@mgdis/mg-components 6.22.1 → 6.23.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 (129) hide show
  1. package/dist/cjs/{index-Dz2LAZQT.js → index-BEF-cqV9.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mg-action-more_36.cjs.entry.js +162 -71
  4. package/dist/cjs/mg-alert.cjs.entry.js +6 -2
  5. package/dist/cjs/mg-breadcrumb.cjs.entry.js +1 -1
  6. package/dist/cjs/mg-components.cjs.js +3 -3
  7. package/dist/cjs/mg-fieldset.cjs.entry.js +4 -3
  8. package/dist/cjs/mg-input-combobox.cjs.entry.js +4 -3
  9. package/dist/cjs/mg-input-file.cjs.entry.js +5 -4
  10. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +7489 -6389
  11. package/dist/cjs/mg-input.conf-wgTh7iBb.js +84 -0
  12. package/dist/cjs/mg-loader.cjs.entry.js +1 -1
  13. package/dist/cjs/mg-progress.cjs.entry.js +1 -1
  14. package/dist/collection/assets/icons/index.js +1 -1
  15. package/dist/collection/collection-manifest.json +1 -1
  16. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +5 -2
  17. package/dist/collection/components/atoms/mg-badge/mg-badge.js +10 -2
  18. package/dist/collection/components/atoms/mg-button/mg-button.js +3 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +14 -6
  20. package/dist/collection/components/atoms/mg-icon/mg-icon.js +8 -5
  21. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +7 -2
  22. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +11 -11
  23. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +3 -1
  24. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +4 -2
  25. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +4 -2
  26. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +5 -3
  27. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +3 -1
  28. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +3 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +3 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +3 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +54 -26
  32. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +5 -3
  33. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +3 -1
  34. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +3 -1
  35. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
  36. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +4 -2
  37. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
  38. package/dist/collection/components/molecules/mg-alert/mg-alert.js +25 -1
  39. package/dist/collection/components/molecules/mg-details/mg-details.js +3 -1
  40. package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +3 -1
  41. package/dist/collection/components/molecules/mg-form/mg-form.js +4 -2
  42. package/dist/collection/components/molecules/mg-message/mg-message.js +39 -2
  43. package/dist/collection/components/molecules/mg-panel/mg-panel.js +16 -4
  44. package/dist/components/index3.js +1 -1
  45. package/dist/components/index4.js +1 -0
  46. package/dist/components/mg-action-more.js +1 -1
  47. package/dist/components/mg-alert.js +1 -1
  48. package/dist/components/mg-badge2.js +1 -1
  49. package/dist/components/mg-breadcrumb.js +1 -1
  50. package/dist/components/mg-button2.js +1 -1
  51. package/dist/components/mg-card2.js +1 -1
  52. package/dist/components/mg-character-left2.js +1 -1
  53. package/dist/components/mg-details.js +1 -1
  54. package/dist/components/mg-divider2.js +1 -1
  55. package/dist/components/mg-fieldset.js +1 -1
  56. package/dist/components/mg-form.js +1 -1
  57. package/dist/components/mg-icon2.js +1 -1
  58. package/dist/components/mg-input-checkbox.js +1 -1
  59. package/dist/components/mg-input-combobox.js +1 -1
  60. package/dist/components/mg-input-date.js +1 -1
  61. package/dist/components/mg-input-file.js +1 -1
  62. package/dist/components/mg-input-numeric.js +1 -1
  63. package/dist/components/mg-input-password.js +1 -1
  64. package/dist/components/mg-input-radio.js +1 -1
  65. package/dist/components/mg-input-rich-text-editor.js +284 -284
  66. package/dist/components/mg-input-select2.js +1 -1
  67. package/dist/components/mg-input-text2.js +1 -1
  68. package/dist/components/mg-input-textarea.js +1 -1
  69. package/dist/components/mg-input-title2.js +1 -1
  70. package/dist/components/mg-input-toggle.js +1 -1
  71. package/dist/components/mg-input2.js +1 -1
  72. package/dist/components/mg-item-more2.js +1 -1
  73. package/dist/components/mg-loader2.js +1 -1
  74. package/dist/components/mg-menu-item2.js +1 -1
  75. package/dist/components/mg-message2.js +1 -1
  76. package/dist/components/mg-modal.js +1 -1
  77. package/dist/components/mg-pagination.js +1 -1
  78. package/dist/components/mg-panel.js +1 -1
  79. package/dist/components/mg-popover-content2.js +1 -1
  80. package/dist/components/mg-skip-links.js +1 -1
  81. package/dist/components/mg-table.js +1 -1
  82. package/dist/components/mg-tooltip2.js +1 -1
  83. package/dist/custom-elements.json +8828 -0
  84. package/dist/esm/{index-C3jUhxdI.js → index-DshvCiTL.js} +1 -1
  85. package/dist/esm/loader.js +3 -3
  86. package/dist/esm/mg-action-more_36.entry.js +162 -71
  87. package/dist/esm/mg-alert.entry.js +6 -2
  88. package/dist/esm/mg-breadcrumb.entry.js +1 -1
  89. package/dist/esm/mg-components.js +4 -4
  90. package/dist/esm/mg-fieldset.entry.js +4 -3
  91. package/dist/esm/mg-input-combobox.entry.js +4 -3
  92. package/dist/esm/mg-input-file.entry.js +5 -4
  93. package/dist/esm/mg-input-rich-text-editor.entry.js +7489 -6389
  94. package/dist/esm/mg-input.conf-DOi9lJXy.js +73 -0
  95. package/dist/esm/mg-loader.entry.js +1 -1
  96. package/dist/esm/mg-progress.entry.js +1 -1
  97. package/dist/mg-components/mg-components.esm.js +1 -1
  98. package/dist/mg-components/{p-661da56b.entry.js → p-13feb37a.entry.js} +1 -1
  99. package/dist/mg-components/{p-c1aeb277.entry.js → p-236bb1d2.entry.js} +1 -1
  100. package/dist/mg-components/p-79265ad3.entry.js +1 -0
  101. package/dist/mg-components/{p-8e256086.entry.js → p-7c63e469.entry.js} +1 -1
  102. package/dist/mg-components/p-7fd3e519.entry.js +1 -0
  103. package/dist/mg-components/p-DOi9lJXy.js +1 -0
  104. package/dist/mg-components/p-a0e2c886.entry.js +1 -0
  105. package/dist/mg-components/p-cdb01923.entry.js +1 -0
  106. package/dist/mg-components/p-d0b6d8f5.entry.js +1 -0
  107. package/dist/mg-components/p-d698fa67.entry.js +1658 -0
  108. package/dist/types/assets/icons/index.d.ts +2 -0
  109. package/dist/types/components/atoms/internals/mg-input-title/mg-input-title.d.ts +4 -0
  110. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +4 -0
  111. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +12 -6
  112. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +4 -0
  113. package/dist/types/components/molecules/mg-message/mg-message.d.ts +6 -0
  114. package/dist/types/components.d.ts +22 -0
  115. package/dist/types/stencil-public-runtime.d.ts +1 -0
  116. package/ide/intellij/web-types.json +207 -3472
  117. package/ide/vscode/css-custom-data.json +1 -1
  118. package/ide/vscode/html-custom-data.json +58 -314
  119. package/package.json +29 -24
  120. package/dist/cjs/mg-input.conf-BNpeATnq.js +0 -35
  121. package/dist/esm/mg-input.conf-C9rmNQIL.js +0 -25
  122. package/dist/mg-components/p-06fbdb2f.entry.js +0 -1
  123. package/dist/mg-components/p-188b9ca9.entry.js +0 -1
  124. package/dist/mg-components/p-4667078d.entry.js +0 -1
  125. package/dist/mg-components/p-5a859ecf.entry.js +0 -1658
  126. package/dist/mg-components/p-C9rmNQIL.js +0 -1
  127. package/dist/mg-components/p-b0b8c58f.entry.js +0 -1
  128. package/dist/mg-components/p-bbcef41c.entry.js +0 -1
  129. /package/dist/mg-components/{p-C3jUhxdI.js → p-DshvCiTL.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, allItemsAreString, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  import { classReadonly, classDisabled, widths } from "../mg-input/mg-input.conf";
4
5
  import { initLocales } from "../../../../locales";
5
6
  /**
@@ -20,6 +21,25 @@ const allItemsAreOptions = (items) => Array.isArray(items) && items.every(item =
20
21
  * @returns select optgroup type is valid
21
22
  */
22
23
  const isOptGroup = (optgroup) => typeof optgroup === 'object' && typeof optgroup.group === 'string' && allItemsAreOptions(optgroup.options);
24
+ /**
25
+ * Ensure options can be unambiguously differentiated by their title
26
+ * Two options can share the same title only when they belong to different groups
27
+ * @param items - select options to validate
28
+ */
29
+ const validateUniqueTitles = (items) => {
30
+ const titlesByGroup = new Map();
31
+ items.forEach(({ title, group }) => {
32
+ if (!titlesByGroup.has(group)) {
33
+ titlesByGroup.set(group, new Set());
34
+ }
35
+ const titles = titlesByGroup.get(group);
36
+ if (titles.has(title)) {
37
+ const groupContext = group === undefined ? 'outside of a group' : `within the group "${group}"`;
38
+ throw new Error(`<mg-input-select> prop "items" must not contain options with the same "title" ${groupContext}. Duplicated title: "${title}".`);
39
+ }
40
+ titles.add(title);
41
+ });
42
+ };
23
43
  /**
24
44
  * Group options
25
45
  * @param acc - reduce accumulator
@@ -106,18 +126,37 @@ export class MgInputSelect {
106
126
  return null;
107
127
  }
108
128
  };
129
+ /**
130
+ * Get the rendered options as a flat list, in render order
131
+ * The select value is the position of an option in this list, so it uniquely identifies an option even when several share the same title
132
+ * @returns flat select options
133
+ */
134
+ this.getOptions = () => this.options.flatMap(option => (isOptGroup(option) ? option.options : [option]));
135
+ /**
136
+ * Get the option matching the current select value
137
+ * @returns matching option or undefined
138
+ */
139
+ this.getSelectedOption = () => {
140
+ var _a;
141
+ if (((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) === undefined || this.input.value === '') {
142
+ return undefined;
143
+ }
144
+ const options = this.getOptions();
145
+ // The select value is normally the render index of the selected option
146
+ const optionByIndex = options[Number(this.input.value)];
147
+ // Fallback for an unknown value injected programmatically (stored as a disabled option keyed by its own value)
148
+ return optionByIndex !== null && optionByIndex !== void 0 ? optionByIndex : options.find(option => option.value === this.input.value);
149
+ };
109
150
  /**
110
151
  * Handle input event
111
152
  */
112
153
  this.handleInput = () => {
154
+ const selectedOption = this.getSelectedOption();
113
155
  if (this.input.value === '') {
114
156
  this.value = null;
115
157
  }
116
- else if (allItemsAreString(this.items) && this.items.includes(this.input.value)) {
117
- this.value = this.input.value;
118
- }
119
- else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {
120
- this.value = this.items.find(this.isInputValue).value;
158
+ else if (selectedOption !== undefined) {
159
+ this.value = selectedOption.value;
121
160
  }
122
161
  else {
123
162
  // Add the unknown input.value to the options array as a disabled option before setting it as the new value
@@ -128,20 +167,6 @@ export class MgInputSelect {
128
167
  this.setErrorMessage();
129
168
  }
130
169
  };
131
- /**
132
- * Method to compare item with input.value
133
- * @param item - item to compare with
134
- * @returns truthy if input.value is an item
135
- */
136
- this.isInputValue = (item) => {
137
- if (this.input === undefined)
138
- return false;
139
- // String items keep native DOM values.
140
- if (allItemsAreString(this.items))
141
- return item.title === this.input.value;
142
- // Object items use stringified values.
143
- return toString(item.value) === this.input.value;
144
- };
145
170
  /**
146
171
  * Handle blur event
147
172
  */
@@ -156,7 +181,7 @@ export class MgInputSelect {
156
181
  * Input value is disabled
157
182
  * @returns truthy if input value is disabled
158
183
  */
159
- this.isDisabledValue = () => { var _a; return allItemsAreOptions(this.options) && ((_a = this.options.find(this.isInputValue)) === null || _a === void 0 ? void 0 : _a.disabled) === true; };
184
+ this.isDisabledValue = () => { var _a; return ((_a = this.getSelectedOption()) === null || _a === void 0 ? void 0 : _a.disabled) === true; };
160
185
  /**
161
186
  * Check if input is valid
162
187
  */
@@ -184,12 +209,10 @@ export class MgInputSelect {
184
209
  /**
185
210
  * Render option
186
211
  * @param option - to render
212
+ * @param index - option position in the flat list of rendered options, used as the option value
187
213
  * @returns render option
188
214
  */
189
- this.renderOption = (option) => {
190
- const serializedValue = allItemsAreString(this.items) ? option.title : toString(option.value);
191
- return (h("option", { key: serializedValue, value: serializedValue, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title));
192
- };
215
+ this.renderOption = (option, index) => (h("option", { key: index, value: `${index}`, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title));
193
216
  }
194
217
  validateValue(newValue) {
195
218
  setTimeout(() => {
@@ -207,6 +230,7 @@ export class MgInputSelect {
207
230
  }
208
231
  // String array
209
232
  else if (allItemsAreString(newValue)) {
233
+ validateUniqueTitles(newValue.map(item => ({ title: item })));
210
234
  if (typeof this.value === 'string') {
211
235
  this.valueExist = newValue.includes(this.value);
212
236
  }
@@ -214,6 +238,7 @@ export class MgInputSelect {
214
238
  }
215
239
  // Object array
216
240
  else if (allItemsAreOptions(newValue)) {
241
+ validateUniqueTitles(newValue);
217
242
  this.valueExist = newValue.map(item => item.value).includes(this.value);
218
243
  // Grouped object options
219
244
  if (newValue.some(item => Boolean(item.group))) {
@@ -360,6 +385,7 @@ export class MgInputSelect {
360
385
  componentWillLoad() {
361
386
  // Get locales
362
387
  this.messages = initLocales(this.element).messages;
388
+ normalizeBooleanAttributes(this);
363
389
  // Validate
364
390
  this.validateItems(this.items);
365
391
  this.validateValue(this.value);
@@ -383,11 +409,13 @@ export class MgInputSelect {
383
409
  */
384
410
  render() {
385
411
  const readonlyValue = this.getReadonlyValue();
386
- return (h("mg-input", { key: '7d544e8f67a37d5781697da10d3d4f47cc5027e3', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
412
+ // Running index shared across groups, so each option gets a unique value matching its position in getOptions()
413
+ let optionIndex = 0;
414
+ return (h("mg-input", { key: '9e51eff6ef7158aa1786a893985e4d1d202e94ed', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("select", { class: "mg-c-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
387
415
  if (el !== null)
388
416
  this.input = el;
389
417
  } }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
390
- h("option", { value: "", disabled: this.placeholderDisabled && this.valueExist }, this.placeholder)), this.options.map(option => isOptGroup(option) ? (h("optgroup", { label: option.group, key: option.group }, option.options.map(this.renderOption))) : (isOption(option) && this.renderOption(option)))))));
418
+ h("option", { value: "", disabled: this.placeholderDisabled && this.valueExist }, this.placeholder)), this.options.map(option => isOptGroup(option) ? (h("optgroup", { label: option.group, key: option.group }, option.options.map(groupedOption => this.renderOption(groupedOption, optionIndex++)))) : (isOption(option) && this.renderOption(option, optionIndex++)))))));
391
419
  }
392
420
  static get is() { return "mg-input-select"; }
393
421
  static get encapsulation() { return "shadow"; }
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
- import { allItemsAreString, ClassList, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
2
+ import { ClassList, allItemsAreString, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  import { helpTextTypes, textTypes } from "./mg-input-text.conf";
4
5
  import { widths, classReadonly, classDisabled, classDisplayCharacterLeft } from "../mg-input/mg-input.conf";
5
6
  import { initLocales } from "../../../../locales";
@@ -352,6 +353,7 @@ export class MgInputText {
352
353
  this.messages = initLocales(this.element).messages;
353
354
  this.characterLeftId = `${this.identifier}-character-left`;
354
355
  this.datalistId = `${this.identifier}-datalist`;
356
+ normalizeBooleanAttributes(this);
355
357
  // Validate
356
358
  this.validateIcon(this.icon);
357
359
  this.validateDatalistoptions(this.datalistoptions);
@@ -375,7 +377,7 @@ export class MgInputText {
375
377
  * @returns HTML Element
376
378
  */
377
379
  render() {
378
- return (h("mg-input", { key: '068e38b82ef4e2254fb8d37f21ecf11dc4f3a012', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly
380
+ return (h("mg-input", { key: '5758548bc9e5b1319e5d2f4832339d2f95d9d436', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly
379
381
  ? this.value && this.renderReadonly()
380
382
  : [
381
383
  h("div", { key: "input", class: "mg-c-input__input-group-container", style: {
@@ -550,7 +552,7 @@ export class MgInputText {
550
552
  "mutable": false,
551
553
  "complexType": {
552
554
  "original": "IconType",
553
- "resolved": "\"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"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\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"",
555
+ "resolved": "\"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"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\" | \"glitters\" | \"glitters-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"",
554
556
  "references": {
555
557
  "IconType": {
556
558
  "location": "import",
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  import { widths, classReadonly, classDisabled, classDisplayCharacterLeft } from "../mg-input/mg-input.conf";
4
5
  import { initLocales } from "../../../../locales";
5
6
  export class MgInputTextarea {
@@ -265,6 +266,7 @@ export class MgInputTextarea {
265
266
  // Get locales
266
267
  this.messages = initLocales(this.element).messages;
267
268
  this.characterLeftId = `${this.identifier}-character-left`;
269
+ normalizeBooleanAttributes(this);
268
270
  // Validate
269
271
  this.validatecharacterLeftHide(this.characterLeftHide);
270
272
  this.validatePattern(this.pattern);
@@ -284,7 +286,7 @@ export class MgInputTextarea {
284
286
  * @returns HTML Element
285
287
  */
286
288
  render() {
287
- return (h("mg-input", { key: '021aa902aa952730d98fbc2eaa5136975b484319', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value && h("b", { class: "mg-c-input__readonly-value" }, this.value)) : (h("div", { class: "mg-c-input__input-group-container" }, h("textarea", { class: {
289
+ return (h("mg-input", { key: '5a6d89809f5e842cf5a0cda0e3c692cc4c0f667f', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: this.characterLeftId, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value && h("b", { class: "mg-c-input__readonly-value" }, this.value)) : (h("div", { class: "mg-c-input__input-group-container" }, h("textarea", { class: {
288
290
  'mg-c-input__box': true,
289
291
  'mg-c-input__box--width': true,
290
292
  'mg-c-input__box--resizable': this.resizable === 'both',
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, allItemsAreString, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  import { classDisabled, classReadonly } from "../mg-input/mg-input.conf";
4
5
  /**
5
6
  * type Option validation function
@@ -256,6 +257,7 @@ export class MgInputToggle {
256
257
  * Check if component props are well configured on init
257
258
  */
258
259
  componentWillLoad() {
260
+ normalizeBooleanAttributes(this);
259
261
  this.watchItems(this.items);
260
262
  this.validateSlots();
261
263
  this.watchValue(this.value);
@@ -270,7 +272,7 @@ export class MgInputToggle {
270
272
  */
271
273
  render() {
272
274
  const currentOption = this.options[this.getCurrentOptionIndex(this.value)];
273
- return (h("mg-input", { key: '3f440a16156b4fc89590addba025b350218ccf9c', label: this.label, helpText: this.helpText, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, errorMessage: this.errorMessage }, this.readonly ? (currentOption && h("b", { class: "mg-c-input__readonly-value" }, currentOption.title)) : (h("button", { type: "button", role: "switch", "aria-checked": this.isChecked(this.value).toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-c-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.handleSwitchButton, ref: el => {
275
+ return (h("mg-input", { key: '09f0a48057d2c2a19b1f01e8e769592824afdd23', label: this.label, helpText: this.helpText, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, errorMessage: this.errorMessage }, this.readonly ? (currentOption && h("b", { class: "mg-c-input__readonly-value" }, currentOption.title)) : (h("button", { type: "button", role: "switch", "aria-checked": this.isChecked(this.value).toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-c-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.handleSwitchButton, ref: el => {
274
276
  if (el !== null)
275
277
  this.button = el;
276
278
  } }, h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, h("slot", { name: "item-1" })), h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, h("slot", { name: "item-2" }))))));
@@ -99,7 +99,7 @@ export class MgItemMore {
99
99
  "mutable": false,
100
100
  "complexType": {
101
101
  "original": "IconType",
102
- "resolved": "{ icon: \"filter\" | \"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"; }",
102
+ "resolved": "{ icon: \"filter\" | \"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"glitters\" | \"glitters-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"; }",
103
103
  "references": {
104
104
  "IconType": {
105
105
  "location": "import",
@@ -1,5 +1,6 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { ClassList, createID, isValideID, isValidString, nextTick, toString } from "@mgdis/core-ui-helpers/dist/utils";
2
+ import { ClassList, createID, isValidString, isValideID, nextTick, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  import { initLocales } from "../../../../locales";
4
5
  import { directions } from "../mg-menu/mg-menu.conf";
5
6
  import { Status, targets } from "./mg-menu-item.conf";
@@ -293,6 +294,7 @@ export class MgMenuItem {
293
294
  * Validate props
294
295
  */
295
296
  componentWillLoad() {
297
+ normalizeBooleanAttributes(this);
296
298
  // has children items that is NOT [slot='image' | 'information' | 'label' | 'metadata'] element
297
299
  // we store only matching elements
298
300
  this.hasChildren = Array.from(this.element.children).some(child => !['image', 'information', 'label', 'metadata'].includes(child.getAttribute('slot')));
@@ -370,7 +372,7 @@ export class MgMenuItem {
370
372
  ['mg-c-menu-item__collapse-container']: true,
371
373
  ['mg-c-menu-item__collapse-container--first-level']: (this.isInMainMenu() || this.isItemMore) && this.isDirection(directions.HORIZONTAL),
372
374
  });
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
375
+ return (h(Host, { key: 'c96763db4eeaa4a70213f39f13600aacbbed02b4', 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
374
376
  }, this.renderInteractiveElement(), h("div", { class: getContainerClasses(), slot: "content" }, this.renderSlot()))) : ([
375
377
  this.renderInteractiveElement(),
376
378
  h("div", { key: "vertical-container", class: getContainerClasses(), hidden: !this.expanded }, this.renderSlot()),
@@ -197,7 +197,7 @@ export class MgActionMore {
197
197
  "mutable": true,
198
198
  "complexType": {
199
199
  "original": "MgActionMoreIconType",
200
- "resolved": "{ icon: \"filter\" | \"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"; }",
200
+ "resolved": "{ icon: \"filter\" | \"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\" | \"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\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"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\" | \"glitters\" | \"glitters-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"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\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"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\" | \"table\" | \"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\"; }",
201
201
  "references": {
202
202
  "MgActionMoreIconType": {
203
203
  "location": "import",
@@ -26,6 +26,10 @@ export class MgAlert {
26
26
  * Define variant style
27
27
  */
28
28
  this.variantStyle = 'bar-left';
29
+ /**
30
+ * Define if alert fits its parent element
31
+ */
32
+ this.fullWidth = false;
29
33
  /**
30
34
  * Component classes
31
35
  */
@@ -142,7 +146,7 @@ export class MgAlert {
142
146
  * @returns HTML Element
143
147
  */
144
148
  render() {
145
- return (h("mg-message", { key: '9041d8643bf4d0d44f20d30ac3c1d9aa46d6e060', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '94d1a430e9af605fa2ea2b557e82fc15f1cc148b' }), 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" }))))));
149
+ return (h("mg-message", { key: '8d10696cd86b00304d8ae409e36691a41a16702e', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle, fullWidth: this.fullWidth }, h("slot", { key: '598a86d657b77006f5a9e9dbf33e7969669be125' }), 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
150
  }
147
151
  static get is() { return "mg-alert"; }
148
152
  static get encapsulation() { return "shadow"; }
@@ -230,6 +234,26 @@ export class MgAlert {
230
234
  "reflect": false,
231
235
  "attribute": "variant-style",
232
236
  "defaultValue": "'bar-left'"
237
+ },
238
+ "fullWidth": {
239
+ "type": "boolean",
240
+ "mutable": false,
241
+ "complexType": {
242
+ "original": "boolean",
243
+ "resolved": "boolean",
244
+ "references": {}
245
+ },
246
+ "required": false,
247
+ "optional": false,
248
+ "docs": {
249
+ "tags": [],
250
+ "text": "Define if alert fits its parent element"
251
+ },
252
+ "getter": false,
253
+ "setter": false,
254
+ "reflect": false,
255
+ "attribute": "full-width",
256
+ "defaultValue": "false"
233
257
  }
234
258
  };
235
259
  }
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { isValidString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  /**
4
5
  * @slot summary - Summary content
5
6
  * @slot details - Details content
@@ -36,6 +37,7 @@ export class MgDetails {
36
37
  * Check if component props are well configured on init
37
38
  */
38
39
  componentWillLoad() {
40
+ normalizeBooleanAttributes(this);
39
41
  this.validateTitles(this.toggleClosed);
40
42
  this.validateTitles(this.toggleOpened);
41
43
  // Check if summary slot is empty
@@ -53,7 +55,7 @@ export class MgDetails {
53
55
  * @returns HTML Element
54
56
  */
55
57
  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" }))));
58
+ return (h("details", { key: 'b4a342010e903cfd2a670e46257e889fd74ddf1e', 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: '85fbd6f675e20881a8eb8df776d827e25859e0b7' }, h("slot", { key: '56491b2e4fa9f4772efd5ec66825e897b90cfde3', name: "summary" }), h("span", { key: '43f913504670d8f592479d5929e6901e9f9e9a9a', class: "mg-c-details__toggle" }, h("mg-icon", { key: '268cfc8d4b9e55d87303e6a85dead205ecdd7ce1', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'e3d7c794f7a8d83a31c02302a06bbe0db1e8b63d', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: 'e5230b49934c2b3e9a0c31821e53ea52084b2b26', class: "mg-c-details__details" }, h("slot", { key: '0355f1596c85ab869b3658276ee156a7aadc50d1', name: "details" }))));
57
59
  }
58
60
  static get is() { return "mg-details"; }
59
61
  static get encapsulation() { return "shadow"; }
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, isValidString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  import { classReadonly, isMgInputFile } from "../inputs/mg-input/mg-input.conf";
4
5
  export class MgFieldset {
5
6
  constructor() {
@@ -112,6 +113,7 @@ export class MgFieldset {
112
113
  * Check if component props are well configured on init
113
114
  */
114
115
  componentWillLoad() {
116
+ normalizeBooleanAttributes(this);
115
117
  this.watchReadonly(this.readonly);
116
118
  this.watchLegendBorderDisplay(this.legendBorderDisplay);
117
119
  this.setMgInputs();
@@ -133,7 +135,7 @@ export class MgFieldset {
133
135
  * @returns HTML Element
134
136
  */
135
137
  render() {
136
- return (h("mg-input", { key: 'a32d9d6e0a77eddf6dac1c741066cb600c2f27b3', 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: '5d05e51fd64fc43458bccb3287fcf3a4fe462c00', class: "mg-c-input__input-group" }, h("slot", { key: 'd641e3007cdd2adfa6115f639603de78caa63202' }))));
138
+ return (h("mg-input", { key: '547bdc6c4c35ae9949f185f110a24c5a6437cea7', 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: '4fe4ec0d810cf46192e61b5052caf3694c3444be', class: "mg-c-input__input-group" }, h("slot", { key: '030481c1c7536b9d5e20975f77a86d3dda853582' }))));
137
139
  }
138
140
  static get is() { return "mg-fieldset"; }
139
141
  static get encapsulation() { return "shadow"; }
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
- import { createID, ClassList, toString, isValideID } from "@mgdis/core-ui-helpers/dist/utils";
2
+ import { ClassList, createID, isValideID, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
+ import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
3
4
  import { initLocales } from "../../../locales";
4
5
  import { isMgInputFile } from "../inputs/mg-input/mg-input.conf";
5
6
  import { requiredMessageStatus, roles } from "./mg-form.conf";
@@ -196,6 +197,7 @@ export class MgForm {
196
197
  componentWillLoad() {
197
198
  // Get locales
198
199
  this.messages = initLocales(this.element).messages;
200
+ normalizeBooleanAttributes(this);
199
201
  this.watchIdentifier(this.identifier);
200
202
  this.validateAriaRole(this.ariaRole);
201
203
  this.validateRequiredMessage(this.requiredMessage);
@@ -242,7 +244,7 @@ export class MgForm {
242
244
  * @returns HTML Element
243
245
  */
244
246
  render() {
245
- return (h("form", { key: 'e528a49eba4e57f809dd0a6dd5462c2be3677da5', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '37eb0c30984b998ef8d78ff8ae74949c4761c21a', innerHTML: this.requiredMessageText }), h("slot", { key: '8ae80522118a3e87ca735545a48844c1e4e3ab30' }), !this.readonly && !this.disabled && h("slot", { key: '4cdeba849881f9753ff08df6c456397e859c6a0d', name: "actions" })));
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" })));
246
248
  }
247
249
  static get is() { return "mg-form"; }
248
250
  static get encapsulation() { return "shadow"; }
@@ -11,6 +11,7 @@ export class MgMessage {
11
11
  * Internal *
12
12
  ************/
13
13
  this.classBase = 'mg-c-message';
14
+ this.classFullWidth = 'mg-c-message--full-width';
14
15
  /**
15
16
  * Define variant
16
17
  */
@@ -19,6 +20,10 @@ export class MgMessage {
19
20
  * Define variant style
20
21
  */
21
22
  this.variantStyle = 'bar-left';
23
+ /**
24
+ * Define if message fits its parent element
25
+ */
26
+ this.fullWidth = false;
22
27
  /**
23
28
  * Component classes
24
29
  */
@@ -68,6 +73,14 @@ export class MgMessage {
68
73
  this.classCollection.delete(`${this.classBase}--${oldValue}`);
69
74
  }
70
75
  }
76
+ watchFullWidth(newValue) {
77
+ if (newValue) {
78
+ this.classCollection.add(this.classFullWidth);
79
+ }
80
+ else {
81
+ this.classCollection.delete(this.classFullWidth);
82
+ }
83
+ }
71
84
  /*************
72
85
  * Lifecycle *
73
86
  *************/
@@ -78,6 +91,7 @@ export class MgMessage {
78
91
  // Validate
79
92
  this.watchVariant(this.variant);
80
93
  this.watchVariantStyle(this.variantStyle);
94
+ this.watchFullWidth(this.fullWidth);
81
95
  // Check if component has actions slot
82
96
  this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
83
97
  }
@@ -86,9 +100,9 @@ export class MgMessage {
86
100
  * @returns HTML Element
87
101
  */
88
102
  render() {
89
- return (h("div", { key: 'f99bf527eb2c6005eeaec11f89aaa08f8865ea57', class: this.classCollection.join() }, h("mg-card", { key: 'beede3cd97b022d947c216b6bba454a104ba5790', shadow: true }, this.variantStyle === 'bar-left' && h("span", { key: '515828d725a996c9d57b39ad75e9373150a1b78a', class: "mg-c-message__bar" }), h("span", { key: '02ae41c66af25c2611b9b6cb8c87a1ad99346fa3', class: "mg-c-message__icon" }, h("mg-icon", { key: '3eadb40ed0dfa5ec51155608a67769c5fee3d402', icon: this.getIcon() })), h("div", { key: 'b832251e8f330d00b512bcd508ae9bf6e5f511cb', class: "mg-c-message__content" }, h("span", { key: 'c3520fc49bd5c3c187a83823050ceb9ca8c12d46', class: "mg-c-message__content-slot" }, h("slot", { key: 'f4064dff9536cbb76e45c5c4c1a89621da9531b2' })), this.hasActions && [
103
+ return (h("div", { key: '7a91fbc1a334d006013cdc8dd8ce6bce52947b90', class: this.classCollection.join() }, h("mg-card", { key: '34117431721f271fa96ac729376c1af6178dcedf', shadow: true }, this.variantStyle === 'bar-left' && h("span", { key: 'b68b15e7bb5c48b53f3aafea30c50a1db42db87c', class: "mg-c-message__bar" }), h("span", { key: 'efb2fd983a68f252312c3266879cd37666c17707', class: "mg-c-message__icon" }, h("mg-icon", { key: 'de7df68e25a5c581407b2a88dd7c268c4e6977cd', icon: this.getIcon() })), h("div", { key: '10afb1b7e6b8bea33ed18cf17dfbdaf6b35b3b89', class: "mg-c-message__content" }, h("span", { key: '5f7c5d7429a143f44c992fe79f0c42649fb695a7', class: "mg-c-message__content-slot" }, h("slot", { key: 'c20cbe2a91eb487bdebd5c049c33b7d50148a7b0' })), this.hasActions && [
90
104
  h("span", { class: "mg-c-message__content-separator", key: "content-separator" }),
91
- h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '5585f7c14c2c3896cfdb5319414cd82f4d4b3a8b', name: "actions" })),
105
+ h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: 'cdf59d5cb43793c7d8be40cf9d8d43b7d03d0a02', name: "actions" })),
92
106
  ]))));
93
107
  }
94
108
  static get is() { return "mg-message"; }
@@ -158,6 +172,26 @@ export class MgMessage {
158
172
  "reflect": false,
159
173
  "attribute": "variant-style",
160
174
  "defaultValue": "'bar-left'"
175
+ },
176
+ "fullWidth": {
177
+ "type": "boolean",
178
+ "mutable": false,
179
+ "complexType": {
180
+ "original": "boolean",
181
+ "resolved": "boolean",
182
+ "references": {}
183
+ },
184
+ "required": false,
185
+ "optional": false,
186
+ "docs": {
187
+ "tags": [],
188
+ "text": "Define if message fits its parent element"
189
+ },
190
+ "getter": false,
191
+ "setter": false,
192
+ "reflect": false,
193
+ "attribute": "full-width",
194
+ "defaultValue": "false"
161
195
  }
162
196
  };
163
197
  }
@@ -175,6 +209,9 @@ export class MgMessage {
175
209
  }, {
176
210
  "propName": "variantStyle",
177
211
  "methodName": "watchVariantStyle"
212
+ }, {
213
+ "propName": "fullWidth",
214
+ "methodName": "watchFullWidth"
178
215
  }];
179
216
  }
180
217
  }