@mgdis/mg-components 5.4.0 → 5.5.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.
Files changed (126) hide show
  1. package/dist/cjs/{index-94497267.js → index-c3450336.js} +0 -0
  2. package/dist/cjs/loader.cjs.js +3 -3
  3. package/dist/cjs/{mg-badge_29.cjs.entry.js → mg-badge_30.cjs.entry.js} +380 -625
  4. package/dist/cjs/mg-components.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +3 -2
  6. package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -7
  7. package/dist/collection/components/atoms/mg-badge/mg-badge.js +4 -7
  8. package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -7
  9. package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
  10. package/dist/collection/components/atoms/mg-button/mg-button.css +13 -0
  11. package/dist/collection/components/atoms/mg-button/mg-button.js +12 -29
  12. package/dist/collection/components/atoms/mg-card/mg-card.css +6 -1
  13. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +2 -3
  14. package/dist/collection/components/atoms/mg-divider/mg-divider.js +0 -6
  15. package/dist/collection/components/atoms/mg-icon/mg-icon.js +5 -12
  16. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +4 -8
  17. package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +1 -9
  18. package/dist/collection/components/atoms/mg-tag/mg-tag.css +58 -0
  19. package/dist/collection/components/atoms/mg-tag/mg-tag.js +60 -15
  20. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +6 -19
  21. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +17 -33
  22. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +17 -25
  23. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +24 -47
  24. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -29
  25. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +18 -33
  26. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +23 -33
  27. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +23 -41
  28. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +23 -45
  29. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +16 -33
  30. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +4 -7
  31. package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +8 -1
  32. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +4 -0
  33. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +13 -24
  34. package/dist/collection/components/molecules/mg-details/mg-details.js +4 -8
  35. package/dist/collection/components/molecules/mg-form/mg-form.js +8 -22
  36. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +2 -2
  37. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +0 -6
  38. package/dist/collection/components/molecules/mg-message/mg-message.css +13 -19
  39. package/dist/collection/components/molecules/mg-message/mg-message.js +8 -27
  40. package/dist/collection/components/molecules/mg-modal/mg-modal.css +12 -7
  41. package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -26
  42. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +4 -13
  43. package/dist/collection/components/molecules/mg-panel/mg-panel.css +10 -5
  44. package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -22
  45. package/dist/collection/components/molecules/mg-popover/mg-popover.css +13 -9
  46. package/dist/collection/components/molecules/mg-popover/mg-popover.js +7 -23
  47. package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +24 -0
  48. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js +1 -0
  49. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.css +28 -0
  50. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +77 -0
  51. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +10 -23
  52. package/dist/collection/locales/en/messages.json +3 -0
  53. package/dist/collection/locales/fr/messages.json +3 -0
  54. package/dist/components/index.d.ts +1 -0
  55. package/dist/components/index.js +1 -0
  56. package/dist/components/index2.js +8 -0
  57. package/dist/components/mg-badge2.js +4 -7
  58. package/dist/components/mg-button2.js +13 -30
  59. package/dist/components/mg-card.js +1 -37
  60. package/dist/components/mg-card2.js +39 -0
  61. package/dist/components/mg-character-left2.js +2 -3
  62. package/dist/components/mg-details.js +4 -8
  63. package/dist/components/mg-divider.js +0 -6
  64. package/dist/components/mg-form.js +8 -22
  65. package/dist/components/mg-icon2.js +5 -12
  66. package/dist/components/mg-illustrated-message.js +1 -7
  67. package/dist/components/mg-input-checkbox.js +17 -33
  68. package/dist/components/mg-input-date.js +17 -25
  69. package/dist/components/mg-input-numeric.js +24 -47
  70. package/dist/components/mg-input-password.js +17 -29
  71. package/dist/components/mg-input-radio.js +18 -33
  72. package/dist/components/mg-input-select2.js +24 -34
  73. package/dist/components/mg-input-text2.js +23 -41
  74. package/dist/components/mg-input-textarea.js +23 -45
  75. package/dist/components/mg-input-title2.js +4 -8
  76. package/dist/components/mg-input-toggle.js +16 -33
  77. package/dist/components/mg-menu-item.js +14 -25
  78. package/dist/components/mg-menu.js +4 -7
  79. package/dist/components/mg-message.js +17 -30
  80. package/dist/components/mg-modal.js +18 -30
  81. package/dist/components/mg-pagination.js +4 -13
  82. package/dist/components/mg-panel.js +20 -25
  83. package/dist/components/mg-popover.js +16 -26
  84. package/dist/components/mg-skip-links.d.ts +11 -0
  85. package/dist/components/mg-skip-links.js +66 -0
  86. package/dist/components/mg-tabs.js +10 -23
  87. package/dist/components/mg-tag.js +34 -12
  88. package/dist/components/mg-tooltip2.js +6 -19
  89. package/dist/esm/{index-aad0184c.js → index-78edde1d.js} +0 -0
  90. package/dist/esm/loader.js +3 -3
  91. package/dist/esm/{mg-badge_29.entry.js → mg-badge_30.entry.js} +380 -626
  92. package/dist/esm/mg-components.js +3 -3
  93. package/dist/esm/polyfills/core-js.js +0 -0
  94. package/dist/esm/polyfills/dom.js +0 -0
  95. package/dist/esm/polyfills/es5-html-element.js +0 -0
  96. package/dist/esm/polyfills/index.js +0 -0
  97. package/dist/esm/polyfills/system.js +0 -0
  98. package/dist/mg-components/locales/en/messages.json +3 -0
  99. package/dist/mg-components/locales/fr/messages.json +3 -0
  100. package/dist/mg-components/mg-components.css +1 -1
  101. package/dist/mg-components/mg-components.esm.js +1 -1
  102. package/dist/mg-components/{p-3899d5d2.js → p-125c54ca.js} +0 -0
  103. package/dist/mg-components/p-4961c96c.entry.js +1 -0
  104. package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -11
  105. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -1
  106. package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -11
  107. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
  108. package/dist/types/components/atoms/mg-button/mg-button.d.ts +6 -6
  109. package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -13
  110. package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +5 -1
  111. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +27 -6
  112. package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +1 -0
  113. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
  114. package/dist/types/components/molecules/mg-message/mg-message.d.ts +1 -1
  115. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -1
  116. package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +11 -0
  117. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +7 -0
  118. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +34 -0
  119. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +2 -2
  120. package/dist/types/components.d.ts +37 -6
  121. package/dist/types/locales/index.d.ts +6 -0
  122. package/dist/types/stencil-public-runtime.d.ts +5 -0
  123. package/dist/types/utils/unit.test.utils.d.ts +42 -0
  124. package/package.json +36 -31
  125. package/readme.md +3 -1
  126. package/dist/mg-components/p-059a9a59.entry.js +0 -1
@@ -18,39 +18,6 @@ export class MgInputCheckbox {
18
18
  this.inputs = [];
19
19
  // hasDisplayedError (triggered by blur event)
20
20
  this.hasDisplayedError = false;
21
- /**
22
- * Input name
23
- * If not set the value equals the identifier
24
- */
25
- this.name = this.identifier;
26
- /**
27
- * Define if label is visible
28
- */
29
- this.labelHide = false;
30
- /**
31
- * Define if inputs are display verticaly
32
- */
33
- this.inputVerticalList = false;
34
- /**
35
- * Define if input is required
36
- */
37
- this.required = false;
38
- /**
39
- * Define if input is readonly
40
- */
41
- this.readonly = false;
42
- /**
43
- * Define if input is disabled
44
- */
45
- this.disabled = false;
46
- /**
47
- * Component classes
48
- */
49
- this.classList = new ClassList(['mg-input--checkbox']);
50
- /**
51
- * Formated value for display
52
- */
53
- this.checkboxItems = [];
54
21
  /**
55
22
  * Handle input event
56
23
  *
@@ -100,6 +67,23 @@ export class MgInputCheckbox {
100
67
  this.errorMessage = this.messages.errors.required;
101
68
  }
102
69
  };
70
+ this.value = undefined;
71
+ this.identifier = undefined;
72
+ this.name = this.identifier;
73
+ this.label = undefined;
74
+ this.labelOnTop = undefined;
75
+ this.labelHide = false;
76
+ this.inputVerticalList = false;
77
+ this.required = false;
78
+ this.readonly = false;
79
+ this.disabled = false;
80
+ this.tooltip = undefined;
81
+ this.helpText = undefined;
82
+ this.valid = undefined;
83
+ this.invalid = undefined;
84
+ this.classList = new ClassList(['mg-input--checkbox']);
85
+ this.errorMessage = undefined;
86
+ this.checkboxItems = [];
103
87
  }
104
88
  validateValue(newValue) {
105
89
  if (newValue && newValue.every(item => isCheckboxItem(item))) {
@@ -8,31 +8,6 @@ export class MgInputDate {
8
8
  constructor() {
9
9
  // hasDisplayedError (triggered by blur event)
10
10
  this.hasDisplayedError = false;
11
- /**
12
- * Input name
13
- * If not set the value equals the identifier
14
- */
15
- this.name = this.identifier;
16
- /**
17
- * Define if label is visible
18
- */
19
- this.labelHide = false;
20
- /**
21
- * Define if input is required
22
- */
23
- this.required = false;
24
- /**
25
- * Define if input is readonly
26
- */
27
- this.readonly = false;
28
- /**
29
- * Define if input is disabled
30
- */
31
- this.disabled = false;
32
- /**
33
- * Component classes
34
- */
35
- this.classList = new ClassList(['mg-input--date']);
36
11
  /**
37
12
  * Handle input event
38
13
  */
@@ -111,6 +86,23 @@ export class MgInputDate {
111
86
  }
112
87
  }
113
88
  };
89
+ this.value = undefined;
90
+ this.identifier = undefined;
91
+ this.name = this.identifier;
92
+ this.label = undefined;
93
+ this.labelOnTop = undefined;
94
+ this.labelHide = false;
95
+ this.required = false;
96
+ this.readonly = false;
97
+ this.disabled = false;
98
+ this.tooltip = undefined;
99
+ this.helpText = undefined;
100
+ this.valid = undefined;
101
+ this.invalid = undefined;
102
+ this.min = undefined;
103
+ this.max = undefined;
104
+ this.classList = new ClassList(['mg-input--date']);
105
+ this.errorMessage = undefined;
114
106
  }
115
107
  validateValue(newValue) {
116
108
  if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !dateRegExp.test(newValue))) {
@@ -8,53 +8,6 @@ export class MgInputNumeric {
8
8
  constructor() {
9
9
  // hasDisplayedError (triggered by blur event)
10
10
  this.hasDisplayedError = false;
11
- /**
12
- * Input name
13
- * If not set the value equals the identifier
14
- */
15
- this.name = this.identifier;
16
- /**
17
- * Define if label is visible
18
- */
19
- this.labelHide = false;
20
- /**
21
- * Define if input is required
22
- */
23
- this.required = false;
24
- /**
25
- * Define if input is readonly
26
- */
27
- this.readonly = false;
28
- /**
29
- * Define if input is disabled
30
- */
31
- this.disabled = false;
32
- /**
33
- * Define numeric type
34
- */
35
- this.type = types[0];
36
- /**
37
- * Define currency
38
- */
39
- this.currency = 'USD';
40
- /**
41
- * Override integer length
42
- * integer is the number before the decimal point
43
- */
44
- this.integerLength = 13;
45
- /**
46
- * Override decimal length
47
- * decimal is the number after the decimal point
48
- */
49
- this.decimalLength = 2;
50
- /**
51
- * Component classes
52
- */
53
- this.classList = new ClassList(['mg-input--numeric']);
54
- /**
55
- * Define if input has focus
56
- */
57
- this.hasFocus = false;
58
11
  /**
59
12
  * Handle input event
60
13
  *
@@ -161,6 +114,30 @@ export class MgInputNumeric {
161
114
  this.classList.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-input--is-input-group-append' : 'mg-input--is-append-input-slot-content');
162
115
  }
163
116
  };
117
+ this.value = undefined;
118
+ this.identifier = undefined;
119
+ this.name = this.identifier;
120
+ this.label = undefined;
121
+ this.labelOnTop = undefined;
122
+ this.labelHide = false;
123
+ this.placeholder = undefined;
124
+ this.required = false;
125
+ this.readonly = false;
126
+ this.disabled = false;
127
+ this.mgWidth = undefined;
128
+ this.tooltip = undefined;
129
+ this.helpText = undefined;
130
+ this.type = types[0];
131
+ this.currency = 'USD';
132
+ this.max = undefined;
133
+ this.min = undefined;
134
+ this.integerLength = 13;
135
+ this.decimalLength = 2;
136
+ this.valid = undefined;
137
+ this.invalid = undefined;
138
+ this.classList = new ClassList(['mg-input--numeric']);
139
+ this.errorMessage = undefined;
140
+ this.hasFocus = false;
164
141
  }
165
142
  validateValue(newValue) {
166
143
  if (newValue !== undefined && newValue !== null) {
@@ -6,35 +6,6 @@ export class MgInputPassword {
6
6
  constructor() {
7
7
  // hasDisplayedError (triggered by blur event)
8
8
  this.hasDisplayedError = false;
9
- /**
10
- * Input name
11
- * If not set the value equals the identifier
12
- */
13
- this.name = this.identifier;
14
- /**
15
- * Define if label is visible
16
- */
17
- this.labelHide = false;
18
- /**
19
- * Define if input is required
20
- */
21
- this.required = false;
22
- /**
23
- * Define if input is readonly
24
- */
25
- this.readonly = false;
26
- /**
27
- * Define if input is disabled
28
- */
29
- this.disabled = false;
30
- /**
31
- * Define input width
32
- */
33
- this.mgWidth = 'full';
34
- /**
35
- * Component classes
36
- */
37
- this.classList = new ClassList(['mg-input--password']);
38
9
  /**
39
10
  * Handle input event
40
11
  */
@@ -72,6 +43,23 @@ export class MgInputPassword {
72
43
  this.errorMessage = this.messages.errors.required;
73
44
  }
74
45
  };
46
+ this.value = undefined;
47
+ this.identifier = undefined;
48
+ this.name = this.identifier;
49
+ this.label = undefined;
50
+ this.labelOnTop = undefined;
51
+ this.labelHide = false;
52
+ this.placeholder = undefined;
53
+ this.required = false;
54
+ this.readonly = false;
55
+ this.disabled = false;
56
+ this.mgWidth = 'full';
57
+ this.tooltip = undefined;
58
+ this.helpText = undefined;
59
+ this.valid = undefined;
60
+ this.invalid = undefined;
61
+ this.classList = new ClassList(['mg-input--password']);
62
+ this.errorMessage = undefined;
75
63
  }
76
64
  handleValue(newValue) {
77
65
  this.valueChange.emit(newValue);
@@ -20,39 +20,6 @@ export class MgInputRadio {
20
20
  this.inputs = [];
21
21
  // hasDisplayedError (triggered by blur event)
22
22
  this.hasDisplayedError = false;
23
- /**
24
- * Input name
25
- * If not set the value equals the identifier
26
- */
27
- this.name = this.identifier;
28
- /**
29
- * Define if label is displayed on top
30
- */
31
- this.labelOnTop = false;
32
- /**
33
- * Define if label is visible
34
- */
35
- this.labelHide = false;
36
- /**
37
- * Define if inputs are display verticaly
38
- */
39
- this.inputVerticalList = false;
40
- /**
41
- * Define if input is required
42
- */
43
- this.required = false;
44
- /**
45
- * Define if input is readonly
46
- */
47
- this.readonly = false;
48
- /**
49
- * Define if input is disabled
50
- */
51
- this.disabled = false;
52
- /**
53
- * Component classes
54
- */
55
- this.classList = new ClassList(['mg-input--radio']);
56
23
  /**
57
24
  * Handle input event
58
25
  *
@@ -102,6 +69,24 @@ export class MgInputRadio {
102
69
  * @returns {HTMLInputElement} element
103
70
  */
104
71
  this.getInvalidElement = () => this.inputs.find((input) => !input.disabled && !input.readOnly && !input.checkValidity());
72
+ this.value = undefined;
73
+ this.items = undefined;
74
+ this.identifier = undefined;
75
+ this.name = this.identifier;
76
+ this.label = undefined;
77
+ this.labelOnTop = false;
78
+ this.labelHide = false;
79
+ this.inputVerticalList = false;
80
+ this.required = false;
81
+ this.readonly = false;
82
+ this.disabled = false;
83
+ this.tooltip = undefined;
84
+ this.helpText = undefined;
85
+ this.valid = undefined;
86
+ this.invalid = undefined;
87
+ this.classList = new ClassList(['mg-input--radio']);
88
+ this.errorMessage = undefined;
89
+ this.options = undefined;
105
90
  }
106
91
  handleValue(newValue) {
107
92
  this.valueChange.emit(newValue);
@@ -44,39 +44,6 @@ export class MgInputSelect {
44
44
  constructor() {
45
45
  // hasDisplayedError (triggered by blur event)
46
46
  this.hasDisplayedError = false;
47
- /**
48
- * Input name
49
- * If not set the value equals the identifier
50
- */
51
- this.name = this.identifier;
52
- /**
53
- * Define if label is visible
54
- */
55
- this.labelHide = false;
56
- /**
57
- * Option to remove placeholder
58
- */
59
- this.placeholderHide = false;
60
- /**
61
- * Option to disable placeholder
62
- */
63
- this.placeholderDisabled = false;
64
- /**
65
- * Define if input is required
66
- */
67
- this.required = false;
68
- /**
69
- * Define if input is readonly
70
- */
71
- this.readonly = false;
72
- /**
73
- * Define if input is disabled
74
- */
75
- this.disabled = false;
76
- /**
77
- * Component classes
78
- */
79
- this.classList = new ClassList(['mg-input--select']);
80
47
  /**
81
48
  * Handle input event
82
49
  */
@@ -118,6 +85,29 @@ export class MgInputSelect {
118
85
  this.errorMessage = this.messages.errors.required;
119
86
  }
120
87
  };
88
+ this.value = undefined;
89
+ this.items = undefined;
90
+ this.identifier = undefined;
91
+ this.name = this.identifier;
92
+ this.label = undefined;
93
+ this.labelOnTop = undefined;
94
+ this.labelHide = false;
95
+ this.placeholder = undefined;
96
+ this.placeholderHide = false;
97
+ this.placeholderDisabled = false;
98
+ this.required = false;
99
+ this.readonly = false;
100
+ this.disabled = false;
101
+ this.mgWidth = undefined;
102
+ this.tooltip = undefined;
103
+ this.helpText = undefined;
104
+ this.valid = undefined;
105
+ this.invalid = undefined;
106
+ this.classList = new ClassList(['mg-input--select']);
107
+ this.errorMessage = undefined;
108
+ this.options = undefined;
109
+ this.valueExist = undefined;
110
+ this.readonlyValue = undefined;
121
111
  }
122
112
  handleValue(newValue) {
123
113
  if (newValue !== null) {
@@ -13,47 +13,6 @@ export class MgInputText {
13
13
  this.classHasIcon = 'mg-input--has-icon';
14
14
  // hasDisplayedError (triggered by blur event)
15
15
  this.hasDisplayedError = false;
16
- /**
17
- * Input name
18
- * If not set the value equals the identifier
19
- */
20
- this.name = this.identifier;
21
- /**
22
- * Input type
23
- */
24
- this.type = 'text';
25
- /**
26
- * Define if label is visible
27
- */
28
- this.labelHide = false;
29
- /**
30
- * Input max length
31
- */
32
- this.maxlength = 400;
33
- /**
34
- * Define if input is required
35
- */
36
- this.required = false;
37
- /**
38
- * Define if input is readonly
39
- */
40
- this.readonly = false;
41
- /**
42
- * Define if input is disabled
43
- */
44
- this.disabled = false;
45
- /**
46
- * Define input width
47
- */
48
- this.mgWidth = 'full';
49
- /**
50
- * Define if component should display character left
51
- */
52
- this.displayCharacterLeft = true;
53
- /**
54
- * Component classes
55
- */
56
- this.classList = new ClassList(['mg-input--text']);
57
16
  /**
58
17
  * Handle input event
59
18
  *
@@ -144,6 +103,29 @@ export class MgInputText {
144
103
  this.classList.add('mg-input--has-buttons-group-append');
145
104
  }
146
105
  };
106
+ this.value = undefined;
107
+ this.identifier = undefined;
108
+ this.name = this.identifier;
109
+ this.label = undefined;
110
+ this.type = 'text';
111
+ this.icon = undefined;
112
+ this.labelOnTop = undefined;
113
+ this.labelHide = false;
114
+ this.placeholder = undefined;
115
+ this.maxlength = 400;
116
+ this.required = false;
117
+ this.readonly = false;
118
+ this.disabled = false;
119
+ this.mgWidth = 'full';
120
+ this.pattern = undefined;
121
+ this.patternErrorMessage = undefined;
122
+ this.tooltip = undefined;
123
+ this.displayCharacterLeft = true;
124
+ this.helpText = undefined;
125
+ this.valid = undefined;
126
+ this.invalid = undefined;
127
+ this.classList = new ClassList(['mg-input--text']);
128
+ this.errorMessage = undefined;
147
129
  }
148
130
  handleValue(newValue) {
149
131
  this.valueChange.emit(newValue);
@@ -12,51 +12,6 @@ export class MgInputTextarea {
12
12
  this.classHasDisplayCharacterLeft = 'mg-input--has-display-character-left';
13
13
  // hasDisplayedError (triggered by blur event)
14
14
  this.hasDisplayedError = false;
15
- /**
16
- * Input name
17
- * If not set the value equals the identifier
18
- */
19
- this.name = this.identifier;
20
- /**
21
- * Define if label is visible
22
- */
23
- this.labelHide = false;
24
- /**
25
- * Input max length
26
- */
27
- this.maxlength = 4000;
28
- /**
29
- * Define if input is required
30
- */
31
- this.required = false;
32
- /**
33
- * Define if input is readonly
34
- */
35
- this.readonly = false;
36
- /**
37
- * Define if input is disabled
38
- */
39
- this.disabled = false;
40
- /**
41
- * Define input width
42
- */
43
- this.mgWidth = 'full';
44
- /**
45
- * Define the number of visible text lines for the control
46
- */
47
- this.rows = 3;
48
- /**
49
- * Define if component should display character left
50
- */
51
- this.displayCharacterLeft = true;
52
- /**
53
- * Define if input is resizable
54
- */
55
- this.resizable = 'none';
56
- /**
57
- * Component classes
58
- */
59
- this.classList = new ClassList(['mg-input--textarea']);
60
15
  /**
61
16
  * Handle input event
62
17
  */
@@ -127,6 +82,29 @@ export class MgInputTextarea {
127
82
  throw new Error('<mg-input-textarea> prop "pattern" must be paired with the prop "patternErrorMessage"');
128
83
  }
129
84
  };
85
+ this.value = undefined;
86
+ this.identifier = undefined;
87
+ this.name = this.identifier;
88
+ this.label = undefined;
89
+ this.labelOnTop = undefined;
90
+ this.labelHide = false;
91
+ this.placeholder = undefined;
92
+ this.maxlength = 4000;
93
+ this.required = false;
94
+ this.readonly = false;
95
+ this.disabled = false;
96
+ this.mgWidth = 'full';
97
+ this.pattern = undefined;
98
+ this.patternErrorMessage = undefined;
99
+ this.rows = 3;
100
+ this.tooltip = undefined;
101
+ this.displayCharacterLeft = true;
102
+ this.helpText = undefined;
103
+ this.valid = undefined;
104
+ this.invalid = undefined;
105
+ this.resizable = 'none';
106
+ this.classList = new ClassList(['mg-input--textarea']);
107
+ this.errorMessage = undefined;
130
108
  }
131
109
  handleValue(newValue) {
132
110
  this.checkValidity();
@@ -21,39 +21,6 @@ export class MgInputToggle {
21
21
  this.classIsActive = 'mg-input--toggle-is-active';
22
22
  this.classOnOff = 'mg-input--toggle-on-off';
23
23
  this.classIcon = 'mg-input--toggle-icon';
24
- /**
25
- * Input name
26
- * If not set the value equals the identifier
27
- */
28
- this.name = this.identifier;
29
- /**
30
- * Define if label is visible
31
- */
32
- this.labelHide = false;
33
- /**
34
- * Define if toggle have on/off style
35
- */
36
- this.isOnOff = false;
37
- /**
38
- * Define if toggle display icon
39
- */
40
- this.isIcon = false;
41
- /**
42
- * Define if input is readonly
43
- */
44
- this.readonly = false;
45
- /**
46
- * Define if input is disabled
47
- */
48
- this.disabled = false;
49
- /**
50
- * Component classes
51
- */
52
- this.classList = new ClassList(['mg-input--toggle']);
53
- /**
54
- * Checked internal value
55
- */
56
- this.checked = false;
57
24
  /**
58
25
  * Change checked value
59
26
  *
@@ -78,6 +45,22 @@ export class MgInputToggle {
78
45
  slots.forEach(slot => slot.setAttribute('title', slot.textContent));
79
46
  }
80
47
  };
48
+ this.value = undefined;
49
+ this.items = undefined;
50
+ this.identifier = undefined;
51
+ this.name = this.identifier;
52
+ this.label = undefined;
53
+ this.labelOnTop = undefined;
54
+ this.labelHide = false;
55
+ this.isOnOff = false;
56
+ this.isIcon = false;
57
+ this.readonly = false;
58
+ this.disabled = false;
59
+ this.tooltip = undefined;
60
+ this.helpText = undefined;
61
+ this.classList = new ClassList(['mg-input--toggle']);
62
+ this.options = undefined;
63
+ this.checked = false;
81
64
  }
82
65
  handleValue(newValue) {
83
66
  // Swich to the right option
@@ -7,10 +7,6 @@ export class MgMenu {
7
7
  ************/
8
8
  this.name = 'mg-menu';
9
9
  this.focusedMenuItem = 0;
10
- /**
11
- * Component display direction. Default: "horizontal"
12
- */
13
- this.direction = Direction.HORIZONTAL;
14
10
  /**
15
11
  * Close matching menu-item
16
12
  *
@@ -32,9 +28,7 @@ export class MgMenu {
32
28
  // add listeners on menu item and edit index
33
29
  this.menuItems.forEach((item, menuItemIndex) => {
34
30
  ['click', 'focus'].forEach(trigger => {
35
- (item.shadowRoot.querySelector('button') || item.shadowRoot.querySelector('a')).addEventListener(trigger, (event) => {
36
- event.preventDefault();
37
- event.stopPropagation();
31
+ (item.shadowRoot.querySelector('button') || item.shadowRoot.querySelector('a')).addEventListener(trigger, () => {
38
32
  this.focusedMenuItem = menuItemIndex;
39
33
  // reset expanded on previous active menu item
40
34
  this.menuItems.forEach((item, index) => {
@@ -44,6 +38,9 @@ export class MgMenu {
44
38
  });
45
39
  });
46
40
  };
41
+ this.label = undefined;
42
+ this.direction = Direction.HORIZONTAL;
43
+ this.isChildMenu = undefined;
47
44
  }
48
45
  validateLabel(newValue) {
49
46
  if (newValue === undefined) {
@@ -1,5 +1,6 @@
1
1
  import { h } from '@stencil/core';
2
2
  import { filterArgs } from '../../../../../../.storybook/utils';
3
+ import { Direction } from '../../mg-menu/mg-menu.conf';
3
4
  export default {
4
5
  component: 'mg-menu-item',
5
6
  title: 'Beta/menus/mg-menu-item',
@@ -17,6 +18,12 @@ MgMenuItem.args = {
17
18
  identifier: 'identifier',
18
19
  slot: h("span", { slot: "label" }, "My label"),
19
20
  };
21
+ export const MgMenuItemAsLink = Template.bind({});
22
+ MgMenuItemAsLink.args = {
23
+ identifier: 'identifier',
24
+ href: './',
25
+ slot: h("span", { slot: "label" }, "My label"),
26
+ };
20
27
  export const MgMenuItemWhitIcon = Template.bind({});
21
28
  MgMenuItemWhitIcon.args = Object.assign(Object.assign({}, MgMenuItem.args), { slot: [h("span", { slot: "label" }, "My label"), h("mg-icon", { icon: "user", slot: "illustration" })] });
22
29
  export const MgMenuItemWhitBadge = Template.bind({});
@@ -28,5 +35,5 @@ MgMenuItemWhitMetadata.args = Object.assign(Object.assign({}, MgMenuItem.args),
28
35
  export const MgMenuItemWhithSubmenu = Template.bind({});
29
36
  MgMenuItemWhithSubmenu.args = Object.assign(Object.assign({}, MgMenuItem.args), { slot: [
30
37
  h("span", { slot: "label" }, "My label"),
31
- h("mg-menu-vertical", { label: "submenu" }, h("mg-menu-item", null, h("span", { slot: "label" }, "Subitem 1")), h("mg-menu-item", null, h("mg-icon", { icon: "user", slot: "illustration" }), h("span", { slot: "label" }, "Subitem 2")), h("mg-menu-item", null, h("span", { slot: "label" }, "Subitem 3"), h("mg-icon", { icon: "user", slot: "illustration" }), h("mg-badge", { value: "2", label: "hello", slot: "information" }))),
38
+ h("mg-menu", { direction: Direction.VERTICAL, label: "submenu" }, h("mg-menu-item", null, h("span", { slot: "label" }, "Subitem 1")), h("mg-menu-item", null, h("mg-icon", { icon: "user", slot: "illustration" }), h("span", { slot: "label" }, "Subitem 2")), h("mg-menu-item", null, h("span", { slot: "label" }, "Subitem 3"), h("mg-icon", { icon: "user", slot: "illustration" }), h("mg-badge", { value: "2", label: "hello", slot: "information" }))),
32
39
  ] });
@@ -340,4 +340,8 @@
340
340
  white-space: nowrap;
341
341
  overflow: hidden;
342
342
  text-overflow: ellipsis;
343
+ }
344
+
345
+ :host([status=disabled]) {
346
+ pointer-events: none;
343
347
  }