@cnamts/synapse 0.0.11-alpha → 0.0.13-alpha

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 (315) hide show
  1. package/dist/design-system-v3.js +5394 -3813
  2. package/dist/design-system-v3.umd.cjs +1 -1
  3. package/dist/src/components/Amelipro/types/types.d.ts +38 -0
  4. package/dist/src/components/CookieBanner/CookieBanner.d.ts +1 -1
  5. package/dist/src/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -0
  6. package/dist/src/components/Customs/SyTextField/SyTextField.d.ts +31 -23
  7. package/dist/src/components/Customs/SyTextField/types.d.ts +1 -0
  8. package/dist/src/components/DatePicker/DatePicker.d.ts +105 -102
  9. package/dist/src/components/DatePicker/DateTextInput.d.ts +82 -74
  10. package/dist/src/components/ErrorPage/ErrorPage.d.ts +1 -1
  11. package/dist/src/components/FileList/FileList.d.ts +1 -0
  12. package/dist/src/components/FileList/UploadItem/UploadItem.d.ts +1 -1
  13. package/dist/src/components/FilterInline/AccessibiliteItems.d.ts +30 -0
  14. package/dist/src/components/FilterInline/constants/ExpertiseLevelEnum.d.ts +4 -0
  15. package/dist/src/components/FilterSideBar/AccessibiliteItems.d.ts +29 -0
  16. package/dist/src/components/FilterSideBar/FilterSideBar.d.ts +31 -0
  17. package/dist/src/components/FilterSideBar/constants/ExpertiseLevelEnum.d.ts +4 -0
  18. package/dist/src/components/FilterSideBar/locales.d.ts +7 -0
  19. package/dist/src/components/LangBtn/LangBtn.d.ts +2 -2
  20. package/dist/src/components/NirField/NirField.d.ts +952 -0
  21. package/dist/src/components/NotificationBar/NotificationBar.d.ts +6 -6
  22. package/dist/src/components/PasswordField/PasswordField.d.ts +42 -8
  23. package/dist/src/components/PeriodField/PeriodField.d.ts +259 -235
  24. package/dist/src/components/PhoneField/PhoneField.d.ts +33 -3
  25. package/dist/src/components/RatingPicker/EmotionPicker/EmotionPicker.d.ts +1 -1
  26. package/dist/src/components/RatingPicker/NumberPicker/NumberPicker.d.ts +1 -1
  27. package/dist/src/components/RatingPicker/StarsPicker/StarsPicker.d.ts +1 -1
  28. package/dist/src/components/UploadWorkflow/AccessibiliteItems.d.ts +29 -0
  29. package/dist/src/components/UploadWorkflow/config.d.ts +29 -0
  30. package/dist/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.d.ts +4 -0
  31. package/dist/src/components/UploadWorkflow/locales.d.ts +7 -0
  32. package/dist/src/components/UploadWorkflow/types.d.ts +19 -0
  33. package/dist/src/components/UploadWorkflow/useFileList.d.ts +10 -0
  34. package/dist/src/components/UploadWorkflow/useFileUploadJourney.d.ts +9 -0
  35. package/dist/src/components/Usages/Usages.d.ts +10 -0
  36. package/dist/src/components/index.d.ts +5 -0
  37. package/dist/src/composables/date/tests/useDateFormat.spec.d.ts +1 -0
  38. package/dist/src/composables/date/tests/useDateInitialization.spec.d.ts +1 -0
  39. package/dist/src/composables/date/tests/useDatePickerAccessibility.spec.d.ts +1 -0
  40. package/dist/src/composables/date/useDateFormat.d.ts +26 -0
  41. package/dist/src/composables/date/useDateInitialization.d.ts +18 -0
  42. package/dist/src/composables/date/useDatePickerAccessibility.d.ts +8 -0
  43. package/dist/src/composables/rules/useFieldValidation.d.ts +1 -0
  44. package/dist/src/composables/useFilterable/useFilterable.d.ts +1 -1
  45. package/dist/src/composables/validation/tests/useValidation.spec.d.ts +1 -0
  46. package/dist/src/composables/validation/useValidation.d.ts +40 -0
  47. package/dist/src/designTokens/index.d.ts +3 -1
  48. package/dist/src/main.d.ts +1 -0
  49. package/dist/src/utils/formatDate/index.d.ts +3 -0
  50. package/dist/src/utils/formatDate/tests/formatDate.spec.d.ts +1 -0
  51. package/dist/src/utils/functions/validation/isDateAfter/index.d.ts +2 -0
  52. package/dist/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.d.ts +1 -0
  53. package/dist/src/utils/functions/validation/isDateBefore/index.d.ts +2 -0
  54. package/dist/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.d.ts +1 -0
  55. package/dist/src/utils/functions/validation/isDateInRange/index.d.ts +3 -0
  56. package/dist/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.d.ts +1 -0
  57. package/dist/src/utils/functions/validation/isDateValid/index.d.ts +9 -0
  58. package/dist/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.d.ts +1 -0
  59. package/dist/src/utils/functions/validation/isEmailValid/tests/isEmailValid.spec.d.ts +1 -0
  60. package/dist/src/utils/functions/validation/isWeekend/index.d.ts +3 -0
  61. package/dist/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.d.ts +1 -0
  62. package/dist/src/utils/parseDate/index.d.ts +3 -0
  63. package/dist/src/utils/parseDate/tests/parseDate.spec.d.ts +1 -0
  64. package/dist/src/utils/rules/doMatchPattern/index.d.ts +3 -0
  65. package/dist/src/utils/rules/doMatchPattern/tests/matchPattern.spec.d.ts +1 -0
  66. package/dist/src/utils/rules/index.d.ts +11 -0
  67. package/dist/src/utils/rules/isDateValid/index.d.ts +4 -0
  68. package/dist/src/utils/rules/isDateValid/tests/isDateValid.spec.d.ts +1 -0
  69. package/dist/src/utils/rules/isExactLength/index.d.ts +3 -0
  70. package/dist/src/utils/rules/isExactLength/locales.d.ts +2 -0
  71. package/dist/src/utils/rules/isExactLength/tests/exactLength.spec.d.ts +1 -0
  72. package/dist/src/utils/rules/isMaxLength/index.d.ts +3 -0
  73. package/dist/src/utils/rules/isMaxLength/locales.d.ts +2 -0
  74. package/dist/src/utils/rules/isMaxLength/tests/isMaxLength.spec.d.ts +1 -0
  75. package/dist/src/utils/rules/isMinLength/index.d.ts +3 -0
  76. package/dist/src/utils/rules/isMinLength/locales.d.ts +2 -0
  77. package/dist/src/utils/rules/isMinLength/tests/isMinLength.spec.d.ts +1 -0
  78. package/dist/src/utils/rules/isNotAfterDate/index.d.ts +3 -0
  79. package/dist/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.d.ts +1 -0
  80. package/dist/src/utils/rules/isNotAfterToday/index.d.ts +4 -0
  81. package/dist/src/utils/rules/isNotAfterToday/locales.d.ts +2 -0
  82. package/dist/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.d.ts +1 -0
  83. package/dist/src/utils/rules/isNotBeforeDate/index.d.ts +3 -0
  84. package/dist/src/utils/rules/isNotBeforeDate/locales.d.ts +2 -0
  85. package/dist/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.d.ts +1 -0
  86. package/dist/src/utils/rules/isNotBeforeToday/index.d.ts +4 -0
  87. package/dist/src/utils/rules/isNotBeforeToday/locales.d.ts +2 -0
  88. package/dist/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.d.ts +1 -0
  89. package/dist/src/utils/rules/isRequired/index.d.ts +4 -0
  90. package/dist/src/utils/rules/isRequired/locales.d.ts +2 -0
  91. package/dist/src/utils/rules/isRequired/tests/isRequred.spec.d.ts +1 -0
  92. package/dist/src/utils/rules/isValidEmail/index.d.ts +4 -0
  93. package/dist/src/utils/rules/isValidEmail/locales.d.ts +2 -0
  94. package/dist/src/utils/rules/isValidEmail/tests/isValidEmail.spec.d.ts +1 -0
  95. package/dist/src/vuetifyConfig.d.ts +81 -0
  96. package/dist/style.css +1 -1
  97. package/package.json +3 -1
  98. package/src/assets/_elevations.scss +89 -0
  99. package/src/assets/_fonts.scss +6 -0
  100. package/src/assets/_radius.scss +92 -0
  101. package/src/assets/_spacers.scss +149 -0
  102. package/src/assets/settings.scss +15 -3
  103. package/src/assets/tokens.scss +32 -29
  104. package/src/components/Amelipro/types/types.ts +40 -0
  105. package/src/components/ChipList/ChipList.stories.ts +26 -27
  106. package/src/components/ChipList/ChipList.vue +5 -1
  107. package/src/components/ChipList/config.ts +1 -0
  108. package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -2
  109. package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +1 -1
  110. package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +1 -1
  111. package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +65 -0
  112. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +13 -3
  113. package/src/components/Customs/SySelect/SySelect.mdx +1 -1
  114. package/src/components/Customs/SySelect/SySelect.stories.ts +88 -5
  115. package/src/components/Customs/SySelect/SySelect.vue +55 -14
  116. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +135 -2
  117. package/src/components/Customs/SyTextField/SyTextField.mdx +2 -2
  118. package/src/components/Customs/SyTextField/SyTextField.stories.ts +809 -79
  119. package/src/components/Customs/SyTextField/SyTextField.vue +135 -104
  120. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +190 -38
  121. package/src/components/Customs/SyTextField/types.d.ts +1 -0
  122. package/src/components/DatePicker/DatePicker.stories.ts +177 -5
  123. package/src/components/DatePicker/DatePicker.vue +302 -233
  124. package/src/components/DatePicker/DateTextInput.vue +101 -246
  125. package/src/components/DatePicker/tests/DatePicker.spec.ts +123 -60
  126. package/src/components/DatePicker/tests/DateTextInput.spec.ts +202 -6
  127. package/src/components/FileList/Accessibilite.stories.ts +1 -1
  128. package/src/components/FileList/AccessibiliteItems.ts +22 -0
  129. package/src/components/FileList/FileList.vue +2 -1
  130. package/src/components/FileList/UploadItem/UploadItem.vue +10 -0
  131. package/src/components/FileUpload/FileUpload.stories.ts +93 -7
  132. package/src/components/FileUpload/FileUpload.vue +1 -0
  133. package/src/components/FileUpload/tests/FileUpload.spec.ts +4 -4
  134. package/src/components/FilterInline/Accessibilite.mdx +14 -0
  135. package/src/components/FilterInline/Accessibilite.stories.ts +216 -0
  136. package/src/components/FilterInline/AccessibiliteItems.ts +132 -0
  137. package/src/components/FilterInline/FilterInline.mdx +180 -34
  138. package/src/components/FilterInline/FilterInline.stories.ts +363 -6
  139. package/src/components/FilterInline/constants/ExpertiseLevelEnum.ts +4 -0
  140. package/src/components/FilterSideBar/Accessibilite.mdx +14 -0
  141. package/src/components/FilterSideBar/Accessibilite.stories.ts +216 -0
  142. package/src/components/FilterSideBar/AccessibiliteItems.ts +153 -0
  143. package/src/components/FilterSideBar/FilterSideBar.mdx +237 -0
  144. package/src/components/FilterSideBar/FilterSideBar.stories.ts +798 -0
  145. package/src/components/FilterSideBar/FilterSideBar.vue +193 -0
  146. package/src/components/FilterSideBar/constants/ExpertiseLevelEnum.ts +4 -0
  147. package/src/components/FilterSideBar/locales.ts +8 -0
  148. package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +305 -0
  149. package/src/components/FilterSideBar/tests/__snapshots__/FilterSideBar.spec.ts.snap +39 -0
  150. package/src/components/HeaderBar/Usages.mdx +1 -1
  151. package/src/components/NirField/NirField.stories.ts +738 -29
  152. package/src/components/NirField/NirField.vue +401 -359
  153. package/src/components/NirField/examples//342/200/257dataset/342/200/257.md +12 -0
  154. package/src/components/NirField/tests/NirField.spec.ts +88 -52
  155. package/src/components/NirField/tests/config.spec.ts +65 -0
  156. package/src/components/NotificationBar/Accessibilite.stories.ts +4 -0
  157. package/src/components/NotificationBar/NotificationBar.mdx +2 -2
  158. package/src/components/NotificationBar/NotificationBar.stories.ts +66 -13
  159. package/src/components/NotificationBar/NotificationBar.vue +42 -114
  160. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +28 -33
  161. package/src/components/NotificationBar/tests/__snapshots__/NotificationBar.spec.ts.snap +1 -1
  162. package/src/components/PaginatedTable/PaginatedTable.vue +6 -10
  163. package/src/components/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +4 -4
  164. package/src/components/PasswordField/PasswordField.mdx +129 -47
  165. package/src/components/PasswordField/PasswordField.stories.ts +1111 -120
  166. package/src/components/PasswordField/PasswordField.vue +212 -99
  167. package/src/components/PasswordField/tests/PasswordField.spec.ts +138 -9
  168. package/src/components/PeriodField/PeriodField.stories.ts +214 -118
  169. package/src/components/PeriodField/PeriodField.vue +238 -190
  170. package/src/components/PeriodField/tests/PeriodField.spec.ts +146 -0
  171. package/src/components/PhoneField/PhoneField.stories.ts +170 -0
  172. package/src/components/PhoneField/PhoneField.vue +76 -17
  173. package/src/components/PhoneField/indicatifs.ts +1 -1
  174. package/src/components/PhoneField/tests/PhoneField.spec.ts +40 -0
  175. package/src/components/RatingPicker/RatingPicker.stories.ts +7 -7
  176. package/src/components/SearchListField/SearchListField.stories.ts +1 -1
  177. package/src/components/UploadWorkflow/Accessibilite.mdx +14 -0
  178. package/src/components/UploadWorkflow/Accessibilite.stories.ts +216 -0
  179. package/src/components/UploadWorkflow/AccessibiliteItems.ts +192 -0
  180. package/src/components/UploadWorkflow/UploadWorkflow.mdx +75 -0
  181. package/src/components/UploadWorkflow/UploadWorkflow.stories.ts +943 -0
  182. package/src/components/UploadWorkflow/UploadWorkflow.vue +230 -0
  183. package/src/components/UploadWorkflow/config.ts +29 -0
  184. package/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.ts +4 -0
  185. package/src/components/UploadWorkflow/locales.ts +8 -0
  186. package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +257 -0
  187. package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +54 -0
  188. package/src/components/UploadWorkflow/types.ts +21 -0
  189. package/src/components/UploadWorkflow/useFileList.ts +84 -0
  190. package/src/components/UploadWorkflow/useFileUploadJourney.ts +18 -0
  191. package/src/components/Usages/tests/Usages.spec.ts +183 -0
  192. package/src/components/index.ts +5 -0
  193. package/src/composables/date/tests/useDateFormat.spec.ts +67 -0
  194. package/src/composables/date/tests/useDateInitialization.spec.ts +89 -0
  195. package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +102 -0
  196. package/src/composables/date/useDateFormat.ts +94 -0
  197. package/src/composables/date/useDateInitialization.ts +92 -0
  198. package/src/composables/date/useDatePickerAccessibility.ts +78 -0
  199. package/src/composables/rules/tests/useFieldValidation.spec.ts +385 -4
  200. package/src/composables/rules/useFieldValidation.ts +5 -2
  201. package/src/composables/useFilterable/useFilterable.ts +5 -4
  202. package/src/composables/validation/tests/useValidation.spec.ts +154 -0
  203. package/src/composables/validation/useValidation.ts +180 -0
  204. package/src/designTokens/index.ts +4 -0
  205. package/src/main.ts +1 -0
  206. package/src/stories/Accessibilite/Aculturation/AuditDesignSystem.mdx +28 -0
  207. package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +2 -2
  208. package/src/stories/Accessibilite/Audit/RGAA.mdx +6 -6
  209. package/src/stories/Accessibilite/Introduction.mdx +2 -1
  210. package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +1 -1
  211. package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +1 -1
  212. package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +8 -11
  213. package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +77 -0
  214. package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru.mdx +9 -3
  215. package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +2 -2
  216. package/src/stories/Demarrer/Accueil.mdx +1 -1
  217. package/src/stories/Demarrer/Introduction.stories.ts +3 -3
  218. package/src/stories/Demarrer/Releases.mdx +8 -0
  219. package/src/stories/Demarrer/Releases.stories.ts +66 -0
  220. package/src/stories/DesignTokens/Conteneurs.stories.ts +3 -3
  221. package/src/stories/DesignTokens/ThemePA.mdx +4 -30
  222. package/src/stories/GuideDuDev/LesBreackingChanges.mdx +36 -0
  223. package/src/stories/GuideDuDev/UtiliserLesRules.mdx +321 -78
  224. package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
  225. package/src/utils/formatDate/index.ts +6 -0
  226. package/src/utils/formatDate/tests/formatDate.spec.ts +18 -0
  227. package/src/utils/functions/validation/isDateAfter/index.ts +9 -0
  228. package/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.ts +18 -0
  229. package/src/utils/functions/validation/isDateBefore/index.ts +9 -0
  230. package/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.ts +23 -0
  231. package/src/utils/functions/validation/isDateInRange/index.ts +22 -0
  232. package/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.ts +28 -0
  233. package/src/utils/functions/validation/isDateValid/index.ts +67 -0
  234. package/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.ts +46 -0
  235. package/src/utils/functions/validation/isEmailValid/index.ts +9 -0
  236. package/src/utils/functions/validation/isWeekend/index.ts +10 -0
  237. package/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.ts +16 -0
  238. package/src/utils/parseDate/index.ts +29 -0
  239. package/src/utils/parseDate/tests/parseDate.spec.ts +52 -0
  240. package/src/utils/rules/Rules.mdx +16 -0
  241. package/src/utils/rules/doMatchPattern/DoMachPattern.mdx +66 -0
  242. package/src/utils/rules/doMatchPattern/DoMatchPattern.stories.ts +106 -0
  243. package/src/utils/rules/doMatchPattern/index.ts +28 -0
  244. package/src/utils/rules/doMatchPattern/locales.ts +5 -0
  245. package/src/utils/rules/doMatchPattern/tests/matchPattern.spec.ts +38 -0
  246. package/src/utils/rules/index.ts +11 -0
  247. package/src/utils/rules/isDateValid/IsDateValid.mdx +87 -0
  248. package/src/utils/rules/isDateValid/IsDateValid.stories.ts +113 -0
  249. package/src/utils/rules/isDateValid/index.ts +32 -0
  250. package/src/utils/rules/isDateValid/locales.ts +10 -0
  251. package/src/utils/rules/isDateValid/tests/isDateValid.spec.ts +27 -0
  252. package/src/utils/rules/isExactLength/IsExactLenght.mdx +68 -0
  253. package/src/utils/rules/isExactLength/IsExactLength.stories.ts +151 -0
  254. package/src/utils/rules/{exactLength → isExactLength}/index.ts +2 -4
  255. package/src/utils/rules/isExactLength/tests/exactLength.spec.ts +48 -0
  256. package/src/utils/rules/isMaxLength/IsMaxLength.mdx +68 -0
  257. package/src/utils/rules/isMaxLength/IsMaxLength.stories.ts +152 -0
  258. package/src/utils/rules/isMaxLength/index.ts +30 -0
  259. package/src/utils/rules/isMaxLength/locales.ts +6 -0
  260. package/src/utils/rules/isMaxLength/tests/isMaxLength.spec.ts +42 -0
  261. package/src/utils/rules/isMinLength/IsMinLength.mdx +68 -0
  262. package/src/utils/rules/isMinLength/IsMinLength.stories.ts +152 -0
  263. package/src/utils/rules/isMinLength/index.ts +30 -0
  264. package/src/utils/rules/isMinLength/locales.ts +6 -0
  265. package/src/utils/rules/isMinLength/tests/isMinLength.spec.ts +42 -0
  266. package/src/utils/rules/isNotAfterDate/IsNotAfterDate.mdx +68 -0
  267. package/src/utils/rules/isNotAfterDate/IsNotAfterDate.stories.ts +109 -0
  268. package/src/utils/rules/isNotAfterDate/index.ts +25 -0
  269. package/src/utils/rules/isNotAfterDate/locales.ts +6 -0
  270. package/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.ts +25 -0
  271. package/src/utils/rules/isNotAfterToday/IsNotAfterToday.mdx +83 -0
  272. package/src/utils/rules/isNotAfterToday/IsNotAfterToday.stories.ts +110 -0
  273. package/src/utils/rules/isNotAfterToday/index.ts +28 -0
  274. package/src/utils/rules/isNotAfterToday/locales.ts +5 -0
  275. package/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.ts +30 -0
  276. package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.mdx +68 -0
  277. package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.stories.ts +114 -0
  278. package/src/utils/rules/isNotBeforeDate/index.ts +25 -0
  279. package/src/utils/rules/isNotBeforeDate/locales.ts +6 -0
  280. package/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.ts +25 -0
  281. package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.mdx +83 -0
  282. package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.stories.ts +110 -0
  283. package/src/utils/rules/isNotBeforeToday/index.ts +28 -0
  284. package/src/utils/rules/isNotBeforeToday/locales.ts +5 -0
  285. package/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.ts +36 -0
  286. package/src/utils/rules/isRequired/IsRequired.mdx +81 -0
  287. package/src/utils/rules/isRequired/IsRequired.stories.ts +101 -0
  288. package/src/utils/rules/{required → isRequired}/index.ts +3 -3
  289. package/src/utils/rules/{required/tests/index.spec.ts → isRequired/tests/isRequred.spec.ts} +9 -9
  290. package/src/utils/rules/isValidEmail/IsValidEmail.mdx +81 -0
  291. package/src/utils/rules/isValidEmail/IsValidEmail.stories.ts +101 -0
  292. package/src/utils/rules/{email → isValidEmail}/index.ts +3 -5
  293. package/src/utils/rules/{email/tests/email.spec.ts → isValidEmail/tests/isValidEmail.spec.ts} +5 -5
  294. package/src/vuetifyConfig.ts +61 -0
  295. package/dist/src/utils/rules/email/index.d.ts +0 -4
  296. package/dist/src/utils/rules/exactLength/index.d.ts +0 -4
  297. package/dist/src/utils/rules/required/index.d.ts +0 -4
  298. package/dist/src/utils/rules/required/ruleMessageHelper.d.ts +0 -3
  299. package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +0 -58
  300. package/src/composables/useFilterable/__snapshots__/useFilterable.spec.ts.snap +0 -3
  301. package/src/utils/functions/isEmailValid/index.ts +0 -8
  302. package/src/utils/rules/required/ruleMessageHelper.ts +0 -14
  303. package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +0 -22
  304. /package/dist/src/{utils/functions/isEmailValid/tests/isEmailValid.spec.d.ts → components/FilterSideBar/tests/FilterSideBar.spec.d.ts} +0 -0
  305. /package/dist/src/{utils/rules/email/tests/email.spec.d.ts → components/NirField/tests/config.spec.d.ts} +0 -0
  306. /package/dist/src/{utils/rules/required/tests/index.spec.d.ts → components/UploadWorkflow/tests/UploadWorkflow.spec.d.ts} +0 -0
  307. /package/dist/src/{utils/rules/required/tests/rulesMessageHelper.spec.d.ts → components/Usages/tests/Usages.spec.d.ts} +0 -0
  308. /package/dist/src/utils/functions/{isEmailValid → validation/isEmailValid}/index.d.ts +0 -0
  309. /package/dist/src/utils/rules/{exactLength → doMatchPattern}/locales.d.ts +0 -0
  310. /package/dist/src/utils/rules/{email → isDateValid}/locales.d.ts +0 -0
  311. /package/dist/src/utils/rules/{required → isNotAfterDate}/locales.d.ts +0 -0
  312. /package/src/utils/functions/{isEmailValid → validation/isEmailValid}/tests/isEmailValid.spec.ts +0 -0
  313. /package/src/utils/rules/{exactLength → isExactLength}/locales.ts +0 -0
  314. /package/src/utils/rules/{required → isRequired}/locales.ts +0 -0
  315. /package/src/utils/rules/{email → isValidEmail}/locales.ts +0 -0
@@ -2,8 +2,10 @@
2
2
  import { ref, computed, watch, onMounted } from 'vue'
3
3
  import { nextTick } from 'vue'
4
4
  import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
5
- import { useFieldValidation } from '@/composables/rules/useFieldValidation'
6
- import type { RuleOptions } from '@/composables/rules/useFieldValidation'
5
+ import { useDateFormat } from '@/composables/date/useDateFormat'
6
+ import { useValidation, type ValidationRule } from '@/composables/validation/useValidation'
7
+
8
+ const { parseDate } = useDateFormat()
7
9
 
8
10
  type DateValue = string | null
9
11
 
@@ -20,9 +22,11 @@
20
22
  displayIcon?: boolean
21
23
  displayAppendIcon?: boolean
22
24
  noIcon?: boolean
23
- customRules?: { type: string, options: RuleOptions }[]
24
- customWarningRules?: { type: string, options: RuleOptions }[]
25
+ customRules?: ValidationRule[]
26
+ customWarningRules?: ValidationRule[]
25
27
  displayPrependIcon?: boolean
28
+ disableErrorHandling?: boolean
29
+ showSuccessMessages?: boolean
26
30
  }>(), {
27
31
  modelValue: null,
28
32
  placeholder: 'Sélectionner une date',
@@ -39,6 +43,8 @@
39
43
  customRules: () => [],
40
44
  customWarningRules: () => [],
41
45
  displayPrependIcon: true,
46
+ disableErrorHandling: false,
47
+ showSuccessMessages: true,
42
48
  })
43
49
 
44
50
  const emit = defineEmits<{
@@ -47,63 +53,27 @@
47
53
  (e: 'blur'): void
48
54
  }>()
49
55
 
56
+ const {
57
+ errors,
58
+ warnings,
59
+ successes,
60
+ hasError,
61
+ clearValidation,
62
+ validateField,
63
+ } = useValidation({
64
+ showSuccessMessages: props.showSuccessMessages,
65
+ fieldIdentifier: props.label || props.placeholder,
66
+ disableErrorHandling: props.disableErrorHandling,
67
+ })
68
+
69
+ const errorMessages = errors
70
+ const warningMessages = warnings
71
+ const successMessages = successes
72
+
50
73
  const inputValue = ref<string>('')
51
74
  const isFocused = ref(false)
52
75
  const hasInteracted = ref(false)
53
- const errorMessages = ref<string[]>([])
54
- const warningMessages = ref<string[]>([])
55
- const successMessages = ref<string[]>([])
56
-
57
- // Fonction pour parser une date selon le format spécifié
58
- const parseDate = (dateStr: string, format: string = props.format): Date | null => {
59
- const parts = dateStr.split(/[-/.]/)
60
- const formatParts = format.split(/[-/.]/)
61
-
62
- if (parts.length !== formatParts.length) {
63
- return null
64
- }
65
-
66
- let day = 1, month = 0, year = 1970
67
-
68
- // Mapper les parties selon le format
69
- for (let i = 0; i < formatParts.length; i++) {
70
- const value = parseInt(parts[i], 10)
71
- if (isNaN(value)) {
72
- return null
73
- }
74
-
75
- switch (formatParts[i].toUpperCase()) {
76
- case 'DD':
77
- day = value
78
- break
79
- case 'MM':
80
- month = value - 1 // JavaScript months are 0-based
81
- break
82
- case 'YY':
83
- year = value + 2000 // Assuming 20xx for YY format
84
- break
85
- case 'YYYY':
86
- year = value
87
- break
88
- }
89
- }
90
76
 
91
- // Valider les limites
92
- if (month < 0 || month > 11) return null
93
- if (day < 1 || day > 31) return null
94
- if (year < 1000 || year > 9999) return null // Accepter une plage d'années plus large
95
-
96
- const date = new Date(year, month, day)
97
-
98
- // Vérifier si la date est valide (ex: 31/04 n'existe pas)
99
- if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) {
100
- return null
101
- }
102
-
103
- return date
104
- }
105
-
106
- // Fonction pour formater une date en chaîne selon le format spécifié
107
77
  const formatDateToString = (date: Date, format: string): string => {
108
78
  const day = date.getDate().toString().padStart(2, '0')
109
79
  const month = (date.getMonth() + 1).toString().padStart(2, '0')
@@ -133,28 +103,23 @@
133
103
  return parts.join(separator)
134
104
  }
135
105
 
136
- // Fonction pour formater la date pendant la saisie
137
106
  const formatDateInput = (input: string, cursorPosition?: number): { formatted: string, cursorPos: number } => {
138
107
  const separator = props.format.includes('/') ? '/' : props.format.includes('-') ? '-' : '.'
139
108
 
140
- // Déterminer l'ordre des composants (jour, mois, année) en fonction du format
141
109
  const formatParts = props.format.split(/[/.-]/)
142
110
  const dayIndex = formatParts.findIndex(part => part.toUpperCase().includes('D'))
143
111
  const monthIndex = formatParts.findIndex(part => part.toUpperCase().includes('M'))
144
112
  const yearIndex = formatParts.findIndex(part => part.toUpperCase().includes('Y'))
145
113
 
146
- // Créer le masque en fonction du format
147
114
  const parts = Array(3).fill('__')
148
- parts[yearIndex] = '____' // L'année a toujours 4 caractères
115
+ parts[yearIndex] = '____'
149
116
  const mask = parts.join(separator)
150
117
 
151
118
  let result = mask
152
119
  let pos = cursorPosition || 0
153
120
 
154
- // Nettoyer l'entrée pour ne garder que les chiffres et les séparateurs
155
121
  let cleanInput = input
156
122
 
157
- // Si l'entrée contient déjà des séparateurs, on les garde pour préserver l'ordre
158
123
  if (input.includes(separator)) {
159
124
  const parts = input.split(separator)
160
125
  cleanInput = parts.map(part => part.replace(/\D/g, '')).join(separator)
@@ -163,7 +128,6 @@
163
128
  cleanInput = input.replace(/\D/g, '')
164
129
  }
165
130
 
166
- // Si l'entrée contient des séparateurs, on traite chaque partie séparément
167
131
  if (cleanInput.includes(separator)) {
168
132
  const parts = cleanInput.split(separator)
169
133
  const formattedParts = Array(3).fill('__')
@@ -174,7 +138,6 @@
174
138
  result = formattedParts.join(separator)
175
139
  }
176
140
  else {
177
- // Distribution des chiffres selon le format
178
141
  const formatOrder = [dayIndex, monthIndex, yearIndex]
179
142
  let currentDigit = 0
180
143
 
@@ -182,9 +145,8 @@
182
145
  const formatPartIndex = formatOrder[partIndex % 3]
183
146
  const isYear = formatParts[formatPartIndex].toUpperCase().includes('Y')
184
147
  const partLength = isYear ? 4 : 2
185
- const targetStartPos = formatPartIndex * 3 // Chaque partie a 2 caractères + 1 séparateur
148
+ const targetStartPos = formatPartIndex * 3
186
149
 
187
- // Insérer les chiffres pour cette partie
188
150
  for (let j = 0; j < partLength && currentDigit < cleanInput.length; j++) {
189
151
  const digit = cleanInput[currentDigit]
190
152
  const targetPos = targetStartPos + j
@@ -194,10 +156,8 @@
194
156
  }
195
157
  }
196
158
 
197
- // Calculer la nouvelle position du curseur
198
159
  if (cursorPosition !== undefined) {
199
160
  pos = cursorPosition
200
- // Si on est sur un séparateur, avancer d'une position
201
161
  if (mask[pos] === separator) {
202
162
  pos++
203
163
  }
@@ -209,160 +169,77 @@
209
169
  }
210
170
  }
211
171
 
212
- // Fonction pour nettoyer une chaîne de date
213
172
  const cleanDateString = (input: string): string => {
214
- // Conserver uniquement les chiffres et les séparateurs valides
215
173
  return input.replace(/[^\d/.-]/g, '')
216
174
  }
217
175
 
218
- // Fonction pour valider le format de la date
219
176
  const validateDateFormat = (dateStr: string): { isValid: boolean, message: string } => {
220
177
  if (!dateStr) {
221
- return { isValid: !props.required || !hasInteracted.value, message: (props.required && hasInteracted.value) ? 'La date est requise' : '' }
178
+ return {
179
+ isValid: !props.required || !hasInteracted.value || props.disableErrorHandling,
180
+ message: (props.required && hasInteracted.value && !props.disableErrorHandling) ? 'La date est requise' : '',
181
+ }
222
182
  }
223
183
 
224
- // Vérifier que la chaîne ne contient que des chiffres et des séparateurs
225
184
  if (!/^[\d/.-]*$/.test(dateStr)) {
226
- return { isValid: false, message: 'Format de date invalide' }
185
+ return {
186
+ isValid: props.disableErrorHandling,
187
+ message: props.disableErrorHandling ? '' : 'Format de date invalide',
188
+ }
227
189
  }
228
190
 
229
- // Essayer de parser avec le format d'entrée
230
191
  let date = parseDate(dateStr, props.format)
231
192
 
232
- // Si ça échoue et qu'on a un format de retour, essayer avec celui-ci
233
193
  if (!date && props.dateFormatReturn) {
234
194
  date = parseDate(dateStr, props.dateFormatReturn)
235
195
  }
236
196
 
237
197
  if (!date) {
238
- return { isValid: false, message: 'Format de date invalide' }
198
+ return {
199
+ isValid: props.disableErrorHandling,
200
+ message: props.disableErrorHandling ? '' : 'Format de date invalide',
201
+ }
239
202
  }
240
203
 
241
204
  return { isValid: true, message: '' }
242
205
  }
243
206
 
244
- // Fonction pour valider les règles et mettre à jour les messages
245
207
  const validateRules = (value: string) => {
246
- errorMessages.value = []
247
- warningMessages.value = []
248
- successMessages.value = []
208
+ clearValidation()
249
209
 
250
- if (!value) {
251
- if (props.required && hasInteracted.value) {
252
- errorMessages.value.push('La date est requise')
210
+ if (!value && props.required && hasInteracted.value) {
211
+ if (!props.disableErrorHandling) {
212
+ errors.value.push('La date est requise')
253
213
  }
254
- return
255
- }
256
-
257
- // Validation du format
258
- const validation = validateDateFormat(value)
259
- if (!validation.isValid) {
260
- errorMessages.value.push(validation.message)
261
- return
214
+ return false
262
215
  }
263
216
 
264
- // Validation des règles
265
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
266
- const validateErrorRules = (rules: any[]) => {
267
- let allValid = true
268
- const successMsgs: string[] = []
269
-
270
- rules.forEach((rule) => {
271
- const result = rule(value)
272
- if (result?.error) {
273
- errorMessages.value.push(result.error)
274
- allValid = false
275
- }
276
- else if (!result?.warning && !result?.error) {
277
- successMsgs.push(result?.success || 'Date valide')
278
- }
279
- })
280
-
281
- // N'ajouter les messages de succès que si toutes les règles sont validées
282
- if (allValid && successMsgs.length > 0) {
283
- successMessages.value.push(...successMsgs)
284
- }
217
+ if (!value && !props.required) {
218
+ return true
285
219
  }
286
220
 
287
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
288
- const validateWarningRules = (rules: any[]) => {
289
- let allValid = true
290
- const successMsgs: string[] = []
291
-
292
- rules.forEach((rule) => {
293
- const result = rule(value)
294
- if (result?.warning) {
295
- warningMessages.value.push(result.warning)
296
- allValid = false
297
- }
298
- else if (result?.success) {
299
- successMsgs.push(result.success)
300
- }
301
- })
302
-
303
- // N'ajouter les messages de succès que si toutes les règles sont validées
304
- if (allValid && successMsgs.length > 0) {
305
- successMessages.value.push(...successMsgs)
221
+ const formatValidation = validateDateFormat(value)
222
+ if (!formatValidation.isValid) {
223
+ if (!props.disableErrorHandling && formatValidation.message) {
224
+ errors.value.push(formatValidation.message)
306
225
  }
226
+ return false
307
227
  }
308
228
 
309
- // Appliquer les règles
310
- validateErrorRules(validationRules)
311
- validateWarningRules(warningValidationRules)
229
+ validateField(
230
+ value,
231
+ props.customRules,
232
+ props.customWarningRules,
233
+ [],
234
+ )
312
235
 
313
- // Supprimer les doublons
314
- errorMessages.value = [...new Set(errorMessages.value)]
315
- warningMessages.value = [...new Set(warningMessages.value)]
316
- successMessages.value = [...new Set(successMessages.value)]
236
+ return !hasError.value
317
237
  }
318
238
 
319
- const { generateRules } = useFieldValidation()
320
-
321
- // Générer les règles de validation
322
- const generateCustomRules = (rules: { type: string, options: RuleOptions }[]) => {
323
- return rules.map((rule) => {
324
- return (value: string) => {
325
- if (rule.type === 'custom') {
326
- const { validate, message, warningMessage, successMessage, isWarning } = rule.options
327
-
328
- if (typeof validate !== 'function') {
329
- return true
330
- }
331
-
332
- const isValid = validate(value)
333
-
334
- if (isWarning) {
335
- // Pour les règles de warning, on inverse la logique :
336
- return !isValid
337
- ? { warning: warningMessage || message }
338
- : { success: successMessage }
339
- }
239
+ const isOnError = computed(() => warningMessages.value.length === 0 && successMessages.value.length === 0 && errorMessages.value.length > 0)
240
+ const isOnWarning = computed(() => errorMessages.value.length === 0 && successMessages.value.length === 0 && warningMessages.value.length > 0)
241
+ const isOnSuccess = computed(() => errorMessages.value.length === 0 && warningMessages.value.length === 0 && successMessages.value.length > 0)
340
242
 
341
- // Pour les règles normales
342
- return !isValid
343
- ? { error: message }
344
- : { success: successMessage }
345
- }
346
- return null
347
- }
348
- })
349
- }
350
-
351
- const validationRules = [
352
- ...generateCustomRules(props.customRules?.filter(r => r.type === 'custom' && !r.options.isWarning) || []),
353
- ...generateRules(props.customRules?.filter(r => r.type !== 'custom') || []),
354
- ]
355
- const warningValidationRules = [
356
- ...generateCustomRules(props.customWarningRules || []),
357
- ...generateCustomRules(props.customRules?.filter(r => r.type === 'custom' && r.options.isWarning) || []),
358
- ]
359
-
360
- // Déterminer si le champ est en erreur
361
- const isOnError = computed(() => errorMessages.value.length > 0)
362
- const isOnWarning = computed(() => warningMessages.value.length > 0)
363
- const isOnSuccess = computed(() => successMessages.value.length > 0)
364
-
365
- // Déterminer l'icône à afficher
366
243
  const getIcon = computed(() => {
367
244
  if (errorMessages.value.length > 0) {
368
245
  return 'error'
@@ -376,15 +253,12 @@
376
253
  return undefined
377
254
  })
378
255
 
379
- // Gestionnaire de touches pour permettre le copier-coller
380
256
  const handleKeydown = (event: KeyboardEvent) => {
381
- // Autoriser les touches de contrôle (Ctrl+C, Ctrl+V, etc.)
382
257
  if (event.ctrlKey || event.metaKey) {
383
258
  return
384
259
  }
385
260
  }
386
261
 
387
- // Gestionnaire de l'événement paste
388
262
  const handlePaste = (event: ClipboardEvent) => {
389
263
  event.preventDefault()
390
264
  const pastedText = event.clipboardData?.getData('text')
@@ -393,23 +267,18 @@
393
267
  return
394
268
  }
395
269
 
396
- // Nettoyer et formater la valeur collée
397
270
  const cleanedText = cleanDateString(pastedText)
398
271
  const formattedText = formatDateInput(cleanedText).formatted
399
272
 
400
- // Mettre à jour la valeur
401
273
  inputValue.value = formattedText
402
274
  }
403
275
 
404
- // Référence vers l'élément input
405
276
  const inputRef = ref<InstanceType<typeof SyTextField> | null>(null)
406
277
 
407
- // Flag pour éviter le formatage récursif
408
278
  const isFormatting = ref(false)
409
279
 
410
- // Watch sur inputValue pour gérer le formatage et la validation
411
280
  watch(inputValue, async (newValue, oldValue) => {
412
- if (isFormatting.value || newValue === oldValue) return // Éviter la récursion pendant le formatage
281
+ if (isFormatting.value || newValue === oldValue) return
413
282
 
414
283
  try {
415
284
  isFormatting.value = true
@@ -420,89 +289,81 @@
420
289
  return
421
290
  }
422
291
 
423
- // Récupérer la position du curseur avant le formatage
424
292
  const input = inputRef.value?.$el.querySelector('input')
425
293
  const cursorPos = input?.selectionStart || 0
426
294
 
427
- // Formater la valeur
428
295
  const { formatted, cursorPos: newPos } = formatDateInput(newValue, cursorPos)
429
296
 
430
- // Mettre à jour la valeur si nécessaire
431
297
  if (formatted !== newValue) {
432
298
  inputValue.value = formatted
433
- // Rétablir la position du curseur après le formatage
434
299
  await nextTick()
435
300
  input?.setSelectionRange(newPos, newPos)
436
301
  }
437
302
 
438
- // Vérifier si la date est complète
439
303
  const isDateComplete = !formatted.includes('_')
440
304
 
441
305
  if (isDateComplete) {
442
- // Valider le format si la date est complète
443
306
  const validation = validateDateFormat(formatted)
444
307
  if (validation.isValid) {
445
- const date = parseDate(formatted)
308
+ const date = parseDate(formatted, props.format)
446
309
  if (date) {
447
310
  const formattedDate = props.dateFormatReturn
448
311
  ? formatDateToString(date, props.dateFormatReturn)
449
312
  : formatted
450
- await nextTick() // Attendre le prochain tick avant d'émettre
313
+ await nextTick()
451
314
  emit('update:model-value', formattedDate)
452
315
  }
453
316
  }
454
317
  validateRules(formatted)
455
318
  }
456
319
  else {
457
- // Réinitialiser les messages d'erreur pendant la saisie
458
- errorMessages.value = []
459
- warningMessages.value = []
460
- successMessages.value = []
320
+ clearValidation()
461
321
  }
462
322
  }
463
323
  finally {
464
- await nextTick() // Attendre le prochain tick avant de réinitialiser le flag
324
+ await nextTick()
465
325
  isFormatting.value = false
466
326
  }
467
327
  })
468
328
 
469
- // Watch pour mettre à jour l'input quand modelValue change
470
329
  watch(() => props.modelValue, (newValue) => {
471
- if (isFormatting.value) return // Ne pas mettre à jour si on est en train de formater
330
+ if (isFormatting.value) return
472
331
 
473
332
  if (!newValue) {
474
333
  inputValue.value = ''
475
334
  return
476
335
  }
477
336
 
478
- // Formater la valeur selon le format d'affichage
479
- const date = parseDate(newValue, props.dateFormatReturn)
337
+ const date = parseDate(newValue, props.format)
480
338
  if (date) {
481
- const formatted = formatDateToString(date, props.format)
482
- inputValue.value = formatted
339
+ if (props.dateFormatReturn && props.dateFormatReturn !== props.format) {
340
+ const formattedForReturn = formatDateToString(date, props.dateFormatReturn)
341
+ emit('update:model-value', formattedForReturn)
342
+ }
343
+
344
+ inputValue.value = formatDateToString(date, props.format)
345
+ validateRules(inputValue.value)
483
346
  }
484
347
  else {
485
348
  inputValue.value = newValue
349
+ validateRules(newValue)
486
350
  }
487
351
  })
488
352
 
489
- // Gestionnaire de focus
490
353
  const handleFocus = () => {
491
354
  isFocused.value = true
492
355
  emit('focus')
493
356
  }
494
357
 
495
- // Gestionnaire de blur
496
358
  const handleBlur = () => {
497
359
  isFocused.value = false
498
360
  hasInteracted.value = true
499
361
  emit('blur')
500
362
 
501
- // Valider le format complet lors du blur
502
363
  if (inputValue.value) {
503
364
  const validation = validateDateFormat(inputValue.value)
504
365
  if (validation.isValid) {
505
- const date = parseDate(inputValue.value)
366
+ const date = parseDate(inputValue.value, props.format)
506
367
  if (date) {
507
368
  const formattedDate = props.dateFormatReturn
508
369
  ? formatDateToString(date, props.dateFormatReturn)
@@ -510,43 +371,40 @@
510
371
  emit('update:model-value', formattedDate)
511
372
  }
512
373
  }
374
+ else {
375
+ emit('update:model-value', props.modelValue)
376
+ }
377
+ }
378
+ else if (props.required) {
379
+ emit('update:model-value', props.modelValue)
513
380
  }
514
- // Toujours valider les règles, même si le champ est vide
381
+ else {
382
+ emit('update:model-value', null)
383
+ }
384
+
515
385
  validateRules(inputValue.value || '')
516
386
  }
517
387
 
518
- // Fonction de validation lors de la soumission
519
388
  const isValidating = ref(false)
520
389
 
521
- const validateOnSubmit = (): boolean => {
390
+ const validateOnSubmit = async (): Promise<boolean> => {
522
391
  isValidating.value = true
392
+ hasInteracted.value = true
523
393
 
524
- // Vérifier si le champ est requis et vide
525
- if (props.required && !inputValue.value) {
526
- errorMessages.value = ['Ce champ est requis']
527
- return false
528
- }
394
+ try {
395
+ const isFormatValid = validateRules(inputValue.value)
529
396
 
530
- // Si le champ n'est pas requis et est vide, c'est valide
531
- if (!inputValue.value) {
532
- return true
533
- }
397
+ if (!isFormatValid) {
398
+ return false
399
+ }
534
400
 
535
- // Valider le format de la date
536
- const { isValid, message } = validateDateFormat(inputValue.value)
537
- if (!isValid) {
538
- errorMessages.value = [message]
539
- return false
401
+ return !hasError.value
402
+ }
403
+ finally {
404
+ isValidating.value = false
540
405
  }
541
-
542
- // Valider les règles personnalisées
543
- validateRules(inputValue.value)
544
-
545
- // Retourner true seulement si pas d'erreurs
546
- return errorMessages.value.length === 0
547
406
  }
548
407
 
549
- // Exposer les méthodes et propriétés nécessaires
550
408
  defineExpose({
551
409
  validateOnSubmit,
552
410
  focus: () => {
@@ -568,16 +426,13 @@
568
426
  return
569
427
  }
570
428
 
571
- // Parser la date avec le format d'entrée
572
429
  const date = parseDate(props.modelValue, props.format)
573
430
  if (date) {
574
- // Si un format de retour est spécifié, l'utiliser pour la valeur émise
575
431
  if (props.dateFormatReturn && props.dateFormatReturn !== props.format) {
576
432
  const formattedForReturn = formatDateToString(date, props.dateFormatReturn)
577
433
  emit('update:model-value', formattedForReturn)
578
434
  }
579
435
 
580
- // Toujours afficher dans le format d'entrée
581
436
  inputValue.value = formatDateToString(date, props.format)
582
437
  validateRules(inputValue.value)
583
438
  }
@@ -597,7 +452,7 @@
597
452
  :label="label"
598
453
  :error-messages="errorMessages"
599
454
  :warning-messages="warningMessages"
600
- :success-messages="successMessages"
455
+ :success-messages="showSuccessMessages ? successMessages : []"
601
456
  :is-on-error="isOnError"
602
457
  :is-disabled="isDisabled"
603
458
  :is-read-only="isReadOnly"