@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
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Create random ID
3
- * @param {string} prefix add prefix to created ID
4
- * @param {number} length ID length
5
- * @returns {string} ID
3
+ * @param prefix - add prefix to created ID
4
+ * @param length - ID length
5
+ * @returns ID
6
6
  */
7
7
  const createID = (prefix = '', length = 10) => {
8
8
  let ID = '';
@@ -21,8 +21,7 @@ class ClassList {
21
21
  constructor(classlist = []) {
22
22
  /**
23
23
  * Add class
24
- * @param {string} className class name to add
25
- * @returns {void}
24
+ * @param className - class name to add
26
25
  */
27
26
  this.add = (className) => {
28
27
  if (!this.has(className)) {
@@ -31,8 +30,7 @@ class ClassList {
31
30
  };
32
31
  /**
33
32
  * Delete class
34
- * @param {string} className class name to delete
35
- * @returns {void}
33
+ * @param className - class name to delete
36
34
  */
37
35
  this.delete = (className) => {
38
36
  const index = this.classes.indexOf(className);
@@ -42,15 +40,15 @@ class ClassList {
42
40
  };
43
41
  /**
44
42
  * Check if class exist in list
45
- * @param {string} className class name to check
46
- * @returns {boolean} class name is in the list
43
+ * @param className - class name to check
44
+ * @returns class name is in the list
47
45
  */
48
46
  this.has = (className) => {
49
47
  return this.classes.includes(className);
50
48
  };
51
49
  /**
52
50
  * Join classes seperated by spaces
53
- * @returns {string} joined values
51
+ * @returns joined values
54
52
  */
55
53
  this.join = () => {
56
54
  return this.classes.join(' ');
@@ -60,15 +58,15 @@ class ClassList {
60
58
  }
61
59
  /**
62
60
  * Check if all items are string
63
- * @param {unknown} items items to check
64
- * @returns {boolean} all items are string
61
+ * @param items - items to check
62
+ * @returns all items are string
65
63
  */
66
64
  const allItemsAreString = (items) => Array.isArray(items) && items.every(item => typeof item === 'string');
67
65
  /**
68
66
  * Check if element is a heading
69
- * @param {Element} element slotted element
70
- * @param {string[]} tagNames allowed tag names list
71
- * @returns {boolean} element is a heading
67
+ * @param element - slotted element
68
+ * @param tagNames - allowed tag names list
69
+ * @returns element is a heading
72
70
  */
73
71
  const isTagName = (element, tagNames) => {
74
72
  return tagNames.includes(element === null || element === void 0 ? void 0 : element.tagName.toLowerCase());
@@ -79,8 +77,8 @@ const isTagName = (element, tagNames) => {
79
77
  const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier]';
80
78
  /**
81
79
  * Get windows
82
- * @param {Window} localWindow the window we are lookink for other windows
83
- * @returns {Window[]} The list of windows found
80
+ * @param localWindow - the window we are lookink for other windows
81
+ * @returns The list of windows found
84
82
  */
85
83
  const getWindows = (localWindow) => {
86
84
  const parentWindows = getParentWindows(localWindow);
@@ -89,9 +87,9 @@ const getWindows = (localWindow) => {
89
87
  };
90
88
  /**
91
89
  * Get parent windows
92
- * @param {Window} localWindow the window we are lookink for parents
93
- * @param {Window[]} windows The list of allready found windows
94
- * @returns {Window[]} The list of windows found
90
+ * @param localWindow - the window we are lookink for parents
91
+ * @param windows - The list of allready found windows
92
+ * @returns The list of windows found
95
93
  */
96
94
  const getParentWindows = (localWindow, windows = []) => {
97
95
  // Check if is in iframe
@@ -111,9 +109,9 @@ const getParentWindows = (localWindow, windows = []) => {
111
109
  };
112
110
  /**
113
111
  * Get child windows
114
- * @param {Window} localWindow the window we are lookink for children
115
- * @param {Window[]} windows The list of allready found windows
116
- * @returns {Window[]} The list of windows found
112
+ * @param localWindow - the window we are lookink for children
113
+ * @param windows - The list of allready found windows
114
+ * @returns The list of windows found
117
115
  */
118
116
  const getChildWindows = (localWindow, windows = []) => {
119
117
  if (localWindow.frames.length > 0) {
@@ -16,6 +16,13 @@ const nbCharLeft$1 = "{counter} characters left.";
16
16
  const input$1 = {
17
17
  select: {
18
18
  placeholder: "Select a value"
19
+ },
20
+ checkbox: {
21
+ selectedValues: "{nb} selected values",
22
+ selectedValue: "{nb} selected value",
23
+ editButton: "Edit",
24
+ selectButton: "Select values",
25
+ showButton: "Show"
19
26
  }
20
27
  };
21
28
  const form$1 = {
@@ -91,6 +98,13 @@ const nbCharLeft = "{counter} caractères disponibles.";
91
98
  const input = {
92
99
  select: {
93
100
  placeholder: "Sélectionnez une valeur"
101
+ },
102
+ checkbox: {
103
+ selectedValues: "{nb} valeurs selectionnées",
104
+ selectedValue: "{nb} valeur selectionnée",
105
+ editButton: "Modifier",
106
+ selectButton: "Sélectionner des valeurs",
107
+ showButton: "Voir"
94
108
  }
95
109
  };
96
110
  const form = {
@@ -150,19 +164,19 @@ const fr = {
150
164
 
151
165
  /**
152
166
  * Format number to the locale currency
153
- * @param {number} number number to format
154
- * @param {string} locale locale to apply
155
- * @param {string} currency currency to apply
156
- * @returns {string} formatted currency
167
+ * @param number - number to format
168
+ * @param locale - locale to apply
169
+ * @param currency - currency to apply
170
+ * @returns formatted currency
157
171
  */
158
172
  const localeCurrency = (number, locale, currency) => {
159
173
  return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
160
174
  };
161
175
  /**
162
176
  * Format number to locale
163
- * @param {number} number number to format
164
- * @param {string} locale locale to apply
165
- * @returns {string} formatted number
177
+ * @param number - number to format
178
+ * @param locale - locale to apply
179
+ * @returns formatted number
166
180
  */
167
181
  const localeNumber = (number, locale) => {
168
182
  return new Intl.NumberFormat(locale).format(number);
@@ -173,9 +187,9 @@ const localeNumber = (number, locale) => {
173
187
  const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
174
188
  /**
175
189
  * Locale date format
176
- * @param {string} date date to format
177
- * @param {string} locale locale to apply
178
- * @returns {string} formatted date
190
+ * @param date - date to format
191
+ * @param locale - locale to apply
192
+ * @returns formatted date
179
193
  */
180
194
  const localeDate = (date, locale) => {
181
195
  if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
@@ -186,10 +200,10 @@ const localeDate = (date, locale) => {
186
200
  /**
187
201
  * Get locale and messages
188
202
  * We load the defined locale but for now we only support the first subtag for messages
189
- * @param {HTMLElement} element element we need to get the language
190
- * @param {unknown} messages messages to use
191
- * @param {string} defaultLocale default messages locale
192
- * @returns {{ locale: string; messages: Record<string, unknown> }} messages object
203
+ * @param element - element we need to get the language
204
+ * @param messages - messages to use
205
+ * @param defaultLocale - default messages locale
206
+ * @returns messages object
193
207
  */
194
208
  const getLocaleMessages = (element, messages, defaultLocale) => {
195
209
  // Get local
@@ -209,8 +223,8 @@ const defaultLocale = 'en';
209
223
  const messages = { en, fr };
210
224
  /**
211
225
  * Get Intl object
212
- * @param {HTMLElement} element element we need to get the language
213
- * @returns {{ locale: string; messages: Record<string, unknown> }} messages object
226
+ * @param element - element we need to get the language
227
+ * @returns messages object
214
228
  */
215
229
  const initLocales = (element) => getLocaleMessages(element, messages, defaultLocale);
216
230
 
@@ -14,8 +14,8 @@ const mgActionMoreCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1
14
14
 
15
15
  /**
16
16
  * MgActionMore['items'] type guard
17
- * @param {unknown} prop commponent items prop
18
- * @returns {boolean} return true if type is valid
17
+ * @param prop - commponent items prop
18
+ * @returns return true if type is valid
19
19
  */
20
20
  const isMgActionMoreItems = (prop) => {
21
21
  const items = prop;
@@ -23,8 +23,8 @@ const isMgActionMoreItems = (prop) => {
23
23
  };
24
24
  /**
25
25
  * MgActionMore['button'] type guard
26
- * @param {unknown} prop commponent button prop
27
- * @returns {boolean} return true if type is valid
26
+ * @param prop - commponent button prop
27
+ * @returns return true if type is valid
28
28
  */
29
29
  const isMgActionMoreButton = (prop) => {
30
30
  const button = prop;
@@ -32,8 +32,8 @@ const isMgActionMoreButton = (prop) => {
32
32
  };
33
33
  /**
34
34
  * MgActionMore['icon'] type guard
35
- * @param {unknown} prop commponent icon prop
36
- * @returns {boolean} return true if type is valid
35
+ * @param prop - commponent icon prop
36
+ * @returns return true if type is valid
37
37
  */
38
38
  const isMgActionMoreIcon = (prop) => {
39
39
  const icon = prop;
@@ -54,23 +54,20 @@ const MgActionMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
54
54
  ***********/
55
55
  /**
56
56
  * Toogle expanded props
57
- * @returns {void}
58
57
  */
59
58
  this.toggleExpanded = () => {
60
59
  this.expanded = !this.expanded;
61
60
  };
62
61
  /**
63
62
  * Button click handler
64
- * @returns {void}
65
63
  */
66
64
  this.handleButton = () => {
67
65
  this.toggleExpanded();
68
66
  };
69
67
  /**
70
68
  * Item click handler
71
- * @param {MouseEvent} event click event
72
- * @param {MgActionMoreItemType['mouseEventHandler']} customHandler item['mouseEventHandler']
73
- * @returns {void}
69
+ * @param event - click event
70
+ * @param customHandler - item['mouseEventHandler']
74
71
  */
75
72
  this.handleItemClick = (event, customHandler) => {
76
73
  this.expanded = false;
@@ -107,7 +104,6 @@ const MgActionMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
107
104
  *************/
108
105
  /**
109
106
  * Validate props
110
- * @returns {void}
111
107
  */
112
108
  componentWillLoad() {
113
109
  this.messages = initLocales(this.element).messages.actionMore;
@@ -118,7 +114,7 @@ const MgActionMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
118
114
  }
119
115
  /**
120
116
  * Render
121
- * @returns {HTMLElement} HTML Element
117
+ * @returns HTML Element
122
118
  */
123
119
  render() {
124
120
  const buttonLabel = this.button.label || this.messages.label;
@@ -22,7 +22,7 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
22
22
  this.label = undefined;
23
23
  this.variant = variants[0];
24
24
  this.outline = undefined;
25
- this.classList = new ClassList(['mg-badge']);
25
+ this.classCollection = new ClassList(['mg-badge']);
26
26
  }
27
27
  validateValue(newValue) {
28
28
  if (`${newValue}`.match(/^(\d+\+*|[?*!a-z])$/i) === null) {
@@ -40,20 +40,19 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
40
40
  }
41
41
  else {
42
42
  if (oldValue !== undefined) {
43
- this.classList.delete(`mg-badge--${oldValue}`);
43
+ this.classCollection.delete(`mg-badge--${oldValue}`);
44
44
  }
45
- this.classList.add(`mg-badge--${newValue}`);
45
+ this.classCollection.add(`mg-badge--${newValue}`);
46
46
  }
47
47
  }
48
48
  validateOutline(newValue) {
49
49
  if (newValue)
50
- this.classList.add(this.classOutline);
50
+ this.classCollection.add(this.classOutline);
51
51
  else
52
- this.classList.delete(this.classOutline);
52
+ this.classCollection.delete(this.classOutline);
53
53
  }
54
54
  /**
55
55
  * Check if props are well configured on init
56
- * @returns {void}
57
56
  */
58
57
  componentWillLoad() {
59
58
  this.validateValue(this.value);
@@ -63,10 +62,10 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
63
62
  }
64
63
  /**
65
64
  * Render
66
- * @returns {HTMLElement} HTML Element
65
+ * @returns HTML Element
67
66
  */
68
67
  render() {
69
- return (h("span", { class: this.classList.join() }, h("span", { class: "mg-badge__value" }, this.value), h("span", { class: "sr-only" }, this.label)));
68
+ return (h("span", { class: this.classCollection.join() }, h("span", { class: "mg-badge__value" }, this.value), h("span", { class: "sr-only" }, this.label)));
70
69
  }
71
70
  static get watchers() { return {
72
71
  "value": ["validateValue"],
@@ -80,7 +79,7 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
80
79
  "label": [1],
81
80
  "variant": [1],
82
81
  "outline": [4],
83
- "classList": [32]
82
+ "classCollection": [32]
84
83
  }]);
85
84
  function defineCustomElement() {
86
85
  if (typeof customElements === "undefined") {
@@ -24,8 +24,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
24
24
  this.classFullWidth = 'mg-button--full-width';
25
25
  /**
26
26
  * Trigger actions onClick event
27
- * @param {MouseEvent} event click event
28
- * @returns {void}
27
+ * @param event - click event
29
28
  */
30
29
  this.handleClick = (event) => {
31
30
  if (this.disabled)
@@ -38,8 +37,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
38
37
  };
39
38
  /**
40
39
  * Handle onKeydown event
41
- * @param {KeyboardEvent} event keyboard event
42
- * @returns {void}
40
+ * @param event - keyboard event
43
41
  */
44
42
  this.handleKeydown = (event) => {
45
43
  if (!this.disabled && event.key === ' ') {
@@ -52,8 +50,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
52
50
  };
53
51
  /**
54
52
  * Handle onKeyup event
55
- * @param {KeyboardEvent} event keyboard event
56
- * @returns {void}
53
+ * @param event - keyboard event
57
54
  */
58
55
  this.handleKeyup = (event) => {
59
56
  if (!this.disabled && event.key === ' ') {
@@ -71,7 +68,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
71
68
  this.isIcon = false;
72
69
  this.disableOnClick = false;
73
70
  this.loading = false;
74
- this.classList = new ClassList(['mg-button']);
71
+ this.classCollection = new ClassList(['mg-button']);
75
72
  }
76
73
  validateVariant(newValue, oldValue) {
77
74
  if (!variants.includes(newValue)) {
@@ -79,9 +76,9 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
79
76
  }
80
77
  else {
81
78
  if (oldValue !== undefined) {
82
- this.classList.delete(`mg-button--${oldValue}`);
79
+ this.classCollection.delete(`mg-button--${oldValue}`);
83
80
  }
84
- this.classList.add(`mg-button--${newValue}`);
81
+ this.classCollection.add(`mg-button--${newValue}`);
85
82
  }
86
83
  }
87
84
  validateFullWidth(newValue) {
@@ -89,10 +86,10 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
89
86
  throw new Error('<mg-button> prop "fullWidth" cannot be used with prop "isIcon".');
90
87
  }
91
88
  else if (newValue) {
92
- this.classList.add(this.classFullWidth);
89
+ this.classCollection.add(this.classFullWidth);
93
90
  }
94
91
  else {
95
- this.classList.delete(this.classFullWidth);
92
+ this.classCollection.delete(this.classFullWidth);
96
93
  }
97
94
  }
98
95
  disabledHandler(isDisabled) {
@@ -105,10 +102,10 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
105
102
  this.element.onclick = isDisabled ? undefined : this.onClickElementFn;
106
103
  // apply style
107
104
  if (isDisabled) {
108
- this.classList.add(this.classDisabled);
105
+ this.classCollection.add(this.classDisabled);
109
106
  }
110
107
  else {
111
- this.classList.delete(this.classDisabled);
108
+ this.classCollection.delete(this.classDisabled);
112
109
  }
113
110
  // emit value update
114
111
  this.disabledChange.emit(isDisabled);
@@ -116,21 +113,20 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
116
113
  loadingHandler(newValue) {
117
114
  // we add loading style if it newvalue is true else we remove it
118
115
  if (newValue) {
119
- this.classList.add(this.classLoading);
116
+ this.classCollection.add(this.classLoading);
120
117
  }
121
118
  else {
122
- this.classList.delete(this.classLoading);
119
+ this.classCollection.delete(this.classLoading);
123
120
  }
124
121
  }
125
122
  /**
126
123
  * Check if props are well configured on init
127
- * @returns {void}
128
124
  */
129
125
  componentWillLoad() {
130
126
  this.validateVariant(this.variant);
131
127
  this.validateFullWidth(this.fullWidth);
132
128
  if (this.isIcon) {
133
- this.classList.add(`mg-button--icon`);
129
+ this.classCollection.add(`mg-button--icon`);
134
130
  if (typeof this.label !== 'string' || this.label.trim() === '') {
135
131
  throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
136
132
  }
@@ -141,10 +137,10 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
141
137
  }
142
138
  /**
143
139
  * Render component
144
- * @returns {HTMLElement} html element
140
+ * @returns html element
145
141
  */
146
142
  render() {
147
- return (h(Host, { role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { class: this.classList.join(), id: this.identifier }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null)))));
143
+ return (h(Host, { role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { class: this.classCollection.join(), id: this.identifier }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null)))));
148
144
  }
149
145
  get element() { return this; }
150
146
  static get watchers() { return {
@@ -165,7 +161,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
165
161
  "isIcon": [4, "is-icon"],
166
162
  "disableOnClick": [4, "disable-on-click"],
167
163
  "loading": [32],
168
- "classList": [32]
164
+ "classCollection": [32]
169
165
  }]);
170
166
  function defineCustomElement() {
171
167
  if (typeof customElements === "undefined") {
@@ -10,7 +10,7 @@ const variants = ['info', 'warning', 'success', 'danger', 'app'];
10
10
  */
11
11
  const variantStyles = ['bar-left', 'fill'];
12
12
 
13
- const mgCardCss = ".mg-card{position:relative;width:100%;max-width:var(--mg-card-max-width);padding:var(--mg-card-padding, var(--mg-card-padding-default));overflow:var(--mg-card-overflow, var(--mg-card-overflow-default));box-sizing:border-box;z-index:inherit;background:var(--mg-card-background, var(--mg-card-background-default));border:var(--mg-card-border, var(--mg-card-border-default));border-radius:var(--mg-card-border-radius, var(--mg-card-border-radius-default));box-shadow:var(--mg-card-box-shadow, var(--mg-card-box-shadow-default))}.mg-card ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default);--mg-card-max-width:unset}.mg-card.mg-card--info{overflow:hidden}.mg-card.mg-card--info.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-card.mg-card--info.mg-card--fill{background-color:hsl(var(--color-info-h), var(--color-info-s), var(--mg-color-soft-l))}.mg-card.mg-card--warning{overflow:hidden}.mg-card.mg-card--warning.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-warning-h), var(--color-warning-s), var(--color-warning-l))}.mg-card.mg-card--warning.mg-card--fill{background-color:hsl(var(--color-warning-h), var(--color-warning-s), var(--mg-color-soft-l))}.mg-card.mg-card--success{overflow:hidden}.mg-card.mg-card--success.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-card.mg-card--success.mg-card--fill{background-color:hsl(var(--color-success-h), var(--color-success-s), var(--mg-color-soft-l))}.mg-card.mg-card--danger{overflow:hidden}.mg-card.mg-card--danger.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-card.mg-card--danger.mg-card--fill{background-color:hsl(var(--color-danger-h), var(--color-danger-s), var(--mg-color-soft-l))}.mg-card.mg-card--app{overflow:hidden}.mg-card.mg-card--app.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--mg-color-app-h), var(--mg-color-app-s), var(--mg-color-app-l))}.mg-card.mg-card--app.mg-card--fill{background-color:hsl(var(--mg-color-app-h), var(--mg-color-app-s), var(--mg-color-soft-l))}.mg-card__bar{position:absolute;top:0;left:0;width:0.3rem;height:100%}";
13
+ const mgCardCss = ".mg-card{position:relative;width:100%;max-width:var(--mg-card-max-width);min-width:var(--mg-card-min-width);padding:var(--mg-card-padding, var(--mg-card-padding-default));overflow:var(--mg-card-overflow, var(--mg-card-overflow-default));box-sizing:border-box;z-index:inherit;background:var(--mg-card-background, var(--mg-card-background-default));border:var(--mg-card-border, var(--mg-card-border-default));border-radius:var(--mg-card-border-radius, var(--mg-card-border-radius-default));box-shadow:var(--mg-card-box-shadow, var(--mg-card-box-shadow-default))}.mg-card ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default);--mg-card-max-width:unset;--mg-card-min-width:unset}.mg-card.mg-card--info{overflow:hidden}.mg-card.mg-card--info.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-card.mg-card--info.mg-card--fill{background-color:hsl(var(--color-info-h), var(--color-info-s), var(--mg-color-soft-l))}.mg-card.mg-card--warning{overflow:hidden}.mg-card.mg-card--warning.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-warning-h), var(--color-warning-s), var(--color-warning-l))}.mg-card.mg-card--warning.mg-card--fill{background-color:hsl(var(--color-warning-h), var(--color-warning-s), var(--mg-color-soft-l))}.mg-card.mg-card--success{overflow:hidden}.mg-card.mg-card--success.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-card.mg-card--success.mg-card--fill{background-color:hsl(var(--color-success-h), var(--color-success-s), var(--mg-color-soft-l))}.mg-card.mg-card--danger{overflow:hidden}.mg-card.mg-card--danger.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-card.mg-card--danger.mg-card--fill{background-color:hsl(var(--color-danger-h), var(--color-danger-s), var(--mg-color-soft-l))}.mg-card.mg-card--app{overflow:hidden}.mg-card.mg-card--app.mg-card--bar-left .mg-card__bar{background-color:hsl(var(--mg-color-app-h), var(--mg-color-app-s), var(--mg-color-app-l))}.mg-card.mg-card--app.mg-card--fill{background-color:hsl(var(--mg-color-app-h), var(--mg-color-app-s), var(--mg-color-soft-l))}.mg-card__bar{position:absolute;top:0;left:0;width:0.3rem;height:100%}";
14
14
 
15
15
  const MgCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
16
16
  constructor() {
@@ -25,7 +25,6 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
25
25
  /**
26
26
  * Methode to set default varianStyle props
27
27
  * needeed has stencil doesn't know that props is mutated when updated in prop watcher
28
- * @returns {void}
29
28
  */
30
29
  this.setDefaultVariantStyle = () => {
31
30
  if (this.variantStyle === undefined)
@@ -33,17 +32,17 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
33
32
  };
34
33
  this.variant = undefined;
35
34
  this.variantStyle = undefined;
36
- this.classList = new ClassList([this.baseClass]);
35
+ this.classCollection = new ClassList([this.baseClass]);
37
36
  }
38
37
  validateVariant(newValue, oldValue) {
39
38
  if (newValue && !variants.includes(newValue))
40
39
  throw new Error(`<${this.name}> prop "variant" must match VariantType type.`);
41
40
  if (Boolean(newValue)) {
42
41
  this.setDefaultVariantStyle();
43
- this.classList.add(`${this.baseClass}--${newValue}`);
42
+ this.classCollection.add(`${this.baseClass}--${newValue}`);
44
43
  }
45
44
  if (Boolean(oldValue))
46
- this.classList.delete(`${this.baseClass}--${oldValue}`);
45
+ this.classCollection.delete(`${this.baseClass}--${oldValue}`);
47
46
  }
48
47
  validateVariantStyle(newValue, oldValue) {
49
48
  if (newValue && !variantStyles.includes(newValue))
@@ -51,16 +50,15 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
51
50
  else if (Boolean(newValue) && !variants.includes(this.variant))
52
51
  throw new Error(`<${this.name}> prop "variantStyle" must be paired with ${JSON.stringify(variants)} "variant" prop.`);
53
52
  if (Boolean(newValue))
54
- this.classList.add(`${this.baseClass}--${newValue}`);
53
+ this.classCollection.add(`${this.baseClass}--${newValue}`);
55
54
  if (Boolean(oldValue))
56
- this.classList.delete(`${this.baseClass}--${oldValue}`);
55
+ this.classCollection.delete(`${this.baseClass}--${oldValue}`);
57
56
  }
58
57
  /*************
59
58
  * Lifecycle *
60
59
  *************/
61
60
  /**
62
61
  * Check if props are well configured on init
63
- * @returns {void}
64
62
  */
65
63
  componentWillLoad() {
66
64
  this.validateVariant(this.variant);
@@ -68,11 +66,11 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
68
66
  }
69
67
  /**
70
68
  * Render
71
- * @returns {HTMLElement} HTML Element
69
+ * @returns HTML Element
72
70
  */
73
71
  render() {
74
72
  var _a;
75
- return (h("div", { class: this.classList.join() }, ((_a = this.variantStyle) === null || _a === void 0 ? void 0 : _a.startsWith('bar-')) && h("span", { class: "mg-card__bar" }), h("slot", null)));
73
+ return (h("div", { class: this.classCollection.join() }, ((_a = this.variantStyle) === null || _a === void 0 ? void 0 : _a.startsWith('bar-')) && h("span", { class: "mg-card__bar" }), h("slot", null)));
76
74
  }
77
75
  static get watchers() { return {
78
76
  "variant": ["validateVariant"],
@@ -82,7 +80,7 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
82
80
  }, [1, "mg-card", {
83
81
  "variant": [1],
84
82
  "variantStyle": [1025, "variant-style"],
85
- "classList": [32]
83
+ "classCollection": [32]
86
84
  }]);
87
85
  function defineCustomElement() {
88
86
  if (typeof customElements === "undefined") {
@@ -21,7 +21,6 @@ const MgCharacterLeft = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
21
21
  *************/
22
22
  /**
23
23
  * Check if props are well configured on init
24
- * @returns {void}
25
24
  */
26
25
  componentWillLoad() {
27
26
  this.validateMaxlength(this.maxlength);
@@ -29,7 +28,7 @@ const MgCharacterLeft = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
29
28
  }
30
29
  /**
31
30
  * Render component
32
- * @returns {HTMLElement} HTML Element
31
+ * @returns HTML Element
33
32
  */
34
33
  render() {
35
34
  return (h("span", { id: this.identifier, "aria-live": "polite" }, h("span", { "aria-hidden": "true" }, this.maxlength - this.characters.length, "/", this.maxlength), h("span", { class: "sr-only" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
@@ -11,7 +11,6 @@ const MgDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11
11
  this.expandedChange = createEvent(this, "expanded-change", 7);
12
12
  /**
13
13
  * Handle details toggle
14
- * @returns {void}
15
14
  */
16
15
  this.handleToggle = () => {
17
16
  this.expanded = this.details.open;
@@ -34,7 +33,6 @@ const MgDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
34
33
  *************/
35
34
  /**
36
35
  * Check if component props are well configured on init
37
- * @returns {void}
38
36
  */
39
37
  componentWillLoad() {
40
38
  this.validateTitles(this.toggleClosed);
@@ -42,7 +40,7 @@ const MgDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
42
40
  }
43
41
  /**
44
42
  * Render
45
- * @returns {HTMLElement} HTML Element
43
+ * @returns HTML Element
46
44
  */
47
45
  render() {
48
46
  return (h("details", { class: "mg-details", onToggle: this.handleToggle, open: this.expanded, ref: el => (this.details = el) }, h("summary", null, h("slot", { name: "summary" }), h("span", { class: "mg-details__toggle" }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down', size: "small" }), h("span", { class: { 'sr-only': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { class: "mg-details__details" }, h("slot", { name: "details" }))));
@@ -11,7 +11,7 @@ const MgDivider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11
11
  }
12
12
  /**
13
13
  * Render
14
- * @returns {HTMLElement} HTML Element
14
+ * @returns HTML Element
15
15
  */
16
16
  render() {
17
17
  return (h("div", { class: {