@cnamts/synapse 1.0.8 → 1.0.9

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 (394) hide show
  1. package/dist/{DateFilter-DkqG0pmr.js → DateFilter-BylukfjR.js} +1 -1
  2. package/dist/{NumberFilter-Ck7AwD39.js → NumberFilter-C_bUk9o1.js} +1 -1
  3. package/dist/{PeriodFilter-LRI6YpgU.js → PeriodFilter-dVOmcfmt.js} +1 -1
  4. package/dist/{SelectFilter-DPc70Jk7.js → SelectFilter-BW8KpXkQ.js} +1 -1
  5. package/dist/{TextFilter-DRQL7uD8.js → TextFilter-diwVzTz7.js} +1 -1
  6. package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +2785 -2770
  7. package/dist/components/Amelipro/AmeliproCallback/AmeliproCallback.d.ts +3 -3
  8. package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +7 -7
  9. package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.d.ts +3 -3
  10. package/dist/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.d.ts +3 -3
  11. package/dist/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.d.ts +30 -0
  12. package/dist/components/Amelipro/AmeliproContentLayout/index.d.ts +2 -0
  13. package/dist/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.d.ts +24 -0
  14. package/dist/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.d.ts +128 -0
  15. package/dist/components/Amelipro/AmeliproErrorTemplate/errorTemplateTypes.d.ts +2 -0
  16. package/dist/components/Amelipro/AmeliproErrorTemplate/types.d.ts +7 -0
  17. package/dist/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.d.ts +91 -0
  18. package/dist/components/Amelipro/AmeliproFooter/AmeliproFooter.d.ts +18 -18
  19. package/dist/components/Amelipro/AmeliproHeader/AmeliproHeader.d.ts +9 -9
  20. package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.d.ts +3 -3
  21. package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.d.ts +3 -3
  22. package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +3 -3
  23. package/dist/components/Amelipro/AmeliproMenu/AmeliproMenu.d.ts +3 -3
  24. package/dist/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/AmeliproPaginationBtn.d.ts +3 -3
  25. package/dist/components/Amelipro/AmeliproPatientBanner/AmeliproPatientBanner.d.ts +3 -3
  26. package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +2766 -2751
  27. package/dist/components/Amelipro/AmeliproStateTile/AmeliproStateTile.d.ts +3 -3
  28. package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +2766 -2751
  29. package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +388 -386
  30. package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +632 -630
  31. package/dist/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.d.ts +3 -3
  32. package/dist/components/Amelipro/AmeliproTransmission/AmeliproTransmission.d.ts +9 -9
  33. package/dist/components/CookieBanner/CookieBanner.d.ts +116 -114
  34. package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +465 -465
  35. package/dist/components/CookiesSelection/CookiesSelection.d.ts +103 -101
  36. package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +105 -105
  37. package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1 -1
  38. package/dist/components/Customs/SyTextField/SyTextField.d.ts +634 -632
  39. package/dist/components/DataList/DataList.d.ts +1 -1
  40. package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +2875 -2843
  41. package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +1446 -1430
  42. package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +643 -641
  43. package/dist/components/DialogBox/DialogBox.d.ts +172 -169
  44. package/dist/components/DialogBox/config.d.ts +3 -3
  45. package/dist/components/DialogBox/locales.d.ts +2 -0
  46. package/dist/components/DialogBox/useDraggable.d.ts +8 -0
  47. package/dist/components/FilterSideBar/FilterSideBar.d.ts +159 -157
  48. package/dist/components/FooterBar/FooterBar.d.ts +5 -5
  49. package/dist/components/HeaderBar/HeaderBar.d.ts +2 -2
  50. package/dist/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +1 -1
  51. package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +1 -1
  52. package/dist/components/LangBtn/LangBtn.d.ts +169 -167
  53. package/dist/components/LogoBrandSection/LogoBrandSection.d.ts +1 -1
  54. package/dist/components/NirField/NirField.d.ts +1277 -1273
  55. package/dist/components/PeriodField/PeriodField.d.ts +5752 -5688
  56. package/dist/components/PhoneField/PhoneField.d.ts +647 -636
  57. package/dist/components/SearchListField/SearchListField.d.ts +105 -105
  58. package/dist/components/SyAlert/SyAlert.d.ts +29 -29
  59. package/dist/components/SyTextArea/SyTextArea.d.ts +389 -387
  60. package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +207 -175
  61. package/dist/components/Tables/SyTable/SyTable.d.ts +208 -176
  62. package/dist/components/Tables/common/SyTableFilter.d.ts +1 -1
  63. package/dist/components/Tables/common/SyTablePagination.d.ts +105 -105
  64. package/dist/components/Tables/common/filters/DateFilter.d.ts +1 -1
  65. package/dist/components/Tables/common/filters/NumberFilter.d.ts +1 -1
  66. package/dist/components/Tables/common/filters/PeriodFilter.d.ts +1 -1
  67. package/dist/components/Tables/common/filters/SelectFilter.d.ts +1 -1
  68. package/dist/components/Tables/common/filters/TextFilter.d.ts +1 -1
  69. package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +82 -82
  70. package/dist/components/Tables/common/tableProps.d.ts +11 -0
  71. package/dist/components/Tables/common/types.d.ts +8 -4
  72. package/dist/components/Tables/common/useStoredOptions.d.ts +14 -0
  73. package/dist/components/Tables/common/useTableHeaders.d.ts +3 -2
  74. package/dist/components/Tables/common/useTableItems.d.ts +0 -1
  75. package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +16 -16
  76. package/dist/components/index.d.ts +4 -0
  77. package/dist/design-system-v3.js +166 -162
  78. package/dist/design-system-v3.umd.cjs +267 -262
  79. package/dist/main-2eWGB7zZ.js +30203 -0
  80. package/dist/style.css +1 -1
  81. package/dist/vuetifyConfig.d.ts +6 -6
  82. package/package.json +1 -1
  83. package/src/assets/amelipro/img/ico_pdf.svg +15 -0
  84. package/src/assets/amelipro/img/navigateurs.png +0 -0
  85. package/src/assets/amelipro/img/visuel_deconnexion.svg +973 -0
  86. package/src/assets/amelipro/img/visuel_erreur_403.svg +3652 -0
  87. package/src/assets/amelipro/img/visuel_erreur_404.svg +1801 -0
  88. package/src/assets/amelipro/img/visuel_erreur_500.svg +989 -0
  89. package/src/assets/amelipro/img/visuel_erreur_503.svg +1005 -0
  90. package/src/assets/amelipro/img/visuel_navigateur_obsolete.svg +828 -0
  91. package/src/assets/amelipro/pdf/charte-pour-pdf.pdf +0 -0
  92. package/src/components/Accordion/Accessibilite/AccessibilityGuide.mdx +5 -2
  93. package/src/components/Accordion/Accordion.mdx +5 -3
  94. package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.stories.ts +258 -0
  95. package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.stories.ts +321 -0
  96. package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +656 -0
  97. package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.mdx +1 -3
  98. package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.stories.ts +208 -0
  99. package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +562 -0
  100. package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.stories.ts +480 -0
  101. package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.stories.ts +267 -0
  102. package/src/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.stories.ts +287 -6
  103. package/src/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.stories.ts +433 -0
  104. package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.mdx +15 -0
  105. package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.stories.ts +44 -0
  106. package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.vue +55 -0
  107. package/src/components/Amelipro/AmeliproContentLayout/__tests__/AmeliproContentLayout.spec.ts +20 -0
  108. package/src/components/Amelipro/AmeliproContentLayout/__tests__/__snapshots__/AmeliproContentLayout.spec.ts.snap +24 -0
  109. package/src/components/Amelipro/AmeliproContentLayout/index.ts +3 -0
  110. package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.mdx +18 -0
  111. package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.stories.ts +68 -0
  112. package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.vue +73 -0
  113. package/src/components/Amelipro/AmeliproCopyBtn/__tests__/AmeliproCopyBtn.spec.ts +20 -0
  114. package/src/components/Amelipro/AmeliproCopyBtn/__tests__/__snapshots__/AmeliproCopyBtn.spec.ts.snap +84 -0
  115. package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.stories.ts +422 -0
  116. package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +2 -2
  117. package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +4 -6
  118. package/src/components/Amelipro/AmeliproDisclosure/AmeliproDisclosure.stories.ts +92 -0
  119. package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.mdx +23 -0
  120. package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.stories.ts +386 -0
  121. package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.vue +187 -0
  122. package/src/components/Amelipro/AmeliproErrorTemplate/__tests__/AmeliproErrorTemplate.spec.ts +31 -0
  123. package/src/components/Amelipro/AmeliproErrorTemplate/__tests__/__snapshots__/AmeliproErrorTemplate.spec.ts.snap +185 -0
  124. package/src/components/Amelipro/AmeliproErrorTemplate/errorTemplateTypes.ts +85 -0
  125. package/src/components/Amelipro/AmeliproErrorTemplate/types.d.ts +7 -0
  126. package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.mdx +15 -0
  127. package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.stories.ts +71 -0
  128. package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +161 -0
  129. package/src/components/Amelipro/AmeliproFilePreview/__tests__/AmeliproFilePreview.spec.ts +28 -0
  130. package/src/components/Amelipro/AmeliproFilePreview/__tests__/__snapshots__/AmeliproFilePreview.spec.ts.snap +209 -0
  131. package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.stories.ts +194 -0
  132. package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.stories.ts +639 -0
  133. package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +648 -0
  134. package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.stories.ts +392 -0
  135. package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.stories.ts +351 -0
  136. package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.stories.ts +634 -38
  137. package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +1 -1
  138. package/src/components/Amelipro/ServiceMenu/ServiceMenu.mdx +5 -3
  139. package/src/components/Amelipro/StructureMenu/StructureMenu.mdx +5 -3
  140. package/src/components/Amelipro/UserMenu/UserMenu.mdx +5 -3
  141. package/src/components/BackBtn/Accessibilite.mdx +6 -2
  142. package/src/components/BackBtn/BackBtn.mdx +5 -3
  143. package/src/components/BackBtn/BackBtn.stories.ts +1 -0
  144. package/src/components/BackBtn/Usages.mdx +5 -3
  145. package/src/components/BackToTopBtn/Accessibilite.mdx +6 -2
  146. package/src/components/BackToTopBtn/BackToTopBtn.mdx +5 -4
  147. package/src/components/BackToTopBtn/Usages.mdx +5 -3
  148. package/src/components/ChipList/Accessibilite.mdx +6 -2
  149. package/src/components/ChipList/ChipList.mdx +5 -3
  150. package/src/components/CollapsibleList/Accessibilite.mdx +6 -2
  151. package/src/components/CollapsibleList/CollapsibleList.mdx +5 -3
  152. package/src/components/ContextualMenu/Accessibilite.mdx +6 -2
  153. package/src/components/ContextualMenu/ContextualMenu.mdx +7 -4
  154. package/src/components/ContextualMenu/Usages.mdx +5 -3
  155. package/src/components/CookieBanner/Accessibilite.mdx +6 -2
  156. package/src/components/CookieBanner/CookieBanner.mdx +5 -8
  157. package/src/components/CopyBtn/Accessibilite.mdx +6 -2
  158. package/src/components/CopyBtn/CopyBtn.mdx +5 -3
  159. package/src/components/CopyBtn/Usages.mdx +5 -3
  160. package/src/components/Customs/Selects/SelectBtnField/Accessibilite.mdx +6 -2
  161. package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.mdx +7 -4
  162. package/src/components/Customs/Selects/SelectBtnField/Usages.mdx +5 -3
  163. package/src/components/Customs/Selects/SelectOverview.mdx +5 -3
  164. package/src/components/Customs/Selects/SyBtnSelect/Accessibilite.mdx +6 -2
  165. package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.mdx +6 -4
  166. package/src/components/Customs/Selects/SyInputSelect/Accessibilite.mdx +6 -2
  167. package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.mdx +7 -2
  168. package/src/components/Customs/Selects/SySelect/Accessibilite.mdx +7 -3
  169. package/src/components/Customs/Selects/SySelect/SySelect.mdx +6 -4
  170. package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +1 -1
  171. package/src/components/Customs/Selects/SySelect/SySelect.vue +115 -193
  172. package/src/components/Customs/Selects/SySelect/Usages.mdx +5 -3
  173. package/src/components/Customs/SyCheckbox/Accessibilite.mdx +6 -3
  174. package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +5 -3
  175. package/src/components/Customs/SyIcon/Accessibilite.mdx +5 -5
  176. package/src/components/Customs/SyIcon/SyIcon.mdx +5 -7
  177. package/src/components/Customs/SyPagination/SyPagination.mdx +7 -4
  178. package/src/components/Customs/SyTabs/Accessibilite.mdx +4 -1
  179. package/src/components/Customs/SyTabs/SyTabs.mdx +5 -3
  180. package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +18 -0
  181. package/src/components/Customs/SyTextField/Accessibilite.mdx +6 -2
  182. package/src/components/Customs/SyTextField/SyTextField.mdx +5 -6
  183. package/src/components/Customs/SyTextField/SyTextField.vue +17 -4
  184. package/src/components/Customs/SyTextField/Usages.mdx +1 -0
  185. package/src/components/DataList/Accessibilite.mdx +6 -2
  186. package/src/components/DataList/DataList.mdx +5 -3
  187. package/src/components/DataListGroup/Accessibilite.mdx +6 -2
  188. package/src/components/DataListGroup/DataListGroup.mdx +5 -3
  189. package/src/components/DatePicker/Accessibilite.mdx +6 -2
  190. package/src/components/DatePicker/CalendarMode/DatePicker.mdx +5 -3
  191. package/src/components/DatePicker/CalendarMode/DatePicker.vue +6 -3
  192. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.mdx +5 -6
  193. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +14 -3
  194. package/src/components/DatePicker/DatePickerOverview.mdx +5 -3
  195. package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.mdx +5 -3
  196. package/src/components/DatePicker/DateTextInput/DateTextInput.vue +37 -32
  197. package/src/components/DatePicker/DateTextInput/NoCalendar.mdx +5 -3
  198. package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +3 -0
  199. package/src/components/DatePicker/Usages.mdx +5 -3
  200. package/src/components/DiacriticPicker/DiacriticPicker.mdx +5 -3
  201. package/src/components/DialogBox/Accessibilite.mdx +6 -2
  202. package/src/components/DialogBox/DialogBox.mdx +5 -3
  203. package/src/components/DialogBox/DialogBox.stories.ts +83 -0
  204. package/src/components/DialogBox/DialogBox.vue +41 -6
  205. package/src/components/DialogBox/Usages.mdx +5 -3
  206. package/src/components/DialogBox/config.ts +3 -3
  207. package/src/components/DialogBox/locales.ts +2 -0
  208. package/src/components/DialogBox/tests/DialogBox.spec.ts +132 -3
  209. package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +14 -11
  210. package/src/components/DialogBox/useDraggable.ts +98 -0
  211. package/src/components/DownloadBtn/Accessibilite.mdx +6 -2
  212. package/src/components/DownloadBtn/DownloadBtn.mdx +7 -4
  213. package/src/components/DownloadBtn/DownloadBtn.vue +1 -1
  214. package/src/components/DownloadBtn/tests/DownloadBtn.spec.ts +2 -3
  215. package/src/components/ErrorPage/Accessibilite.mdx +6 -2
  216. package/src/components/ErrorPage/ErrorPage.mdx +5 -3
  217. package/src/components/ExternalLinks/Accessibilite.mdx +6 -2
  218. package/src/components/ExternalLinks/ExternalLinks.mdx +5 -8
  219. package/src/components/ExternalLinks/Usages.mdx +5 -3
  220. package/src/components/FileList/Accessibilite.mdx +6 -2
  221. package/src/components/FileList/FileList.mdx +5 -4
  222. package/src/components/FilePreview/Accessibilite.mdx +6 -2
  223. package/src/components/FilePreview/FilePreview.mdx +7 -7
  224. package/src/components/FileUpload/Accessibilite.mdx +6 -2
  225. package/src/components/FileUpload/FileUpload.mdx +7 -4
  226. package/src/components/FilterInline/Accessibilite.mdx +6 -2
  227. package/src/components/FilterInline/FilterInline.mdx +5 -5
  228. package/src/components/FilterSideBar/Accessibilite.mdx +6 -2
  229. package/src/components/FilterSideBar/FilterSideBar.mdx +5 -4
  230. package/src/components/FooterBar/Accessibilite.mdx +6 -2
  231. package/src/components/FooterBar/FooterBar.mdx +5 -3
  232. package/src/components/FranceConnectBtn/Accessibilite.mdx +6 -2
  233. package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +5 -3
  234. package/src/components/HeaderBar/Accessibilite.mdx +6 -2
  235. package/src/components/HeaderBar/HeaderBar.mdx +4 -4
  236. package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.mdx +6 -2
  237. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +9 -13
  238. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +1 -1
  239. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +5 -5
  240. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +1 -2
  241. package/src/components/HeaderBar/Usages.mdx +5 -3
  242. package/src/components/HeaderLoading/Accessibilite.mdx +2 -1
  243. package/src/components/HeaderLoading/HeaderLoading.mdx +5 -3
  244. package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +1 -8
  245. package/src/components/HeaderToolbar/Accessibilite.mdx +6 -2
  246. package/src/components/HeaderToolbar/HeaderToolbar.mdx +5 -3
  247. package/src/components/LangBtn/Accessibilite.mdx +6 -2
  248. package/src/components/LangBtn/LangBtn.mdx +5 -3
  249. package/src/components/Logo/Accessibilite.mdx +6 -2
  250. package/src/components/Logo/Logo.mdx +5 -3
  251. package/src/components/LogoBrandSection/Accessibilite.mdx +6 -2
  252. package/src/components/LogoBrandSection/LogoBrandSection.mdx +5 -3
  253. package/src/components/MaintenancePage/Accessibilite.mdx +6 -2
  254. package/src/components/MaintenancePage/MaintenancePage.mdx +6 -4
  255. package/src/components/NirField/Accessibilite.mdx +6 -2
  256. package/src/components/NirField/NirField.mdx +5 -7
  257. package/src/components/NirField/NirField.vue +13 -118
  258. package/src/components/NirField/Usages.mdx +5 -3
  259. package/src/components/NotFoundPage/Accessibilite.mdx +6 -2
  260. package/src/components/NotFoundPage/NotFoundPage.mdx +6 -4
  261. package/src/components/NotificationBar/Accessibilite.mdx +6 -2
  262. package/src/components/NotificationBar/NotificationBar.mdx +5 -1
  263. package/src/components/NotificationBar/Usages.mdx +5 -3
  264. package/src/components/PageContainer/Accessibilite.mdx +6 -2
  265. package/src/components/PageContainer/PageContainer.mdx +5 -3
  266. package/src/components/PaginatedTable/Accessibilite.mdx +6 -2
  267. package/src/components/PaginatedTable/PaginatedTable.mdx +5 -3
  268. package/src/components/PasswordField/Accessibilite.mdx +6 -2
  269. package/src/components/PasswordField/PasswordField.mdx +5 -3
  270. package/src/components/PeriodField/Accessibilite.mdx +6 -2
  271. package/src/components/PeriodField/PeriodField.mdx +5 -3
  272. package/src/components/PhoneField/Accessibilite.mdx +6 -2
  273. package/src/components/PhoneField/PhoneField.mdx +5 -3
  274. package/src/components/PhoneField/PhoneField.stories.ts +17 -218
  275. package/src/components/PhoneField/PhoneField.vue +17 -11
  276. package/src/components/PhoneField/Usages.mdx +5 -3
  277. package/src/components/PhoneField/tests/PhoneField.spec.ts +46 -0
  278. package/src/components/RangeField/Accessibilite.mdx +6 -2
  279. package/src/components/RangeField/RangeField.mdx +5 -7
  280. package/src/components/RatingPicker/Accessibilite.mdx +6 -2
  281. package/src/components/RatingPicker/RatingPicker.mdx +5 -4
  282. package/src/components/SearchListField/Accessibilite.mdx +6 -2
  283. package/src/components/SearchListField/SearchListField.mdx +7 -5
  284. package/src/components/SkipLink/Accessibilite.mdx +6 -2
  285. package/src/components/SkipLink/SkipLink.mdx +5 -3
  286. package/src/components/SkipLink/Usages.mdx +5 -3
  287. package/src/components/SocialMediaLinks/Accessibilite.mdx +6 -2
  288. package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +5 -3
  289. package/src/components/SubHeader/Accessibilite.mdx +6 -2
  290. package/src/components/SubHeader/SubHeader.mdx +5 -3
  291. package/src/components/SyAlert/Accessibilite.mdx +6 -2
  292. package/src/components/SyAlert/SyAlert.mdx +7 -4
  293. package/src/components/SyAlert/Usages.mdx +5 -3
  294. package/src/components/SyTextArea/SyTextArea.mdx +5 -3
  295. package/src/components/TableToolbar/Accessibilite.mdx +6 -2
  296. package/src/components/TableToolbar/TableToolbar.mdx +6 -3
  297. package/src/components/Tables/SyServerTable/SyServerTable.mdx +5 -3
  298. package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +4 -0
  299. package/src/components/Tables/SyServerTable/SyServerTable.vue +36 -74
  300. package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +46 -7
  301. package/src/components/Tables/SyTable/SyTable.mdx +5 -3
  302. package/src/components/Tables/SyTable/SyTable.stories.ts +5 -1
  303. package/src/components/Tables/SyTable/SyTable.vue +38 -60
  304. package/src/components/Tables/SyTable/tests/SyTable.spec.ts +9 -7
  305. package/src/components/Tables/common/tableProps.ts +53 -0
  306. package/src/components/Tables/common/tableStyles.scss +4 -0
  307. package/src/components/Tables/common/tests/tableUtils.spec.ts +4 -151
  308. package/src/components/Tables/common/types.ts +12 -2
  309. package/src/components/Tables/common/useStoredOptions.ts +36 -0
  310. package/src/components/Tables/common/useTableHeaders.ts +10 -7
  311. package/src/components/Tables/common/useTableItems.ts +0 -20
  312. package/src/components/ToolbarContainer/ToolbarContainer.mdx +1 -0
  313. package/src/components/UploadWorkflow/Accessibilite.mdx +6 -2
  314. package/src/components/UploadWorkflow/UploadWorkflow.mdx +5 -7
  315. package/src/components/UserMenuBtn/Accessibilite.mdx +6 -2
  316. package/src/components/UserMenuBtn/UserMenuBtn.mdx +5 -3
  317. package/src/components/index.ts +4 -0
  318. package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +2 -65
  319. package/src/stories/Accessibilite/Audit/RGAA.mdx +2 -20
  320. package/src/stories/Accessibilite/AuditDesignSystem.mdx +4 -47
  321. package/src/stories/Accessibilite/Avancement/Avancement.mdx +5 -68
  322. package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +267 -198
  323. package/src/stories/Accessibilite/Introduction.mdx +2 -20
  324. package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +4 -21
  325. package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +3 -20
  326. package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +5 -50
  327. package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +3 -46
  328. package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.mdx +3 -39
  329. package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/Utilisation.mdx +4 -54
  330. package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +4 -51
  331. package/src/stories/Accessibilite/Vuetify/Vuetify.mdx +3 -11
  332. package/src/stories/Accessibilite/Vuetify/Vuetify.stories.ts +2 -2
  333. package/src/stories/Accessibilite/Vuetify/VuetifyItems.ts +6 -3
  334. package/src/stories/Components/Components.stories.ts +1 -1
  335. package/src/stories/Demarrer/CreerUneIssue.mdx +4 -1
  336. package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +0 -2
  337. package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +3 -0
  338. package/src/stories/Demarrer/Releases.mdx +0 -2
  339. package/src/stories/Demarrer/Releases.stories.ts +3 -0
  340. package/src/stories/DesignTokens/Arrondis.mdx +7 -1
  341. package/src/stories/DesignTokens/Colors.mdx +7 -1
  342. package/src/stories/DesignTokens/Conteneurs.mdx +6 -1
  343. package/src/stories/DesignTokens/Elevations.mdx +7 -1
  344. package/src/stories/DesignTokens/Espacements.mdx +7 -1
  345. package/src/stories/DesignTokens/Introduction.mdx +5 -3
  346. package/src/stories/DesignTokens/StylesTypographiques.mdx +6 -1
  347. package/src/stories/DesignTokens/Typographie.mdx +5 -1
  348. package/src/stories/Directives/SvgDirective.mdx +3 -22
  349. package/src/stories/EcoConception/EcoGuideComponent.vue +569 -0
  350. package/src/stories/EcoConception/Introduction.mdx +190 -13
  351. package/src/stories/EcoConception/Referentiel.mdx +13 -0
  352. package/src/stories/EcoConception/datas/back_rules.json +184 -0
  353. package/src/stories/EcoConception/datas/ux_ui_rules.json +1073 -0
  354. package/src/stories/EcoConception/ecoconception.stories.ts +30 -0
  355. package/src/stories/GuideDuDev/ClassesUtilitaires/DataUtilities.mdx +7 -3
  356. package/src/stories/GuideDuDev/ClassesUtilitaires/DomBrowserUtilities.mdx +9 -1
  357. package/src/stories/GuideDuDev/ClassesUtilitaires/FormattingUtilities.mdx +7 -3
  358. package/src/stories/GuideDuDev/ClassesUtilitaires/StorageUtilities.mdx +5 -1
  359. package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationRules.mdx +7 -3
  360. package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationUtilities.mdx +7 -3
  361. package/src/stories/GuideDuDev/ClassesUtilitaires/index.mdx +5 -2
  362. package/src/stories/GuideDuDev/FormValidationGuide.mdx +7 -3
  363. package/src/stories/GuideDuDev/LesBreackingChanges.mdx +6 -2
  364. package/src/stories/GuideDuDev/MigrationDepuisBridge.mdx +7 -2
  365. package/src/stories/GuideDuDev/MigrationDepuisVue2.mdx +7 -2
  366. package/src/stories/GuideDuDev/PortailAgent.mdx +6 -1
  367. package/src/stories/GuideDuDev/Theme.mdx +8 -2
  368. package/src/stories/GuideDuDev/UtiliserLesRules.mdx +7 -3
  369. package/src/stories/GuideDuDev/moduleDeNotification.mdx +8 -3
  370. package/src/stories/GuideDuDev/vuetifyOptions.mdx +5 -1
  371. package/src/stories/Templates/Templates.stories.ts +1 -1
  372. package/src/stories/styles/shared.css +16 -0
  373. package/src/utils/rules/Rules.mdx +26 -3
  374. package/src/utils/rules/doMatchPattern/DoMachPattern.mdx +27 -4
  375. package/src/utils/rules/isDateValid/IsDateValid.mdx +27 -4
  376. package/src/utils/rules/isExactLength/IsExactLenght.mdx +27 -4
  377. package/src/utils/rules/isHolidayDay/IsHolidayDay.mdx +27 -4
  378. package/src/utils/rules/isMaxLength/IsMaxLength.mdx +27 -4
  379. package/src/utils/rules/isMinLength/IsMinLength.mdx +27 -4
  380. package/src/utils/rules/isNotAfterDate/IsNotAfterDate.mdx +27 -4
  381. package/src/utils/rules/isNotAfterToday/IsNotAfterToday.mdx +27 -4
  382. package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.mdx +27 -4
  383. package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.mdx +27 -3
  384. package/src/utils/rules/isRequired/IsRequired.mdx +27 -4
  385. package/src/utils/rules/isValidEmail/IsValidEmail.mdx +27 -4
  386. package/dist/components/Tables/common/tableStorageUtils.d.ts +0 -69
  387. package/dist/components/Tables/common/tableUtils.d.ts +0 -79
  388. package/dist/main-DXMoMtj5.js +0 -29904
  389. package/dist/stories/EcoConception/ecoDesignItems.d.ts +0 -4
  390. package/src/components/DownloadBtn/tests/__snapshots__/DownloadBtn.spec.ts.snap +0 -92
  391. package/src/components/Tables/common/tableStorageUtils.ts +0 -127
  392. package/src/components/Tables/common/tableUtils.ts +0 -102
  393. package/src/stories/EcoConception/ecoDesignItems.ts +0 -55
  394. package/src/stories/EcoConception/econception.stories.ts +0 -30
@@ -3,9 +3,10 @@ import * as SyTable from './SyTable.stories';
3
3
 
4
4
  <Meta of={SyTable} />
5
5
 
6
- # SyTable
7
-
8
- Le composant `SyTable` est utilisé pour afficher des données tabulaires côté client. Il s'appuie sur le composant `VDataTable` de Vuetify et offre des fonctionnalités supplémentaires comme le stockage local des options de tableau et des améliorations d'accessibilité.
6
+ <div className="header">
7
+ <h1>SyTable</h1>
8
+ <p>Le composant `SyTable` est utilisé pour afficher des données tabulaires côté client. Il s'appuie sur le composant `VDataTable` de Vuetify et offre des fonctionnalités supplémentaires comme le stockage local des options de tableau et des améliorations d'accessibilité.</p>
9
+ </div>
9
10
 
10
11
  <Canvas story={{height: '550px'}} of={SyTable.Default} />
11
12
 
@@ -79,6 +80,7 @@ Le composant améliore l'accessibilité en ajoutant automatiquement :
79
80
  const options = ref({
80
81
  itemsPerPage: 4,
81
82
  })
83
+ import '../../../stories/styles/shared.css';
82
84
 
83
85
  const headers = ref([
84
86
  {
@@ -70,6 +70,10 @@ const meta = {
70
70
  defaultValue: { summary: 'undefined' },
71
71
  },
72
72
  },
73
+ saveState: {
74
+ description: 'Permet d\'activer ou non la sauvegarde des options (pagination, tris, ordre des colonnes) du tableau dans le localStorage. Par défaut, cette fonctionnalité est activée.',
75
+ control: { type: 'boolean' },
76
+ },
73
77
  suffix: {
74
78
  description: 'Suffixe permettant de gérer individuellement le stockage des options d\'un tableau d\'une page à l\'autre. Ce prop est obligatoire pour garantir un stockage unique pour chaque tableau.',
75
79
  control: { type: 'text' },
@@ -338,7 +342,7 @@ export const SortBy: Story = {
338
342
  key: 'firstname',
339
343
  },
340
344
  {
341
- title: 'Email',
345
+ title: 'Email',
342
346
  value: 'email',
343
347
  },
344
348
  ])
@@ -8,7 +8,7 @@
8
8
  import { processItems } from '../common/formatters'
9
9
  import { locales } from '../common/locales'
10
10
  import OrganizeColumns from '../common/organizeColumns/OrganizeColumns.vue'
11
- import { useTableUtils } from '../common/tableUtils'
11
+ import { useTableProps } from '../common/tableProps'
12
12
  import type { DataOptions, SyTableProps } from '../common/types'
13
13
  import { useTableFilter } from '../common/useTableFilter'
14
14
  import { usePagination } from '../common/usePagination'
@@ -17,9 +17,12 @@
17
17
  import { useTableItems } from '../common/useTableItems'
18
18
  import { useTableCheckbox } from '../common/useTableCheckbox'
19
19
  import { useTableAria } from '../common/useTableAria'
20
+ import { useTableAccessibility } from '../common/tableAccessibilityUtils'
21
+ import useStoredOptions from '../common/useStoredOptions'
20
22
 
21
23
  const props = withDefaults(defineProps<SyTableProps>(), {
22
24
  caption: '',
25
+ saveState: true,
23
26
  showFilters: false,
24
27
  resizableColumns: false,
25
28
  items: () => [],
@@ -61,27 +64,28 @@
61
64
  // Generate a unique ID for this table instance
62
65
  const uniqueTableId = ref(`sy-table-${Math.random().toString(36).substr(2, 9)}`)
63
66
 
67
+ const { storedOptions, storeOptions } = useStoredOptions({
68
+ key: computed(() => props.suffix ? `table-${props.suffix}` : 'table'),
69
+ saveState: toRef(props, 'saveState'),
70
+ })
71
+
64
72
  const {
65
73
  propsFacade,
66
74
  updateOptions,
67
- setupAccessibility,
68
- setupLocalStorage,
69
- columnWidths,
70
- updateColumnWidth,
71
- headers: storageHeaders,
72
- } = useTableUtils({
73
- tableId: uniqueTableId.value,
74
- prefix: 'table',
75
- suffix: props.suffix,
76
- caption: props.caption,
75
+ } = useTableProps({
77
76
  componentAttributes,
78
77
  options,
79
- density: props.density,
78
+ storedOptions: storedOptions.options,
79
+ })
80
+
81
+ const { setupAccessibility } = useTableAccessibility({
82
+ tableId: uniqueTableId.value,
80
83
  })
81
84
 
82
85
  // Use the table headers composable
83
86
  const { headers, displayHeaders, getEnhancedHeader } = useTableHeaders({
84
- headersProp: storageHeaders.value ? storageHeaders : toRef(props, 'headers'),
87
+ headersProp: toRef(props, 'headers'),
88
+ storedHeaders: storedOptions.headers,
85
89
  filterInputConfig: props.filterInputConfig,
86
90
  })
87
91
 
@@ -89,7 +93,7 @@
89
93
  const itemsRef = computed(() => props.items)
90
94
 
91
95
  // Use the table items composable
92
- const { filteredItems, createEmptyItemWithStructure } = useTableItems({
96
+ const { filteredItems } = useTableItems({
93
97
  items: itemsRef,
94
98
  headers,
95
99
  filters,
@@ -176,51 +180,32 @@
176
180
 
177
181
  setupAccessibility()
178
182
 
179
- const { watchOptions, saveHeaders } = setupLocalStorage()
180
-
181
183
  // Create a reactive reference to column widths that will be provided to children
182
- const reactiveColumnWidths = ref(columnWidths.value)
184
+ const reactiveColumnWidths = ref(storedOptions.columnWidths || {})
183
185
 
184
186
  // Provide column widths and update function to child components
185
187
  provide('columnWidths', reactiveColumnWidths)
186
188
  provide('updateColumnWidth', (key: string, width: number | string) => {
187
189
  // Update both the local reactive reference and call the storage utility
188
190
  reactiveColumnWidths.value[key] = width
189
- updateColumnWidth(key, width)
190
191
  })
191
192
 
192
- // Watch for changes to columnWidths from storage and update the reactive reference
193
+ // Save options, headers, and column widths to local storage whenever they change
193
194
  watch(
194
- () => columnWidths.value,
195
- (newWidths) => {
196
- reactiveColumnWidths.value = { ...newWidths }
197
- },
198
- { deep: true, immediate: true },
199
- )
200
-
201
- watch(
202
- () => options.value,
195
+ [
196
+ () => options.value,
197
+ () => headers.value,
198
+ () => reactiveColumnWidths.value,
199
+ ],
203
200
  () => {
204
- // Call watchOptions to update localStorage
205
- watchOptions()
206
-
207
- // We need to use nextTick to ensure the table has re-rendered
208
- nextTick(() => {
209
- // Update the reactive reference directly, which will update the provided value
210
- reactiveColumnWidths.value = { ...columnWidths.value }
201
+ storeOptions({
202
+ options: options.value,
203
+ headers: headers.value,
204
+ columnWidths: reactiveColumnWidths.value,
211
205
  })
212
206
  },
213
207
  { deep: true },
214
208
  )
215
-
216
- watch(
217
- headers,
218
- () => {
219
- saveHeaders(headers.value)
220
- },
221
- { deep: true },
222
- )
223
-
224
209
  </script>
225
210
 
226
211
  <template>
@@ -243,7 +228,7 @@
243
228
  color="primary"
244
229
  :headers="displayHeaders"
245
230
  v-bind="propsFacade"
246
- :items="processItems(filteredItems.length > 0 ? filteredItems : createEmptyItemWithStructure())"
231
+ :items="processItems(filteredItems)"
247
232
  :density="props.density"
248
233
  :show-select="props.showSelect"
249
234
  :item-selectable="(item) => true"
@@ -268,7 +253,9 @@
268
253
  v-for="column in slotProps.columns"
269
254
  :key="column.key"
270
255
  >
271
- <th>
256
+ <th
257
+ class="checkbox-column"
258
+ >
272
259
  <template v-if="column.key === 'data-table-select' && props.showSelect">
273
260
  <SyCheckbox
274
261
  :model-value="slotProps.allSelected"
@@ -345,13 +332,6 @@
345
332
  </VBtn>
346
333
  </td>
347
334
  </tr>
348
- <tr v-if="filteredItems.length === 0">
349
- <td colspan="100%">
350
- <div class="text-center text-grey">
351
- {{ locales.noData }}
352
- </div>
353
- </td>
354
- </tr>
355
335
  </template>
356
336
  <!-- Repli lorsque les colonnes ne sont pas définies -->
357
337
  <template v-else>
@@ -389,13 +369,6 @@
389
369
  </SyTableFilter>
390
370
  </th>
391
371
  </tr>
392
- <tr v-if="filteredItems.length === 0">
393
- <td colspan="100%">
394
- <div class="text-center text-grey">
395
- {{ locales.noData }}
396
- </div>
397
- </td>
398
- </tr>
399
372
  </template>
400
373
  </template>
401
374
 
@@ -449,4 +422,9 @@
449
422
  .sy-table--striped :deep() {
450
423
  @include striped-rows;
451
424
  }
425
+
426
+ .checkbox-column {
427
+ max-width: fit-content;
428
+ }
429
+
452
430
  </style>
@@ -153,12 +153,14 @@ describe('SyTable', () => {
153
153
  expect(setItemMock).toHaveBeenCalledWith(
154
154
  'table-test-storage',
155
155
  expect.objectContaining({
156
- sortBy: [
157
- {
158
- key: 'name',
159
- order: 'desc',
160
- },
161
- ],
156
+ options: expect.objectContaining({
157
+ sortBy: [
158
+ {
159
+ key: 'name',
160
+ order: 'desc',
161
+ },
162
+ ],
163
+ }),
162
164
  }),
163
165
  )
164
166
  })
@@ -367,7 +369,7 @@ describe('SyTable', () => {
367
369
  })
368
370
 
369
371
  await wrapper.vm.$nextTick()
370
- expect(wrapper.text()).toContain('Aucune donnée disponible')
372
+ expect(wrapper.text()).toContain('No data available')
371
373
  })
372
374
 
373
375
  it('enables selection when showSelect is true', async () => {
@@ -0,0 +1,53 @@
1
+ import { computed, ref, watch, type Ref } from 'vue'
2
+ import type { DataOptions } from './types'
3
+
4
+ export function useTableProps({
5
+ componentAttributes,
6
+ serverItemsLength,
7
+ options,
8
+ storedOptions,
9
+ }: {
10
+ componentAttributes: Record<string, unknown>
11
+ serverItemsLength?: number
12
+ options: Ref<Partial<DataOptions>>
13
+ storedOptions?: Partial<DataOptions>
14
+ }): {
15
+ propsFacade: Ref<Record<string, unknown>>
16
+ updateOptions: (tableOptions: Partial<DataOptions>) => void
17
+ } {
18
+ const localOptions = ref<Partial<DataOptions>>(storedOptions || options.value || {})
19
+
20
+ const propsFacade = computed(() => {
21
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
+ const { 'onUpdate:options': _, ...attrs } = componentAttributes
23
+
24
+ const props = {
25
+ ...attrs,
26
+ ...localOptions.value,
27
+ ...(serverItemsLength !== undefined ? { itemsLength: serverItemsLength } : {}),
28
+ }
29
+
30
+ return props
31
+ })
32
+
33
+ // When the table options are updated, merge them into localOptions
34
+ function updateOptions(tableOptions: Partial<DataOptions>): void {
35
+ options.value = {
36
+ ...options.value,
37
+ ...tableOptions,
38
+ }
39
+ }
40
+
41
+ // Watch for external changes to options and update localOptions accordingly
42
+ watch(options, (newOptions) => {
43
+ localOptions.value = {
44
+ ...localOptions.value,
45
+ ...newOptions,
46
+ }
47
+ })
48
+
49
+ return {
50
+ propsFacade,
51
+ updateOptions,
52
+ }
53
+ }
@@ -77,4 +77,8 @@
77
77
  .v-checkbox-btn .v-selection-control__input::before {
78
78
  border-color: rgb(var(--v-theme-primary)) !important;
79
79
  }
80
+
81
+ .v-data-table-rows-no-data {
82
+ color: tokens.$grey-base;
83
+ }
80
84
  }
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
2
2
  import { ref } from 'vue'
3
- import { useTableUtils } from '../tableUtils'
3
+ import { useTableProps } from '../tableProps'
4
4
  import { LocalStorageUtility } from '@/utils/localStorageUtility'
5
5
  import type { DataOptions } from '../types'
6
6
 
@@ -21,75 +21,6 @@ describe('tableUtils', () => {
21
21
  vi.resetAllMocks()
22
22
  })
23
23
 
24
- it('should create storage key correctly with suffix', () => {
25
- const options = ref<Partial<DataOptions>>({})
26
- const { storageKey } = useTableUtils({
27
- tableId: 'test-table',
28
- prefix: 'table',
29
- suffix: 'test-suffix',
30
- caption: 'Test Table',
31
- componentAttributes: {},
32
- options,
33
- })
34
-
35
- expect(storageKey.value).toBe('table-test-suffix')
36
- })
37
-
38
- it('should create storage key correctly without suffix', () => {
39
- const options = ref<Partial<DataOptions>>({})
40
- const { storageKey } = useTableUtils({
41
- tableId: 'test-table',
42
- prefix: 'table',
43
- caption: 'Test Table',
44
- componentAttributes: {},
45
- options,
46
- })
47
-
48
- expect(storageKey.value).toBe('table')
49
- })
50
-
51
- it('should handle undefined headers', () => {
52
- const options = ref<Partial<DataOptions>>({})
53
- const componentAttributes = {}
54
-
55
- const { headers } = useTableUtils({
56
- tableId: 'test-table',
57
- prefix: 'table',
58
- caption: 'Test Table',
59
- componentAttributes,
60
- options,
61
- })
62
-
63
- expect(headers.value).toBeUndefined()
64
- })
65
-
66
- it('should create optionsFacade correctly', () => {
67
- const options = ref<Partial<DataOptions>>({
68
- page: 2,
69
- sortBy: [{ key: 'name', order: 'asc' }],
70
- })
71
- const componentAttributes = {
72
- page: 1,
73
- }
74
-
75
- const { optionsFacade } = useTableUtils({
76
- tableId: 'test-table',
77
- prefix: 'table',
78
- caption: 'Test Table',
79
- componentAttributes,
80
- options,
81
- })
82
-
83
- expect(optionsFacade.value).toEqual({
84
- page: 2,
85
- sortBy: [{ key: 'name', order: 'asc' }],
86
- itemsPerPage: 10,
87
- groupBy: undefined,
88
- multiSort: undefined,
89
- mustSort: undefined,
90
- })
91
- })
92
-
93
24
  it('should create propsFacade correctly for client table', () => {
94
25
  const options = ref<Partial<DataOptions>>({})
95
26
  const componentAttributes = {
@@ -97,10 +28,7 @@ describe('tableUtils', () => {
97
28
  'onUpdate:options': vi.fn(),
98
29
  }
99
30
 
100
- const { propsFacade } = useTableUtils({
101
- tableId: 'test-table',
102
- prefix: 'table',
103
- caption: 'Test Table',
31
+ const { propsFacade } = useTableProps({
104
32
  componentAttributes,
105
33
  options,
106
34
  })
@@ -117,10 +45,7 @@ describe('tableUtils', () => {
117
45
  items: [{ id: 1 }],
118
46
  }
119
47
 
120
- const { propsFacade } = useTableUtils({
121
- tableId: 'test-table',
122
- prefix: 'table',
123
- caption: 'Test Table',
48
+ const { propsFacade } = useTableProps({
124
49
  serverItemsLength: 100,
125
50
  componentAttributes,
126
51
  options,
@@ -139,10 +64,7 @@ describe('tableUtils', () => {
139
64
  })
140
65
  const componentAttributes = {}
141
66
 
142
- const { updateOptions } = useTableUtils({
143
- tableId: 'test-table',
144
- prefix: 'table',
145
- caption: 'Test Table',
67
+ const { updateOptions } = useTableProps({
146
68
  componentAttributes,
147
69
  options,
148
70
  })
@@ -156,73 +78,4 @@ describe('tableUtils', () => {
156
78
  sortBy: [{ key: 'name', order: 'desc' }],
157
79
  })
158
80
  })
159
-
160
- it('should setup local storage correctly', () => {
161
- mockLocalStorageUtility.getItem.mockReturnValue({
162
- page: 2,
163
- options: {
164
- itemsPerPage: 20,
165
- },
166
- })
167
-
168
- const options = ref<Partial<DataOptions>>({})
169
- const componentAttributes = {}
170
-
171
- const { localOptions, setupLocalStorage } = useTableUtils({
172
- tableId: 'test-table',
173
- prefix: 'table',
174
- suffix: 'test',
175
- caption: 'Test Table',
176
- componentAttributes,
177
- options,
178
- })
179
-
180
- const { watchOptions } = setupLocalStorage()
181
-
182
- expect(mockLocalStorageUtility.getItem).toHaveBeenCalledWith('table-test')
183
- expect(localOptions.value).toEqual({
184
- page: 2,
185
- options: {
186
- itemsPerPage: 20,
187
- },
188
- })
189
-
190
- // Test watchOptions
191
- options.value = {
192
- page: 3,
193
- sortBy: [{ key: 'name', order: 'asc' }],
194
- }
195
- watchOptions()
196
-
197
- expect(mockLocalStorageUtility.setItem).toHaveBeenCalledWith('table-test', expect.objectContaining({
198
- page: 3,
199
- sortBy: [{ key: 'name', order: 'asc' }],
200
- }))
201
- })
202
-
203
- it('should handle server table local storage correctly', () => {
204
- mockLocalStorageUtility.getItem.mockReturnValue(null)
205
-
206
- const options = ref<Partial<DataOptions>>({
207
- page: 1,
208
- })
209
- const componentAttributes = {}
210
-
211
- const { setupLocalStorage } = useTableUtils({
212
- tableId: 'test-table',
213
- prefix: 'server-table',
214
- caption: 'Test Table',
215
- serverItemsLength: 100,
216
- componentAttributes,
217
- options,
218
- })
219
-
220
- const { watchOptions } = setupLocalStorage()
221
- watchOptions()
222
-
223
- expect(mockLocalStorageUtility.setItem).toHaveBeenCalledWith('server-table', expect.objectContaining({
224
- page: 1,
225
- itemsLength: 100,
226
- }))
227
- })
228
81
  })
@@ -4,12 +4,20 @@ export type SortOptions = {
4
4
  }
5
5
 
6
6
  export type FilterType = 'text' | 'number' | 'date' | 'period' | 'select' | 'custom'
7
-
7
+ type FilterValue =
8
+ | string
9
+ | number
10
+ | Date
11
+ | Array<string | number | Date>
12
+ | { from: string | null, to: string | null }
13
+ | Record<string, unknown>
14
+ | null
15
+ | undefined
8
16
  export type TableDensityType = 'default' | 'comfortable' | 'compact'
9
17
 
10
18
  export interface FilterOption {
11
19
  key: string
12
- value: string | number | Date | Array<string | number | Date> | { from: string | null, to: string | null } | Record<string, unknown> | null | undefined
20
+ value: FilterValue
13
21
  type: FilterType
14
22
  }
15
23
 
@@ -65,6 +73,7 @@ export type TableColumnHeader = {
65
73
  export type SyTableProps = {
66
74
  items?: Record<string, unknown>[]
67
75
  suffix: string
76
+ saveState?: boolean
68
77
  caption?: string
69
78
  showFilters?: boolean
70
79
  filterInputConfig?: Record<string, unknown>
@@ -83,6 +92,7 @@ export type SyServerTableProps = {
83
92
  serverItemsLength: number
84
93
  items?: Record<string, unknown>[]
85
94
  suffix: string
95
+ saveState?: boolean
86
96
  caption?: string
87
97
  showFilters?: boolean
88
98
  resizableColumns?: boolean
@@ -0,0 +1,36 @@
1
+ import { toValue, type Ref } from 'vue'
2
+ import type { DataOptions, DataTableHeaders } from './types'
3
+ import { LocalStorageUtility } from '@/utils'
4
+
5
+ export type TableOptions = {
6
+ options?: Partial<DataOptions>
7
+ headers?: DataTableHeaders[]
8
+ columnWidths?: Record<string, number | string>
9
+ }
10
+
11
+ export default function useStoredOptions({
12
+ key,
13
+ saveState,
14
+ }: {
15
+ key: Ref<string>
16
+ saveState: Ref<boolean>
17
+ }): {
18
+ storedOptions: TableOptions
19
+ storeOptions: (options: TableOptions) => void
20
+ } {
21
+ const localStorageUtility = new LocalStorageUtility()
22
+
23
+ const storedOptions: TableOptions
24
+ = (saveState.value ? localStorageUtility.getItem(toValue(key)) : {}) || {}
25
+
26
+ function storeOptions(options: TableOptions): void {
27
+ if (saveState.value) {
28
+ localStorageUtility.setItem(toValue(key), options)
29
+ }
30
+ }
31
+
32
+ return {
33
+ storedOptions,
34
+ storeOptions,
35
+ }
36
+ }
@@ -11,17 +11,20 @@ import { sortHeaders } from './organizeColumns/sortHeaders'
11
11
  */
12
12
  export function useTableHeaders({
13
13
  headersProp,
14
+ storedHeaders,
14
15
  filterInputConfig = {},
15
16
  }: {
16
- headersProp: Ref<DataTableHeaders[] | undefined>
17
+ headersProp: Readonly<Ref<DataTableHeaders[] | undefined>>
18
+ storedHeaders?: DataTableHeaders[]
17
19
  filterInputConfig?: Record<string, unknown>
18
20
  }) {
19
21
  // Process headers to ensure they have title property
20
22
  const normalizedHeaders = computed(() => {
21
- if (!Array.isArray(headersProp?.value)) {
23
+ const headers = storedHeaders ?? headersProp?.value
24
+ if (!Array.isArray(headers)) {
22
25
  return undefined
23
26
  }
24
- return headersProp.value.map(header => ({
27
+ return headers.map(header => ({
25
28
  ...header,
26
29
  title: header.title ?? header.text,
27
30
  }))
@@ -34,8 +37,8 @@ export function useTableHeaders({
34
37
  })
35
38
 
36
39
  /**
37
- * Enhance header with filter type and configuration
38
- */
40
+ * Enhance header with filter type and configuration
41
+ */
39
42
  function getEnhancedHeader(column: TableColumnHeader): TableColumnHeader {
40
43
  // If column is not filterable, return as is
41
44
  if (!column.filterable) return column
@@ -63,8 +66,8 @@ export function useTableHeaders({
63
66
  }, { immediate: true, deep: true })
64
67
 
65
68
  /**
66
- * Get header by key
67
- */
69
+ * Get header by key
70
+ */
68
71
  function getHeaderByKey(key: string): TableColumnHeader | undefined {
69
72
  return normalizedHeaders.value?.find(header => header.key === key)
70
73
  }
@@ -59,29 +59,9 @@ export function useTableItems({
59
59
  return filteredItems.value.slice(start, end)
60
60
  })
61
61
 
62
- /**
63
- * Create an empty item that maintains the structure of columns
64
- * Useful for displaying empty state with correct column structure
65
- */
66
- function createEmptyItemWithStructure(): Record<string, unknown>[] {
67
- if (!headers.value || !headers.value.length) return []
68
-
69
- const emptyItem: Record<string, unknown> = {}
70
-
71
- // Create an empty object with all header keys
72
- headers.value.forEach((header) => {
73
- if (header.key) {
74
- emptyItem[header.key] = ''
75
- }
76
- })
77
-
78
- return [emptyItem]
79
- }
80
-
81
62
  return {
82
63
  processedItems,
83
64
  filteredItems,
84
65
  paginatedItems,
85
- createEmptyItemWithStructure,
86
66
  }
87
67
  }
@@ -1,4 +1,5 @@
1
1
  import {Controls, Canvas, Meta, Source} from '@storybook/blocks';
2
+ import '../../stories/styles/shared.css';
2
3
 
3
4
  import * as ToolbarContainerStories from './ToolbarContainer.stories';
4
5
 
@@ -1,10 +1,14 @@
1
1
  import { Meta, Story } from '@storybook/addon-docs';
2
2
  import * as AccessStories from './Accessibilite.stories.ts';
3
+ import '../../stories/styles/shared.css';
3
4
 
4
5
  <Meta of={AccessStories} />
5
6
 
6
- Accessibilité
7
- =============
7
+ <div className="header">
8
+ <h1>Accessibilité</h1>
9
+ <p>Informations sur l'accessibilité du composant</p>
10
+ </div>
11
+
8
12
  <Story of={AccessStories.Legende} />
9
13
  <br />
10
14