@mgdis/mg-components 6.2.0 → 6.4.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 (238) hide show
  1. package/dist/cjs/{index-52d5f3d4.js → index-911898e4.js} +410 -266
  2. package/dist/cjs/index-911898e4.js.map +1 -0
  3. package/dist/cjs/{index-cc11af95.js → index-a3269bfc.js} +3 -3
  4. package/dist/cjs/{index-cc11af95.js.map → index-a3269bfc.js.map} +1 -1
  5. package/dist/cjs/{index.es-ac7c22e3.js → index.es-325100d7.js} +47 -47
  6. package/dist/cjs/index.es-325100d7.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/mg-action-more_36.cjs.entry.js +1414 -983
  9. package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
  10. package/dist/cjs/mg-alert.cjs.entry.js +17 -12
  11. package/dist/cjs/mg-alert.cjs.entry.js.map +1 -1
  12. package/dist/cjs/mg-components.cjs.js +3 -3
  13. package/dist/cjs/mg-components.cjs.js.map +1 -1
  14. package/dist/cjs/mg-loader.cjs.entry.js +6 -8
  15. package/dist/cjs/mg-loader.cjs.entry.js.map +1 -1
  16. package/dist/cjs/mg-progress.cjs.entry.js +27 -12
  17. package/dist/cjs/mg-progress.cjs.entry.js.map +1 -1
  18. package/dist/collection/collection-manifest.json +2 -2
  19. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +10 -3
  20. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js.map +1 -1
  21. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +15 -4
  22. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-badge/mg-badge.js +15 -4
  24. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-button/mg-button.conf.js +4 -0
  26. package/dist/collection/components/atoms/mg-button/mg-button.conf.js.map +1 -1
  27. package/dist/collection/components/atoms/mg-button/mg-button.js +112 -12
  28. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  29. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
  30. package/dist/collection/components/atoms/mg-divider/mg-divider.js +9 -1
  31. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  32. package/dist/collection/components/atoms/mg-icon/mg-icon.js +22 -6
  33. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  34. package/dist/collection/components/atoms/mg-tag/mg-tag.js +14 -4
  35. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  36. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +3 -4
  37. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
  38. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +28 -6
  39. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  40. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +50 -13
  41. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +1 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +29 -11
  43. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +106 -33
  45. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  46. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +99 -36
  47. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  48. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +130 -35
  49. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  50. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +87 -25
  51. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  52. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +86 -26
  53. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  54. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +92 -30
  55. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  56. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +109 -32
  57. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  58. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +109 -29
  59. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  60. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +67 -21
  61. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  62. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +16 -70
  63. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -1
  64. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +101 -89
  65. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  66. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +194 -157
  67. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  68. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +19 -8
  69. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  70. package/dist/collection/components/molecules/mg-alert/mg-alert.js +31 -6
  71. package/dist/collection/components/molecules/mg-alert/mg-alert.js.map +1 -1
  72. package/dist/collection/components/molecules/mg-details/mg-details.js +17 -5
  73. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  74. package/dist/collection/components/molecules/mg-form/mg-form.js +48 -16
  75. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  76. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +13 -3
  77. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  78. package/dist/collection/components/molecules/mg-loader/mg-loader.js +5 -5
  79. package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -1
  80. package/dist/collection/components/molecules/mg-message/mg-message.js +22 -6
  81. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  82. package/dist/collection/components/molecules/mg-modal/mg-modal.js +54 -11
  83. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  84. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +28 -9
  85. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  86. package/dist/collection/components/molecules/mg-panel/mg-panel.js +48 -13
  87. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  88. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +10 -2
  89. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-popover/mg-popover.js +61 -7
  91. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  92. package/dist/collection/components/molecules/mg-progress/mg-progress.js +26 -1
  93. package/dist/collection/components/molecules/mg-progress/mg-progress.js.map +1 -1
  94. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +3 -2
  95. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  96. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +28 -8
  97. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  98. package/dist/collection/utils/behaviors.utils.js +44 -107
  99. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  100. package/dist/components/index.es.js +42 -42
  101. package/dist/components/index.es.js.map +1 -1
  102. package/dist/components/index2.js +2 -2
  103. package/dist/components/mg-action-more.js +15 -12
  104. package/dist/components/mg-action-more.js.map +1 -1
  105. package/dist/components/mg-alert.js +15 -10
  106. package/dist/components/mg-alert.js.map +1 -1
  107. package/dist/components/mg-badge2.js +13 -10
  108. package/dist/components/mg-badge2.js.map +1 -1
  109. package/dist/components/mg-button2.js +77 -16
  110. package/dist/components/mg-button2.js.map +1 -1
  111. package/dist/components/mg-card2.js +1 -1
  112. package/dist/components/mg-character-left2.js +8 -7
  113. package/dist/components/mg-character-left2.js.map +1 -1
  114. package/dist/components/mg-details.js +11 -7
  115. package/dist/components/mg-details.js.map +1 -1
  116. package/dist/components/mg-divider2.js +7 -1
  117. package/dist/components/mg-divider2.js.map +1 -1
  118. package/dist/components/mg-form.js +35 -21
  119. package/dist/components/mg-form.js.map +1 -1
  120. package/dist/components/mg-icon2.js +17 -11
  121. package/dist/components/mg-icon2.js.map +1 -1
  122. package/dist/components/mg-illustrated-message.js +10 -4
  123. package/dist/components/mg-illustrated-message.js.map +1 -1
  124. package/dist/components/mg-input-checkbox-paginated2.js +14 -10
  125. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  126. package/dist/components/mg-input-checkbox.js +73 -40
  127. package/dist/components/mg-input-checkbox.js.map +1 -1
  128. package/dist/components/mg-input-date.js +77 -46
  129. package/dist/components/mg-input-date.js.map +1 -1
  130. package/dist/components/mg-input-numeric.js +90 -45
  131. package/dist/components/mg-input-numeric.js.map +1 -1
  132. package/dist/components/mg-input-password.js +56 -28
  133. package/dist/components/mg-input-password.js.map +1 -1
  134. package/dist/components/mg-input-radio.js +59 -31
  135. package/dist/components/mg-input-radio.js.map +1 -1
  136. package/dist/components/mg-input-select2.js +60 -36
  137. package/dist/components/mg-input-select2.js.map +1 -1
  138. package/dist/components/mg-input-text2.js +71 -40
  139. package/dist/components/mg-input-text2.js.map +1 -1
  140. package/dist/components/mg-input-textarea.js +72 -36
  141. package/dist/components/mg-input-textarea.js.map +1 -1
  142. package/dist/components/mg-input-title2.js +11 -8
  143. package/dist/components/mg-input-title2.js.map +1 -1
  144. package/dist/components/mg-input-toggle.js +43 -25
  145. package/dist/components/mg-input-toggle.js.map +1 -1
  146. package/dist/components/mg-input2.js +37 -20
  147. package/dist/components/mg-input2.js.map +1 -1
  148. package/dist/components/mg-item-more2.js +146 -270
  149. package/dist/components/mg-item-more2.js.map +1 -1
  150. package/dist/components/mg-loader.js +4 -6
  151. package/dist/components/mg-loader.js.map +1 -1
  152. package/dist/components/mg-menu-item2.js +193 -149
  153. package/dist/components/mg-menu-item2.js.map +1 -1
  154. package/dist/components/mg-message2.js +21 -9
  155. package/dist/components/mg-message2.js.map +1 -1
  156. package/dist/components/mg-modal.js +36 -17
  157. package/dist/components/mg-modal.js.map +1 -1
  158. package/dist/components/mg-pagination2.js +21 -14
  159. package/dist/components/mg-pagination2.js.map +1 -1
  160. package/dist/components/mg-panel.js +37 -20
  161. package/dist/components/mg-panel.js.map +1 -1
  162. package/dist/components/mg-popover-content2.js +9 -3
  163. package/dist/components/mg-popover-content2.js.map +1 -1
  164. package/dist/components/mg-popover2.js +38 -10
  165. package/dist/components/mg-popover2.js.map +1 -1
  166. package/dist/components/mg-progress.js +26 -11
  167. package/dist/components/mg-progress.js.map +1 -1
  168. package/dist/components/mg-skip-links.js +2 -3
  169. package/dist/components/mg-skip-links.js.map +1 -1
  170. package/dist/components/mg-tabs.js +27 -17
  171. package/dist/components/mg-tabs.js.map +1 -1
  172. package/dist/components/mg-tag.js +12 -8
  173. package/dist/components/mg-tag.js.map +1 -1
  174. package/dist/components/mg-tooltip-content2.js +1 -2
  175. package/dist/components/mg-tooltip-content2.js.map +1 -1
  176. package/dist/components/mg-tooltip2.js +24 -12
  177. package/dist/components/mg-tooltip2.js.map +1 -1
  178. package/dist/esm/{index-81752ffe.js → index-1f32332a.js} +410 -266
  179. package/dist/esm/index-1f32332a.js.map +1 -0
  180. package/dist/esm/{index-f3d3fb70.js → index-9bd10f5d.js} +3 -3
  181. package/dist/esm/{index-f3d3fb70.js.map → index-9bd10f5d.js.map} +1 -1
  182. package/dist/esm/{index.es-940821a9.js → index.es-a2587b72.js} +43 -43
  183. package/dist/esm/index.es-a2587b72.js.map +1 -0
  184. package/dist/esm/loader.js +3 -3
  185. package/dist/esm/mg-action-more_36.entry.js +1414 -983
  186. package/dist/esm/mg-action-more_36.entry.js.map +1 -1
  187. package/dist/esm/mg-alert.entry.js +17 -12
  188. package/dist/esm/mg-alert.entry.js.map +1 -1
  189. package/dist/esm/mg-components.js +4 -4
  190. package/dist/esm/mg-components.js.map +1 -1
  191. package/dist/esm/mg-loader.entry.js +6 -8
  192. package/dist/esm/mg-loader.entry.js.map +1 -1
  193. package/dist/esm/mg-progress.entry.js +27 -12
  194. package/dist/esm/mg-progress.entry.js.map +1 -1
  195. package/dist/mg-components/mg-components.esm.js +1 -1
  196. package/dist/mg-components/mg-components.esm.js.map +1 -1
  197. package/dist/mg-components/p-0ead5317.entry.js +2 -0
  198. package/dist/mg-components/{p-31e6c1a7.entry.js.map → p-0ead5317.entry.js.map} +1 -1
  199. package/dist/mg-components/p-35898742.js +3 -0
  200. package/dist/mg-components/p-35898742.js.map +1 -0
  201. package/dist/mg-components/p-3b052ac0.entry.js +2 -0
  202. package/dist/mg-components/p-3b052ac0.entry.js.map +1 -0
  203. package/dist/mg-components/p-6810a565.entry.js +2 -0
  204. package/dist/mg-components/p-6810a565.entry.js.map +1 -0
  205. package/dist/mg-components/{p-ee51ec5e.js → p-b986c107.js} +2 -2
  206. package/dist/mg-components/p-b986c107.js.map +1 -0
  207. package/dist/mg-components/{p-a49e2b74.js → p-dc436f3c.js} +2 -2
  208. package/dist/mg-components/p-f48d964f.entry.js +2 -0
  209. package/dist/mg-components/p-f48d964f.entry.js.map +1 -0
  210. package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +9 -1
  211. package/dist/types/components/atoms/mg-button/mg-button.d.ts +11 -1
  212. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +6 -0
  213. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.d.ts +1 -15
  214. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +14 -30
  215. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +46 -37
  216. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +4 -0
  217. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +4 -0
  218. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +4 -0
  219. package/dist/types/components.d.ts +33 -15
  220. package/dist/types/utils/behaviors.utils.d.ts +15 -44
  221. package/ide/intellij/web-types.json +39 -11
  222. package/ide/vscode/html-custom-data.json +28 -6
  223. package/package.json +27 -37
  224. package/dist/cjs/index-52d5f3d4.js.map +0 -1
  225. package/dist/cjs/index.es-ac7c22e3.js.map +0 -1
  226. package/dist/esm/index-81752ffe.js.map +0 -1
  227. package/dist/esm/index.es-940821a9.js.map +0 -1
  228. package/dist/mg-components/p-2298352f.js +0 -3
  229. package/dist/mg-components/p-2298352f.js.map +0 -1
  230. package/dist/mg-components/p-31e6c1a7.entry.js +0 -2
  231. package/dist/mg-components/p-67c9be27.entry.js +0 -2
  232. package/dist/mg-components/p-67c9be27.entry.js.map +0 -1
  233. package/dist/mg-components/p-95895169.entry.js +0 -2
  234. package/dist/mg-components/p-95895169.entry.js.map +0 -1
  235. package/dist/mg-components/p-abddacc2.entry.js +0 -2
  236. package/dist/mg-components/p-abddacc2.entry.js.map +0 -1
  237. package/dist/mg-components/p-ee51ec5e.js.map +0 -1
  238. /package/dist/mg-components/{p-a49e2b74.js.map → p-dc436f3c.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"mg-icon.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-icon/mg-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAiB,KAAK,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GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Watch, State, Element } from '@stencil/core';\nimport { type IconType, sizes, type IconSizeType, variants, type IconVariantType, variantStyles, type IconVariantStyleType } from './mg-icon.conf';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { icons } from '../../../assets/icons';\n\n@Component({\n tag: 'mg-icon',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-icon.css',\n shadow: true,\n})\nexport class MgIcon {\n private svg: SVGSVGElement;\n\n /**\n * Icon HTML Element\n */\n @Element() element: HTMLMgIconElement;\n\n /**\n * Icon to display.\n */\n @Prop() icon!: IconType;\n @Watch('icon')\n validateIcon(newValue: MgIcon['icon'], oldValue?: MgIcon['icon']): void {\n if (!Object.keys(icons).includes(newValue)) throw new Error(`<mg-icon> prop \"icon\" must be one of: ${Object.keys(icons).join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--${oldValue}`);\n this.classCollection.add(`mg-c-icon--${newValue}`);\n this.renderIcon(newValue);\n }\n }\n\n /**\n * Define icon size\n */\n @Prop() size: IconSizeType = 'medium';\n @Watch('size')\n validateSize(newValue: MgIcon['size'], oldValue?: MgIcon['size']): void {\n if (!sizes.includes(newValue)) throw new Error(`<mg-icon> prop \"size\" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--size-${oldValue}`);\n this.classCollection.add(`mg-c-icon--size-${newValue}`);\n }\n }\n\n /**\n * Define icon variant color\n */\n @Prop() variant?: IconVariantType;\n @Watch('variant')\n validateVariant(newValue: MgIcon['variant'], oldValue?: MgIcon['variant']): void {\n if (newValue !== undefined) {\n if (!variants.includes(newValue)) throw new Error(`<mg-icon> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n this.setDefaultVariantStyle();\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--variant-${oldValue}`);\n this.classCollection.add(`mg-c-icon--variant-${newValue}`);\n }\n }\n }\n\n /**\n * Define icon color variant style\n * Add a color to the icon based on variant color with given style\n * 'full': Used to set a circular background with variant soft color and icon variant color\n * 'background': Used to set a circular background with variant soft color\n * 'icon': Used to set a color only to the icon\n */\n @Prop({ mutable: true }) variantStyle: IconVariantStyleType;\n @Watch('variantStyle')\n validateVariantStyle(newValue: MgIcon['variantStyle'], oldValue?: MgIcon['variantStyle']): void {\n if (newValue !== undefined) {\n if (!variantStyles.includes(newValue)) throw new Error(`<mg-icon> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--variant-style-${oldValue}`);\n this.classCollection.add(`mg-c-icon--variant-style-${newValue}`);\n }\n }\n }\n\n /**\n * Make the icon spin\n */\n @Prop() spin = false;\n @Watch('spin')\n handleSpin(newValue: MgIcon['spin']): void {\n if (newValue) {\n this.classCollection.add('mg-c-icon--spin');\n } else {\n this.classCollection.delete('mg-c-icon--spin');\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-icon']);\n\n /**\n * Method to set default varianStyle props\n * needeed has stencil doesn't know that props is mutated when updated in prop watcher\n */\n private setDefaultVariantStyle = (): void => {\n if (this.variantStyle === undefined) this.variantStyle = 'background';\n };\n\n /**\n * Render icon in shadowroot\n * @param icon - icon to render\n */\n private renderIcon = (icon: IconType): void => {\n this.element.shadowRoot.innerHTML = icons[icon];\n this.svg = this.element.shadowRoot.querySelector('svg');\n // update svg attributes\n this.svg.setAttribute('aria-hidden', 'true');\n this.svg.setAttribute('focusable', 'false');\n this.svg.setAttribute('class', this.classCollection.join());\n };\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateIcon(this.icon);\n this.validateSize(this.size);\n this.validateVariant(this.variant);\n this.validateVariantStyle(this.variantStyle);\n this.handleSpin(this.spin);\n // render icon\n this.renderIcon(this.icon);\n }\n\n /**\n * update html when component trigger changes\n */\n componentWillUpdate() {\n this.svg.setAttribute('class', this.classCollection.join());\n }\n}\n"]}
1
+ {"version":3,"file":"mg-icon.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-icon/mg-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAiB,KAAK,EAAqB,QAAQ,EAAwB,aAAa,EAA6B,MAAM,gBAAgB,CAAC;AACnJ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAO9C,MAAM,OAAO,MAAM;IALnB;QA2BE;;WAEG;QACK,SAAI,GAAiB,QAAQ,CAAC;QA6CtC;;WAEG;QACK,SAAI,GAAG,KAAK,CAAC;QAUrB;;WAEG;QACM,oBAAe,GAAc,IAAI,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAEnE;;;WAGG;QACK,2BAAsB,GAAG,GAAS,EAAE;YAC1C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS;gBAAE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACxE,CAAC,CAAC;QAEF;;;WAGG;QACK,eAAU,GAAG,CAAC,IAAc,EAAQ,EAAE;YAC5C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CA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ACjC,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IA4BD;;OAEG;IACH,iBAAiB;QACf,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,cAAc;QACd,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Watch, State, Element } from '@stencil/core';\nimport { type IconType, sizes, type IconSizeType, variants, type IconVariantType, variantStyles, type IconVariantStyleType } from './mg-icon.conf';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { icons } from '../../../assets/icons';\n\n@Component({\n tag: 'mg-icon',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-icon.css',\n shadow: true,\n})\nexport class MgIcon {\n private svg: SVGSVGElement;\n\n /**\n * Icon HTML Element\n */\n @Element() element: HTMLMgIconElement;\n\n /**\n * Icon to display.\n */\n @Prop() icon!: IconType;\n @Watch('icon')\n validateIcon(newValue: MgIcon['icon'], oldValue?: MgIcon['icon']): void {\n if (!Object.keys(icons).includes(newValue)) throw new Error(`<mg-icon> prop \"icon\" must be one of: ${Object.keys(icons).join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--${oldValue}`);\n this.classCollection.add(`mg-c-icon--${newValue}`);\n this.renderIcon(newValue);\n }\n }\n\n /**\n * Define icon size\n */\n @Prop() size: IconSizeType = 'medium';\n @Watch('size')\n validateSize(newValue: MgIcon['size'], oldValue?: MgIcon['size']): void {\n if (!sizes.includes(newValue)) throw new Error(`<mg-icon> prop \"size\" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--size-${oldValue}`);\n this.classCollection.add(`mg-c-icon--size-${newValue}`);\n }\n }\n\n /**\n * Define icon variant color\n */\n @Prop() variant?: IconVariantType;\n @Watch('variant')\n validateVariant(newValue: MgIcon['variant'], oldValue?: MgIcon['variant']): void {\n if (newValue !== undefined) {\n if (!variants.includes(newValue)) throw new Error(`<mg-icon> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n this.setDefaultVariantStyle();\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--variant-${oldValue}`);\n this.classCollection.add(`mg-c-icon--variant-${newValue}`);\n }\n }\n }\n\n /**\n * Define icon color variant style\n * Add a color to the icon based on variant color with given style\n * 'full': Used to set a circular background with variant soft color and icon variant color\n * 'background': Used to set a circular background with variant soft color\n * 'icon': Used to set a color only to the icon\n */\n @Prop({ mutable: true }) variantStyle: IconVariantStyleType;\n @Watch('variantStyle')\n validateVariantStyle(newValue: MgIcon['variantStyle'], oldValue?: MgIcon['variantStyle']): void {\n if (newValue !== undefined) {\n if (!variantStyles.includes(newValue)) throw new Error(`<mg-icon> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n else {\n if (oldValue !== undefined) this.classCollection.delete(`mg-c-icon--variant-style-${oldValue}`);\n this.classCollection.add(`mg-c-icon--variant-style-${newValue}`);\n }\n }\n }\n\n /**\n * Make the icon spin\n */\n @Prop() spin = false;\n @Watch('spin')\n handleSpin(newValue: MgIcon['spin']): void {\n if (newValue) {\n this.classCollection.add('mg-c-icon--spin');\n } else {\n this.classCollection.delete('mg-c-icon--spin');\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-icon']);\n\n /**\n * Method to set default varianStyle props\n * needeed has stencil doesn't know that props is mutated when updated in prop watcher\n */\n private setDefaultVariantStyle = (): void => {\n if (this.variantStyle === undefined) this.variantStyle = 'background';\n };\n\n /**\n * Render icon in shadowroot\n * @param icon - icon to render\n */\n private renderIcon = (icon: IconType): void => {\n this.element.shadowRoot.innerHTML = icons[icon];\n this.svg = this.element.shadowRoot.querySelector('svg');\n // update svg attributes\n this.svg.setAttribute('aria-hidden', 'true');\n this.svg.setAttribute('focusable', 'false');\n this.svg.setAttribute('class', this.classCollection.join());\n };\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateIcon(this.icon);\n this.validateSize(this.size);\n this.validateVariant(this.variant);\n this.validateVariantStyle(this.variantStyle);\n this.handleSpin(this.spin);\n // render icon\n this.renderIcon(this.icon);\n }\n\n /**\n * update html when component trigger changes\n */\n componentWillUpdate() {\n this.svg.setAttribute('class', this.classCollection.join());\n }\n}\n"]}
@@ -12,9 +12,13 @@ export class MgTag {
12
12
  // Classes
13
13
  this.classOutline = 'mg-c-tag--outline';
14
14
  this.classSoft = 'mg-c-tag--soft';
15
- this.variant = variants[0];
16
- this.outline = undefined;
17
- this.soft = undefined;
15
+ /**
16
+ * Define tag variant
17
+ */
18
+ this.variant = variants[0]; // primary
19
+ /**
20
+ * Component classes
21
+ */
18
22
  this.classCollection = new ClassList(['mg-c-tag']);
19
23
  }
20
24
  validateVariant(newValue, oldValue) {
@@ -72,7 +76,7 @@ export class MgTag {
72
76
  * @returns HTML Element
73
77
  */
74
78
  render() {
75
- return (h("span", { key: 'bb99306c07ea9ef4ee193a6e52c2c211378d34df', class: this.classCollection.join() }, h("slot", { key: '0e427b1189217e5d863daf9ed15d35de4832d8dd' })));
79
+ return (h("span", { key: 'b3269e3baec3a281bdbe65f8b62636b7ea2fa84c', class: this.classCollection.join() }, h("slot", { key: 'bcca2d8653dbcd6a96d322055a4e2773d85ca87d' })));
76
80
  }
77
81
  static get is() { return "mg-tag"; }
78
82
  static get encapsulation() { return "shadow"; }
@@ -108,6 +112,8 @@ export class MgTag {
108
112
  "tags": [],
109
113
  "text": "Define tag variant"
110
114
  },
115
+ "getter": false,
116
+ "setter": false,
111
117
  "attribute": "variant",
112
118
  "reflect": false,
113
119
  "defaultValue": "variants[0]"
@@ -126,6 +132,8 @@ export class MgTag {
126
132
  "tags": [],
127
133
  "text": "Define if tag is using outline style"
128
134
  },
135
+ "getter": false,
136
+ "setter": false,
129
137
  "attribute": "outline",
130
138
  "reflect": false
131
139
  },
@@ -143,6 +151,8 @@ export class MgTag {
143
151
  "tags": [],
144
152
  "text": "Define if tag is using soft style"
145
153
  },
154
+ "getter": false,
155
+ "setter": false,
146
156
  "attribute": "soft",
147
157
  "reflect": false
148
158
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mg-tag.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-tag/mg-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,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AC;IACnD,CAAC;IAOD;;mBAEe;IAEf;;;OAGG;IACK,mBAAmB,CAAC,WAAmB;QAC7C,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACjG,CAAC;IAED;;mBAEe;IAEf;;OAEG;IACH,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;IACrD,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,6DAAM,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;YACtC,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
1
+ {"version":3,"file":"mg-tag.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-tag/mg-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAkB,QAAQ,EAAE,MAAM,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AAI,QAAQ;YAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;YAClD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;IAOD;;mBAEe;IAEf;;;OAGG;IACK,mBAAmB,CAAC,WAAmB;QAC7C,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACjG,CAAC;IAED;;mBAEe;IAEf;;OAEG;IACH,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;IACrD,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,6DAAM,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;YACtC,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -3,9 +3,6 @@ import { h, Host } from "@stencil/core";
3
3
  * @internal
4
4
  */
5
5
  export class MgTooltipContent {
6
- constructor() {
7
- this.message = undefined;
8
- }
9
6
  /*************
10
7
  * Lifecycle *
11
8
  *************/
@@ -14,7 +11,7 @@ export class MgTooltipContent {
14
11
  * @returns HTML Element
15
12
  */
16
13
  render() {
17
- return (h(Host, { key: '2f94fdb8d48e172cc1d1f069ce12d1508e5e7896', role: "tooltip" }, h("span", { key: 'f075e8392eba2cd1256df7e89b7f20c832dc02e8', innerHTML: this.message, class: "mg-tooltip-content__message" }), h("slot", { key: '5f840ac9a4c9c422dc6e012dd8fbb0637232bd5f', name: "arrow" })));
14
+ 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" })));
18
15
  }
19
16
  static get is() { return "mg-tooltip-content"; }
20
17
  static get encapsulation() { return "shadow"; }
@@ -44,6 +41,8 @@ export class MgTooltipContent {
44
41
  "tags": [],
45
42
  "text": "Displayed message in the tooltip"
46
43
  },
44
+ "getter": false,
45
+ "setter": false,
47
46
  "attribute": "message",
48
47
  "reflect": false
49
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mg-tooltip-content.js","sourceRoot":"","sources":["../../../../../src/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AAMH,MAAM,OAAO,gBAAgB;;;;IAM3B;;mBAEe;IAEf;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,SAAS;YAClB,6DAAM,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,6BAA6B,GAAQ;YAC1E,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACrB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
1
+ {"version":3,"file":"mg-tooltip-content.js","sourceRoot":"","sources":["../../../../../src/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AAMH,MAAM,OAAO,gBAAgB;IAM3B;;mBAEe;IAEf;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,SAAS;YAClB,6DAAM,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,6BAA6B,GAAQ;YAC1E,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACrB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -14,6 +14,23 @@ const isButton = (element) => typeof element === 'object' && ['MG-BUTTON', 'BUTT
14
14
  */
15
15
  export class MgTooltip {
16
16
  constructor() {
17
+ /**
18
+ * Sets an `id` attribute.
19
+ * Needed by the input for accessibility `aria-decribedby`.
20
+ */
21
+ this.identifier = createID('mg-tooltip');
22
+ /**
23
+ * Tooltip placement
24
+ */
25
+ this.placement = 'bottom';
26
+ /**
27
+ * Display tooltip
28
+ */
29
+ this.display = false;
30
+ /**
31
+ * Disable tooltip
32
+ */
33
+ this.disabled = false;
17
34
  /**
18
35
  * Show tooltip
19
36
  */
@@ -219,11 +236,6 @@ export class MgTooltip {
219
236
  element.setAttribute('aria-describedby', `${[...new Set([...element.getAttribute('aria-describedby').split(' '), this.identifier])].join(' ')}`);
220
237
  }
221
238
  };
222
- this.identifier = createID('mg-tooltip');
223
- this.message = undefined;
224
- this.placement = 'bottom';
225
- this.display = false;
226
- this.disabled = false;
227
239
  }
228
240
  watchIdentifier(newValue) {
229
241
  if (!isValideID(newValue)) {
@@ -353,7 +365,7 @@ export class MgTooltip {
353
365
  * @returns HTML Element
354
366
  */
355
367
  render() {
356
- return (h(Host, { key: '76fa15330f130c087376fd76188806dbd972fca9' }, h("slot", { key: '3ae6087202535e2855cda3b25bd8be886eb37d21' }), h("slot", { key: 'b2502789d5270a19b585c4e44b5d7e9f7fffc196', name: "content" })));
368
+ return (h(Host, { key: '7868f7704c0f1ccd9d0d67d45eac6aa8901f4d5d' }, h("slot", { key: '4f865f9e153c5d01259ca83b81772dce302f5c05' }), h("slot", { key: '2032e81f60a7b7818a7220f0b00cec81ca0a84ed', name: "content" })));
357
369
  }
358
370
  static get is() { return "mg-tooltip"; }
359
371
  static get encapsulation() { return "shadow"; }
@@ -383,6 +395,8 @@ export class MgTooltip {
383
395
  "tags": [],
384
396
  "text": "Sets an `id` attribute.\nNeeded by the input for accessibility `aria-decribedby`."
385
397
  },
398
+ "getter": false,
399
+ "setter": false,
386
400
  "attribute": "identifier",
387
401
  "reflect": false,
388
402
  "defaultValue": "createID('mg-tooltip')"
@@ -401,6 +415,8 @@ export class MgTooltip {
401
415
  "tags": [],
402
416
  "text": "Displayed message in the tooltip"
403
417
  },
418
+ "getter": false,
419
+ "setter": false,
404
420
  "attribute": "message",
405
421
  "reflect": false
406
422
  },
@@ -424,6 +440,8 @@ export class MgTooltip {
424
440
  "tags": [],
425
441
  "text": "Tooltip placement"
426
442
  },
443
+ "getter": false,
444
+ "setter": false,
427
445
  "attribute": "placement",
428
446
  "reflect": false,
429
447
  "defaultValue": "'bottom'"
@@ -442,6 +460,8 @@ export class MgTooltip {
442
460
  "tags": [],
443
461
  "text": "Display tooltip"
444
462
  },
463
+ "getter": false,
464
+ "setter": false,
445
465
  "attribute": "display",
446
466
  "reflect": false,
447
467
  "defaultValue": "false"
@@ -460,6 +480,8 @@ export class MgTooltip {
460
480
  "tags": [],
461
481
  "text": "Disable tooltip"
462
482
  },
483
+ "getter": false,
484
+ "setter": false,
463
485
  "attribute": "disabled",
464
486
  "reflect": false,
465
487
  "defaultValue": "false"
@@ -1 +1 @@
1
- {"version":3,"file":"mg-tooltip.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-tooltip/mg-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAChI,OAAO,EAA8B,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAkB,KAAK,EAAE,MAAM,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,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,oBAAoB;;QAClB,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,WAAmB,EAAE,EAAE;YAC5C,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;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAa;YACb,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { createID, focusableElements, getWindows, isValideID, isValidString, nextTick, toString } from '@mgdis/stencil-helpers';\nimport { Instance as PopperInstance, createPopper, Placement, PositioningStrategy } from '@popperjs/core';\nimport { type GuardType, Guard } 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 popper: PopperInstance;\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() placement: Placement = 'bottom';\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 // Enable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }],\n }));\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 // Disable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }],\n }));\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 popper instance\n * @param strategy - popper strategy to apply on instance\n */\n private setPopper = (strategy: PositioningStrategy): void => {\n // Create popperjs tooltip\n this.popper = createPopper(this.tooltipedElement, this.mgTooltipContent, {\n placement: this.placement,\n strategy,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['auto'],\n },\n },\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 popper instance\n this.popper.update();\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.popperArrow = '';\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.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.setPopper(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.popper.update();\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 }\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"]}
1
+ {"version":3,"file":"mg-tooltip.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-tooltip/mg-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAChI,OAAO,EAA8B,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AAC1G,O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F,gCAAgC;QAChC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAE7D,cAAc;QACd,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,oBAAoB;;QAClB,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,WAAmB,EAAE,EAAE;YAC5C,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;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAa;YACb,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { createID, focusableElements, getWindows, isValideID, isValidString, nextTick, toString } from '@mgdis/stencil-helpers';\nimport { Instance as PopperInstance, createPopper, Placement, PositioningStrategy } from '@popperjs/core';\nimport { type GuardType, Guard } 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 popper: PopperInstance;\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() placement: Placement = 'bottom';\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 // Enable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }],\n }));\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 // Disable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }],\n }));\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 popper instance\n * @param strategy - popper strategy to apply on instance\n */\n private setPopper = (strategy: PositioningStrategy): void => {\n // Create popperjs tooltip\n this.popper = createPopper(this.tooltipedElement, this.mgTooltipContent, {\n placement: this.placement,\n strategy,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['auto'],\n },\n },\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 popper instance\n this.popper.update();\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.popperArrow = '';\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.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.setPopper(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.popper.update();\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 }\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"]}
@@ -17,24 +17,38 @@ export class MgInput {
17
17
  this.classHasError = 'mg-c-input--has-error';
18
18
  this.classLabelOnTop = 'mg-c-input--label-on-top';
19
19
  /**
20
- * Get tooltip node
21
- * @returns mg-tooltip
20
+ * Define if label is visible
22
21
  */
23
- this.renderTooltip = () => (h("mg-tooltip", { identifier: `${this.identifier}-tooltip`, message: this.tooltip }, h("mg-icon", { icon: "info-circle" })));
24
- this.identifier = undefined;
25
- this.label = undefined;
26
- this.labelOnTop = undefined;
27
22
  this.labelHide = false;
28
- this.tooltip = undefined;
23
+ /**
24
+ * Define tooltip position
25
+ */
29
26
  this.tooltipPosition = 'input';
27
+ /**
28
+ * Define if input is required
29
+ */
30
30
  this.required = false;
31
- this.errorMessage = undefined;
32
- this.helpText = undefined;
33
- this.ariaDescribedbyIDs = undefined;
31
+ /**
32
+ * Element is fieldset
33
+ */
34
34
  this.isFieldset = false;
35
+ /**
36
+ * Element is readonly
37
+ */
35
38
  this.isReadonly = false;
39
+ /**
40
+ * Element is disabled
41
+ */
36
42
  this.isDisabled = false;
43
+ /**
44
+ * Element is disabled
45
+ */
37
46
  this.isVerticalList = false;
47
+ /**
48
+ * Get tooltip node
49
+ * @returns mg-tooltip
50
+ */
51
+ this.renderTooltip = () => (h("mg-tooltip", { identifier: `${this.identifier}-tooltip`, message: this.tooltip }, h("mg-icon", { icon: "info-circle" })));
38
52
  }
39
53
  watchIdentifier(newValue) {
40
54
  if (!isValidString(newValue)) {
@@ -106,7 +120,10 @@ export class MgInput {
106
120
  ariaDescribedbyIDs.add(this.helpTextErrorId);
107
121
  }
108
122
  this.element.querySelectorAll('input,select,textarea,[role="switch"]').forEach(element => {
109
- element.setAttribute('aria-describedby', Array.from(ariaDescribedbyIDs).join(' '));
123
+ if (ariaDescribedbyIDs.size)
124
+ element.setAttribute('aria-describedby', Array.from(ariaDescribedbyIDs).join(' '));
125
+ else
126
+ element.removeAttribute('aria-describedby');
110
127
  });
111
128
  }
112
129
  /**
@@ -220,7 +237,7 @@ export class MgInput {
220
237
  */
221
238
  render() {
222
239
  const isGroup = this.isFieldset && !this.isReadonly;
223
- return (h(Host, { key: '628e189d5e91c6146c2e8ab5b9374b5cc4132786', class: this.element.classList.toString(), role: isGroup ? 'group' : undefined, "aria-labelledby": isGroup ? `${this.identifier}-title` : undefined }, h("div", { key: '9471070c3810c71fe5335f31012fa9294dbcadde', class: { 'mg-c-input__title': true, 'mg-u-visually-hidden': this.labelHide } }, h("slot", { key: 'd653ebdb538ba4325b76d92725a8192245b022ab', name: this.slotLabel }), this.tooltip && (this.tooltipPosition === 'label' || this.labelOnTop) && !this.labelHide && this.renderTooltip()), h("div", { key: '6c9d40fc0ae6b51581659470c14678474885bc0c', class: "mg-c-input__input-container" }, h("div", { key: '5f80ebc33f11151607322133f995374056321453', class: "mg-c-input__input" }, h("slot", { key: 'da67674bb91c4957c850cd50b0196f4aeaa8f4d0' }), this.tooltip && !this.labelOnTop && (this.tooltipPosition === 'input' || this.labelHide) && this.renderTooltip()), this.helptextMessageSlotElement && (h("div", { key: '25be9fc701e42a4b2eb0ecc01d22ca0be271c1d9', class: "mg-c-input__help-text" }, h("slot", { key: 'fc6b29fdc35e52d90646cbf1d9f2f3e631371dc7', name: this.slotHelpText }))), !this.isDisabled && this.errorMessage && (h("div", { key: '3ad2878abfa52fb5129cf773e907f75fac9a0985', class: "mg-c-input__error", "aria-live": "assertive" }, h("slot", { key: '1c72d4ab723c8c7805a1dcc8c6554ac24739f080', name: this.slotError }))))));
240
+ return (h(Host, { key: '2b69235bf675e431e61261d1a4465e216675bbb2', class: this.element.classList.toString(), role: isGroup ? 'group' : undefined, "aria-labelledby": isGroup ? `${this.identifier}-title` : undefined }, h("div", { key: '7cbe4343e2d6ebbad943b4562c69b8e2f583fe23', class: { 'mg-c-input__title': true, 'mg-u-visually-hidden': this.labelHide } }, h("slot", { key: 'af2c9482dd4a66c62047edc8fecef17efeeb6537', name: this.slotLabel }), this.tooltip && (this.tooltipPosition === 'label' || this.labelOnTop) && !this.labelHide && this.renderTooltip()), h("div", { key: 'b48eaa21ea25c08b3a04c1f0d22c9c59bd535e26', class: "mg-c-input__input-container" }, h("div", { key: '3f61784438dd63b5ccf7fd8cbb50b51ae3ac982e', class: "mg-c-input__input" }, h("slot", { key: '05bed4a07201b7fe65c82886ebf8ac63b004be4e' }), this.tooltip && !this.labelOnTop && (this.tooltipPosition === 'input' || this.labelHide) && this.renderTooltip()), this.helptextMessageSlotElement && (h("div", { key: 'b27e2ae017422b7408780521a1d38f9b094c341c', class: "mg-c-input__help-text" }, h("slot", { key: '3798d38bcbdabfeec3b0e9f97c2074734ffd7149', name: this.slotHelpText }))), !this.isDisabled && this.errorMessage && (h("div", { key: '70f4ea8fda4fb884934e3d3c9d34c67eb6db9ab9', class: "mg-c-input__error", "aria-live": "assertive" }, h("slot", { key: '90c13c82e7b7a9c820bcab5cdad7f09ce95b8512', name: this.slotError }))))));
224
241
  }
225
242
  static get is() { return "mg-input"; }
226
243
  static get encapsulation() { return "shadow"; }
@@ -250,6 +267,8 @@ export class MgInput {
250
267
  "tags": [],
251
268
  "text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)"
252
269
  },
270
+ "getter": false,
271
+ "setter": false,
253
272
  "attribute": "identifier",
254
273
  "reflect": false
255
274
  },
@@ -267,6 +286,8 @@ export class MgInput {
267
286
  "tags": [],
268
287
  "text": "Define input label"
269
288
  },
289
+ "getter": false,
290
+ "setter": false,
270
291
  "attribute": "label",
271
292
  "reflect": false
272
293
  },
@@ -284,6 +305,8 @@ export class MgInput {
284
305
  "tags": [],
285
306
  "text": "Define if label is displayed on top"
286
307
  },
308
+ "getter": false,
309
+ "setter": false,
287
310
  "attribute": "label-on-top",
288
311
  "reflect": false
289
312
  },
@@ -301,6 +324,8 @@ export class MgInput {
301
324
  "tags": [],
302
325
  "text": "Define if label is visible"
303
326
  },
327
+ "getter": false,
328
+ "setter": false,
304
329
  "attribute": "label-hide",
305
330
  "reflect": false,
306
331
  "defaultValue": "false"
@@ -319,6 +344,8 @@ export class MgInput {
319
344
  "tags": [],
320
345
  "text": "Add a tooltip message next to the input"
321
346
  },
347
+ "getter": false,
348
+ "setter": false,
322
349
  "attribute": "tooltip",
323
350
  "reflect": false
324
351
  },
@@ -342,6 +369,8 @@ export class MgInput {
342
369
  "tags": [],
343
370
  "text": "Define tooltip position"
344
371
  },
372
+ "getter": false,
373
+ "setter": false,
345
374
  "attribute": "tooltip-position",
346
375
  "reflect": false,
347
376
  "defaultValue": "'input'"
@@ -360,6 +389,8 @@ export class MgInput {
360
389
  "tags": [],
361
390
  "text": "Define if input is required"
362
391
  },
392
+ "getter": false,
393
+ "setter": false,
363
394
  "attribute": "required",
364
395
  "reflect": false,
365
396
  "defaultValue": "false"
@@ -378,6 +409,8 @@ export class MgInput {
378
409
  "tags": [],
379
410
  "text": "Define error message to display"
380
411
  },
412
+ "getter": false,
413
+ "setter": false,
381
414
  "attribute": "error-message",
382
415
  "reflect": false
383
416
  },
@@ -395,6 +428,8 @@ export class MgInput {
395
428
  "tags": [],
396
429
  "text": "Define help text to display"
397
430
  },
431
+ "getter": false,
432
+ "setter": false,
398
433
  "attribute": "help-text",
399
434
  "reflect": false
400
435
  },
@@ -411,7 +446,9 @@ export class MgInput {
411
446
  "docs": {
412
447
  "tags": [],
413
448
  "text": "Define aria-describedby ids to link with"
414
- }
449
+ },
450
+ "getter": false,
451
+ "setter": false
415
452
  }
416
453
  };
417
454
  }