@cnamts/synapse 1.0.25 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AutocompleteFilter-D7qBuCAP.js → AutocompleteFilter-BPR-a55G.js} +1 -1
- package/dist/{DateFilter-BitMWrMU.js → DateFilter-CknrJWs2.js} +2 -2
- package/dist/{NumberFilter-BTLUxw0a.js → NumberFilter-DJ-yNlzv.js} +1 -1
- package/dist/{PeriodFilter-B5rUIPAC.js → PeriodFilter-CiB5Oa9Z.js} +1 -1
- package/dist/{SelectFilter-l4QnRcuk.js → SelectFilter-EiafX97M.js} +1 -1
- package/dist/{TextFilter-C9hj6Qrp.js → TextFilter-BzOmpdxj.js} +1 -1
- package/dist/{apLightTheme-DnIM24Lv.js → apLightTheme-DS0Uy44H.js} +20 -16
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +4 -2
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +60 -289
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +1 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1 -0
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +1 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +2 -4
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +50 -49
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +29 -28
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +8 -8
- package/dist/components/DatePicker/composables/useDatePickerState.d.ts +3 -3
- package/dist/components/DatePicker/composables/useDateTextField.d.ts +2 -2
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +2 -2
- package/dist/components/DatePicker/types.d.ts +1 -2
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +1 -0
- package/dist/components/MonthPicker/MonthPicker.d.ts +1 -1
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +1 -1
- package/dist/components/NirField/NirField.d.ts +8 -4
- package/dist/components/NirField/useNirValidation.d.ts +6 -2
- package/dist/components/PeriodField/PeriodField.d.ts +102 -102
- package/dist/components/PhoneField/PhoneField.d.ts +11 -1
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +0 -3
- package/dist/components/RatingPicker/EmotionPicker/EmotionPicker.d.ts +3 -1
- package/dist/components/RatingPicker/NumberPicker/NumberPicker.d.ts +4 -3
- package/dist/components/RatingPicker/RatingPicker.d.ts +18 -5
- package/dist/components/RatingPicker/StarsPicker/StarsPicker.d.ts +3 -1
- package/dist/components/RatingPicker/tests/RatingPicker.a11y.spect.d.ts +1 -0
- package/dist/components/RatingPicker/useRatingFocus.d.ts +18 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +4 -4
- package/dist/components/Tables/SyTable/SyTable.d.ts +4 -4
- package/dist/components/Tables/common/SyTablePagination.d.ts +152 -364
- package/dist/components/Tables/common/TableHeader.d.ts +1 -1
- package/dist/components/Tables/common/filters/DateFilter.d.ts +4 -4
- package/dist/composables/date/useDateInitializationDayjs.d.ts +3 -1
- package/dist/composables/unifyValidation/useCustomValidation.d.ts +3 -1
- package/dist/composables/unifyValidation/useValidation.d.ts +12 -6
- package/dist/composables/unifyValidation/useVuetifyValidation.d.ts +1 -1
- package/dist/composables/validation/useValidation.d.ts +1 -0
- package/dist/design-system-v3.js +2 -2
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +2 -0
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +2 -0
- package/dist/{main-Cpx8Co6H.js → main-BsJ9ec3i.js} +9103 -9018
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +1 -1
- package/package.json +8 -7
- package/src/assets/overrides/_icons.scss +0 -13
- package/src/assets/overrides/_otp.scss +0 -1
- package/src/components/Accordion/Accordion.vue +2 -0
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -1
- package/src/components/CookiesSelection/CookiesSelection.vue +2 -1
- package/src/components/CopyBtn/CopyBtn.vue +9 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +1 -1
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +413 -96
- package/src/components/Customs/Selects/SySelect/SySelect.vue +270 -225
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +245 -6
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +3 -3
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +23 -2
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +23 -5
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +5 -5
- package/src/components/Customs/SyTabs/config.ts +3 -3
- package/src/components/Customs/SyTextField/SyTextField.vue +31 -4
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +17 -14
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +8 -7
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +1 -1
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +57 -23
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +1 -1
- package/src/components/DatePicker/composables/useDatePickerState.ts +33 -14
- package/src/components/DatePicker/composables/useDateRangeInput.ts +2 -1
- package/src/components/DatePicker/composables/useDateSelection.ts +2 -1
- package/src/components/DatePicker/composables/useDateTextField.ts +2 -2
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +2 -2
- package/src/components/DatePicker/types.ts +1 -2
- package/src/components/DialogBox/DialogBox.stories.ts +8 -8
- package/src/components/DialogBox/accessibilite/Accessibility.mdx +86 -22
- package/src/components/FilterSideBar/FilterSideBar.vue +2 -1
- package/src/components/LangBtn/LangBtn.vue +2 -1
- package/src/components/NotificationBar/Notification/Notification.vue +2 -2
- package/src/components/PaginatedTable/PaginatedTable.vue +1 -1
- package/src/components/PaginatedTable/Pagination.vue +1 -1
- package/src/components/PasswordField/PasswordField.vue +7 -3
- package/src/components/PhoneField/PhoneField.vue +4 -2
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +11 -18
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +32 -48
- package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +5 -0
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +48 -53
- package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +2 -1
- package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +40 -13
- package/src/components/RatingPicker/RatingPicker.stories.ts +65 -88
- package/src/components/RatingPicker/RatingPicker.vue +71 -15
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +28 -37
- package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +1 -1
- package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +5 -0
- package/src/components/RatingPicker/accessibilite/Accessibility.mdx +137 -9
- package/src/components/RatingPicker/tests/RatingPicker.a11y.spect.ts +123 -0
- package/src/components/RatingPicker/tests/RatingPicker.spec.ts +3 -2
- package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +40 -11
- package/src/components/RatingPicker/useRatingFocus.ts +97 -0
- package/src/components/SyTextArea/SyTextArea.vue +32 -1
- package/src/components/Tables/SyServerTable/SyServerTable.vue +1 -1
- package/src/components/Tables/SyTable/SyTable.vue +1 -1
- package/src/components/Tables/common/SyTableFilter.vue +4 -4
- package/src/components/Tables/common/SyTablePagination.vue +1 -0
- package/src/components/Tables/common/TableHeader.vue +1 -1
- package/src/components/Tables/common/filters/DateFilter.vue +2 -2
- package/src/composables/date/tests/useDateFormatDayjs.spec.ts +81 -0
- package/src/composables/date/tests/{useDateInitialization.spec.ts → useDateInitializationDayjs.spec.ts} +39 -3
- package/src/composables/date/useDateInitializationDayjs.ts +4 -1
- package/src/composables/unifyValidation/documentationValidationProps.ts +7 -7
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +2 -1
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +22 -0
- package/src/composables/unifyValidation/useCustomValidation.ts +16 -4
- package/src/composables/unifyValidation/useValidation.ts +46 -15
- package/src/composables/unifyValidation/useVuetifyValidation.ts +2 -2
- package/src/composables/useFormFieldErrorHandling.ts +4 -1
- package/src/composables/validation/tests/useValidation.spec.ts +2 -2
- package/src/composables/validation/useValidation.ts +15 -3
- package/src/composantsVuetify/VCard/VCard.mdx +59 -0
- package/src/composantsVuetify/VCard/v-card.stories.ts +279 -0
- package/src/designTokens/tokens/amelipro/apColors2026.ts +1 -1
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +3 -0
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +3 -0
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +61 -91
- package/src/stories/Accessibilite/AuditDesignSystem.mdx +5 -8
- package/src/stories/Accessibilite/AuditEtContreAudit/Exemptions-derogations.mdx +1 -1
- package/src/stories/Accessibilite/AuditEtContreAudit/Introduction.mdx +11 -8
- package/src/stories/Accessibilite/AuditEtContreAudit/RGAA.mdx +6 -7
- package/src/stories/Accessibilite/Introduction.mdx +30 -30
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +168 -78
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +13 -6
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +66 -45
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +23 -49
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.stories.ts +6 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/Utilisation.mdx +7 -19
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +18 -20
- package/src/stories/Components/Components.stories.ts +52 -3
- package/dist/AutocompleteFilter-Df9i5mAl.cjs +0 -1
- package/dist/DateFilter-BJD6FMev.cjs +0 -1
- package/dist/NumberFilter-DGCzCXzI.cjs +0 -1
- package/dist/PeriodFilter-DO_ecTZW.cjs +0 -1
- package/dist/SelectFilter-CGwcKWLm.cjs +0 -1
- package/dist/TextFilter-B8nf7xoK.cjs +0 -1
- package/dist/apLightTheme-CEK4iY3f.cjs +0 -1
- package/dist/composables/date/useDateFormat.d.ts +0 -26
- package/dist/composables/date/useDateInitialization.d.ts +0 -18
- package/dist/design-system-v3.umd.cjs +0 -1
- package/dist/main-ByDPHpae.cjs +0 -1067
- package/dist/tooth-11-D3sLWv2n.cjs +0 -1
- package/dist/tooth-12-CXrLuH03.cjs +0 -1
- package/dist/tooth-13-BSfo5fpT.cjs +0 -1
- package/dist/tooth-14-DMzulx0h.cjs +0 -1
- package/dist/tooth-15-BKRFVi-9.cjs +0 -1
- package/dist/tooth-16-CpuxAbuM.cjs +0 -1
- package/dist/tooth-17-BPoahUdg.cjs +0 -1
- package/dist/tooth-18-DhHJz8sy.cjs +0 -1
- package/dist/tooth-21-Dgd5hn_X.cjs +0 -1
- package/dist/tooth-22-C2Tn19sB.cjs +0 -1
- package/dist/tooth-23-C9uaaSGb.cjs +0 -1
- package/dist/tooth-24-BrK9UGpf.cjs +0 -1
- package/dist/tooth-25-CE_EfGNp.cjs +0 -1
- package/dist/tooth-26-Ctv4i9Fy.cjs +0 -1
- package/dist/tooth-27-C5J7JkWM.cjs +0 -1
- package/dist/tooth-28-Z9oWqjo0.cjs +0 -1
- package/dist/tooth-31-BrYqmkTi.cjs +0 -1
- package/dist/tooth-32-BNNR0oCZ.cjs +0 -1
- package/dist/tooth-33-DuxvqO2J.cjs +0 -1
- package/dist/tooth-34-BCSCXMB6.cjs +0 -1
- package/dist/tooth-35-BLUXkX88.cjs +0 -1
- package/dist/tooth-36-IrKHYqlA.cjs +0 -1
- package/dist/tooth-37-BYqpdMwo.cjs +0 -1
- package/dist/tooth-38-B_eNXXdu.cjs +0 -1
- package/dist/tooth-41-Ddva4Ot8.cjs +0 -1
- package/dist/tooth-42-szcDqlM0.cjs +0 -1
- package/dist/tooth-43-B3ka6rQm.cjs +0 -1
- package/dist/tooth-44-CazyQucj.cjs +0 -1
- package/dist/tooth-45-B4HQtc8n.cjs +0 -1
- package/dist/tooth-46-BPM40gbG.cjs +0 -1
- package/dist/tooth-47-Dvr20dlh.cjs +0 -1
- package/dist/tooth-48-Bd8ljGsF.cjs +0 -1
- package/dist/tooth-51-OBpwCOF3.cjs +0 -1
- package/dist/tooth-52-aKxyHcmq.cjs +0 -1
- package/dist/tooth-53-vCwJjTOc.cjs +0 -1
- package/dist/tooth-54-DsWu2iFy.cjs +0 -1
- package/dist/tooth-55-BxC1X2Dn.cjs +0 -1
- package/dist/tooth-61-BbLvxMQi.cjs +0 -1
- package/dist/tooth-62-CmTkWczP.cjs +0 -1
- package/dist/tooth-63-DI7l_2qI.cjs +0 -1
- package/dist/tooth-64-B21sOsJh.cjs +0 -1
- package/dist/tooth-65-D2ZC2VEr.cjs +0 -1
- package/dist/tooth-71-D473PPO5.cjs +0 -1
- package/dist/tooth-72-Drh1wnNu.cjs +0 -1
- package/dist/tooth-73-DzlwYI23.cjs +0 -1
- package/dist/tooth-74-8aGvcZPg.cjs +0 -1
- package/dist/tooth-75-BFK7At_r.cjs +0 -1
- package/dist/tooth-81-BZmR-I0M.cjs +0 -1
- package/dist/tooth-82-euVfUUZV.cjs +0 -1
- package/dist/tooth-83-KV010j64.cjs +0 -1
- package/dist/tooth-84-BBg1RjhZ.cjs +0 -1
- package/dist/tooth-85-Cr-kc1wM.cjs +0 -1
- package/dist/vuetifyConfig.umd.cjs +0 -1
- package/src/composables/date/tests/useDateFormat.spec.ts +0 -67
- package/src/composables/date/useDateFormat.ts +0 -110
- package/src/composables/date/useDateInitialization.ts +0 -92
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { useValidation, type ValidationResult, type ValidationRule } from '@/composables/validation/useValidation'
|
|
8
8
|
import { useValidatable } from '@/composables/validation/useValidatable'
|
|
9
9
|
import { useDateFormat } from '@/composables/date/useDateFormatDayjs'
|
|
10
|
-
import { useDateInitialization, type
|
|
10
|
+
import { useDateInitialization, type DateModelValue, type DateInput } from '@/composables/date/useDateInitializationDayjs'
|
|
11
11
|
import { useDatePickerAccessibility } from '@/composables/date/useDatePickerAccessibility'
|
|
12
12
|
import { useWeekendDays, useTodayButton, useDatePickerViewMode, useDateSelection, useMonthButtonCustomization, useDisplayedDateString, useAsteriskDisplay, useDateValidation, useDatePickerState, useHolidayHighlighting, useCalendarKeyboardNavigation, useDatePickerFocusTrap } from '../composables'
|
|
13
13
|
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
const props = withDefaults(defineProps<{
|
|
41
41
|
autoClamp?: boolean
|
|
42
42
|
bgColor?: string
|
|
43
|
-
|
|
43
|
+
/** @deprecated Utilisez isBirthDate à la place */
|
|
44
|
+
birthDate?: boolean
|
|
44
45
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
46
|
customRules?: { type: string, options: any }[]
|
|
46
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -241,12 +242,12 @@
|
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
const emit = defineEmits<{
|
|
244
|
-
(e: 'update:modelValue', value:
|
|
245
|
+
(e: 'update:modelValue', value: DateModelValue): void
|
|
245
246
|
(e: 'closed'): void
|
|
246
247
|
(e: 'focus'): void
|
|
247
248
|
(e: 'blur'): void
|
|
248
|
-
(e: 'input', value:
|
|
249
|
-
(e: 'date-selected', value:
|
|
249
|
+
(e: 'input', value: DateModelValue): void
|
|
250
|
+
(e: 'date-selected', value: DateModelValue): void
|
|
250
251
|
}>()
|
|
251
252
|
|
|
252
253
|
const validation = useValidation({
|
|
@@ -309,7 +310,8 @@
|
|
|
309
310
|
|
|
310
311
|
const errorMessages = errors
|
|
311
312
|
const warningMessages = warnings
|
|
312
|
-
const successMessages =
|
|
313
|
+
const successMessages = validation.displaySuccesses
|
|
314
|
+
const isOnSuccess = computed(() => successes.value.length > 0 && errors.value.length === 0 && warnings.value.length === 0)
|
|
313
315
|
|
|
314
316
|
// Variable pour éviter les mises à jour récursives
|
|
315
317
|
const isUpdatingFromInternal = ref(false)
|
|
@@ -392,7 +394,7 @@
|
|
|
392
394
|
}
|
|
393
395
|
|
|
394
396
|
// Fonction centralisée pour mettre à jour le modèle
|
|
395
|
-
const updateModel = async (value:
|
|
397
|
+
const updateModel = async (value: DateModelValue) => {
|
|
396
398
|
// Éviter les mises à jour inutiles
|
|
397
399
|
if (JSON.stringify(value) === JSON.stringify(props.modelValue)) return
|
|
398
400
|
|
|
@@ -434,7 +436,7 @@
|
|
|
434
436
|
if (Array.isArray(newValue) && props.displayRange && newValue.length >= 2 && props.noCalendar) {
|
|
435
437
|
// Cas spécifique noCalendar + displayRange : conserver la chaîne de plage complète
|
|
436
438
|
const start = newValue[0]
|
|
437
|
-
const end = newValue[1]
|
|
439
|
+
const end = newValue[newValue.length - 1]
|
|
438
440
|
if (start && end) {
|
|
439
441
|
textInputValue.value = `${formatDate(start, props.format)} - ${formatDate(end, props.format)}`
|
|
440
442
|
}
|
|
@@ -465,7 +467,7 @@
|
|
|
465
467
|
})
|
|
466
468
|
|
|
467
469
|
// Utilisation du composable pour gérer la sélection de dates
|
|
468
|
-
const { updateSelectedDates, rangeBoundaryDates, resetRange } = useDateSelection(
|
|
470
|
+
const { updateSelectedDates, rangeBoundaryDates, generateDateRange, resetRange } = useDateSelection(
|
|
469
471
|
parseDate,
|
|
470
472
|
selectedDates,
|
|
471
473
|
props.format,
|
|
@@ -490,10 +492,11 @@
|
|
|
490
492
|
initializeSelectedDates,
|
|
491
493
|
validateDates,
|
|
492
494
|
updateModel,
|
|
495
|
+
generateDateRange,
|
|
493
496
|
})
|
|
494
497
|
|
|
495
498
|
// Gestionnaire pour les mises à jour du DateTextInput en mode no-calendar
|
|
496
|
-
const handleDateTextInputUpdate = async (value:
|
|
499
|
+
const handleDateTextInputUpdate = async (value: DateModelValue) => {
|
|
497
500
|
if (isUpdatingFromInternal.value) return
|
|
498
501
|
|
|
499
502
|
try {
|
|
@@ -514,7 +517,7 @@
|
|
|
514
517
|
const endDate = parseDate(endDateStr, props.dateFormatReturn || props.format)
|
|
515
518
|
|
|
516
519
|
if (startDate && endDate) {
|
|
517
|
-
selectedDates.value =
|
|
520
|
+
selectedDates.value = generateDateRange(startDate, endDate)
|
|
518
521
|
displayFormattedDate.value = `${formatDate(startDate, props.format)} - ${formatDate(endDate, props.format)}`
|
|
519
522
|
}
|
|
520
523
|
}
|
|
@@ -535,7 +538,7 @@
|
|
|
535
538
|
}
|
|
536
539
|
|
|
537
540
|
// Gestionnaire pour les événements date-selected du DateTextInput
|
|
538
|
-
const handleDateTextInputSelection = async (value:
|
|
541
|
+
const handleDateTextInputSelection = async (value: DateModelValue) => {
|
|
539
542
|
if (isUpdatingFromInternal.value) return
|
|
540
543
|
|
|
541
544
|
// Mettre à jour le modèle avec la valeur sélectionnée
|
|
@@ -774,7 +777,6 @@
|
|
|
774
777
|
|
|
775
778
|
// Utilisation du composable pour gérer le mode d'affichage du CalendarMode
|
|
776
779
|
const { currentViewMode, handleViewModeUpdate, handleYearUpdate, handleMonthUpdate, resetViewMode } = useDatePickerViewMode(
|
|
777
|
-
// Fonction qui retourne la valeur actuelle de isBirthDate (combinaison de isBirthDate et birthDate)
|
|
778
780
|
() => props.isBirthDate || props.birthDate,
|
|
779
781
|
// Fonction qui retourne l'état de la date sélectionnée
|
|
780
782
|
() => selectedDates.value,
|
|
@@ -1061,7 +1063,8 @@
|
|
|
1061
1063
|
:class="[getMessageClasses(), 'label-hidden-on-focus']"
|
|
1062
1064
|
:error-messages="errorMessages"
|
|
1063
1065
|
:warning-messages="warningMessages"
|
|
1064
|
-
:success-messages="
|
|
1066
|
+
:success-messages="successMessages"
|
|
1067
|
+
:has-success="isOnSuccess"
|
|
1065
1068
|
:disabled="props.disabled"
|
|
1066
1069
|
:disable-click-button="false"
|
|
1067
1070
|
:readonly="true"
|
|
@@ -309,7 +309,7 @@ const meta = {
|
|
|
309
309
|
},
|
|
310
310
|
'birthDate': {
|
|
311
311
|
control: 'boolean',
|
|
312
|
-
description: '
|
|
312
|
+
description: '⚠️ **DEPRECATED** — Utilisez `isBirthDate` à la place.',
|
|
313
313
|
defaultValue: false,
|
|
314
314
|
},
|
|
315
315
|
'useCombinedMode': {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import {
|
|
13
13
|
useDateInitialization,
|
|
14
14
|
type DateInput,
|
|
15
|
-
type
|
|
15
|
+
type DateModelValue,
|
|
16
16
|
} from '@/composables/date/useDateInitializationDayjs'
|
|
17
17
|
import {
|
|
18
18
|
useAsteriskDisplay,
|
|
@@ -130,6 +130,7 @@
|
|
|
130
130
|
defineProps<{
|
|
131
131
|
autoClamp?: boolean
|
|
132
132
|
bgColor?: string
|
|
133
|
+
/** @deprecated Utilisez isBirthDate à la place */
|
|
133
134
|
birthDate?: boolean
|
|
134
135
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- sorry
|
|
135
136
|
customRules?: { type: string, options: any }[]
|
|
@@ -212,12 +213,12 @@
|
|
|
212
213
|
)
|
|
213
214
|
|
|
214
215
|
const emit = defineEmits<{
|
|
215
|
-
(e: 'update:modelValue', value:
|
|
216
|
+
(e: 'update:modelValue', value: DateModelValue): void
|
|
216
217
|
(e: 'closed'): void
|
|
217
218
|
(e: 'focus'): void
|
|
218
219
|
(e: 'blur'): void
|
|
219
220
|
(e: 'input', value: string): void
|
|
220
|
-
(e: 'date-selected', value:
|
|
221
|
+
(e: 'date-selected', value: DateModelValue): void
|
|
221
222
|
}>()
|
|
222
223
|
|
|
223
224
|
/**
|
|
@@ -313,14 +314,14 @@
|
|
|
313
314
|
emitFocus: () => emit('focus'),
|
|
314
315
|
})
|
|
315
316
|
|
|
316
|
-
const updateModel = (value:
|
|
317
|
+
const updateModel = (value: DateModelValue) => {
|
|
317
318
|
// Prevent redundant emits
|
|
318
319
|
if (JSON.stringify(value) === JSON.stringify(props.modelValue)) return
|
|
319
320
|
withInternalUpdate(() => emit('update:modelValue', value))
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
// Keep and expose this so consumers can listen to `date-selected`
|
|
323
|
-
const handleDateSelected = (value:
|
|
324
|
+
const handleDateSelected = (value: DateModelValue) => {
|
|
324
325
|
if (props.readonly) return
|
|
325
326
|
|
|
326
327
|
// 1) Update v-model
|
|
@@ -709,7 +710,7 @@
|
|
|
709
710
|
validateField: (value, rules, warningRules) =>
|
|
710
711
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- sorry
|
|
711
712
|
validateField(value, rules as any[], warningRules as any[]),
|
|
712
|
-
updateModel: value => updateModel(value as
|
|
713
|
+
updateModel: value => updateModel(value as DateModelValue),
|
|
713
714
|
emitInput: value => emit('input', value),
|
|
714
715
|
inputRef: dateCalendarTextInputRef as Ref<ComponentPublicInstance | null>,
|
|
715
716
|
})
|
|
@@ -848,7 +849,7 @@
|
|
|
848
849
|
/**
|
|
849
850
|
* Gère les mises à jour de DateTextInput avec contrôle
|
|
850
851
|
*/
|
|
851
|
-
const handleDateTextInputUpdate = (value:
|
|
852
|
+
const handleDateTextInputUpdate = (value: DateModelValue) => {
|
|
852
853
|
// Ne pas traiter les mises à jour internes pour éviter les boucles
|
|
853
854
|
if (isUpdatingFromInternal.value) return
|
|
854
855
|
|
|
@@ -157,7 +157,7 @@ describe('ComplexDatePicker.clean', () => {
|
|
|
157
157
|
expect(wrapper.vm.selectedDates).not.toBeNull()
|
|
158
158
|
|
|
159
159
|
const input = wrapper.find('input')
|
|
160
|
-
expect((input.element as HTMLInputElement).value).toBe('01/01/2025 - ')
|
|
160
|
+
expect((input.element as HTMLInputElement).value).toBe('01/01/2025 - 10/01/2025')
|
|
161
161
|
})
|
|
162
162
|
|
|
163
163
|
it('generates all intermediate dates when selecting a range in range mode', async () => {
|
package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts
CHANGED
|
@@ -76,7 +76,7 @@ ValidationExamples.parameters = {
|
|
|
76
76
|
<script setup>
|
|
77
77
|
import { computed, ref, watch } from 'vue';vue'
|
|
78
78
|
import DatePicker from '@/components/DatePicker/CalendarMode/DatePicker.vue'
|
|
79
|
-
import { useDateFormat } from '@/composables/date/
|
|
79
|
+
import { useDateFormat } from '@/composables/date/useDateFormatDayjs'
|
|
80
80
|
|
|
81
81
|
// Exemple 1: Validation de base (required)
|
|
82
82
|
const date1 = ref('')
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { useValidatable } from '@/composables/validation/useValidatable'
|
|
17
17
|
import { useDateFormat } from '@/composables/date/useDateFormatDayjs'
|
|
18
18
|
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
19
|
-
import type {
|
|
19
|
+
import type { DateModelValue } from '@/composables/date/useDateInitializationDayjs'
|
|
20
20
|
import type { DateObjectValue } from '../types'
|
|
21
21
|
|
|
22
22
|
dayjs.extend(customParseFormat)
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
isOutlined?: boolean
|
|
41
41
|
isValidateOnBlur?: boolean
|
|
42
42
|
label: string
|
|
43
|
-
modelValue?:
|
|
43
|
+
modelValue?: DateModelValue
|
|
44
44
|
noIcon?: boolean
|
|
45
45
|
persistentHint?: boolean
|
|
46
46
|
placeholder?: string
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
})
|
|
78
78
|
|
|
79
79
|
const emit = defineEmits<{
|
|
80
|
-
(e: 'update:model-value', value:
|
|
80
|
+
(e: 'update:model-value', value: DateModelValue): void
|
|
81
81
|
(e: 'focus'): void
|
|
82
82
|
(e: 'blur'): void
|
|
83
83
|
(e: 'input', value: string): void
|
|
84
|
-
(e: 'date-selected', value:
|
|
84
|
+
(e: 'date-selected', value: DateModelValue): void
|
|
85
85
|
}>()
|
|
86
86
|
|
|
87
87
|
/**
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
errors: ref<string[]>([]),
|
|
112
112
|
warnings: ref<string[]>([]),
|
|
113
113
|
successes: ref<string[]>([]),
|
|
114
|
+
displaySuccesses: computed(() => []),
|
|
114
115
|
hasError: ref(false),
|
|
115
116
|
clearValidation: () => {},
|
|
116
117
|
validateField: () => ({
|
|
@@ -153,7 +154,8 @@
|
|
|
153
154
|
// Agrégation des erreurs internes et externes
|
|
154
155
|
const errorMessages = computed(() => [...errors.value, ...props.externalErrorMessages])
|
|
155
156
|
const warningMessages = warnings
|
|
156
|
-
const
|
|
157
|
+
const displaySuccesses = computed(() => (validationApi.value as typeof baseValidation).displaySuccesses?.value ?? [])
|
|
158
|
+
const successMessages = displaySuccesses
|
|
157
159
|
|
|
158
160
|
/**
|
|
159
161
|
* Safe validate utility
|
|
@@ -576,7 +578,7 @@
|
|
|
576
578
|
return formatDate(date, returnFormat.value)
|
|
577
579
|
}
|
|
578
580
|
|
|
579
|
-
function emitModel(val:
|
|
581
|
+
function emitModel(val: DateModelValue) {
|
|
580
582
|
emit('update:model-value', val)
|
|
581
583
|
}
|
|
582
584
|
|
|
@@ -688,12 +690,31 @@
|
|
|
688
690
|
|
|
689
691
|
if (formatValidationResult.isValid && !customRulesValidationResult.hasError && !isRange.value) {
|
|
690
692
|
const parsedDate = dayjs(inputValue.value, displayFormat.value, true).toDate()
|
|
693
|
+
// Guard isFormatting to prevent the modelValue watcher from
|
|
694
|
+
// rewriting inputValue in reaction to our own emit.
|
|
695
|
+
isFormatting.value = true
|
|
691
696
|
emitModel(returnFormat.value !== displayFormat.value ? dayjs(parsedDate).format(returnFormat.value) : inputValue.value)
|
|
692
697
|
}
|
|
693
698
|
else if (formatValidationResult.isValid && !customRulesValidationResult.hasError && isRange.value) {
|
|
694
699
|
if (typeof inputValue.value === 'string' && inputValue.value.includes(' - ')) {
|
|
695
700
|
const dateRangeParts = inputValue.value.split(' - ')
|
|
696
|
-
if (dateRangeParts.length === 2)
|
|
701
|
+
if (dateRangeParts.length === 2) {
|
|
702
|
+
const sd = dayjs(dateRangeParts[0]!, displayFormat.value, true)
|
|
703
|
+
const ed = dayjs(dateRangeParts[1]!, displayFormat.value, true)
|
|
704
|
+
// Guard isFormatting to prevent the modelValue watcher from
|
|
705
|
+
// rewriting inputValue in reaction to our own emit.
|
|
706
|
+
isFormatting.value = true
|
|
707
|
+
if (sd.isValid() && ed.isValid()) {
|
|
708
|
+
const emittedRange: [string, string] = [
|
|
709
|
+
returnFormat.value !== displayFormat.value ? sd.format(returnFormat.value) : dateRangeParts[0]!,
|
|
710
|
+
returnFormat.value !== displayFormat.value ? ed.format(returnFormat.value) : dateRangeParts[1]!,
|
|
711
|
+
]
|
|
712
|
+
emitModel(emittedRange)
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
emitModel([dateRangeParts[0]!, dateRangeParts[1]!])
|
|
716
|
+
}
|
|
717
|
+
}
|
|
697
718
|
else emitModel(inputValue.value)
|
|
698
719
|
}
|
|
699
720
|
else emitModel(inputValue.value)
|
|
@@ -701,29 +722,40 @@
|
|
|
701
722
|
else {
|
|
702
723
|
runRules(inputValue.value)
|
|
703
724
|
if (!props.disableErrorHandling && formatValidationResult.message) errors.value.push(formatValidationResult.message)
|
|
704
|
-
//
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
// For custom rule errors with valid format, keep the current value
|
|
725
|
+
// Keep the invalid input visible so the user can correct it.
|
|
726
|
+
// Do NOT emit null — that would trigger the modelValue watcher
|
|
727
|
+
// which clears inputValue and hides the error message.
|
|
728
|
+
return
|
|
709
729
|
}
|
|
710
730
|
}
|
|
711
731
|
|
|
712
732
|
// autoClamp au blur
|
|
713
|
-
if (props.autoClamp)
|
|
733
|
+
if (props.autoClamp) {
|
|
734
|
+
const clamped = clampIfNeeded(inputValue.value)
|
|
735
|
+
if (clamped !== inputValue.value) {
|
|
736
|
+
inputValue.value = clamped
|
|
714
737
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
738
|
+
// Sync model après clamp uniquement si la valeur a changé
|
|
739
|
+
isFormatting.value = true
|
|
740
|
+
if (isRange.value) {
|
|
741
|
+
const [startDate, endDate] = parseRangeInput(inputValue.value)
|
|
742
|
+
if (startDate && endDate) emitModel([toReturnFormat(startDate), toReturnFormat(endDate)])
|
|
743
|
+
else if (startDate) emit('date-selected', toReturnFormat(startDate))
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
const parsedDate = parseDate(inputValue.value, displayFormat.value)
|
|
747
|
+
if (parsedDate) emitModel(returnFormat.value !== displayFormat.value ? toReturnFormat(parsedDate) : formatDate(parsedDate, displayFormat.value))
|
|
748
|
+
}
|
|
749
|
+
}
|
|
724
750
|
}
|
|
725
751
|
|
|
726
752
|
runRules(inputValue.value)
|
|
753
|
+
|
|
754
|
+
// Release isFormatting after the current microtask so that
|
|
755
|
+
// the modelValue watcher (triggered synchronously by emitModel)
|
|
756
|
+
// stays blocked, but future external changes are allowed.
|
|
757
|
+
await nextTick()
|
|
758
|
+
isFormatting.value = false
|
|
727
759
|
}
|
|
728
760
|
|
|
729
761
|
/**
|
|
@@ -1092,7 +1124,9 @@
|
|
|
1092
1124
|
:readonly="props.readonly"
|
|
1093
1125
|
:variant-style="props.isOutlined ? 'outlined' : 'underlined'"
|
|
1094
1126
|
:warning-messages="warningMessages"
|
|
1095
|
-
:success-messages="
|
|
1127
|
+
:success-messages="successMessages"
|
|
1128
|
+
:has-success="isOnSuccess"
|
|
1129
|
+
:show-success-messages="props.showSuccessMessages"
|
|
1096
1130
|
:bg-color="props.bgColor"
|
|
1097
1131
|
color="primary"
|
|
1098
1132
|
:is-clearable="!props.readonly"
|
|
@@ -196,7 +196,7 @@ const meta = {
|
|
|
196
196
|
},
|
|
197
197
|
'birthDate': {
|
|
198
198
|
control: 'boolean',
|
|
199
|
-
description: '
|
|
199
|
+
description: '⚠️ **DEPRECATED** — Utilisez `isBirthDate` à la place.',
|
|
200
200
|
defaultValue: false,
|
|
201
201
|
},
|
|
202
202
|
'isBirthDate': {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed, ref, watch, type Ref, type ComputedRef } from 'vue'
|
|
2
|
-
import type { DateInput,
|
|
2
|
+
import type { DateInput, DateModelValue } from '@/composables/date/useDateInitializationDayjs'
|
|
3
|
+
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
3
4
|
|
|
4
5
|
export interface UseDatePickerStateOptions {
|
|
5
6
|
selectedDates: Ref<Date | (Date | null)[] | null>
|
|
@@ -11,7 +12,7 @@ export interface UseDatePickerStateOptions {
|
|
|
11
12
|
formatDate: (date: Date | null, format: string) => string
|
|
12
13
|
initializeSelectedDates: (value: DateInput | null, format: string, dateFormatReturn?: string) => Date | (Date | null)[] | null
|
|
13
14
|
validateDates: (forceValidation?: boolean) => void
|
|
14
|
-
updateModel: (value:
|
|
15
|
+
updateModel: (value: DateModelValue) => void
|
|
15
16
|
generateDateRange?: (start: Date, end: Date) => Date[]
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -20,7 +21,7 @@ export interface UseDatePickerStateResult {
|
|
|
20
21
|
rangeBoundaryDates?: Ref<[Date | null, Date | null] | null>
|
|
21
22
|
textInputValue: Ref<string>
|
|
22
23
|
displayFormattedDate: Ref<string>
|
|
23
|
-
formattedDate: Ref<
|
|
24
|
+
formattedDate: Ref<DateModelValue>
|
|
24
25
|
displayFormattedFromSelectedDates: ComputedRef<string | null>
|
|
25
26
|
syncFromModelValue: (newValue: DateInput | undefined) => void
|
|
26
27
|
syncTextInputFromSelection: () => void
|
|
@@ -44,7 +45,7 @@ export const useDatePickerState = (options: UseDatePickerStateOptions): UseDateP
|
|
|
44
45
|
const textInputValue = ref('')
|
|
45
46
|
const displayFormattedDate = ref('')
|
|
46
47
|
|
|
47
|
-
const formattedDate = computed<
|
|
48
|
+
const formattedDate = computed<DateModelValue>(() => {
|
|
48
49
|
if (!selectedDates.value) return ''
|
|
49
50
|
const rf = dateFormatReturn || format
|
|
50
51
|
|
|
@@ -73,7 +74,7 @@ export const useDatePickerState = (options: UseDatePickerStateOptions): UseDateP
|
|
|
73
74
|
|
|
74
75
|
if (Array.isArray(selectedDates.value)) {
|
|
75
76
|
if (selectedDates.value.length >= 2) {
|
|
76
|
-
return `${formatDate(selectedDates.value[0]!, format)}
|
|
77
|
+
return `${formatDate(selectedDates.value[0]!, format)}${DATE_PICKER_MESSAGES.RANGE_SEPARATOR}${formatDate(
|
|
77
78
|
selectedDates.value[selectedDates.value.length - 1]!,
|
|
78
79
|
format,
|
|
79
80
|
)}`
|
|
@@ -91,7 +92,17 @@ export const useDatePickerState = (options: UseDatePickerStateOptions): UseDateP
|
|
|
91
92
|
textInputValue.value = ''
|
|
92
93
|
return
|
|
93
94
|
}
|
|
94
|
-
if (
|
|
95
|
+
if (Array.isArray(newValue) && newValue.length === 2) {
|
|
96
|
+
// Mode plage : afficher "startDate - endDate" dans l'input
|
|
97
|
+
const startStr = dateFormatReturn
|
|
98
|
+
? formatDate(parseDate(newValue[0]!, dateFormatReturn), format)
|
|
99
|
+
: newValue[0]!
|
|
100
|
+
const endStr = dateFormatReturn
|
|
101
|
+
? formatDate(parseDate(newValue[1]!, dateFormatReturn), format)
|
|
102
|
+
: newValue[1]!
|
|
103
|
+
textInputValue.value = `${startStr}${DATE_PICKER_MESSAGES.RANGE_SEPARATOR}${endStr}`
|
|
104
|
+
}
|
|
105
|
+
else if (typeof newValue === 'string') {
|
|
95
106
|
if (dateFormatReturn) {
|
|
96
107
|
const date = parseDate(newValue, dateFormatReturn)
|
|
97
108
|
if (date) {
|
|
@@ -128,16 +139,24 @@ export const useDatePickerState = (options: UseDatePickerStateOptions): UseDateP
|
|
|
128
139
|
}
|
|
129
140
|
|
|
130
141
|
if (selectedDates.value) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
142
|
+
if (displayRange && Array.isArray(selectedDates.value) && selectedDates.value.length >= 2) {
|
|
143
|
+
const startDate = selectedDates.value[0]
|
|
144
|
+
const endDate = selectedDates.value[selectedDates.value.length - 1]
|
|
145
|
+
if (startDate && endDate) {
|
|
146
|
+
textInputValue.value = `${formatDate(startDate, format)}${DATE_PICKER_MESSAGES.RANGE_SEPARATOR}${formatDate(endDate, format)}`
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
const firstDate = Array.isArray(selectedDates.value)
|
|
151
|
+
? selectedDates.value[0]
|
|
152
|
+
: selectedDates.value
|
|
153
|
+
if (firstDate) {
|
|
154
|
+
textInputValue.value = formatDate(firstDate, format)
|
|
155
|
+
}
|
|
137
156
|
}
|
|
138
157
|
if (Array.isArray(formattedDate.value)) {
|
|
139
158
|
// Pour les plages, formater avec le séparateur standard " - "
|
|
140
|
-
displayFormattedDate.value = formattedDate.value.join(
|
|
159
|
+
displayFormattedDate.value = formattedDate.value.join(DATE_PICKER_MESSAGES.RANGE_SEPARATOR)
|
|
141
160
|
}
|
|
142
161
|
else {
|
|
143
162
|
displayFormattedDate.value = (formattedDate.value as string) || ''
|
|
@@ -157,7 +176,7 @@ export const useDatePickerState = (options: UseDatePickerStateOptions): UseDateP
|
|
|
157
176
|
const startDate = value[0]
|
|
158
177
|
const endDate = value[value.length - 1]
|
|
159
178
|
if (startDate && endDate) {
|
|
160
|
-
const formattedForInput = `${formatDate(startDate, format)}
|
|
179
|
+
const formattedForInput = `${formatDate(startDate, format)}${DATE_PICKER_MESSAGES.RANGE_SEPARATOR}${formatDate(endDate, format)}`
|
|
161
180
|
if (textInputValue.value !== formattedForInput) {
|
|
162
181
|
textInputValue.value = formattedForInput
|
|
163
182
|
}
|
|
@@ -2,6 +2,7 @@ import { ref, computed } from 'vue'
|
|
|
2
2
|
import dayjs from 'dayjs'
|
|
3
3
|
import customParseFormat from 'dayjs/plugin/customParseFormat'
|
|
4
4
|
import { extractRangeParts as extractRangePartsUtil, hasRangeSeparator as hasRangeSeparatorUtil, isValidDateRange } from '../utils/dateFormattingUtils'
|
|
5
|
+
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
5
6
|
|
|
6
7
|
// Initialiser les plugins dayjs
|
|
7
8
|
dayjs.extend(customParseFormat)
|
|
@@ -23,7 +24,7 @@ export function useDateRangeInput(
|
|
|
23
24
|
// Stockage temporaire pour la deuxième date saisie
|
|
24
25
|
const secondDate = ref<Date | null>(null)
|
|
25
26
|
// Séparateur de plage
|
|
26
|
-
const rangeSeparator =
|
|
27
|
+
const rangeSeparator = DATE_PICKER_MESSAGES.RANGE_SEPARATOR
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Vérifie si une chaîne de caractères contient un séparateur de plage
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ref } from 'vue'
|
|
2
2
|
import type { Ref } from 'vue'
|
|
3
|
+
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Composable pour gérer la sélection de dates dans les composants CalendarMode
|
|
@@ -101,7 +102,7 @@ export function useDateSelection(
|
|
|
101
102
|
}
|
|
102
103
|
else if (typeof input === 'string') {
|
|
103
104
|
// Mode plage de dates
|
|
104
|
-
const dates = input.split(
|
|
105
|
+
const dates = input.split(DATE_PICKER_MESSAGES.RANGE_SEPARATOR)
|
|
105
106
|
if (dates.length === 2) {
|
|
106
107
|
const startDate = parseDate(dates[0]!, format)
|
|
107
108
|
const endDate = parseDate(dates[1]!, format)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
2
|
import type { ValidationResult } from '@/composables/validation/useValidation'
|
|
3
|
-
import type {
|
|
3
|
+
import type { DateModelValue } from '@/composables/date/useDateInitializationDayjs'
|
|
4
4
|
import { useManualDateValidation } from './useManualDateValidation'
|
|
5
5
|
|
|
6
6
|
export interface UseDateTextFieldManualValidationOptions {
|
|
@@ -37,7 +37,7 @@ export interface UseDateTextFieldResetOptions {
|
|
|
37
37
|
inputValue: Ref<string>
|
|
38
38
|
selectedDates: Ref<unknown>
|
|
39
39
|
resetState: () => void
|
|
40
|
-
emitModel: (value:
|
|
40
|
+
emitModel: (value: DateModelValue) => void
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export interface UseDateTextFieldOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Ref, ref } from 'vue'
|
|
2
|
-
import { type
|
|
2
|
+
import { type DateModelValue } from '@/composables/date/useDateInitializationDayjs'
|
|
3
3
|
import { type DateObjectValue } from '../types'
|
|
4
4
|
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
5
5
|
|
|
@@ -27,7 +27,7 @@ export const useInputBlurHandler = (options: {
|
|
|
27
27
|
validateDateFormat: (dateStr: string) => { isValid: boolean, message: string }
|
|
28
28
|
parseDate: (dateStr: string, format: string) => Date | null
|
|
29
29
|
formatDate: (date: Date, format: string) => string
|
|
30
|
-
updateModel: (value:
|
|
30
|
+
updateModel: (value: DateModelValue) => void
|
|
31
31
|
validateManualInput: (value: string) => boolean | Promise<boolean>
|
|
32
32
|
|
|
33
33
|
// Émetteurs d'événements
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
export type DateObjectValue = Date | (Date | null)[] | null
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @deprecated Utilisez DateObjectValue pour les objets Date ou importez DateValue depuis useDateInitializationDayjs pour les chaînes
|
|
12
|
+
* @deprecated Utilisez DateObjectValue pour les objets Date ou importez DateModelValue depuis useDateInitializationDayjs pour les chaînes
|
|
14
13
|
*/
|
|
15
14
|
export type DateValue = DateObjectValue
|
|
@@ -730,7 +730,7 @@ export const VuetifyOptions: Story = {
|
|
|
730
730
|
rounded: 'xl',
|
|
731
731
|
},
|
|
732
732
|
cardTitle: {
|
|
733
|
-
class: 'pa-5 mb-4
|
|
733
|
+
class: 'pa-5 mb-4 secondary--text',
|
|
734
734
|
},
|
|
735
735
|
closeBtn: {
|
|
736
736
|
class: {
|
|
@@ -738,14 +738,14 @@ export const VuetifyOptions: Story = {
|
|
|
738
738
|
},
|
|
739
739
|
},
|
|
740
740
|
icon: {
|
|
741
|
-
color: '
|
|
741
|
+
color: 'secondary',
|
|
742
742
|
},
|
|
743
743
|
cancelBtn: {
|
|
744
|
-
color: '
|
|
744
|
+
color: 'secondary',
|
|
745
745
|
text: false,
|
|
746
746
|
},
|
|
747
747
|
confirmBtn: {
|
|
748
|
-
color: '
|
|
748
|
+
color: 'secondary',
|
|
749
749
|
text: true,
|
|
750
750
|
},
|
|
751
751
|
},
|
|
@@ -813,7 +813,7 @@ export const VuetifyOptions: Story = {
|
|
|
813
813
|
rounded: 'xl',
|
|
814
814
|
},
|
|
815
815
|
cardTitle: {
|
|
816
|
-
class: 'pa-5 mb-4
|
|
816
|
+
class: 'pa-5 mb-4 secondary--text',
|
|
817
817
|
},
|
|
818
818
|
closeBtn: {
|
|
819
819
|
class: {
|
|
@@ -821,14 +821,14 @@ export const VuetifyOptions: Story = {
|
|
|
821
821
|
},
|
|
822
822
|
},
|
|
823
823
|
icon: {
|
|
824
|
-
color: '
|
|
824
|
+
color: 'secondary',
|
|
825
825
|
},
|
|
826
826
|
cancelBtn: {
|
|
827
|
-
color: '
|
|
827
|
+
color: 'secondary',
|
|
828
828
|
text: false,
|
|
829
829
|
},
|
|
830
830
|
confirmBtn: {
|
|
831
|
-
color: '
|
|
831
|
+
color: 'secondary',
|
|
832
832
|
text: true,
|
|
833
833
|
},
|
|
834
834
|
}
|