@mgdis/mg-components 6.20.0 → 6.22.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 (205) hide show
  1. package/dist/cjs/{index-TUElr4Wv.js → index-BxB20_Vw.js} +54 -0
  2. package/dist/cjs/{index-Bp6wZzau.js → index-C2viYwrR.js} +1761 -80
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/mg-action-more_37.cjs.entry.js +761 -371
  5. package/dist/cjs/mg-alert.cjs.entry.js +17 -9
  6. package/dist/cjs/mg-breadcrumb.cjs.entry.js +63 -0
  7. package/dist/cjs/mg-components.cjs.js +3 -3
  8. package/dist/cjs/mg-fieldset.cjs.entry.js +24 -7
  9. package/dist/cjs/mg-input-combobox.cjs.entry.js +49 -19
  10. package/dist/cjs/mg-input-file.cjs.entry.js +384 -0
  11. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +40096 -15821
  12. package/dist/cjs/{mg-input.conf-D7jmj_lh.js → mg-input.conf-BNpeATnq.js} +7 -0
  13. package/dist/cjs/mg-loader.cjs.entry.js +8 -6
  14. package/dist/cjs/mg-progress.cjs.entry.js +19 -9
  15. package/dist/collection/assets/icons/index.js +1 -1
  16. package/dist/collection/collection-manifest.json +5 -3
  17. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
  18. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
  20. package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.js +2 -2
  22. package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
  23. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  24. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
  26. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -2
  28. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -2
  29. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +1 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
  32. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +877 -0
  33. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
  34. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +2 -2
  35. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
  36. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +212 -0
  37. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.js +1 -0
  38. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +300 -94
  39. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.js +29 -0
  40. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +163 -53
  41. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
  43. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
  45. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +3 -36
  46. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js +0 -4
  47. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +21 -43
  48. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +65 -38
  49. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
  50. package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
  51. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.js +1 -0
  52. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +92 -0
  53. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  54. package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +12 -3
  55. package/dist/collection/components/molecules/mg-form/mg-form.js +12 -2
  56. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  57. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  58. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  59. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  60. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  61. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  62. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  63. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  64. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  65. package/dist/collection/components/molecules/mg-table/mg-table.js +37 -0
  66. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +0 -4
  67. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +13 -33
  68. package/dist/collection/locales/en/messages.json +14 -0
  69. package/dist/collection/locales/fr/messages.json +14 -0
  70. package/dist/components/events.utils.js +1 -23
  71. package/dist/components/index.d.ts +2 -0
  72. package/dist/components/index.js +1 -1
  73. package/dist/components/index2.js +1 -408
  74. package/dist/components/index3.js +1 -476
  75. package/dist/components/mg-action-more.js +1 -254
  76. package/dist/components/mg-alert.js +1 -224
  77. package/dist/components/mg-badge.js +1 -6
  78. package/dist/components/mg-badge2.js +1 -113
  79. package/dist/components/mg-breadcrumb.d.ts +11 -0
  80. package/dist/components/mg-breadcrumb.js +1 -0
  81. package/dist/components/mg-button.js +1 -6
  82. package/dist/components/mg-button2.js +1 -275
  83. package/dist/components/mg-card.js +1 -6
  84. package/dist/components/mg-card2.js +1 -92
  85. package/dist/components/mg-character-left.js +1 -6
  86. package/dist/components/mg-character-left2.js +1 -75
  87. package/dist/components/mg-details.js +1 -104
  88. package/dist/components/mg-divider.js +1 -6
  89. package/dist/components/mg-divider2.js +1 -49
  90. package/dist/components/mg-fieldset.js +1 -209
  91. package/dist/components/mg-form.js +1 -302
  92. package/dist/components/mg-icon.js +1 -6
  93. package/dist/components/mg-icon2.js +1 -188
  94. package/dist/components/mg-illustrated-message.js +1 -129
  95. package/dist/components/mg-input-checkbox-paginated.js +1 -6
  96. package/dist/components/mg-input-checkbox-paginated2.js +1 -135
  97. package/dist/components/mg-input-checkbox.js +1 -762
  98. package/dist/components/mg-input-combobox.js +1 -940
  99. package/dist/components/mg-input-date.js +1 -463
  100. package/dist/components/mg-input-file.d.ts +11 -0
  101. package/dist/components/mg-input-file.js +1 -0
  102. package/dist/components/mg-input-numeric.js +1 -592
  103. package/dist/components/mg-input-password.js +1 -360
  104. package/dist/components/mg-input-radio.js +1 -392
  105. package/dist/components/mg-input-rich-text-editor.js +1663 -16797
  106. package/dist/components/mg-input-select.js +1 -6
  107. package/dist/components/mg-input-select2.js +1 -481
  108. package/dist/components/mg-input-text.js +1 -6
  109. package/dist/components/mg-input-text2.js +1 -514
  110. package/dist/components/mg-input-textarea.js +1 -412
  111. package/dist/components/mg-input-title.js +1 -6
  112. package/dist/components/mg-input-title2.js +1 -81
  113. package/dist/components/mg-input-toggle.js +1 -371
  114. package/dist/components/mg-input.conf.js +1 -0
  115. package/dist/components/mg-input.js +1 -6
  116. package/dist/components/mg-input2.js +1 -459
  117. package/dist/components/mg-item-more.js +1 -6
  118. package/dist/components/mg-item-more2.js +1 -505
  119. package/dist/components/mg-loader.js +1 -6
  120. package/dist/components/mg-loader2.js +1 -74
  121. package/dist/components/mg-menu-item.js +1 -6
  122. package/dist/components/mg-menu-item2.js +1 -485
  123. package/dist/components/mg-menu.js +1 -6
  124. package/dist/components/mg-message.js +1 -6
  125. package/dist/components/mg-message2.js +1 -146
  126. package/dist/components/mg-modal.js +1 -184
  127. package/dist/components/mg-pagination.js +1 -234
  128. package/dist/components/mg-panel.js +1 -350
  129. package/dist/components/mg-popover-content.js +1 -6
  130. package/dist/components/mg-popover-content2.js +1 -96
  131. package/dist/components/mg-popover.js +1 -6
  132. package/dist/components/mg-popover2.js +1 -312
  133. package/dist/components/mg-progress.js +1 -123
  134. package/dist/components/mg-skip-links.js +1 -78
  135. package/dist/components/mg-table.js +1 -319
  136. package/dist/components/mg-tabs.js +1 -6
  137. package/dist/components/mg-tabs2.js +1 -315
  138. package/dist/components/mg-tag.js +1 -133
  139. package/dist/components/mg-tooltip-content.js +1 -6
  140. package/dist/components/mg-tooltip-content2.js +1 -42
  141. package/dist/components/mg-tooltip.js +1 -6
  142. package/dist/components/mg-tooltip2.js +1 -421
  143. package/dist/components/popper.js +1 -1790
  144. package/dist/esm/{index-BluNKQ3L.js → index-DFwaH2hS.js} +1761 -80
  145. package/dist/esm/{index-CNX6lq0x.js → index-DSEloqPn.js} +54 -1
  146. package/dist/esm/loader.js +3 -3
  147. package/dist/esm/mg-action-more_37.entry.js +761 -371
  148. package/dist/esm/mg-alert.entry.js +17 -9
  149. package/dist/esm/mg-breadcrumb.entry.js +61 -0
  150. package/dist/esm/mg-components.js +4 -4
  151. package/dist/esm/mg-fieldset.entry.js +24 -7
  152. package/dist/esm/mg-input-combobox.entry.js +49 -19
  153. package/dist/esm/mg-input-file.entry.js +382 -0
  154. package/dist/esm/mg-input-rich-text-editor.entry.js +40083 -15808
  155. package/dist/esm/{mg-input.conf-DDnrE1hD.js → mg-input.conf-C9rmNQIL.js} +7 -1
  156. package/dist/esm/mg-loader.entry.js +8 -6
  157. package/dist/esm/mg-progress.entry.js +19 -9
  158. package/dist/mg-components/locales/en/messages.json +14 -0
  159. package/dist/mg-components/locales/fr/messages.json +14 -0
  160. package/dist/mg-components/mg-components.esm.js +1 -1
  161. package/dist/mg-components/p-0482eb9f.entry.js +1 -0
  162. package/dist/mg-components/{p-7132bca1.entry.js → p-2ee92f38.entry.js} +1 -1
  163. package/dist/mg-components/{p-916dfb6d.entry.js → p-3b653226.entry.js} +1 -1
  164. package/dist/mg-components/p-5745fbea.entry.js +1 -0
  165. package/dist/mg-components/p-C9rmNQIL.js +1 -0
  166. package/dist/mg-components/p-DFwaH2hS.js +2 -0
  167. package/dist/mg-components/p-DSEloqPn.js +1 -0
  168. package/dist/mg-components/p-adec7fcc.entry.js +1 -0
  169. package/dist/mg-components/p-c63f97f0.entry.js +1658 -0
  170. package/dist/mg-components/p-c8c8cfc1.entry.js +1 -0
  171. package/dist/mg-components/p-cc793586.entry.js +1 -0
  172. package/dist/mg-components/p-d5e69c95.entry.js +1 -0
  173. package/dist/types/assets/icons/index.d.ts +2 -0
  174. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +7 -1
  175. package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +210 -0
  176. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +17 -0
  177. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/index.d.ts +27 -19
  178. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +3 -0
  179. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +50 -16
  180. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +0 -5
  181. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.d.ts +1 -6
  182. package/dist/types/components/molecules/menus/mg-menu/mg-menu.conf.d.ts +2 -10
  183. package/dist/types/components/molecules/menus/mg-menu/mg-menu.d.ts +7 -7
  184. package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +12 -8
  185. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.d.ts +18 -0
  186. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +34 -0
  187. package/dist/types/components/molecules/mg-table/mg-table.d.ts +6 -0
  188. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +1 -9
  189. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +4 -4
  190. package/dist/types/components.d.ts +302 -46
  191. package/dist/types/stencil-public-runtime.d.ts +76 -12
  192. package/ide/intellij/web-types.json +483 -51
  193. package/ide/vscode/css-custom-data.json +10 -2
  194. package/ide/vscode/html-custom-data.json +445 -104
  195. package/package.json +24 -23
  196. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +0 -1
  197. package/dist/mg-components/p-016bd291.entry.js +0 -1
  198. package/dist/mg-components/p-186a6139.entry.js +0 -1
  199. package/dist/mg-components/p-BluNKQ3L.js +0 -2
  200. package/dist/mg-components/p-CNX6lq0x.js +0 -1
  201. package/dist/mg-components/p-DDnrE1hD.js +0 -1
  202. package/dist/mg-components/p-cd061b38.entry.js +0 -1
  203. package/dist/mg-components/p-d2c72f09.entry.js +0 -1
  204. package/dist/mg-components/p-d5a276eb.entry.js +0 -1
  205. package/ide/vscode/custom.css-data.json +0 -425
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { directions, sizes } from "./mg-menu.conf";
2
+ import { directions } from "./mg-menu.conf";
3
3
  import { toString } from "@mgdis/core-ui-helpers/dist/utils";
4
4
  /**
5
5
  * @slot - Menu content
@@ -14,10 +14,6 @@ export class MgMenu {
14
14
  * Component display direction.
15
15
  */
16
16
  this.direction = 'horizontal';
17
- /**
18
- * Define mg-menu size
19
- */
20
- this.size = 'medium';
21
17
  /*************
22
18
  * Methods *
23
19
  *************/
@@ -53,7 +49,6 @@ export class MgMenu {
53
49
  * render mg-item-more
54
50
  */
55
51
  this.renderMgItemMore = () => {
56
- var _a;
57
52
  if (this.direction === directions.VERTICAL || (this.direction === directions.HORIZONTAL && this.isChildMenu()) || this.element.children.length <= 1) {
58
53
  return;
59
54
  }
@@ -67,8 +62,6 @@ export class MgMenu {
67
62
  for (const propertie in this.itemmore) {
68
63
  itemMoreElement[propertie] = this.itemmore[propertie];
69
64
  }
70
- if (((_a = this.itemmore) === null || _a === void 0 ? void 0 : _a.size) === undefined)
71
- itemMoreElement.size = this.size;
72
65
  };
73
66
  }
74
67
  validateLabel(newValue) {
@@ -92,11 +85,6 @@ export class MgMenu {
92
85
  this.renderMgItemMore();
93
86
  }
94
87
  }
95
- validateSize(newValue) {
96
- if (!sizes.includes(newValue)) {
97
- throw new Error(`<${this.name}> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);
98
- }
99
- }
100
88
  /**
101
89
  * Define mg-menu-item listener when they are loaded
102
90
  * @param event - mg-item-loaded "item-loaded" custom event
@@ -131,7 +119,6 @@ export class MgMenu {
131
119
  this.validateDirection(this.direction);
132
120
  this.validateLabel(this.label);
133
121
  this.validateItemMore(this.itemmore);
134
- this.validateSize(this.size);
135
122
  }
136
123
  /**
137
124
  * Check if component slots configuration
@@ -166,7 +153,7 @@ export class MgMenu {
166
153
  * @returns HTML Element
167
154
  */
168
155
  render() {
169
- return (h(Host, { key: '753833b01b86d6983f5d063f5598e2187b147a6e', role: "list", "aria-label": this.label }, h("slot", { key: '56702e49f5a97feddeb66e6271bd898061aa0d48' })));
156
+ return (h(Host, { key: '17b5111014e866939f58170452ca74ee40c8454c', role: "list", "aria-label": this.label }, h("slot", { key: '7c2a9aafccbc7526c74acaf7a505d7a33befc5ad' })));
170
157
  }
171
158
  static get is() { return "mg-menu"; }
172
159
  static get encapsulation() { return "shadow"; }
@@ -227,54 +214,48 @@ export class MgMenu {
227
214
  "attribute": "direction",
228
215
  "defaultValue": "'horizontal'"
229
216
  },
230
- "itemmore": {
217
+ "size": {
231
218
  "type": "unknown",
232
219
  "mutable": false,
233
220
  "complexType": {
234
- "original": "ItemMoreType",
235
- "resolved": "{ size?: \"medium\" | \"large\" | \"xlarge\"; icon?: IconType; slotlabel?: SlotLabelType; }",
236
- "references": {
237
- "ItemMoreType": {
238
- "location": "import",
239
- "path": "./mg-menu.conf",
240
- "id": "src/components/molecules/menus/mg-menu/mg-menu.conf.ts::ItemMoreType"
241
- }
242
- }
221
+ "original": "never",
222
+ "resolved": "never",
223
+ "references": {}
243
224
  },
244
225
  "required": false,
245
- "optional": true,
226
+ "optional": false,
246
227
  "docs": {
247
- "tags": [],
248
- "text": "Customize \"mg-item-more\" element\nUsed with direction: 'vertical' to manage overflow"
228
+ "tags": [{
229
+ "name": "deprecated",
230
+ "text": "this prop is deprecated and will be removed in future releases"
231
+ }],
232
+ "text": "Size of the menu items"
249
233
  },
250
234
  "getter": false,
251
235
  "setter": false
252
236
  },
253
- "size": {
254
- "type": "string",
237
+ "itemmore": {
238
+ "type": "unknown",
255
239
  "mutable": false,
256
240
  "complexType": {
257
- "original": "MenuSizeType",
258
- "resolved": "\"large\" | \"medium\" | \"xlarge\"",
241
+ "original": "ItemMoreType",
242
+ "resolved": "{ icon?: IconType; slotlabel?: SlotLabelType; }",
259
243
  "references": {
260
- "MenuSizeType": {
244
+ "ItemMoreType": {
261
245
  "location": "import",
262
246
  "path": "./mg-menu.conf",
263
- "id": "src/components/molecules/menus/mg-menu/mg-menu.conf.ts::MenuSizeType"
247
+ "id": "src/components/molecules/menus/mg-menu/mg-menu.conf.ts::ItemMoreType"
264
248
  }
265
249
  }
266
250
  },
267
251
  "required": false,
268
- "optional": false,
252
+ "optional": true,
269
253
  "docs": {
270
254
  "tags": [],
271
- "text": "Define mg-menu size"
255
+ "text": "Customize \"mg-item-more\" element\nUsed with direction: 'horizontal' to manage overflow"
272
256
  },
273
257
  "getter": false,
274
- "setter": false,
275
- "reflect": false,
276
- "attribute": "size",
277
- "defaultValue": "'medium'"
258
+ "setter": false
278
259
  }
279
260
  };
280
261
  }
@@ -289,9 +270,6 @@ export class MgMenu {
289
270
  }, {
290
271
  "propName": "itemmore",
291
272
  "methodName": "validateItemMore"
292
- }, {
293
- "propName": "size",
294
- "methodName": "validateSize"
295
273
  }];
296
274
  }
297
275
  static get listeners() {
@@ -16,7 +16,7 @@ export class MgMenuItem {
16
16
  * Internal *
17
17
  ************/
18
18
  this.name = 'mg-menu-item';
19
- this.navigationButton = 'mg-c-menu-item__navigation-button';
19
+ this.classNavigationButton = 'mg-c-menu-item__navigation-button';
20
20
  /************
21
21
  * Props *
22
22
  ************/
@@ -28,6 +28,10 @@ export class MgMenuItem {
28
28
  * Define menu-item status.
29
29
  */
30
30
  this.status = 'visible';
31
+ /**
32
+ * Define menu-item isIcon style.
33
+ */
34
+ this.isIcon = false;
31
35
  /**
32
36
  * Define menu-item content expanded.
33
37
  */
@@ -35,14 +39,10 @@ export class MgMenuItem {
35
39
  /**********
36
40
  * States *
37
41
  *********/
38
- /**
39
- * Define menu-item size.
40
- */
41
- this.size = 'medium';
42
42
  /**
43
43
  * Component button classes
44
44
  */
45
- this.navigationButtonClassList = new ClassList([this.navigationButton]);
45
+ this.classNavigationButtonClassList = new ClassList([this.classNavigationButton]);
46
46
  /**
47
47
  * Does component have children.
48
48
  */
@@ -146,12 +146,6 @@ export class MgMenuItem {
146
146
  * @param guard - prevent action with guard
147
147
  */
148
148
  this.updateItem = (guard) => {
149
- const menu = this.getParentMenu();
150
- // define element size
151
- if ((menu === null || menu === void 0 ? void 0 : menu.size) !== undefined && !this.isItemMore)
152
- this.size = menu.size;
153
- else if (this.isItemMore)
154
- this.size = this.element.dataset.size;
155
149
  // when vertical main menu item contain an active item we force expanded
156
150
  this.updateExpanded(this.expanded);
157
151
  this.updateStatus(guard);
@@ -177,9 +171,6 @@ export class MgMenuItem {
177
171
  const closePopover = (element) => {
178
172
  if (element === null)
179
173
  return;
180
- else if (element !== this.element && element.expanded && element.shadowRoot.querySelector('mg-popover') !== null) {
181
- element.expanded = false;
182
- }
183
174
  else {
184
175
  closePopover(element.parentElement.closest('mg-menu-item'));
185
176
  }
@@ -215,8 +206,23 @@ export class MgMenuItem {
215
206
  }
216
207
  watchStatus(newValue, oldValue) {
217
208
  if (oldValue !== undefined)
218
- this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);
219
- this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);
209
+ this.classNavigationButtonClassList.delete(`${this.classNavigationButton}--${oldValue}`);
210
+ this.classNavigationButtonClassList.add(`${this.classNavigationButton}--${newValue}`);
211
+ }
212
+ watchIsIcon(newValue) {
213
+ const classIcon = `${this.classNavigationButton}--is-icon`;
214
+ if (newValue) {
215
+ // in vertical menu isIcon is not available
216
+ if (this.direction === 'vertical') {
217
+ this.isIcon = false;
218
+ }
219
+ else {
220
+ this.classNavigationButtonClassList.add(classIcon);
221
+ }
222
+ }
223
+ else {
224
+ this.classNavigationButtonClassList.delete(classIcon);
225
+ }
220
226
  }
221
227
  watchExpanded(newValue) {
222
228
  if (typeof newValue !== 'boolean') {
@@ -231,15 +237,10 @@ export class MgMenuItem {
231
237
  });
232
238
  }
233
239
  }
234
- watchSize(newValue, oldValue) {
235
- if (oldValue !== undefined)
236
- this.navigationButtonClassList.delete(`${this.navigationButton}--size-${oldValue}`);
237
- this.navigationButtonClassList.add(`${this.navigationButton}--size-${newValue}`);
238
- }
239
240
  validateDirection(newValue, oldValue) {
240
241
  if (oldValue !== undefined)
241
- this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);
242
- this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);
242
+ this.classNavigationButtonClassList.delete(`${this.classNavigationButton}--${oldValue}`);
243
+ this.classNavigationButtonClassList.add(`${this.classNavigationButton}--${newValue}`);
243
244
  // manage all sub levels child menu-items level with data-level attribut
244
245
  Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {
245
246
  if (this.isDirection(directions.VERTICAL, newValue)) {
@@ -262,6 +263,7 @@ export class MgMenuItem {
262
263
  // eslint-disable-next-line @stencil-community/no-unused-watch
263
264
  watchDataStyleDirection(newValue) {
264
265
  this.direction = newValue;
266
+ this.watchIsIcon(this.isIcon);
265
267
  }
266
268
  /**
267
269
  * has focus value in dataset
@@ -301,7 +303,7 @@ export class MgMenuItem {
301
303
  this.watchExpanded(this.expanded);
302
304
  this.watchTarget(this.target);
303
305
  this.watchIdentifier(this.identifier);
304
- this.watchSize(this.size);
306
+ this.watchIsIcon(this.isIcon);
305
307
  }
306
308
  /**
307
309
  * Check if component slots configuration
@@ -315,7 +317,6 @@ export class MgMenuItem {
315
317
  // https://stenciljs.com/docs/component-lifecycle#componentwillload
316
318
  return setTimeout(() => {
317
319
  this.watchDataStyleDirection(this.element.dataset.styleDirection);
318
- this.watchDataHasFocus(this.element.dataset.hasFocus);
319
320
  this.updateItem([Status.ACTIVE]);
320
321
  // emit loaded event when component is fully loaded
321
322
  this.itemLoaded.emit();
@@ -339,19 +340,26 @@ export class MgMenuItem {
339
340
  this.itemUpdated.emit();
340
341
  });
341
342
  }
343
+ /**
344
+ * Render information slot or notification badge
345
+ * @returns HTML Element
346
+ */
347
+ renderInformationSlotOrNotification() {
348
+ return !this.displayNotificationBadge ? (h("slot", { name: "information" })) : (h("span", { class: `${this.classNavigationButton}-text-content-notification` }, h("mg-badge", { label: this.messages.badgeLabel, value: "!", variant: "text-color", slot: "information" })));
349
+ }
342
350
  /**
343
351
  * Render ineractive element
344
352
  * @returns HTML Element
345
353
  */
346
354
  renderInteractiveElement() {
347
355
  const TagName = this.href !== undefined ? 'a' : 'button';
348
- return (h(TagName, { href: this.href, class: this.navigationButtonClassList.join(), tabindex: [Status.DISABLED, Status.HIDDEN].includes(this.status) ? -1 : undefined, disabled: this.status === Status.DISABLED, hidden: this.status === Status.HIDDEN, target: this.href !== undefined && this.target !== undefined ? this.target : undefined, "aria-expanded": this.hasChildren && this.expanded.toString(), "aria-current": this.status === Status.ACTIVE && 'page', onClick: this.handleElementCLick }, h("slot", { name: "image" }), h("div", { class: `${this.navigationButton}-center` }, h("div", { class: `${this.navigationButton}-text-content` }, h("slot", { name: "label" }), !this.displayNotificationBadge && h("slot", { name: "information" }), this.displayNotificationBadge && (h("span", { class: `${this.navigationButton}-text-content-notification` }, h("mg-badge", { label: this.messages.badgeLabel, value: "!", variant: "text-color", slot: "information" }))), this.target === '_blank' && [
349
- h("mg-icon", { key: "icon-new-tab", class: `${this.navigationButton}-new-tab`, icon: "arrow-up-right-square" }),
356
+ return (h(TagName, { href: this.href, class: this.classNavigationButtonClassList.join(), tabindex: [Status.DISABLED, Status.HIDDEN].includes(this.status) ? -1 : undefined, disabled: this.status === Status.DISABLED, hidden: this.status === Status.HIDDEN, target: this.href !== undefined && this.target !== undefined ? this.target : undefined, "aria-expanded": this.hasChildren && this.expanded.toString(), "aria-current": this.status === Status.ACTIVE && 'page', onClick: this.handleElementCLick }, h("slot", { name: "image" }), h("div", { class: { [`${this.classNavigationButton}-center`]: true, 'mg-u-visually-hidden': this.isIcon } }, h("div", { class: `${this.classNavigationButton}-text-content` }, h("slot", { name: "label" }), !this.isIcon && this.renderInformationSlotOrNotification(), this.target === '_blank' && [
357
+ h("mg-icon", { key: "icon-new-tab", class: `${this.classNavigationButton}-new-tab`, icon: "arrow-up-right-square" }),
350
358
  h("span", { key: "a11y-new-tab", class: "mg-u-visually-hidden" }, this.messages.openNewTab),
351
- ]), this.size !== 'medium' && h("slot", { name: "metadata" })), this.hasChildren && this.href === undefined && (h("span", { class: {
352
- [`${this.navigationButton}-chevron`]: true,
353
- [`${this.navigationButton}-chevron--rotate`]: this.expanded === true,
354
- } }, h("mg-icon", { icon: "chevron-down" })))));
359
+ ]), !this.isIcon && h("slot", { name: "metadata" })), this.isIcon && this.renderInformationSlotOrNotification(), this.hasChildren && this.href === undefined && !this.isIcon && (h("span", { class: {
360
+ [`${this.classNavigationButton}-chevron`]: true,
361
+ [`${this.classNavigationButton}-chevron--rotate`]: this.expanded === true,
362
+ } }, h("mg-icon", { icon: "chevron-down", size: "small" })))));
355
363
  }
356
364
  /**
357
365
  * Render
@@ -362,7 +370,7 @@ export class MgMenuItem {
362
370
  ['mg-c-menu-item__collapse-container']: true,
363
371
  ['mg-c-menu-item__collapse-container--first-level']: (this.isInMainMenu() || this.isItemMore) && this.isDirection(directions.HORIZONTAL),
364
372
  });
365
- return (h(Host, { key: '9476243af2ac82d34f91487a22b46ea07c282ebc', role: this.isItemMore ? 'presentation' : 'listitem' }, this.hasPopover() ? (h("mg-popover", { display: this.expanded, placement: "bottom-start", arrowHide: true, "onDisplay-change": this.handlePopoverDisplay, identifier: this.popoverIdentifier, "data-fallback-placement": "bottom-end" // use for the last element of the menu if it is placed on the right side
373
+ return (h(Host, { key: '374bf5cb625380973d15163b1088e7e743da5dd4', role: this.isItemMore ? 'presentation' : 'listitem' }, this.hasPopover() ? (h("mg-popover", { display: this.expanded, placement: "bottom-start", arrowHide: true, "onDisplay-change": this.handlePopoverDisplay, identifier: this.popoverIdentifier, "data-fallback-placement": "bottom-end" // use for the last element of the menu if it is placed on the right side
366
374
  }, this.renderInteractiveElement(), h("div", { class: getContainerClasses(), slot: "content" }, this.renderSlot()))) : ([
367
375
  this.renderInteractiveElement(),
368
376
  h("div", { key: "vertical-container", class: getContainerClasses(), hidden: !this.expanded }, this.renderSlot()),
@@ -472,6 +480,26 @@ export class MgMenuItem {
472
480
  "attribute": "status",
473
481
  "defaultValue": "'visible'"
474
482
  },
483
+ "isIcon": {
484
+ "type": "boolean",
485
+ "mutable": true,
486
+ "complexType": {
487
+ "original": "boolean",
488
+ "resolved": "boolean",
489
+ "references": {}
490
+ },
491
+ "required": false,
492
+ "optional": true,
493
+ "docs": {
494
+ "tags": [],
495
+ "text": "Define menu-item isIcon style."
496
+ },
497
+ "getter": false,
498
+ "setter": false,
499
+ "reflect": false,
500
+ "attribute": "is-icon",
501
+ "defaultValue": "false"
502
+ },
475
503
  "expanded": {
476
504
  "type": "boolean",
477
505
  "mutable": true,
@@ -496,8 +524,7 @@ export class MgMenuItem {
496
524
  }
497
525
  static get states() {
498
526
  return {
499
- "size": {},
500
- "navigationButtonClassList": {},
527
+ "classNavigationButtonClassList": {},
501
528
  "direction": {},
502
529
  "isItemMore": {},
503
530
  "hasChildren": {},
@@ -548,12 +575,12 @@ export class MgMenuItem {
548
575
  }, {
549
576
  "propName": "status",
550
577
  "methodName": "watchStatus"
578
+ }, {
579
+ "propName": "isIcon",
580
+ "methodName": "watchIsIcon"
551
581
  }, {
552
582
  "propName": "expanded",
553
583
  "methodName": "watchExpanded"
554
- }, {
555
- "propName": "size",
556
- "methodName": "watchSize"
557
584
  }, {
558
585
  "propName": "direction",
559
586
  "methodName": "validateDirection"
@@ -141,7 +141,7 @@ export class MgActionMore {
141
141
  [`${this.classBase}__chevron--rotate`]: this.expanded === true,
142
142
  } }, h("mg-icon", { icon: "chevron-down" })));
143
143
  }
144
- return (h(Host, { key: 'd75e1a5326ea3a1414f8048858e5ee3fee51760e', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: 'b671a6c35cb3a9fa6eb7b2329f0f595e78b573b5', class: this.classBase }, h("mg-popover", { key: '38a38123d34ca868d0587123c2ab6b11550da8f0', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: '030b9360917b79edfc8df325d5ca5cfa08356c81', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: 'a47ca6b078ca160d1cbb13c964df3abede5f373c' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: 'ac38c705625cb5716a7e8aabd25d596db3d5adef', slot: "content" }, h("mg-menu", { key: 'cd382a65f69ba3c303a74d6b7444fcf0ccf9d1c5', direction: directions.VERTICAL, label: this.messages.label }, this.items.map(item => {
144
+ return (h(Host, { key: 'bef7d0e0c5a991f321ca930d65fa458873fc7564', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '4e47d1513749cc1ac15ef8febd2fb914e362bbee', class: this.classBase }, h("mg-popover", { key: 'ab6dfc93422f03b49a78d2896196aa6901841aef', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: '921f17c4ede5f1783dc336429539b0b082902fdd', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: '19bf9e015cbd82d8dffc62269de735607ab4f2bb' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: '56a43a5adebd31264742c0ef8905ccb0bd8fb581', slot: "content" }, h("mg-menu", { key: '70520957ac07a3190ef753ee435996af96dbc5b5', direction: directions.VERTICAL, label: this.messages.label }, this.items.map(item => {
145
145
  var _a, _b;
146
146
  return isMgActionMoreDivider(item) ? (h("mg-divider", { class: "mg-c-action-more__divider", key: "divider", "full-width": true })) : (h("mg-menu-item", { key: item.label, status: item.status || Status.VISIBLE, target: item.target, href: item.href,
147
147
  // eslint-disable-next-line react/jsx-no-bind
@@ -195,7 +195,7 @@ export class MgActionMore {
195
195
  "mutable": true,
196
196
  "complexType": {
197
197
  "original": "MgActionMoreIconType",
198
- "resolved": "{ icon: \"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"; }",
198
+ "resolved": "{ icon: \"filter\" | \"link\" | \"picture\" | \"table\" | \"circle\" | \"download\" | \"key\" | \"list\" | \"copy\" | \"history\" | \"location\" | \"pause\" | \"loader\" | \"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"; }",
199
199
  "references": {
200
200
  "MgActionMoreIconType": {
201
201
  "location": "import",
@@ -142,7 +142,7 @@ export class MgAlert {
142
142
  * @returns HTML Element
143
143
  */
144
144
  render() {
145
- return (h("mg-message", { key: '4b974a10812e527a2c481ec00f22324ab490a135', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '9133a3cca56d67e75e8c3f018c52838c31e908f2' }), this.hasActions ? (h("span", { slot: "actions" }, h("slot", { name: "actions" }))) : (h("span", { class: "mg-c-alert__close-button" }, h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.alert.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
145
+ return (h("mg-message", { key: '6085a45d00c4762bae88d98e89f44c20d5f9b6c4', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '55491d1b41609883958680c14a2ddb8dd84a3bd4' }), this.hasActions ? (h("span", { slot: "actions" }, h("slot", { name: "actions" }))) : (h("span", { class: "mg-c-alert__close-button" }, h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.alert.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
146
146
  }
147
147
  static get is() { return "mg-alert"; }
148
148
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,92 @@
1
+ import { h } from "@stencil/core";
2
+ import { initLocales } from "../../../locales";
3
+ import { isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
4
+ /**
5
+ * Type guard for BreadcrumbItemType[]
6
+ * @param items - value to check
7
+ * @returns true if items is a non-empty array of valid BreadcrumbItemType (label required, href required except for last item)
8
+ */
9
+ const isBreadcrumbItems = (items) => Array.isArray(items) &&
10
+ items.length > 0 &&
11
+ items.every((item, index) => typeof item === 'object' && item !== null && isValidString(item.label) && (index === items.length - 1 || isValidString(item.href)));
12
+ export class MgBreadcrumb {
13
+ validateItems(newValue) {
14
+ if (newValue === undefined || !isBreadcrumbItems(newValue)) {
15
+ throw new Error(`<mg-breadcrumb> prop "items" is required and all values must be the same type, BreadcrumbItemType. Passed value: ${toString(newValue)}.`);
16
+ }
17
+ }
18
+ /***********
19
+ * Methods *
20
+ **********/
21
+ /**
22
+ * Render a single breadcrumb item (link or current page)
23
+ * @param item - The breadcrumb item
24
+ * @param isLast - Whether this item is the last in the list
25
+ * @returns The rendered link or span element
26
+ */
27
+ renderItem(item, isLast) {
28
+ if (isValidString(item.href)) {
29
+ return (h("a", { href: item.href, "aria-label": item.icon !== undefined ? item.label : undefined, "aria-current": isLast ? 'page' : undefined }, item.icon !== undefined ? h("mg-icon", { icon: item.icon }) : item.label));
30
+ }
31
+ return h("span", null, item.label);
32
+ }
33
+ /*************
34
+ * Lifecycle *
35
+ *************/
36
+ componentWillLoad() {
37
+ this.validateItems(this.items);
38
+ this.messages = initLocales(this.element).messages.breadcrumb;
39
+ }
40
+ render() {
41
+ return (h("nav", { key: '5181512072a7de6e161adcbb9988ae3407f61301', "aria-label": this.messages.label, class: "mg-c-breadcrumb" }, h("ol", { key: '2a4cec366a72027091ebcbccd78d552884005b93', class: "mg-c-breadcrumb__list" }, this.items.map((item, index) => {
42
+ var _a;
43
+ return (h("li", { key: `${index}-${(_a = item.href) !== null && _a !== void 0 ? _a : item.label}`, class: "mg-c-breadcrumb__list-item" }, this.renderItem(item, index === this.items.length - 1)));
44
+ }))));
45
+ }
46
+ static get is() { return "mg-breadcrumb"; }
47
+ static get encapsulation() { return "shadow"; }
48
+ static get originalStyleUrls() {
49
+ return {
50
+ "$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-breadcrumb.css"]
51
+ };
52
+ }
53
+ static get styleUrls() {
54
+ return {
55
+ "$": ["../../../../node_modules/@mgdis/styles/dist/components/mg-breadcrumb.css"]
56
+ };
57
+ }
58
+ static get properties() {
59
+ return {
60
+ "items": {
61
+ "type": "unknown",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "BreadcrumbItemType[]",
65
+ "resolved": "BreadcrumbItemType[]",
66
+ "references": {
67
+ "BreadcrumbItemType": {
68
+ "location": "import",
69
+ "path": "./mg-breadcrumb.conf",
70
+ "id": "src/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.ts::BreadcrumbItemType"
71
+ }
72
+ }
73
+ },
74
+ "required": true,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": "Breadcrumb items (hierarchical order: root \u2192 current page)."
79
+ },
80
+ "getter": false,
81
+ "setter": false
82
+ }
83
+ };
84
+ }
85
+ static get elementRef() { return "element"; }
86
+ static get watchers() {
87
+ return [{
88
+ "propName": "items",
89
+ "methodName": "validateItems"
90
+ }];
91
+ }
92
+ }
@@ -53,7 +53,7 @@ export class MgDetails {
53
53
  * @returns HTML Element
54
54
  */
55
55
  render() {
56
- return (h("details", { key: 'bbaac6909fa5f3fbd3236b2a8ace0f7c80b2580b', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: '2ed8228b63403dd9b386bf3fa70c9094516b6f0e' }, h("slot", { key: '5461d77d2b2869b14737a5c7cfc40a1f9584ee03', name: "summary" }), h("span", { key: 'bb089365bdeaa7b934b97cff6f5f7c67587048e1', class: "mg-c-details__toggle" }, h("mg-icon", { key: 'dc1a30338703ad4182d50f9953a903ae0f68ecb1', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'a32cbaf9e38b71540deeaa8980895c34a7288ecb', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: 'b9c2bc7d681da8ac8b4dec5ff25287bc68975fb6', class: "mg-c-details__details" }, h("slot", { key: '069f05b4c133ff13055681e0b05bb98744303137', name: "details" }))));
56
+ return (h("details", { key: '4da17afd7a964a14b5b101bcfadc241be569d55a', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: '515d6c4e117b547fe80a310fb90e114900f645e8' }, h("slot", { key: '0c9c0dcc47dd418e34e541d878bfc03ca137c68d', name: "summary" }), h("span", { key: 'c94f52994843b10c1161c0d85f38f8cb917ea806', class: "mg-c-details__toggle" }, h("mg-icon", { key: '9421452572af3deb03146a8dfd189369b249ba2d', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'dbfb0b34da00e37f55ec07236611c2babdd6b7c5', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: '1b18b65a98e39a8663fa5d7e51eef5fbe2b92f76', class: "mg-c-details__details" }, h("slot", { key: '81c213594b1b67747db439624090784eaa5e6fcd', name: "details" }))));
57
57
  }
58
58
  static get is() { return "mg-details"; }
59
59
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, isValidString } from "@mgdis/core-ui-helpers/dist/utils";
3
- import { classReadonly } from "../inputs/mg-input/mg-input.conf";
3
+ import { classReadonly, isMgInputFile } from "../inputs/mg-input/mg-input.conf";
4
4
  export class MgFieldset {
5
5
  constructor() {
6
6
  /**
@@ -44,7 +44,16 @@ export class MgFieldset {
44
44
  // Set inputs readonly or disabled based on form configuration
45
45
  // Othewise listen to events
46
46
  this.mgInputs.forEach(input => {
47
- if (this.readonly) {
47
+ // manage special display case for mg-input-file
48
+ if (input.nodeName === 'MG-INPUT-FILE') {
49
+ if (this.readonly) {
50
+ input.setAttribute('hidden', '');
51
+ }
52
+ else {
53
+ input.removeAttribute('hidden');
54
+ }
55
+ }
56
+ if (this.readonly && !isMgInputFile(input)) {
48
57
  input.readonly = true;
49
58
  }
50
59
  else if (this.disabled) {
@@ -124,7 +133,7 @@ export class MgFieldset {
124
133
  * @returns HTML Element
125
134
  */
126
135
  render() {
127
- return (h("mg-input", { key: 'b8b7c203bb2ed22cc9344389af5a6ae8d85af6d5', label: this.legend, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: !this.legendHide, labelHeading: this.legendHeading, labelBorderDisplay: this.legendHeading && this.legendBorderDisplay, labelHide: this.legendHide, inputsOnBottom: this.legendHeading !== undefined, tooltip: this.tooltip, tooltipPosition: 'label', helpText: this.helpText, errorMessage: !this.valid && isValidString(this.errorMessage) ? this.errorMessage : undefined }, h("span", { key: 'c0e7480b14b0a8e136dd951bdce7275b65b59b48', class: "mg-c-input__input-group" }, h("slot", { key: '021e7b126cef9437e64622d8ef59219b09c06e9f' }))));
136
+ return (h("mg-input", { key: 'b0b16a170de87de91fa02a38371eb3dd6fe995d7', label: this.legend, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: !this.legendHide, labelHeading: this.legendHeading, labelBorderDisplay: this.legendHeading && this.legendBorderDisplay, labelHide: this.legendHide, inputsOnBottom: this.legendHeading !== undefined, tooltip: this.tooltip, tooltipPosition: 'label', helpText: this.helpText, errorMessage: !this.valid && isValidString(this.errorMessage) ? this.errorMessage : undefined }, h("span", { key: 'c449a5235da7b190d8d311469d15cebcfaf3badc', class: "mg-c-input__input-group" }, h("slot", { key: '6d8c60e2555bfd65c8c146233dc840a2d73597d5' }))));
128
137
  }
129
138
  static get is() { return "mg-fieldset"; }
130
139
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { createID, ClassList, toString, isValideID } from "@mgdis/core-ui-helpers/dist/utils";
3
3
  import { initLocales } from "../../../locales";
4
+ import { isMgInputFile } from "../inputs/mg-input/mg-input.conf";
4
5
  import { requiredMessageStatus, roles } from "./mg-form.conf";
5
6
  /**
6
7
  * @slot - Form content
@@ -111,7 +112,16 @@ export class MgForm {
111
112
  if (this.labelOnTop) {
112
113
  input.labelOnTop = true;
113
114
  }
114
- if (this.readonly) {
115
+ // manage special display case for mg-input-file
116
+ if (input.nodeName === 'MG-INPUT-FILE') {
117
+ if (this.readonly) {
118
+ input.setAttribute('hidden', '');
119
+ }
120
+ else {
121
+ input.removeAttribute('hidden');
122
+ }
123
+ }
124
+ if (this.readonly && !isMgInputFile(input)) {
115
125
  input.readonly = true;
116
126
  }
117
127
  else if (this.disabled) {
@@ -232,7 +242,7 @@ export class MgForm {
232
242
  * @returns HTML Element
233
243
  */
234
244
  render() {
235
- return (h("form", { key: '8b698b2a33af00e36691abab5adff5488b736218', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '2e1fb5c4030ecb99d1f18c57d5c3fe238db4d12e', innerHTML: this.requiredMessageText }), h("slot", { key: '568fb8ac9ab0e3521899c05472592ebd15cc91fa' }), !this.readonly && !this.disabled && h("slot", { key: 'd4f38320de58f3b1d491083a34d1b5366d22b935', name: "actions" })));
245
+ return (h("form", { key: 'b1a6b50f2bbb9b71cecd23d419771cf1b40e13b4', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '9c878f3730a06e1b683240057511b588edf5e887', innerHTML: this.requiredMessageText }), h("slot", { key: '3cf5ca0f07e2f3573615cf6566e230f4d5678b31' }), !this.readonly && !this.disabled && h("slot", { key: '6cbfd58e9600f7a9d9b55ec23bdd64877c03f0d7', name: "actions" })));
236
246
  }
237
247
  static get is() { return "mg-form"; }
238
248
  static get encapsulation() { return "shadow"; }
@@ -81,7 +81,7 @@ export class MgIllustratedMessage {
81
81
  * @returns HTML Element
82
82
  */
83
83
  render() {
84
- return (h("div", { key: 'c9d8c8bfd2792b1cf5e78ab9d168d597b20e9a1e', class: this.classCollection.join() }, h("div", { key: 'cc8fa03147b9e59e6e8e015be9ed2b8dddd92ded', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '83a4ec2223c4e74511beb7c0abfa10e77cee425d', name: "illustration" })), h("div", { key: 'dbb4d13ca5324cab889fa2acc9b9b22522d7a8ec', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '9e74d84becf29539ec9c37e8ad1e317714f3c86c', name: "title" }), h("slot", { key: 'ae97d25c19b76ca092560d2555ebd6a87f542ffe', name: "details" }))));
84
+ return (h("div", { key: 'ed3b924f5c5a75706aef03ef8798cb699679012d', class: this.classCollection.join() }, h("div", { key: '59b7f7b3fe4ad808377094f93e8b6e86ba2f49ec', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: 'd28aa873cd7025647f56f3a4ed62d9e35dde25d3', name: "illustration" })), h("div", { key: '3b150411a26531827c988a2d34e2990a2302f982', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '8ffea6e50bf5dc4b870d414cb710fc88e0984f61', name: "title" }), h("slot", { key: 'ec85b4a50d28ddf14dbd6b0feff59e2030348b68', name: "details" }))));
85
85
  }
86
86
  static get is() { return "mg-illustrated-message"; }
87
87
  static get encapsulation() { return "shadow"; }
@@ -29,7 +29,7 @@ export class MgLoader {
29
29
  * @returns HTML Element
30
30
  */
31
31
  render() {
32
- return (h("div", { key: '739b4cbacd8a8da056dbb1445c40fac2cf26766a', class: "mg-c-loader", "aria-live": "polite" }, h("mg-icon", { key: '95d3cbf26fcd6dbf0dad4853bf55aa66385f1aba', icon: "loader", spin: true }), h("span", { key: 'f6322cd3054d8976bd2ec24f86a2d6bb60ca7ae1', class: { 'mg-u-visually-hidden': this.messageHide } }, this.message || this.messages.loader.inProgress)));
32
+ return (h("div", { key: 'da82988810c1e2916a2464299844cad674cd1f12', class: "mg-c-loader", "aria-live": "polite" }, h("mg-icon", { key: '45588ae8dd55ca582a4872d4c1e731bb00681c28', icon: "loader", spin: true }), h("span", { key: '3bc07f4bbf8995de61c019942c33c8076793096a', class: { 'mg-u-visually-hidden': this.messageHide } }, this.message || this.messages.loader.inProgress)));
33
33
  }
34
34
  static get is() { return "mg-loader"; }
35
35
  static get encapsulation() { return "shadow"; }