@cnamts/synapse 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateFilter-BmRuzQ9Z.js +98 -0
- package/dist/NumberFilter-CnIPDHqx.js +121 -0
- package/dist/PeriodFilter-CZwZ8CnQ.js +112 -0
- package/dist/SelectFilter-Cj-GW2Cc.js +97 -0
- package/dist/TextFilter-DTxZHJwX.js +114 -0
- package/dist/{components/BackBtn → common}/constants/ExpertiseLevelEnum.d.ts +3 -0
- package/dist/components/BackBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/BackToTopBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/ChipList/AccessibiliteItems.d.ts +1 -1
- package/dist/components/CollapsibleList/AccessibiliteItems.d.ts +1 -1
- package/dist/components/ContextualMenu/AccessibiliteItems.d.ts +1 -1
- package/dist/components/CookieBanner/AccessibiliteItems.d.ts +1 -1
- package/dist/components/CopyBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Customs/SyBtnSelect/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Customs/SyInputSelect/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Customs/SySelect/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Customs/SyTextField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/DataList/AccessibiliteItems.d.ts +1 -1
- package/dist/components/DataListGroup/AccessibiliteItems.d.ts +1 -1
- package/dist/components/DatePicker/AccessibiliteItems.d.ts +1 -1
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +4162 -0
- package/dist/components/DatePicker/{DatePicker.d.ts → DatePicker/DatePicker.d.ts} +142 -102
- package/dist/components/DatePicker/{DateTextInput.d.ts → DateTextInput/DateTextInput.d.ts} +32 -26
- package/dist/components/DatePicker/composables/index.d.ts +15 -0
- package/dist/components/DatePicker/composables/useDateFormatValidation.d.ts +25 -0
- package/dist/components/DatePicker/composables/useDateInputEditing.d.ts +33 -0
- package/dist/components/DatePicker/composables/useDatePickerViewMode.d.ts +16 -0
- package/dist/components/DatePicker/composables/useDatePickerVisibility.d.ts +27 -0
- package/dist/components/DatePicker/composables/useDateRangeInput.d.ts +29 -0
- package/dist/components/DatePicker/composables/useDateRangeValidation.d.ts +11 -0
- package/dist/components/DatePicker/composables/useDateSelection.d.ts +10 -0
- package/dist/components/DatePicker/composables/useDateValidation.d.ts +35 -0
- package/dist/components/DatePicker/composables/useDisplayedDateString.d.ts +16 -0
- package/dist/components/DatePicker/composables/useIconState.d.ts +17 -0
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +30 -0
- package/dist/components/DatePicker/composables/useInputHandler.d.ts +32 -0
- package/dist/components/DatePicker/composables/useManualDateValidation.d.ts +33 -0
- package/dist/components/DatePicker/composables/useMonthButtonCustomization.d.ts +9 -0
- package/dist/components/DatePicker/composables/useTodayButton.d.ts +16 -0
- package/dist/components/DatePicker/composables/useWeekendDays.d.ts +11 -0
- package/dist/components/DatePicker/constants/messages.d.ts +29 -0
- package/dist/components/DatePicker/types.d.ts +13 -0
- package/dist/components/DialogBox/AccessibiliteItems.d.ts +1 -1
- package/dist/components/DownloadBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/ErrorPage/AccessibiliteItems.d.ts +1 -1
- package/dist/components/ExternalLinks/AccessibiliteItems.d.ts +1 -1
- package/dist/components/FileList/AccessibiliteItems.d.ts +1 -1
- package/dist/components/FilePreview/AccessibiliteItems.d.ts +1 -1
- package/dist/components/FileUpload/AccessibiliteItems.d.ts +1 -1
- package/dist/components/FilterInline/AccessibiliteItems.d.ts +1 -1
- package/dist/components/FilterSideBar/AccessibiliteItems.d.ts +1 -1
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +395 -1
- package/dist/components/FooterBar/AccessibiliteItems.d.ts +1 -1
- package/dist/components/FranceConnectBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/HeaderBar/AccessibiliteItems.d.ts +1 -1
- package/dist/components/HeaderBar/HeaderBurgerMenu/AccessibiliteItems.d.ts +1 -1
- package/dist/components/HeaderLoading/AccessibiliteItems.d.ts +1 -1
- package/dist/components/HeaderToolbar/AccessibiliteItems.d.ts +1 -1
- package/dist/components/LangBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Logo/AccessibiliteItems.d.ts +1 -1
- package/dist/components/LogoBrandSection/AccessibiliteItems.d.ts +1 -1
- package/dist/components/MaintenancePage/AccessibiliteItems.d.ts +1 -1
- package/dist/components/NirField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/NotFoundPage/AccessibiliteItems.d.ts +1 -1
- package/dist/components/NotificationBar/AccessibiliteItems.d.ts +1 -1
- package/dist/components/PageContainer/AccessibiliteItems.d.ts +1 -1
- package/dist/components/PaginatedTable/AccessibiliteItems.d.ts +1 -1
- package/dist/components/PasswordField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/PeriodField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/PeriodField/PeriodField.d.ts +171 -37
- package/dist/components/PhoneField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/RangeField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/RatingPicker/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SearchListField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SelectBtnField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SkipLink/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SocialMediaLinks/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SubHeader/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SyAlert/AccessibiliteItems.d.ts +1 -1
- package/dist/components/TableToolbar/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +647 -0
- package/dist/components/Tables/SyTable/SyTable.d.ts +666 -0
- package/dist/components/Tables/common/SyTableFilter.d.ts +126 -0
- package/dist/components/Tables/common/TableHeader.d.ts +33 -0
- package/dist/components/Tables/common/constants/StateEnum.d.ts +6 -0
- package/dist/components/Tables/common/filters/DateFilter.d.ts +121 -0
- package/dist/components/Tables/common/filters/NumberFilter.d.ts +132 -0
- package/dist/components/Tables/common/filters/PeriodFilter.d.ts +135 -0
- package/dist/components/Tables/common/filters/SelectFilter.d.ts +120 -0
- package/dist/components/Tables/common/filters/TextFilter.d.ts +132 -0
- package/dist/components/Tables/common/formatters.d.ts +17 -0
- package/dist/components/Tables/common/locales.d.ts +7 -0
- package/dist/components/Tables/common/tableAccessibilityUtils.d.ts +8 -0
- package/dist/components/Tables/common/tableFilterUtils.d.ts +2 -0
- package/dist/components/Tables/common/tableStorageUtils.d.ts +29 -0
- package/dist/components/Tables/common/tableUtils.d.ts +42 -0
- package/dist/components/Tables/common/types.d.ts +80 -0
- package/dist/components/Tables/common/useTableFilter.d.ts +9 -0
- package/dist/components/Tables/index.d.ts +2 -0
- package/dist/components/UploadWorkflow/AccessibiliteItems.d.ts +1 -1
- package/dist/components/UserMenuBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/design-system-v3.js +100 -11944
- package/dist/design-system-v3.umd.cjs +22 -4
- package/dist/designTokens/index.d.ts +3 -1
- package/dist/designTokens/tokens/cnam/cnamFonts.d.ts +140 -0
- package/dist/designTokens/tokens/pa/paFonts.d.ts +140 -0
- package/dist/designTokens/utils/createFontVariables.d.ts +39 -0
- package/dist/designTokens/utils/index.d.ts +2 -1
- package/dist/main-WDqeoGM-.js +14788 -0
- package/dist/style.css +1 -1
- package/dist/utils/rules/isRequired/index.d.ts +1 -1
- package/dist/vite-env.d.ts +12 -0
- package/package.json +3 -3
- package/src/assets/_spacers.scss +37 -1
- package/src/assets/_typography.scss +158 -0
- package/src/assets/settings.scss +7 -0
- package/src/common/constants/ExpertiseLevelEnum.ts +7 -0
- package/src/components/BackBtn/AccessibiliteItems.ts +1 -1
- package/src/components/BackToTopBtn/AccessibiliteItems.ts +1 -1
- package/src/components/ChipList/AccessibiliteItems.ts +1 -1
- package/src/components/CollapsibleList/AccessibiliteItems.ts +1 -1
- package/src/components/ContextualMenu/AccessibiliteItems.ts +1 -1
- package/src/components/CookieBanner/AccessibiliteItems.ts +1 -1
- package/src/components/CopyBtn/AccessibiliteItems.ts +1 -1
- package/src/components/Customs/SyBtnSelect/AccessibiliteItems.ts +1 -1
- package/src/components/Customs/SyInputSelect/AccessibiliteItems.ts +1 -1
- package/src/components/Customs/SySelect/AccessibiliteItems.ts +1 -1
- package/src/components/Customs/SySelect/SySelect.vue +3 -9
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +4 -2
- package/src/components/Customs/SyTextField/AccessibiliteItems.ts +1 -1
- package/src/components/DataList/AccessibiliteItems.ts +1 -1
- package/src/components/DataListGroup/AccessibiliteItems.ts +1 -1
- package/src/components/DatePicker/AccessibiliteItems.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.mdx +212 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +1097 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +497 -180
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +941 -0
- package/src/components/DatePicker/DatePicker/DatePicker.mdx +176 -0
- package/src/components/DatePicker/{tests → DatePicker}/DatePicker.spec.ts +1 -1
- package/src/components/DatePicker/{DatePicker.stories.ts → DatePicker/DatePicker.stories.ts} +115 -400
- package/src/components/DatePicker/{DatePicker.vue → DatePicker/DatePicker.vue} +302 -84
- package/src/components/DatePicker/DatePickerOverview.mdx +227 -0
- package/src/components/DatePicker/{DatePickerValidation.mdx → DatePickerValidationExample/DatePickerValidation.mdx} +3 -3
- package/src/components/DatePicker/{DatePickerValidation.stories.ts → DatePickerValidationExample/DatePickerValidation.stories.ts} +2 -2
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +310 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +278 -0
- package/src/components/DatePicker/{tests → DateTextInput}/DateTextInput.spec.ts +8 -7
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +916 -0
- package/src/components/DatePicker/DateTextInput/NoCalendar.mdx +64 -0
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +572 -0
- package/src/components/DatePicker/composables/index.ts +22 -0
- package/src/components/DatePicker/composables/tests/useDateFormatValidation.spec.ts +165 -0
- package/src/components/DatePicker/composables/tests/useDateInputEditing.spec.ts +359 -0
- package/src/components/DatePicker/composables/tests/useDatePickerViewMode.spec.ts +160 -0
- package/src/components/DatePicker/composables/tests/useDatePickerVisibility.spec.ts +339 -0
- package/src/components/DatePicker/composables/tests/useDateRangeInput.spec.ts +277 -0
- package/src/components/DatePicker/composables/tests/useDateRangeValidation.spec.ts +107 -0
- package/src/components/DatePicker/composables/tests/useDateSelection.spec.ts +171 -0
- package/src/components/DatePicker/composables/tests/useDateValidation.spec.ts +245 -0
- package/src/components/DatePicker/composables/tests/useDisplayedDateString.spec.ts +98 -0
- package/src/components/DatePicker/composables/tests/useIconState.spec.ts +130 -0
- package/src/components/DatePicker/composables/tests/useInputBlurHandler.spec.ts +278 -0
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +233 -0
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +100 -0
- package/src/components/DatePicker/composables/tests/useTodayButton.spec.ts +97 -0
- package/src/components/DatePicker/composables/tests/useWeekendDays.spec.ts +28 -0
- package/src/components/DatePicker/composables/useDateFormatValidation.ts +95 -0
- package/src/components/DatePicker/composables/useDateInputEditing.ts +326 -0
- package/src/components/DatePicker/composables/useDatePickerViewMode.ts +61 -0
- package/src/components/DatePicker/composables/useDatePickerVisibility.ts +146 -0
- package/src/components/DatePicker/composables/useDateRangeInput.ts +375 -0
- package/src/components/DatePicker/composables/useDateRangeValidation.ts +48 -0
- package/src/components/DatePicker/composables/useDateSelection.ts +121 -0
- package/src/components/DatePicker/composables/useDateValidation.ts +225 -0
- package/src/components/DatePicker/composables/useDisplayedDateString.ts +58 -0
- package/src/components/DatePicker/composables/useIconState.ts +53 -0
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +101 -0
- package/src/components/DatePicker/composables/useInputHandler.ts +436 -0
- package/src/components/DatePicker/composables/useManualDateValidation.ts +161 -0
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +89 -0
- package/src/components/DatePicker/composables/useTodayButton.ts +43 -0
- package/src/components/DatePicker/composables/useWeekendDays.ts +21 -0
- package/src/components/DatePicker/constants/messages.ts +50 -0
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +4 -4
- package/src/components/DatePicker/docExamples/DatePickerValidationExamples.vue +1 -1
- package/src/components/DatePicker/playground/ComplexDatePickerPlayground.vue +172 -0
- package/src/components/DatePicker/types.ts +15 -0
- package/src/components/DialogBox/AccessibiliteItems.ts +1 -1
- package/src/components/DownloadBtn/AccessibiliteItems.ts +1 -1
- package/src/components/ErrorPage/AccessibiliteItems.ts +1 -1
- package/src/components/ExternalLinks/AccessibiliteItems.ts +1 -1
- package/src/components/FileList/AccessibiliteItems.ts +1 -1
- package/src/components/FilePreview/AccessibiliteItems.ts +1 -1
- package/src/components/FileUpload/AccessibiliteItems.ts +1 -1
- package/src/components/FilterInline/AccessibiliteItems.ts +1 -1
- package/src/components/FilterSideBar/AccessibiliteItems.ts +1 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +108 -90
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +27 -0
- package/src/components/FilterSideBar/tests/__snapshots__/FilterSideBar.spec.ts.snap +114 -109
- package/src/components/FooterBar/AccessibiliteItems.ts +1 -1
- package/src/components/FooterBar/FooterBar.vue +2 -1
- package/src/components/FranceConnectBtn/AccessibiliteItems.ts +1 -1
- package/src/components/HeaderBar/AccessibiliteItems.ts +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/AccessibiliteItems.ts +1 -1
- package/src/components/HeaderLoading/AccessibiliteItems.ts +1 -1
- package/src/components/HeaderToolbar/AccessibiliteItems.ts +1 -1
- package/src/components/LangBtn/AccessibiliteItems.ts +1 -1
- package/src/components/Logo/Accessibilite.stories.ts +4 -0
- package/src/components/Logo/AccessibiliteItems.ts +1 -1
- package/src/components/LogoBrandSection/AccessibiliteItems.ts +1 -1
- package/src/components/MaintenancePage/AccessibiliteItems.ts +1 -1
- package/src/components/NirField/AccessibiliteItems.ts +1 -1
- package/src/components/NotFoundPage/AccessibiliteItems.ts +1 -1
- package/src/components/NotificationBar/AccessibiliteItems.ts +1 -1
- package/src/components/PageContainer/AccessibiliteItems.ts +1 -1
- package/src/components/PaginatedTable/AccessibiliteItems.ts +1 -1
- package/src/components/PaginatedTable/PaginatedTable.stories.ts +19 -0
- package/src/components/PaginatedTable/PaginatedTable.vue +51 -13
- package/src/components/PaginatedTable/tests/PaginatedTable.spec.ts +0 -2
- package/src/components/PasswordField/AccessibiliteItems.ts +1 -1
- package/src/components/PeriodField/AccessibiliteItems.ts +1 -1
- package/src/components/PeriodField/PeriodField.vue +13 -1
- package/src/components/PhoneField/AccessibiliteItems.ts +1 -1
- package/src/components/RangeField/AccessibiliteItems.ts +1 -1
- package/src/components/RatingPicker/AccessibiliteItems.ts +1 -1
- package/src/components/SearchListField/AccessibiliteItems.ts +1 -1
- package/src/components/SelectBtnField/AccessibiliteItems.ts +1 -1
- package/src/components/SkipLink/AccessibiliteItems.ts +1 -1
- package/src/components/SocialMediaLinks/AccessibiliteItems.ts +1 -1
- package/src/components/SubHeader/AccessibiliteItems.ts +1 -1
- package/src/components/SyAlert/AccessibiliteItems.ts +1 -1
- package/src/components/TableToolbar/AccessibiliteItems.ts +1 -1
- package/src/components/TableToolbar/TableToolbar.stories.ts +110 -56
- package/src/components/Tables/SyServerTable/FilterRules.stories.ts +83 -0
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +160 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +2887 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +302 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +450 -0
- package/src/components/Tables/SyServerTable/tests/__snapshots__/SyServerTable.spec.ts.snap +521 -0
- package/src/components/Tables/SyTable/FilterRules.stories.ts +235 -0
- package/src/components/Tables/SyTable/SyTable.mdx +129 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +1966 -0
- package/src/components/Tables/SyTable/SyTable.vue +317 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +345 -0
- package/src/components/Tables/SyTable/tests/__snapshots__/SyTable.spec.ts.snap +521 -0
- package/src/components/Tables/common/SyTableFilter.vue +342 -0
- package/src/components/Tables/common/TableHeader.vue +221 -0
- package/src/components/Tables/common/constants/StateEnum.ts +6 -0
- package/src/components/Tables/common/filters/DateFilter.vue +140 -0
- package/src/components/Tables/common/filters/NumberFilter.vue +234 -0
- package/src/components/Tables/common/filters/PeriodFilter.vue +147 -0
- package/src/components/Tables/common/filters/SelectFilter.vue +126 -0
- package/src/components/Tables/common/filters/TextFilter.vue +191 -0
- package/src/components/Tables/common/filters/tests/DateFilter.spec.ts +187 -0
- package/src/components/Tables/common/filters/tests/NumberFilter.spec.ts +280 -0
- package/src/components/Tables/common/filters/tests/PeriodFilter.spec.ts +192 -0
- package/src/components/Tables/common/filters/tests/SelectFilter.spec.ts +219 -0
- package/src/components/Tables/common/filters/tests/TextFilter.spec.ts +260 -0
- package/src/components/Tables/common/formatters.ts +72 -0
- package/src/components/Tables/common/locales.ts +7 -0
- package/src/components/Tables/common/tableAccessibilityUtils.ts +61 -0
- package/src/components/Tables/common/tableFilterUtils.ts +327 -0
- package/src/components/Tables/common/tableStorageUtils.ts +102 -0
- package/src/components/Tables/common/tableStyles.scss +54 -0
- package/src/components/Tables/common/tableUtils.ts +115 -0
- package/src/components/Tables/common/tests/SyTableFilter.spec.ts +312 -0
- package/src/components/Tables/common/tests/resize.spec.ts +161 -0
- package/src/components/Tables/common/tests/tableFilterUtils.spec.ts +106 -0
- package/src/components/Tables/common/tests/tableUtils.spec.ts +272 -0
- package/src/components/Tables/common/types.ts +81 -0
- package/src/components/Tables/common/useTableFilter.ts +19 -0
- package/src/components/Tables/index.ts +3 -0
- package/src/components/UploadWorkflow/AccessibiliteItems.ts +1 -1
- package/src/components/UserMenuBtn/AccessibiliteItems.ts +1 -1
- package/src/components/index.ts +3 -1
- package/src/composables/date/useDateFormatDayjs.ts +8 -3
- package/src/composables/date/useDateInitializationDayjs.ts +28 -36
- package/src/composables/rules/useFieldValidation.ts +1 -2
- package/src/designTokens/index.ts +4 -0
- package/src/designTokens/tokens/cnam/cnamFonts.ts +140 -0
- package/src/designTokens/tokens/pa/paFonts.ts +140 -0
- package/src/designTokens/utils/createFontVariables.ts +143 -0
- package/src/designTokens/utils/index.ts +2 -1
- package/src/stories/Demarrer/Accueil.stories.ts +12 -3
- package/src/utils/rules/isHolidayDay/IsHolidayDay.stories.ts +1 -1
- package/src/utils/rules/isRequired/index.ts +2 -1
- package/src/vite-env.d.ts +12 -0
- package/src/vuetifyConfig.ts +10 -3
- package/dist/components/BackToTopBtn/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/ChipList/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/CollapsibleList/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/ContextualMenu/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/CookieBanner/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/CopyBtn/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/Customs/SyBtnSelect/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/Customs/SyInputSelect/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/Customs/SySelect/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/Customs/SyTextField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/DataList/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/DataListGroup/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/DatePicker/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/DialogBox/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/DownloadBtn/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/ErrorPage/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/ExternalLinks/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/FileList/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/FilePreview/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/FileUpload/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/FilterInline/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/FilterSideBar/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/FooterBar/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/FranceConnectBtn/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/HeaderBar/HeaderBurgerMenu/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/HeaderBar/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/HeaderLoading/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/HeaderToolbar/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/LangBtn/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/Logo/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/LogoBrandSection/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/MaintenancePage/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/NirField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/NotFoundPage/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/NotificationBar/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/PageContainer/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/PaginatedTable/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/PasswordField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/PeriodField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/PhoneField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/RangeField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/RatingPicker/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/SearchListField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/SelectBtnField/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/SkipLink/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/SocialMediaLinks/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/SubHeader/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/SyAlert/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/TableToolbar/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/UploadWorkflow/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/dist/components/UserMenuBtn/constants/ExpertiseLevelEnum.d.ts +0 -4
- package/src/components/BackBtn/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/ChipList/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/ContextualMenu/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/CookieBanner/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/Customs/SyBtnSelect/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/Customs/SyInputSelect/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/Customs/SySelect/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/Customs/SyTextField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/DataList/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/DataListGroup/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/DatePicker/DatePicker.mdx +0 -222
- package/src/components/DatePicker/DateTextInput.vue +0 -504
- package/src/components/DatePicker/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/DialogBox/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/DownloadBtn/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/ErrorPage/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/ExternalLinks/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/FileList/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/FilePreview/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/FileUpload/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/FilterInline/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/FilterSideBar/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/FooterBar/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/HeaderBar/HeaderBurgerMenu/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/HeaderBar/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/HeaderLoading/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/HeaderToolbar/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/LangBtn/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/Logo/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/LogoBrandSection/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/MaintenancePage/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/NirField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/NotFoundPage/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/PaginatedTable/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/PasswordField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/PeriodField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/PhoneField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/RangeField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/RatingPicker/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/SearchListField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/SelectBtnField/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/SocialMediaLinks/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/SubHeader/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/SyAlert/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/TableToolbar/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.ts +0 -4
- package/src/components/UserMenuBtn/constants/ExpertiseLevelEnum.ts +0 -4
- /package/src/components/DatePicker/{examples → playground}/DatePickerHolidayRule.vue +0 -0
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick, type ComponentPublicInstance } from 'vue'
|
|
2
|
+
import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick, type ComponentPublicInstance, type Ref } from 'vue'
|
|
3
3
|
import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
|
|
4
|
-
import DateTextInput from '../DateTextInput.vue'
|
|
4
|
+
import DateTextInput from '../DateTextInput/DateTextInput.vue'
|
|
5
5
|
import { VDatePicker } from 'vuetify/components'
|
|
6
|
+
import { useInputHandler } from '../composables/useInputHandler'
|
|
6
7
|
import { useValidation } from '@/composables/validation/useValidation'
|
|
7
8
|
import { useDateFormat } from '@/composables/date/useDateFormatDayjs'
|
|
8
|
-
import { useDateInitialization, type
|
|
9
|
+
import { useDateInitialization, type DateInput, type DateValue } from '@/composables/date/useDateInitializationDayjs'
|
|
10
|
+
import type { DateObjectValue } from '../types'
|
|
9
11
|
import { useDatePickerAccessibility } from '@/composables/date/useDatePickerAccessibility'
|
|
12
|
+
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
13
|
+
import { useMonthButtonCustomization } from '../composables'
|
|
14
|
+
import { mdiCalendar } from '@mdi/js'
|
|
15
|
+
import {
|
|
16
|
+
useWeekendDays,
|
|
17
|
+
useTodayButton,
|
|
18
|
+
useDatePickerViewMode,
|
|
19
|
+
useDateSelection,
|
|
20
|
+
useDateRangeValidation,
|
|
21
|
+
useDateFormatValidation,
|
|
22
|
+
useIconState,
|
|
23
|
+
useDateValidation,
|
|
24
|
+
useManualDateValidation,
|
|
25
|
+
useInputBlurHandler,
|
|
26
|
+
useDatePickerVisibility,
|
|
27
|
+
useDisplayedDateString,
|
|
28
|
+
} from '../composables'
|
|
29
|
+
|
|
10
30
|
import dayjs from 'dayjs'
|
|
11
31
|
import customParseFormat from 'dayjs/plugin/customParseFormat'
|
|
12
32
|
|
|
@@ -23,6 +43,7 @@
|
|
|
23
43
|
format?: string
|
|
24
44
|
dateFormatReturn?: string
|
|
25
45
|
isBirthDate?: boolean
|
|
46
|
+
birthDate?: boolean // Alias pour isBirthDate pour compatibilité avec l'attribut kebab-case birth-date
|
|
26
47
|
showWeekNumber?: boolean
|
|
27
48
|
required?: boolean
|
|
28
49
|
displayRange?: boolean
|
|
@@ -43,12 +64,19 @@
|
|
|
43
64
|
showSuccessMessages?: boolean
|
|
44
65
|
bgColor?: string
|
|
45
66
|
textFieldActivator?: boolean
|
|
67
|
+
displayTodayButton?: boolean
|
|
68
|
+
displayWeekendDays?: boolean
|
|
69
|
+
period?: {
|
|
70
|
+
min?: string
|
|
71
|
+
max?: string
|
|
72
|
+
}
|
|
46
73
|
}>(), {
|
|
47
74
|
modelValue: undefined,
|
|
48
|
-
placeholder:
|
|
49
|
-
format:
|
|
75
|
+
placeholder: DATE_PICKER_MESSAGES.PLACEHOLDER_DEFAULT,
|
|
76
|
+
format: DATE_PICKER_MESSAGES.FORMAT_DEFAULT,
|
|
50
77
|
dateFormatReturn: '',
|
|
51
78
|
isBirthDate: false,
|
|
79
|
+
birthDate: false,
|
|
52
80
|
showWeekNumber: false,
|
|
53
81
|
required: false,
|
|
54
82
|
displayRange: false,
|
|
@@ -67,6 +95,12 @@
|
|
|
67
95
|
showSuccessMessages: true,
|
|
68
96
|
bgColor: undefined,
|
|
69
97
|
textFieldActivator: false,
|
|
98
|
+
displayTodayButton: true,
|
|
99
|
+
displayWeekendDays: true,
|
|
100
|
+
period: () => ({
|
|
101
|
+
min: '',
|
|
102
|
+
max: '',
|
|
103
|
+
}),
|
|
70
104
|
})
|
|
71
105
|
|
|
72
106
|
const emit = defineEmits<{
|
|
@@ -74,12 +108,18 @@
|
|
|
74
108
|
(e: 'closed'): void
|
|
75
109
|
(e: 'focus'): void
|
|
76
110
|
(e: 'blur'): void
|
|
111
|
+
(e: 'input', value: string): void
|
|
112
|
+
(e: 'date-selected', value: DateValue): void
|
|
77
113
|
}>()
|
|
78
114
|
|
|
79
|
-
|
|
115
|
+
// Utilisation du composable pour la saisie manuelle des plages de dates
|
|
116
|
+
const selectedDates = ref<Date | (Date | null)[] | null>(
|
|
80
117
|
initializeSelectedDates(props.modelValue as DateInput | null, props.format, props.dateFormatReturn),
|
|
81
118
|
)
|
|
82
119
|
|
|
120
|
+
// Utilisation du composable pour la validation des plages de dates
|
|
121
|
+
const { currentRangeIsValid, getRangeValidationError } = useDateRangeValidation(selectedDates as Ref<DateObjectValue>, props.displayRange)
|
|
122
|
+
|
|
83
123
|
const isDatePickerVisible = ref(false)
|
|
84
124
|
const validation = useValidation({
|
|
85
125
|
showSuccessMessages: props.showSuccessMessages,
|
|
@@ -90,61 +130,48 @@
|
|
|
90
130
|
})
|
|
91
131
|
const { errors, warnings, successes, validateField, clearValidation } = validation
|
|
92
132
|
|
|
93
|
-
const errorMessages = errors
|
|
94
|
-
const warningMessages = warnings
|
|
95
|
-
const successMessages = successes
|
|
133
|
+
const errorMessages = computed(() => errors.value)
|
|
134
|
+
const warningMessages = computed(() => warnings.value)
|
|
135
|
+
const successMessages = computed(() => successes.value)
|
|
96
136
|
const displayFormattedDate = ref('')
|
|
97
137
|
|
|
98
138
|
const textInputValue = ref<string>('')
|
|
99
139
|
|
|
140
|
+
// Variables pour la gestion de la saisie manuelle
|
|
141
|
+
const isManualInputActive = ref(false)
|
|
142
|
+
const isFormatting = ref(false)
|
|
143
|
+
|
|
100
144
|
// Variable pour éviter les mises à jour récursives
|
|
101
145
|
const isUpdatingFromInternal = ref(false)
|
|
146
|
+
// Variable pour suivre si l'utilisateur a interagi avec le champ
|
|
147
|
+
const hasInteracted = ref(false)
|
|
148
|
+
|
|
149
|
+
const { validateDateFormat, isDateComplete } = useDateFormatValidation({
|
|
150
|
+
format: props.format,
|
|
151
|
+
dateFormatReturn: props.dateFormatReturn,
|
|
152
|
+
required: props.required,
|
|
153
|
+
hasInteracted,
|
|
154
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
155
|
+
})
|
|
102
156
|
|
|
103
|
-
//
|
|
104
|
-
const validateDates
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
return
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (!selectedDates.value) return
|
|
126
|
-
|
|
127
|
-
// Préparer les dates à valider
|
|
128
|
-
const datesToValidate = Array.isArray(selectedDates.value)
|
|
129
|
-
? selectedDates.value
|
|
130
|
-
: [selectedDates.value]
|
|
131
|
-
|
|
132
|
-
// Valider chaque date
|
|
133
|
-
if (shouldDisplayErrors) {
|
|
134
|
-
datesToValidate.forEach((date) => {
|
|
135
|
-
validateField(
|
|
136
|
-
date,
|
|
137
|
-
props.customRules,
|
|
138
|
-
props.customWarningRules,
|
|
139
|
-
)
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
// Dédoublonner les messages (au cas où plusieurs dates auraient les mêmes messages)
|
|
143
|
-
errors.value = [...new Set(errors.value)]
|
|
144
|
-
warnings.value = [...new Set(warnings.value)]
|
|
145
|
-
successes.value = [...new Set(successes.value)]
|
|
146
|
-
}
|
|
147
|
-
}
|
|
157
|
+
// pour valider les dates
|
|
158
|
+
const { validateDates, validateOnSubmit } = useDateValidation({
|
|
159
|
+
noCalendar: props.noCalendar,
|
|
160
|
+
required: props.required,
|
|
161
|
+
displayRange: props.displayRange,
|
|
162
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
163
|
+
customRules: props.customRules,
|
|
164
|
+
customWarningRules: props.customWarningRules,
|
|
165
|
+
selectedDates,
|
|
166
|
+
isUpdatingFromInternal,
|
|
167
|
+
currentRangeIsValid,
|
|
168
|
+
getRangeValidationError,
|
|
169
|
+
clearValidation,
|
|
170
|
+
validateField,
|
|
171
|
+
errors,
|
|
172
|
+
warnings,
|
|
173
|
+
successes,
|
|
174
|
+
})
|
|
148
175
|
|
|
149
176
|
// Fonction centralisée pour mettre à jour le modèle
|
|
150
177
|
const updateModel = (value: DateValue) => {
|
|
@@ -210,17 +237,45 @@
|
|
|
210
237
|
'min-width': '100%',
|
|
211
238
|
}))
|
|
212
239
|
|
|
240
|
+
// Déclaration des variables qui seront initialisées par le composable useDateSelection
|
|
241
|
+
const rangeBoundaryDates = ref<[Date | null, Date | null] | null>(null)
|
|
242
|
+
// Initialisation des variables après la déclaration de selectedDates
|
|
243
|
+
const dateSelectionResult = useDateSelection(
|
|
244
|
+
parseDate,
|
|
245
|
+
selectedDates,
|
|
246
|
+
props.format,
|
|
247
|
+
props.displayRange,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
// Assignation des fonctions et variables retournées par le composable
|
|
251
|
+
// Utiliser une fonction pour wrapper updateSelectedDates afin de maintenir la compatibilité avec le template
|
|
252
|
+
const updateSelectedDates = (date: Date | null) => {
|
|
253
|
+
dateSelectionResult.updateSelectedDates(date)
|
|
254
|
+
}
|
|
255
|
+
// generateDateRange est maintenant utilisé via le composable useInputHandler
|
|
256
|
+
// Synchroniser notre référence locale avec celle du composable
|
|
257
|
+
watch(() => dateSelectionResult.rangeBoundaryDates.value, (newValue) => {
|
|
258
|
+
rangeBoundaryDates.value = newValue
|
|
259
|
+
}, { immediate: true })
|
|
260
|
+
|
|
213
261
|
// Date(s) formatée(s) en chaîne de caractères pour la valeur de retour
|
|
214
262
|
const formattedDate = computed<DateValue>(() => {
|
|
215
263
|
if (!selectedDates.value) return ''
|
|
216
264
|
|
|
217
265
|
const returnFormat = props.dateFormatReturn || props.format
|
|
218
266
|
|
|
219
|
-
|
|
267
|
+
// Pour les plages de dates, utiliser rangeBoundaryDates s'il est disponible
|
|
268
|
+
if (props.displayRange && rangeBoundaryDates.value) {
|
|
269
|
+
return [
|
|
270
|
+
formatDate(rangeBoundaryDates.value[0], returnFormat),
|
|
271
|
+
formatDate(rangeBoundaryDates.value[1], returnFormat),
|
|
272
|
+
] as [string, string]
|
|
273
|
+
}
|
|
274
|
+
else if (Array.isArray(selectedDates.value)) {
|
|
220
275
|
if (selectedDates.value.length >= 2) {
|
|
221
276
|
return [
|
|
222
277
|
formatDate(selectedDates.value[0], returnFormat),
|
|
223
|
-
formatDate(selectedDates.value[1], returnFormat),
|
|
278
|
+
formatDate(selectedDates.value[selectedDates.value.length - 1], returnFormat),
|
|
224
279
|
] as [string, string]
|
|
225
280
|
}
|
|
226
281
|
return ''
|
|
@@ -331,46 +386,28 @@
|
|
|
331
386
|
const updateDisplayFormattedDate = () => {
|
|
332
387
|
if (displayFormattedDateComputed.value) {
|
|
333
388
|
displayFormattedDate.value = displayFormattedDateComputed.value
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
selectedDates.value = null
|
|
345
|
-
return
|
|
389
|
+
// Émettre l'événement date-selected pour indiquer qu'une date a été sélectionnée dans le calendrier
|
|
390
|
+
emit('date-selected', formattedDate.value)
|
|
391
|
+
|
|
392
|
+
// En mode plage, ne pas fermer le DatePicker après la sélection de la première date
|
|
393
|
+
// Vérifier si nous sommes en mode plage et si les deux dates sont sélectionnées
|
|
394
|
+
if (!props.displayRange || (props.displayRange && rangeBoundaryDates.value && rangeBoundaryDates.value[0] && rangeBoundaryDates.value[1])) {
|
|
395
|
+
// Fermer le DatePicker seulement si nous ne sommes pas en mode plage
|
|
396
|
+
// ou si les deux dates de la plage sont déjà sélectionnées
|
|
397
|
+
isDatePickerVisible.value = false
|
|
398
|
+
emit('closed')
|
|
346
399
|
}
|
|
347
|
-
|
|
348
|
-
selectedDates.value = dates
|
|
349
|
-
return
|
|
400
|
+
validateDates()
|
|
350
401
|
}
|
|
351
|
-
|
|
352
|
-
const date = input ? parseDate(input, props.format) : null
|
|
353
|
-
selectedDates.value = date === null ? null : date
|
|
354
402
|
}
|
|
355
403
|
|
|
356
|
-
//
|
|
357
|
-
const handleClickOutside = (event: MouseEvent) => {
|
|
358
|
-
if (!isDatePickerVisible.value) return
|
|
404
|
+
// Les variables useDateSelection sont maintenant déclarées et initialisées plus haut dans le code
|
|
359
405
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
// Si on clique dans le conteneur du DatePicker, on ne fait rien
|
|
364
|
-
if (container) return
|
|
365
|
-
emit('closed')
|
|
366
|
-
// Déclencher la validation à la fermeture
|
|
367
|
-
validateDates()
|
|
406
|
+
// Fonction pour émettre l'événement blur (utilisée pour les tests)
|
|
407
|
+
const emitBlurEvent = () => {
|
|
408
|
+
emit('blur')
|
|
368
409
|
}
|
|
369
410
|
|
|
370
|
-
const todayInString = computed(() => {
|
|
371
|
-
return dayjs().locale('fr').format('dddd D MMMM').replace(/\b\w/g, l => l.toUpperCase())
|
|
372
|
-
})
|
|
373
|
-
|
|
374
411
|
onMounted(() => {
|
|
375
412
|
document.addEventListener('click', handleClickOutside)
|
|
376
413
|
|
|
@@ -381,6 +418,9 @@
|
|
|
381
418
|
|
|
382
419
|
// Valider les dates au montage
|
|
383
420
|
validateDates()
|
|
421
|
+
|
|
422
|
+
// Configurer l'observateur pour le bouton du mois
|
|
423
|
+
setupMonthButtonObserver()
|
|
384
424
|
})
|
|
385
425
|
|
|
386
426
|
onBeforeUnmount(() => {
|
|
@@ -389,66 +429,96 @@
|
|
|
389
429
|
|
|
390
430
|
const dateTextInputRef = ref<null | ComponentPublicInstance<typeof DateTextInput>>()
|
|
391
431
|
const dateCalendarTextInputRef = ref<null | ComponentPublicInstance<typeof SyTextField>>()
|
|
392
|
-
const datePickerRef = ref<null | ComponentPublicInstance<typeof VDatePicker>>()
|
|
393
432
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
433
|
+
// Initialiser le composable useInputHandler pour gérer la saisie des dates
|
|
434
|
+
const inputHandler = useInputHandler({
|
|
435
|
+
format: props.format,
|
|
436
|
+
displayRange: props.displayRange,
|
|
437
|
+
dateFormatReturn: props.dateFormatReturn,
|
|
438
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
439
|
+
parseDate,
|
|
440
|
+
formatDate,
|
|
441
|
+
generateDateRange: dateSelectionResult.generateDateRange,
|
|
442
|
+
isDateComplete: isDateComplete.value,
|
|
443
|
+
displayFormattedDate,
|
|
444
|
+
selectedDates,
|
|
445
|
+
isFormatting,
|
|
446
|
+
isManualInputActive,
|
|
447
|
+
isUpdatingFromInternal,
|
|
448
|
+
clearValidation,
|
|
449
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- validation rules
|
|
450
|
+
validateField: (value, rules, warningRules) => validateField(value, rules as any[], warningRules as any[]),
|
|
451
|
+
updateModel: value => updateModel(value as DateValue),
|
|
452
|
+
emitInput: value => emit('input', value),
|
|
453
|
+
inputRef: dateCalendarTextInputRef as Ref<ComponentPublicInstance | null>,
|
|
454
|
+
})
|
|
403
455
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
456
|
+
/**
|
|
457
|
+
* Gère l'entrée utilisateur dans le champ de saisie de date
|
|
458
|
+
* Délègue le traitement au composable useInputHandler
|
|
459
|
+
*/
|
|
460
|
+
const handleInput = (event: Event) => {
|
|
461
|
+
// Utiliser la fonction handleInput du composable
|
|
462
|
+
inputHandler.handleInput(event)
|
|
408
463
|
}
|
|
464
|
+
const datePickerRef = ref<null | ComponentPublicInstance<typeof VDatePicker>>()
|
|
409
465
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
watch(() => props.isBirthDate, (newValue) => {
|
|
416
|
-
currentViewMode.value = newValue ? 'year' : 'month'
|
|
417
|
-
})
|
|
466
|
+
// Utilisation du composable pour personnaliser le bouton du mois
|
|
467
|
+
const { customizeMonthButton, setupMonthButtonObserver } = useMonthButtonCustomization(
|
|
468
|
+
() => isDatePickerVisible.value,
|
|
469
|
+
)
|
|
418
470
|
|
|
419
|
-
//
|
|
420
|
-
const handleViewModeUpdate
|
|
421
|
-
|
|
422
|
-
|
|
471
|
+
// Utilisation du composable pour gérer le mode d'affichage du DatePicker
|
|
472
|
+
const { currentViewMode, handleViewModeUpdate, handleYearUpdate, handleMonthUpdate, resetViewMode } = useDatePickerViewMode(
|
|
473
|
+
// Fonction qui retourne la valeur actuelle de isBirthDate (combinaison de isBirthDate et birthDate)
|
|
474
|
+
() => props.isBirthDate || props.birthDate,
|
|
475
|
+
)
|
|
423
476
|
|
|
424
|
-
//
|
|
425
|
-
const handleYearUpdate = () => {
|
|
426
|
-
if (props.isBirthDate) {
|
|
427
|
-
// Après la sélection de l'année, passer automatiquement à la sélection du mois
|
|
428
|
-
currentViewMode.value = 'months'
|
|
429
|
-
}
|
|
430
|
-
}
|
|
477
|
+
// La fonction isDateComplete est maintenant importée du composable useDateFormatValidation
|
|
431
478
|
|
|
432
|
-
// Fonction pour
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
479
|
+
// Fonction pour valider la saisie manuelle, similaire à validateRules dans DateTextInput
|
|
480
|
+
const { validateManualInput } = useManualDateValidation({
|
|
481
|
+
format: props.format,
|
|
482
|
+
required: props.required,
|
|
483
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
484
|
+
customRules: props.customRules,
|
|
485
|
+
customWarningRules: props.customWarningRules,
|
|
486
|
+
hasInteracted,
|
|
487
|
+
errors,
|
|
488
|
+
clearValidation,
|
|
489
|
+
validateDateFormat,
|
|
490
|
+
isDateComplete: isDateComplete.value,
|
|
491
|
+
parseDate,
|
|
492
|
+
validateField,
|
|
493
|
+
})
|
|
439
494
|
|
|
440
|
-
const handleInputBlur = (
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
495
|
+
const { handleInputBlur } = useInputBlurHandler({
|
|
496
|
+
format: props.format,
|
|
497
|
+
dateFormatReturn: props.dateFormatReturn,
|
|
498
|
+
required: props.required,
|
|
499
|
+
displayFormattedDate,
|
|
500
|
+
hasInteracted,
|
|
501
|
+
isManualInputActive,
|
|
502
|
+
isUpdatingFromInternal,
|
|
503
|
+
selectedDates,
|
|
504
|
+
validateDateFormat,
|
|
505
|
+
parseDate,
|
|
506
|
+
formatDate,
|
|
507
|
+
updateModel,
|
|
508
|
+
validateManualInput,
|
|
509
|
+
emitBlur: emitBlurEvent,
|
|
510
|
+
})
|
|
444
511
|
|
|
445
512
|
watch(isDatePickerVisible, async (isVisible) => {
|
|
446
513
|
if (!isVisible && props.isBirthDate) {
|
|
447
514
|
// Réinitialiser le mode d'affichage au type birthdate
|
|
448
|
-
|
|
515
|
+
resetViewMode()
|
|
449
516
|
}
|
|
450
517
|
|
|
451
518
|
if (isVisible) {
|
|
519
|
+
// Personnaliser le bouton du mois
|
|
520
|
+
customizeMonthButton()
|
|
521
|
+
|
|
452
522
|
// set the focus on the date picker
|
|
453
523
|
await nextTick()
|
|
454
524
|
const firstButton = datePickerRef.value?.$el.querySelector('button')
|
|
@@ -471,21 +541,14 @@
|
|
|
471
541
|
}
|
|
472
542
|
})
|
|
473
543
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
return 'warning'
|
|
483
|
-
case successMessages.value.length > 0:
|
|
484
|
-
return 'success'
|
|
485
|
-
default:
|
|
486
|
-
return
|
|
487
|
-
}
|
|
488
|
-
}
|
|
544
|
+
// Utilisation du composable useIconState pour déterminer l'icône à afficher
|
|
545
|
+
const { getIcon } = useIconState({
|
|
546
|
+
noCalendar: props.noCalendar,
|
|
547
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
548
|
+
errorMessages,
|
|
549
|
+
warningMessages,
|
|
550
|
+
successMessages,
|
|
551
|
+
})
|
|
489
552
|
|
|
490
553
|
const syncFromModelValue = (newValue: DateInput | undefined) => {
|
|
491
554
|
if (!newValue || newValue === '') {
|
|
@@ -536,40 +599,225 @@
|
|
|
536
599
|
}
|
|
537
600
|
}, { immediate: true })
|
|
538
601
|
|
|
539
|
-
const
|
|
540
|
-
|
|
602
|
+
const {
|
|
603
|
+
toggleDatePicker,
|
|
604
|
+
openDatePicker,
|
|
605
|
+
openDatePickerOnClick,
|
|
606
|
+
openDatePickerOnFocus,
|
|
607
|
+
openDatePickerOnIconClick,
|
|
608
|
+
handleClickOutside,
|
|
609
|
+
handleKeyboardNavigation,
|
|
610
|
+
} = useDatePickerVisibility({
|
|
611
|
+
disabled: props.disabled,
|
|
612
|
+
readonly: props.readonly,
|
|
613
|
+
textFieldActivator: props.textFieldActivator,
|
|
614
|
+
isDatePickerVisible,
|
|
615
|
+
isManualInputActive,
|
|
616
|
+
hasInteracted,
|
|
617
|
+
updateAccessibility,
|
|
618
|
+
validateDates,
|
|
619
|
+
emitClosed: () => emit('closed'),
|
|
620
|
+
emitFocus: () => emit('focus'),
|
|
621
|
+
})
|
|
622
|
+
|
|
623
|
+
// Fonctions pour la gestion de la saisie manuelle
|
|
624
|
+
const formatDateInput = (input: string, cursorPosition?: number): { formatted: string, cursorPos: number } => {
|
|
625
|
+
// Conserver uniquement les chiffres de l'entrée
|
|
626
|
+
const cleanedInput = input.replace(/[^\d]/g, '')
|
|
627
|
+
|
|
628
|
+
// Déterminer le séparateur utilisé dans le format
|
|
629
|
+
const separator = props.format.match(/[^DMY]/)?.[0] || '/'
|
|
630
|
+
|
|
631
|
+
// Calculer la position du curseur dans l'entrée nettoyée (sans séparateurs)
|
|
632
|
+
// Pour cela, on compte combien de chiffres il y a avant la position du curseur
|
|
633
|
+
const inputBeforeCursor = input.substring(0, cursorPosition || 0)
|
|
634
|
+
const digitsBeforeCursor = inputBeforeCursor.replace(/[^\d]/g, '').length
|
|
635
|
+
|
|
636
|
+
// Construire la chaîne formatée
|
|
637
|
+
let result = ''
|
|
638
|
+
let digitIndex = 0
|
|
541
639
|
|
|
542
|
-
|
|
640
|
+
// Parcourir le format pour placer les chiffres et séparateurs
|
|
641
|
+
for (let i = 0; i < props.format.length && digitIndex < cleanedInput.length; i++) {
|
|
642
|
+
const formatChar = props.format[i].toUpperCase()
|
|
543
643
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}
|
|
644
|
+
if (['D', 'M', 'Y'].includes(formatChar)) {
|
|
645
|
+
// Ajouter un chiffre
|
|
646
|
+
result += cleanedInput[digitIndex]
|
|
647
|
+
digitIndex++
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
// Ajouter un séparateur
|
|
651
|
+
result += separator
|
|
652
|
+
}
|
|
549
653
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
654
|
+
|
|
655
|
+
// Calculer la nouvelle position du curseur
|
|
656
|
+
// Nombre de chiffres avant le curseur + nombre de séparateurs avant ces chiffres
|
|
657
|
+
let newCursorPos = digitsBeforeCursor
|
|
658
|
+
|
|
659
|
+
// Ajouter les séparateurs qui apparaissent avant la position du curseur
|
|
660
|
+
for (let i = 0, digitCount = 0; i < props.format.length && digitCount < digitsBeforeCursor; i++) {
|
|
661
|
+
if (!['D', 'M', 'Y'].includes(props.format[i].toUpperCase())) {
|
|
662
|
+
newCursorPos++
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
digitCount++
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return {
|
|
670
|
+
formatted: result,
|
|
671
|
+
cursorPos: Math.min(newCursorPos, result.length),
|
|
553
672
|
}
|
|
554
673
|
}
|
|
555
674
|
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
|
|
675
|
+
const handleKeydown = (event: KeyboardEvent & { target: HTMLInputElement }) => {
|
|
676
|
+
// Déléguer la gestion de l'ouverture du calendrier au composable
|
|
677
|
+
if (!props.noCalendar && handleKeyboardNavigation(event)) {
|
|
678
|
+
return
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// Gérer la suppression des séparateurs
|
|
682
|
+
if (event.key === 'Backspace') {
|
|
683
|
+
const input = event.target
|
|
684
|
+
if (!input.selectionStart || input.selectionStart !== input.selectionEnd) {
|
|
685
|
+
return
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const cursorPos = input.selectionStart
|
|
689
|
+
const charBeforeCursor = input.value[cursorPos - 1]
|
|
690
|
+
|
|
691
|
+
if (!/\d/.test(charBeforeCursor)) {
|
|
692
|
+
// Si le caractère avant le curseur n'est pas un chiffre, on le supprime aussi
|
|
693
|
+
// et on supprime le chiffre avant le séparateur
|
|
694
|
+
event.preventDefault() // Empêcher le comportement par défaut
|
|
695
|
+
|
|
696
|
+
const newValue = input.value.substring(0, cursorPos - 2)
|
|
697
|
+
+ input.value.substring(cursorPos)
|
|
698
|
+
|
|
699
|
+
// Mettre à jour la valeur
|
|
700
|
+
displayFormattedDate.value = newValue
|
|
701
|
+
|
|
702
|
+
// Positionner le curseur après un court délai
|
|
703
|
+
setTimeout(() => {
|
|
704
|
+
const newCursorPos = cursorPos - 2
|
|
705
|
+
input.setSelectionRange(newCursorPos, newCursorPos)
|
|
706
|
+
}, 0)
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// Gérer les touches de direction pour éviter de se retrouver entre un séparateur et un chiffre
|
|
711
|
+
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
712
|
+
const input = event.target
|
|
713
|
+
const cursorPos = input.selectionStart || 0
|
|
714
|
+
|
|
715
|
+
// Déterminer le séparateur utilisé dans le format
|
|
716
|
+
const separator = props.format.match(/[^DMY]/)?.[0] || '/'
|
|
717
|
+
|
|
718
|
+
if (event.key === 'ArrowLeft' && cursorPos > 0) {
|
|
719
|
+
const charBeforeCursor = input.value[cursorPos - 1]
|
|
720
|
+
|
|
721
|
+
if (charBeforeCursor === separator) {
|
|
722
|
+
// Si on se déplace à gauche et qu'on rencontre un séparateur, sauter par-dessus
|
|
723
|
+
event.preventDefault()
|
|
724
|
+
input.setSelectionRange(cursorPos - 2, cursorPos - 2)
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
else if (event.key === 'ArrowRight' && cursorPos < input.value.length) {
|
|
728
|
+
const charAtCursor = input.value[cursorPos]
|
|
729
|
+
|
|
730
|
+
if (charAtCursor === separator) {
|
|
731
|
+
// Si on se déplace à droite et qu'on rencontre un séparateur, sauter par-dessus
|
|
732
|
+
event.preventDefault()
|
|
733
|
+
input.setSelectionRange(cursorPos + 2, cursorPos + 2)
|
|
734
|
+
}
|
|
735
|
+
}
|
|
559
736
|
}
|
|
560
737
|
}
|
|
561
738
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
739
|
+
// Variable pour l'accessibilité
|
|
740
|
+
const accessibilityDescription = ref(DATE_PICKER_MESSAGES.ARIA_DATE_INPUT)
|
|
741
|
+
|
|
742
|
+
// Fonction pour créer une description accessible de la date pour les lecteurs d'écran
|
|
743
|
+
const getDateDescription = (dateStr: string, format: string): string => {
|
|
744
|
+
// Si la chaîne est vide, retourner un message simple
|
|
745
|
+
if (!dateStr || !dateStr.trim()) {
|
|
746
|
+
return 'Aucune date saisie'
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
// Déterminer le séparateur utilisé dans le format
|
|
750
|
+
const separator = format.match(/[^DMY]/)?.[0] || '/'
|
|
751
|
+
|
|
752
|
+
// Extraire les parties de la date
|
|
753
|
+
const dateParts = dateStr.split(separator)
|
|
754
|
+
const formatParts = format.split(separator)
|
|
755
|
+
|
|
756
|
+
// Créer une description en fonction du format
|
|
757
|
+
let description = 'Date en cours de saisie: '
|
|
758
|
+
|
|
759
|
+
for (let i = 0; i < formatParts.length; i++) {
|
|
760
|
+
if (i >= dateParts.length) break
|
|
761
|
+
|
|
762
|
+
const part = dateParts[i].trim()
|
|
763
|
+
const formatPart = formatParts[i].charAt(0).toUpperCase()
|
|
764
|
+
|
|
765
|
+
// Ignorer les parties vides ou contenant uniquement des placeholders
|
|
766
|
+
if (!part || part.replace(/_/g, '').length === 0) {
|
|
767
|
+
continue
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
switch (formatPart) {
|
|
771
|
+
case 'D':
|
|
772
|
+
description += `jour ${part}, `
|
|
773
|
+
break
|
|
774
|
+
case 'M':
|
|
775
|
+
description += `mois ${part}, `
|
|
776
|
+
break
|
|
777
|
+
case 'Y':
|
|
778
|
+
description += `année ${part}, `
|
|
779
|
+
break
|
|
780
|
+
}
|
|
566
781
|
}
|
|
567
|
-
|
|
568
|
-
|
|
782
|
+
|
|
783
|
+
// Supprimer la virgule finale si elle existe
|
|
784
|
+
return description.endsWith(', ')
|
|
785
|
+
? description.slice(0, -2)
|
|
786
|
+
: description
|
|
569
787
|
}
|
|
570
788
|
|
|
571
|
-
|
|
572
|
-
|
|
789
|
+
// Mettre à jour la description accessible lorsque la valeur affichée change
|
|
790
|
+
watch(displayFormattedDate, (newValue) => {
|
|
791
|
+
if (newValue) {
|
|
792
|
+
// Créer une version accessible pour les lecteurs d'écran (sans les caractères de placeholder)
|
|
793
|
+
const accessibleValue = newValue.replace(/_/g, ' ')
|
|
794
|
+
|
|
795
|
+
// Créer un message descriptif pour le lecteur d'écran
|
|
796
|
+
accessibilityDescription.value = getDateDescription(accessibleValue, props.format)
|
|
797
|
+
}
|
|
798
|
+
else {
|
|
799
|
+
accessibilityDescription.value = 'Aucune date saisie'
|
|
800
|
+
}
|
|
801
|
+
})
|
|
802
|
+
|
|
803
|
+
// Utilisation des composables pour les fonctionnalités du DatePicker
|
|
804
|
+
const { displayWeekendDays } = useWeekendDays(props)
|
|
805
|
+
|
|
806
|
+
// Computed properties pour period
|
|
807
|
+
const minDate = computed(() => props.period?.min || dayjs().subtract(10, 'year').format(props.format))
|
|
808
|
+
const maxDate = computed(() => props.period?.max || dayjs().add(10, 'year').format(props.format))
|
|
809
|
+
|
|
810
|
+
const { todayInString, selectToday } = useTodayButton(props)
|
|
811
|
+
|
|
812
|
+
// Utilisation du composable pour l'affichage formaté des dates
|
|
813
|
+
const { displayedDateString } = useDisplayedDateString({
|
|
814
|
+
selectedDates,
|
|
815
|
+
todayInString,
|
|
816
|
+
})
|
|
817
|
+
|
|
818
|
+
// Wrapper pour la fonction selectToday du composable
|
|
819
|
+
const handleSelectToday = () => {
|
|
820
|
+
selectToday(selectedDates)
|
|
573
821
|
}
|
|
574
822
|
|
|
575
823
|
defineExpose({
|
|
@@ -579,8 +827,18 @@
|
|
|
579
827
|
errorMessages,
|
|
580
828
|
handleClickOutside,
|
|
581
829
|
initializeSelectedDates,
|
|
830
|
+
handleSelectToday,
|
|
582
831
|
updateAccessibility,
|
|
583
832
|
openDatePicker,
|
|
833
|
+
updateDisplayFormattedDate,
|
|
834
|
+
toggleDatePicker,
|
|
835
|
+
validateField,
|
|
836
|
+
clearValidation,
|
|
837
|
+
validateDates,
|
|
838
|
+
formatDateInput,
|
|
839
|
+
emitBlur: emitBlurEvent,
|
|
840
|
+
validateDateFormat,
|
|
841
|
+
displayFormattedDate,
|
|
584
842
|
})
|
|
585
843
|
</script>
|
|
586
844
|
|
|
@@ -589,6 +847,13 @@
|
|
|
589
847
|
class="date-picker-container"
|
|
590
848
|
:style="inputStyle"
|
|
591
849
|
>
|
|
850
|
+
<!-- Variable pour stocker la description accessible -->
|
|
851
|
+
<span
|
|
852
|
+
v-if="false"
|
|
853
|
+
ref="accessibilityDescriptionRef"
|
|
854
|
+
>
|
|
855
|
+
{{ accessibilityDescription }}
|
|
856
|
+
</span>
|
|
592
857
|
<template v-if="props.noCalendar">
|
|
593
858
|
<DateTextInput
|
|
594
859
|
ref="dateTextInputRef"
|
|
@@ -636,14 +901,14 @@
|
|
|
636
901
|
ref="dateCalendarTextInputRef"
|
|
637
902
|
v-model="displayFormattedDate"
|
|
638
903
|
:append-icon="displayIcon && displayAppendIcon ? 'calendar' : undefined"
|
|
639
|
-
:append-inner-icon="getIcon
|
|
904
|
+
:append-inner-icon="getIcon"
|
|
640
905
|
:class="[getMessageClasses(), 'label-hidden-on-focus']"
|
|
641
906
|
:error-messages="errorMessages"
|
|
642
907
|
:warning-messages="warningMessages"
|
|
643
908
|
:success-messages="props.showSuccessMessages ? successMessages : []"
|
|
644
909
|
:disabled="props.disabled"
|
|
645
910
|
:disable-click-button="false"
|
|
646
|
-
:readonly="
|
|
911
|
+
:readonly="props.readonly"
|
|
647
912
|
:label="props.placeholder"
|
|
648
913
|
:no-icon="props.noIcon"
|
|
649
914
|
:prepend-icon="displayIcon && !displayAppendIcon ? 'calendar' : undefined"
|
|
@@ -653,10 +918,13 @@
|
|
|
653
918
|
:bg-color="props.bgColor"
|
|
654
919
|
is-clearable
|
|
655
920
|
title="Date Picker"
|
|
921
|
+
:aria-label="accessibilityDescription"
|
|
656
922
|
@click="openDatePickerOnClick"
|
|
657
923
|
@focus="openDatePickerOnFocus"
|
|
658
924
|
@blur="handleInputBlur"
|
|
659
925
|
@update:model-value="updateSelectedDates"
|
|
926
|
+
@input="handleInput"
|
|
927
|
+
@keydown="handleKeydown"
|
|
660
928
|
@prepend-icon-click="openDatePickerOnIconClick"
|
|
661
929
|
@append-icon-click="openDatePickerOnIconClick"
|
|
662
930
|
/>
|
|
@@ -666,11 +934,14 @@
|
|
|
666
934
|
ref="datePickerRef"
|
|
667
935
|
v-model="selectedDates"
|
|
668
936
|
color="primary"
|
|
937
|
+
:class="displayWeekendDays ? 'weekend' : ''"
|
|
669
938
|
:first-day-of-week="1"
|
|
670
939
|
:multiple="props.displayRange ? 'range' : false"
|
|
671
940
|
:show-adjacent-months="true"
|
|
672
941
|
:show-week="props.showWeekNumber"
|
|
673
942
|
:view-mode="currentViewMode"
|
|
943
|
+
:max="maxDate"
|
|
944
|
+
:min="minDate"
|
|
674
945
|
@update:view-mode="handleViewModeUpdate"
|
|
675
946
|
@update:year="handleYearUpdate"
|
|
676
947
|
@update:month="handleMonthUpdate"
|
|
@@ -681,9 +952,32 @@
|
|
|
681
952
|
</template>
|
|
682
953
|
<template #header>
|
|
683
954
|
<h3 class="mx-auto my-auto ml-5 mb-4">
|
|
684
|
-
{{
|
|
955
|
+
{{ displayedDateString }}
|
|
685
956
|
</h3>
|
|
686
957
|
</template>
|
|
958
|
+
<template
|
|
959
|
+
v-if="props.displayTodayButton"
|
|
960
|
+
#actions
|
|
961
|
+
>
|
|
962
|
+
<div class="d-flex justify-center align-center w-100">
|
|
963
|
+
<v-btn
|
|
964
|
+
v-if="props.displayTodayButton"
|
|
965
|
+
size="x-small"
|
|
966
|
+
color="primary"
|
|
967
|
+
:title="DATE_PICKER_MESSAGES.BUTTON_TODAY"
|
|
968
|
+
class="my-2 pa-2 mt-2"
|
|
969
|
+
:ripple="false"
|
|
970
|
+
@click="handleSelectToday"
|
|
971
|
+
>
|
|
972
|
+
<VIcon
|
|
973
|
+
class="mr-1"
|
|
974
|
+
>
|
|
975
|
+
{{ mdiCalendar }}
|
|
976
|
+
</VIcon>
|
|
977
|
+
{{ DATE_PICKER_MESSAGES.BUTTON_TODAY }}
|
|
978
|
+
</v-btn>
|
|
979
|
+
</div>
|
|
980
|
+
</template>
|
|
687
981
|
</VDatePicker>
|
|
688
982
|
</VMenu>
|
|
689
983
|
</template>
|
|
@@ -693,6 +987,22 @@
|
|
|
693
987
|
<style lang="scss" scoped>
|
|
694
988
|
@use '@/assets/tokens';
|
|
695
989
|
|
|
990
|
+
/* Disable ripple effect on month and year buttons */
|
|
991
|
+
:deep(.v-date-picker-controls__month-btn),
|
|
992
|
+
:deep(.v-date-picker-controls__mode-btn) {
|
|
993
|
+
.v-ripple__container,
|
|
994
|
+
.v-ripple__animation {
|
|
995
|
+
display: none !important;
|
|
996
|
+
opacity: 0 !important;
|
|
997
|
+
background-color: transparent !important;
|
|
998
|
+
pointer-events: none !important;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
:deep(.v-date-picker-controls .v-btn:last-child) {
|
|
1003
|
+
margin-inline-start: 0;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
696
1006
|
.label-hidden-on-focus:focus + label {
|
|
697
1007
|
display: none;
|
|
698
1008
|
}
|
|
@@ -783,13 +1093,20 @@
|
|
|
783
1093
|
opacity: 1;
|
|
784
1094
|
}
|
|
785
1095
|
|
|
786
|
-
.
|
|
787
|
-
|
|
788
|
-
|
|
1096
|
+
:deep(.weekend .v-date-picker-month__day--week-end .v-btn) {
|
|
1097
|
+
background-color: #afb1b1;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
/* div avant la class .v-date-picker-month__day--week-end */
|
|
1101
|
+
:deep(.weekend .v-date-picker-month__day:has(+ .v-date-picker-month__day--week-end) .v-btn) {
|
|
1102
|
+
background-color: #afb1b1;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
:deep(.v-date-picker-controls__mode-btn) {
|
|
1106
|
+
transform: none !important;
|
|
789
1107
|
}
|
|
790
1108
|
|
|
791
|
-
.
|
|
792
|
-
|
|
793
|
-
opacity: 0;
|
|
1109
|
+
:deep(.v-btn--variant-text .v-btn__overlay) {
|
|
1110
|
+
padding: 13px;
|
|
794
1111
|
}
|
|
795
1112
|
</style>
|