@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
|
@@ -258,7 +258,6 @@ export class MgInputPassword {
|
|
|
258
258
|
return {
|
|
259
259
|
"value": {
|
|
260
260
|
"type": "string",
|
|
261
|
-
"attribute": "value",
|
|
262
261
|
"mutable": true,
|
|
263
262
|
"complexType": {
|
|
264
263
|
"original": "string",
|
|
@@ -273,11 +272,11 @@ export class MgInputPassword {
|
|
|
273
272
|
},
|
|
274
273
|
"getter": false,
|
|
275
274
|
"setter": false,
|
|
276
|
-
"reflect": true
|
|
275
|
+
"reflect": true,
|
|
276
|
+
"attribute": "value"
|
|
277
277
|
},
|
|
278
278
|
"identifier": {
|
|
279
279
|
"type": "string",
|
|
280
|
-
"attribute": "identifier",
|
|
281
280
|
"mutable": false,
|
|
282
281
|
"complexType": {
|
|
283
282
|
"original": "string",
|
|
@@ -292,11 +291,11 @@ export class MgInputPassword {
|
|
|
292
291
|
},
|
|
293
292
|
"getter": false,
|
|
294
293
|
"setter": false,
|
|
295
|
-
"reflect": false
|
|
294
|
+
"reflect": false,
|
|
295
|
+
"attribute": "identifier"
|
|
296
296
|
},
|
|
297
297
|
"name": {
|
|
298
298
|
"type": "string",
|
|
299
|
-
"attribute": "name",
|
|
300
299
|
"mutable": false,
|
|
301
300
|
"complexType": {
|
|
302
301
|
"original": "string",
|
|
@@ -312,11 +311,11 @@ export class MgInputPassword {
|
|
|
312
311
|
"getter": false,
|
|
313
312
|
"setter": false,
|
|
314
313
|
"reflect": false,
|
|
314
|
+
"attribute": "name",
|
|
315
315
|
"defaultValue": "this.identifier"
|
|
316
316
|
},
|
|
317
317
|
"label": {
|
|
318
318
|
"type": "string",
|
|
319
|
-
"attribute": "label",
|
|
320
319
|
"mutable": false,
|
|
321
320
|
"complexType": {
|
|
322
321
|
"original": "string",
|
|
@@ -331,11 +330,11 @@ export class MgInputPassword {
|
|
|
331
330
|
},
|
|
332
331
|
"getter": false,
|
|
333
332
|
"setter": false,
|
|
334
|
-
"reflect": false
|
|
333
|
+
"reflect": false,
|
|
334
|
+
"attribute": "label"
|
|
335
335
|
},
|
|
336
336
|
"labelOnTop": {
|
|
337
337
|
"type": "boolean",
|
|
338
|
-
"attribute": "label-on-top",
|
|
339
338
|
"mutable": false,
|
|
340
339
|
"complexType": {
|
|
341
340
|
"original": "boolean",
|
|
@@ -351,11 +350,11 @@ export class MgInputPassword {
|
|
|
351
350
|
"getter": false,
|
|
352
351
|
"setter": false,
|
|
353
352
|
"reflect": false,
|
|
353
|
+
"attribute": "label-on-top",
|
|
354
354
|
"defaultValue": "false"
|
|
355
355
|
},
|
|
356
356
|
"labelHide": {
|
|
357
357
|
"type": "boolean",
|
|
358
|
-
"attribute": "label-hide",
|
|
359
358
|
"mutable": false,
|
|
360
359
|
"complexType": {
|
|
361
360
|
"original": "boolean",
|
|
@@ -371,11 +370,11 @@ export class MgInputPassword {
|
|
|
371
370
|
"getter": false,
|
|
372
371
|
"setter": false,
|
|
373
372
|
"reflect": false,
|
|
373
|
+
"attribute": "label-hide",
|
|
374
374
|
"defaultValue": "false"
|
|
375
375
|
},
|
|
376
376
|
"placeholder": {
|
|
377
377
|
"type": "string",
|
|
378
|
-
"attribute": "placeholder",
|
|
379
378
|
"mutable": false,
|
|
380
379
|
"complexType": {
|
|
381
380
|
"original": "string",
|
|
@@ -390,11 +389,11 @@ export class MgInputPassword {
|
|
|
390
389
|
},
|
|
391
390
|
"getter": false,
|
|
392
391
|
"setter": false,
|
|
393
|
-
"reflect": false
|
|
392
|
+
"reflect": false,
|
|
393
|
+
"attribute": "placeholder"
|
|
394
394
|
},
|
|
395
395
|
"maxlength": {
|
|
396
396
|
"type": "number",
|
|
397
|
-
"attribute": "maxlength",
|
|
398
397
|
"mutable": false,
|
|
399
398
|
"complexType": {
|
|
400
399
|
"original": "number",
|
|
@@ -409,11 +408,11 @@ export class MgInputPassword {
|
|
|
409
408
|
},
|
|
410
409
|
"getter": false,
|
|
411
410
|
"setter": false,
|
|
412
|
-
"reflect": false
|
|
411
|
+
"reflect": false,
|
|
412
|
+
"attribute": "maxlength"
|
|
413
413
|
},
|
|
414
414
|
"required": {
|
|
415
415
|
"type": "boolean",
|
|
416
|
-
"attribute": "required",
|
|
417
416
|
"mutable": false,
|
|
418
417
|
"complexType": {
|
|
419
418
|
"original": "boolean",
|
|
@@ -429,11 +428,11 @@ export class MgInputPassword {
|
|
|
429
428
|
"getter": false,
|
|
430
429
|
"setter": false,
|
|
431
430
|
"reflect": false,
|
|
431
|
+
"attribute": "required",
|
|
432
432
|
"defaultValue": "false"
|
|
433
433
|
},
|
|
434
434
|
"readonly": {
|
|
435
435
|
"type": "boolean",
|
|
436
|
-
"attribute": "readonly",
|
|
437
436
|
"mutable": false,
|
|
438
437
|
"complexType": {
|
|
439
438
|
"original": "boolean",
|
|
@@ -449,11 +448,11 @@ export class MgInputPassword {
|
|
|
449
448
|
"getter": false,
|
|
450
449
|
"setter": false,
|
|
451
450
|
"reflect": false,
|
|
451
|
+
"attribute": "readonly",
|
|
452
452
|
"defaultValue": "false"
|
|
453
453
|
},
|
|
454
454
|
"disabled": {
|
|
455
455
|
"type": "boolean",
|
|
456
|
-
"attribute": "disabled",
|
|
457
456
|
"mutable": false,
|
|
458
457
|
"complexType": {
|
|
459
458
|
"original": "boolean",
|
|
@@ -469,11 +468,11 @@ export class MgInputPassword {
|
|
|
469
468
|
"getter": false,
|
|
470
469
|
"setter": false,
|
|
471
470
|
"reflect": false,
|
|
471
|
+
"attribute": "disabled",
|
|
472
472
|
"defaultValue": "false"
|
|
473
473
|
},
|
|
474
474
|
"mgWidth": {
|
|
475
475
|
"type": "any",
|
|
476
|
-
"attribute": "mg-width",
|
|
477
476
|
"mutable": false,
|
|
478
477
|
"complexType": {
|
|
479
478
|
"original": "Width",
|
|
@@ -495,11 +494,11 @@ export class MgInputPassword {
|
|
|
495
494
|
"getter": false,
|
|
496
495
|
"setter": false,
|
|
497
496
|
"reflect": false,
|
|
497
|
+
"attribute": "mg-width",
|
|
498
498
|
"defaultValue": "'full'"
|
|
499
499
|
},
|
|
500
500
|
"tooltip": {
|
|
501
501
|
"type": "string",
|
|
502
|
-
"attribute": "tooltip",
|
|
503
502
|
"mutable": false,
|
|
504
503
|
"complexType": {
|
|
505
504
|
"original": "string",
|
|
@@ -514,11 +513,11 @@ export class MgInputPassword {
|
|
|
514
513
|
},
|
|
515
514
|
"getter": false,
|
|
516
515
|
"setter": false,
|
|
517
|
-
"reflect": false
|
|
516
|
+
"reflect": false,
|
|
517
|
+
"attribute": "tooltip"
|
|
518
518
|
},
|
|
519
519
|
"tooltipPosition": {
|
|
520
520
|
"type": "string",
|
|
521
|
-
"attribute": "tooltip-position",
|
|
522
521
|
"mutable": false,
|
|
523
522
|
"complexType": {
|
|
524
523
|
"original": "TooltipPosition",
|
|
@@ -540,11 +539,11 @@ export class MgInputPassword {
|
|
|
540
539
|
"getter": false,
|
|
541
540
|
"setter": false,
|
|
542
541
|
"reflect": false,
|
|
542
|
+
"attribute": "tooltip-position",
|
|
543
543
|
"defaultValue": "'input'"
|
|
544
544
|
},
|
|
545
545
|
"helpText": {
|
|
546
546
|
"type": "string",
|
|
547
|
-
"attribute": "help-text",
|
|
548
547
|
"mutable": false,
|
|
549
548
|
"complexType": {
|
|
550
549
|
"original": "string",
|
|
@@ -559,11 +558,11 @@ export class MgInputPassword {
|
|
|
559
558
|
},
|
|
560
559
|
"getter": false,
|
|
561
560
|
"setter": false,
|
|
562
|
-
"reflect": false
|
|
561
|
+
"reflect": false,
|
|
562
|
+
"attribute": "help-text"
|
|
563
563
|
},
|
|
564
564
|
"valid": {
|
|
565
565
|
"type": "boolean",
|
|
566
|
-
"attribute": "valid",
|
|
567
566
|
"mutable": true,
|
|
568
567
|
"complexType": {
|
|
569
568
|
"original": "boolean",
|
|
@@ -578,11 +577,11 @@ export class MgInputPassword {
|
|
|
578
577
|
},
|
|
579
578
|
"getter": false,
|
|
580
579
|
"setter": false,
|
|
581
|
-
"reflect": false
|
|
580
|
+
"reflect": false,
|
|
581
|
+
"attribute": "valid"
|
|
582
582
|
},
|
|
583
583
|
"invalid": {
|
|
584
584
|
"type": "boolean",
|
|
585
|
-
"attribute": "invalid",
|
|
586
585
|
"mutable": true,
|
|
587
586
|
"complexType": {
|
|
588
587
|
"original": "boolean",
|
|
@@ -597,7 +596,8 @@ export class MgInputPassword {
|
|
|
597
596
|
},
|
|
598
597
|
"getter": false,
|
|
599
598
|
"setter": false,
|
|
600
|
-
"reflect": false
|
|
599
|
+
"reflect": false,
|
|
600
|
+
"attribute": "invalid"
|
|
601
601
|
}
|
|
602
602
|
};
|
|
603
603
|
}
|
|
@@ -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, classFieldset } 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
|
* type Option validation function
|
|
8
7
|
* @param option - radio option
|
|
@@ -75,21 +74,11 @@ export class MgInputRadio {
|
|
|
75
74
|
// reset guard
|
|
76
75
|
this.handlerInProgress = undefined;
|
|
77
76
|
};
|
|
78
|
-
/**
|
|
79
|
-
* Test if component has items
|
|
80
|
-
* @returns truthy if component has items
|
|
81
|
-
*/
|
|
82
|
-
this.hasInputValue = () => { var _a; return ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0; };
|
|
83
|
-
/**
|
|
84
|
-
* Test if component has no value error message displayed
|
|
85
|
-
* @returns truthy if compent display no value error message
|
|
86
|
-
*/
|
|
87
|
-
this.hasNoValueErrorMessageDisplay = () => this.errorMessage === this.messages.errors.noValue;
|
|
88
77
|
/**
|
|
89
78
|
* Check if input is valid
|
|
90
79
|
*/
|
|
91
80
|
this.checkValidity = () => {
|
|
92
|
-
this.setValidity(this.readonly || this.disabled ||
|
|
81
|
+
this.setValidity(this.readonly || this.disabled || this.getInvalidElement() === undefined);
|
|
93
82
|
};
|
|
94
83
|
/**
|
|
95
84
|
* Set input error message
|
|
@@ -103,22 +92,11 @@ export class MgInputRadio {
|
|
|
103
92
|
if (errorMessage !== undefined) {
|
|
104
93
|
this.errorMessage = errorMessage;
|
|
105
94
|
}
|
|
106
|
-
else if (!this.hasInputValue()) {
|
|
107
|
-
this.errorMessage = this.messages.errors.noValue;
|
|
108
|
-
}
|
|
109
95
|
else if (invalidElement.validity.valueMissing) {
|
|
110
96
|
this.errorMessage = this.messages.errors.required;
|
|
111
97
|
}
|
|
112
98
|
}
|
|
113
99
|
};
|
|
114
|
-
/**
|
|
115
|
-
* Reset error message
|
|
116
|
-
*/
|
|
117
|
-
this.resetErrorMessage = () => {
|
|
118
|
-
this.checkValidity();
|
|
119
|
-
this.errorMessage = undefined;
|
|
120
|
-
this.hasDisplayedError = false;
|
|
121
|
-
};
|
|
122
100
|
/**
|
|
123
101
|
* get invalid element
|
|
124
102
|
* @returns element
|
|
@@ -140,29 +118,17 @@ export class MgInputRadio {
|
|
|
140
118
|
this.valueChange.emit(newValue);
|
|
141
119
|
}
|
|
142
120
|
validateItems(newValue) {
|
|
143
|
-
if ([undefined, null].includes(newValue) || (Array.isArray(newValue) && newValue.length === 0)) {
|
|
144
|
-
this.options = [];
|
|
145
|
-
this.displayError();
|
|
146
|
-
}
|
|
147
121
|
// Validate if items have required min length
|
|
148
|
-
|
|
122
|
+
if (typeof newValue === 'object' && newValue.length < 2) {
|
|
149
123
|
throw new Error(`<mg-input-radio> prop "items" require at least 2 items. Passed value: ${toString(newValue)}.`);
|
|
150
124
|
}
|
|
151
125
|
// String array
|
|
152
126
|
else if (allItemsAreString(newValue)) {
|
|
153
127
|
this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
|
|
154
|
-
// force to reset error when noValueError is displaied
|
|
155
|
-
if (this.invalid && this.hasNoValueErrorMessageDisplay()) {
|
|
156
|
-
this.resetErrorMessage();
|
|
157
|
-
}
|
|
158
128
|
}
|
|
159
129
|
// Object array
|
|
160
|
-
else if (
|
|
130
|
+
else if (newValue && newValue.every(item => isOption(item))) {
|
|
161
131
|
this.options = newValue;
|
|
162
|
-
// force to reset error when noValueError is displaied
|
|
163
|
-
if (this.invalid && this.hasNoValueErrorMessageDisplay()) {
|
|
164
|
-
this.resetErrorMessage();
|
|
165
|
-
}
|
|
166
132
|
}
|
|
167
133
|
else {
|
|
168
134
|
throw new Error(`<mg-input-radio> prop "items" is required and all items must be the same type, string or RadioOption. Passed value: ${toString(newValue)}.`);
|
|
@@ -258,7 +224,9 @@ export class MgInputRadio {
|
|
|
258
224
|
// - Keep everything in sync both inside and outside the component
|
|
259
225
|
return new Promise(resolve => {
|
|
260
226
|
requestAnimationFrame(() => {
|
|
261
|
-
this.
|
|
227
|
+
this.checkValidity();
|
|
228
|
+
this.errorMessage = undefined;
|
|
229
|
+
this.hasDisplayedError = false;
|
|
262
230
|
resolve();
|
|
263
231
|
});
|
|
264
232
|
});
|
|
@@ -304,12 +272,10 @@ export class MgInputRadio {
|
|
|
304
272
|
* @returns HTML Element
|
|
305
273
|
*/
|
|
306
274
|
render() {
|
|
307
|
-
return (h("mg-input", { key: '
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
this.inputs[index] = el;
|
|
312
|
-
} }), h("label", { htmlFor: this.identifier + '_' + index }, input.title))))))));
|
|
275
|
+
return (h("mg-input", { key: '048aa732e7f8593701c9397e571b97584bc5e37b', 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 && !this.value ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (h("ul", { class: "mg-c-input__input-group-container", role: "list" }, this.options.map((input, index) => (h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
|
|
276
|
+
if (el !== null)
|
|
277
|
+
this.inputs[index] = el;
|
|
278
|
+
} }), h("label", { htmlFor: this.identifier + '_' + index }, input.title))))))));
|
|
313
279
|
}
|
|
314
280
|
static get is() { return "mg-input-radio"; }
|
|
315
281
|
static get encapsulation() { return "shadow"; }
|
|
@@ -327,7 +293,6 @@ export class MgInputRadio {
|
|
|
327
293
|
return {
|
|
328
294
|
"value": {
|
|
329
295
|
"type": "any",
|
|
330
|
-
"attribute": "value",
|
|
331
296
|
"mutable": true,
|
|
332
297
|
"complexType": {
|
|
333
298
|
"original": "any",
|
|
@@ -342,11 +307,11 @@ export class MgInputRadio {
|
|
|
342
307
|
},
|
|
343
308
|
"getter": false,
|
|
344
309
|
"setter": false,
|
|
345
|
-
"reflect": false
|
|
310
|
+
"reflect": false,
|
|
311
|
+
"attribute": "value"
|
|
346
312
|
},
|
|
347
313
|
"items": {
|
|
348
314
|
"type": "unknown",
|
|
349
|
-
"attribute": "items",
|
|
350
315
|
"mutable": false,
|
|
351
316
|
"complexType": {
|
|
352
317
|
"original": "string[] | RadioOption[]",
|
|
@@ -370,7 +335,6 @@ export class MgInputRadio {
|
|
|
370
335
|
},
|
|
371
336
|
"identifier": {
|
|
372
337
|
"type": "string",
|
|
373
|
-
"attribute": "identifier",
|
|
374
338
|
"mutable": false,
|
|
375
339
|
"complexType": {
|
|
376
340
|
"original": "string",
|
|
@@ -385,11 +349,11 @@ export class MgInputRadio {
|
|
|
385
349
|
},
|
|
386
350
|
"getter": false,
|
|
387
351
|
"setter": false,
|
|
388
|
-
"reflect": false
|
|
352
|
+
"reflect": false,
|
|
353
|
+
"attribute": "identifier"
|
|
389
354
|
},
|
|
390
355
|
"name": {
|
|
391
356
|
"type": "string",
|
|
392
|
-
"attribute": "name",
|
|
393
357
|
"mutable": false,
|
|
394
358
|
"complexType": {
|
|
395
359
|
"original": "string",
|
|
@@ -405,11 +369,11 @@ export class MgInputRadio {
|
|
|
405
369
|
"getter": false,
|
|
406
370
|
"setter": false,
|
|
407
371
|
"reflect": false,
|
|
372
|
+
"attribute": "name",
|
|
408
373
|
"defaultValue": "this.identifier"
|
|
409
374
|
},
|
|
410
375
|
"label": {
|
|
411
376
|
"type": "string",
|
|
412
|
-
"attribute": "label",
|
|
413
377
|
"mutable": false,
|
|
414
378
|
"complexType": {
|
|
415
379
|
"original": "string",
|
|
@@ -424,11 +388,11 @@ export class MgInputRadio {
|
|
|
424
388
|
},
|
|
425
389
|
"getter": false,
|
|
426
390
|
"setter": false,
|
|
427
|
-
"reflect": false
|
|
391
|
+
"reflect": false,
|
|
392
|
+
"attribute": "label"
|
|
428
393
|
},
|
|
429
394
|
"labelOnTop": {
|
|
430
395
|
"type": "boolean",
|
|
431
|
-
"attribute": "label-on-top",
|
|
432
396
|
"mutable": false,
|
|
433
397
|
"complexType": {
|
|
434
398
|
"original": "boolean",
|
|
@@ -444,11 +408,11 @@ export class MgInputRadio {
|
|
|
444
408
|
"getter": false,
|
|
445
409
|
"setter": false,
|
|
446
410
|
"reflect": false,
|
|
411
|
+
"attribute": "label-on-top",
|
|
447
412
|
"defaultValue": "false"
|
|
448
413
|
},
|
|
449
414
|
"labelHide": {
|
|
450
415
|
"type": "boolean",
|
|
451
|
-
"attribute": "label-hide",
|
|
452
416
|
"mutable": false,
|
|
453
417
|
"complexType": {
|
|
454
418
|
"original": "boolean",
|
|
@@ -464,11 +428,11 @@ export class MgInputRadio {
|
|
|
464
428
|
"getter": false,
|
|
465
429
|
"setter": false,
|
|
466
430
|
"reflect": false,
|
|
431
|
+
"attribute": "label-hide",
|
|
467
432
|
"defaultValue": "false"
|
|
468
433
|
},
|
|
469
434
|
"inputVerticalList": {
|
|
470
435
|
"type": "boolean",
|
|
471
|
-
"attribute": "input-vertical-list",
|
|
472
436
|
"mutable": false,
|
|
473
437
|
"complexType": {
|
|
474
438
|
"original": "boolean",
|
|
@@ -484,11 +448,11 @@ export class MgInputRadio {
|
|
|
484
448
|
"getter": false,
|
|
485
449
|
"setter": false,
|
|
486
450
|
"reflect": false,
|
|
451
|
+
"attribute": "input-vertical-list",
|
|
487
452
|
"defaultValue": "false"
|
|
488
453
|
},
|
|
489
454
|
"required": {
|
|
490
455
|
"type": "boolean",
|
|
491
|
-
"attribute": "required",
|
|
492
456
|
"mutable": false,
|
|
493
457
|
"complexType": {
|
|
494
458
|
"original": "boolean",
|
|
@@ -504,11 +468,11 @@ export class MgInputRadio {
|
|
|
504
468
|
"getter": false,
|
|
505
469
|
"setter": false,
|
|
506
470
|
"reflect": false,
|
|
471
|
+
"attribute": "required",
|
|
507
472
|
"defaultValue": "false"
|
|
508
473
|
},
|
|
509
474
|
"readonly": {
|
|
510
475
|
"type": "boolean",
|
|
511
|
-
"attribute": "readonly",
|
|
512
476
|
"mutable": false,
|
|
513
477
|
"complexType": {
|
|
514
478
|
"original": "boolean",
|
|
@@ -524,11 +488,11 @@ export class MgInputRadio {
|
|
|
524
488
|
"getter": false,
|
|
525
489
|
"setter": false,
|
|
526
490
|
"reflect": false,
|
|
491
|
+
"attribute": "readonly",
|
|
527
492
|
"defaultValue": "false"
|
|
528
493
|
},
|
|
529
494
|
"disabled": {
|
|
530
495
|
"type": "boolean",
|
|
531
|
-
"attribute": "disabled",
|
|
532
496
|
"mutable": false,
|
|
533
497
|
"complexType": {
|
|
534
498
|
"original": "boolean",
|
|
@@ -544,11 +508,11 @@ export class MgInputRadio {
|
|
|
544
508
|
"getter": false,
|
|
545
509
|
"setter": false,
|
|
546
510
|
"reflect": false,
|
|
511
|
+
"attribute": "disabled",
|
|
547
512
|
"defaultValue": "false"
|
|
548
513
|
},
|
|
549
514
|
"tooltip": {
|
|
550
515
|
"type": "string",
|
|
551
|
-
"attribute": "tooltip",
|
|
552
516
|
"mutable": false,
|
|
553
517
|
"complexType": {
|
|
554
518
|
"original": "string",
|
|
@@ -563,11 +527,11 @@ export class MgInputRadio {
|
|
|
563
527
|
},
|
|
564
528
|
"getter": false,
|
|
565
529
|
"setter": false,
|
|
566
|
-
"reflect": false
|
|
530
|
+
"reflect": false,
|
|
531
|
+
"attribute": "tooltip"
|
|
567
532
|
},
|
|
568
533
|
"tooltipPosition": {
|
|
569
534
|
"type": "string",
|
|
570
|
-
"attribute": "tooltip-position",
|
|
571
535
|
"mutable": false,
|
|
572
536
|
"complexType": {
|
|
573
537
|
"original": "TooltipPosition",
|
|
@@ -589,11 +553,11 @@ export class MgInputRadio {
|
|
|
589
553
|
"getter": false,
|
|
590
554
|
"setter": false,
|
|
591
555
|
"reflect": false,
|
|
556
|
+
"attribute": "tooltip-position",
|
|
592
557
|
"defaultValue": "'input'"
|
|
593
558
|
},
|
|
594
559
|
"helpText": {
|
|
595
560
|
"type": "string",
|
|
596
|
-
"attribute": "help-text",
|
|
597
561
|
"mutable": false,
|
|
598
562
|
"complexType": {
|
|
599
563
|
"original": "string",
|
|
@@ -608,30 +572,11 @@ export class MgInputRadio {
|
|
|
608
572
|
},
|
|
609
573
|
"getter": false,
|
|
610
574
|
"setter": false,
|
|
611
|
-
"reflect": false
|
|
612
|
-
|
|
613
|
-
"noValueErrorDetail": {
|
|
614
|
-
"type": "string",
|
|
615
|
-
"attribute": "no-value-error-detail",
|
|
616
|
-
"mutable": false,
|
|
617
|
-
"complexType": {
|
|
618
|
-
"original": "string",
|
|
619
|
-
"resolved": "string",
|
|
620
|
-
"references": {}
|
|
621
|
-
},
|
|
622
|
-
"required": false,
|
|
623
|
-
"optional": true,
|
|
624
|
-
"docs": {
|
|
625
|
-
"tags": [],
|
|
626
|
-
"text": "Define no value error detail"
|
|
627
|
-
},
|
|
628
|
-
"getter": false,
|
|
629
|
-
"setter": false,
|
|
630
|
-
"reflect": false
|
|
575
|
+
"reflect": false,
|
|
576
|
+
"attribute": "help-text"
|
|
631
577
|
},
|
|
632
578
|
"valid": {
|
|
633
579
|
"type": "boolean",
|
|
634
|
-
"attribute": "valid",
|
|
635
580
|
"mutable": true,
|
|
636
581
|
"complexType": {
|
|
637
582
|
"original": "boolean",
|
|
@@ -646,11 +591,11 @@ export class MgInputRadio {
|
|
|
646
591
|
},
|
|
647
592
|
"getter": false,
|
|
648
593
|
"setter": false,
|
|
649
|
-
"reflect": false
|
|
594
|
+
"reflect": false,
|
|
595
|
+
"attribute": "valid"
|
|
650
596
|
},
|
|
651
597
|
"invalid": {
|
|
652
598
|
"type": "boolean",
|
|
653
|
-
"attribute": "invalid",
|
|
654
599
|
"mutable": true,
|
|
655
600
|
"complexType": {
|
|
656
601
|
"original": "boolean",
|
|
@@ -665,7 +610,8 @@ export class MgInputRadio {
|
|
|
665
610
|
},
|
|
666
611
|
"getter": false,
|
|
667
612
|
"setter": false,
|
|
668
|
-
"reflect": false
|
|
613
|
+
"reflect": false,
|
|
614
|
+
"attribute": "invalid"
|
|
669
615
|
}
|
|
670
616
|
};
|
|
671
617
|
}
|