@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.
- package/dist/{DateFilter-DkqG0pmr.js → DateFilter-BylukfjR.js} +1 -1
- package/dist/{NumberFilter-Ck7AwD39.js → NumberFilter-C_bUk9o1.js} +1 -1
- package/dist/{PeriodFilter-LRI6YpgU.js → PeriodFilter-dVOmcfmt.js} +1 -1
- package/dist/{SelectFilter-DPc70Jk7.js → SelectFilter-BW8KpXkQ.js} +1 -1
- package/dist/{TextFilter-DRQL7uD8.js → TextFilter-diwVzTz7.js} +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +2785 -2770
- package/dist/components/Amelipro/AmeliproCallback/AmeliproCallback.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +7 -7
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.d.ts +30 -0
- package/dist/components/Amelipro/AmeliproContentLayout/index.d.ts +2 -0
- package/dist/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.d.ts +24 -0
- package/dist/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.d.ts +128 -0
- package/dist/components/Amelipro/AmeliproErrorTemplate/errorTemplateTypes.d.ts +2 -0
- package/dist/components/Amelipro/AmeliproErrorTemplate/types.d.ts +7 -0
- package/dist/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.d.ts +91 -0
- package/dist/components/Amelipro/AmeliproFooter/AmeliproFooter.d.ts +18 -18
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeader.d.ts +9 -9
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproMenu/AmeliproMenu.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/AmeliproPaginationBtn.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproPatientBanner/AmeliproPatientBanner.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +2766 -2751
- package/dist/components/Amelipro/AmeliproStateTile/AmeliproStateTile.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +2766 -2751
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +388 -386
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +632 -630
- package/dist/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproTransmission/AmeliproTransmission.d.ts +9 -9
- package/dist/components/CookieBanner/CookieBanner.d.ts +116 -114
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +465 -465
- package/dist/components/CookiesSelection/CookiesSelection.d.ts +103 -101
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +105 -105
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1 -1
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +634 -632
- package/dist/components/DataList/DataList.d.ts +1 -1
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +2875 -2843
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +1446 -1430
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +643 -641
- package/dist/components/DialogBox/DialogBox.d.ts +172 -169
- package/dist/components/DialogBox/config.d.ts +3 -3
- package/dist/components/DialogBox/locales.d.ts +2 -0
- package/dist/components/DialogBox/useDraggable.d.ts +8 -0
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +159 -157
- package/dist/components/FooterBar/FooterBar.d.ts +5 -5
- package/dist/components/HeaderBar/HeaderBar.d.ts +2 -2
- package/dist/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +1 -1
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +1 -1
- package/dist/components/LangBtn/LangBtn.d.ts +169 -167
- package/dist/components/LogoBrandSection/LogoBrandSection.d.ts +1 -1
- package/dist/components/NirField/NirField.d.ts +1277 -1273
- package/dist/components/PeriodField/PeriodField.d.ts +5752 -5688
- package/dist/components/PhoneField/PhoneField.d.ts +647 -636
- package/dist/components/SearchListField/SearchListField.d.ts +105 -105
- package/dist/components/SyAlert/SyAlert.d.ts +29 -29
- package/dist/components/SyTextArea/SyTextArea.d.ts +389 -387
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +207 -175
- package/dist/components/Tables/SyTable/SyTable.d.ts +208 -176
- package/dist/components/Tables/common/SyTableFilter.d.ts +1 -1
- package/dist/components/Tables/common/SyTablePagination.d.ts +105 -105
- package/dist/components/Tables/common/filters/DateFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/NumberFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/PeriodFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/SelectFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/TextFilter.d.ts +1 -1
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +82 -82
- package/dist/components/Tables/common/tableProps.d.ts +11 -0
- package/dist/components/Tables/common/types.d.ts +8 -4
- package/dist/components/Tables/common/useStoredOptions.d.ts +14 -0
- package/dist/components/Tables/common/useTableHeaders.d.ts +3 -2
- package/dist/components/Tables/common/useTableItems.d.ts +0 -1
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +16 -16
- package/dist/components/index.d.ts +4 -0
- package/dist/design-system-v3.js +166 -162
- package/dist/design-system-v3.umd.cjs +267 -262
- package/dist/main-2eWGB7zZ.js +30203 -0
- package/dist/style.css +1 -1
- package/dist/vuetifyConfig.d.ts +6 -6
- package/package.json +1 -1
- package/src/assets/amelipro/img/ico_pdf.svg +15 -0
- package/src/assets/amelipro/img/navigateurs.png +0 -0
- package/src/assets/amelipro/img/visuel_deconnexion.svg +973 -0
- package/src/assets/amelipro/img/visuel_erreur_403.svg +3652 -0
- package/src/assets/amelipro/img/visuel_erreur_404.svg +1801 -0
- package/src/assets/amelipro/img/visuel_erreur_500.svg +989 -0
- package/src/assets/amelipro/img/visuel_erreur_503.svg +1005 -0
- package/src/assets/amelipro/img/visuel_navigateur_obsolete.svg +828 -0
- package/src/assets/amelipro/pdf/charte-pour-pdf.pdf +0 -0
- package/src/components/Accordion/Accessibilite/AccessibilityGuide.mdx +5 -2
- package/src/components/Accordion/Accordion.mdx +5 -3
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.stories.ts +258 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.stories.ts +321 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +656 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.mdx +1 -3
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.stories.ts +208 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +562 -0
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.stories.ts +480 -0
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.stories.ts +267 -0
- package/src/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.stories.ts +287 -6
- package/src/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.stories.ts +433 -0
- package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.mdx +15 -0
- package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.stories.ts +44 -0
- package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.vue +55 -0
- package/src/components/Amelipro/AmeliproContentLayout/__tests__/AmeliproContentLayout.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproContentLayout/__tests__/__snapshots__/AmeliproContentLayout.spec.ts.snap +24 -0
- package/src/components/Amelipro/AmeliproContentLayout/index.ts +3 -0
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.mdx +18 -0
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.stories.ts +68 -0
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.vue +73 -0
- package/src/components/Amelipro/AmeliproCopyBtn/__tests__/AmeliproCopyBtn.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproCopyBtn/__tests__/__snapshots__/AmeliproCopyBtn.spec.ts.snap +84 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.stories.ts +422 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +2 -2
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +4 -6
- package/src/components/Amelipro/AmeliproDisclosure/AmeliproDisclosure.stories.ts +92 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.mdx +23 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.stories.ts +386 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.vue +187 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/__tests__/AmeliproErrorTemplate.spec.ts +31 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/__tests__/__snapshots__/AmeliproErrorTemplate.spec.ts.snap +185 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/errorTemplateTypes.ts +85 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/types.d.ts +7 -0
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.mdx +15 -0
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.stories.ts +71 -0
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +161 -0
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/AmeliproFilePreview.spec.ts +28 -0
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/__snapshots__/AmeliproFilePreview.spec.ts.snap +209 -0
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.stories.ts +194 -0
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.stories.ts +639 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +648 -0
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.stories.ts +392 -0
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.stories.ts +351 -0
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.stories.ts +634 -38
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +1 -1
- package/src/components/Amelipro/ServiceMenu/ServiceMenu.mdx +5 -3
- package/src/components/Amelipro/StructureMenu/StructureMenu.mdx +5 -3
- package/src/components/Amelipro/UserMenu/UserMenu.mdx +5 -3
- package/src/components/BackBtn/Accessibilite.mdx +6 -2
- package/src/components/BackBtn/BackBtn.mdx +5 -3
- package/src/components/BackBtn/BackBtn.stories.ts +1 -0
- package/src/components/BackBtn/Usages.mdx +5 -3
- package/src/components/BackToTopBtn/Accessibilite.mdx +6 -2
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +5 -4
- package/src/components/BackToTopBtn/Usages.mdx +5 -3
- package/src/components/ChipList/Accessibilite.mdx +6 -2
- package/src/components/ChipList/ChipList.mdx +5 -3
- package/src/components/CollapsibleList/Accessibilite.mdx +6 -2
- package/src/components/CollapsibleList/CollapsibleList.mdx +5 -3
- package/src/components/ContextualMenu/Accessibilite.mdx +6 -2
- package/src/components/ContextualMenu/ContextualMenu.mdx +7 -4
- package/src/components/ContextualMenu/Usages.mdx +5 -3
- package/src/components/CookieBanner/Accessibilite.mdx +6 -2
- package/src/components/CookieBanner/CookieBanner.mdx +5 -8
- package/src/components/CopyBtn/Accessibilite.mdx +6 -2
- package/src/components/CopyBtn/CopyBtn.mdx +5 -3
- package/src/components/CopyBtn/Usages.mdx +5 -3
- package/src/components/Customs/Selects/SelectBtnField/Accessibilite.mdx +6 -2
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.mdx +7 -4
- package/src/components/Customs/Selects/SelectBtnField/Usages.mdx +5 -3
- package/src/components/Customs/Selects/SelectOverview.mdx +5 -3
- package/src/components/Customs/Selects/SyBtnSelect/Accessibilite.mdx +6 -2
- package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.mdx +6 -4
- package/src/components/Customs/Selects/SyInputSelect/Accessibilite.mdx +6 -2
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.mdx +7 -2
- package/src/components/Customs/Selects/SySelect/Accessibilite.mdx +7 -3
- package/src/components/Customs/Selects/SySelect/SySelect.mdx +6 -4
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +1 -1
- package/src/components/Customs/Selects/SySelect/SySelect.vue +115 -193
- package/src/components/Customs/Selects/SySelect/Usages.mdx +5 -3
- package/src/components/Customs/SyCheckbox/Accessibilite.mdx +6 -3
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +5 -3
- package/src/components/Customs/SyIcon/Accessibilite.mdx +5 -5
- package/src/components/Customs/SyIcon/SyIcon.mdx +5 -7
- package/src/components/Customs/SyPagination/SyPagination.mdx +7 -4
- package/src/components/Customs/SyTabs/Accessibilite.mdx +4 -1
- package/src/components/Customs/SyTabs/SyTabs.mdx +5 -3
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +18 -0
- package/src/components/Customs/SyTextField/Accessibilite.mdx +6 -2
- package/src/components/Customs/SyTextField/SyTextField.mdx +5 -6
- package/src/components/Customs/SyTextField/SyTextField.vue +17 -4
- package/src/components/Customs/SyTextField/Usages.mdx +1 -0
- package/src/components/DataList/Accessibilite.mdx +6 -2
- package/src/components/DataList/DataList.mdx +5 -3
- package/src/components/DataListGroup/Accessibilite.mdx +6 -2
- package/src/components/DataListGroup/DataListGroup.mdx +5 -3
- package/src/components/DatePicker/Accessibilite.mdx +6 -2
- package/src/components/DatePicker/CalendarMode/DatePicker.mdx +5 -3
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +6 -3
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.mdx +5 -6
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +14 -3
- package/src/components/DatePicker/DatePickerOverview.mdx +5 -3
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.mdx +5 -3
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +37 -32
- package/src/components/DatePicker/DateTextInput/NoCalendar.mdx +5 -3
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +3 -0
- package/src/components/DatePicker/Usages.mdx +5 -3
- package/src/components/DiacriticPicker/DiacriticPicker.mdx +5 -3
- package/src/components/DialogBox/Accessibilite.mdx +6 -2
- package/src/components/DialogBox/DialogBox.mdx +5 -3
- package/src/components/DialogBox/DialogBox.stories.ts +83 -0
- package/src/components/DialogBox/DialogBox.vue +41 -6
- package/src/components/DialogBox/Usages.mdx +5 -3
- package/src/components/DialogBox/config.ts +3 -3
- package/src/components/DialogBox/locales.ts +2 -0
- package/src/components/DialogBox/tests/DialogBox.spec.ts +132 -3
- package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +14 -11
- package/src/components/DialogBox/useDraggable.ts +98 -0
- package/src/components/DownloadBtn/Accessibilite.mdx +6 -2
- package/src/components/DownloadBtn/DownloadBtn.mdx +7 -4
- package/src/components/DownloadBtn/DownloadBtn.vue +1 -1
- package/src/components/DownloadBtn/tests/DownloadBtn.spec.ts +2 -3
- package/src/components/ErrorPage/Accessibilite.mdx +6 -2
- package/src/components/ErrorPage/ErrorPage.mdx +5 -3
- package/src/components/ExternalLinks/Accessibilite.mdx +6 -2
- package/src/components/ExternalLinks/ExternalLinks.mdx +5 -8
- package/src/components/ExternalLinks/Usages.mdx +5 -3
- package/src/components/FileList/Accessibilite.mdx +6 -2
- package/src/components/FileList/FileList.mdx +5 -4
- package/src/components/FilePreview/Accessibilite.mdx +6 -2
- package/src/components/FilePreview/FilePreview.mdx +7 -7
- package/src/components/FileUpload/Accessibilite.mdx +6 -2
- package/src/components/FileUpload/FileUpload.mdx +7 -4
- package/src/components/FilterInline/Accessibilite.mdx +6 -2
- package/src/components/FilterInline/FilterInline.mdx +5 -5
- package/src/components/FilterSideBar/Accessibilite.mdx +6 -2
- package/src/components/FilterSideBar/FilterSideBar.mdx +5 -4
- package/src/components/FooterBar/Accessibilite.mdx +6 -2
- package/src/components/FooterBar/FooterBar.mdx +5 -3
- package/src/components/FranceConnectBtn/Accessibilite.mdx +6 -2
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +5 -3
- package/src/components/HeaderBar/Accessibilite.mdx +6 -2
- package/src/components/HeaderBar/HeaderBar.mdx +4 -4
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.mdx +6 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +9 -13
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +5 -5
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +1 -2
- package/src/components/HeaderBar/Usages.mdx +5 -3
- package/src/components/HeaderLoading/Accessibilite.mdx +2 -1
- package/src/components/HeaderLoading/HeaderLoading.mdx +5 -3
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +1 -8
- package/src/components/HeaderToolbar/Accessibilite.mdx +6 -2
- package/src/components/HeaderToolbar/HeaderToolbar.mdx +5 -3
- package/src/components/LangBtn/Accessibilite.mdx +6 -2
- package/src/components/LangBtn/LangBtn.mdx +5 -3
- package/src/components/Logo/Accessibilite.mdx +6 -2
- package/src/components/Logo/Logo.mdx +5 -3
- package/src/components/LogoBrandSection/Accessibilite.mdx +6 -2
- package/src/components/LogoBrandSection/LogoBrandSection.mdx +5 -3
- package/src/components/MaintenancePage/Accessibilite.mdx +6 -2
- package/src/components/MaintenancePage/MaintenancePage.mdx +6 -4
- package/src/components/NirField/Accessibilite.mdx +6 -2
- package/src/components/NirField/NirField.mdx +5 -7
- package/src/components/NirField/NirField.vue +13 -118
- package/src/components/NirField/Usages.mdx +5 -3
- package/src/components/NotFoundPage/Accessibilite.mdx +6 -2
- package/src/components/NotFoundPage/NotFoundPage.mdx +6 -4
- package/src/components/NotificationBar/Accessibilite.mdx +6 -2
- package/src/components/NotificationBar/NotificationBar.mdx +5 -1
- package/src/components/NotificationBar/Usages.mdx +5 -3
- package/src/components/PageContainer/Accessibilite.mdx +6 -2
- package/src/components/PageContainer/PageContainer.mdx +5 -3
- package/src/components/PaginatedTable/Accessibilite.mdx +6 -2
- package/src/components/PaginatedTable/PaginatedTable.mdx +5 -3
- package/src/components/PasswordField/Accessibilite.mdx +6 -2
- package/src/components/PasswordField/PasswordField.mdx +5 -3
- package/src/components/PeriodField/Accessibilite.mdx +6 -2
- package/src/components/PeriodField/PeriodField.mdx +5 -3
- package/src/components/PhoneField/Accessibilite.mdx +6 -2
- package/src/components/PhoneField/PhoneField.mdx +5 -3
- package/src/components/PhoneField/PhoneField.stories.ts +17 -218
- package/src/components/PhoneField/PhoneField.vue +17 -11
- package/src/components/PhoneField/Usages.mdx +5 -3
- package/src/components/PhoneField/tests/PhoneField.spec.ts +46 -0
- package/src/components/RangeField/Accessibilite.mdx +6 -2
- package/src/components/RangeField/RangeField.mdx +5 -7
- package/src/components/RatingPicker/Accessibilite.mdx +6 -2
- package/src/components/RatingPicker/RatingPicker.mdx +5 -4
- package/src/components/SearchListField/Accessibilite.mdx +6 -2
- package/src/components/SearchListField/SearchListField.mdx +7 -5
- package/src/components/SkipLink/Accessibilite.mdx +6 -2
- package/src/components/SkipLink/SkipLink.mdx +5 -3
- package/src/components/SkipLink/Usages.mdx +5 -3
- package/src/components/SocialMediaLinks/Accessibilite.mdx +6 -2
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +5 -3
- package/src/components/SubHeader/Accessibilite.mdx +6 -2
- package/src/components/SubHeader/SubHeader.mdx +5 -3
- package/src/components/SyAlert/Accessibilite.mdx +6 -2
- package/src/components/SyAlert/SyAlert.mdx +7 -4
- package/src/components/SyAlert/Usages.mdx +5 -3
- package/src/components/SyTextArea/SyTextArea.mdx +5 -3
- package/src/components/TableToolbar/Accessibilite.mdx +6 -2
- package/src/components/TableToolbar/TableToolbar.mdx +6 -3
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +5 -3
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +4 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +36 -74
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +46 -7
- package/src/components/Tables/SyTable/SyTable.mdx +5 -3
- package/src/components/Tables/SyTable/SyTable.stories.ts +5 -1
- package/src/components/Tables/SyTable/SyTable.vue +38 -60
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +9 -7
- package/src/components/Tables/common/tableProps.ts +53 -0
- package/src/components/Tables/common/tableStyles.scss +4 -0
- package/src/components/Tables/common/tests/tableUtils.spec.ts +4 -151
- package/src/components/Tables/common/types.ts +12 -2
- package/src/components/Tables/common/useStoredOptions.ts +36 -0
- package/src/components/Tables/common/useTableHeaders.ts +10 -7
- package/src/components/Tables/common/useTableItems.ts +0 -20
- package/src/components/ToolbarContainer/ToolbarContainer.mdx +1 -0
- package/src/components/UploadWorkflow/Accessibilite.mdx +6 -2
- package/src/components/UploadWorkflow/UploadWorkflow.mdx +5 -7
- package/src/components/UserMenuBtn/Accessibilite.mdx +6 -2
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +5 -3
- package/src/components/index.ts +4 -0
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +2 -65
- package/src/stories/Accessibilite/Audit/RGAA.mdx +2 -20
- package/src/stories/Accessibilite/AuditDesignSystem.mdx +4 -47
- package/src/stories/Accessibilite/Avancement/Avancement.mdx +5 -68
- package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +267 -198
- package/src/stories/Accessibilite/Introduction.mdx +2 -20
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +4 -21
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +3 -20
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +5 -50
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +3 -46
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.mdx +3 -39
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/Utilisation.mdx +4 -54
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +4 -51
- package/src/stories/Accessibilite/Vuetify/Vuetify.mdx +3 -11
- package/src/stories/Accessibilite/Vuetify/Vuetify.stories.ts +2 -2
- package/src/stories/Accessibilite/Vuetify/VuetifyItems.ts +6 -3
- package/src/stories/Components/Components.stories.ts +1 -1
- package/src/stories/Demarrer/CreerUneIssue.mdx +4 -1
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +0 -2
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +3 -0
- package/src/stories/Demarrer/Releases.mdx +0 -2
- package/src/stories/Demarrer/Releases.stories.ts +3 -0
- package/src/stories/DesignTokens/Arrondis.mdx +7 -1
- package/src/stories/DesignTokens/Colors.mdx +7 -1
- package/src/stories/DesignTokens/Conteneurs.mdx +6 -1
- package/src/stories/DesignTokens/Elevations.mdx +7 -1
- package/src/stories/DesignTokens/Espacements.mdx +7 -1
- package/src/stories/DesignTokens/Introduction.mdx +5 -3
- package/src/stories/DesignTokens/StylesTypographiques.mdx +6 -1
- package/src/stories/DesignTokens/Typographie.mdx +5 -1
- package/src/stories/Directives/SvgDirective.mdx +3 -22
- package/src/stories/EcoConception/EcoGuideComponent.vue +569 -0
- package/src/stories/EcoConception/Introduction.mdx +190 -13
- package/src/stories/EcoConception/Referentiel.mdx +13 -0
- package/src/stories/EcoConception/datas/back_rules.json +184 -0
- package/src/stories/EcoConception/datas/ux_ui_rules.json +1073 -0
- package/src/stories/EcoConception/ecoconception.stories.ts +30 -0
- package/src/stories/GuideDuDev/ClassesUtilitaires/DataUtilities.mdx +7 -3
- package/src/stories/GuideDuDev/ClassesUtilitaires/DomBrowserUtilities.mdx +9 -1
- package/src/stories/GuideDuDev/ClassesUtilitaires/FormattingUtilities.mdx +7 -3
- package/src/stories/GuideDuDev/ClassesUtilitaires/StorageUtilities.mdx +5 -1
- package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationRules.mdx +7 -3
- package/src/stories/GuideDuDev/ClassesUtilitaires/ValidationUtilities.mdx +7 -3
- package/src/stories/GuideDuDev/ClassesUtilitaires/index.mdx +5 -2
- package/src/stories/GuideDuDev/FormValidationGuide.mdx +7 -3
- package/src/stories/GuideDuDev/LesBreackingChanges.mdx +6 -2
- package/src/stories/GuideDuDev/MigrationDepuisBridge.mdx +7 -2
- package/src/stories/GuideDuDev/MigrationDepuisVue2.mdx +7 -2
- package/src/stories/GuideDuDev/PortailAgent.mdx +6 -1
- package/src/stories/GuideDuDev/Theme.mdx +8 -2
- package/src/stories/GuideDuDev/UtiliserLesRules.mdx +7 -3
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +8 -3
- package/src/stories/GuideDuDev/vuetifyOptions.mdx +5 -1
- package/src/stories/Templates/Templates.stories.ts +1 -1
- package/src/stories/styles/shared.css +16 -0
- package/src/utils/rules/Rules.mdx +26 -3
- package/src/utils/rules/doMatchPattern/DoMachPattern.mdx +27 -4
- package/src/utils/rules/isDateValid/IsDateValid.mdx +27 -4
- package/src/utils/rules/isExactLength/IsExactLenght.mdx +27 -4
- package/src/utils/rules/isHolidayDay/IsHolidayDay.mdx +27 -4
- package/src/utils/rules/isMaxLength/IsMaxLength.mdx +27 -4
- package/src/utils/rules/isMinLength/IsMinLength.mdx +27 -4
- package/src/utils/rules/isNotAfterDate/IsNotAfterDate.mdx +27 -4
- package/src/utils/rules/isNotAfterToday/IsNotAfterToday.mdx +27 -4
- package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.mdx +27 -4
- package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.mdx +27 -3
- package/src/utils/rules/isRequired/IsRequired.mdx +27 -4
- package/src/utils/rules/isValidEmail/IsValidEmail.mdx +27 -4
- package/dist/components/Tables/common/tableStorageUtils.d.ts +0 -69
- package/dist/components/Tables/common/tableUtils.d.ts +0 -79
- package/dist/main-DXMoMtj5.js +0 -29904
- package/dist/stories/EcoConception/ecoDesignItems.d.ts +0 -4
- package/src/components/DownloadBtn/tests/__snapshots__/DownloadBtn.spec.ts.snap +0 -92
- package/src/components/Tables/common/tableStorageUtils.ts +0 -127
- package/src/components/Tables/common/tableUtils.ts +0 -102
- package/src/stories/EcoConception/ecoDesignItems.ts +0 -55
- 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
|
-
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
|
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
|
|
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
|
-
//
|
|
193
|
+
// Save options, headers, and column widths to local storage whenever they change
|
|
193
194
|
watch(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
watch(
|
|
202
|
-
() => options.value,
|
|
195
|
+
[
|
|
196
|
+
() => options.value,
|
|
197
|
+
() => headers.value,
|
|
198
|
+
() => reactiveColumnWidths.value,
|
|
199
|
+
],
|
|
203
200
|
() => {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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('
|
|
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
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'
|
|
2
2
|
import { ref } from 'vue'
|
|
3
|
-
import {
|
|
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 } =
|
|
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 } =
|
|
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 } =
|
|
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:
|
|
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
|
-
|
|
23
|
+
const headers = storedHeaders ?? headersProp?.value
|
|
24
|
+
if (!Array.isArray(headers)) {
|
|
22
25
|
return undefined
|
|
23
26
|
}
|
|
24
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
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,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
|
-
|
|
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
|
|