@cnamts/synapse 1.0.13 → 1.0.15

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 (254) hide show
  1. package/README.md +72 -72
  2. package/dist/{DateFilter-_EFzsvvM.js → DateFilter-isr8mXVb.js} +1 -1
  3. package/dist/{NumberFilter-CUxEbKJh.js → NumberFilter-BOe7DqWX.js} +1 -1
  4. package/dist/{PeriodFilter-D5ueqtKy.js → PeriodFilter-WTprpO40.js} +1 -1
  5. package/dist/{SelectFilter-BciBNydy.js → SelectFilter-CqlG5dmI.js} +1 -1
  6. package/dist/{TextFilter-DMN_WAQB.js → TextFilter-fVW5bsRw.js} +1 -1
  7. package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +60 -28
  8. package/dist/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.d.ts +3 -3
  9. package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +60 -28
  10. package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +61 -29
  11. package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +5 -1
  12. package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +3 -1
  13. package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +1 -1
  14. package/dist/components/Captcha/Captcha.d.ts +2 -0
  15. package/dist/components/Captcha/CaptchaBase.d.ts +1 -0
  16. package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +29 -17
  17. package/dist/components/Customs/SyTabs/SyTabs.d.ts +20 -0
  18. package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +100 -10
  19. package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +108 -21
  20. package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +6 -6
  21. package/dist/components/DatePicker/composables/useDateFormatDisplay.d.ts +3 -0
  22. package/dist/components/DatePicker/tests/setup.d.ts +768 -48
  23. package/dist/components/FilterSideBar/FilterSideBar.d.ts +8 -0
  24. package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +58 -34
  25. package/dist/components/LangBtn/LangBtn.d.ts +4 -0
  26. package/dist/components/PeriodField/PeriodField.d.ts +192 -12
  27. package/dist/components/RatingPicker/RatingPicker.d.ts +9 -0
  28. package/dist/components/SearchListField/SearchListField.d.ts +42 -413
  29. package/dist/components/SearchListField/locales.d.ts +1 -2
  30. package/dist/components/SyAlert/SyAlert.d.ts +1 -1
  31. package/dist/components/SyTextArea/SyTextArea.d.ts +2 -0
  32. package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +15 -8
  33. package/dist/components/Tables/SyTable/SyTable.d.ts +15 -8
  34. package/dist/components/Tables/common/SyTablePagination.d.ts +29 -17
  35. package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +4 -0
  36. package/dist/components/Tables/common/types.d.ts +2 -0
  37. package/dist/design-system-v3.js +1 -1
  38. package/dist/design-system-v3.umd.cjs +32 -16
  39. package/dist/{main-DISHlqcd.js → main-CbBVJ_le.js} +9911 -9751
  40. package/dist/style.css +1 -1
  41. package/package.json +5 -2
  42. package/src/assets/amelipro/icons.ts +17 -0
  43. package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.stories.ts +40 -36
  44. package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/AmeliproAccordionGroup.spec.ts +226 -26
  45. package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/__snapshots__/AmeliproAccordionGroup.spec.ts.snap +55 -506
  46. package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +1 -1
  47. package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +7 -2
  48. package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +2 -1
  49. package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/__snapshots__/AmeliproAccordionResultTemplate.spec.ts.snap +4 -1
  50. package/src/components/Amelipro/AmeliproAccordionResult/__tests__/__snapshots__/AmeliproAccordionResult.spec.ts.snap +4 -1
  51. package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +1 -1
  52. package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +9 -3
  53. package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +42 -11
  54. package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.stories.ts +4 -4
  55. package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.vue +7 -5
  56. package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +4 -2
  57. package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.stories.ts +1 -40
  58. package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.vue +4 -0
  59. package/src/components/Amelipro/AmeliproCallback/AmeliproCallback.stories.ts +4 -2
  60. package/src/components/Amelipro/AmeliproCaptcha/__tests__/__snapshots__/AmeliproCaptcha.spec.ts.snap +2 -1
  61. package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.stories.ts +39 -29
  62. package/src/components/Amelipro/AmeliproCopyBtn/__tests__/__snapshots__/AmeliproCopyBtn.spec.ts.snap +4 -1
  63. package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +3 -3
  64. package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +8 -6
  65. package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.mdx +3 -1
  66. package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.stories.ts +23 -5
  67. package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +5 -6
  68. package/src/components/Amelipro/AmeliproFilePreview/__tests__/AmeliproFilePreview.spec.ts +2 -2
  69. package/src/components/Amelipro/AmeliproFilePreview/__tests__/__snapshots__/AmeliproFilePreview.spec.ts.snap +5 -6
  70. package/src/components/Amelipro/AmeliproFirstLogin/__tests__/__snapshots__/AmeliproFirstLogin.spec.ts.snap +4 -1
  71. package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +1 -2
  72. package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/__tests__/AmeliproLogoAm.spec.ts +78 -0
  73. package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/{tests → __tests__}/__snapshots__/AmeliproLogoAm.spec.ts.snap +64 -2
  74. package/src/components/Amelipro/AmeliproIcon/__tests__/AmeliproIcon.spec.ts +358 -0
  75. package/src/components/Amelipro/AmeliproIcon/{tests → __tests__}/__snapshots__/AmeliproIcon.spec.ts.snap +30 -3
  76. package/src/components/Amelipro/AmeliproIcon/iconList.ts +1 -0
  77. package/src/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.vue +1 -1
  78. package/src/components/Amelipro/AmeliproIconBtn/__tests__/AmeliproIconBtn.spec.ts +459 -0
  79. package/src/components/Amelipro/AmeliproIconBtn/__tests__/__snapshots__/AmeliproIconBtn.spec.ts.snap +58 -0
  80. package/src/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.stories.ts +38 -26
  81. package/src/components/Amelipro/AmeliproIllustratedDataTile/__tests__/AmeliproIllustratedDataTile.spec.ts +321 -0
  82. package/src/components/Amelipro/AmeliproIllustratedDataTile/__tests__/__snapshots__/AmeliproIllustratedDataTile.spec.ts.snap +148 -0
  83. package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.stories.ts +14 -5
  84. package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.vue +1 -1
  85. package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/AmeliproIllustratedRadioGroup.spec.ts +498 -0
  86. package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/__snapshots__/AmeliproIllustratedRadioGroup.spec.ts.snap +325 -0
  87. package/src/components/Amelipro/AmeliproMailTile/__tests__/AmeliproMailTile.spec.ts +210 -0
  88. package/src/components/Amelipro/AmeliproMailTile/__tests__/__snapshots__/AmeliproMailTile.spec.ts.snap +98 -0
  89. package/src/components/Amelipro/AmeliproMessage/__tests__/AmeliproMessage.spec.ts +446 -0
  90. package/src/components/Amelipro/AmeliproMessage/__tests__/__snapshots__/AmeliproMessage.spec.ts.snap +60 -0
  91. package/src/components/Amelipro/AmeliproMessagingLayout/__tests__/AmeliproMessagingLayout.spec.ts +300 -0
  92. package/src/components/Amelipro/AmeliproMessagingLayout/__tests__/__snapshots__/AmeliproMessagingLayout.spec.ts.snap +197 -0
  93. package/src/components/Amelipro/AmeliproNumberedCard/__tests__/AmeliproNumberedCard.spec.ts +117 -0
  94. package/src/components/Amelipro/AmeliproNumberedCard/{tests → __tests__}/__snapshots__/AmeliproNumberedCard.spec.ts.snap +47 -45
  95. package/src/components/Amelipro/AmeliproOnboarding/__tests__/AmeliproOnboarding.spec.ts +219 -0
  96. package/src/components/Amelipro/AmeliproOnboarding/__tests__/__snapshots__/AmeliproOnboarding.spec.ts.snap +41 -0
  97. package/src/components/Amelipro/AmeliproPageLayout/__tests__/AmeliproPageLayout.spec.ts +129 -0
  98. package/src/components/Amelipro/AmeliproPageLayout/__tests__/__snapshots__/AmeliproPageLayout.spec.ts.snap +189 -0
  99. package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/__tests__/AmeliproPaginationBtn.spec.ts +92 -0
  100. package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/__tests__/__snapshots__/AmeliproPaginationBtn.spec.ts.snap +56 -0
  101. package/src/components/Amelipro/AmeliproPagination/__tests__/AmeliproPagination.spec.ts +165 -0
  102. package/src/components/Amelipro/AmeliproPagination/__tests__/__snapshots__/AmeliproPagination.spec.ts.snap +83 -0
  103. package/src/components/Amelipro/AmeliproPatientBanner/__tests__/AmeliproPatientBanner.spec.ts +208 -0
  104. package/src/components/Amelipro/AmeliproPatientBanner/__tests__/__snapshots__/AmeliproPatientBanner.spec.ts.snap +285 -0
  105. package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +26 -7
  106. package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/__snapshots__/AmeliproPostalAddressCityRow.spec.ts.snap +12 -4
  107. package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.stories.ts +28 -8
  108. package/src/components/Amelipro/AmeliproRadioGroup/__tests__/AmeliproRadioGroup.spec.ts +332 -0
  109. package/src/components/Amelipro/AmeliproRadioGroup/__tests__/__snapshots__/AmeliproRadioGroup.spec.ts.snap +255 -0
  110. package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +1 -2
  111. package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +3 -1
  112. package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +2 -1
  113. package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +11 -5
  114. package/src/components/Amelipro/AmeliproSelect/__tests__/AmeliproSelect.spec.ts +481 -0
  115. package/src/components/Amelipro/AmeliproSelect/__tests__/__snapshots__/AmeliproSelect.spec.ts.snap +117 -0
  116. package/src/components/Amelipro/AmeliproStateTile/AmeliproStateTile.vue +5 -2
  117. package/src/components/Amelipro/AmeliproStateTile/__tests__/AmeliproStateTile.spec.ts +206 -0
  118. package/src/components/Amelipro/AmeliproStateTile/__tests__/__snapshots__/AmeliproStateTile.spec.ts.snap +158 -0
  119. package/src/components/Amelipro/AmeliproStatus/__tests__/AmeliproStatus.spec.ts +120 -0
  120. package/src/components/Amelipro/AmeliproStatus/__tests__/__snapshots__/AmeliproStatus.spec.ts.snap +39 -0
  121. package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/__tests__/AmeliproStepBtn.spec.ts +97 -0
  122. package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/__tests__/__snapshots__/AmeliproStepBtn.spec.ts.snap +61 -0
  123. package/src/components/Amelipro/AmeliproStepper/__tests__/AmeliproStepper.spec.ts +248 -0
  124. package/src/components/Amelipro/AmeliproStepper/__tests__/__snapshots__/AmeliproStepper.spec.ts.snap +179 -0
  125. package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +14 -13
  126. package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +2 -1
  127. package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +10 -3
  128. package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/__tests__/AmeliproTabBtn.spec.ts +129 -0
  129. package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/__tests__/__snapshots__/AmeliproTabBtn.spec.ts.snap +81 -0
  130. package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +2 -2
  131. package/src/components/Amelipro/AmeliproTabs/__tests__/AmeliproTabs.spec.ts +234 -0
  132. package/src/components/Amelipro/AmeliproTabs/__tests__/__snapshots__/AmeliproTabs.spec.ts.snap +122 -0
  133. package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.vue +7 -5
  134. package/src/components/Amelipro/AmeliproTextArea/__tests__/AmeliproTextArea.spec.ts +265 -9
  135. package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +98 -155
  136. package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +7 -5
  137. package/src/components/Amelipro/AmeliproTextField/__tests__/AmeliproTextField.spec.ts +375 -0
  138. package/src/components/Amelipro/AmeliproTextField/__tests__/__snapshots__/AmeliproTextField.spec.ts.snap +143 -0
  139. package/src/components/Amelipro/AmeliproTileBtn/__tests__/AmeliproTileBtn.spec.ts +241 -0
  140. package/src/components/Amelipro/AmeliproTileBtn/__tests__/__snapshots__/AmeliproTileBtn.spec.ts.snap +74 -0
  141. package/src/components/Amelipro/AmeliproTooltips/__tests__/AmeliproTooltips.spec.ts +212 -0
  142. package/src/components/Amelipro/AmeliproTooltips/__tests__/__snapshots__/AmeliproTooltips.spec.ts.snap +71 -0
  143. package/src/components/Amelipro/AmeliproTransmission/__tests__/AmeliproTransmission.spec.ts +155 -0
  144. package/src/components/Amelipro/AmeliproTransmission/__tests__/__snapshots__/AmeliproTransmission.spec.ts.snap +240 -0
  145. package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.stories.ts +0 -1
  146. package/src/components/Amelipro/ServiceMenu/tests/__snapshots__/ServiceMenu.spec.ts.snap +4 -1
  147. package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +4 -0
  148. package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +4 -5
  149. package/src/components/Amelipro/StructureMenu/StructureTabs/tests/__snapshots__/StructureTabs.spec.ts.snap +5 -4
  150. package/src/components/Amelipro/StructureMenu/tests/__snapshots__/StructureMenu.spec.ts.snap +13 -6
  151. package/src/components/Amelipro/UserMenu/UserMenu.vue +2 -1
  152. package/src/components/Amelipro/UserMenu/tests/__snapshots__/UserMenu.spec.ts.snap +4 -1
  153. package/src/components/Captcha/Captcha.mdx +4 -4
  154. package/src/components/Captcha/Captcha.stories.ts +8 -1
  155. package/src/components/Captcha/Captcha.vue +3 -0
  156. package/src/components/Captcha/CaptchaBase.vue +3 -0
  157. package/src/components/Captcha/captchaApi.ts +0 -1
  158. package/src/components/Customs/Selects/SySelect/SySelect.vue +2 -2
  159. package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +5 -0
  160. package/src/components/Customs/SyCheckbox/SyCheckbox.vue +1 -1
  161. package/src/components/Customs/SyTabs/SyTabs.stories.ts +174 -10
  162. package/src/components/Customs/SyTabs/SyTabs.vue +62 -0
  163. package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +98 -0
  164. package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +13 -13
  165. package/src/components/DatePicker/CalendarMode/DatePicker.vue +13 -0
  166. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +11 -11
  167. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +5 -0
  168. package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.mdx +7 -0
  169. package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +1 -1
  170. package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +3 -3
  171. package/src/components/DatePicker/DateTextInput/DateTextInput.vue +50 -2
  172. package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +15 -15
  173. package/src/components/DatePicker/composables/tests/useDateFormatValidation.spec.ts +2 -2
  174. package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +1 -1
  175. package/src/components/DatePicker/composables/useDateFormatDisplay.ts +25 -0
  176. package/src/components/DatePicker/composables/useDateFormatValidation.ts +5 -2
  177. package/src/components/DatePicker/composables/useManualDateValidation.ts +5 -1
  178. package/src/components/DatePicker/tests/DatePicker.validation.spec.ts +1 -1
  179. package/src/components/ErrorPage/ErrorPage.vue +54 -7
  180. package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +6 -2
  181. package/src/components/ExternalLinks/ExternalLinks.vue +2 -4
  182. package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +6 -2
  183. package/src/components/PasswordField/PasswordField.vue +6 -6
  184. package/src/components/RangeField/RangeSlider/RangeSlider.vue +3 -2
  185. package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +2 -1
  186. package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +2 -0
  187. package/src/components/RatingPicker/RatingPicker.stories.ts +10 -0
  188. package/src/components/RatingPicker/RatingPicker.vue +23 -1
  189. package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +2 -0
  190. package/src/components/SearchListField/Accessibilite.stories.ts +4 -0
  191. package/src/components/SearchListField/SearchListField.stories.ts +16 -0
  192. package/src/components/SearchListField/SearchListField.vue +121 -109
  193. package/src/components/SearchListField/locales.ts +11 -2
  194. package/src/components/SearchListField/tests/SearchListField.spec.ts +91 -25
  195. package/src/components/SyAlert/SyAlert.vue +8 -0
  196. package/src/components/SyAlert/tests/SyAlert.spec.ts +1 -22
  197. package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +304 -0
  198. package/src/components/Tables/SyServerTable/SyServerTable.vue +12 -4
  199. package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
  200. package/src/components/Tables/SyTable/SyTable.stories.ts +186 -0
  201. package/src/components/Tables/SyTable/SyTable.vue +12 -4
  202. package/src/components/Tables/SyTable/tests/SyTable.spec.ts +65 -1
  203. package/src/components/Tables/common/types.ts +2 -0
  204. package/src/composables/rules/useFieldValidation.ts +47 -7
  205. package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/tests/AmeliproLogoAm.spec.ts +0 -15
  206. package/src/components/Amelipro/AmeliproIcon/tests/AmeliproIcon.spec.ts +0 -19
  207. package/src/components/Amelipro/AmeliproIconBtn/tests/AmeliproIconBtn.spec.ts +0 -22
  208. package/src/components/Amelipro/AmeliproIconBtn/tests/__snapshots__/AmeliproIconBtn.spec.ts.snap +0 -87
  209. package/src/components/Amelipro/AmeliproIllustratedDataTile/tests/AmeliproIllustratedDataTile.spec.ts +0 -20
  210. package/src/components/Amelipro/AmeliproIllustratedDataTile/tests/__snapshots__/AmeliproIllustratedDataTile.spec.ts.snap +0 -69
  211. package/src/components/Amelipro/AmeliproIllustratedRadioGroup/tests/AmeliproIllustratedRadioGroup.spec.ts +0 -53
  212. package/src/components/Amelipro/AmeliproIllustratedRadioGroup/tests/__snapshots__/AmeliproIllustratedRadioGroup.spec.ts.snap +0 -544
  213. package/src/components/Amelipro/AmeliproMailTile/tests/AmeliproMailTile.spec.ts +0 -25
  214. package/src/components/Amelipro/AmeliproMailTile/tests/__snapshots__/AmeliproMailTile.spec.ts.snap +0 -164
  215. package/src/components/Amelipro/AmeliproMessage/tests/AmeliproMessage.spec.ts +0 -18
  216. package/src/components/Amelipro/AmeliproMessage/tests/__snapshots__/AmeliproMessage.spec.ts.snap +0 -94
  217. package/src/components/Amelipro/AmeliproMessagingLayout/tests/AmeliproMessagingLayout.spec.ts +0 -30
  218. package/src/components/Amelipro/AmeliproMessagingLayout/tests/__snapshots__/AmeliproMessagingLayout.spec.ts.snap +0 -439
  219. package/src/components/Amelipro/AmeliproNumberedCard/tests/AmeliproNumberedCard.spec.ts +0 -23
  220. package/src/components/Amelipro/AmeliproOnboarding/tests/AmeliproOnboarding.spec.ts +0 -41
  221. package/src/components/Amelipro/AmeliproOnboarding/tests/__snapshots__/AmeliproOnboarding.spec.ts.snap +0 -3
  222. package/src/components/Amelipro/AmeliproPageLayout/tests/AmeliproPageLayout.spec.ts +0 -183
  223. package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +0 -1602
  224. package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/tests/AmeliproPaginationBtn.spec.ts +0 -15
  225. package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/tests/__snapshots__/AmeliproPaginationBtn.spec.ts.snap +0 -46
  226. package/src/components/Amelipro/AmeliproPagination/tests/AmeliproPagination.spec.ts +0 -15
  227. package/src/components/Amelipro/AmeliproPagination/tests/__snapshots__/AmeliproPagination.spec.ts.snap +0 -116
  228. package/src/components/Amelipro/AmeliproPatientBanner/tests/AmeliproPatientBanner.spec.ts +0 -24
  229. package/src/components/Amelipro/AmeliproPatientBanner/tests/__snapshots__/AmeliproPatientBanner.spec.ts.snap +0 -268
  230. package/src/components/Amelipro/AmeliproRadioGroup/tests/AmeliproRadioGroup.spec.ts +0 -43
  231. package/src/components/Amelipro/AmeliproRadioGroup/tests/__snapshots__/AmeliproRadioGroup.spec.ts.snap +0 -262
  232. package/src/components/Amelipro/AmeliproSelect/tests/AmeliproSelect.spec.ts +0 -38
  233. package/src/components/Amelipro/AmeliproSelect/tests/__snapshots__/AmeliproSelect.spec.ts.snap +0 -196
  234. package/src/components/Amelipro/AmeliproStateTile/tests/AmeliproStateTile.spec.ts +0 -20
  235. package/src/components/Amelipro/AmeliproStateTile/tests/__snapshots__/AmeliproStateTile.spec.ts.snap +0 -90
  236. package/src/components/Amelipro/AmeliproStatus/tests/AmeliproStatus.spec.ts +0 -16
  237. package/src/components/Amelipro/AmeliproStatus/tests/__snapshots__/AmeliproStatus.spec.ts.snap +0 -21
  238. package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/tests/AmeliproStepBtn.spec.ts +0 -18
  239. package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/tests/__snapshots__/AmeliproStepBtn.spec.ts.snap +0 -34
  240. package/src/components/Amelipro/AmeliproStepper/tests/AmeliproStepper.spec.ts +0 -36
  241. package/src/components/Amelipro/AmeliproStepper/tests/__snapshots__/AmeliproStepper.spec.ts.snap +0 -354
  242. package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/tests/AmeliproTabBtn.spec.ts +0 -20
  243. package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/tests/__snapshots__/AmeliproTabBtn.spec.ts.snap +0 -34
  244. package/src/components/Amelipro/AmeliproTabs/tests/AmeliproTabs.spec.ts +0 -39
  245. package/src/components/Amelipro/AmeliproTabs/tests/__snapshots__/AmeliproTabs.spec.ts.snap +0 -217
  246. package/src/components/Amelipro/AmeliproTextField/tests/AmeliproTextField.spec.ts +0 -16
  247. package/src/components/Amelipro/AmeliproTextField/tests/__snapshots__/AmeliproTextField.spec.ts.snap +0 -162
  248. package/src/components/Amelipro/AmeliproTileBtn/tests/AmeliproTileBtn.spec.ts +0 -17
  249. package/src/components/Amelipro/AmeliproTileBtn/tests/__snapshots__/AmeliproTileBtn.spec.ts.snap +0 -65
  250. package/src/components/Amelipro/AmeliproTooltips/tests/AmeliproTooltips.spec.ts +0 -16
  251. package/src/components/Amelipro/AmeliproTooltips/tests/__snapshots__/AmeliproTooltips.spec.ts.snap +0 -105
  252. package/src/components/Amelipro/AmeliproTransmission/tests/AmeliproTransmission.spec.ts +0 -16
  253. package/src/components/Amelipro/AmeliproTransmission/tests/__snapshots__/AmeliproTransmission.spec.ts.snap +0 -246
  254. package/src/components/SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap +0 -99
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { type PropType, computed, onMounted, onUpdated, ref, watch } from 'vue'
2
+ import { computed, onMounted, onUpdated, type PropType, ref, watch } from 'vue'
3
3
  import AmeliproPagination from '../AmeliproPagination/AmeliproPagination.vue'
4
4
  import AmeliproSelect from '../AmeliproSelect/AmeliproSelect.vue'
5
5
  import type { IDataListItem } from '../types'
@@ -139,6 +139,8 @@
139
139
  currentPage.value = 1
140
140
  }
141
141
  }
142
+
143
+ watch(sortSelectModel, emitSortSelectChange, { immediate: true })
142
144
  </script>
143
145
 
144
146
  <template>
@@ -56,8 +56,9 @@ exports[`AmeliproResultList > render correctly 1`] = `
56
56
  w-100
57
57
  ">
58
58
  <div class="
59
- align-start
59
+ align-baseline
60
60
  d-inline-flex
61
+ mb-1
61
62
  ">
62
63
  <label
63
64
  class="
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- /* eslint-disable vuejs-accessibility/label-has-for */
2
+ /* eslint-disable vuejs-accessibility/label-has-for */
3
3
  import type { IndexedObject, ValidateOnType } from '../types'
4
4
  import type { InputSelect, SelectItem } from './types'
5
- import { type PropType, computed, onMounted, onUnmounted, ref } from 'vue'
5
+ import { computed, onMounted, onUnmounted, type PropType, ref } from 'vue'
6
6
  import AmeliproMessage from '../AmeliproMessage/AmeliproMessage.vue'
7
7
  import type { ValidationRule } from '@/utils/rules/types'
8
8
  import { convertToHex } from '@/utils/functions/convertToHex'
@@ -243,7 +243,7 @@
243
243
  :class="selectClasses"
244
244
  >
245
245
  <div
246
- class="d-inline-flex align-start"
246
+ class="d-inline-flex align-baseline mb-1"
247
247
  :class="labelClasses"
248
248
  >
249
249
  <label
@@ -265,7 +265,10 @@
265
265
  </span>
266
266
  </label>
267
267
 
268
- <slot name="labelInfo" />
268
+ <slot
269
+ class="mb-1"
270
+ name="labelInfo"
271
+ />
269
272
  </div>
270
273
 
271
274
  <VSelect
@@ -345,6 +348,10 @@
345
348
  --v-field-border-opacity: 1 !important;
346
349
  }
347
350
 
351
+ & :deep(.v-field__input > input) {
352
+ align-self: unset;
353
+ }
354
+
348
355
  & :deep(.v-field.v-field--variant-outlined.v-field--focused .v-field__outline) {
349
356
  --v-field-border-width: 1px !important;
350
357
  }
@@ -360,7 +367,6 @@
360
367
  }
361
368
 
362
369
  .amelipro-select__label {
363
- margin-bottom: 4px;
364
370
  font-size: apTokens.$font-size-xs;
365
371
  font-weight: apTokens.$label-font-weight;
366
372
  }
@@ -0,0 +1,481 @@
1
+ import { VueWrapper, config, mount, shallowMount } from '@vue/test-utils'
2
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
3
+ import AmeliproSelect from '../AmeliproSelect.vue'
4
+ import type { ComponentProps } from 'vue-component-type-helpers'
5
+ import type { ExpectedPropOptions } from '@tests/types'
6
+ import { defineComponent, type PropType } from 'vue'
7
+ import type { SelectItem } from '../types'
8
+ import TestHelper from '@tests/helpers/TestHelper'
9
+ import type { ValidateOnType } from '../../types'
10
+ import type { ValidationRule } from '@/utils/rules/types'
11
+ import { isRequired } from '@/utils/rules/isRequired'
12
+
13
+ vi.mock('@/utils/rules/isRequired', () => ({ isRequired: 'mocked-is-required' }))
14
+
15
+ const VSelectStub = defineComponent({
16
+ name: 'VSelect',
17
+ props: {
18
+ modelValue: {
19
+ type: [String, Number, Object],
20
+ default: undefined,
21
+ },
22
+ items: {
23
+ type: Array,
24
+ default: () => [],
25
+ },
26
+ placeholder: {
27
+ type: String,
28
+ default: undefined,
29
+ },
30
+ readonly: {
31
+ type: Boolean,
32
+ default: false,
33
+ },
34
+ disabled: {
35
+ type: Boolean,
36
+ default: false,
37
+ },
38
+ clearable: {
39
+ type: Boolean,
40
+ default: false,
41
+ },
42
+ prefix: {
43
+ type: [String, Number],
44
+ default: undefined,
45
+ },
46
+ id: {
47
+ type: String,
48
+ default: undefined,
49
+ },
50
+ ariaRequired: {
51
+ type: [Boolean, String],
52
+ default: false,
53
+ },
54
+ ariaInvalid: {
55
+ type: [Boolean, String],
56
+ default: false,
57
+ },
58
+ ariaDescribedby: {
59
+ type: String,
60
+ default: undefined,
61
+ },
62
+ hideDetails: {
63
+ type: [Boolean, String],
64
+ default: false,
65
+ },
66
+ style: {
67
+ type: [String, Object],
68
+ default: undefined,
69
+ },
70
+ rules: {
71
+ type: Array,
72
+ default: () => [],
73
+ },
74
+ validateOn: {
75
+ type: String,
76
+ default: undefined,
77
+ },
78
+ },
79
+ emits: ['update:modelValue', 'focus', 'blur'],
80
+ template: `
81
+ <div
82
+ class="v-select-stub"
83
+ :aria-required="ariaRequired"
84
+ :style="style"
85
+ >
86
+ <slot />
87
+ <slot name="append" />
88
+ </div>
89
+ `,
90
+ })
91
+
92
+ config.global.stubs = config.global.stubs || {}
93
+ config.global.stubs.VSelect = VSelectStub
94
+
95
+ const expectedPropOptions: ExpectedPropOptions<typeof AmeliproSelect> = {
96
+ ariaRequired: {
97
+ type: Boolean,
98
+ default: false,
99
+ },
100
+ classes: {
101
+ type: String,
102
+ default: undefined,
103
+ },
104
+ clearable: {
105
+ type: Boolean,
106
+ default: false,
107
+ },
108
+ disabled: {
109
+ type: Boolean,
110
+ default: false,
111
+ },
112
+ fullWidthErrorMsg: {
113
+ type: Boolean,
114
+ default: false,
115
+ },
116
+ globalMaxWidth: {
117
+ type: String,
118
+ default: undefined,
119
+ },
120
+ globalMinWidth: {
121
+ type: String,
122
+ default: undefined,
123
+ },
124
+ globalWidth: {
125
+ type: String,
126
+ default: undefined,
127
+ },
128
+ hideErrorMessage: {
129
+ type: Boolean,
130
+ default: false,
131
+ },
132
+ horizontal: {
133
+ type: Boolean,
134
+ default: false,
135
+ },
136
+ inputMaxWidth: {
137
+ type: String,
138
+ default: undefined,
139
+ },
140
+ inputMinWidth: {
141
+ type: String,
142
+ default: undefined,
143
+ },
144
+ items: {
145
+ type: Array as PropType<string[] | SelectItem[]>,
146
+ required: true,
147
+ },
148
+ label: {
149
+ type: String,
150
+ required: true,
151
+ },
152
+ labelMaxWidth: {
153
+ type: String,
154
+ default: undefined,
155
+ },
156
+ labelMinWidth: {
157
+ type: String,
158
+ default: undefined,
159
+ },
160
+ modelValue: {
161
+ type: [Object, Number, String] as PropType<SelectItem | number | string>,
162
+ default: undefined,
163
+ },
164
+ placeholder: {
165
+ type: String,
166
+ default: undefined,
167
+ },
168
+ readonly: {
169
+ type: Boolean,
170
+ default: false,
171
+ },
172
+ rules: {
173
+ type: Array as PropType<ValidationRule[]>,
174
+ default: () => [],
175
+ },
176
+ uniqueId: {
177
+ type: String,
178
+ required: true,
179
+ },
180
+ validateOn: {
181
+ default: 'input',
182
+ type: String as PropType<ValidateOnType>,
183
+ validator(value: string): boolean {
184
+ return ['lazy', 'blur', 'input', 'submit', 'blur lazy', 'input lazy', 'submit lazy', 'lazy blur', 'lazy input', 'lazy submit'].includes(value.toLowerCase())
185
+ },
186
+ },
187
+ }
188
+
189
+ // Values pour les props "required"
190
+ const requiredPropValues = (): ComponentProps<typeof AmeliproSelect> => ({
191
+ items: [],
192
+ label: 'Required label',
193
+ uniqueId: 'required-unique-id',
194
+ })
195
+
196
+ // Valeurs pour les props "modified"
197
+ const modifiedPropValues = (): ComponentProps<typeof AmeliproSelect> => ({
198
+ ariaRequired: true,
199
+ classes: 'modified-classes',
200
+ clearable: true,
201
+ disabled: true,
202
+ fullWidthErrorMsg: true,
203
+ globalMaxWidth: 'modified-global-max-width',
204
+ globalMinWidth: 'modified-global-min-width',
205
+ globalWidth: 'modified-global-width',
206
+ hideErrorMessage: true,
207
+ horizontal: true,
208
+ inputMaxWidth: 'modified-input-max-width',
209
+ inputMinWidth: 'modified-input-min-width',
210
+ items: [
211
+ {
212
+ disabled: true,
213
+ title: 'Modified item title 1',
214
+ value: 'modified-item-value-1',
215
+ },
216
+ {
217
+ title: 'Modified item title 2',
218
+ value: 'modified-item-value-2',
219
+ },
220
+ {
221
+ title: 'Modified item title 3',
222
+ value: 'modified-item-value-3',
223
+ },
224
+ ] as SelectItem[],
225
+ label: 'Modified label',
226
+ labelMaxWidth: 'modified-label-max-width',
227
+ labelMinWidth: 'modified-label-min-width',
228
+ modelValue: 'modified-value',
229
+ placeholder: 'Modified placeholder',
230
+ readonly: true,
231
+ rules: [() => 'modified-rule'],
232
+ uniqueId: 'modified-unique-id',
233
+ })
234
+
235
+ const testHelper = new TestHelper(AmeliproSelect)
236
+ testHelper.setExpectedPropOptions(expectedPropOptions)
237
+ .setRequiredPropValues(requiredPropValues)
238
+ .setModifiedPropValues(modifiedPropValues)
239
+
240
+ describe('AmeliproSelect', () => {
241
+ let vueWrapper: VueWrapper<InstanceType<typeof AmeliproSelect>>
242
+ const selectWrapper = () => vueWrapper.findComponent(VSelectStub)
243
+
244
+ describe('Snapshots', () => {
245
+ testHelper.snapshots()
246
+ })
247
+
248
+ describe('Properties', () => {
249
+ testHelper.properties()
250
+ })
251
+
252
+ describe('Slots', () => {
253
+ describe('label info', () => {
254
+ it('renders correctly', () => {
255
+ vueWrapper = shallowMount(AmeliproSelect, {
256
+ props: modifiedPropValues(),
257
+ slots: { labelInfo: '<div class="custom-label-info">Custom label info</div>' },
258
+ global: {
259
+ stubs: { VSelect: VSelectStub },
260
+ },
261
+ })
262
+ expect(vueWrapper.find('.custom-label-info').text()).toEqual('Custom label info')
263
+ })
264
+ })
265
+
266
+ describe('append', () => {
267
+ it('renders correctly', () => {
268
+ vueWrapper = mount(AmeliproSelect, {
269
+ props: modifiedPropValues(),
270
+ slots: { append: '<div class="append">Append outer</div>' },
271
+ global: {
272
+ stubs: { VSelect: VSelectStub },
273
+ },
274
+ })
275
+ expect(vueWrapper.find('.append').text()).toEqual('Append outer')
276
+ })
277
+ })
278
+ })
279
+
280
+ describe('Setting props should update attributes of inner tags', () => {
281
+ beforeEach(() => {
282
+ vueWrapper = shallowMount(AmeliproSelect, { props: requiredPropValues() })
283
+ })
284
+
285
+ describe('main div', () => {
286
+ it('prop ariaRequired sets display of span', async () => {
287
+ expect(vueWrapper.findAll('.amelipro-select__label span').length).toBe(0)
288
+
289
+ const { ariaRequired } = modifiedPropValues()
290
+ await vueWrapper.setProps({ ariaRequired })
291
+ expect(vueWrapper.findAll('.amelipro-select__label span').length).toBe(3)
292
+ })
293
+
294
+ it('prop horizontal sets attribute class', async () => {
295
+ expect(vueWrapper.find('.amelipro-select__wrapper').attributes('class')).toBe('w-100 amelipro-select__wrapper d-flex flex-column')
296
+
297
+ const { horizontal } = modifiedPropValues()
298
+ await vueWrapper.setProps({ horizontal })
299
+ expect(vueWrapper.find('.amelipro-select__wrapper').attributes('class')).toBe('w-100 amelipro-select__wrapper d-flex flex-column flex-md-row')
300
+ })
301
+
302
+ it('props globalMaxWidth, globalMinWidth & globalWidth set attribute style', async () => {
303
+ if (vueWrapper.attributes('style')) {
304
+ expect(vueWrapper.attributes('style')).not.toContain('max-width:')
305
+ expect(vueWrapper.attributes('style')).not.toContain('min-width:')
306
+ }
307
+
308
+ const { globalMaxWidth, globalMinWidth, globalWidth } = modifiedPropValues()
309
+ await vueWrapper.setProps({ globalMaxWidth, globalMinWidth, globalWidth })
310
+ expect(vueWrapper.attributes('style')).toContain('margin-bottom: 12px; max-width: modified-global-max-width; min-width: modified-global-min-width;')
311
+ })
312
+ })
313
+
314
+ describe('label wrapper', () => {
315
+ it('prop horizontal sets attribute class', async () => {
316
+ expect(vueWrapper.find('.amelipro-select__wrapper > div').classes()).not.toContain('mt-md-2')
317
+ expect(vueWrapper.find('.amelipro-select__wrapper > div').classes()).not.toContain('mr-md-2')
318
+
319
+ const { horizontal } = modifiedPropValues()
320
+ await vueWrapper.setProps({ horizontal })
321
+ expect(vueWrapper.find('.amelipro-select__wrapper > div').classes()).toContain('mt-md-2')
322
+ expect(vueWrapper.find('.amelipro-select__wrapper > div').classes()).toContain('mr-md-2')
323
+ })
324
+ })
325
+
326
+ describe('label', () => {
327
+ it('prop uniqueId sets attributes id & for', async () => {
328
+ expect(vueWrapper.find('.amelipro-select__label').attributes('id')).toBe('required-unique-id-label')
329
+ expect(vueWrapper.find('.amelipro-select__label').attributes('for')).toBe('required-unique-id')
330
+
331
+ await vueWrapper.setProps({ uniqueId: 'new-id' })
332
+ expect(vueWrapper.find('.amelipro-select__label').attributes('id')).toBe('new-id-label')
333
+ expect(vueWrapper.find('.amelipro-select__label').attributes('for')).toBe('new-id')
334
+ })
335
+ it('props labelMinWidth & labelMaxWidth set attribute style', async () => {
336
+ expect(vueWrapper.find('.amelipro-select__label').attributes('style')).toBeUndefined()
337
+
338
+ const { labelMinWidth, labelMaxWidth } = modifiedPropValues()
339
+ await vueWrapper.setProps({ labelMinWidth, labelMaxWidth })
340
+ expect(vueWrapper.find('.amelipro-select__label').attributes('style')).toBe('max-width: modified-label-max-width; min-width: modified-label-min-width;')
341
+ })
342
+ })
343
+ })
344
+
345
+ describe('Setting props should update props or attributes of inner components', () => {
346
+ describe('VSelect', () => {
347
+ beforeEach(() => {
348
+ vueWrapper = shallowMount(AmeliproSelect, {
349
+ props: requiredPropValues(),
350
+ global: {
351
+ stubs: { VSelect: VSelectStub },
352
+ },
353
+ })
354
+ })
355
+
356
+ it('prop uniqueId sets prop uniqueId', async () => {
357
+ expect(vueWrapper.findComponent(VSelectStub).props('id')).toBe(testHelper.default('uniqueId'))
358
+ await vueWrapper.setProps({ uniqueId: testHelper.modified('uniqueId') })
359
+ expect(vueWrapper.findComponent(VSelectStub).props('id')).toBe(testHelper.modified('uniqueId'))
360
+ })
361
+
362
+ it('prop clearable sets prop clearable', async () => {
363
+ expect(vueWrapper.findComponent(VSelectStub).props('clearable')).toBe(testHelper.default('clearable'))
364
+ await vueWrapper.setProps({ clearable: testHelper.modified('clearable') })
365
+ expect(vueWrapper.findComponent(VSelectStub).props('clearable')).toBe(testHelper.modified('clearable'))
366
+ })
367
+
368
+ it('prop disabled sets prop disabled', async () => {
369
+ expect(vueWrapper.findComponent(VSelectStub).props('disabled')).toBe(testHelper.default('disabled'))
370
+ await vueWrapper.setProps({ disabled: testHelper.modified('disabled') })
371
+ expect(vueWrapper.findComponent(VSelectStub).props('disabled')).toBe(testHelper.modified('disabled'))
372
+ })
373
+
374
+ it('prop hideErrorMessage sets prop hideDetails', async () => {
375
+ expect(vueWrapper.findComponent(VSelectStub).props('hideDetails')).toBe(testHelper.default('hideErrorMessage'))
376
+ await vueWrapper.setProps({ hideErrorMessage: testHelper.modified('hideErrorMessage') })
377
+ expect(vueWrapper.findComponent(VSelectStub).props('hideDetails')).toBe(testHelper.modified('hideErrorMessage'))
378
+ })
379
+
380
+ it('prop items sets prop items', async () => {
381
+ expect(vueWrapper.findComponent(VSelectStub).props('items')).toEqual(testHelper.default('items'))
382
+ await vueWrapper.setProps({ items: testHelper.modified('items') })
383
+ expect(vueWrapper.findComponent(VSelectStub).props('items')).toEqual(testHelper.modified('items'))
384
+ })
385
+
386
+ it('prop placeholder sets prop placeholder', async () => {
387
+ expect(vueWrapper.findComponent(VSelectStub).props('placeholder')).toBe(testHelper.default('placeholder'))
388
+ await vueWrapper.setProps({ placeholder: testHelper.modified('placeholder') })
389
+ expect(vueWrapper.findComponent(VSelectStub).props('placeholder')).toBe(testHelper.modified('placeholder'))
390
+ })
391
+
392
+ it('prop readonly sets prop readonly', async () => {
393
+ expect(vueWrapper.findComponent(VSelectStub).props('readonly')).toBe(testHelper.default('readonly'))
394
+ await vueWrapper.setProps({ readonly: testHelper.modified('readonly') })
395
+ expect(vueWrapper.findComponent(VSelectStub).props('readonly')).toBe(testHelper.modified('readonly'))
396
+ })
397
+
398
+ it('prop ariaRequired sets attribute aria-required', async () => {
399
+ expect(vueWrapper.findComponent(VSelectStub).attributes('aria-required')).toBe('false')
400
+ await vueWrapper.setProps({ ariaRequired: testHelper.modified('ariaRequired') })
401
+ expect(vueWrapper.findComponent(VSelectStub).attributes('aria-required')).toBe('true')
402
+ })
403
+
404
+ it('props inputMinWidth & inputMaxWidth set attribute style', async () => {
405
+ expect(vueWrapper.findComponent(VSelectStub).attributes('style')).toBeUndefined()
406
+ await vueWrapper.setProps({
407
+ inputMinWidth: testHelper.modified('inputMinWidth'),
408
+ inputMaxWidth: testHelper.modified('inputMaxWidth'),
409
+ })
410
+ expect(vueWrapper.findComponent(VSelectStub).attributes('style')).toBe(`max-width: ${testHelper.modified('inputMaxWidth')}; min-width: ${testHelper.modified('inputMinWidth')};`)
411
+ })
412
+
413
+ it('props ariaRequired & rules set prop rules', async () => {
414
+ expect(vueWrapper.findComponent(VSelectStub).props('rules')).toEqual([])
415
+ await vueWrapper.setProps({ ariaRequired: testHelper.modified('ariaRequired') })
416
+ expect(vueWrapper.findComponent(VSelectStub).props('rules')).toEqual(['mocked-is-required'])
417
+ })
418
+ })
419
+ })
420
+
421
+ describe('should react to child component events', () => {
422
+ beforeEach(() => {
423
+ vueWrapper = mount(AmeliproSelect, { props: modifiedPropValues() })
424
+ })
425
+
426
+ describe('VSelect', () => {
427
+ it.skip('should react to blur/focus event', async () => {
428
+ // focused est inutilisé
429
+ expect(vueWrapper.attributes('???')).toBe('???')
430
+ await selectWrapper().vm.$emit('focus')
431
+ expect(vueWrapper.attributes('???')).toBe('???')
432
+ await selectWrapper().vm.$emit('blur')
433
+ expect(vueWrapper.attributes('???')).toBe('???')
434
+ })
435
+ })
436
+ })
437
+
438
+ describe.skip('Getters', () => {
439
+ it('displays error message when input is invalid', async () => {
440
+ const uniqueId = 'test-id'
441
+ vueWrapper = mount(AmeliproSelect, {
442
+ props: {
443
+ items: [{ title: 'option 1', value: 'Option1' }],
444
+ label: 'Mon Label',
445
+ rules: [isRequired],
446
+ uniqueId,
447
+ },
448
+ })
449
+ await vueWrapper.vm.$nextTick()
450
+ const errorId = `${vueWrapper.props().uniqueId}-error`
451
+ expect(errorId).toBe(`${uniqueId}-error`)
452
+ })
453
+ it('computes bgColor correctly based on props', () => {
454
+ vueWrapper = mount(AmeliproSelect, {
455
+ props: {
456
+ ariaRequired: true,
457
+ bgWhite: true,
458
+ disabled: true,
459
+ items: [{ title: 'option 1', value: 'Option1' }],
460
+ label: 'My Label',
461
+ readonly: false,
462
+ uniqueId: 'exampleId',
463
+ },
464
+ })
465
+ expect((vueWrapper.vm as unknown as { bgColor: string }).bgColor).toStrictEqual('#EEEEEE')
466
+ })
467
+
468
+ it('renders slot content correctly', () => {
469
+ vueWrapper = mount(AmeliproSelect, {
470
+ propsData: {
471
+ items: [{ title: 'option 1', value: 'Option1' }],
472
+ label: 'Mon Label',
473
+ uniqueId: 'modified-unique-id',
474
+ },
475
+ slots: { labelInfo: '<div class="custom-label-info">Custom Label Info</div>' },
476
+ })
477
+ const labelInfoNameSelector = vueWrapper.find('.custom-label-info')
478
+ expect(labelInfoNameSelector.text()).toEqual('Custom Label Info')
479
+ })
480
+ })
481
+ })
@@ -0,0 +1,117 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`AmeliproSelect > Snapshots > renders the component with all properties filled in 1`] = `
4
+ <div
5
+ class="modified-classes"
6
+ id="modified-unique-id-container"
7
+ style="
8
+ margin-bottom: 12px;
9
+ max-width: modified-global-max-width;
10
+ min-width: modified-global-min-width;
11
+ "
12
+ >
13
+ <div class="
14
+ amelipro-select__wrapper
15
+ d-flex
16
+ flex-column
17
+ flex-md-row
18
+ w-100
19
+ ">
20
+ <div class="
21
+ align-baseline
22
+ d-inline-flex
23
+ mb-1
24
+ mr-md-2
25
+ mt-md-2
26
+ ">
27
+ <label
28
+ class="
29
+ amelipro-select__label
30
+ mr-2
31
+ "
32
+ for="modified-unique-id"
33
+ id="modified-unique-id-label"
34
+ style="
35
+ max-width: modified-label-max-width;
36
+ min-width: modified-label-min-width;
37
+ "
38
+ >
39
+ Modified label
40
+ <span>
41
+ <span aria-hidden="true">
42
+ &nbsp;*
43
+ </span>
44
+ <span class="d-sr-only">
45
+ &nbsp;Champ obligatoire
46
+ </span>
47
+ </span>
48
+ </label>
49
+ </div>
50
+ <div
51
+ aria-required="true"
52
+ bg-color="ap-grey-lighten-2"
53
+ class="
54
+ amelipro-select
55
+ pt-0
56
+ v-select-stub
57
+ "
58
+ color="ap-blue-darken-1"
59
+ density="compact"
60
+ item-props="true"
61
+ style="
62
+ max-width: modified-input-max-width;
63
+ min-width: modified-input-min-width;
64
+ "
65
+ variant="outlined"
66
+ ></div>
67
+ </div>
68
+ <!-- v-if -->
69
+ </div>
70
+ `;
71
+
72
+ exports[`AmeliproSelect > Snapshots > renders the component with only required properties filled in 1`] = `
73
+ <div
74
+ class=""
75
+ id="required-unique-id-container"
76
+ style="margin-bottom: 12px;"
77
+ >
78
+ <div class="
79
+ amelipro-select__wrapper
80
+ d-flex
81
+ flex-column
82
+ w-100
83
+ ">
84
+ <div class="
85
+ align-baseline
86
+ d-inline-flex
87
+ mb-1
88
+ ">
89
+ <label
90
+ class="
91
+ amelipro-select__label
92
+ mr-2
93
+ "
94
+ for="required-unique-id"
95
+ id="required-unique-id-label"
96
+ >
97
+ Required label
98
+ <!-- v-if -->
99
+ </label>
100
+ </div>
101
+ <div
102
+ aria-required="false"
103
+ bg-color="ap-white"
104
+ class="
105
+ amelipro-select
106
+ pt-0
107
+ v-select-stub
108
+ "
109
+ color="ap-blue-darken-1"
110
+ density="compact"
111
+ item-props="true"
112
+ variant="outlined"
113
+ ></div>
114
+ </div>
115
+ <!-- v-if -->
116
+ </div>
117
+ `;
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { type PropType, computed } from 'vue'
2
+ import { computed, type PropType } from 'vue'
3
3
  import AmeliproIcon from '../AmeliproIcon/AmeliproIcon.vue'
4
4
  import { AmeliproStateTileTypes } from './AmeliproStateTileTypes'
5
5
  import type { IndexedObject } from '../types'
@@ -305,7 +305,10 @@
305
305
  display: flex;
306
306
  flex-direction: column;
307
307
  background-color: apTokens.$ap-white;
308
- white-space: normal;
308
+
309
+ & span {
310
+ white-space: normal;
311
+ }
309
312
 
310
313
  &:hover {
311
314
  & .amelipro-state-tile__pdf-download {