@mgdis/mg-components 5.19.2 → 5.20.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 (496) hide show
  1. package/dist/cjs/{components.utils-dc9c8a53.js → components.utils-cd908d4e.js} +102 -99
  2. package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
  3. package/dist/cjs/{index-c042e24b.js → index-8532b5e9.js} +320 -137
  4. package/dist/cjs/index-8532b5e9.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_34.cjs.entry.js +5130 -5057
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +224 -224
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +193 -183
  13. package/dist/collection/assets/icons/index.js.map +1 -0
  14. package/dist/collection/collection-manifest.json +6 -6
  15. package/dist/collection/components/atoms/mg-badge/mg-badge.js +161 -161
  16. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +362 -347
  18. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +126 -126
  20. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  21. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +101 -101
  22. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-divider/mg-divider.js +47 -47
  24. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-icon/mg-icon.js +231 -231
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  27. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +132 -132
  28. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +158 -158
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +46 -46
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
  33. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +3 -3
  34. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  35. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +398 -398
  36. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/MgInput.conf.js +8 -0
  38. package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/MgInput.js +84 -84
  40. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +8 -8
  42. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  43. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +266 -266
  44. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -4
  46. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +789 -791
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +4 -4
  50. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  51. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +589 -572
  52. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  53. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +4 -4
  54. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  55. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +779 -767
  56. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  57. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +537 -520
  58. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  59. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +566 -550
  60. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  61. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +701 -689
  62. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  63. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +0 -4
  64. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +771 -754
  66. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +706 -689
  68. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  69. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
  70. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  71. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
  72. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  73. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
  74. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  75. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
  76. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  77. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
  78. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  80. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
  81. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  82. package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
  83. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  84. package/dist/collection/components/molecules/mg-form/mg-form.js +332 -335
  85. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  86. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
  87. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  88. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +189 -189
  89. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
  91. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  92. package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
  93. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  94. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
  95. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  96. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
  97. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  98. package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
  99. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  100. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
  101. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  102. package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
  103. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  104. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
  105. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  106. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
  107. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  108. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
  109. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  110. package/dist/collection/locales/fr/messages.json +4 -4
  111. package/dist/collection/locales/index.spec.js +20 -20
  112. package/dist/collection/locales/index.spec.js.map +1 -1
  113. package/dist/collection/utils/behaviors.utils.js +127 -127
  114. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  115. package/dist/collection/utils/behaviors.utils.spec.js +42 -42
  116. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  117. package/dist/collection/utils/components.utils.js +77 -75
  118. package/dist/collection/utils/components.utils.js.map +1 -1
  119. package/dist/collection/utils/components.utils.spec.js +150 -135
  120. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  121. package/dist/collection/utils/e2e.test.utils.js +21 -21
  122. package/dist/collection/utils/e2e.test.utils.js.map +1 -1
  123. package/dist/collection/utils/locale.utils.js +17 -17
  124. package/dist/collection/utils/locale.utils.js.map +1 -1
  125. package/dist/collection/utils/locale.utils.spec.js +45 -45
  126. package/dist/collection/utils/locale.utils.spec.js.map +1 -1
  127. package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
  128. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  129. package/dist/collection/utils/playwright.fixture.js +24 -0
  130. package/dist/collection/utils/playwright.fixture.js.map +1 -0
  131. package/dist/collection/utils/unit.test.utils.js +50 -50
  132. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  133. package/dist/components/MgInput.js +105 -97
  134. package/dist/components/MgInput.js.map +1 -1
  135. package/dist/components/components.utils.js +78 -76
  136. package/dist/components/components.utils.js.map +1 -1
  137. package/dist/components/index2.js +21 -21
  138. package/dist/components/index2.js.map +1 -1
  139. package/dist/components/mg-action-more.d.ts +2 -2
  140. package/dist/components/mg-action-more.js +173 -173
  141. package/dist/components/mg-action-more.js.map +1 -1
  142. package/dist/components/mg-badge.d.ts +2 -2
  143. package/dist/components/mg-badge2.js +83 -83
  144. package/dist/components/mg-badge2.js.map +1 -1
  145. package/dist/components/mg-button.d.ts +2 -2
  146. package/dist/components/mg-button2.js +182 -167
  147. package/dist/components/mg-button2.js.map +1 -1
  148. package/dist/components/mg-card.d.ts +2 -2
  149. package/dist/components/mg-card2.js +77 -77
  150. package/dist/components/mg-card2.js.map +1 -1
  151. package/dist/components/mg-character-left.d.ts +2 -2
  152. package/dist/components/mg-character-left2.js +50 -50
  153. package/dist/components/mg-character-left2.js.map +1 -1
  154. package/dist/components/mg-details.d.ts +2 -2
  155. package/dist/components/mg-details.js +69 -69
  156. package/dist/components/mg-details.js.map +1 -1
  157. package/dist/components/mg-divider.d.ts +2 -2
  158. package/dist/components/mg-divider.js +30 -30
  159. package/dist/components/mg-divider.js.map +1 -1
  160. package/dist/components/mg-form.d.ts +2 -2
  161. package/dist/components/mg-form.js +171 -179
  162. package/dist/components/mg-form.js.map +1 -1
  163. package/dist/components/mg-icon.d.ts +2 -2
  164. package/dist/components/mg-icon2.js +327 -309
  165. package/dist/components/mg-icon2.js.map +1 -1
  166. package/dist/components/mg-illustrated-message.d.ts +2 -2
  167. package/dist/components/mg-illustrated-message.js +51 -51
  168. package/dist/components/mg-illustrated-message.js.map +1 -1
  169. package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
  170. package/dist/components/mg-input-checkbox-paginated2.js +170 -170
  171. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  172. package/dist/components/mg-input-checkbox.d.ts +2 -2
  173. package/dist/components/mg-input-checkbox.js +478 -480
  174. package/dist/components/mg-input-checkbox.js.map +1 -1
  175. package/dist/components/mg-input-date.d.ts +2 -2
  176. package/dist/components/mg-input-date.js +266 -260
  177. package/dist/components/mg-input-date.js.map +1 -1
  178. package/dist/components/mg-input-numeric.d.ts +2 -2
  179. package/dist/components/mg-input-numeric.js +354 -348
  180. package/dist/components/mg-input-numeric.js.map +1 -1
  181. package/dist/components/mg-input-password.d.ts +2 -2
  182. package/dist/components/mg-input-password.js +205 -199
  183. package/dist/components/mg-input-password.js.map +1 -1
  184. package/dist/components/mg-input-radio.d.ts +2 -2
  185. package/dist/components/mg-input-radio.js +236 -231
  186. package/dist/components/mg-input-radio.js.map +1 -1
  187. package/dist/components/mg-input-select.d.ts +2 -2
  188. package/dist/components/mg-input-select2.js +316 -310
  189. package/dist/components/mg-input-select2.js.map +1 -1
  190. package/dist/components/mg-input-text.d.ts +2 -2
  191. package/dist/components/mg-input-text2.js +306 -300
  192. package/dist/components/mg-input-text2.js.map +1 -1
  193. package/dist/components/mg-input-textarea.d.ts +2 -2
  194. package/dist/components/mg-input-textarea.js +277 -271
  195. package/dist/components/mg-input-textarea.js.map +1 -1
  196. package/dist/components/mg-input-title.d.ts +2 -2
  197. package/dist/components/mg-input-title2.js +60 -60
  198. package/dist/components/mg-input-title2.js.map +1 -1
  199. package/dist/components/mg-input-toggle.d.ts +2 -2
  200. package/dist/components/mg-input-toggle.js +251 -251
  201. package/dist/components/mg-input-toggle.js.map +1 -1
  202. package/dist/components/mg-item-more.d.ts +2 -2
  203. package/dist/components/mg-item-more.js +285 -285
  204. package/dist/components/mg-item-more.js.map +1 -1
  205. package/dist/components/mg-menu-item.d.ts +2 -2
  206. package/dist/components/mg-menu-item2.js +345 -345
  207. package/dist/components/mg-menu-item2.js.map +1 -1
  208. package/dist/components/mg-menu.conf.js +2 -2
  209. package/dist/components/mg-menu.conf.js.map +1 -1
  210. package/dist/components/mg-menu.d.ts +2 -2
  211. package/dist/components/mg-menu2.js +176 -176
  212. package/dist/components/mg-menu2.js.map +1 -1
  213. package/dist/components/mg-message.d.ts +2 -2
  214. package/dist/components/mg-message.js +198 -193
  215. package/dist/components/mg-message.js.map +1 -1
  216. package/dist/components/mg-modal.d.ts +2 -2
  217. package/dist/components/mg-modal.js +198 -198
  218. package/dist/components/mg-modal.js.map +1 -1
  219. package/dist/components/mg-pagination.d.ts +2 -2
  220. package/dist/components/mg-pagination2.js +133 -133
  221. package/dist/components/mg-pagination2.js.map +1 -1
  222. package/dist/components/mg-panel.d.ts +2 -2
  223. package/dist/components/mg-panel.js +238 -238
  224. package/dist/components/mg-panel.js.map +1 -1
  225. package/dist/components/mg-popover-content.d.ts +2 -2
  226. package/dist/components/mg-popover-content2.js +70 -70
  227. package/dist/components/mg-popover-content2.js.map +1 -1
  228. package/dist/components/mg-popover.d.ts +2 -2
  229. package/dist/components/mg-popover2.js +224 -222
  230. package/dist/components/mg-popover2.js.map +1 -1
  231. package/dist/components/mg-skip-links.d.ts +2 -2
  232. package/dist/components/mg-skip-links.js +57 -57
  233. package/dist/components/mg-skip-links.js.map +1 -1
  234. package/dist/components/mg-tabs.d.ts +2 -2
  235. package/dist/components/mg-tabs.js +243 -243
  236. package/dist/components/mg-tabs.js.map +1 -1
  237. package/dist/components/mg-tag.d.ts +2 -2
  238. package/dist/components/mg-tag.js +97 -97
  239. package/dist/components/mg-tag.js.map +1 -1
  240. package/dist/components/mg-tooltip-content.d.ts +2 -2
  241. package/dist/components/mg-tooltip-content2.js +30 -30
  242. package/dist/components/mg-tooltip-content2.js.map +1 -1
  243. package/dist/components/mg-tooltip.d.ts +2 -2
  244. package/dist/components/mg-tooltip2.js +316 -316
  245. package/dist/components/mg-tooltip2.js.map +1 -1
  246. package/dist/components/popper.js +6 -12
  247. package/dist/components/popper.js.map +1 -1
  248. package/dist/esm/{components.utils-0f76010d.js → components.utils-0d67c31c.js} +102 -100
  249. package/dist/esm/components.utils-0d67c31c.js.map +1 -0
  250. package/dist/esm/{index-ce01e63b.js → index-f34a3a2c.js} +320 -137
  251. package/dist/esm/index-f34a3a2c.js.map +1 -0
  252. package/dist/esm/loader.js +3 -3
  253. package/dist/esm/mg-action-more_34.entry.js +5130 -5057
  254. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  255. package/dist/esm/mg-components.js +4 -4
  256. package/dist/esm/mg-components.js.map +1 -1
  257. package/dist/esm/mg-item-more.entry.js +224 -224
  258. package/dist/esm/mg-item-more.entry.js.map +1 -1
  259. package/dist/mg-components/locales/fr/messages.json +4 -4
  260. package/dist/mg-components/mg-components.css +1 -1
  261. package/dist/mg-components/mg-components.esm.js +1 -1
  262. package/dist/mg-components/mg-components.esm.js.map +1 -1
  263. package/dist/mg-components/p-629454f7.entry.js +2 -0
  264. package/dist/mg-components/p-629454f7.entry.js.map +1 -0
  265. package/dist/mg-components/p-7444ff40.js +3 -0
  266. package/dist/mg-components/p-7444ff40.js.map +1 -0
  267. package/dist/mg-components/p-af42d17b.js +2 -0
  268. package/dist/mg-components/p-af42d17b.js.map +1 -0
  269. package/dist/mg-components/{p-01ebc95a.entry.js → p-e0fb0f3c.entry.js} +2 -2
  270. package/dist/mg-components/p-e0fb0f3c.entry.js.map +1 -0
  271. package/dist/types/assets/icons/index.d.ts +193 -0
  272. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
  273. package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -96
  274. package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
  275. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
  276. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
  277. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
  278. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
  279. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
  280. package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
  281. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
  282. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
  283. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +10 -3
  284. package/dist/types/components/molecules/inputs/MgInput.d.ts +17 -16
  285. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
  286. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
  287. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -260
  288. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
  289. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -149
  290. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
  291. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -222
  292. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -141
  293. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
  294. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -151
  295. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
  296. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -192
  297. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +1 -6
  298. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -194
  299. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -180
  300. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
  301. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
  302. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
  303. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
  304. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
  305. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
  306. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -11
  307. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
  308. package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
  309. package/dist/types/components/molecules/mg-form/mg-form.d.ts +103 -104
  310. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
  311. package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
  312. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +61 -61
  313. package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
  314. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
  315. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
  316. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
  317. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
  318. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
  319. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
  320. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
  321. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
  322. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
  323. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
  324. package/dist/types/components.d.ts +296 -32
  325. package/dist/types/locales/index.d.ts +172 -172
  326. package/dist/types/stencil-public-runtime.d.ts +29 -0
  327. package/dist/types/utils/behaviors.utils.d.ts +65 -65
  328. package/dist/types/utils/components.utils.d.ts +32 -26
  329. package/dist/types/utils/locale.utils.d.ts +2 -2
  330. package/dist/types/utils/playwright.fixture.d.ts +3 -0
  331. package/dist/types/utils/unit.test.utils.d.ts +5 -5
  332. package/package.json +33 -47
  333. package/dist/cjs/components.utils-dc9c8a53.js.map +0 -1
  334. package/dist/cjs/index-c042e24b.js.map +0 -1
  335. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
  336. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
  337. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
  338. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
  339. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
  340. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
  341. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -142
  342. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
  343. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
  344. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
  345. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
  346. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
  347. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
  348. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
  349. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
  350. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
  351. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
  352. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
  353. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
  354. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
  355. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
  356. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
  357. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
  358. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
  359. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
  360. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
  361. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
  362. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
  363. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
  364. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
  365. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
  366. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
  367. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
  368. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
  369. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
  370. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
  371. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
  372. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
  373. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -640
  374. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
  375. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
  376. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
  377. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -379
  378. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
  379. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
  380. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
  381. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -456
  382. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
  383. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
  384. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
  385. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -289
  386. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
  387. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
  388. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
  389. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -355
  390. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
  391. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
  392. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
  393. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -399
  394. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
  395. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
  396. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
  397. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -353
  398. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
  399. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
  400. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
  401. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -318
  402. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
  403. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
  404. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
  405. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
  406. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
  407. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
  408. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
  409. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
  410. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
  411. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
  412. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
  413. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
  414. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
  415. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -128
  416. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
  417. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -187
  418. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
  419. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
  420. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
  421. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
  422. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
  423. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
  424. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
  425. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -277
  426. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
  427. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
  428. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
  429. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
  430. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
  431. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
  432. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
  433. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
  434. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
  435. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
  436. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
  437. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
  438. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
  439. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
  440. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
  441. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
  442. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
  443. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
  444. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
  445. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
  446. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
  447. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
  448. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
  449. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
  450. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
  451. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
  452. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
  453. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
  454. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
  455. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
  456. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
  457. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
  458. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
  459. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
  460. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
  461. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
  462. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
  463. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
  464. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
  465. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
  466. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
  467. package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
  468. package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
  469. package/dist/esm/components.utils-0f76010d.js.map +0 -1
  470. package/dist/esm/index-ce01e63b.js.map +0 -1
  471. package/dist/mg-components/p-01ebc95a.entry.js.map +0 -1
  472. package/dist/mg-components/p-1aa89acf.js +0 -3
  473. package/dist/mg-components/p-1aa89acf.js.map +0 -1
  474. package/dist/mg-components/p-71a5a848.entry.js +0 -2
  475. package/dist/mg-components/p-71a5a848.entry.js.map +0 -1
  476. package/dist/mg-components/p-c9e2c669.js +0 -2
  477. package/dist/mg-components/p-c9e2c669.js.map +0 -1
  478. package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
  479. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
  480. package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
  481. package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
  482. package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
  483. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
  484. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
  485. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
  486. package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
  487. package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
  488. package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
  489. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
  490. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
  491. package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
  492. package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
  493. package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
  494. package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
  495. package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
  496. package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
@@ -22,254 +22,254 @@ const titlePositions = ['left', 'right'];
22
22
  const mgPanelCss = ":host{--mg-card-border:none;--mg-card-padding:0;--mg-card-border-radius:var(--mg-panel-border-radius);--mg-card-background:hsl(var(--mg-panel-background));--mg-card-box-shadow:var(--mg-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 1rem 0 .3rem}.mg-c-panel__header.mg-c-panel__header--reverse{padding-right:.3rem;padding-left:1rem}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:.3rem 0}.mg-c-panel__header-content{min-height:var(--default-size);flex:1 auto;align-items:center;padding-left:.3rem}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:.3rem}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:.3rem}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--font-size:1.4rem;--mg-button-font-weight:600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-panel-content-padding)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:1rem}.mg-c-panel ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default);--mg-card-max-width:unset;--mg-card-min-width:unset}";
23
23
 
24
24
  const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLElement {
25
- constructor() {
26
- super();
27
- this.__registerHost();
28
- this.__attachShadow();
29
- this.titleChange = createEvent(this, "title-change", 7);
30
- this.expandedChange = createEvent(this, "expanded-change", 7);
31
- /************
32
- * Methods *
33
- ************/
34
- /**
35
- * Toggle is editing state
36
- */
37
- this.toggleIsEditing = () => {
38
- this.isEditing = !this.isEditing;
39
- };
40
- /************
41
- * Handlers *
42
- ************/
43
- /**
44
- * Collapse button click handler
45
- */
46
- this.handleCollapseButton = () => {
47
- if (!this.expandToggleDisabled)
48
- this.expanded = !this.expanded;
49
- };
50
- /**
51
- * Edit button click handler
52
- */
53
- this.handleEditButton = () => {
54
- this.toggleIsEditing();
55
- };
56
- /**
57
- * Update title handler
58
- * @param event - input value change event
59
- */
60
- this.handleUpdateTitle = (event) => {
61
- this.updatedPanelTitle = event.detail;
62
- };
63
- /**
64
- * Cancel edition button handler
65
- */
66
- this.handleCancelEditButton = () => {
67
- this.updatedPanelTitle = undefined;
68
- this.toggleIsEditing();
69
- };
70
- /**
71
- * Validate edition button handler
72
- */
73
- this.handleValidateEditButton = () => {
74
- if (!this.editInputElement.valid)
75
- return;
76
- if (this.updatedPanelTitle !== undefined)
77
- this.panelTitle = this.updatedPanelTitle;
78
- this.toggleIsEditing();
79
- };
25
+ constructor() {
26
+ super();
27
+ this.__registerHost();
28
+ this.__attachShadow();
29
+ this.titleChange = createEvent(this, "title-change", 7);
30
+ this.expandedChange = createEvent(this, "expanded-change", 7);
31
+ /************
32
+ * Methods *
33
+ ************/
34
+ /**
35
+ * Toggle is editing state
36
+ */
37
+ this.toggleIsEditing = () => {
38
+ this.isEditing = !this.isEditing;
39
+ };
40
+ /************
41
+ * Handlers *
42
+ ************/
43
+ /**
44
+ * Collapse button click handler
45
+ */
46
+ this.handleCollapseButton = () => {
47
+ if (!this.expandToggleDisabled)
48
+ this.expanded = !this.expanded;
49
+ };
50
+ /**
51
+ * Edit button click handler
52
+ */
53
+ this.handleEditButton = () => {
54
+ this.toggleIsEditing();
55
+ };
56
+ /**
57
+ * Update title handler
58
+ * @param event - input value change event
59
+ */
60
+ this.handleUpdateTitle = (event) => {
61
+ this.updatedPanelTitle = event.detail;
62
+ };
63
+ /**
64
+ * Cancel edition button handler
65
+ */
66
+ this.handleCancelEditButton = () => {
67
+ this.updatedPanelTitle = undefined;
68
+ this.toggleIsEditing();
69
+ };
70
+ /**
71
+ * Validate edition button handler
72
+ */
73
+ this.handleValidateEditButton = () => {
74
+ if (!this.editInputElement.valid)
75
+ return;
76
+ if (this.updatedPanelTitle !== undefined)
77
+ this.panelTitle = this.updatedPanelTitle;
78
+ this.toggleIsEditing();
79
+ };
80
+ /*************
81
+ * Render *
82
+ *************/
83
+ /**
84
+ * Render collapse button
85
+ * @returns collpase button
86
+ */
87
+ this.renderCollapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", identifier: `${this.identifier}-collapse-button`, "aria-expanded": this.expanded.toString(), "aria-controls": `${this.identifier}-content`, disabled: this.expandToggleDisabled, isIcon: this.expandToggleDisplay === 'icon', label: this.panelTitle }, h("span", { class: "mg-c-panel__collapse-button-content" }, h("mg-icon", { icon: "chevron-up", class: { 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded } }), !this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle)));
88
+ /**
89
+ * Render edit button
90
+ * @returns edit Button
91
+ */
92
+ this.renderEditButton = () => (h("mg-button", { key: "edit-button", "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })));
93
+ /**
94
+ * Render input button
95
+ * @returns edit title input
96
+ */
97
+ this.renderEditInput = () => (h("mg-input-text", { key: "edition-input", label: this.messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: (el) => (this.editInputElement = el) }, h("mg-button", { slot: "append-input", label: this.messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` }, h("mg-icon", { icon: "cross" })), h("mg-button", { slot: "append-input", label: this.messages.general.confirm, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, h("mg-icon", { icon: "check" }))));
98
+ /**
99
+ * Render title
100
+ * @returns title element
101
+ */
102
+ this.renderTitle = () => {
103
+ const elementsToRender = [this.renderCollapseButton()];
104
+ if (this.titleEditable) {
105
+ if (!this.isEditing)
106
+ elementsToRender.push(this.renderEditButton());
107
+ else
108
+ elementsToRender.push(this.renderEditInput());
109
+ }
110
+ return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;
111
+ };
112
+ /**
113
+ * Render header children
114
+ * @returns header child
115
+ */
116
+ this.renderHeaderChildren = () => {
117
+ const children = [
118
+ h("div", { class: { 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }, key: this.panelTitle }, this.renderTitle()),
119
+ h("div", { class: "mg-c-panel__header-content", key: "slot-header" }, h("slot", { name: "header-right" })),
120
+ ];
121
+ return this.titlePosition === 'right' ? children.reverse() : children;
122
+ };
123
+ this.identifier = createID('mg-panel');
124
+ this.panelTitle = undefined;
125
+ this.titlePattern = undefined;
126
+ this.titlePatternErrorMessage = undefined;
127
+ this.titleEditable = false;
128
+ this.titlePosition = titlePositions[0];
129
+ this.expanded = false;
130
+ this.expandToggleDisplay = expandToggleDisplays[0];
131
+ this.expandToggleDisabled = undefined;
132
+ this.classCollection = new ClassList(['mg-c-panel']);
133
+ this.isEditing = false;
134
+ this.updatedPanelTitle = undefined;
135
+ }
136
+ validatePanelTitle(newValue) {
137
+ if (!isValidString(newValue))
138
+ throw new Error('<mg-panel> prop "panelTitle" is required.');
139
+ this.titleChange.emit(newValue);
140
+ }
141
+ validateTitlePattern(newValue) {
142
+ if (newValue !== undefined && !this.titleEditable)
143
+ throw new Error(`<mg-panel> prop "titleEditable" must be set to "true".`);
144
+ }
145
+ validateTitlePosition(newValue) {
146
+ if (!titlePositions.includes(newValue))
147
+ throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}.`);
148
+ }
149
+ handleExpanded(newValue) {
150
+ this.expandedChange.emit(newValue);
151
+ }
152
+ validateExpandToggleDisplay(newValue) {
153
+ if (!expandToggleDisplays.includes(newValue))
154
+ throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}.`);
155
+ if (newValue === 'icon' && this.titleEditable)
156
+ this.titleEditable = false;
157
+ }
80
158
  /*************
81
- * Render *
159
+ * Lifecycle *
82
160
  *************/
83
161
  /**
84
- * Render collapse button
85
- * @returns collpase button
162
+ * Check if props are well configured on init
86
163
  */
87
- this.renderCollapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", identifier: `${this.identifier}-collapse-button`, "aria-expanded": this.expanded.toString(), "aria-controls": `${this.identifier}-content`, disabled: this.expandToggleDisabled, isIcon: this.expandToggleDisplay === 'icon', label: this.panelTitle }, h("span", { class: "mg-c-panel__collapse-button-content" }, h("mg-icon", { icon: "chevron-up", class: { 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded } }), !this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle)));
164
+ componentWillLoad() {
165
+ // Get locales
166
+ this.messages = initLocales(this.element).messages;
167
+ // Validate
168
+ this.validateTitlePattern(this.titlePattern);
169
+ this.validateTitlePattern(this.titlePatternErrorMessage);
170
+ this.validatePanelTitle(this.panelTitle);
171
+ this.validateExpandToggleDisplay(this.expandToggleDisplay);
172
+ this.validateTitlePosition(this.titlePosition);
173
+ }
88
174
  /**
89
- * Render edit button
90
- * @returns edit Button
175
+ * Edit DOM after render
91
176
  */
92
- this.renderEditButton = () => (h("mg-button", { key: "edit-button", "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })));
177
+ componentDidRender() {
178
+ // when we are editing we get focus on edition input
179
+ if (this.isEditing)
180
+ this.editInputElement.setFocus();
181
+ }
93
182
  /**
94
- * Render input button
95
- * @returns edit title input
183
+ * Render component
184
+ * @returns rendered component
96
185
  */
97
- this.renderEditInput = () => (h("mg-input-text", { key: "edition-input", label: this.messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: (el) => (this.editInputElement = el) }, h("mg-button", { slot: "append-input", label: this.messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` }, h("mg-icon", { icon: "cross" })), h("mg-button", { slot: "append-input", label: this.messages.general.confirm, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, h("mg-icon", { icon: "check" }))));
98
- /**
99
- * Render title
100
- * @returns title element
101
- */
102
- this.renderTitle = () => {
103
- const elementsToRender = [this.renderCollapseButton()];
104
- if (this.titleEditable) {
105
- if (!this.isEditing)
106
- elementsToRender.push(this.renderEditButton());
107
- else
108
- elementsToRender.push(this.renderEditInput());
109
- }
110
- return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;
111
- };
112
- /**
113
- * Render header children
114
- * @returns header child
115
- */
116
- this.renderHeaderChildren = () => {
117
- const children = [
118
- h("div", { class: { 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }, key: this.panelTitle }, this.renderTitle()),
119
- h("div", { class: "mg-c-panel__header-content", key: "slot-header" }, h("slot", { name: "header-right" })),
120
- ];
121
- return this.titlePosition === 'right' ? children.reverse() : children;
122
- };
123
- this.identifier = createID('mg-panel');
124
- this.panelTitle = undefined;
125
- this.titlePattern = undefined;
126
- this.titlePatternErrorMessage = undefined;
127
- this.titleEditable = false;
128
- this.titlePosition = titlePositions[0];
129
- this.expanded = false;
130
- this.expandToggleDisplay = expandToggleDisplays[0];
131
- this.expandToggleDisabled = undefined;
132
- this.classCollection = new ClassList(['mg-c-panel']);
133
- this.isEditing = false;
134
- this.updatedPanelTitle = undefined;
135
- }
136
- validatePanelTitle(newValue) {
137
- if (!isValidString(newValue))
138
- throw new Error('<mg-panel> prop "panelTitle" is required.');
139
- this.titleChange.emit(newValue);
140
- }
141
- validateTitlePattern(newValue) {
142
- if (newValue !== undefined && !this.titleEditable)
143
- throw new Error(`<mg-panel> prop "titleEditable" must be set to "true".`);
144
- }
145
- validateTitlePosition(newValue) {
146
- if (!titlePositions.includes(newValue))
147
- throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}.`);
148
- }
149
- handleExpanded(newValue) {
150
- this.expandedChange.emit(newValue);
151
- }
152
- validateExpandToggleDisplay(newValue) {
153
- if (!expandToggleDisplays.includes(newValue))
154
- throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}.`);
155
- if (newValue === 'icon' && this.titleEditable)
156
- this.titleEditable = false;
157
- }
158
- /*************
159
- * Lifecycle *
160
- *************/
161
- /**
162
- * Check if props are well configured on init
163
- */
164
- componentWillLoad() {
165
- // Get locales
166
- this.messages = initLocales(this.element).messages;
167
- // Validate
168
- this.validateTitlePattern(this.titlePattern);
169
- this.validateTitlePattern(this.titlePatternErrorMessage);
170
- this.validatePanelTitle(this.panelTitle);
171
- this.validateExpandToggleDisplay(this.expandToggleDisplay);
172
- this.validateTitlePosition(this.titlePosition);
173
- }
174
- /**
175
- * Edit DOM after render
176
- */
177
- componentDidRender() {
178
- // when we are editing we get focus on edition input
179
- if (this.isEditing)
180
- this.editInputElement.setFocus();
181
- }
182
- /**
183
- * Render component
184
- * @returns rendered component
185
- */
186
- render() {
187
- const headerId = `${this.identifier}-header`;
188
- return (h("section", { class: this.classCollection.join(), id: this.identifier }, h("mg-card", null, h("header", { class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", null)))));
189
- }
190
- get element() { return this; }
191
- static get watchers() { return {
192
- "panelTitle": ["validatePanelTitle"],
193
- "titlePattern": ["validateTitlePattern"],
194
- "titlePatternErrorMessage": ["validateTitlePattern"],
195
- "titlePosition": ["validateTitlePosition"],
196
- "expanded": ["handleExpanded"],
197
- "expandToggleDisplay": ["validateExpandToggleDisplay"]
198
- }; }
199
- static get style() { return mgPanelCss; }
186
+ render() {
187
+ const headerId = `${this.identifier}-header`;
188
+ return (h("section", { class: this.classCollection.join(), id: this.identifier }, h("mg-card", null, h("header", { class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", null)))));
189
+ }
190
+ get element() { return this; }
191
+ static get watchers() { return {
192
+ "panelTitle": ["validatePanelTitle"],
193
+ "titlePattern": ["validateTitlePattern"],
194
+ "titlePatternErrorMessage": ["validateTitlePattern"],
195
+ "titlePosition": ["validateTitlePosition"],
196
+ "expanded": ["handleExpanded"],
197
+ "expandToggleDisplay": ["validateExpandToggleDisplay"]
198
+ }; }
199
+ static get style() { return mgPanelCss; }
200
200
  }, [1, "mg-panel", {
201
- "identifier": [1],
202
- "panelTitle": [1025, "panel-title"],
203
- "titlePattern": [1, "title-pattern"],
204
- "titlePatternErrorMessage": [1, "title-pattern-error-message"],
205
- "titleEditable": [1028, "title-editable"],
206
- "titlePosition": [1, "title-position"],
207
- "expanded": [1028],
208
- "expandToggleDisplay": [1, "expand-toggle-display"],
209
- "expandToggleDisabled": [4, "expand-toggle-disabled"],
210
- "classCollection": [32],
211
- "isEditing": [32],
212
- "updatedPanelTitle": [32]
213
- }, undefined, {
214
- "panelTitle": ["validatePanelTitle"],
215
- "titlePattern": ["validateTitlePattern"],
216
- "titlePatternErrorMessage": ["validateTitlePattern"],
217
- "titlePosition": ["validateTitlePosition"],
218
- "expanded": ["handleExpanded"],
219
- "expandToggleDisplay": ["validateExpandToggleDisplay"]
220
- }]);
201
+ "identifier": [1],
202
+ "panelTitle": [1025, "panel-title"],
203
+ "titlePattern": [1, "title-pattern"],
204
+ "titlePatternErrorMessage": [1, "title-pattern-error-message"],
205
+ "titleEditable": [1028, "title-editable"],
206
+ "titlePosition": [1, "title-position"],
207
+ "expanded": [1028],
208
+ "expandToggleDisplay": [1, "expand-toggle-display"],
209
+ "expandToggleDisabled": [4, "expand-toggle-disabled"],
210
+ "classCollection": [32],
211
+ "isEditing": [32],
212
+ "updatedPanelTitle": [32]
213
+ }, undefined, {
214
+ "panelTitle": ["validatePanelTitle"],
215
+ "titlePattern": ["validateTitlePattern"],
216
+ "titlePatternErrorMessage": ["validateTitlePattern"],
217
+ "titlePosition": ["validateTitlePosition"],
218
+ "expanded": ["handleExpanded"],
219
+ "expandToggleDisplay": ["validateExpandToggleDisplay"]
220
+ }]);
221
221
  function defineCustomElement$1() {
222
- if (typeof customElements === "undefined") {
223
- return;
224
- }
225
- const components = ["mg-panel", "mg-button", "mg-card", "mg-character-left", "mg-icon", "mg-input-text", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
226
- components.forEach(tagName => { switch (tagName) {
227
- case "mg-panel":
228
- if (!customElements.get(tagName)) {
229
- customElements.define(tagName, MgPanel$1);
230
- }
231
- break;
232
- case "mg-button":
233
- if (!customElements.get(tagName)) {
234
- defineCustomElement$9();
235
- }
236
- break;
237
- case "mg-card":
238
- if (!customElements.get(tagName)) {
239
- defineCustomElement$8();
240
- }
241
- break;
242
- case "mg-character-left":
243
- if (!customElements.get(tagName)) {
244
- defineCustomElement$7();
245
- }
246
- break;
247
- case "mg-icon":
248
- if (!customElements.get(tagName)) {
249
- defineCustomElement$6();
250
- }
251
- break;
252
- case "mg-input-text":
253
- if (!customElements.get(tagName)) {
254
- defineCustomElement$5();
255
- }
256
- break;
257
- case "mg-input-title":
258
- if (!customElements.get(tagName)) {
259
- defineCustomElement$4();
260
- }
261
- break;
262
- case "mg-tooltip":
263
- if (!customElements.get(tagName)) {
264
- defineCustomElement$3();
265
- }
266
- break;
267
- case "mg-tooltip-content":
268
- if (!customElements.get(tagName)) {
269
- defineCustomElement$2();
270
- }
271
- break;
272
- } });
222
+ if (typeof customElements === "undefined") {
223
+ return;
224
+ }
225
+ const components = ["mg-panel", "mg-button", "mg-card", "mg-character-left", "mg-icon", "mg-input-text", "mg-input-title", "mg-tooltip", "mg-tooltip-content"];
226
+ components.forEach(tagName => { switch (tagName) {
227
+ case "mg-panel":
228
+ if (!customElements.get(tagName)) {
229
+ customElements.define(tagName, MgPanel$1);
230
+ }
231
+ break;
232
+ case "mg-button":
233
+ if (!customElements.get(tagName)) {
234
+ defineCustomElement$9();
235
+ }
236
+ break;
237
+ case "mg-card":
238
+ if (!customElements.get(tagName)) {
239
+ defineCustomElement$8();
240
+ }
241
+ break;
242
+ case "mg-character-left":
243
+ if (!customElements.get(tagName)) {
244
+ defineCustomElement$7();
245
+ }
246
+ break;
247
+ case "mg-icon":
248
+ if (!customElements.get(tagName)) {
249
+ defineCustomElement$6();
250
+ }
251
+ break;
252
+ case "mg-input-text":
253
+ if (!customElements.get(tagName)) {
254
+ defineCustomElement$5();
255
+ }
256
+ break;
257
+ case "mg-input-title":
258
+ if (!customElements.get(tagName)) {
259
+ defineCustomElement$4();
260
+ }
261
+ break;
262
+ case "mg-tooltip":
263
+ if (!customElements.get(tagName)) {
264
+ defineCustomElement$3();
265
+ }
266
+ break;
267
+ case "mg-tooltip-content":
268
+ if (!customElements.get(tagName)) {
269
+ defineCustomElement$2();
270
+ }
271
+ break;
272
+ } });
273
273
  }
274
274
  defineCustomElement$1();
275
275
 
@@ -1 +1 @@
1
- {"file":"mg-panel.js","mappings":";;;;;;;;;;;;AAAA;;;AAGO,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAO9D;;;AAGO,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;;ACbxD,MAAM,UAAU,GAAG,m/CAAm/C;;MCUz/CA,SAAO;;;;;;;;;;;;;IAyHV,oBAAe,GAAG;MACxB,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;KAClC,CAAC;;;;;;;IASM,yBAAoB,GAAG;MAC7B,IAAI,CAAC,IAAI,CAAC,oBAAoB;QAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;KAChE,CAAC;;;;IAKM,qBAAgB,GAAG;MACzB,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB,CAAC;;;;;IAMM,sBAAiB,GAAG,CAAC,KAA0B;MACrD,IAAI,CAAC,iBAAiB,GAAG,KAAK,C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EAAE,EAAE,IAAI,CAAC,UAAU,IAC9D,mBACE,cAAQ,KAAK,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,CAAC,aAAa,KAAK,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,IACvH,IAAI,CAAC,oBAAoB,EAAE,CACrB,EACT,eAAS,KAAK,EAAC,qBAAqB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,UAAU,qBAAmB,QAAQ,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,IACtH,eAAa,CACL,CACF,CACF,EACV;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgPanel"],"sources":["src/components/molecules/mg-panel/mg-panel.conf.ts","../styles/dist/components/mg-panel.css?tag=mg-panel&encapsulation=shadow","src/components/molecules/mg-panel/mg-panel.tsx"],"sourcesContent":["/**\n * Available expand toggle display options\n */\nexport const expandToggleDisplays = ['text', 'icon'] as const;\n\n/**\n * Generated expand toggle display type from available expand toggle display options\n */\nexport type ExpandToggleDisplayType = (typeof expandToggleDisplays)[number];\n\n/**\n * Available title positions\n */\nexport const titlePositions = ['left', 'right'] as const;\n\n/**\n * Generated title positions type from available title positions\n */\nexport type TitlePositionType = (typeof titlePositions)[number];\n",":host{--mg-card-border: none;--mg-card-padding: 0;--mg-card-border-radius: var(--mg-panel-border-radius);--mg-card-background: hsl(var(--mg-panel-background));--mg-card-box-shadow: var(--mg-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 1rem 0 .3rem}.mg-c-panel__header.mg-c-panel__header--reverse{padding-right:.3rem;padding-left:1rem}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:.3rem 0}.mg-c-panel__header-content{min-height:var(--default-size);flex:1 auto;align-items:center;padding-left:.3rem}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:.3rem}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:.3rem}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--font-size: 1.4rem;--mg-button-font-weight: 600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-panel-content-padding)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:1rem}.mg-c-panel ::slotted(*){--mg-card-border: var(--mg-card-border-default);--mg-card-padding: var(--mg-card-padding-default);--mg-card-border-radius: var(--mg-card-border-radius-default);--mg-card-background: var(--mg-card-background-default);--mg-card-box-shadow: var(--mg-card-box-shadow-default);--mg-card-max-width: unset;--mg-card-min-width: unset}/*# sourceMappingURL=mg-panel.css.map */\n","import { Component, Element, h, Prop, State, EventEmitter, Watch, Event } from '@stencil/core';\nimport { createID, ClassList, isValidString } from '../../../utils/components.utils';\nimport { initLocales } from '../../../locales';\nimport { type ExpandToggleDisplayType, type TitlePositionType, expandToggleDisplays, titlePositions } from './mg-panel.conf';\n\n@Component({\n tag: 'mg-panel',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-panel.css',\n shadow: true,\n})\nexport class MgPanel {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private editInputElement: HTMLMgInputTextElement;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPanelElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-panel');\n\n /**\n * Panel title\n */\n @Prop({ mutable: true }) panelTitle!: string;\n @Watch('panelTitle')\n validatePanelTitle(newValue: MgPanel['panelTitle']): void {\n if (!isValidString(newValue)) throw new Error('<mg-panel> prop \"panelTitle\" is required.');\n this.titleChange.emit(newValue);\n }\n\n /**\n * Panel title pattern\n */\n @Prop() titlePattern: string;\n\n /**\n * Panel title pattern error message\n */\n @Prop() titlePatternErrorMessage: string;\n @Watch('titlePattern')\n @Watch('titlePatternErrorMessage')\n validateTitlePattern(newValue: string): void {\n if (newValue !== undefined && !this.titleEditable) throw new Error(`<mg-panel> prop \"titleEditable\" must be set to \"true\".`);\n }\n\n /**\n * Define if panel title is editable\n */\n @Prop({ mutable: true }) titleEditable = false;\n\n /**\n * Define title position\n */\n @Prop() titlePosition: TitlePositionType = titlePositions[0];\n @Watch('titlePosition')\n validateTitlePosition(newValue: MgPanel['titlePosition']) {\n if (!titlePositions.includes(newValue)) throw new Error(`<mg-panel> prop \"titlePosition\" must be one of: ${titlePositions.join(', ')}.`);\n }\n\n /**\n * Panel is opened\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n handleExpanded(newValue: MgPanel['expanded']): void {\n this.expandedChange.emit(newValue);\n }\n\n /**\n * Define expand toggle button display\n */\n @Prop() expandToggleDisplay: ExpandToggleDisplayType = expandToggleDisplays[0];\n @Watch('expandToggleDisplay')\n validateExpandToggleDisplay(newValue: MgPanel['expandToggleDisplay']) {\n if (!expandToggleDisplays.includes(newValue)) throw new Error(`<mg-panel> prop \"expandToggleDisplay\" must be one of: ${expandToggleDisplays.join(', ')}.`);\n if (newValue === 'icon' && this.titleEditable) this.titleEditable = false;\n }\n\n /**\n * Disable possibility to toggle expand\n */\n @Prop() expandToggleDisabled: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-panel']);\n\n /**\n * Title is in edition mode\n */\n @State() isEditing = false;\n\n /**\n * Cache for updated panel title before validation\n */\n @State() updatedPanelTitle: string;\n\n /**\n * Emmited event when title change\n */\n @Event({ eventName: 'title-change' }) titleChange: EventEmitter<string>;\n\n /**\n * Emmited event when expanded change\n */\n @Event({ eventName: 'expanded-change' }) expandedChange: EventEmitter<boolean>;\n\n /************\n * Methods *\n ************/\n\n /**\n * Toggle is editing state\n */\n private toggleIsEditing = (): void => {\n this.isEditing = !this.isEditing;\n };\n\n /************\n * Handlers *\n ************/\n\n /**\n * Collapse button click handler\n */\n private handleCollapseButton = (): void => {\n if (!this.expandToggleDisabled) this.expanded = !this.expanded;\n };\n\n /**\n * Edit button click handler\n */\n private handleEditButton = (): void => {\n this.toggleIsEditing();\n };\n\n /**\n * Update title handler\n * @param event - input value change event\n */\n private handleUpdateTitle = (event: CustomEvent<string>): void => {\n this.updatedPanelTitle = event.detail;\n };\n\n /**\n * Cancel edition button handler\n */\n private handleCancelEditButton = (): void => {\n this.updatedPanelTitle = undefined;\n this.toggleIsEditing();\n };\n\n /**\n * Validate edition button handler\n */\n private handleValidateEditButton = (): void => {\n if (!this.editInputElement.valid) return;\n if (this.updatedPanelTitle !== undefined) this.panelTitle = this.updatedPanelTitle;\n this.toggleIsEditing();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.validateTitlePattern(this.titlePattern);\n this.validateTitlePattern(this.titlePatternErrorMessage);\n this.validatePanelTitle(this.panelTitle);\n this.validateExpandToggleDisplay(this.expandToggleDisplay);\n this.validateTitlePosition(this.titlePosition);\n }\n\n /**\n * Edit DOM after render\n */\n componentDidRender(): void {\n // when we are editing we get focus on edition input\n if (this.isEditing) this.editInputElement.setFocus();\n }\n\n /*************\n * Render *\n *************/\n\n /**\n * Render collapse button\n * @returns collpase button\n */\n private renderCollapseButton = (): HTMLMgButtonElement => (\n <mg-button\n onClick={this.handleCollapseButton}\n variant=\"flat\"\n identifier={`${this.identifier}-collapse-button`}\n aria-expanded={this.expanded.toString()}\n aria-controls={`${this.identifier}-content`}\n disabled={this.expandToggleDisabled}\n isIcon={this.expandToggleDisplay === 'icon'}\n label={this.panelTitle}\n >\n <span class=\"mg-c-panel__collapse-button-content\">\n <mg-icon icon=\"chevron-up\" class={{ 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded }}></mg-icon>\n {!this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle}\n </span>\n </mg-button>\n );\n\n /**\n * Render edit button\n * @returns edit Button\n */\n private renderEditButton = (): HTMLMgButtonElement => (\n <mg-button key=\"edit-button\" is-icon variant=\"flat\" label={this.messages.panel.editLabel} onClick={this.handleEditButton} identifier={`${this.identifier}-edit-button`}>\n <mg-icon icon=\"pen\"></mg-icon>\n </mg-button>\n );\n\n /**\n * Render input button\n * @returns edit title input\n */\n private renderEditInput = (): HTMLMgInputTextElement => (\n <mg-input-text\n key=\"edition-input\"\n label={this.messages.panel.editLabel}\n label-hide\n value={this.panelTitle}\n onValue-change={this.handleUpdateTitle}\n displayCharacterLeft={false}\n pattern={this.titlePattern}\n pattern-error-message={this.titlePatternErrorMessage}\n identifier={`${this.identifier}-edition-input`}\n ref={(el: HTMLMgInputTextElement) => (this.editInputElement = el)}\n >\n <mg-button\n slot=\"append-input\"\n label={this.messages.general.cancel}\n is-icon\n variant=\"secondary\"\n onClick={this.handleCancelEditButton}\n identifier={`${this.identifier}-edition-button-cancel`}\n >\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n <mg-button\n slot=\"append-input\"\n label={this.messages.general.confirm}\n is-icon\n variant=\"secondary\"\n onClick={this.handleValidateEditButton}\n identifier={`${this.identifier}-edition-button-validate`}\n >\n <mg-icon icon=\"check\"></mg-icon>\n </mg-button>\n </mg-input-text>\n );\n\n /**\n * Render title\n * @returns title element\n */\n private renderTitle = (): HTMLElement[] => {\n const elementsToRender: HTMLElement[] = [this.renderCollapseButton()];\n if (this.titleEditable) {\n if (!this.isEditing) elementsToRender.push(this.renderEditButton());\n else elementsToRender.push(this.renderEditInput());\n }\n\n return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;\n };\n\n /**\n * Render header children\n * @returns header child\n */\n private renderHeaderChildren = (): HTMLElement[] => {\n const children = [\n <div\n class={{ 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }}\n key={this.panelTitle}\n >\n {this.renderTitle()}\n </div>,\n <div class=\"mg-c-panel__header-content\" key=\"slot-header\">\n <slot name=\"header-right\"></slot>\n </div>,\n ];\n return this.titlePosition === 'right' ? children.reverse() : children;\n };\n\n /**\n * Render component\n * @returns rendered component\n */\n render(): HTMLElement {\n const headerId = `${this.identifier}-header`;\n return (\n <section class={this.classCollection.join()} id={this.identifier}>\n <mg-card>\n <header class={{ 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }} id={headerId}>\n {this.renderHeaderChildren()}\n </header>\n <article class=\"mg-c-panel__content\" id={`${this.identifier}-content`} aria-labelledby={headerId} hidden={!this.expanded}>\n <slot></slot>\n </article>\n </mg-card>\n </section>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-panel.js","mappings":";;;;;;;;;;;;AAAA;;;AAGO,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAO9D;;;AAGO,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;;ACbxD,MAAM,UAAU,GAAG,m/CAAm/C;;MCUz/CA,SAAO;;;;;;;;;;;;;QAyHV,oBAAe,GAAG;YACxB,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;SAClC,CAAC;;;;;;;QASM,yBAAoB,GAAG;YAC7B,IAAI,CAAC,IAAI,CAAC,oBAAoB;gBAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;SAChE,CAAC;;;;QAKM,qBAAgB,GAAG;YACzB,IAAI,CAAC,eAAe,EAAE,CAAC;SACxB,CAAC;;;;;QAMM,sBAAiB,GAAG,CAAC,KAA0B;YACrD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC;SACvC,CA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,CAAC,UAAU,IAC9D,mBACE,cAAQ,KAAK,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,CAAC,aAAa,KAAK,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,IACvH,IAAI,CAAC,oBAAoB,EAAE,CACrB,EACT,eAAS,KAAK,EAAC,qBAAqB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,UAAU,qBAAmB,QAAQ,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,IACtH,eAAa,CACL,CACF,CACF,EACV;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgPanel"],"sources":["src/components/molecules/mg-panel/mg-panel.conf.ts","../styles/dist/components/mg-panel.css?tag=mg-panel&encapsulation=shadow","src/components/molecules/mg-panel/mg-panel.tsx"],"sourcesContent":["/**\n * Available expand toggle display options\n */\nexport const expandToggleDisplays = ['text', 'icon'] as const;\n\n/**\n * Generated expand toggle display type from available expand toggle display options\n */\nexport type ExpandToggleDisplayType = (typeof expandToggleDisplays)[number];\n\n/**\n * Available title positions\n */\nexport const titlePositions = ['left', 'right'] as const;\n\n/**\n * Generated title positions type from available title positions\n */\nexport type TitlePositionType = (typeof titlePositions)[number];\n",":host{--mg-card-border: none;--mg-card-padding: 0;--mg-card-border-radius: var(--mg-panel-border-radius);--mg-card-background: hsl(var(--mg-panel-background));--mg-card-box-shadow: var(--mg-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 1rem 0 .3rem}.mg-c-panel__header.mg-c-panel__header--reverse{padding-right:.3rem;padding-left:1rem}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:.3rem 0}.mg-c-panel__header-content{min-height:var(--default-size);flex:1 auto;align-items:center;padding-left:.3rem}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:.3rem}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:.3rem}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--font-size: 1.4rem;--mg-button-font-weight: 600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-panel-content-padding)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:1rem}.mg-c-panel ::slotted(*){--mg-card-border: var(--mg-card-border-default);--mg-card-padding: var(--mg-card-padding-default);--mg-card-border-radius: var(--mg-card-border-radius-default);--mg-card-background: var(--mg-card-background-default);--mg-card-box-shadow: var(--mg-card-box-shadow-default);--mg-card-max-width: unset;--mg-card-min-width: unset}/*# sourceMappingURL=mg-panel.css.map */\n","import { Component, Element, h, Prop, State, EventEmitter, Watch, Event } from '@stencil/core';\nimport { createID, ClassList, isValidString } from '../../../utils/components.utils';\nimport { initLocales } from '../../../locales';\nimport { type ExpandToggleDisplayType, type TitlePositionType, expandToggleDisplays, titlePositions } from './mg-panel.conf';\n\n@Component({\n tag: 'mg-panel',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-panel.css',\n shadow: true,\n})\nexport class MgPanel {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private editInputElement: HTMLMgInputTextElement;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPanelElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-panel');\n\n /**\n * Panel title\n */\n @Prop({ mutable: true }) panelTitle!: string;\n @Watch('panelTitle')\n validatePanelTitle(newValue: MgPanel['panelTitle']): void {\n if (!isValidString(newValue)) throw new Error('<mg-panel> prop \"panelTitle\" is required.');\n this.titleChange.emit(newValue);\n }\n\n /**\n * Panel title pattern\n */\n @Prop() titlePattern: string;\n\n /**\n * Panel title pattern error message\n */\n @Prop() titlePatternErrorMessage: string;\n @Watch('titlePattern')\n @Watch('titlePatternErrorMessage')\n validateTitlePattern(newValue: string): void {\n if (newValue !== undefined && !this.titleEditable) throw new Error(`<mg-panel> prop \"titleEditable\" must be set to \"true\".`);\n }\n\n /**\n * Define if panel title is editable\n */\n @Prop({ mutable: true }) titleEditable = false;\n\n /**\n * Define title position\n */\n @Prop() titlePosition: TitlePositionType = titlePositions[0];\n @Watch('titlePosition')\n validateTitlePosition(newValue: MgPanel['titlePosition']) {\n if (!titlePositions.includes(newValue)) throw new Error(`<mg-panel> prop \"titlePosition\" must be one of: ${titlePositions.join(', ')}.`);\n }\n\n /**\n * Panel is opened\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n handleExpanded(newValue: MgPanel['expanded']): void {\n this.expandedChange.emit(newValue);\n }\n\n /**\n * Define expand toggle button display\n */\n @Prop() expandToggleDisplay: ExpandToggleDisplayType = expandToggleDisplays[0];\n @Watch('expandToggleDisplay')\n validateExpandToggleDisplay(newValue: MgPanel['expandToggleDisplay']) {\n if (!expandToggleDisplays.includes(newValue)) throw new Error(`<mg-panel> prop \"expandToggleDisplay\" must be one of: ${expandToggleDisplays.join(', ')}.`);\n if (newValue === 'icon' && this.titleEditable) this.titleEditable = false;\n }\n\n /**\n * Disable possibility to toggle expand\n */\n @Prop() expandToggleDisabled: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-panel']);\n\n /**\n * Title is in edition mode\n */\n @State() isEditing = false;\n\n /**\n * Cache for updated panel title before validation\n */\n @State() updatedPanelTitle: string;\n\n /**\n * Emmited event when title change\n */\n @Event({ eventName: 'title-change' }) titleChange: EventEmitter<HTMLMgPanelElement['panelTitle']>;\n\n /**\n * Emmited event when expanded change\n */\n @Event({ eventName: 'expanded-change' }) expandedChange: EventEmitter<HTMLMgPanelElement['expanded']>;\n\n /************\n * Methods *\n ************/\n\n /**\n * Toggle is editing state\n */\n private toggleIsEditing = (): void => {\n this.isEditing = !this.isEditing;\n };\n\n /************\n * Handlers *\n ************/\n\n /**\n * Collapse button click handler\n */\n private handleCollapseButton = (): void => {\n if (!this.expandToggleDisabled) this.expanded = !this.expanded;\n };\n\n /**\n * Edit button click handler\n */\n private handleEditButton = (): void => {\n this.toggleIsEditing();\n };\n\n /**\n * Update title handler\n * @param event - input value change event\n */\n private handleUpdateTitle = (event: CustomEvent<string>): void => {\n this.updatedPanelTitle = event.detail;\n };\n\n /**\n * Cancel edition button handler\n */\n private handleCancelEditButton = (): void => {\n this.updatedPanelTitle = undefined;\n this.toggleIsEditing();\n };\n\n /**\n * Validate edition button handler\n */\n private handleValidateEditButton = (): void => {\n if (!this.editInputElement.valid) return;\n if (this.updatedPanelTitle !== undefined) this.panelTitle = this.updatedPanelTitle;\n this.toggleIsEditing();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.validateTitlePattern(this.titlePattern);\n this.validateTitlePattern(this.titlePatternErrorMessage);\n this.validatePanelTitle(this.panelTitle);\n this.validateExpandToggleDisplay(this.expandToggleDisplay);\n this.validateTitlePosition(this.titlePosition);\n }\n\n /**\n * Edit DOM after render\n */\n componentDidRender(): void {\n // when we are editing we get focus on edition input\n if (this.isEditing) this.editInputElement.setFocus();\n }\n\n /*************\n * Render *\n *************/\n\n /**\n * Render collapse button\n * @returns collpase button\n */\n private renderCollapseButton = (): HTMLMgButtonElement => (\n <mg-button\n onClick={this.handleCollapseButton}\n variant=\"flat\"\n identifier={`${this.identifier}-collapse-button`}\n aria-expanded={this.expanded.toString()}\n aria-controls={`${this.identifier}-content`}\n disabled={this.expandToggleDisabled}\n isIcon={this.expandToggleDisplay === 'icon'}\n label={this.panelTitle}\n >\n <span class=\"mg-c-panel__collapse-button-content\">\n <mg-icon icon=\"chevron-up\" class={{ 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded }}></mg-icon>\n {!this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle}\n </span>\n </mg-button>\n );\n\n /**\n * Render edit button\n * @returns edit Button\n */\n private renderEditButton = (): HTMLMgButtonElement => (\n <mg-button key=\"edit-button\" is-icon variant=\"flat\" label={this.messages.panel.editLabel} onClick={this.handleEditButton} identifier={`${this.identifier}-edit-button`}>\n <mg-icon icon=\"pen\"></mg-icon>\n </mg-button>\n );\n\n /**\n * Render input button\n * @returns edit title input\n */\n private renderEditInput = (): HTMLMgInputTextElement => (\n <mg-input-text\n key=\"edition-input\"\n label={this.messages.panel.editLabel}\n label-hide\n value={this.panelTitle}\n onValue-change={this.handleUpdateTitle}\n displayCharacterLeft={false}\n pattern={this.titlePattern}\n pattern-error-message={this.titlePatternErrorMessage}\n identifier={`${this.identifier}-edition-input`}\n ref={(el: HTMLMgInputTextElement) => (this.editInputElement = el)}\n >\n <mg-button\n slot=\"append-input\"\n label={this.messages.general.cancel}\n is-icon\n variant=\"secondary\"\n onClick={this.handleCancelEditButton}\n identifier={`${this.identifier}-edition-button-cancel`}\n >\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n <mg-button\n slot=\"append-input\"\n label={this.messages.general.confirm}\n is-icon\n variant=\"secondary\"\n onClick={this.handleValidateEditButton}\n identifier={`${this.identifier}-edition-button-validate`}\n >\n <mg-icon icon=\"check\"></mg-icon>\n </mg-button>\n </mg-input-text>\n );\n\n /**\n * Render title\n * @returns title element\n */\n private renderTitle = (): HTMLElement[] => {\n const elementsToRender: HTMLElement[] = [this.renderCollapseButton()];\n if (this.titleEditable) {\n if (!this.isEditing) elementsToRender.push(this.renderEditButton());\n else elementsToRender.push(this.renderEditInput());\n }\n\n return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;\n };\n\n /**\n * Render header children\n * @returns header child\n */\n private renderHeaderChildren = (): HTMLElement[] => {\n const children = [\n <div\n class={{ 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }}\n key={this.panelTitle}\n >\n {this.renderTitle()}\n </div>,\n <div class=\"mg-c-panel__header-content\" key=\"slot-header\">\n <slot name=\"header-right\"></slot>\n </div>,\n ];\n return this.titlePosition === 'right' ? children.reverse() : children;\n };\n\n /**\n * Render component\n * @returns rendered component\n */\n render(): HTMLElement {\n const headerId = `${this.identifier}-header`;\n return (\n <section class={this.classCollection.join()} id={this.identifier}>\n <mg-card>\n <header class={{ 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }} id={headerId}>\n {this.renderHeaderChildren()}\n </header>\n <article class=\"mg-c-panel__content\" id={`${this.identifier}-content`} aria-labelledby={headerId} hidden={!this.expanded}>\n <slot></slot>\n </article>\n </mg-card>\n </section>\n );\n }\n}\n"],"version":3}
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../types/components";
2
2
 
3
3
  interface MgPopoverContent extends Components.MgPopoverContent, HTMLElement {}
4
4
  export const MgPopoverContent: {
5
- prototype: MgPopoverContent;
6
- new (): MgPopoverContent;
5
+ prototype: MgPopoverContent;
6
+ new (): MgPopoverContent;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.