@mgdis/mg-components 6.24.0 → 6.25.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 (186) hide show
  1. package/dist/cjs/index-Acmyl4hv.js +5 -0
  2. package/dist/cjs/{index-BxB20_Vw.js → index-B6J2EllP.js} +3 -1
  3. package/dist/cjs/{index-BEF-cqV9.js → index-BmFwLEZT.js} +5 -1
  4. package/dist/cjs/{index-CpENFzEo.js → index-DrZECzp6.js} +14 -6
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_36.cjs.entry.js +385 -259
  7. package/dist/cjs/mg-alert.cjs.entry.js +7 -8
  8. package/dist/cjs/mg-breadcrumb.cjs.entry.js +27 -10
  9. package/dist/cjs/mg-components.cjs.js +2 -2
  10. package/dist/cjs/mg-fieldset.cjs.entry.js +8 -8
  11. package/dist/cjs/mg-illustration.cjs.entry.js +57 -0
  12. package/dist/cjs/mg-input-combobox.cjs.entry.js +40 -23
  13. package/dist/cjs/mg-input-file.cjs.entry.js +12 -11
  14. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +2565 -4011
  15. package/dist/cjs/mg-loader.cjs.entry.js +5 -5
  16. package/dist/cjs/mg-progress.cjs.entry.js +3 -3
  17. package/dist/collection/assets/illustrations/index.js +1 -0
  18. package/dist/collection/collection-manifest.json +1 -0
  19. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
  20. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
  21. package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
  22. package/dist/collection/components/atoms/mg-button/mg-button.js +4 -1
  23. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
  24. package/dist/collection/components/atoms/mg-divider/mg-divider.conf.js +4 -0
  25. package/dist/collection/components/atoms/mg-divider/mg-divider.js +62 -3
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  27. package/dist/collection/components/atoms/mg-illustration/mg-illustration.conf.js +1 -0
  28. package/dist/collection/components/atoms/mg-illustration/mg-illustration.js +95 -0
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
  30. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -7
  32. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +49 -19
  33. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +5 -2
  34. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js +5 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +30 -22
  36. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +69 -25
  37. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +14 -8
  38. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +8 -7
  39. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +21 -12
  40. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +7 -7
  41. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +15 -10
  42. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +29 -3
  43. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +260 -7
  44. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -19
  45. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +18 -13
  46. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +7 -7
  47. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +10 -9
  48. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
  49. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +7 -5
  50. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +18 -17
  51. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +7 -4
  52. package/dist/collection/components/molecules/mg-alert/mg-alert.js +6 -7
  53. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +49 -6
  54. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  55. package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +6 -6
  56. package/dist/collection/components/molecules/mg-form/mg-form.js +16 -13
  57. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +2 -2
  58. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  59. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  60. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  61. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +8 -4
  62. package/dist/collection/components/molecules/mg-panel/mg-panel.js +13 -4
  63. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -2
  64. package/dist/collection/components/molecules/mg-popover/mg-popover.js +21 -37
  65. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  66. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +5 -3
  67. package/dist/collection/components/molecules/mg-table/mg-table.js +10 -6
  68. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +12 -9
  69. package/dist/collection/utils/behaviors.utils.js +3 -3
  70. package/dist/collection/utils/playwright.fixture.js +7 -2
  71. package/dist/components/mg-action-more.js +1 -1
  72. package/dist/components/mg-alert.js +1 -1
  73. package/dist/components/mg-badge2.js +1 -1
  74. package/dist/components/mg-breadcrumb.js +1 -1
  75. package/dist/components/mg-button2.js +1 -1
  76. package/dist/components/mg-card2.js +1 -1
  77. package/dist/components/mg-character-left2.js +1 -1
  78. package/dist/components/mg-details.js +1 -1
  79. package/dist/components/mg-divider2.js +1 -1
  80. package/dist/components/mg-fieldset.js +1 -1
  81. package/dist/components/mg-form.js +1 -1
  82. package/dist/components/mg-icon2.js +1 -1
  83. package/dist/components/mg-illustrated-message.js +1 -1
  84. package/dist/components/mg-illustration.d.ts +11 -0
  85. package/dist/components/mg-illustration.js +1 -0
  86. package/dist/components/mg-input-checkbox.js +1 -1
  87. package/dist/components/mg-input-combobox.js +1 -1
  88. package/dist/components/mg-input-date.js +1 -1
  89. package/dist/components/mg-input-file.js +1 -1
  90. package/dist/components/mg-input-numeric.js +1 -1
  91. package/dist/components/mg-input-password.js +1 -1
  92. package/dist/components/mg-input-radio.js +1 -1
  93. package/dist/components/mg-input-rich-text-editor.js +294 -284
  94. package/dist/components/mg-input-select2.js +1 -1
  95. package/dist/components/mg-input-text2.js +1 -1
  96. package/dist/components/mg-input-textarea.js +1 -1
  97. package/dist/components/mg-input-title2.js +1 -1
  98. package/dist/components/mg-input-toggle.js +1 -1
  99. package/dist/components/mg-input2.js +1 -1
  100. package/dist/components/mg-item-more2.js +1 -1
  101. package/dist/components/mg-loader2.js +1 -1
  102. package/dist/components/mg-menu-item2.js +1 -1
  103. package/dist/components/mg-message2.js +1 -1
  104. package/dist/components/mg-modal.js +1 -1
  105. package/dist/components/mg-pagination.js +1 -1
  106. package/dist/components/mg-panel.js +1 -1
  107. package/dist/components/mg-popover-content2.js +1 -1
  108. package/dist/components/mg-popover2.js +1 -1
  109. package/dist/components/mg-progress.js +1 -1
  110. package/dist/components/mg-skip-links.js +1 -1
  111. package/dist/components/mg-table.js +1 -1
  112. package/dist/components/mg-tabs2.js +1 -1
  113. package/dist/components/mg-tag.js +1 -1
  114. package/dist/components/mg-tooltip-content2.js +1 -1
  115. package/dist/components/mg-tooltip2.js +1 -1
  116. package/dist/custom-elements.json +178 -48
  117. package/dist/esm/{index-C7xjtdiw.js → index-91BOpzAB.js} +14 -6
  118. package/dist/esm/{index-DSEloqPn.js → index-BfblyCaJ.js} +3 -1
  119. package/dist/esm/index-Ci9Hv7DG.js +3 -0
  120. package/dist/esm/{index-DshvCiTL.js → index-D4bO_UCn.js} +5 -1
  121. package/dist/esm/loader.js +3 -3
  122. package/dist/esm/mg-action-more_36.entry.js +382 -256
  123. package/dist/esm/mg-alert.entry.js +7 -8
  124. package/dist/esm/mg-breadcrumb.entry.js +27 -10
  125. package/dist/esm/mg-components.js +3 -3
  126. package/dist/esm/mg-fieldset.entry.js +8 -8
  127. package/dist/esm/mg-illustration.entry.js +55 -0
  128. package/dist/esm/mg-input-combobox.entry.js +40 -23
  129. package/dist/esm/mg-input-file.entry.js +12 -11
  130. package/dist/esm/mg-input-rich-text-editor.entry.js +2550 -3996
  131. package/dist/esm/mg-loader.entry.js +5 -5
  132. package/dist/esm/mg-progress.entry.js +3 -3
  133. package/dist/mg-components/mg-components.css +1 -1
  134. package/dist/mg-components/mg-components.esm.js +1 -1
  135. package/dist/mg-components/{p-cdb01923.entry.js → p-3ad7441c.entry.js} +1 -1
  136. package/dist/mg-components/p-413b4536.entry.js +1 -0
  137. package/dist/mg-components/p-4693077a.entry.js +1 -0
  138. package/dist/mg-components/p-5dff879a.entry.js +1 -0
  139. package/dist/mg-components/{p-08d3d957.entry.js → p-96fc508e.entry.js} +1 -1
  140. package/dist/mg-components/p-Ci9Hv7DG.js +1 -0
  141. package/dist/mg-components/p-D4bO_UCn.js +2 -0
  142. package/dist/mg-components/{p-d0b6d8f5.entry.js → p-ad533d08.entry.js} +1 -1
  143. package/dist/mg-components/p-b20f3698.entry.js +1 -0
  144. package/dist/mg-components/p-d0d12800.entry.js +1 -0
  145. package/dist/mg-components/p-ec4bd337.entry.js +1667 -0
  146. package/dist/mg-components/p-f8e58181.entry.js +1 -0
  147. package/dist/types/assets/illustrations/index.d.ts +21 -0
  148. package/dist/types/components/atoms/mg-divider/mg-divider.conf.d.ts +9 -0
  149. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +13 -0
  150. package/dist/types/components/atoms/mg-illustration/mg-illustration.conf.d.ts +5 -0
  151. package/dist/types/components/atoms/mg-illustration/mg-illustration.d.ts +24 -0
  152. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +18 -0
  153. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +1 -1
  154. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +10 -5
  155. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +2 -2
  156. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +2 -2
  157. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +2 -2
  158. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +1 -1
  159. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +4 -0
  160. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +25 -0
  161. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +61 -2
  162. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +2 -2
  163. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +2 -2
  164. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +2 -2
  165. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -2
  166. package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +2 -2
  167. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +2 -2
  168. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +11 -0
  169. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +1 -1
  170. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +3 -3
  171. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +1 -1
  172. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -1
  173. package/dist/types/components.d.ts +145 -40
  174. package/ide/intellij/web-types.json +134 -64
  175. package/ide/vscode/css-custom-data.json +6 -2
  176. package/ide/vscode/html-custom-data.json +190 -32
  177. package/package.json +21 -21
  178. package/dist/mg-components/p-13feb37a.entry.js +0 -1
  179. package/dist/mg-components/p-7c63e469.entry.js +0 -1
  180. package/dist/mg-components/p-7fd3e519.entry.js +0 -1
  181. package/dist/mg-components/p-9953b835.entry.js +0 -1
  182. package/dist/mg-components/p-9c0a9fc7.entry.js +0 -1657
  183. package/dist/mg-components/p-DshvCiTL.js +0 -2
  184. package/dist/mg-components/p-a338088e.entry.js +0 -1
  185. /package/dist/mg-components/{p-C7xjtdiw.js → p-91BOpzAB.js} +0 -0
  186. /package/dist/mg-components/{p-DSEloqPn.js → p-BfblyCaJ.js} +0 -0
@@ -54,17 +54,20 @@ export class MgForm {
54
54
  }
55
55
  // If the form is disabled or readonly none of them are required
56
56
  // Check if all fields are not editable (readonly or disabled)
57
- const isEditable = input => !(input.disabled || input.readonly);
58
- const isMgInputToggle = input => input.nodeName === 'MG-INPUT-TOGGLE';
59
- if (!this.disabled && !this.readonly && this.mgInputs.some(input => isEditable(input) && !isMgInputToggle(input))) {
57
+ const isEditable = (input) => !(input.disabled || input.readonly);
58
+ const isMgInputToggle = (input) => input.nodeName === 'MG-INPUT-TOGGLE';
59
+ if (!this.disabled &&
60
+ !this.readonly &&
61
+ this.mgInputs.some((input) => isEditable(input) && !isMgInputToggle(input))) {
60
62
  // Get editable inputs
61
63
  const editableInputs = this.mgInputs.filter(isEditable);
62
64
  // Get required inputs
63
65
  // mg-input-toggle can not be required
64
- const requiredInputs = editableInputs.filter(input => !isMgInputToggle(input) && input.required);
66
+ const requiredInputs = editableInputs.filter((input) => !isMgInputToggle(input) && input.required);
65
67
  // All inputs are required
66
- if ([requiredInputs.length, editableInputs.length].every(length => length === 1) ||
67
- (requiredInputs.length > 1 && requiredInputs.length === editableInputs.filter(input => !isMgInputToggle(input)).length)) {
68
+ if ([requiredInputs.length, editableInputs.length].every((length) => length === 1) ||
69
+ (requiredInputs.length > 1 &&
70
+ requiredInputs.length === editableInputs.filter((input) => !isMgInputToggle(input)).length)) {
68
71
  this.requiredMessageText = this.getRequiredMessageBasedOnCount(requiredInputs, 'allRequiredSingle', 'allRequired');
69
72
  this.classCollection.add(this.classAllRequired);
70
73
  }
@@ -88,7 +91,7 @@ export class MgForm {
88
91
  this.checkValidity = () => {
89
92
  // Update required on input event
90
93
  this.setRequiredMessage();
91
- this.valid = !this.mgInputs.some(input => input.invalid);
94
+ this.valid = !this.mgInputs.some((input) => input.invalid);
92
95
  this.invalid = !this.valid;
93
96
  // We need to send valid event if it is the same value
94
97
  this.formValid.emit(this.valid);
@@ -109,7 +112,7 @@ export class MgForm {
109
112
  this.mgInputs = Array.from(this.element.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-INPUT'));
110
113
  // Set inputs readonly or disabled based on form configuration
111
114
  // Othewise listen to events
112
- this.mgInputs.forEach(input => {
115
+ this.mgInputs.forEach((input) => {
113
116
  if (this.labelOnTop) {
114
117
  input.labelOnTop = true;
115
118
  }
@@ -167,7 +170,7 @@ export class MgForm {
167
170
  async displayError() {
168
171
  if (!this.readonly) {
169
172
  const mgFieldsets = Array.from(this.element.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-FIELDSET'));
170
- [...mgFieldsets, ...this.mgInputs].forEach(input => {
173
+ [...mgFieldsets, ...this.mgInputs].forEach((input) => {
171
174
  var _a;
172
175
  (_a = input.displayError) === null || _a === void 0 ? void 0 : _a.call(input);
173
176
  });
@@ -205,7 +208,7 @@ export class MgForm {
205
208
  // Get slotted mgButtons
206
209
  this.mgButtons = Array.from(this.element.querySelectorAll('mg-button'));
207
210
  // Set button form identifier
208
- this.mgButtons.forEach(mgButton => {
211
+ this.mgButtons.forEach((mgButton) => {
209
212
  mgButton.setAttribute('form', this.identifier);
210
213
  if (mgButton.type === 'reset') {
211
214
  mgButton.addEventListener('click', () => {
@@ -232,8 +235,8 @@ export class MgForm {
232
235
  componentDidLoad() {
233
236
  // Update mgInputs when mgForm content change
234
237
  const observerOptions = { childList: true, subtree: true };
235
- new MutationObserver(mutations => {
236
- if (mutations.some(mutation => Object.keys(observerOptions).includes(mutation.type))) {
238
+ new MutationObserver((mutations) => {
239
+ if (mutations.some((mutation) => Object.keys(observerOptions).includes(mutation.type))) {
237
240
  this.setMgInputs();
238
241
  this.checkValidity();
239
242
  }
@@ -244,7 +247,7 @@ export class MgForm {
244
247
  * @returns HTML Element
245
248
  */
246
249
  render() {
247
- return (h("form", { key: 'bb340dafd9e9d987b4de94f718f81a63749b183c', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '5cdfc883ecd9a1e9759f952beac2c17f4d9a3237', innerHTML: this.requiredMessageText }), h("slot", { key: 'd5879767bc1d23a7c31b119b2fa2a29b9f8bc76f' }), !this.readonly && !this.disabled && h("slot", { key: 'c47af6bccd71ee51e1725c5592001d09add966b8', name: "actions" })));
250
+ return (h("form", { key: '65d3e11931386af2dedd953f58505e2c71cd99ff', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '7546db3b8a4259fd7d092cc7b912b6593fab9d84', innerHTML: this.requiredMessageText }), h("slot", { key: '0023ed360230ea97395a249b230e02bb7a4bdbda' }), !this.readonly && !this.disabled && h("slot", { key: 'de84e088ff029eff487be1ed8b4766425c558c29', name: "actions" })));
248
251
  }
249
252
  static get is() { return "mg-form"; }
250
253
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, isTagName, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
- import { directions, sizes } from "./mg-illustrated-message.conf";
3
+ import { directions, sizes, } from "./mg-illustrated-message.conf";
4
4
  /**
5
5
  * @slot illustration - Illustration content
6
6
  * @slot title - Title content
@@ -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: '87fb97f2eff23d0793e1829a2ac533be7c670f59', class: this.classCollection.join() }, h("div", { key: 'c3395aefc56c00f625a7510ce73204097abbfc06', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '2505490d95166f2490e75cac403a90c693507502', name: "illustration" })), h("div", { key: '12b89745d353f0a31575f48c15d864459eb2d77e', class: "mg-c-illustrated-message__slots" }, h("slot", { key: 'c56b865f24c818ef40e3e0adb7efb698e509fba9', name: "title" }), h("slot", { key: '018faf36cfd88e1ac38b13636e7c7da7b44c9b40', 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: 'a2e3880baccec9691a9fd6abbdb9e01d452136aa', class: "mg-c-loader", "aria-live": "polite" }, h("mg-icon", { key: '044153b87e799f1f51cb3c9c6236bf6b8b328cf5', icon: "loader", spin: true }), h("span", { key: '5e4293bd33bd2a51b7557ebf26037991e4fc853e', 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"; }
@@ -100,9 +100,9 @@ export class MgMessage {
100
100
  * @returns HTML Element
101
101
  */
102
102
  render() {
103
- return (h("div", { key: '7a91fbc1a334d006013cdc8dd8ce6bce52947b90', class: this.classCollection.join() }, h("mg-card", { key: '8cffef0275a4c8e10f13974577fedc7857a41b7b', shadow: this.variantStyle !== 'background' }, h("span", { key: '7dea80369d39b5662a2257f7990b847115e7547f', class: "mg-c-message__icon" }, h("mg-icon", { key: '843d6ba95d234f7e0e7986fc904058bd8e7dca95', icon: this.getIcon() })), h("div", { key: '903125d7b30bbc386bd9f5c690b38cd3df67a661', class: "mg-c-message__content" }, h("span", { key: '3efffe2f4ebe5db86a4d42f156517caf4888e0c9', class: "mg-c-message__content-slot" }, h("slot", { key: 'f4dc15ab614ab7eb7a6d4c5ad11baba8037f6f18' })), this.hasActions && [
103
+ return (h("div", { key: 'a182451917bfe33de32c893d9eeedd52b11f8b15', class: this.classCollection.join() }, h("mg-card", { key: '9dd0da031d97f669e885a1681b72e5a086e79c0b', shadow: this.variantStyle !== 'background' }, h("span", { key: '158c2470a10ab9d677e2031c28ad0d43c09e4cf2', class: "mg-c-message__icon" }, h("mg-icon", { key: 'f7d0cb02781d2bf5a71fbd7f9498ebf4dca31edf', icon: this.getIcon() })), h("div", { key: '56a7299983c30ea4527bb19a46ac0677b6e8c40e', class: "mg-c-message__content" }, h("span", { key: '744ad763177f92bdbac37d43a5a58f221ff97e69', class: "mg-c-message__content-slot" }, h("slot", { key: '14b7f22e206bd074336287809574b2a5abfe5bf5' })), this.hasActions && [
104
104
  h("span", { class: "mg-c-message__content-separator", key: "content-separator" }),
105
- h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '4b3861414a1ca22792bb77d0d7bf38280d812aa1', name: "actions" })),
105
+ h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '104be326f73ded002cba9a471491ca614227e3d5', name: "actions" })),
106
106
  ]))));
107
107
  }
108
108
  static get is() { return "mg-message"; }
@@ -106,11 +106,11 @@ export class MgModal {
106
106
  * @returns HTML Element
107
107
  */
108
108
  render() {
109
- return (h("dialog", { key: '7e07f2e52ec70012b98a8cf1097a9a3fde516e90', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
109
+ return (h("dialog", { key: '3b802b99d96be80d8071c89be6537269866e6fff', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
110
110
  if (el !== null) {
111
111
  this.dialog = el;
112
112
  }
113
- } }, h("mg-card", { key: '8c1465a6bb2ee834dfb5e56c847ed989de3e7f85', shadow: true }, h("div", { key: '5897cc498704d96f11e0c164f6ca9f466dd796e2', class: "mg-c-modal__dialog" }, h("header", { key: '362442dfe15aa7a1a0ee9c5d108eeb4d06267216', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: '3e67791bec888b3d79433ecdfc61f47d6b3be8ec', class: "mg-c-modal__close-button" }, h("mg-button", { key: '7d7c4b9947737392e178ce125f77bb6c7d376322', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '27d293b26e3b2e7b36cf92fc02ed7ffae90da736', icon: "cross" })))), h("h1", { key: 'fa0a8c9db3a3cd0e7facf944dd0e23786b59191d', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: '60079c102f0db39e5b05613ed0b03db167740d47', class: "mg-c-modal__content" }, h("slot", { key: '5c52b794b06d07c2206aa05e4ca809f369c06811' })), this.hasActions && (h("footer", { key: '793cf6f99e16b10f5af17691194fd2dd6101a3b7', class: "mg-c-modal__footer" }, h("slot", { key: '7d2b3b264a7bf167d5066b14db8fed880e985013', name: "actions" })))))));
113
+ } }, h("mg-card", { key: '4985b4af69968577ffd36a6a2b1f96274703d146', shadow: true }, h("div", { key: 'c4aed6d29dc5ee00f323dcbaecff9532f370ec98', class: "mg-c-modal__dialog" }, h("header", { key: '3bfeb66d59144c0cba3fd82c1fb4dee2ed62cea7', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: '55205da6c8991444ff53da7224b28c7475b0e173', class: "mg-c-modal__close-button" }, h("mg-button", { key: 'da7fdea3a124a559cb637beea9d5565c1f777eea', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '77c2ab2bcacdda9fa179b480651507a1d6584686', icon: "cross" })))), h("h1", { key: 'cedb5efc709de2d18e81409139da790349a48bb8', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: '7f24e65244836c08dbf7465f8c80970080003bcd', class: "mg-c-modal__content" }, h("slot", { key: '36d7c2a0ef1bb1024887da08298391962285bbf8' })), this.hasActions && (h("footer", { key: '5967d650e4e58726641a3c960d82aa7ee588e38f', class: "mg-c-modal__footer" }, h("slot", { key: 'c275b8235acb658ded3db7c69b931000a5ff14d2', name: "actions" })))))));
114
114
  }
115
115
  static get is() { return "mg-modal"; }
116
116
  static get encapsulation() { return "shadow"; }
@@ -23,7 +23,7 @@ import { initLocales } from "./../../../locales";
23
23
  * @param step - step size
24
24
  * @returns range numbers
25
25
  */
26
- const range = (start, end, step = 1) => Array.from(Array(Math.ceil((end + 1 - start) / step)).keys()).map(x => start + x * step);
26
+ const range = (start, end, step = 1) => Array.from(Array(Math.ceil((end + 1 - start) / step)).keys()).map((x) => start + x * step);
27
27
  export class MgPagination {
28
28
  constructor() {
29
29
  /**
@@ -71,7 +71,9 @@ export class MgPagination {
71
71
  * @param disabled - button disable state
72
72
  */
73
73
  this.handleGoToPage = (action, disabled) => {
74
- !disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
74
+ if (!disabled) {
75
+ this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
76
+ }
75
77
  };
76
78
  }
77
79
  watchIdentifier(newValue) {
@@ -94,7 +96,9 @@ export class MgPagination {
94
96
  this.currentPageChange.emit(newValue);
95
97
  }
96
98
  watchPaginationMessages(newValue) {
97
- if (Boolean(newValue) && (typeof newValue !== 'object' || !['next', 'previous', 'nextLabel', 'previousLabel'].every(key => isValidString(newValue[key])))) {
99
+ if (Boolean(newValue) &&
100
+ (typeof newValue !== 'object' ||
101
+ !['next', 'previous', 'nextLabel', 'previousLabel'].every((key) => isValidString(newValue[key])))) {
98
102
  throw new Error('<mg-pagination> prop "messages" must be a valid "PaginationMessagesType".');
99
103
  }
100
104
  }
@@ -134,7 +138,7 @@ export class MgPagination {
134
138
  // eslint-disable-next-line react/jsx-no-bind
135
139
  onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), !this.hideNavigationLabels && navigationMessages[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
136
140
  };
137
- return (h(Host, { hidden: this.totalPages < 2 }, h("nav", { role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (h("div", { class: "mg-c-pagination__page-count" }, h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.localesMessages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("span", { class: "mg-u-visually-hidden" }, this.localesMessages.pagination.page, " ", this.currentPage), "/ ", this.totalPages, " ", this.totalPages > 1 ? this.localesMessages.pagination.pages : this.localesMessages.pagination.page)), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT))));
141
+ return (h(Host, { hidden: this.totalPages < 2 }, h("nav", { role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (h("div", { class: "mg-c-pagination__page-count" }, h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map((page) => page.toString()), label: this.localesMessages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("p", { class: "mg-c-pagination__page-count-text" }, h("span", { class: "mg-u-visually-hidden" }, this.localesMessages.pagination.page, " ", this.currentPage), "/ ", this.totalPages, ' ', this.totalPages > 1 ? this.localesMessages.pagination.pages : this.localesMessages.pagination.page))), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT))));
138
142
  }
139
143
  static get is() { return "mg-pagination"; }
140
144
  static get encapsulation() { return "shadow"; }
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
2
2
  import { ClassList, createID, isValidString, isValideID, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
3
  import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
4
4
  import { initLocales } from "../../../locales";
5
- import { expandToggleDisplays, titlePositions } from "./mg-panel.conf";
5
+ import { expandToggleDisplays, titlePositions, } from "./mg-panel.conf";
6
6
  /**
7
7
  * @slot - Panel content
8
8
  * @slot panel-title - Panel title content (replaces panel-title prop when used)
@@ -110,7 +110,12 @@ export class MgPanel {
110
110
  * Render collapse button
111
111
  * @returns collpase button
112
112
  */
113
- this.renderCollapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", "aria-expanded": this.expanded.toString(), "aria-controls": `${this.identifier}-content`, disabled: this.expandToggleDisabled, isIcon: this.expandToggleDisplay === 'icon', label: this.expandToggleDisplay === 'icon' ? this.panelTitle : undefined }, h("span", { class: "mg-c-panel__collapse-button-content" }, h("mg-icon", { icon: "chevron-up", class: { 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded } }), !this.isEditing && this.expandToggleDisplay !== 'icon' && (this.hasPanelTitleSlot() ? h("slot", { name: "panel-title" }) : this.panelTitle))));
113
+ this.renderCollapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", "aria-expanded": this.expanded.toString(), "aria-controls": `${this.identifier}-content`, disabled: this.expandToggleDisabled, isIcon: this.expandToggleDisplay === 'icon', label: this.expandToggleDisplay === 'icon' ? this.panelTitle : undefined }, h("span", { class: "mg-c-panel__collapse-button-content" }, h("mg-icon", { icon: "chevron-up", class: {
114
+ 'mg-c-panel__collapse-button-icon': true,
115
+ 'mg-c-panel__collapse-button-icon--reverse': !this.expanded,
116
+ } }), !this.isEditing &&
117
+ this.expandToggleDisplay !== 'icon' &&
118
+ (this.hasPanelTitleSlot() ? h("slot", { name: "panel-title" }) : this.panelTitle))));
114
119
  /**
115
120
  * Render edit button
116
121
  * @returns edit Button
@@ -142,7 +147,11 @@ export class MgPanel {
142
147
  */
143
148
  this.renderHeaderChildren = () => {
144
149
  const children = [
145
- h("div", { class: { 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }, key: this.panelTitle }, this.renderTitle()),
150
+ h("div", { class: {
151
+ 'mg-c-panel__header-title': true,
152
+ 'mg-c-panel__header-title--full': this.isEditing,
153
+ 'mg-c-panel__header-title--reverse': this.titlePosition === 'right',
154
+ }, key: this.panelTitle }, this.renderTitle()),
146
155
  h("div", { class: "mg-c-panel__header-content", key: "slot-header" }, h("slot", { name: "header-right" })),
147
156
  ];
148
157
  return this.titlePosition === 'right' ? children.reverse() : children;
@@ -236,7 +245,7 @@ export class MgPanel {
236
245
  */
237
246
  render() {
238
247
  const headerId = `${this.identifier}-header`;
239
- return (h("section", { key: '39d956a9b2c54b794c7ab9f2896dd1152834e8ef', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: '13d0facc8eb2f4cf0c5cfc7580aafd49d3debf9a', shadow: this.shadow }, h("header", { key: 'e008bee0a091c655b41712f8f9dff3beadaf437d', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: 'a2efbe980ed634f9aeb296eb4c0f7a3f117a8e51', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: '20849cd8295bed06e647e5befd3906e787dae698' })))));
248
+ return (h("section", { key: '33e6da36cbb92f19bcd957de7758c1a13ced5e83', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: 'df278e46b4604d8c5dce2abeffb2e979b02f34e9', shadow: this.shadow }, h("header", { key: 'b68012115af4bb5b62b6357fc07cbf50876ac08f', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: '3dfec67e6531fc0dff866e102ac36bd6c6a48834', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: '56c63dd0b0e98968594ff713c2c6ee2a3269b74b' })))));
240
249
  }
241
250
  static get is() { return "mg-panel"; }
242
251
  static get encapsulation() { return "shadow"; }
@@ -46,7 +46,7 @@ export class MgPopoverContent {
46
46
  * @returns HTML Element
47
47
  */
48
48
  render() {
49
- return (h(Host, { key: 'e3de7dc2ddf9cba900f1980a6237e95f7a5daea1' }, h("mg-card", { key: '775c623b0cfd3f5cb08ce34281ac558a5dfd52df', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: '48269416813e32ef03cc4f02dae4e42fb542b053', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: 'd947151a3751052261c3a1d67eca570b6f991d80', icon: "cross" }))), h("div", { key: '6c447184b41381b2563dcee874153a55521ff7aa', class: "mg-c-popover-content__title" }, h("slot", { key: '5b05e6c30fa020a8765f83d7008b4b9ecad63433', name: "title" })), h("slot", { key: '386dbb305a8862cb55f8b06aa35d08b65051a07d', name: "content" })), h("slot", { key: '16093d6e34d8558677222da720142b7afe443adf', name: "arrow" })));
49
+ return (h(Host, { key: '7035d8f560b811596c9c641abc7fe28ee9fdf3a2' }, h("mg-card", { key: 'badc81425100283dac69cad111514d8c3edfba45', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: 'cb20d8c7db741051b532c3b1653d578df859f0d0', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: '389dc26f4cfdbb899b2b9eb4b27ceb6369209b2f', icon: "cross" }))), h("div", { key: '29b6721af3b6e06760affd6565e740bbc667f457', class: "mg-c-popover-content__title" }, h("slot", { key: '5834364d298a4e65a9170f003d0ec1f5e8868c4a', name: "title" })), h("slot", { key: '8398f497064fe097151ca263225349a9d84d4f36', name: "content" }))));
50
50
  }
51
51
  static get is() { return "mg-popover-content"; }
52
52
  static get encapsulation() { return "shadow"; }
@@ -98,7 +98,7 @@ export class MgPopoverContent {
98
98
  "composed": true,
99
99
  "docs": {
100
100
  "tags": [],
101
- "text": "Emited event when close button is clicked"
101
+ "text": "Emitted event when close button is clicked"
102
102
  },
103
103
  "complexType": {
104
104
  "original": "void",
@@ -16,11 +16,7 @@ export class MgPopover {
16
16
  /**
17
17
  * Popover placement
18
18
  */
19
- this.placement = 'bottom';
20
- /**
21
- * Hide popover arrow
22
- */
23
- this.arrowHide = false;
19
+ this.placement = 'bottom-start';
24
20
  /**
25
21
  * Define if popover has a cross button
26
22
  */
@@ -45,7 +41,8 @@ export class MgPopover {
45
41
  // retargeted to the outer shadow host and `closest()` cannot reach the popover
46
42
  // nor the `data-mg-popover-guard` element.
47
43
  const path = event.composedPath();
48
- const isInside = path.includes(this.element) || path.some(node => node instanceof HTMLElement && node.dataset.mgPopoverGuard === this.identifier);
44
+ const isInside = path.includes(this.element) ||
45
+ path.some((node) => node instanceof HTMLElement && node.dataset.mgPopoverGuard === this.identifier);
49
46
  if (!this.disabled && !isInside) {
50
47
  this.display = false;
51
48
  }
@@ -84,7 +81,7 @@ export class MgPopover {
84
81
  * @param newValue - if true enable popper listners
85
82
  */
86
83
  this.setPopperListeners = (newValue) => {
87
- this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: newValue }] })));
84
+ this.popper.setOptions((options) => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: newValue }] })));
88
85
  };
89
86
  /**
90
87
  * Manage all clickOustside listeners
@@ -121,13 +118,9 @@ export class MgPopover {
121
118
  this.mgPopoverContent.setAttribute('slot', 'content');
122
119
  this.mgPopoverContent.setAttribute('id', this.identifier);
123
120
  this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);
124
- const arrow = document.createElement('div');
125
- arrow.setAttribute('slot', 'arrow');
126
- arrow.dataset.popperArrow = '';
127
- this.mgPopoverContent.appendChild(arrow);
128
121
  // insert elements in DOM
129
- ['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach(slotType => {
130
- Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {
122
+ ['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach((slotType) => {
123
+ Array.from(this.element.querySelectorAll(slotType)).forEach((slot) => {
131
124
  this.mgPopoverContent.appendChild(slot);
132
125
  });
133
126
  });
@@ -145,12 +138,6 @@ export class MgPopover {
145
138
  // use renderPopoverContent to update popover-content id
146
139
  this.renderPopoverContent();
147
140
  }
148
- validateArrowHide(newValue) {
149
- if (newValue)
150
- this.mgPopoverContent.dataset.arrowHide = '';
151
- else
152
- delete this.mgPopoverContent.dataset.arrowHide;
153
- }
154
141
  validateCloseButton(newValue) {
155
142
  this.mgPopoverContent.closeButton = newValue;
156
143
  }
@@ -182,7 +169,6 @@ export class MgPopover {
182
169
  this.renderPopoverContent();
183
170
  this.validateCloseButton(this.closeButton);
184
171
  this.validateIdentifier(this.identifier);
185
- this.validateArrowHide(this.arrowHide);
186
172
  }
187
173
  /**
188
174
  * Check if component props are well configured on init
@@ -207,7 +193,8 @@ export class MgPopover {
207
193
  {
208
194
  name: 'offset',
209
195
  options: {
210
- offset: [0, 0],
196
+ // 2px gap with the trigger element, applied on the main axis only (no cross-axis shift so `-start`/`-end` stay aligned)
197
+ offset: [0, 2],
211
198
  },
212
199
  },
213
200
  {
@@ -219,7 +206,7 @@ export class MgPopover {
219
206
  ],
220
207
  });
221
208
  // add resize observer
222
- [this.interactiveElement, this.element.querySelector('mg-popover-content')].forEach(element => {
209
+ [this.interactiveElement, this.element.querySelector('mg-popover-content')].forEach((element) => {
223
210
  new ResizeObserver(() => {
224
211
  this.popper.update();
225
212
  }).observe(element);
@@ -236,7 +223,7 @@ export class MgPopover {
236
223
  }
237
224
  });
238
225
  // Add events to hide popover
239
- this.element.addEventListener('keydown', e => {
226
+ this.element.addEventListener('keydown', (e) => {
240
227
  if (!this.disabled && e.code === 'Escape') {
241
228
  this.display = false;
242
229
  this.componentClose.emit();
@@ -250,7 +237,7 @@ export class MgPopover {
250
237
  * @returns HTML Element
251
238
  */
252
239
  render() {
253
- return (h(Host, { key: '422ac3fe8b6d3784bd667074096996ffe6f52cb6' }, h("slot", { key: 'c8a2b51b1ca454f823d73ed2e72fff9aa1162b3f' }), h("slot", { key: '3f7c21389b13c497204de5415613c90aeabe3c86', name: "content" })));
240
+ return (h(Host, { key: '9e62e60ba76045222b9c69b34245c3825004f8d6' }, h("slot", { key: '4be1a5c1221e1985cd0c0b4f7b19435d097bee4e' }), h("slot", { key: '07c2003dc3ad0bb7059e75e95e0de2862a64fd22', name: "content" })));
254
241
  }
255
242
  static get is() { return "mg-popover"; }
256
243
  static get encapsulation() { return "shadow"; }
@@ -311,27 +298,27 @@ export class MgPopover {
311
298
  "setter": false,
312
299
  "reflect": false,
313
300
  "attribute": "placement",
314
- "defaultValue": "'bottom'"
301
+ "defaultValue": "'bottom-start'"
315
302
  },
316
303
  "arrowHide": {
317
- "type": "boolean",
304
+ "type": "unknown",
318
305
  "mutable": false,
319
306
  "complexType": {
320
- "original": "boolean",
321
- "resolved": "boolean",
307
+ "original": "never",
308
+ "resolved": "never",
322
309
  "references": {}
323
310
  },
324
311
  "required": false,
325
312
  "optional": false,
326
313
  "docs": {
327
- "tags": [],
314
+ "tags": [{
315
+ "name": "deprecated",
316
+ "text": "this prop is deprecated and will be removed in future releases. The popover arrow has been removed."
317
+ }],
328
318
  "text": "Hide popover arrow"
329
319
  },
330
320
  "getter": false,
331
- "setter": false,
332
- "reflect": false,
333
- "attribute": "arrow-hide",
334
- "defaultValue": "false"
321
+ "setter": false
335
322
  },
336
323
  "closeButton": {
337
324
  "type": "boolean",
@@ -404,7 +391,7 @@ export class MgPopover {
404
391
  "composed": true,
405
392
  "docs": {
406
393
  "tags": [],
407
- "text": "Emited event when display value change"
394
+ "text": "Emitted event when display value change"
408
395
  },
409
396
  "complexType": {
410
397
  "original": "HTMLMgPopoverElement['display']",
@@ -438,9 +425,6 @@ export class MgPopover {
438
425
  return [{
439
426
  "propName": "identifier",
440
427
  "methodName": "validateIdentifier"
441
- }, {
442
- "propName": "arrowHide",
443
- "methodName": "validateArrowHide"
444
428
  }, {
445
429
  "propName": "closeButton",
446
430
  "methodName": "validateCloseButton"
@@ -65,7 +65,7 @@ export class MgProgress {
65
65
  * @returns HTML Element
66
66
  */
67
67
  render() {
68
- return (h(Host, { key: 'd5027418b3a6fe08cd7e6800fd1cb01a268750f6', role: this.ariaRole, "aria-label": this.label, "aria-valuenow": this.value, "aria-valuemin": this.min, "aria-valuemax": this.max }, h("div", { key: '963659f80b05db089d564095a6eaa5558ece4ffd', class: "mg-c-progress" }, h("div", { key: 'ad019298b3d3ecf3df00946af3e7b897910bbaf7', class: { 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min } }, h("div", { key: '921f637985dc611a606ebc4c62da4ba188b3d407', class: "mg-c-progress__fill", style: {
68
+ return (h(Host, { key: '3682d5f1980678e39594dab8223805deb4b425d4', role: this.ariaRole, "aria-label": this.label, "aria-valuenow": this.value, "aria-valuemin": this.min, "aria-valuemax": this.max }, h("div", { key: '001d511a866ec0526c4ffd01a8a90448b6f40819', class: "mg-c-progress" }, h("div", { key: '504fa583f5b8186236871f3f2cd886acb40614ef', class: { 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min } }, h("div", { key: '044c9297d5a12c9d8c6d3b76d17dd2ba6a1a9719', class: "mg-c-progress__fill", style: {
69
69
  width: `${Math.round(((this.value - this.min) / (this.max - this.min)) * 100)}%`,
70
70
  } })))));
71
71
  }
@@ -17,7 +17,9 @@ export class MgSkipLinks {
17
17
  };
18
18
  }
19
19
  validateLinks(links) {
20
- if (links === undefined || links.length === 0 || links.some(link => !isValidString(link.href) || !link.href.startsWith('#') || !isValidString(link.label))) {
20
+ if (links === undefined ||
21
+ links.length === 0 ||
22
+ links.some((link) => !isValidString(link.href) || !link.href.startsWith('#') || !isValidString(link.label))) {
21
23
  throw new Error(`<mg-skip-links> prop "links": Cannot be empty and each link must contains an href starting with a "#" and a non empty label attributes.`);
22
24
  }
23
25
  }
@@ -36,7 +38,7 @@ export class MgSkipLinks {
36
38
  * @returns HTML Element
37
39
  */
38
40
  render() {
39
- return (h("nav", { key: 'ddae15101123757391d8dced8c88854c852563c1', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: 'df27b144dbf68f3e2fceeeb8575a81c51b74c4d4', class: "mg-c-skip-links__list", role: "list" }, this.links.map(link => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
41
+ return (h("nav", { key: '9208da538e001be23c8cc78e8a34498cd072cdc6', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: 'fcd69f398fad6964d5c017bb652ad7b8de34dee6', class: "mg-c-skip-links__list", role: "list" }, this.links.map((link) => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
40
42
  }
41
43
  static get is() { return "mg-skip-links"; }
42
44
  static get encapsulation() { return "shadow"; }
@@ -87,7 +89,7 @@ export class MgSkipLinks {
87
89
  "composed": true,
88
90
  "docs": {
89
91
  "tags": [],
90
- "text": "Emited event when link is clicked"
92
+ "text": "Emitted event when link is clicked"
91
93
  },
92
94
  "complexType": {
93
95
  "original": "string",
@@ -1,5 +1,5 @@
1
1
  import { ClassList, toString, createID, isValidString } from "@mgdis/core-ui-helpers/dist/utils";
2
- import { textAlignments, dataTypes, sizes } from "./mg-table.conf";
2
+ import { textAlignments, dataTypes, sizes, } from "./mg-table.conf";
3
3
  import { initLocales } from "../../../locales";
4
4
  /**
5
5
  * Check if value is a valid align object
@@ -22,7 +22,7 @@ typeof newValue === 'object' &&
22
22
  (value.sortable !== undefined && typeof value.sortable === 'boolean') ||
23
23
  (value.datatype !== undefined && dataTypes.includes(value.datatype))) &&
24
24
  // ensure no extra properties are present
25
- Object.keys(value).every(key => ['align', 'sortable', 'datatype'].includes(key)));
25
+ Object.keys(value).every((key) => ['align', 'sortable', 'datatype'].includes(key)));
26
26
  /**
27
27
  * Compare values
28
28
  * @param firstValue - First value
@@ -150,12 +150,16 @@ export class MgTable {
150
150
  // Add event listener
151
151
  button.addEventListener('click', () => {
152
152
  // Reset aria pressed
153
- table.querySelectorAll(`thead td:not(:nth-child(${key})) [aria-pressed],thead th:not(:nth-child(${key})) [aria-pressed]`).forEach(ariaPressed => {
153
+ table
154
+ .querySelectorAll(`thead td:not(:nth-child(${key})) [aria-pressed],thead th:not(:nth-child(${key})) [aria-pressed]`)
155
+ .forEach((ariaPressed) => {
154
156
  ariaPressed.removeAttribute('aria-pressed');
155
157
  ariaPressed.querySelector('mg-icon').setAttribute('icon', 'arrows-up-down');
156
158
  });
157
159
  // Reset aria sort
158
- table.querySelectorAll(`thead td:not(:nth-child(${key}))[aria-sort],thead th:not(:nth-child(${key}))[aria-sort]`).forEach(ariaSort => {
160
+ table
161
+ .querySelectorAll(`thead td:not(:nth-child(${key}))[aria-sort],thead th:not(:nth-child(${key}))[aria-sort]`)
162
+ .forEach((ariaSort) => {
159
163
  ariaSort.removeAttribute('aria-sort');
160
164
  });
161
165
  // Set aria pressed
@@ -190,7 +194,7 @@ export class MgTable {
190
194
  // If sort order is none, return to original order
191
195
  if (sortOrder === 'none') {
192
196
  // Append rows to table
193
- rowsDefault.forEach(row => table.querySelector('tbody').append(row));
197
+ rowsDefault.forEach((row) => table.querySelector('tbody').append(row));
194
198
  return;
195
199
  }
196
200
  // Set a copy of rows
@@ -208,7 +212,7 @@ export class MgTable {
208
212
  return compareValues(cellValueA, cellValueB, sortOrder === 'descending', value.datatype);
209
213
  });
210
214
  // Append rows to table
211
- rows.forEach(row => table.querySelector('tbody').append(row));
215
+ rows.forEach((row) => table.querySelector('tbody').append(row));
212
216
  });
213
217
  }
214
218
  });
@@ -1,5 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
- import { createID, ClassList, allItemsAreString, isValidString, nextTick, toString, isValideID } from "@mgdis/core-ui-helpers/dist/utils";
2
+ import { createID, ClassList, allItemsAreString, isValidString, nextTick, toString, isValideID, } from "@mgdis/core-ui-helpers/dist/utils";
3
3
  import { Status } from "./mg-tabs.conf";
4
4
  import { Keys } from "../../../utils/events.utils";
5
5
  /**
@@ -141,7 +141,7 @@ export class MgTabs {
141
141
  * Validate slots setting
142
142
  */
143
143
  this.validateSlots = () => {
144
- const slots = Array.from(this.element.children).filter(slot => { var _a; return (_a = slot.getAttribute('slot')) === null || _a === void 0 ? void 0 : _a.includes('tab_content-'); });
144
+ const slots = Array.from(this.element.children).filter((slot) => { var _a; return (_a = slot.getAttribute('slot')) === null || _a === void 0 ? void 0 : _a.includes('tab_content-'); });
145
145
  if (slots.length !== this.tabs.length)
146
146
  throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
147
147
  };
@@ -159,7 +159,7 @@ export class MgTabs {
159
159
  validateItems(newValue) {
160
160
  // String array
161
161
  if (allItemsAreString(newValue))
162
- this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
162
+ this.tabs = newValue.map((item) => ({ label: item, status: Status.VISIBLE }));
163
163
  // Object array
164
164
  else if (Array.isArray(newValue) && newValue.length > 0 && newValue.every(isTabItem))
165
165
  this.tabs = newValue;
@@ -170,11 +170,14 @@ export class MgTabs {
170
170
  // when `active-tab` is undefined we set default value by searching an item with `Status.ACTIVE` or we use the `startIndex` has fallback value
171
171
  // after setting new value to `active-tab` the validate will be triggered again with the updated value and process the tab update
172
172
  if (newValue === undefined) {
173
- this.activeTab = this.tabs.some(tab => this.tabHasStatus(tab, Status.ACTIVE))
174
- ? this.getTabItemIndex(this.tabs.findIndex(tab => this.tabHasStatus(tab, Status.ACTIVE)))
173
+ this.activeTab = this.tabs.some((tab) => this.tabHasStatus(tab, Status.ACTIVE))
174
+ ? this.getTabItemIndex(this.tabs.findIndex((tab) => this.tabHasStatus(tab, Status.ACTIVE)))
175
175
  : this.startIndex;
176
176
  }
177
- else if (typeof newValue === 'number' && newValue >= this.startIndex && newValue <= this.tabs.length && this.isActivableTab(this.tabs[newValue - this.startIndex])) {
177
+ else if (typeof newValue === 'number' &&
178
+ newValue >= this.startIndex &&
179
+ newValue <= this.tabs.length &&
180
+ this.isActivableTab(this.tabs[newValue - this.startIndex])) {
178
181
  // if new 'active-tab' is activable we update tab status to ACTIVE and toggle past ACTIVE to VISIBLE
179
182
  this.tabs.forEach((tab, index) => {
180
183
  const isNewActiveTab = index === newValue - this.startIndex;
@@ -223,13 +226,13 @@ export class MgTabs {
223
226
  * @returns HTML Element
224
227
  */
225
228
  render() {
226
- return (h("div", { key: '25edcc3793e5f060bd3df862ec0c2963c4ec6bdd', class: this.classCollection.join() }, h("header", { key: 'fe9f0e13f798bb88a4c00e2e5ad8e9adf841b05e', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
229
+ return (h("div", { key: '37be8d325dfea3a7b828236f3cc21da57be28154', class: this.classCollection.join() }, h("header", { key: 'd88f10c0331984a759f8abc311f11d913fb25206', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
227
230
  [`${this.buttonTabBaseClass}`]: true,
228
231
  [`${this.buttonTabBaseClass}--horizontal`]: true,
229
232
  [`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
230
233
  [`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.tabHasStatus(tab, Status.DISABLED),
231
234
  [`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.tabHasStatus(tab, Status.HIDDEN),
232
- }, tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), "aria-disabled": this.tabHasStatus(tab, Status.DISABLED), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabItemIndex(index) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon, size: "small" }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "text-color", value: tab.badge.value, label: tab.badge.label, outline: tab.badge.role === 'information' }))))), this.tabs.map((tab, index) => (h("article", { key: tab.label, role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-c-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) }))))));
235
+ }, tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), "aria-disabled": this.tabHasStatus(tab, Status.DISABLED), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabItemIndex(index) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon, size: "small" }), tab.label, tab.badge !== undefined && (h("mg-badge", { variant: "text-color", value: tab.badge.value, label: tab.badge.label, outline: tab.badge.role === 'information' })))))), this.tabs.map((tab, index) => (h("article", { key: tab.label, role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-c-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) }))))));
233
236
  }
234
237
  static get is() { return "mg-tabs"; }
235
238
  static get encapsulation() { return "shadow"; }
@@ -364,7 +367,7 @@ export class MgTabs {
364
367
  "composed": true,
365
368
  "docs": {
366
369
  "tags": [],
367
- "text": "Emited event when active tab change"
370
+ "text": "Emitted event when active tab change"
368
371
  },
369
372
  "complexType": {
370
373
  "original": "HTMLMgTabsElement['activeTab']",
@@ -60,13 +60,13 @@ export class OverflowBehavior {
60
60
  throw new Error('OverflowBehavior - all constructor params are required');
61
61
  }
62
62
  const items = Array.from(this.parentElement.children);
63
- this._resizeObserver = new ResizeObserver(entries => {
63
+ this._resizeObserver = new ResizeObserver((entries) => {
64
64
  this._availableWidth = entries
65
- .map(entry => entry.contentRect.width)
65
+ .map((entry) => entry.contentRect.width)
66
66
  .sort((a, b) => a - b)
67
67
  .shift();
68
68
  // reset items
69
- items.forEach(item => this.toggleItem(item, false));
69
+ items.forEach((item) => this.toggleItem(item, false));
70
70
  let accWidth = 0;
71
71
  items.forEach((item, index) => {
72
72
  accWidth += item.offsetWidth;