@mgdis/mg-components 3.3.0 → 4.0.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 (226) hide show
  1. package/dist/cjs/{index-bead7dbd.js → index-88560a66.js} +47 -48
  2. package/dist/cjs/{index-369388eb.js → index-a39c5567.js} +97 -10
  3. package/dist/cjs/loader.cjs.js +3 -17
  4. package/dist/cjs/mg-badge_21.cjs.entry.js +461 -281
  5. package/dist/cjs/mg-components.cjs.js +3 -7
  6. package/dist/cjs/mg-modal.cjs.entry.js +12 -6
  7. package/dist/cjs/mg-popover.cjs.entry.js +15 -6
  8. package/dist/cjs/{popper-0c3964e7.js → popper-71bf3058.js} +6 -2
  9. package/dist/collection/collection-manifest.json +1 -1
  10. package/dist/collection/components/atoms/mg-badge/{mg-badge.stories.js → doc/mg-badge.stories.js} +1 -1
  11. package/dist/collection/components/atoms/mg-badge/mg-badge.css +0 -2
  12. package/dist/collection/components/atoms/mg-badge/mg-badge.js +15 -3
  13. package/dist/collection/components/atoms/mg-button/{mg-button.stories.js → doc/mg-button.stories.js} +2 -2
  14. package/dist/collection/components/atoms/mg-button/mg-button.css +6 -30
  15. package/dist/collection/components/atoms/mg-button/mg-button.js +7 -2
  16. package/dist/collection/components/atoms/mg-character-left/{mg-character-left.stories.js → doc/mg-character-left.stories.js} +1 -1
  17. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +10 -47
  18. package/dist/collection/components/atoms/mg-icon/{mg-icon.stories.js → doc/mg-icon.stories.js} +1 -1
  19. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +86 -10
  20. package/dist/collection/components/atoms/mg-icon/mg-icon.css +4 -0
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.js +22 -6
  22. package/dist/collection/components/atoms/mg-input-title/{mg-input-title.stories.js → doc/mg-input-title.stories.js} +0 -0
  23. package/dist/collection/components/atoms/mg-tag/{mg-tag.stories.js → doc/mg-tag.stories.js} +1 -1
  24. package/dist/collection/components/atoms/mg-tag/mg-tag.js +19 -4
  25. package/dist/collection/components/atoms/mg-tooltip/{mg-tooltip.stories.js → doc/mg-tooltip.stories.js} +14 -1
  26. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +20 -0
  27. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +7 -2
  28. package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -7
  29. package/dist/collection/components/molecules/inputs/MgInput.js +5 -15
  30. package/dist/collection/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.js → doc/mg-input-checkbox.stories.js} +0 -0
  31. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +19 -13
  32. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +8 -21
  33. package/dist/collection/components/molecules/inputs/mg-input-date/{mg-input-date.stories.js → doc/mg-input-date.stories.js} +0 -0
  34. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +19 -18
  35. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +19 -18
  36. package/dist/collection/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.js → doc/mg-input-numeric.stories.js} +9 -2
  37. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +20 -19
  38. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +43 -19
  39. package/dist/collection/components/molecules/inputs/mg-input-password/{mg-input-password.stories.js → doc/mg-input-password.stories.js} +10 -1
  40. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +19 -18
  41. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -22
  42. package/dist/collection/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.js → doc/mg-input-radio.stories.js} +0 -0
  43. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +19 -13
  44. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +8 -15
  45. package/dist/collection/components/molecules/inputs/mg-input-select/{mg-input-select.stories.js → doc/mg-input-select.stories.js} +10 -3
  46. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +20 -18
  47. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +24 -31
  48. package/dist/collection/components/molecules/inputs/mg-input-text/{mg-input-text.stories.js → doc/mg-input-text.stories.js} +11 -7
  49. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +51 -28
  50. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +42 -43
  51. package/dist/collection/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.js → doc/mg-input-textarea.stories.js} +10 -4
  52. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +51 -22
  53. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +64 -37
  54. package/dist/collection/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.js → doc/mg-input-toggle.stories.js} +0 -0
  55. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +18 -9
  56. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +9 -3
  57. package/dist/collection/components/molecules/mg-form/{mg-form.stories.js → doc/mg-form.stories.js} +0 -0
  58. package/dist/collection/components/molecules/mg-form/mg-form.css +4 -0
  59. package/dist/collection/components/molecules/mg-form/mg-form.js +5 -3
  60. package/dist/collection/components/molecules/mg-message/{mg-message.stories.js → doc/mg-message.stories.js} +1 -1
  61. package/dist/collection/components/molecules/mg-message/mg-message.js +15 -7
  62. package/dist/collection/components/molecules/mg-modal/{mg-modal.stories.js → doc/mg-modal.stories.js} +0 -0
  63. package/dist/collection/components/molecules/mg-modal/mg-modal.css +5 -7
  64. package/dist/collection/components/molecules/mg-modal/mg-modal.js +10 -4
  65. package/dist/collection/components/molecules/mg-pagination/{mg-pagination.stories.js → doc/mg-pagination.stories.js} +0 -0
  66. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +17 -18
  67. package/dist/collection/components/molecules/mg-panel/{mg-panel.stories.js → doc/mg-panel.stories.js} +0 -0
  68. package/dist/collection/components/molecules/mg-panel/mg-panel.css +5 -1
  69. package/dist/collection/components/molecules/mg-panel/mg-panel.js +10 -9
  70. package/dist/collection/components/molecules/mg-popover/{mg-popover.stories.js → doc/mg-popover.stories.js} +10 -0
  71. package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +20 -0
  72. package/dist/collection/components/molecules/mg-popover/mg-popover.js +19 -5
  73. package/dist/collection/components/molecules/mg-tabs/{mg-tabs.stories.js → doc/mg-tabs.stories.js} +11 -5
  74. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +7 -0
  75. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +3 -0
  76. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +72 -26
  77. package/dist/collection/locales/index.js +33 -4
  78. package/dist/collection/stories/helpers.stories.js +33 -0
  79. package/dist/collection/utils/locale.utils.js +7 -4
  80. package/dist/collection/variables.css +10 -5
  81. package/dist/collection/variables.scss +10 -5
  82. package/dist/components/MgInput.js +6 -23
  83. package/dist/components/index.d.ts +23 -5
  84. package/dist/components/index.js +23 -0
  85. package/dist/components/index2.js +97 -8
  86. package/dist/components/locale.utils.js +7 -5
  87. package/dist/components/mg-badge2.js +16 -4
  88. package/dist/components/mg-button2.js +8 -3
  89. package/dist/components/mg-character-left2.js +4 -27
  90. package/dist/components/mg-form.js +6 -4
  91. package/dist/components/mg-icon2.js +109 -17
  92. package/dist/components/mg-input-checkbox.js +11 -27
  93. package/dist/components/mg-input-date.js +21 -25
  94. package/dist/components/mg-input-numeric.js +28 -26
  95. package/dist/components/mg-input-password.js +18 -28
  96. package/dist/components/mg-input-radio.js +10 -22
  97. package/dist/components/mg-input-select2.js +24 -35
  98. package/dist/components/mg-input-text2.js +38 -26
  99. package/dist/components/mg-input-textarea.js +43 -20
  100. package/dist/components/mg-input-toggle.js +11 -11
  101. package/dist/components/mg-message.js +16 -8
  102. package/dist/components/mg-modal.js +11 -5
  103. package/dist/components/mg-pagination.js +16 -22
  104. package/dist/components/mg-panel.js +8 -7
  105. package/dist/components/mg-popover.js +13 -4
  106. package/dist/components/mg-tabs.js +75 -21
  107. package/dist/components/mg-tag.js +20 -5
  108. package/dist/components/mg-tooltip2.js +1 -1
  109. package/dist/components/popper.js +6 -2
  110. package/dist/esm/{index-9e877561.js → index-bca81100.js} +48 -46
  111. package/dist/esm/{index-c346f52d.js → index-e51ae032.js} +97 -8
  112. package/dist/esm/loader.js +3 -17
  113. package/dist/esm/mg-badge_21.entry.js +458 -278
  114. package/dist/esm/mg-components.js +3 -7
  115. package/dist/esm/mg-modal.entry.js +12 -6
  116. package/dist/esm/mg-popover.entry.js +15 -6
  117. package/dist/esm/{popper-8874fd6c.js → popper-93ecb064.js} +6 -2
  118. package/dist/index.js +1 -1
  119. package/dist/mg-components/mg-components.css +1 -1
  120. package/dist/mg-components/mg-components.esm.js +1 -1
  121. package/dist/mg-components/p-003a1344.entry.js +1 -0
  122. package/dist/mg-components/p-462d648a.entry.js +1 -0
  123. package/dist/mg-components/p-4c66f794.js +1 -0
  124. package/dist/mg-components/p-5126ab10.entry.js +1 -0
  125. package/dist/mg-components/p-780bd52d.js +1 -0
  126. package/dist/mg-components/p-b14a3443.js +2 -0
  127. package/dist/mg-components/variables.css +10 -5
  128. package/dist/mg-components/variables.scss +10 -5
  129. package/dist/types/components/atoms/mg-badge/{mg-badge.stories.d.ts → doc/mg-badge.stories.d.ts} +0 -0
  130. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +8 -1
  131. package/dist/types/components/atoms/mg-button/{mg-button.stories.d.ts → doc/mg-button.stories.d.ts} +0 -0
  132. package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
  133. package/dist/types/components/atoms/mg-character-left/{mg-character-left.stories.d.ts → doc/mg-character-left.stories.d.ts} +0 -0
  134. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +5 -13
  135. package/dist/types/components/atoms/mg-icon/{mg-icon.stories.d.ts → doc/mg-icon.stories.d.ts} +0 -0
  136. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +3 -3
  137. package/dist/types/components/atoms/mg-input-title/{mg-input-title.stories.d.ts → doc/mg-input-title.stories.d.ts} +0 -0
  138. package/dist/types/components/atoms/mg-tag/{mg-tag.stories.d.ts → doc/mg-tag.stories.d.ts} +0 -0
  139. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +8 -1
  140. package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +29 -0
  141. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +8 -0
  142. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +2 -1
  143. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +0 -6
  144. package/dist/types/components/molecules/inputs/MgInput.d.ts +2 -4
  145. package/dist/types/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.d.ts → doc/mg-input-checkbox.stories.d.ts} +0 -0
  146. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +5 -2
  147. package/dist/types/components/molecules/inputs/mg-input-date/{mg-input-date.stories.d.ts → doc/mg-input-date.stories.d.ts} +0 -0
  148. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +7 -1
  149. package/dist/types/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.d.ts → doc/mg-input-numeric.stories.d.ts} +6 -0
  150. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +8 -2
  151. package/dist/types/components/molecules/inputs/mg-input-password/{mg-input-password.stories.d.ts → doc/mg-input-password.stories.d.ts} +8 -0
  152. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +7 -2
  153. package/dist/types/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.d.ts → doc/mg-input-radio.stories.d.ts} +0 -0
  154. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -1
  155. package/dist/types/components/molecules/inputs/mg-input-select/{mg-input-select.stories.d.ts → doc/mg-input-select.stories.d.ts} +11 -5
  156. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +7 -2
  157. package/dist/types/components/molecules/inputs/mg-input-text/{mg-input-text.stories.d.ts → doc/mg-input-text.stories.d.ts} +8 -0
  158. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +7 -7
  159. package/dist/types/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.d.ts → doc/mg-input-textarea.stories.d.ts} +8 -0
  160. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +14 -6
  161. package/dist/types/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.d.ts → doc/mg-input-toggle.stories.d.ts} +0 -0
  162. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -0
  163. package/dist/types/components/molecules/mg-form/{mg-form.stories.d.ts → doc/mg-form.stories.d.ts} +0 -0
  164. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -0
  165. package/dist/types/components/molecules/mg-message/{mg-message.stories.d.ts → doc/mg-message.stories.d.ts} +0 -0
  166. package/dist/types/components/molecules/mg-message/mg-message.d.ts +2 -0
  167. package/dist/types/components/molecules/mg-modal/{mg-modal.stories.d.ts → doc/mg-modal.stories.d.ts} +0 -0
  168. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +2 -0
  169. package/dist/types/components/molecules/mg-pagination/{mg-pagination.stories.d.ts → doc/mg-pagination.stories.d.ts} +0 -0
  170. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +8 -0
  171. package/dist/types/components/molecules/mg-panel/{mg-panel.stories.d.ts → doc/mg-panel.stories.d.ts} +0 -0
  172. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +5 -0
  173. package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +25 -0
  174. package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +8 -0
  175. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +9 -1
  176. package/dist/types/components/molecules/mg-tabs/{mg-tabs.stories.d.ts → doc/mg-tabs.stories.d.ts} +0 -0
  177. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +7 -1
  178. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +44 -0
  179. package/dist/types/components.d.ts +149 -151
  180. package/dist/types/locales/index.d.ts +109 -46
  181. package/dist/types/stories/{buttons.stories.d.ts → helpers.stories.d.ts} +1 -1
  182. package/dist/types/utils/locale.utils.d.ts +7 -3
  183. package/loader/index.js +1 -1
  184. package/package.json +41 -14
  185. package/readme.md +6 -35
  186. package/dist/cjs/css-shim-629916b0.js +0 -6
  187. package/dist/cjs/shadow-css-546083ef.js +0 -390
  188. package/dist/collection/stories/buttons.stories.js +0 -43
  189. package/dist/collection/stories/messages.stories.js +0 -44
  190. package/dist/collection/stories/tags.stories.js +0 -13
  191. package/dist/esm/css-shim-0993aa3b.js +0 -4
  192. package/dist/esm/shadow-css-dfa0587f.js +0 -388
  193. package/dist/esm-es5/css-shim-0993aa3b.js +0 -1
  194. package/dist/esm-es5/index-9e877561.js +0 -1
  195. package/dist/esm-es5/index-c346f52d.js +0 -1
  196. package/dist/esm-es5/index.js +0 -0
  197. package/dist/esm-es5/loader.js +0 -1
  198. package/dist/esm-es5/mg-badge_21.entry.js +0 -2
  199. package/dist/esm-es5/mg-components.js +0 -1
  200. package/dist/esm-es5/mg-modal.entry.js +0 -1
  201. package/dist/esm-es5/mg-popover.entry.js +0 -1
  202. package/dist/esm-es5/popper-8874fd6c.js +0 -1
  203. package/dist/esm-es5/shadow-css-dfa0587f.js +0 -12
  204. package/dist/mg-components/mg-components.js +0 -132
  205. package/dist/mg-components/p-136c8d6f.system.entry.js +0 -2
  206. package/dist/mg-components/p-3c14153d.js +0 -1
  207. package/dist/mg-components/p-50ea2036.system.js +0 -1
  208. package/dist/mg-components/p-55a22b35.system.js +0 -1
  209. package/dist/mg-components/p-5e796581.js +0 -12
  210. package/dist/mg-components/p-656b5efb.system.js +0 -1
  211. package/dist/mg-components/p-68d6f104.js +0 -1
  212. package/dist/mg-components/p-6d49ed95.js +0 -1
  213. package/dist/mg-components/p-6f173f62.system.entry.js +0 -1
  214. package/dist/mg-components/p-70177194.entry.js +0 -1
  215. package/dist/mg-components/p-8b2d8a2a.system.js +0 -13
  216. package/dist/mg-components/p-8cb61c3f.system.js +0 -1
  217. package/dist/mg-components/p-ace173b1.js +0 -1
  218. package/dist/mg-components/p-b7488a4c.entry.js +0 -1
  219. package/dist/mg-components/p-c1ffb2e1.entry.js +0 -1
  220. package/dist/mg-components/p-c90cc4bf.system.js +0 -1
  221. package/dist/mg-components/p-de1164fa.system.entry.js +0 -1
  222. package/dist/mg-components/p-e4a502b5.system.js +0 -1
  223. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +0 -11
  224. package/dist/types/components/molecules/mg-popover/mg-popover.stories.d.ts +0 -12
  225. package/dist/types/stories/messages.stories.d.ts +0 -13
  226. package/dist/types/stories/tags.stories.d.ts +0 -5
@@ -1,8 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { c as createID } from './components.utils.js';
3
- import { m as messages } from './index2.js';
4
- import { d as defineCustomElement$7 } from './mg-button2.js';
5
- import { d as defineCustomElement$6 } from './mg-character-left2.js';
3
+ import { i as initLocales } from './index2.js';
4
+ import { d as defineCustomElement$6 } from './mg-button2.js';
6
5
  import { d as defineCustomElement$5 } from './mg-icon2.js';
7
6
  import { d as defineCustomElement$4 } from './mg-input-select2.js';
8
7
  import { d as defineCustomElement$3 } from './mg-input-title2.js';
@@ -14,7 +13,7 @@ var NavigationAction;
14
13
  NavigationAction["PREVIOUS"] = "previous";
15
14
  })(NavigationAction || (NavigationAction = {}));
16
15
 
17
- const mgPaginationCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-pagination__nav{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}.mg-pagination__nav mg-input-select{margin-right:0.5rem}.mg-pagination__button{display:-ms-flexbox;display:flex}.mg-pagination__button:first-of-type{margin-right:1rem}.mg-pagination__button:last-of-type{margin-left:1rem}";
16
+ const mgPaginationCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-pagination__nav{display:flex;align-items:center;flex-direction:row}.mg-pagination__nav mg-input-select{margin-right:0.5rem}.mg-pagination__button{display:flex}.mg-pagination__button:first-of-type{margin-right:1rem}.mg-pagination__button:last-of-type{margin-left:1rem}";
18
17
 
19
18
  /**
20
19
  * Range generator
@@ -43,19 +42,11 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
43
42
  this.__registerHost();
44
43
  this.__attachShadow();
45
44
  this.currentPageChange = createEvent(this, "current-page-change", 7);
46
- /**************
47
- * Decorators *
48
- **************/
49
45
  /**
50
46
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
51
47
  * If not set, it will be created.
52
48
  */
53
49
  this.identifier = createID('mg-pagination');
54
- /**
55
- * Panignation label. Is a short description.
56
- * Customize default value can be usefull to improve accessibility
57
- */
58
- this.label = 'pagination';
59
50
  /**
60
51
  * Component total pages
61
52
  */
@@ -119,8 +110,15 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
119
110
  * @returns {void}
120
111
  */
121
112
  componentWillLoad() {
113
+ // Get locales
114
+ this.messages = initLocales(this.element).messages;
115
+ // Validate
122
116
  this.validateTotalPages(this.totalPages);
123
117
  this.validateCurrentPage(this.currentPage);
118
+ // Set default label
119
+ if (this.label === undefined || this.label === '') {
120
+ this.label = this.messages.pagination.label;
121
+ }
124
122
  }
125
123
  /**
126
124
  * Render
@@ -128,11 +126,12 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
128
126
  * @returns {HTMLElement} HTML Element
129
127
  */
130
128
  render() {
131
- const navigationActionButton = (disabled, action) => (h("mg-button", { identifier: `${this.identifier}-button-${action}`, class: "mg-pagination__button", label: messages.pagination[`${action}Page`],
129
+ const navigationActionButton = (disabled, action) => (h("mg-button", { identifier: `${this.identifier}-button-${action}`, class: "mg-pagination__button", label: this.messages.pagination[`${action}Page`],
132
130
  // eslint-disable-next-line react/jsx-no-bind
133
- onClick: () => this.handleGoToPage(action), disabled: disabled, variant: "flat" }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), messages.general[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
134
- return (h("nav", { "aria-label": this.label, id: this.identifier, class: "mg-pagination__nav" }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("span", { class: "sr-only" }, messages.pagination.page, " ", this.currentPage), h("span", null, "/ ", this.totalPages, " ", this.totalPages > 1 ? messages.pagination.pages : messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)));
131
+ onClick: () => this.handleGoToPage(action), disabled: disabled, variant: "flat" }, action === NavigationAction.PREVIOUS && h("mg-icon", { icon: "chevron-left" }), this.messages.general[action], action === NavigationAction.NEXT && h("mg-icon", { icon: "chevron-right" })));
132
+ return (h("nav", { "aria-label": this.label, id: this.identifier, class: "mg-pagination__nav" }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("span", { class: "sr-only" }, this.messages.pagination.page, " ", this.currentPage), h("span", null, "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)));
135
133
  }
134
+ get element() { return this; }
136
135
  static get watchers() { return {
137
136
  "totalPages": ["validateTotalPages"],
138
137
  "currentPage": ["validateCurrentPage"]
@@ -140,7 +139,7 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
140
139
  static get style() { return mgPaginationCss; }
141
140
  }, [1, "mg-pagination", {
142
141
  "identifier": [1],
143
- "label": [1],
142
+ "label": [1025],
144
143
  "totalPages": [2, "total-pages"],
145
144
  "currentPage": [1538, "current-page"]
146
145
  }]);
@@ -148,7 +147,7 @@ function defineCustomElement$1() {
148
147
  if (typeof customElements === "undefined") {
149
148
  return;
150
149
  }
151
- const components = ["mg-pagination", "mg-button", "mg-character-left", "mg-icon", "mg-input-select", "mg-input-title", "mg-tooltip"];
150
+ const components = ["mg-pagination", "mg-button", "mg-icon", "mg-input-select", "mg-input-title", "mg-tooltip"];
152
151
  components.forEach(tagName => { switch (tagName) {
153
152
  case "mg-pagination":
154
153
  if (!customElements.get(tagName)) {
@@ -156,11 +155,6 @@ function defineCustomElement$1() {
156
155
  }
157
156
  break;
158
157
  case "mg-button":
159
- if (!customElements.get(tagName)) {
160
- defineCustomElement$7();
161
- }
162
- break;
163
- case "mg-character-left":
164
158
  if (!customElements.get(tagName)) {
165
159
  defineCustomElement$6();
166
160
  }
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { c as createID, C as ClassList } from './components.utils.js';
3
- import { m as messages } from './index2.js';
3
+ import { i as initLocales } from './index2.js';
4
4
  import { d as defineCustomElement$7 } from './mg-button2.js';
5
5
  import { d as defineCustomElement$6 } from './mg-character-left2.js';
6
6
  import { d as defineCustomElement$5 } from './mg-icon2.js';
@@ -8,7 +8,7 @@ import { d as defineCustomElement$4 } from './mg-input-text2.js';
8
8
  import { d as defineCustomElement$3 } from './mg-input-title2.js';
9
9
  import { d as defineCustomElement$2 } from './mg-tooltip2.js';
10
10
 
11
- const mgPanelCss = ".mg-panel{background-color:hsl(var(--mg-panel-background));border-radius:var(--mg-panel-border-radius);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}.mg-panel__header{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;padding:0 1rem 0 0.3rem;-ms-flex-align:start;align-items:flex-start}.mg-panel__header-left,.mg-panel__header-right{display:-ms-flexbox;display:flex;margin:0.3rem 0}.mg-panel__header-left--full{-ms-flex:1 1 auto;flex:1 1 auto}.mg-panel__header-right{-ms-flex:1 auto;flex:1 auto}.mg-panel__header-left mg-input-text{-ms-flex-positive:1;flex-grow:1}.mg-panel__collapse-button{font-family:var(--font-family-heading);font-size:1.4rem;font-weight:500;margin:0 0.3rem 0 0}.mg-panel__content{padding:1.5rem}.mg-panel ::slotted([slot=header-right]){display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:1rem;margin-left:auto}";
11
+ const mgPanelCss = ".mg-panel{background-color:hsl(var(--mg-panel-background));border-radius:var(--mg-panel-border-radius);box-shadow:var(--box-shadow)}.mg-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 1rem 0 0.3rem;align-items:flex-start}.mg-panel__header-left,.mg-panel__header-right{display:flex;margin:0.3rem 0}.mg-panel__header-left--full{flex:1 1 auto}.mg-panel__header-right{flex:1 auto}.mg-panel__header-left mg-input-text{flex-grow:1}.mg-panel__collapse-button .mg-button{font-family:var(--font-family-heading);font-size:1.4rem;font-weight:500}.mg-panel__collapse-button,.mg-panel__edit-button{margin:0 0.3rem 0 0}.mg-panel__content{padding:1.5rem}.mg-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;gap:1rem;margin-left:auto}";
12
12
 
13
13
  const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
14
14
  constructor() {
@@ -17,9 +17,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
17
17
  this.__attachShadow();
18
18
  this.titleChange = createEvent(this, "title-change", 7);
19
19
  this.expandedChange = createEvent(this, "expanded-change", 7);
20
- /**************
21
- * Decorators *
22
- **************/
23
20
  /**
24
21
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
25
22
  * If not set, it will be created.
@@ -118,13 +115,13 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
118
115
  if (this.titleEditable && !this.isEditing) {
119
116
  return [
120
117
  collapseButton(),
121
- h("mg-button", { "is-icon": true, variant: "flat", label: messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })),
118
+ h("mg-button", { "is-icon": true, variant: "flat", class: "mg-panel__edit-button", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })),
122
119
  ];
123
120
  }
124
121
  if (this.titleEditable && this.isEditing) {
125
122
  return [
126
123
  collapseButton(),
127
- h("mg-input-text", { label: 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: 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: messages.general.validate, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, h("mg-icon", { icon: "check" }))),
124
+ h("mg-input-text", { 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" }))),
128
125
  ];
129
126
  }
130
127
  return collapseButton();
@@ -153,6 +150,9 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
153
150
  * @returns {void}
154
151
  */
155
152
  componentWillLoad() {
153
+ // Get locales
154
+ this.messages = initLocales(this.element).messages;
155
+ // Validate
156
156
  this.validatetitlePattern(this.titlePattern);
157
157
  }
158
158
  /**
@@ -174,6 +174,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
174
174
  render() {
175
175
  return (h("section", { class: this.classList.join(), id: this.identifier }, h("header", { class: "mg-panel__header", id: `${this.identifier}-header` }, h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()), h("div", { class: "mg-panel__header-right" }, h("slot", { name: "header-right" }))), h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded }, h("slot", null))));
176
176
  }
177
+ get element() { return this; }
177
178
  static get watchers() { return {
178
179
  "panelTitle": ["handelTileChange"],
179
180
  "titlePattern": ["validatetitlePattern"],
@@ -1,11 +1,11 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { c as createID } from './components.utils.js';
3
- import { m as messages } from './index2.js';
3
+ import { i as initLocales } from './index2.js';
4
4
  import { d as defineCustomElement$3 } from './mg-button2.js';
5
5
  import { d as defineCustomElement$2 } from './mg-icon2.js';
6
6
  import { c as createPopper } from './popper.js';
7
7
 
8
- const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover,.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>*,.mg-popover__title .sc-mg-popover-s>*{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
8
+ const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover,.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>*,.mg-popover__title .sc-mg-popover-s>*{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
9
9
 
10
10
  const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11
11
  constructor() {
@@ -73,7 +73,7 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
73
73
  this.popover.removeAttribute('data-show');
74
74
  // Disable the event listeners
75
75
  this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
76
- // Remove even listener
76
+ // Remove event listener
77
77
  document.removeEventListener('click', this.clickOutside, false);
78
78
  };
79
79
  /**
@@ -96,6 +96,15 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
96
96
  /*************
97
97
  * Lifecycle *
98
98
  *************/
99
+ /**
100
+ * Check if component props are well configured on init
101
+ *
102
+ * @returns {void} timeout
103
+ */
104
+ componentWillLoad() {
105
+ // Get locales
106
+ this.messages = initLocales(this.element).messages;
107
+ }
99
108
  /**
100
109
  * Check if component props are well configured on init
101
110
  *
@@ -149,7 +158,7 @@ const MgPopover$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
149
158
  * @returns {HTMLElement} HTML Element
150
159
  */
151
160
  render() {
152
- return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { icon: "cross" }))), h("div", { class: "mg-popover__title" }, h("slot", { name: "title" })), h("slot", { name: "content" }), h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
161
+ return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { icon: "cross" }))), h("div", { class: "mg-popover__title" }, h("slot", { name: "title" })), h("slot", { name: "content" }), h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
153
162
  }
154
163
  get element() { return this; }
155
164
  static get watchers() { return {
@@ -3,12 +3,19 @@ import { c as createID, C as ClassList, a as allItemsAreString } from './compone
3
3
  import { d as defineCustomElement$3 } from './mg-badge2.js';
4
4
  import { d as defineCustomElement$2 } from './mg-icon2.js';
5
5
 
6
+ var Status;
7
+ (function (Status) {
8
+ Status["VISIBLE"] = "visible";
9
+ Status["HIDDEN"] = "hidden";
10
+ Status["DISABLED"] = "disabled";
11
+ Status["ACTIVE"] = "active";
12
+ })(Status || (Status = {}));
6
13
  /**
7
14
  * List of all possibles sizes
8
15
  */
9
16
  const sizes = ['regular', 'large'];
10
17
 
11
- const mgTabsCss = ".mg-tabs.mg-tabs--size-regular.sc-mg-tabs .mg-tabs__navigation-button.sc-mg-tabs{padding:calc(1rem + 0.3rem) calc(1rem * 1.3) 1rem}.mg-tabs.mg-tabs--size-large.sc-mg-tabs .mg-tabs__navigation-button.sc-mg-tabs{padding:calc(1.8rem + 0.3rem) calc(1.8rem * 1.3) 1.8rem}.mg-tabs__header.sc-mg-tabs{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.mg-tabs__navigation-button.sc-mg-tabs{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-column-gap:0.5rem;-moz-column-gap:0.5rem;column-gap:0.5rem;background:none;border:none;border-bottom:0.3rem solid transparent;color:hsl(var(--color-dark));line-height:var(--line-height);cursor:pointer}.mg-tabs__navigation-button.sc-mg-tabs:disabled,.mg-tabs__navigation-button--disabled.sc-mg-tabs{cursor:default;opacity:30%}.mg-tabs__navigation-button.sc-mg-tabs:hover:not(:disabled),.mg-tabs__navigation-button.sc-mg-tabs:focus:not(:disabled){background-color:hsla(var(--color-info-h), var(--color-info-s), var(--color-info-l), 10%)}.mg-tabs__navigation-button.mg-tabs__navigation-button--active.sc-mg-tabs{color:hsl(var(--color-info));border-bottom-color:hsl(var(--color-info));font-weight:700}.mg-tabs__content-container.sc-mg-tabs:focus-visible{outline:none}";
18
+ const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button{padding:calc(1rem + 0.3rem) calc(1rem * 1.3) 1rem}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button{padding:calc(1.8rem + 0.3rem) calc(1.8rem * 1.3) 1.8rem}.mg-tabs__header{display:flex;flex-direction:row;flex-wrap:wrap}.mg-tabs__navigation-button{display:flex;align-items:center;column-gap:0.5rem;background:none;border:none;border-bottom:0.3rem solid transparent;color:hsl(var(--color-dark));line-height:var(--line-height);cursor:pointer}.mg-tabs__navigation-button:disabled,.mg-tabs__navigation-button--disabled{cursor:default;opacity:30%}.mg-tabs__navigation-button:hover:not(:disabled),.mg-tabs__navigation-button:focus:not(:disabled){background-color:hsla(var(--color-info-h), var(--color-info-s), var(--color-info-l), 10%)}.mg-tabs__navigation-button.mg-tabs__navigation-button--active{color:hsl(var(--color-info));border-bottom-color:hsl(var(--color-info));font-weight:700}.mg-tabs__navigation-button.mg-tabs__navigation-button--hidden{display:none}.mg-tabs__content-container:focus-visible{outline:none}";
12
19
 
13
20
  /**
14
21
  * type TabItem validation function
@@ -22,6 +29,12 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
22
29
  super();
23
30
  this.__registerHost();
24
31
  this.activeTabChange = createEvent(this, "active-tab-change", 7);
32
+ /************
33
+ * Internal *
34
+ ************/
35
+ this.tabPanel = 'panel';
36
+ this.startIndex = 1;
37
+ this.buttonTabBaseClass = 'mg-tabs__navigation-button';
25
38
  /**
26
39
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
27
40
  * If not set, it will be created.
@@ -44,6 +57,46 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
44
57
  * Component classes
45
58
  */
46
59
  this.classList = new ClassList(['mg-tabs']);
60
+ /**
61
+ * Method to set active tab
62
+ *
63
+ * @param {number} tabKey item tab key to set to ACTIVE status
64
+ * @returns {void}
65
+ */
66
+ this.setActiveTab = (tabKey) => {
67
+ // reset active tabs
68
+ this.tabs.forEach(tab => {
69
+ if (this.tabHasGivenStatus(tab, Status.ACTIVE))
70
+ tab.status = Status.VISIBLE;
71
+ });
72
+ // set active tab from given tab key
73
+ this.tabs[tabKey - this.startIndex].status = Status.ACTIVE;
74
+ // emit change active tab key event
75
+ this.activeTabChange.emit(tabKey);
76
+ };
77
+ /**
78
+ * Method to know if given tab has the given status
79
+ *
80
+ * @param {TabItem} tab item tab key to set to ACTIVE status
81
+ * @param {Status} status status to valide
82
+ * @returns {boolean} status comparaison
83
+ */
84
+ this.tabHasGivenStatus = (tab, status) => tab.status === status;
85
+ /**
86
+ * Method to get element id from index
87
+ *
88
+ * @param {string} element to get id
89
+ * @param {number} index to generate id
90
+ * @returns {string} generated element id
91
+ */
92
+ this.getElementId = (element, index) => `${element}-${this.getTabIndex(index)}`;
93
+ /**
94
+ * Method to get tab index
95
+ *
96
+ * @param {number} index to get
97
+ * @returns {number} index
98
+ */
99
+ this.getTabIndex = (index) => index + this.startIndex;
47
100
  /**
48
101
  * Handle click events on tabs
49
102
  *
@@ -53,6 +106,14 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
53
106
  const tabId = event.currentTarget.getAttribute('data-index');
54
107
  this.activeTab = Number(tabId);
55
108
  };
109
+ /**
110
+ * get navigation button class from given status
111
+ *
112
+ * @param {Status} status button tab status
113
+ * @param {boolean} isSelector set if we need a CSS selector with the dot '.' at the begin. default value = false.
114
+ * @returns {string} button class/selector variant
115
+ */
116
+ this.getNavigationButtonClass = (status, isSelector = false) => `${isSelector ? '.' : ''}${this.buttonTabBaseClass}--${status}`;
56
117
  /**
57
118
  * Handle keyboard event on tabs
58
119
  *
@@ -63,16 +124,14 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
63
124
  let tabId = Number(event.target.getAttribute('data-index'));
64
125
  const parent = event.target.parentElement;
65
126
  // change selected id from key code
66
- // /* IE FIX */ delete 'Right'
67
- if (['ArrowRight', 'Right'].includes(event.key)) {
127
+ if (event.key === 'ArrowRight') {
68
128
  tabId++;
69
- // /* IE FIX */ delete 'Left'
70
129
  }
71
- else if (['ArrowLeft', 'Left'].includes(event.key)) {
130
+ else if (event.key === 'ArrowLeft') {
72
131
  tabId--;
73
132
  }
74
- // get selected tab
75
- const selectedTab = parent.querySelector(`[data-index="${tabId}"]`);
133
+ // get selected tab if NOT hidden, disabled
134
+ const selectedTab = parent.querySelector(`[data-index="${tabId}"]:not(${[this.getNavigationButtonClass(Status.HIDDEN, true), this.getNavigationButtonClass(Status.DISABLED, true)].join()})`);
76
135
  // apply selected tab if exist
77
136
  if (selectedTab !== null) {
78
137
  selectedTab.focus();
@@ -98,7 +157,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
98
157
  validateItems(newValue) {
99
158
  // String array
100
159
  if (allItemsAreString(newValue)) {
101
- this.tabs = newValue.map(item => ({ label: item, disabled: false }));
160
+ this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
102
161
  }
103
162
  // Object array
104
163
  else if (newValue && newValue.every(item => isTabItem(item))) {
@@ -113,7 +172,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
113
172
  throw new Error('<mg-tabs> prop "activeTab" must be between 1 and tabs length.');
114
173
  }
115
174
  else {
116
- this.activeTabChange.emit(newValue);
175
+ this.setActiveTab(newValue);
117
176
  }
118
177
  }
119
178
  /*************
@@ -137,17 +196,12 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
137
196
  * @returns {HTMLElement} HTML Element
138
197
  */
139
198
  render() {
140
- return (h(Host, null, h("div", { class: this.classList.join() }, h("header", { role: "tablist", "aria-label": this.label, class: "mg-tabs__header" }, this.tabs.map((tab, index) => {
141
- const tabIndex = index + 1;
142
- return (h("button", { role: "tab", id: `${this.identifier}-${tabIndex}`, class: {
143
- 'mg-tabs__navigation-button': true,
144
- 'mg-tabs__navigation-button--active': tabIndex === this.activeTab,
145
- 'mg-tabs__navigation-button--disabled': tab.disabled,
146
- }, tabindex: tabIndex === this.activeTab ? 0 : -1, "aria-selected": (tabIndex === this.activeTab).toString(), "aria-controls": `pannel-${tabIndex}`, onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": tabIndex, disabled: tab.disabled }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "info", value: tab.badge.value, label: tab.badge.label })));
147
- })), this.tabs.map((_tab, index) => {
148
- const tabIndex = index + 1;
149
- return (h("article", { role: "tabpanel", id: `pannel-${tabIndex}`, hidden: tabIndex !== this.activeTab, "aria-labelledby": `${this.identifier}-${this.activeTab}`, tabindex: tabIndex === this.activeTab ? 0 : -1, class: "mg-tabs__content-container" }, h("slot", { name: `tab_content-${tabIndex}` })));
150
- }))));
199
+ return (h(Host, null, h("div", { class: this.classList.join() }, h("header", { role: "tablist", "aria-label": this.label, class: "mg-tabs__header" }, this.tabs.map((tab, index) => (h("button", { role: "tab", id: this.getElementId(this.identifier, index), class: {
200
+ [`${this.buttonTabBaseClass}`]: true,
201
+ [`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasGivenStatus(tab, Status.ACTIVE),
202
+ [`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.tabHasGivenStatus(tab, Status.DISABLED),
203
+ [`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.tabHasGivenStatus(tab, Status.HIDDEN),
204
+ }, tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasGivenStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabIndex(index), disabled: this.tabHasGivenStatus(tab, Status.DISABLED) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "info", value: tab.badge.value, label: tab.badge.label }))))), this.tabs.map((tab, index) => (h("article", { role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasGivenStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) })))))));
151
205
  }
152
206
  get element() { return this; }
153
207
  static get watchers() { return {
@@ -156,7 +210,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
156
210
  "activeTab": ["validateActiveTab"]
157
211
  }; }
158
212
  static get style() { return mgTabsCss; }
159
- }, [6, "mg-tabs", {
213
+ }, [4, "mg-tabs", {
160
214
  "identifier": [1],
161
215
  "label": [1],
162
216
  "size": [1],
@@ -6,31 +6,46 @@ import { C as ClassList } from './components.utils.js';
6
6
  */
7
7
  const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'];
8
8
 
9
- const mgTagCss = ".mg-tag{padding:calc((var(--mg-tag-height) - 0.2rem - var(--mg-tag-font-size) * var(--line-height)) / 2) 0.6rem;min-height:var(--mg-tag-height);-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:var(--mg-tag-border-radius);border:0.1rem solid;font-size:var(--mg-tag-font-size);font-weight:600;text-align:center}.mg-tag.mg-tag--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-tag.mg-tag--primary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-tag.mg-tag--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-tag.mg-tag--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-tag.mg-tag--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-tag.mg-tag--danger.mg-tag--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-tag.mg-tag--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-tag.mg-tag--info.mg-tag--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-tag,mg-tag{display:inline-block;vertical-align:middle}";
9
+ const mgTagCss = ".mg-tag{padding:calc((var(--mg-tag-height) - 0.2rem - var(--mg-tag-font-size) * var(--line-height)) / 2) 0.6rem;min-height:var(--mg-tag-height);box-sizing:border-box;border-radius:var(--mg-tag-border-radius);border:0.1rem solid;font-size:var(--mg-tag-font-size);font-weight:600;text-align:center}.mg-tag.mg-tag--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-tag.mg-tag--primary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-tag.mg-tag--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-tag.mg-tag--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-tag.mg-tag--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-tag.mg-tag--danger.mg-tag--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-tag.mg-tag--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-tag.mg-tag--info.mg-tag--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-tag,mg-tag{display:inline-block;vertical-align:middle}";
10
10
 
11
11
  const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
12
12
  constructor() {
13
13
  super();
14
14
  this.__registerHost();
15
15
  this.__attachShadow();
16
+ /************
17
+ * Internal *
18
+ ************/
19
+ // classes
20
+ this.classOutline = `mg-tag--outline`;
21
+ /**************
22
+ * Decorators *
23
+ **************/
16
24
  /**
17
25
  * Define button variant
18
26
  */
19
- this.variant = variants[0]; // info
27
+ this.variant = variants[0]; // primary
20
28
  /**
21
29
  * Component classes
22
30
  */
23
31
  this.classList = new ClassList(['mg-tag']);
24
32
  }
25
- validateVariant(newValue) {
33
+ validateVariant(newValue, oldValue) {
26
34
  if (!variants.includes(newValue)) {
27
35
  throw new Error(`<mg-tag> prop "variant" must be one of : ${variants.join(', ')}.`);
28
36
  }
29
- this.classList.add(`mg-tag--${this.variant}`);
37
+ else {
38
+ if (oldValue !== undefined) {
39
+ this.classList.delete(`mg-tag--${oldValue}`);
40
+ }
41
+ this.classList.add(`mg-tag--${newValue}`);
42
+ }
30
43
  }
31
44
  validateOutline(newValue) {
32
45
  if (newValue)
33
- this.classList.add(`mg-tag--outline`);
46
+ this.classList.add(this.classOutline);
47
+ else
48
+ this.classList.delete(this.classOutline);
34
49
  }
35
50
  /*************
36
51
  * Lifecycle *
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
2
2
  import { c as createID } from './components.utils.js';
3
3
  import { c as createPopper } from './popper.js';
4
4
 
5
- const mgTooltipCss = ".sc-mg-tooltip-h{display:inline-block}.mg-tooltip.sc-mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:9999;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start}.mg-tooltip[data-show].sc-mg-tooltip{display:block}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip,.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip{visibility:hidden}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{visibility:visible;content:\"\";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.mg-tooltip[data-popper-placement^=top].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{bottom:-4px}.mg-tooltip[data-popper-placement^=bottom].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{top:-4px}.mg-tooltip[data-popper-placement^=left].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{right:-4px}.mg-tooltip[data-popper-placement^=right].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{left:-4px}";
5
+ const mgTooltipCss = ".sc-mg-tooltip-h{display:inline-block}.mg-tooltip.sc-mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:9999;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start}.mg-tooltip[data-show].sc-mg-tooltip{display:block}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip,.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip{visibility:hidden}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-tooltip[data-popper-placement^=top].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{bottom:-4px}.mg-tooltip[data-popper-placement^=bottom].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{top:-4px}.mg-tooltip[data-popper-placement^=left].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{right:-4px}.mg-tooltip[data-popper-placement^=right].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{left:-4px}";
6
6
 
7
7
  const MgTooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
8
  constructor() {
@@ -298,6 +298,10 @@ function getContainingBlock(element) {
298
298
 
299
299
  var currentNode = getParentNode(element);
300
300
 
301
+ if (isShadowRoot(currentNode)) {
302
+ currentNode = currentNode.host;
303
+ }
304
+
301
305
  while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
302
306
  var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
303
307
  // create a containing block.
@@ -521,7 +525,7 @@ function mapToStyles(_ref2) {
521
525
 
522
526
  if (placement === top || (placement === left || placement === right) && variation === end) {
523
527
  sideY = bottom;
524
- var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
528
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
525
529
  offsetParent[heightProp];
526
530
  y -= offsetY - popperRect.height;
527
531
  y *= gpuAcceleration ? 1 : -1;
@@ -529,7 +533,7 @@ function mapToStyles(_ref2) {
529
533
 
530
534
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
531
535
  sideX = right;
532
- var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
536
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
533
537
  offsetParent[widthProp];
534
538
  x -= offsetX - popperRect.width;
535
539
  x *= gpuAcceleration ? 1 : -1;