@cnamts/synapse 1.0.25 → 1.0.27
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/{AutocompleteFilter-D7qBuCAP.js → AutocompleteFilter-C9eLKyW8.js} +3 -3
- package/dist/{DateFilter-BitMWrMU.js → DateFilter-y-GLkAkn.js} +9 -9
- package/dist/{NumberFilter-BTLUxw0a.js → NumberFilter-DN6hIBS7.js} +1 -1
- package/dist/{PeriodFilter-B5rUIPAC.js → PeriodFilter-MoUUp9qS.js} +1 -1
- package/dist/{SelectFilter-l4QnRcuk.js → SelectFilter-bCbrdLmu.js} +1 -1
- package/dist/{TextFilter-C9hj6Qrp.js → TextFilter-CvjgEaoM.js} +4 -4
- package/dist/apLightTheme2026-ug4Y23ns.js +611 -0
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +2369 -351
- package/dist/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.d.ts +18 -0
- package/dist/components/Customs/Selects/SyAutocomplete/utils/ariaManager.d.ts +1 -1
- package/dist/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.d.ts +3 -1
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +58 -288
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +1 -0
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectValidation.d.ts +15 -0
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +4 -3
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +4 -3
- package/dist/components/Customs/SyIconButton/SyIconButton.d.ts +18 -0
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +20 -37
- package/dist/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.d.ts +50 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +8 -10
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +197 -185
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +91 -82
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +35 -32
- package/dist/components/DatePicker/composables/index.d.ts +1 -0
- package/dist/components/DatePicker/composables/useDatePickerState.d.ts +3 -3
- package/dist/components/DatePicker/composables/useDatePickerValidationBridge.d.ts +51 -0
- 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/LunarCalendar/useLunarCalendarValidation.d.ts +1 -0
- package/dist/components/MonthPicker/MonthPicker.d.ts +24 -24
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +24 -24
- package/dist/components/NirField/NirField.d.ts +64 -60
- package/dist/components/NirField/useNirValidation.d.ts +6 -2
- package/dist/components/PasswordField/PasswordField.d.ts +3 -3
- package/dist/components/PeriodField/PeriodField.d.ts +338 -314
- package/dist/components/PhoneField/PhoneField.d.ts +34 -24
- 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/useRatingFocus.d.ts +18 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +25 -15
- package/dist/components/SyTextArea/composables/useSyTextAreaValidation.d.ts +20 -0
- package/dist/components/SyTextArea/locales.d.ts +1 -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 +152 -364
- package/dist/components/Tables/common/TableHeader.d.ts +1 -1
- package/dist/components/Tables/common/filters/DateFilter.d.ts +4 -4
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/date/useDateInitializationDayjs.d.ts +3 -1
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +160 -160
- package/dist/composables/unifyValidation/useCustomValidation.d.ts +3 -1
- package/dist/composables/unifyValidation/useValidation.d.ts +27 -19
- package/dist/composables/unifyValidation/useVuetifyValidation.d.ts +1 -1
- package/dist/composables/validation/useValidation.d.ts +1 -0
- package/dist/design-system-v3.js +81 -80
- package/dist/designTokens/tokens/amelipro/apContextual.d.ts +6 -6
- package/dist/designTokens/tokens/amelipro/apDarkTheme.d.ts +3 -1
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +53 -98
- package/dist/designTokens/tokens/baseContextualTokens.d.ts +0 -6
- package/dist/designTokens/tokens/baseTokens.d.ts +232 -0
- package/dist/designTokens/tokens/cnam/cnamContextual.d.ts +6 -6
- package/dist/designTokens/tokens/cnam/cnamDarkTheme.d.ts +1 -1
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +57 -99
- package/dist/designTokens/tokens/pa/paContextual.d.ts +0 -6
- package/dist/designTokens/tokens/pa/paDarkTheme.d.ts +1 -1
- package/dist/designTokens/tokens/pa/paLightTheme.d.ts +53 -97
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +1 -0
- package/dist/designTokens/tokens/semanticTokens.d.ts +112 -0
- package/dist/{main-Cpx8Co6H.js → main-CI6Q9nmO.js} +13843 -13478
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +208 -72
- package/package.json +10 -7
- package/src/assets/overrides/_icons.scss +5 -17
- package/src/assets/overrides/_otp.scss +4 -5
- package/src/assets/overrides/_typography.scss +2 -1
- package/src/assets/overrides/_utilities.scss +1 -42
- package/src/components/Accordion/Accordion.vue +2 -0
- package/src/components/ChipList/ChipList.vue +30 -18
- package/src/components/ChipList/tests/chipList.spec.ts +4 -4
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -1
- package/src/components/CookiesSelection/CookiesSelection.vue +2 -1
- package/src/components/CopyBtn/CopyBtn.vue +9 -0
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.stories.ts +4 -0
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +7 -6
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +223 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +283 -351
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +183 -219
- package/src/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.ts +101 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +761 -1
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +3 -1
- package/src/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.ts +79 -5
- package/src/components/Customs/Selects/SyAutocomplete/validation/Validation.stories.ts +1029 -0
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +52 -217
- package/src/components/Customs/Selects/SySelect/SySelect.vue +248 -236
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +3 -0
- package/src/components/Customs/Selects/SySelect/composables/useSySelectValidation.ts +64 -0
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +440 -5
- package/src/components/Customs/Selects/SySelect/validation/Validation.stories.ts +1026 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +18 -7
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +5 -5
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +8 -8
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +27 -6
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +1 -1
- package/src/components/Customs/SyIcon/accessibilite/Accessibility.mdx +0 -6
- package/src/components/Customs/SyIcon/utils/tests/iconUtils.spec.ts +107 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.mdx +2 -2
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.stories.ts +395 -200
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +100 -127
- package/src/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.ts +127 -0
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.a11y.spec.ts +93 -1
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.spec.ts +146 -9
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.visual.cy.ts +165 -0
- package/src/components/Customs/SyRadioGroup/validation/Validation.stories.ts +773 -0
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +5 -5
- package/src/components/Customs/SyTabs/config.ts +3 -3
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +265 -0
- package/src/components/Customs/SyTabs/tests/useTabTransition.spec.ts +188 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +10 -29
- package/src/components/Customs/SyTextField/SyTextField.vue +52 -17
- package/src/components/DataList/DataList.stories.ts +1 -1
- package/src/components/DataListItem/tests/DataListItem.spec.ts +3 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +52 -154
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.coverage.spec.ts +156 -0
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.spec.ts +495 -4
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +55 -73
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +207 -1
- package/src/components/DatePicker/ComplexDatePicker/tests/bridge-integration.regression.spec.ts +210 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/calendar-navigation.regression.spec.ts +214 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/validation-cross.regression.spec.ts +194 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/validation-success-messages.regression.spec.ts +83 -0
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +169 -60
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.spec.ts +320 -0
- package/src/components/DatePicker/composables/index.ts +1 -0
- package/src/components/DatePicker/composables/tests/useCalendarKeyboardNavigation.spec.ts +360 -0
- package/src/components/DatePicker/composables/tests/useDatePickerValidationBridge.spec.ts +129 -0
- package/src/components/DatePicker/composables/useDatePickerState.ts +33 -14
- package/src/components/DatePicker/composables/useDatePickerValidationBridge.ts +205 -0
- 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 -2
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +2 -2
- package/src/components/DatePicker/docExamples/BidirectionalComplexValidation.vue +1 -1
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +1 -1
- package/src/components/DatePicker/tests/exposed-methods.coverage.spec.ts +75 -0
- package/src/components/DatePicker/types.ts +1 -2
- package/src/components/DialogBox/DialogBox.stories.ts +8 -8
- package/src/components/DialogBox/DialogBox.vue +1 -1
- package/src/components/DialogBox/accessibilite/Accessibility.mdx +86 -22
- package/src/components/FileList/UploadItem/UploadItem.vue +4 -4
- package/src/components/FileUpload/FileUpload.vue +2 -2
- package/src/components/FileUpload/FileUploadContent.vue +1 -1
- package/src/components/FilterInline/FilterInline.mdx +2 -2
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +1 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +4 -3
- package/src/components/FooterBar/FooterBar.vue +7 -7
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +2 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +7 -7
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +2 -2
- package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +87 -8
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +3 -3
- package/src/components/HeaderNavigationBar/HorizontalNavbar/tests/HorizontalNavbar.spec.ts +589 -0
- package/src/components/HeaderToolbar/tests/HeaderToolBar.spec.ts +153 -1
- package/src/components/HeaderToolbar/tests/useMobileRightMenu.spec.ts +258 -0
- package/src/components/LangBtn/LangBtn.vue +2 -1
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +2 -2
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +1 -1
- package/src/components/LunarCalendar/tests/useLunarCalendarRules.spec.ts +184 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthSelector.vue +3 -3
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.vue +1 -1
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +2 -2
- package/src/components/MonthPicker/MonthPickerVisual/YearSelector.vue +1 -1
- package/src/components/NirField/NirField.vue +3 -3
- package/src/components/NotificationBar/Notification/Notification.vue +12 -12
- package/src/components/NotificationBar/NotificationBar.stories.ts +8 -8
- package/src/components/PaginatedTable/PaginatedTable.vue +1 -1
- package/src/components/PaginatedTable/Pagination.vue +3 -3
- package/src/components/PasswordField/PasswordField.vue +15 -11
- package/src/components/PasswordField/tests/PasswordField.spec.ts +3 -3
- package/src/components/PhoneField/PhoneField.vue +4 -2
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +11 -18
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +1 -1
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +32 -48
- 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 +28 -37
- 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.spec.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/StatusPage/tests/StatusPage.spec.ts +149 -0
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SyAlert/SyAlert.vue +23 -23
- package/src/components/SyTextArea/SyTextArea.stories.ts +177 -131
- package/src/components/SyTextArea/SyTextArea.vue +257 -74
- package/src/components/SyTextArea/composables/useSyTextAreaValidation.ts +81 -0
- package/src/components/SyTextArea/locales.ts +1 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +449 -1
- package/src/components/SyTextArea/useDefaultValidationRules.ts +2 -7
- package/src/components/SyTextArea/validation/Validation.stories.ts +856 -0
- package/src/components/TableToolbar/TableToolbar.vue +6 -6
- package/src/components/TableToolbar/accessibilite/Accessibility.mdx +81 -7
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +163 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +3 -2
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +94 -0
- package/src/components/Tables/SyTable/SyTable.vue +3 -2
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +64 -0
- package/src/components/Tables/common/SyTableFilter.vue +4 -4
- package/src/components/Tables/common/SyTablePagination.vue +1 -0
- package/src/components/Tables/common/TableHeader.vue +3 -3
- package/src/components/Tables/common/filters/DateFilter.vue +2 -2
- package/src/components/Tables/common/filters/logics/tests/NumberFilterLogic.spec.ts +176 -0
- package/src/components/Tables/common/filters/logics/tests/SelectFilterLogic.spec.ts +111 -0
- package/src/components/Tables/common/tableStyles.scss +6 -6
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/composables/date/tests/useDateFormatDayjs.spec.ts +112 -0
- package/src/composables/date/tests/{useDateInitialization.spec.ts → useDateInitializationDayjs.spec.ts} +39 -3
- package/src/composables/date/tests/useHolidayDay.spec.ts +109 -0
- package/src/composables/date/useDateInitializationDayjs.ts +4 -1
- package/src/composables/rules/tests/useFieldValidation.spec.ts +374 -0
- package/src/composables/tests/useError.spec.ts +30 -0
- package/src/composables/tests/useFormFieldErrorHandling.spec.ts +234 -0
- package/src/composables/unifyValidation/documentationValidationProps.ts +12 -12
- package/src/composables/unifyValidation/tests/documentationValidationProps.spec.ts +177 -0
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +32 -1
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +28 -2
- package/src/composables/unifyValidation/useCustomValidation.ts +34 -12
- package/src/composables/unifyValidation/useValidation.ts +55 -27
- package/src/composables/unifyValidation/useVuetifyValidation.ts +2 -2
- package/src/composables/useFilterable/useFilterable.spec.ts +42 -0
- package/src/composables/useFilterable/useFilterable.ts +11 -7
- package/src/composables/useFormFieldErrorHandling.ts +6 -3
- package/src/composables/validation/tests/useValidation.spec.ts +2 -2
- package/src/composables/validation/useValidation.ts +15 -3
- package/src/composantsVuetify/VBtn/VBtn.mdx +9 -39
- package/src/composantsVuetify/VBtn/v-btn.stories.ts +26 -86
- package/src/composantsVuetify/VCard/VCard.mdx +59 -0
- package/src/composantsVuetify/VCard/v-card.stories.ts +279 -0
- package/src/designTokens/tokens/amelipro/apColors2026.ts +1 -1
- package/src/designTokens/tokens/amelipro/apContextual.ts +6 -0
- package/src/designTokens/tokens/amelipro/apDarkTheme.ts +2 -2
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +72 -100
- package/src/designTokens/tokens/amelipro/apSemantic.ts +1 -1
- package/src/designTokens/tokens/baseContextualTokens.ts +1 -6
- package/src/designTokens/tokens/baseTokens.ts +232 -0
- package/src/designTokens/tokens/cnam/cnamContextual.ts +6 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +2 -2
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +76 -101
- package/src/designTokens/tokens/pa/paDarkTheme.ts +2 -2
- package/src/designTokens/tokens/pa/paLightTheme.ts +73 -99
- package/src/designTokens/tokens/pa/paSemantic.ts +2 -0
- package/src/designTokens/tokens/semanticTokens.ts +114 -0
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +61 -91
- package/src/stories/Accessibilite/AuditDesignSystem.mdx +5 -8
- 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/Introduction.mdx +30 -30
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +168 -78
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +13 -6
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +66 -45
- 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 +18 -20
- package/src/stories/Components/Components.stories.ts +59 -6
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +2 -3
- package/src/stories/DesignTokens/Colors.mdx +6 -8
- package/src/stories/DesignTokens/colors.stories.ts +244 -1081
- package/src/utils/amelipro/toKebabCase/tests/toKebabCase.spec.ts +52 -0
- package/src/utils/formatNir/tests/formatNir.spec.ts +34 -0
- package/src/utils/tests/insertAt.spec.ts +44 -0
- package/dist/AutocompleteFilter-Df9i5mAl.cjs +0 -1
- package/dist/DateFilter-BJD6FMev.cjs +0 -1
- package/dist/NumberFilter-DGCzCXzI.cjs +0 -1
- package/dist/PeriodFilter-DO_ecTZW.cjs +0 -1
- package/dist/SelectFilter-CGwcKWLm.cjs +0 -1
- package/dist/TextFilter-B8nf7xoK.cjs +0 -1
- package/dist/apLightTheme-CEK4iY3f.cjs +0 -1
- package/dist/apLightTheme-DnIM24Lv.js +0 -950
- 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/main-ByDPHpae.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/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/DatePicker/CalendarMode/tests/DatePicker.events.spec.ts +0 -178
- 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/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/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/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/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/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/composables/date/tests/useDateFormat.spec.ts +0 -67
- package/src/composables/date/useDateFormat.ts +0 -110
- package/src/composables/date/useDateInitialization.ts +0 -92
|
@@ -309,7 +309,7 @@ const meta = {
|
|
|
309
309
|
},
|
|
310
310
|
'birthDate': {
|
|
311
311
|
control: 'boolean',
|
|
312
|
-
description: '
|
|
312
|
+
description: '⚠️ **DEPRECATED** — Utilisez `isBirthDate` à la place.',
|
|
313
313
|
defaultValue: false,
|
|
314
314
|
},
|
|
315
315
|
'useCombinedMode': {
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
type ComponentPublicInstance,
|
|
4
4
|
computed,
|
|
5
|
-
watch,
|
|
6
|
-
onMounted,
|
|
7
|
-
onBeforeUnmount,
|
|
8
5
|
nextTick,
|
|
9
|
-
|
|
6
|
+
onBeforeUnmount,
|
|
7
|
+
onMounted,
|
|
8
|
+
ref,
|
|
10
9
|
type Ref,
|
|
10
|
+
watch,
|
|
11
11
|
} from 'vue'
|
|
12
12
|
import {
|
|
13
|
-
useDateInitialization,
|
|
14
13
|
type DateInput,
|
|
15
|
-
type
|
|
14
|
+
type DateModelValue,
|
|
15
|
+
useDateInitialization,
|
|
16
16
|
} from '@/composables/date/useDateInitializationDayjs'
|
|
17
17
|
import {
|
|
18
18
|
useAsteriskDisplay,
|
|
19
|
+
useCalendarKeyboardNavigation,
|
|
20
|
+
useDateFormatValidation,
|
|
19
21
|
useDatePickerFocusTrap,
|
|
20
22
|
useDatePickerState,
|
|
21
|
-
|
|
22
|
-
useDateValidation,
|
|
23
|
+
useDatePickerValidationBridge,
|
|
23
24
|
useDatePickerViewMode,
|
|
24
25
|
useDatePickerVisibility,
|
|
25
26
|
useDateRangeValidation,
|
|
26
27
|
useDateSelection,
|
|
27
28
|
useDisplayedDateString,
|
|
29
|
+
useHolidayHighlighting,
|
|
28
30
|
useInputBlurHandler,
|
|
29
31
|
useManualDateValidation,
|
|
30
32
|
useMonthButtonCustomization,
|
|
31
33
|
useTodayButton,
|
|
32
|
-
useHolidayHighlighting,
|
|
33
|
-
useCalendarKeyboardNavigation,
|
|
34
34
|
} from '../composables'
|
|
35
35
|
import dayjs from 'dayjs'
|
|
36
36
|
import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
|
|
37
37
|
import DateTextInput from '../DateTextInput/DateTextInput.vue'
|
|
38
38
|
import { VDatePicker } from 'vuetify/components'
|
|
39
39
|
import { useInputHandler } from '../composables/useInputHandler'
|
|
40
|
-
import { useValidation } from '@/composables/validation/useValidation'
|
|
41
40
|
import { useValidatable } from '@/composables/validation/useValidatable'
|
|
42
41
|
import { useDateFormat } from '@/composables/date/useDateFormatDayjs'
|
|
43
42
|
import type { DateObjectValue } from '../types'
|
|
@@ -130,6 +129,7 @@
|
|
|
130
129
|
defineProps<{
|
|
131
130
|
autoClamp?: boolean
|
|
132
131
|
bgColor?: string
|
|
132
|
+
/** @deprecated Utilisez isBirthDate à la place */
|
|
133
133
|
birthDate?: boolean
|
|
134
134
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- sorry
|
|
135
135
|
customRules?: { type: string, options: any }[]
|
|
@@ -212,12 +212,12 @@
|
|
|
212
212
|
)
|
|
213
213
|
|
|
214
214
|
const emit = defineEmits<{
|
|
215
|
-
(e: 'update:modelValue', value:
|
|
215
|
+
(e: 'update:modelValue', value: DateModelValue): void
|
|
216
216
|
(e: 'closed'): void
|
|
217
217
|
(e: 'focus'): void
|
|
218
218
|
(e: 'blur'): void
|
|
219
219
|
(e: 'input', value: string): void
|
|
220
|
-
(e: 'date-selected', value:
|
|
220
|
+
(e: 'date-selected', value: DateModelValue): void
|
|
221
221
|
}>()
|
|
222
222
|
|
|
223
223
|
/**
|
|
@@ -231,22 +231,6 @@
|
|
|
231
231
|
* Validation + messages
|
|
232
232
|
*/
|
|
233
233
|
const isDatePickerVisible = ref(false)
|
|
234
|
-
const validation = useValidation({
|
|
235
|
-
showSuccessMessages: props.showSuccessMessages,
|
|
236
|
-
fieldIdentifier: 'Date',
|
|
237
|
-
disableErrorHandling: props.disableErrorHandling,
|
|
238
|
-
})
|
|
239
|
-
const { errors, warnings, successes, validateField, clearValidation } = validation
|
|
240
|
-
const errorMessages = computed(() => errors.value)
|
|
241
|
-
const warningMessages = computed(() => warnings.value)
|
|
242
|
-
const successMessages = computed(() => successes.value)
|
|
243
|
-
|
|
244
|
-
const getMessageClasses = () => ({
|
|
245
|
-
'dp-width': true,
|
|
246
|
-
'v-messages__message--error': errorMessages.value.length > 0,
|
|
247
|
-
'v-messages__message--warning': warningMessages.value.length > 0 && errorMessages.value.length === 0,
|
|
248
|
-
'v-messages__message--success': successMessages.value.length > 0 && errorMessages.value.length === 0 && warningMessages.value.length === 0,
|
|
249
|
-
})
|
|
250
234
|
|
|
251
235
|
/**
|
|
252
236
|
* Selection state
|
|
@@ -274,22 +258,36 @@
|
|
|
274
258
|
disableErrorHandling: props.disableErrorHandling,
|
|
275
259
|
})
|
|
276
260
|
|
|
277
|
-
const {
|
|
261
|
+
const {
|
|
262
|
+
errors,
|
|
263
|
+
warnings,
|
|
264
|
+
successes,
|
|
265
|
+
validateField,
|
|
266
|
+
clearValidation,
|
|
267
|
+
validateDates,
|
|
268
|
+
} = useDatePickerValidationBridge({
|
|
269
|
+
showSuccessMessages: props.showSuccessMessages,
|
|
270
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
278
271
|
noCalendar: props.noCalendar,
|
|
279
272
|
required: props.required,
|
|
280
273
|
displayRange: props.displayRange,
|
|
281
|
-
disableErrorHandling: props.disableErrorHandling,
|
|
282
274
|
customRules: computed(() => props.customRules),
|
|
283
275
|
customWarningRules: computed(() => props.customWarningRules),
|
|
284
276
|
selectedDates,
|
|
285
277
|
isUpdatingFromInternal,
|
|
286
278
|
currentRangeIsValid,
|
|
287
279
|
getRangeValidationError,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
280
|
+
revalidateOnCustomRulesChange: true,
|
|
281
|
+
})
|
|
282
|
+
const errorMessages = computed(() => errors.value)
|
|
283
|
+
const warningMessages = computed(() => warnings.value)
|
|
284
|
+
const successMessages = computed(() => successes.value)
|
|
285
|
+
|
|
286
|
+
const getMessageClasses = () => ({
|
|
287
|
+
'dp-width': true,
|
|
288
|
+
'v-messages__message--error': errorMessages.value.length > 0,
|
|
289
|
+
'v-messages__message--warning': warningMessages.value.length > 0 && errorMessages.value.length === 0,
|
|
290
|
+
'v-messages__message--success': successMessages.value.length > 0 && errorMessages.value.length === 0 && warningMessages.value.length === 0,
|
|
293
291
|
})
|
|
294
292
|
|
|
295
293
|
const {
|
|
@@ -313,14 +311,14 @@
|
|
|
313
311
|
emitFocus: () => emit('focus'),
|
|
314
312
|
})
|
|
315
313
|
|
|
316
|
-
const updateModel = (value:
|
|
314
|
+
const updateModel = (value: DateModelValue) => {
|
|
317
315
|
// Prevent redundant emits
|
|
318
316
|
if (JSON.stringify(value) === JSON.stringify(props.modelValue)) return
|
|
319
317
|
withInternalUpdate(() => emit('update:modelValue', value))
|
|
320
318
|
}
|
|
321
319
|
|
|
322
320
|
// Keep and expose this so consumers can listen to `date-selected`
|
|
323
|
-
const handleDateSelected = (value:
|
|
321
|
+
const handleDateSelected = (value: DateModelValue) => {
|
|
324
322
|
if (props.readonly) return
|
|
325
323
|
|
|
326
324
|
// 1) Update v-model
|
|
@@ -342,30 +340,12 @@
|
|
|
342
340
|
}
|
|
343
341
|
}
|
|
344
342
|
else {
|
|
345
|
-
|
|
346
|
-
selectedDates.value = dateObject
|
|
343
|
+
selectedDates.value = parseDate(value, returnFormat.value)
|
|
347
344
|
}
|
|
348
345
|
|
|
349
346
|
// 3) Re-emit upward
|
|
350
347
|
emit('date-selected', value)
|
|
351
348
|
}
|
|
352
|
-
// Watcher pour re-valider quand les customRules changent
|
|
353
|
-
watch(() => props.customRules, () => {
|
|
354
|
-
if (selectedDates.value !== null) {
|
|
355
|
-
// Retarder légèrement pour s'assurer que les computed sont mis à jour
|
|
356
|
-
setTimeout(async () => {
|
|
357
|
-
clearValidation()
|
|
358
|
-
const datesToValidate = Array.isArray(selectedDates.value) ? selectedDates.value : [selectedDates.value]
|
|
359
|
-
for (const date of datesToValidate) {
|
|
360
|
-
await Promise.resolve(validateField(
|
|
361
|
-
date,
|
|
362
|
-
props.customRules,
|
|
363
|
-
props.customWarningRules,
|
|
364
|
-
))
|
|
365
|
-
}
|
|
366
|
-
}, 5)
|
|
367
|
-
}
|
|
368
|
-
}, { deep: true })
|
|
369
349
|
// Range handling
|
|
370
350
|
const rangeBoundaryDates = ref<[Date | null, Date | null] | null>(null)
|
|
371
351
|
const dateSelectionResult = useDateSelection(parseDate, selectedDates, props.format, props.displayRange)
|
|
@@ -709,7 +689,7 @@
|
|
|
709
689
|
validateField: (value, rules, warningRules) =>
|
|
710
690
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- sorry
|
|
711
691
|
validateField(value, rules as any[], warningRules as any[]),
|
|
712
|
-
updateModel: value => updateModel(value as
|
|
692
|
+
updateModel: value => updateModel(value as DateModelValue),
|
|
713
693
|
emitInput: value => emit('input', value),
|
|
714
694
|
inputRef: dateCalendarTextInputRef as Ref<ComponentPublicInstance | null>,
|
|
715
695
|
})
|
|
@@ -727,8 +707,7 @@
|
|
|
727
707
|
|
|
728
708
|
if (!charBeforeCursor || !/\d/.test(charBeforeCursor)) {
|
|
729
709
|
event.preventDefault()
|
|
730
|
-
|
|
731
|
-
displayFormattedDate.value = newValue
|
|
710
|
+
displayFormattedDate.value = input.value.substring(0, cursorPos - 2) + input.value.substring(cursorPos)
|
|
732
711
|
queueMicrotask(() => {
|
|
733
712
|
const newCursorPos = cursorPos - 2
|
|
734
713
|
input.setSelectionRange(newCursorPos, newCursorPos)
|
|
@@ -848,7 +827,7 @@
|
|
|
848
827
|
/**
|
|
849
828
|
* Gère les mises à jour de DateTextInput avec contrôle
|
|
850
829
|
*/
|
|
851
|
-
const handleDateTextInputUpdate = (value:
|
|
830
|
+
const handleDateTextInputUpdate = (value: DateModelValue) => {
|
|
852
831
|
// Ne pas traiter les mises à jour internes pour éviter les boucles
|
|
853
832
|
if (isUpdatingFromInternal.value) return
|
|
854
833
|
|
|
@@ -900,9 +879,9 @@
|
|
|
900
879
|
}
|
|
901
880
|
}
|
|
902
881
|
finally {
|
|
903
|
-
|
|
882
|
+
queueMicrotask(() => {
|
|
904
883
|
isUpdatingFromInternal.value = false
|
|
905
|
-
}
|
|
884
|
+
})
|
|
906
885
|
}
|
|
907
886
|
}
|
|
908
887
|
|
|
@@ -1072,6 +1051,7 @@
|
|
|
1072
1051
|
:title="props.title"
|
|
1073
1052
|
:hint="props.hint"
|
|
1074
1053
|
:persistent-hint="props.persistentHint"
|
|
1054
|
+
:skip-internal-validation="true"
|
|
1075
1055
|
@focus="emit('focus')"
|
|
1076
1056
|
@blur="emit('blur')"
|
|
1077
1057
|
/>
|
|
@@ -1105,6 +1085,7 @@
|
|
|
1105
1085
|
ref="dateCalendarTextInputRef"
|
|
1106
1086
|
:key="fieldKey"
|
|
1107
1087
|
:model-value="textInputValue"
|
|
1088
|
+
:skip-internal-validation="true"
|
|
1108
1089
|
:label="labelWithAsterisk"
|
|
1109
1090
|
:placeholder="props.placeholder"
|
|
1110
1091
|
:format="props.format"
|
|
@@ -1272,40 +1253,40 @@
|
|
|
1272
1253
|
.v-messages__message--success {
|
|
1273
1254
|
:deep(.v-input__control),
|
|
1274
1255
|
:deep(.v-messages__message) {
|
|
1275
|
-
color: rgb(var(--v-theme-
|
|
1256
|
+
color: rgb(var(--v-theme-success)) !important;
|
|
1276
1257
|
|
|
1277
1258
|
--v-medium-emphasis-opacity: 1;
|
|
1278
1259
|
}
|
|
1279
1260
|
|
|
1280
1261
|
.v-field--active & {
|
|
1281
|
-
color: rgb(var(--v-theme-
|
|
1262
|
+
color: rgb(var(--v-theme-success)) !important;
|
|
1282
1263
|
}
|
|
1283
1264
|
}
|
|
1284
1265
|
|
|
1285
1266
|
.v-messages__message--error {
|
|
1286
1267
|
:deep(.v-input__control),
|
|
1287
1268
|
:deep(.v-messages__message) {
|
|
1288
|
-
color: rgb(var(--v-theme-
|
|
1269
|
+
color: rgb(var(--v-theme-error)) !important;
|
|
1289
1270
|
}
|
|
1290
1271
|
|
|
1291
1272
|
.v-field--active & {
|
|
1292
|
-
color: rgb(var(--v-theme-
|
|
1273
|
+
color: rgb(var(--v-theme-error)) !important;
|
|
1293
1274
|
}
|
|
1294
1275
|
}
|
|
1295
1276
|
|
|
1296
1277
|
.v-messages__message--warning {
|
|
1297
1278
|
:deep(.v-input__control) {
|
|
1298
|
-
color: rgb(var(--v-theme-
|
|
1279
|
+
color: rgb(var(--v-theme-warning)) !important;
|
|
1299
1280
|
|
|
1300
1281
|
--v-medium-emphasis-opacity: 1;
|
|
1301
1282
|
}
|
|
1302
1283
|
|
|
1303
1284
|
:deep(.v-messages__message) {
|
|
1304
|
-
color: rgb(var(--v-theme-
|
|
1285
|
+
color: rgb(var(--v-theme-warning)) !important;
|
|
1305
1286
|
}
|
|
1306
1287
|
|
|
1307
1288
|
.v-field--active & {
|
|
1308
|
-
color: rgb(var(--v-theme-
|
|
1289
|
+
color: rgb(var(--v-theme-warning)) !important;
|
|
1309
1290
|
}
|
|
1310
1291
|
}
|
|
1311
1292
|
|
|
@@ -1341,7 +1322,8 @@
|
|
|
1341
1322
|
}
|
|
1342
1323
|
|
|
1343
1324
|
:deep(.v-date-picker-month__day .v-btn:hover) {
|
|
1344
|
-
background-color: rgb(var(--v-theme-
|
|
1325
|
+
// background-color: rgb(var(--v-theme-background));
|
|
1326
|
+
background: green !important;
|
|
1345
1327
|
}
|
|
1346
1328
|
|
|
1347
1329
|
:deep(.v-date-picker-month__day--selected, .v-date-picker-month__day--adjacent) {
|
|
@@ -1349,7 +1331,7 @@
|
|
|
1349
1331
|
}
|
|
1350
1332
|
|
|
1351
1333
|
:deep(.v-date-picker-month__day--selected .v-btn:hover) {
|
|
1352
|
-
background-color: rgb(var(--v-theme-
|
|
1334
|
+
background-color: rgb(var(--v-theme-primaryVariant)) !important;
|
|
1353
1335
|
}
|
|
1354
1336
|
|
|
1355
1337
|
:deep(.weekend .v-date-picker-month__day--week-end .v-btn) {
|
|
@@ -59,6 +59,24 @@ describe('ComplexDatePicker.clean', () => {
|
|
|
59
59
|
expect(wrapper.vm.currentMonthName).toBeTruthy()
|
|
60
60
|
})
|
|
61
61
|
|
|
62
|
+
it('preserves autoClamp in text input mode', async () => {
|
|
63
|
+
const wrapper = mountComponent({
|
|
64
|
+
label: 'Date Field',
|
|
65
|
+
format: 'DD/MM/YYYY',
|
|
66
|
+
autoClamp: true,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const input = wrapper.find('input')
|
|
70
|
+
await input.setValue('31/04/2025')
|
|
71
|
+
await input.trigger('blur')
|
|
72
|
+
await flushPromises()
|
|
73
|
+
|
|
74
|
+
expect(input.element.value).toBe('30/04/2025')
|
|
75
|
+
const emitted = wrapper.emitted('update:modelValue')
|
|
76
|
+
expect(emitted).toBeTruthy()
|
|
77
|
+
expect(emitted && emitted[emitted.length - 1]?.[0]).toBe('30/04/2025')
|
|
78
|
+
})
|
|
79
|
+
|
|
62
80
|
it('respects disabled and readonly props when opening the calendar', async () => {
|
|
63
81
|
const wrapper = mountComponent({
|
|
64
82
|
label: 'Date Field',
|
|
@@ -157,7 +175,7 @@ describe('ComplexDatePicker.clean', () => {
|
|
|
157
175
|
expect(wrapper.vm.selectedDates).not.toBeNull()
|
|
158
176
|
|
|
159
177
|
const input = wrapper.find('input')
|
|
160
|
-
expect((input.element as HTMLInputElement).value).toBe('01/01/2025 - ')
|
|
178
|
+
expect((input.element as HTMLInputElement).value).toBe('01/01/2025 - 10/01/2025')
|
|
161
179
|
})
|
|
162
180
|
|
|
163
181
|
it('generates all intermediate dates when selecting a range in range mode', async () => {
|
|
@@ -319,6 +337,29 @@ describe('ComplexDatePicker.clean', () => {
|
|
|
319
337
|
expect(wrapper.vm.errorMessages.length).toBeGreaterThan(0)
|
|
320
338
|
})
|
|
321
339
|
|
|
340
|
+
it('surfaces custom warning rules without blocking submit in calendar mode', async () => {
|
|
341
|
+
const wrapper = mountComponent({
|
|
342
|
+
label: 'Date Field',
|
|
343
|
+
format: 'DD/MM/YYYY',
|
|
344
|
+
customWarningRules: [
|
|
345
|
+
{
|
|
346
|
+
type: 'custom',
|
|
347
|
+
options: {
|
|
348
|
+
validate: () => false,
|
|
349
|
+
warningMessage: 'Warning de contrat ComplexDatePicker',
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
],
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
wrapper.vm.selectedDates = new Date(2025, 0, 1)
|
|
356
|
+
const result = await wrapper.vm.validateOnSubmit()
|
|
357
|
+
|
|
358
|
+
expect(result).toBe(true)
|
|
359
|
+
expect(wrapper.vm.errorMessages).toEqual([])
|
|
360
|
+
expect(wrapper.vm.warningMessages).toContain('Warning de contrat ComplexDatePicker')
|
|
361
|
+
})
|
|
362
|
+
|
|
322
363
|
it('validateDates flags an error when end date is before start date in range mode', async () => {
|
|
323
364
|
const wrapper = mountComponent({
|
|
324
365
|
label: 'Date Field',
|
|
@@ -379,4 +420,169 @@ describe('ComplexDatePicker.clean', () => {
|
|
|
379
420
|
expect(wrapper.vm.errorMessages.length).toBe(0)
|
|
380
421
|
expect(wrapper.vm.isDatePickerVisible).toBe(false)
|
|
381
422
|
})
|
|
423
|
+
|
|
424
|
+
it('handleDateSelected avec value null efface la sélection', async () => {
|
|
425
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY' })
|
|
426
|
+
wrapper.vm.selectedDates = new Date(2025, 0, 1)
|
|
427
|
+
await wrapper.vm.handleDateSelected(null)
|
|
428
|
+
await flushPromises()
|
|
429
|
+
expect(wrapper.vm.selectedDates).toBeNull()
|
|
430
|
+
})
|
|
431
|
+
|
|
432
|
+
it('handleDateSelected avec tableau range met à jour selectedDates', async () => {
|
|
433
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY', displayRange: true })
|
|
434
|
+
await wrapper.vm.handleDateSelected(['01/01/2025', '10/01/2025'])
|
|
435
|
+
await flushPromises()
|
|
436
|
+
expect(wrapper.vm.selectedDates).not.toBeNull()
|
|
437
|
+
})
|
|
438
|
+
|
|
439
|
+
it('watcher selectedDates null remet les dates à aujourd hui', async () => {
|
|
440
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY' })
|
|
441
|
+
wrapper.vm.selectedDates = new Date(2025, 0, 1)
|
|
442
|
+
await nextTick()
|
|
443
|
+
wrapper.vm.selectedDates = null
|
|
444
|
+
await flushPromises()
|
|
445
|
+
// currentYear doit être une année valide (reset vers today)
|
|
446
|
+
const year = Number(wrapper.vm.currentYear)
|
|
447
|
+
expect(year).toBeGreaterThanOrEqual(2025)
|
|
448
|
+
})
|
|
449
|
+
|
|
450
|
+
it('syncFromModelValue initialise depuis un array range', async () => {
|
|
451
|
+
const wrapper = mountComponent({
|
|
452
|
+
label: 'Test',
|
|
453
|
+
format: 'DD/MM/YYYY',
|
|
454
|
+
displayRange: true,
|
|
455
|
+
modelValue: ['01/01/2025', '10/01/2025'],
|
|
456
|
+
})
|
|
457
|
+
await flushPromises()
|
|
458
|
+
expect(wrapper.vm.selectedDates).not.toBeNull()
|
|
459
|
+
expect(wrapper.vm.displayFormattedDate).toContain('01/01/2025')
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
it('syncFromModelValue initialise depuis une string', async () => {
|
|
463
|
+
const wrapper = mountComponent({
|
|
464
|
+
label: 'Test',
|
|
465
|
+
format: 'DD/MM/YYYY',
|
|
466
|
+
modelValue: '15/06/2025',
|
|
467
|
+
})
|
|
468
|
+
await flushPromises()
|
|
469
|
+
expect(wrapper.vm.displayFormattedDate).toBe('15/06/2025')
|
|
470
|
+
})
|
|
471
|
+
|
|
472
|
+
it('reset avec disabled incrémente fieldKey', async () => {
|
|
473
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY', disabled: true })
|
|
474
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
475
|
+
const before = (wrapper.vm as any).fieldKey
|
|
476
|
+
wrapper.vm.reset()
|
|
477
|
+
await flushPromises()
|
|
478
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
479
|
+
expect((wrapper.vm as any).fieldKey).toBe(before + 1)
|
|
480
|
+
})
|
|
481
|
+
|
|
482
|
+
it('navigation année : bridge Dec→Jan quand currentMonth=11 et année monte', async () => {
|
|
483
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY' })
|
|
484
|
+
wrapper.vm.isDatePickerVisible = true
|
|
485
|
+
// Simuler mois=11 (décembre) et année qui monte
|
|
486
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
487
|
+
;(wrapper.vm as any).currentMonth = '11'
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
489
|
+
;(wrapper.vm as any).currentYear = '2024'
|
|
490
|
+
await nextTick()
|
|
491
|
+
// Émettre update:year avec une année supérieure
|
|
492
|
+
const dp = wrapper.findComponent({ name: 'VDatePicker' })
|
|
493
|
+
if (dp.exists()) {
|
|
494
|
+
await dp.vm.$emit('update:year', '2025')
|
|
495
|
+
await nextTick()
|
|
496
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
497
|
+
expect((wrapper.vm as any).currentMonth).toBe('0')
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
// VDatePicker non rendu sans le calendrier ouvert – appel direct
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
502
|
+
;(wrapper.vm as any).handleYearUpdate?.()
|
|
503
|
+
}
|
|
504
|
+
})
|
|
505
|
+
|
|
506
|
+
const makeKeydownEvent = (key: string, inputProps: Partial<HTMLInputElement> = {}) => {
|
|
507
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
508
|
+
const fakeInput = Object.assign(document.createElement('input'), inputProps) as any
|
|
509
|
+
fakeInput.setSelectionRange = () => {}
|
|
510
|
+
const event = new KeyboardEvent('keydown', { key, bubbles: true })
|
|
511
|
+
Object.defineProperty(event, 'target', { value: fakeInput, writable: false })
|
|
512
|
+
return event
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
it('handleKeydown Backspace sur séparateur supprime le séparateur', async () => {
|
|
516
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY' })
|
|
517
|
+
const event = makeKeydownEvent('Backspace', { value: '01/', selectionStart: 3, selectionEnd: 3 })
|
|
518
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
519
|
+
;(wrapper.vm as any).handleKeydown(event)
|
|
520
|
+
await nextTick()
|
|
521
|
+
expect(wrapper.exists()).toBe(true)
|
|
522
|
+
})
|
|
523
|
+
|
|
524
|
+
it('handleKeydown ArrowLeft saute le séparateur', async () => {
|
|
525
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY' })
|
|
526
|
+
const event = makeKeydownEvent('ArrowLeft', { value: '01/01/2025', selectionStart: 3, selectionEnd: 3 })
|
|
527
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
528
|
+
;(wrapper.vm as any).handleKeydown(event)
|
|
529
|
+
await nextTick()
|
|
530
|
+
expect(wrapper.exists()).toBe(true)
|
|
531
|
+
})
|
|
532
|
+
|
|
533
|
+
it('handleKeydown ArrowRight saute le séparateur', async () => {
|
|
534
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY' })
|
|
535
|
+
const event = makeKeydownEvent('ArrowRight', { value: '01/01/2025', selectionStart: 2, selectionEnd: 2 })
|
|
536
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
537
|
+
;(wrapper.vm as any).handleKeydown(event)
|
|
538
|
+
await nextTick()
|
|
539
|
+
expect(wrapper.exists()).toBe(true)
|
|
540
|
+
})
|
|
541
|
+
|
|
542
|
+
it('handleDateTextInputUpdate en mode noCalendar met à jour le modèle depuis une string', async () => {
|
|
543
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY', noCalendar: true })
|
|
544
|
+
const input = wrapper.find('input')
|
|
545
|
+
await input.setValue('15/06/2025')
|
|
546
|
+
await input.trigger('blur')
|
|
547
|
+
await flushPromises()
|
|
548
|
+
const emitted = wrapper.emitted('update:modelValue')
|
|
549
|
+
expect(emitted).toBeTruthy()
|
|
550
|
+
})
|
|
551
|
+
|
|
552
|
+
it('handleDateTextInputUpdate avec valeur null efface selectedDates via reset', async () => {
|
|
553
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY', noCalendar: true })
|
|
554
|
+
wrapper.vm.selectedDates = new Date(2025, 0, 1)
|
|
555
|
+
wrapper.vm.reset()
|
|
556
|
+
await flushPromises()
|
|
557
|
+
expect(wrapper.vm.selectedDates).toBeNull()
|
|
558
|
+
})
|
|
559
|
+
|
|
560
|
+
it('handleDateTextInputUpdate avec array range startDate only via noCalendar', async () => {
|
|
561
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY', noCalendar: true, displayRange: true })
|
|
562
|
+
const input = wrapper.find('input')
|
|
563
|
+
await input.setValue('01/01/2025 - ')
|
|
564
|
+
await input.trigger('blur')
|
|
565
|
+
await flushPromises()
|
|
566
|
+
expect(wrapper.exists()).toBe(true)
|
|
567
|
+
})
|
|
568
|
+
|
|
569
|
+
it('handleKeydown readonly ne fait rien', async () => {
|
|
570
|
+
const wrapper = mountComponent({ label: 'Test', format: 'DD/MM/YYYY', readonly: true })
|
|
571
|
+
const event = makeKeydownEvent('Backspace', { value: '01/01/2025', selectionStart: 3, selectionEnd: 3 })
|
|
572
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
573
|
+
;(wrapper.vm as any).handleKeydown(event)
|
|
574
|
+
await nextTick()
|
|
575
|
+
expect(wrapper.exists()).toBe(true)
|
|
576
|
+
})
|
|
577
|
+
|
|
578
|
+
it('keeps deprecated birthDate prop as an alias for birth date mode', () => {
|
|
579
|
+
const wrapper = mountComponent({
|
|
580
|
+
label: 'Date Field',
|
|
581
|
+
birthDate: true,
|
|
582
|
+
format: 'DD/MM/YYYY',
|
|
583
|
+
})
|
|
584
|
+
|
|
585
|
+
expect(wrapper.props('birthDate')).toBe(true)
|
|
586
|
+
expect(wrapper.vm.currentViewMode).toBe('year')
|
|
587
|
+
})
|
|
382
588
|
})
|