@mgdis/mg-components 5.9.1 → 5.10.1
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/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_31.cjs.entry.js +345 -648
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +19 -43
- package/dist/cjs/{mg-menu.conf-9afe6571.js → mg-menu.conf-196151fe.js} +16 -21
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +9 -12
- package/dist/collection/components/atoms/mg-button/mg-button.js +18 -27
- package/dist/collection/components/atoms/mg-card/mg-card.js +22 -15
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +1 -4
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +26 -23
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -4
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +11 -16
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +12 -34
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +4 -1
- package/dist/collection/components/molecules/inputs/MgInput.js +26 -24
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +10 -20
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +7 -17
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +14 -34
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +6 -13
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +10 -27
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -45
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +17 -43
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +14 -22
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +17 -28
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +11 -29
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +20 -47
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -23
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -27
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -4
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +4 -12
- package/dist/collection/components/molecules/mg-message/mg-message.js +12 -20
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -17
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +11 -19
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -30
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +8 -21
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +3 -8
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +20 -36
- package/dist/collection/locales/index.js +2 -3
- package/dist/collection/utils/behaviors.utils.js +16 -32
- package/dist/collection/utils/components.utils.js +22 -33
- package/dist/collection/utils/locale.utils.js +14 -18
- package/dist/collection/utils/unit.test.utils.js +7 -15
- package/dist/components/MgInput.js +30 -24
- package/dist/components/components.utils.js +22 -33
- package/dist/components/index2.js +16 -21
- package/dist/components/mg-action-more.js +9 -21
- package/dist/components/mg-badge2.js +9 -12
- package/dist/components/mg-button2.js +18 -27
- package/dist/components/mg-card2.js +20 -13
- package/dist/components/mg-character-left2.js +1 -4
- package/dist/components/mg-details.js +1 -6
- package/dist/components/mg-divider.js +1 -2
- package/dist/components/mg-form.js +7 -23
- package/dist/components/mg-icon2.js +26 -23
- package/dist/components/mg-illustrated-message.js +1 -4
- package/dist/components/mg-input-checkbox.js +9 -16
- package/dist/components/mg-input-date.js +6 -13
- package/dist/components/mg-input-numeric.js +13 -30
- package/dist/components/mg-input-password.js +5 -9
- package/dist/components/mg-input-radio.js +9 -23
- package/dist/components/mg-input-select2.js +20 -41
- package/dist/components/mg-input-text2.js +15 -35
- package/dist/components/mg-input-textarea.js +13 -18
- package/dist/components/mg-input-title2.js +1 -4
- package/dist/components/mg-input-toggle.js +16 -24
- package/dist/components/mg-item-more.js +18 -42
- package/dist/components/mg-menu-item2.js +17 -44
- package/dist/components/mg-menu2.js +9 -27
- package/dist/components/mg-message.js +12 -20
- package/dist/components/mg-modal.js +8 -17
- package/dist/components/mg-pagination.js +11 -19
- package/dist/components/mg-panel.js +11 -30
- package/dist/components/mg-popover2.js +8 -21
- package/dist/components/mg-skip-links.js +3 -8
- package/dist/components/mg-tabs.js +20 -36
- package/dist/components/mg-tag.js +11 -16
- package/dist/components/mg-tooltip2.js +12 -34
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_31.entry.js +345 -648
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +19 -43
- package/dist/esm/{mg-menu.conf-881fbd82.js → mg-menu.conf-9ca023ee.js} +16 -21
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-67ce7cb8.entry.js → p-97aaca3e.entry.js} +1 -1
- package/dist/mg-components/p-d891e707.entry.js +1 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +2 -5
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +5 -14
- package/dist/types/components/atoms/mg-card/mg-card.d.ts +11 -8
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +1 -4
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +1 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +8 -7
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -4
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +3 -8
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +11 -33
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -1
- package/dist/types/components/molecules/inputs/MgInput.d.ts +5 -6
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +5 -11
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -11
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +7 -26
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +3 -7
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -18
- 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 -22
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +3 -23
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -9
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -11
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +10 -29
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +21 -49
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +3 -15
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -6
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +3 -19
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +1 -4
- package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +2 -12
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +4 -12
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +3 -12
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +5 -14
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +4 -23
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +3 -16
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +2 -7
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +15 -30
- package/dist/types/components.d.ts +22 -34
- package/dist/types/locales/index.d.ts +2 -3
- package/dist/types/utils/behaviors.utils.d.ts +14 -29
- package/dist/types/utils/components.utils.d.ts +19 -29
- package/dist/types/utils/locale.utils.d.ts +14 -18
- package/dist/types/utils/unit.test.utils.d.ts +11 -24
- package/package.json +11 -12
- package/dist/mg-components/p-9a93b7af.entry.js +0 -1
- /package/dist/mg-components/{p-367f92d2.js → p-0d3146d9.js} +0 -0
|
@@ -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
|
/**
|
|
@@ -279,7 +277,6 @@ export namespace Components {
|
|
|
279
277
|
"disabled": boolean;
|
|
280
278
|
/**
|
|
281
279
|
* Public method to display errors
|
|
282
|
-
* @returns
|
|
283
280
|
*/
|
|
284
281
|
"displayError": () => Promise<void>;
|
|
285
282
|
/**
|
|
@@ -354,7 +351,6 @@ export namespace Components {
|
|
|
354
351
|
"disabled": boolean;
|
|
355
352
|
/**
|
|
356
353
|
* Public method to display errors
|
|
357
|
-
* @returns
|
|
358
354
|
*/
|
|
359
355
|
"displayError": () => Promise<void>;
|
|
360
356
|
/**
|
|
@@ -437,7 +433,6 @@ export namespace Components {
|
|
|
437
433
|
"disabled": boolean;
|
|
438
434
|
/**
|
|
439
435
|
* Public method to display errors
|
|
440
|
-
* @returns
|
|
441
436
|
*/
|
|
442
437
|
"displayError": () => Promise<void>;
|
|
443
438
|
/**
|
|
@@ -504,7 +499,6 @@ export namespace Components {
|
|
|
504
499
|
"disabled": boolean;
|
|
505
500
|
/**
|
|
506
501
|
* Public method to display errors
|
|
507
|
-
* @returns
|
|
508
502
|
*/
|
|
509
503
|
"displayError": () => Promise<void>;
|
|
510
504
|
/**
|
|
@@ -571,7 +565,6 @@ export namespace Components {
|
|
|
571
565
|
"disabled": boolean;
|
|
572
566
|
/**
|
|
573
567
|
* Public method to display errors
|
|
574
|
-
* @returns
|
|
575
568
|
*/
|
|
576
569
|
"displayError": () => Promise<void>;
|
|
577
570
|
/**
|
|
@@ -654,7 +647,6 @@ export namespace Components {
|
|
|
654
647
|
"displayCharacterLeft": boolean;
|
|
655
648
|
/**
|
|
656
649
|
* Public method to display errors
|
|
657
|
-
* @returns
|
|
658
650
|
*/
|
|
659
651
|
"displayError": () => Promise<void>;
|
|
660
652
|
/**
|
|
@@ -719,7 +711,6 @@ export namespace Components {
|
|
|
719
711
|
"required": boolean;
|
|
720
712
|
/**
|
|
721
713
|
* Public method to play input focus
|
|
722
|
-
* @returns
|
|
723
714
|
*/
|
|
724
715
|
"setFocus": () => Promise<void>;
|
|
725
716
|
/**
|
|
@@ -750,7 +741,6 @@ export namespace Components {
|
|
|
750
741
|
"displayCharacterLeft": boolean;
|
|
751
742
|
/**
|
|
752
743
|
* Public method to display errors
|
|
753
|
-
* @returns
|
|
754
744
|
*/
|
|
755
745
|
"displayError": () => Promise<void>;
|
|
756
746
|
/**
|
|
@@ -867,7 +857,6 @@ export namespace Components {
|
|
|
867
857
|
"isOnOff": boolean;
|
|
868
858
|
/**
|
|
869
859
|
* Items are the possible options to select
|
|
870
|
-
* @returns
|
|
871
860
|
*/
|
|
872
861
|
"items": string[] | ToggleValue[];
|
|
873
862
|
/**
|
|
@@ -901,7 +890,7 @@ export namespace Components {
|
|
|
901
890
|
}
|
|
902
891
|
interface MgItemMore {
|
|
903
892
|
/**
|
|
904
|
-
* Define icon
|
|
893
|
+
* Define icon
|
|
905
894
|
*/
|
|
906
895
|
"icon": IconType;
|
|
907
896
|
/**
|
|
@@ -909,13 +898,13 @@ export namespace Components {
|
|
|
909
898
|
*/
|
|
910
899
|
"size": SizeType;
|
|
911
900
|
/**
|
|
912
|
-
* Define slot label element
|
|
901
|
+
* Define slot label element
|
|
913
902
|
*/
|
|
914
903
|
"slotlabel": SlotLabelType;
|
|
915
904
|
}
|
|
916
905
|
interface MgMenu {
|
|
917
906
|
/**
|
|
918
|
-
* Component display direction.
|
|
907
|
+
* Component display direction.
|
|
919
908
|
*/
|
|
920
909
|
"direction": Direction;
|
|
921
910
|
/**
|
|
@@ -927,13 +916,13 @@ export namespace Components {
|
|
|
927
916
|
*/
|
|
928
917
|
"label": string;
|
|
929
918
|
/**
|
|
930
|
-
* Define mg-menu size
|
|
919
|
+
* Define mg-menu size
|
|
931
920
|
*/
|
|
932
921
|
"size": MenuSizeType;
|
|
933
922
|
}
|
|
934
923
|
interface MgMenuItem {
|
|
935
924
|
/**
|
|
936
|
-
* Define menu-item content expanded.
|
|
925
|
+
* Define menu-item content expanded.
|
|
937
926
|
*/
|
|
938
927
|
"expanded": boolean;
|
|
939
928
|
/**
|
|
@@ -941,11 +930,11 @@ export namespace Components {
|
|
|
941
930
|
*/
|
|
942
931
|
"href": string;
|
|
943
932
|
/**
|
|
944
|
-
* Identifier is used to control mg-popover
|
|
933
|
+
* Identifier is used to control mg-popover
|
|
945
934
|
*/
|
|
946
935
|
"identifier": string;
|
|
947
936
|
/**
|
|
948
|
-
* Define menu-item status.
|
|
937
|
+
* Define menu-item status.
|
|
949
938
|
*/
|
|
950
939
|
"status": Status;
|
|
951
940
|
}
|
|
@@ -1443,7 +1432,7 @@ declare global {
|
|
|
1443
1432
|
declare namespace LocalJSX {
|
|
1444
1433
|
interface MgActionMore {
|
|
1445
1434
|
/**
|
|
1446
|
-
* Define button properties
|
|
1435
|
+
* Define button properties
|
|
1447
1436
|
*/
|
|
1448
1437
|
"button"?: MgActionMoreButtonType;
|
|
1449
1438
|
/**
|
|
@@ -1451,7 +1440,7 @@ declare namespace LocalJSX {
|
|
|
1451
1440
|
*/
|
|
1452
1441
|
"displayChevron"?: boolean;
|
|
1453
1442
|
/**
|
|
1454
|
-
* Define displaied icon
|
|
1443
|
+
* Define displaied icon
|
|
1455
1444
|
*/
|
|
1456
1445
|
"icon"?: MgActionMoreIconType;
|
|
1457
1446
|
/**
|
|
@@ -1521,11 +1510,11 @@ declare namespace LocalJSX {
|
|
|
1521
1510
|
}
|
|
1522
1511
|
interface MgCard {
|
|
1523
1512
|
/**
|
|
1524
|
-
* Define variant prop
|
|
1513
|
+
* Define variant prop
|
|
1525
1514
|
*/
|
|
1526
1515
|
"variant"?: undefined | VariantType1;
|
|
1527
1516
|
/**
|
|
1528
|
-
* Define variantStyle prop
|
|
1517
|
+
* Define variantStyle prop
|
|
1529
1518
|
*/
|
|
1530
1519
|
"variantStyle"?: undefined | VariantStyleType;
|
|
1531
1520
|
}
|
|
@@ -2314,7 +2303,6 @@ declare namespace LocalJSX {
|
|
|
2314
2303
|
"isOnOff"?: boolean;
|
|
2315
2304
|
/**
|
|
2316
2305
|
* Items are the possible options to select
|
|
2317
|
-
* @returns
|
|
2318
2306
|
*/
|
|
2319
2307
|
"items": string[] | ToggleValue[];
|
|
2320
2308
|
/**
|
|
@@ -2356,7 +2344,7 @@ declare namespace LocalJSX {
|
|
|
2356
2344
|
}
|
|
2357
2345
|
interface MgItemMore {
|
|
2358
2346
|
/**
|
|
2359
|
-
* Define icon
|
|
2347
|
+
* Define icon
|
|
2360
2348
|
*/
|
|
2361
2349
|
"icon"?: IconType;
|
|
2362
2350
|
/**
|
|
@@ -2364,13 +2352,13 @@ declare namespace LocalJSX {
|
|
|
2364
2352
|
*/
|
|
2365
2353
|
"size"?: SizeType;
|
|
2366
2354
|
/**
|
|
2367
|
-
* Define slot label element
|
|
2355
|
+
* Define slot label element
|
|
2368
2356
|
*/
|
|
2369
2357
|
"slotlabel"?: SlotLabelType;
|
|
2370
2358
|
}
|
|
2371
2359
|
interface MgMenu {
|
|
2372
2360
|
/**
|
|
2373
|
-
* Component display direction.
|
|
2361
|
+
* Component display direction.
|
|
2374
2362
|
*/
|
|
2375
2363
|
"direction"?: Direction;
|
|
2376
2364
|
/**
|
|
@@ -2382,13 +2370,13 @@ declare namespace LocalJSX {
|
|
|
2382
2370
|
*/
|
|
2383
2371
|
"label": string;
|
|
2384
2372
|
/**
|
|
2385
|
-
* Define mg-menu size
|
|
2373
|
+
* Define mg-menu size
|
|
2386
2374
|
*/
|
|
2387
2375
|
"size"?: MenuSizeType;
|
|
2388
2376
|
}
|
|
2389
2377
|
interface MgMenuItem {
|
|
2390
2378
|
/**
|
|
2391
|
-
* Define menu-item content expanded.
|
|
2379
|
+
* Define menu-item content expanded.
|
|
2392
2380
|
*/
|
|
2393
2381
|
"expanded"?: boolean;
|
|
2394
2382
|
/**
|
|
@@ -2396,7 +2384,7 @@ declare namespace LocalJSX {
|
|
|
2396
2384
|
*/
|
|
2397
2385
|
"href"?: string;
|
|
2398
2386
|
/**
|
|
2399
|
-
* Identifier is used to control mg-popover
|
|
2387
|
+
* Identifier is used to control mg-popover
|
|
2400
2388
|
*/
|
|
2401
2389
|
"identifier"?: string;
|
|
2402
2390
|
/**
|
|
@@ -2408,7 +2396,7 @@ declare namespace LocalJSX {
|
|
|
2408
2396
|
*/
|
|
2409
2397
|
"onStatus-change"?: (event: MgMenuItemCustomEvent<MgMenuItem['status']>) => void;
|
|
2410
2398
|
/**
|
|
2411
|
-
* Define menu-item status.
|
|
2399
|
+
* Define menu-item status.
|
|
2412
2400
|
*/
|
|
2413
2401
|
"status"?: Status;
|
|
2414
2402
|
}
|
|
@@ -126,9 +126,8 @@ declare const messages: {
|
|
|
126
126
|
};
|
|
127
127
|
/**
|
|
128
128
|
* Get Intl object
|
|
129
|
-
*
|
|
130
|
-
* @
|
|
131
|
-
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
129
|
+
* @param element - element we need to get the language
|
|
130
|
+
* @returns messages object
|
|
132
131
|
*/
|
|
133
132
|
export declare const initLocales: (element: HTMLElement) => {
|
|
134
133
|
locale: string;
|
|
@@ -15,8 +15,6 @@ export declare class OverflowBehavior {
|
|
|
15
15
|
**********/
|
|
16
16
|
/**
|
|
17
17
|
* Disconnect ResizeObserver
|
|
18
|
-
*
|
|
19
|
-
* @returns {void}
|
|
20
18
|
*/
|
|
21
19
|
disconnect: () => void;
|
|
22
20
|
/************
|
|
@@ -24,61 +22,48 @@ export declare class OverflowBehavior {
|
|
|
24
22
|
************/
|
|
25
23
|
/**
|
|
26
24
|
* run overflow behavior
|
|
27
|
-
*
|
|
28
|
-
* @param {number} width width of the container. Optional.
|
|
29
|
-
* @returns {void}
|
|
25
|
+
* @param width - width of the container. Optional.
|
|
30
26
|
*/
|
|
31
27
|
private run;
|
|
32
28
|
/**
|
|
33
29
|
* Get interactive children filtred by authorized nodeName ['MG-MENU-ITEM', 'MG-BUTTON']
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
36
|
-
* @returns {Element[]} children
|
|
30
|
+
* @param element - element to parse
|
|
31
|
+
* @returns children
|
|
37
32
|
*/
|
|
38
33
|
private getInteractiveItems;
|
|
39
34
|
/**
|
|
40
35
|
* Update displayed items in container from a given available space
|
|
41
|
-
*
|
|
42
|
-
* @param {number} availableWidth available width in container to display child items
|
|
43
|
-
* @returns {void}
|
|
36
|
+
* @param availableWidth - available width in container to display child items
|
|
44
37
|
*/
|
|
45
38
|
private updateDisplayedItems;
|
|
46
39
|
/**
|
|
47
40
|
* Utility method to know if item overflow partialy or totaly in the container
|
|
48
|
-
*
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @
|
|
52
|
-
* @returns {boolean} truthy if element is overflow
|
|
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
|
|
53
45
|
*/
|
|
54
46
|
private isOverflowElement;
|
|
55
47
|
/**
|
|
56
48
|
* Utility method to know if a given element is the 'MORE' element
|
|
57
|
-
*
|
|
58
|
-
* @
|
|
59
|
-
* @returns {boolean} truthy if element is the 'MORE' element
|
|
49
|
+
* @param element - element to match with 'MORE' element
|
|
50
|
+
* @returns truthy if element is the 'MORE' element
|
|
60
51
|
*/
|
|
61
52
|
private isMoreElement;
|
|
62
53
|
/**
|
|
63
54
|
* Toggle display item element
|
|
64
|
-
*
|
|
65
|
-
* @param
|
|
66
|
-
* @param {boolean} isHidden is item hidden
|
|
67
|
-
* @returns {void}
|
|
55
|
+
* @param item - item to control
|
|
56
|
+
* @param isHidden - is item hidden
|
|
68
57
|
*/
|
|
69
58
|
private toggleItem;
|
|
70
59
|
/**
|
|
71
60
|
* Toggle element's hidde attribute
|
|
72
|
-
*
|
|
73
|
-
* @param
|
|
74
|
-
* @param {boolean} isHidden element is hidden
|
|
75
|
-
* @returns {void}
|
|
61
|
+
* @param element - element to toggle
|
|
62
|
+
* @param isHidden - element is hidden
|
|
76
63
|
*/
|
|
77
64
|
private toggleElement;
|
|
78
65
|
/**
|
|
79
66
|
* Remove hidden attributes on all items
|
|
80
|
-
*
|
|
81
|
-
* @returns {void}
|
|
82
67
|
*/
|
|
83
68
|
private restoreItems;
|
|
84
69
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create random ID
|
|
3
|
-
*
|
|
4
|
-
* @param
|
|
5
|
-
* @
|
|
6
|
-
* @returns {string} ID
|
|
3
|
+
* @param prefix - add prefix to created ID
|
|
4
|
+
* @param length - ID length
|
|
5
|
+
* @returns ID
|
|
7
6
|
*/
|
|
8
7
|
export declare const createID: (prefix?: string, length?: number) => string;
|
|
9
8
|
/**
|
|
@@ -15,45 +14,37 @@ export declare class ClassList {
|
|
|
15
14
|
constructor(classlist?: string[]);
|
|
16
15
|
/**
|
|
17
16
|
* Add class
|
|
18
|
-
*
|
|
19
|
-
* @param {string} className class name to add
|
|
20
|
-
* @returns {void}
|
|
17
|
+
* @param className - class name to add
|
|
21
18
|
*/
|
|
22
19
|
add: (className: string) => void;
|
|
23
20
|
/**
|
|
24
21
|
* Delete class
|
|
25
|
-
*
|
|
26
|
-
* @param {string} className class name to delete
|
|
27
|
-
* @returns {void}
|
|
22
|
+
* @param className - class name to delete
|
|
28
23
|
*/
|
|
29
24
|
delete: (className: string) => void;
|
|
30
25
|
/**
|
|
31
26
|
* Check if class exist in list
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
* @returns {boolean} class name is in the list
|
|
27
|
+
* @param className - class name to check
|
|
28
|
+
* @returns class name is in the list
|
|
35
29
|
*/
|
|
36
30
|
has: (className: string) => boolean;
|
|
37
31
|
/**
|
|
38
32
|
* Join classes seperated by spaces
|
|
39
|
-
*
|
|
40
|
-
* @returns {string} joined values
|
|
33
|
+
* @returns joined values
|
|
41
34
|
*/
|
|
42
35
|
join: () => string;
|
|
43
36
|
}
|
|
44
37
|
/**
|
|
45
38
|
* Check if all items are string
|
|
46
|
-
*
|
|
47
|
-
* @
|
|
48
|
-
* @returns {boolean} all items are string
|
|
39
|
+
* @param items - items to check
|
|
40
|
+
* @returns all items are string
|
|
49
41
|
*/
|
|
50
42
|
export declare const allItemsAreString: (items: unknown) => items is string[];
|
|
51
43
|
/**
|
|
52
44
|
* Check if element is a heading
|
|
53
|
-
*
|
|
54
|
-
* @param
|
|
55
|
-
* @
|
|
56
|
-
* @returns {boolean} element is a heading
|
|
45
|
+
* @param element - slotted element
|
|
46
|
+
* @param tagNames - allowed tag names list
|
|
47
|
+
* @returns element is a heading
|
|
57
48
|
*/
|
|
58
49
|
export declare const isTagName: (element: Element, tagNames: string[]) => boolean;
|
|
59
50
|
/**
|
|
@@ -61,16 +52,15 @@ export declare const isTagName: (element: Element, tagNames: string[]) => boolea
|
|
|
61
52
|
*/
|
|
62
53
|
export declare const focusableElements = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier]";
|
|
63
54
|
/**
|
|
64
|
-
*
|
|
65
|
-
* @param
|
|
66
|
-
* @returns
|
|
55
|
+
* Get windows
|
|
56
|
+
* @param localWindow - the window we are lookink for other windows
|
|
57
|
+
* @returns The list of windows found
|
|
67
58
|
*/
|
|
68
59
|
export declare const getWindows: (localWindow: Window) => Window[];
|
|
69
60
|
/**
|
|
70
61
|
* Get parent windows
|
|
71
|
-
*
|
|
72
|
-
* @param
|
|
73
|
-
* @
|
|
74
|
-
* @returns {Window[]} The list of windows found
|
|
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
|
|
75
65
|
*/
|
|
76
66
|
export declare const getParentWindows: (localWindow: Window, windows?: Window[]) => Window[];
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Format number to the locale currency
|
|
3
|
-
*
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @
|
|
7
|
-
* @returns {string} formatted currency
|
|
3
|
+
* @param number - number to format
|
|
4
|
+
* @param locale - locale to apply
|
|
5
|
+
* @param currency - currency to apply
|
|
6
|
+
* @returns formatted currency
|
|
8
7
|
*/
|
|
9
8
|
export declare const localeCurrency: (number: number, locale: string, currency: string) => string;
|
|
10
9
|
/**
|
|
11
10
|
* Format number to locale
|
|
12
|
-
*
|
|
13
|
-
* @param
|
|
14
|
-
* @
|
|
15
|
-
* @returns {string} formatted number
|
|
11
|
+
* @param number - number to format
|
|
12
|
+
* @param locale - locale to apply
|
|
13
|
+
* @returns formatted number
|
|
16
14
|
*/
|
|
17
15
|
export declare const localeNumber: (number: number, locale: string) => string;
|
|
18
16
|
/**
|
|
@@ -21,20 +19,18 @@ export declare const localeNumber: (number: number, locale: string) => string;
|
|
|
21
19
|
export declare const dateRegExp: RegExp;
|
|
22
20
|
/**
|
|
23
21
|
* Locale date format
|
|
24
|
-
*
|
|
25
|
-
* @param
|
|
26
|
-
* @
|
|
27
|
-
* @returns {string} formatted date
|
|
22
|
+
* @param date - date to format
|
|
23
|
+
* @param locale - locale to apply
|
|
24
|
+
* @returns formatted date
|
|
28
25
|
*/
|
|
29
26
|
export declare const localeDate: (date: string, locale: string) => string;
|
|
30
27
|
/**
|
|
31
28
|
* Get locale and messages
|
|
32
29
|
* We load the defined locale but for now we only support the first subtag for messages
|
|
33
|
-
*
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
36
|
-
* @
|
|
37
|
-
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
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
|
|
38
34
|
*/
|
|
39
35
|
export declare const getLocaleMessages: (element: HTMLElement, messages: unknown, defaultLocale: string) => {
|
|
40
36
|
locale: string;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { MockCustomEvent } from '@stencil/core/mock-doc';
|
|
2
2
|
/**
|
|
3
3
|
* Clone Deep function
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
* @returns {unknown} cloned json
|
|
4
|
+
* @param obj - object to clone
|
|
5
|
+
* @returns cloned json
|
|
7
6
|
*/
|
|
8
7
|
export declare const cloneDeep: (obj: unknown) => unknown;
|
|
9
8
|
/**
|
|
10
9
|
* Utility function that mocks the `MutationObserver` API. Recommended to execute inside `beforeEach`.
|
|
11
|
-
*
|
|
12
10
|
* @param mutationObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
13
11
|
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
14
12
|
* mock the mutation observer, but its methods.
|
|
15
13
|
* You can manually fire an intersection entry:
|
|
16
|
-
* @param
|
|
17
|
-
* @
|
|
18
|
-
* @param {Function} mutationObserverMock.takeRecords takeRecords function
|
|
19
|
-
* @returns {MutationObserver} Mocked MutationObserver
|
|
14
|
+
* @param mutationObserverMock - configuration object
|
|
15
|
+
* @returns Mocked MutationObserver
|
|
20
16
|
* @example
|
|
21
17
|
* ```
|
|
22
18
|
* let fireMo;
|
|
@@ -37,14 +33,12 @@ type SetupMutationObserverMockParams = {
|
|
|
37
33
|
export declare const setupMutationObserverMock: ({ disconnect, observe, takeRecords }: SetupMutationObserverMockParams) => typeof MutationObserver;
|
|
38
34
|
/**
|
|
39
35
|
* Utility function that mocks the `ResizeObserver` API. Recommended to execute inside `beforeEach`.
|
|
40
|
-
*
|
|
41
36
|
* @param resizeObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
42
37
|
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
43
38
|
* mock the resize observer, but its methods.
|
|
44
39
|
* You can manually fire an intersection entry:
|
|
45
|
-
* @param
|
|
46
|
-
* @
|
|
47
|
-
* @returns {ResizeObserver} Mocked ResizeObserver
|
|
40
|
+
* @param resizeObserverMock - configuration object
|
|
41
|
+
* @returns Mocked ResizeObserver
|
|
48
42
|
* @example
|
|
49
43
|
* ```
|
|
50
44
|
* let fireRo;
|
|
@@ -70,38 +64,31 @@ type setupResizeObserverMockParams = {
|
|
|
70
64
|
export declare const setupResizeObserverMock: ({ disconnect, observe }: setupResizeObserverMockParams) => typeof ResizeObserver;
|
|
71
65
|
/**
|
|
72
66
|
* Utility function that mocks the `SubmitEvent` API. Recommended to execute inside `beforeEach`.
|
|
73
|
-
*
|
|
74
|
-
* @returns {void}
|
|
75
67
|
* @example
|
|
76
68
|
* ```
|
|
77
69
|
* setupSubmitEventMock();
|
|
78
70
|
* ```
|
|
71
|
+
* @returns custom event mock
|
|
79
72
|
*/
|
|
80
73
|
export declare const setupSubmitEventMock: () => typeof MockCustomEvent;
|
|
81
74
|
/**
|
|
82
75
|
* force popover id when component use randomed identifier
|
|
83
|
-
*
|
|
84
|
-
* @param
|
|
85
|
-
* @param
|
|
86
|
-
* @param {string} interactiveElement element where attribute 'aria-controls' is set
|
|
87
|
-
* @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
|
|
88
79
|
*/
|
|
89
80
|
export declare const forcePopoverId: (component: Element, id: string, interactiveElement?: string) => void;
|
|
90
81
|
/**
|
|
91
82
|
* fix popper console.error in test
|
|
92
|
-
* it is generated in
|
|
83
|
+
* it is generated in `@popperjs/core/dist/cjs/popper.js l.1859`
|
|
93
84
|
* this is due to internal function isHTMLElement(), so we can not mock it directly.
|
|
94
85
|
* this function check if test DOM element mockHTMLElement instance is 'instanceof HTMLElement'
|
|
95
86
|
* so we only override the console.error side effect for this error
|
|
96
|
-
*
|
|
97
|
-
* @returns {void}
|
|
98
87
|
*/
|
|
99
88
|
export declare const mockConsoleError: () => void;
|
|
100
89
|
/**
|
|
101
90
|
* Add missing window.frames property to test context
|
|
102
91
|
* usefull for component with iframe listeners, ex: mg-popover
|
|
103
|
-
*
|
|
104
|
-
* @returns {void}
|
|
105
92
|
*/
|
|
106
93
|
export declare const mockWindowFrames: () => void;
|
|
107
94
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/mg-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.1",
|
|
4
4
|
"description": "MG Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
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.0",
|
|
33
34
|
"@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
|
|
34
|
-
"@stencil/eslint-plugin": "^0.4.0",
|
|
35
35
|
"@stencil/sass": "^1.5.2",
|
|
36
36
|
"@storybook/addon-a11y": "^6.5.16",
|
|
37
37
|
"@storybook/addon-actions": "^6.5.16",
|
|
@@ -43,31 +43,29 @@
|
|
|
43
43
|
"@types/jest": "npm:@types/jest@^26",
|
|
44
44
|
"@types/jest-image-snapshot": "^4.3.2",
|
|
45
45
|
"@types/node": "^18.14.0",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
47
|
-
"@typescript-eslint/parser": "^4.33.0",
|
|
48
46
|
"babel-loader": "^8.3.0",
|
|
49
47
|
"babel-plugin-jsx-pragmatic": "^1.0.2",
|
|
50
48
|
"chromatic": "^6.15.0",
|
|
51
49
|
"css-loader": "^5.2.7",
|
|
52
|
-
"eslint": "^
|
|
53
|
-
"eslint-plugin-
|
|
54
|
-
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
55
|
-
"eslint-plugin-react": "^7.32.2",
|
|
56
|
-
"eslint-plugin-storybook": "^0.6.10",
|
|
50
|
+
"eslint": "^8.39.0",
|
|
51
|
+
"eslint-plugin-storybook": "^0.6.11",
|
|
57
52
|
"jest": "npm:jest@^26",
|
|
58
53
|
"jest-cli": "npm:jest-cli@^26",
|
|
59
54
|
"jest-image-snapshot": "^4.5.1",
|
|
60
55
|
"jest-junit": "^15.0.0",
|
|
61
56
|
"jsx-dom": "^8.0.4",
|
|
62
57
|
"npm-run-all": "^4.1.5",
|
|
58
|
+
"playwright-config": "^1.0.0",
|
|
63
59
|
"prettier": "^2.8.4",
|
|
64
60
|
"puppeteer": "^13.7.0",
|
|
65
61
|
"sass": "^1.58.0",
|
|
66
62
|
"sass-loader": "^10.4.1",
|
|
67
63
|
"style-loader": "^2.0.0",
|
|
68
64
|
"ts-node": "^10.9.1",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
65
|
+
"typescript": "^4.9.5",
|
|
66
|
+
"@mgdis/linting-stencil": "1.0.0",
|
|
67
|
+
"eslint-config-stencil": "1.0.0",
|
|
68
|
+
"tsconfig": "1.0.0"
|
|
71
69
|
},
|
|
72
70
|
"license": "BSD-3-Clause",
|
|
73
71
|
"scripts": {
|
|
@@ -82,10 +80,11 @@
|
|
|
82
80
|
"test": "TZ=UTC stencil test --spec --e2e",
|
|
83
81
|
"test:unit": "TZ=UTC stencil test --spec --collectCoverage",
|
|
84
82
|
"test:e2e": "stencil test --e2e",
|
|
83
|
+
"test:e2e:playwright": "pnpm dlx playwright test",
|
|
85
84
|
"test:watch": "stencil test --spec --e2e --watchAll",
|
|
86
85
|
"generate": "stencil generate",
|
|
87
86
|
"storybook": "NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6006",
|
|
88
87
|
"storybook:build": "NODE_OPTIONS=--openssl-legacy-provider build-storybook",
|
|
89
|
-
"coverage": "TZ=UTC stencil test --spec --collectCoverage --reporters=\"default\" --reporters=\"jest-junit\""
|
|
88
|
+
"coverage": "TZ=UTC stencil test --spec --no-build --collectCoverage --reporters=\"default\" --reporters=\"jest-junit\""
|
|
90
89
|
}
|
|
91
90
|
}
|