@mgdis/mg-components 6.12.0 → 6.13.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 (102) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_37.cjs.entry.js +211 -45
  3. package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -1
  4. package/dist/cjs/mg-components.cjs.js +1 -1
  5. package/dist/cjs/mg-input-combobox.cjs.entry.js +38 -16
  6. package/dist/cjs/mg-input-combobox.cjs.entry.js.map +1 -1
  7. package/dist/cjs/mg-input-combobox.entry.cjs.js.map +1 -1
  8. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +33 -15
  9. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js.map +1 -1
  10. package/dist/cjs/mg-input-rich-text-editor.entry.cjs.js.map +1 -1
  11. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -1
  12. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  13. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +42 -5
  14. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  15. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +38 -16
  16. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +1 -1
  17. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +39 -5
  18. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  19. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +41 -6
  20. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +39 -4
  22. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +40 -4
  24. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +51 -16
  26. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +39 -4
  28. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +19 -7
  30. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +39 -4
  32. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  33. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +40 -6
  34. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  35. package/dist/collection/components/molecules/mg-form/mg-form.js +23 -1
  36. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  37. package/dist/components/mg-form.js +9 -1
  38. package/dist/components/mg-form.js.map +1 -1
  39. package/dist/components/mg-input-checkbox-paginated2.js +2 -1
  40. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  41. package/dist/components/mg-input-checkbox.js +26 -5
  42. package/dist/components/mg-input-checkbox.js.map +1 -1
  43. package/dist/components/mg-input-combobox.js +38 -16
  44. package/dist/components/mg-input-combobox.js.map +1 -1
  45. package/dist/components/mg-input-date.js +23 -5
  46. package/dist/components/mg-input-date.js.map +1 -1
  47. package/dist/components/mg-input-numeric.js +23 -4
  48. package/dist/components/mg-input-numeric.js.map +1 -1
  49. package/dist/components/mg-input-password.js +23 -4
  50. package/dist/components/mg-input-password.js.map +1 -1
  51. package/dist/components/mg-input-radio.js +24 -4
  52. package/dist/components/mg-input-radio.js.map +1 -1
  53. package/dist/components/mg-input-rich-text-editor.js +34 -15
  54. package/dist/components/mg-input-rich-text-editor.js.map +1 -1
  55. package/dist/components/mg-input-select2.js +23 -4
  56. package/dist/components/mg-input-select2.js.map +1 -1
  57. package/dist/components/mg-input-text2.js +18 -6
  58. package/dist/components/mg-input-text2.js.map +1 -1
  59. package/dist/components/mg-input-textarea.js +23 -4
  60. package/dist/components/mg-input-textarea.js.map +1 -1
  61. package/dist/components/mg-input-toggle.js +24 -6
  62. package/dist/components/mg-input-toggle.js.map +1 -1
  63. package/dist/components/mg-table.js +1 -1
  64. package/dist/components/mg-table.js.map +1 -1
  65. package/dist/esm/loader.js +1 -1
  66. package/dist/esm/mg-action-more_37.entry.js +211 -45
  67. package/dist/esm/mg-action-more_37.entry.js.map +1 -1
  68. package/dist/esm/mg-components.js +1 -1
  69. package/dist/esm/mg-input-combobox.entry.js +38 -16
  70. package/dist/esm/mg-input-combobox.entry.js.map +1 -1
  71. package/dist/esm/mg-input-rich-text-editor.entry.js +33 -15
  72. package/dist/esm/mg-input-rich-text-editor.entry.js.map +1 -1
  73. package/dist/mg-components/mg-components.esm.js +1 -1
  74. package/dist/mg-components/mg-input-combobox.entry.esm.js.map +1 -1
  75. package/dist/mg-components/mg-input-rich-text-editor.entry.esm.js.map +1 -1
  76. package/dist/mg-components/p-3e92299a.entry.js +2 -0
  77. package/dist/mg-components/p-3e92299a.entry.js.map +1 -0
  78. package/dist/mg-components/p-c907ddac.entry.js +2 -0
  79. package/dist/mg-components/p-c907ddac.entry.js.map +1 -0
  80. package/dist/mg-components/{p-3853afb5.entry.js → p-e7a7c651.entry.js} +2 -2
  81. package/dist/mg-components/p-e7a7c651.entry.js.map +1 -0
  82. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +4 -0
  83. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +1 -1
  84. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -0
  85. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +6 -2
  86. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +4 -0
  87. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +4 -0
  88. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +4 -0
  89. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +4 -0
  90. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +1 -1
  91. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -0
  92. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +9 -4
  93. package/dist/types/components/molecules/mg-form/mg-form.d.ts +4 -0
  94. package/dist/types/components.d.ts +47 -6
  95. package/ide/intellij/web-types.json +21 -17
  96. package/ide/vscode/html-custom-data.json +14 -14
  97. package/package.json +20 -20
  98. package/dist/mg-components/p-3853afb5.entry.js.map +0 -1
  99. package/dist/mg-components/p-5a05b1da.entry.js +0 -2
  100. package/dist/mg-components/p-5a05b1da.entry.js.map +0 -1
  101. package/dist/mg-components/p-74b5112a.entry.js +0 -2
  102. package/dist/mg-components/p-74b5112a.entry.js.map +0 -1
@@ -668,6 +668,7 @@ const MgForm = class {
668
668
  index.registerInstance(this, hostRef);
669
669
  this.formValid = index.createEvent(this, "form-valid");
670
670
  this.formSubmit = index.createEvent(this, "form-submit");
671
+ this.formReset = index.createEvent(this, "form-reset");
671
672
  // Classes
672
673
  this.classAllRequired = 'mg-c-form--all-required';
673
674
  this.classLabelOnTop = 'mg-c-form--label-on-top';
@@ -832,6 +833,8 @@ const MgForm = class {
832
833
  await input.reset();
833
834
  }
834
835
  }));
836
+ this.checkValidity();
837
+ this.formReset.emit(true);
835
838
  }
836
839
  }
837
840
  /*************
@@ -852,6 +855,11 @@ const MgForm = class {
852
855
  // Set button form identifier
853
856
  this.mgButtons.forEach(mgButton => {
854
857
  mgButton.setAttribute('form', this.identifier);
858
+ if (mgButton.type === 'reset') {
859
+ mgButton.addEventListener('click', () => {
860
+ this.reset();
861
+ });
862
+ }
855
863
  });
856
864
  // Set mgInputs
857
865
  this.setMgInputs();
@@ -884,7 +892,7 @@ const MgForm = class {
884
892
  * @returns HTML Element
885
893
  */
886
894
  render() {
887
- return (index.h("form", { key: '9080c660259ae4bacd80e1b9230357e32b034375', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && index.h("p", { key: '477b0b4f73559078d2ae898c65f581fb0d3f7400', innerHTML: this.requiredMessageText }), index.h("slot", { key: 'df79ec2a3b9b20c4960a1d0b3f4fe2825114c123' }), !this.readonly && !this.disabled && index.h("slot", { key: 'e18812f3f0894552bd931d94a842af6a13f4d770', name: "actions" })));
895
+ return (index.h("form", { key: '6330085d26ecd493eab3fd0fd63344ce1a00e589', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && index.h("p", { key: '386adf6d3ee2d0d8ec6adf791da8f21a6fb6ac11', innerHTML: this.requiredMessageText }), index.h("slot", { key: '5349f004f644b4e02e1c5da27f49df4efacac016' }), !this.readonly && !this.disabled && index.h("slot", { key: '2ed9817b514033c89933751a3dc00ed668331b68', name: "actions" })));
888
896
  }
889
897
  get element() { return index.getElement(this); }
890
898
  static get watchers() { return {
@@ -1586,7 +1594,9 @@ const MgInputCheckbox = class {
1586
1594
  const displayItems = this.getDisplayItems();
1587
1595
  // update only displayed items
1588
1596
  displayItems.forEach(item => {
1589
- item.value = event.detail !== SectionKind.SELECTED;
1597
+ if (item.disabled !== true) {
1598
+ item.value = event.detail !== SectionKind.SELECTED;
1599
+ }
1590
1600
  });
1591
1601
  this.updateValues();
1592
1602
  };
@@ -1779,6 +1789,13 @@ const MgInputCheckbox = class {
1779
1789
  // refresh search values
1780
1790
  this.updateSearchResults();
1781
1791
  }
1792
+ /**
1793
+ * Set focus on input.
1794
+ */
1795
+ async setFocus() {
1796
+ var _a;
1797
+ (_a = this.element.shadowRoot.querySelector('input')) === null || _a === void 0 ? void 0 : _a.focus();
1798
+ }
1782
1799
  /**
1783
1800
  * Display input error if it exists.
1784
1801
  */
@@ -1825,9 +1842,20 @@ const MgInputCheckbox = class {
1825
1842
  async reset() {
1826
1843
  if (!this.readonly) {
1827
1844
  this.value = this.value.map(item => (Object.assign(Object.assign({}, item), { value: false })));
1828
- this.checkValidity();
1829
- this.errorMessage = undefined;
1830
- this.hasDisplayedError = false;
1845
+ // Use `Promise` as requested for stencil method
1846
+ // Use `requestAnimationFrame` to ensure:
1847
+ // - DOM is fully updated before validation
1848
+ // - Async operations are completed
1849
+ // - No timing issues with Stencil's render cycle
1850
+ // - Keep everything in sync both inside and outside the component
1851
+ return new Promise(resolve => {
1852
+ requestAnimationFrame(() => {
1853
+ this.checkValidity();
1854
+ this.errorMessage = undefined;
1855
+ this.hasDisplayedError = false;
1856
+ resolve();
1857
+ });
1858
+ });
1831
1859
  }
1832
1860
  }
1833
1861
  /**
@@ -1947,7 +1975,7 @@ const MgInputCheckbox = class {
1947
1975
  else {
1948
1976
  inputContent = this.renderCheckboxMulti();
1949
1977
  }
1950
- return (index.h("mg-input", { key: '27f167ac343dd9b8ad18007d02112ece285badf0', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue.length === 0 ? 'label' : this.tooltipPosition, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined }, inputContent));
1978
+ return (index.h("mg-input", { key: '9778efa758e52b1da2a91fa57da2bd7f9a708d35', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue.length === 0 ? 'label' : this.tooltipPosition, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined }, inputContent));
1951
1979
  }
1952
1980
  get element() { return index.getElement(this); }
1953
1981
  static get watchers() { return {
@@ -2073,7 +2101,8 @@ const MgInputCheckboxPaginated = class {
2073
2101
  const getText = (checkboxes) => (index.h("em", { key: '0bf489a95090b519c85a4649d6c3b9a0e97bf0d8', class: "mg-c-input__section-header-title-label" }, `${this.messages[checkboxes.length > 1 ? 'titlePlural' : 'title']} (${checkboxes.length})`));
2074
2102
  const [from, to] = this.getFromToIndexes();
2075
2103
  const itemsContainerId = `items-${this.sectionKind}-container`;
2076
- return (index.h(index.Host, { key: 'ee67aa1705efa2b88010748b6978e0c1dec6e4de', hidden: this.checkboxes.length < 1 }, index.h("div", { key: 'b713e2a0e21f57d3b238b72163f3d7a4781b7026', class: "mg-c-input__section-header" }, this.sectionKind === SectionKind.SELECTED ? (index.h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.expanded.toString() }, index.h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), index.h("span", { class: "mg-c-input__section-header-title" }, getText(this.checkboxes)))) : (index.h("p", { class: "mg-c-input__section-header-title mg-c-input__section-header-title--static" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.expanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (index.h("mg-tooltip", { key: 'ef75381dab8028c3da4cbcefba644770322c2e7e', class: "mg-c-input__section-header-tootlip", message: this.messages.tooltip }, index.h("mg-button", { key: '6e33b32300e7932f09ce1152462a3cf19e452df8', variant: "link", onClick: this.massActionHandler }, this.messages.action))), this.expanded && this.getPageCount(this.checkboxes) > 1 && (index.h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), index.h("div", { key: '727ef2955d5866131e421c0809244ccc42c75dd0', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__section-content" }, index.h(MgInputCheckboxList, { key: 'd26de7f05b85142df7218ad9941e4b201cfb2e01', checkboxes: this.getArrayRange(this.checkboxes, from, to), displaySearchInput: true, messages: this.messages, id: `items-${this.sectionKind}`, disabled: this.disabled, name: this.name, invalid: this.invalid }))));
2104
+ return (index.h(index.Host, { key: 'ee67aa1705efa2b88010748b6978e0c1dec6e4de', hidden: this.checkboxes.length < 1 }, index.h("div", { key: 'b713e2a0e21f57d3b238b72163f3d7a4781b7026', class: "mg-c-input__section-header" }, this.sectionKind === SectionKind.SELECTED ? (index.h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.expanded.toString() }, index.h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), index.h("span", { class: "mg-c-input__section-header-title" }, getText(this.checkboxes)))) : (index.h("p", { class: "mg-c-input__section-header-title mg-c-input__section-header-title--static" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.expanded && this.checkboxes.some(checkbox => checkbox.value === true && checkbox.disabled !== true)) ||
2105
+ (this.sectionKind === SectionKind.NOT_SELECTED && this.checkboxes.some(checkbox => checkbox.value === false && checkbox.disabled !== true))) && (index.h("mg-tooltip", { key: '7e5cba3b03cdc7bab68650b9aed36c195ca4dfe6', class: "mg-c-input__section-header-tootlip", message: this.messages.tooltip }, index.h("mg-button", { key: '4980f26ade12cbfaa6ef6041fa84918900cb652a', variant: "link", onClick: this.massActionHandler }, this.messages.action))), this.expanded && this.getPageCount(this.checkboxes) > 1 && (index.h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), index.h("div", { key: '950b07ea9c59e8bc21e236bf32e3bf0a9318a008', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__section-content" }, index.h(MgInputCheckboxList, { key: '276f679e01756d6d60f043dc1c04807b5058750a', checkboxes: this.getArrayRange(this.checkboxes, from, to), displaySearchInput: true, messages: this.messages, id: `items-${this.sectionKind}`, disabled: this.disabled, name: this.name, invalid: this.invalid }))));
2077
2106
  }
2078
2107
  static get watchers() { return {
2079
2108
  "checkboxes": ["watchCheckboxes"]
@@ -2331,6 +2360,13 @@ const MgInputDate = class {
2331
2360
  else
2332
2361
  this.classCollection.delete(mgInput_conf.classDisabled);
2333
2362
  }
2363
+ /**
2364
+ * Set focus on input.
2365
+ */
2366
+ async setFocus() {
2367
+ var _a;
2368
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
2369
+ }
2334
2370
  /**
2335
2371
  * Display input error if it exists.
2336
2372
  */
@@ -2377,10 +2413,20 @@ const MgInputDate = class {
2377
2413
  async reset() {
2378
2414
  if (!this.readonly) {
2379
2415
  this.value = null;
2380
- this.checkValidity();
2381
- this.invalid = false;
2382
- this.errorMessage = undefined;
2383
- this.hasDisplayedError = false;
2416
+ // Use `Promise` as requested for stencil method
2417
+ // Use `requestAnimationFrame` to ensure:
2418
+ // - DOM is fully updated before validation
2419
+ // - Async operations are completed
2420
+ // - No timing issues with Stencil's render cycle
2421
+ // - Keep everything in sync both inside and outside the component
2422
+ return new Promise(resolve => {
2423
+ requestAnimationFrame(() => {
2424
+ this.checkValidity();
2425
+ this.errorMessage = undefined;
2426
+ this.hasDisplayedError = false;
2427
+ resolve();
2428
+ });
2429
+ });
2384
2430
  }
2385
2431
  }
2386
2432
  /**
@@ -2428,7 +2474,7 @@ const MgInputDate = class {
2428
2474
  * @returns HTML Element
2429
2475
  */
2430
2476
  render() {
2431
- return (index.h("mg-input", { key: 'f70668308972435503fc53cc194b3f14abab6d3c', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === null ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly ? (this.value && index.h("b", { class: "mg-c-input__readonly-value" }, index$2.localeDate(this.value, this.locale))) : (index.h("input", { type: "date", class: "mg-c-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, ref: (el) => {
2477
+ return (index.h("mg-input", { key: '9afadd8001b3db8101678116996a28c88fc047be', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === null ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly ? (this.value && index.h("b", { class: "mg-c-input__readonly-value" }, index$2.localeDate(this.value, this.locale))) : (index.h("input", { type: "date", class: "mg-c-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, ref: (el) => {
2432
2478
  if (el !== null)
2433
2479
  this.input = el;
2434
2480
  } }))));
@@ -2756,6 +2802,13 @@ const MgInputNumeric = class {
2756
2802
  throw new Error(`<mg-input-numeric> prop "decimal-length" must be a positive number, consider using prop "type" to "integer" instead. Passed value: ${index$1.toString(newValue)}.`);
2757
2803
  }
2758
2804
  }
2805
+ /**
2806
+ * Set focus on input.
2807
+ */
2808
+ async setFocus() {
2809
+ var _a;
2810
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
2811
+ }
2759
2812
  /**
2760
2813
  * Display input error if it exists.
2761
2814
  */
@@ -2802,9 +2855,20 @@ const MgInputNumeric = class {
2802
2855
  async reset() {
2803
2856
  if (!this.readonly) {
2804
2857
  this.value = '';
2805
- this.checkValidity();
2806
- this.errorMessage = undefined;
2807
- this.hasDisplayedError = false;
2858
+ // Use `Promise` as requested for stencil method
2859
+ // Use `requestAnimationFrame` to ensure:
2860
+ // - DOM is fully updated before validation
2861
+ // - Async operations are completed
2862
+ // - No timing issues with Stencil's render cycle
2863
+ // - Keep everything in sync both inside and outside the component
2864
+ return new Promise(resolve => {
2865
+ requestAnimationFrame(() => {
2866
+ this.checkValidity();
2867
+ this.errorMessage = undefined;
2868
+ this.hasDisplayedError = false;
2869
+ resolve();
2870
+ });
2871
+ });
2808
2872
  }
2809
2873
  }
2810
2874
  /**
@@ -2888,7 +2952,7 @@ const MgInputNumeric = class {
2888
2952
  * @returns HTML Element
2889
2953
  */
2890
2954
  render() {
2891
- return (index.h("mg-input", { key: '2f6c8a691f5d089cb24a3541a70b2bfb62a5d381', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly
2955
+ return (index.h("mg-input", { key: '4b882a2d468ea59b1ece7cb59cdb8372ce4d2299', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly
2892
2956
  ? this.readonlyValue && this.renderReadonly()
2893
2957
  : [
2894
2958
  index.h("input", { key: "input", type: "text", class: "mg-c-input__box mg-c-input__box--width", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, autocomplete: "off", "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
@@ -3049,6 +3113,13 @@ const MgInputPassword = class {
3049
3113
  if (newValue !== undefined)
3050
3114
  this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
3051
3115
  }
3116
+ /**
3117
+ * Set focus on input.
3118
+ */
3119
+ async setFocus() {
3120
+ var _a;
3121
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
3122
+ }
3052
3123
  /**
3053
3124
  * Display input error if it exists.
3054
3125
  */
@@ -3095,9 +3166,20 @@ const MgInputPassword = class {
3095
3166
  async reset() {
3096
3167
  if (!this.readonly) {
3097
3168
  this.value = '';
3098
- this.checkValidity();
3099
- this.errorMessage = undefined;
3100
- this.hasDisplayedError = false;
3169
+ // Use `Promise` as requested for stencil method
3170
+ // Use `requestAnimationFrame` to ensure:
3171
+ // - DOM is fully updated before validation
3172
+ // - Async operations are completed
3173
+ // - No timing issues with Stencil's render cycle
3174
+ // - Keep everything in sync both inside and outside the component
3175
+ return new Promise(resolve => {
3176
+ requestAnimationFrame(() => {
3177
+ this.checkValidity();
3178
+ this.errorMessage = undefined;
3179
+ this.hasDisplayedError = false;
3180
+ resolve();
3181
+ });
3182
+ });
3101
3183
  }
3102
3184
  }
3103
3185
  /**
@@ -3137,7 +3219,7 @@ const MgInputPassword = class {
3137
3219
  * @returns HTML Element
3138
3220
  */
3139
3221
  render() {
3140
- return (index.h("mg-input", { key: '7d2c89d5d0089768179be40837166db5b40cb387', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], 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 !== undefined && index.h("b", { class: "mg-c-input__readonly-value" }, '•'.repeat(this.value.length))) : (index.h("span", { class: "mg-c-input__input-group" }, index.h("input", { type: this.displayPassword ? 'text' : 'password', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, maxlength: this.maxlength, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
3222
+ return (index.h("mg-input", { key: '00d40d4c4c8b9ca57e9c9f34575e69ec535aea22', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], 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 !== undefined && index.h("b", { class: "mg-c-input__readonly-value" }, '•'.repeat(this.value.length))) : (index.h("span", { class: "mg-c-input__input-group" }, index.h("input", { type: this.displayPassword ? 'text' : 'password', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, maxlength: this.maxlength, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
3141
3223
  if (el !== null)
3142
3224
  this.input = el;
3143
3225
  } }), index.h("mg-button", { label: this.messages.input.password[this.displayPassword ? 'hide' : 'display'], disabled: this.disabled, variant: "flat", class: "mg-c-input__append-button", "is-icon": true, onClick: this.toggleDisplayPassword, "aria-controls": this.identifier }, index.h("mg-icon", { class: "mg-c-input__input-icon", icon: this.displayPassword ? 'eye-slash' : 'eye' }))))));
@@ -3318,6 +3400,14 @@ const MgInputRadio = class {
3318
3400
  else
3319
3401
  this.classCollection.delete(mgInput_conf.classDisabled);
3320
3402
  }
3403
+ /**
3404
+ * Set focus on input.
3405
+ */
3406
+ async setFocus() {
3407
+ if (this.inputs.length > 0) {
3408
+ this.inputs[0].focus();
3409
+ }
3410
+ }
3321
3411
  /**
3322
3412
  * Display input error if it exists.
3323
3413
  */
@@ -3364,9 +3454,20 @@ const MgInputRadio = class {
3364
3454
  async reset() {
3365
3455
  if (!this.readonly) {
3366
3456
  this.value = undefined;
3367
- this.checkValidity();
3368
- this.errorMessage = undefined;
3369
- this.hasDisplayedError = false;
3457
+ // Use `Promise` as requested for stencil method
3458
+ // Use `requestAnimationFrame` to ensure:
3459
+ // - DOM is fully updated before validation
3460
+ // - Async operations are completed
3461
+ // - No timing issues with Stencil's render cycle
3462
+ // - Keep everything in sync both inside and outside the component
3463
+ return new Promise(resolve => {
3464
+ requestAnimationFrame(() => {
3465
+ this.checkValidity();
3466
+ this.errorMessage = undefined;
3467
+ this.hasDisplayedError = false;
3468
+ resolve();
3469
+ });
3470
+ });
3370
3471
  }
3371
3472
  }
3372
3473
  /**
@@ -3409,7 +3510,7 @@ const MgInputRadio = class {
3409
3510
  * @returns HTML Element
3410
3511
  */
3411
3512
  render() {
3412
- return (index.h("mg-input", { key: '29331953486dee2ea14a562e16975b80eb672d5a', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && !this.value ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && index.h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (index.h("ul", { class: "mg-c-input__input-group-container", role: "list" }, this.options.map((input, index$1) => (index.h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "radio", id: this.identifier + '_' + index$1, name: this.identifier, value: index$1, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index$1].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
3513
+ return (index.h("mg-input", { key: '9460e2802454e18c1f79ebc63bef0b5e4712acf8', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && !this.value ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && index.h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (index.h("ul", { class: "mg-c-input__input-group-container", role: "list" }, this.options.map((input, index$1) => (index.h("li", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "radio", id: this.identifier + '_' + index$1, name: this.identifier, value: index$1, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index$1].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
3413
3514
  if (el !== null)
3414
3515
  this.inputs[index$1] = el;
3415
3516
  } }), index.h("label", { htmlFor: this.identifier + '_' + index$1 }, input.title))))))));
@@ -3668,6 +3769,13 @@ const MgInputSelect = class {
3668
3769
  if (newValue !== undefined)
3669
3770
  this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
3670
3771
  }
3772
+ /**
3773
+ * Set focus on input.
3774
+ */
3775
+ async setFocus() {
3776
+ var _a;
3777
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
3778
+ }
3671
3779
  /**
3672
3780
  * Display input error if it exists.
3673
3781
  */
@@ -3714,9 +3822,20 @@ const MgInputSelect = class {
3714
3822
  async reset() {
3715
3823
  if (!this.readonly) {
3716
3824
  this.value = null;
3717
- this.checkValidity();
3718
- this.errorMessage = undefined;
3719
- this.hasDisplayedError = false;
3825
+ // Use `Promise` as requested for stencil method
3826
+ // Use `requestAnimationFrame` to ensure:
3827
+ // - DOM is fully updated before validation
3828
+ // - Async operations are completed
3829
+ // - No timing issues with Stencil's render cycle
3830
+ // - Keep everything in sync both inside and outside the component
3831
+ return new Promise(resolve => {
3832
+ requestAnimationFrame(() => {
3833
+ this.checkValidity();
3834
+ this.errorMessage = undefined;
3835
+ this.hasDisplayedError = false;
3836
+ resolve();
3837
+ });
3838
+ });
3720
3839
  }
3721
3840
  }
3722
3841
  /**
@@ -3764,7 +3883,7 @@ const MgInputSelect = class {
3764
3883
  * @returns HTML Element
3765
3884
  */
3766
3885
  render() {
3767
- return (index.h("mg-input", { key: '0f03bf159be06827dca10a9dbfbaf953a003832d', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && index.h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (index.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) => {
3886
+ return (index.h("mg-input", { key: 'c755e68979b8cb479f409c0ac99d4fc47d1e4c25', label: this.label, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.readonlyValue === null ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && index.h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (index.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) => {
3768
3887
  if (el !== null)
3769
3888
  this.input = el;
3770
3889
  } }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
@@ -4040,10 +4159,11 @@ const MgInputText = class {
4040
4159
  }
4041
4160
  }
4042
4161
  /**
4043
- * Public method to play input focus
4162
+ * Set focus on input.
4044
4163
  */
4045
4164
  async setFocus() {
4046
- this.input.focus();
4165
+ var _a;
4166
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
4047
4167
  }
4048
4168
  /**
4049
4169
  * Display input error if it exists.
@@ -4091,9 +4211,20 @@ const MgInputText = class {
4091
4211
  async reset() {
4092
4212
  if (!this.readonly) {
4093
4213
  this.value = '';
4094
- this.checkValidity();
4095
- this.errorMessage = undefined;
4096
- this.hasDisplayedError = false;
4214
+ // Use `Promise` as requested for stencil method
4215
+ // Use `requestAnimationFrame` to ensure:
4216
+ // - DOM is fully updated before validation
4217
+ // - Async operations are completed
4218
+ // - No timing issues with Stencil's render cycle
4219
+ // - Keep everything in sync both inside and outside the component
4220
+ return new Promise(resolve => {
4221
+ requestAnimationFrame(() => {
4222
+ this.checkValidity();
4223
+ this.errorMessage = undefined;
4224
+ this.hasDisplayedError = false;
4225
+ resolve();
4226
+ });
4227
+ });
4097
4228
  }
4098
4229
  }
4099
4230
  /**
@@ -4142,7 +4273,7 @@ const MgInputText = class {
4142
4273
  * @returns HTML Element
4143
4274
  */
4144
4275
  render() {
4145
- return (index.h("mg-input", { key: '2a9455e4b6ea63a275743efd9eb0f19ca84ed6a8', 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
4276
+ return (index.h("mg-input", { key: '76e332d40fea8e1897da15271989f29d710c6550', 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
4146
4277
  ? this.value && this.renderReadonly()
4147
4278
  : [
4148
4279
  index.h("div", { key: "input", class: "mg-c-input__with-character-left", style: {
@@ -4352,6 +4483,13 @@ const MgInputTextarea = class {
4352
4483
  this.classCollection.add(this.classDisplayCharacterLeft);
4353
4484
  }
4354
4485
  }
4486
+ /**
4487
+ * Set focus on input.
4488
+ */
4489
+ async setFocus() {
4490
+ var _a;
4491
+ (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
4492
+ }
4355
4493
  /**
4356
4494
  * Display input error if it exists.
4357
4495
  */
@@ -4398,9 +4536,20 @@ const MgInputTextarea = class {
4398
4536
  async reset() {
4399
4537
  if (!this.readonly) {
4400
4538
  this.value = '';
4401
- this.checkValidity();
4402
- this.errorMessage = undefined;
4403
- this.hasDisplayedError = false;
4539
+ // Use `Promise` as requested for stencil method
4540
+ // Use `requestAnimationFrame` to ensure:
4541
+ // - DOM is fully updated before validation
4542
+ // - Async operations are completed
4543
+ // - No timing issues with Stencil's render cycle
4544
+ // - Keep everything in sync both inside and outside the component
4545
+ return new Promise(resolve => {
4546
+ requestAnimationFrame(() => {
4547
+ this.checkValidity();
4548
+ this.errorMessage = undefined;
4549
+ this.hasDisplayedError = false;
4550
+ resolve();
4551
+ });
4552
+ });
4404
4553
  }
4405
4554
  }
4406
4555
  /**
@@ -4445,7 +4594,7 @@ const MgInputTextarea = class {
4445
4594
  * @returns HTML Element
4446
4595
  */
4447
4596
  render() {
4448
- return (index.h("mg-input", { key: '17ae0e252ce0aaf46c1497ef088d744f49d7db59', 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 && index.h("b", { class: "mg-c-input__readonly-value" }, this.value)) : (index.h("div", { class: "mg-c-input__with-character-left" }, index.h("textarea", { class: {
4597
+ return (index.h("mg-input", { key: '7bcbb8d4ca3244f2278ebad0b85f83be0187a996', 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 && index.h("b", { class: "mg-c-input__readonly-value" }, this.value)) : (index.h("div", { class: "mg-c-input__with-character-left" }, index.h("textarea", { class: {
4449
4598
  'mg-c-input__box': true,
4450
4599
  'mg-c-input__box--width': true,
4451
4600
  'mg-c-input__box--resizable': this.resizable === 'both',
@@ -4534,9 +4683,6 @@ const MgInputToggle = class {
4534
4683
  index.registerInstance(this, hostRef);
4535
4684
  this.valueChange = index.createEvent(this, "value-change");
4536
4685
  this.inputValid = index.createEvent(this, "input-valid");
4537
- /************
4538
- * Internal *
4539
- ************/
4540
4686
  // Classes
4541
4687
  this.classIsActive = 'mg-c-input--toggle-is-active';
4542
4688
  this.classOnOff = 'mg-c-input--toggle-on-off';
@@ -4685,6 +4831,13 @@ const MgInputToggle = class {
4685
4831
  // update value
4686
4832
  this.value = this.getCheckedItem(newValue).value;
4687
4833
  }
4834
+ /**
4835
+ * Set focus on input.
4836
+ */
4837
+ async setFocus() {
4838
+ var _a;
4839
+ (_a = this.button) === null || _a === void 0 ? void 0 : _a.focus();
4840
+ }
4688
4841
  /**
4689
4842
  * Set an error and display a custom error message.
4690
4843
  * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
@@ -4712,9 +4865,19 @@ const MgInputToggle = class {
4712
4865
  async reset() {
4713
4866
  if (!this.readonly) {
4714
4867
  this.value = this.options[0].value;
4715
- this.errorMessage = undefined;
4716
- this.valid = undefined;
4717
4868
  this.setChecked();
4869
+ // Use `Promise` as requested for stencil method
4870
+ // Use `requestAnimationFrame` to ensure:
4871
+ // - DOM is fully updated before validation
4872
+ // - Async operations are completed
4873
+ // - No timing issues with Stencil's render cycle
4874
+ // - Keep everything in sync both inside and outside the component
4875
+ return new Promise(resolve => {
4876
+ requestAnimationFrame(() => {
4877
+ this.errorMessage = undefined;
4878
+ resolve();
4879
+ });
4880
+ });
4718
4881
  }
4719
4882
  }
4720
4883
  /**
@@ -4764,7 +4927,10 @@ const MgInputToggle = class {
4764
4927
  */
4765
4928
  render() {
4766
4929
  const checkedItem = this.getCheckedItem(this.checked);
4767
- return (index.h("mg-input", { key: 'cad9cfb403949c1a2092657d2d05956dc7bfe701', label: this.label, helpText: this.helpText, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, errorMessage: this.errorMessage }, this.readonly ? (checkedItem && index.h("b", { class: "mg-c-input__readonly-value" }, checkedItem.title)) : (index.h("button", { type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-c-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked }, index.h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, index.h("slot", { name: "item-1" })), index.h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, index.h("slot", { name: "item-2" }))))));
4930
+ return (index.h("mg-input", { key: '2e92c411cfa6fdcbcc6ed0546eed6e804ed4d9cb', label: this.label, helpText: this.helpText, identifier: this.identifier, class: this.classCollection.join(), ariaDescribedbyIDs: [], labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: undefined, tooltip: this.tooltip, tooltipPosition: this.tooltipPosition, errorMessage: this.errorMessage }, this.readonly ? (checkedItem && index.h("b", { class: "mg-c-input__readonly-value" }, checkedItem.title)) : (index.h("button", { type: "button", role: "switch", "aria-checked": this.checked.toString(), "aria-readonly": this.disabled || this.readonly, id: this.identifier, class: "mg-c-input__button-toggle", disabled: this.disabled || this.readonly, onClick: this.toggleChecked, ref: el => {
4931
+ if (el !== null)
4932
+ this.button = el;
4933
+ } }, index.h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, index.h("slot", { name: "item-1" })), index.h("span", { "aria-hidden": "true", class: "mg-c-input__toggle-item-container" }, index.h("slot", { name: "item-2" }))))));
4768
4934
  }
4769
4935
  get element() { return index.getElement(this); }
4770
4936
  static get watchers() { return {
@@ -8254,7 +8420,7 @@ const textAlignments = ['left', 'center', 'right'];
8254
8420
  // Define possible data types
8255
8421
  const dataTypes = ['string', 'numeric', 'date'];
8256
8422
 
8257
- const mgTableCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}@font-face{font-family:\"Open Sans\";src:url(\"fonts/OpenSans-Regular.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:600;src:url(\"fonts/OpenSans-SemiBold.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:700;src:url(\"fonts/OpenSans-Bold.ttf\") format(\"truetype\")}p{margin:0}p+p{margin-top:var(--mg-b-size-8)}h1,.mg-u-h1{font-family:var(--mg-b-font-family-heading);font-weight:bold}h2,.mg-u-h2{font-family:var(--mg-b-font-family-heading);font-weight:bold}h3,.mg-u-h3{font-family:var(--mg-b-font-family-heading);font-weight:bold}h4,.mg-u-h4{font-family:var(--mg-b-font-family-heading);font-weight:bold}h5,.mg-u-h5{font-family:var(--mg-b-font-family-heading);font-weight:bold}h6,.mg-u-h6{font-family:var(--mg-b-font-family-heading);font-weight:bold}h1,.mg-u-h1{font-size:var(--mg-b-font-size-h1)}h2,.mg-u-h2{font-size:var(--mg-b-font-size-h2)}h3,.mg-u-h3{font-size:var(--mg-b-font-size-h3)}h4,.mg-u-h4{font-size:var(--mg-b-font-size-h4)}h5,.mg-u-h5{font-size:var(--mg-b-font-size-h5)}h6,.mg-u-h6{font-size:var(--mg-b-font-size-h6)}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}small{font-size:var(--mg-b-small-font-size)}.mg-u-text-left{text-align:left !important}.mg-u-text-center{text-align:center !important}.mg-u-text-right{text-align:right !important}.mg-c-table{--mg-c-table-cell-spacing:var(--mg-b-size-8) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-40);--mg-c-table-header-cell-height:calc(var(--mg-b-size-min-height) + 2 * var(--mg-b-size-8));overflow:hidden;border:var(--mg-b-size-border) solid var(--mg-b-color-neutral-30);border-radius:var(--mg-b-size-12);background:var(--mg-b-color-light);border-spacing:0;color:var(--mg-b-color-dark)}.mg-c-table td,.mg-c-table th{height:var(--mg-c-table-cell-height);box-sizing:border-box;padding:var(--mg-c-table-cell-spacing);text-align:start}.mg-c-table thead{height:var(--mg-c-table-header-cell-height)}.mg-c-table thead,.mg-c-table tfoot{background-color:var(--mg-b-color-neutral-10)}.mg-c-table thead td,.mg-c-table tfoot td,.mg-c-table th{font-weight:600}.mg-c-table tr th,.mg-c-table tr td{border-block-end:var(--mg-b-size-border) solid var(--mg-b-color-neutral-30)}.mg-c-table tfoot tr:last-of-type th,.mg-c-table tfoot tr:last-of-type td{border-block-end:none}.mg-c-table.mg-c-table--size-small{--mg-c-table-cell-spacing:var(--mg-b-size-4) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-32);--mg-c-table-header-cell-height:var(--mg-b-size-32)}.mg-c-table.mg-c-table--size-large{--mg-c-table-cell-height:var(--mg-c-table-header-cell-height)}.mg-c-table.mg-c-table--size-xlarge{--mg-c-table-cell-spacing:var(--mg-b-size-12) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-64);--mg-c-table-header-cell-height:var(--mg-b-size-64)}.mg-c-table.mg-c-table--full-width{width:100%}.mg-c-table-wrapper{overflow:auto}.mg-c-table thead td,.mg-c-table thead th{position:relative}.mg-c-table thead td .mg-c-table__sort-button,.mg-c-table thead th .mg-c-table__sort-button{padding:0;border:none;margin:0;background:none;color:inherit;font-size:inherit;font-weight:600}.mg-c-table thead td .mg-c-table__sort-button::after,.mg-c-table thead th .mg-c-table__sort-button::after{position:absolute;content:\"\";inset:0}.mg-c-table thead td .mg-c-table__sort-button:hover,.mg-c-table thead th .mg-c-table__sort-button:hover{cursor:pointer}.mg-c-table thead td .mg-c-table__sort-button mg-icon,.mg-c-table thead th .mg-c-table__sort-button mg-icon{margin-left:var(--mg-b-size-4)}.mg-c-table thead td:has(.mg-c-table__sort-button):hover,.mg-c-table thead td[aria-sort=descending],.mg-c-table thead td[aria-sort=ascending],.mg-c-table thead th:has(.mg-c-table__sort-button):hover,.mg-c-table thead th[aria-sort=descending],.mg-c-table thead th[aria-sort=ascending]{background-color:var(--mg-b-color-neutral-20)}";
8423
+ const mgTableCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}@font-face{font-family:\"Open Sans\";src:url(\"fonts/OpenSans-Regular.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:600;src:url(\"fonts/OpenSans-SemiBold.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:700;src:url(\"fonts/OpenSans-Bold.ttf\") format(\"truetype\")}p{margin:0}p+p{margin-top:var(--mg-b-size-8)}h1,.mg-u-h1{font-family:var(--mg-b-font-family-heading);font-weight:bold}h2,.mg-u-h2{font-family:var(--mg-b-font-family-heading);font-weight:bold}h3,.mg-u-h3{font-family:var(--mg-b-font-family-heading);font-weight:bold}h4,.mg-u-h4{font-family:var(--mg-b-font-family-heading);font-weight:bold}h5,.mg-u-h5{font-family:var(--mg-b-font-family-heading);font-weight:bold}h6,.mg-u-h6{font-family:var(--mg-b-font-family-heading);font-weight:bold}h1,.mg-u-h1{font-size:var(--mg-b-font-size-h1)}h2,.mg-u-h2{font-size:var(--mg-b-font-size-h2)}h3,.mg-u-h3{font-size:var(--mg-b-font-size-h3)}h4,.mg-u-h4{font-size:var(--mg-b-font-size-h4)}h5,.mg-u-h5{font-size:var(--mg-b-font-size-h5)}h6,.mg-u-h6{font-size:var(--mg-b-font-size-h6)}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}small{font-size:var(--mg-b-small-font-size)}.mg-u-text-left{text-align:left !important}.mg-u-text-center{text-align:center !important}.mg-u-text-right{text-align:right !important}.mg-c-table{--mg-c-table-cell-spacing:var(--mg-b-size-8) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-40);--mg-c-table-header-cell-height:calc(var(--mg-b-size-min-height) + 2 * var(--mg-b-size-8));overflow:hidden;border:var(--mg-b-size-border) solid var(--mg-b-color-neutral-30);border-radius:var(--mg-b-size-12);background:var(--mg-b-color-light);border-spacing:0;color:var(--mg-b-color-dark)}.mg-c-table td,.mg-c-table th{height:var(--mg-c-table-cell-height);box-sizing:border-box;padding:var(--mg-c-table-cell-spacing);text-align:start}.mg-c-table thead{height:var(--mg-c-table-header-cell-height)}.mg-c-table thead,.mg-c-table tfoot{background-color:var(--mg-b-color-neutral-10)}.mg-c-table thead td,.mg-c-table tfoot td,.mg-c-table th{font-weight:600}.mg-c-table tr th,.mg-c-table tr td{border-block-end:var(--mg-b-size-border) solid var(--mg-b-color-neutral-30)}.mg-c-table tfoot tr:last-of-type th,.mg-c-table tfoot tr:last-of-type td{border-block-end:none}.mg-c-table.mg-c-table--size-small{--mg-c-table-cell-spacing:var(--mg-b-size-4) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-32);--mg-c-table-header-cell-height:var(--mg-b-size-32)}.mg-c-table.mg-c-table--size-large{--mg-c-table-cell-height:var(--mg-c-table-header-cell-height)}.mg-c-table.mg-c-table--size-xlarge{--mg-c-table-cell-spacing:var(--mg-b-size-12) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-64);--mg-c-table-header-cell-height:var(--mg-b-size-64)}.mg-c-table.mg-c-table--full-width{width:100%}.mg-c-table-wrapper{overflow:auto}.mg-c-table thead td,.mg-c-table thead th{position:relative}.mg-c-table thead td .mg-c-table__sort-button,.mg-c-table thead th .mg-c-table__sort-button{display:inline-flex;align-items:center;padding:0;border:none;margin:0;background:none;color:inherit;font-size:inherit;font-weight:600;gap:var(--mg-b-size-4);text-align:left}.mg-c-table thead td .mg-c-table__sort-button::after,.mg-c-table thead th .mg-c-table__sort-button::after{position:absolute;content:\"\";inset:0}.mg-c-table thead td .mg-c-table__sort-button:hover,.mg-c-table thead th .mg-c-table__sort-button:hover{cursor:pointer}.mg-c-table thead td:has(.mg-c-table__sort-button):hover,.mg-c-table thead td[aria-sort=descending],.mg-c-table thead td[aria-sort=ascending],.mg-c-table thead th:has(.mg-c-table__sort-button):hover,.mg-c-table thead th[aria-sort=descending],.mg-c-table thead th[aria-sort=ascending]{background-color:var(--mg-b-color-neutral-20)}";
8258
8424
 
8259
8425
  /**
8260
8426
  * Check if value is a valid align object