@cnamts/synapse 0.0.12-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 (250) hide show
  1. package/dist/design-system-v3.js +4913 -4021
  2. package/dist/design-system-v3.umd.cjs +1 -1
  3. package/dist/src/components/Amelipro/types/types.d.ts +30 -57
  4. package/dist/src/components/Customs/SyTextField/SyTextField.d.ts +2 -0
  5. package/dist/src/components/DatePicker/DatePicker.d.ts +36 -44
  6. package/dist/src/components/DatePicker/DateTextInput.d.ts +33 -36
  7. package/dist/src/components/FilterInline/AccessibiliteItems.d.ts +30 -0
  8. package/dist/src/components/FilterInline/constants/ExpertiseLevelEnum.d.ts +4 -0
  9. package/dist/src/components/FilterSideBar/AccessibiliteItems.d.ts +29 -0
  10. package/dist/src/components/FilterSideBar/constants/ExpertiseLevelEnum.d.ts +4 -0
  11. package/dist/src/components/NirField/NirField.d.ts +14 -2
  12. package/dist/src/components/NotificationBar/NotificationBar.d.ts +5 -5
  13. package/dist/src/components/PasswordField/PasswordField.d.ts +2 -0
  14. package/dist/src/components/PeriodField/PeriodField.d.ts +159 -157
  15. package/dist/src/components/PhoneField/PhoneField.d.ts +22 -1
  16. package/dist/src/components/UploadWorkflow/AccessibiliteItems.d.ts +29 -0
  17. package/dist/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.d.ts +4 -0
  18. package/dist/src/components/Usages/Usages.d.ts +10 -0
  19. package/dist/src/components/index.d.ts +3 -0
  20. package/dist/src/composables/date/tests/useDatePickerAccessibility.spec.d.ts +1 -0
  21. package/dist/src/composables/date/useDateFormat.d.ts +26 -0
  22. package/dist/src/composables/date/useDateInitialization.d.ts +18 -0
  23. package/dist/src/composables/date/useDatePickerAccessibility.d.ts +8 -0
  24. package/dist/src/composables/useFilterable/useFilterable.d.ts +1 -1
  25. package/dist/src/composables/validation/useValidation.d.ts +1 -0
  26. package/dist/src/main.d.ts +1 -0
  27. package/dist/src/utils/formatDate/index.d.ts +3 -0
  28. package/dist/src/utils/formatDate/tests/formatDate.spec.d.ts +1 -0
  29. package/dist/src/utils/functions/validation/isDateAfter/index.d.ts +2 -0
  30. package/dist/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.d.ts +1 -0
  31. package/dist/src/utils/functions/validation/isDateBefore/index.d.ts +2 -0
  32. package/dist/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.d.ts +1 -0
  33. package/dist/src/utils/functions/validation/isDateInRange/index.d.ts +3 -0
  34. package/dist/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.d.ts +1 -0
  35. package/dist/src/utils/functions/validation/isDateValid/index.d.ts +9 -0
  36. package/dist/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.d.ts +1 -0
  37. package/dist/src/utils/functions/validation/isEmailValid/tests/isEmailValid.spec.d.ts +1 -0
  38. package/dist/src/utils/functions/validation/isWeekend/index.d.ts +3 -0
  39. package/dist/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.d.ts +1 -0
  40. package/dist/src/utils/parseDate/index.d.ts +3 -0
  41. package/dist/src/utils/parseDate/tests/parseDate.spec.d.ts +1 -0
  42. package/dist/src/utils/rules/doMatchPattern/index.d.ts +3 -0
  43. package/dist/src/utils/rules/doMatchPattern/tests/matchPattern.spec.d.ts +1 -0
  44. package/dist/src/utils/rules/index.d.ts +11 -0
  45. package/dist/src/utils/rules/isDateValid/index.d.ts +4 -0
  46. package/dist/src/utils/rules/isDateValid/tests/isDateValid.spec.d.ts +1 -0
  47. package/dist/src/utils/rules/isExactLength/index.d.ts +3 -0
  48. package/dist/src/utils/rules/isExactLength/locales.d.ts +2 -0
  49. package/dist/src/utils/rules/isExactLength/tests/exactLength.spec.d.ts +1 -0
  50. package/dist/src/utils/rules/isMaxLength/index.d.ts +3 -0
  51. package/dist/src/utils/rules/isMaxLength/locales.d.ts +2 -0
  52. package/dist/src/utils/rules/isMaxLength/tests/isMaxLength.spec.d.ts +1 -0
  53. package/dist/src/utils/rules/isMinLength/index.d.ts +3 -0
  54. package/dist/src/utils/rules/isMinLength/locales.d.ts +2 -0
  55. package/dist/src/utils/rules/isMinLength/tests/isMinLength.spec.d.ts +1 -0
  56. package/dist/src/utils/rules/isNotAfterDate/index.d.ts +3 -0
  57. package/dist/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.d.ts +1 -0
  58. package/dist/src/utils/rules/isNotAfterToday/index.d.ts +4 -0
  59. package/dist/src/utils/rules/isNotAfterToday/locales.d.ts +2 -0
  60. package/dist/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.d.ts +1 -0
  61. package/dist/src/utils/rules/isNotBeforeDate/index.d.ts +3 -0
  62. package/dist/src/utils/rules/isNotBeforeDate/locales.d.ts +2 -0
  63. package/dist/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.d.ts +1 -0
  64. package/dist/src/utils/rules/isNotBeforeToday/index.d.ts +4 -0
  65. package/dist/src/utils/rules/isNotBeforeToday/locales.d.ts +2 -0
  66. package/dist/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.d.ts +1 -0
  67. package/dist/src/utils/rules/isRequired/index.d.ts +4 -0
  68. package/dist/src/utils/rules/isRequired/locales.d.ts +2 -0
  69. package/dist/src/utils/rules/isRequired/tests/isRequred.spec.d.ts +1 -0
  70. package/dist/src/utils/rules/isValidEmail/index.d.ts +4 -0
  71. package/dist/src/utils/rules/isValidEmail/locales.d.ts +2 -0
  72. package/dist/src/utils/rules/isValidEmail/tests/isValidEmail.spec.d.ts +1 -0
  73. package/dist/style.css +1 -1
  74. package/package.json +3 -1
  75. package/src/assets/_radius.scss +12 -6
  76. package/src/assets/settings.scss +8 -0
  77. package/src/components/Amelipro/types/types.ts +40 -0
  78. package/src/components/ChipList/ChipList.stories.ts +26 -27
  79. package/src/components/ChipList/ChipList.vue +5 -1
  80. package/src/components/ChipList/config.ts +1 -0
  81. package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -2
  82. package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +1 -1
  83. package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +1 -1
  84. package/src/components/Customs/SySelect/SySelect.mdx +1 -1
  85. package/src/components/Customs/SySelect/SySelect.vue +19 -4
  86. package/src/components/Customs/SyTextField/SyTextField.mdx +2 -2
  87. package/src/components/Customs/SyTextField/SyTextField.stories.ts +239 -0
  88. package/src/components/Customs/SyTextField/SyTextField.vue +3 -0
  89. package/src/components/DatePicker/DatePicker.stories.ts +177 -5
  90. package/src/components/DatePicker/DatePicker.vue +148 -347
  91. package/src/components/DatePicker/DateTextInput.vue +91 -251
  92. package/src/components/DatePicker/tests/DatePicker.spec.ts +118 -48
  93. package/src/components/DatePicker/tests/DateTextInput.spec.ts +202 -6
  94. package/src/components/FileList/Accessibilite.stories.ts +1 -1
  95. package/src/components/FileList/AccessibiliteItems.ts +22 -0
  96. package/src/components/FileUpload/FileUpload.stories.ts +9 -7
  97. package/src/components/FilterInline/Accessibilite.mdx +14 -0
  98. package/src/components/FilterInline/Accessibilite.stories.ts +216 -0
  99. package/src/components/FilterInline/AccessibiliteItems.ts +132 -0
  100. package/src/components/FilterInline/constants/ExpertiseLevelEnum.ts +4 -0
  101. package/src/components/FilterSideBar/Accessibilite.mdx +14 -0
  102. package/src/components/FilterSideBar/Accessibilite.stories.ts +216 -0
  103. package/src/components/FilterSideBar/AccessibiliteItems.ts +153 -0
  104. package/src/components/FilterSideBar/constants/ExpertiseLevelEnum.ts +4 -0
  105. package/src/components/NirField/NirField.stories.ts +165 -0
  106. package/src/components/NirField/NirField.vue +6 -2
  107. package/src/components/NirField/tests/config.spec.ts +65 -0
  108. package/src/components/NotificationBar/NotificationBar.mdx +2 -2
  109. package/src/components/NotificationBar/NotificationBar.stories.ts +59 -11
  110. package/src/components/NotificationBar/NotificationBar.vue +42 -114
  111. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +28 -33
  112. package/src/components/NotificationBar/tests/__snapshots__/NotificationBar.spec.ts.snap +1 -1
  113. package/src/components/PaginatedTable/PaginatedTable.vue +6 -10
  114. package/src/components/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +4 -4
  115. package/src/components/PasswordField/PasswordField.stories.ts +191 -4
  116. package/src/components/PasswordField/PasswordField.vue +3 -0
  117. package/src/components/PeriodField/PeriodField.stories.ts +214 -118
  118. package/src/components/PeriodField/PeriodField.vue +195 -148
  119. package/src/components/PeriodField/tests/PeriodField.spec.ts +146 -0
  120. package/src/components/PhoneField/PhoneField.stories.ts +101 -0
  121. package/src/components/PhoneField/PhoneField.vue +73 -17
  122. package/src/components/PhoneField/tests/PhoneField.spec.ts +40 -0
  123. package/src/components/RatingPicker/RatingPicker.stories.ts +7 -7
  124. package/src/components/SearchListField/SearchListField.stories.ts +1 -1
  125. package/src/components/UploadWorkflow/Accessibilite.mdx +14 -0
  126. package/src/components/UploadWorkflow/Accessibilite.stories.ts +216 -0
  127. package/src/components/UploadWorkflow/AccessibiliteItems.ts +192 -0
  128. package/src/components/UploadWorkflow/UploadWorkflow.vue +2 -2
  129. package/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.ts +4 -0
  130. package/src/components/Usages/tests/Usages.spec.ts +183 -0
  131. package/src/components/index.ts +3 -0
  132. package/src/composables/date/tests/useDateFormat.spec.ts +67 -0
  133. package/src/composables/date/tests/useDateInitialization.spec.ts +89 -0
  134. package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +102 -0
  135. package/src/composables/date/useDateFormat.ts +94 -0
  136. package/src/composables/date/useDateInitialization.ts +92 -0
  137. package/src/composables/date/useDatePickerAccessibility.ts +78 -0
  138. package/src/composables/rules/tests/useFieldValidation.spec.ts +385 -4
  139. package/src/composables/useFilterable/useFilterable.ts +5 -4
  140. package/src/composables/validation/useValidation.ts +15 -0
  141. package/src/main.ts +1 -0
  142. package/src/stories/Accessibilite/Aculturation/AuditDesignSystem.mdx +28 -0
  143. package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +2 -2
  144. package/src/stories/Accessibilite/Audit/RGAA.mdx +6 -6
  145. package/src/stories/Accessibilite/Introduction.mdx +2 -1
  146. package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +1 -1
  147. package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +1 -1
  148. package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +8 -11
  149. package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +77 -0
  150. package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru.mdx +9 -3
  151. package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +2 -2
  152. package/src/stories/Demarrer/Introduction.stories.ts +3 -3
  153. package/src/stories/Demarrer/Releases.mdx +8 -0
  154. package/src/stories/Demarrer/Releases.stories.ts +66 -0
  155. package/src/stories/DesignTokens/Conteneurs.stories.ts +3 -3
  156. package/src/stories/GuideDuDev/LesBreackingChanges.mdx +36 -0
  157. package/src/stories/GuideDuDev/UtiliserLesRules.mdx +2 -2
  158. package/src/utils/formatDate/index.ts +6 -0
  159. package/src/utils/formatDate/tests/formatDate.spec.ts +18 -0
  160. package/src/utils/functions/validation/isDateAfter/index.ts +9 -0
  161. package/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.ts +18 -0
  162. package/src/utils/functions/validation/isDateBefore/index.ts +9 -0
  163. package/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.ts +23 -0
  164. package/src/utils/functions/validation/isDateInRange/index.ts +22 -0
  165. package/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.ts +28 -0
  166. package/src/utils/functions/validation/isDateValid/index.ts +67 -0
  167. package/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.ts +46 -0
  168. package/src/utils/functions/validation/isEmailValid/index.ts +9 -0
  169. package/src/utils/functions/validation/isWeekend/index.ts +10 -0
  170. package/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.ts +16 -0
  171. package/src/utils/parseDate/index.ts +29 -0
  172. package/src/utils/parseDate/tests/parseDate.spec.ts +52 -0
  173. package/src/utils/rules/Rules.mdx +16 -0
  174. package/src/utils/rules/doMatchPattern/DoMachPattern.mdx +66 -0
  175. package/src/utils/rules/doMatchPattern/DoMatchPattern.stories.ts +106 -0
  176. package/src/utils/rules/doMatchPattern/index.ts +28 -0
  177. package/src/utils/rules/doMatchPattern/locales.ts +5 -0
  178. package/src/utils/rules/doMatchPattern/tests/matchPattern.spec.ts +38 -0
  179. package/src/utils/rules/index.ts +11 -0
  180. package/src/utils/rules/isDateValid/IsDateValid.mdx +87 -0
  181. package/src/utils/rules/isDateValid/IsDateValid.stories.ts +113 -0
  182. package/src/utils/rules/isDateValid/index.ts +32 -0
  183. package/src/utils/rules/isDateValid/locales.ts +10 -0
  184. package/src/utils/rules/isDateValid/tests/isDateValid.spec.ts +27 -0
  185. package/src/utils/rules/isExactLength/IsExactLenght.mdx +68 -0
  186. package/src/utils/rules/isExactLength/IsExactLength.stories.ts +151 -0
  187. package/src/utils/rules/{exactLength → isExactLength}/index.ts +2 -4
  188. package/src/utils/rules/isExactLength/tests/exactLength.spec.ts +48 -0
  189. package/src/utils/rules/isMaxLength/IsMaxLength.mdx +68 -0
  190. package/src/utils/rules/isMaxLength/IsMaxLength.stories.ts +152 -0
  191. package/src/utils/rules/isMaxLength/index.ts +30 -0
  192. package/src/utils/rules/isMaxLength/locales.ts +6 -0
  193. package/src/utils/rules/isMaxLength/tests/isMaxLength.spec.ts +42 -0
  194. package/src/utils/rules/isMinLength/IsMinLength.mdx +68 -0
  195. package/src/utils/rules/isMinLength/IsMinLength.stories.ts +152 -0
  196. package/src/utils/rules/isMinLength/index.ts +30 -0
  197. package/src/utils/rules/isMinLength/locales.ts +6 -0
  198. package/src/utils/rules/isMinLength/tests/isMinLength.spec.ts +42 -0
  199. package/src/utils/rules/isNotAfterDate/IsNotAfterDate.mdx +68 -0
  200. package/src/utils/rules/isNotAfterDate/IsNotAfterDate.stories.ts +109 -0
  201. package/src/utils/rules/isNotAfterDate/index.ts +25 -0
  202. package/src/utils/rules/isNotAfterDate/locales.ts +6 -0
  203. package/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.ts +25 -0
  204. package/src/utils/rules/isNotAfterToday/IsNotAfterToday.mdx +83 -0
  205. package/src/utils/rules/isNotAfterToday/IsNotAfterToday.stories.ts +110 -0
  206. package/src/utils/rules/isNotAfterToday/index.ts +28 -0
  207. package/src/utils/rules/isNotAfterToday/locales.ts +5 -0
  208. package/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.ts +30 -0
  209. package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.mdx +68 -0
  210. package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.stories.ts +114 -0
  211. package/src/utils/rules/isNotBeforeDate/index.ts +25 -0
  212. package/src/utils/rules/isNotBeforeDate/locales.ts +6 -0
  213. package/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.ts +25 -0
  214. package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.mdx +83 -0
  215. package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.stories.ts +110 -0
  216. package/src/utils/rules/isNotBeforeToday/index.ts +28 -0
  217. package/src/utils/rules/isNotBeforeToday/locales.ts +5 -0
  218. package/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.ts +36 -0
  219. package/src/utils/rules/isRequired/IsRequired.mdx +81 -0
  220. package/src/utils/rules/isRequired/IsRequired.stories.ts +101 -0
  221. package/src/utils/rules/{required → isRequired}/index.ts +3 -3
  222. package/src/utils/rules/{required/tests/index.spec.ts → isRequired/tests/isRequred.spec.ts} +9 -9
  223. package/src/utils/rules/isValidEmail/IsValidEmail.mdx +81 -0
  224. package/src/utils/rules/isValidEmail/IsValidEmail.stories.ts +101 -0
  225. package/src/utils/rules/{email → isValidEmail}/index.ts +3 -5
  226. package/src/utils/rules/{email/tests/email.spec.ts → isValidEmail/tests/isValidEmail.spec.ts} +5 -5
  227. package/dist/src/components/Amelipro/types/languages.d.ts +0 -6
  228. package/dist/src/utils/rules/email/index.d.ts +0 -4
  229. package/dist/src/utils/rules/exactLength/index.d.ts +0 -4
  230. package/dist/src/utils/rules/required/index.d.ts +0 -4
  231. package/dist/src/utils/rules/required/ruleMessageHelper.d.ts +0 -3
  232. package/src/components/Amelipro/types/languages.d.ts +0 -6
  233. package/src/components/Amelipro/types/types.d.ts +0 -65
  234. package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +0 -58
  235. package/src/utils/functions/isEmailValid/index.ts +0 -8
  236. package/src/utils/rules/required/ruleMessageHelper.ts +0 -14
  237. package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +0 -22
  238. /package/dist/src/{utils/functions/isEmailValid/tests/isEmailValid.spec.d.ts → components/NirField/tests/config.spec.d.ts} +0 -0
  239. /package/dist/src/{utils/rules/email/tests/email.spec.d.ts → components/Usages/tests/Usages.spec.d.ts} +0 -0
  240. /package/dist/src/{utils/rules/required/tests/index.spec.d.ts → composables/date/tests/useDateFormat.spec.d.ts} +0 -0
  241. /package/dist/src/{utils/rules/required/tests/rulesMessageHelper.spec.d.ts → composables/date/tests/useDateInitialization.spec.d.ts} +0 -0
  242. /package/dist/src/utils/functions/{isEmailValid → validation/isEmailValid}/index.d.ts +0 -0
  243. /package/dist/src/utils/rules/{exactLength → doMatchPattern}/locales.d.ts +0 -0
  244. /package/dist/src/utils/rules/{email → isDateValid}/locales.d.ts +0 -0
  245. /package/dist/src/utils/rules/{required → isNotAfterDate}/locales.d.ts +0 -0
  246. /package/src/components/NirField/{tests → examples}//342/200/257dataset/342/200/257.md" +0 -0
  247. /package/src/utils/functions/{isEmailValid → validation/isEmailValid}/tests/isEmailValid.spec.ts +0 -0
  248. /package/src/utils/rules/{exactLength → isExactLength}/locales.ts +0 -0
  249. /package/src/utils/rules/{required → isRequired}/locales.ts +0 -0
  250. /package/src/utils/rules/{email → isValidEmail}/locales.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnamts/synapse",
3
- "version": "0.0.12-alpha",
3
+ "version": "0.0.13-alpha",
4
4
  "private": false,
5
5
  "description": "CNAM DS v3",
6
6
  "type": "module",
@@ -105,8 +105,10 @@
105
105
  "dependencies": {
106
106
  "@emotion/css": "^11.13.5",
107
107
  "@mdi/js": "^7.4.47",
108
+ "dayjs": "^1.11.13",
108
109
  "deepmerge": "^4.3.1",
109
110
  "iso-639-1": "^3.1.3",
111
+ "marked": "^15.0.7",
110
112
  "maska": "^3.0.3",
111
113
  "sass-embedded": "^1.83.0",
112
114
  "sass-loader": "^16.0.3",
@@ -61,26 +61,32 @@ $radius-keys: (0, 'sm', 'md', 'lg', 'xl', 'pill', 'circle');
61
61
  border-radius: var(--radius-md) !important;
62
62
  }
63
63
 
64
- .v-btn--rounded-md {
64
+ .v-btn.rounded-md {
65
65
  border-radius: var(--radius-md) !important;
66
66
  }
67
67
 
68
- .v-btn--rounded-sm {
68
+ .v-btn.rounded-sm {
69
69
  border-radius: var(--radius-sm) !important;
70
70
  }
71
71
 
72
- .v-btn--rounded-lg {
72
+ .v-btn.rounded-lg {
73
73
  border-radius: var(--radius-lg) !important;
74
74
  }
75
75
 
76
- .v-btn--rounded-xl {
76
+ .v-btn.rounded-xl {
77
77
  border-radius: var(--radius-xl) !important;
78
78
  }
79
79
 
80
- .v-btn--rounded-pill {
80
+ .v-btn.rounded-pill {
81
81
  border-radius: var(--radius-pill) !important;
82
82
  }
83
83
 
84
- .v-btn--rounded-circle {
84
+ .v-btn.rounded-circle {
85
85
  border-radius: var(--radius-circle) !important;
86
86
  }
87
+
88
+ .v-date-picker {
89
+ .v-btn {
90
+ border-radius: var(--radius-pill) !important;
91
+ }
92
+ }
@@ -16,3 +16,11 @@
16
16
  .v-tooltip .v-overlay__content {
17
17
  background-color: rgb(0 0 0 / 70%) !important;
18
18
  }
19
+
20
+ .v-messages {
21
+ font-size: 14px !important;
22
+
23
+ .v-messages__message {
24
+ line-height: 16px !important;
25
+ }
26
+ }
@@ -0,0 +1,40 @@
1
+ export interface IndexedObject<T = string> {
2
+ [key: string]: T
3
+ }
4
+
5
+ export interface Theme {
6
+ primary: string
7
+ secondary: string
8
+ info: string
9
+ warning: string
10
+ error: string
11
+ success: string
12
+ }
13
+ export interface Color {
14
+ darken1?: string
15
+ darken2?: string
16
+ darken3?: string
17
+ darken4?: string
18
+ darken5?: string
19
+ darken6?: string
20
+ base: string
21
+ lighten1?: string
22
+ lighten2?: string
23
+ lighten3?: string
24
+ lighten4?: string
25
+ lighten5?: string
26
+ lighten6?: string
27
+ }
28
+
29
+ export interface Palette {
30
+ apBlue: Color
31
+ apGrey: Color
32
+ apWhite: Color
33
+ apBlack: Color
34
+ apYellow: Color
35
+ apGreen: Color
36
+ apRed: Color
37
+ apTurquoise: Color
38
+ apParme: Color
39
+ apPink: Color
40
+ }
@@ -116,9 +116,9 @@ export const Default: Story = {
116
116
  {
117
117
  name: 'Script',
118
118
  code: `<script setup lang="ts">
119
- import ChipList from '@cnamts/synapse'
119
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
120
120
 
121
- const items = [
121
+ const items: ChipItem[] = [
122
122
  {
123
123
  text: 'Email',
124
124
  value: 'email',
@@ -205,9 +205,9 @@ export const Success: Story = {
205
205
  {
206
206
  name: 'Script',
207
207
  code: `<script setup lang="ts">
208
- import ChipList from '@cnamts/synapse'
208
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
209
209
 
210
- const items = [
210
+ const items: ChipItem[] = [
211
211
  {
212
212
  text: 'Email',
213
213
  value: 'email',
@@ -298,9 +298,9 @@ export const Info: Story = {
298
298
  {
299
299
  name: 'Script',
300
300
  code: `<script setup lang="ts">
301
- import ChipList from '@cnamts/synapse'
301
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
302
302
 
303
- const items = [
303
+ const items: ChipItem[] = [
304
304
  {
305
305
  text: 'Email',
306
306
  value: 'email',
@@ -391,9 +391,9 @@ export const Warning: Story = {
391
391
  {
392
392
  name: 'Script',
393
393
  code: `<script setup lang="ts">
394
- import ChipList from '@cnamts/synapse'
394
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
395
395
 
396
- const items = [
396
+ const items: ChipItem[] = [
397
397
  {
398
398
  text: 'Email',
399
399
  value: 'email',
@@ -484,9 +484,9 @@ export const Error: Story = {
484
484
  {
485
485
  name: 'Script',
486
486
  code: `<script setup lang="ts">
487
- import ChipList from '@cnamts/synapse'
487
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
488
488
 
489
- const items = [
489
+ const items: ChipItem[] = [
490
490
  {
491
491
  text: 'Email',
492
492
  value: 'email',
@@ -578,9 +578,9 @@ export const ReadOnly: Story = {
578
578
  {
579
579
  name: 'Script',
580
580
  code: `<script setup lang="ts">
581
- import ChipList from '@cnamts/synapse'
581
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
582
582
 
583
- const items = [
583
+ const items: ChipItem[] = [
584
584
  {
585
585
  text: 'Email',
586
586
  value: 'email',
@@ -659,9 +659,9 @@ export const CustomResetText: Story = {
659
659
  {
660
660
  name: 'Script',
661
661
  code: `<script setup lang="ts">
662
- import ChipList from '@cnamts/synapse'
662
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
663
663
 
664
- const items = [
664
+ const items: ChipItem[] = [
665
665
  {
666
666
  text: 'Email',
667
667
  value: 'email',
@@ -728,9 +728,9 @@ export const WithOverflow: Story = {
728
728
  {
729
729
  name: 'Script',
730
730
  code: `<script setup lang="ts">
731
- import ChipList from '@cnamts/synapse'
731
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
732
732
 
733
- const items = [
733
+ const items: ChipItem[] = [
734
734
  {
735
735
  text: 'Email',
736
736
  value: 'email',
@@ -822,10 +822,9 @@ export const WithEvents: Story = {
822
822
  {
823
823
  name: 'Script',
824
824
  code: `<script setup lang="ts">
825
- import ChipList from '@cnamts/synapse'
826
- import type { ChipItem } from '@cnamts/synapse/src/components/ChipList/types'
825
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
827
826
 
828
- const items = [
827
+ const items: ChipItem[] = [
829
828
  {
830
829
  text: 'Email',
831
830
  value: 'email',
@@ -933,9 +932,9 @@ export const WithPrependStateIcon: Story = {
933
932
  {
934
933
  name: 'Script',
935
934
  code: `<script setup lang="ts">
936
- import ChipList from '@cnamts/synapse'
935
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
937
936
 
938
- const items = [
937
+ const items: ChipItem[] = [
939
938
  {
940
939
  text: 'Email',
941
940
  value: 'email',
@@ -1011,9 +1010,9 @@ export const WithAppendStateIcon: Story = {
1011
1010
  {
1012
1011
  name: 'Script',
1013
1012
  code: `<script setup lang="ts">
1014
- import ChipList from '@cnamts/synapse'
1013
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
1015
1014
 
1016
- const items = [
1015
+ const items: ChipItem[] = [
1017
1016
  {
1018
1017
  text: 'Email',
1019
1018
  value: 'email',
@@ -1090,10 +1089,10 @@ export const WithCustomIcon: Story = {
1090
1089
  {
1091
1090
  name: 'Script',
1092
1091
  code: `<script setup lang="ts">
1093
- import ChipList from '@cnamts/synapse'
1092
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
1094
1093
  import { mdiAccount } from '@mdi/js'
1095
1094
 
1096
- const items = [
1095
+ const items: ChipItem[] = [
1097
1096
  {
1098
1097
  text: 'Email',
1099
1098
  value: 'email',
@@ -1172,9 +1171,9 @@ export const Customization: Story = {
1172
1171
  {
1173
1172
  name: 'Script',
1174
1173
  code: `<script setup lang="ts">
1175
- import ChipList from '@/components/ChipList/ChipList.vue'
1174
+ import { ChipList, type ChipItem } from '@cnamts/synapse'
1176
1175
 
1177
- const items = [
1176
+ const items: ChipItem[] = [
1178
1177
  {
1179
1178
  text: 'Email',
1180
1179
  value: 'email',
@@ -203,7 +203,7 @@
203
203
  color="primary"
204
204
  size="small"
205
205
  data-test-id="reset-btn"
206
- class="overflow-btn px-1 ml-0 my-1"
206
+ class="overflow-btn px-1 ml-1 my-1"
207
207
  @click="emitResetEvent"
208
208
  >
209
209
  {{ resetButtonText }}
@@ -243,4 +243,8 @@
243
243
  .overflow-btn :deep(.v-btn__overlay) {
244
244
  display: none;
245
245
  }
246
+
247
+ .remove-chip {
248
+ padding: 0 !important;
249
+ }
246
250
  </style>
@@ -20,6 +20,7 @@ export const config: ComponentConfig = {
20
20
  size: 'small',
21
21
  density: 'compact',
22
22
  variant: 'text' as VuetifyVariant,
23
+ rounded: 'pill',
23
24
  },
24
25
  icon: {
25
26
  size: 'medium',
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { required } from '@/utils/rules/required'
2
+ import { isRequired } from '@/utils/rules/isRequired'
3
3
  import { mdiChevronDown, mdiChevronUp } from '@mdi/js'
4
4
  import { computed, ref } from 'vue'
5
5
  import CookiesTable from '../CookiesTable/CookiesTable.vue'
@@ -70,7 +70,7 @@
70
70
  <VRadioGroup
71
71
  v-if="type !== 'essentials'"
72
72
  :model-value="parsedValue"
73
- :rules="[required]"
73
+ :rules="[isRequired]"
74
74
  data-test-id="radio-group"
75
75
  inline
76
76
  :label="locales.fieldLabel(locales[type].title)"
@@ -5,7 +5,7 @@ import * as SyBtnSelectStories from "./SyBtnSelect.stories";
5
5
 
6
6
  # SyBtnSelect
7
7
 
8
- Le composant `SyBtnSelect` est utilisé pour proposer une sélection d'options avec un bouton personnalisé, conforme au style du Design System et qui respecte les règles d'accessibilité RGAA.<br/>
8
+ Le composant `SyBtnSelect` est utilisé pour proposer une sélection d'options avec un bouton personnalisé, conforme au style du Design System et qui respecte les règles d'accessibilité <abbr title="Référentiel Général d’Amélioration de l’Accessibilité">RGAA</abbr>.<br/>
9
9
  Il est basé sur un `v-btn`.
10
10
 
11
11
  <Canvas of={SyBtnSelectStories.Default}/>
@@ -5,7 +5,7 @@ import * as SyInputSelectStories from "./SyInputSelect.stories";
5
5
 
6
6
  # SyInputSelect
7
7
 
8
- Le composant `SyInputSelect` est utilisé pour proposer une alternative au `v-select` de Vuetify qui ne respecte pas les règles RGAA.<br/>
8
+ Le composant `SyInputSelect` est utilisé pour proposer une alternative au `v-select` de Vuetify qui ne respecte pas les règles <abbr title="Référentiel Général d’Amélioration de l’Accessibilité">RGAA</abbr>.<br/>
9
9
  Il est basé sur un `v-input`.
10
10
 
11
11
  <Canvas of={SyInputSelectStories.Default} />
@@ -5,7 +5,7 @@ import * as SySelectStories from "./SySelect.stories";
5
5
 
6
6
  # SySelect
7
7
 
8
- Le composant `SySelect` est utilisé pour proposer une alternative au `v-select` de Vuetify qui ne respecte pas les règles d'accessibilité RGAA.<br/>
8
+ Le composant `SySelect` est utilisé pour proposer une alternative au `v-select` de Vuetify qui ne respecte pas les règles d'accessibilité <abbr title="Référentiel Général d’Amélioration de l’Accessibilité">RGAA</abbr>.<br/>
9
9
  Il est basé sur un `v-textfield`.
10
10
 
11
11
  <Canvas of={SySelectStories.Default} />
@@ -52,6 +52,10 @@
52
52
  type: Boolean,
53
53
  default: false,
54
54
  },
55
+ disableErrorHandling: {
56
+ type: Boolean,
57
+ default: false,
58
+ },
55
59
  })
56
60
 
57
61
  const emit = defineEmits(['update:modelValue'])
@@ -118,6 +122,8 @@
118
122
  })
119
123
 
120
124
  const isRequired = computed(() => {
125
+ // Si la gestion des erreurs est désactivée, on ne considère jamais le champ comme requis
126
+ if (props.disableErrorHandling) return false
121
127
  return (props.required || props.errorMessages.length > 0) && !selectedItem.value
122
128
  })
123
129
 
@@ -129,7 +135,13 @@
129
135
 
130
136
  watch([isOpen, hasError], ([newIsOpen, newHasError]) => {
131
137
  if (!newIsOpen) {
132
- hasError.value = (!selectedItem.value && isRequired.value) || props.errorMessages.length > 0
138
+ // Si la gestion des erreurs est désactivée, on ne met jamais hasError à true
139
+ if (props.disableErrorHandling) {
140
+ hasError.value = false
141
+ }
142
+ else {
143
+ hasError.value = (!selectedItem.value && isRequired.value) || props.errorMessages.length > 0
144
+ }
133
145
  }
134
146
  else {
135
147
  hasError.value = newHasError
@@ -137,7 +149,10 @@
137
149
  })
138
150
 
139
151
  watch(() => props.errorMessages, (newValue) => {
140
- hasError.value = newValue.length > 0
152
+ // Si la gestion des erreurs est désactivée, on ne met jamais hasError à true
153
+ if (!props.disableErrorHandling) {
154
+ hasError.value = newValue.length > 0
155
+ }
141
156
  })
142
157
 
143
158
  onMounted(() => {
@@ -166,9 +181,9 @@
166
181
  :disabled="disabled"
167
182
  :label="labelWithAsterisk"
168
183
  :aria-label="labelWithAsterisk"
169
- :error-messages="errorMessages"
184
+ :error-messages="props.disableErrorHandling ? [] : errorMessages"
170
185
  :variant="outlined ? 'outlined' : 'underlined'"
171
- :rules="isRequired ? ['Le champ est requis.'] : []"
186
+ :rules="isRequired && !props.disableErrorHandling ? ['Le champ est requis.'] : []"
172
187
  :display-asterisk="displayAsterisk"
173
188
  class="sy-select"
174
189
  :style="hasError ? { minWidth: `${labelWidth + 18}px`} : {minWidth: `${labelWidth}px`}"
@@ -1,11 +1,11 @@
1
1
  import { Meta, Canvas, Controls, Source } from '@storybook/blocks';
2
- import * as SyTextFieldStories from "./SyTextField.stories";
2
+ import * as SyTextFieldStories from "./SyTextField.stories.ts";
3
3
 
4
4
  <Meta of={SyTextFieldStories} />
5
5
 
6
6
  # SyTextField
7
7
 
8
- Le composant `SyTextField` est utilisé pour proposer une alternative au `TextField` de Vuetify, conforme au style du Design System et qui respecte les règles d'accessibilité RGAA.
8
+ Le composant `SyTextField` est utilisé pour proposer une alternative au `TextField` de Vuetify, conforme au style du Design System et qui respecte les règles d'accessibilité <abbr title="Référentiel Général d’Amélioration de l’Accessibilité">RGAA</abbr>.
9
9
 
10
10
  Il étend les fonctionnalités de base de Vuetify avec :
11
11
 
@@ -75,6 +75,10 @@ const meta = {
75
75
  control: 'boolean',
76
76
  default: true,
77
77
  },
78
+ 'disableErrorHandling': {
79
+ control: 'boolean',
80
+ description: 'Désactive complètement la validation des règles et l\'affichage des erreurs',
81
+ },
78
82
  'isActive': {
79
83
  description: 'Force l\'état actif du champ (label flottant et styles visuels)',
80
84
  control: 'boolean',
@@ -368,6 +372,23 @@ export const Required: Story = {
368
372
  ...Default.args,
369
373
  required: true,
370
374
  },
375
+ render: (args) => {
376
+ return {
377
+ components: { SyTextField, VIcon },
378
+ setup() {
379
+ const value = ref(args.modelValue)
380
+ watch(() => args.modelValue, (newValue) => {
381
+ value.value = newValue
382
+ })
383
+ return { args, value }
384
+ },
385
+ template: `
386
+ <div class="d-flex flex-wrap align-center">
387
+ <SyTextField v-bind="args" v-model="value" />
388
+ </div>
389
+ `,
390
+ }
391
+ },
371
392
  parameters: {
372
393
  docs: {
373
394
  description: {
@@ -408,6 +429,23 @@ export const RequiredWithAsterisk: Story = {
408
429
  required: true,
409
430
  displayAsterisk: true,
410
431
  },
432
+ render: (args) => {
433
+ return {
434
+ components: { SyTextField, VIcon },
435
+ setup() {
436
+ const value = ref(args.modelValue)
437
+ watch(() => args.modelValue, (newValue) => {
438
+ value.value = newValue
439
+ })
440
+ return { args, value }
441
+ },
442
+ template: `
443
+ <div class="d-flex flex-wrap align-center">
444
+ <SyTextField v-bind="args" v-model="value" />
445
+ </div>
446
+ `,
447
+ }
448
+ },
411
449
  parameters: {
412
450
  docs: {
413
451
  description: {
@@ -1359,3 +1397,204 @@ export const WithPrefixAndSuffix: Story = {
1359
1397
  ],
1360
1398
  },
1361
1399
  }
1400
+
1401
+ export const DisabledErrorHandling: Story = {
1402
+ args: {
1403
+ label: 'Champ requis',
1404
+ required: true,
1405
+ customRules: [
1406
+ {
1407
+ type: 'required',
1408
+ options: {
1409
+ message: 'Ce champ est obligatoire.',
1410
+ },
1411
+ },
1412
+ ],
1413
+ },
1414
+ render: (args) => {
1415
+ return {
1416
+ components: { SyTextField },
1417
+ setup() {
1418
+ const value1 = ref('')
1419
+ const value2 = ref('')
1420
+
1421
+ return { args, value1, value2 }
1422
+ },
1423
+ template: `
1424
+ <div>
1425
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
1426
+ <div>
1427
+ <p class="text-subtitle-2 mb-2">Validation normale</p>
1428
+ <SyTextField
1429
+ v-model="value1"
1430
+ v-bind="args"
1431
+ is-validate-on-blur
1432
+ />
1433
+ </div>
1434
+
1435
+ <div>
1436
+ <p class="text-subtitle-2 mb-2">Sans gestion d'erreurs</p>
1437
+ <SyTextField
1438
+ v-model="value2"
1439
+ v-bind="args"
1440
+ disableErrorHandling
1441
+ is-validate-on-blur
1442
+ />
1443
+ </div>
1444
+ </div>
1445
+
1446
+ <div class="mt-4 text-body-2">
1447
+ <p>Instructions :</p>
1448
+ <ol>
1449
+ <li class="ml-4">Cliquez dans un champ puis en dehors pour déclencher la validation</li>
1450
+ <li class="ml-4">Observez que le champ de gauche affiche un message d'erreur</li>
1451
+ <li class="ml-4">Le champ de droite n'affiche aucune erreur malgré les mêmes règles</li>
1452
+ </ol>
1453
+ </div>
1454
+ </div>
1455
+ `,
1456
+ }
1457
+ },
1458
+ parameters: {
1459
+ docs: {
1460
+ description: {
1461
+ story: 'La prop `disableErrorHandling` permet de désactiver complètement la gestion des erreurs de validation, même si des règles sont définies.',
1462
+ },
1463
+ },
1464
+ sourceCode: [
1465
+ {
1466
+ name: 'Template',
1467
+ code: `
1468
+ <template>
1469
+ <!-- Champ avec validation normale -->
1470
+ <SyTextField
1471
+ v-model="value"
1472
+ label="Champ obligatoire"
1473
+ required
1474
+ :custom-rules="[{
1475
+ type: 'required',
1476
+ options: { message: 'Ce champ est obligatoire.' }
1477
+ }]"
1478
+ is-validate-on-blur
1479
+ />
1480
+
1481
+ <!-- Champ avec gestion d'erreur désactivée -->
1482
+ <SyTextField
1483
+ v-model="value"
1484
+ label="Champ obligatoire"
1485
+ required
1486
+ :custom-rules="[{
1487
+ type: 'required',
1488
+ options: { message: 'Ce champ est obligatoire.' }
1489
+ }]"
1490
+ disableErrorHandling
1491
+ is-validate-on-blur
1492
+ />
1493
+ </template>`,
1494
+ },
1495
+ ],
1496
+ },
1497
+ }
1498
+
1499
+ export const WithoutSuccessMessages: Story = {
1500
+ args: {
1501
+ label: 'Email',
1502
+ customRules: [
1503
+ {
1504
+ type: 'matchPattern',
1505
+ options: {
1506
+ pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
1507
+ message: 'Veuillez entrer une adresse email valide',
1508
+ successMessage: 'Le format de l\'email est correct',
1509
+ fieldIdentifier: 'Email',
1510
+ },
1511
+ },
1512
+ ],
1513
+ },
1514
+ render: (args) => {
1515
+ return {
1516
+ components: { SyTextField },
1517
+ setup() {
1518
+ const value1 = ref('user@example.com')
1519
+ const value2 = ref('user@example.com')
1520
+
1521
+ return { args, value1, value2 }
1522
+ },
1523
+ template: `
1524
+ <div>
1525
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
1526
+ <div>
1527
+ <p class="text-subtitle-2 mb-2">Avec messages de succès (défaut)</p>
1528
+ <SyTextField
1529
+ v-model="value1"
1530
+ v-bind="args"
1531
+ showSuccessMessages
1532
+ />
1533
+ </div>
1534
+
1535
+ <div>
1536
+ <p class="text-subtitle-2 mb-2">Sans messages de succès</p>
1537
+ <SyTextField
1538
+ v-model="value2"
1539
+ v-bind="args"
1540
+ :showSuccessMessages="false"
1541
+ />
1542
+ </div>
1543
+ </div>
1544
+
1545
+ <div class="mt-4 text-body-2">
1546
+ <p>Les deux champs ont la même valeur et passent la validation :</p>
1547
+ <ul >
1548
+ <li class="ml-4">Le champ de gauche affiche le message de succès</li>
1549
+ <li class="ml-4">Le champ de droite n'affiche aucun message</li>
1550
+ </ul>
1551
+ <p class="mt-2">Essayez de modifier les valeurs pour voir le comportement.</p>
1552
+ </div>
1553
+ </div>
1554
+ `,
1555
+ }
1556
+ },
1557
+ parameters: {
1558
+ docs: {
1559
+ description: {
1560
+ story: 'La prop `showSuccessMessages` (par défaut: `true`) permet de contrôler l\'affichage des messages de succès lors de la validation.',
1561
+ },
1562
+ },
1563
+ sourceCode: [
1564
+ {
1565
+ name: 'Template',
1566
+ code: `
1567
+ <template>
1568
+ <!-- Champ avec messages de succès (défaut) -->
1569
+ <SyTextField
1570
+ v-model="email"
1571
+ label="Email"
1572
+ :custom-rules="[{
1573
+ type: 'matchPattern',
1574
+ options: {
1575
+ pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,
1576
+ message: 'Veuillez entrer une adresse email valide',
1577
+ successMessage: 'Le format de l\\'email est correct',
1578
+ }
1579
+ }]"
1580
+ />
1581
+
1582
+ <!-- Champ sans messages de succès -->
1583
+ <SyTextField
1584
+ v-model="email"
1585
+ label="Email"
1586
+ :custom-rules="[{
1587
+ type: 'matchPattern',
1588
+ options: {
1589
+ pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,
1590
+ message: 'Veuillez entrer une adresse email valide',
1591
+ successMessage: 'Le format de l\\'email est correct',
1592
+ }
1593
+ }]"
1594
+ :showSuccessMessages="false"
1595
+ />
1596
+ </template>`,
1597
+ },
1598
+ ],
1599
+ },
1600
+ }