@mgdis/mg-components 5.10.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/cjs/{index-9e1091ab.js → index-03d2557d.js} +3 -0
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mg-action-more_31.cjs.entry.js +444 -455
  4. package/dist/cjs/mg-components.cjs.js +2 -2
  5. package/dist/cjs/mg-item-more.cjs.entry.js +20 -29
  6. package/dist/cjs/{mg-menu.conf-1942ac70.js → mg-menu.conf-05ec32a3.js} +30 -16
  7. package/dist/collection/components/atoms/mg-badge/mg-badge.js +8 -9
  8. package/dist/collection/components/atoms/mg-button/mg-button.js +16 -20
  9. package/dist/collection/components/atoms/mg-card/mg-card.css +2 -0
  10. package/dist/collection/components/atoms/mg-card/mg-card.js +10 -12
  11. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +1 -2
  12. package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
  13. package/dist/collection/components/atoms/mg-icon/mg-icon.js +17 -19
  14. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -2
  15. package/dist/collection/components/atoms/mg-tag/mg-tag.js +11 -13
  16. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +20 -25
  17. package/dist/collection/components/molecules/inputs/MgInput.conf.js +4 -1
  18. package/dist/collection/components/molecules/inputs/MgInput.js +26 -18
  19. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -1
  20. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +18 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +126 -19
  22. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +7 -12
  24. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +14 -22
  26. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +6 -10
  28. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +10 -18
  30. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -32
  32. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +1 -1
  33. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +16 -31
  34. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +1 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +13 -17
  36. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +1 -1
  37. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +17 -23
  38. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +11 -18
  39. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +20 -29
  40. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -15
  41. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -3
  42. package/dist/collection/components/molecules/mg-form/mg-form.js +8 -19
  43. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -2
  44. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +4 -7
  45. package/dist/collection/components/molecules/mg-message/mg-message.css +1 -0
  46. package/dist/collection/components/molecules/mg-message/mg-message.js +11 -14
  47. package/dist/collection/components/molecules/mg-modal/mg-modal.css +1 -0
  48. package/dist/collection/components/molecules/mg-modal/mg-modal.js +7 -11
  49. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +11 -13
  50. package/dist/collection/components/molecules/mg-panel/mg-panel.css +1 -0
  51. package/dist/collection/components/molecules/mg-panel/mg-panel.js +6 -15
  52. package/dist/collection/components/molecules/mg-popover/mg-popover.css +2 -0
  53. package/dist/collection/components/molecules/mg-popover/mg-popover.js +16 -16
  54. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +2 -4
  55. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +20 -24
  56. package/dist/collection/locales/en/messages.json +7 -0
  57. package/dist/collection/locales/fr/messages.json +7 -0
  58. package/dist/collection/locales/index.js +2 -2
  59. package/dist/collection/styles/reset-mg-card-slotted-variables.scss +1 -0
  60. package/dist/collection/utils/behaviors.utils.js +16 -22
  61. package/dist/collection/utils/components.utils.js +21 -23
  62. package/dist/collection/utils/locale.utils.js +14 -14
  63. package/dist/collection/utils/unit.test.utils.js +7 -10
  64. package/dist/components/MgInput.js +30 -18
  65. package/dist/components/components.utils.js +21 -23
  66. package/dist/components/index2.js +30 -16
  67. package/dist/components/mg-action-more.js +9 -13
  68. package/dist/components/mg-badge2.js +8 -9
  69. package/dist/components/mg-button2.js +16 -20
  70. package/dist/components/mg-card2.js +9 -11
  71. package/dist/components/mg-character-left2.js +1 -2
  72. package/dist/components/mg-details.js +1 -3
  73. package/dist/components/mg-divider.js +1 -1
  74. package/dist/components/mg-form.js +7 -15
  75. package/dist/components/mg-icon2.js +17 -19
  76. package/dist/components/mg-illustrated-message.js +1 -2
  77. package/dist/components/mg-input-checkbox.js +126 -21
  78. package/dist/components/mg-input-date.js +7 -9
  79. package/dist/components/mg-input-numeric.js +14 -19
  80. package/dist/components/mg-input-password.js +6 -7
  81. package/dist/components/mg-input-radio.js +10 -15
  82. package/dist/components/mg-input-select2.js +21 -29
  83. package/dist/components/mg-input-text2.js +15 -24
  84. package/dist/components/mg-input-textarea.js +13 -14
  85. package/dist/components/mg-input-title2.js +1 -2
  86. package/dist/components/mg-input-toggle.js +17 -20
  87. package/dist/components/mg-item-more.js +18 -27
  88. package/dist/components/mg-menu-item2.js +17 -26
  89. package/dist/components/mg-menu2.js +9 -16
  90. package/dist/components/mg-message.js +12 -15
  91. package/dist/components/mg-modal.js +8 -12
  92. package/dist/components/mg-pagination.js +11 -13
  93. package/dist/components/mg-panel.js +7 -16
  94. package/dist/components/mg-popover2.js +17 -17
  95. package/dist/components/mg-skip-links.js +2 -4
  96. package/dist/components/mg-tabs.js +20 -24
  97. package/dist/components/mg-tag.js +11 -13
  98. package/dist/components/mg-tooltip2.js +20 -25
  99. package/dist/esm/{index-3249671d.js → index-407d5211.js} +3 -0
  100. package/dist/esm/loader.js +3 -3
  101. package/dist/esm/mg-action-more_31.entry.js +444 -455
  102. package/dist/esm/mg-components.js +3 -3
  103. package/dist/esm/mg-item-more.entry.js +20 -29
  104. package/dist/esm/{mg-menu.conf-2cc1bb67.js → mg-menu.conf-c8aa56ce.js} +30 -16
  105. package/dist/mg-components/locales/en/messages.json +7 -0
  106. package/dist/mg-components/locales/fr/messages.json +7 -0
  107. package/dist/mg-components/mg-components.css +1 -1
  108. package/dist/mg-components/mg-components.esm.js +1 -1
  109. package/dist/mg-components/p-3bf533f7.js +2 -0
  110. package/dist/mg-components/p-51c2def3.entry.js +1 -0
  111. package/dist/mg-components/p-b14be68b.js +1 -0
  112. package/dist/mg-components/{p-a56a3157.entry.js → p-d3ed97d3.entry.js} +1 -1
  113. package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +1 -0
  114. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +2 -3
  115. package/dist/types/components/atoms/mg-button/mg-button.d.ts +5 -9
  116. package/dist/types/components/atoms/mg-card/mg-card.d.ts +2 -6
  117. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +1 -2
  118. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +1 -1
  119. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +3 -5
  120. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -2
  121. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +3 -5
  122. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +15 -21
  123. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -1
  124. package/dist/types/components/molecules/inputs/MgInput.d.ts +5 -5
  125. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +8 -0
  126. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +40 -7
  127. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -6
  128. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +7 -14
  129. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +3 -4
  130. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -10
  131. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -2
  132. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +9 -13
  133. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +3 -12
  134. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -5
  135. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -6
  136. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +10 -18
  137. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +21 -31
  138. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +3 -10
  139. package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -3
  140. package/dist/types/components/molecules/mg-form/mg-form.d.ts +3 -11
  141. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +1 -2
  142. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +2 -7
  143. package/dist/types/components/molecules/mg-message/mg-message.d.ts +4 -7
  144. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +3 -7
  145. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +5 -9
  146. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +4 -13
  147. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +7 -9
  148. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +2 -4
  149. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +15 -19
  150. package/dist/types/components.d.ts +31 -35
  151. package/dist/types/locales/index.d.ts +16 -2
  152. package/dist/types/utils/behaviors.utils.d.ts +14 -20
  153. package/dist/types/utils/components.utils.d.ts +18 -20
  154. package/dist/types/utils/locale.utils.d.ts +14 -14
  155. package/dist/types/utils/unit.test.utils.d.ts +11 -17
  156. package/package.json +4 -4
  157. package/dist/mg-components/p-73156ac9.js +0 -1
  158. package/dist/mg-components/p-8fbc0d87.js +0 -2
  159. package/dist/mg-components/p-eb32bb18.entry.js +0 -1
@@ -7,8 +7,8 @@ import { ClassList, allItemsAreString } from '../../../../utils/components.utils
7
7
  import { initLocales } from '../../../../locales';
8
8
  /**
9
9
  * type Option validation function
10
- * @param {RadioOption} option radio option
11
- * @returns {boolean} radio option type is valid
10
+ * @param option - radio option
11
+ * @returns radio option type is valid
12
12
  */
13
13
  const isOption = (option) => typeof option === 'object' && typeof option.title === 'string' && option.value !== undefined;
14
14
  export class MgInputRadio {
@@ -22,8 +22,7 @@ export class MgInputRadio {
22
22
  this.hasDisplayedError = false;
23
23
  /**
24
24
  * Handle input event
25
- * @param {event} event input event
26
- * @returns {void}
25
+ * @param event - input event
27
26
  */
28
27
  this.handleInput = (event) => {
29
28
  this.checkValidity();
@@ -31,7 +30,6 @@ export class MgInputRadio {
31
30
  };
32
31
  /**
33
32
  * Handle blur event
34
- * @returns {void}
35
33
  */
36
34
  this.handleBlur = () => {
37
35
  this.checkValidity();
@@ -39,7 +37,6 @@ export class MgInputRadio {
39
37
  };
40
38
  /**
41
39
  * Check if input is valid
42
- * @returns {void}
43
40
  */
44
41
  this.checkValidity = () => {
45
42
  this.valid = this.readonly || this.disabled || this.getInvalidElement() === undefined;
@@ -49,7 +46,6 @@ export class MgInputRadio {
49
46
  };
50
47
  /**
51
48
  * Set input error message
52
- * @returns {void}
53
49
  */
54
50
  this.setErrorMessage = () => {
55
51
  const invalidElement = this.getInvalidElement();
@@ -61,7 +57,7 @@ export class MgInputRadio {
61
57
  };
62
58
  /**
63
59
  * get invalid element
64
- * @returns {HTMLInputElement} element
60
+ * @returns element
65
61
  */
66
62
  this.getInvalidElement = () => this.inputs.find((input) => !input.disabled && !input.readOnly && !input.checkValidity());
67
63
  this.value = undefined;
@@ -79,7 +75,7 @@ export class MgInputRadio {
79
75
  this.helpText = undefined;
80
76
  this.valid = undefined;
81
77
  this.invalid = undefined;
82
- this.classList = new ClassList(['mg-input--radio']);
78
+ this.classCollection = new ClassList(['mg-input--radio']);
83
79
  this.errorMessage = undefined;
84
80
  this.options = undefined;
85
81
  }
@@ -115,7 +111,6 @@ export class MgInputRadio {
115
111
  }
116
112
  /**
117
113
  * Public method to display errors
118
- * @returns {Promise<void>}
119
114
  */
120
115
  async displayError() {
121
116
  this.checkValidity();
@@ -127,7 +122,7 @@ export class MgInputRadio {
127
122
  *************/
128
123
  /**
129
124
  * Check if component props are well configured on init
130
- * @returns {ReturnType<typeof setTimeout>} timeout
125
+ * @returns timeout
131
126
  */
132
127
  componentWillLoad() {
133
128
  // Get locales
@@ -143,10 +138,10 @@ export class MgInputRadio {
143
138
  }
144
139
  /**
145
140
  * Render
146
- * @returns {HTMLElement} HTML Element
141
+ * @returns HTML Element
147
142
  */
148
143
  render() {
149
- return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList }, role: "list" }, this.options.map((input, index) => (h("li", { key: input.title, class: { 'mg-input__input-group': true, 'mg-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 => {
144
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList }, role: "list" }, this.options.map((input, index) => (h("li", { key: input.title, class: { 'mg-input__input-group': true, 'mg-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 => {
150
145
  if (el !== null)
151
146
  this.inputs[index] = el;
152
147
  } }), h("label", { htmlFor: this.identifier + '_' + index }, input.title)))))));
@@ -434,7 +429,7 @@ export class MgInputRadio {
434
429
  }
435
430
  static get states() {
436
431
  return {
437
- "classList": {},
432
+ "classCollection": {},
438
433
  "errorMessage": {},
439
434
  "options": {}
440
435
  };
@@ -487,10 +482,7 @@ export class MgInputRadio {
487
482
  },
488
483
  "docs": {
489
484
  "text": "Public method to display errors",
490
- "tags": [{
491
- "name": "returns",
492
- "text": undefined
493
- }]
485
+ "tags": []
494
486
  }
495
487
  }
496
488
  };
@@ -84,7 +84,7 @@
84
84
  .mg-input__input + .mg-input__help-text, .mg-input__input + .mg-input__error {
85
85
  margin-top: 0.5rem;
86
86
  }
87
- .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle {
87
+ .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle, .mg-input.mg-input--checkbox-multi-disabled .mg-input__input strong {
88
88
  opacity: var(--mg-disabled-opacity);
89
89
  }
90
90
 
@@ -6,31 +6,27 @@ import { ClassList, allItemsAreString } from '../../../../utils/components.utils
6
6
  import { initLocales } from '../../../../locales';
7
7
  /**
8
8
  * Check if item is a well configured option
9
- * @param {unknown} option select option
10
- * @returns {boolean} select option type is valid
9
+ * @param option - select option
10
+ * @returns select option type is valid
11
11
  */
12
12
  const isOption = (option) => typeof option === 'object' && typeof option.title === 'string';
13
13
  /**
14
14
  * Check if items[] is SelectOption
15
- * @param {unknown[]} items select option
16
- * @returns {boolean} select option array type is valid
15
+ * @param items - select option
16
+ * @returns select option array type is valid
17
17
  */
18
18
  const allItemsAreOptions = (items) => Array.isArray(items) && items.every(item => isOption(item));
19
19
  /**
20
20
  * Check if item is a well configured optgroup
21
- * @param {unknown} optgroup select option
22
- * @returns {boolean} select optgroup type is valid
21
+ * @param optgroup - select option
22
+ * @returns select optgroup type is valid
23
23
  */
24
24
  const isOptGroup = (optgroup) => typeof optgroup === 'object' && typeof optgroup.group === 'string' && allItemsAreOptions(optgroup.options);
25
25
  /**
26
26
  * Group options
27
- * @param {(SelectOption | OptGroup)[]} acc reduce accumulator
28
- * @param {SelectOption} item item to add
29
- * @param {string} item.group item group
30
- * @param {string} item.title item title
31
- * @param {unknown} item.value item value
32
- * @param {boolean} item.disabled is item disabled
33
- * @returns {(SelectOption | OptGroup)[]} grouped options
27
+ * @param acc - reduce accumulator
28
+ * @param item - item to add
29
+ * @returns grouped options
34
30
  */
35
31
  const groupOptions = (acc, { group, title, value, disabled }) => {
36
32
  if (group !== undefined) {
@@ -56,7 +52,6 @@ export class MgInputSelect {
56
52
  this.hasDisplayedError = false;
57
53
  /**
58
54
  * Handle input event
59
- * @returns {void}
60
55
  */
61
56
  this.handleInput = () => {
62
57
  this.updateValue();
@@ -65,14 +60,13 @@ export class MgInputSelect {
65
60
  };
66
61
  /**
67
62
  * Method to compare item.title with input.value
68
- * @param {SelectOption} item item to compare with
69
- * @returns {boolean} truthy if input.value is an item
63
+ * @param item - item to compare with
64
+ * @returns truthy if input.value is an item
70
65
  */
71
66
  this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
72
67
  /**
73
68
  * value props setter
74
- * @param {MgInputSelect['value']} newValue value to update with
75
- * @returns {void}
69
+ * @param newValue - value to update with
76
70
  */
77
71
  this.setValue = (newValue) => {
78
72
  this.checkValidity();
@@ -80,7 +74,6 @@ export class MgInputSelect {
80
74
  };
81
75
  /**
82
76
  * Update value from input.value
83
- * @returns {void}
84
77
  */
85
78
  this.updateValue = () => {
86
79
  if (this.input.value === '') {
@@ -106,7 +99,7 @@ export class MgInputSelect {
106
99
  };
107
100
  /**
108
101
  * Input value is disabled
109
- * @returns {boolean} truthy if input value is disabled
102
+ * @returns truthy if input value is disabled
110
103
  */
111
104
  this.isDisabledValue = () => { var _a; return allItemsAreOptions(this.options) && ((_a = this.options.find(this.isInputValue)) === null || _a === void 0 ? void 0 : _a.disabled) === true; };
112
105
  /**
@@ -131,8 +124,8 @@ export class MgInputSelect {
131
124
  };
132
125
  /**
133
126
  * Render option
134
- * @param {SelectOption} option to render
135
- * @returns {HTMLElement} render option
127
+ * @param option - to render
128
+ * @returns render option
136
129
  */
137
130
  this.renderOption = (option) => (h("option", { key: option.title, value: option.title, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title));
138
131
  this.value = undefined;
@@ -153,7 +146,7 @@ export class MgInputSelect {
153
146
  this.helpText = undefined;
154
147
  this.valid = undefined;
155
148
  this.invalid = undefined;
156
- this.classList = new ClassList(['mg-input--select']);
149
+ this.classCollection = new ClassList(['mg-input--select']);
157
150
  this.errorMessage = undefined;
158
151
  this.options = undefined;
159
152
  this.valueExist = undefined;
@@ -211,7 +204,6 @@ export class MgInputSelect {
211
204
  }
212
205
  /**
213
206
  * Public method to display errors
214
- * @returns {Promise<void>}
215
207
  */
216
208
  async displayError() {
217
209
  this.checkValidity();
@@ -223,7 +215,7 @@ export class MgInputSelect {
223
215
  *************/
224
216
  /**
225
217
  * Check if component props are well configured on init
226
- * @returns {ReturnType<typeof setTimeout>} timeout
218
+ * @returns timeout
227
219
  */
228
220
  componentWillLoad() {
229
221
  // Get locales
@@ -244,10 +236,10 @@ export class MgInputSelect {
244
236
  }
245
237
  /**
246
238
  * Render
247
- * @returns {HTMLElement} HTML Element
239
+ * @returns HTML Element
248
240
  */
249
241
  render() {
250
- return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: undefined, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("select", { class: "mg-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => {
242
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: undefined, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("select", { class: "mg-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => {
251
243
  if (el !== null)
252
244
  this.input = el;
253
245
  } }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
@@ -592,7 +584,7 @@ export class MgInputSelect {
592
584
  }
593
585
  static get states() {
594
586
  return {
595
- "classList": {},
587
+ "classCollection": {},
596
588
  "errorMessage": {},
597
589
  "options": {},
598
590
  "valueExist": {},
@@ -651,10 +643,7 @@ export class MgInputSelect {
651
643
  },
652
644
  "docs": {
653
645
  "text": "Public method to display errors",
654
- "tags": [{
655
- "name": "returns",
656
- "text": undefined
657
- }]
646
+ "tags": []
658
647
  }
659
648
  }
660
649
  };
@@ -84,7 +84,7 @@
84
84
  .mg-input__input + .mg-input__help-text, .mg-input__input + .mg-input__error {
85
85
  margin-top: 0.5rem;
86
86
  }
87
- .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle {
87
+ .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle, .mg-input.mg-input--checkbox-multi-disabled .mg-input__input strong {
88
88
  opacity: var(--mg-disabled-opacity);
89
89
  }
90
90
 
@@ -15,7 +15,6 @@ export class MgInputText {
15
15
  this.hasDisplayedError = false;
16
16
  /**
17
17
  * Handle input event
18
- * @returns {void}
19
18
  */
20
19
  this.handleInput = () => {
21
20
  this.checkValidity();
@@ -26,26 +25,23 @@ export class MgInputText {
26
25
  };
27
26
  /**
28
27
  * Handle focus event
29
- * @returns {void}
30
28
  */
31
29
  this.handleFocus = () => {
32
- this.classList.add(this.classFocus);
33
- this.classList = new ClassList(this.classList.classes);
30
+ this.classCollection.add(this.classFocus);
31
+ this.classCollection = new ClassList(this.classCollection.classes);
34
32
  };
35
33
  /**
36
34
  * Handle blur event
37
- * @returns {void}
38
35
  */
39
36
  this.handleBlur = () => {
40
37
  // Manage focus
41
- this.classList.delete(this.classFocus);
42
- this.classList = new ClassList(this.classList.classes);
38
+ this.classCollection.delete(this.classFocus);
39
+ this.classCollection = new ClassList(this.classCollection.classes);
43
40
  // Display Error
44
41
  this.displayError();
45
42
  };
46
43
  /**
47
44
  * Check if input is valid
48
- * @returns {void}
49
45
  */
50
46
  this.checkValidity = () => {
51
47
  var _a;
@@ -56,7 +52,6 @@ export class MgInputText {
56
52
  };
57
53
  /**
58
54
  * Set input error message
59
- * @returns {void}
60
55
  */
61
56
  this.setErrorMessage = () => {
62
57
  // Set error message
@@ -72,7 +67,6 @@ export class MgInputText {
72
67
  };
73
68
  /**
74
69
  * Validate pattern configuration
75
- * @returns {void}
76
70
  */
77
71
  this.validatePattern = () => {
78
72
  if (this.pattern !== undefined &&
@@ -84,16 +78,15 @@ export class MgInputText {
84
78
  };
85
79
  /**
86
80
  * Validate append slot
87
- * @returns {void}
88
81
  */
89
82
  this.validateAppendSlot = () => {
90
83
  const slotAppendInput = Array.from(this.element.querySelectorAll('[slot="append-input"]'));
91
84
  if (slotAppendInput.length === 1) {
92
- this.classList.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : 'mg-input--is-append-input-slot-content');
85
+ this.classCollection.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : 'mg-input--is-append-input-slot-content');
93
86
  }
94
87
  else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {
95
- this.classList.add(this.classIsInputGroupAppend);
96
- this.classList.add('mg-input--has-buttons-group-append');
88
+ this.classCollection.add(this.classIsInputGroupAppend);
89
+ this.classCollection.add('mg-input--has-buttons-group-append');
97
90
  }
98
91
  };
99
92
  this.value = undefined;
@@ -117,7 +110,7 @@ export class MgInputText {
117
110
  this.helpText = undefined;
118
111
  this.valid = undefined;
119
112
  this.invalid = undefined;
120
- this.classList = new ClassList(['mg-input--text']);
113
+ this.classCollection = new ClassList(['mg-input--text']);
121
114
  this.errorMessage = undefined;
122
115
  }
123
116
  handleValue(newValue) {
@@ -125,10 +118,10 @@ export class MgInputText {
125
118
  }
126
119
  validateIcon(newValue) {
127
120
  if (newValue !== undefined) {
128
- this.classList.add(this.classHasIcon);
121
+ this.classCollection.add(this.classHasIcon);
129
122
  }
130
123
  else {
131
- this.classList.delete(this.classHasIcon);
124
+ this.classCollection.delete(this.classHasIcon);
132
125
  }
133
126
  }
134
127
  handleValidityChange(newValue, _oldValue, prop) {
@@ -143,14 +136,12 @@ export class MgInputText {
143
136
  }
144
137
  /**
145
138
  * Public method to play input focus
146
- * @returns {Promise<void>}
147
139
  */
148
140
  async setFocus() {
149
141
  this.input.focus();
150
142
  }
151
143
  /**
152
144
  * Public method to display errors
153
- * @returns {Promise<void>}
154
145
  */
155
146
  async displayError() {
156
147
  this.checkValidity();
@@ -162,7 +153,7 @@ export class MgInputText {
162
153
  *************/
163
154
  /**
164
155
  * Check if component props are well configured on init
165
- * @returns {ReturnType<typeof setTimeout>} timeout
156
+ * @returns timeout
166
157
  */
167
158
  componentWillLoad() {
168
159
  // Get locales
@@ -181,10 +172,10 @@ export class MgInputText {
181
172
  }
182
173
  /**
183
174
  * Render
184
- * @returns {HTMLElement} HTML Element
175
+ * @returns HTML Element
185
176
  */
186
177
  render() {
187
- return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-input__with-character-left", style: {
178
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-input__with-character-left", style: {
188
179
  '--mg-character-left-message-length': (this.displayCharacterLeft
189
180
  ? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
190
181
  : 0).toString(),
@@ -582,7 +573,7 @@ export class MgInputText {
582
573
  }
583
574
  static get states() {
584
575
  return {
585
- "classList": {},
576
+ "classCollection": {},
586
577
  "errorMessage": {}
587
578
  };
588
579
  }
@@ -634,10 +625,7 @@ export class MgInputText {
634
625
  },
635
626
  "docs": {
636
627
  "text": "Public method to play input focus",
637
- "tags": [{
638
- "name": "returns",
639
- "text": undefined
640
- }]
628
+ "tags": []
641
629
  }
642
630
  },
643
631
  "displayError": {
@@ -653,10 +641,7 @@ export class MgInputText {
653
641
  },
654
642
  "docs": {
655
643
  "text": "Public method to display errors",
656
- "tags": [{
657
- "name": "returns",
658
- "text": undefined
659
- }]
644
+ "tags": []
660
645
  }
661
646
  }
662
647
  };
@@ -84,7 +84,7 @@
84
84
  .mg-input__input + .mg-input__help-text, .mg-input__input + .mg-input__error {
85
85
  margin-top: 0.5rem;
86
86
  }
87
- .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle {
87
+ .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle, .mg-input.mg-input--checkbox-multi-disabled .mg-input__input strong {
88
88
  opacity: var(--mg-disabled-opacity);
89
89
  }
90
90
 
@@ -26,23 +26,23 @@ export class MgInputTextarea {
26
26
  * Handle focus event
27
27
  */
28
28
  this.handleFocus = () => {
29
- this.classList.add(this.classFocus);
30
- this.classList = new ClassList(this.classList.classes);
29
+ this.classCollection.add(this.classFocus);
30
+ this.classCollection = new ClassList(this.classCollection.classes);
31
31
  };
32
32
  /**
33
33
  * Handle blur event
34
34
  */
35
35
  this.handleBlur = () => {
36
36
  // Manage focus
37
- this.classList.delete(this.classFocus);
38
- this.classList = new ClassList(this.classList.classes);
37
+ this.classCollection.delete(this.classFocus);
38
+ this.classCollection = new ClassList(this.classCollection.classes);
39
39
  // Display Error
40
40
  this.displayError();
41
41
  };
42
42
  /**
43
43
  * Get pattern validity
44
44
  * Pattern is not defined on textarea field: https://developer.mozilla.org/fr/docs/Web/HTML/Element/Textarea
45
- * @returns {boolean} is pattern valid
45
+ * @returns is pattern valid
46
46
  */
47
47
  this.getPatternValidity = () => this.pattern === undefined || new RegExp(`^${this.pattern}$`, 'u').test(this.value);
48
48
  /**
@@ -102,7 +102,7 @@ export class MgInputTextarea {
102
102
  this.valid = undefined;
103
103
  this.invalid = undefined;
104
104
  this.resizable = 'none';
105
- this.classList = new ClassList(['mg-input--textarea']);
105
+ this.classCollection = new ClassList(['mg-input--textarea']);
106
106
  this.errorMessage = undefined;
107
107
  }
108
108
  handleValue(newValue) {
@@ -121,15 +121,14 @@ export class MgInputTextarea {
121
121
  }
122
122
  validateDisplayCharacterLeft(newValue) {
123
123
  if (newValue) {
124
- this.classList.add(this.classHasDisplayCharacterLeft);
124
+ this.classCollection.add(this.classHasDisplayCharacterLeft);
125
125
  }
126
126
  else {
127
- this.classList.delete(this.classHasDisplayCharacterLeft);
127
+ this.classCollection.delete(this.classHasDisplayCharacterLeft);
128
128
  }
129
129
  }
130
130
  /**
131
131
  * Public method to display errors
132
- * @returns {Promise<void>}
133
132
  */
134
133
  async displayError() {
135
134
  this.checkValidity();
@@ -141,7 +140,7 @@ export class MgInputTextarea {
141
140
  *************/
142
141
  /**
143
142
  * Check if component props are well configured on init
144
- * @returns {ReturnType<typeof setTimeout>} timeout
143
+ * @returns timeout
145
144
  */
146
145
  componentWillLoad() {
147
146
  // Get locales
@@ -159,10 +158,10 @@ export class MgInputTextarea {
159
158
  }
160
159
  /**
161
160
  * Render
162
- * @returns {HTMLElement} HTML Element
161
+ * @returns HTML Element
163
162
  */
164
163
  render() {
165
- return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-input__with-character-left" }, h("textarea", { class: {
164
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [this.characterLeftId], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("div", { class: "mg-input__with-character-left" }, h("textarea", { class: {
166
165
  'mg-input__box': true,
167
166
  'mg-input__box--resizable': this.resizable === 'both',
168
167
  'mg-input__box--resizable-horizontal': this.resizable === 'horizontal',
@@ -562,7 +561,7 @@ export class MgInputTextarea {
562
561
  }
563
562
  static get states() {
564
563
  return {
565
- "classList": {},
564
+ "classCollection": {},
566
565
  "errorMessage": {}
567
566
  };
568
567
  }
@@ -614,10 +613,7 @@ export class MgInputTextarea {
614
613
  },
615
614
  "docs": {
616
615
  "text": "Public method to display errors",
617
- "tags": [{
618
- "name": "returns",
619
- "text": undefined
620
- }]
616
+ "tags": []
621
617
  }
622
618
  }
623
619
  };
@@ -84,7 +84,7 @@
84
84
  .mg-input__input + .mg-input__help-text, .mg-input__input + .mg-input__error {
85
85
  margin-top: 0.5rem;
86
86
  }
87
- .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle {
87
+ .mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle, .mg-input.mg-input--checkbox-multi-disabled .mg-input__input strong {
88
88
  opacity: var(--mg-disabled-opacity);
89
89
  }
90
90