@cnamts/synapse 1.0.24 → 1.0.26
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/README.md +27 -5
- package/dist/{AutocompleteFilter-BWLR3U7W.js → AutocompleteFilter-BPR-a55G.js} +1 -1
- package/dist/{DateFilter-BpwFexzi.js → DateFilter-CknrJWs2.js} +2 -2
- package/dist/{NumberFilter-Bz_NTdX9.js → NumberFilter-DJ-yNlzv.js} +1 -1
- package/dist/{PeriodFilter-DX_wy9g-.js → PeriodFilter-CiB5Oa9Z.js} +1 -1
- package/dist/{SelectFilter-xqiPtPgX.js → SelectFilter-EiafX97M.js} +2 -2
- package/dist/{TextFilter-BBl3JFqK.js → TextFilter-BzOmpdxj.js} +1 -1
- package/dist/{apLightTheme-D1P4jcD0.js → apLightTheme-DS0Uy44H.js} +446 -723
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +14 -8
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +60 -289
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +1 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +4 -0
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +1 -0
- package/dist/components/Customs/SyTabs/SyTabs.d.ts +13 -11
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +0 -2
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +54 -73
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +31 -40
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +9 -14
- package/dist/components/DatePicker/composables/useDatePickerState.d.ts +4 -3
- package/dist/components/DatePicker/composables/useDateTextField.d.ts +2 -2
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +2 -2
- package/dist/components/DatePicker/types.d.ts +1 -2
- package/dist/components/FileList/FileList.d.ts +6 -0
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +2 -0
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +13 -13
- package/dist/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +3 -3
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +1 -0
- package/dist/components/MonthPicker/MonthPicker.d.ts +2 -7
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +2 -7
- package/dist/components/NirField/NirField.d.ts +12 -20
- package/dist/components/NirField/useNirValidation.d.ts +6 -2
- package/dist/components/PeriodField/PeriodField.d.ts +110 -150
- package/dist/components/PhoneField/PhoneField.d.ts +12 -7
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +0 -3
- package/dist/components/RatingPicker/EmotionPicker/EmotionPicker.d.ts +3 -1
- package/dist/components/RatingPicker/NumberPicker/NumberPicker.d.ts +4 -3
- package/dist/components/RatingPicker/RatingPicker.d.ts +18 -5
- package/dist/components/RatingPicker/StarsPicker/StarsPicker.d.ts +3 -1
- package/dist/components/RatingPicker/tests/RatingPicker.a11y.spect.d.ts +1 -0
- package/dist/components/RatingPicker/useRatingFocus.d.ts +18 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -4
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -4
- package/dist/components/Tables/common/SyTablePagination.d.ts +154 -364
- package/dist/components/Tables/common/TableHeader.d.ts +6 -1
- package/dist/components/Tables/common/filters/DateFilter.d.ts +4 -4
- package/dist/components/Tables/common/locales.d.ts +3 -0
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +1 -0
- package/dist/composables/date/useDateInitializationDayjs.d.ts +3 -1
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +230 -0
- package/dist/composables/unifyValidation/useCustomValidation.d.ts +3 -1
- package/dist/composables/unifyValidation/useValidation.d.ts +12 -6
- package/dist/composables/unifyValidation/useVuetifyValidation.d.ts +1 -1
- package/dist/composables/validation/useValidation.d.ts +6 -1
- package/dist/design-system-v3.js +2 -2
- package/dist/designTokens/tokens/amelipro/apColors.d.ts +10 -10
- package/dist/designTokens/tokens/amelipro/apColors2026.d.ts +1 -2
- package/dist/designTokens/tokens/amelipro/apContextual.d.ts +44 -0
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +2 -0
- package/dist/designTokens/tokens/amelipro/apSemantic.d.ts +1 -1
- package/dist/designTokens/tokens/baseColors.d.ts +127 -0
- package/dist/designTokens/tokens/baseContextualTokens.d.ts +50 -0
- package/dist/designTokens/tokens/cnam/cnamColors.d.ts +10 -10
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +2 -0
- package/dist/designTokens/tokens/cnam/cnamSemantic.d.ts +1 -1
- package/dist/designTokens/tokens/pa/paColors.d.ts +1 -166
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +1 -1
- package/dist/designTokens/utils/buildColorClassMap.d.ts +12 -0
- package/dist/designTokens/utils/createFlattenTheme.d.ts +1 -3
- package/dist/designTokens/utils/index.d.ts +2 -2
- package/dist/{main-BtTqyn4z.js → main-BsJ9ec3i.js} +16021 -15715
- package/dist/synapse.css +1 -1
- package/dist/utils/functions/classToHex.d.ts +1 -1
- package/dist/utils/functions/createHexResolver.d.ts +16 -0
- package/dist/vuetifyConfig.js +113 -152
- package/package.json +35 -23
- package/src/assets/amelipro/apTokens2026.scss +5 -5
- package/src/assets/overrides/_breakpoints.scss +25 -0
- package/src/assets/overrides/_btns.scss +0 -2
- package/src/assets/overrides/_forms.scss +1 -3
- package/src/assets/overrides/_icons.scss +5 -22
- package/src/assets/overrides/_otp.scss +40 -0
- package/src/assets/overrides/_tables.scss +11 -20
- package/src/assets/overrides/_tooltips.scss +17 -7
- package/src/assets/overrides/_typography.scss +35 -37
- package/src/assets/overrides/_utilities.scss +43 -47
- package/src/assets/themes.scss +1 -0
- package/src/components/Accordion/Accordion.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.vue +20 -20
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.vue +12 -14
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +4 -6
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.vue +5 -5
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +4 -6
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.vue +4 -6
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.vue +4 -6
- package/src/components/Amelipro/AmeliproBreadcrumb/AmeliproBreadcrumb.vue +1 -3
- package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.vue +4 -6
- package/src/components/Amelipro/AmeliproCallback/AmeliproCallback.vue +2 -2
- package/src/components/Amelipro/AmeliproCard/AmeliproCard.vue +31 -31
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.vue +5 -7
- package/src/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.vue +13 -15
- package/src/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.vue +23 -23
- package/src/components/Amelipro/AmeliproChips/AmeliproChips.vue +1 -3
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.vue +17 -12
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.vue +4 -6
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +13 -13
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproDentalChart.vue +4 -2
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproTooth/AmeliproTooth.vue +4 -4
- package/src/components/Amelipro/AmeliproDialog/AmeliproDialog.vue +5 -7
- package/src/components/Amelipro/AmeliproDisclosure/AmeliproDisclosure.vue +1 -3
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.vue +2 -4
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +4 -6
- package/src/components/Amelipro/AmeliproFilters/AmeliproFilters.vue +13 -13
- package/src/components/Amelipro/AmeliproFirstLogin/AmeliproFirstLogin.vue +3 -5
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.vue +1 -3
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +2 -4
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.vue +1 -3
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.vue +20 -16
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.vue +2 -4
- package/src/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.vue +5 -7
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.vue +6 -8
- package/src/components/Amelipro/AmeliproMailTile/AmeliproMailTile.vue +14 -14
- package/src/components/Amelipro/AmeliproMenu/AmeliproMenu.vue +11 -13
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenu.vue +2 -4
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingLayout.vue +8 -8
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.vue +40 -40
- package/src/components/Amelipro/AmeliproNumberedCard/AmeliproNumberedCard.vue +27 -27
- package/src/components/Amelipro/AmeliproOnboarding/AmeliproOnboarding.vue +3 -5
- package/src/components/Amelipro/AmeliproPageLayout/AmeliproPageLayout.vue +2 -4
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.vue +2 -4
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/AmeliproPaginationBtn.vue +3 -5
- package/src/components/Amelipro/AmeliproPatientBanner/AmeliproPatientBanner.vue +1 -3
- package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.vue +2 -4
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLogin.vue +4 -4
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLoginForm/AmeliproPatientLoginForm.vue +1 -3
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.vue +3 -5
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.vue +3 -5
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.vue +23 -23
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +4 -6
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +12 -22
- package/src/components/Amelipro/AmeliproStateTile/AmeliproStateTile.vue +10 -12
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepper.vue +17 -17
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +8 -10
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/AmeliproTabBtn.vue +6 -8
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +4 -4
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.vue +4 -6
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +7 -9
- package/src/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.vue +3 -5
- package/src/components/Amelipro/AmeliproTooltips/AmeliproTooltips.vue +0 -2
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.vue +6 -6
- package/src/components/Amelipro/ServiceMenu/ServiceMenu.vue +2 -2
- package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +4 -4
- package/src/components/Amelipro/StructureMenu/StructureItem/StructureItem.vue +4 -6
- package/src/components/Amelipro/StructureMenu/StructureMenu.vue +2 -2
- package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +2 -2
- package/src/components/Amelipro/UserMenu/UserMenu.vue +1 -3
- package/src/components/BackBtn/tests/BackBtn.visual.cy.ts +43 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-custom-bg.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-dark-mode.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-default.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-no-icon.snap.png +0 -0
- package/src/components/Captcha/Captcha.vue +1 -3
- package/src/components/ChipList/ChipList.vue +14 -16
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -3
- package/src/components/CookiesSelection/CookiesSelection.vue +2 -1
- package/src/components/CopyBtn/CopyBtn.vue +10 -3
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +17 -17
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +31 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +66 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +8 -4
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +18 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +66 -0
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.vue +4 -6
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +414 -135
- package/src/components/Customs/Selects/SySelect/SySelect.vue +502 -257
- package/src/components/Customs/Selects/SySelect/accessibilite/Accessibility.mdx +199 -269
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +278 -4
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +3 -3
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +5 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +52 -2
- package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +18 -3
- package/src/components/Customs/SyPagination/SyPagination.vue +0 -2
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +23 -5
- package/src/components/Customs/SyTabs/SyTabs.mdx +0 -58
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +34 -35
- package/src/components/Customs/SyTabs/SyTabs.vue +87 -67
- package/src/components/Customs/SyTabs/accessibilite/Accessibility.mdx +83 -23
- package/src/components/Customs/SyTabs/config.ts +3 -3
- package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +88 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +46 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +21 -41
- package/src/components/Customs/SyTextField/SyTextField.vue +34 -9
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +29 -28
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +28 -23
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +24 -1
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +65 -33
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +1 -1
- package/src/components/DatePicker/composables/tests/useDatePickerState.spec.ts +53 -0
- package/src/components/DatePicker/composables/useDatePickerState.ts +56 -13
- package/src/components/DatePicker/composables/useDateRangeInput.ts +2 -1
- package/src/components/DatePicker/composables/useDateSelection.ts +2 -1
- package/src/components/DatePicker/composables/useDateTextField.ts +2 -3
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +2 -2
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +9 -8
- package/src/components/DatePicker/playground/DatePickerHolidayRule.vue +1 -1
- package/src/components/DatePicker/types.ts +1 -2
- package/src/components/DialogBox/DialogBox.stories.ts +8 -8
- package/src/components/DialogBox/DialogBox.vue +3 -5
- package/src/components/DialogBox/accessibilite/Accessibility.mdx +86 -22
- package/src/components/DialogBox/tests/DialogBox.visual.cy.ts +76 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-custom-texts.snap.png +0 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-default.snap.png +0 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-no-actions.snap.png +0 -0
- package/src/components/FileList/FileList.vue +9 -2
- package/src/components/FileList/UploadItem/UploadItem.vue +11 -13
- package/src/components/FileList/tests/FileList.spec.ts +47 -0
- package/src/components/FileUpload/FileUpload.vue +3 -5
- package/src/components/FileUpload/FileUploadContent.vue +3 -5
- package/src/components/FilterInline/FilterInline.vue +1 -3
- package/src/components/FilterSideBar/FilterSideBar.mdx +44 -1
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +105 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +9 -1
- package/src/components/FilterSideBar/tests/FilterSideBar.a11y.spec.ts +54 -1
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +42 -0
- package/src/components/FooterBar/FooterBar.vue +9 -13
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +1 -1
- package/src/components/HeaderBar/HeaderBar.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +0 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +8 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +0 -8
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.visual.cy.ts +196 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/header-burger-menu-generated-submenu-open.snap.png +0 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/header-burger-menu-generated.snap.png +0 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +0 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +6 -7
- package/src/components/HeaderBar/tests/HeaderBar.visual.cy.ts +81 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-custom-width.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-default.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-no-sticky.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-prepend.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-side.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-subtitle.snap.png +0 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +12 -3
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +15 -8
- package/src/components/HeaderToolbar/HeaderToolbar.vue +6 -7
- package/src/components/LangBtn/LangBtn.vue +4 -5
- package/src/components/Logo/tests/Logo.visual.cy.ts +57 -0
- package/src/components/Logo/tests/__snapshots__/logo-avatar.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-dark.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-default.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-no-organism.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-no-signature.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-risque-pro.snap.png +0 -0
- package/src/components/LogoBrandSection/LogoBrandSection.vue +2 -2
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +1 -1
- package/src/components/NirField/NirField.stories.ts +2 -2
- package/src/components/NirField/NirField.vue +3 -5
- package/src/components/NirField/accessibilite/Accessibility.mdx +100 -5
- package/src/components/NirField/tests/NirField.spec.ts +118 -0
- package/src/components/NirField/tests/useNirValidation.spec.ts +449 -0
- package/src/components/NirField/useNirValidation.ts +38 -32
- package/src/components/NotificationBar/Notification/Notification.vue +7 -9
- package/src/components/NotificationBar/NotificationBar.vue +1 -3
- package/src/components/PaginatedTable/PaginatedTable.vue +3 -4
- package/src/components/PaginatedTable/Pagination.vue +4 -6
- package/src/components/PasswordField/PasswordField.vue +15 -13
- package/src/components/PhoneField/PhoneField.vue +7 -5
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +11 -20
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +1 -1
- package/src/components/RangeField/tests/RangeField.visual.cy.ts +65 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-custom-bg.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-custom-range.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-default.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-step.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-with-label.snap.png +0 -0
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +38 -56
- package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +5 -0
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +48 -53
- package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +2 -1
- package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +40 -13
- package/src/components/RatingPicker/RatingPicker.stories.ts +65 -88
- package/src/components/RatingPicker/RatingPicker.vue +71 -15
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +31 -42
- package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +1 -1
- package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +5 -0
- package/src/components/RatingPicker/accessibilite/Accessibility.mdx +137 -9
- package/src/components/RatingPicker/tests/RatingPicker.a11y.spect.ts +123 -0
- package/src/components/RatingPicker/tests/RatingPicker.spec.ts +3 -2
- package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +40 -11
- package/src/components/RatingPicker/useRatingFocus.ts +97 -0
- package/src/components/SearchListField/SearchListField.vue +0 -2
- package/src/components/SkipLink/SkipLink.vue +2 -4
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +6 -6
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SyAlert/SyAlert.vue +7 -9
- package/src/components/SyAlert/tests/SyAlert.visual.cy.ts +46 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-closable.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-error.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-info.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-success.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-variant-outlined.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-variant-tonal.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-warning.snap.png +0 -0
- package/src/components/SyBtnMenu/SyBtnMenu.vue +2 -4
- package/src/components/SyTextArea/SyTextArea.vue +32 -1
- package/src/components/TableToolbar/TableToolbar.vue +6 -8
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +166 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +10 -8
- package/src/components/Tables/SyServerTable/tests/SyServerTable.a11y.spec.ts +23 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +268 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +104 -0
- package/src/components/Tables/SyTable/SyTable.vue +10 -8
- package/src/components/Tables/SyTable/tests/SyTable.a11y.spec.ts +22 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +274 -0
- package/src/components/Tables/common/SyTableFilter.vue +31 -6
- package/src/components/Tables/common/SyTablePagination.vue +143 -19
- package/src/components/Tables/common/TableHeader.vue +41 -4
- package/src/components/Tables/common/filters/DateFilter.vue +2 -2
- package/src/components/Tables/common/filters/SelectFilter.vue +1 -1
- package/src/components/Tables/common/locales.ts +3 -0
- package/src/components/Tables/common/tableStyles.scss +16 -19
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +18 -0
- package/src/components/Tables/common/tests/TableHeader.spec.ts +39 -0
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/Tables/common/useTableHeaders.ts +49 -27
- package/src/components/UploadWorkflow/UploadWorkflow.vue +1 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +23 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +66 -0
- package/src/components/UploadWorkflow/useFileList.ts +3 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -3
- package/src/composables/date/tests/useDateFormatDayjs.spec.ts +81 -0
- package/src/composables/date/tests/{useDateInitialization.spec.ts → useDateInitializationDayjs.spec.ts} +39 -3
- package/src/composables/date/useDateInitializationDayjs.ts +4 -1
- package/src/composables/unifyValidation/documentationValidationProps.ts +235 -0
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +2 -1
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +22 -0
- package/src/composables/unifyValidation/useCustomValidation.ts +16 -4
- package/src/composables/unifyValidation/useValidation.ts +46 -15
- package/src/composables/unifyValidation/useVuetifyValidation.ts +2 -2
- package/src/composables/useFormFieldErrorHandling.ts +4 -1
- package/src/composables/validation/tests/useValidation.spec.ts +2 -2
- package/src/composables/validation/useValidation.ts +32 -4
- package/src/composantsVuetify/VBreadcrumbs/VBreadcrumbs.mdx +28 -0
- package/src/composantsVuetify/VBreadcrumbs/v-breadcrumbs.stories.ts +108 -0
- package/src/composantsVuetify/VCard/VCard.mdx +59 -0
- package/src/composantsVuetify/VCard/v-card.stories.ts +279 -0
- package/src/composantsVuetify/VOtpInput/VOtpInput.mdx +39 -0
- package/src/composantsVuetify/VOtpInput/v-otp-input.stories.ts +56 -0
- package/src/composantsVuetify/VSkeletonLoader/VSkeletonLoader.mdx +42 -0
- package/src/composantsVuetify/VSkeletonLoader/v-skeleton-loader.stories.ts +77 -0
- package/src/composantsVuetify/VSwitch/VSwitch.mdx +47 -0
- package/src/composantsVuetify/VSwitch/v-switch.stories.ts +166 -0
- package/src/designTokens/tests/buildColorClassMap.spec.ts +31 -0
- package/src/designTokens/tests/generateScssTokens.spec.ts +12 -0
- package/src/designTokens/tests/themeUtils.spec.ts +53 -0
- package/src/designTokens/tokens/amelipro/apColors.ts +8 -130
- package/src/designTokens/tokens/amelipro/apColors2026.ts +3 -15
- package/src/designTokens/tokens/amelipro/apContextual.ts +55 -47
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +4 -1
- package/src/designTokens/tokens/amelipro/apSemantic.ts +1 -1
- package/src/designTokens/tokens/baseColors.ts +129 -0
- package/src/designTokens/tokens/baseContextualTokens.ts +52 -0
- package/src/designTokens/tokens/cnam/cnamColors.ts +3 -125
- package/src/designTokens/tokens/cnam/cnamContextual.ts +4 -48
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +4 -1
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +1 -1
- package/src/designTokens/tokens/pa/paColors.ts +2 -166
- package/src/designTokens/tokens/pa/paContextual.ts +3 -48
- package/src/designTokens/tokens/pa/paLightTheme.ts +1 -1
- package/src/designTokens/tokens/pa/paSemantic.ts +2 -2
- package/src/designTokens/utils/buildColorClassMap.ts +34 -0
- package/src/designTokens/utils/convertSemanticsToken.ts +8 -11
- package/src/designTokens/utils/createFlattenTheme.ts +15 -7
- package/src/designTokens/utils/index.ts +2 -2
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +61 -91
- package/src/stories/Accessibilite/AuditDesignSystem.mdx +5 -19
- package/src/stories/Accessibilite/AuditEtContreAudit/Exemptions-derogations.mdx +1 -1
- package/src/stories/Accessibilite/AuditEtContreAudit/Introduction.mdx +11 -8
- package/src/stories/Accessibilite/AuditEtContreAudit/RGAA.mdx +6 -7
- package/src/stories/Accessibilite/DesignSystem/Avancement.mdx +433 -0
- package/src/stories/Accessibilite/DesignSystem/a11y-status.json +692 -0
- package/src/stories/Accessibilite/Introduction.mdx +30 -30
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +176 -79
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +67 -19
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +78 -50
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +23 -49
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.stories.ts +6 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/Utilisation.mdx +7 -19
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +55 -67
- package/src/stories/Components/Components.stories.ts +92 -4
- package/src/stories/Demarrer/EnrichirLeDesignSystem.mdx +4 -9
- package/src/stories/Demarrer/EnrichirLeDesignSystem.stories.ts +28 -0
- package/src/stories/Demarrer/Releases.stories.ts +48 -5
- package/src/stories/DesignTokens/ColorDisplay.vue +6 -5
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +2 -4
- package/src/stories/DesignTokens/colors.stories.ts +5 -6
- package/src/stories/GuideDuDev/CreateVuetifyInstance.mdx +95 -0
- package/src/stories/GuideDuDev/Theme.mdx +36 -26
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +3 -2
- package/src/stories/styles/accessibility-guide.css +3 -3
- package/src/utils/functions/classToHex.ts +6 -34
- package/src/utils/functions/createHexResolver.ts +45 -0
- package/src/utils/functions/tests/classToHex.spec.ts +36 -0
- package/src/utils/functions/tests/convertToHex.spec.ts +31 -0
- package/src/utils/functions/tests/createHexResolver.spec.ts +66 -0
- package/src/utils/functions/tests/isCssColor.spec.ts +48 -0
- package/dist/AutocompleteFilter-D9jzRzAL.cjs +0 -1
- package/dist/DateFilter-DTUl8hb1.cjs +0 -1
- package/dist/NumberFilter-MAEojdk0.cjs +0 -1
- package/dist/PeriodFilter-CC4WgIhl.cjs +0 -1
- package/dist/SelectFilter-BR3fvl-a.cjs +0 -1
- package/dist/TextFilter-CCfYFl5F.cjs +0 -1
- package/dist/apLightTheme-CFSRrjv2.cjs +0 -1
- package/dist/composables/date/useDateFormat.d.ts +0 -26
- package/dist/composables/date/useDateInitialization.d.ts +0 -18
- package/dist/design-system-v3.umd.cjs +0 -1
- package/dist/designTokens/utils/convertGaps.d.ts +0 -5
- package/dist/main-C1e3eoxd.cjs +0 -1067
- package/dist/tooth-11-D3sLWv2n.cjs +0 -1
- package/dist/tooth-12-CXrLuH03.cjs +0 -1
- package/dist/tooth-13-BSfo5fpT.cjs +0 -1
- package/dist/tooth-14-DMzulx0h.cjs +0 -1
- package/dist/tooth-15-BKRFVi-9.cjs +0 -1
- package/dist/tooth-16-CpuxAbuM.cjs +0 -1
- package/dist/tooth-17-BPoahUdg.cjs +0 -1
- package/dist/tooth-18-DhHJz8sy.cjs +0 -1
- package/dist/tooth-21-Dgd5hn_X.cjs +0 -1
- package/dist/tooth-22-C2Tn19sB.cjs +0 -1
- package/dist/tooth-23-C9uaaSGb.cjs +0 -1
- package/dist/tooth-24-BrK9UGpf.cjs +0 -1
- package/dist/tooth-25-CE_EfGNp.cjs +0 -1
- package/dist/tooth-26-Ctv4i9Fy.cjs +0 -1
- package/dist/tooth-27-C5J7JkWM.cjs +0 -1
- package/dist/tooth-28-Z9oWqjo0.cjs +0 -1
- package/dist/tooth-31-BrYqmkTi.cjs +0 -1
- package/dist/tooth-32-BNNR0oCZ.cjs +0 -1
- package/dist/tooth-33-DuxvqO2J.cjs +0 -1
- package/dist/tooth-34-BCSCXMB6.cjs +0 -1
- package/dist/tooth-35-BLUXkX88.cjs +0 -1
- package/dist/tooth-36-IrKHYqlA.cjs +0 -1
- package/dist/tooth-37-BYqpdMwo.cjs +0 -1
- package/dist/tooth-38-B_eNXXdu.cjs +0 -1
- package/dist/tooth-41-Ddva4Ot8.cjs +0 -1
- package/dist/tooth-42-szcDqlM0.cjs +0 -1
- package/dist/tooth-43-B3ka6rQm.cjs +0 -1
- package/dist/tooth-44-CazyQucj.cjs +0 -1
- package/dist/tooth-45-B4HQtc8n.cjs +0 -1
- package/dist/tooth-46-BPM40gbG.cjs +0 -1
- package/dist/tooth-47-Dvr20dlh.cjs +0 -1
- package/dist/tooth-48-Bd8ljGsF.cjs +0 -1
- package/dist/tooth-51-OBpwCOF3.cjs +0 -1
- package/dist/tooth-52-aKxyHcmq.cjs +0 -1
- package/dist/tooth-53-vCwJjTOc.cjs +0 -1
- package/dist/tooth-54-DsWu2iFy.cjs +0 -1
- package/dist/tooth-55-BxC1X2Dn.cjs +0 -1
- package/dist/tooth-61-BbLvxMQi.cjs +0 -1
- package/dist/tooth-62-CmTkWczP.cjs +0 -1
- package/dist/tooth-63-DI7l_2qI.cjs +0 -1
- package/dist/tooth-64-B21sOsJh.cjs +0 -1
- package/dist/tooth-65-D2ZC2VEr.cjs +0 -1
- package/dist/tooth-71-D473PPO5.cjs +0 -1
- package/dist/tooth-72-Drh1wnNu.cjs +0 -1
- package/dist/tooth-73-DzlwYI23.cjs +0 -1
- package/dist/tooth-74-8aGvcZPg.cjs +0 -1
- package/dist/tooth-75-BFK7At_r.cjs +0 -1
- package/dist/tooth-81-BZmR-I0M.cjs +0 -1
- package/dist/tooth-82-euVfUUZV.cjs +0 -1
- package/dist/tooth-83-KV010j64.cjs +0 -1
- package/dist/tooth-84-BBg1RjhZ.cjs +0 -1
- package/dist/tooth-85-Cr-kc1wM.cjs +0 -1
- package/dist/vuetifyConfig.umd.cjs +0 -1
- package/src/assets/apTokens.scss +0 -343
- package/src/assets/overrides/_container.scss +0 -36
- package/src/assets/tokens.scss +0 -388
- package/src/composables/date/tests/useDateFormat.spec.ts +0 -67
- package/src/composables/date/useDateFormat.ts +0 -110
- package/src/composables/date/useDateInitialization.ts +0 -92
- package/src/designTokens/apColors.md +0 -66
- package/src/designTokens/cnamColors.md +0 -193
- package/src/designTokens/paColors.md +0 -66
- package/src/designTokens/tokens/json/contextual-tokens.json +0 -156
- package/src/designTokens/tokens/json/primitives.json +0 -209
- package/src/designTokens/tokens/json/semantic.json +0 -120
- package/src/designTokens/utils/convertGaps.ts +0 -11
- package/src/stories/Accessibilite/Avancement/Avancement.mdx +0 -533
- package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +0 -306
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, nextTick, onMounted, ref, inject, watch, type Ref, onUnmounted } from 'vue'
|
|
3
|
-
import type { VDataTable, VDataTableServer } from 'vuetify/components'
|
|
3
|
+
import type { VDataTable, VDataTableServer } from 'vuetify/components/VDataTable'
|
|
4
4
|
import { locales } from './locales'
|
|
5
5
|
import SyIcon from '@/components/Customs/SyIcon/SyIcon.vue'
|
|
6
6
|
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
headerParams: Parameters<VDataTable['$slots']['headers']>['0']
|
|
15
15
|
table: VDataTable | VDataTableServer | null | undefined
|
|
16
16
|
resizableColumns?: boolean
|
|
17
|
+
wrapTitle?: boolean
|
|
17
18
|
storageKey?: string
|
|
18
19
|
headerPropsRaw?: HeaderPropsRaw
|
|
19
20
|
}>(), {
|
|
20
21
|
resizableColumns: false,
|
|
22
|
+
wrapTitle: false,
|
|
21
23
|
storageKey: undefined,
|
|
22
24
|
headerPropsRaw: undefined,
|
|
23
25
|
})
|
|
@@ -198,13 +200,27 @@
|
|
|
198
200
|
const index = props.headerParams.sortBy.findIndex(sort => sort.key === props.column.key)
|
|
199
201
|
return index !== -1 ? index + 1 : null
|
|
200
202
|
})
|
|
203
|
+
|
|
204
|
+
const titleClasses = computed(() => [
|
|
205
|
+
textAlignClass.value,
|
|
206
|
+
headerClassRaw.value,
|
|
207
|
+
{ 'col-title--wrap': props.wrapTitle },
|
|
208
|
+
])
|
|
209
|
+
|
|
210
|
+
const wrapperClasses = computed(() => [
|
|
211
|
+
alignClass.value,
|
|
212
|
+
{
|
|
213
|
+
'h-100': !props.wrapTitle,
|
|
214
|
+
'v-data-table-header__content--wrap': props.wrapTitle,
|
|
215
|
+
},
|
|
216
|
+
])
|
|
201
217
|
</script>
|
|
202
218
|
|
|
203
219
|
<template>
|
|
204
220
|
<div
|
|
205
221
|
ref="wrapper"
|
|
206
|
-
class="v-data-table-header__content d-flex align-center
|
|
207
|
-
:class="
|
|
222
|
+
class="v-data-table-header__content d-flex align-center w-100"
|
|
223
|
+
:class="wrapperClasses"
|
|
208
224
|
>
|
|
209
225
|
<slot
|
|
210
226
|
:name="`header.${column.key}`"
|
|
@@ -216,7 +232,7 @@
|
|
|
216
232
|
>
|
|
217
233
|
<div
|
|
218
234
|
class="col-title"
|
|
219
|
-
:class="
|
|
235
|
+
:class="titleClasses"
|
|
220
236
|
:style="headerStyle"
|
|
221
237
|
>
|
|
222
238
|
{{ column.title }}
|
|
@@ -268,6 +284,27 @@
|
|
|
268
284
|
<style lang="scss" scoped>
|
|
269
285
|
.v-data-table-header__content {
|
|
270
286
|
column-gap: 4px;
|
|
287
|
+
min-width: 0;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.v-data-table-header__content--wrap {
|
|
291
|
+
height: auto;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.col-title {
|
|
295
|
+
flex: 1 1 auto;
|
|
296
|
+
min-width: 0;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.col-title--wrap {
|
|
300
|
+
white-space: normal;
|
|
301
|
+
overflow-wrap: anywhere;
|
|
302
|
+
word-break: break-word;
|
|
303
|
+
line-height: 1.25;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.sort-container {
|
|
307
|
+
flex: 0 0 auto;
|
|
271
308
|
}
|
|
272
309
|
|
|
273
310
|
.sort-order-indicator {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import type { FilterOption, TableColumnHeader } from '../types'
|
|
4
4
|
import DatePicker from '@/components/DatePicker/CalendarMode/DatePicker.vue'
|
|
5
|
-
import type {
|
|
5
|
+
import type { DateModelValue } from '@/composables/date/useDateInitializationDayjs'
|
|
6
6
|
import { useDateFormat } from '@/composables/date/useDateFormatDayjs'
|
|
7
7
|
const { parseDate } = useDateFormat()
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
default: () => [],
|
|
17
17
|
},
|
|
18
18
|
filterValue: {
|
|
19
|
-
type: [String, Date, Object, null] as unknown as () =>
|
|
19
|
+
type: [String, Date, Object, null] as unknown as () => DateModelValue,
|
|
20
20
|
default: null,
|
|
21
21
|
},
|
|
22
22
|
inputConfig: {
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
top: 1px;
|
|
226
226
|
left: 12px;
|
|
227
227
|
color: rgb(0 0 0 / 60%);
|
|
228
|
-
font-size:
|
|
228
|
+
font-size: var(--v-fontSize-liensEtLibelles);
|
|
229
229
|
line-height: 36px; /* Adjust based on your select height */
|
|
230
230
|
pointer-events: none;
|
|
231
231
|
width: calc(100% - 40px); /* Leave space for the dropdown icon */
|
|
@@ -19,6 +19,9 @@ export const locales = {
|
|
|
19
19
|
pageAriaLabel: (page: number) => `Page ${page}`,
|
|
20
20
|
currentPageAriaLabel: (page: number) => `Page courante, Page ${page}`,
|
|
21
21
|
paginationNavAriaLabel: 'Navigation de pagination',
|
|
22
|
+
pageInputLabel: 'Aller à la page',
|
|
23
|
+
pageInputAriaLabel: (pageCount: number) => `Aller à la page, entre 1 et ${pageCount}`,
|
|
24
|
+
pageOf: (pageCount: number) => `sur ${pageCount}`,
|
|
22
25
|
},
|
|
23
26
|
reorganizeColumns: 'Gestion des colonnes',
|
|
24
27
|
close: 'Fermer',
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
@use 'sass:color';
|
|
2
|
-
@use '@/assets/tokens';
|
|
3
|
-
|
|
4
1
|
@mixin tablestyles {
|
|
5
2
|
.v-table {
|
|
6
|
-
border: 1px solid
|
|
3
|
+
border: 1px solid rgb(var(--v-theme-grey-lighten80));
|
|
7
4
|
|
|
8
|
-
--sy-table-header-bg-pinned:
|
|
5
|
+
--sy-table-header-bg-pinned: color-mix(in srgb, rgb(var(--v-theme-blue-lighten80)) 20%, white);
|
|
9
6
|
|
|
10
7
|
// Standardisation des z-index pour les tableaux
|
|
11
8
|
--sy-table-z-base: 1;
|
|
@@ -20,13 +17,13 @@
|
|
|
20
17
|
|
|
21
18
|
table thead tr.filters,
|
|
22
19
|
table thead tr.reset {
|
|
23
|
-
background-color:
|
|
20
|
+
background-color: rgb(var(--v-theme-blue-lighten90));
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
caption,
|
|
27
24
|
table thead tr.headers,
|
|
28
25
|
table thead tr.reset {
|
|
29
|
-
background-color: rgba(
|
|
26
|
+
background-color: rgba(var(--v-theme-blue-lighten80), 0.2);
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
&.fixed-min-height {
|
|
@@ -47,44 +44,44 @@
|
|
|
47
44
|
.v-field__append-inner > .v-icon,
|
|
48
45
|
.v-field__clearable > .v-icon {
|
|
49
46
|
opacity: 1;
|
|
50
|
-
color:
|
|
47
|
+
color: rgb(var(--v-theme-primary));
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
&--focused {
|
|
55
|
-
border-color:
|
|
56
|
-
color:
|
|
52
|
+
border-color: rgb(var(--v-theme-primary));
|
|
53
|
+
color: rgb(var(--v-theme-primary));
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
// Override Vuetify's checkbox styles to use primary color
|
|
61
58
|
.v-table .v-selection-control {
|
|
62
|
-
color: rgb(var(--v-theme-
|
|
59
|
+
color: rgb(var(--v-theme-borderAccentPrimary)) !important;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
.v-table .v-selection-control--dirty .v-selection-control__input::before {
|
|
66
|
-
background-color: rgb(var(--v-theme-
|
|
67
|
-
border-color: rgb(var(--v-theme-
|
|
63
|
+
background-color: rgb(var(--v-theme-borderAccentPrimary)) !important;
|
|
64
|
+
border-color: rgb(var(--v-theme-borderAccentPrimary)) !important;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
// Target the header checkbox specifically
|
|
71
68
|
.v-data-table-header__checkbox .v-selection-control {
|
|
72
|
-
color: rgb(var(--v-theme-
|
|
69
|
+
color: rgb(var(--v-theme-borderAccentPrimary)) !important;
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
// Target the row checkboxes specifically
|
|
76
73
|
.v-data-table-row__checkbox .v-selection-control {
|
|
77
|
-
color: rgb(var(--v-theme-
|
|
74
|
+
color: rgb(var(--v-theme-borderAccentPrimary)) !important;
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
// Add a global style for all checkboxes in the table
|
|
81
78
|
.v-checkbox .v-selection-control__input::before,
|
|
82
79
|
.v-checkbox-btn .v-selection-control__input::before {
|
|
83
|
-
border-color: rgb(var(--v-theme-
|
|
80
|
+
border-color: rgb(var(--v-theme-borderAccentPrimary)) !important;
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
.v-data-table-rows-no-data {
|
|
87
|
-
color:
|
|
84
|
+
color: rgb(var(--v-theme-grey-base));
|
|
88
85
|
}
|
|
89
86
|
|
|
90
87
|
// Ensure loading progress bar appears above sticky/pinned header cells
|
|
@@ -104,7 +101,7 @@
|
|
|
104
101
|
|
|
105
102
|
.v-table tbody > tr.sy-table__clickable-row:focus-visible,
|
|
106
103
|
.v-data-table__tbody > tr.sy-table__clickable-row:focus-visible {
|
|
107
|
-
outline: 2px solid
|
|
104
|
+
outline: 2px solid rgb(var(--v-theme-primary));
|
|
108
105
|
}
|
|
109
106
|
|
|
110
107
|
.v-table tbody > tr.sy-table__clickable-row > td,
|
|
@@ -123,6 +120,6 @@
|
|
|
123
120
|
.v-data-table__tbody > tr.sy-table__clickable-row:hover > .v-data-table__td,
|
|
124
121
|
.v-data-table__tbody > tr.sy-table__clickable-row:focus-visible > td,
|
|
125
122
|
.v-data-table__tbody > tr.sy-table__clickable-row:focus-visible > .v-data-table__td {
|
|
126
|
-
background-color: rgba(
|
|
123
|
+
background-color: rgba(var(--v-theme-primary), 0.08) !important;
|
|
127
124
|
}
|
|
128
125
|
}
|
|
@@ -135,6 +135,24 @@ describe('SyTablePagination.vue', () => {
|
|
|
135
135
|
expect(wrapper.emitted('update:page')![0]).toEqual([2])
|
|
136
136
|
})
|
|
137
137
|
|
|
138
|
+
it('groups page input with pagination controls', () => {
|
|
139
|
+
const wrapper = mount(SyTablePagination, {
|
|
140
|
+
props: {
|
|
141
|
+
headingLevel: 2,
|
|
142
|
+
page: 3,
|
|
143
|
+
itemsPerPage: 10,
|
|
144
|
+
itemsLength: 100,
|
|
145
|
+
pageCount: 10,
|
|
146
|
+
pageInput: true,
|
|
147
|
+
},
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
const controls = wrapper.find('.pagination-controls')
|
|
151
|
+
expect(controls.exists()).toBe(true)
|
|
152
|
+
expect(controls.find('.pagination').exists()).toBe(true)
|
|
153
|
+
expect(controls.find('.page-input').exists()).toBe(true)
|
|
154
|
+
})
|
|
155
|
+
|
|
138
156
|
it('has the correct structure for items per page selection', () => {
|
|
139
157
|
const wrapper = mount(SyTablePagination, {
|
|
140
158
|
props: {
|
|
@@ -135,6 +135,45 @@ describe('TableHeader', () => {
|
|
|
135
135
|
expect(wrapper.find('.sort-order-indicator').exists()).toBe(false)
|
|
136
136
|
})
|
|
137
137
|
|
|
138
|
+
it('wraps the column title when resizable columns are enabled', () => {
|
|
139
|
+
const column = {
|
|
140
|
+
title: 'A very long column title',
|
|
141
|
+
key: 'test',
|
|
142
|
+
value: 'test',
|
|
143
|
+
sortable: true,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const wrapper = mount(TableHeader, {
|
|
147
|
+
props: {
|
|
148
|
+
column,
|
|
149
|
+
headerParams: {
|
|
150
|
+
sortBy: [],
|
|
151
|
+
getSortIcon: () => 'mdi-arrow-up',
|
|
152
|
+
toggleSort: () => {},
|
|
153
|
+
columns: [
|
|
154
|
+
{
|
|
155
|
+
key: 'test',
|
|
156
|
+
value: 'test',
|
|
157
|
+
title: 'A very long column title',
|
|
158
|
+
sortable: true,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
headers: [],
|
|
162
|
+
someSelected: false,
|
|
163
|
+
allSelected: false,
|
|
164
|
+
selectAll: () => {},
|
|
165
|
+
isSorted: () => false,
|
|
166
|
+
},
|
|
167
|
+
table: { $el: { offsetWidth: 800 } } as unknown as VDataTable,
|
|
168
|
+
wrapTitle: true,
|
|
169
|
+
},
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
expect(wrapper.find('.col-title').classes()).toContain('col-title--wrap')
|
|
173
|
+
expect(wrapper.find('.v-data-table-header__content').classes()).toContain('v-data-table-header__content--wrap')
|
|
174
|
+
expect(wrapper.find('.v-data-table-header__content').classes()).not.toContain('h-100')
|
|
175
|
+
})
|
|
176
|
+
|
|
138
177
|
// Test for correct sort order when multiple columns are sorted
|
|
139
178
|
it('displays correct sort order numbers for multiple sorted columns', async () => {
|
|
140
179
|
const columns = [
|
|
@@ -105,6 +105,7 @@ export type SyTableProps = {
|
|
|
105
105
|
pinnedColumns?: Array<string | { key: string, side?: 'left' | 'right' }>
|
|
106
106
|
pinnedColumnKey?: string
|
|
107
107
|
clickableRow?: boolean
|
|
108
|
+
pageInput?: boolean
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
export type SyServerTableProps = {
|
|
@@ -132,4 +133,5 @@ export type SyServerTableProps = {
|
|
|
132
133
|
pinnedColumns?: Array<string | { key: string, side?: 'left' | 'right' }>
|
|
133
134
|
pinnedColumnKey?: string
|
|
134
135
|
clickableRow?: boolean
|
|
136
|
+
pageInput?: boolean
|
|
135
137
|
}
|
|
@@ -18,8 +18,38 @@ export function useTableHeaders({
|
|
|
18
18
|
storedHeaders?: DataTableHeaders[]
|
|
19
19
|
filterInputConfig?: Record<string, unknown>
|
|
20
20
|
}) {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
function normalizeHeader(header: DataTableHeaders): DataTableHeaders {
|
|
22
|
+
const mapped = {
|
|
23
|
+
...header,
|
|
24
|
+
title: header.title ?? header.text,
|
|
25
|
+
} as TableColumnHeader
|
|
26
|
+
|
|
27
|
+
// Si maxWidth est défini sans width → applique-le à width
|
|
28
|
+
if (mapped.maxWidth != null && mapped.width == null) {
|
|
29
|
+
mapped.width = mapped.maxWidth
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Si maxWidth est défini → l'appliquer aussi aux <td> via cellProps
|
|
33
|
+
if (mapped.maxWidth != null) {
|
|
34
|
+
const existingCellProps = (mapped.cellProps ?? {}) as Record<string, unknown>
|
|
35
|
+
const existingStyle = (existingCellProps.style ?? {}) as Record<string, unknown>
|
|
36
|
+
const multilineStyle = {
|
|
37
|
+
...existingStyle,
|
|
38
|
+
maxWidth: mapped.maxWidth,
|
|
39
|
+
whiteSpace: 'normal',
|
|
40
|
+
overflowWrap: 'anywhere',
|
|
41
|
+
wordBreak: 'break-word',
|
|
42
|
+
}
|
|
43
|
+
const baseProps = { ...existingCellProps, style: multilineStyle }
|
|
44
|
+
mapped.cellProps = () => ({
|
|
45
|
+
...baseProps,
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return mapped as unknown as DataTableHeaders
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const mergedHeaders = computed(() => {
|
|
23
53
|
const incoming = headersProp?.value
|
|
24
54
|
const stored = Array.isArray(storedHeaders) ? storedHeaders : undefined
|
|
25
55
|
|
|
@@ -61,27 +91,11 @@ export function useTableHeaders({
|
|
|
61
91
|
headers = (stored ?? incoming) as DataTableHeaders[]
|
|
62
92
|
}
|
|
63
93
|
|
|
64
|
-
|
|
65
|
-
return headers.map((header) => {
|
|
66
|
-
const mapped = {
|
|
67
|
-
...header,
|
|
68
|
-
title: header.title ?? header.text,
|
|
69
|
-
} as TableColumnHeader
|
|
70
|
-
|
|
71
|
-
// Si maxWidth est défini sans width → applique-le à width
|
|
72
|
-
if (mapped.maxWidth != null && mapped.width == null) {
|
|
73
|
-
mapped.width = mapped.maxWidth
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return mapped as unknown as DataTableHeaders
|
|
77
|
-
})
|
|
94
|
+
return headers
|
|
78
95
|
})
|
|
79
96
|
|
|
80
|
-
//
|
|
81
|
-
const
|
|
82
|
-
if (!normalizedHeaders.value) return []
|
|
83
|
-
return normalizedHeaders.value.filter(header => header.filterable)
|
|
84
|
-
})
|
|
97
|
+
// Process headers to ensure they have title property and regenerate cellProps after reordering
|
|
98
|
+
const normalizedHeaders = computed(() => mergedHeaders.value?.map(normalizeHeader))
|
|
85
99
|
|
|
86
100
|
/**
|
|
87
101
|
* Enhance header with filter type and configuration
|
|
@@ -112,27 +126,35 @@ export function useTableHeaders({
|
|
|
112
126
|
internalHeaders.value = newHeaders
|
|
113
127
|
}, { immediate: true, deep: true })
|
|
114
128
|
|
|
129
|
+
const normalizedInternalHeaders = computed(() => internalHeaders.value?.map(normalizeHeader))
|
|
130
|
+
|
|
131
|
+
// Get filterable headers
|
|
132
|
+
const filterableHeaders = computed(() => {
|
|
133
|
+
if (!normalizedInternalHeaders.value) return []
|
|
134
|
+
return normalizedInternalHeaders.value.filter(header => header.filterable)
|
|
135
|
+
})
|
|
136
|
+
|
|
115
137
|
/**
|
|
116
138
|
* Get header by key
|
|
117
139
|
*/
|
|
118
140
|
function getHeaderByKey(key: string): TableColumnHeader | undefined {
|
|
119
|
-
return
|
|
141
|
+
return normalizedInternalHeaders.value?.find(header => header.key === key)
|
|
120
142
|
}
|
|
121
143
|
|
|
122
144
|
/**
|
|
123
145
|
* Get original header from a rendered column (match by key or value)
|
|
124
146
|
*/
|
|
125
147
|
function getHeaderForColumn(column: TableColumnHeader): TableColumnHeader | undefined {
|
|
126
|
-
if (!
|
|
148
|
+
if (!normalizedInternalHeaders.value) return undefined
|
|
127
149
|
const key = column.key ?? undefined
|
|
128
150
|
if (key) {
|
|
129
|
-
const byKey =
|
|
151
|
+
const byKey = normalizedInternalHeaders.value.find(h => h.key === key)
|
|
130
152
|
if (byKey) return byKey
|
|
131
153
|
}
|
|
132
154
|
// Fallback: try matching by value when key is not present or didn't match
|
|
133
155
|
const val = typeof column.value === 'string' ? column.value : undefined
|
|
134
156
|
if (val) {
|
|
135
|
-
const byValue =
|
|
157
|
+
const byValue = normalizedInternalHeaders.value.find(h => h.value === val)
|
|
136
158
|
if (byValue) return byValue
|
|
137
159
|
}
|
|
138
160
|
return undefined
|
|
@@ -142,8 +164,8 @@ export function useTableHeaders({
|
|
|
142
164
|
* The headers filtered by visibility and sorted by order
|
|
143
165
|
*/
|
|
144
166
|
const displayHeaders = computed(() => {
|
|
145
|
-
if (!
|
|
146
|
-
const filteredHeaders =
|
|
167
|
+
if (!normalizedInternalHeaders.value) return undefined
|
|
168
|
+
const filteredHeaders = normalizedInternalHeaders.value.filter(header => header.hidden !== true)
|
|
147
169
|
return sortHeaders(filteredHeaders)
|
|
148
170
|
})
|
|
149
171
|
|
|
@@ -35,6 +35,29 @@ describe('UploadWorkflow', () => {
|
|
|
35
35
|
expect(wrapper.find('.sy-file-upload').isVisible()).toBeTruthy()
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
+
it('handles empty upload list without crashing', async () => {
|
|
39
|
+
const wrapper = mount(UploadWorkflow, {
|
|
40
|
+
props: {
|
|
41
|
+
uploadList: [],
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
46
|
+
expect(wrapper.findAll('.file-item')).toHaveLength(0)
|
|
47
|
+
expect(wrapper.find('.sy-file-upload').exists()).toBeFalsy()
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('handles undefined upload list without crashing', async () => {
|
|
51
|
+
const wrapper = mount(UploadWorkflow, {
|
|
52
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
53
|
+
props: {} as any,
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
57
|
+
expect(wrapper.findAll('.file-item')).toHaveLength(0)
|
|
58
|
+
expect(wrapper.find('.sy-file-upload').exists()).toBeFalsy()
|
|
59
|
+
})
|
|
60
|
+
|
|
38
61
|
it('shows the file in the list when set with the list button', async () => {
|
|
39
62
|
const wrapper = mount(UploadWorkflow, {
|
|
40
63
|
props: {
|
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
+
exports[`UploadWorkflow > handles empty upload list without crashing 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="
|
|
6
|
+
sy-upload-workflow
|
|
7
|
+
white
|
|
8
|
+
"
|
|
9
|
+
style="width: 100%;"
|
|
10
|
+
>
|
|
11
|
+
<h4 class="
|
|
12
|
+
mb-2
|
|
13
|
+
sy-heading
|
|
14
|
+
text-h6
|
|
15
|
+
">
|
|
16
|
+
Document à nous transmettre
|
|
17
|
+
</h4>
|
|
18
|
+
<ul
|
|
19
|
+
class="upload-list"
|
|
20
|
+
style="width: 100%;"
|
|
21
|
+
></ul>
|
|
22
|
+
<transition-stub
|
|
23
|
+
appear="false"
|
|
24
|
+
css="true"
|
|
25
|
+
persisted="false"
|
|
26
|
+
>
|
|
27
|
+
<!-- v-if -->
|
|
28
|
+
</transition-stub>
|
|
29
|
+
<!---->
|
|
30
|
+
<!---->
|
|
31
|
+
<!---->
|
|
32
|
+
<!---->
|
|
33
|
+
</div>
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
exports[`UploadWorkflow > handles undefined upload list without crashing 1`] = `
|
|
37
|
+
<div
|
|
38
|
+
class="
|
|
39
|
+
sy-upload-workflow
|
|
40
|
+
white
|
|
41
|
+
"
|
|
42
|
+
style="width: 100%;"
|
|
43
|
+
>
|
|
44
|
+
<h4 class="
|
|
45
|
+
mb-2
|
|
46
|
+
sy-heading
|
|
47
|
+
text-h6
|
|
48
|
+
">
|
|
49
|
+
Document à nous transmettre
|
|
50
|
+
</h4>
|
|
51
|
+
<ul
|
|
52
|
+
class="upload-list"
|
|
53
|
+
style="width: 100%;"
|
|
54
|
+
></ul>
|
|
55
|
+
<transition-stub
|
|
56
|
+
appear="false"
|
|
57
|
+
css="true"
|
|
58
|
+
persisted="false"
|
|
59
|
+
>
|
|
60
|
+
<!-- v-if -->
|
|
61
|
+
</transition-stub>
|
|
62
|
+
<!---->
|
|
63
|
+
<!---->
|
|
64
|
+
<!---->
|
|
65
|
+
<!---->
|
|
66
|
+
</div>
|
|
67
|
+
`;
|
|
68
|
+
|
|
3
69
|
exports[`UploadWorkflow > render the upload list 1`] = `
|
|
4
70
|
<div
|
|
5
71
|
class="
|
|
@@ -72,6 +72,9 @@ export default function useFileList(
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
const filledUploadList = computed<FileItem[]>(() => {
|
|
75
|
+
if (!uploadList.value) {
|
|
76
|
+
return []
|
|
77
|
+
}
|
|
75
78
|
return uploadList.value.map((uploadItem) => {
|
|
76
79
|
const matchingUploadedItem = findSelectedFile(uploadItem.id)
|
|
77
80
|
const error = errorSelectedFiles.value.includes(uploadItem.id)
|
|
@@ -94,12 +94,10 @@
|
|
|
94
94
|
</template>
|
|
95
95
|
|
|
96
96
|
<style scoped lang="scss">
|
|
97
|
-
@use '@/assets/tokens';
|
|
98
|
-
|
|
99
97
|
.vd-user-icon {
|
|
100
98
|
width: 40px;
|
|
101
99
|
height: 40px;
|
|
102
|
-
background:
|
|
100
|
+
background: rgb(var(--v-theme-grey-lighten90));
|
|
103
101
|
border-radius: 50%;
|
|
104
102
|
|
|
105
103
|
svg,
|
|
@@ -2,7 +2,88 @@ import { describe, it, expect } from 'vitest'
|
|
|
2
2
|
import { formatDate, parseDate } from '../useDateFormatDayjs'
|
|
3
3
|
|
|
4
4
|
describe('useDateFormatDayjs', () => {
|
|
5
|
+
describe('formatDate', () => {
|
|
6
|
+
it('formats a Date object to string according to the specified format', () => {
|
|
7
|
+
const date = new Date(2023, 0, 15) // 15 janvier 2023
|
|
8
|
+
expect(formatDate(date, 'DD/MM/YYYY')).toBe('15/01/2023')
|
|
9
|
+
expect(formatDate(date, 'YYYY-MM-DD')).toBe('2023-01-15')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('returns empty string when date is null or undefined', () => {
|
|
13
|
+
expect(formatDate(null as unknown as Date, 'DD/MM/YYYY')).toBe('')
|
|
14
|
+
expect(formatDate(undefined as unknown as Date, 'DD/MM/YYYY')).toBe('')
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('handles different date formats correctly', () => {
|
|
18
|
+
const date = new Date(2023, 11, 31) // 31 décembre 2023
|
|
19
|
+
expect(formatDate(date, 'DD/MM/YYYY')).toBe('31/12/2023')
|
|
20
|
+
expect(formatDate(date, 'YYYY-MM-DD')).toBe('2023-12-31')
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('handles custom separators correctly', () => {
|
|
24
|
+
const date = new Date(2023, 0, 15) // 15 janvier 2023
|
|
25
|
+
expect(formatDate(date, 'DD.MM.YYYY')).toBe('15.01.2023')
|
|
26
|
+
expect(formatDate(date, 'DD-MM-YYYY')).toBe('15-01-2023')
|
|
27
|
+
expect(formatDate(date, 'YYYY/MM/DD')).toBe('2023/01/15')
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
|
|
5
31
|
describe('parseDate', () => {
|
|
32
|
+
it('parses a date string to a Date object according to the specified format', () => {
|
|
33
|
+
const dateStr = '15/01/2023'
|
|
34
|
+
const date = parseDate(dateStr, 'DD/MM/YYYY')
|
|
35
|
+
expect(date).toBeInstanceOf(Date)
|
|
36
|
+
expect(date?.getFullYear()).toBe(2023)
|
|
37
|
+
expect(date?.getMonth()).toBe(0) // Janvier = 0
|
|
38
|
+
expect(date?.getDate()).toBe(15)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('returns null for invalid date strings', () => {
|
|
42
|
+
expect(parseDate('invalid', 'DD/MM/YYYY')).toBeNull()
|
|
43
|
+
expect(parseDate('31/02/2023', 'DD/MM/YYYY')).toBeNull() // 31 février n'existe pas
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('handles different date formats correctly', () => {
|
|
47
|
+
expect(parseDate('2023-01-15', 'YYYY-MM-DD')?.getDate()).toBe(15)
|
|
48
|
+
expect(parseDate('15.01.2023', 'DD.MM.YYYY')?.getDate()).toBe(15)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('returns null when input is null or empty', () => {
|
|
52
|
+
expect(parseDate(null, 'DD/MM/YYYY')).toBeNull()
|
|
53
|
+
expect(parseDate('', 'DD/MM/YYYY')).toBeNull()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('handles leap years correctly', () => {
|
|
57
|
+
// 2020 était une année bissextile
|
|
58
|
+
expect(parseDate('29/02/2020', 'DD/MM/YYYY')).not.toBeNull()
|
|
59
|
+
// 2023 n'est pas une année bissextile
|
|
60
|
+
expect(parseDate('29/02/2023', 'DD/MM/YYYY')).toBeNull()
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('returns the Date object as-is when input is already a Date', () => {
|
|
64
|
+
const original = new Date(2023, 5, 15, 10, 30)
|
|
65
|
+
const result = parseDate(original, 'DD/MM/YYYY')
|
|
66
|
+
expect(result).toBe(original) // même référence
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it('creates dates at midnight (00:00:00.000)', () => {
|
|
70
|
+
const date = parseDate('15/01/2023', 'DD/MM/YYYY')!
|
|
71
|
+
expect(date.getHours()).toBe(0)
|
|
72
|
+
expect(date.getMinutes()).toBe(0)
|
|
73
|
+
expect(date.getSeconds()).toBe(0)
|
|
74
|
+
expect(date.getMilliseconds()).toBe(0)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('roundtrip: parseDate then formatDate preserves the same calendar day', () => {
|
|
78
|
+
const formats = ['DD/MM/YYYY', 'YYYY-MM-DD', 'DD.MM.YYYY']
|
|
79
|
+
const inputs = ['01/01/2023', '2023-06-30', '31.12.2020']
|
|
80
|
+
formats.forEach((fmt, i) => {
|
|
81
|
+
const parsed = parseDate(inputs[i]!, fmt)
|
|
82
|
+
expect(parsed).not.toBeNull()
|
|
83
|
+
expect(formatDate(parsed, fmt)).toBe(inputs[i])
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
|
|
6
87
|
it('keeps the same calendar day when formatting back in a negative timezone (UTC-4)', () => {
|
|
7
88
|
const previousTz = process.env.TZ
|
|
8
89
|
process.env.TZ = 'America/Guadeloupe'
|