@mgdis/mg-components 6.8.0 → 6.10.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 (372) hide show
  1. package/README.md +17 -78
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  3. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  4. package/dist/cjs/events.utils-D5SAtkpQ.js +28 -0
  5. package/dist/cjs/events.utils-D5SAtkpQ.js.map +1 -0
  6. package/dist/cjs/{index-1a5a1081.js → index-CATFkm3O.js} +248 -196
  7. package/dist/cjs/index-CATFkm3O.js.map +1 -0
  8. package/dist/cjs/{index-234e834a.js → index-CfIlskRh.js} +34 -11
  9. package/dist/cjs/index-CfIlskRh.js.map +1 -0
  10. package/dist/cjs/index.cjs.js +1 -0
  11. package/dist/cjs/index.cjs.js.map +1 -1
  12. package/dist/cjs/index.es-BCLy9yYb.js +250 -0
  13. package/dist/cjs/index.es-BCLy9yYb.js.map +1 -0
  14. package/dist/cjs/loader.cjs.js +4 -5
  15. package/dist/cjs/loader.cjs.js.map +1 -1
  16. package/dist/cjs/mg-action-more_37.cjs.entry.js +573 -934
  17. package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -1
  18. package/dist/cjs/mg-alert.cjs.entry.js +21 -15
  19. package/dist/cjs/mg-alert.cjs.entry.js.map +1 -1
  20. package/dist/cjs/mg-alert.entry.cjs.js.map +1 -0
  21. package/dist/cjs/mg-components.cjs.js +8 -7
  22. package/dist/cjs/mg-components.cjs.js.map +1 -1
  23. package/dist/cjs/mg-input-combobox.cjs.entry.js +774 -0
  24. package/dist/cjs/mg-input-combobox.cjs.entry.js.map +1 -0
  25. package/dist/cjs/mg-input-combobox.entry.cjs.js.map +1 -0
  26. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +21526 -6868
  27. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js.map +1 -1
  28. package/dist/cjs/mg-input-rich-text-editor.entry.cjs.js.map +1 -0
  29. package/dist/cjs/{mg-input.conf-5bbcea79.js → mg-input.conf-WTsvDfpC.js} +2 -1
  30. package/dist/cjs/mg-input.conf-WTsvDfpC.js.map +1 -0
  31. package/dist/cjs/mg-loader.cjs.entry.js +12 -10
  32. package/dist/cjs/mg-loader.cjs.entry.js.map +1 -1
  33. package/dist/cjs/mg-loader.entry.cjs.js.map +1 -0
  34. package/dist/cjs/mg-progress.cjs.entry.js +14 -16
  35. package/dist/cjs/mg-progress.cjs.entry.js.map +1 -1
  36. package/dist/cjs/mg-progress.entry.cjs.js.map +1 -0
  37. package/dist/collection/collection-manifest.json +4 -3
  38. package/dist/collection/components/atoms/mg-badge/mg-badge.js +9 -4
  39. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  40. package/dist/collection/components/atoms/mg-button/mg-button.js +7 -6
  41. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  42. package/dist/collection/components/atoms/mg-tag/mg-tag.js +17 -7
  43. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  44. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +47 -58
  45. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  46. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +12 -8
  47. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +1 -1
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +19 -6
  49. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  50. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +16 -5
  51. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  52. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js +2 -0
  53. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js.map +1 -0
  54. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +1443 -0
  55. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +1 -0
  56. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +8 -3
  57. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  58. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +9 -4
  59. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  60. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +12 -7
  61. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  62. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
  63. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +1 -0
  64. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +46 -41
  65. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js.map +1 -1
  66. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +8 -3
  67. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  68. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +49 -44
  69. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  70. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +28 -23
  71. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  72. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +8 -3
  73. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  74. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.conf.js.map +1 -1
  75. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +2 -2
  76. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -1
  77. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js.map +1 -0
  78. package/dist/collection/components/molecules/{menu → menus}/mg-menu/mg-menu.js +10 -10
  79. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js.map +1 -0
  80. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.conf.js.map +1 -0
  81. package/dist/collection/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.js +9 -9
  82. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js.map +1 -0
  83. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  84. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -6
  85. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  86. package/dist/collection/components/molecules/mg-alert/mg-alert.js +13 -3
  87. package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +1 -1
  88. package/dist/collection/components/molecules/mg-details/mg-details.js +3 -2
  89. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-form/mg-form.js +8 -3
  91. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  92. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  93. package/dist/collection/components/molecules/mg-loader/mg-loader.js +10 -3
  94. package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -1
  95. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  96. package/dist/collection/components/molecules/mg-modal/mg-modal.js +4 -4
  97. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  98. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +17 -7
  99. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  100. package/dist/collection/components/molecules/mg-panel/mg-panel.js +12 -7
  101. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  102. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  103. package/dist/collection/components/molecules/mg-popover/mg-popover.js +56 -81
  104. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  105. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  106. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  107. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +6 -5
  108. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  109. package/dist/collection/locales/en/messages.json +14 -3
  110. package/dist/collection/locales/fr/messages.json +14 -3
  111. package/dist/collection/utils/behaviors.utils.js +3 -3
  112. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  113. package/dist/collection/utils/events.utils.js +22 -0
  114. package/dist/collection/utils/events.utils.js.map +1 -0
  115. package/dist/collection/utils/floating-ui.utils.js +46 -2
  116. package/dist/collection/utils/floating-ui.utils.js.map +1 -1
  117. package/dist/collection/utils/playwright.fixture.js +2 -3
  118. package/dist/collection/utils/playwright.fixture.js.map +1 -1
  119. package/dist/components/events.utils.js +26 -0
  120. package/dist/components/events.utils.js.map +1 -0
  121. package/dist/components/floating-ui.utils.js +48 -423
  122. package/dist/components/floating-ui.utils.js.map +1 -1
  123. package/dist/components/index.es.js +161 -67
  124. package/dist/components/index.es.js.map +1 -1
  125. package/dist/components/index.js +1 -0
  126. package/dist/components/index2.js +33 -10
  127. package/dist/components/index2.js.map +1 -1
  128. package/dist/components/mg-action-more.js +15 -11
  129. package/dist/components/mg-action-more.js.map +1 -1
  130. package/dist/components/mg-alert.js +16 -8
  131. package/dist/components/mg-alert.js.map +1 -1
  132. package/dist/components/mg-badge.js +1 -0
  133. package/dist/components/mg-badge2.js +14 -10
  134. package/dist/components/mg-badge2.js.map +1 -1
  135. package/dist/components/mg-button.js +1 -0
  136. package/dist/components/mg-button2.js +13 -12
  137. package/dist/components/mg-button2.js.map +1 -1
  138. package/dist/components/mg-card.js +1 -0
  139. package/dist/components/mg-card2.js +2 -2
  140. package/dist/components/mg-card2.js.map +1 -1
  141. package/dist/components/mg-character-left.js +1 -0
  142. package/dist/components/mg-character-left2.js +6 -6
  143. package/dist/components/mg-character-left2.js.map +1 -1
  144. package/dist/components/mg-details.js +8 -7
  145. package/dist/components/mg-details.js.map +1 -1
  146. package/dist/components/mg-divider.js +1 -0
  147. package/dist/components/mg-divider2.js +2 -2
  148. package/dist/components/mg-divider2.js.map +1 -1
  149. package/dist/components/mg-form.js +14 -10
  150. package/dist/components/mg-form.js.map +1 -1
  151. package/dist/components/mg-icon.js +1 -0
  152. package/dist/components/mg-icon2.js +8 -8
  153. package/dist/components/mg-icon2.js.map +1 -1
  154. package/dist/components/mg-illustrated-message.js +8 -8
  155. package/dist/components/mg-illustrated-message.js.map +1 -1
  156. package/dist/components/mg-input-checkbox-paginated.js +2 -1
  157. package/dist/components/mg-input-checkbox-paginated2.js +15 -3
  158. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  159. package/dist/components/mg-input-checkbox.js +23 -14
  160. package/dist/components/mg-input-checkbox.js.map +1 -1
  161. package/dist/components/mg-input-combobox.d.ts +11 -0
  162. package/dist/components/mg-input-combobox.js +897 -0
  163. package/dist/components/mg-input-combobox.js.map +1 -0
  164. package/dist/components/mg-input-date.js +25 -21
  165. package/dist/components/mg-input-date.js.map +1 -1
  166. package/dist/components/mg-input-numeric.js +23 -19
  167. package/dist/components/mg-input-numeric.js.map +1 -1
  168. package/dist/components/mg-input-password.js +13 -9
  169. package/dist/components/mg-input-password.js.map +1 -1
  170. package/dist/components/mg-input-radio.js +11 -11
  171. package/dist/components/mg-input-radio.js.map +1 -1
  172. package/dist/components/mg-input-rich-text-editor.js +21527 -6867
  173. package/dist/components/mg-input-rich-text-editor.js.map +1 -1
  174. package/dist/components/mg-input-select.js +1 -0
  175. package/dist/components/mg-input-select2.js +16 -12
  176. package/dist/components/mg-input-select2.js.map +1 -1
  177. package/dist/components/mg-input-text.js +1 -0
  178. package/dist/components/mg-input-text2.js +24 -20
  179. package/dist/components/mg-input-text2.js.map +1 -1
  180. package/dist/components/mg-input-textarea.js +17 -13
  181. package/dist/components/mg-input-textarea.js.map +1 -1
  182. package/dist/components/mg-input-title.js +1 -0
  183. package/dist/components/mg-input-title2.js +6 -6
  184. package/dist/components/mg-input-title2.js.map +1 -1
  185. package/dist/components/mg-input-toggle.js +14 -10
  186. package/dist/components/mg-input-toggle.js.map +1 -1
  187. package/dist/components/mg-input.js +1 -0
  188. package/dist/components/mg-input2.js +20 -14
  189. package/dist/components/mg-input2.js.map +1 -1
  190. package/dist/components/mg-item-more.js +2 -1
  191. package/dist/components/mg-item-more2.js +22 -23
  192. package/dist/components/mg-item-more2.js.map +1 -1
  193. package/dist/components/mg-loader.js +2 -67
  194. package/dist/components/mg-loader.js.map +1 -1
  195. package/dist/components/mg-loader2.js +75 -0
  196. package/dist/components/mg-loader2.js.map +1 -0
  197. package/dist/components/mg-menu-item.js +1 -0
  198. package/dist/components/mg-menu-item2.js +18 -18
  199. package/dist/components/mg-menu-item2.js.map +1 -1
  200. package/dist/components/mg-menu.js +2 -1
  201. package/dist/components/mg-message.js +1 -0
  202. package/dist/components/mg-message2.js +8 -8
  203. package/dist/components/mg-message2.js.map +1 -1
  204. package/dist/components/mg-modal.js +13 -13
  205. package/dist/components/mg-modal.js.map +1 -1
  206. package/dist/components/mg-pagination.js +1 -0
  207. package/dist/components/mg-pagination2.js +19 -11
  208. package/dist/components/mg-pagination2.js.map +1 -1
  209. package/dist/components/mg-panel.js +18 -14
  210. package/dist/components/mg-panel.js.map +1 -1
  211. package/dist/components/mg-popover-content.js +1 -0
  212. package/dist/components/mg-popover-content2.js +7 -7
  213. package/dist/components/mg-popover-content2.js.map +1 -1
  214. package/dist/components/mg-popover.js +1 -0
  215. package/dist/components/mg-popover2.js +62 -88
  216. package/dist/components/mg-popover2.js.map +1 -1
  217. package/dist/components/mg-progress.js +13 -13
  218. package/dist/components/mg-progress.js.map +1 -1
  219. package/dist/components/mg-skip-links.js +5 -5
  220. package/dist/components/mg-skip-links.js.map +1 -1
  221. package/dist/components/mg-table.js +8 -8
  222. package/dist/components/mg-table.js.map +1 -1
  223. package/dist/components/mg-tabs.js +20 -19
  224. package/dist/components/mg-tabs.js.map +1 -1
  225. package/dist/components/mg-tag.js +16 -8
  226. package/dist/components/mg-tag.js.map +1 -1
  227. package/dist/components/mg-tooltip-content.js +1 -0
  228. package/dist/components/mg-tooltip-content2.js +3 -3
  229. package/dist/components/mg-tooltip-content2.js.map +1 -1
  230. package/dist/components/mg-tooltip.js +1 -0
  231. package/dist/components/mg-tooltip2.js +58 -68
  232. package/dist/components/mg-tooltip2.js.map +1 -1
  233. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  234. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  235. package/dist/esm/events.utils-yMGqY8YG.js +26 -0
  236. package/dist/esm/events.utils-yMGqY8YG.js.map +1 -0
  237. package/dist/esm/{index-5059254f.js → index-CAuxALt5.js} +246 -174
  238. package/dist/esm/index-CAuxALt5.js.map +1 -0
  239. package/dist/esm/{index-544778a7.js → index-DmsGewMC.js} +34 -11
  240. package/dist/esm/index-DmsGewMC.js.map +1 -0
  241. package/dist/esm/index.es-rLV3KFPd.js +223 -0
  242. package/dist/esm/index.es-rLV3KFPd.js.map +1 -0
  243. package/dist/esm/index.js +1 -0
  244. package/dist/esm/index.js.map +1 -1
  245. package/dist/esm/loader.js +5 -4
  246. package/dist/esm/loader.js.map +1 -1
  247. package/dist/esm/mg-action-more_37.entry.js +573 -932
  248. package/dist/esm/mg-action-more_37.entry.js.map +1 -1
  249. package/dist/esm/mg-alert.entry.js +21 -13
  250. package/dist/esm/mg-alert.entry.js.map +1 -1
  251. package/dist/esm/mg-components.js +7 -5
  252. package/dist/esm/mg-components.js.map +1 -1
  253. package/dist/esm/mg-input-combobox.entry.js +772 -0
  254. package/dist/esm/mg-input-combobox.entry.js.map +1 -0
  255. package/dist/esm/mg-input-rich-text-editor.entry.js +21529 -6869
  256. package/dist/esm/mg-input-rich-text-editor.entry.js.map +1 -1
  257. package/dist/esm/{mg-input.conf-712c7bb6.js → mg-input.conf-CNgv8hc5.js} +3 -2
  258. package/dist/esm/mg-input.conf-CNgv8hc5.js.map +1 -0
  259. package/dist/esm/mg-loader.entry.js +12 -8
  260. package/dist/esm/mg-loader.entry.js.map +1 -1
  261. package/dist/esm/mg-progress.entry.js +14 -14
  262. package/dist/esm/mg-progress.entry.js.map +1 -1
  263. package/dist/mg-components/index.esm.js.map +1 -1
  264. package/dist/mg-components/loader.esm.js.map +1 -0
  265. package/dist/mg-components/locales/en/messages.json +14 -3
  266. package/dist/mg-components/locales/fr/messages.json +14 -3
  267. package/dist/mg-components/mg-alert.entry.esm.js.map +1 -0
  268. package/dist/mg-components/mg-components.esm.js +1 -1
  269. package/dist/mg-components/mg-components.esm.js.map +1 -1
  270. package/dist/mg-components/mg-input-combobox.entry.esm.js.map +1 -0
  271. package/dist/mg-components/mg-input-rich-text-editor.entry.esm.js.map +1 -0
  272. package/dist/mg-components/mg-loader.entry.esm.js.map +1 -0
  273. package/dist/mg-components/mg-progress.entry.esm.js.map +1 -0
  274. package/dist/mg-components/p-0f761c6c.entry.js +2 -0
  275. package/dist/mg-components/p-0f761c6c.entry.js.map +1 -0
  276. package/dist/mg-components/p-73099ed7.entry.js +11 -0
  277. package/dist/mg-components/p-73099ed7.entry.js.map +1 -0
  278. package/dist/mg-components/p-88f77de2.entry.js +2 -0
  279. package/dist/mg-components/p-88f77de2.entry.js.map +1 -0
  280. package/dist/mg-components/p-CAuxALt5.js +3 -0
  281. package/dist/mg-components/p-CAuxALt5.js.map +1 -0
  282. package/dist/mg-components/p-CNgv8hc5.js +2 -0
  283. package/dist/mg-components/p-CNgv8hc5.js.map +1 -0
  284. package/dist/mg-components/p-DK9teKTo.js +2 -0
  285. package/dist/mg-components/p-DK9teKTo.js.map +1 -0
  286. package/dist/mg-components/p-DQuL1Twl.js +2 -0
  287. package/dist/mg-components/p-DQuL1Twl.js.map +1 -0
  288. package/dist/mg-components/p-ad66e7b3.entry.js +2 -0
  289. package/dist/mg-components/p-ad66e7b3.entry.js.map +1 -0
  290. package/dist/mg-components/p-cdbe689e.entry.js +2 -0
  291. package/dist/mg-components/p-cdbe689e.entry.js.map +1 -0
  292. package/dist/mg-components/p-d3a868f0.entry.js +2 -0
  293. package/dist/mg-components/p-d3a868f0.entry.js.map +1 -0
  294. package/dist/mg-components/p-rLV3KFPd.js +2 -0
  295. package/dist/mg-components/p-rLV3KFPd.js.map +1 -0
  296. package/dist/mg-components/p-yMGqY8YG.js +2 -0
  297. package/dist/mg-components/p-yMGqY8YG.js.map +1 -0
  298. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +2 -2
  299. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +6 -6
  300. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +1 -4
  301. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +2 -2
  302. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +2 -2
  303. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.d.ts +24 -0
  304. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +340 -0
  305. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -1
  306. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +1 -1
  307. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +2 -2
  308. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +9 -9
  309. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
  310. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +8 -8
  311. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +5 -5
  312. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +1 -1
  313. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +1 -1
  314. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +1 -1
  315. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +1 -1
  316. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
  317. package/dist/types/components/molecules/mg-loader/mg-loader.d.ts +1 -1
  318. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +2 -2
  319. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
  320. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +6 -9
  321. package/dist/types/components.d.ts +274 -29
  322. package/dist/types/stencil-public-runtime.d.ts +1 -0
  323. package/dist/types/utils/events.utils.d.ts +4 -0
  324. package/dist/types/utils/floating-ui.utils.d.ts +9 -1
  325. package/ide/intellij/web-types.json +488 -45
  326. package/ide/vscode/html-custom-data.json +358 -26
  327. package/package.json +26 -26
  328. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  329. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  330. package/dist/cjs/index-1a5a1081.js.map +0 -1
  331. package/dist/cjs/index-234e834a.js.map +0 -1
  332. package/dist/cjs/index.es-b90f74d4.js +0 -151
  333. package/dist/cjs/index.es-b90f74d4.js.map +0 -1
  334. package/dist/cjs/mg-input.conf-5bbcea79.js.map +0 -1
  335. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +0 -1
  336. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +0 -1
  337. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +0 -1
  338. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +0 -1
  339. package/dist/esm/app-globals-0f993ce5.js +0 -5
  340. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  341. package/dist/esm/index-5059254f.js.map +0 -1
  342. package/dist/esm/index-544778a7.js.map +0 -1
  343. package/dist/esm/index.es-517b1bf2.js +0 -129
  344. package/dist/esm/index.es-517b1bf2.js.map +0 -1
  345. package/dist/esm/mg-input.conf-712c7bb6.js.map +0 -1
  346. package/dist/mg-components/p-12a1edee.js +0 -2
  347. package/dist/mg-components/p-12a1edee.js.map +0 -1
  348. package/dist/mg-components/p-2884f369.js +0 -2
  349. package/dist/mg-components/p-2884f369.js.map +0 -1
  350. package/dist/mg-components/p-9bc53279.js +0 -2
  351. package/dist/mg-components/p-9bc53279.js.map +0 -1
  352. package/dist/mg-components/p-ad98f3d8.entry.js +0 -2
  353. package/dist/mg-components/p-ad98f3d8.entry.js.map +0 -1
  354. package/dist/mg-components/p-c10433db.entry.js +0 -2
  355. package/dist/mg-components/p-c10433db.entry.js.map +0 -1
  356. package/dist/mg-components/p-c67e4934.entry.js +0 -2
  357. package/dist/mg-components/p-c67e4934.entry.js.map +0 -1
  358. package/dist/mg-components/p-e1255160.js +0 -2
  359. package/dist/mg-components/p-e1255160.js.map +0 -1
  360. package/dist/mg-components/p-e39791fa.js +0 -3
  361. package/dist/mg-components/p-e39791fa.js.map +0 -1
  362. package/dist/mg-components/p-f72efb64.entry.js +0 -2
  363. package/dist/mg-components/p-f72efb64.entry.js.map +0 -1
  364. package/dist/mg-components/p-fd4a7980.entry.js +0 -2
  365. package/dist/mg-components/p-fd4a7980.entry.js.map +0 -1
  366. package/loader/package.json +0 -11
  367. /package/dist/collection/components/molecules/{menu → menus}/mg-menu/mg-menu.conf.js +0 -0
  368. /package/dist/collection/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.conf.js +0 -0
  369. /package/dist/types/components/molecules/{menu → menus}/mg-menu/mg-menu.conf.d.ts +0 -0
  370. /package/dist/types/components/molecules/{menu → menus}/mg-menu/mg-menu.d.ts +0 -0
  371. /package/dist/types/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.conf.d.ts +0 -0
  372. /package/dist/types/components/molecules/{menu → menus}/mg-menu-item/mg-menu-item.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { Z as Ze, V as Ve, m as me } from './index.es.js';
2
+ import { Z as Zt, G as Gt, D as De } from './index.es.js';
3
3
 
4
4
  /**
5
5
  * List of all possibles variants
@@ -7,7 +7,6 @@ import { Z as Ze, V as Ve, m as me } from './index.es.js';
7
7
  const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'];
8
8
 
9
9
  const mgTagCss = "/*!\n * @prop --mg-c-tag-height: Defines the height of the tag. Default value is `--mg-b-size-24`.\n * @prop --mg-c-tag-border-radius: Defines the border radius of the tag. Default value is `--mg-b-size-radius`.\n * @prop --mg-c-tag-font-size: Defines the font size of the tag. Default value is `--mg-b-font-size-small`.\n */:host{display:inline-block}.mg-c-tag{display:inline-flex;min-height:var(--mg-c-tag-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-c-tag-height) - 2*var(--mg-b-size-border) - var(--mg-c-tag-font-size)*var(--mg-b-line-height))/2) calc(var(--mg-b-size-8) - var(--mg-b-size-border));border:var(--mg-b-size-border) solid;border-radius:var(--mg-c-tag-border-radius);font-size:var(--mg-c-tag-font-size);font-weight:600;text-align:center;vertical-align:middle}.mg-c-tag.mg-c-tag--primary{border-color:var(--mg-b-color-neutral-110);background-color:var(--mg-b-color-neutral-110);color:var(--mg-b-color-text-on-primary)}.mg-c-tag.mg-c-tag--primary.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-neutral-110)}.mg-c-tag.mg-c-tag--primary.mg-c-tag--soft{border-color:var(--mg-b-color-neutral-20);background-color:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--primary.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-neutral-110)}.mg-c-tag.mg-c-tag--secondary{border-color:var(--mg-b-color-neutral-10);background-color:var(--mg-b-color-neutral-10);color:var(--mg-b-color-text-on-secondary)}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-neutral-10)}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--soft{border-color:var(--mg-b-color-neutral-20);background-color:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-text-on-secondary)}.mg-c-tag.mg-c-tag--danger{border-color:var(--mg-b-color-danger);background-color:var(--mg-b-color-danger);color:var(--mg-b-color-text-on-danger)}.mg-c-tag.mg-c-tag--danger.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-danger)}.mg-c-tag.mg-c-tag--danger.mg-c-tag--soft{border-color:var(--mg-b-color-red-20);background-color:var(--mg-b-color-red-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--danger.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-danger)}.mg-c-tag.mg-c-tag--info{border-color:var(--mg-b-color-info);background-color:var(--mg-b-color-info);color:var(--mg-b-color-text-on-info)}.mg-c-tag.mg-c-tag--info.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-info)}.mg-c-tag.mg-c-tag--info.mg-c-tag--soft{border-color:var(--mg-b-color-blue-20);background-color:var(--mg-b-color-blue-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--info.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-info)}.mg-c-tag.mg-c-tag--success{border-color:var(--mg-b-color-success);background-color:var(--mg-b-color-success);color:var(--mg-b-color-text-on-success)}.mg-c-tag.mg-c-tag--success.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-success)}.mg-c-tag.mg-c-tag--success.mg-c-tag--soft{border-color:var(--mg-b-color-green-20);background-color:var(--mg-b-color-green-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--success.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-success)}.mg-c-tag.mg-c-tag--warning{border-color:var(--mg-b-color-warning);background-color:var(--mg-b-color-warning);color:var(--mg-b-color-text-on-warning)}.mg-c-tag.mg-c-tag--warning.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-warning)}.mg-c-tag.mg-c-tag--warning.mg-c-tag--soft{border-color:var(--mg-b-color-yellow-20);background-color:var(--mg-b-color-yellow-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--warning.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-warning)}::slotted(mg-icon){margin-right:var(--mg-b-size-4)}slot{display:inline-flex;align-items:center}";
10
- const MgTagStyle0 = mgTagCss;
11
10
 
12
11
  const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement {
13
12
  constructor() {
@@ -23,15 +22,23 @@ const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement
23
22
  /**
24
23
  * Define tag variant
25
24
  */
26
- this.variant = variants[0]; // primary
25
+ this.variant = 'primary';
26
+ /**
27
+ * Define if tag is using outline style
28
+ */
29
+ this.outline = false;
30
+ /**
31
+ * Define if tag is using soft style
32
+ */
33
+ this.soft = false;
27
34
  /**
28
35
  * Component classes
29
36
  */
30
- this.classCollection = new Ze(['mg-c-tag']);
37
+ this.classCollection = new Zt(['mg-c-tag']);
31
38
  }
32
39
  validateVariant(newValue, oldValue) {
33
40
  if (!variants.includes(newValue)) {
34
- throw new Error(`<mg-tag> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${Ve(newValue)}.`);
41
+ throw new Error(`<mg-tag> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${Gt(newValue)}.`);
35
42
  }
36
43
  else {
37
44
  if (oldValue !== undefined) {
@@ -64,7 +71,7 @@ const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement
64
71
  * @param textContent - html element textContent property
65
72
  */
66
73
  validateTextContent(textContent) {
67
- if (!me(textContent))
74
+ if (!De(textContent))
68
75
  throw new Error('<mg-tag> slot must contain a text content.');
69
76
  }
70
77
  /*************
@@ -84,7 +91,7 @@ const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement
84
91
  * @returns HTML Element
85
92
  */
86
93
  render() {
87
- return (h("span", { key: 'b3269e3baec3a281bdbe65f8b62636b7ea2fa84c', class: this.classCollection.join() }, h("slot", { key: 'bcca2d8653dbcd6a96d322055a4e2773d85ca87d' })));
94
+ return (h("span", { key: '2517dd6020afcf91017c9cfb6a1f3037c0b6a7c4', class: this.classCollection.join() }, h("slot", { key: '0f0f0f82274342a87d98125631174f40060105af' })));
88
95
  }
89
96
  get element() { return this; }
90
97
  static get watchers() { return {
@@ -92,7 +99,7 @@ const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement
92
99
  "outline": ["validateOutline"],
93
100
  "soft": ["validateSoft"]
94
101
  }; }
95
- static get style() { return MgTagStyle0; }
102
+ static get style() { return mgTagCss; }
96
103
  }, [1, "mg-tag", {
97
104
  "variant": [1],
98
105
  "outline": [4],
@@ -122,5 +129,6 @@ const MgTag = MgTag$1;
122
129
  const defineCustomElement = defineCustomElement$1;
123
130
 
124
131
  export { MgTag, defineCustomElement };
132
+ //# sourceMappingURL=mg-tag.js.map
125
133
 
126
134
  //# sourceMappingURL=mg-tag.js.map
@@ -1 +1 @@
1
- {"file":"mg-tag.js","mappings":";;;AAEA;;;AAGO,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAU;;ACLjG,MAAM,QAAQ,GAAG,89HAA89H,CAAC;AACh/H,oBAAe,QAAQ;;MCUVA,OAAK;IALlB;;;;;;;;QAWmB,iBAAY,GAAG,mBAAmB,CAAC;QACnC,cA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;;;;;;IASD,iBAAiB;QACf,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;KACpD;;;;;IAMD,MAAM;QACJ,QACE,6DAAM,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,IACtC,8DAAa,CACR,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgTag","ClassList","toString","isValidString"],"sources":["src/components/atoms/mg-tag/mg-tag.conf.ts","../styles/dist/components/mg-tag.css?tag=mg-tag&encapsulation=shadow","src/components/atoms/mg-tag/mg-tag.tsx"],"sourcesContent":["import type { Variant } from '../../../types';\n\n/**\n * List of all possibles variants\n */\nexport const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'] as const;\n\n/**\n * TagVariantType type from tag variants\n */\nexport type TagVariantType = Variant & (typeof variants)[number];\n","/*!\n * @prop --mg-c-tag-height: Defines the height of the tag. Default value is `--mg-b-size-24`.\n * @prop --mg-c-tag-border-radius: Defines the border radius of the tag. Default value is `--mg-b-size-radius`.\n * @prop --mg-c-tag-font-size: Defines the font size of the tag. Default value is `--mg-b-font-size-small`.\n */:host{display:inline-block}.mg-c-tag{display:inline-flex;min-height:var(--mg-c-tag-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-c-tag-height) - 2*var(--mg-b-size-border) - var(--mg-c-tag-font-size)*var(--mg-b-line-height))/2) calc(var(--mg-b-size-8) - var(--mg-b-size-border));border:var(--mg-b-size-border) solid;border-radius:var(--mg-c-tag-border-radius);font-size:var(--mg-c-tag-font-size);font-weight:600;text-align:center;vertical-align:middle}.mg-c-tag.mg-c-tag--primary{border-color:var(--mg-b-color-neutral-110);background-color:var(--mg-b-color-neutral-110);color:var(--mg-b-color-text-on-primary)}.mg-c-tag.mg-c-tag--primary.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-neutral-110)}.mg-c-tag.mg-c-tag--primary.mg-c-tag--soft{border-color:var(--mg-b-color-neutral-20);background-color:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--primary.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-neutral-110)}.mg-c-tag.mg-c-tag--secondary{border-color:var(--mg-b-color-neutral-10);background-color:var(--mg-b-color-neutral-10);color:var(--mg-b-color-text-on-secondary)}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-neutral-10)}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--soft{border-color:var(--mg-b-color-neutral-20);background-color:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-text-on-secondary)}.mg-c-tag.mg-c-tag--danger{border-color:var(--mg-b-color-danger);background-color:var(--mg-b-color-danger);color:var(--mg-b-color-text-on-danger)}.mg-c-tag.mg-c-tag--danger.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-danger)}.mg-c-tag.mg-c-tag--danger.mg-c-tag--soft{border-color:var(--mg-b-color-red-20);background-color:var(--mg-b-color-red-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--danger.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-danger)}.mg-c-tag.mg-c-tag--info{border-color:var(--mg-b-color-info);background-color:var(--mg-b-color-info);color:var(--mg-b-color-text-on-info)}.mg-c-tag.mg-c-tag--info.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-info)}.mg-c-tag.mg-c-tag--info.mg-c-tag--soft{border-color:var(--mg-b-color-blue-20);background-color:var(--mg-b-color-blue-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--info.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-info)}.mg-c-tag.mg-c-tag--success{border-color:var(--mg-b-color-success);background-color:var(--mg-b-color-success);color:var(--mg-b-color-text-on-success)}.mg-c-tag.mg-c-tag--success.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-success)}.mg-c-tag.mg-c-tag--success.mg-c-tag--soft{border-color:var(--mg-b-color-green-20);background-color:var(--mg-b-color-green-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--success.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-success)}.mg-c-tag.mg-c-tag--warning{border-color:var(--mg-b-color-warning);background-color:var(--mg-b-color-warning);color:var(--mg-b-color-text-on-warning)}.mg-c-tag.mg-c-tag--warning.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-warning)}.mg-c-tag.mg-c-tag--warning.mg-c-tag--soft{border-color:var(--mg-b-color-yellow-20);background-color:var(--mg-b-color-yellow-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--warning.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-warning)}::slotted(mg-icon){margin-right:var(--mg-b-size-4)}slot{display:inline-flex;align-items:center}/*# sourceMappingURL=mg-tag.css.map */\n","import { Component, h, Prop, State, Watch, Element } from '@stencil/core';\nimport { TagVariantType, variants } from './mg-tag.conf';\nimport { ClassList, isValidString, toString } from '@mgdis/stencil-helpers';\n/**\n * @slot - Tag content\n */\n@Component({\n tag: 'mg-tag',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-tag.css',\n shadow: true,\n})\nexport class MgTag {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classOutline = 'mg-c-tag--outline';\n private readonly classSoft = 'mg-c-tag--soft';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTagElement;\n\n /**\n * Define tag variant\n */\n @Prop() variant: TagVariantType = variants[0]; // primary\n @Watch('variant')\n validateVariant(newValue: MgTag['variant'], oldValue?: MgTag['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-tag> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-tag--${oldValue}`);\n }\n this.classCollection.add(`mg-c-tag--${newValue}`);\n }\n }\n\n /**\n * Define if tag is using outline style\n */\n @Prop() outline?: boolean;\n @Watch('outline')\n validateOutline(newValue: MgTag['outline']): void {\n if (newValue) this.classCollection.add(this.classOutline);\n else this.classCollection.delete(this.classOutline);\n }\n\n /**\n * Define if tag is using soft style\n */\n @Prop() soft?: boolean;\n @Watch('soft')\n validateSoft(newValue: MgTag['soft']): void {\n // usage validation\n if (newValue && this.outline) throw new Error('<mg-tag> prop \"soft\" can NOT be used with prop \"outline\".');\n\n // apply class\n if (newValue) this.classCollection.add(this.classSoft);\n else this.classCollection.delete(this.classSoft);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-tag']);\n\n /*************\n * Methods *\n *************/\n\n /**\n * Validate the given textContent\n * @param textContent - html element textContent property\n */\n private validateTextContent(textContent: string): void {\n if (!isValidString(textContent)) throw new Error('<mg-tag> slot must contain a text content.');\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateVariant(this.variant);\n this.validateOutline(this.outline);\n this.validateSoft(this.soft);\n this.validateTextContent(this.element.textContent);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <span class={this.classCollection.join()}>\n <slot></slot>\n </span>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-tag.js","mappings":";;;AAEA;;AAEG;AACI,MAAM,QAAQ,GAAG,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CAAC,IAAI,CAAC,YAAY,CAAC;;AAQrD,IAAA,YAAY,CAAC,QAAuB,EAAA;;AAElC,QAAA,IAAI,QAAQ,IAAI,IAAI,CAAC,OAAO;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC;;AAG1G,QAAA,IAAI,QAAQ;YAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;;YACjD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;;AAQlD;;AAEe;AAEf;;;AAGG;AACK,IAAA,mBAAmB,CAAC,WAAmB,EAAA;AAC7C,QAAA,IAAI,CAACC,EAAa,CAAC,WAAW,CAAC;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;;AAGhG;;AAEe;AAEf;;AAEG;IACH,iBAAiB,GAAA;AACf,QAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC;AAClC,QAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC;AAClC,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;;AAGpD;;;AAGG;IACH,MAAM,GAAA;AACJ,QAAA,QACE,6DAAM,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,EAAA,EACtC,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgTag","__stencil_proxyCustomElement","ClassList","toString","isValidString"],"sources":["src/components/atoms/mg-tag/mg-tag.conf.ts","../styles/dist/components/mg-tag.css?tag=mg-tag&encapsulation=shadow","src/components/atoms/mg-tag/mg-tag.tsx"],"sourcesContent":["import type { Variant } from '../../../types';\n\n/**\n * List of all possibles variants\n */\nexport const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'] as const;\n\n/**\n * TagVariantType type from tag variants\n */\nexport type TagVariantType = Variant & (typeof variants)[number];\n","/*!\n * @prop --mg-c-tag-height: Defines the height of the tag. Default value is `--mg-b-size-24`.\n * @prop --mg-c-tag-border-radius: Defines the border radius of the tag. Default value is `--mg-b-size-radius`.\n * @prop --mg-c-tag-font-size: Defines the font size of the tag. Default value is `--mg-b-font-size-small`.\n */:host{display:inline-block}.mg-c-tag{display:inline-flex;min-height:var(--mg-c-tag-height);box-sizing:border-box;align-items:center;padding:calc((var(--mg-c-tag-height) - 2*var(--mg-b-size-border) - var(--mg-c-tag-font-size)*var(--mg-b-line-height))/2) calc(var(--mg-b-size-8) - var(--mg-b-size-border));border:var(--mg-b-size-border) solid;border-radius:var(--mg-c-tag-border-radius);font-size:var(--mg-c-tag-font-size);font-weight:600;text-align:center;vertical-align:middle}.mg-c-tag.mg-c-tag--primary{border-color:var(--mg-b-color-neutral-110);background-color:var(--mg-b-color-neutral-110);color:var(--mg-b-color-text-on-primary)}.mg-c-tag.mg-c-tag--primary.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-neutral-110)}.mg-c-tag.mg-c-tag--primary.mg-c-tag--soft{border-color:var(--mg-b-color-neutral-20);background-color:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--primary.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-neutral-110)}.mg-c-tag.mg-c-tag--secondary{border-color:var(--mg-b-color-neutral-10);background-color:var(--mg-b-color-neutral-10);color:var(--mg-b-color-text-on-secondary)}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-neutral-10)}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--soft{border-color:var(--mg-b-color-neutral-20);background-color:var(--mg-b-color-neutral-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--secondary.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-text-on-secondary)}.mg-c-tag.mg-c-tag--danger{border-color:var(--mg-b-color-danger);background-color:var(--mg-b-color-danger);color:var(--mg-b-color-text-on-danger)}.mg-c-tag.mg-c-tag--danger.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-danger)}.mg-c-tag.mg-c-tag--danger.mg-c-tag--soft{border-color:var(--mg-b-color-red-20);background-color:var(--mg-b-color-red-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--danger.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-danger)}.mg-c-tag.mg-c-tag--info{border-color:var(--mg-b-color-info);background-color:var(--mg-b-color-info);color:var(--mg-b-color-text-on-info)}.mg-c-tag.mg-c-tag--info.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-info)}.mg-c-tag.mg-c-tag--info.mg-c-tag--soft{border-color:var(--mg-b-color-blue-20);background-color:var(--mg-b-color-blue-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--info.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-info)}.mg-c-tag.mg-c-tag--success{border-color:var(--mg-b-color-success);background-color:var(--mg-b-color-success);color:var(--mg-b-color-text-on-success)}.mg-c-tag.mg-c-tag--success.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-success)}.mg-c-tag.mg-c-tag--success.mg-c-tag--soft{border-color:var(--mg-b-color-green-20);background-color:var(--mg-b-color-green-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--success.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-success)}.mg-c-tag.mg-c-tag--warning{border-color:var(--mg-b-color-warning);background-color:var(--mg-b-color-warning);color:var(--mg-b-color-text-on-warning)}.mg-c-tag.mg-c-tag--warning.mg-c-tag--outline{background-color:rgba(0,0,0,0);color:var(--mg-b-color-warning)}.mg-c-tag.mg-c-tag--warning.mg-c-tag--soft{border-color:var(--mg-b-color-yellow-20);background-color:var(--mg-b-color-yellow-20);color:var(--mg-b-color-dark);font-weight:400}.mg-c-tag.mg-c-tag--warning.mg-c-tag--soft ::slotted(mg-icon){color:var(--mg-b-color-warning)}::slotted(mg-icon){margin-right:var(--mg-b-size-4)}slot{display:inline-flex;align-items:center}/*# sourceMappingURL=mg-tag.css.map */\n","import { Component, h, Prop, State, Watch, Element } from '@stencil/core';\nimport { TagVariantType, variants } from './mg-tag.conf';\nimport { ClassList, isValidString, toString } from '@mgdis/stencil-helpers';\n/**\n * @slot - Tag content\n */\n@Component({\n tag: 'mg-tag',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-tag.css',\n shadow: true,\n})\nexport class MgTag {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classOutline = 'mg-c-tag--outline';\n private readonly classSoft = 'mg-c-tag--soft';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTagElement;\n\n /**\n * Define tag variant\n */\n @Prop() variant: TagVariantType = 'primary';\n @Watch('variant')\n validateVariant(newValue: MgTag['variant'], oldValue?: MgTag['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-tag> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-tag--${oldValue}`);\n }\n this.classCollection.add(`mg-c-tag--${newValue}`);\n }\n }\n\n /**\n * Define if tag is using outline style\n */\n @Prop() outline = false;\n @Watch('outline')\n validateOutline(newValue: MgTag['outline']): void {\n if (newValue) this.classCollection.add(this.classOutline);\n else this.classCollection.delete(this.classOutline);\n }\n\n /**\n * Define if tag is using soft style\n */\n @Prop() soft = false;\n @Watch('soft')\n validateSoft(newValue: MgTag['soft']): void {\n // usage validation\n if (newValue && this.outline) throw new Error('<mg-tag> prop \"soft\" can NOT be used with prop \"outline\".');\n\n // apply class\n if (newValue) this.classCollection.add(this.classSoft);\n else this.classCollection.delete(this.classSoft);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-tag']);\n\n /*************\n * Methods *\n *************/\n\n /**\n * Validate the given textContent\n * @param textContent - html element textContent property\n */\n private validateTextContent(textContent: string): void {\n if (!isValidString(textContent)) throw new Error('<mg-tag> slot must contain a text content.');\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateVariant(this.variant);\n this.validateOutline(this.outline);\n this.validateSoft(this.soft);\n this.validateTextContent(this.element.textContent);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <span class={this.classCollection.join()}>\n <slot></slot>\n </span>\n );\n }\n}\n"],"version":3}
@@ -4,5 +4,6 @@ const MgTooltipContent = MgTooltipContent$1;
4
4
  const defineCustomElement = defineCustomElement$1;
5
5
 
6
6
  export { MgTooltipContent, defineCustomElement };
7
+ //# sourceMappingURL=mg-tooltip-content.js.map
7
8
 
8
9
  //# sourceMappingURL=mg-tooltip-content.js.map
@@ -1,7 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
 
3
- const mgTooltipContentCss = ":host{z-index:1000;display:none;max-width:var(--mg-b-size-floating-element-max-width);box-sizing:border-box;padding:var(--mg-b-size-4) var(--mg-b-size-8);border-radius:var(--mg-c-tooltip-border-radius);background-color:var(--mg-c-tooltip-color-background);color:var(--mg-c-tooltip-color-text);font-family:var(--mg-b-font-family);font-size:var(--mg-b-font-size);font-weight:400;text-align:start}:host([data-show]){display:block}::slotted([slot=arrow]){visibility:hidden}::slotted([slot=arrow])::before{content:\"\";transform:rotate(45deg);visibility:visible}::slotted([slot=arrow]),::slotted([slot=arrow])::before{position:absolute;z-index:9999;width:var(--mg-b-size-8);height:var(--mg-b-size-8);background-color:var(--mg-c-tooltip-color-background)}:host([data-placement^=top])>::slotted([slot=arrow]){bottom:calc(-1*var(--mg-b-size-4))}:host([data-placement^=bottom])>::slotted([slot=arrow]){top:calc(-1*var(--mg-b-size-4))}:host([data-placement^=left])>::slotted([slot=arrow]){right:calc(-1*var(--mg-b-size-4))}:host([data-placement^=right])>::slotted([slot=arrow]){left:calc(-1*var(--mg-b-size-4))}";
4
- const MgTooltipContentStyle0 = mgTooltipContentCss;
3
+ const mgTooltipContentCss = ":host{z-index:1000;top:0;left:0;display:none;width:max-content;max-width:var(--mg-b-size-floating-element-max-width);box-sizing:border-box;padding:var(--mg-b-size-4) var(--mg-b-size-8);border-radius:var(--mg-c-tooltip-border-radius);background-color:var(--mg-c-tooltip-color-background);color:var(--mg-c-tooltip-color-text);font-family:var(--mg-b-font-family);font-size:var(--mg-b-font-size);font-weight:400;text-align:start}:host([data-show]){display:block}::slotted([slot=arrow]){position:absolute;visibility:hidden}::slotted([slot=arrow])::before{content:\"\";transform:rotate(45deg);visibility:visible}::slotted([slot=arrow]),::slotted([slot=arrow])::before{position:absolute;z-index:9999;width:var(--mg-b-size-8);height:var(--mg-b-size-8);background-color:var(--mg-c-tooltip-color-background)}:host([data-placement^=top])>::slotted([slot=arrow]){bottom:calc(-1*var(--mg-b-size-4))}:host([data-placement^=bottom])>::slotted([slot=arrow]){top:calc(-1*var(--mg-b-size-4))}:host([data-placement^=left])>::slotted([slot=arrow]){right:calc(-1*var(--mg-b-size-4))}:host([data-placement^=right])>::slotted([slot=arrow]){left:calc(-1*var(--mg-b-size-4))}";
5
4
 
6
5
  const MgTooltipContent = /*@__PURE__*/ proxyCustomElement(class MgTooltipContent extends HTMLElement {
7
6
  constructor() {
@@ -19,7 +18,7 @@ const MgTooltipContent = /*@__PURE__*/ proxyCustomElement(class MgTooltipContent
19
18
  render() {
20
19
  return (h(Host, { key: '2221de3ca0ef7c9d6e46e24b19c69007fababf81', role: "tooltip" }, h("span", { key: '9e14f7f5b3f5e5060ed9f42e8d7259b17575168e', innerHTML: this.message, class: "mg-tooltip-content__message" }), h("slot", { key: 'bc083567d77e8f4ffccee98b96036ba8ac494fb6', name: "arrow" })));
21
20
  }
22
- static get style() { return MgTooltipContentStyle0; }
21
+ static get style() { return mgTooltipContentCss; }
23
22
  }, [1, "mg-tooltip-content", {
24
23
  "message": [1]
25
24
  }]);
@@ -39,5 +38,6 @@ function defineCustomElement() {
39
38
  defineCustomElement();
40
39
 
41
40
  export { MgTooltipContent as M, defineCustomElement as d };
41
+ //# sourceMappingURL=mg-tooltip-content2.js.map
42
42
 
43
43
  //# sourceMappingURL=mg-tooltip-content2.js.map
@@ -1 +1 @@
1
- {"file":"mg-tooltip-content2.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,+kCAA+kC,CAAC;AAC5mC,+BAAe,mBAAmB;;MCSrB,gBAAgB;;;;;;;;;;;;;IAc3B,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,IAAI,EAAC,SAAS,IAClB,6DAAM,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,6BAA6B,GAAQ,EAC1E,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACrB,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../styles/dist/components/mg-tooltip-content.css?tag=mg-tooltip-content&encapsulation=shadow","src/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.tsx"],"sourcesContent":[":host{z-index:1000;display:none;max-width:var(--mg-b-size-floating-element-max-width);box-sizing:border-box;padding:var(--mg-b-size-4) var(--mg-b-size-8);border-radius:var(--mg-c-tooltip-border-radius);background-color:var(--mg-c-tooltip-color-background);color:var(--mg-c-tooltip-color-text);font-family:var(--mg-b-font-family);font-size:var(--mg-b-font-size);font-weight:400;text-align:start}:host([data-show]){display:block}::slotted([slot=arrow]){visibility:hidden}::slotted([slot=arrow])::before{content:\"\";transform:rotate(45deg);visibility:visible}::slotted([slot=arrow]),::slotted([slot=arrow])::before{position:absolute;z-index:9999;width:var(--mg-b-size-8);height:var(--mg-b-size-8);background-color:var(--mg-c-tooltip-color-background)}:host([data-placement^=top])>::slotted([slot=arrow]){bottom:calc(-1*var(--mg-b-size-4))}:host([data-placement^=bottom])>::slotted([slot=arrow]){top:calc(-1*var(--mg-b-size-4))}:host([data-placement^=left])>::slotted([slot=arrow]){right:calc(-1*var(--mg-b-size-4))}:host([data-placement^=right])>::slotted([slot=arrow]){left:calc(-1*var(--mg-b-size-4))}/*# sourceMappingURL=mg-tooltip-content.css.map */\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n/**\n * @internal\n */\n@Component({\n tag: 'mg-tooltip-content',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-tooltip-content.css',\n shadow: true,\n})\nexport class MgTooltipContent {\n /**\n * Displayed message in the tooltip\n */\n @Prop() message!: string;\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"tooltip\">\n <span innerHTML={this.message} class=\"mg-tooltip-content__message\"></span>\n <slot name=\"arrow\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-tooltip-content2.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,goCAAgoC;;MCU/oC,gBAAgB,iBAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAA,WAAA,CAAA;;;;;;AAM3B;;AAEe;AAEf;;;AAGG;IACH,MAAM,GAAA;QACJ,QACE,CAAC,CAAA,IAAI,EAAC,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,SAAS,EAAA,EAClB,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,6BAA6B,EAAQ,CAAA,EAC1E,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,OAAO,EAAQ,CAAA,CACrB;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"sources":["../styles/dist/components/mg-tooltip-content.css?tag=mg-tooltip-content&encapsulation=shadow","src/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.tsx"],"sourcesContent":[":host{z-index:1000;top:0;left:0;display:none;width:max-content;max-width:var(--mg-b-size-floating-element-max-width);box-sizing:border-box;padding:var(--mg-b-size-4) var(--mg-b-size-8);border-radius:var(--mg-c-tooltip-border-radius);background-color:var(--mg-c-tooltip-color-background);color:var(--mg-c-tooltip-color-text);font-family:var(--mg-b-font-family);font-size:var(--mg-b-font-size);font-weight:400;text-align:start}:host([data-show]){display:block}::slotted([slot=arrow]){position:absolute;visibility:hidden}::slotted([slot=arrow])::before{content:\"\";transform:rotate(45deg);visibility:visible}::slotted([slot=arrow]),::slotted([slot=arrow])::before{position:absolute;z-index:9999;width:var(--mg-b-size-8);height:var(--mg-b-size-8);background-color:var(--mg-c-tooltip-color-background)}:host([data-placement^=top])>::slotted([slot=arrow]){bottom:calc(-1*var(--mg-b-size-4))}:host([data-placement^=bottom])>::slotted([slot=arrow]){top:calc(-1*var(--mg-b-size-4))}:host([data-placement^=left])>::slotted([slot=arrow]){right:calc(-1*var(--mg-b-size-4))}:host([data-placement^=right])>::slotted([slot=arrow]){left:calc(-1*var(--mg-b-size-4))}/*# sourceMappingURL=mg-tooltip-content.css.map */\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n/**\n * @internal\n */\n@Component({\n tag: 'mg-tooltip-content',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-tooltip-content.css',\n shadow: true,\n})\nexport class MgTooltipContent {\n /**\n * Displayed message in the tooltip\n */\n @Prop() message!: string;\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"tooltip\">\n <span innerHTML={this.message} class=\"mg-tooltip-content__message\"></span>\n <slot name=\"arrow\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -4,5 +4,6 @@ const MgTooltip = MgTooltip$1;
4
4
  const defineCustomElement = defineCustomElement$1;
5
5
 
6
6
  export { MgTooltip, defineCustomElement };
7
+ //# sourceMappingURL=mg-tooltip.js.map
7
8
 
8
9
  //# sourceMappingURL=mg-tooltip.js.map
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { G as Ge, s as st, X as Xe, V as Ve, m as me, Y as Ye, Q as Qe } from './index.es.js';
3
- import { a as autoUpdate, c as computePosition, o as offset, f as flip, d as shift, l as limitShift, e as arrow, i as isFloatingUIPlacement } from './floating-ui.utils.js';
2
+ import { P as Pt, X as Xt, U as Ut, G as Gt, D as De, B as Bt, c as Ht } from './index.es.js';
3
+ import { b as autoUpdate, c as computePosition, g as getTransformation, n as numberToPx, i as isFloatingUIPlacement, o as offset, f as flip, d as shift, e as arrow, l as limitShift } from './floating-ui.utils.js';
4
4
  import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
5
5
 
6
6
  const Guard = {
@@ -11,7 +11,6 @@ const Guard = {
11
11
  };
12
12
 
13
13
  const mgTooltipCss = "/*!\n * @prop --mg-c-tooltip-border-radius: Defines the border radius of the tooltip. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-tooltip-color-background: Defines the background color of the tooltip. Default value: `--mg-b-color-dark`.\n * @prop --mg-c-tooltip-color-text: Defines the font color of the tooltip. Default value: `--mg-b-color-light`.\n */:host{display:inline-block}";
14
- const MgTooltipStyle0 = mgTooltipCss;
15
14
 
16
15
  /**
17
16
  * HTMLMgButtonElement type guard
@@ -28,7 +27,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
28
27
  * Sets an `id` attribute.
29
28
  * Needed by the input for accessibility `aria-decribedby`.
30
29
  */
31
- this.identifier = Ge('mg-tooltip');
30
+ this.identifier = Pt('mg-tooltip');
32
31
  /**
33
32
  * Tooltip placement
34
33
  */
@@ -48,12 +47,13 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
48
47
  // Make the tooltip visible
49
48
  this.mgTooltipContent.dataset.show = '';
50
49
  // hide when click outside on nextTick to prevent event to trigger after creation
51
- st(() => {
50
+ Xt(() => {
52
51
  this.windows.forEach((localWindow) => {
53
52
  localWindow.addEventListener('click', this.handleClickOutside, false);
54
53
  localWindow.addEventListener('keydown', this.handlePressEscape, false);
55
54
  });
56
55
  });
56
+ this.updateTooltip();
57
57
  };
58
58
  /**
59
59
  * Hide tooltip
@@ -91,8 +91,9 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
91
91
  * @param condition - additionnal condition to apply display prop newValue
92
92
  */
93
93
  this.setDisplay = (newValue, condition = true) => {
94
- if (!this.disabled && condition)
94
+ if (!this.disabled && condition && this.display !== newValue) {
95
95
  this.display = newValue;
96
+ }
96
97
  };
97
98
  /**
98
99
  * Action for tooltip element and tooltiped element mouse listener
@@ -150,52 +151,43 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
150
151
  }
151
152
  };
152
153
  /**
153
- * Set Floating UI instance
154
- * @param strategy - Floating UI strategy to apply on instance
154
+ * Update tooltip position
155
+ * @returns autoUpdate function
155
156
  */
156
- this.setFloatingUI = (strategy) => {
157
- // Initial styles configuration
157
+ this.updateTooltip = () => autoUpdate(this.tooltipedElement, this.mgTooltipContent, async () => {
158
+ // Placement
159
+ const { x, y, placement, middlewareData } = await computePosition(this.tooltipedElement, this.mgTooltipContent, {
160
+ placement: this.placement,
161
+ strategy: this.tooltipStrategy,
162
+ middleware: [
163
+ offset(8),
164
+ flip(),
165
+ shift({
166
+ limiter: limitShift(),
167
+ }),
168
+ arrow({ element: this.arrowElement }),
169
+ ],
170
+ });
171
+ // Positioning
158
172
  Object.assign(this.mgTooltipContent.style, {
159
- position: strategy,
160
- top: '0',
161
- left: '0',
162
- transform: 'translate(0, 0)',
173
+ position: this.tooltipStrategy,
174
+ transform: getTransformation(x, y),
163
175
  });
164
- // Create Floating UI instance with autoUpdate
165
- this.floatingUICleanup = autoUpdate(this.tooltipedElement, this.mgTooltipContent, () => {
166
- computePosition(this.tooltipedElement, this.mgTooltipContent, {
167
- placement: this.placement,
168
- strategy,
169
- middleware: [offset(8), flip(), shift({ limiter: limitShift() }), arrow({ element: this.mgTooltipContent.querySelector('[data-floating-arrow]') })],
170
- }).then(({ x, y, placement, middlewareData }) => {
171
- Object.assign(this.mgTooltipContent.style, {
172
- transform: !isNaN(x) && !isNaN(y) ? `translate(${x}px, ${y}px)` : undefined,
173
- });
174
- // Update arrow style
175
- const { x: arrowX, y: arrowY } = middlewareData.arrow;
176
- const staticSide = {
177
- top: 'bottom',
178
- right: 'left',
179
- bottom: 'top',
180
- left: 'right',
181
- }[placement.split('-')[0]];
182
- const arrowElement = this.mgTooltipContent.querySelector('[data-floating-arrow]');
183
- // https://floating-ui.com/docs/arrow
184
- // Unlike the floating element, which has both coordinates defined at all times, the arrow only has one defined.
185
- // Due to this, either x or y will be undefined, depending on the side of placement.
186
- // The above code uses `isNaN` to check for null and undefined simultaneously.
187
- // Don’t remove `isNaN`, because either value can be falsy (0), causing a bug!
188
- const numberToPx = (number) => (!isNaN(number) ? `${number}px` : '');
189
- Object.assign(arrowElement.style, {
190
- left: numberToPx(arrowX),
191
- top: numberToPx(arrowY),
192
- [staticSide]: '-4px',
193
- position: 'absolute',
194
- });
195
- this.mgTooltipContent.setAttribute('data-placement', placement);
196
- });
176
+ // Arrow positioning
177
+ const { x: arrowX, y: arrowY } = middlewareData.arrow;
178
+ const staticSide = {
179
+ top: 'bottom',
180
+ right: 'left',
181
+ bottom: 'top',
182
+ left: 'right',
183
+ }[placement.split('-')[0]];
184
+ Object.assign(this.arrowElement.style, {
185
+ left: numberToPx(arrowX),
186
+ top: numberToPx(arrowY),
187
+ [staticSide]: '-4px',
197
188
  });
198
- };
189
+ this.mgTooltipContent.setAttribute('data-placement', placement);
190
+ });
199
191
  /**
200
192
  * Define selected element to become tooltip selector and init listeners
201
193
  * @param element - tooltiped element
@@ -237,18 +229,15 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
237
229
  // set guard when one of mutations is for a disabled with disabled-on-click
238
230
  if (mutationList.some((mutation) => mutation.target.disabled && mutation.target.disableOnClick)) {
239
231
  this.guard = Guard.DISABLE_ON_CLICK;
240
- }
241
- // when the disabled-on-click guard is running we stop process
242
- if (this.guard === Guard.DISABLE_ON_CLICK)
243
232
  return;
233
+ }
244
234
  // update button wrapper
245
235
  this.setMgButtonWrapper(mgButton);
246
236
  // Since Firefox doesn't trigger a "blur" event when the "disabled" attribute is added or removed from a button
247
237
  // we have to manually unlock the guard because the "blur" handler of the tooltipedElement won't do it.
248
238
  this.resetGuard();
249
239
  // update Floating UI instance
250
- this.floatingUICleanup();
251
- this.setFloatingUI(this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed');
240
+ this.updateTooltip();
252
241
  }).observe(mgButton, { attributes: true });
253
242
  };
254
243
  /**
@@ -267,15 +256,15 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
267
256
  };
268
257
  }
269
258
  watchIdentifier(newValue) {
270
- if (!Xe(newValue)) {
271
- throw new Error(`<mg-tooltip> prop "identifier" value is invalid. Passed value: ${Ve(newValue)}.`);
259
+ if (!Ut(newValue)) {
260
+ throw new Error(`<mg-tooltip> prop "identifier" value is invalid. Passed value: ${Gt(newValue)}.`);
272
261
  }
273
262
  // use renderTooltipContent to update tooltip-content id
274
263
  this.renderTooltipContent();
275
264
  }
276
265
  watchMessage(newValue) {
277
- if (!me(newValue)) {
278
- throw new Error(`<mg-tooltip> prop "message" is required and must be a string. Passed value: ${Ve(newValue)}.`);
266
+ if (!De(newValue)) {
267
+ throw new Error(`<mg-tooltip> prop "message" is required and must be a string. Passed value: ${Gt(newValue)}.`);
279
268
  }
280
269
  if (this.mgTooltipContent !== undefined)
281
270
  this.mgTooltipContent.message = newValue;
@@ -334,7 +323,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
334
323
  */
335
324
  componentWillLoad() {
336
325
  // Get windows to attach events
337
- this.windows = Ye(window);
326
+ this.windows = Bt(window);
338
327
  // Get tooltip element
339
328
  this.renderTooltipContent();
340
329
  //validate properties
@@ -342,6 +331,8 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
342
331
  this.watchDisabled(this.disabled);
343
332
  this.watchMessage(this.message);
344
333
  this.watchIdentifier(this.identifier);
334
+ // define if the tooltip is inside a popover
335
+ this.tooltipStrategy = this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed';
345
336
  }
346
337
  /**
347
338
  * Get slotted element
@@ -353,8 +344,10 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
353
344
  // get slotted element wich is not the tooltip
354
345
  const slotElement = this.element.querySelector(`*:not(#${this.identifier})`);
355
346
  // Get interactive element
356
- const interactiveElement = slotElement.matches(Qe) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(Qe);
347
+ const interactiveElement = slotElement.matches(Ht) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(Ht);
357
348
  this.setTooltipedElement(interactiveElement || slotElement);
349
+ // Set arrow element
350
+ this.arrowElement = this.mgTooltipContent.querySelector('[data-floating-arrow]');
358
351
  // Check if slotted element is a disabled mg-button
359
352
  // In this case we wrap the mg-button into a div to enable the tooltip
360
353
  if (isButton(slotElement)) {
@@ -370,8 +363,6 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
370
363
  }
371
364
  // apply a11y aria
372
365
  this.setAriaDescribedby(slotElement);
373
- // set Tooltip
374
- this.setFloatingUI(this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed');
375
366
  // add document keyboard handler
376
367
  document.addEventListener('keydown', this.handlePressEscape);
377
368
  // check props
@@ -381,28 +372,26 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
381
372
  * update popper position after props change on component did update hook to benefit from render ended
382
373
  */
383
374
  componentDidUpdate() {
384
- this.floatingUICleanup();
385
- this.setFloatingUI(this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed');
375
+ this.updateTooltip();
386
376
  }
387
377
  /**
388
378
  * remove listeners
389
379
  */
390
380
  disconnectedCallback() {
391
- var _a;
381
+ var _a, _b;
392
382
  document.removeEventListener('keydown', this.handlePressEscape);
393
383
  (_a = this.windows) === null || _a === void 0 ? void 0 : _a.forEach((localWindow) => {
394
384
  localWindow.removeEventListener('click', this.handleClickOutside, false);
395
385
  localWindow.removeEventListener('keydown', this.handlePressEscape, false);
396
386
  });
397
- // cleanup Floating UI
398
- this.floatingUICleanup();
387
+ (_b = this.updateTooltip) === null || _b === void 0 ? void 0 : _b.call(this);
399
388
  }
400
389
  /**
401
390
  * Render
402
391
  * @returns HTML Element
403
392
  */
404
393
  render() {
405
- return (h(Host, { key: '38823340f62287af2769d7dee3313dc83405fd87' }, h("slot", { key: '598ed57134a1163630f036328139572acb467f41' }), h("slot", { key: '8da7b05b4675b00a4b5e90a3e9b8c0532b1afac1', name: "content" })));
394
+ return (h(Host, { key: 'dab470c730b1541ab5be487222da8ba3643501ae' }, h("slot", { key: 'a6f5d444e3521d93cf9f39ccffcd68cfde4f8101' }), h("slot", { key: 'ba4d98f953453a710379cb4ce28f1c468a34ffc4', name: "content" })));
406
395
  }
407
396
  get element() { return this; }
408
397
  static get watchers() { return {
@@ -412,7 +401,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
412
401
  "display": ["watchDisplay"],
413
402
  "disabled": ["watchDisabled"]
414
403
  }; }
415
- static get style() { return MgTooltipStyle0; }
404
+ static get style() { return mgTooltipCss; }
416
405
  }, [1, "mg-tooltip", {
417
406
  "identifier": [1],
418
407
  "message": [1],
@@ -447,5 +436,6 @@ function defineCustomElement() {
447
436
  defineCustomElement();
448
437
 
449
438
  export { MgTooltip as M, defineCustomElement as d };
439
+ //# sourceMappingURL=mg-tooltip2.js.map
450
440
 
451
441
  //# sourceMappingURL=mg-tooltip2.js.map
@@ -1 +1 @@
1
- {"file":"mg-tooltip2.js","mappings":";;;;;AAKO,MAAM,KAAK,GAA8B;IAC9C,KAAK,EAAE,OAAO;IACd,qBAAqB,EAAE,cAAc;IACrC,uBAAuB,EAAE,gBAAgB;IACzC,gBAAgB,EAAE,gBAAgB;CACnC;;ACVD,MAAM,YAAY,GAAG,yYAAyY,CAAC;AAC/Z,wBAAe,YAAY;;ACI3B;;;;;AAKA,MAAM,QAAQ,GAAG,CAAC,OAAgB,KAAqC,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAE,OAAmB,CAAC,OAAO,CAAC,CAAC;MAWxJ,SAAS;IALtB;;;;;;;;QAgCU,eAAU,GAAWA,EAAQ,CAAC,YAAY,CAAC,CAAC;;;;QAyB3B,cAAS,GAAyB,QAAQ,CAAC;;;;QAS3C,YAAO,GAAG,KAAK,CAAC;;;;QAajC,aAAQ,GAAG,KAAK,CAAC;;;;QAYjB,SAAI,GAAG;;YAEb,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC;;YAExCC,EAAQ,CAAC;gBACP,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAmB;oBACvC,WAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;oBACtE,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;iBACxE,CAAC,CAAC;aACJ,CAAC,CAAC;SACJ,CAAC;;;;QAKM,SAAI,GAAG;;YAEb,IAAI,CAAC,gBAAgB,CAA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AAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;;QAGvF,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;;QAG7D,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACjC;;;;IAKD,kBAAkB;QAChB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;KACxF;;;;IAKD,oBAAoB;;QAClB,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,WAAmB;YACxC,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;YACzE,WAAW,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;SAC3E,CAAC,CAAC;;QAEH,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;;;;;IAMD,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,8DAAa,EACb,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["createID","nextTick","isValideID","toString","isValidString","getWindows","focusableElements"],"sources":["src/components/atoms/mg-tooltip/mg-tooltip.conf.tsx","../styles/dist/components/mg-tooltip.css?tag=mg-tooltip&encapsulation=shadow","src/components/atoms/mg-tooltip/mg-tooltip.tsx"],"sourcesContent":["import { type ExtendedPlacement, placements } from '../../../utils/floating-ui.utils';\nexport * from '../../../utils/floating-ui.utils';\n\nexport type GuardType = 'focus' | 'hoverTooltip' | 'hoverTooltiped' | 'disableOnClick';\n\nexport const Guard: Record<string, GuardType> = {\n FOCUS: 'focus',\n HOVER_TOOLTIP_ELEMENT: 'hoverTooltip',\n HOVER_TOOLTIPED_ELEMENT: 'hoverTooltiped',\n DISABLE_ON_CLICK: 'disableOnClick',\n};\n\n/**\n * Placement type from placements\n */\nexport type TooltipPlacementType = ExtendedPlacement & (typeof placements)[number];\n","/*!\n * @prop --mg-c-tooltip-border-radius: Defines the border radius of the tooltip. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-tooltip-color-background: Defines the background color of the tooltip. Default value: `--mg-b-color-dark`.\n * @prop --mg-c-tooltip-color-text: Defines the font color of the tooltip. Default value: `--mg-b-color-light`.\n */:host{display:inline-block}/*# sourceMappingURL=mg-tooltip.css.map */\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { createID, focusableElements, getWindows, isValideID, isValidString, nextTick, toString } from '@mgdis/stencil-helpers';\nimport { computePosition, autoUpdate, flip, shift, limitShift, offset, arrow, type Strategy, type Placement } from '@floating-ui/dom';\nimport { type GuardType, Guard, type TooltipPlacementType, isFloatingUIPlacement } from './mg-tooltip.conf';\n\n/**\n * HTMLMgButtonElement type guard\n * @param element - element to check\n * @returns return true if type is HTMLMgButtonElement\n */\nconst isButton = (element: unknown): element is HTMLMgButtonElement => typeof element === 'object' && ['MG-BUTTON', 'BUTTON'].includes((element as Element).tagName);\n\n/**\n * @slot - Element that will display the tooltip\n * @slot content - Tooltip content\n */\n@Component({\n tag: 'mg-tooltip',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-tooltip.css',\n shadow: true,\n})\nexport class MgTooltip {\n /************\n * Internal *\n ************/\n\n private floatingUICleanup: ReturnType<typeof autoUpdate>;\n private mgTooltipContent: HTMLMgTooltipContentElement;\n private tooltipedElement: HTMLElement;\n private windows: Window[];\n private hasCustomTabIndex: boolean;\n\n // tooltip actions guards\n private guard: GuardType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTooltipElement;\n\n /**\n * Sets an `id` attribute.\n * Needed by the input for accessibility `aria-decribedby`.\n */\n @Prop() identifier: string = createID('mg-tooltip');\n @Watch('identifier')\n watchIdentifier(newValue: MgTooltip['identifier']): void {\n if (!isValideID(newValue)) {\n throw new Error(`<mg-tooltip> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n // use renderTooltipContent to update tooltip-content id\n this.renderTooltipContent();\n }\n\n /**\n * Displayed message in the tooltip\n */\n @Prop() message!: string;\n @Watch('message')\n watchMessage(newValue: MgTooltip['message']): void {\n if (!isValidString(newValue)) {\n throw new Error(`<mg-tooltip> prop \"message\" is required and must be a string. Passed value: ${toString(newValue)}.`);\n }\n if (this.mgTooltipContent !== undefined) this.mgTooltipContent.message = newValue;\n }\n\n /**\n * Tooltip placement\n */\n @Prop({ mutable: true }) placement: TooltipPlacementType = 'bottom';\n @Watch('placement')\n watchPlacement(newValue): void {\n if (!isFloatingUIPlacement(newValue)) this.placement = 'bottom';\n }\n\n /**\n * Display tooltip\n */\n @Prop({ mutable: true }) display = false;\n @Watch('display')\n watchDisplay(newValue: MgTooltip['display']): void {\n if (newValue) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Disable tooltip\n */\n @Prop() disabled = false;\n @Watch('disabled')\n watchDisabled(newValue: MgTooltip['disabled']): void {\n if (this.hasCustomTabIndex) {\n if (newValue) this.tooltipedElement.removeAttribute('tabindex');\n else if (!this.tooltipedElement.hasAttribute('tabindex')) this.tooltipedElement.setAttribute('tabindex', '0');\n }\n }\n\n /**\n * Show tooltip\n */\n private show = (): void => {\n // Make the tooltip visible\n this.mgTooltipContent.dataset.show = '';\n // hide when click outside on nextTick to prevent event to trigger after creation\n nextTick(() => {\n this.windows.forEach((localWindow: Window) => {\n localWindow.addEventListener('click', this.handleClickOutside, false);\n localWindow.addEventListener('keydown', this.handlePressEscape, false);\n });\n });\n };\n\n /**\n * Hide tooltip\n */\n private hide = (): void => {\n // Hide the tooltip\n this.mgTooltipContent.removeAttribute('data-show');\n // Remove event listener\n this.windows.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.handleClickOutside, false);\n localWindow.removeEventListener('keyboard', this.handlePressEscape, false);\n });\n };\n\n /**\n * Check if clicked outside of component and hide tooltip\n * @param event - mouse event\n */\n private handleClickOutside = (event: MouseEvent & { target: HTMLElement }): void => {\n if (event.target.closest('mg-tooltip') !== this.element) this.setDisplay(false);\n };\n\n /**\n * Check if 'Escape' key is pressed of component and hide tooltip\n * @param event - keyboard event\n */\n private handlePressEscape = (event: KeyboardEvent): void => {\n if (event.code === 'Escape') {\n this.setDisplay(false);\n this.resetGuard();\n }\n };\n\n /**\n * Method to set display prop\n * @param newValue - display prop new value\n * @param condition - additionnal condition to apply display prop newValue\n */\n private setDisplay = (newValue: MgTooltip['display'], condition = true): void => {\n if (!this.disabled && condition) this.display = newValue;\n };\n\n /**\n * Action for tooltip element and tooltiped element mouse listener\n * @param elementGuard - tooltip element guard\n * @param eventName - event name\n * @param conditionalGuard - guard condition\n */\n private tooltipMouseListenerAction = (elementGuard: GuardType, eventName: 'mouseenter' | 'mouseleave', conditionalGuard: GuardType): void => {\n // active FOCUS guard cancel process\n if ([Guard.FOCUS, Guard.DISABLE_ON_CLICK].includes(this.guard)) {\n return;\n }\n\n // Update guard by element guard\n this.guard = elementGuard;\n\n if (eventName !== 'mouseenter') {\n // process action in the next event loop macro task\n setTimeout(() => {\n this.setDisplay(false, this.guard !== conditionalGuard);\n this.resetGuard();\n }, 100);\n } else if (this.guard === Guard.HOVER_TOOLTIPED_ELEMENT) {\n this.setDisplay(true);\n }\n };\n\n /**\n * Method to reset guard value\n */\n private resetGuard = (): void => {\n this.guard = undefined;\n };\n\n /**\n * Update slot content when it is a mg-button\n * @param mgButton - slotted mg-button\n */\n private setMgButtonWrapper = (mgButton: HTMLMgButtonElement): void => {\n const buttonWrapperClass = 'mg-c-tooltip__mg-button-wrapper';\n const hasButtonWrapper = mgButton.parentElement.classList.contains(buttonWrapperClass);\n // For disabled mg-button, we need to wrap it in a new element\n // We bind handlers to this new element to keep listener features as workaround to disabled mg-button `pointer-events: none`\n // AND to prevent multiple nested wrappers from rendering when a new render is called with a disabled mg-button\n if (mgButton.disabled && !hasButtonWrapper) {\n // wrap mg-button in a div\n const div = document.createElement('div');\n div.classList.add(buttonWrapperClass);\n mgButton.parentNode.insertBefore(div, mgButton);\n div.appendChild(mgButton);\n\n // update tooltipElement\n this.setTooltipedElement(div);\n } else if (!mgButton.disabled && hasButtonWrapper) {\n this.element.firstElementChild.replaceWith(mgButton);\n\n // update tooltipElement\n this.setTooltipedElement(mgButton);\n }\n };\n\n /**\n * Set Floating UI instance\n * @param strategy - Floating UI strategy to apply on instance\n */\n private setFloatingUI = (strategy: Strategy): void => {\n // Initial styles configuration\n Object.assign(this.mgTooltipContent.style, {\n position: strategy,\n top: '0',\n left: '0',\n transform: 'translate(0, 0)',\n });\n\n // Create Floating UI instance with autoUpdate\n this.floatingUICleanup = autoUpdate(this.tooltipedElement, this.mgTooltipContent, () => {\n computePosition(this.tooltipedElement, this.mgTooltipContent, {\n placement: this.placement as Placement,\n strategy,\n middleware: [offset(8), flip(), shift({ limiter: limitShift() }), arrow({ element: this.mgTooltipContent.querySelector('[data-floating-arrow]') })],\n }).then(({ x, y, placement, middlewareData }) => {\n Object.assign(this.mgTooltipContent.style, {\n transform: !isNaN(x) && !isNaN(y) ? `translate(${x}px, ${y}px)` : undefined,\n });\n\n // Update arrow style\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n const staticSide = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]];\n\n const arrowElement: HTMLElement = this.mgTooltipContent.querySelector('[data-floating-arrow]');\n // https://floating-ui.com/docs/arrow\n // Unlike the floating element, which has both coordinates defined at all times, the arrow only has one defined.\n // Due to this, either x or y will be undefined, depending on the side of placement.\n // The above code uses `isNaN` to check for null and undefined simultaneously.\n // Don’t remove `isNaN`, because either value can be falsy (0), causing a bug!\n const numberToPx = (number: number): string => (!isNaN(number) ? `${number}px` : '');\n\n Object.assign(arrowElement.style, {\n left: numberToPx(arrowX),\n top: numberToPx(arrowY),\n [staticSide]: '-4px',\n position: 'absolute',\n });\n\n this.mgTooltipContent.setAttribute('data-placement', placement);\n });\n });\n };\n\n /**\n * Define selected element to become tooltip selector and init listeners\n * @param element - tooltiped element\n */\n private setTooltipedElement = (element: HTMLElement): void => {\n this.tooltipedElement = element;\n\n // Manage tooltipedElement focus events\n this.tooltipedElement.addEventListener('focus', () => {\n this.guard = Guard.FOCUS;\n this.setDisplay(true);\n });\n\n // as `click` event is the composition of `mousedown` and `mouseup` event,\n // and `click` event trigger `focus` event after a success `mousedown` wich set the `guard` to `Guard.FOCUS`\n // we reset the guard on `mouseup` event to unlock tooltip\n this.tooltipedElement.addEventListener('mouseup', () => {\n this.resetGuard();\n });\n\n this.tooltipedElement.addEventListener('blur', () => {\n this.resetGuard();\n this.setDisplay(false);\n });\n\n // manage tooltipElement & tooltipedElement mouseenter/mouseleave events\n this.tooltipedElement.addEventListener('mouseenter', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseenter', Guard.HOVER_TOOLTIP_ELEMENT);\n });\n\n this.tooltipedElement.addEventListener('mouseleave', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseleave', Guard.HOVER_TOOLTIP_ELEMENT);\n });\n };\n\n /**\n * Set button mutation observer\n * @param mgButton - mg-button to observe\n */\n private setMgButtonMutationObserver = (mgButton: HTMLMgButtonElement): void => {\n new MutationObserver(mutationList => {\n // stop process when none of mutations attributed is disabled\n if (!mutationList.some(mutation => ['aria-disabled', 'disabled'].includes(mutation.attributeName))) return;\n\n // set guard when one of mutations is for a disabled with disabled-on-click\n if (mutationList.some((mutation: MutationRecord & { target: HTMLMgButtonElement }) => mutation.target.disabled && mutation.target.disableOnClick)) {\n this.guard = Guard.DISABLE_ON_CLICK;\n }\n\n // when the disabled-on-click guard is running we stop process\n if (this.guard === Guard.DISABLE_ON_CLICK) return;\n\n // update button wrapper\n this.setMgButtonWrapper(mgButton);\n\n // Since Firefox doesn't trigger a \"blur\" event when the \"disabled\" attribute is added or removed from a button\n // we have to manually unlock the guard because the \"blur\" handler of the tooltipedElement won't do it.\n this.resetGuard();\n\n // update Floating UI instance\n this.floatingUICleanup();\n this.setFloatingUI(this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed');\n }).observe(mgButton, { attributes: true });\n };\n\n /**\n * Set tooltiped element aria-describedby\n * @param element - element to update\n */\n private setAriaDescribedby = (element: HTMLElement): void => {\n // Set aria-describedby\n if (!element.hasAttribute('aria-describedby')) {\n this.tooltipedElement.setAttribute('aria-describedby', this.identifier);\n } else {\n // We ensure to have uniq ids\n element.setAttribute('aria-describedby', `${[...new Set([...element.getAttribute('aria-describedby').split(' '), this.identifier])].join(' ')}`);\n }\n };\n\n /**\n * Render tooltip content element and init listeners\n */\n private renderTooltipContent(): void {\n if (this.mgTooltipContent !== undefined) {\n this.mgTooltipContent.setAttribute('id', this.identifier);\n } else {\n this.mgTooltipContent = document.createElement('mg-tooltip-content');\n this.mgTooltipContent.setAttribute('slot', 'content');\n this.mgTooltipContent.setAttribute('id', this.identifier);\n\n const arrow = document.createElement('div');\n arrow.setAttribute('slot', 'arrow');\n arrow.dataset.floatingArrow = '';\n this.mgTooltipContent.appendChild(arrow);\n\n // manage tooltipElement & tooltipedElement mouseenter/mouseleave events\n this.mgTooltipContent.addEventListener('mouseenter', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, 'mouseenter', Guard.HOVER_TOOLTIPED_ELEMENT);\n });\n this.mgTooltipContent.addEventListener('mouseleave', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, 'mouseleave', Guard.HOVER_TOOLTIPED_ELEMENT);\n });\n\n // append tooltip element to component\n this.element.appendChild(this.mgTooltipContent);\n }\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * set variables\n */\n componentWillLoad(): void {\n // Get windows to attach events\n this.windows = getWindows(window);\n\n // Get tooltip element\n this.renderTooltipContent();\n\n //validate properties\n this.watchPlacement(this.placement);\n this.watchDisabled(this.disabled);\n this.watchMessage(this.message);\n this.watchIdentifier(this.identifier);\n }\n\n /**\n * Get slotted element\n * Check if it already contain an interactive element, if not we need to add a tabIndex attribute\n * We need to attach the focused element to the tooltip (aria-describedby)\n */\n componentDidLoad(): void {\n // get slotted element wich is not the tooltip\n const slotElement: HTMLElement = this.element.querySelector(`*:not(#${this.identifier})`);\n\n // Get interactive element\n const interactiveElement: HTMLElement = slotElement.matches(focusableElements) ? slotElement : slotElement.shadowRoot?.querySelector(focusableElements);\n\n this.setTooltipedElement(interactiveElement || slotElement);\n\n // Check if slotted element is a disabled mg-button\n // In this case we wrap the mg-button into a div to enable the tooltip\n if (isButton(slotElement)) {\n this.setMgButtonMutationObserver(slotElement);\n this.setMgButtonWrapper(slotElement);\n }\n\n // Add tabindex to slotted element if we can't find any interactive element\n if (!this.disabled && [undefined, null].includes(interactiveElement)) {\n this.hasCustomTabIndex = true;\n slotElement.tabIndex = 0;\n // Add role on non-interactive element to work with \"aria-describedby\" for screen readers\n slotElement.setAttribute('role', 'button');\n }\n\n // apply a11y aria\n this.setAriaDescribedby(slotElement);\n\n // set Tooltip\n this.setFloatingUI(this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed');\n\n // add document keyboard handler\n document.addEventListener('keydown', this.handlePressEscape);\n\n // check props\n this.watchDisplay(this.display);\n }\n\n /**\n * update popper position after props change on component did update hook to benefit from render ended\n */\n componentDidUpdate(): void {\n this.floatingUICleanup();\n this.setFloatingUI(this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed');\n }\n\n /**\n * remove listeners\n */\n disconnectedCallback(): void {\n document.removeEventListener('keydown', this.handlePressEscape);\n this.windows?.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.handleClickOutside, false);\n localWindow.removeEventListener('keydown', this.handlePressEscape, false);\n });\n // cleanup Floating UI\n this.floatingUICleanup();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <slot></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-tooltip2.js","mappings":";;;;;AAKO,MAAM,KAAK,GAA8B;AAC9C,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,qBAAqB,EAAE,cAAc;AACrC,IAAA,uBAAuB,EAAE,gBAAgB;AACzC,IAAA,gBAAgB,EAAE,gBAAgB;CACnC;;ACVD,MAAM,YAAY,GAAG,yYAAyY;;ACK9Z;;;;AAIG;AACH,MAAM,QAAQ,GAAG,CAAC,OAAgB,KAAqC,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAE,OAAmB,CAAC,OAAO,CAAC;MAUvJ,SAAS,iBAAAA,kBAAA,CAAA,MAAA,SAAA,SAAA,WAAA,CAAA;AALtB,IAAA,WAAA,GAAA;;;;AA6BE;;;AAGG;AACK,QAAA,IAAA,CAAA,UAAU,GAAWC,EAAQ,CAAC,YAAY,CAAC;AAsBnD;;AAEG;AACsB,QAAA,IAAS,CAAA,SAAA,GAAyB,QAAQ;AAMnE;;AAEG;AACsB,QAAA,IAAO,CAAA,OAAA,GAAG,KAAK;AAUxC;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AASxB;;AAEG;AACK,QAAA,IAAI,CAAA,IAAA,GAAG,MAAW;;YAExB,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,GAAG,EAAE;;YAEvCC,EAAQ,CAAC,MAAK;gBACZ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAmB,KAAI;oBAC3C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I,EAAC,SAAS,EAAQ,CAAA,CACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","createID","nextTick","isValideID","toString","isValidString","getWindows","focusableElements"],"sources":["src/components/atoms/mg-tooltip/mg-tooltip.conf.tsx","../styles/dist/components/mg-tooltip.css?tag=mg-tooltip&encapsulation=shadow","src/components/atoms/mg-tooltip/mg-tooltip.tsx"],"sourcesContent":["import { type ExtendedPlacement, placements } from '../../../utils/floating-ui.utils';\nexport * from '../../../utils/floating-ui.utils';\n\nexport type GuardType = 'focus' | 'hoverTooltip' | 'hoverTooltiped' | 'disableOnClick';\n\nexport const Guard: Record<string, GuardType> = {\n FOCUS: 'focus',\n HOVER_TOOLTIP_ELEMENT: 'hoverTooltip',\n HOVER_TOOLTIPED_ELEMENT: 'hoverTooltiped',\n DISABLE_ON_CLICK: 'disableOnClick',\n};\n\n/**\n * Placement type from placements\n */\nexport type TooltipPlacementType = ExtendedPlacement & (typeof placements)[number];\n","/*!\n * @prop --mg-c-tooltip-border-radius: Defines the border radius of the tooltip. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-tooltip-color-background: Defines the background color of the tooltip. Default value: `--mg-b-color-dark`.\n * @prop --mg-c-tooltip-color-text: Defines the font color of the tooltip. Default value: `--mg-b-color-light`.\n */:host{display:inline-block}/*# sourceMappingURL=mg-tooltip.css.map */\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { createID, focusableElements, getWindows, isValideID, isValidString, nextTick, toString } from '@mgdis/stencil-helpers';\nimport { computePosition, autoUpdate, flip, shift, limitShift, offset, arrow, type Strategy, type Placement } from '@floating-ui/dom';\nimport { type GuardType, Guard, type TooltipPlacementType, isFloatingUIPlacement, getTransformation, numberToPx } from './mg-tooltip.conf';\n\n/**\n * HTMLMgButtonElement type guard\n * @param element - element to check\n * @returns return true if type is HTMLMgButtonElement\n */\nconst isButton = (element: unknown): element is HTMLMgButtonElement => typeof element === 'object' && ['MG-BUTTON', 'BUTTON'].includes((element as Element).tagName);\n\n/**\n * @slot - Element that will display the tooltip\n */\n@Component({\n tag: 'mg-tooltip',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-tooltip.css',\n shadow: true,\n})\nexport class MgTooltip {\n /************\n * Internal *\n ************/\n\n private mgTooltipContent: HTMLMgTooltipContentElement;\n private tooltipedElement: HTMLElement;\n private arrowElement: HTMLElement;\n private windows: Window[];\n private hasCustomTabIndex: boolean;\n private tooltipStrategy: Strategy;\n\n // tooltip actions guards\n private guard: GuardType;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTooltipElement;\n\n /**\n * Sets an `id` attribute.\n * Needed by the input for accessibility `aria-decribedby`.\n */\n @Prop() identifier: string = createID('mg-tooltip');\n @Watch('identifier')\n watchIdentifier(newValue: MgTooltip['identifier']): void {\n if (!isValideID(newValue)) {\n throw new Error(`<mg-tooltip> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n // use renderTooltipContent to update tooltip-content id\n this.renderTooltipContent();\n }\n\n /**\n * Displayed message in the tooltip\n */\n @Prop() message!: string;\n @Watch('message')\n watchMessage(newValue: MgTooltip['message']): void {\n if (!isValidString(newValue)) {\n throw new Error(`<mg-tooltip> prop \"message\" is required and must be a string. Passed value: ${toString(newValue)}.`);\n }\n if (this.mgTooltipContent !== undefined) this.mgTooltipContent.message = newValue;\n }\n\n /**\n * Tooltip placement\n */\n @Prop({ mutable: true }) placement: TooltipPlacementType = 'bottom';\n @Watch('placement')\n watchPlacement(newValue: TooltipPlacementType): void {\n if (!isFloatingUIPlacement(newValue)) this.placement = 'bottom';\n }\n\n /**\n * Display tooltip\n */\n @Prop({ mutable: true }) display = false;\n @Watch('display')\n watchDisplay(newValue: MgTooltip['display']): void {\n if (newValue) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Disable tooltip\n */\n @Prop() disabled = false;\n @Watch('disabled')\n watchDisabled(newValue: MgTooltip['disabled']): void {\n if (this.hasCustomTabIndex) {\n if (newValue) this.tooltipedElement.removeAttribute('tabindex');\n else if (!this.tooltipedElement.hasAttribute('tabindex')) this.tooltipedElement.setAttribute('tabindex', '0');\n }\n }\n\n /**\n * Show tooltip\n */\n private show = (): void => {\n // Make the tooltip visible\n this.mgTooltipContent.dataset.show = '';\n // hide when click outside on nextTick to prevent event to trigger after creation\n nextTick(() => {\n this.windows.forEach((localWindow: Window) => {\n localWindow.addEventListener('click', this.handleClickOutside, false);\n localWindow.addEventListener('keydown', this.handlePressEscape, false);\n });\n });\n this.updateTooltip();\n };\n\n /**\n * Hide tooltip\n */\n private hide = (): void => {\n // Hide the tooltip\n this.mgTooltipContent.removeAttribute('data-show');\n // Remove event listener\n this.windows.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.handleClickOutside, false);\n localWindow.removeEventListener('keyboard', this.handlePressEscape, false);\n });\n };\n\n /**\n * Check if clicked outside of component and hide tooltip\n * @param event - mouse event\n */\n private handleClickOutside = (event: MouseEvent & { target: HTMLElement }): void => {\n if (event.target.closest('mg-tooltip') !== this.element) this.setDisplay(false);\n };\n\n /**\n * Check if 'Escape' key is pressed of component and hide tooltip\n * @param event - keyboard event\n */\n private handlePressEscape = (event: KeyboardEvent): void => {\n if (event.code === 'Escape') {\n this.setDisplay(false);\n this.resetGuard();\n }\n };\n\n /**\n * Method to set display prop\n * @param newValue - display prop new value\n * @param condition - additionnal condition to apply display prop newValue\n */\n private setDisplay = (newValue: MgTooltip['display'], condition = true): void => {\n if (!this.disabled && condition && this.display !== newValue) {\n this.display = newValue;\n }\n };\n\n /**\n * Action for tooltip element and tooltiped element mouse listener\n * @param elementGuard - tooltip element guard\n * @param eventName - event name\n * @param conditionalGuard - guard condition\n */\n private tooltipMouseListenerAction = (elementGuard: GuardType, eventName: 'mouseenter' | 'mouseleave', conditionalGuard: GuardType): void => {\n // active FOCUS guard cancel process\n if ([Guard.FOCUS, Guard.DISABLE_ON_CLICK].includes(this.guard)) {\n return;\n }\n\n // Update guard by element guard\n this.guard = elementGuard;\n\n if (eventName !== 'mouseenter') {\n // process action in the next event loop macro task\n setTimeout(() => {\n this.setDisplay(false, this.guard !== conditionalGuard);\n this.resetGuard();\n }, 100);\n } else if (this.guard === Guard.HOVER_TOOLTIPED_ELEMENT) {\n this.setDisplay(true);\n }\n };\n\n /**\n * Method to reset guard value\n */\n private resetGuard = (): void => {\n this.guard = undefined;\n };\n\n /**\n * Update slot content when it is a mg-button\n * @param mgButton - slotted mg-button\n */\n private setMgButtonWrapper = (mgButton: HTMLMgButtonElement): void => {\n const buttonWrapperClass = 'mg-c-tooltip__mg-button-wrapper';\n const hasButtonWrapper = mgButton.parentElement.classList.contains(buttonWrapperClass);\n // For disabled mg-button, we need to wrap it in a new element\n // We bind handlers to this new element to keep listener features as workaround to disabled mg-button `pointer-events: none`\n // AND to prevent multiple nested wrappers from rendering when a new render is called with a disabled mg-button\n if (mgButton.disabled && !hasButtonWrapper) {\n // wrap mg-button in a div\n const div = document.createElement('div');\n div.classList.add(buttonWrapperClass);\n mgButton.parentNode.insertBefore(div, mgButton);\n div.appendChild(mgButton);\n\n // update tooltipElement\n this.setTooltipedElement(div);\n } else if (!mgButton.disabled && hasButtonWrapper) {\n this.element.firstElementChild.replaceWith(mgButton);\n\n // update tooltipElement\n this.setTooltipedElement(mgButton);\n }\n };\n\n /**\n * Update tooltip position\n * @returns autoUpdate function\n */\n private updateTooltip = () =>\n autoUpdate(this.tooltipedElement, this.mgTooltipContent, async () => {\n // Placement\n const { x, y, placement, middlewareData } = await computePosition(this.tooltipedElement, this.mgTooltipContent, {\n placement: this.placement as Placement,\n strategy: this.tooltipStrategy,\n middleware: [\n offset(8),\n flip(),\n shift({\n limiter: limitShift(),\n }),\n arrow({ element: this.arrowElement }),\n ],\n });\n\n // Positioning\n Object.assign(this.mgTooltipContent.style, {\n position: this.tooltipStrategy,\n transform: getTransformation(x, y),\n });\n\n // Arrow positioning\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n const staticSide = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]];\n\n Object.assign(this.arrowElement.style, {\n left: numberToPx(arrowX),\n top: numberToPx(arrowY),\n [staticSide]: '-4px',\n });\n\n this.mgTooltipContent.setAttribute('data-placement', placement);\n });\n\n /**\n * Define selected element to become tooltip selector and init listeners\n * @param element - tooltiped element\n */\n private setTooltipedElement = (element: HTMLElement): void => {\n this.tooltipedElement = element;\n\n // Manage tooltipedElement focus events\n this.tooltipedElement.addEventListener('focus', () => {\n this.guard = Guard.FOCUS;\n this.setDisplay(true);\n });\n\n // as `click` event is the composition of `mousedown` and `mouseup` event,\n // and `click` event trigger `focus` event after a success `mousedown` wich set the `guard` to `Guard.FOCUS`\n // we reset the guard on `mouseup` event to unlock tooltip\n this.tooltipedElement.addEventListener('mouseup', () => {\n this.resetGuard();\n });\n\n this.tooltipedElement.addEventListener('blur', () => {\n this.resetGuard();\n this.setDisplay(false);\n });\n\n // manage tooltipElement & tooltipedElement mouseenter/mouseleave events\n this.tooltipedElement.addEventListener('mouseenter', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseenter', Guard.HOVER_TOOLTIP_ELEMENT);\n });\n\n this.tooltipedElement.addEventListener('mouseleave', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseleave', Guard.HOVER_TOOLTIP_ELEMENT);\n });\n };\n\n /**\n * Set button mutation observer\n * @param mgButton - mg-button to observe\n */\n private setMgButtonMutationObserver = (mgButton: HTMLMgButtonElement): void => {\n new MutationObserver(mutationList => {\n // stop process when none of mutations attributed is disabled\n if (!mutationList.some(mutation => ['aria-disabled', 'disabled'].includes(mutation.attributeName))) return;\n\n // set guard when one of mutations is for a disabled with disabled-on-click\n if (mutationList.some((mutation: MutationRecord & { target: HTMLMgButtonElement }) => mutation.target.disabled && mutation.target.disableOnClick)) {\n this.guard = Guard.DISABLE_ON_CLICK;\n return;\n }\n\n // update button wrapper\n this.setMgButtonWrapper(mgButton);\n\n // Since Firefox doesn't trigger a \"blur\" event when the \"disabled\" attribute is added or removed from a button\n // we have to manually unlock the guard because the \"blur\" handler of the tooltipedElement won't do it.\n this.resetGuard();\n\n // update Floating UI instance\n this.updateTooltip();\n }).observe(mgButton, { attributes: true });\n };\n\n /**\n * Set tooltiped element aria-describedby\n * @param element - element to update\n */\n private setAriaDescribedby = (element: HTMLElement): void => {\n // Set aria-describedby\n if (!element.hasAttribute('aria-describedby')) {\n this.tooltipedElement.setAttribute('aria-describedby', this.identifier);\n } else {\n // We ensure to have uniq ids\n element.setAttribute('aria-describedby', `${[...new Set([...element.getAttribute('aria-describedby').split(' '), this.identifier])].join(' ')}`);\n }\n };\n\n /**\n * Render tooltip content element and init listeners\n */\n private renderTooltipContent(): void {\n if (this.mgTooltipContent !== undefined) {\n this.mgTooltipContent.setAttribute('id', this.identifier);\n } else {\n this.mgTooltipContent = document.createElement('mg-tooltip-content');\n this.mgTooltipContent.setAttribute('slot', 'content');\n this.mgTooltipContent.setAttribute('id', this.identifier);\n\n const arrow = document.createElement('div');\n arrow.setAttribute('slot', 'arrow');\n arrow.dataset.floatingArrow = '';\n this.mgTooltipContent.appendChild(arrow);\n\n // manage tooltipElement & tooltipedElement mouseenter/mouseleave events\n this.mgTooltipContent.addEventListener('mouseenter', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, 'mouseenter', Guard.HOVER_TOOLTIPED_ELEMENT);\n });\n this.mgTooltipContent.addEventListener('mouseleave', () => {\n this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, 'mouseleave', Guard.HOVER_TOOLTIPED_ELEMENT);\n });\n\n // append tooltip element to component\n this.element.appendChild(this.mgTooltipContent);\n }\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * set variables\n */\n componentWillLoad(): void {\n // Get windows to attach events\n this.windows = getWindows(window);\n\n // Get tooltip element\n this.renderTooltipContent();\n\n //validate properties\n this.watchPlacement(this.placement);\n this.watchDisabled(this.disabled);\n this.watchMessage(this.message);\n this.watchIdentifier(this.identifier);\n\n // define if the tooltip is inside a popover\n this.tooltipStrategy = this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed';\n }\n\n /**\n * Get slotted element\n * Check if it already contain an interactive element, if not we need to add a tabIndex attribute\n * We need to attach the focused element to the tooltip (aria-describedby)\n */\n componentDidLoad(): void {\n // get slotted element wich is not the tooltip\n const slotElement: HTMLElement = this.element.querySelector(`*:not(#${this.identifier})`);\n\n // Get interactive element\n const interactiveElement: HTMLElement = slotElement.matches(focusableElements) ? slotElement : slotElement.shadowRoot?.querySelector(focusableElements);\n\n this.setTooltipedElement(interactiveElement || slotElement);\n\n // Set arrow element\n this.arrowElement = this.mgTooltipContent.querySelector('[data-floating-arrow]');\n\n // Check if slotted element is a disabled mg-button\n // In this case we wrap the mg-button into a div to enable the tooltip\n if (isButton(slotElement)) {\n this.setMgButtonMutationObserver(slotElement);\n this.setMgButtonWrapper(slotElement);\n }\n\n // Add tabindex to slotted element if we can't find any interactive element\n if (!this.disabled && [undefined, null].includes(interactiveElement)) {\n this.hasCustomTabIndex = true;\n slotElement.tabIndex = 0;\n // Add role on non-interactive element to work with \"aria-describedby\" for screen readers\n slotElement.setAttribute('role', 'button');\n }\n\n // apply a11y aria\n this.setAriaDescribedby(slotElement);\n\n // add document keyboard handler\n document.addEventListener('keydown', this.handlePressEscape);\n\n // check props\n this.watchDisplay(this.display);\n }\n\n /**\n * update popper position after props change on component did update hook to benefit from render ended\n */\n componentDidUpdate(): void {\n this.updateTooltip();\n }\n\n /**\n * remove listeners\n */\n disconnectedCallback(): void {\n document.removeEventListener('keydown', this.handlePressEscape);\n this.windows?.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.handleClickOutside, false);\n localWindow.removeEventListener('keydown', this.handlePressEscape, false);\n });\n this.updateTooltip?.();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <slot></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,6 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };
4
+ //# sourceMappingURL=app-globals-DQuL1Twl.js.map
5
+
6
+ //# sourceMappingURL=app-globals-DQuL1Twl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-globals-DQuL1Twl.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\n"],"names":[],"mappings":"AAAY,MAAC,aAAa,GAAG,MAAM;;;;"}