@cnamts/synapse 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/DateFilter-YWOTbfeL.js +98 -0
- package/dist/NumberFilter-DMmMgALM.js +121 -0
- package/dist/PeriodFilter-Bok5BHcn.js +112 -0
- package/dist/SelectFilter-BKud2WhN.js +136 -0
- package/dist/TextFilter-DvMf2thH.js +114 -0
- package/dist/{components/BackBtn → common}/constants/ExpertiseLevelEnum.d.ts +3 -0
- package/dist/components/Accordion/Accordion.d.ts +2 -1
- package/dist/components/Accordion/composables/useAccordionGroupCommunication.d.ts +5 -0
- package/dist/components/Accordion/composables/useAccordionKeyboardNavigation.d.ts +12 -0
- package/dist/components/Accordion/composables/useAccordionState.d.ts +13 -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/SyCheckbox/SyCheckbox.d.ts +85 -0
- package/dist/components/Customs/SyInputSelect/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -0
- package/dist/components/Customs/SySelect/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Customs/SySelect/SySelect.d.ts +33 -13
- package/dist/components/Customs/SyTextField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +2 -2
- 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 +4295 -0
- package/dist/components/DatePicker/{DatePicker.d.ts → DatePicker/DatePicker.d.ts} +158 -104
- package/dist/components/DatePicker/{DateTextInput.d.ts → DateTextInput/DateTextInput.d.ts} +35 -27
- package/dist/components/DatePicker/composables/index.d.ts +17 -0
- package/dist/components/DatePicker/composables/useAsteriskDisplay.d.ts +14 -0
- package/dist/components/DatePicker/composables/useDateAutoClamp.d.ts +16 -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 +19 -0
- package/dist/components/DatePicker/composables/useIconState.d.ts +17 -0
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +31 -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 +12 -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/NirField/NirField.d.ts +7 -3
- package/dist/components/NirField/nirValidation.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/PasswordField/PasswordField.d.ts +2 -0
- package/dist/components/PeriodField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/PeriodField/PeriodField.d.ts +219 -41
- package/dist/components/PhoneField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/PhoneField/PhoneField.d.ts +2 -2
- package/dist/components/RangeField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/RangeField/RangeField.d.ts +2 -0
- package/dist/components/RatingPicker/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SearchListField/AccessibiliteItems.d.ts +1 -1
- package/dist/components/SearchListField/SearchListField.d.ts +9 -0
- 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/SyTextArea/SyTextArea.d.ts +2 -0
- package/dist/components/TableToolbar/AccessibiliteItems.d.ts +1 -1
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +652 -0
- package/dist/components/Tables/SyTable/SyTable.d.ts +671 -0
- package/dist/components/Tables/common/SyTableFilter.d.ts +126 -0
- package/dist/components/Tables/common/SyTablePagination.d.ts +1636 -0
- package/dist/components/Tables/common/TableHeader.d.ts +15 -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/filters/getFilterComponent.d.ts +1 -0
- package/dist/components/Tables/common/filters/locales.d.ts +4 -0
- package/dist/components/Tables/common/filters/logics/date.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/number.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/period.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/select.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/text.d.ts +1 -0
- package/dist/components/Tables/common/formatters.d.ts +17 -0
- package/dist/components/Tables/common/locales.d.ts +28 -0
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +267 -0
- package/dist/components/Tables/common/organizeColumns/sortHeaders.d.ts +2 -0
- package/dist/components/Tables/common/tableAccessibilityUtils.d.ts +8 -0
- package/dist/components/Tables/common/tableFilterUtils.d.ts +3 -0
- package/dist/components/Tables/common/tableStorageUtils.d.ts +69 -0
- package/dist/components/Tables/common/tableUtils.d.ts +79 -0
- package/dist/components/Tables/common/types.d.ts +91 -0
- package/dist/components/Tables/common/usePagination.d.ts +22 -0
- package/dist/components/Tables/common/useTableCheckbox.d.ts +20 -0
- package/dist/components/Tables/common/useTableFilter.d.ts +9 -0
- package/dist/components/Tables/common/useTableHeaders.d.ts +76 -0
- package/dist/components/Tables/common/useTableItems.d.ts +24 -0
- package/dist/components/Tables/common/useTableOptions.d.ts +18 -0
- package/dist/components/Tables/index.d.ts +2 -0
- package/dist/components/ToolbarContainer/ToolbarContainer.d.ts +11 -0
- package/dist/components/UploadWorkflow/AccessibiliteItems.d.ts +1 -1
- package/dist/components/UserMenuBtn/AccessibiliteItems.d.ts +1 -1
- package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +9 -2
- package/dist/components/index.d.ts +9 -5
- package/dist/design-system-v3.js +102 -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-Cx8qG7YR.js +16344 -0
- package/dist/stories/Accessibilite/Vuetify/VuetifyItems.d.ts +14 -2
- package/dist/stories/DesignTokens/StylesTypographiques.stories.new.d.ts +8 -0
- package/dist/stories/DesignTokens/TypographyDisplay.d.ts +28 -0
- package/dist/stories/DesignTokens/vue-shims.d.ts +6 -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/common/imgs/accessibility-svgrepo-com.svg +4 -0
- package/src/components/Accordion/Accessibilite/AccessibilityGuide.mdx +249 -0
- package/src/components/Accordion/Accordion.vue +48 -76
- package/src/components/Accordion/composables/__tests__/useAccordionGroupCommunication.spec.ts +146 -0
- package/src/components/Accordion/composables/__tests__/useAccordionKeyboardNavigation.spec.ts +209 -0
- package/src/components/Accordion/composables/__tests__/useAccordionState.spec.ts +144 -0
- package/src/components/Accordion/composables/useAccordionGroupCommunication.ts +52 -0
- package/src/components/Accordion/composables/useAccordionKeyboardNavigation.ts +111 -0
- package/src/components/Accordion/composables/useAccordionState.ts +59 -0
- package/src/components/Accordion/tests/__snapshots__/accordion.spec.ts.snap +3 -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/SyCheckbox/Accessibilite.mdx +303 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +50 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +630 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +326 -0
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +201 -0
- package/src/components/Customs/SyInputSelect/AccessibiliteItems.ts +1 -1
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +1 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +8 -1
- package/src/components/Customs/SySelect/AccessibiliteItems.ts +1 -1
- package/src/components/Customs/SySelect/SySelect.stories.ts +160 -0
- package/src/components/Customs/SySelect/SySelect.vue +292 -39
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +234 -2
- package/src/components/Customs/SyTextField/AccessibiliteItems.ts +1 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +3 -2
- package/src/components/Customs/SyTextField/SyTextField.vue +19 -8
- 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 +1307 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +769 -204
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.events.spec.ts +161 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +943 -0
- package/src/components/DatePicker/DatePicker/DatePicker.mdx +176 -0
- package/src/components/DatePicker/{DatePicker.stories.ts → DatePicker/DatePicker.stories.ts} +356 -519
- package/src/components/DatePicker/{DatePicker.vue → DatePicker/DatePicker.vue} +435 -89
- package/src/components/DatePicker/DatePicker/tests/DatePicker.events.spec.ts +189 -0
- package/src/components/DatePicker/{tests → DatePicker/tests}/DatePicker.spec.ts +0 -14
- 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 +320 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.events.spec.ts +148 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +278 -0
- package/src/components/DatePicker/{tests → DateTextInput}/DateTextInput.spec.ts +10 -7
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +1111 -0
- package/src/components/DatePicker/DateTextInput/NoCalendar.mdx +64 -0
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +782 -0
- package/src/components/DatePicker/composables/index.ts +24 -0
- package/src/components/DatePicker/composables/tests/useDateAutoClamp.spec.ts +190 -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 +456 -0
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +233 -0
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +125 -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/useAsteriskDisplay.ts +31 -0
- package/src/components/DatePicker/composables/useDateAutoClamp.ts +136 -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 +378 -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 +70 -0
- package/src/components/DatePicker/composables/useIconState.ts +53 -0
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +165 -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 +187 -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/DiacriticPicker/DiacriticPicker.stories.ts +10 -0
- package/src/components/DialogBox/AccessibiliteItems.ts +1 -1
- package/src/components/DownloadBtn/AccessibiliteItems.ts +1 -1
- package/src/components/ErrorPage/Accessibilite.stories.ts +8 -0
- package/src/components/ErrorPage/AccessibiliteItems.ts +1 -1
- package/src/components/ErrorPage/ErrorPage.vue +12 -6
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +4 -4
- 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/NirField/NirField.mdx +22 -9
- package/src/components/NirField/NirField.stories.ts +26 -2
- package/src/components/NirField/NirField.vue +209 -22
- package/src/components/NirField/nirValidation.ts +17 -3
- package/src/components/NirField/tests/NirField.spec.ts +2 -2
- package/src/components/NotFoundPage/Accessibilite.stories.ts +8 -0
- package/src/components/NotFoundPage/AccessibiliteItems.ts +1 -1
- package/src/components/NotFoundPage/NotFoundPage.vue +2 -1
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +8 -6
- 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.mdx +2 -0
- 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/PasswordField/PasswordField.stories.ts +4 -0
- package/src/components/PasswordField/PasswordField.vue +3 -0
- package/src/components/PeriodField/AccessibiliteItems.ts +1 -1
- package/src/components/PeriodField/PeriodField.vue +15 -1
- package/src/components/PhoneField/AccessibiliteItems.ts +1 -1
- package/src/components/PhoneField/PhoneField.stories.ts +15 -15
- package/src/components/PhoneField/PhoneField.vue +1 -1
- package/src/components/RangeField/AccessibiliteItems.ts +1 -1
- package/src/components/RangeField/RangeField.stories.ts +9 -0
- package/src/components/RangeField/RangeField.vue +4 -0
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +12 -0
- package/src/components/RatingPicker/AccessibiliteItems.ts +1 -1
- package/src/components/SearchListField/AccessibiliteItems.ts +1 -1
- package/src/components/SearchListField/SearchListField.vue +5 -0
- 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/SyTextArea/SyTextArea.vue +3 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +0 -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 +700 -0
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +170 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +4354 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +391 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +702 -0
- package/src/components/Tables/SyTable/FilterRules.stories.ts +418 -0
- package/src/components/Tables/SyTable/SyTable.mdx +139 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +2754 -0
- package/src/components/Tables/SyTable/SyTable.vue +397 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +707 -0
- package/src/components/Tables/common/SyTableFilter.vue +289 -0
- package/src/components/Tables/common/SyTablePagination.vue +375 -0
- package/src/components/Tables/common/TableHeader.vue +205 -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 +235 -0
- package/src/components/Tables/common/filters/TextFilter.vue +191 -0
- package/src/components/Tables/common/filters/getFilterComponent.ts +54 -0
- package/src/components/Tables/common/filters/locales.ts +4 -0
- package/src/components/Tables/common/filters/logics/date.ts +12 -0
- package/src/components/Tables/common/filters/logics/number.ts +48 -0
- package/src/components/Tables/common/filters/logics/period.ts +25 -0
- package/src/components/Tables/common/filters/logics/select.ts +27 -0
- package/src/components/Tables/common/filters/logics/tests/TextFilterLogic.spec.ts +177 -0
- package/src/components/Tables/common/filters/logics/text.ts +62 -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 +31 -0
- package/src/components/Tables/common/organizeColumns/OrganizeColumns.vue +269 -0
- package/src/components/Tables/common/organizeColumns/sortHeaders.ts +9 -0
- package/src/components/Tables/common/tableAccessibilityUtils.ts +61 -0
- package/src/components/Tables/common/tableFilterUtils.ts +75 -0
- package/src/components/Tables/common/tableStorageUtils.ts +127 -0
- package/src/components/Tables/common/tableStyles.scss +80 -0
- package/src/components/Tables/common/tableUtils.ts +102 -0
- package/src/components/Tables/common/tests/SyTableFilter.spec.ts +312 -0
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +170 -0
- package/src/components/Tables/common/tests/filterByRange.spec.ts +215 -0
- package/src/components/Tables/common/tests/resize.spec.ts +161 -0
- package/src/components/Tables/common/tests/tableFilterUtils.spec.ts +92 -0
- package/src/components/Tables/common/tests/tableUtils.spec.ts +228 -0
- package/src/components/Tables/common/types.ts +92 -0
- package/src/components/Tables/common/usePagination.ts +83 -0
- package/src/components/Tables/common/useTableCheckbox.ts +58 -0
- package/src/components/Tables/common/useTableFilter.ts +19 -0
- package/src/components/Tables/common/useTableHeaders.ts +88 -0
- package/src/components/Tables/common/useTableItems.ts +87 -0
- package/src/components/Tables/common/useTableOptions.ts +93 -0
- package/src/components/Tables/index.ts +3 -0
- package/src/components/ToolbarContainer/ToolbarContainer.mdx +16 -0
- package/src/components/ToolbarContainer/ToolbarContainer.stories.ts +675 -0
- package/src/components/ToolbarContainer/ToolbarContainer.vue +128 -0
- package/src/components/ToolbarContainer/tests/ToolbarContainer.spec.ts +156 -0
- package/src/components/UploadWorkflow/AccessibiliteItems.ts +1 -1
- package/src/components/UserMenuBtn/AccessibiliteItems.ts +1 -1
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +74 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +19 -17
- package/src/components/index.ts +9 -5
- 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/Accessibilite/Aculturation/AuditDesignSystem.mdx +293 -20
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +448 -54
- package/src/stories/Accessibilite/Audit/RGAA.mdx +231 -23
- package/src/stories/Accessibilite/Avancement/Avancement.mdx +591 -7
- package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +139 -38
- package/src/stories/Accessibilite/Introduction.mdx +258 -18
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +221 -31
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +204 -22
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +537 -24
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +577 -70
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru.mdx +382 -31
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +419 -81
- package/src/stories/Accessibilite/Vuetify/Vuetify.mdx +132 -6
- package/src/stories/Accessibilite/Vuetify/Vuetify.stories.ts +370 -146
- package/src/stories/Accessibilite/Vuetify/VuetifyItems.ts +35 -57
- package/src/stories/Demarrer/Accueil.stories.ts +32 -8
- package/src/stories/DesignTokens/StylesTypographiques.mdx +10 -9
- package/src/stories/DesignTokens/StylesTypographiques.stories.new.ts +397 -0
- package/src/stories/DesignTokens/StylesTypographiques.stories.ts +397 -0
- package/src/stories/DesignTokens/TypographyDisplay.vue +155 -0
- package/src/stories/DesignTokens/vue-shims.d.ts +6 -0
- package/src/stories/GuideDuDev/LesBreackingChanges.mdx +0 -2
- package/src/stories/GuideDuDev/MigrationDepuisBridge.mdx +1 -1
- package/src/stories/GuideDuDev/MigrationDepuisVue2.mdx +1 -1
- package/src/stories/GuideDuDev/PortailAgent.mdx +10 -0
- package/src/stories/GuideDuDev/PortailAgent.stories.ts +506 -0
- package/src/stories/GuideDuDev/Theme.mdx +41 -0
- 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/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +0 -886
- 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/stories/DesignTokens/ThemePA.mdx +0 -35
- /package/src/components/DatePicker/{examples → playground}/DatePickerHolidayRule.vue +0 -0
|
@@ -1,12 +1,33 @@
|
|
|
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 { useHolidayDay } from '@/composables/date/useHolidayDay'
|
|
16
|
+
import {
|
|
17
|
+
useTodayButton,
|
|
18
|
+
useDatePickerViewMode,
|
|
19
|
+
useDateSelection,
|
|
20
|
+
useDateRangeValidation,
|
|
21
|
+
useDateFormatValidation,
|
|
22
|
+
useIconState,
|
|
23
|
+
useDateValidation,
|
|
24
|
+
useManualDateValidation,
|
|
25
|
+
useInputBlurHandler,
|
|
26
|
+
useDatePickerVisibility,
|
|
27
|
+
useDisplayedDateString,
|
|
28
|
+
useAsteriskDisplay,
|
|
29
|
+
} from '../composables'
|
|
30
|
+
|
|
10
31
|
import dayjs from 'dayjs'
|
|
11
32
|
import customParseFormat from 'dayjs/plugin/customParseFormat'
|
|
12
33
|
|
|
@@ -17,12 +38,86 @@
|
|
|
17
38
|
const { initializeSelectedDates } = useDateInitialization()
|
|
18
39
|
const { updateAccessibility } = useDatePickerAccessibility()
|
|
19
40
|
|
|
41
|
+
// Variables pour suivre le mois et l'année actuellement affichés dans le DatePicker
|
|
42
|
+
const currentMonth = ref<string | null>(null)
|
|
43
|
+
const currentYear = ref<string | null>(null)
|
|
44
|
+
const currentMonthName = ref<string | null>(null)
|
|
45
|
+
const currentYearName = ref<string | null>(null)
|
|
46
|
+
|
|
47
|
+
const onUpdateMonth = (month: string) => {
|
|
48
|
+
// Éviter les mises à jour inutiles si le mois n'a pas changé
|
|
49
|
+
if (currentMonth.value === month) return
|
|
50
|
+
|
|
51
|
+
currentMonth.value = month
|
|
52
|
+
currentMonthName.value = dayjs().month(parseInt(month, 10)).format('MMMM')
|
|
53
|
+
handleMonthUpdate()
|
|
54
|
+
nextTick(() => {
|
|
55
|
+
if (isDatePickerVisible.value) {
|
|
56
|
+
customizeMonthButton()
|
|
57
|
+
markHolidayDays()
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const onUpdateYear = (year: string) => {
|
|
63
|
+
const oldYear = currentYear.value
|
|
64
|
+
currentYear.value = year
|
|
65
|
+
currentYearName.value = year
|
|
66
|
+
|
|
67
|
+
// Gérer le changement d'année entre décembre et janvier
|
|
68
|
+
if (parseInt(year) > parseInt(oldYear || '0') && parseInt(currentMonth.value || '0') === 11) {
|
|
69
|
+
currentMonth.value = '0'
|
|
70
|
+
currentMonthName.value = dayjs().month(0).format('MMMM')
|
|
71
|
+
}
|
|
72
|
+
else if (parseInt(year) < parseInt(oldYear || '0') && parseInt(currentMonth.value || '0') === 0) {
|
|
73
|
+
currentMonth.value = '11'
|
|
74
|
+
currentMonthName.value = dayjs().month(11).format('MMMM')
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
handleYearUpdate()
|
|
78
|
+
handleMonthUpdate()
|
|
79
|
+
nextTick(() => {
|
|
80
|
+
if (isDatePickerVisible.value) {
|
|
81
|
+
customizeMonthButton()
|
|
82
|
+
markHolidayDays()
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Fonction pour gérer les dates sélectionnées depuis le DateTextInput
|
|
88
|
+
const handleDateSelected = (value: DateValue) => {
|
|
89
|
+
// Mettre à jour le modèle avec la nouvelle valeur
|
|
90
|
+
updateModel(value)
|
|
91
|
+
|
|
92
|
+
// Mettre à jour les dates sélectionnées
|
|
93
|
+
if (value === null) {
|
|
94
|
+
selectedDates.value = null
|
|
95
|
+
}
|
|
96
|
+
else if (Array.isArray(value)) {
|
|
97
|
+
// Pour les plages de dates
|
|
98
|
+
const dateObjects = value.map((dateStr) => {
|
|
99
|
+
return parseDate(dateStr, props.dateFormatReturn || props.format)
|
|
100
|
+
}).filter(Boolean) as Date[]
|
|
101
|
+
selectedDates.value = dateObjects
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// Pour une date unique
|
|
105
|
+
const dateObject = parseDate(value, props.dateFormatReturn || props.format)
|
|
106
|
+
selectedDates.value = dateObject
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Émettre l'événement date-selected
|
|
110
|
+
emit('date-selected', value)
|
|
111
|
+
}
|
|
112
|
+
|
|
20
113
|
const props = withDefaults(defineProps<{
|
|
21
114
|
modelValue?: DateInput
|
|
115
|
+
label?: string
|
|
22
116
|
placeholder?: string
|
|
23
117
|
format?: string
|
|
24
118
|
dateFormatReturn?: string
|
|
25
119
|
isBirthDate?: boolean
|
|
120
|
+
birthDate?: boolean // Alias pour isBirthDate pour compatibilité avec l'attribut kebab-case birth-date
|
|
26
121
|
showWeekNumber?: boolean
|
|
27
122
|
required?: boolean
|
|
28
123
|
displayRange?: boolean
|
|
@@ -43,12 +138,22 @@
|
|
|
43
138
|
showSuccessMessages?: boolean
|
|
44
139
|
bgColor?: string
|
|
45
140
|
textFieldActivator?: boolean
|
|
141
|
+
displayTodayButton?: boolean
|
|
142
|
+
displayWeekendDays?: boolean
|
|
143
|
+
displayHolidayDays?: boolean
|
|
144
|
+
displayAsterisk?: boolean
|
|
145
|
+
period?: {
|
|
146
|
+
min?: string
|
|
147
|
+
max?: string
|
|
148
|
+
}
|
|
149
|
+
autoClamp?: boolean
|
|
46
150
|
}>(), {
|
|
47
151
|
modelValue: undefined,
|
|
48
|
-
placeholder:
|
|
49
|
-
format:
|
|
152
|
+
placeholder: DATE_PICKER_MESSAGES.PLACEHOLDER_DEFAULT,
|
|
153
|
+
format: DATE_PICKER_MESSAGES.FORMAT_DEFAULT,
|
|
50
154
|
dateFormatReturn: '',
|
|
51
155
|
isBirthDate: false,
|
|
156
|
+
birthDate: false,
|
|
52
157
|
showWeekNumber: false,
|
|
53
158
|
required: false,
|
|
54
159
|
displayRange: false,
|
|
@@ -65,21 +170,45 @@
|
|
|
65
170
|
width: '100%',
|
|
66
171
|
disableErrorHandling: false,
|
|
67
172
|
showSuccessMessages: true,
|
|
68
|
-
bgColor:
|
|
173
|
+
bgColor: 'white',
|
|
69
174
|
textFieldActivator: false,
|
|
175
|
+
displayTodayButton: true,
|
|
176
|
+
displayWeekendDays: true,
|
|
177
|
+
displayHolidayDays: true,
|
|
178
|
+
displayAsterisk: false,
|
|
179
|
+
period: () => ({
|
|
180
|
+
min: '',
|
|
181
|
+
max: '',
|
|
182
|
+
}),
|
|
183
|
+
autoClamp: false,
|
|
184
|
+
label: DATE_PICKER_MESSAGES.PLACEHOLDER_DEFAULT,
|
|
70
185
|
})
|
|
71
186
|
|
|
187
|
+
// Computed properties pour period
|
|
188
|
+
const minDate = computed(() =>
|
|
189
|
+
props.period?.min || dayjs().subtract(10, 'year').format(props.format),
|
|
190
|
+
)
|
|
191
|
+
const maxDate = computed(() =>
|
|
192
|
+
props.period?.max || dayjs().add(10, 'year').format(props.format),
|
|
193
|
+
)
|
|
194
|
+
|
|
72
195
|
const emit = defineEmits<{
|
|
73
196
|
(e: 'update:modelValue', value: DateValue): void
|
|
74
197
|
(e: 'closed'): void
|
|
75
198
|
(e: 'focus'): void
|
|
76
199
|
(e: 'blur'): void
|
|
200
|
+
(e: 'input', value: string): void
|
|
201
|
+
(e: 'date-selected', value: DateValue): void
|
|
77
202
|
}>()
|
|
78
203
|
|
|
79
|
-
|
|
204
|
+
// Utilisation du composable pour la saisie manuelle des plages de dates
|
|
205
|
+
const selectedDates = ref<Date | (Date | null)[] | null>(
|
|
80
206
|
initializeSelectedDates(props.modelValue as DateInput | null, props.format, props.dateFormatReturn),
|
|
81
207
|
)
|
|
82
208
|
|
|
209
|
+
// Utilisation du composable pour la validation des plages de dates
|
|
210
|
+
const { currentRangeIsValid, getRangeValidationError } = useDateRangeValidation(selectedDates as Ref<DateObjectValue>, props.displayRange)
|
|
211
|
+
|
|
83
212
|
const isDatePickerVisible = ref(false)
|
|
84
213
|
const validation = useValidation({
|
|
85
214
|
showSuccessMessages: props.showSuccessMessages,
|
|
@@ -90,61 +219,48 @@
|
|
|
90
219
|
})
|
|
91
220
|
const { errors, warnings, successes, validateField, clearValidation } = validation
|
|
92
221
|
|
|
93
|
-
const errorMessages = errors
|
|
94
|
-
const warningMessages = warnings
|
|
95
|
-
const successMessages = successes
|
|
222
|
+
const errorMessages = computed(() => errors.value)
|
|
223
|
+
const warningMessages = computed(() => warnings.value)
|
|
224
|
+
const successMessages = computed(() => successes.value)
|
|
96
225
|
const displayFormattedDate = ref('')
|
|
97
226
|
|
|
98
227
|
const textInputValue = ref<string>('')
|
|
99
228
|
|
|
229
|
+
// Variables pour la gestion de la saisie manuelle
|
|
230
|
+
const isManualInputActive = ref(false)
|
|
231
|
+
const isFormatting = ref(false)
|
|
232
|
+
|
|
100
233
|
// Variable pour éviter les mises à jour récursives
|
|
101
234
|
const isUpdatingFromInternal = ref(false)
|
|
235
|
+
// Variable pour suivre si l'utilisateur a interagi avec le champ
|
|
236
|
+
const hasInteracted = ref(false)
|
|
237
|
+
|
|
238
|
+
const { validateDateFormat, isDateComplete } = useDateFormatValidation({
|
|
239
|
+
format: props.format,
|
|
240
|
+
dateFormatReturn: props.dateFormatReturn,
|
|
241
|
+
required: props.required,
|
|
242
|
+
hasInteracted,
|
|
243
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
244
|
+
})
|
|
102
245
|
|
|
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
|
-
}
|
|
246
|
+
// pour valider les dates
|
|
247
|
+
const { validateDates, validateOnSubmit } = useDateValidation({
|
|
248
|
+
noCalendar: props.noCalendar,
|
|
249
|
+
required: props.required,
|
|
250
|
+
displayRange: props.displayRange,
|
|
251
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
252
|
+
customRules: props.customRules,
|
|
253
|
+
customWarningRules: props.customWarningRules,
|
|
254
|
+
selectedDates,
|
|
255
|
+
isUpdatingFromInternal,
|
|
256
|
+
currentRangeIsValid,
|
|
257
|
+
getRangeValidationError,
|
|
258
|
+
clearValidation,
|
|
259
|
+
validateField,
|
|
260
|
+
errors,
|
|
261
|
+
warnings,
|
|
262
|
+
successes,
|
|
263
|
+
})
|
|
148
264
|
|
|
149
265
|
// Fonction centralisée pour mettre à jour le modèle
|
|
150
266
|
const updateModel = (value: DateValue) => {
|
|
@@ -206,9 +322,30 @@
|
|
|
206
322
|
'v-messages__message--warning': warningMessages.value.length > 0 && errorMessages.value.length < 1,
|
|
207
323
|
})
|
|
208
324
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
325
|
+
// Déclaration des variables qui seront initialisées par le composable useDateSelection
|
|
326
|
+
const rangeBoundaryDates = ref<[Date | null, Date | null] | null>(null)
|
|
327
|
+
// Initialisation des variables après la déclaration de selectedDates
|
|
328
|
+
const dateSelectionResult = useDateSelection(
|
|
329
|
+
parseDate,
|
|
330
|
+
selectedDates,
|
|
331
|
+
props.format,
|
|
332
|
+
props.displayRange,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
watch(() => dateSelectionResult.rangeBoundaryDates.value, (newValue) => {
|
|
336
|
+
rangeBoundaryDates.value = newValue
|
|
337
|
+
}, { immediate: true })
|
|
338
|
+
|
|
339
|
+
// Assignation des fonctions et variables retournées par le composable
|
|
340
|
+
// Utiliser une fonction pour wrapper updateSelectedDates afin de maintenir la compatibilité avec le template
|
|
341
|
+
const updateSelectedDates = (date: Date | null) => {
|
|
342
|
+
dateSelectionResult.updateSelectedDates(date)
|
|
343
|
+
}
|
|
344
|
+
// generateDateRange est maintenant utilisé via le composable useInputHandler
|
|
345
|
+
// Synchroniser notre référence locale avec celle du composable
|
|
346
|
+
watch(() => dateSelectionResult.rangeBoundaryDates.value, (newValue) => {
|
|
347
|
+
rangeBoundaryDates.value = newValue
|
|
348
|
+
}, { immediate: true })
|
|
212
349
|
|
|
213
350
|
// Date(s) formatée(s) en chaîne de caractères pour la valeur de retour
|
|
214
351
|
const formattedDate = computed<DateValue>(() => {
|
|
@@ -216,11 +353,18 @@
|
|
|
216
353
|
|
|
217
354
|
const returnFormat = props.dateFormatReturn || props.format
|
|
218
355
|
|
|
219
|
-
|
|
356
|
+
// Pour les plages de dates, utiliser rangeBoundaryDates s'il est disponible
|
|
357
|
+
if (props.displayRange && rangeBoundaryDates.value) {
|
|
358
|
+
return [
|
|
359
|
+
formatDate(rangeBoundaryDates.value[0], returnFormat),
|
|
360
|
+
formatDate(rangeBoundaryDates.value[1], returnFormat),
|
|
361
|
+
] as [string, string]
|
|
362
|
+
}
|
|
363
|
+
else if (Array.isArray(selectedDates.value)) {
|
|
220
364
|
if (selectedDates.value.length >= 2) {
|
|
221
365
|
return [
|
|
222
366
|
formatDate(selectedDates.value[0], returnFormat),
|
|
223
|
-
formatDate(selectedDates.value[1], returnFormat),
|
|
367
|
+
formatDate(selectedDates.value[selectedDates.value.length - 1], returnFormat),
|
|
224
368
|
] as [string, string]
|
|
225
369
|
}
|
|
226
370
|
return ''
|
|
@@ -327,50 +471,132 @@
|
|
|
327
471
|
}
|
|
328
472
|
})
|
|
329
473
|
|
|
330
|
-
|
|
474
|
+
/**
|
|
475
|
+
* Met à jour l'affichage formaté de la date lorsqu'une date est sélectionnée dans le calendrier
|
|
476
|
+
*/
|
|
331
477
|
const updateDisplayFormattedDate = () => {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
478
|
+
// Utiliser setTimeout pour s'assurer que toutes les mises à jour sont terminées
|
|
479
|
+
setTimeout(() => {
|
|
480
|
+
// Mettre à jour l'affichage formaté pour qu'il corresponde à la date sélectionnée
|
|
481
|
+
let formattedValue = ''
|
|
336
482
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
.
|
|
341
|
-
|
|
483
|
+
// Gérer la fermeture du DatePicker en fonction du mode et de l'état de sélection
|
|
484
|
+
if (props.displayRange) {
|
|
485
|
+
// Priorité à rangeBoundaryDates pour les plages
|
|
486
|
+
if (rangeBoundaryDates.value && rangeBoundaryDates.value[0] && rangeBoundaryDates.value[1]) {
|
|
487
|
+
// Les deux dates de la plage sont disponibles dans rangeBoundaryDates
|
|
488
|
+
const startDate = formatDate(rangeBoundaryDates.value[0], props.format)
|
|
489
|
+
const endDate = formatDate(rangeBoundaryDates.value[1], props.format)
|
|
490
|
+
|
|
491
|
+
// Formater l'affichage de la plage
|
|
492
|
+
formattedValue = `${startDate} - ${endDate}`
|
|
493
|
+
displayFormattedDate.value = formattedValue
|
|
494
|
+
textInputValue.value = formattedValue
|
|
495
|
+
|
|
496
|
+
// Mettre à jour le modèle avec les dates formatées
|
|
497
|
+
const formattedDates = [
|
|
498
|
+
formatDate(rangeBoundaryDates.value[0], props.dateFormatReturn || props.format),
|
|
499
|
+
formatDate(rangeBoundaryDates.value[1], props.dateFormatReturn || props.format),
|
|
500
|
+
] as [string, string]
|
|
501
|
+
|
|
502
|
+
updateModel(formattedDates)
|
|
503
|
+
emit('date-selected', formattedDates)
|
|
504
|
+
|
|
505
|
+
// Les deux dates de la plage sont sélectionnées, fermer le DatePicker
|
|
506
|
+
isDatePickerVisible.value = false
|
|
507
|
+
emit('closed')
|
|
508
|
+
}
|
|
509
|
+
// Fallback sur selectedDates si rangeBoundaryDates n'est pas complet
|
|
510
|
+
else if (Array.isArray(selectedDates.value) && selectedDates.value.length >= 2) {
|
|
511
|
+
// Émettre l'événement date-selected avec les dates formatées
|
|
512
|
+
const formattedDates = [
|
|
513
|
+
formatDate(selectedDates.value[0], props.format),
|
|
514
|
+
formatDate(selectedDates.value[selectedDates.value.length - 1], props.format),
|
|
515
|
+
] as [string, string]
|
|
516
|
+
|
|
517
|
+
formattedValue = `${formattedDates[0]} - ${formattedDates[1]}`
|
|
518
|
+
displayFormattedDate.value = formattedValue
|
|
519
|
+
textInputValue.value = formattedValue
|
|
520
|
+
|
|
521
|
+
// Mettre à jour le modèle avec les dates formatées
|
|
522
|
+
updateModel(formattedDates)
|
|
523
|
+
emit('date-selected', formattedDates)
|
|
524
|
+
|
|
525
|
+
// Les deux dates de la plage sont sélectionnées, fermer le DatePicker
|
|
526
|
+
isDatePickerVisible.value = false
|
|
527
|
+
emit('closed')
|
|
528
|
+
}
|
|
529
|
+
else {
|
|
530
|
+
// Utiliser la valeur calculée par le computed si disponible
|
|
531
|
+
formattedValue = displayFormattedDateComputed.value || ''
|
|
532
|
+
displayFormattedDate.value = formattedValue
|
|
533
|
+
textInputValue.value = formattedValue
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
// En mode date unique
|
|
538
|
+
formattedValue = displayFormattedDateComputed.value || ''
|
|
539
|
+
displayFormattedDate.value = formattedValue
|
|
540
|
+
textInputValue.value = formattedValue
|
|
342
541
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
542
|
+
// En mode date unique, fermer le DatePicker après sélection
|
|
543
|
+
isDatePickerVisible.value = false
|
|
544
|
+
emit('closed')
|
|
545
|
+
emit('date-selected', formattedDate.value)
|
|
346
546
|
}
|
|
347
547
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
548
|
+
// Valider les dates après mise à jour
|
|
549
|
+
validateDates()
|
|
550
|
+
}, 0) // setTimeout avec délai de 0ms pour s'exécuter après le cycle de rendu actuel
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// Les variables useDateSelection sont maintenant déclarées et initialisées plus haut dans le code
|
|
351
554
|
|
|
352
|
-
|
|
353
|
-
|
|
555
|
+
// Fonction pour émettre l'événement blur (utilisée pour les tests)
|
|
556
|
+
const emitBlurEvent = () => {
|
|
557
|
+
emit('blur')
|
|
354
558
|
}
|
|
355
559
|
|
|
356
|
-
//
|
|
357
|
-
const
|
|
358
|
-
|
|
560
|
+
// Utilisation du composable pour les jours fériés
|
|
561
|
+
const { getJoursFeries } = useHolidayDay()
|
|
562
|
+
|
|
563
|
+
// Fonction pour marquer les jours fériés dans le calendrier
|
|
564
|
+
const markHolidayDays = () => {
|
|
565
|
+
// Si l'affichage des jours fériés est désactivé, ne rien faire
|
|
566
|
+
if (!props.displayHolidayDays) return
|
|
567
|
+
|
|
568
|
+
// Attendre que le DOM soit mis à jour
|
|
569
|
+
nextTick(() => {
|
|
570
|
+
// Récupérer l'année et le mois courants
|
|
571
|
+
const year = parseInt(currentYear.value || new Date().getFullYear().toString(), 10)
|
|
572
|
+
// Utiliser currentMonth.value !== null pour vérifier si la valeur est définie, même si c'est 0
|
|
573
|
+
const month = parseInt(currentMonth.value !== null ? currentMonth.value : new Date().getMonth().toString(), 10)
|
|
574
|
+
|
|
575
|
+
// Récupérer les jours fériés pour cette année
|
|
576
|
+
const joursFeries = getJoursFeries(year)
|
|
577
|
+
// Convertir les jours fériés en objets Date
|
|
578
|
+
const holidayDates = Array.from(joursFeries).map((dateStr) => {
|
|
579
|
+
const [day, monthStr, yearStr] = dateStr.split('/')
|
|
580
|
+
return new Date(parseInt(yearStr), parseInt(monthStr) - 1, parseInt(day))
|
|
581
|
+
})
|
|
359
582
|
|
|
360
|
-
|
|
361
|
-
|
|
583
|
+
// Filtrer les jours fériés pour le mois courant
|
|
584
|
+
const monthHolidays = holidayDates.filter((holiday) => {
|
|
585
|
+
return holiday.getMonth() === month && holiday.getFullYear() === year
|
|
586
|
+
})
|
|
362
587
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
588
|
+
// Pour chaque jour férié, trouver l'élément DOM correspondant et ajouter la classe
|
|
589
|
+
monthHolidays.forEach((holiday) => {
|
|
590
|
+
const day = holiday.getDate()
|
|
591
|
+
const dateStr = `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`
|
|
592
|
+
const dayElements = document.querySelectorAll(`[data-v-date="${dateStr}"]`)
|
|
593
|
+
dayElements.forEach((element) => {
|
|
594
|
+
element.classList.add('holiday-day')
|
|
595
|
+
})
|
|
596
|
+
})
|
|
597
|
+
})
|
|
368
598
|
}
|
|
369
599
|
|
|
370
|
-
const todayInString = computed(() => {
|
|
371
|
-
return dayjs().locale('fr').format('dddd D MMMM').replace(/\b\w/g, l => l.toUpperCase())
|
|
372
|
-
})
|
|
373
|
-
|
|
374
600
|
onMounted(() => {
|
|
375
601
|
document.addEventListener('click', handleClickOutside)
|
|
376
602
|
|
|
@@ -381,6 +607,9 @@
|
|
|
381
607
|
|
|
382
608
|
// Valider les dates au montage
|
|
383
609
|
validateDates()
|
|
610
|
+
|
|
611
|
+
// Configurer l'observateur pour le bouton du mois
|
|
612
|
+
setupMonthButtonObserver()
|
|
384
613
|
})
|
|
385
614
|
|
|
386
615
|
onBeforeUnmount(() => {
|
|
@@ -389,66 +618,142 @@
|
|
|
389
618
|
|
|
390
619
|
const dateTextInputRef = ref<null | ComponentPublicInstance<typeof DateTextInput>>()
|
|
391
620
|
const dateCalendarTextInputRef = ref<null | ComponentPublicInstance<typeof SyTextField>>()
|
|
392
|
-
const datePickerRef = ref<null | ComponentPublicInstance<typeof VDatePicker>>()
|
|
393
621
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
622
|
+
// Initialiser le composable useInputHandler pour gérer la saisie des dates
|
|
623
|
+
const inputHandler = useInputHandler({
|
|
624
|
+
format: props.format,
|
|
625
|
+
displayRange: props.displayRange,
|
|
626
|
+
dateFormatReturn: props.dateFormatReturn,
|
|
627
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
628
|
+
parseDate,
|
|
629
|
+
formatDate,
|
|
630
|
+
generateDateRange: dateSelectionResult.generateDateRange,
|
|
631
|
+
isDateComplete: isDateComplete.value,
|
|
632
|
+
displayFormattedDate,
|
|
633
|
+
selectedDates,
|
|
634
|
+
isFormatting,
|
|
635
|
+
isManualInputActive,
|
|
636
|
+
isUpdatingFromInternal,
|
|
637
|
+
clearValidation,
|
|
638
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- validation rules
|
|
639
|
+
validateField: (value, rules, warningRules) => validateField(value, rules as any[], warningRules as any[]),
|
|
640
|
+
updateModel: value => updateModel(value as DateValue),
|
|
641
|
+
emitInput: value => emit('input', value),
|
|
642
|
+
inputRef: dateCalendarTextInputRef as Ref<ComponentPublicInstance | null>,
|
|
643
|
+
})
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Gère l'entrée utilisateur dans le champ de saisie de date
|
|
647
|
+
* Adapté pour fonctionner avec DateTextInput qui émet une valeur string au lieu d'un Event
|
|
648
|
+
*/
|
|
649
|
+
const handleInput = (eventOrValue: Event | string) => {
|
|
650
|
+
// Si c'est un événement standard, utiliser directement
|
|
651
|
+
if (eventOrValue instanceof Event) {
|
|
652
|
+
inputHandler.handleInput(eventOrValue)
|
|
653
|
+
return
|
|
397
654
|
}
|
|
398
|
-
// Forcer la validation pour ignorer les conditions de validation interactive
|
|
399
|
-
validateDates(true)
|
|
400
|
-
// Retourner directement un booléen pour maintenir la compatibilité avec les tests existants
|
|
401
|
-
return errors.value.length === 0
|
|
402
|
-
}
|
|
403
655
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
656
|
+
// Si c'est une valeur string (venant du DateTextInput)
|
|
657
|
+
const inputElement = dateCalendarTextInputRef.value?.$el?.querySelector('input')
|
|
658
|
+
if (!inputElement) return
|
|
659
|
+
|
|
660
|
+
// Mettre à jour la valeur du modèle directement
|
|
661
|
+
textInputValue.value = eventOrValue
|
|
662
|
+
|
|
663
|
+
// Traitement spécifique pour les plages de dates
|
|
664
|
+
if (props.displayRange && typeof eventOrValue === 'string') {
|
|
665
|
+
// Vérifier si la plage est complète (contient un séparateur et deux dates)
|
|
666
|
+
if (eventOrValue.includes(' - ')) {
|
|
667
|
+
const parts = eventOrValue.split(' - ')
|
|
668
|
+
const startDateStr = parts[0]?.trim() || ''
|
|
669
|
+
const endDateStr = parts[1]?.trim() || ''
|
|
670
|
+
|
|
671
|
+
// Si les deux dates sont présentes et valides, mettre à jour le modèle
|
|
672
|
+
if (startDateStr && endDateStr && !endDateStr.includes('_')) {
|
|
673
|
+
// Convertir les dates en objets Date
|
|
674
|
+
const startDate = parseDate(startDateStr, props.format)
|
|
675
|
+
const endDate = parseDate(endDateStr, props.format)
|
|
676
|
+
|
|
677
|
+
if (startDate && endDate) {
|
|
678
|
+
// Mettre à jour les dates sélectionnées
|
|
679
|
+
selectedDates.value = [startDate, endDate]
|
|
680
|
+
// Valider la plage de dates
|
|
681
|
+
validateDates()
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
// Pour une date unique
|
|
688
|
+
validateDates()
|
|
407
689
|
}
|
|
408
690
|
}
|
|
691
|
+
const datePickerRef = ref<null | ComponentPublicInstance<typeof VDatePicker>>()
|
|
409
692
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
currentViewMode.value = newValue ? 'year' : 'month'
|
|
417
|
-
})
|
|
693
|
+
// Utilisation du composable pour personnaliser les boutons du mois et de l'année
|
|
694
|
+
const { customizeMonthButton, setupMonthButtonObserver } = useMonthButtonCustomization(
|
|
695
|
+
() => isDatePickerVisible.value,
|
|
696
|
+
currentMonthName,
|
|
697
|
+
currentYearName,
|
|
698
|
+
)
|
|
418
699
|
|
|
419
|
-
//
|
|
420
|
-
const handleViewModeUpdate
|
|
421
|
-
|
|
422
|
-
|
|
700
|
+
// Utilisation du composable pour gérer le mode d'affichage du DatePicker
|
|
701
|
+
const { currentViewMode, handleViewModeUpdate, handleYearUpdate, handleMonthUpdate, resetViewMode } = useDatePickerViewMode(
|
|
702
|
+
// Fonction qui retourne la valeur actuelle de isBirthDate (combinaison de isBirthDate et birthDate)
|
|
703
|
+
() => props.isBirthDate || props.birthDate,
|
|
704
|
+
)
|
|
423
705
|
|
|
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
|
-
}
|
|
706
|
+
// La fonction isDateComplete est maintenant importée du composable useDateFormatValidation
|
|
431
707
|
|
|
432
|
-
// Fonction pour
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
708
|
+
// Fonction pour valider la saisie manuelle, similaire à validateRules dans DateTextInput
|
|
709
|
+
const { validateManualInput } = useManualDateValidation({
|
|
710
|
+
format: props.format,
|
|
711
|
+
required: props.required,
|
|
712
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
713
|
+
customRules: props.customRules,
|
|
714
|
+
customWarningRules: props.customWarningRules,
|
|
715
|
+
hasInteracted,
|
|
716
|
+
errors,
|
|
717
|
+
clearValidation,
|
|
718
|
+
validateDateFormat,
|
|
719
|
+
isDateComplete: isDateComplete.value,
|
|
720
|
+
parseDate,
|
|
721
|
+
validateField,
|
|
722
|
+
})
|
|
439
723
|
|
|
440
|
-
const handleInputBlur = (
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
724
|
+
const { handleInputBlur } = useInputBlurHandler({
|
|
725
|
+
format: props.format,
|
|
726
|
+
dateFormatReturn: props.dateFormatReturn,
|
|
727
|
+
required: props.required,
|
|
728
|
+
displayFormattedDate,
|
|
729
|
+
hasInteracted,
|
|
730
|
+
isManualInputActive,
|
|
731
|
+
isUpdatingFromInternal,
|
|
732
|
+
selectedDates,
|
|
733
|
+
errors,
|
|
734
|
+
validateDateFormat,
|
|
735
|
+
parseDate,
|
|
736
|
+
formatDate,
|
|
737
|
+
updateModel,
|
|
738
|
+
validateManualInput,
|
|
739
|
+
emitBlur: emitBlurEvent,
|
|
740
|
+
})
|
|
444
741
|
|
|
445
742
|
watch(isDatePickerVisible, async (isVisible) => {
|
|
446
743
|
if (!isVisible && props.isBirthDate) {
|
|
447
744
|
// Réinitialiser le mode d'affichage au type birthdate
|
|
448
|
-
|
|
745
|
+
resetViewMode()
|
|
449
746
|
}
|
|
450
747
|
|
|
451
748
|
if (isVisible) {
|
|
749
|
+
// Personnaliser le bouton du mois
|
|
750
|
+
customizeMonthButton()
|
|
751
|
+
|
|
752
|
+
// Marquer les jours fériés lorsque le calendrier devient visible
|
|
753
|
+
if (props.displayHolidayDays) {
|
|
754
|
+
markHolidayDays()
|
|
755
|
+
}
|
|
756
|
+
|
|
452
757
|
// set the focus on the date picker
|
|
453
758
|
await nextTick()
|
|
454
759
|
const firstButton = datePickerRef.value?.$el.querySelector('button')
|
|
@@ -471,21 +776,14 @@
|
|
|
471
776
|
}
|
|
472
777
|
})
|
|
473
778
|
|
|
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
|
-
}
|
|
779
|
+
// Utilisation du composable useIconState pour déterminer l'icône à afficher
|
|
780
|
+
const { getIcon } = useIconState({
|
|
781
|
+
noCalendar: props.noCalendar,
|
|
782
|
+
disableErrorHandling: props.disableErrorHandling,
|
|
783
|
+
errorMessages,
|
|
784
|
+
warningMessages,
|
|
785
|
+
successMessages,
|
|
786
|
+
})
|
|
489
787
|
|
|
490
788
|
const syncFromModelValue = (newValue: DateInput | undefined) => {
|
|
491
789
|
if (!newValue || newValue === '') {
|
|
@@ -536,40 +834,220 @@
|
|
|
536
834
|
}
|
|
537
835
|
}, { immediate: true })
|
|
538
836
|
|
|
539
|
-
const
|
|
540
|
-
|
|
837
|
+
const {
|
|
838
|
+
toggleDatePicker,
|
|
839
|
+
openDatePicker,
|
|
840
|
+
openDatePickerOnClick,
|
|
841
|
+
openDatePickerOnFocus,
|
|
842
|
+
openDatePickerOnIconClick,
|
|
843
|
+
handleClickOutside,
|
|
844
|
+
handleKeyboardNavigation,
|
|
845
|
+
} = useDatePickerVisibility({
|
|
846
|
+
disabled: props.disabled,
|
|
847
|
+
readonly: props.readonly,
|
|
848
|
+
textFieldActivator: props.textFieldActivator,
|
|
849
|
+
isDatePickerVisible,
|
|
850
|
+
isManualInputActive,
|
|
851
|
+
hasInteracted,
|
|
852
|
+
updateAccessibility,
|
|
853
|
+
validateDates,
|
|
854
|
+
emitClosed: () => emit('closed'),
|
|
855
|
+
emitFocus: () => emit('focus'),
|
|
856
|
+
})
|
|
857
|
+
|
|
858
|
+
// Fonctions pour la gestion de la saisie manuelle
|
|
859
|
+
const formatDateInput = (input: string, cursorPosition?: number): { formatted: string, cursorPos: number } => {
|
|
860
|
+
// Conserver uniquement les chiffres de l'entrée
|
|
861
|
+
const cleanedInput = input.replace(/[^\d]/g, '')
|
|
541
862
|
|
|
542
|
-
|
|
863
|
+
// Déterminer le séparateur utilisé dans le format
|
|
864
|
+
const separator = props.format.match(/[^DMY]/)?.[0] || '/'
|
|
543
865
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
866
|
+
// Calculer la position du curseur dans l'entrée nettoyée (sans séparateurs)
|
|
867
|
+
// Pour cela, on compte combien de chiffres il y a avant la position du curseur
|
|
868
|
+
const inputBeforeCursor = input.substring(0, cursorPosition || 0)
|
|
869
|
+
const digitsBeforeCursor = inputBeforeCursor.replace(/[^\d]/g, '').length
|
|
870
|
+
|
|
871
|
+
// Construire la chaîne formatée
|
|
872
|
+
let result = ''
|
|
873
|
+
let digitIndex = 0
|
|
874
|
+
|
|
875
|
+
// Parcourir le format pour placer les chiffres et séparateurs
|
|
876
|
+
for (let i = 0; i < props.format.length && digitIndex < cleanedInput.length; i++) {
|
|
877
|
+
const formatChar = props.format[i].toUpperCase()
|
|
878
|
+
|
|
879
|
+
if (['D', 'M', 'Y'].includes(formatChar)) {
|
|
880
|
+
// Ajouter un chiffre
|
|
881
|
+
result += cleanedInput[digitIndex]
|
|
882
|
+
digitIndex++
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
// Ajouter un séparateur
|
|
886
|
+
result += separator
|
|
887
|
+
}
|
|
549
888
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
889
|
+
|
|
890
|
+
// Calculer la nouvelle position du curseur
|
|
891
|
+
// Nombre de chiffres avant le curseur + nombre de séparateurs avant ces chiffres
|
|
892
|
+
let newCursorPos = digitsBeforeCursor
|
|
893
|
+
|
|
894
|
+
// Ajouter les séparateurs qui apparaissent avant la position du curseur
|
|
895
|
+
for (let i = 0, digitCount = 0; i < props.format.length && digitCount < digitsBeforeCursor; i++) {
|
|
896
|
+
if (!['D', 'M', 'Y'].includes(props.format[i].toUpperCase())) {
|
|
897
|
+
newCursorPos++
|
|
898
|
+
}
|
|
899
|
+
else {
|
|
900
|
+
digitCount++
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
return {
|
|
905
|
+
formatted: result,
|
|
906
|
+
cursorPos: Math.min(newCursorPos, result.length),
|
|
553
907
|
}
|
|
554
908
|
}
|
|
555
909
|
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
|
|
910
|
+
const handleKeydown = (event: KeyboardEvent & { target: HTMLInputElement }) => {
|
|
911
|
+
// Déléguer la gestion de l'ouverture du calendrier au composable
|
|
912
|
+
if (!props.noCalendar && handleKeyboardNavigation(event)) {
|
|
913
|
+
return
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// Gérer la suppression des séparateurs
|
|
917
|
+
if (event.key === 'Backspace') {
|
|
918
|
+
const input = event.target
|
|
919
|
+
if (!input.selectionStart || input.selectionStart !== input.selectionEnd) {
|
|
920
|
+
return
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
const cursorPos = input.selectionStart
|
|
924
|
+
const charBeforeCursor = input.value[cursorPos - 1]
|
|
925
|
+
|
|
926
|
+
if (!/\d/.test(charBeforeCursor)) {
|
|
927
|
+
// Si le caractère avant le curseur n'est pas un chiffre, on le supprime aussi
|
|
928
|
+
// et on supprime le chiffre avant le séparateur
|
|
929
|
+
event.preventDefault() // Empêcher le comportement par défaut
|
|
930
|
+
|
|
931
|
+
const newValue = input.value.substring(0, cursorPos - 2)
|
|
932
|
+
+ input.value.substring(cursorPos)
|
|
933
|
+
|
|
934
|
+
// Mettre à jour la valeur
|
|
935
|
+
displayFormattedDate.value = newValue
|
|
936
|
+
|
|
937
|
+
// Positionner le curseur après un court délai
|
|
938
|
+
setTimeout(() => {
|
|
939
|
+
const newCursorPos = cursorPos - 2
|
|
940
|
+
input.setSelectionRange(newCursorPos, newCursorPos)
|
|
941
|
+
}, 0)
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// Gérer les touches de direction pour éviter de se retrouver entre un séparateur et un chiffre
|
|
946
|
+
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
947
|
+
const input = event.target
|
|
948
|
+
const cursorPos = input.selectionStart || 0
|
|
949
|
+
|
|
950
|
+
// Déterminer le séparateur utilisé dans le format
|
|
951
|
+
const separator = props.format.match(/[^DMY]/)?.[0] || '/'
|
|
952
|
+
|
|
953
|
+
if (event.key === 'ArrowLeft' && cursorPos > 0) {
|
|
954
|
+
const charBeforeCursor = input.value[cursorPos - 1]
|
|
955
|
+
|
|
956
|
+
if (charBeforeCursor === separator) {
|
|
957
|
+
// Si on se déplace à gauche et qu'on rencontre un séparateur, sauter par-dessus
|
|
958
|
+
event.preventDefault()
|
|
959
|
+
input.setSelectionRange(cursorPos - 2, cursorPos - 2)
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
else if (event.key === 'ArrowRight' && cursorPos < input.value.length) {
|
|
963
|
+
const charAtCursor = input.value[cursorPos]
|
|
964
|
+
|
|
965
|
+
if (charAtCursor === separator) {
|
|
966
|
+
// Si on se déplace à droite et qu'on rencontre un séparateur, sauter par-dessus
|
|
967
|
+
event.preventDefault()
|
|
968
|
+
input.setSelectionRange(cursorPos + 2, cursorPos + 2)
|
|
969
|
+
}
|
|
970
|
+
}
|
|
559
971
|
}
|
|
560
972
|
}
|
|
561
973
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
974
|
+
// Variable pour l'accessibilité
|
|
975
|
+
const accessibilityDescription = ref(DATE_PICKER_MESSAGES.ARIA_DATE_INPUT)
|
|
976
|
+
|
|
977
|
+
// Fonction pour créer une description accessible de la date pour les lecteurs d'écran
|
|
978
|
+
const getDateDescription = (dateStr: string, format: string): string => {
|
|
979
|
+
// Si la chaîne est vide, retourner un message simple
|
|
980
|
+
if (!dateStr || !dateStr.trim()) {
|
|
981
|
+
return 'Aucune date saisie'
|
|
566
982
|
}
|
|
567
|
-
|
|
568
|
-
|
|
983
|
+
|
|
984
|
+
// Déterminer le séparateur utilisé dans le format
|
|
985
|
+
const separator = format.match(/[^DMY]/)?.[0] || '/'
|
|
986
|
+
|
|
987
|
+
// Extraire les parties de la date
|
|
988
|
+
const dateParts = dateStr.split(separator)
|
|
989
|
+
const formatParts = format.split(separator)
|
|
990
|
+
|
|
991
|
+
// Créer une description en fonction du format
|
|
992
|
+
let description = 'Date en cours de saisie: '
|
|
993
|
+
|
|
994
|
+
for (let i = 0; i < formatParts.length; i++) {
|
|
995
|
+
if (i >= dateParts.length) break
|
|
996
|
+
|
|
997
|
+
const part = dateParts[i].trim()
|
|
998
|
+
const formatPart = formatParts[i].charAt(0).toUpperCase()
|
|
999
|
+
|
|
1000
|
+
// Ignorer les parties vides ou contenant uniquement des placeholders
|
|
1001
|
+
if (!part || part.replace(/_/g, '').length === 0) {
|
|
1002
|
+
continue
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
switch (formatPart) {
|
|
1006
|
+
case 'D':
|
|
1007
|
+
description += `jour ${part}, `
|
|
1008
|
+
break
|
|
1009
|
+
case 'M':
|
|
1010
|
+
description += `mois ${part}, `
|
|
1011
|
+
break
|
|
1012
|
+
case 'Y':
|
|
1013
|
+
description += `année ${part}, `
|
|
1014
|
+
break
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// Supprimer la virgule finale si elle existe
|
|
1019
|
+
return description.endsWith(', ')
|
|
1020
|
+
? description.slice(0, -2)
|
|
1021
|
+
: description
|
|
569
1022
|
}
|
|
570
1023
|
|
|
571
|
-
|
|
572
|
-
|
|
1024
|
+
// Mettre à jour la description accessible lorsque la valeur affichée change
|
|
1025
|
+
watch(displayFormattedDate, (newValue) => {
|
|
1026
|
+
if (newValue && typeof newValue === 'string') {
|
|
1027
|
+
// Créer une version accessible pour les lecteurs d'écran (sans les caractères de placeholder)
|
|
1028
|
+
const accessibleValue = newValue.replace(/_/g, ' ')
|
|
1029
|
+
|
|
1030
|
+
// Créer un message descriptif pour le lecteur d'écran
|
|
1031
|
+
accessibilityDescription.value = getDateDescription(accessibleValue, props.format)
|
|
1032
|
+
}
|
|
1033
|
+
else {
|
|
1034
|
+
accessibilityDescription.value = 'Aucune date saisie'
|
|
1035
|
+
}
|
|
1036
|
+
})
|
|
1037
|
+
|
|
1038
|
+
const { todayInString, selectToday } = useTodayButton(props)
|
|
1039
|
+
const { labelWithAsterisk } = useAsteriskDisplay(props)
|
|
1040
|
+
|
|
1041
|
+
// Utilisation du composable pour l'affichage formaté des dates
|
|
1042
|
+
const { displayedDateString } = useDisplayedDateString({
|
|
1043
|
+
selectedDates,
|
|
1044
|
+
rangeBoundaryDates,
|
|
1045
|
+
todayInString,
|
|
1046
|
+
})
|
|
1047
|
+
|
|
1048
|
+
// Wrapper pour la fonction selectToday du composable
|
|
1049
|
+
const handleSelectToday = () => {
|
|
1050
|
+
selectToday(selectedDates)
|
|
573
1051
|
}
|
|
574
1052
|
|
|
575
1053
|
defineExpose({
|
|
@@ -579,16 +1057,34 @@
|
|
|
579
1057
|
errorMessages,
|
|
580
1058
|
handleClickOutside,
|
|
581
1059
|
initializeSelectedDates,
|
|
1060
|
+
handleSelectToday,
|
|
582
1061
|
updateAccessibility,
|
|
583
1062
|
openDatePicker,
|
|
1063
|
+
updateDisplayFormattedDate,
|
|
1064
|
+
currentMonth, // Exposer le mois actuellement affiché
|
|
1065
|
+
currentMonthName, // Exposer le nom du mois actuellement affiché
|
|
1066
|
+
toggleDatePicker,
|
|
1067
|
+
validateField,
|
|
1068
|
+
clearValidation,
|
|
1069
|
+
validateDates,
|
|
1070
|
+
formatDateInput,
|
|
1071
|
+
emitBlur: emitBlurEvent,
|
|
1072
|
+
validateDateFormat,
|
|
1073
|
+
displayFormattedDate,
|
|
584
1074
|
})
|
|
585
1075
|
</script>
|
|
586
1076
|
|
|
587
1077
|
<template>
|
|
588
1078
|
<div
|
|
589
1079
|
class="date-picker-container"
|
|
590
|
-
:style="inputStyle"
|
|
591
1080
|
>
|
|
1081
|
+
<!-- Variable pour stocker la description accessible -->
|
|
1082
|
+
<span
|
|
1083
|
+
v-if="false"
|
|
1084
|
+
ref="accessibilityDescriptionRef"
|
|
1085
|
+
>
|
|
1086
|
+
{{ accessibilityDescription }}
|
|
1087
|
+
</span>
|
|
592
1088
|
<template v-if="props.noCalendar">
|
|
593
1089
|
<DateTextInput
|
|
594
1090
|
ref="dateTextInputRef"
|
|
@@ -596,7 +1092,7 @@
|
|
|
596
1092
|
:class="[getMessageClasses(), 'label-hidden-on-focus']"
|
|
597
1093
|
:date-format-return="props.dateFormatReturn"
|
|
598
1094
|
:format="props.format"
|
|
599
|
-
:label="
|
|
1095
|
+
:label="labelWithAsterisk || ''"
|
|
600
1096
|
:placeholder="props.placeholder"
|
|
601
1097
|
:required="props.required"
|
|
602
1098
|
:custom-rules="props.customRules"
|
|
@@ -611,6 +1107,8 @@
|
|
|
611
1107
|
:disable-error-handling="props.disableErrorHandling"
|
|
612
1108
|
:show-success-messages="props.showSuccessMessages"
|
|
613
1109
|
:bg-color="props.bgColor"
|
|
1110
|
+
:auto-clamp="props.autoClamp"
|
|
1111
|
+
:display-asterisk="props.displayAsterisk"
|
|
614
1112
|
title="Date text input"
|
|
615
1113
|
@focus="emit('focus')"
|
|
616
1114
|
@blur="emit('blur')"
|
|
@@ -627,36 +1125,42 @@
|
|
|
627
1125
|
:open-on-click="false"
|
|
628
1126
|
scroll-strategy="none"
|
|
629
1127
|
transition="fade-transition"
|
|
630
|
-
|
|
631
|
-
:offset="[-20, 5]"
|
|
1128
|
+
:offset="[0, 10]"
|
|
632
1129
|
>
|
|
633
1130
|
<template #activator="{ props: menuProps }">
|
|
634
|
-
<
|
|
1131
|
+
<DateTextInput
|
|
635
1132
|
v-bind="menuProps"
|
|
636
1133
|
ref="dateCalendarTextInputRef"
|
|
637
|
-
v-model="
|
|
638
|
-
:
|
|
639
|
-
:
|
|
640
|
-
:
|
|
641
|
-
:
|
|
642
|
-
:
|
|
643
|
-
:success-messages="props.showSuccessMessages ? successMessages : []"
|
|
1134
|
+
v-model="textInputValue"
|
|
1135
|
+
:label="labelWithAsterisk || ''"
|
|
1136
|
+
:placeholder="props.placeholder"
|
|
1137
|
+
:format="props.format"
|
|
1138
|
+
:date-format-return="props.dateFormatReturn"
|
|
1139
|
+
:required="props.required"
|
|
644
1140
|
:disabled="props.disabled"
|
|
645
|
-
:
|
|
646
|
-
:
|
|
647
|
-
:
|
|
1141
|
+
:readonly="props.readonly"
|
|
1142
|
+
:is-outlined="props.isOutlined"
|
|
1143
|
+
:display-icon="props.displayIcon"
|
|
1144
|
+
:display-append-icon="props.displayAppendIcon"
|
|
1145
|
+
:display-prepend-icon="props.displayPrependIcon"
|
|
648
1146
|
:no-icon="props.noIcon"
|
|
649
|
-
:
|
|
650
|
-
:
|
|
651
|
-
|
|
1147
|
+
:custom-rules="props.customRules"
|
|
1148
|
+
:custom-warning-rules="props.customWarningRules"
|
|
1149
|
+
:display-asterisk="props.displayAsterisk"
|
|
1150
|
+
:disable-error-handling="props.disableErrorHandling"
|
|
652
1151
|
:show-success-messages="props.showSuccessMessages"
|
|
653
1152
|
:bg-color="props.bgColor"
|
|
654
|
-
|
|
655
|
-
|
|
1153
|
+
:display-range="props.displayRange"
|
|
1154
|
+
:display-persistent-placeholder="true"
|
|
1155
|
+
:class="[getMessageClasses(), 'label-hidden-on-focus']"
|
|
1156
|
+
:append-inner-icon="getIcon"
|
|
1157
|
+
:auto-clamp="props.autoClamp"
|
|
656
1158
|
@click="openDatePickerOnClick"
|
|
657
1159
|
@focus="openDatePickerOnFocus"
|
|
658
1160
|
@blur="handleInputBlur"
|
|
659
|
-
@
|
|
1161
|
+
@input="handleInput"
|
|
1162
|
+
@keydown="handleKeydown"
|
|
1163
|
+
@date-selected="handleDateSelected"
|
|
660
1164
|
@prepend-icon-click="openDatePickerOnIconClick"
|
|
661
1165
|
@append-icon-click="openDatePickerOnIconClick"
|
|
662
1166
|
/>
|
|
@@ -666,24 +1170,55 @@
|
|
|
666
1170
|
ref="datePickerRef"
|
|
667
1171
|
v-model="selectedDates"
|
|
668
1172
|
color="primary"
|
|
1173
|
+
:class="props.displayWeekendDays ? 'weekend' : ''"
|
|
669
1174
|
:first-day-of-week="1"
|
|
670
1175
|
:multiple="props.displayRange ? 'range' : false"
|
|
671
1176
|
:show-adjacent-months="true"
|
|
672
1177
|
:show-week="props.showWeekNumber"
|
|
673
1178
|
:view-mode="currentViewMode"
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
1179
|
+
:max="maxDate"
|
|
1180
|
+
:min="minDate"
|
|
1181
|
+
:display-holiday-days="props.displayHolidayDays"
|
|
1182
|
+
:display-asterisk="props.displayAsterisk"
|
|
677
1183
|
@update:model-value="updateDisplayFormattedDate"
|
|
1184
|
+
@update:view-mode="handleViewModeUpdate"
|
|
1185
|
+
@update:month="onUpdateMonth"
|
|
1186
|
+
@update:year="onUpdateYear"
|
|
1187
|
+
@click:date="updateSelectedDates"
|
|
1188
|
+
@focus="props.displayHolidayDays ? markHolidayDays : undefined"
|
|
1189
|
+
@update:month-year="props.displayHolidayDays ? markHolidayDays : undefined"
|
|
678
1190
|
>
|
|
679
1191
|
<template #title>
|
|
680
1192
|
Sélectionnez une date
|
|
681
1193
|
</template>
|
|
682
1194
|
<template #header>
|
|
683
1195
|
<h3 class="mx-auto my-auto ml-5 mb-4">
|
|
684
|
-
{{
|
|
1196
|
+
{{ displayedDateString }}
|
|
685
1197
|
</h3>
|
|
686
1198
|
</template>
|
|
1199
|
+
<template
|
|
1200
|
+
v-if="props.displayTodayButton"
|
|
1201
|
+
#actions
|
|
1202
|
+
>
|
|
1203
|
+
<div class="d-flex justify-center align-center w-100">
|
|
1204
|
+
<v-btn
|
|
1205
|
+
v-if="props.displayTodayButton"
|
|
1206
|
+
size="x-small"
|
|
1207
|
+
color="primary"
|
|
1208
|
+
:title="DATE_PICKER_MESSAGES.BUTTON_TODAY"
|
|
1209
|
+
class="my-2 pa-2 mt-2"
|
|
1210
|
+
:ripple="false"
|
|
1211
|
+
@click="handleSelectToday"
|
|
1212
|
+
>
|
|
1213
|
+
<VIcon
|
|
1214
|
+
class="mr-1"
|
|
1215
|
+
>
|
|
1216
|
+
{{ mdiCalendar }}
|
|
1217
|
+
</VIcon>
|
|
1218
|
+
{{ DATE_PICKER_MESSAGES.BUTTON_TODAY }}
|
|
1219
|
+
</v-btn>
|
|
1220
|
+
</div>
|
|
1221
|
+
</template>
|
|
687
1222
|
</VDatePicker>
|
|
688
1223
|
</VMenu>
|
|
689
1224
|
</template>
|
|
@@ -693,6 +1228,29 @@
|
|
|
693
1228
|
<style lang="scss" scoped>
|
|
694
1229
|
@use '@/assets/tokens';
|
|
695
1230
|
|
|
1231
|
+
/* Disable ripple effect on month and year buttons */
|
|
1232
|
+
:deep(.v-date-picker-controls__month-btn),
|
|
1233
|
+
:deep(.v-date-picker-controls__mode-btn) {
|
|
1234
|
+
.v-ripple__container,
|
|
1235
|
+
.v-ripple__animation {
|
|
1236
|
+
display: none !important;
|
|
1237
|
+
opacity: 0 !important;
|
|
1238
|
+
background-color: transparent !important;
|
|
1239
|
+
pointer-events: none !important;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/* Style pour les jours fériés */
|
|
1244
|
+
:deep(.holiday-day) {
|
|
1245
|
+
background-color: rgb(255 193 7 / 10%);
|
|
1246
|
+
border: 2px dotted tokens.$neutral-black;
|
|
1247
|
+
border-radius: 50%;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
:deep(.v-date-picker-controls .v-btn:last-child) {
|
|
1251
|
+
margin-inline-start: 0;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
696
1254
|
.label-hidden-on-focus:focus + label {
|
|
697
1255
|
display: none;
|
|
698
1256
|
}
|
|
@@ -763,7 +1321,7 @@
|
|
|
763
1321
|
}
|
|
764
1322
|
|
|
765
1323
|
.date-picker-container {
|
|
766
|
-
|
|
1324
|
+
width: 100%;
|
|
767
1325
|
position: relative;
|
|
768
1326
|
|
|
769
1327
|
:deep(.v-date-picker) {
|
|
@@ -783,13 +1341,20 @@
|
|
|
783
1341
|
opacity: 1;
|
|
784
1342
|
}
|
|
785
1343
|
|
|
786
|
-
.
|
|
787
|
-
|
|
788
|
-
|
|
1344
|
+
:deep(.weekend .v-date-picker-month__day--week-end .v-btn) {
|
|
1345
|
+
background-color: #afb1b1;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
/* div avant la class .v-date-picker-month__day--week-end */
|
|
1349
|
+
:deep(.weekend .v-date-picker-month__day:has(+ .v-date-picker-month__day--week-end) .v-btn) {
|
|
1350
|
+
background-color: #afb1b1;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
:deep(.v-date-picker-controls__mode-btn) {
|
|
1354
|
+
transform: none !important;
|
|
789
1355
|
}
|
|
790
1356
|
|
|
791
|
-
.
|
|
792
|
-
|
|
793
|
-
opacity: 0;
|
|
1357
|
+
:deep(.v-btn--variant-text .v-btn__overlay) {
|
|
1358
|
+
padding: 13px;
|
|
794
1359
|
}
|
|
795
1360
|
</style>
|