@mgdis/mg-components 6.15.0 → 6.17.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/events.utils-D5SAtkpQ.js +25 -0
- package/dist/cjs/{index-BGxkpQwi.js → index-DCZEYvlH.js} +48 -29
- package/dist/cjs/{index-iUZvsp-F.js → index-TUElr4Wv.js} +18 -30
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +100 -365
- package/dist/cjs/mg-alert.cjs.entry.js +2 -2
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-input-combobox.cjs.entry.js +78 -140
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +4 -4
- package/dist/cjs/{mg-input.conf-CwjEAih3.js → mg-input.conf-WTsvDfpC.js} +0 -7
- package/dist/cjs/mg-loader.cjs.entry.js +2 -2
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +5 -5
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +7 -7
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +6 -6
- package/dist/collection/components/atoms/mg-button/mg-button.js +13 -13
- package/dist/collection/components/atoms/mg-card/mg-card.js +2 -2
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +32 -26
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +2 -2
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +6 -6
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +37 -108
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +6 -8
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +42 -99
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +82 -167
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +27 -44
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +40 -55
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +26 -26
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +32 -86
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +26 -27
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +33 -82
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +33 -34
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +32 -32
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +27 -161
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +2 -4
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +4 -5
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +7 -7
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -4
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +4 -4
- package/dist/collection/components/molecules/mg-details/mg-details.js +6 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js +13 -13
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +2 -2
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +3 -3
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +6 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +7 -8
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +13 -13
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +6 -6
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +6 -6
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +0 -1
- package/dist/collection/components/molecules/mg-table/mg-table.js +2 -3
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +6 -7
- package/dist/collection/locales/en/messages.json +8 -13
- package/dist/collection/locales/fr/messages.json +8 -13
- package/dist/components/index2.js +1 -1
- package/dist/components/index3.js +18 -30
- package/dist/components/mg-action-more.js +4 -2
- package/dist/components/mg-alert.js +4 -2
- package/dist/components/mg-badge2.js +4 -2
- package/dist/components/mg-button2.js +4 -2
- package/dist/components/mg-card2.js +4 -2
- package/dist/components/mg-character-left2.js +4 -2
- package/dist/components/mg-details.js +99 -1
- package/dist/components/mg-divider2.js +4 -2
- package/dist/components/mg-form.js +4 -2
- package/dist/components/mg-icon2.js +29 -21
- package/dist/components/mg-illustrated-message.js +4 -2
- package/dist/components/mg-input-checkbox-paginated2.js +6 -7
- package/dist/components/mg-input-checkbox.js +23 -65
- package/dist/components/mg-input-combobox.js +64 -132
- package/dist/components/mg-input-date.js +8 -29
- package/dist/components/mg-input-numeric.js +8 -27
- package/dist/components/mg-input-password.js +6 -10
- package/dist/components/mg-input-radio.js +16 -55
- package/dist/components/mg-input-rich-text-editor.js +6 -10
- package/dist/components/mg-input-select2.js +12 -46
- package/dist/components/mg-input-text2.js +6 -10
- package/dist/components/mg-input-textarea.js +6 -10
- package/dist/components/mg-input-title2.js +4 -2
- package/dist/components/mg-input-toggle.js +15 -98
- package/dist/components/mg-input2.js +26 -101
- package/dist/components/mg-item-more2.js +8 -4
- package/dist/components/mg-loader2.js +4 -2
- package/dist/components/mg-menu-item2.js +4 -2
- package/dist/components/mg-message2.js +4 -2
- package/dist/components/mg-modal.js +4 -2
- package/dist/components/mg-pagination.js +6 -10
- package/dist/components/mg-panel.js +11 -15
- package/dist/components/mg-popover-content2.js +4 -2
- package/dist/components/mg-popover2.js +4 -2
- package/dist/components/mg-progress.js +4 -2
- package/dist/components/mg-skip-links.js +4 -2
- package/dist/components/mg-table.js +4 -2
- package/dist/components/mg-tabs2.js +4 -2
- package/dist/components/mg-tag.js +4 -2
- package/dist/components/mg-tooltip-content2.js +4 -2
- package/dist/components/mg-tooltip2.js +4 -2
- package/dist/esm/events.utils-yMGqY8YG.js +23 -0
- package/dist/esm/{index-CKB-AnCZ.js → index-CNX6lq0x.js} +18 -30
- package/dist/esm/{index-DhAOnZJn.js → index-T6kOJXP1.js} +48 -29
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +96 -361
- package/dist/esm/mg-alert.entry.js +2 -2
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-input-combobox.entry.js +59 -121
- package/dist/esm/mg-input-rich-text-editor.entry.js +4 -4
- package/dist/esm/{mg-input.conf-BAUTlb6r.js → mg-input.conf-CNgv8hc5.js} +1 -7
- package/dist/esm/mg-loader.entry.js +2 -2
- package/dist/esm/mg-progress.entry.js +1 -1
- package/dist/mg-components/locales/en/messages.json +8 -13
- package/dist/mg-components/locales/fr/messages.json +8 -13
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-47e19783.entry.js → p-0e6b40d6.entry.js} +1 -1
- package/dist/mg-components/{p-67af6274.entry.js → p-397bf67b.entry.js} +1 -1
- package/dist/mg-components/{p-a0fa44cf.entry.js → p-5dc3a1fb.entry.js} +1 -1
- package/dist/mg-components/p-8a69175b.entry.js +1 -0
- package/dist/mg-components/p-CNX6lq0x.js +1 -0
- package/dist/mg-components/p-CNgv8hc5.js +1 -0
- package/dist/mg-components/p-T6kOJXP1.js +2 -0
- package/dist/mg-components/{p-420daa1e.entry.js → p-c5da335e.entry.js} +1 -1
- package/dist/mg-components/p-d84d87ea.entry.js +1 -0
- package/dist/mg-components/p-yMGqY8YG.js +1 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +1 -1
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +0 -13
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +4 -15
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +3 -21
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +2 -16
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +4 -40
- package/dist/types/components.d.ts +7 -63
- package/dist/types/stencil-public-runtime.d.ts +39 -2
- package/dist/types/types/index.d.ts +1 -1
- package/ide/intellij/web-types.json +23 -304
- package/ide/vscode/html-custom-data.json +18 -113
- package/package.json +22 -22
- package/dist/cjs/mg-input.utils-D-ASK4ua.js +0 -49
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.utils.js +0 -21
- package/dist/components/mg-details2.js +0 -99
- package/dist/components/mg-input.utils.js +0 -24
- package/dist/esm/mg-input.utils-BYI03zSi.js +0 -46
- package/dist/mg-components/p-31856cff.entry.js +0 -1
- package/dist/mg-components/p-698dfc6c.entry.js +0 -1
- package/dist/mg-components/p-BAUTlb6r.js +0 -1
- package/dist/mg-components/p-CKB-AnCZ.js +0 -1
- package/dist/mg-components/p-DhAOnZJn.js +0 -2
- package/dist/mg-components/p-PuX-pdL4.js +0 -1
- package/dist/types/components/molecules/inputs/mg-input/mg-input.utils.d.ts +0 -8
|
@@ -328,7 +328,6 @@ export class MgInputRichTextEditor {
|
|
|
328
328
|
return {
|
|
329
329
|
"value": {
|
|
330
330
|
"type": "string",
|
|
331
|
-
"attribute": "value",
|
|
332
331
|
"mutable": true,
|
|
333
332
|
"complexType": {
|
|
334
333
|
"original": "string",
|
|
@@ -344,11 +343,11 @@ export class MgInputRichTextEditor {
|
|
|
344
343
|
"getter": false,
|
|
345
344
|
"setter": false,
|
|
346
345
|
"reflect": false,
|
|
346
|
+
"attribute": "value",
|
|
347
347
|
"defaultValue": "''"
|
|
348
348
|
},
|
|
349
349
|
"identifier": {
|
|
350
350
|
"type": "string",
|
|
351
|
-
"attribute": "identifier",
|
|
352
351
|
"mutable": false,
|
|
353
352
|
"complexType": {
|
|
354
353
|
"original": "string",
|
|
@@ -363,11 +362,11 @@ export class MgInputRichTextEditor {
|
|
|
363
362
|
},
|
|
364
363
|
"getter": false,
|
|
365
364
|
"setter": false,
|
|
366
|
-
"reflect": false
|
|
365
|
+
"reflect": false,
|
|
366
|
+
"attribute": "identifier"
|
|
367
367
|
},
|
|
368
368
|
"label": {
|
|
369
369
|
"type": "string",
|
|
370
|
-
"attribute": "label",
|
|
371
370
|
"mutable": false,
|
|
372
371
|
"complexType": {
|
|
373
372
|
"original": "string",
|
|
@@ -382,11 +381,11 @@ export class MgInputRichTextEditor {
|
|
|
382
381
|
},
|
|
383
382
|
"getter": false,
|
|
384
383
|
"setter": false,
|
|
385
|
-
"reflect": false
|
|
384
|
+
"reflect": false,
|
|
385
|
+
"attribute": "label"
|
|
386
386
|
},
|
|
387
387
|
"labelOnTop": {
|
|
388
388
|
"type": "boolean",
|
|
389
|
-
"attribute": "label-on-top",
|
|
390
389
|
"mutable": false,
|
|
391
390
|
"complexType": {
|
|
392
391
|
"original": "boolean",
|
|
@@ -402,11 +401,11 @@ export class MgInputRichTextEditor {
|
|
|
402
401
|
"getter": false,
|
|
403
402
|
"setter": false,
|
|
404
403
|
"reflect": false,
|
|
404
|
+
"attribute": "label-on-top",
|
|
405
405
|
"defaultValue": "false"
|
|
406
406
|
},
|
|
407
407
|
"labelHide": {
|
|
408
408
|
"type": "boolean",
|
|
409
|
-
"attribute": "label-hide",
|
|
410
409
|
"mutable": false,
|
|
411
410
|
"complexType": {
|
|
412
411
|
"original": "boolean",
|
|
@@ -422,11 +421,11 @@ export class MgInputRichTextEditor {
|
|
|
422
421
|
"getter": false,
|
|
423
422
|
"setter": false,
|
|
424
423
|
"reflect": false,
|
|
424
|
+
"attribute": "label-hide",
|
|
425
425
|
"defaultValue": "false"
|
|
426
426
|
},
|
|
427
427
|
"placeholder": {
|
|
428
428
|
"type": "string",
|
|
429
|
-
"attribute": "placeholder",
|
|
430
429
|
"mutable": false,
|
|
431
430
|
"complexType": {
|
|
432
431
|
"original": "string",
|
|
@@ -441,11 +440,11 @@ export class MgInputRichTextEditor {
|
|
|
441
440
|
},
|
|
442
441
|
"getter": false,
|
|
443
442
|
"setter": false,
|
|
444
|
-
"reflect": false
|
|
443
|
+
"reflect": false,
|
|
444
|
+
"attribute": "placeholder"
|
|
445
445
|
},
|
|
446
446
|
"rows": {
|
|
447
447
|
"type": "number",
|
|
448
|
-
"attribute": "rows",
|
|
449
448
|
"mutable": false,
|
|
450
449
|
"complexType": {
|
|
451
450
|
"original": "number",
|
|
@@ -461,11 +460,11 @@ export class MgInputRichTextEditor {
|
|
|
461
460
|
"getter": false,
|
|
462
461
|
"setter": false,
|
|
463
462
|
"reflect": false,
|
|
463
|
+
"attribute": "rows",
|
|
464
464
|
"defaultValue": "5"
|
|
465
465
|
},
|
|
466
466
|
"required": {
|
|
467
467
|
"type": "boolean",
|
|
468
|
-
"attribute": "required",
|
|
469
468
|
"mutable": false,
|
|
470
469
|
"complexType": {
|
|
471
470
|
"original": "boolean",
|
|
@@ -481,11 +480,11 @@ export class MgInputRichTextEditor {
|
|
|
481
480
|
"getter": false,
|
|
482
481
|
"setter": false,
|
|
483
482
|
"reflect": false,
|
|
483
|
+
"attribute": "required",
|
|
484
484
|
"defaultValue": "false"
|
|
485
485
|
},
|
|
486
486
|
"readonly": {
|
|
487
487
|
"type": "boolean",
|
|
488
|
-
"attribute": "readonly",
|
|
489
488
|
"mutable": false,
|
|
490
489
|
"complexType": {
|
|
491
490
|
"original": "boolean",
|
|
@@ -501,11 +500,11 @@ export class MgInputRichTextEditor {
|
|
|
501
500
|
"getter": false,
|
|
502
501
|
"setter": false,
|
|
503
502
|
"reflect": false,
|
|
503
|
+
"attribute": "readonly",
|
|
504
504
|
"defaultValue": "false"
|
|
505
505
|
},
|
|
506
506
|
"disabled": {
|
|
507
507
|
"type": "boolean",
|
|
508
|
-
"attribute": "disabled",
|
|
509
508
|
"mutable": false,
|
|
510
509
|
"complexType": {
|
|
511
510
|
"original": "boolean",
|
|
@@ -521,11 +520,11 @@ export class MgInputRichTextEditor {
|
|
|
521
520
|
"getter": false,
|
|
522
521
|
"setter": false,
|
|
523
522
|
"reflect": false,
|
|
523
|
+
"attribute": "disabled",
|
|
524
524
|
"defaultValue": "false"
|
|
525
525
|
},
|
|
526
526
|
"pattern": {
|
|
527
527
|
"type": "string",
|
|
528
|
-
"attribute": "pattern",
|
|
529
528
|
"mutable": false,
|
|
530
529
|
"complexType": {
|
|
531
530
|
"original": "string",
|
|
@@ -540,11 +539,11 @@ export class MgInputRichTextEditor {
|
|
|
540
539
|
},
|
|
541
540
|
"getter": false,
|
|
542
541
|
"setter": false,
|
|
543
|
-
"reflect": false
|
|
542
|
+
"reflect": false,
|
|
543
|
+
"attribute": "pattern"
|
|
544
544
|
},
|
|
545
545
|
"patternErrorMessage": {
|
|
546
546
|
"type": "string",
|
|
547
|
-
"attribute": "pattern-error-message",
|
|
548
547
|
"mutable": false,
|
|
549
548
|
"complexType": {
|
|
550
549
|
"original": "string",
|
|
@@ -559,11 +558,11 @@ export class MgInputRichTextEditor {
|
|
|
559
558
|
},
|
|
560
559
|
"getter": false,
|
|
561
560
|
"setter": false,
|
|
562
|
-
"reflect": false
|
|
561
|
+
"reflect": false,
|
|
562
|
+
"attribute": "pattern-error-message"
|
|
563
563
|
},
|
|
564
564
|
"tooltip": {
|
|
565
565
|
"type": "string",
|
|
566
|
-
"attribute": "tooltip",
|
|
567
566
|
"mutable": false,
|
|
568
567
|
"complexType": {
|
|
569
568
|
"original": "string",
|
|
@@ -578,11 +577,11 @@ export class MgInputRichTextEditor {
|
|
|
578
577
|
},
|
|
579
578
|
"getter": false,
|
|
580
579
|
"setter": false,
|
|
581
|
-
"reflect": false
|
|
580
|
+
"reflect": false,
|
|
581
|
+
"attribute": "tooltip"
|
|
582
582
|
},
|
|
583
583
|
"tooltipPosition": {
|
|
584
584
|
"type": "string",
|
|
585
|
-
"attribute": "tooltip-position",
|
|
586
585
|
"mutable": false,
|
|
587
586
|
"complexType": {
|
|
588
587
|
"original": "TooltipPosition",
|
|
@@ -604,11 +603,11 @@ export class MgInputRichTextEditor {
|
|
|
604
603
|
"getter": false,
|
|
605
604
|
"setter": false,
|
|
606
605
|
"reflect": false,
|
|
606
|
+
"attribute": "tooltip-position",
|
|
607
607
|
"defaultValue": "'input'"
|
|
608
608
|
},
|
|
609
609
|
"helpText": {
|
|
610
610
|
"type": "string",
|
|
611
|
-
"attribute": "help-text",
|
|
612
611
|
"mutable": false,
|
|
613
612
|
"complexType": {
|
|
614
613
|
"original": "string",
|
|
@@ -623,11 +622,11 @@ export class MgInputRichTextEditor {
|
|
|
623
622
|
},
|
|
624
623
|
"getter": false,
|
|
625
624
|
"setter": false,
|
|
626
|
-
"reflect": false
|
|
625
|
+
"reflect": false,
|
|
626
|
+
"attribute": "help-text"
|
|
627
627
|
},
|
|
628
628
|
"modules": {
|
|
629
629
|
"type": "unknown",
|
|
630
|
-
"attribute": "modules",
|
|
631
630
|
"mutable": false,
|
|
632
631
|
"complexType": {
|
|
633
632
|
"original": "EditorOptionsType['modules']",
|
|
@@ -651,7 +650,6 @@ export class MgInputRichTextEditor {
|
|
|
651
650
|
},
|
|
652
651
|
"valid": {
|
|
653
652
|
"type": "boolean",
|
|
654
|
-
"attribute": "valid",
|
|
655
653
|
"mutable": true,
|
|
656
654
|
"complexType": {
|
|
657
655
|
"original": "boolean",
|
|
@@ -666,11 +664,11 @@ export class MgInputRichTextEditor {
|
|
|
666
664
|
},
|
|
667
665
|
"getter": false,
|
|
668
666
|
"setter": false,
|
|
669
|
-
"reflect": false
|
|
667
|
+
"reflect": false,
|
|
668
|
+
"attribute": "valid"
|
|
670
669
|
},
|
|
671
670
|
"invalid": {
|
|
672
671
|
"type": "boolean",
|
|
673
|
-
"attribute": "invalid",
|
|
674
672
|
"mutable": true,
|
|
675
673
|
"complexType": {
|
|
676
674
|
"original": "boolean",
|
|
@@ -685,7 +683,8 @@ export class MgInputRichTextEditor {
|
|
|
685
683
|
},
|
|
686
684
|
"getter": false,
|
|
687
685
|
"setter": false,
|
|
688
|
-
"reflect": false
|
|
686
|
+
"reflect": false,
|
|
687
|
+
"attribute": "invalid"
|
|
689
688
|
}
|
|
690
689
|
};
|
|
691
690
|
}
|
|
@@ -2,7 +2,6 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { ClassList, allItemsAreString, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
3
3
|
import { classReadonly, classDisabled, widths } from "../mg-input/mg-input.conf";
|
|
4
4
|
import { initLocales } from "../../../../locales";
|
|
5
|
-
import { defineErrorMessage } from "../mg-input/mg-input.utils";
|
|
6
5
|
/**
|
|
7
6
|
* Check if item is a well configured option
|
|
8
7
|
* @param option - select option
|
|
@@ -134,16 +133,6 @@ export class MgInputSelect {
|
|
|
134
133
|
* @returns truthy if input.value is an item
|
|
135
134
|
*/
|
|
136
135
|
this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
|
|
137
|
-
/**
|
|
138
|
-
* Test if component has items
|
|
139
|
-
* @returns truthy if component has items
|
|
140
|
-
*/
|
|
141
|
-
this.hasInputValue = () => { var _a; return ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0; };
|
|
142
|
-
/**
|
|
143
|
-
* Test if component has no value error message displayed
|
|
144
|
-
* @returns truthy if compent display no value error message
|
|
145
|
-
*/
|
|
146
|
-
this.hasNoValueErrorMessageDisplay = () => this.errorMessage === this.messages.errors.noValue;
|
|
147
136
|
/**
|
|
148
137
|
* Handle blur event
|
|
149
138
|
*/
|
|
@@ -163,7 +152,7 @@ export class MgInputSelect {
|
|
|
163
152
|
* Check if input is valid
|
|
164
153
|
*/
|
|
165
154
|
this.checkValidity = () => {
|
|
166
|
-
this.setValidity(!this.isDisabledValue() && (this.readonly || this.disabled ||
|
|
155
|
+
this.setValidity(!this.isDisabledValue() && (this.readonly || this.disabled || this.input.checkValidity()));
|
|
167
156
|
};
|
|
168
157
|
/**
|
|
169
158
|
* Set input error message
|
|
@@ -176,22 +165,11 @@ export class MgInputSelect {
|
|
|
176
165
|
if (errorMessage !== undefined) {
|
|
177
166
|
this.errorMessage = errorMessage;
|
|
178
167
|
}
|
|
179
|
-
else if (!this.hasInputValue()) {
|
|
180
|
-
this.errorMessage = this.messages.errors.noValue;
|
|
181
|
-
}
|
|
182
168
|
else if (this.input.validity.valueMissing) {
|
|
183
169
|
this.errorMessage = this.messages.errors.required;
|
|
184
170
|
}
|
|
185
171
|
}
|
|
186
172
|
};
|
|
187
|
-
/**
|
|
188
|
-
* Reset error message
|
|
189
|
-
*/
|
|
190
|
-
this.resetErrorMessage = () => {
|
|
191
|
-
this.checkValidity();
|
|
192
|
-
this.errorMessage = undefined;
|
|
193
|
-
this.hasDisplayedError = false;
|
|
194
|
-
};
|
|
195
173
|
/**
|
|
196
174
|
* Render option
|
|
197
175
|
* @param option - to render
|
|
@@ -209,11 +187,9 @@ export class MgInputSelect {
|
|
|
209
187
|
this.valueChange.emit(newValue);
|
|
210
188
|
}
|
|
211
189
|
validateItems(newValue) {
|
|
212
|
-
let resetMessage = false;
|
|
213
190
|
// Empty options
|
|
214
|
-
if (
|
|
191
|
+
if (newValue.length === 0) {
|
|
215
192
|
this.options = [];
|
|
216
|
-
this.displayError();
|
|
217
193
|
}
|
|
218
194
|
// String array
|
|
219
195
|
else if (allItemsAreString(newValue)) {
|
|
@@ -221,8 +197,6 @@ export class MgInputSelect {
|
|
|
221
197
|
this.valueExist = newValue.includes(this.value);
|
|
222
198
|
}
|
|
223
199
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
224
|
-
// force to reset error when noValueError is displaied
|
|
225
|
-
resetMessage = this.invalid && this.hasNoValueErrorMessageDisplay();
|
|
226
200
|
}
|
|
227
201
|
// Object array
|
|
228
202
|
else if (allItemsAreOptions(newValue)) {
|
|
@@ -235,15 +209,10 @@ export class MgInputSelect {
|
|
|
235
209
|
else {
|
|
236
210
|
this.options = newValue;
|
|
237
211
|
}
|
|
238
|
-
// force to reset error when noValueError is displaied
|
|
239
|
-
resetMessage = this.invalid && this.hasNoValueErrorMessageDisplay();
|
|
240
212
|
}
|
|
241
213
|
else {
|
|
242
214
|
throw new Error(`<mg-input-select> prop "items" is required, can be an empty Array or all items must be the same type: string or Option. Passed value: ${toString(newValue)}.`);
|
|
243
215
|
}
|
|
244
|
-
if (resetMessage) {
|
|
245
|
-
this.resetErrorMessage();
|
|
246
|
-
}
|
|
247
216
|
}
|
|
248
217
|
watchReadonly(newValue) {
|
|
249
218
|
if (newValue)
|
|
@@ -337,7 +306,9 @@ export class MgInputSelect {
|
|
|
337
306
|
// - Keep everything in sync both inside and outside the component
|
|
338
307
|
return new Promise(resolve => {
|
|
339
308
|
requestAnimationFrame(() => {
|
|
340
|
-
this.
|
|
309
|
+
this.checkValidity();
|
|
310
|
+
this.errorMessage = undefined;
|
|
311
|
+
this.hasDisplayedError = false;
|
|
341
312
|
resolve();
|
|
342
313
|
});
|
|
343
314
|
});
|
|
@@ -389,7 +360,7 @@ export class MgInputSelect {
|
|
|
389
360
|
*/
|
|
390
361
|
render() {
|
|
391
362
|
const readonlyValue = this.getReadonlyValue();
|
|
392
|
-
return (h("mg-input", { key: '
|
|
363
|
+
return (h("mg-input", { key: '1394827503d3f2dd71efc6efa389ac707573d2ec', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
|
|
393
364
|
if (el !== null)
|
|
394
365
|
this.input = el;
|
|
395
366
|
} }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
@@ -411,7 +382,6 @@ export class MgInputSelect {
|
|
|
411
382
|
return {
|
|
412
383
|
"value": {
|
|
413
384
|
"type": "any",
|
|
414
|
-
"attribute": "value",
|
|
415
385
|
"mutable": true,
|
|
416
386
|
"complexType": {
|
|
417
387
|
"original": "any",
|
|
@@ -426,11 +396,11 @@ export class MgInputSelect {
|
|
|
426
396
|
},
|
|
427
397
|
"getter": false,
|
|
428
398
|
"setter": false,
|
|
429
|
-
"reflect": false
|
|
399
|
+
"reflect": false,
|
|
400
|
+
"attribute": "value"
|
|
430
401
|
},
|
|
431
402
|
"items": {
|
|
432
403
|
"type": "unknown",
|
|
433
|
-
"attribute": "items",
|
|
434
404
|
"mutable": false,
|
|
435
405
|
"complexType": {
|
|
436
406
|
"original": "(string | SelectOption)[]",
|
|
@@ -454,7 +424,6 @@ export class MgInputSelect {
|
|
|
454
424
|
},
|
|
455
425
|
"identifier": {
|
|
456
426
|
"type": "string",
|
|
457
|
-
"attribute": "identifier",
|
|
458
427
|
"mutable": false,
|
|
459
428
|
"complexType": {
|
|
460
429
|
"original": "string",
|
|
@@ -469,11 +438,11 @@ export class MgInputSelect {
|
|
|
469
438
|
},
|
|
470
439
|
"getter": false,
|
|
471
440
|
"setter": false,
|
|
472
|
-
"reflect": false
|
|
441
|
+
"reflect": false,
|
|
442
|
+
"attribute": "identifier"
|
|
473
443
|
},
|
|
474
444
|
"name": {
|
|
475
445
|
"type": "string",
|
|
476
|
-
"attribute": "name",
|
|
477
446
|
"mutable": false,
|
|
478
447
|
"complexType": {
|
|
479
448
|
"original": "string",
|
|
@@ -489,11 +458,11 @@ export class MgInputSelect {
|
|
|
489
458
|
"getter": false,
|
|
490
459
|
"setter": false,
|
|
491
460
|
"reflect": false,
|
|
461
|
+
"attribute": "name",
|
|
492
462
|
"defaultValue": "this.identifier"
|
|
493
463
|
},
|
|
494
464
|
"label": {
|
|
495
465
|
"type": "string",
|
|
496
|
-
"attribute": "label",
|
|
497
466
|
"mutable": false,
|
|
498
467
|
"complexType": {
|
|
499
468
|
"original": "string",
|
|
@@ -508,11 +477,11 @@ export class MgInputSelect {
|
|
|
508
477
|
},
|
|
509
478
|
"getter": false,
|
|
510
479
|
"setter": false,
|
|
511
|
-
"reflect": false
|
|
480
|
+
"reflect": false,
|
|
481
|
+
"attribute": "label"
|
|
512
482
|
},
|
|
513
483
|
"labelOnTop": {
|
|
514
484
|
"type": "boolean",
|
|
515
|
-
"attribute": "label-on-top",
|
|
516
485
|
"mutable": false,
|
|
517
486
|
"complexType": {
|
|
518
487
|
"original": "boolean",
|
|
@@ -528,11 +497,11 @@ export class MgInputSelect {
|
|
|
528
497
|
"getter": false,
|
|
529
498
|
"setter": false,
|
|
530
499
|
"reflect": false,
|
|
500
|
+
"attribute": "label-on-top",
|
|
531
501
|
"defaultValue": "false"
|
|
532
502
|
},
|
|
533
503
|
"labelHide": {
|
|
534
504
|
"type": "boolean",
|
|
535
|
-
"attribute": "label-hide",
|
|
536
505
|
"mutable": false,
|
|
537
506
|
"complexType": {
|
|
538
507
|
"original": "boolean",
|
|
@@ -548,11 +517,11 @@ export class MgInputSelect {
|
|
|
548
517
|
"getter": false,
|
|
549
518
|
"setter": false,
|
|
550
519
|
"reflect": false,
|
|
520
|
+
"attribute": "label-hide",
|
|
551
521
|
"defaultValue": "false"
|
|
552
522
|
},
|
|
553
523
|
"placeholder": {
|
|
554
524
|
"type": "string",
|
|
555
|
-
"attribute": "placeholder",
|
|
556
525
|
"mutable": true,
|
|
557
526
|
"complexType": {
|
|
558
527
|
"original": "string",
|
|
@@ -567,11 +536,11 @@ export class MgInputSelect {
|
|
|
567
536
|
},
|
|
568
537
|
"getter": false,
|
|
569
538
|
"setter": false,
|
|
570
|
-
"reflect": false
|
|
539
|
+
"reflect": false,
|
|
540
|
+
"attribute": "placeholder"
|
|
571
541
|
},
|
|
572
542
|
"placeholderHide": {
|
|
573
543
|
"type": "boolean",
|
|
574
|
-
"attribute": "placeholder-hide",
|
|
575
544
|
"mutable": false,
|
|
576
545
|
"complexType": {
|
|
577
546
|
"original": "boolean",
|
|
@@ -587,11 +556,11 @@ export class MgInputSelect {
|
|
|
587
556
|
"getter": false,
|
|
588
557
|
"setter": false,
|
|
589
558
|
"reflect": false,
|
|
559
|
+
"attribute": "placeholder-hide",
|
|
590
560
|
"defaultValue": "false"
|
|
591
561
|
},
|
|
592
562
|
"placeholderDisabled": {
|
|
593
563
|
"type": "boolean",
|
|
594
|
-
"attribute": "placeholder-disabled",
|
|
595
564
|
"mutable": false,
|
|
596
565
|
"complexType": {
|
|
597
566
|
"original": "boolean",
|
|
@@ -607,11 +576,11 @@ export class MgInputSelect {
|
|
|
607
576
|
"getter": false,
|
|
608
577
|
"setter": false,
|
|
609
578
|
"reflect": false,
|
|
579
|
+
"attribute": "placeholder-disabled",
|
|
610
580
|
"defaultValue": "false"
|
|
611
581
|
},
|
|
612
582
|
"required": {
|
|
613
583
|
"type": "boolean",
|
|
614
|
-
"attribute": "required",
|
|
615
584
|
"mutable": false,
|
|
616
585
|
"complexType": {
|
|
617
586
|
"original": "boolean",
|
|
@@ -627,11 +596,11 @@ export class MgInputSelect {
|
|
|
627
596
|
"getter": false,
|
|
628
597
|
"setter": false,
|
|
629
598
|
"reflect": false,
|
|
599
|
+
"attribute": "required",
|
|
630
600
|
"defaultValue": "false"
|
|
631
601
|
},
|
|
632
602
|
"readonly": {
|
|
633
603
|
"type": "boolean",
|
|
634
|
-
"attribute": "readonly",
|
|
635
604
|
"mutable": false,
|
|
636
605
|
"complexType": {
|
|
637
606
|
"original": "boolean",
|
|
@@ -647,11 +616,11 @@ export class MgInputSelect {
|
|
|
647
616
|
"getter": false,
|
|
648
617
|
"setter": false,
|
|
649
618
|
"reflect": false,
|
|
619
|
+
"attribute": "readonly",
|
|
650
620
|
"defaultValue": "false"
|
|
651
621
|
},
|
|
652
622
|
"disabled": {
|
|
653
623
|
"type": "boolean",
|
|
654
|
-
"attribute": "disabled",
|
|
655
624
|
"mutable": false,
|
|
656
625
|
"complexType": {
|
|
657
626
|
"original": "boolean",
|
|
@@ -667,11 +636,11 @@ export class MgInputSelect {
|
|
|
667
636
|
"getter": false,
|
|
668
637
|
"setter": false,
|
|
669
638
|
"reflect": false,
|
|
639
|
+
"attribute": "disabled",
|
|
670
640
|
"defaultValue": "false"
|
|
671
641
|
},
|
|
672
642
|
"mgWidth": {
|
|
673
643
|
"type": "any",
|
|
674
|
-
"attribute": "mg-width",
|
|
675
644
|
"mutable": false,
|
|
676
645
|
"complexType": {
|
|
677
646
|
"original": "Width",
|
|
@@ -692,11 +661,11 @@ export class MgInputSelect {
|
|
|
692
661
|
},
|
|
693
662
|
"getter": false,
|
|
694
663
|
"setter": false,
|
|
695
|
-
"reflect": true
|
|
664
|
+
"reflect": true,
|
|
665
|
+
"attribute": "mg-width"
|
|
696
666
|
},
|
|
697
667
|
"tooltip": {
|
|
698
668
|
"type": "string",
|
|
699
|
-
"attribute": "tooltip",
|
|
700
669
|
"mutable": false,
|
|
701
670
|
"complexType": {
|
|
702
671
|
"original": "string",
|
|
@@ -711,11 +680,11 @@ export class MgInputSelect {
|
|
|
711
680
|
},
|
|
712
681
|
"getter": false,
|
|
713
682
|
"setter": false,
|
|
714
|
-
"reflect": false
|
|
683
|
+
"reflect": false,
|
|
684
|
+
"attribute": "tooltip"
|
|
715
685
|
},
|
|
716
686
|
"tooltipPosition": {
|
|
717
687
|
"type": "string",
|
|
718
|
-
"attribute": "tooltip-position",
|
|
719
688
|
"mutable": false,
|
|
720
689
|
"complexType": {
|
|
721
690
|
"original": "TooltipPosition",
|
|
@@ -737,11 +706,11 @@ export class MgInputSelect {
|
|
|
737
706
|
"getter": false,
|
|
738
707
|
"setter": false,
|
|
739
708
|
"reflect": false,
|
|
709
|
+
"attribute": "tooltip-position",
|
|
740
710
|
"defaultValue": "'input'"
|
|
741
711
|
},
|
|
742
712
|
"helpText": {
|
|
743
713
|
"type": "string",
|
|
744
|
-
"attribute": "help-text",
|
|
745
714
|
"mutable": false,
|
|
746
715
|
"complexType": {
|
|
747
716
|
"original": "string",
|
|
@@ -756,30 +725,11 @@ export class MgInputSelect {
|
|
|
756
725
|
},
|
|
757
726
|
"getter": false,
|
|
758
727
|
"setter": false,
|
|
759
|
-
"reflect": false
|
|
760
|
-
|
|
761
|
-
"noValueErrorDetail": {
|
|
762
|
-
"type": "string",
|
|
763
|
-
"attribute": "no-value-error-detail",
|
|
764
|
-
"mutable": false,
|
|
765
|
-
"complexType": {
|
|
766
|
-
"original": "string",
|
|
767
|
-
"resolved": "string",
|
|
768
|
-
"references": {}
|
|
769
|
-
},
|
|
770
|
-
"required": false,
|
|
771
|
-
"optional": true,
|
|
772
|
-
"docs": {
|
|
773
|
-
"tags": [],
|
|
774
|
-
"text": "Define no value error detail"
|
|
775
|
-
},
|
|
776
|
-
"getter": false,
|
|
777
|
-
"setter": false,
|
|
778
|
-
"reflect": false
|
|
728
|
+
"reflect": false,
|
|
729
|
+
"attribute": "help-text"
|
|
779
730
|
},
|
|
780
731
|
"valid": {
|
|
781
732
|
"type": "boolean",
|
|
782
|
-
"attribute": "valid",
|
|
783
733
|
"mutable": true,
|
|
784
734
|
"complexType": {
|
|
785
735
|
"original": "boolean",
|
|
@@ -794,11 +744,11 @@ export class MgInputSelect {
|
|
|
794
744
|
},
|
|
795
745
|
"getter": false,
|
|
796
746
|
"setter": false,
|
|
797
|
-
"reflect": false
|
|
747
|
+
"reflect": false,
|
|
748
|
+
"attribute": "valid"
|
|
798
749
|
},
|
|
799
750
|
"invalid": {
|
|
800
751
|
"type": "boolean",
|
|
801
|
-
"attribute": "invalid",
|
|
802
752
|
"mutable": true,
|
|
803
753
|
"complexType": {
|
|
804
754
|
"original": "boolean",
|
|
@@ -813,7 +763,8 @@ export class MgInputSelect {
|
|
|
813
763
|
},
|
|
814
764
|
"getter": false,
|
|
815
765
|
"setter": false,
|
|
816
|
-
"reflect": false
|
|
766
|
+
"reflect": false,
|
|
767
|
+
"attribute": "invalid"
|
|
817
768
|
}
|
|
818
769
|
};
|
|
819
770
|
}
|