@mgdis/mg-components 5.19.2 → 5.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/dist/cjs/{components.utils-dc9c8a53.js → components.utils-cd908d4e.js} +102 -99
  2. package/dist/cjs/components.utils-cd908d4e.js.map +1 -0
  3. package/dist/cjs/{index-c042e24b.js → index-8532b5e9.js} +320 -137
  4. package/dist/cjs/index-8532b5e9.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_34.cjs.entry.js +5130 -5057
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +224 -224
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +193 -183
  13. package/dist/collection/assets/icons/index.js.map +1 -0
  14. package/dist/collection/collection-manifest.json +6 -6
  15. package/dist/collection/components/atoms/mg-badge/mg-badge.js +161 -161
  16. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +362 -347
  18. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-card/mg-card.js +126 -126
  20. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  21. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +101 -101
  22. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
  23. package/dist/collection/components/atoms/mg-divider/mg-divider.js +47 -47
  24. package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
  25. package/dist/collection/components/atoms/mg-icon/mg-icon.js +231 -231
  26. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  27. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +132 -132
  28. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  29. package/dist/collection/components/atoms/mg-tag/mg-tag.js +158 -158
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +46 -46
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
  33. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +3 -3
  34. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
  35. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +398 -398
  36. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/MgInput.conf.js +8 -0
  38. package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/MgInput.js +84 -84
  40. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +8 -8
  42. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  43. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +266 -266
  44. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -4
  46. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +789 -791
  48. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +4 -4
  50. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  51. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +589 -572
  52. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  53. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +4 -4
  54. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
  55. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +779 -767
  56. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  57. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +537 -520
  58. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  59. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +566 -550
  60. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  61. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +701 -689
  62. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  63. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +0 -4
  64. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +771 -754
  66. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  67. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +706 -689
  68. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  69. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +527 -522
  70. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  71. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +2 -2
  72. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
  73. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +263 -263
  74. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  75. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +6 -6
  76. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -1
  77. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +423 -423
  78. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  80. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +214 -214
  81. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  82. package/dist/collection/components/molecules/mg-details/mg-details.js +155 -150
  83. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  84. package/dist/collection/components/molecules/mg-form/mg-form.js +332 -335
  85. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  86. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +85 -85
  87. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  88. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +189 -189
  89. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  90. package/dist/collection/components/molecules/mg-message/mg-message.js +325 -304
  91. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  92. package/dist/collection/components/molecules/mg-modal/mg-modal.js +317 -317
  93. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  94. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +2 -2
  95. package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -1
  96. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +216 -216
  97. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  98. package/dist/collection/components/molecules/mg-panel/mg-panel.js +409 -399
  99. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  100. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +91 -91
  101. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  102. package/dist/collection/components/molecules/mg-popover/mg-popover.js +336 -329
  103. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  104. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +94 -94
  105. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  106. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -4
  107. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -1
  108. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +348 -343
  109. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  110. package/dist/collection/locales/fr/messages.json +4 -4
  111. package/dist/collection/locales/index.spec.js +20 -20
  112. package/dist/collection/locales/index.spec.js.map +1 -1
  113. package/dist/collection/utils/behaviors.utils.js +127 -127
  114. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  115. package/dist/collection/utils/behaviors.utils.spec.js +42 -42
  116. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  117. package/dist/collection/utils/components.utils.js +77 -75
  118. package/dist/collection/utils/components.utils.js.map +1 -1
  119. package/dist/collection/utils/components.utils.spec.js +150 -135
  120. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  121. package/dist/collection/utils/e2e.test.utils.js +21 -21
  122. package/dist/collection/utils/e2e.test.utils.js.map +1 -1
  123. package/dist/collection/utils/locale.utils.js +17 -17
  124. package/dist/collection/utils/locale.utils.js.map +1 -1
  125. package/dist/collection/utils/locale.utils.spec.js +45 -45
  126. package/dist/collection/utils/locale.utils.spec.js.map +1 -1
  127. package/dist/collection/utils/playwright.e2e.test.utils.js +41 -41
  128. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  129. package/dist/collection/utils/playwright.fixture.js +24 -0
  130. package/dist/collection/utils/playwright.fixture.js.map +1 -0
  131. package/dist/collection/utils/unit.test.utils.js +50 -50
  132. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  133. package/dist/components/MgInput.js +105 -97
  134. package/dist/components/MgInput.js.map +1 -1
  135. package/dist/components/components.utils.js +78 -76
  136. package/dist/components/components.utils.js.map +1 -1
  137. package/dist/components/index2.js +21 -21
  138. package/dist/components/index2.js.map +1 -1
  139. package/dist/components/mg-action-more.d.ts +2 -2
  140. package/dist/components/mg-action-more.js +173 -173
  141. package/dist/components/mg-action-more.js.map +1 -1
  142. package/dist/components/mg-badge.d.ts +2 -2
  143. package/dist/components/mg-badge2.js +83 -83
  144. package/dist/components/mg-badge2.js.map +1 -1
  145. package/dist/components/mg-button.d.ts +2 -2
  146. package/dist/components/mg-button2.js +182 -167
  147. package/dist/components/mg-button2.js.map +1 -1
  148. package/dist/components/mg-card.d.ts +2 -2
  149. package/dist/components/mg-card2.js +77 -77
  150. package/dist/components/mg-card2.js.map +1 -1
  151. package/dist/components/mg-character-left.d.ts +2 -2
  152. package/dist/components/mg-character-left2.js +50 -50
  153. package/dist/components/mg-character-left2.js.map +1 -1
  154. package/dist/components/mg-details.d.ts +2 -2
  155. package/dist/components/mg-details.js +69 -69
  156. package/dist/components/mg-details.js.map +1 -1
  157. package/dist/components/mg-divider.d.ts +2 -2
  158. package/dist/components/mg-divider.js +30 -30
  159. package/dist/components/mg-divider.js.map +1 -1
  160. package/dist/components/mg-form.d.ts +2 -2
  161. package/dist/components/mg-form.js +171 -179
  162. package/dist/components/mg-form.js.map +1 -1
  163. package/dist/components/mg-icon.d.ts +2 -2
  164. package/dist/components/mg-icon2.js +327 -309
  165. package/dist/components/mg-icon2.js.map +1 -1
  166. package/dist/components/mg-illustrated-message.d.ts +2 -2
  167. package/dist/components/mg-illustrated-message.js +51 -51
  168. package/dist/components/mg-illustrated-message.js.map +1 -1
  169. package/dist/components/mg-input-checkbox-paginated.d.ts +2 -2
  170. package/dist/components/mg-input-checkbox-paginated2.js +170 -170
  171. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  172. package/dist/components/mg-input-checkbox.d.ts +2 -2
  173. package/dist/components/mg-input-checkbox.js +478 -480
  174. package/dist/components/mg-input-checkbox.js.map +1 -1
  175. package/dist/components/mg-input-date.d.ts +2 -2
  176. package/dist/components/mg-input-date.js +266 -260
  177. package/dist/components/mg-input-date.js.map +1 -1
  178. package/dist/components/mg-input-numeric.d.ts +2 -2
  179. package/dist/components/mg-input-numeric.js +354 -348
  180. package/dist/components/mg-input-numeric.js.map +1 -1
  181. package/dist/components/mg-input-password.d.ts +2 -2
  182. package/dist/components/mg-input-password.js +205 -199
  183. package/dist/components/mg-input-password.js.map +1 -1
  184. package/dist/components/mg-input-radio.d.ts +2 -2
  185. package/dist/components/mg-input-radio.js +236 -231
  186. package/dist/components/mg-input-radio.js.map +1 -1
  187. package/dist/components/mg-input-select.d.ts +2 -2
  188. package/dist/components/mg-input-select2.js +316 -310
  189. package/dist/components/mg-input-select2.js.map +1 -1
  190. package/dist/components/mg-input-text.d.ts +2 -2
  191. package/dist/components/mg-input-text2.js +306 -300
  192. package/dist/components/mg-input-text2.js.map +1 -1
  193. package/dist/components/mg-input-textarea.d.ts +2 -2
  194. package/dist/components/mg-input-textarea.js +277 -271
  195. package/dist/components/mg-input-textarea.js.map +1 -1
  196. package/dist/components/mg-input-title.d.ts +2 -2
  197. package/dist/components/mg-input-title2.js +60 -60
  198. package/dist/components/mg-input-title2.js.map +1 -1
  199. package/dist/components/mg-input-toggle.d.ts +2 -2
  200. package/dist/components/mg-input-toggle.js +251 -251
  201. package/dist/components/mg-input-toggle.js.map +1 -1
  202. package/dist/components/mg-item-more.d.ts +2 -2
  203. package/dist/components/mg-item-more.js +285 -285
  204. package/dist/components/mg-item-more.js.map +1 -1
  205. package/dist/components/mg-menu-item.d.ts +2 -2
  206. package/dist/components/mg-menu-item2.js +345 -345
  207. package/dist/components/mg-menu-item2.js.map +1 -1
  208. package/dist/components/mg-menu.conf.js +2 -2
  209. package/dist/components/mg-menu.conf.js.map +1 -1
  210. package/dist/components/mg-menu.d.ts +2 -2
  211. package/dist/components/mg-menu2.js +176 -176
  212. package/dist/components/mg-menu2.js.map +1 -1
  213. package/dist/components/mg-message.d.ts +2 -2
  214. package/dist/components/mg-message.js +198 -193
  215. package/dist/components/mg-message.js.map +1 -1
  216. package/dist/components/mg-modal.d.ts +2 -2
  217. package/dist/components/mg-modal.js +198 -198
  218. package/dist/components/mg-modal.js.map +1 -1
  219. package/dist/components/mg-pagination.d.ts +2 -2
  220. package/dist/components/mg-pagination2.js +133 -133
  221. package/dist/components/mg-pagination2.js.map +1 -1
  222. package/dist/components/mg-panel.d.ts +2 -2
  223. package/dist/components/mg-panel.js +238 -238
  224. package/dist/components/mg-panel.js.map +1 -1
  225. package/dist/components/mg-popover-content.d.ts +2 -2
  226. package/dist/components/mg-popover-content2.js +70 -70
  227. package/dist/components/mg-popover-content2.js.map +1 -1
  228. package/dist/components/mg-popover.d.ts +2 -2
  229. package/dist/components/mg-popover2.js +224 -222
  230. package/dist/components/mg-popover2.js.map +1 -1
  231. package/dist/components/mg-skip-links.d.ts +2 -2
  232. package/dist/components/mg-skip-links.js +57 -57
  233. package/dist/components/mg-skip-links.js.map +1 -1
  234. package/dist/components/mg-tabs.d.ts +2 -2
  235. package/dist/components/mg-tabs.js +243 -243
  236. package/dist/components/mg-tabs.js.map +1 -1
  237. package/dist/components/mg-tag.d.ts +2 -2
  238. package/dist/components/mg-tag.js +97 -97
  239. package/dist/components/mg-tag.js.map +1 -1
  240. package/dist/components/mg-tooltip-content.d.ts +2 -2
  241. package/dist/components/mg-tooltip-content2.js +30 -30
  242. package/dist/components/mg-tooltip-content2.js.map +1 -1
  243. package/dist/components/mg-tooltip.d.ts +2 -2
  244. package/dist/components/mg-tooltip2.js +316 -316
  245. package/dist/components/mg-tooltip2.js.map +1 -1
  246. package/dist/components/popper.js +6 -12
  247. package/dist/components/popper.js.map +1 -1
  248. package/dist/esm/{components.utils-0f76010d.js → components.utils-0d67c31c.js} +102 -100
  249. package/dist/esm/components.utils-0d67c31c.js.map +1 -0
  250. package/dist/esm/{index-ce01e63b.js → index-f34a3a2c.js} +320 -137
  251. package/dist/esm/index-f34a3a2c.js.map +1 -0
  252. package/dist/esm/loader.js +3 -3
  253. package/dist/esm/mg-action-more_34.entry.js +5130 -5057
  254. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  255. package/dist/esm/mg-components.js +4 -4
  256. package/dist/esm/mg-components.js.map +1 -1
  257. package/dist/esm/mg-item-more.entry.js +224 -224
  258. package/dist/esm/mg-item-more.entry.js.map +1 -1
  259. package/dist/mg-components/locales/fr/messages.json +4 -4
  260. package/dist/mg-components/mg-components.css +1 -1
  261. package/dist/mg-components/mg-components.esm.js +1 -1
  262. package/dist/mg-components/mg-components.esm.js.map +1 -1
  263. package/dist/mg-components/p-629454f7.entry.js +2 -0
  264. package/dist/mg-components/p-629454f7.entry.js.map +1 -0
  265. package/dist/mg-components/p-7444ff40.js +3 -0
  266. package/dist/mg-components/p-7444ff40.js.map +1 -0
  267. package/dist/mg-components/p-af42d17b.js +2 -0
  268. package/dist/mg-components/p-af42d17b.js.map +1 -0
  269. package/dist/mg-components/{p-01ebc95a.entry.js → p-e0fb0f3c.entry.js} +2 -2
  270. package/dist/mg-components/p-e0fb0f3c.entry.js.map +1 -0
  271. package/dist/types/assets/icons/index.d.ts +193 -0
  272. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +41 -41
  273. package/dist/types/components/atoms/mg-button/mg-button.d.ts +100 -96
  274. package/dist/types/components/atoms/mg-card/mg-card.d.ts +39 -39
  275. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +37 -37
  276. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +12 -12
  277. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +56 -56
  278. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +34 -34
  279. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +51 -51
  280. package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +12 -12
  281. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +3 -3
  282. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +113 -113
  283. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +10 -3
  284. package/dist/types/components/molecules/inputs/MgInput.d.ts +17 -16
  285. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +100 -100
  286. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +26 -26
  287. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +262 -260
  288. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +4 -4
  289. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +150 -149
  290. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +4 -4
  291. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +223 -222
  292. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +142 -141
  293. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +3 -3
  294. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +152 -151
  295. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +6 -6
  296. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +193 -192
  297. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +1 -6
  298. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +195 -194
  299. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +181 -180
  300. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +2 -2
  301. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +141 -141
  302. package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -2
  303. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +97 -97
  304. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +6 -6
  305. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +179 -179
  306. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +12 -11
  307. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +72 -72
  308. package/dist/types/components/molecules/mg-details/mg-details.d.ts +45 -45
  309. package/dist/types/components/molecules/mg-form/mg-form.d.ts +103 -104
  310. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +27 -27
  311. package/dist/types/components/molecules/mg-item-more/mg-item-more.conf.d.ts +5 -5
  312. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +61 -61
  313. package/dist/types/components/molecules/mg-message/mg-message.d.ts +100 -93
  314. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +107 -107
  315. package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +2 -2
  316. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +74 -74
  317. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +149 -149
  318. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +43 -43
  319. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +88 -88
  320. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +2 -2
  321. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +40 -40
  322. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -10
  323. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +118 -118
  324. package/dist/types/components.d.ts +296 -32
  325. package/dist/types/locales/index.d.ts +172 -172
  326. package/dist/types/stencil-public-runtime.d.ts +29 -0
  327. package/dist/types/utils/behaviors.utils.d.ts +65 -65
  328. package/dist/types/utils/components.utils.d.ts +32 -26
  329. package/dist/types/utils/locale.utils.d.ts +2 -2
  330. package/dist/types/utils/playwright.fixture.d.ts +3 -0
  331. package/dist/types/utils/unit.test.utils.d.ts +5 -5
  332. package/package.json +33 -47
  333. package/dist/cjs/components.utils-dc9c8a53.js.map +0 -1
  334. package/dist/cjs/index-c042e24b.js.map +0 -1
  335. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +0 -33
  336. package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +0 -1
  337. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +0 -70
  338. package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +0 -1
  339. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +0 -91
  340. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +0 -1
  341. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +0 -142
  342. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +0 -1
  343. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +0 -36
  344. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +0 -1
  345. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +0 -43
  346. package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +0 -1
  347. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +0 -15
  348. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +0 -1
  349. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +0 -42
  350. package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +0 -1
  351. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +0 -11
  352. package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +0 -1
  353. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +0 -14
  354. package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +0 -1
  355. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +0 -55
  356. package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +0 -1
  357. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +0 -84
  358. package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +0 -1
  359. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +0 -12
  360. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +0 -1
  361. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +0 -23
  362. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +0 -1
  363. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +0 -23
  364. package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +0 -1
  365. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +0 -71
  366. package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +0 -1
  367. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +0 -138
  368. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +0 -1
  369. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +0 -272
  370. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +0 -1
  371. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +0 -237
  372. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +0 -1
  373. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +0 -640
  374. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +0 -1
  375. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +0 -123
  376. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +0 -1
  377. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +0 -379
  378. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +0 -1
  379. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +0 -212
  380. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +0 -1
  381. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +0 -456
  382. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +0 -1
  383. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +0 -115
  384. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +0 -1
  385. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +0 -289
  386. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +0 -1
  387. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +0 -154
  388. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +0 -1
  389. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +0 -355
  390. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +0 -1
  391. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +0 -194
  392. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +0 -1
  393. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +0 -399
  394. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +0 -1
  395. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +0 -147
  396. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +0 -1
  397. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +0 -353
  398. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +0 -1
  399. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +0 -129
  400. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +0 -1
  401. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +0 -318
  402. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +0 -1
  403. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +0 -108
  404. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +0 -1
  405. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +0 -247
  406. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +0 -1
  407. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js +0 -239
  408. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +0 -1
  409. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +0 -175
  410. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +0 -1
  411. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +0 -100
  412. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +0 -1
  413. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +0 -295
  414. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +0 -1
  415. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +0 -128
  416. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +0 -1
  417. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +0 -187
  418. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +0 -1
  419. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +0 -30
  420. package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +0 -1
  421. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +0 -42
  422. package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +0 -1
  423. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +0 -169
  424. package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +0 -1
  425. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +0 -277
  426. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +0 -1
  427. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +0 -39
  428. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +0 -1
  429. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +0 -36
  430. package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +0 -1
  431. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +0 -85
  432. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +0 -1
  433. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +0 -106
  434. package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +0 -1
  435. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +0 -64
  436. package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +0 -1
  437. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +0 -109
  438. package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +0 -1
  439. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +0 -62
  440. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +0 -1
  441. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +0 -40
  442. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +0 -1
  443. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +0 -26
  444. package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +0 -1
  445. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +0 -122
  446. package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +0 -1
  447. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +0 -57
  448. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +0 -1
  449. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +0 -121
  450. package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +0 -1
  451. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +0 -106
  452. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +0 -1
  453. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +0 -213
  454. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +0 -1
  455. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js +0 -140
  456. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +0 -1
  457. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +0 -142
  458. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +0 -1
  459. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +0 -55
  460. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +0 -1
  461. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +0 -55
  462. package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +0 -1
  463. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +0 -76
  464. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +0 -1
  465. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +0 -332
  466. package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +0 -1
  467. package/dist/collection/utils/stencil.e2e.test.utils.js +0 -33
  468. package/dist/collection/utils/stencil.e2e.test.utils.js.map +0 -1
  469. package/dist/esm/components.utils-0f76010d.js.map +0 -1
  470. package/dist/esm/index-ce01e63b.js.map +0 -1
  471. package/dist/mg-components/p-01ebc95a.entry.js.map +0 -1
  472. package/dist/mg-components/p-1aa89acf.js +0 -3
  473. package/dist/mg-components/p-1aa89acf.js.map +0 -1
  474. package/dist/mg-components/p-71a5a848.entry.js +0 -2
  475. package/dist/mg-components/p-71a5a848.entry.js.map +0 -1
  476. package/dist/mg-components/p-c9e2c669.js +0 -2
  477. package/dist/mg-components/p-c9e2c669.js.map +0 -1
  478. package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +0 -1
  479. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +0 -1
  480. package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +0 -1
  481. package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +0 -1
  482. package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +0 -1
  483. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +0 -1
  484. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +0 -1
  485. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +0 -1
  486. package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +0 -2
  487. package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +0 -1
  488. package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +0 -1
  489. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +0 -1
  490. package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +0 -12
  491. package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +0 -1
  492. package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +0 -1
  493. package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +0 -1
  494. package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +0 -1
  495. package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +0 -1
  496. package/dist/types/utils/stencil.e2e.test.utils.d.ts +0 -14
@@ -1,277 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { newSpecPage } from "@stencil/core/testing";
3
- import { MgForm } from "../mg-form";
4
- import { MgButton } from "../../../atoms/mg-button/mg-button";
5
- import { buttonTypes } from "../../../atoms/mg-button/mg-button.conf";
6
- import { MgInputCheckbox } from "../../inputs/mg-input-checkbox/mg-input-checkbox";
7
- import { MgInputDate } from "../../inputs/mg-input-date/mg-input-date";
8
- import { MgInputNumeric } from "../../inputs/mg-input-numeric/mg-input-numeric";
9
- import { MgInputPassword } from "../../inputs/mg-input-password/mg-input-password";
10
- import { MgInputRadio } from "../../inputs/mg-input-radio/mg-input-radio";
11
- import { MgInputSelect } from "../../inputs/mg-input-select/mg-input-select";
12
- import { MgInputText } from "../../inputs/mg-input-text/mg-input-text";
13
- import { MgInputTextarea } from "../../inputs/mg-input-textarea/mg-input-textarea";
14
- import { MgInputToggle } from "../../inputs/mg-input-toggle/mg-input-toggle";
15
- import { setupMutationObserverMock, setupSubmitEventMock } from "../../../../utils/unit.test.utils";
16
- const getPage = (args, content) => {
17
- const page = newSpecPage({
18
- components: [MgForm, MgInputCheckbox, MgInputDate, MgInputNumeric, MgInputPassword, MgInputRadio, MgInputSelect, MgInputText, MgInputTextarea, MgInputToggle, MgButton],
19
- template: () => h("mg-form", Object.assign({}, args), content),
20
- });
21
- jest.runAllTimers();
22
- return page;
23
- };
24
- const getSlottedContent = () => [
25
- h("mg-input-checkbox", { identifier: "mg-input-checkbox", label: "mg-input-checkbox label", value: [
26
- { title: 'oui', value: true },
27
- { title: 'non', value: false },
28
- ] }),
29
- h("mg-input-date", { identifier: "mg-input-date", label: "mg-input-date label" }),
30
- h("mg-input-numeric", { identifier: "mg-input-numeric", label: "mg-input-numeric label" }),
31
- h("mg-input-password", { identifier: "mg-input-password", label: "mg-input-password label" }),
32
- h("mg-input-radio", { identifier: "mg-input-radio", label: "mg-input-radio label", items: ['blu', 'bli', 'bla', 'blo'] }),
33
- h("mg-input-select", { identifier: "mg-input-select", label: "mg-input-select label", items: ['blu', 'bli', 'bla', 'blo'] }),
34
- h("mg-input-text", { identifier: "mg-input-text", label: "mg-input-text label" }),
35
- h("mg-input-textarea", { identifier: "mg-input-textarea", label: "mg-input-textarea label" }),
36
- h("mg-input-toggle", { identifier: "mg-input-toggle", label: "mg-input-toggle label", items: [
37
- { title: 'non', value: false },
38
- { title: 'oui', value: true },
39
- ] }, h("span", { slot: "item-1" }, "non"), h("span", { slot: "item-2" }, "oui")),
40
- ];
41
- const setCheckValitidy = (input) => {
42
- const shadowInputs = input.shadowRoot.querySelectorAll('input, textarea, select');
43
- shadowInputs.forEach(input => {
44
- input.checkValidity = jest.fn(() => false);
45
- Object.defineProperty(input, 'validity', {
46
- get: jest.fn(() => ({
47
- valueMissing: true,
48
- })),
49
- });
50
- });
51
- };
52
- const setMgInputChecboxeInvalid = (input) => {
53
- input.required = true;
54
- input.value = [
55
- { title: 'oui', value: false },
56
- { title: 'non', value: false },
57
- ];
58
- };
59
- describe('mg-form', () => {
60
- let fireMo;
61
- beforeEach(() => {
62
- jest.useFakeTimers();
63
- setupMutationObserverMock({
64
- observe: function () {
65
- fireMo = this.cb;
66
- },
67
- disconnect: function () {
68
- return null;
69
- },
70
- takeRecords: () => [],
71
- });
72
- setupSubmitEventMock();
73
- });
74
- afterEach(() => jest.runOnlyPendingTimers());
75
- test.each([
76
- { args: { identifier: 'identifier' } },
77
- { args: { identifier: 'identifier', readonly: true } },
78
- { args: { identifier: 'identifier', disabled: true } },
79
- { args: { identifier: 'identifier' }, required: 'one' },
80
- { args: { identifier: 'identifier' }, required: 'all' },
81
- { args: { identifier: 'identifier' }, required: 'multiple' },
82
- { args: { identifier: 'identifier' }, required: 'single' },
83
- { args: { identifier: 'identifier' }, readonly: true },
84
- ])('Should render with args %o:', async ({ args, required, readonly }) => {
85
- const slot = required === 'single' ? getSlottedContent()[0] : getSlottedContent();
86
- if (required === 'one')
87
- slot[0].$attrs$.required = true;
88
- else if (required === 'all')
89
- slot.forEach(s => {
90
- s.$attrs$.required = true;
91
- });
92
- else if (required === 'multiple') {
93
- slot[0].$attrs$.required = true;
94
- slot[1].$attrs$.required = true;
95
- }
96
- else if (required === 'single')
97
- slot.$attrs$.required = true;
98
- if (readonly)
99
- slot.forEach(s => {
100
- s.$attrs$.readonly = true;
101
- });
102
- const { root } = await getPage(args, slot);
103
- expect(root).toMatchSnapshot();
104
- });
105
- test.each([false, true])('Should display components errors (readonly: %s)', async (readonly) => {
106
- const args = { identifier: 'identifier', readonly };
107
- const slot = getSlottedContent();
108
- // Set all elements required
109
- slot.forEach(s => {
110
- s.$attrs$.required = true;
111
- });
112
- const page = await getPage(args, slot);
113
- const mgForm = page.doc.querySelector('mg-form');
114
- if (!readonly) {
115
- // Mock all input validity
116
- const mgInputs = Array.from(mgForm.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-INPUT-') && node.nodeName !== 'MG-INPUT-TOGGLE');
117
- mgInputs.forEach(input => {
118
- if (input.nodeName.includes('CHECKBOX'))
119
- setMgInputChecboxeInvalid(input);
120
- setCheckValitidy(input);
121
- });
122
- await page.waitForChanges();
123
- await mgForm.displayError();
124
- }
125
- await page.waitForChanges();
126
- expect(page.root).toMatchSnapshot();
127
- });
128
- test.each(['fr', 'xx'])('display error message with locale: %s', async (lang) => {
129
- const args = { identifier: 'identifier', lang };
130
- const slot = getSlottedContent();
131
- // Set all elements required
132
- slot.forEach(s => {
133
- s.$attrs$.required = true;
134
- });
135
- const page = await getPage(args, slot);
136
- const mgForm = page.doc.querySelector('mg-form');
137
- // Mock all input validity
138
- const mgInputs = Array.from(mgForm.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-INPUT-') && node.nodeName !== 'MG-INPUT-TOGGLE');
139
- mgInputs.forEach(input => {
140
- if (input.nodeName.includes('CHECKBOX'))
141
- setMgInputChecboxeInvalid(input);
142
- setCheckValitidy(input);
143
- });
144
- await page.waitForChanges();
145
- await mgForm.displayError();
146
- await page.waitForChanges();
147
- expect(page.root).toMatchSnapshot();
148
- });
149
- test.each([undefined, ...buttonTypes])('Should only emit "submit" event for <mg-button type="submit">, case type is %s', async (type) => {
150
- const args = { identifier: 'identifier' };
151
- const slot = [
152
- ...getSlottedContent(),
153
- h("div", { slot: "actions" }, h("mg-button", { type: type }, "Submit")),
154
- ];
155
- const page = await getPage(args, slot);
156
- const mgForm = page.doc.querySelector('mg-form');
157
- const form = mgForm.shadowRoot.querySelector('form');
158
- const mgButton = page.doc.querySelector('mg-button');
159
- const formSpy = jest.spyOn(form, 'dispatchEvent');
160
- const mgFormSpy = jest.spyOn(page.rootInstance.formSubmit, 'emit');
161
- mgButton.dispatchEvent(new Event('click', { bubbles: true }));
162
- await page.waitForChanges();
163
- if ([undefined, 'submit'].includes(type)) {
164
- expect(formSpy).toHaveBeenCalledWith(expect.objectContaining({
165
- type: 'submit',
166
- cancelable: true,
167
- }));
168
- expect(mgFormSpy).toHaveBeenCalled();
169
- }
170
- else {
171
- expect(formSpy).not.toHaveBeenCalled();
172
- expect(mgFormSpy).not.toHaveBeenCalled();
173
- }
174
- });
175
- test('Should update input list when element is added to DOM', async () => {
176
- const args = { identifier: 'identifier' };
177
- const slot = getSlottedContent();
178
- const page = await getPage(args, slot);
179
- spyOn(page.rootInstance, 'setMgInputs');
180
- expect(page.rootInstance.setMgInputs).not.toHaveBeenCalled();
181
- fireMo([]);
182
- await page.waitForChanges();
183
- expect(page.rootInstance.setMgInputs).toHaveBeenCalled();
184
- });
185
- test.each(['readonly', 'disabled'])('Should update input list when attribute % change', async (attribute) => {
186
- const args = { identifier: 'identifier' };
187
- const slot = getSlottedContent();
188
- const page = await getPage(args, slot);
189
- const mgForm = page.doc.querySelector('mg-form');
190
- spyOn(page.rootInstance, 'setMgInputs');
191
- spyOn(page.rootInstance, 'setRequiredMessage');
192
- expect(page.rootInstance.setMgInputs).not.toHaveBeenCalled();
193
- expect(page.rootInstance.setRequiredMessage).not.toHaveBeenCalled();
194
- mgForm[attribute] = true;
195
- await page.waitForChanges();
196
- expect(page.rootInstance.setMgInputs).toHaveBeenCalled();
197
- expect(page.rootInstance.setRequiredMessage).toHaveBeenCalled();
198
- });
199
- test.each([
200
- {
201
- slot: () => [h("mg-input-text", { identifier: "mg-input-text", label: "mg-input-text label" })],
202
- message: null,
203
- },
204
- {
205
- slot: () => [
206
- h("mg-input-text", { identifier: "mg-input-text", label: "mg-input-text label" }),
207
- h("mg-input-toggle", { identifier: "mg-input-toggle", label: "mg-input-toggle label", items: [
208
- { title: 'non', value: false },
209
- { title: 'oui', value: true },
210
- ] }, h("span", { slot: "item-1" }, "non"), h("span", { slot: "item-2" }, "oui")),
211
- ],
212
- message: null,
213
- },
214
- {
215
- slot: () => [h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" })],
216
- message: 'The field is required',
217
- },
218
- {
219
- slot: () => [
220
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
221
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
222
- ],
223
- message: 'All fields are required',
224
- },
225
- {
226
- slot: () => [
227
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
228
- h("mg-input-text", { identifier: "mg-input-text", label: "mg-input-text label" }),
229
- ],
230
- message: 'Field with a <strong class="mg-u-is-asterisk">*</strong> is required',
231
- },
232
- {
233
- slot: () => [
234
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
235
- h("mg-input-text", { identifier: "mg-input-text", label: "mg-input-text label" }),
236
- h("mg-input-toggle", { identifier: "mg-input-toggle", label: "mg-input-toggle label", items: [
237
- { title: 'non', value: false },
238
- { title: 'oui', value: true },
239
- ] }, h("span", { slot: "item-1" }, "non"), h("span", { slot: "item-2" }, "oui")),
240
- ],
241
- message: 'Field with a <strong class="mg-u-is-asterisk">*</strong> is required',
242
- },
243
- {
244
- slot: () => [
245
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
246
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
247
- h("mg-input-toggle", { identifier: "mg-input-toggle", label: "mg-input-toggle label", items: [
248
- { title: 'non', value: false },
249
- { title: 'oui', value: true },
250
- ] }, h("span", { slot: "item-1" }, "non"), h("span", { slot: "item-2" }, "oui")),
251
- ],
252
- message: 'All fields are required',
253
- },
254
- {
255
- slot: () => [
256
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
257
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
258
- h("mg-input-text", { identifier: "mg-input-text", label: "mg-input-text label" }),
259
- ],
260
- message: 'Fields with a <strong class="mg-u-is-asterisk">*</strong> are required',
261
- },
262
- {
263
- slot: () => [
264
- h("mg-input-text", { required: true, identifier: "mg-input-text", label: "mg-input-text label" }),
265
- h("mg-input-toggle", { identifier: "mg-input-toggle", label: "mg-input-toggle label", items: [
266
- { title: 'non', value: false },
267
- { title: 'oui', value: true },
268
- ] }, h("span", { slot: "item-1" }, "non"), h("span", { slot: "item-2" }, "oui")),
269
- ],
270
- message: 'Field with a <strong class="mg-u-is-asterisk">*</strong> is required',
271
- },
272
- ])('Should display needeed required message', async ({ slot, message }) => {
273
- const page = await getPage({ identifier: 'identifier' }, slot());
274
- expect(page.rootInstance.requiredMessage).toBe(message);
275
- });
276
- });
277
- //# sourceMappingURL=mg-form.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-form.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/mg-form/test/mg-form.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,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AAG,EAAE,CAAC;QACV,qBAAe,QAAQ,QAAC,UAAU,EAAC,eAAe,EAAC,KAAK,EAAC,qBAAqB,GAAiB;QAC/F,qBAAe,QAAQ,QAAC,UAAU,EAAC,eAAe,EAAC,KAAK,EAAC,qBAAqB,GAAiB;QAC/F,qBAAe,UAAU,EAAC,eAAe,EAAC,KAAK,EAAC,qBAAqB,GAAiB;OACvF;MACD,OAAO,EAAE,wEAAwE;KAClF;IACD;MACE,IAAI,EAAE,GAAG,EAAE,CAAC;QACV,qBAAe,QAAQ,QAAC,UAAU,EAAC,eAAe,EAAC,KAAK,EAAC,qBAAqB,GAAiB;QAC/F,uBACE,UAAU,EAAC,iBAAiB,EAC5B,KAAK,EAAC,uBAAuB,EAC7B,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;YAC9B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;WAC9B;UAED,YAAM,IAAI,EAAC,QAAQ,UAAW;UAC9B,YAAM,IAAI,EAAC,QAAQ,UAAW,CACd;OACnB;MACD,OAAO,EAAE,sEAAsE;KAChF;GACF,CAAC,CAAC,yCAAyC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IACxE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAEjE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;EAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { MgForm } from '../mg-form';\nimport { MgButton } from '../../../atoms/mg-button/mg-button';\nimport { buttonTypes } from '../../../atoms/mg-button/mg-button.conf';\nimport { MgInputCheckbox } from '../../inputs/mg-input-checkbox/mg-input-checkbox';\nimport { MgInputDate } from '../../inputs/mg-input-date/mg-input-date';\nimport { MgInputNumeric } from '../../inputs/mg-input-numeric/mg-input-numeric';\nimport { MgInputPassword } from '../../inputs/mg-input-password/mg-input-password';\nimport { MgInputRadio } from '../../inputs/mg-input-radio/mg-input-radio';\nimport { MgInputSelect } from '../../inputs/mg-input-select/mg-input-select';\nimport { MgInputText } from '../../inputs/mg-input-text/mg-input-text';\nimport { MgInputTextarea } from '../../inputs/mg-input-textarea/mg-input-textarea';\nimport { MgInputToggle } from '../../inputs/mg-input-toggle/mg-input-toggle';\nimport { HTMLMgInputsElement } from '../../inputs/MgInput.conf';\nimport { setupMutationObserverMock, setupSubmitEventMock } from '../../../../utils/unit.test.utils';\n\nconst getPage = (args, content?) => {\n const page = newSpecPage({\n components: [MgForm, MgInputCheckbox, MgInputDate, MgInputNumeric, MgInputPassword, MgInputRadio, MgInputSelect, MgInputText, MgInputTextarea, MgInputToggle, MgButton],\n template: () => <mg-form {...args}>{content}</mg-form>,\n });\n\n jest.runAllTimers();\n\n return page;\n};\n\nconst getSlottedContent = () => [\n <mg-input-checkbox\n identifier=\"mg-input-checkbox\"\n label=\"mg-input-checkbox label\"\n value={[\n { title: 'oui', value: true },\n { title: 'non', value: false },\n ]}\n ></mg-input-checkbox>,\n <mg-input-date identifier=\"mg-input-date\" label=\"mg-input-date label\"></mg-input-date>,\n <mg-input-numeric identifier=\"mg-input-numeric\" label=\"mg-input-numeric label\"></mg-input-numeric>,\n <mg-input-password identifier=\"mg-input-password\" label=\"mg-input-password label\"></mg-input-password>,\n <mg-input-radio identifier=\"mg-input-radio\" label=\"mg-input-radio label\" items={['blu', 'bli', 'bla', 'blo']}></mg-input-radio>,\n <mg-input-select identifier=\"mg-input-select\" label=\"mg-input-select label\" items={['blu', 'bli', 'bla', 'blo']}></mg-input-select>,\n <mg-input-text identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-textarea identifier=\"mg-input-textarea\" label=\"mg-input-textarea label\"></mg-input-textarea>,\n <mg-input-toggle\n identifier=\"mg-input-toggle\"\n label=\"mg-input-toggle label\"\n items={[\n { title: 'non', value: false },\n { title: 'oui', value: true },\n ]}\n >\n <span slot=\"item-1\">non</span>\n <span slot=\"item-2\">oui</span>\n </mg-input-toggle>,\n];\n\nconst setCheckValitidy = (input: HTMLMgInputsElement): void => {\n const shadowInputs = input.shadowRoot.querySelectorAll('input, textarea, select') as NodeListOf<HTMLInputElement>;\n shadowInputs.forEach(input => {\n input.checkValidity = jest.fn(() => false);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing: true,\n })),\n });\n });\n};\n\nconst setMgInputChecboxeInvalid = (input: HTMLMgInputCheckboxElement): void => {\n input.required = true;\n input.value = [\n { title: 'oui', value: false },\n { title: 'non', value: false },\n ];\n};\n\ndescribe('mg-form', () => {\n let fireMo;\n\n beforeEach(() => {\n jest.useFakeTimers();\n\n setupMutationObserverMock({\n observe: function () {\n fireMo = this.cb;\n },\n disconnect: function () {\n return null;\n },\n takeRecords: () => [],\n });\n setupSubmitEventMock();\n });\n\n afterEach(() => jest.runOnlyPendingTimers());\n\n test.each([\n { args: { identifier: 'identifier' } },\n { args: { identifier: 'identifier', readonly: true } },\n { args: { identifier: 'identifier', disabled: true } },\n { args: { identifier: 'identifier' }, required: 'one' },\n { args: { identifier: 'identifier' }, required: 'all' },\n { args: { identifier: 'identifier' }, required: 'multiple' },\n { args: { identifier: 'identifier' }, required: 'single' },\n { args: { identifier: 'identifier' }, readonly: true },\n ])('Should render with args %o:', async ({ args, required, readonly }) => {\n const slot = required === 'single' ? getSlottedContent()[0] : getSlottedContent();\n if (required === 'one') slot[0].$attrs$.required = true;\n else if (required === 'all')\n slot.forEach(s => {\n s.$attrs$.required = true;\n });\n else if (required === 'multiple') {\n slot[0].$attrs$.required = true;\n slot[1].$attrs$.required = true;\n } else if (required === 'single') slot.$attrs$.required = true;\n\n if (readonly)\n slot.forEach(s => {\n s.$attrs$.readonly = true;\n });\n\n const { root } = await getPage(args, slot);\n expect(root).toMatchSnapshot();\n });\n\n test.each([false, true])('Should display components errors (readonly: %s)', async readonly => {\n const args = { identifier: 'identifier', readonly };\n\n const slot = getSlottedContent();\n // Set all elements required\n slot.forEach(s => {\n s.$attrs$.required = true;\n });\n\n const page = await getPage(args, slot);\n const mgForm = page.doc.querySelector('mg-form');\n\n if (!readonly) {\n // Mock all input validity\n const mgInputs = Array.from(mgForm.querySelectorAll('*')).filter(\n (node: Node) => node.nodeName.startsWith('MG-INPUT-') && node.nodeName !== 'MG-INPUT-TOGGLE',\n ) as HTMLMgInputsElement[];\n mgInputs.forEach(input => {\n if (input.nodeName.includes('CHECKBOX')) setMgInputChecboxeInvalid(input as HTMLMgInputCheckboxElement);\n setCheckValitidy(input);\n });\n await page.waitForChanges();\n\n await mgForm.displayError();\n }\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each(['fr', 'xx'])('display error message with locale: %s', async lang => {\n const args = { identifier: 'identifier', lang };\n\n const slot = getSlottedContent();\n // Set all elements required\n slot.forEach(s => {\n s.$attrs$.required = true;\n });\n\n const page = await getPage(args, slot);\n const mgForm = page.doc.querySelector('mg-form');\n\n // Mock all input validity\n const mgInputs = Array.from(mgForm.querySelectorAll('*')).filter(\n (node: Node) => node.nodeName.startsWith('MG-INPUT-') && node.nodeName !== 'MG-INPUT-TOGGLE',\n ) as HTMLMgInputsElement[];\n mgInputs.forEach(input => {\n if (input.nodeName.includes('CHECKBOX')) setMgInputChecboxeInvalid(input as HTMLMgInputCheckboxElement);\n setCheckValitidy(input);\n });\n await page.waitForChanges();\n\n await mgForm.displayError();\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each([undefined, ...buttonTypes])('Should only emit \"submit\" event for <mg-button type=\"submit\">, case type is %s', async type => {\n const args = { identifier: 'identifier' };\n const slot = [\n ...getSlottedContent(),\n <div slot=\"actions\">\n <mg-button type={type}>Submit</mg-button>\n </div>,\n ];\n const page = await getPage(args, slot);\n\n const mgForm = page.doc.querySelector('mg-form');\n const form = mgForm.shadowRoot.querySelector('form');\n const mgButton = page.doc.querySelector('mg-button');\n\n const formSpy = jest.spyOn(form, 'dispatchEvent');\n const mgFormSpy = jest.spyOn(page.rootInstance.formSubmit, 'emit');\n\n mgButton.dispatchEvent(new Event('click', { bubbles: true }));\n\n await page.waitForChanges();\n\n if ([undefined, 'submit'].includes(type)) {\n expect(formSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n type: 'submit',\n cancelable: true,\n }),\n );\n expect(mgFormSpy).toHaveBeenCalled();\n } else {\n expect(formSpy).not.toHaveBeenCalled();\n expect(mgFormSpy).not.toHaveBeenCalled();\n }\n });\n\n test('Should update input list when element is added to DOM', async () => {\n const args = { identifier: 'identifier' };\n const slot = getSlottedContent();\n const page = await getPage(args, slot);\n\n spyOn(page.rootInstance, 'setMgInputs');\n\n expect(page.rootInstance.setMgInputs).not.toHaveBeenCalled();\n\n fireMo([]);\n await page.waitForChanges();\n\n expect(page.rootInstance.setMgInputs).toHaveBeenCalled();\n });\n\n test.each(['readonly', 'disabled'])('Should update input list when attribute % change', async attribute => {\n const args = { identifier: 'identifier' };\n const slot = getSlottedContent();\n const page = await getPage(args, slot);\n const mgForm = page.doc.querySelector('mg-form');\n\n spyOn(page.rootInstance, 'setMgInputs');\n spyOn(page.rootInstance, 'setRequiredMessage');\n\n expect(page.rootInstance.setMgInputs).not.toHaveBeenCalled();\n expect(page.rootInstance.setRequiredMessage).not.toHaveBeenCalled();\n\n mgForm[attribute] = true;\n await page.waitForChanges();\n\n expect(page.rootInstance.setMgInputs).toHaveBeenCalled();\n expect(page.rootInstance.setRequiredMessage).toHaveBeenCalled();\n });\n\n test.each([\n {\n slot: () => [<mg-input-text identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>],\n message: null,\n },\n {\n slot: () => [\n <mg-input-text identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-toggle\n identifier=\"mg-input-toggle\"\n label=\"mg-input-toggle label\"\n items={[\n { title: 'non', value: false },\n { title: 'oui', value: true },\n ]}\n >\n <span slot=\"item-1\">non</span>\n <span slot=\"item-2\">oui</span>\n </mg-input-toggle>,\n ],\n message: null,\n },\n {\n slot: () => [<mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>],\n message: 'The field is required',\n },\n {\n slot: () => [\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n ],\n message: 'All fields are required',\n },\n {\n slot: () => [\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-text identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n ],\n message: 'Field with a <strong class=\"mg-u-is-asterisk\">*</strong> is required',\n },\n {\n slot: () => [\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-text identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-toggle\n identifier=\"mg-input-toggle\"\n label=\"mg-input-toggle label\"\n items={[\n { title: 'non', value: false },\n { title: 'oui', value: true },\n ]}\n >\n <span slot=\"item-1\">non</span>\n <span slot=\"item-2\">oui</span>\n </mg-input-toggle>,\n ],\n message: 'Field with a <strong class=\"mg-u-is-asterisk\">*</strong> is required',\n },\n {\n slot: () => [\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-toggle\n identifier=\"mg-input-toggle\"\n label=\"mg-input-toggle label\"\n items={[\n { title: 'non', value: false },\n { title: 'oui', value: true },\n ]}\n >\n <span slot=\"item-1\">non</span>\n <span slot=\"item-2\">oui</span>\n </mg-input-toggle>,\n ],\n message: 'All fields are required',\n },\n {\n slot: () => [\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-text identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n ],\n message: 'Fields with a <strong class=\"mg-u-is-asterisk\">*</strong> are required',\n },\n {\n slot: () => [\n <mg-input-text required identifier=\"mg-input-text\" label=\"mg-input-text label\"></mg-input-text>,\n <mg-input-toggle\n identifier=\"mg-input-toggle\"\n label=\"mg-input-toggle label\"\n items={[\n { title: 'non', value: false },\n { title: 'oui', value: true },\n ]}\n >\n <span slot=\"item-1\">non</span>\n <span slot=\"item-2\">oui</span>\n </mg-input-toggle>,\n ],\n message: 'Field with a <strong class=\"mg-u-is-asterisk\">*</strong> is required',\n },\n ])('Should display needeed required message', async ({ slot, message }) => {\n const page = await getPage({ identifier: 'identifier' }, slot());\n\n expect(page.rootInstance.requiredMessage).toBe(message);\n });\n});\n"]}
@@ -1,39 +0,0 @@
1
- import { createPage } from "../../../../utils/stencil.e2e.test.utils";
2
- const template = (size = 'regular', direction = 'vertical') => `<mg-illustrated-message size="${size}" direction="${direction}">
3
- <svg slot="illustration" width="190" height="350" viewBox="0 0 190 350" xmlns="http://www.w3.org/2000/svg">
4
- <path
5
- fill-rule="evenodd"
6
- clip-rule="evenodd"
7
- d="M0 0H15C23.2843 0 30 6.71573 30 15V290H40V15C40 6.71573 46.7157 0 55 0C63.2843 0 70 6.71573 70 15V275C70 277.761 67.7615 280 65 280H60V40H50V340H60V290H65C67.7615 290 70 292.239 70 295V340H80V295C80 291.158 78.5558 287.654 76.1805 285C78.5558 282.346 80 278.842 80 275V0H95C103.284 0 110 6.71573 110 15V25C110 28.8418 108.556 32.3462 106.181 35C108.556 37.6538 110 41.1582 110 45V305C110 307.761 107.761 310 105 310H100V45C100 42.2386 97.7615 40 95 40H90V325C90 333.284 96.7157 340 105 340H120V330H105C102.239 330 100 327.761 100 325V320H105C113.284 320 120 313.284 120 305V15C120 6.71573 126.716 0 135 0C143.284 0 150 6.71573 150 15V330H140V15C140 12.2386 137.761 10 135 10C132.239 10 130 12.2386 130 15V340H165C173.284 340 180 333.284 180 325V15C180 12.2386 177.761 10 175 10H170V325C170 327.761 167.761 330 165 330H160V0H175C183.284 0 190 6.71573 190 15V350H0V0ZM10 325C10 333.284 16.7157 340 25 340C33.2843 340 40 333.284 40 325V300H30V325C30 327.761 27.7615 330 25 330C22.2385 330 20 327.761 20 325V15C20 12.2386 17.7615 10 15 10H10V325ZM60 15V30H50V15C50 12.2386 52.2385 10 55 10C57.7615 10 60 12.2386 60 15ZM95 30H90V10H95C97.7615 10 100 12.2386 100 15V25C100 27.7614 97.7615 30 95 30Z"
8
- fill="black"
9
- />
10
- </svg>
11
- <h2 slot="title">Lorem Ipsum</h2>
12
- <h3 slot="details">The standard Lorem Ipsum passage, used since the 1500s</h3>
13
- <div slot="details">
14
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
15
- exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
16
- pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
17
- </div>
18
- </mg-illustrated-message>`;
19
- describe('mg-illustrated-message', () => {
20
- test.each(['regular', 'small'])('renders size %', async (size) => {
21
- const page = await createPage(template(size));
22
- const element = await page.find('mg-illustrated-message');
23
- expect(element).toHaveClass('hydrated');
24
- const screenshot = await page.screenshot();
25
- expect(screenshot).toMatchImageSnapshot();
26
- });
27
- test('renders horizontal', async () => {
28
- const page = await createPage(template(undefined, 'horizontal'));
29
- const element = await page.find('mg-illustrated-message');
30
- expect(element).toHaveClass('hydrated');
31
- await page.setViewport({ width: 800, height: 300 });
32
- const screenshot = await page.screenshot();
33
- expect(screenshot).toMatchImageSnapshot();
34
- await page.setViewport({ width: 600, height: 600 });
35
- const screenshotResponsive = await page.screenshot();
36
- expect(screenshotResponsive).toMatchImageSnapshot();
37
- });
38
- });
39
- //# sourceMappingURL=mg-illustrated-message.e2e.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-illustrated-message.e2e.js","sourceRoot":"","sources":["../../../../../src/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,MAAM,QAAQ,GAAG,CAAC,IAAI,GAAG,SAAS,EAAE,SAAS,GAAG,UAAU,EAAE,EAAE,CAAC,iCAAiC,IAAI,gBAAgB,SAAS;;;;;;;;;;;;;;;;0BAgBnG,CAAC;AAE3B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;EACtC,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;IAC7D,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAExC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,EAAE,CAAC;EAC5C,CAAC,CAAC,CAAC;EAEH,IAAI,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;IACpC,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAEjE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAExC,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,EAAE,CAAC;IAE1C,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAEpD,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IACrD,MAAM,CAAC,oBAAoB,CAAC,CAAC,oBAAoB,EAAE,CAAC;EACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { createPage } from '../../../../utils/stencil.e2e.test.utils';\n\nconst template = (size = 'regular', direction = 'vertical') => `<mg-illustrated-message size=\"${size}\" direction=\"${direction}\">\n<svg slot=\"illustration\" width=\"190\" height=\"350\" viewBox=\"0 0 190 350\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M0 0H15C23.2843 0 30 6.71573 30 15V290H40V15C40 6.71573 46.7157 0 55 0C63.2843 0 70 6.71573 70 15V275C70 277.761 67.7615 280 65 280H60V40H50V340H60V290H65C67.7615 290 70 292.239 70 295V340H80V295C80 291.158 78.5558 287.654 76.1805 285C78.5558 282.346 80 278.842 80 275V0H95C103.284 0 110 6.71573 110 15V25C110 28.8418 108.556 32.3462 106.181 35C108.556 37.6538 110 41.1582 110 45V305C110 307.761 107.761 310 105 310H100V45C100 42.2386 97.7615 40 95 40H90V325C90 333.284 96.7157 340 105 340H120V330H105C102.239 330 100 327.761 100 325V320H105C113.284 320 120 313.284 120 305V15C120 6.71573 126.716 0 135 0C143.284 0 150 6.71573 150 15V330H140V15C140 12.2386 137.761 10 135 10C132.239 10 130 12.2386 130 15V340H165C173.284 340 180 333.284 180 325V15C180 12.2386 177.761 10 175 10H170V325C170 327.761 167.761 330 165 330H160V0H175C183.284 0 190 6.71573 190 15V350H0V0ZM10 325C10 333.284 16.7157 340 25 340C33.2843 340 40 333.284 40 325V300H30V325C30 327.761 27.7615 330 25 330C22.2385 330 20 327.761 20 325V15C20 12.2386 17.7615 10 15 10H10V325ZM60 15V30H50V15C50 12.2386 52.2385 10 55 10C57.7615 10 60 12.2386 60 15ZM95 30H90V10H95C97.7615 10 100 12.2386 100 15V25C100 27.7614 97.7615 30 95 30Z\"\n fill=\"black\"\n />\n</svg>\n<h2 slot=\"title\">Lorem Ipsum</h2>\n<h3 slot=\"details\">The standard Lorem Ipsum passage, used since the 1500s</h3>\n<div slot=\"details\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud\n exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\n pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n</div>\n</mg-illustrated-message>`;\n\ndescribe('mg-illustrated-message', () => {\n test.each(['regular', 'small'])('renders size %', async size => {\n const page = await createPage(template(size));\n\n const element = await page.find('mg-illustrated-message');\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n\n test('renders horizontal', async () => {\n const page = await createPage(template(undefined, 'horizontal'));\n\n const element = await page.find('mg-illustrated-message');\n expect(element).toHaveClass('hydrated');\n\n await page.setViewport({ width: 800, height: 300 });\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n\n await page.setViewport({ width: 600, height: 600 });\n\n const screenshotResponsive = await page.screenshot();\n expect(screenshotResponsive).toMatchImageSnapshot();\n });\n});\n"]}
@@ -1,36 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { newSpecPage } from "@stencil/core/testing";
3
- import { MgIllustratedMessage } from "../mg-illustrated-message";
4
- const getPage = (args, title = h("h2", { slot: "title" }, "Lorem Ipsum"), illustration = (h("svg", { slot: "illustration", width: "190", height: "350", viewBox: "0 0 190 350", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0 0H15C23.2843 0 30 6.71573 30 15V290H40V15C40 6.71573 46.7157 0 55 0C63.2843 0 70 6.71573 70 15V275C70 277.761 67.7615 280 65 280H60V40H50V340H60V290H65C67.7615 290 70 292.239 70 295V340H80V295C80 291.158 78.5558 287.654 76.1805 285C78.5558 282.346 80 278.842 80 275V0H95C103.284 0 110 6.71573 110 15V25C110 28.8418 108.556 32.3462 106.181 35C108.556 37.6538 110 41.1582 110 45V305C110 307.761 107.761 310 105 310H100V45C100 42.2386 97.7615 40 95 40H90V325C90 333.284 96.7157 340 105 340H120V330H105C102.239 330 100 327.761 100 325V320H105C113.284 320 120 313.284 120 305V15C120 6.71573 126.716 0 135 0C143.284 0 150 6.71573 150 15V330H140V15C140 12.2386 137.761 10 135 10C132.239 10 130 12.2386 130 15V340H165C173.284 340 180 333.284 180 325V15C180 12.2386 177.761 10 175 10H170V325C170 327.761 167.761 330 165 330H160V0H175C183.284 0 190 6.71573 190 15V350H0V0ZM10 325C10 333.284 16.7157 340 25 340C33.2843 340 40 333.284 40 325V300H30V325C30 327.761 27.7615 330 25 330C22.2385 330 20 327.761 20 325V15C20 12.2386 17.7615 10 15 10H10V325ZM60 15V30H50V15C50 12.2386 52.2385 10 55 10C57.7615 10 60 12.2386 60 15ZM95 30H90V10H95C97.7615 10 100 12.2386 100 15V25C100 27.7614 97.7615 30 95 30Z", fill: "black" })))) => newSpecPage({
5
- components: [MgIllustratedMessage],
6
- template: () => (h("mg-illustrated-message", Object.assign({}, args), illustration, title, h("h3", { slot: "details" }, "The standard Lorem Ipsum passage, used since the 1500s"), h("div", { slot: "details" }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."))),
7
- });
8
- describe('mg-illustrated-message', () => {
9
- test.each([{}, { size: 'small' }, { direction: 'horizontal' }])('with args %s', async (args) => {
10
- const { root } = await getPage(args);
11
- expect(root).toMatchSnapshot();
12
- });
13
- test('Should render even if slotted content is not an image file', async () => {
14
- const { root } = await getPage({}, undefined, h("span", { slot: "illustration" }));
15
- expect(root).toMatchSnapshot();
16
- });
17
- test('Should throw error if slot title element is not a heading', async () => {
18
- expect.assertions(1);
19
- try {
20
- await getPage({}, h("span", { slot: "title" }, "Lorem Ipsum"));
21
- }
22
- catch (err) {
23
- expect(err.message).toContain('<mg-illustrated-message> Slotted title must be a heading: ');
24
- }
25
- });
26
- test.each([h("div", null, "content without illustration slot"), [h("svg", { slot: "illustration" }), h("svg", { slot: "illustration" })]])('Should throw error if slot illustration is not single or element is not an image', async (slottedIllustration) => {
27
- expect.assertions(1);
28
- try {
29
- await getPage({}, undefined, slottedIllustration);
30
- }
31
- catch (err) {
32
- expect(err.message).toEqual('<mg-illustrated-message> Slotted illustration must be present and unique.');
33
- }
34
- });
35
- });
36
- //# sourceMappingURL=mg-illustrated-message.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-illustrated-message.spec.js","sourceRoot":"","sources":["../../../../../src/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MA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AAC,eAAe,EAAE,CAAC;EACjC,CAAC,CAAC,CAAC;EAEH,IAAI,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;IAC3E,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrB,IAAI;MACF,MAAM,OAAO,CAAC,EAAE,EAAE,YAAM,IAAI,EAAC,OAAO,kBAAmB,CAAC,CAAC;KAC1D;IAAC,OAAO,GAAG,EAAE;MACZ,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,4DAA4D,CAAC,CAAC;KAC7F;EACH,CAAC,CAAC,CAAC;EAEH,IAAI,CAAC,IAAI,CAAC,CAAC,mDAA4C,EAAE,CAAC,WAAK,IAAI,EAAC,cAAc,GAAO,EAAE,WAAK,IAAI,EAAC,cAAc,GAAO,CAAC,CAAC,CAAC,CAC3H,kFAAkF,EAClF,KAAK,EAAC,mBAAmB,EAAC,EAAE;IAC1B,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrB,IAAI;MACF,MAAM,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC;KACnD;IAAC,OAAO,GAAG,EAAE;MACZ,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,2EAA2E,CAAC,CAAC;KAC1G;EACH,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { MgIllustratedMessage } from '../mg-illustrated-message';\n\nconst getPage = (\n args,\n title = <h2 slot=\"title\">Lorem Ipsum</h2>,\n illustration = (\n <svg slot=\"illustration\" width=\"190\" height=\"350\" viewBox=\"0 0 190 350\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M0 0H15C23.2843 0 30 6.71573 30 15V290H40V15C40 6.71573 46.7157 0 55 0C63.2843 0 70 6.71573 70 15V275C70 277.761 67.7615 280 65 280H60V40H50V340H60V290H65C67.7615 290 70 292.239 70 295V340H80V295C80 291.158 78.5558 287.654 76.1805 285C78.5558 282.346 80 278.842 80 275V0H95C103.284 0 110 6.71573 110 15V25C110 28.8418 108.556 32.3462 106.181 35C108.556 37.6538 110 41.1582 110 45V305C110 307.761 107.761 310 105 310H100V45C100 42.2386 97.7615 40 95 40H90V325C90 333.284 96.7157 340 105 340H120V330H105C102.239 330 100 327.761 100 325V320H105C113.284 320 120 313.284 120 305V15C120 6.71573 126.716 0 135 0C143.284 0 150 6.71573 150 15V330H140V15C140 12.2386 137.761 10 135 10C132.239 10 130 12.2386 130 15V340H165C173.284 340 180 333.284 180 325V15C180 12.2386 177.761 10 175 10H170V325C170 327.761 167.761 330 165 330H160V0H175C183.284 0 190 6.71573 190 15V350H0V0ZM10 325C10 333.284 16.7157 340 25 340C33.2843 340 40 333.284 40 325V300H30V325C30 327.761 27.7615 330 25 330C22.2385 330 20 327.761 20 325V15C20 12.2386 17.7615 10 15 10H10V325ZM60 15V30H50V15C50 12.2386 52.2385 10 55 10C57.7615 10 60 12.2386 60 15ZM95 30H90V10H95C97.7615 10 100 12.2386 100 15V25C100 27.7614 97.7615 30 95 30Z\"\n fill=\"black\"\n />\n </svg>\n ),\n) =>\n newSpecPage({\n components: [MgIllustratedMessage],\n template: () => (\n <mg-illustrated-message {...args}>\n {illustration}\n {title}\n <h3 slot=\"details\">The standard Lorem Ipsum passage, used since the 1500s</h3>\n <div slot=\"details\">\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud\n exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\n pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n </div>\n </mg-illustrated-message>\n ),\n });\n\ndescribe('mg-illustrated-message', () => {\n test.each([{}, { size: 'small' }, { direction: 'horizontal' }])('with args %s', async args => {\n const { root } = await getPage(args);\n expect(root).toMatchSnapshot();\n });\n\n test('Should render even if slotted content is not an image file', async () => {\n const { root } = await getPage({}, undefined, <span slot=\"illustration\"></span>);\n expect(root).toMatchSnapshot();\n });\n\n test('Should throw error if slot title element is not a heading', async () => {\n expect.assertions(1);\n try {\n await getPage({}, <span slot=\"title\">Lorem Ipsum</span>);\n } catch (err) {\n expect(err.message).toContain('<mg-illustrated-message> Slotted title must be a heading: ');\n }\n });\n\n test.each([<div>content without illustration slot</div>, [<svg slot=\"illustration\"></svg>, <svg slot=\"illustration\"></svg>]])(\n 'Should throw error if slot illustration is not single or element is not an image',\n async slottedIllustration => {\n expect.assertions(1);\n try {\n await getPage({}, undefined, slottedIllustration);\n } catch (err) {\n expect(err.message).toEqual('<mg-illustrated-message> Slotted illustration must be present and unique.');\n }\n },\n );\n});\n"]}
@@ -1,85 +0,0 @@
1
- import { OverflowBehaviorElements } from "../../../../utils/behaviors.utils";
2
- import { setPageContent, expect, describe, testEach } from "../../../../utils/playwright.e2e.test.utils";
3
- import { renderAttributes } from "../../../../utils/e2e.test.utils";
4
- import { Status } from "../../menu/mg-menu-item/mg-menu-item.conf";
5
- import { Direction, sizes } from "../../menu/mg-menu/mg-menu.conf";
6
- const verticalFrameSizes = {
7
- regular: {
8
- height: 200,
9
- width: 180,
10
- },
11
- medium: {
12
- height: 300,
13
- width: 180,
14
- },
15
- large: {
16
- height: 400,
17
- width: 180,
18
- },
19
- };
20
- const getSubMenuSize = (size) => {
21
- if (size === 'large')
22
- return 'medium';
23
- else if (size === 'medium')
24
- return 'regular';
25
- else
26
- return 'regular';
27
- };
28
- const createHTML = args => `
29
- <header class="menu-container menu-container--${args.direction}-small">
30
- <mg-menu ${renderAttributes(Object.assign({ label: 'menu' }, args))}>
31
- <mg-menu-item status="active">
32
- <span slot="label">1 - head-1</span>
33
- <mg-menu ${renderAttributes({ label: 'sub-menu 1', direction: Direction.VERTICAL, size: getSubMenuSize(args === null || args === void 0 ? void 0 : args.size) })}>
34
- <mg-menu-item><span slot="label">Batman begins</span></mg-menu-item>
35
- </mg-menu>
36
- </mg-menu-item>
37
- <mg-menu-item status="disabled"><span slot="label">1 - head-2 long</span></mg-menu-item>
38
- <mg-menu-item href="#link">
39
- <span slot="label">1 - head-3 very long</span>
40
- <mg-icon icon='user' slot='image'></mg-icon>
41
- </mg-menu-item>
42
- <mg-menu-item>
43
- <span slot="label">1 - head-4</span>
44
- <mg-icon icon='user' slot='image'></mg-icon>
45
- ${(args === null || args === void 0 ? void 0 : args.badge) ? "<mg-badge value='2' label='hello' slot='information'></mg-badge>" : ''}
46
- </mg-menu-item>
47
- <mg-menu-item>
48
- <span slot="label">1 - head-5</span>
49
- <mg-icon icon='user' slot='image'></mg-icon>
50
- ${(args === null || args === void 0 ? void 0 : args.badge) ? "<mg-badge value='2' label='hello' slot='information'></mg-badge>" : ''}
51
- <mg-menu ${renderAttributes({ label: 'sub-menu 2', direction: Direction.VERTICAL, size: getSubMenuSize(args === null || args === void 0 ? void 0 : args.size) })}>
52
- <mg-menu-item><span slot="label">Batman begins with a longer title to go outide screen</span></mg-menu-item>
53
- </mg-menu>
54
- </mg-menu-item>
55
- </mg-menu>
56
- </header>
57
- <style>
58
- .menu-container.menu-container--vertical-small {
59
- width: 180px;
60
- }
61
- .menu-container.menu-container--horizontal-small {
62
- width: 200px;
63
- }
64
- </style>
65
- `;
66
- describe('mg-item-more', () => {
67
- describe('mg-menu', () => {
68
- testEach(sizes)(`should renders, case direction ${Direction.VERTICAL} size %s with small screen`, async (page, size) => {
69
- await setPageContent(page, createHTML({ direction: Direction.VERTICAL, size }), verticalFrameSizes[size]);
70
- await expect(page.locator('.e2e-screenshot')).toHaveScreenshot();
71
- });
72
- testEach([true, false])('should renders with overflow, case badge %s', async (page, badge) => {
73
- await setPageContent(page, createHTML({ direction: Direction.HORIZONTAL, badge }), { width: 400, height: 250 });
74
- await expect(page.locator('.e2e-screenshot')).toHaveScreenshot();
75
- await page.$eval(`[${OverflowBehaviorElements.BASE_INDEX}="0"]`, (elm, status) => {
76
- elm.setAttribute('status', status);
77
- }, Status.VISIBLE);
78
- await page.$eval(`[${OverflowBehaviorElements.BASE_INDEX}="2"]`, (elm, status) => {
79
- elm.setAttribute('status', status);
80
- }, Status.ACTIVE);
81
- await expect(page.locator('.e2e-screenshot')).toHaveScreenshot();
82
- });
83
- });
84
- });
85
- //# sourceMappingURL=mg-item-more.e2e.playwright.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mg-item-more.e2e.playwright.js","sourceRoot":"","sources":["../../../../../src/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAY,MAAM,6CAA6C,CAAC;AACnH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,SAAS,EAAgB,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAEjF,MAAM,kBAAkB,GAAG;EACzB,OAAO,EAAE;IACP,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;GACX;EACD,MAAM,EAAE;IACN,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;GACX;EACD,KAAK,EAAE;IACL,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;GACX;CACF,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,IAAkB,EAAE,EAAE;EAC5C,IAAI,IAAI,KAAK,OAAO;IAAE,OAAO,QAAQ,CAAC;OACjC,IAAI,IAAI,KAAK,QAAQ;IAAE,OAAO,SAAS,CAAC;;IACxC,OAAO,SAAS,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,UAAU,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Q,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,6CAA6C,EAAE,KAAK,EAAE,IAAc,EAAE,KAAK,EAAE,EAAE;MACrG,MAAM,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;MAEhH,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;MAEjE,MAAM,IAAI,CAAC,KAAK,CACd,IAAI,wBAAwB,CAAC,UAAU,OAAO,EAC9C,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACd,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAgB,CAAC,CAAC;MAC/C,CAAC,EACD,MAAM,CAAC,OAAO,CACf,CAAC;MAEF,MAAM,IAAI,CAAC,KAAK,CACd,IAAI,wBAAwB,CAAC,UAAU,OAAO,EAC9C,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACd,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAgB,CAAC,CAAC;MAC/C,CAAC,EACD,MAAM,CAAC,MAAM,CACd,CAAC;MAEF,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnE,CAAC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { OverflowBehaviorElements } from '../../../../utils/behaviors.utils';\nimport { setPageContent, expect, describe, testEach, PageType } from '../../../../utils/playwright.e2e.test.utils';\nimport { renderAttributes } from '../../../../utils/e2e.test.utils';\nimport { Status } from '../../menu/mg-menu-item/mg-menu-item.conf';\nimport { Direction, MenuSizeType, sizes } from '../../menu/mg-menu/mg-menu.conf';\n\nconst verticalFrameSizes = {\n regular: {\n height: 200,\n width: 180,\n },\n medium: {\n height: 300,\n width: 180,\n },\n large: {\n height: 400,\n width: 180,\n },\n};\n\nconst getSubMenuSize = (size: MenuSizeType) => {\n if (size === 'large') return 'medium';\n else if (size === 'medium') return 'regular';\n else return 'regular';\n};\n\nconst createHTML = args => `\n <header class=\"menu-container menu-container--${args.direction}-small\">\n <mg-menu ${renderAttributes({ label: 'menu', ...args })}>\n <mg-menu-item status=\"active\">\n <span slot=\"label\">1 - head-1</span>\n <mg-menu ${renderAttributes({ label: 'sub-menu 1', direction: Direction.VERTICAL, size: getSubMenuSize(args?.size) })}>\n <mg-menu-item><span slot=\"label\">Batman begins</span></mg-menu-item>\n </mg-menu>\n </mg-menu-item>\n <mg-menu-item status=\"disabled\"><span slot=\"label\">1 - head-2 long</span></mg-menu-item>\n <mg-menu-item href=\"#link\">\n <span slot=\"label\">1 - head-3 very long</span>\n <mg-icon icon='user' slot='image'></mg-icon>\n </mg-menu-item>\n <mg-menu-item>\n <span slot=\"label\">1 - head-4</span>\n <mg-icon icon='user' slot='image'></mg-icon>\n ${args?.badge ? \"<mg-badge value='2' label='hello' slot='information'></mg-badge>\" : ''} \n </mg-menu-item>\n <mg-menu-item>\n <span slot=\"label\">1 - head-5</span>\n <mg-icon icon='user' slot='image'></mg-icon>\n ${args?.badge ? \"<mg-badge value='2' label='hello' slot='information'></mg-badge>\" : ''} \n <mg-menu ${renderAttributes({ label: 'sub-menu 2', direction: Direction.VERTICAL, size: getSubMenuSize(args?.size) })}>\n <mg-menu-item><span slot=\"label\">Batman begins with a longer title to go outide screen</span></mg-menu-item>\n </mg-menu>\n </mg-menu-item>\n </mg-menu>\n </header>\n <style>\n .menu-container.menu-container--vertical-small {\n width: 180px;\n }\n .menu-container.menu-container--horizontal-small {\n width: 200px;\n }\n </style>\n `;\n\ndescribe('mg-item-more', () => {\n describe('mg-menu', () => {\n testEach(sizes)(`should renders, case direction ${Direction.VERTICAL} size %s with small screen`, async (page: PageType, size: string) => {\n await setPageContent(page, createHTML({ direction: Direction.VERTICAL, size }), verticalFrameSizes[size]);\n\n await expect(page.locator('.e2e-screenshot')).toHaveScreenshot();\n });\n\n testEach([true, false])('should renders with overflow, case badge %s', async (page: PageType, badge) => {\n await setPageContent(page, createHTML({ direction: Direction.HORIZONTAL, badge }), { width: 400, height: 250 });\n\n await expect(page.locator('.e2e-screenshot')).toHaveScreenshot();\n\n await page.$eval(\n `[${OverflowBehaviorElements.BASE_INDEX}=\"0\"]`,\n (elm, status) => {\n elm.setAttribute('status', status as string);\n },\n Status.VISIBLE,\n );\n\n await page.$eval(\n `[${OverflowBehaviorElements.BASE_INDEX}=\"2\"]`,\n (elm, status) => {\n elm.setAttribute('status', status as string);\n },\n Status.ACTIVE,\n );\n\n await expect(page.locator('.e2e-screenshot')).toHaveScreenshot();\n });\n });\n});\n"]}