@mgdis/mg-components 6.14.0 → 6.15.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 (150) hide show
  1. package/dist/cjs/{index-DzBkSgSK.js → index-BGxkpQwi.js} +7 -1
  2. package/dist/cjs/{index-DUJwxnoi.js → index-CpENFzEo.js} +2 -2
  3. package/dist/cjs/{index-CwjAofQ1.js → index-iUZvsp-F.js} +55 -31
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/mg-action-more_37.cjs.entry.js +431 -208
  6. package/dist/cjs/mg-alert.cjs.entry.js +4 -4
  7. package/dist/cjs/mg-components.cjs.js +3 -3
  8. package/dist/cjs/mg-input-combobox.cjs.entry.js +145 -81
  9. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +1248 -16004
  10. package/dist/cjs/{mg-input.conf-WTsvDfpC.js → mg-input.conf-CwjEAih3.js} +7 -0
  11. package/dist/cjs/mg-input.utils-D-ASK4ua.js +49 -0
  12. package/dist/cjs/mg-loader.cjs.entry.js +4 -4
  13. package/dist/cjs/mg-progress.cjs.entry.js +3 -3
  14. package/dist/collection/assets/icons/index.js +1 -1
  15. package/dist/collection/collection-manifest.json +2 -2
  16. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  17. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
  18. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +93 -22
  19. package/dist/collection/components/molecules/inputs/mg-input/mg-input.utils.js +21 -0
  20. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +49 -106
  22. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +123 -48
  23. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +140 -56
  24. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +6 -1
  26. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +63 -10
  28. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +54 -6
  30. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
  31. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  32. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +142 -9
  33. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
  34. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
  35. package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
  36. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  37. package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
  38. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  39. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  40. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  41. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  42. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  43. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  44. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  45. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  46. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  47. package/dist/collection/components/molecules/mg-table/mg-table.js +2 -2
  48. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
  49. package/dist/collection/locales/en/messages.json +23 -14
  50. package/dist/collection/locales/fr/messages.json +24 -15
  51. package/dist/components/index2.js +3 -3
  52. package/dist/components/index3.js +55 -31
  53. package/dist/components/mg-action-more.js +2 -2
  54. package/dist/components/mg-alert.js +2 -2
  55. package/dist/components/mg-badge2.js +1 -1
  56. package/dist/components/mg-button2.js +1 -1
  57. package/dist/components/mg-card2.js +1 -1
  58. package/dist/components/mg-character-left2.js +1 -1
  59. package/dist/components/mg-details.js +1 -97
  60. package/dist/components/mg-details2.js +99 -0
  61. package/dist/components/mg-divider2.js +1 -1
  62. package/dist/components/mg-form.js +2 -2
  63. package/dist/components/mg-icon2.js +1 -1
  64. package/dist/components/mg-illustrated-message.js +2 -2
  65. package/dist/components/mg-input-checkbox-paginated2.js +43 -124
  66. package/dist/components/mg-input-checkbox.js +136 -62
  67. package/dist/components/mg-input-combobox.js +135 -63
  68. package/dist/components/mg-input-date.js +9 -3
  69. package/dist/components/mg-input-numeric.js +14 -3
  70. package/dist/components/mg-input-password.js +10 -4
  71. package/dist/components/mg-input-radio.js +54 -13
  72. package/dist/components/mg-input-rich-text-editor.js +1266 -16016
  73. package/dist/components/mg-input-select2.js +45 -9
  74. package/dist/components/mg-input-text2.js +10 -4
  75. package/dist/components/mg-input-textarea.js +10 -4
  76. package/dist/components/mg-input-title2.js +1 -1
  77. package/dist/components/mg-input-toggle.js +97 -12
  78. package/dist/components/mg-input.utils.js +24 -0
  79. package/dist/components/mg-input2.js +100 -23
  80. package/dist/components/mg-item-more2.js +2 -2
  81. package/dist/components/mg-loader2.js +2 -2
  82. package/dist/components/mg-menu-item2.js +1 -1
  83. package/dist/components/mg-message2.js +3 -3
  84. package/dist/components/mg-modal.js +3 -3
  85. package/dist/components/mg-pagination.js +233 -1
  86. package/dist/components/mg-panel.js +14 -8
  87. package/dist/components/mg-popover-content2.js +2 -2
  88. package/dist/components/mg-popover2.js +2 -2
  89. package/dist/components/mg-progress.js +2 -2
  90. package/dist/components/mg-skip-links.js +2 -2
  91. package/dist/components/mg-table.js +3 -3
  92. package/dist/components/mg-tabs.js +1 -311
  93. package/dist/components/mg-tabs2.js +313 -0
  94. package/dist/components/mg-tag.js +1 -1
  95. package/dist/components/mg-tooltip-content2.js +1 -1
  96. package/dist/components/mg-tooltip2.js +2 -2
  97. package/dist/esm/{index-Bv7NHR-W.js → index-CKB-AnCZ.js} +55 -31
  98. package/dist/esm/{index-Degtjvph.js → index-DhAOnZJn.js} +7 -1
  99. package/dist/esm/{index-Dr7GYvIz.js → index-WtiuOkLj.js} +2 -2
  100. package/dist/esm/loader.js +3 -3
  101. package/dist/esm/mg-action-more_37.entry.js +426 -203
  102. package/dist/esm/mg-alert.entry.js +4 -4
  103. package/dist/esm/mg-components.js +4 -4
  104. package/dist/esm/mg-input-combobox.entry.js +125 -61
  105. package/dist/esm/mg-input-rich-text-editor.entry.js +1249 -16005
  106. package/dist/esm/{mg-input.conf-CNgv8hc5.js → mg-input.conf-BAUTlb6r.js} +7 -1
  107. package/dist/esm/mg-input.utils-BYI03zSi.js +46 -0
  108. package/dist/esm/mg-loader.entry.js +4 -4
  109. package/dist/esm/mg-progress.entry.js +3 -3
  110. package/dist/mg-components/locales/en/messages.json +23 -14
  111. package/dist/mg-components/locales/fr/messages.json +24 -15
  112. package/dist/mg-components/mg-components.esm.js +1 -1
  113. package/dist/mg-components/p-31856cff.entry.js +1 -0
  114. package/dist/mg-components/{p-056ba467.entry.js → p-420daa1e.entry.js} +1 -1
  115. package/dist/mg-components/{p-d13a6fdc.entry.js → p-47e19783.entry.js} +1 -1
  116. package/dist/mg-components/p-67af6274.entry.js +1 -0
  117. package/dist/mg-components/p-698dfc6c.entry.js +1 -0
  118. package/dist/mg-components/p-BAUTlb6r.js +1 -0
  119. package/dist/mg-components/p-CKB-AnCZ.js +1 -0
  120. package/dist/mg-components/p-DhAOnZJn.js +2 -0
  121. package/dist/mg-components/p-PuX-pdL4.js +1 -0
  122. package/dist/mg-components/p-WtiuOkLj.js +1 -0
  123. package/dist/mg-components/p-a0fa44cf.entry.js +1 -0
  124. package/dist/types/assets/icons/index.d.ts +6 -0
  125. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +13 -0
  126. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +15 -4
  127. package/dist/types/components/molecules/inputs/mg-input/mg-input.utils.d.ts +8 -0
  128. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +17 -40
  129. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +1 -2
  130. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +36 -9
  131. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +17 -3
  132. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +18 -0
  133. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +18 -0
  134. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +40 -4
  135. package/dist/types/components.d.ts +69 -40
  136. package/ide/intellij/web-types.json +148 -22
  137. package/ide/vscode/html-custom-data.json +143 -9
  138. package/package.json +15 -15
  139. package/dist/cjs/events.utils-D5SAtkpQ.js +0 -25
  140. package/dist/components/mg-pagination2.js +0 -229
  141. package/dist/esm/events.utils-yMGqY8YG.js +0 -23
  142. package/dist/mg-components/p-625c463c.entry.js +0 -1
  143. package/dist/mg-components/p-Bv7NHR-W.js +0 -1
  144. package/dist/mg-components/p-CNgv8hc5.js +0 -1
  145. package/dist/mg-components/p-Degtjvph.js +0 -2
  146. package/dist/mg-components/p-Dr7GYvIz.js +0 -1
  147. package/dist/mg-components/p-c522f3c1.entry.js +0 -1
  148. package/dist/mg-components/p-cac23bd7.entry.js +0 -1
  149. package/dist/mg-components/p-e75f5383.entry.js +0 -10
  150. package/dist/mg-components/p-yMGqY8YG.js +0 -1
@@ -106,11 +106,11 @@ export class MgModal {
106
106
  * @returns HTML Element
107
107
  */
108
108
  render() {
109
- return (h("dialog", { key: 'e104352d5cdb04886d4db6bac62ecb772c6df004', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
109
+ return (h("dialog", { key: '783b289712deb419fa7ac4c9f371add80054af6b', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
110
110
  if (el !== null) {
111
111
  this.dialog = el;
112
112
  }
113
- } }, h("mg-card", { key: 'd69679cb9118dfe4b141c1dcf6d1ef0fd53d9df9', shadow: true }, h("div", { key: '29e0a092a73d4e05c300c0840191823d3e3bbd30', class: "mg-c-modal__dialog" }, h("header", { key: 'c3a595adc778b67e5cafbbb964741ebc56c2dba5', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: 'f19447c5c29ae4fdaa46c2e35629622091b172d6', class: "mg-c-modal__close-button" }, h("mg-button", { key: 'af85956cc5e16e2c8c05156a4f54f63ad35b913a', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: 'fd6aa0394f8b39bacd50e7b087f1b155c38e1bc9', icon: "cross" })))), h("h1", { key: '0e80bdf6182c01257f487741661754a1224b802d', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: 'c23c02cc9046545b4b851ce640ed8409fa190511', class: "mg-c-modal__content" }, h("slot", { key: 'db7c708e38ff3e7de6e4a7d299cd7a3c1e9d1e00' })), this.hasActions && (h("footer", { key: '4ba012a916db38e219287a5ea9ca7b4644dd96d9', class: "mg-c-modal__footer" }, h("slot", { key: 'c541075b02466d95defae7831c3fc7e4b786d7fc', name: "actions" })))))));
113
+ } }, h("mg-card", { key: 'd6006f296ab50a192229e09e6e01a3313ab69cce', shadow: true }, h("div", { key: '76bc44557dc4b4bcce40b54d5d4bfa381f7906af', class: "mg-c-modal__dialog" }, h("header", { key: '08ba473f429ae57434dd321575f9eaf97e41f7a9', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: 'd96baeaaefdb5541da7ee7bc58c3901b3d64ed33', class: "mg-c-modal__close-button" }, h("mg-button", { key: 'f43486e05e337fad6e54b8a0b07b9d13aad50acc', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '3278e25d15abdefb56cc3c67e7a8ec500d90547b', icon: "cross" })))), h("h1", { key: 'd9246055be4cb938f4aff20fcdc53b3a7c119d20', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: 'bce8cd10a2fffdf726df6d07b9f81da1fd693038', class: "mg-c-modal__content" }, h("slot", { key: '9db561d8462fe9a3afc6be543f2ef3b189f3efd4' })), this.hasActions && (h("footer", { key: '226e235454dce60eb8b5652add3b23e1cf480fc7', class: "mg-c-modal__footer" }, h("slot", { key: '8352666de0db98e96c52a419c939574285972571', name: "actions" })))))));
114
114
  }
115
115
  static get is() { return "mg-modal"; }
116
116
  static get encapsulation() { return "shadow"; }
@@ -196,7 +196,7 @@ export class MgPanel {
196
196
  */
197
197
  render() {
198
198
  const headerId = `${this.identifier}-header`;
199
- return (h("section", { key: '36381ea8a92fcfc7e54c0db11edc49e033a3914f', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: 'b55169124454725f2cfc8b769f1b9c2882573112', shadow: this.shadow }, h("header", { key: '2ef537a657cb5f40fb0249a24b822a892a64aa7c', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: '16705d61598a15b02f8adfd4ae42fe69c6fd9833', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: '26633ede9d285e037e9aafa030d8008eeee430e8' })))));
199
+ return (h("section", { key: '6d9b0759cf8d6a8e94a1a6598f45fc00288ca22a', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: '21b0d991daf053506097333df58d3b98ec2e5b0e', shadow: this.shadow }, h("header", { key: 'abd9dbeb13d85c9a66aac13e7b32e6a83e2ded57', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: '23c74b70bd275fb18c853a1b7a0a4b4ff5a4c605', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: '15561936437c960768c4954f45df4045ac3dee03' })))));
200
200
  }
201
201
  static get is() { return "mg-panel"; }
202
202
  static get encapsulation() { return "shadow"; }
@@ -46,7 +46,7 @@ export class MgPopoverContent {
46
46
  * @returns HTML Element
47
47
  */
48
48
  render() {
49
- return (h(Host, { key: 'c87fe52d52b80954170963fd1378b3a05313f9c6' }, h("mg-card", { key: 'a38755a5a7055d4bd4166531326b1be245d2906f', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: '823e99beb15aa19f6f2f7cee2c5e1088cc116425', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: '70daf81e59533585b6a051a6d97539a75833432e', icon: "cross" }))), h("div", { key: 'cccf70c8fba6906e6724629642383fad0c98656e', class: "mg-c-popover-content__title" }, h("slot", { key: 'b05acb47b32d27d1629d39451e4a786d2f404406', name: "title" })), h("slot", { key: '40de167b1fb77c7d8fc557f60cf176c0991e991d', name: "content" })), h("slot", { key: 'c6c1305d5ff51d2af0d56b1199731cd41645c99d', name: "arrow" })));
49
+ return (h(Host, { key: '2746e72f636c1a702d2b15836343ca8503f233e5' }, h("mg-card", { key: '84e28550627969d4e15ded5a5f8b6d19584eb891', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: 'f25c773593441597e81330997df3175cd9a963e4', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: '723f3d1e8a85356d7aa9be9c875b273d7c9c1f72', icon: "cross" }))), h("div", { key: '283316f2a66212d9afc128aaec3fb24e4a40c0eb', class: "mg-c-popover-content__title" }, h("slot", { key: 'a1839a9a3259ccb221b90e82f786eb0e7c3d2a19', name: "title" })), h("slot", { key: '708903013417e27f4a9ed9811fde886d6b697dec', name: "content" })), h("slot", { key: 'fad6024a2474ffd5f46925101baa0e6ab9f2e951', name: "arrow" })));
50
50
  }
51
51
  static get is() { return "mg-popover-content"; }
52
52
  static get encapsulation() { return "shadow"; }
@@ -242,7 +242,7 @@ export class MgPopover {
242
242
  * @returns HTML Element
243
243
  */
244
244
  render() {
245
- return (h(Host, { key: 'c25d773831395cf154f85cda3be67af22d6d8767' }, h("slot", { key: 'c6fb5897222e527cc36c78e1f32aaadc4d3c4b01' }), h("slot", { key: 'd7f682fdf78caa8491b8e9a74e6d5e91dbf5ef84', name: "content" })));
245
+ return (h(Host, { key: '7ea28f19a5a61f6191c2aece439e85da8f067270' }, h("slot", { key: 'aa6a627b90246ca327e2971329ab58b02eeb1d04' }), h("slot", { key: '1851353a6b4de659d6027a0bf3ba5f2120f7137d', name: "content" })));
246
246
  }
247
247
  static get is() { return "mg-popover"; }
248
248
  static get encapsulation() { return "shadow"; }
@@ -65,7 +65,7 @@ export class MgProgress {
65
65
  * @returns HTML Element
66
66
  */
67
67
  render() {
68
- return (h(Host, { key: 'e6d254a68f35c5019158ab17fcb0e4dfd1943ef8', role: this.ariaRole, "aria-label": this.label, "aria-valuenow": this.value, "aria-valuemin": this.min, "aria-valuemax": this.max }, h("div", { key: '5b427579ad97336076504a45013a0be00673f9a9', class: "mg-c-progress" }, h("div", { key: '76dbdf88550caf51890e10c45c034d73cd02db5d', class: { 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min } }, h("div", { key: 'b0ab6f784cdb8cc25a40b83a0d97bcda5b5c1f9b', class: "mg-c-progress__fill", style: {
68
+ return (h(Host, { key: '62c66dbd93249bfde3eb8ff449b49884edfe49c3', role: this.ariaRole, "aria-label": this.label, "aria-valuenow": this.value, "aria-valuemin": this.min, "aria-valuemax": this.max }, h("div", { key: 'b349c9d7358086ca4668705a1935fd8bbdb86afa', class: "mg-c-progress" }, h("div", { key: '57cc19d07c0f006f8ecf3a1f86ec12e37ffd8d6b', class: { 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min } }, h("div", { key: 'b4c49d94d9cfe2e1a6d8013aa4a39cde51b36d04', class: "mg-c-progress__fill", style: {
69
69
  width: `${Math.round(((this.value - this.min) / (this.max - this.min)) * 100)}%`,
70
70
  } })))));
71
71
  }
@@ -36,7 +36,7 @@ export class MgSkipLinks {
36
36
  * @returns HTML Element
37
37
  */
38
38
  render() {
39
- return (h("nav", { key: '9df42d332b207abf989ef73f3c83ebbcfcf222a6', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: '0185490dbd3dfb08b534a898fe779850ce96c427', class: "mg-c-skip-links__list", role: "list" }, this.links.map(link => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
39
+ return (h("nav", { key: '66ea9a2abfd1db7a1c7c46e9cdcd15af013ea406', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: '07f404865c3ad0d815b87e32a46716136ed77d7d', class: "mg-c-skip-links__list", role: "list" }, this.links.map(link => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
40
40
  }
41
41
  static get is() { return "mg-skip-links"; }
42
42
  static get encapsulation() { return "shadow"; }
@@ -110,11 +110,11 @@ export class MgTable {
110
110
  Object.entries(this.columns).forEach(([key, value]) => {
111
111
  // Add alignment to stylesheet
112
112
  if (value.align !== undefined) {
113
- this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:${value.align}}}`);
113
+ this.alignmentStylesheet.insertRule(`.${this.componentClass} th:nth-child(${key}),td:nth-child(${key}){text-align:${value.align};&>*{display:inline-block;}}`);
114
114
  }
115
115
  // if align is not defined and datatype is number, align right
116
116
  else if (value.datatype === 'numeric') {
117
- this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:right}}`);
117
+ this.alignmentStylesheet.insertRule(`.${this.componentClass} th:nth-child(${key}),td:nth-child(${key}){text-align:right;&>*{display:inline-block;}}`);
118
118
  }
119
119
  // Define if column is sortable
120
120
  if (value.sortable) {
@@ -234,7 +234,7 @@ export class MgTabs {
234
234
  * @returns HTML Element
235
235
  */
236
236
  render() {
237
- return (h("div", { key: '06dd97d9d4e77f606dee3c4a8960b51265345666', class: this.classCollection.join() }, h("header", { key: 'ea3771bdfe8576bb8b443823a2c338a51ed3ba69', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
237
+ return (h("div", { key: '97f18baca4ae45b85401fd38570fe16d8df46c2b', class: this.classCollection.join() }, h("header", { key: '46cffaf2e14dde2a4994e894358caee7553b3bd6', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
238
238
  [`${this.buttonTabBaseClass}`]: true,
239
239
  [`${this.buttonTabBaseClass}--horizontal`]: true,
240
240
  [`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "errors": {
3
- "required": "This field is required."
3
+ "required": "This field is required.",
4
+ "noValue": "No value."
4
5
  },
5
6
  "nbCharLeft": "{counter} characters left.",
6
7
  "input": {
8
+ "showMore": "Show more",
7
9
  "select": {
8
10
  "placeholder": "Select a value"
9
11
  },
@@ -13,23 +15,27 @@
13
15
  "editButton": "Edit",
14
16
  "selectButton": "Select values",
15
17
  "showButton": "Show",
16
- "label": "Enter a value",
17
- "result": "result",
18
- "results": "results",
19
- "searchResults": "Search result(s) list.",
20
- "noResult": "No result.",
21
18
  "sections": {
19
+ "label": "Values grouped by: \"Selected\" or \"Available\"",
20
+ "badge": { "label": "value(s)" },
21
+ "search": {
22
+ "label": "Enter a value",
23
+ "values": "{count} value(s) found",
24
+ "noValue": "No values found"
25
+ },
22
26
  "selected": {
23
27
  "title": "Selected",
24
- "titlePlural": "Selected",
25
28
  "action": "Unselect all",
26
- "tooltip": "Unselect all current search results"
29
+ "tooltip": "Unselect all current values",
30
+ "values": "{count} value(s) selected",
31
+ "noValue": "No value selected"
27
32
  },
28
33
  "notSelected": {
29
- "title": "Not selected",
30
- "titlePlural": "Not selected",
34
+ "title": "Available",
31
35
  "action": "Select all",
32
- "tooltip": "Select all current search results"
36
+ "tooltip": "Select all current values",
37
+ "values": "{count} value(s) available",
38
+ "noValue": "All values are selected"
33
39
  }
34
40
  }
35
41
  },
@@ -61,9 +67,8 @@
61
67
  "hide": "Hide password value"
62
68
  },
63
69
  "combobox": {
64
- "notFound": "No elements match your input",
65
- "notAvailable": "No elements available",
66
- "loadMore": "Load more",
70
+ "notFound": "No value matches your input",
71
+ "notAvailable": "No value available",
67
72
  "search": "Search…"
68
73
  },
69
74
  "text": {
@@ -130,5 +135,9 @@
130
135
  },
131
136
  "table": {
132
137
  "sortableCaption": "(column headers with buttons are sortable)"
138
+ },
139
+ "details": {
140
+ "toggleClosed": "Show details",
141
+ "toggleOpened": "Hide details"
133
142
  }
134
143
  }
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "errors": {
3
- "required": "Ce champ est obligatoire."
3
+ "required": "Ce champ est obligatoire.",
4
+ "noValue": "Aucune valeur."
4
5
  },
5
6
  "nbCharLeft": "{counter} caractères disponibles.",
6
7
  "input": {
8
+ "showMore": "Afficher plus",
7
9
  "select": {
8
10
  "placeholder": "Sélectionnez une valeur"
9
11
  },
@@ -13,23 +15,27 @@
13
15
  "editButton": "Modifier",
14
16
  "selectButton": "Sélectionner des valeurs",
15
17
  "showButton": "Voir",
16
- "label": "Saisissez une valeur",
17
- "result": "résultat",
18
- "results": "résultats",
19
- "searchResults": "Liste de résultat(s) de la recherche.",
20
- "noResult": "Aucun résultat.",
21
18
  "sections": {
19
+ "label": "Valeurs regroupées par: \"Sélectionnées\" ou \"Disponibles\"",
20
+ "badge": { "label": "valeur(s)" },
21
+ "search": {
22
+ "label": "Saisissez une valeur",
23
+ "values": "{count} résultat(s)",
24
+ "noValue": "Aucune valeur n'a été trouvée."
25
+ },
22
26
  "selected": {
23
- "title": "Sélectionné",
24
- "titlePlural": "Sélectionnés",
27
+ "title": "Sélectionnées",
25
28
  "action": "Tout désélectionner",
26
- "tooltip": "Désélectionne tous les résultats de la recherche en cours"
29
+ "tooltip": "Désélectionne toutes les valeurs de la section",
30
+ "values": "{count} valeur(s) sélectionnée(s)",
31
+ "noValue": "Aucune valeur sélectionnée"
27
32
  },
28
33
  "notSelected": {
29
- "title": "Non sélectionné",
30
- "titlePlural": "Non sélectionnés",
34
+ "title": "Disponibles",
31
35
  "action": "Tout sélectionner",
32
- "tooltip": "Sélectionne tous les résultats de la recherche en cours"
36
+ "tooltip": "Sélectionne toutes les valeurs de la section",
37
+ "values": "{count} valeur(s) disponible(s)",
38
+ "noValue": "Toutes les valeurs sont sélectionnées"
33
39
  }
34
40
  }
35
41
  },
@@ -61,9 +67,8 @@
61
67
  "hide": "Masquer le mot de passe"
62
68
  },
63
69
  "combobox": {
64
- "notFound": "Aucun élément ne correspondont a votre saisie",
65
- "notAvailable": "Aucun élément disponible",
66
- "loadMore": "Afficher plus",
70
+ "notFound": "Aucune valeur ne correspondont à votre saisie",
71
+ "notAvailable": "Aucune valeur disponible",
67
72
  "search": "Recherche…"
68
73
  },
69
74
  "text": {
@@ -130,5 +135,9 @@
130
135
  },
131
136
  "table": {
132
137
  "sortableCaption": "(les en-têtes de colonnes avec des boutons peuvent être triés)"
138
+ },
139
+ "details": {
140
+ "toggleClosed": "Voir le detail",
141
+ "toggleOpened": "Masquer le detail"
133
142
  }
134
143
  }
@@ -65,10 +65,10 @@ const getObjectValueFromKey = (object, path, defaultValue) => {
65
65
  }
66
66
  const [current, ...next] = path.split(separator);
67
67
  if (next.length) {
68
- return getObjectValueFromKey(object[current], next.join(separator));
68
+ return getObjectValueFromKey(object[current], next.join(separator), defaultValue);
69
69
  }
70
70
  else {
71
- return object[current];
71
+ return object[current] ?? defaultValue;
72
72
  }
73
73
  };
74
74
 
@@ -405,4 +405,4 @@ const getChildWindows = (localWindow, windows = []) => {
405
405
  return windows;
406
406
  };
407
407
 
408
- export { ClassList as C, Paginate as P, isValideID as a, isTagName as b, createID as c, allItemsAreString as d, cleanString as e, formatID as f, getWindows as g, Cursor as h, isValidString as i, Page as j, getObjectValueFromKey as k, isObject as l, focusableElements as m, nextTick as n, dateRegExp as o, dateToString as p, isValidNumber as q, toString as t };
408
+ export { ClassList as C, Paginate as P, isValideID as a, isTagName as b, createID as c, allItemsAreString as d, Cursor as e, formatID as f, getWindows as g, isObject as h, isValidString as i, Page as j, getObjectValueFromKey as k, focusableElements as l, cleanString as m, nextTick as n, dateRegExp as o, dateToString as p, isValidNumber as q, toString as t };
@@ -1,8 +1,10 @@
1
1
  const errors$1 = {
2
- required: "This field is required."
2
+ required: "This field is required.",
3
+ noValue: "No value."
3
4
  };
4
5
  const nbCharLeft$1 = "{counter} characters left.";
5
6
  const input$1 = {
7
+ showMore: "Show more",
6
8
  select: {
7
9
  placeholder: "Select a value"
8
10
  },
@@ -12,23 +14,29 @@ const input$1 = {
12
14
  editButton: "Edit",
13
15
  selectButton: "Select values",
14
16
  showButton: "Show",
15
- label: "Enter a value",
16
- result: "result",
17
- results: "results",
18
- searchResults: "Search result(s) list.",
19
- noResult: "No result.",
20
17
  sections: {
18
+ label: "Values grouped by: \"Selected\" or \"Available\"",
19
+ badge: {
20
+ label: "value(s)"
21
+ },
22
+ search: {
23
+ label: "Enter a value",
24
+ values: "{count} value(s) found",
25
+ noValue: "No values found"
26
+ },
21
27
  selected: {
22
28
  title: "Selected",
23
- titlePlural: "Selected",
24
29
  action: "Unselect all",
25
- tooltip: "Unselect all current search results"
30
+ tooltip: "Unselect all current values",
31
+ values: "{count} value(s) selected",
32
+ noValue: "No value selected"
26
33
  },
27
34
  notSelected: {
28
- title: "Not selected",
29
- titlePlural: "Not selected",
35
+ title: "Available",
30
36
  action: "Select all",
31
- tooltip: "Select all current search results"
37
+ tooltip: "Select all current values",
38
+ values: "{count} value(s) available",
39
+ noValue: "All values are selected"
32
40
  }
33
41
  }
34
42
  },
@@ -60,9 +68,8 @@ const input$1 = {
60
68
  hide: "Hide password value"
61
69
  },
62
70
  combobox: {
63
- notFound: "No elements match your input",
64
- notAvailable: "No elements available",
65
- loadMore: "Load more",
71
+ notFound: "No value matches your input",
72
+ notAvailable: "No value available",
66
73
  search: "Search…"
67
74
  },
68
75
  text: {
@@ -130,6 +137,10 @@ const loader$1 = {
130
137
  const table$1 = {
131
138
  sortableCaption: "(column headers with buttons are sortable)"
132
139
  };
140
+ const details$1 = {
141
+ toggleClosed: "Show details",
142
+ toggleOpened: "Hide details"
143
+ };
133
144
  var en = {
134
145
  errors: errors$1,
135
146
  nbCharLeft: nbCharLeft$1,
@@ -145,14 +156,17 @@ var en = {
145
156
  itemMore: itemMore$1,
146
157
  actionMore: actionMore$1,
147
158
  loader: loader$1,
148
- table: table$1
159
+ table: table$1,
160
+ details: details$1
149
161
  };
150
162
 
151
163
  const errors = {
152
- required: "Ce champ est obligatoire."
164
+ required: "Ce champ est obligatoire.",
165
+ noValue: "Aucune valeur."
153
166
  };
154
167
  const nbCharLeft = "{counter} caractères disponibles.";
155
168
  const input = {
169
+ showMore: "Afficher plus",
156
170
  select: {
157
171
  placeholder: "Sélectionnez une valeur"
158
172
  },
@@ -162,23 +176,29 @@ const input = {
162
176
  editButton: "Modifier",
163
177
  selectButton: "Sélectionner des valeurs",
164
178
  showButton: "Voir",
165
- label: "Saisissez une valeur",
166
- result: "résultat",
167
- results: "résultats",
168
- searchResults: "Liste de résultat(s) de la recherche.",
169
- noResult: "Aucun résultat.",
170
179
  sections: {
180
+ label: "Valeurs regroupées par: \"Sélectionnées\" ou \"Disponibles\"",
181
+ badge: {
182
+ label: "valeur(s)"
183
+ },
184
+ search: {
185
+ label: "Saisissez une valeur",
186
+ values: "{count} résultat(s)",
187
+ noValue: "Aucune valeur n'a été trouvée."
188
+ },
171
189
  selected: {
172
- title: "Sélectionné",
173
- titlePlural: "Sélectionnés",
190
+ title: "Sélectionnées",
174
191
  action: "Tout désélectionner",
175
- tooltip: "Désélectionne tous les résultats de la recherche en cours"
192
+ tooltip: "Désélectionne toutes les valeurs de la section",
193
+ values: "{count} valeur(s) sélectionnée(s)",
194
+ noValue: "Aucune valeur sélectionnée"
176
195
  },
177
196
  notSelected: {
178
- title: "Non sélectionné",
179
- titlePlural: "Non sélectionnés",
197
+ title: "Disponibles",
180
198
  action: "Tout sélectionner",
181
- tooltip: "Sélectionne tous les résultats de la recherche en cours"
199
+ tooltip: "Sélectionne toutes les valeurs de la section",
200
+ values: "{count} valeur(s) disponible(s)",
201
+ noValue: "Toutes les valeurs sont sélectionnées"
182
202
  }
183
203
  }
184
204
  },
@@ -210,9 +230,8 @@ const input = {
210
230
  hide: "Masquer le mot de passe"
211
231
  },
212
232
  combobox: {
213
- notFound: "Aucun élément ne correspondont a votre saisie",
214
- notAvailable: "Aucun élément disponible",
215
- loadMore: "Afficher plus",
233
+ notFound: "Aucune valeur ne correspondont à votre saisie",
234
+ notAvailable: "Aucune valeur disponible",
216
235
  search: "Recherche…"
217
236
  },
218
237
  text: {
@@ -280,6 +299,10 @@ const loader = {
280
299
  const table = {
281
300
  sortableCaption: "(les en-têtes de colonnes avec des boutons peuvent être triés)"
282
301
  };
302
+ const details = {
303
+ toggleClosed: "Voir le detail",
304
+ toggleOpened: "Masquer le detail"
305
+ };
283
306
  var fr = {
284
307
  errors: errors,
285
308
  nbCharLeft: nbCharLeft,
@@ -295,7 +318,8 @@ var fr = {
295
318
  itemMore: itemMore,
296
319
  actionMore: actionMore,
297
320
  loader: loader,
298
- table: table
321
+ table: table,
322
+ details: details
299
323
  };
300
324
 
301
325
  /**
@@ -154,7 +154,7 @@ const MgActionMore$1 = /*@__PURE__*/ proxyCustomElement(class MgActionMore exten
154
154
  [`${this.classBase}__chevron--rotate`]: this.expanded === true,
155
155
  } }, h("mg-icon", { icon: "chevron-down" })));
156
156
  }
157
- return (h(Host, { key: '76e2d992c871f918fd1e0ba0b4c7a385a15821da', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '1b321034f5154f4ffc39c41725d25e47689c4425', class: this.classBase }, h("mg-popover", { key: 'c39e28967995ad6a2d823548848c21da44a1e5a5', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: '72e170ce8da38fd2962b44a6fbf5b98e8ed2b72d', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: '48b16c1e4f1beddc8d3e92567c8d34dca26801f6' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: '6e3a7df656edcf556a931d9fc9ce553b9b23503b', slot: "content" }, h("mg-menu", { key: '8f29fe09601875bdeff2bda35663ffcfd76f8e68', direction: directions.VERTICAL, label: this.messages.label }, this.items.map(item => {
157
+ return (h(Host, { key: 'f1b9e6e54f933a049628067993400d3a31d15710', "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { key: '081b89284d5234f24e6073dcd9bf4088fd5a86b8', class: this.classBase }, h("mg-popover", { key: '0e6c50bc3bcb07f72507571de9fdda90226d2163', identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { key: 'ab4a385069e0a33fe9d5bc026c98160eb4ec1dfa', variant: this.button.variant, isIcon: this.button.isIcon, disabled: this.button.disabled, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({ key: 'e9dc31c07c3c0f474cea70f5eeda36707d101e85' }, this.icon)), !this.button.isIcon && buttonContent), h("div", { key: '201666b0bf5513e3360c3cc960e6cd6cd565dda1', slot: "content" }, h("mg-menu", { key: '3b0d56d9779b5bcaad31c714586dcda81bc550fa', direction: directions.VERTICAL, label: this.messages.label }, this.items.map(item => {
158
158
  var _a, _b;
159
159
  return isMgActionMoreDivider(item) ? (h("mg-divider", { class: "mg-c-action-more__divider", key: "divider", "full-width": true })) : (h("mg-menu-item", { key: item.label, status: item.status || Status.VISIBLE, target: item.target, href: item.href,
160
160
  // eslint-disable-next-line react/jsx-no-bind
@@ -169,7 +169,7 @@ const MgActionMore$1 = /*@__PURE__*/ proxyCustomElement(class MgActionMore exten
169
169
  "displayChevron": ["validateDisplayChevron"]
170
170
  }; }
171
171
  static get style() { return mgActionMoreCss; }
172
- }, [1, "mg-action-more", {
172
+ }, [257, "mg-action-more", {
173
173
  "items": [16],
174
174
  "icon": [1040],
175
175
  "button": [16],
@@ -159,7 +159,7 @@ const MgAlert$1 = /*@__PURE__*/ proxyCustomElement(class MgAlert extends HTMLEle
159
159
  * @returns HTML Element
160
160
  */
161
161
  render() {
162
- return (h("mg-message", { key: '397a9a25b825bc75479d4562bff61dedc8ddc891', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: '793fb1e88b5d68bd41598f020748ea2fb02d7f3b' }), 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" }))))));
162
+ return (h("mg-message", { key: '626afcfe4c86dacff9860d2515827ae5aa6b7234', class: this.classCollection.join(), role: ['info', 'success'].includes(this.variant) ? 'status' : 'alert', variant: this.variant, variantStyle: this.variantStyle }, h("slot", { key: 'bc7d72c21dcf36c9012e144253ce2b3c6ebc14ed' }), 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" }))))));
163
163
  }
164
164
  get element() { return this; }
165
165
  static get watchers() { return {
@@ -169,7 +169,7 @@ const MgAlert$1 = /*@__PURE__*/ proxyCustomElement(class MgAlert extends HTMLEle
169
169
  "hidden": ["watchHidden"]
170
170
  }; }
171
171
  static get style() { return mgAlertCss; }
172
- }, [1, "mg-alert", {
172
+ }, [257, "mg-alert", {
173
173
  "delay": [2],
174
174
  "variant": [1],
175
175
  "variantStyle": [1, "variant-style"],
@@ -81,7 +81,7 @@ const MgBadge = /*@__PURE__*/ proxyCustomElement(class MgBadge extends HTMLEleme
81
81
  "outline": ["validateOutline"]
82
82
  }; }
83
83
  static get style() { return mgBadgeCss; }
84
- }, [1, "mg-badge", {
84
+ }, [257, "mg-badge", {
85
85
  "value": [8],
86
86
  "label": [1],
87
87
  "variant": [1],
@@ -230,7 +230,7 @@ const MgButton = /*@__PURE__*/ proxyCustomElement(class MgButton extends HTMLEle
230
230
  "loading": ["loadingHandler"]
231
231
  }; }
232
232
  static get style() { return mgButtonCss; }
233
- }, [1, "mg-button", {
233
+ }, [257, "mg-button", {
234
234
  "variant": [1025],
235
235
  "label": [1],
236
236
  "type": [1],
@@ -64,7 +64,7 @@ const MgCard = /*@__PURE__*/ proxyCustomElement(class MgCard extends HTMLElement
64
64
  "radiusSize": ["watchRadiusSize"]
65
65
  }; }
66
66
  static get style() { return mgCardCss; }
67
- }, [1, "mg-card", {
67
+ }, [257, "mg-card", {
68
68
  "shadow": [4],
69
69
  "radiusSize": [1, "radius-size"],
70
70
  "classCollection": [32]
@@ -47,7 +47,7 @@ const MgCharacterLeft = /*@__PURE__*/ proxyCustomElement(class MgCharacterLeft e
47
47
  "maxlength": ["validateMaxlength"]
48
48
  }; }
49
49
  static get style() { return mgCharacterLeftCss; }
50
- }, [2, "mg-character-left", {
50
+ }, [258, "mg-character-left", {
51
51
  "identifier": [1],
52
52
  "characters": [1],
53
53
  "maxlength": [2]
@@ -1,100 +1,4 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { i as isValidString } from './index2.js';
3
- import { d as defineCustomElement$2 } from './mg-icon2.js';
4
-
5
- const mgDetailsCss = ".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}}/*!\n * @prop --mg-c-details-spacing: Defines the spacing between the summary and the details. Default value: `--mg-b-size-8`.\n */.mg-c-details summary{display:inline-flex;align-items:baseline;cursor:pointer;gap:var(--mg-b-size-16)}.mg-c-details summary::-webkit-details-marker{display:none}.mg-c-details.mg-c-details--empty-summary summary{gap:unset}.mg-c-details__toggle{display:flex;min-height:calc(var(--mg-b-font-size)*var(--mg-b-line-height));flex-shrink:0;align-items:center;align-self:flex-start;gap:var(--mg-b-size-4)}.mg-c-details__toggle-icon.mg-c-details__toggle-icon--reverse{transform:rotate(180deg)}.mg-c-details__details{margin-top:var(--mg-c-details-spacing)}@media (width < 43.75rem){.mg-c-details:not(.mg-c-details--empty-summary) .mg-c-details__toggle>span{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}}";
6
-
7
- const MgDetails$1 = /*@__PURE__*/ proxyCustomElement(class MgDetails extends HTMLElement {
8
- constructor() {
9
- super();
10
- this.__registerHost();
11
- this.__attachShadow();
12
- this.expandedChange = createEvent(this, "expanded-change", 7);
13
- /**
14
- * Hide summary element
15
- */
16
- this.hideSummary = false;
17
- /**
18
- * Define if details are diplayed
19
- */
20
- this.expanded = false;
21
- /**
22
- * Handle details toggle
23
- */
24
- this.handleToggle = () => {
25
- this.expanded = this.details.open;
26
- };
27
- }
28
- validateTitles(newValue) {
29
- if (!isValidString(newValue)) {
30
- throw new Error(`<mg-details> prop "toggleClosed" and "toggleOpened" is required and must be a valid string. Passed value: "toggleClosed='${this.toggleClosed}'" and "toggleOpened='${this.toggleOpened}'".`);
31
- }
32
- }
33
- handleExpanded(newValue) {
34
- this.expandedChange.emit(newValue);
35
- }
36
- /*************
37
- * Lifecycle *
38
- *************/
39
- /**
40
- * Check if component props are well configured on init
41
- */
42
- componentWillLoad() {
43
- this.validateTitles(this.toggleClosed);
44
- this.validateTitles(this.toggleOpened);
45
- // Check if summary slot is empty
46
- const summarySlot = this.element.querySelector('[slot="summary"]');
47
- this.isEmptySummary = summarySlot === null || !isValidString(summarySlot.textContent);
48
- // Add event listener to prevent default action on summary click
49
- this.element.addEventListener('click', (event) => {
50
- if (event.target.closest('[slot="summary"] mg-button, mg-button[slot="summary"]') !== null) {
51
- event.preventDefault();
52
- }
53
- });
54
- }
55
- /**
56
- * Render
57
- * @returns HTML Element
58
- */
59
- render() {
60
- return (h("details", { key: 'a06326b8ad16138a8dcc826a0e7dcce5b27aed6e', 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: '32517ae0572bfdd2b4abcf3b1a693df2bb9189d8' }, h("slot", { key: 'e06f303855a21ac4e6c20b2a405699429a38f978', name: "summary" }), h("span", { key: 'f9b1589d79e8f56d546fdb323faea37d6527ef78', class: "mg-c-details__toggle" }, h("mg-icon", { key: '5174b81f4a93f04690b8dcd3432d11cf56eaf7df', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'b7c07eb8ec0b674c4233b2b6d6522a8afe9bcdfc', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: 'a88f7633a3aa775bb26e11788469d9f51764c223', class: "mg-c-details__details" }, h("slot", { key: 'd87ba0c67e7730436b9aff8edf1b04dcd0528fc1', name: "details" }))));
61
- }
62
- get element() { return this; }
63
- static get watchers() { return {
64
- "toggleClosed": ["validateTitles"],
65
- "toggleOpened": ["validateTitles"],
66
- "expanded": ["handleExpanded"]
67
- }; }
68
- static get style() { return mgDetailsCss; }
69
- }, [1, "mg-details", {
70
- "toggleClosed": [1, "toggle-closed"],
71
- "toggleOpened": [1, "toggle-opened"],
72
- "hideSummary": [4, "hide-summary"],
73
- "expanded": [1028]
74
- }, undefined, {
75
- "toggleClosed": ["validateTitles"],
76
- "toggleOpened": ["validateTitles"],
77
- "expanded": ["handleExpanded"]
78
- }]);
79
- function defineCustomElement$1() {
80
- if (typeof customElements === "undefined") {
81
- return;
82
- }
83
- const components = ["mg-details", "mg-icon"];
84
- components.forEach(tagName => { switch (tagName) {
85
- case "mg-details":
86
- if (!customElements.get(tagName)) {
87
- customElements.define(tagName, MgDetails$1);
88
- }
89
- break;
90
- case "mg-icon":
91
- if (!customElements.get(tagName)) {
92
- defineCustomElement$2();
93
- }
94
- break;
95
- } });
96
- }
97
- defineCustomElement$1();
1
+ import { M as MgDetails$1, d as defineCustomElement$1 } from './mg-details2.js';
98
2
 
99
3
  const MgDetails = MgDetails$1;
100
4
  const defineCustomElement = defineCustomElement$1;