@mgdis/mg-components 3.2.0 → 4.0.1

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 (228) 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 +519 -294
  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 -10
  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.conf.js +1 -1
  15. package/dist/collection/components/atoms/mg-button/mg-button.css +20 -32
  16. package/dist/collection/components/atoms/mg-button/mg-button.js +8 -3
  17. package/dist/collection/components/atoms/mg-character-left/{mg-character-left.stories.js → doc/mg-character-left.stories.js} +1 -1
  18. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +10 -47
  19. package/dist/collection/components/atoms/mg-icon/{mg-icon.stories.js → doc/mg-icon.stories.js} +1 -1
  20. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +97 -10
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.css +4 -0
  22. package/dist/collection/components/atoms/mg-icon/mg-icon.js +22 -6
  23. package/dist/collection/components/atoms/mg-input-title/{mg-input-title.stories.js → doc/mg-input-title.stories.js} +0 -0
  24. package/dist/collection/components/atoms/mg-tag/{mg-tag.stories.js → doc/mg-tag.stories.js} +1 -1
  25. package/dist/collection/components/atoms/mg-tag/mg-tag.js +19 -4
  26. package/dist/collection/components/atoms/mg-tooltip/{mg-tooltip.stories.js → doc/mg-tooltip.stories.js} +14 -1
  27. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +20 -0
  28. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +7 -2
  29. package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -7
  30. package/dist/collection/components/molecules/inputs/MgInput.js +5 -15
  31. package/dist/collection/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.js → doc/mg-input-checkbox.stories.js} +0 -0
  32. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +19 -13
  33. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +8 -21
  34. package/dist/collection/components/molecules/inputs/mg-input-date/{mg-input-date.stories.js → doc/mg-input-date.stories.js} +0 -0
  35. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +19 -18
  36. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +19 -18
  37. package/dist/collection/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.js → doc/mg-input-numeric.stories.js} +9 -2
  38. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +20 -19
  39. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +43 -19
  40. package/dist/collection/components/molecules/inputs/mg-input-password/{mg-input-password.stories.js → doc/mg-input-password.stories.js} +10 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +19 -18
  42. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -22
  43. package/dist/collection/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.js → doc/mg-input-radio.stories.js} +0 -0
  44. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +19 -13
  45. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +8 -15
  46. package/dist/collection/components/molecules/inputs/mg-input-select/{mg-input-select.stories.js → doc/mg-input-select.stories.js} +10 -3
  47. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +20 -18
  48. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +24 -31
  49. package/dist/collection/components/molecules/inputs/mg-input-text/{mg-input-text.stories.js → doc/mg-input-text.stories.js} +11 -7
  50. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +51 -28
  51. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +42 -43
  52. package/dist/collection/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.js → doc/mg-input-textarea.stories.js} +10 -4
  53. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +51 -22
  54. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +66 -39
  55. package/dist/collection/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.js → doc/mg-input-toggle.stories.js} +0 -0
  56. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +18 -9
  57. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +10 -4
  58. package/dist/collection/components/molecules/mg-form/{mg-form.stories.js → doc/mg-form.stories.js} +0 -0
  59. package/dist/collection/components/molecules/mg-form/mg-form.css +4 -0
  60. package/dist/collection/components/molecules/mg-form/mg-form.js +5 -3
  61. package/dist/collection/components/molecules/mg-message/{mg-message.stories.js → doc/mg-message.stories.js} +1 -1
  62. package/dist/collection/components/molecules/mg-message/mg-message.js +15 -7
  63. package/dist/collection/components/molecules/mg-modal/{mg-modal.stories.js → doc/mg-modal.stories.js} +0 -0
  64. package/dist/collection/components/molecules/mg-modal/mg-modal.css +5 -7
  65. package/dist/collection/components/molecules/mg-modal/mg-modal.js +12 -5
  66. package/dist/collection/components/molecules/mg-pagination/{mg-pagination.stories.js → doc/mg-pagination.stories.js} +0 -0
  67. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +17 -18
  68. package/dist/collection/components/molecules/mg-panel/{mg-panel.stories.js → doc/mg-panel.stories.js} +9 -1
  69. package/dist/collection/components/molecules/mg-panel/mg-panel.css +13 -4
  70. package/dist/collection/components/molecules/mg-panel/mg-panel.js +119 -18
  71. package/dist/collection/components/molecules/mg-popover/{mg-popover.stories.js → doc/mg-popover.stories.js} +10 -0
  72. package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +20 -0
  73. package/dist/collection/components/molecules/mg-popover/mg-popover.js +19 -9
  74. package/dist/collection/components/molecules/mg-tabs/{mg-tabs.stories.js → doc/mg-tabs.stories.js} +12 -5
  75. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +7 -0
  76. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +3 -0
  77. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +92 -27
  78. package/dist/collection/locales/index.js +33 -4
  79. package/dist/collection/stories/helpers.stories.js +33 -0
  80. package/dist/collection/utils/locale.utils.js +7 -4
  81. package/dist/collection/variables.css +9 -4
  82. package/dist/collection/variables.scss +9 -4
  83. package/dist/components/MgInput.js +6 -23
  84. package/dist/components/index.d.ts +23 -5
  85. package/dist/components/index.js +23 -0
  86. package/dist/components/index2.js +97 -8
  87. package/dist/components/locale.utils.js +7 -5
  88. package/dist/components/mg-badge2.js +16 -4
  89. package/dist/components/mg-button2.js +10 -5
  90. package/dist/components/mg-character-left2.js +4 -27
  91. package/dist/components/mg-form.js +6 -4
  92. package/dist/components/mg-icon2.js +120 -17
  93. package/dist/components/mg-input-checkbox.js +11 -27
  94. package/dist/components/mg-input-date.js +21 -25
  95. package/dist/components/mg-input-numeric.js +28 -26
  96. package/dist/components/mg-input-password.js +18 -28
  97. package/dist/components/mg-input-radio.js +10 -22
  98. package/dist/components/mg-input-select2.js +24 -35
  99. package/dist/components/mg-input-text2.js +38 -26
  100. package/dist/components/mg-input-textarea.js +44 -21
  101. package/dist/components/mg-input-toggle.js +11 -11
  102. package/dist/components/mg-message.js +16 -8
  103. package/dist/components/mg-modal.js +11 -5
  104. package/dist/components/mg-pagination.js +16 -22
  105. package/dist/components/mg-panel.js +51 -17
  106. package/dist/components/mg-popover.js +13 -8
  107. package/dist/components/mg-tabs.js +80 -22
  108. package/dist/components/mg-tag.js +20 -5
  109. package/dist/components/mg-tooltip2.js +1 -1
  110. package/dist/components/popper.js +6 -2
  111. package/dist/esm/{index-9e877561.js → index-bca81100.js} +48 -46
  112. package/dist/esm/{index-c346f52d.js → index-e51ae032.js} +97 -8
  113. package/dist/esm/loader.js +3 -17
  114. package/dist/esm/mg-badge_21.entry.js +516 -291
  115. package/dist/esm/mg-components.js +3 -7
  116. package/dist/esm/mg-modal.entry.js +12 -6
  117. package/dist/esm/mg-popover.entry.js +15 -10
  118. package/dist/esm/{popper-8874fd6c.js → popper-93ecb064.js} +6 -2
  119. package/dist/index.js +1 -1
  120. package/dist/mg-components/mg-components.css +1 -1
  121. package/dist/mg-components/mg-components.esm.js +1 -1
  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-766c918b.entry.js +1 -0
  126. package/dist/mg-components/p-780bd52d.js +1 -0
  127. package/dist/mg-components/p-b14a3443.js +2 -0
  128. package/dist/mg-components/variables.css +9 -4
  129. package/dist/mg-components/variables.scss +9 -4
  130. package/dist/types/components/atoms/mg-badge/{mg-badge.stories.d.ts → doc/mg-badge.stories.d.ts} +0 -0
  131. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +8 -1
  132. package/dist/types/components/atoms/mg-button/{mg-button.stories.d.ts → doc/mg-button.stories.d.ts} +0 -0
  133. package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
  134. package/dist/types/components/atoms/mg-character-left/{mg-character-left.stories.d.ts → doc/mg-character-left.stories.d.ts} +0 -0
  135. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +5 -13
  136. package/dist/types/components/atoms/mg-icon/{mg-icon.stories.d.ts → doc/mg-icon.stories.d.ts} +0 -0
  137. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +3 -3
  138. package/dist/types/components/atoms/mg-input-title/{mg-input-title.stories.d.ts → doc/mg-input-title.stories.d.ts} +0 -0
  139. package/dist/types/components/atoms/mg-tag/{mg-tag.stories.d.ts → doc/mg-tag.stories.d.ts} +0 -0
  140. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +8 -1
  141. package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +29 -0
  142. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +8 -0
  143. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +2 -1
  144. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +0 -6
  145. package/dist/types/components/molecules/inputs/MgInput.d.ts +2 -4
  146. package/dist/types/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.d.ts → doc/mg-input-checkbox.stories.d.ts} +0 -0
  147. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +5 -2
  148. package/dist/types/components/molecules/inputs/mg-input-date/{mg-input-date.stories.d.ts → doc/mg-input-date.stories.d.ts} +0 -0
  149. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +7 -1
  150. package/dist/types/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.d.ts → doc/mg-input-numeric.stories.d.ts} +6 -0
  151. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +8 -2
  152. package/dist/types/components/molecules/inputs/mg-input-password/{mg-input-password.stories.d.ts → doc/mg-input-password.stories.d.ts} +8 -0
  153. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +7 -2
  154. package/dist/types/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.d.ts → doc/mg-input-radio.stories.d.ts} +0 -0
  155. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -1
  156. package/dist/types/components/molecules/inputs/mg-input-select/{mg-input-select.stories.d.ts → doc/mg-input-select.stories.d.ts} +11 -5
  157. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +7 -2
  158. package/dist/types/components/molecules/inputs/mg-input-text/{mg-input-text.stories.d.ts → doc/mg-input-text.stories.d.ts} +8 -0
  159. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +7 -7
  160. package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +19 -0
  161. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +15 -7
  162. package/dist/types/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.d.ts → doc/mg-input-toggle.stories.d.ts} +0 -0
  163. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -0
  164. package/dist/types/components/molecules/mg-form/{mg-form.stories.d.ts → doc/mg-form.stories.d.ts} +0 -0
  165. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -0
  166. package/dist/types/components/molecules/mg-message/{mg-message.stories.d.ts → doc/mg-message.stories.d.ts} +0 -0
  167. package/dist/types/components/molecules/mg-message/mg-message.d.ts +2 -0
  168. package/dist/types/components/molecules/mg-modal/{mg-modal.stories.d.ts → doc/mg-modal.stories.d.ts} +0 -0
  169. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +2 -0
  170. package/dist/types/components/molecules/mg-pagination/{mg-pagination.stories.d.ts → doc/mg-pagination.stories.d.ts} +0 -0
  171. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +8 -0
  172. package/dist/types/components/molecules/{inputs/mg-input-textarea/mg-input-textarea.stories.d.ts → mg-panel/doc/mg-panel.stories.d.ts} +1 -1
  173. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +29 -0
  174. package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +25 -0
  175. package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +8 -0
  176. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +9 -1
  177. package/dist/types/components/molecules/mg-tabs/{mg-tabs.stories.d.ts → doc/mg-tabs.stories.d.ts} +5 -0
  178. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +7 -1
  179. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +49 -0
  180. package/dist/types/components.d.ts +181 -151
  181. package/dist/types/locales/index.d.ts +109 -46
  182. package/dist/types/stories/{buttons.stories.d.ts → helpers.stories.d.ts} +1 -1
  183. package/dist/types/utils/locale.utils.d.ts +7 -3
  184. package/loader/index.js +1 -1
  185. package/package.json +14 -14
  186. package/readme.md +6 -35
  187. package/dist/cjs/css-shim-629916b0.js +0 -6
  188. package/dist/cjs/shadow-css-546083ef.js +0 -390
  189. package/dist/collection/stories/buttons.stories.js +0 -43
  190. package/dist/collection/stories/messages.stories.js +0 -44
  191. package/dist/collection/stories/tags.stories.js +0 -13
  192. package/dist/esm/css-shim-0993aa3b.js +0 -4
  193. package/dist/esm/shadow-css-dfa0587f.js +0 -388
  194. package/dist/esm-es5/css-shim-0993aa3b.js +0 -1
  195. package/dist/esm-es5/index-9e877561.js +0 -1
  196. package/dist/esm-es5/index-c346f52d.js +0 -1
  197. package/dist/esm-es5/index.js +0 -0
  198. package/dist/esm-es5/loader.js +0 -1
  199. package/dist/esm-es5/mg-badge_21.entry.js +0 -2
  200. package/dist/esm-es5/mg-components.js +0 -1
  201. package/dist/esm-es5/mg-modal.entry.js +0 -1
  202. package/dist/esm-es5/mg-popover.entry.js +0 -1
  203. package/dist/esm-es5/popper-8874fd6c.js +0 -1
  204. package/dist/esm-es5/shadow-css-dfa0587f.js +0 -12
  205. package/dist/mg-components/mg-components.js +0 -132
  206. package/dist/mg-components/p-3633e9e1.system.entry.js +0 -2
  207. package/dist/mg-components/p-3c14153d.js +0 -1
  208. package/dist/mg-components/p-50ea2036.system.js +0 -1
  209. package/dist/mg-components/p-55a22b35.system.js +0 -1
  210. package/dist/mg-components/p-5e796581.js +0 -12
  211. package/dist/mg-components/p-656b5efb.system.js +0 -1
  212. package/dist/mg-components/p-68d6f104.js +0 -1
  213. package/dist/mg-components/p-6d49ed95.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-c46fbd54.entry.js +0 -1
  219. package/dist/mg-components/p-c90cc4bf.system.js +0 -1
  220. package/dist/mg-components/p-cd2a4acc.system.entry.js +0 -1
  221. package/dist/mg-components/p-de1164fa.system.entry.js +0 -1
  222. package/dist/mg-components/p-dfe25da3.entry.js +0 -1
  223. package/dist/mg-components/p-e4a502b5.system.js +0 -1
  224. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +0 -11
  225. package/dist/types/components/molecules/mg-panel/mg-panel.stories.d.ts +0 -6
  226. package/dist/types/components/molecules/mg-popover/mg-popover.stories.d.ts +0 -12
  227. package/dist/types/stories/messages.stories.d.ts +0 -13
  228. package/dist/types/stories/tags.stories.d.ts +0 -5
@@ -1,14 +1,21 @@
1
- import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { c as createID, C as ClassList, a as allItemsAreString } from './components.utils.js';
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
@@ -21,6 +28,13 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
28
  constructor() {
22
29
  super();
23
30
  this.__registerHost();
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';
24
38
  /**
25
39
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
26
40
  * If not set, it will be created.
@@ -43,6 +57,46 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
43
57
  * Component classes
44
58
  */
45
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;
46
100
  /**
47
101
  * Handle click events on tabs
48
102
  *
@@ -52,6 +106,14 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
52
106
  const tabId = event.currentTarget.getAttribute('data-index');
53
107
  this.activeTab = Number(tabId);
54
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}`;
55
117
  /**
56
118
  * Handle keyboard event on tabs
57
119
  *
@@ -62,16 +124,14 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
62
124
  let tabId = Number(event.target.getAttribute('data-index'));
63
125
  const parent = event.target.parentElement;
64
126
  // change selected id from key code
65
- // /* IE FIX */ delete 'Right'
66
- if (['ArrowRight', 'Right'].includes(event.key)) {
127
+ if (event.key === 'ArrowRight') {
67
128
  tabId++;
68
- // /* IE FIX */ delete 'Left'
69
129
  }
70
- else if (['ArrowLeft', 'Left'].includes(event.key)) {
130
+ else if (event.key === 'ArrowLeft') {
71
131
  tabId--;
72
132
  }
73
- // get selected tab
74
- 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()})`);
75
135
  // apply selected tab if exist
76
136
  if (selectedTab !== null) {
77
137
  selectedTab.focus();
@@ -97,7 +157,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
97
157
  validateItems(newValue) {
98
158
  // String array
99
159
  if (allItemsAreString(newValue)) {
100
- this.tabs = newValue.map(item => ({ label: item, disabled: false }));
160
+ this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
101
161
  }
102
162
  // Object array
103
163
  else if (newValue && newValue.every(item => isTabItem(item))) {
@@ -108,9 +168,12 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
108
168
  }
109
169
  }
110
170
  validateActiveTab(newValue) {
111
- if (Number(newValue) < 1 || Number(newValue) > this.tabs.length) {
171
+ if (newValue < 1 || newValue > this.tabs.length) {
112
172
  throw new Error('<mg-tabs> prop "activeTab" must be between 1 and tabs length.');
113
173
  }
174
+ else {
175
+ this.setActiveTab(newValue);
176
+ }
114
177
  }
115
178
  /*************
116
179
  * Lifecycle *
@@ -133,17 +196,12 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
133
196
  * @returns {HTMLElement} HTML Element
134
197
  */
135
198
  render() {
136
- 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) => {
137
- const tabIndex = index + 1;
138
- return (h("button", { role: "tab", id: `${this.identifier}-${tabIndex}`, class: {
139
- 'mg-tabs__navigation-button': true,
140
- 'mg-tabs__navigation-button--active': tabIndex === this.activeTab,
141
- 'mg-tabs__navigation-button--disabled': tab.disabled,
142
- }, 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 })));
143
- })), this.tabs.map((_tab, index) => {
144
- const tabIndex = index + 1;
145
- 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}` })));
146
- }))));
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) })))))));
147
205
  }
148
206
  get element() { return this; }
149
207
  static get watchers() { return {
@@ -152,7 +210,7 @@ const MgTabs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
152
210
  "activeTab": ["validateActiveTab"]
153
211
  }; }
154
212
  static get style() { return mgTabsCss; }
155
- }, [6, "mg-tabs", {
213
+ }, [4, "mg-tabs", {
156
214
  "identifier": [1],
157
215
  "label": [1],
158
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;
@@ -9,7 +9,6 @@ let checkSlotRelocate = false;
9
9
  let isSvgMode = false;
10
10
  let queuePending = false;
11
11
  const win = typeof window !== 'undefined' ? window : {};
12
- const CSS = win.CSS ;
13
12
  const doc = win.document || { head: {} };
14
13
  const plt = {
15
14
  $flags$: 0,
@@ -20,13 +19,11 @@ const plt = {
20
19
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
21
20
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
22
21
  };
23
- const supportsShadow = /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
24
- ;
25
22
  const promiseResolve = (v) => Promise.resolve(v);
26
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
23
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
27
24
  try {
28
25
  new CSSStyleSheet();
29
- return typeof new CSSStyleSheet().replace === 'function';
26
+ return typeof new CSSStyleSheet().replaceSync === 'function';
30
27
  }
31
28
  catch (e) { }
32
29
  return false;
@@ -84,9 +81,14 @@ const uniqueTime = (key, measureText) => {
84
81
  const rootAppliedStyles = new WeakMap();
85
82
  const registerStyle = (scopeId, cssText, allowCS) => {
86
83
  let style = styles.get(scopeId);
87
- if (supportsConstructibleStylesheets && allowCS) {
84
+ if (supportsConstructableStylesheets && allowCS) {
88
85
  style = (style || new CSSStyleSheet());
89
- style.replace(cssText);
86
+ if (typeof style === 'string') {
87
+ style = cssText;
88
+ }
89
+ else {
90
+ style.replaceSync(cssText);
91
+ }
90
92
  }
91
93
  else {
92
94
  style = cssText;
@@ -95,7 +97,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
95
97
  };
96
98
  const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
97
99
  let scopeId = getScopeId(cmpMeta);
98
- let style = styles.get(scopeId);
100
+ const style = styles.get(scopeId);
99
101
  // if an element is NOT connected then getRootNode() will return the wrong root node
100
102
  // so the fallback is to always use the document for the root node in those cases
101
103
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
@@ -109,18 +111,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
109
111
  }
110
112
  if (!appliedStyles.has(scopeId)) {
111
113
  {
112
- if (plt.$cssShim$) {
113
- styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */));
114
- const newScopeId = styleElm['s-sc'];
115
- if (newScopeId) {
116
- scopeId = newScopeId;
117
- // we don't want to add this styleID to the appliedStyles Set
118
- // since the cssVarShim might need to apply several different
119
- // stylesheets for the same component
120
- appliedStyles = null;
121
- }
122
- }
123
- else {
114
+ {
124
115
  styleElm = doc.createElement('style');
125
116
  styleElm.innerHTML = style;
126
117
  }
@@ -142,7 +133,7 @@ const attachStyles = (hostRef) => {
142
133
  const elm = hostRef.$hostElement$;
143
134
  const flags = cmpMeta.$flags$;
144
135
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
145
- const scopeId = addStyle(supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
136
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
146
137
  if (flags & 10 /* needsScopedEncapsulation */) {
147
138
  // only required when we're NOT using native shadow dom (slot)
148
139
  // or this browser doesn't support native shadow dom
@@ -195,7 +186,7 @@ const h = (nodeName, vnodeData, ...children) => {
195
186
  let slotName = null;
196
187
  let simple = false;
197
188
  let lastSimple = false;
198
- let vNodeChildren = [];
189
+ const vNodeChildren = [];
199
190
  const walk = (c) => {
200
191
  for (let i = 0; i < c.length; i++) {
201
192
  child = c[i];
@@ -316,6 +307,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
316
307
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
317
308
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
318
309
  }
310
+ else if (memberName === 'style') {
311
+ // update style attribute, css properties and values
312
+ {
313
+ for (const prop in oldValue) {
314
+ if (!newValue || newValue[prop] == null) {
315
+ if (prop.includes('-')) {
316
+ elm.style.removeProperty(prop);
317
+ }
318
+ else {
319
+ elm.style[prop] = '';
320
+ }
321
+ }
322
+ }
323
+ }
324
+ for (const prop in newValue) {
325
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
326
+ if (prop.includes('-')) {
327
+ elm.style.setProperty(prop, newValue[prop]);
328
+ }
329
+ else {
330
+ elm.style[prop] = newValue[prop];
331
+ }
332
+ }
333
+ }
334
+ }
319
335
  else if (memberName === 'ref') {
320
336
  // minifier will clean this up
321
337
  if (newValue) {
@@ -367,7 +383,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
367
383
  if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
368
384
  try {
369
385
  if (!elm.tagName.includes('-')) {
370
- let n = newValue == null ? '' : newValue;
386
+ const n = newValue == null ? '' : newValue;
371
387
  // Workaround for Safari, moving the <input> caret when re-assigning the same valued
372
388
  if (memberName === 'list') {
373
389
  isProp = false;
@@ -424,7 +440,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
424
440
  };
425
441
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
426
442
  // tslint:disable-next-line: prefer-const
427
- let newVNode = newParentVNode.$children$[childIndex];
443
+ const newVNode = newParentVNode.$children$[childIndex];
428
444
  let i = 0;
429
445
  let elm;
430
446
  let childNode;
@@ -730,7 +746,7 @@ const patch = (oldVNode, newVNode) => {
730
746
  };
731
747
  const updateFallbackSlotVisibility = (elm) => {
732
748
  // tslint:disable-next-line: prefer-const
733
- let childNodes = elm.childNodes;
749
+ const childNodes = elm.childNodes;
734
750
  let childNode;
735
751
  let i;
736
752
  let ilen;
@@ -783,8 +799,8 @@ const relocateSlotContent = (elm) => {
783
799
  let relocateNodeData;
784
800
  let j;
785
801
  let i = 0;
786
- let childNodes = elm.childNodes;
787
- let ilen = childNodes.length;
802
+ const childNodes = elm.childNodes;
803
+ const ilen = childNodes.length;
788
804
  for (; i < ilen; i++) {
789
805
  childNode = childNodes[i];
790
806
  if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
@@ -884,7 +900,7 @@ const renderVdom = (hostRef, renderFnResults) => {
884
900
  }
885
901
  {
886
902
  contentRef = hostElm['s-cr'];
887
- useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
903
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
888
904
  // always reset
889
905
  checkSlotFallbackVisibility = false;
890
906
  }
@@ -1045,9 +1061,6 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1045
1061
  {
1046
1062
  callRender(hostRef, instance);
1047
1063
  }
1048
- if (plt.$cssShim$) {
1049
- plt.$cssShim$.updateHost(elm);
1050
- }
1051
1064
  if (rc) {
1052
1065
  // ok, so turns out there are some child host elements
1053
1066
  // waiting on this parent element to load
@@ -1419,9 +1432,6 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1419
1432
  const scopeId = getScopeId(cmpMeta);
1420
1433
  if (!styles.has(scopeId)) {
1421
1434
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1422
- if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
1423
- style = await import('./shadow-css-dfa0587f.js').then((m) => m.scopeCss(style, scopeId, false));
1424
- }
1425
1435
  registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1426
1436
  endRegisterStyles();
1427
1437
  }
@@ -1519,10 +1529,6 @@ const disconnectedCallback = (elm) => {
1519
1529
  hostRef.$rmListeners$ = undefined;
1520
1530
  }
1521
1531
  }
1522
- // clear CSS var-shim tracking
1523
- if (plt.$cssShim$) {
1524
- plt.$cssShim$.removeHost(elm);
1525
- }
1526
1532
  }
1527
1533
  };
1528
1534
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -1558,9 +1564,6 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1558
1564
  {
1559
1565
  cmpMeta.$watchers$ = {};
1560
1566
  }
1561
- if (!supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1562
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
1563
- }
1564
1567
  const tagName = cmpMeta.$tagName$;
1565
1568
  const HostElement = class extends HTMLElement {
1566
1569
  // StencilLazyHost
@@ -1574,14 +1577,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1574
1577
  // and this browser supports shadow dom
1575
1578
  // add the read-only property "shadowRoot" to the host element
1576
1579
  // adding the shadow root build conditionals to minimize runtime
1577
- if (supportsShadow) {
1580
+ {
1578
1581
  {
1579
1582
  self.attachShadow({ mode: 'open' });
1580
1583
  }
1581
1584
  }
1582
- else if (!('shadowRoot' in self)) {
1583
- self.shadowRoot = self;
1584
- }
1585
1585
  }
1586
1586
  }
1587
1587
  connectedCallback() {
@@ -1661,7 +1661,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1661
1661
  if (module) {
1662
1662
  return module[exportName];
1663
1663
  }
1664
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1664
1665
  return import(
1666
+ /* @vite-ignore */
1665
1667
  /* webpackInclude: /\.entry\.js$/ */
1666
1668
  /* webpackExclude: /\.system\.entry\.js$/ */
1667
1669
  /* webpackMode: "lazy" */
@@ -1716,4 +1718,4 @@ const flush = () => {
1716
1718
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1717
1719
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1718
1720
 
1719
- export { CSS as C, Host as H, promiseResolve as a, bootstrapLazy as b, createEvent as c, getElement as g, h, plt as p, registerInstance as r, win as w };
1721
+ export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
@@ -73,13 +73,73 @@ function allItemsAreString(items) {
73
73
  return items && items.every(item => typeof item === 'string');
74
74
  }
75
75
 
76
+ const errors$1 = {
77
+ required: "This field is required.",
78
+ date: {
79
+ badInput: "The date format must be <span aria-hidden=\"true\">mm/dd/yyyy</span><span class=\"sr-only\">m m / d d / y y y y</span> and the date must be greater than {min}",
80
+ min: "The date cannot be earlier than {min}",
81
+ max: "The date cannot be later than {max}",
82
+ minMax: "The date must be between {min} and {max}"
83
+ },
84
+ numeric: {
85
+ min: "The value cannot be less than {min}",
86
+ max: "The value cannot be greater than {max}",
87
+ minMax: "The value must be between {min} et {max}"
88
+ }
89
+ };
90
+ const nbCharLeft$1 = "{counter} characters left.";
91
+ const input$1 = {
92
+ select: {
93
+ placeholder: "Select a value"
94
+ }
95
+ };
96
+ const form$1 = {
97
+ required: "Fields with a <strong class=\"is-asterisk\">*</strong> are required",
98
+ allRequired: "All fields are required"
99
+ };
100
+ const message$1 = {
101
+ closeButton: "Close message"
102
+ };
103
+ const modal$1 = {
104
+ closeButton: "Close modal"
105
+ };
106
+ const pagination$1 = {
107
+ label: "Pagination",
108
+ page: "page",
109
+ pages: "pages",
110
+ nextPage: "Next page",
111
+ previousPage: "Previous page",
112
+ selectPage: "Select the page to display."
113
+ };
114
+ const panel$1 = {
115
+ editLabel: "Edit section title."
116
+ };
117
+ const general$1 = {
118
+ confirm: "Confirm",
119
+ cancel: "Cancel",
120
+ close: "Close",
121
+ next: "next",
122
+ previous: "previous"
123
+ };
124
+ const en = {
125
+ errors: errors$1,
126
+ nbCharLeft: nbCharLeft$1,
127
+ input: input$1,
128
+ form: form$1,
129
+ message: message$1,
130
+ modal: modal$1,
131
+ pagination: pagination$1,
132
+ panel: panel$1,
133
+ general: general$1
134
+ };
135
+
76
136
  const errors = {
77
137
  required: "Ce champ est obligatoire.",
78
138
  date: {
79
139
  badInput: "Le format de la date doit être du type <span aria-hidden=\"true\">jj/mm/aaaa</span><span class=\"sr-only\">j j / m m / a a a a</span> et la date supérieure au {min}",
80
140
  min: "La date ne peut pas être antérieure au {min}",
81
141
  max: "La date ne peut pas être postérieure au {max}",
82
- minMax: "La date doit être comprise entre {min} et {max}"
142
+ minMax: "La date doit être comprise entre le {min} et le {max}"
83
143
  },
84
144
  numeric: {
85
145
  min: "La valeur ne peut pas être inférieure à {min}",
@@ -101,9 +161,10 @@ const message = {
101
161
  closeButton: "Fermer le message"
102
162
  };
103
163
  const modal = {
104
- closeButton: "Fermer la modal"
164
+ closeButton: "Fermer la modale"
105
165
  };
106
166
  const pagination = {
167
+ label: "Pagination",
107
168
  page: "page",
108
169
  pages: "pages",
109
170
  nextPage: "Page suivante",
@@ -111,10 +172,10 @@ const pagination = {
111
172
  selectPage: "Sélectionner la page à afficher."
112
173
  };
113
174
  const panel = {
114
- editLabel: "Modifer le titre de la section."
175
+ editLabel: "Modifier le titre de la section."
115
176
  };
116
177
  const general = {
117
- validate: "Valider",
178
+ confirm: "Valider",
118
179
  cancel: "Annuler",
119
180
  close: "Fermer",
120
181
  next: "suivant",
@@ -132,8 +193,36 @@ const fr = {
132
193
  general: general
133
194
  };
134
195
 
135
- const locale = 'fr-FR';
136
- const messages = fr;
137
- const currency = 'EUR';
196
+ const defaultLocale = 'en';
197
+ const messages = { en, fr };
198
+ /**
199
+ * Get locale
200
+ *
201
+ * @param {HTMLElement} element element that needs to know the locale to use
202
+ * @returns {string} locale
203
+ */
204
+ const getLocale = (element) => {
205
+ var _a;
206
+ return ((_a = element.closest('[lang]')) === null || _a === void 0 ? void 0 : _a.lang) || navigator.language || defaultLocale;
207
+ };
208
+ /**
209
+ * Get Intl object
210
+ * We load the defined locale but for now we only support the first subtag for messages
211
+ *
212
+ * @param {HTMLElement} element element we need to get the language
213
+ * @returns {{ locale: string; messages: unknown }} messages object
214
+ */
215
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
216
+ const initLocales = (element) => {
217
+ // Get local
218
+ const locale = getLocale(element);
219
+ // Only keep first subtag
220
+ const localeSubtag = locale.split('-').shift();
221
+ // Return
222
+ return {
223
+ locale,
224
+ messages: messages[localeSubtag] || messages[defaultLocale],
225
+ };
226
+ };
138
227
 
139
- export { ClassList as C, currency as a, allItemsAreString as b, createID as c, locale as l, messages as m };
228
+ export { ClassList as C, allItemsAreString as a, createID as c, initLocales as i };