@cnamts/synapse 0.0.10-alpha → 0.0.11-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 (589) hide show
  1. package/dist/design-system-v3.js +4291 -3815
  2. package/dist/design-system-v3.umd.cjs +1 -1
  3. package/dist/src/components/BackBtn/AccessibiliteItems.d.ts +29 -0
  4. package/dist/src/components/BackBtn/BackBtn.d.ts +14 -0
  5. package/dist/src/components/BackBtn/constants/ExpertiseLevelEnum.d.ts +4 -0
  6. package/dist/src/components/BackBtn/locales.d.ts +3 -0
  7. package/dist/src/components/BackBtn/tests/BackBtn.spec.d.ts +1 -0
  8. package/dist/src/components/BackToTopBtn/AccessibiliteItems.d.ts +29 -0
  9. package/dist/src/components/BackToTopBtn/BackToTopBtn.d.ts +23 -0
  10. package/dist/src/components/BackToTopBtn/config.d.ts +12 -0
  11. package/dist/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.d.ts +4 -0
  12. package/dist/src/components/BackToTopBtn/locales.d.ts +3 -0
  13. package/dist/src/components/BackToTopBtn/tests/BackToTopBtn.spec.d.ts +1 -0
  14. package/dist/src/components/ChipList/AccessibiliteItems.d.ts +29 -0
  15. package/dist/src/components/ChipList/ChipList.d.ts +47 -0
  16. package/dist/src/components/ChipList/config.d.ts +8 -0
  17. package/dist/src/components/ChipList/constants/ExpertiseLevelEnum.d.ts +4 -0
  18. package/dist/src/components/ChipList/locales.d.ts +6 -0
  19. package/dist/src/components/ChipList/tests/chipList.spec.d.ts +1 -0
  20. package/dist/src/components/ChipList/types.d.ts +6 -0
  21. package/dist/src/components/CollapsibleList/AccessibiliteItems.d.ts +46 -0
  22. package/dist/src/components/CollapsibleList/CollapsibleList.d.ts +7 -0
  23. package/dist/src/components/CollapsibleList/constants/ExpertiseLevelEnum.d.ts +4 -0
  24. package/dist/src/components/CollapsibleList/tests/CollapsibleList.spec.d.ts +1 -0
  25. package/dist/src/components/CollapsibleList/types.d.ts +5 -0
  26. package/dist/src/components/ContextualMenu/AccessibiliteItems.d.ts +46 -0
  27. package/dist/src/components/ContextualMenu/ContextualMenu.d.ts +13 -0
  28. package/dist/src/components/ContextualMenu/constants/ExpertiseLevelEnum.d.ts +4 -0
  29. package/dist/src/components/ContextualMenu/tests/ContextualMenu.spec.d.ts +1 -0
  30. package/dist/src/components/ContextualMenu/types.d.ts +5 -0
  31. package/dist/src/components/CookieBanner/AccessibiliteItems.d.ts +79 -0
  32. package/dist/src/components/CookieBanner/CookieBanner.d.ts +28 -0
  33. package/dist/src/components/CookieBanner/config.d.ts +40 -0
  34. package/dist/src/components/CookieBanner/constants/ExpertiseLevelEnum.d.ts +4 -0
  35. package/dist/src/components/CookieBanner/locales.d.ts +11 -0
  36. package/dist/src/components/CookieBanner/tests/CookieBanner.spec.d.ts +1 -0
  37. package/dist/src/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +19 -0
  38. package/dist/src/components/CookiesSelection/CookiesInformation/locales.d.ts +19 -0
  39. package/dist/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.spec.d.ts +1 -0
  40. package/dist/src/components/CookiesSelection/CookiesTable/CookiesTable.d.ts +13 -0
  41. package/dist/src/components/CookiesSelection/CookiesTable/headers.d.ts +10 -0
  42. package/dist/src/components/CookiesSelection/CookiesTable/tests/CookiesTable.spec.d.ts +1 -0
  43. package/dist/src/components/CookiesSelection/locales.d.ts +8 -0
  44. package/dist/src/components/CookiesSelection/tests/CookiesSelection.spec.d.ts +1 -0
  45. package/dist/src/components/CookiesSelection/types.d.ts +12 -0
  46. package/dist/src/components/CopyBtn/AccessibiliteItems.d.ts +29 -0
  47. package/dist/src/components/CopyBtn/CopyBtn.d.ts +28 -0
  48. package/dist/src/components/CopyBtn/config.d.ts +17 -0
  49. package/dist/src/components/CopyBtn/constants/ExpertiseLevelEnum.d.ts +4 -0
  50. package/dist/src/components/CopyBtn/locales.d.ts +3 -0
  51. package/dist/src/components/CopyBtn/tests/CopyBtn.spec.d.ts +1 -0
  52. package/dist/src/components/Customs/SyBtnSelect/AccessibiliteItems.d.ts +29 -0
  53. package/dist/src/components/Customs/SyBtnSelect/SyBtnSelect.d.ts +164 -0
  54. package/dist/src/components/Customs/SyBtnSelect/constants/ExpertiseLevelEnum.d.ts +4 -0
  55. package/dist/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.d.ts +1 -0
  56. package/dist/src/components/Customs/SyInputSelect/AccessibiliteItems.d.ts +29 -0
  57. package/dist/src/components/Customs/SyInputSelect/SyInputSelect.d.ts +36 -0
  58. package/dist/src/components/Customs/SyInputSelect/config.d.ts +9 -0
  59. package/dist/src/components/Customs/SyInputSelect/constants/ExpertiseLevelEnum.d.ts +4 -0
  60. package/dist/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.d.ts +1 -0
  61. package/dist/src/components/Customs/SySelect/AccessibiliteItems.d.ts +54 -0
  62. package/dist/src/components/Customs/SySelect/constants/ExpertiseLevelEnum.d.ts +4 -0
  63. package/dist/src/components/Customs/SySelect/tests/SySelect.spec.d.ts +1 -0
  64. package/dist/src/components/Customs/SyTextField/AccessibiliteItems.d.ts +70 -0
  65. package/dist/src/components/Customs/SyTextField/SyTextField.d.ts +160 -0
  66. package/dist/src/components/Customs/SyTextField/constants/ExpertiseLevelEnum.d.ts +4 -0
  67. package/dist/src/components/Customs/SyTextField/tests/SyTextField.spec.d.ts +1 -0
  68. package/dist/src/components/Customs/SyTextField/types.d.ts +3 -0
  69. package/dist/src/components/DataList/AccessibiliteItems.d.ts +29 -0
  70. package/dist/src/components/DataList/DataList.d.ts +134 -0
  71. package/dist/src/components/DataList/DataListLoading/DataListLoading.d.ts +32 -0
  72. package/dist/src/components/DataList/DataListLoading/tests/DataListLoading.spec.d.ts +1 -0
  73. package/dist/src/components/DataList/constants/ExpertiseLevelEnum.d.ts +4 -0
  74. package/dist/src/components/DataList/locales.d.ts +3 -0
  75. package/dist/src/components/DataList/tests/DataList.spec.d.ts +1 -0
  76. package/dist/src/components/DataList/types.d.ts +22 -0
  77. package/dist/src/components/DataListGroup/AccessibiliteItems.d.ts +29 -0
  78. package/dist/src/components/DataListGroup/DataListGroup.d.ts +56 -0
  79. package/dist/src/components/DataListGroup/constants/ExpertiseLevelEnum.d.ts +4 -0
  80. package/dist/src/components/DataListGroup/tests/DataListGroup.spec.d.ts +1 -0
  81. package/dist/src/components/DataListGroup/tests/data/dataListGroupItems.d.ts +5 -0
  82. package/dist/src/components/DataListGroup/types.d.ts +14 -0
  83. package/dist/src/components/DataListItem/DataListItem.d.ts +37 -0
  84. package/dist/src/components/DataListItem/config.d.ts +16 -0
  85. package/dist/src/components/DataListItem/locales.d.ts +3 -0
  86. package/dist/src/components/DataListItem/tests/DataListItem.spec.d.ts +1 -0
  87. package/dist/src/components/DataListItem/types.d.ts +22 -0
  88. package/dist/src/components/DatePicker/AccessibiliteItems.d.ts +54 -0
  89. package/dist/src/components/DatePicker/DatePicker.d.ts +594 -0
  90. package/dist/src/components/DatePicker/DateTextInput.d.ts +462 -0
  91. package/dist/src/components/DatePicker/constants/ExpertiseLevelEnum.d.ts +4 -0
  92. package/dist/src/components/DatePicker/tests/DatePicker.spec.d.ts +1 -0
  93. package/dist/src/components/DatePicker/tests/DateTextInput.spec.d.ts +1 -0
  94. package/dist/src/components/DialogBox/AccessibiliteItems.d.ts +54 -0
  95. package/dist/src/components/DialogBox/config.d.ts +25 -0
  96. package/dist/src/components/DialogBox/constants/ExpertiseLevelEnum.d.ts +4 -0
  97. package/dist/src/components/DialogBox/locales.d.ts +5 -0
  98. package/dist/src/components/DialogBox/tests/DialogBox.spec.d.ts +1 -0
  99. package/dist/src/components/DownloadBtn/AccessibiliteItems.d.ts +29 -0
  100. package/dist/src/components/DownloadBtn/DownloadBtn.d.ts +39 -0
  101. package/dist/src/components/DownloadBtn/config.d.ts +13 -0
  102. package/dist/src/components/DownloadBtn/constants/ExpertiseLevelEnum.d.ts +4 -0
  103. package/dist/src/components/DownloadBtn/tests/DownloadBtn.spec.d.ts +1 -0
  104. package/dist/src/components/DownloadBtn/tests/data/filePromise.d.ts +5 -0
  105. package/dist/src/components/ErrorPage/AccessibiliteItems.d.ts +65 -0
  106. package/dist/src/components/ErrorPage/ErrorPage.d.ts +31 -0
  107. package/dist/src/components/ErrorPage/constants/ExpertiseLevelEnum.d.ts +4 -0
  108. package/dist/src/components/ErrorPage/locales.d.ts +5 -0
  109. package/dist/src/components/ErrorPage/tests/ErrorPage.spec.d.ts +1 -0
  110. package/dist/src/components/ExternalLinks/AccessibiliteItems.d.ts +55 -0
  111. package/dist/src/components/ExternalLinks/ExternalLinks.d.ts +31 -0
  112. package/dist/src/components/ExternalLinks/config.d.ts +32 -0
  113. package/dist/src/components/ExternalLinks/constants/ExpertiseLevelEnum.d.ts +4 -0
  114. package/dist/src/components/ExternalLinks/locales.d.ts +4 -0
  115. package/dist/src/components/ExternalLinks/tests/ExternalLinks.spec.d.ts +1 -0
  116. package/dist/src/components/FileList/AccessibiliteItems.d.ts +29 -0
  117. package/dist/src/components/FileList/FileList.d.ts +44 -0
  118. package/dist/src/components/FileList/UploadItem/UploadItem.d.ts +58 -0
  119. package/dist/src/components/FileList/UploadItem/locales.d.ts +9 -0
  120. package/dist/src/components/FileList/constants/ExpertiseLevelEnum.d.ts +4 -0
  121. package/dist/src/components/FileList/tests/FileList.spec.d.ts +1 -0
  122. package/dist/src/components/FilePreview/AccessibiliteItems.d.ts +16 -0
  123. package/dist/src/components/FilePreview/FilePreview.d.ts +28 -0
  124. package/dist/src/components/FilePreview/config.d.ts +9 -0
  125. package/dist/src/components/FilePreview/constants/ExpertiseLevelEnum.d.ts +4 -0
  126. package/dist/src/components/FilePreview/locales.d.ts +4 -0
  127. package/dist/src/components/FilePreview/tests/FilePreview.spec.d.ts +1 -0
  128. package/dist/src/components/FileUpload/AccessibiliteItems.d.ts +16 -0
  129. package/dist/src/components/FileUpload/FileUpload.d.ts +49 -0
  130. package/dist/src/components/FileUpload/FileUploadContent.d.ts +20 -0
  131. package/dist/src/components/FileUpload/constants/ExpertiseLevelEnum.d.ts +4 -0
  132. package/dist/src/components/FileUpload/locales.d.ts +9 -0
  133. package/dist/src/components/FileUpload/tests/FileUpload.spec.d.ts +1 -0
  134. package/dist/src/components/FileUpload/useFileDrop.d.ts +2 -0
  135. package/dist/src/components/FileUpload/validateFiles.d.ts +4 -0
  136. package/dist/src/components/FilterInline/FilterInline.d.ts +28 -0
  137. package/dist/src/components/FilterInline/locales.d.ts +3 -0
  138. package/dist/src/components/FilterInline/tests/FilterInline.spec.d.ts +1 -0
  139. package/dist/src/components/FooterBar/A11yCompliance.d.ts +3 -0
  140. package/dist/src/components/FooterBar/AccessibiliteItems.d.ts +110 -0
  141. package/dist/src/components/FooterBar/FooterBar.d.ts +57 -0
  142. package/dist/src/components/FooterBar/config.d.ts +18 -0
  143. package/dist/src/components/FooterBar/constants/ExpertiseLevelEnum.d.ts +4 -0
  144. package/dist/src/components/FooterBar/defaultSocialMediaLinks.d.ts +2 -0
  145. package/dist/src/components/FooterBar/locales.d.ts +11 -0
  146. package/dist/src/components/FooterBar/tests/FooterBar.spec.d.ts +1 -0
  147. package/dist/src/components/FooterBar/tests/FooterBarConfig.spec.d.ts +1 -0
  148. package/dist/src/components/FooterBar/types.d.ts +9 -0
  149. package/dist/src/components/FranceConnectBtn/AccessibiliteItems.d.ts +45 -0
  150. package/dist/src/components/FranceConnectBtn/FranceConnectBtn.d.ts +10 -0
  151. package/dist/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.d.ts +4 -0
  152. package/dist/src/components/FranceConnectBtn/locales.d.ts +4 -0
  153. package/dist/src/components/FranceConnectBtn/tests/FranceConnectBtn.spec.d.ts +1 -0
  154. package/dist/src/components/HeaderBar/AccessibiliteItems.d.ts +91 -0
  155. package/dist/src/components/HeaderBar/HeaderBar.d.ts +67 -0
  156. package/dist/src/components/HeaderBar/HeaderBurgerMenu/AccessibiliteItems.d.ts +77 -0
  157. package/dist/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.d.ts +67 -0
  158. package/dist/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.d.ts +9 -0
  159. package/dist/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/tests/HeaderMenuItem.spec.d.ts +1 -0
  160. package/dist/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.d.ts +13 -0
  161. package/dist/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/tests/HeaderMenuSection.spec.d.ts +1 -0
  162. package/dist/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.d.ts +10 -0
  163. package/dist/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/tests/HeaderSubMenu.spec.d.ts +1 -0
  164. package/dist/src/components/HeaderBar/HeaderBurgerMenu/constants/ExpertiseLevelEnum.d.ts +4 -0
  165. package/dist/src/components/HeaderBar/HeaderBurgerMenu/conts.d.ts +1 -0
  166. package/dist/src/components/HeaderBar/HeaderBurgerMenu/locals.d.ts +5 -0
  167. package/dist/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.d.ts +1 -0
  168. package/dist/src/components/HeaderBar/HeaderBurgerMenu/tests/useHandleSubMenus.spec.d.ts +1 -0
  169. package/dist/src/components/HeaderBar/HeaderBurgerMenu/useHandleSubMenus.d.ts +4 -0
  170. package/dist/src/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +31 -0
  171. package/dist/src/components/HeaderBar/HeaderLogo/locales.d.ts +3 -0
  172. package/dist/src/components/HeaderBar/HeaderLogo/logos/Logo-mobile.d.ts +2 -0
  173. package/dist/src/components/HeaderBar/HeaderLogo/logos/Logo.d.ts +2 -0
  174. package/dist/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.d.ts +1 -0
  175. package/dist/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.d.ts +14 -0
  176. package/dist/src/components/HeaderBar/HeaderMenuBtn/locals.d.ts +5 -0
  177. package/dist/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.d.ts +1 -0
  178. package/dist/src/components/HeaderBar/constants/ExpertiseLevelEnum.d.ts +4 -0
  179. package/dist/src/components/HeaderBar/consts.d.ts +2 -0
  180. package/dist/src/components/HeaderBar/locales.d.ts +3 -0
  181. package/dist/src/components/HeaderBar/tests/HeaderBar.spec.d.ts +1 -0
  182. package/dist/src/components/HeaderBar/tests/useHeaderResponsiveMode.spec.d.ts +1 -0
  183. package/dist/src/components/HeaderBar/tests/useScrollDirection.spec.d.ts +1 -0
  184. package/dist/src/components/HeaderBar/useHeaderResponsiveMode.d.ts +3 -0
  185. package/dist/src/components/HeaderBar/useScrollDirection.d.ts +3 -0
  186. package/dist/src/components/HeaderLoading/AccessibiliteItems.d.ts +16 -0
  187. package/dist/src/components/HeaderLoading/HeaderLoading.d.ts +23 -0
  188. package/dist/src/components/HeaderLoading/constants/ExpertiseLevelEnum.d.ts +4 -0
  189. package/dist/src/components/HeaderLoading/tests/HeaderLoading.spec.d.ts +1 -0
  190. package/dist/src/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +84 -0
  191. package/dist/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +20 -0
  192. package/dist/src/components/HeaderNavigationBar/HorizontalNavbar/config.d.ts +16 -0
  193. package/dist/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.d.ts +1 -0
  194. package/dist/src/components/HeaderNavigationBar/types.d.ts +6 -0
  195. package/dist/src/components/HeaderToolbar/AccessibiliteItems.d.ts +46 -0
  196. package/dist/src/components/HeaderToolbar/HeaderToolbar.d.ts +103 -0
  197. package/dist/src/components/HeaderToolbar/constants/ExpertiseLevelEnum.d.ts +4 -0
  198. package/dist/src/components/HeaderToolbar/tests/HeaderToolbar.spec.d.ts +1 -0
  199. package/dist/src/components/HeaderToolbar/types.d.ts +19 -0
  200. package/dist/src/components/LangBtn/AccessibiliteItems.d.ts +16 -0
  201. package/dist/src/components/LangBtn/LangBtn.d.ts +31 -0
  202. package/dist/src/components/LangBtn/config.d.ts +15 -0
  203. package/dist/src/components/LangBtn/constants/ExpertiseLevelEnum.d.ts +4 -0
  204. package/dist/src/components/LangBtn/locales.d.ts +3 -0
  205. package/dist/src/components/LangBtn/tests/Config.spec.d.ts +1 -0
  206. package/dist/src/components/LangBtn/tests/LangBtn.spec.d.ts +1 -0
  207. package/dist/src/components/LangBtn/types.d.ts +7 -0
  208. package/dist/src/components/Logo/AccessibiliteItems.d.ts +65 -0
  209. package/dist/src/components/Logo/Logo.d.ts +71 -0
  210. package/dist/src/components/Logo/LogoSize.d.ts +6 -0
  211. package/dist/src/components/Logo/constants/ExpertiseLevelEnum.d.ts +4 -0
  212. package/dist/src/components/Logo/locales.d.ts +6 -0
  213. package/dist/src/components/Logo/logoDimensionsMapping.d.ts +3 -0
  214. package/dist/src/components/Logo/tests/Logo.spec.d.ts +1 -0
  215. package/dist/src/components/Logo/types.d.ts +7 -0
  216. package/dist/src/components/LogoBrandSection/AccessibiliteItems.d.ts +91 -0
  217. package/dist/src/components/LogoBrandSection/LogoBrandSection.d.ts +38 -0
  218. package/dist/src/components/LogoBrandSection/constants/ExpertiseLevelEnum.d.ts +4 -0
  219. package/dist/src/components/LogoBrandSection/dividerDimensionsMapping.d.ts +14 -0
  220. package/dist/src/components/LogoBrandSection/locales.d.ts +14 -0
  221. package/dist/src/components/LogoBrandSection/secondaryLogoMapping.d.ts +18 -0
  222. package/dist/src/components/LogoBrandSection/tests/LogoBrandSection.spec.d.ts +1 -0
  223. package/dist/src/components/LogoBrandSection/types.d.ts +1 -0
  224. package/dist/src/components/MaintenancePage/AccessibiliteItems.d.ts +65 -0
  225. package/dist/src/components/MaintenancePage/MaintenancePage.d.ts +2 -0
  226. package/dist/src/components/MaintenancePage/constants/ExpertiseLevelEnum.d.ts +4 -0
  227. package/dist/src/components/MaintenancePage/index.d.ts +2 -0
  228. package/dist/src/components/MaintenancePage/locales.d.ts +4 -0
  229. package/dist/src/components/MaintenancePage/tests/MaintenancePage.spec.d.ts +1 -0
  230. package/dist/src/components/NirField/AccessibiliteItems.d.ts +79 -0
  231. package/dist/src/components/NirField/config.d.ts +15 -0
  232. package/dist/src/components/NirField/constants/ExpertiseLevelEnum.d.ts +4 -0
  233. package/dist/src/components/NirField/locales.d.ts +12 -0
  234. package/dist/src/components/NirField/nirValidation.d.ts +5 -0
  235. package/dist/src/components/NirField/tests/NirField.spec.d.ts +1 -0
  236. package/dist/src/components/NotFoundPage/AccessibiliteItems.d.ts +65 -0
  237. package/dist/src/components/NotFoundPage/NotFoundPage.d.ts +14 -0
  238. package/dist/src/components/NotFoundPage/constants/ExpertiseLevelEnum.d.ts +4 -0
  239. package/dist/src/components/NotFoundPage/locales.d.ts +6 -0
  240. package/dist/src/components/NotFoundPage/tests/NotFoundPage.spec.d.ts +1 -0
  241. package/dist/src/components/NotificationBar/AccessibiliteItems.d.ts +29 -0
  242. package/dist/src/components/NotificationBar/NotificationBar.d.ts +37 -0
  243. package/dist/src/components/NotificationBar/constants/ExpertiseLevelEnum.d.ts +4 -0
  244. package/dist/src/components/NotificationBar/options.d.ts +13 -0
  245. package/dist/src/components/NotificationBar/tests/NotificationBar.spec.d.ts +1 -0
  246. package/dist/src/components/NotificationBar/types.d.ts +7 -0
  247. package/dist/src/components/PageContainer/AccessibiliteItems.d.ts +29 -0
  248. package/dist/src/components/PageContainer/PageContainer.d.ts +21 -0
  249. package/dist/src/components/PageContainer/constants/ExpertiseLevelEnum.d.ts +4 -0
  250. package/dist/src/components/PageContainer/tests/PageContainer.spec.d.ts +1 -0
  251. package/dist/src/components/PaginatedTable/AccessibiliteItems.d.ts +97 -0
  252. package/dist/src/components/PaginatedTable/PaginatedTable.d.ts +57 -0
  253. package/dist/src/components/PaginatedTable/constants/ExpertiseLevelEnum.d.ts +4 -0
  254. package/dist/src/components/PaginatedTable/constants/StateEnum.d.ts +6 -0
  255. package/dist/src/components/PaginatedTable/tests/PaginatedTable.spec.d.ts +1 -0
  256. package/dist/src/components/PaginatedTable/types.d.ts +26 -0
  257. package/dist/src/components/PasswordField/AccessibiliteItems.d.ts +54 -0
  258. package/dist/src/components/PasswordField/PasswordField.d.ts +25 -0
  259. package/dist/src/components/PasswordField/config.d.ts +9 -0
  260. package/dist/src/components/PasswordField/constants/ExpertiseLevelEnum.d.ts +4 -0
  261. package/dist/src/components/PasswordField/locales.d.ts +4 -0
  262. package/dist/src/components/PasswordField/tests/PasswordField.spec.d.ts +1 -0
  263. package/dist/src/components/PeriodField/AccessibiliteItems.d.ts +54 -0
  264. package/dist/src/components/PeriodField/PeriodField.d.ts +1381 -0
  265. package/dist/src/components/PeriodField/constants/ExpertiseLevelEnum.d.ts +4 -0
  266. package/dist/src/components/PeriodField/tests/PeriodField.spec.d.ts +1 -0
  267. package/dist/src/components/PhoneField/AccessibiliteItems.d.ts +94 -0
  268. package/dist/src/components/PhoneField/PhoneField.d.ts +129 -0
  269. package/dist/src/components/PhoneField/constants/ExpertiseLevelEnum.d.ts +4 -0
  270. package/dist/src/components/PhoneField/indicatifs.d.ts +7 -0
  271. package/dist/src/components/PhoneField/locales.d.ts +4 -0
  272. package/dist/src/components/PhoneField/tests/PhoneField.spec.d.ts +1 -0
  273. package/dist/src/components/RangeField/AccessibiliteItems.d.ts +54 -0
  274. package/dist/src/components/RangeField/RangeField.d.ts +19 -0
  275. package/dist/src/components/RangeField/RangeSlider/RangeSlider.d.ts +286 -0
  276. package/dist/src/components/RangeField/RangeSlider/Tooltip/Tooltip.d.ts +20 -0
  277. package/dist/src/components/RangeField/RangeSlider/tests/rangeSlider.spec.d.ts +1 -0
  278. package/dist/src/components/RangeField/RangeSlider/tests/useDoubleSlider.spec.d.ts +1 -0
  279. package/dist/src/components/RangeField/RangeSlider/tests/useMouseSlide.spec.d.ts +1 -0
  280. package/dist/src/components/RangeField/RangeSlider/tests/useThumb.spec.d.ts +1 -0
  281. package/dist/src/components/RangeField/RangeSlider/tests/useThumbKeyboard.spec.d.ts +1 -0
  282. package/dist/src/components/RangeField/RangeSlider/tests/useTooltipsNudge.spec.d.ts +1 -0
  283. package/dist/src/components/RangeField/RangeSlider/tests/useTrack.spec.d.ts +1 -0
  284. package/dist/src/components/RangeField/RangeSlider/tests/vAnimateClick.spec.d.ts +1 -0
  285. package/dist/src/components/RangeField/RangeSlider/types.d.ts +13 -0
  286. package/dist/src/components/RangeField/RangeSlider/useMouseSlide.d.ts +18 -0
  287. package/dist/src/components/RangeField/RangeSlider/useRangeSlider.d.ts +17 -0
  288. package/dist/src/components/RangeField/RangeSlider/useThumb.d.ts +6 -0
  289. package/dist/src/components/RangeField/RangeSlider/useThumbKeyboard.d.ts +12 -0
  290. package/dist/src/components/RangeField/RangeSlider/useTooltipsNudge.d.ts +16 -0
  291. package/dist/src/components/RangeField/RangeSlider/useTrack.d.ts +13 -0
  292. package/dist/src/components/RangeField/RangeSlider/vAnimateClick.d.ts +3 -0
  293. package/dist/src/components/RangeField/config.d.ts +6 -0
  294. package/dist/src/components/RangeField/constants/ExpertiseLevelEnum.d.ts +4 -0
  295. package/dist/src/components/RangeField/locales.d.ts +4 -0
  296. package/dist/src/components/RangeField/tests/RangeField.spec.d.ts +1 -0
  297. package/dist/src/components/RatingPicker/AccessibiliteItems.d.ts +80 -0
  298. package/dist/src/components/RatingPicker/EmotionPicker/EmotionPicker.d.ts +65 -0
  299. package/dist/src/components/RatingPicker/EmotionPicker/locales.d.ts +3 -0
  300. package/dist/src/components/RatingPicker/EmotionPicker/tests/EmotionPicker.spec.d.ts +1 -0
  301. package/dist/src/components/RatingPicker/NumberPicker/NumberPicker.d.ts +64 -0
  302. package/dist/src/components/RatingPicker/NumberPicker/locales.d.ts +3 -0
  303. package/dist/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.d.ts +1 -0
  304. package/dist/src/components/RatingPicker/Rating.d.ts +25 -0
  305. package/dist/src/components/RatingPicker/RatingPicker.d.ts +82 -0
  306. package/dist/src/components/RatingPicker/StarsPicker/StarsPicker.d.ts +54 -0
  307. package/dist/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.d.ts +1 -0
  308. package/dist/src/components/RatingPicker/constants/ExpertiseLevelEnum.d.ts +4 -0
  309. package/dist/src/components/RatingPicker/locales.d.ts +3 -0
  310. package/dist/src/components/RatingPicker/tests/Rating.spec.d.ts +1 -0
  311. package/dist/src/components/RatingPicker/tests/RatingPicker.spec.d.ts +1 -0
  312. package/dist/src/components/SearchListField/AccessibiliteItems.d.ts +90 -0
  313. package/dist/src/components/SearchListField/SearchListField.d.ts +42 -0
  314. package/dist/src/components/SearchListField/constants/ExpertiseLevelEnum.d.ts +4 -0
  315. package/dist/src/components/SearchListField/locales.d.ts +5 -0
  316. package/dist/src/components/SearchListField/tests/SearchListField.spec.d.ts +1 -0
  317. package/dist/src/components/SearchListField/types.d.ts +4 -0
  318. package/dist/src/components/SelectBtnField/AccessibiliteItems.d.ts +79 -0
  319. package/dist/src/components/SelectBtnField/SelectBtnField.d.ts +33 -0
  320. package/dist/src/components/SelectBtnField/config.d.ts +11 -0
  321. package/dist/src/components/SelectBtnField/constants/ExpertiseLevelEnum.d.ts +4 -0
  322. package/dist/src/components/SelectBtnField/tests/SelectBtnField.spec.d.ts +1 -0
  323. package/dist/src/components/SelectBtnField/types.d.ts +11 -0
  324. package/dist/src/components/SkipLink/AccessibiliteItems.d.ts +16 -0
  325. package/dist/src/components/SkipLink/SkipLink.d.ts +18 -0
  326. package/dist/src/components/SkipLink/constants/ExpertiseLevelEnum.d.ts +4 -0
  327. package/dist/src/components/SkipLink/locales.d.ts +3 -0
  328. package/dist/src/components/SkipLink/tests/skipLink.spec.d.ts +1 -0
  329. package/dist/src/components/SocialMediaLinks/AccessibiliteItems.d.ts +46 -0
  330. package/dist/src/components/SocialMediaLinks/DefaultSocialMediaLinks.d.ts +2 -0
  331. package/dist/src/components/SocialMediaLinks/SocialMediaLinks.d.ts +16 -0
  332. package/dist/src/components/SocialMediaLinks/constants/ExpertiseLevelEnum.d.ts +4 -0
  333. package/dist/src/components/SocialMediaLinks/locales.d.ts +3 -0
  334. package/dist/src/components/SocialMediaLinks/tests/DefaultSocialMediaLinks.spec.d.ts +1 -0
  335. package/dist/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.d.ts +1 -0
  336. package/dist/src/components/SocialMediaLinks/types.d.ts +5 -0
  337. package/dist/src/components/SubHeader/AccessibiliteItems.d.ts +29 -0
  338. package/dist/src/components/SubHeader/SubHeader.d.ts +40 -0
  339. package/dist/src/components/SubHeader/config.d.ts +11 -0
  340. package/dist/src/components/SubHeader/constants/ExpertiseLevelEnum.d.ts +4 -0
  341. package/dist/src/components/SubHeader/locales.d.ts +3 -0
  342. package/dist/src/components/SubHeader/tests/SubHeader.spec.d.ts +1 -0
  343. package/dist/src/components/SyAlert/AccessibiliteItems.d.ts +29 -0
  344. package/dist/src/components/SyAlert/SyAlert.d.ts +32 -0
  345. package/dist/src/components/SyAlert/constants/ExpertiseLevelEnum.d.ts +4 -0
  346. package/dist/src/components/SyAlert/locales.d.ts +3 -0
  347. package/dist/src/components/SyAlert/tests/SyAlert.spec.d.ts +1 -0
  348. package/dist/src/components/TableToolbar/AccessibiliteItems.d.ts +71 -0
  349. package/dist/src/components/TableToolbar/TableToolbar.d.ts +40 -0
  350. package/dist/src/components/TableToolbar/config.d.ts +24 -0
  351. package/dist/src/components/TableToolbar/constants/ExpertiseLevelEnum.d.ts +4 -0
  352. package/dist/src/components/TableToolbar/locales.d.ts +5 -0
  353. package/dist/src/components/TableToolbar/tests/TableToolbar.spec.d.ts +1 -0
  354. package/dist/src/components/UserMenuBtn/AccessibiliteItems.d.ts +54 -0
  355. package/dist/src/components/UserMenuBtn/UserMenuBtn.d.ts +32 -0
  356. package/dist/src/components/UserMenuBtn/config.d.ts +24 -0
  357. package/dist/src/components/UserMenuBtn/constants/ExpertiseLevelEnum.d.ts +4 -0
  358. package/dist/src/components/UserMenuBtn/tests/UserMenuBtn.spec.d.ts +1 -0
  359. package/dist/src/components/index.d.ts +63 -0
  360. package/dist/src/composables/index.d.ts +3 -0
  361. package/dist/src/composables/rules/tests/useFieldValidation.spec.d.ts +1 -0
  362. package/dist/src/composables/rules/useFieldValidation.d.ts +27 -0
  363. package/dist/src/composables/useCustomizableOptions.d.ts +13 -0
  364. package/dist/src/composables/useFilterable/useFilterable.d.ts +32 -0
  365. package/dist/src/composables/useFilterable/useFilterable.spec.d.ts +1 -0
  366. package/dist/src/composables/widthable/index.d.ts +13 -0
  367. package/dist/src/composables/widthable/tests/widthable.spec.d.ts +1 -0
  368. package/dist/src/constants/icons.d.ts +3 -0
  369. package/dist/src/designTokens/index.d.ts +9 -0
  370. package/dist/src/designTokens/tokens/cnam/cnamColors.d.ts +171 -0
  371. package/dist/src/designTokens/tokens/cnam/cnamContextual.d.ts +58 -0
  372. package/dist/src/designTokens/tokens/cnam/cnamDarkTheme.d.ts +3 -0
  373. package/dist/src/designTokens/tokens/cnam/cnamLightTheme.d.ts +90 -0
  374. package/dist/src/designTokens/tokens/cnam/cnamSemantic.d.ts +87 -0
  375. package/dist/src/designTokens/tokens/pa/paColors.d.ts +171 -0
  376. package/dist/src/designTokens/tokens/pa/paContextual.d.ts +58 -0
  377. package/dist/src/designTokens/tokens/pa/paDarkTheme.d.ts +3 -0
  378. package/dist/src/designTokens/tokens/pa/paLightTheme.d.ts +120 -0
  379. package/dist/src/designTokens/tokens/pa/paSemantic.d.ts +87 -0
  380. package/dist/src/designTokens/utils/convertGaps.d.ts +5 -0
  381. package/dist/src/designTokens/utils/convertSemanticsToken.d.ts +12 -0
  382. package/dist/src/designTokens/utils/createFlattenTheme.d.ts +7 -0
  383. package/dist/src/designTokens/utils/index.d.ts +3 -0
  384. package/dist/src/directives/clickOutside.d.ts +1 -0
  385. package/dist/src/main.d.ts +3 -0
  386. package/dist/src/modules.d.ts +4 -0
  387. package/dist/src/services/NotificationService.d.ts +19 -0
  388. package/dist/src/services/index.d.ts +1 -0
  389. package/dist/src/stories/Accessibilite/Vuetify/VuetifyItems.d.ts +58 -0
  390. package/dist/src/stories/EcoConception/ecoDesignItems.d.ts +4 -0
  391. package/dist/src/types/vuetifyTypes.d.ts +3 -0
  392. package/dist/src/utils/calcHumanFileSize/index.d.ts +2 -0
  393. package/dist/src/utils/calcHumanFileSize/tests/calcHumanFileSize.spec.d.ts +1 -0
  394. package/dist/src/utils/convertToUnit/index.d.ts +2 -0
  395. package/dist/src/utils/convertToUnit/test/convertToUnit.spec.d.ts +1 -0
  396. package/dist/src/utils/functions/copyToClipboard/index.d.ts +2 -0
  397. package/dist/src/utils/functions/copyToClipboard/tests/copyToClipboard.spec.d.ts +1 -0
  398. package/dist/src/utils/functions/deepCopy/index.d.ts +4 -0
  399. package/dist/src/utils/functions/deepCopy/tests/deepCopy.spec.d.ts +1 -0
  400. package/dist/src/utils/functions/downloadFile/index.d.ts +3 -0
  401. package/dist/src/utils/functions/downloadFile/tests/downloadFile.spec.d.ts +1 -0
  402. package/dist/src/utils/functions/downloadFile/types.d.ts +1 -0
  403. package/dist/src/utils/functions/isEmailValid/index.d.ts +4 -0
  404. package/dist/src/utils/functions/isEmailValid/tests/isEmailValid.spec.d.ts +1 -0
  405. package/dist/src/utils/functions/throttleDisplayFn/tests/throttleDisplayFn.spec.d.ts +1 -0
  406. package/dist/src/utils/functions/throttleDisplayFn/throttleDisplayFn.d.ts +4 -0
  407. package/dist/src/utils/localStorageUtility/index.d.ts +28 -0
  408. package/dist/src/utils/localStorageUtility/tests/localStorageUtility.spec.d.ts +1 -0
  409. package/dist/src/utils/propValidator/index.d.ts +2 -0
  410. package/dist/src/utils/propValidator/tests/propValidator.spec.d.ts +1 -0
  411. package/dist/src/utils/ruleMessage/index.d.ts +3 -0
  412. package/dist/src/utils/ruleMessage/tests/ruleMessages.spec.d.ts +1 -0
  413. package/dist/src/utils/rules/email/index.d.ts +4 -0
  414. package/dist/src/utils/rules/email/locales.d.ts +2 -0
  415. package/dist/src/utils/rules/email/tests/email.spec.d.ts +1 -0
  416. package/dist/src/utils/rules/exactLength/index.d.ts +4 -0
  417. package/dist/src/utils/rules/exactLength/locales.d.ts +2 -0
  418. package/dist/src/utils/rules/required/index.d.ts +4 -0
  419. package/dist/src/utils/rules/required/locales.d.ts +2 -0
  420. package/dist/src/utils/rules/required/ruleMessageHelper.d.ts +3 -0
  421. package/dist/src/utils/rules/required/tests/index.spec.d.ts +1 -0
  422. package/dist/src/utils/rules/required/tests/rulesMessageHelper.spec.d.ts +1 -0
  423. package/dist/src/utils/rules/types.d.ts +15 -0
  424. package/dist/style.css +1 -1
  425. package/package.json +23 -21
  426. package/src/assets/settings.scss +11 -0
  427. package/src/components/BackBtn/Usages.mdx +9 -0
  428. package/src/components/BackBtn/Usages.stories.ts +37 -0
  429. package/src/components/BackToTopBtn/Usages.mdx +9 -0
  430. package/src/components/BackToTopBtn/Usages.stories.ts +41 -0
  431. package/src/components/ChipList/Accessibilite.mdx +14 -0
  432. package/src/components/ChipList/Accessibilite.stories.ts +216 -0
  433. package/src/components/ChipList/AccessibiliteItems.ts +119 -0
  434. package/src/components/ChipList/ChipList.mdx +59 -0
  435. package/src/components/ChipList/ChipList.stories.ts +1257 -0
  436. package/src/components/ChipList/ChipList.vue +246 -0
  437. package/src/components/ChipList/config.ts +27 -0
  438. package/src/{stories/Guidelines/Accessibilite → components/ChipList}/constants/ExpertiseLevelEnum.ts +0 -1
  439. package/src/components/ChipList/locales.ts +6 -0
  440. package/src/components/ChipList/tests/chipList.spec.ts +300 -0
  441. package/src/components/ChipList/types.ts +7 -0
  442. package/src/components/ContextualMenu/Usages.mdx +9 -0
  443. package/src/components/ContextualMenu/Usages.stories.ts +38 -0
  444. package/src/components/CopyBtn/Usages.mdx +9 -0
  445. package/src/components/CopyBtn/Usages.stories.ts +41 -0
  446. package/src/components/Customs/SySelect/SySelect.vue +4 -1
  447. package/src/components/Customs/SySelect/Usages.mdx +9 -0
  448. package/src/components/Customs/SySelect/Usages.stories.ts +41 -0
  449. package/src/components/Customs/SyTextField/SyTextField.mdx +21 -0
  450. package/src/components/Customs/SyTextField/SyTextField.stories.ts +402 -231
  451. package/src/components/Customs/SyTextField/SyTextField.vue +217 -19
  452. package/src/components/Customs/SyTextField/Usages.mdx +9 -0
  453. package/src/components/Customs/SyTextField/Usages.stories.ts +41 -0
  454. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +9 -8
  455. package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +23 -25
  456. package/src/components/DatePicker/DatePicker.mdx +37 -1
  457. package/src/components/DatePicker/DatePicker.stories.ts +374 -5
  458. package/src/components/DatePicker/DatePicker.vue +119 -47
  459. package/src/components/DatePicker/DateTextInput.vue +567 -290
  460. package/src/components/DatePicker/Usages.mdx +9 -0
  461. package/src/components/DatePicker/Usages.stories.ts +43 -0
  462. package/src/components/DatePicker/tests/DatePicker.spec.ts +5 -5
  463. package/src/components/DatePicker/tests/DateTextInput.spec.ts +282 -0
  464. package/src/components/DialogBox/DialogBox.mdx +1 -1
  465. package/src/components/DialogBox/Usages.mdx +9 -0
  466. package/src/components/DialogBox/Usages.stories.ts +45 -0
  467. package/src/components/ErrorPage/ErrorPage.mdx +1 -1
  468. package/src/components/ExternalLinks/Usages.mdx +9 -0
  469. package/src/components/ExternalLinks/Usages.stories.ts +40 -0
  470. package/src/components/FileList/Accessibilite.mdx +14 -0
  471. package/src/components/FileList/Accessibilite.stories.ts +216 -0
  472. package/src/components/FileList/AccessibiliteItems.ts +110 -0
  473. package/src/components/FileList/constants/ExpertiseLevelEnum.ts +4 -0
  474. package/src/components/FilePreview/Accessibilite.mdx +14 -0
  475. package/src/components/FilePreview/Accessibilite.stories.ts +216 -0
  476. package/src/components/FilePreview/AccessibiliteItems.ts +27 -0
  477. package/src/components/FilePreview/constants/ExpertiseLevelEnum.ts +4 -0
  478. package/src/components/FileUpload/Accessibilite.mdx +14 -0
  479. package/src/components/FileUpload/Accessibilite.stories.ts +216 -0
  480. package/src/components/FileUpload/AccessibiliteItems.ts +27 -0
  481. package/src/components/FileUpload/constants/ExpertiseLevelEnum.ts +4 -0
  482. package/src/components/FilterInline/FilterInline.mdx +91 -0
  483. package/src/components/FilterInline/FilterInline.stories.ts +406 -0
  484. package/src/components/FilterInline/FilterInline.vue +108 -0
  485. package/src/components/FilterInline/locales.ts +4 -0
  486. package/src/components/FilterInline/tests/FilterInline.spec.ts +68 -0
  487. package/src/components/FilterInline/tests/__snapshots__/FilterInline.spec.ts.snap +38 -0
  488. package/src/components/HeaderBar/Usages.mdx +7 -2
  489. package/src/components/HeaderBar/Usages.stories.ts +39 -0
  490. package/src/components/NirField/NirField.stories.ts +1 -1
  491. package/src/components/NirField/NirField.vue +10 -4
  492. package/src/components/NirField/Usages.mdx +9 -0
  493. package/src/components/NirField/Usages.stories.ts +42 -0
  494. package/src/components/NotificationBar/Usages.mdx +9 -0
  495. package/src/components/NotificationBar/Usages.stories.ts +41 -0
  496. package/src/components/PaginatedTable/Accessibilite.mdx +14 -0
  497. package/src/components/PaginatedTable/Accessibilite.stories.ts +216 -0
  498. package/src/components/PaginatedTable/AccessibiliteItems.ts +352 -0
  499. package/src/components/PaginatedTable/PaginatedTable.mdx +54 -0
  500. package/src/components/PaginatedTable/PaginatedTable.stories.ts +591 -0
  501. package/src/components/PaginatedTable/PaginatedTable.vue +243 -0
  502. package/src/components/PaginatedTable/constants/ExpertiseLevelEnum.ts +4 -0
  503. package/src/components/PaginatedTable/constants/StateEnum.ts +6 -0
  504. package/src/components/PaginatedTable/tests/PaginatedTable.spec.ts +257 -0
  505. package/src/components/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +249 -0
  506. package/src/components/PaginatedTable/types.ts +30 -0
  507. package/src/components/PeriodField/Accessibilite.mdx +14 -0
  508. package/src/components/PeriodField/Accessibilite.stories.ts +216 -0
  509. package/src/components/PeriodField/AccessibiliteItems.ts +269 -0
  510. package/src/components/PeriodField/PeriodField.vue +62 -77
  511. package/src/components/PeriodField/constants/ExpertiseLevelEnum.ts +4 -0
  512. package/src/components/PeriodField/tests/PeriodField.spec.ts +11 -19
  513. package/src/components/PhoneField/PhoneField.mdx +1 -1
  514. package/src/components/PhoneField/Usages.mdx +9 -0
  515. package/src/components/PhoneField/Usages.stories.ts +38 -0
  516. package/src/components/RangeField/RangeField.vue +0 -4
  517. package/src/components/SearchListField/SearchListField.mdx +1 -2
  518. package/src/components/SelectBtnField/Usages.mdx +9 -0
  519. package/src/components/SelectBtnField/Usages.stories.ts +40 -0
  520. package/src/components/SkipLink/Usages.mdx +9 -0
  521. package/src/components/SkipLink/Usages.stories.ts +41 -0
  522. package/src/components/SyAlert/Usages.mdx +9 -0
  523. package/src/components/SyAlert/Usages.stories.ts +40 -0
  524. package/src/components/TableToolbar/Accessibilite.mdx +14 -0
  525. package/src/components/TableToolbar/Accessibilite.stories.ts +216 -0
  526. package/src/components/TableToolbar/AccessibiliteItems.ts +283 -0
  527. package/src/components/TableToolbar/constants/ExpertiseLevelEnum.ts +4 -0
  528. package/src/components/Usages/Usages.vue +95 -0
  529. package/src/components/index.ts +3 -0
  530. package/src/composables/rules/useFieldValidation.ts +84 -12
  531. package/src/composables/useFilterable/__snapshots__/useFilterable.spec.ts.snap +3 -0
  532. package/src/composables/useFilterable/useFilterable.spec.ts +635 -0
  533. package/src/composables/useFilterable/useFilterable.ts +196 -0
  534. package/src/constants/icons.ts +5 -0
  535. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +3 -3
  536. package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +63 -0
  537. package/src/stories/Accessibilite/Audit/RGAA.mdx +29 -0
  538. package/src/stories/Accessibilite/Introduction.mdx +27 -0
  539. package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +40 -0
  540. package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +32 -0
  541. package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +33 -0
  542. package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru.mdx +33 -0
  543. package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +100 -0
  544. package/src/stories/{Guidelines → Accessibilite}/Vuetify/Vuetify.mdx +1 -1
  545. package/src/stories/{Guidelines → Accessibilite}/Vuetify/Vuetify.stories.ts +1 -1
  546. package/src/stories/Components/Components.mdx +8 -0
  547. package/src/stories/Components/Components.stories.ts +398 -0
  548. package/src/stories/Demarrer/Accueil.mdx +8 -3
  549. package/src/stories/Demarrer/Accueil.stories.ts +126 -16
  550. package/src/stories/Demarrer/Introduction.mdx +12 -0
  551. package/src/stories/Demarrer/Introduction.stories.ts +151 -0
  552. package/src/stories/{GuideDuDev → Demarrer}/components.stories.ts +2 -2
  553. package/src/stories/{Fondamentaux → DesignTokens}/Arrondis.mdx +1 -1
  554. package/src/stories/{Fondamentaux → DesignTokens}/Colors.mdx +4 -4
  555. package/src/stories/DesignTokens/Conteneurs.mdx +18 -0
  556. package/src/stories/DesignTokens/Conteneurs.stories.ts +103 -0
  557. package/src/stories/{Fondamentaux → DesignTokens}/Elevations.mdx +1 -1
  558. package/src/stories/{Fondamentaux → DesignTokens}/Espacements.mdx +1 -1
  559. package/src/stories/{Fondamentaux → DesignTokens}/Introduction.mdx +1 -1
  560. package/src/stories/{Fondamentaux → DesignTokens}/StylesTypographiques.mdx +1 -1
  561. package/src/stories/{Fondamentaux/CustomisationEtThemes.mdx → DesignTokens/ThemePA.mdx} +6 -2
  562. package/src/stories/{Fondamentaux → DesignTokens}/Typographie.mdx +14 -1
  563. package/src/stories/{Guidelines/EcoConception/EcoConception.mdx → EcoConception/Introduction.mdx} +2 -2
  564. package/src/stories/{Guidelines/EcoConception/Econception.stories.ts → EcoConception/econception.stories.ts} +2 -2
  565. package/src/stories/GuideDuDev/MigrationDepuisBridge.mdx +432 -0
  566. package/src/stories/GuideDuDev/MigrationDepuisVue2.mdx +415 -0
  567. package/src/stories/GuideDuDev/UtiliserLesRules.mdx +1 -13
  568. package/src/stories/Templates/Templates.mdx +8 -0
  569. package/src/stories/Templates/Templates.stories.ts +85 -0
  570. package/src/utils/functions/deepCopy/index.ts +20 -0
  571. package/src/utils/functions/deepCopy/tests/deepCopy.spec.ts +58 -0
  572. package/src/utils/functions/isEmailValid/index.ts +8 -0
  573. package/src/utils/functions/isEmailValid/tests/isEmailValid.spec.ts +22 -0
  574. package/src/utils/localStorageUtility/index.ts +201 -0
  575. package/src/utils/localStorageUtility/tests/localStorageUtility.spec.ts +180 -0
  576. package/src/utils/ruleMessage/index.ts +14 -0
  577. package/src/utils/ruleMessage/tests/ruleMessages.spec.ts +28 -0
  578. package/src/utils/rules/email/index.ts +26 -0
  579. package/src/utils/rules/email/locales.ts +5 -0
  580. package/src/utils/rules/email/tests/email.spec.ts +24 -0
  581. package/dist/design-system-v3.d.ts +0 -2925
  582. package/src/stories/Fondamentaux/Conteneurs.mdx +0 -7
  583. package/src/stories/Guidelines/Accessibilite/Accessibilite.mdx +0 -51
  584. package/src/stories/Guidelines/Accessibilite/Accessibilite.stories.ts +0 -36
  585. package/src/stories/Guidelines/Accessibilite/AccessibiliteItems.ts +0 -706
  586. package/src/stories/Guidelines/Accessibilite/constants/RGAALevelEnum.ts +0 -4
  587. /package/src/stories/{Guidelines → Accessibilite}/Vuetify/VuetifyItems.ts +0 -0
  588. /package/src/stories/{GuideDuDev → Demarrer}/CreerUneIssue.mdx +0 -0
  589. /package/src/stories/{Guidelines/EcoConception → EcoConception}/ecoDesignItems.ts +0 -0
@@ -1,409 +1,686 @@
1
1
  <script lang="ts" setup>
2
- import { computed, ref, watch, onMounted } from 'vue'
3
- import SyTextField from '../Customs/SyTextField/SyTextField.vue'
2
+ import { ref, computed, watch, onMounted } from 'vue'
3
+ import { nextTick } from 'vue'
4
+ import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
4
5
  import { useFieldValidation } from '@/composables/rules/useFieldValidation'
5
6
  import type { RuleOptions } from '@/composables/rules/useFieldValidation'
6
7
 
7
- // Type pour les valeurs de date
8
- type DateValue = string | [string, string]
8
+ type DateValue = string | null
9
9
 
10
10
  const props = withDefaults(defineProps<{
11
11
  modelValue?: DateValue
12
- displayFormat?: string
13
- returnFormat?: string
14
- range?: boolean
15
12
  placeholder?: string
16
- rules?: { type: string, options: RuleOptions }[]
17
- warningRules?: { type: string, options: RuleOptions }[]
13
+ format?: string
14
+ dateFormatReturn?: string
15
+ label?: string
18
16
  required?: boolean
17
+ isDisabled?: boolean
18
+ isReadOnly?: boolean
19
+ isOutlined?: boolean
20
+ displayIcon?: boolean
21
+ displayAppendIcon?: boolean
22
+ noIcon?: boolean
23
+ customRules?: { type: string, options: RuleOptions }[]
24
+ customWarningRules?: { type: string, options: RuleOptions }[]
25
+ displayPrependIcon?: boolean
19
26
  }>(), {
20
- modelValue: undefined,
21
- displayFormat: 'DD/MM/YYYY',
22
- returnFormat: '',
23
- range: false,
24
- placeholder: '',
25
- rules: () => [],
26
- warningRules: () => [],
27
+ modelValue: null,
28
+ placeholder: 'Sélectionner une date',
29
+ format: 'DD/MM/YYYY',
30
+ dateFormatReturn: undefined,
31
+ label: undefined,
27
32
  required: false,
33
+ isDisabled: false,
34
+ isReadOnly: false,
35
+ isOutlined: true,
36
+ displayIcon: true,
37
+ displayAppendIcon: false,
38
+ noIcon: false,
39
+ customRules: () => [],
40
+ customWarningRules: () => [],
41
+ displayPrependIcon: true,
28
42
  })
29
43
 
30
44
  const emit = defineEmits<{
31
- (e: 'update:modelValue', value: DateValue): void
45
+ (e: 'update:model-value', value: DateValue): void
46
+ (e: 'focus'): void
47
+ (e: 'blur'): void
32
48
  }>()
33
49
 
34
- const inputValue = ref('')
35
-
36
- const { generateRules } = useFieldValidation()
37
-
38
- // Règles de validation
39
- const validationRules = computed(() => generateRules(props.rules || []))
40
- const warningValidationRules = computed(() => generateRules(props.warningRules || []))
41
-
42
- // États de validation
43
- const hasError = ref(false)
44
- const hasWarning = ref(false)
45
- const hasSuccess = ref(false)
50
+ const inputValue = ref<string>('')
51
+ const isFocused = ref(false)
52
+ const hasInteracted = ref(false)
46
53
  const errorMessages = ref<string[]>([])
47
54
  const warningMessages = ref<string[]>([])
48
55
  const successMessages = ref<string[]>([])
49
56
 
50
- // Valider le champ
51
- const validateField = () => {
52
- // Réinitialiser les états
53
- errorMessages.value = []
54
- warningMessages.value = []
55
- successMessages.value = []
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(/[-/.]/)
56
61
 
57
- if (props.required && !inputValue.value) {
58
- errorMessages.value.push('La date est requise.')
59
- hasError.value = true
60
- return
62
+ if (parts.length !== formatParts.length) {
63
+ return null
61
64
  }
62
65
 
63
- if (inputValue.value) {
64
- if (props.range) {
65
- // Pour une plage, valider chaque date séparément
66
- const [start, end] = inputValue.value.split('-').map(d => d.trim())
67
- if (start && isValidDate(start)) {
68
- // Validation des erreurs et succès pour la date de début
69
- addMessages(start, validationRules.value, 'error')
70
- addMessages(start, validationRules.value, 'success')
71
- // Validation des warnings pour la date de début
72
- addMessages(start, warningValidationRules.value, 'warning')
73
- }
66
+ let day = 1, month = 0, year = 1970
74
67
 
75
- if (end && isValidDate(end)) {
76
- // Validation des erreurs et succès pour la date de fin
77
- addMessages(end, validationRules.value, 'error')
78
- addMessages(end, validationRules.value, 'success')
79
- // Validation des warnings pour la date de fin
80
- addMessages(end, warningValidationRules.value, 'warning')
81
-
82
- // Valider que la date de fin est après la date de début
83
- if (start && isValidDate(start)) {
84
- const startDate = parseDate(start, props.displayFormat)
85
- const endDate = parseDate(end, props.displayFormat)
86
- if (startDate && endDate && endDate < startDate) {
87
- errorMessages.value.push('La date de fin doit être après la date de début')
88
- }
89
- }
90
- }
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
91
73
  }
92
- else {
93
- // Validation pour une date simple
94
- addMessages(inputValue.value, validationRules.value, 'error')
95
- addMessages(inputValue.value, validationRules.value, 'success')
96
- addMessages(inputValue.value, warningValidationRules.value, 'warning')
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
97
88
  }
98
89
  }
99
90
 
100
- // Mettre à jour les états
101
- hasError.value = errorMessages.value.length > 0
102
- hasWarning.value = warningMessages.value.length > 0
103
- hasSuccess.value = successMessages.value.length > 0 && !hasError.value && !hasWarning.value
104
- }
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
105
95
 
106
- // Fonction pour ajouter les messages
107
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
108
- const addMessages = (value: string, rules: any[], messageType: 'error' | 'warning' | 'success') => {
109
- if (!value) return
110
-
111
- // Convertir la date au format YYYY-MM-DD pour la validation
112
- const validationValue = toValidationFormat(value)
113
- if (!validationValue) return
114
-
115
- rules.forEach((rule) => {
116
- const result = rule(validationValue)
117
- if (result) {
118
- const targetMessages = messageType === 'error'
119
- ? errorMessages
120
- : messageType === 'warning'
121
- ? warningMessages
122
- : successMessages
123
- if (result[messageType]) {
124
- targetMessages.value.push(result[messageType])
125
- targetMessages.value = [...new Set(targetMessages.value)]
126
- }
127
- }
128
- })
129
- }
96
+ const date = new Date(year, month, day)
130
97
 
131
- // Convert a date string to YYYY-MM-DD format for validation
132
- const toValidationFormat = (dateStr: string): string => {
133
- if (!dateStr) return ''
134
- const date = parseDate(dateStr, 'DD/MM/YYYY')
135
- if (!date) return dateStr
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
+ }
136
102
 
137
- // Formatter en YYYY-MM-DD
138
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
103
+ return date
139
104
  }
140
105
 
141
- // Fonction pour parser les dates selon le format spécifié
142
- const parseDate = (dateStr: string, format: string): Date | null => {
143
- const formatParts = format.split(/[^A-Z]/)
144
- const dateParts = dateStr.split(/[^0-9]/)
106
+ // Fonction pour formater une date en chaîne selon le format spécifié
107
+ const formatDateToString = (date: Date, format: string): string => {
108
+ const day = date.getDate().toString().padStart(2, '0')
109
+ const month = (date.getMonth() + 1).toString().padStart(2, '0')
110
+ const year = date.getFullYear()
111
+ const shortYear = (year % 100).toString().padStart(2, '0')
145
112
 
146
- if (dateParts.length !== formatParts.length) return null
147
-
148
- let day = 1, month = 0, year = 2000
149
-
150
- for (let i = 0; i < formatParts.length; i++) {
151
- const value = parseInt(dateParts[i])
152
- if (isNaN(value)) return null
113
+ const separator = format.includes('/') ? '/' : format.includes('-') ? '-' : '.'
114
+ const parts: string[] = []
153
115
 
154
- switch (formatParts[i]) {
116
+ format.split(/[-/.]/).forEach((part) => {
117
+ switch (part.toUpperCase()) {
155
118
  case 'DD':
156
- day = value
119
+ parts.push(day)
157
120
  break
158
121
  case 'MM':
159
- month = value - 1 // JavaScript months are 0-based
122
+ parts.push(month)
160
123
  break
161
- case 'YYYY':
162
124
  case 'YY':
163
- year = value
164
- if (formatParts[i] === 'YY') {
165
- const currentYear = new Date().getFullYear()
166
- const currentCentury = Math.floor(currentYear / 100) * 100
167
- year = currentCentury + value
168
- }
125
+ parts.push(shortYear)
126
+ break
127
+ case 'YYYY':
128
+ parts.push(year.toString())
169
129
  break
170
130
  }
171
- }
131
+ })
172
132
 
173
- const date = new Date(year, month, day)
174
- return date.getFullYear() === year && date.getMonth() === month && date.getDate() === day ? date : null
133
+ return parts.join(separator)
175
134
  }
176
135
 
177
- // Convert between different date formats
178
- const convertDateFormat = (dateStr: string, fromFormat: string, toFormat: string): string => {
179
- if (!dateStr) return ''
136
+ // Fonction pour formater la date pendant la saisie
137
+ const formatDateInput = (input: string, cursorPosition?: number): { formatted: string, cursorPos: number } => {
138
+ const separator = props.format.includes('/') ? '/' : props.format.includes('-') ? '-' : '.'
180
139
 
181
- const date = parseDate(dateStr, fromFormat)
182
- if (!date) return dateStr
140
+ // Déterminer l'ordre des composants (jour, mois, année) en fonction du format
141
+ const formatParts = props.format.split(/[/.-]/)
142
+ const dayIndex = formatParts.findIndex(part => part.toUpperCase().includes('D'))
143
+ const monthIndex = formatParts.findIndex(part => part.toUpperCase().includes('M'))
144
+ const yearIndex = formatParts.findIndex(part => part.toUpperCase().includes('Y'))
183
145
 
184
- // Format the date according to the target format
185
- let result = toFormat
186
- result = result.replace('YYYY', String(date.getFullYear()))
187
- result = result.replace('YY', String(date.getFullYear()).slice(-2))
188
- result = result.replace('MM', String(date.getMonth() + 1).padStart(2, '0'))
189
- result = result.replace('DD', String(date.getDate()).padStart(2, '0'))
190
- return result
191
- }
146
+ // Créer le masque en fonction du format
147
+ const parts = Array(3).fill('__')
148
+ parts[yearIndex] = '____' // L'année a toujours 4 caractères
149
+ const mask = parts.join(separator)
192
150
 
193
- // Format a date input string (add slashes)
194
- const formatDateInput = (value: string): string => {
195
- const numbers = value.replace(/\D/g, '')
196
- const chars = numbers.split('')
151
+ let result = mask
152
+ let pos = cursorPosition || 0
197
153
 
198
- if (chars.length <= 2) return numbers
199
- if (chars.length <= 4) return `${chars.slice(0, 2).join('')}/${chars.slice(2).join('')}`
154
+ // Nettoyer l'entrée pour ne garder que les chiffres et les séparateurs
155
+ let cleanInput = input
200
156
 
201
- // Permettre les années à 4 chiffres
202
- const yearPart = chars.slice(4).join('')
203
- return `${chars.slice(0, 2).join('')}/${chars.slice(2, 4).join('')}/${yearPart}`
204
- }
157
+ // Si l'entrée contient déjà des séparateurs, on les garde pour préserver l'ordre
158
+ if (input.includes(separator)) {
159
+ const parts = input.split(separator)
160
+ cleanInput = parts.map(part => part.replace(/\D/g, '')).join(separator)
161
+ }
162
+ else {
163
+ cleanInput = input.replace(/\D/g, '')
164
+ }
205
165
 
206
- // Initialisation au montage
207
- onMounted(() => {
208
- if (props.modelValue) {
209
- if (Array.isArray(props.modelValue)) {
210
- // Si on reçoit un tableau de dates, on les formate pour l'affichage
211
- const [start, end] = props.modelValue
212
- const formattedStart = convertDateFormat(start, props.returnFormat || 'YYYY-MM-DD', props.displayFormat)
213
- const formattedEnd = convertDateFormat(end, props.returnFormat || 'YYYY-MM-DD', props.displayFormat)
214
- inputValue.value = `${formattedStart} - ${formattedEnd}`
215
- }
216
- else if (typeof props.modelValue === 'string') {
217
- // Si on reçoit une chaîne, on la convertit dans le format d'affichage
218
- inputValue.value = convertDateFormat(props.modelValue, props.returnFormat || 'YYYY-MM-DD', props.displayFormat)
166
+ // Si l'entrée contient des séparateurs, on traite chaque partie séparément
167
+ if (cleanInput.includes(separator)) {
168
+ const parts = cleanInput.split(separator)
169
+ const formattedParts = Array(3).fill('__')
170
+ formattedParts[yearIndex] = (parts[yearIndex] || '').padEnd(4, '_')
171
+ formattedParts[monthIndex] = (parts[monthIndex] || '').padEnd(2, '_')
172
+ formattedParts[dayIndex] = (parts[dayIndex] || '').padEnd(2, '_')
173
+
174
+ result = formattedParts.join(separator)
175
+ }
176
+ else {
177
+ // Distribution des chiffres selon le format
178
+ const formatOrder = [dayIndex, monthIndex, yearIndex]
179
+ let currentDigit = 0
180
+
181
+ for (let partIndex = 0; currentDigit < Math.min(cleanInput.length, 8); partIndex++) {
182
+ const formatPartIndex = formatOrder[partIndex % 3]
183
+ const isYear = formatParts[formatPartIndex].toUpperCase().includes('Y')
184
+ const partLength = isYear ? 4 : 2
185
+ const targetStartPos = formatPartIndex * 3 // Chaque partie a 2 caractères + 1 séparateur
186
+
187
+ // Insérer les chiffres pour cette partie
188
+ for (let j = 0; j < partLength && currentDigit < cleanInput.length; j++) {
189
+ const digit = cleanInput[currentDigit]
190
+ const targetPos = targetStartPos + j
191
+ result = result.substring(0, targetPos) + digit + result.substring(targetPos + 1)
192
+ currentDigit++
193
+ }
219
194
  }
220
- validateField()
221
195
  }
222
- })
223
196
 
224
- // Mise à jour quand la valeur change
225
- watch(() => props.modelValue, (newValue) => {
226
- if (newValue) {
227
- if (Array.isArray(newValue)) {
228
- // Si on reçoit un tableau de dates, on les formate pour l'affichage
229
- const [start, end] = newValue
230
- const formattedStart = convertDateFormat(start, props.returnFormat || 'YYYY-MM-DD', props.displayFormat)
231
- const formattedEnd = convertDateFormat(end, props.returnFormat || 'YYYY-MM-DD', props.displayFormat)
232
- inputValue.value = `${formattedStart} - ${formattedEnd}`
233
- }
234
- else if (typeof newValue === 'string') {
235
- // Si on reçoit une chaîne, on la convertit dans le format d'affichage
236
- inputValue.value = convertDateFormat(newValue, props.returnFormat || 'YYYY-MM-DD', props.displayFormat)
197
+ // Calculer la nouvelle position du curseur
198
+ if (cursorPosition !== undefined) {
199
+ pos = cursorPosition
200
+ // Si on est sur un séparateur, avancer d'une position
201
+ if (mask[pos] === separator) {
202
+ pos++
237
203
  }
238
- validateField()
239
204
  }
240
- else {
241
- inputValue.value = ''
205
+
206
+ return {
207
+ formatted: result,
208
+ cursorPos: pos,
242
209
  }
243
- })
210
+ }
244
211
 
245
- // Émission de la valeur
246
- const emitValue = (value: string) => {
247
- if (!value) {
248
- emit('update:modelValue', '')
249
- return
212
+ // Fonction pour nettoyer une chaîne de date
213
+ const cleanDateString = (input: string): string => {
214
+ // Conserver uniquement les chiffres et les séparateurs valides
215
+ return input.replace(/[^\d/.-]/g, '')
216
+ }
217
+
218
+ // Fonction pour valider le format de la date
219
+ const validateDateFormat = (dateStr: string): { isValid: boolean, message: string } => {
220
+ if (!dateStr) {
221
+ return { isValid: !props.required || !hasInteracted.value, message: (props.required && hasInteracted.value) ? 'La date est requise' : '' }
222
+ }
223
+
224
+ // Vérifier que la chaîne ne contient que des chiffres et des séparateurs
225
+ if (!/^[\d/.-]*$/.test(dateStr)) {
226
+ return { isValid: false, message: 'Format de date invalide' }
250
227
  }
251
228
 
252
- const returnFormat = props.returnFormat || 'YYYY-MM-DD'
229
+ // Essayer de parser avec le format d'entrée
230
+ let date = parseDate(dateStr, props.format)
253
231
 
254
- if (props.range) {
255
- const [start, end] = value.split('-').map(d => d.trim())
256
- if (start && end) {
257
- // Pour les ranges, convertir les deux dates au format demandé
258
- const formattedStart = convertDateFormat(start, props.displayFormat, returnFormat)
259
- const formattedEnd = convertDateFormat(end, props.displayFormat, returnFormat)
260
- emit('update:modelValue', [formattedStart, formattedEnd])
261
- }
232
+ // Si ça échoue et qu'on a un format de retour, essayer avec celui-ci
233
+ if (!date && props.dateFormatReturn) {
234
+ date = parseDate(dateStr, props.dateFormatReturn)
262
235
  }
263
- else {
264
- // Pour une date simple, convertir au format demandé
265
- const formattedValue = convertDateFormat(value, props.displayFormat, returnFormat)
266
- emit('update:modelValue', formattedValue)
236
+
237
+ if (!date) {
238
+ return { isValid: false, message: 'Format de date invalide' }
267
239
  }
240
+
241
+ return { isValid: true, message: '' }
268
242
  }
269
243
 
270
- // Handle the input value formatting
271
- const maxLength = computed(() => props.range ? 23 : 10) // 10 pour "DD/MM/YYYY", 23 pour "DD/MM/YYYY - DD/MM/YYYY"
272
- const handleInput = (value: string) => {
273
- // Limiter la longueur du texte
274
- if (value.length > maxLength.value) {
275
- value = value.slice(0, maxLength.value)
276
- }
244
+ // Fonction pour valider les règles et mettre à jour les messages
245
+ const validateRules = (value: string) => {
246
+ errorMessages.value = []
247
+ warningMessages.value = []
248
+ successMessages.value = []
277
249
 
278
250
  if (!value) {
279
- inputValue.value = ''
280
- emitValue('')
281
- validateField()
251
+ if (props.required && hasInteracted.value) {
252
+ errorMessages.value.push('La date est requise')
253
+ }
254
+ return
255
+ }
256
+
257
+ // Validation du format
258
+ const validation = validateDateFormat(value)
259
+ if (!validation.isValid) {
260
+ errorMessages.value.push(validation.message)
282
261
  return
283
262
  }
284
263
 
285
- // Garder uniquement les chiffres et le séparateur de plage
286
- let formattedValue = value.replace(/[^\d-]/g, '')
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
+ })
287
280
 
288
- if (props.range) {
289
- const [start, end] = formattedValue.split('-').map(d => d.trim())
290
- let result = ''
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
+ }
285
+ }
291
286
 
292
- // Formater la première date
293
- if (start) {
294
- result = formatDateInput(start)
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[] = []
295
291
 
296
- // Si la première date est complète, ajouter automatiquement le séparateur
297
- const yearLength = props.displayFormat.includes('YYYY') ? 8 : 6
298
- if (start.length === yearLength && !formattedValue.includes('-')) {
299
- result += ' -'
292
+ rules.forEach((rule) => {
293
+ const result = rule(value)
294
+ if (result?.warning) {
295
+ warningMessages.value.push(result.warning)
296
+ allValid = false
300
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)
301
306
  }
307
+ }
302
308
 
303
- // Ajouter le séparateur et la deuxième date si présente
304
- if (formattedValue.includes('-')) {
305
- if (!result.includes(' -')) {
306
- result += ' -'
307
- }
308
- if (end) {
309
- result += ' ' + formatDateInput(end)
309
+ // Appliquer les règles
310
+ validateErrorRules(validationRules)
311
+ validateWarningRules(warningValidationRules)
312
+
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)]
317
+ }
318
+
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
+ }
340
+
341
+ // Pour les règles normales
342
+ return !isValid
343
+ ? { error: message }
344
+ : { success: successMessage }
310
345
  }
346
+ return null
311
347
  }
348
+ })
349
+ }
312
350
 
313
- formattedValue = result
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
+ const getIcon = computed(() => {
367
+ if (errorMessages.value.length > 0) {
368
+ return 'error'
314
369
  }
315
- else {
316
- formattedValue = formatDateInput(formattedValue)
370
+ if (warningMessages.value.length > 0) {
371
+ return 'warning'
372
+ }
373
+ if (successMessages.value.length > 0 && !warningMessages.value.length) {
374
+ return 'success'
317
375
  }
376
+ return undefined
377
+ })
318
378
 
319
- inputValue.value = formattedValue
320
- emitValue(formattedValue)
379
+ // Gestionnaire de touches pour permettre le copier-coller
380
+ const handleKeydown = (event: KeyboardEvent) => {
381
+ // Autoriser les touches de contrôle (Ctrl+C, Ctrl+V, etc.)
382
+ if (event.ctrlKey || event.metaKey) {
383
+ return
384
+ }
321
385
  }
322
386
 
323
- // Handle blur event to format the final value
324
- const handleBlur = () => {
325
- if (!inputValue.value) {
326
- emitValue('')
387
+ // Gestionnaire de l'événement paste
388
+ const handlePaste = (event: ClipboardEvent) => {
389
+ event.preventDefault()
390
+ const pastedText = event.clipboardData?.getData('text')
391
+
392
+ if (!pastedText) {
327
393
  return
328
394
  }
329
395
 
330
- if (props.range) {
331
- const [start, end] = inputValue.value.split('-').map(d => d.trim())
332
- if (start && end) {
333
- // Nettoyer et formater les dates
334
- const cleanStart = start.replace(/\D/g, '')
335
- const cleanEnd = end.replace(/\D/g, '')
396
+ // Nettoyer et formater la valeur collée
397
+ const cleanedText = cleanDateString(pastedText)
398
+ const formattedText = formatDateInput(cleanedText).formatted
399
+
400
+ // Mettre à jour la valeur
401
+ inputValue.value = formattedText
402
+ }
403
+
404
+ // Référence vers l'élément input
405
+ const inputRef = ref<InstanceType<typeof SyTextField> | null>(null)
336
406
 
337
- // Extraire les parties des dates
338
- const startDay = cleanStart.slice(0, 2)
339
- const startMonth = cleanStart.slice(2, 4)
340
- const startYear = cleanStart.slice(4)
407
+ // Flag pour éviter le formatage récursif
408
+ const isFormatting = ref(false)
341
409
 
342
- const endDay = cleanEnd.slice(0, 2)
343
- const endMonth = cleanEnd.slice(2, 4)
344
- const endYear = cleanEnd.slice(4)
410
+ // Watch sur inputValue pour gérer le formatage et la validation
411
+ watch(inputValue, async (newValue, oldValue) => {
412
+ if (isFormatting.value || newValue === oldValue) return // Éviter la récursion pendant le formatage
345
413
 
346
- // Formater pour l'affichage
347
- const formattedStart = `${startDay}/${startMonth}/${startYear}`
348
- const formattedEnd = `${endDay}/${endMonth}/${endYear}`
349
- inputValue.value = `${formattedStart} - ${formattedEnd}`
414
+ try {
415
+ isFormatting.value = true
416
+
417
+ if (!newValue) {
418
+ emit('update:model-value', null)
419
+ validateRules('')
420
+ return
421
+ }
422
+
423
+ // Récupérer la position du curseur avant le formatage
424
+ const input = inputRef.value?.$el.querySelector('input')
425
+ const cursorPos = input?.selectionStart || 0
426
+
427
+ // Formater la valeur
428
+ const { formatted, cursorPos: newPos } = formatDateInput(newValue, cursorPos)
429
+
430
+ // Mettre à jour la valeur si nécessaire
431
+ if (formatted !== newValue) {
432
+ inputValue.value = formatted
433
+ // Rétablir la position du curseur après le formatage
434
+ await nextTick()
435
+ input?.setSelectionRange(newPos, newPos)
436
+ }
350
437
 
351
- // Émettre les dates si elles sont valides
352
- if (isValidDate(formattedStart) && isValidDate(formattedEnd)) {
353
- emitValue(`${formattedStart} - ${formattedEnd}`)
438
+ // Vérifier si la date est complète
439
+ const isDateComplete = !formatted.includes('_')
440
+
441
+ if (isDateComplete) {
442
+ // Valider le format si la date est complète
443
+ const validation = validateDateFormat(formatted)
444
+ if (validation.isValid) {
445
+ const date = parseDate(formatted)
446
+ if (date) {
447
+ const formattedDate = props.dateFormatReturn
448
+ ? formatDateToString(date, props.dateFormatReturn)
449
+ : formatted
450
+ await nextTick() // Attendre le prochain tick avant d'émettre
451
+ emit('update:model-value', formattedDate)
452
+ }
354
453
  }
454
+ validateRules(formatted)
455
+ }
456
+ else {
457
+ // Réinitialiser les messages d'erreur pendant la saisie
458
+ errorMessages.value = []
459
+ warningMessages.value = []
460
+ successMessages.value = []
355
461
  }
356
462
  }
357
- else {
358
- const cleanValue = inputValue.value.replace(/\D/g, '')
463
+ finally {
464
+ await nextTick() // Attendre le prochain tick avant de réinitialiser le flag
465
+ isFormatting.value = false
466
+ }
467
+ })
359
468
 
360
- // Extraire les parties de la date
361
- const day = cleanValue.slice(0, 2)
362
- const month = cleanValue.slice(2, 4)
363
- const year = cleanValue.slice(4)
469
+ // Watch pour mettre à jour l'input quand modelValue change
470
+ watch(() => props.modelValue, (newValue) => {
471
+ if (isFormatting.value) return // Ne pas mettre à jour si on est en train de formater
364
472
 
365
- // Formater pour l'affichage
366
- const formattedValue = `${day}/${month}/${year}`
367
- inputValue.value = formattedValue
473
+ if (!newValue) {
474
+ inputValue.value = ''
475
+ return
476
+ }
368
477
 
369
- if (isValidDate(formattedValue)) {
370
- emitValue(formattedValue)
371
- }
478
+ // Formater la valeur selon le format d'affichage
479
+ const date = parseDate(newValue, props.dateFormatReturn)
480
+ if (date) {
481
+ const formatted = formatDateToString(date, props.format)
482
+ inputValue.value = formatted
483
+ }
484
+ else {
485
+ inputValue.value = newValue
372
486
  }
487
+ })
373
488
 
374
- validateField()
489
+ // Gestionnaire de focus
490
+ const handleFocus = () => {
491
+ isFocused.value = true
492
+ emit('focus')
375
493
  }
376
494
 
377
- // Validate single date
378
- const isValidDate = (dateString: string): boolean => {
379
- return parseDate(dateString, props.displayFormat) !== null
495
+ // Gestionnaire de blur
496
+ const handleBlur = () => {
497
+ isFocused.value = false
498
+ hasInteracted.value = true
499
+ emit('blur')
500
+
501
+ // Valider le format complet lors du blur
502
+ if (inputValue.value) {
503
+ const validation = validateDateFormat(inputValue.value)
504
+ if (validation.isValid) {
505
+ const date = parseDate(inputValue.value)
506
+ if (date) {
507
+ const formattedDate = props.dateFormatReturn
508
+ ? formatDateToString(date, props.dateFormatReturn)
509
+ : inputValue.value
510
+ emit('update:model-value', formattedDate)
511
+ }
512
+ }
513
+ }
514
+ // Toujours valider les règles, même si le champ est vide
515
+ validateRules(inputValue.value || '')
380
516
  }
381
517
 
382
- // Exposer la méthode de validation
383
- const validateOnSubmit = () => {
384
- validateField()
518
+ // Fonction de validation lors de la soumission
519
+ const isValidating = ref(false)
520
+
521
+ const validateOnSubmit = (): boolean => {
522
+ isValidating.value = true
523
+
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
+ }
529
+
530
+ // Si le champ n'est pas requis et est vide, c'est valide
531
+ if (!inputValue.value) {
532
+ return true
533
+ }
534
+
535
+ // Valider le format de la date
536
+ const { isValid, message } = validateDateFormat(inputValue.value)
537
+ if (!isValid) {
538
+ errorMessages.value = [message]
539
+ return false
540
+ }
541
+
542
+ // Valider les règles personnalisées
543
+ validateRules(inputValue.value)
544
+
545
+ // Retourner true seulement si pas d'erreurs
385
546
  return errorMessages.value.length === 0
386
547
  }
387
548
 
549
+ // Exposer les méthodes et propriétés nécessaires
388
550
  defineExpose({
389
- validate: validateField,
390
551
  validateOnSubmit,
552
+ focus: () => {
553
+ const input = document.querySelector('input')
554
+ if (input) {
555
+ input.focus()
556
+ }
557
+ },
558
+ blur: () => {
559
+ const input = document.querySelector('input')
560
+ if (input) {
561
+ input.blur()
562
+ }
563
+ },
391
564
  })
565
+
566
+ onMounted(() => {
567
+ if (!props.modelValue) {
568
+ return
569
+ }
570
+
571
+ // Parser la date avec le format d'entrée
572
+ const date = parseDate(props.modelValue, props.format)
573
+ if (date) {
574
+ // Si un format de retour est spécifié, l'utiliser pour la valeur émise
575
+ if (props.dateFormatReturn && props.dateFormatReturn !== props.format) {
576
+ const formattedForReturn = formatDateToString(date, props.dateFormatReturn)
577
+ emit('update:model-value', formattedForReturn)
578
+ }
579
+
580
+ // Toujours afficher dans le format d'entrée
581
+ inputValue.value = formatDateToString(date, props.format)
582
+ validateRules(inputValue.value)
583
+ }
584
+ else {
585
+ inputValue.value = props.modelValue
586
+ validateRules(props.modelValue)
587
+ }
588
+ })
589
+
392
590
  </script>
393
591
 
394
592
  <template>
395
593
  <SyTextField
594
+ ref="inputRef"
396
595
  v-model="inputValue"
397
- :error="hasError"
398
- :error-messages="errorMessages"
399
- :messages="successMessages"
400
596
  :placeholder="placeholder"
401
- :success="hasSuccess"
402
- :warning="hasWarning"
597
+ :label="label"
598
+ :error-messages="errorMessages"
403
599
  :warning-messages="warningMessages"
404
- :maxlength="maxLength"
405
- v-bind="$attrs"
600
+ :success-messages="successMessages"
601
+ :is-on-error="isOnError"
602
+ :is-disabled="isDisabled"
603
+ :is-read-only="isReadOnly"
604
+ :display-icon="displayIcon"
605
+ :display-append-icon="displayAppendIcon"
606
+ :no-icon="noIcon"
607
+ :prepend-icon="props.displayPrependIcon && !props.displayAppendIcon ? 'calendar' : undefined"
608
+ :append-icon="props.displayAppendIcon ? 'calendar' : undefined"
609
+ :append-inner-icon="getIcon"
610
+ :variant-style="isOutlined ? 'outlined' : 'filled'"
611
+ :class="{
612
+ 'error-field': isOnError,
613
+ 'warning-field': isOnWarning,
614
+ 'success-field': isOnSuccess
615
+ }"
616
+ @keydown="handleKeydown"
617
+ @focus="handleFocus"
406
618
  @blur="handleBlur"
407
- @update:model-value="handleInput"
619
+ @paste="handlePaste"
408
620
  />
409
621
  </template>
622
+
623
+ <style lang="scss" scoped>
624
+ @use '@/assets/tokens';
625
+
626
+ :deep(.v-icon__svg) { cursor: default; }
627
+
628
+ .warning-field {
629
+ :deep(.v-input__details > .v-icon),
630
+ :deep(.v-input__prepend > .v-icon),
631
+ :deep(.v-input__append > .v-icon) {
632
+ opacity: 1 !important;
633
+ }
634
+
635
+ :deep(.v-field) {
636
+ color: tokens.$colors-border-warning !important;
637
+
638
+ .v-field__outline {
639
+ color: tokens.$colors-border-warning !important;
640
+ }
641
+ }
642
+
643
+ :deep(.v-messages) {
644
+ opacity: 1 !important;
645
+
646
+ .v-messages__message {
647
+ color: tokens.$colors-border-warning !important;
648
+ }
649
+ }
650
+ }
651
+
652
+ .error-field {
653
+ :deep(.v-input__control),
654
+ :deep(.v-messages__message) {
655
+ color: tokens.$colors-text-error !important;
656
+ }
657
+
658
+ .v-field--active & {
659
+ color: tokens.$colors-border-error !important;
660
+ }
661
+ }
662
+
663
+ .success-field {
664
+ :deep(.v-input__details > .v-icon),
665
+ :deep(.v-input__prepend > .v-icon),
666
+ :deep(.v-input__append > .v-icon) {
667
+ opacity: 1 !important;
668
+ }
669
+
670
+ :deep(.v-field) {
671
+ color: tokens.$colors-border-success !important;
672
+
673
+ .v-field__outline {
674
+ color: tokens.$colors-border-success !important;
675
+ }
676
+ }
677
+
678
+ :deep(.v-messages) {
679
+ opacity: 1 !important;
680
+
681
+ .v-messages__message {
682
+ color: tokens.$colors-border-success !important;
683
+ }
684
+ }
685
+ }
686
+ </style>