@cnamts/synapse 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DateFilter-QEfKOz0P.js → DateFilter-_EFzsvvM.js} +1 -1
- package/dist/{NumberFilter-C0h7gVzp.js → NumberFilter-CUxEbKJh.js} +1 -1
- package/dist/{PeriodFilter-8dVrKjju.js → PeriodFilter-D5ueqtKy.js} +1 -1
- package/dist/{SelectFilter-BI3QGbqb.js → SelectFilter-BciBNydy.js} +1 -1
- package/dist/{TextFilter-UOp1hcPp.js → TextFilter-DMN_WAQB.js} +1 -1
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordion.d.ts +7 -3
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.d.ts +2 -0
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.d.ts +7 -3
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproCard/AmeliproCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIcon/AmeliproIcon.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +5 -5
- package/dist/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproNumberedCard/AmeliproNumberedCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +24 -32
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +36 -48
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproTable/AmeliproTable.d.ts +4 -0
- package/dist/components/Amelipro/AmeliproTable/types.d.ts +11 -0
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +0 -4
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +12 -16
- package/dist/components/Captcha/Captcha.d.ts +68 -0
- package/dist/components/Captcha/CaptchaAlert.d.ts +13 -0
- package/dist/components/Captcha/CaptchaBase.d.ts +55 -0
- package/dist/components/Captcha/CaptchaBtn.d.ts +12 -0
- package/dist/components/Captcha/CaptchaForm.d.ts +16 -0
- package/dist/components/Captcha/CaptchaImg.d.ts +12 -0
- package/dist/components/Captcha/CaptchaInformation.d.ts +20 -0
- package/dist/components/Captcha/captchaApi.d.ts +41 -0
- package/dist/components/Captcha/icons/volumeUp.d.ts +2 -0
- package/dist/components/Captcha/locales.d.ts +35 -0
- package/dist/components/Captcha/types.d.ts +2 -0
- package/dist/components/ChipList/ChipList.d.ts +2 -2
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +14 -14
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +5 -5
- package/dist/components/Customs/SyForm/SyForm.d.ts +6 -3
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +12 -16
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +96 -68
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +63 -38
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +23 -27
- package/dist/components/DatePicker/composables/useDatePickerViewMode.d.ts +2 -1
- package/dist/components/DatePicker/tests/setup.d.ts +816 -520
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +10 -10
- package/dist/components/NirField/NirField.d.ts +31 -34
- package/dist/components/NirField/locales.d.ts +1 -3
- package/dist/components/PasswordField/PasswordField.d.ts +2 -0
- package/dist/components/PeriodField/PeriodField.d.ts +192 -128
- package/dist/components/PhoneField/PhoneField.d.ts +13 -17
- package/dist/components/SearchListField/SearchListField.d.ts +5 -5
- package/dist/components/SyTextArea/SyTextArea.d.ts +0 -4
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -8
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -8
- package/dist/components/Tables/common/SyTablePagination.d.ts +5 -5
- package/dist/components/Tables/common/types.d.ts +4 -0
- package/dist/components/Tables/common/usePagination.d.ts +3 -4
- package/dist/components/Tables/common/useTableCheckbox.d.ts +10 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/validation/useFormValidation.d.ts +10 -0
- package/dist/composables/validation/useValidatable.d.ts +10 -2
- package/dist/design-system-v3.js +126 -125
- package/dist/design-system-v3.umd.cjs +265 -265
- package/dist/main-DISHlqcd.js +34217 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/overrides/_forms.scss +2 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.stories.ts +7 -4
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.vue +1 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/__tests__/__snapshots__/AmeliproAccordionFrieze.spec.ts.snap +574 -112
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +5 -2
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +2 -1
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.stories.ts +6 -3
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +5 -2
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +2 -1
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/AmeliproCheckbox.spec.ts +175 -0
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/__snapshots__/AmeliproCheckbox.spec.ts.snap +88 -0
- package/src/components/Amelipro/AmeliproCheckboxGroup/__tests__/AmeliproCheckboxGroup.spec.ts +423 -0
- package/src/components/Amelipro/AmeliproCheckboxGroup/{tests → __tests__}/__snapshots__/AmeliproCheckboxGroup.spec.ts.snap +112 -78
- package/src/components/Amelipro/AmeliproChips/__tests__/AmeliproChips.spec.ts +92 -0
- package/src/components/Amelipro/AmeliproChips/__tests__/__snapshots__/AmeliproChips.spec.ts.snap +81 -0
- package/src/components/Amelipro/AmeliproDialog/__tests__/AmeliproDialog.spec.ts +257 -0
- package/src/components/Amelipro/AmeliproDialog/__tests__/__snapshots__/AmeliproDialog.spec.ts.snap +61 -0
- package/src/components/Amelipro/AmeliproDisclosure/__tests__/AmeliproDisclosure.spec.ts +79 -0
- package/src/components/Amelipro/AmeliproDisclosure/__tests__/__snapshots__/AmeliproDisclosure.spec.ts.snap +89 -0
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.vue +6 -7
- package/src/components/Amelipro/AmeliproFooter/__tests__/AmeliproFooter.spec.ts +787 -0
- package/src/components/Amelipro/AmeliproFooter/__tests__/__snapshots__/AmeliproFooter.spec.ts.snap +318 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/AmeliproHeaderBrandSection.spec.ts +167 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +100 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/__tests__/AmeliproHeaderBar.spec.ts +312 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/__tests__/__snapshots__/AmeliproHeaderBar.spec.ts.snap +98 -0
- package/src/components/Amelipro/AmeliproHeader/__tests__/AmeliproHeader.spec.ts +361 -0
- package/src/components/Amelipro/AmeliproHeader/__tests__/__snapshots__/AmeliproHeader.spec.ts.snap +22 -0
- package/src/components/Amelipro/AmeliproMenu/__tests__/AmeliproMenu.spec.ts +168 -0
- package/src/components/Amelipro/AmeliproMenu/__tests__/__snapshots__/AmeliproMenu.spec.ts.snap +295 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/__tests__/AmeliproDropdownMenuBtn.spec.ts +128 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/__tests__/__snapshots__/AmeliproDropdownMenuBtn.spec.ts.snap +67 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/__tests__/AmeliproDropdownMenu.spec.ts +266 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/__tests__/__snapshots__/AmeliproDropdownMenu.spec.ts.snap +134 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/__tests__/AmeliproMessagingMenuBtn.spec.ts +72 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/__tests__/__snapshots__/AmeliproMessagingMenuBtn.spec.ts.snap +71 -0
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +12 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +81 -9
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +139 -61
- package/src/components/Amelipro/AmeliproTable/__tests__/AmeliproTable.spec.ts +10 -0
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +361 -187
- package/src/components/Amelipro/AmeliproTable/types.d.ts +11 -0
- package/src/components/Captcha/Captcha.mdx +72 -0
- package/src/components/Captcha/Captcha.stories.ts +276 -0
- package/src/components/Captcha/Captcha.vue +325 -0
- package/src/components/Captcha/CaptchaAlert.vue +60 -0
- package/src/components/Captcha/CaptchaBase.vue +219 -0
- package/src/components/Captcha/CaptchaBtn.vue +35 -0
- package/src/components/Captcha/CaptchaForm.vue +58 -0
- package/src/components/Captcha/CaptchaImg.vue +41 -0
- package/src/components/Captcha/CaptchaInformation.vue +64 -0
- package/src/components/Captcha/captchaApi.ts +111 -0
- package/src/components/Captcha/icons/volumeUp.vue +11 -0
- package/src/components/Captcha/locales.ts +35 -0
- package/src/components/Captcha/readme.md +5 -0
- package/src/components/Captcha/tests/Captcha.spec.ts +298 -0
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +716 -0
- package/src/components/Captcha/types.ts +2 -0
- package/src/components/Customs/Selects/SySelect/SySelect.vue +2 -2
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +4 -0
- package/src/components/Customs/SyForm/SyForm.stories.ts +133 -23
- package/src/components/Customs/SyForm/SyForm.vue +17 -1
- package/src/components/Customs/SyTextField/SyTextField.vue +29 -7
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +32 -9
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +154 -18
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +2 -2
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +35 -4
- package/src/components/DatePicker/composables/tests/useDatePickerViewMode.spec.ts +107 -72
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +6 -6
- package/src/components/DatePicker/composables/useDatePickerViewMode.ts +57 -7
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +14 -14
- package/src/components/DatePicker/tests/navigation.regression.spec.ts +74 -0
- package/src/components/DatePicker/tests/navigation.simple.spec.ts +137 -0
- package/src/components/NirField/NirField.stories.ts +85 -2
- package/src/components/NirField/NirField.vue +55 -18
- package/src/components/NirField/locales.ts +1 -3
- package/src/components/PasswordField/PasswordField.vue +39 -7
- package/src/components/PhoneField/PhoneField.vue +43 -10
- package/src/components/RangeField/tests/RangeField.spec.ts +0 -3
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +15 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +309 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +18 -3
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.mdx +15 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +228 -0
- package/src/components/Tables/SyTable/SyTable.vue +18 -3
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +63 -0
- package/src/components/Tables/common/SyTablePagination.vue +10 -8
- package/src/components/Tables/common/types.ts +4 -0
- package/src/components/Tables/common/usePagination.ts +11 -20
- package/src/components/Tables/common/useTableCheckbox.ts +23 -11
- package/src/components/index.ts +1 -0
- package/src/composables/validation/AvecVosComposants.mdx.old +1 -1
- package/src/composables/validation/FormValidation.stories.ts.old +5 -5
- package/src/composables/validation/useFormValidation.ts +46 -8
- package/src/composables/validation/useValidatable.ts +19 -8
- package/src/stories/Accessibilite/Introduction.mdx +1 -1
- package/src/stories/Demarrer/EnrichirLeDesignSystem.mdx +43 -0
- package/src/stories/Demarrer/EnrichirLeDesignSystem.stories.ts +239 -0
- package/src/stories/Demarrer/SignalerUneAnomalie.mdx +39 -0
- package/src/stories/Demarrer/SignalerUneAnomalie.stories.ts +261 -0
- package/dist/main-DyEOPqqn.js +0 -33329
- package/src/components/Amelipro/AmeliproCheckbox/tests/AmeliproCheckbox.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproCheckbox/tests/__snapshots__/AmeliproCheckbox.spec.ts.snap +0 -40
- package/src/components/Amelipro/AmeliproCheckboxGroup/tests/AmeliproCheckboxGroup.spec.ts +0 -46
- package/src/components/Amelipro/AmeliproChips/tests/AmeliproChips.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproChips/tests/__snapshots__/AmeliproChips.spec.ts.snap +0 -97
- package/src/components/Amelipro/AmeliproDialog/tests/AmeliproDialog.spec.ts +0 -24
- package/src/components/Amelipro/AmeliproDialog/tests/__snapshots__/AmeliproDialog.spec.ts.snap +0 -134
- package/src/components/Amelipro/AmeliproDisclosure/tests/AmeliproDisclosure.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproDisclosure/tests/__snapshots__/AmeliproDisclosure.spec.ts.snap +0 -104
- package/src/components/Amelipro/AmeliproFooter/tests/AmeliproFooter.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproFooter/tests/__snapshots__/AmeliproFooter.spec.ts.snap +0 -432
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/AmeliproHeaderBrandSection.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +0 -131
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/AmeliproHeaderBar.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/__snapshots__/AmeliproHeaderBar.spec.ts.snap +0 -172
- package/src/components/Amelipro/AmeliproHeader/tests/AmeliproHeader.spec.ts +0 -159
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +0 -841
- package/src/components/Amelipro/AmeliproMenu/tests/AmeliproMenu.spec.ts +0 -85
- package/src/components/Amelipro/AmeliproMenu/tests/__snapshots__/AmeliproMenu.spec.ts.snap +0 -537
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/tests/AmeliproDropdownMenuBtn.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/tests/__snapshots__/AmeliproDropdownMenuBtn.spec.ts.snap +0 -56
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/tests/AmeliproDropdownMenu.spec.ts +0 -28
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/tests/__snapshots__/AmeliproDropdownMenu.spec.ts.snap +0 -300
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/tests/AmeliproMessagingMenuBtn.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/tests/__snapshots__/AmeliproMessagingMenuBtn.spec.ts.snap +0 -89
- package/src/components/BackBtn/tests/__snapshots__/BackBtn.spec.ts.snap +0 -45
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +0 -1270
- package/src/stories/Demarrer/CreerUneIssue.mdx +0 -67
- package/src/stories/Demarrer/components.stories.ts +0 -25
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const unifyAfterCalendarUpdate = async () => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
52
|
+
// const unifyAfterCalendarUpdate = async () => {
|
|
53
|
+
// if (!isDatePickerVisible.value) return
|
|
54
|
+
// await nextTick()
|
|
55
|
+
// customizeMonthButton()
|
|
56
|
+
// markHolidayDays()
|
|
57
|
+
// }
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Calendar current month / year
|
|
@@ -64,14 +64,21 @@
|
|
|
64
64
|
const currentMonthName = ref<string | null>(null)
|
|
65
65
|
const currentYearName = ref<string | null>(null)
|
|
66
66
|
|
|
67
|
+
// Fonction pour mettre à jour le mois quand on navigue via les flèches
|
|
67
68
|
const onUpdateMonth = (month: string) => {
|
|
68
69
|
if (currentMonth.value === month) return
|
|
69
70
|
currentMonth.value = month
|
|
70
71
|
currentMonthName.value = dayjs().month(parseInt(month, 10)).format('MMMM')
|
|
71
72
|
handleMonthUpdate()
|
|
72
|
-
|
|
73
|
+
nextTick(() => {
|
|
74
|
+
if (isDatePickerVisible.value) {
|
|
75
|
+
customizeMonthButton()
|
|
76
|
+
markHolidayDays()
|
|
77
|
+
}
|
|
78
|
+
})
|
|
73
79
|
}
|
|
74
80
|
|
|
81
|
+
// Fonction pour mettre à jour l'année quand on navigue via les flèches
|
|
75
82
|
const onUpdateYear = (year: string) => {
|
|
76
83
|
const oldYear = currentYear.value
|
|
77
84
|
currentYear.value = year
|
|
@@ -92,8 +99,12 @@
|
|
|
92
99
|
}
|
|
93
100
|
|
|
94
101
|
handleYearUpdate()
|
|
95
|
-
|
|
96
|
-
|
|
102
|
+
nextTick(() => {
|
|
103
|
+
if (isDatePickerVisible.value) {
|
|
104
|
+
customizeMonthButton()
|
|
105
|
+
markHolidayDays()
|
|
106
|
+
}
|
|
107
|
+
})
|
|
97
108
|
}
|
|
98
109
|
|
|
99
110
|
/**
|
|
@@ -140,6 +151,8 @@
|
|
|
140
151
|
autoClamp?: boolean
|
|
141
152
|
isValidateOnBlur?: boolean
|
|
142
153
|
density?: 'default' | 'comfortable' | 'compact'
|
|
154
|
+
hint?: string
|
|
155
|
+
persistentHint?: boolean
|
|
143
156
|
}>(),
|
|
144
157
|
{
|
|
145
158
|
modelValue: undefined,
|
|
@@ -176,6 +189,8 @@
|
|
|
176
189
|
label: DATE_PICKER_MESSAGES.PLACEHOLDER_DEFAULT,
|
|
177
190
|
isValidateOnBlur: true,
|
|
178
191
|
density: 'default',
|
|
192
|
+
hint: undefined,
|
|
193
|
+
persistentHint: false,
|
|
179
194
|
},
|
|
180
195
|
)
|
|
181
196
|
|
|
@@ -231,6 +246,8 @@
|
|
|
231
246
|
|
|
232
247
|
const textInputValue = ref('')
|
|
233
248
|
const displayFormattedDate = ref('')
|
|
249
|
+
// Force re-render of DateTextInput/SyTextField when needed (e.g., after reset)
|
|
250
|
+
const fieldKey = ref(0)
|
|
234
251
|
const isManualInputActive = ref(false)
|
|
235
252
|
const isFormatting = ref(false)
|
|
236
253
|
const isUpdatingFromInternal = ref(false)
|
|
@@ -384,7 +401,10 @@
|
|
|
384
401
|
if (typeof newValue === 'string') {
|
|
385
402
|
if (props.dateFormatReturn) {
|
|
386
403
|
const date = parseDate(newValue, returnFormat.value)
|
|
387
|
-
if (date)
|
|
404
|
+
if (date) {
|
|
405
|
+
const formattedForDisplay = formatDate(date, props.format)
|
|
406
|
+
textInputValue.value = formattedForDisplay
|
|
407
|
+
}
|
|
388
408
|
}
|
|
389
409
|
else {
|
|
390
410
|
textInputValue.value = newValue
|
|
@@ -400,21 +420,38 @@
|
|
|
400
420
|
updateModel(formattedDate.value)
|
|
401
421
|
withInternalUpdate(() => {
|
|
402
422
|
if (Array.isArray(newValue)) {
|
|
403
|
-
if (newValue.length > 0)
|
|
423
|
+
if (newValue.length > 0) {
|
|
424
|
+
const newFormattedValue = formatDate(newValue[0], props.format)
|
|
425
|
+
if (textInputValue.value !== newFormattedValue) {
|
|
426
|
+
textInputValue.value = newFormattedValue
|
|
427
|
+
}
|
|
428
|
+
}
|
|
404
429
|
}
|
|
405
430
|
else {
|
|
406
|
-
|
|
431
|
+
const newFormattedValue = formatDate(newValue, props.format)
|
|
432
|
+
if (textInputValue.value !== newFormattedValue) {
|
|
433
|
+
textInputValue.value = newFormattedValue
|
|
434
|
+
}
|
|
407
435
|
}
|
|
408
436
|
})
|
|
409
437
|
}
|
|
410
438
|
else {
|
|
411
439
|
updateModel(null)
|
|
412
440
|
textInputValue.value = ''
|
|
441
|
+
// Reset month/year names when clearing the date
|
|
442
|
+
const today = new Date()
|
|
443
|
+
currentMonth.value = today.getMonth().toString()
|
|
444
|
+
currentMonthName.value = dayjs(today).format('MMMM')
|
|
445
|
+
currentYear.value = today.getFullYear().toString()
|
|
446
|
+
currentYearName.value = today.getFullYear().toString()
|
|
413
447
|
}
|
|
414
448
|
})
|
|
415
449
|
|
|
416
450
|
// Handle manual typing sync → model/selection
|
|
417
451
|
watch(textInputValue, (newValue) => {
|
|
452
|
+
// En mode plage, on laisse DateTextInput + handleDateTextInputUpdate
|
|
453
|
+
// piloter la mise à jour du modèle et de selectedDates
|
|
454
|
+
if (props.displayRange) return
|
|
418
455
|
if (isUpdatingFromInternal.value) return
|
|
419
456
|
const date = parseDate(newValue, props.format)
|
|
420
457
|
if (date) {
|
|
@@ -636,7 +673,10 @@
|
|
|
636
673
|
* View mode handling
|
|
637
674
|
*/
|
|
638
675
|
const { currentViewMode, handleViewModeUpdate, handleYearUpdate, handleMonthUpdate, resetViewMode }
|
|
639
|
-
= useDatePickerViewMode(
|
|
676
|
+
= useDatePickerViewMode(
|
|
677
|
+
() => props.isBirthDate || props.birthDate,
|
|
678
|
+
() => selectedDates.value,
|
|
679
|
+
)
|
|
640
680
|
|
|
641
681
|
/**
|
|
642
682
|
* Manual input validation on blur
|
|
@@ -687,6 +727,67 @@
|
|
|
687
727
|
successMessages,
|
|
688
728
|
})
|
|
689
729
|
|
|
730
|
+
/**
|
|
731
|
+
* Gère les mises à jour de DateTextInput avec contrôle
|
|
732
|
+
*/
|
|
733
|
+
const handleDateTextInputUpdate = (value: DateValue) => {
|
|
734
|
+
// Ne pas traiter les mises à jour internes pour éviter les boucles
|
|
735
|
+
if (isUpdatingFromInternal.value) return
|
|
736
|
+
|
|
737
|
+
try {
|
|
738
|
+
isUpdatingFromInternal.value = true
|
|
739
|
+
|
|
740
|
+
// 1) Propager la valeur brute vers le v-model externe
|
|
741
|
+
updateModel(value)
|
|
742
|
+
|
|
743
|
+
// 2) Mettre à jour selectedDates / displayFormattedDate pour refléter la saisie manuelle
|
|
744
|
+
if (!value) {
|
|
745
|
+
selectedDates.value = null
|
|
746
|
+
displayFormattedDate.value = ''
|
|
747
|
+
return
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (Array.isArray(value) && props.displayRange) {
|
|
751
|
+
const [startStr, endStr] = value
|
|
752
|
+
const rf = returnFormat.value
|
|
753
|
+
const startDate = startStr ? parseDate(startStr, rf) || parseDate(startStr, props.format) : null
|
|
754
|
+
const endDate = endStr ? parseDate(endStr, rf) || parseDate(endStr, props.format) : null
|
|
755
|
+
|
|
756
|
+
if (startDate && endDate) {
|
|
757
|
+
selectedDates.value = [startDate, endDate]
|
|
758
|
+
displayFormattedDate.value
|
|
759
|
+
= `${formatDate(startDate, props.format)} - ${formatDate(endDate, props.format)}`
|
|
760
|
+
}
|
|
761
|
+
else if (startDate) {
|
|
762
|
+
// Première date saisie uniquement
|
|
763
|
+
selectedDates.value = [startDate]
|
|
764
|
+
displayFormattedDate.value = formatDate(startDate, props.format)
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
selectedDates.value = null
|
|
768
|
+
displayFormattedDate.value = ''
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
else if (typeof value === 'string') {
|
|
772
|
+
const rf = returnFormat.value
|
|
773
|
+
const date = parseDate(value, rf) || parseDate(value, props.format)
|
|
774
|
+
if (date) {
|
|
775
|
+
selectedDates.value = date
|
|
776
|
+
displayFormattedDate.value = formatDate(date, props.format)
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
selectedDates.value = null
|
|
780
|
+
displayFormattedDate.value = ''
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
finally {
|
|
785
|
+
setTimeout(() => {
|
|
786
|
+
isUpdatingFromInternal.value = false
|
|
787
|
+
}, 0)
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
690
791
|
/**
|
|
691
792
|
* Sync from external v-model
|
|
692
793
|
*/
|
|
@@ -704,7 +805,8 @@
|
|
|
704
805
|
const firstDate = Array.isArray(selectedDates.value)
|
|
705
806
|
? selectedDates.value[0]
|
|
706
807
|
: selectedDates.value
|
|
707
|
-
|
|
808
|
+
const formattedForInput = formatDate(firstDate, props.format)
|
|
809
|
+
textInputValue.value = formattedForInput
|
|
708
810
|
displayFormattedDate.value = displayFormattedDateComputed.value || ''
|
|
709
811
|
}
|
|
710
812
|
validateDates()
|
|
@@ -736,6 +838,8 @@
|
|
|
736
838
|
isDatePickerVisible,
|
|
737
839
|
(visible) => {
|
|
738
840
|
if (visible) {
|
|
841
|
+
// Réinitialiser le view mode à l'ouverture pour éviter les problèmes de navigation
|
|
842
|
+
resetViewMode()
|
|
739
843
|
nextTick(() => {
|
|
740
844
|
customizeMonthButton()
|
|
741
845
|
markHolidayDays()
|
|
@@ -870,8 +974,30 @@
|
|
|
870
974
|
return textInputValid && errors.value.length === 0
|
|
871
975
|
}
|
|
872
976
|
|
|
977
|
+
// Reset hook utilisé par SyForm.reset() via useValidatable
|
|
978
|
+
const reset = () => {
|
|
979
|
+
// 1) Nettoyer l'état de validation et d'interaction
|
|
980
|
+
clearValidation()
|
|
981
|
+
isDatePickerVisible.value = false
|
|
982
|
+
hasInteracted.value = false
|
|
983
|
+
isManualInputActive.value = false
|
|
984
|
+
|
|
985
|
+
// 2) Réinitialiser la valeur et la sélection SANS déclencher
|
|
986
|
+
// de validation "required" interactive
|
|
987
|
+
withInternalUpdate(() => {
|
|
988
|
+
selectedDates.value = null
|
|
989
|
+
textInputValue.value = ''
|
|
990
|
+
displayFormattedDate.value = ''
|
|
991
|
+
// Synchroniser le modèle externe
|
|
992
|
+
emit('update:modelValue', null)
|
|
993
|
+
})
|
|
994
|
+
|
|
995
|
+
// 3) Forcer la recréation du champ pour réinitialiser l'état interne de Vuetify
|
|
996
|
+
fieldKey.value++
|
|
997
|
+
}
|
|
998
|
+
|
|
873
999
|
// Intégration avec le système de validation du formulaire
|
|
874
|
-
useValidatable(validateOnSubmit)
|
|
1000
|
+
useValidatable(validateOnSubmit, clearValidation, reset)
|
|
875
1001
|
|
|
876
1002
|
defineExpose({
|
|
877
1003
|
validateOnSubmit,
|
|
@@ -897,6 +1023,7 @@
|
|
|
897
1023
|
// Expose for consumers
|
|
898
1024
|
handleDateSelected,
|
|
899
1025
|
resetViewMode,
|
|
1026
|
+
reset,
|
|
900
1027
|
})
|
|
901
1028
|
</script>
|
|
902
1029
|
|
|
@@ -911,6 +1038,7 @@
|
|
|
911
1038
|
<template v-if="props.noCalendar">
|
|
912
1039
|
<DateTextInput
|
|
913
1040
|
ref="dateTextInputRef"
|
|
1041
|
+
:key="fieldKey"
|
|
914
1042
|
v-model="textInputValue"
|
|
915
1043
|
:class="[getMessageClasses(), 'label-hidden-on-focus']"
|
|
916
1044
|
:date-format-return="props.dateFormatReturn"
|
|
@@ -934,7 +1062,9 @@
|
|
|
934
1062
|
:external-error-messages="errorMessages"
|
|
935
1063
|
:display-asterisk="props.displayAsterisk"
|
|
936
1064
|
:is-validate-on-blur="props.isValidateOnBlur"
|
|
937
|
-
:title="props.title || undefined"
|
|
1065
|
+
:title="props.title || props.placeholder || undefined"
|
|
1066
|
+
:hint="props.hint"
|
|
1067
|
+
:persistent-hint="props.persistentHint"
|
|
938
1068
|
@focus="emit('focus')"
|
|
939
1069
|
@blur="emit('blur')"
|
|
940
1070
|
/>
|
|
@@ -956,7 +1086,8 @@
|
|
|
956
1086
|
<DateTextInput
|
|
957
1087
|
v-bind="menuProps"
|
|
958
1088
|
ref="dateCalendarTextInputRef"
|
|
959
|
-
|
|
1089
|
+
:key="fieldKey"
|
|
1090
|
+
:model-value="textInputValue"
|
|
960
1091
|
:label="labelWithAsterisk || ''"
|
|
961
1092
|
:placeholder="props.placeholder"
|
|
962
1093
|
:format="props.format"
|
|
@@ -964,7 +1095,7 @@
|
|
|
964
1095
|
:required="props.required"
|
|
965
1096
|
:disabled="props.disabled"
|
|
966
1097
|
:readonly="props.readonly"
|
|
967
|
-
:title="props.title || undefined"
|
|
1098
|
+
:title="props.title || props.placeholder || undefined"
|
|
968
1099
|
:is-outlined="props.isOutlined"
|
|
969
1100
|
:display-icon="props.displayIcon"
|
|
970
1101
|
:display-append-icon="props.displayAppendIcon"
|
|
@@ -984,6 +1115,9 @@
|
|
|
984
1115
|
:append-inner-icon="getIcon"
|
|
985
1116
|
:auto-clamp="props.autoClamp"
|
|
986
1117
|
:density="props.density"
|
|
1118
|
+
:hint="props.hint"
|
|
1119
|
+
:persistent-hint="props.persistentHint"
|
|
1120
|
+
@update:model-value="handleDateTextInputUpdate"
|
|
987
1121
|
@click="openDatePickerOnClick"
|
|
988
1122
|
@focus="openDatePickerOnFocus"
|
|
989
1123
|
@blur="handleInputBlur"
|
|
@@ -1015,6 +1149,8 @@
|
|
|
1015
1149
|
:is-validate-on-blur="props.isValidateOnBlur"
|
|
1016
1150
|
:error-messages="errorMessages"
|
|
1017
1151
|
:density="props.density"
|
|
1152
|
+
:hint="props.hint"
|
|
1153
|
+
:persistent-hint="props.persistentHint"
|
|
1018
1154
|
@update:model-value="updateDisplayFormattedDate"
|
|
1019
1155
|
@update:view-mode="handleViewModeUpdate"
|
|
1020
1156
|
@update:month="onUpdateMonth"
|
|
@@ -86,13 +86,13 @@ vi.mock('../composables/useTodayButton', () => ({
|
|
|
86
86
|
}))
|
|
87
87
|
|
|
88
88
|
vi.mock('../composables/useDatePickerViewMode', () => ({
|
|
89
|
-
useDatePickerViewMode: () => ({
|
|
89
|
+
useDatePickerViewMode: vi.fn(() => ({
|
|
90
90
|
currentViewMode: 'month',
|
|
91
91
|
handleViewModeUpdate: vi.fn(),
|
|
92
92
|
handleYearUpdate: vi.fn(),
|
|
93
93
|
handleMonthUpdate: vi.fn(),
|
|
94
94
|
resetViewMode: vi.fn(),
|
|
95
|
-
}),
|
|
95
|
+
})),
|
|
96
96
|
}))
|
|
97
97
|
|
|
98
98
|
// Créer un mock pour rangeBoundaryDates qui peut être observé par les watchers
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
autoClamp?: boolean
|
|
51
51
|
isValidateOnBlur?: boolean
|
|
52
52
|
density?: 'default' | 'comfortable' | 'compact'
|
|
53
|
+
hint?: string
|
|
54
|
+
persistentHint?: boolean
|
|
53
55
|
externalErrorMessages?: string[]
|
|
54
56
|
}>(), {
|
|
55
57
|
modelValue: null,
|
|
@@ -75,6 +77,8 @@
|
|
|
75
77
|
autoClamp: true,
|
|
76
78
|
isValidateOnBlur: true,
|
|
77
79
|
density: 'default',
|
|
80
|
+
hint: undefined,
|
|
81
|
+
persistentHint: false,
|
|
78
82
|
externalErrorMessages: () => [],
|
|
79
83
|
})
|
|
80
84
|
|
|
@@ -196,6 +200,8 @@
|
|
|
196
200
|
const inputValue = ref('')
|
|
197
201
|
const inputRef = ref<InstanceType<typeof SyTextField> | null>(null)
|
|
198
202
|
const isFormatting = ref(false)
|
|
203
|
+
// Force re-render of SyTextField when needed (e.g., after reset)
|
|
204
|
+
const fieldKey = ref(0)
|
|
199
205
|
|
|
200
206
|
const updateDisplayValue = (dateDisplayText: string) => (inputValue.value = dateDisplayText)
|
|
201
207
|
const updateAriaLabel = (ariaLabelText: string) => (ariaLabel.value = ariaLabelText)
|
|
@@ -936,15 +942,37 @@
|
|
|
936
942
|
isValidating.value = true
|
|
937
943
|
hasInteracted.value = true
|
|
938
944
|
const ok = runRules(inputValue.value)
|
|
939
|
-
|
|
940
|
-
return
|
|
945
|
+
isValidating.value = false
|
|
946
|
+
return ok
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
// Reset hook utilisé par SyForm.reset() via useValidatable
|
|
950
|
+
const reset = () => {
|
|
951
|
+
// 1) Nettoyer l'état de validation et d'interaction
|
|
952
|
+
clearValidation()
|
|
953
|
+
isFocused.value = false
|
|
954
|
+
hasInteracted.value = false
|
|
955
|
+
|
|
956
|
+
// 2) Réinitialiser la valeur sans déclencher de validation interactive
|
|
957
|
+
isFormatting.value = true
|
|
958
|
+
inputValue.value = ''
|
|
959
|
+
selectedDates.value = null
|
|
960
|
+
resetState()
|
|
961
|
+
isFormatting.value = false
|
|
962
|
+
|
|
963
|
+
// 3) Synchroniser le modèle externe
|
|
964
|
+
emitModel(null)
|
|
965
|
+
|
|
966
|
+
// 4) Forcer la recréation du champ pour réinitialiser l'état interne de Vuetify
|
|
967
|
+
fieldKey.value++
|
|
941
968
|
}
|
|
942
969
|
|
|
943
970
|
// Intégration avec le système de validation du formulaire
|
|
944
|
-
useValidatable(validateOnSubmit)
|
|
971
|
+
useValidatable(validateOnSubmit, clearValidation, reset)
|
|
945
972
|
|
|
946
973
|
defineExpose({
|
|
947
974
|
validateOnSubmit,
|
|
975
|
+
reset,
|
|
948
976
|
focus() {
|
|
949
977
|
const el: HTMLInputElement | null | undefined = inputRef.value?.$el?.querySelector?.('input:not([type="hidden"])')
|
|
950
978
|
el?.focus({ preventScroll: true })
|
|
@@ -998,6 +1026,7 @@
|
|
|
998
1026
|
|
|
999
1027
|
<template>
|
|
1000
1028
|
<SyTextField
|
|
1029
|
+
:key="fieldKey"
|
|
1001
1030
|
ref="inputRef"
|
|
1002
1031
|
v-model="inputValue"
|
|
1003
1032
|
:append-icon="props.displayIcon && props.displayAppendIcon ? 'calendar' : undefined"
|
|
@@ -1024,7 +1053,9 @@
|
|
|
1024
1053
|
:aria-label="ariaLabel || props.placeholder"
|
|
1025
1054
|
:is-validate-on-blur="props.isValidateOnBlur"
|
|
1026
1055
|
:density="props.density"
|
|
1027
|
-
:title="props.title || undefined"
|
|
1056
|
+
:title="props.title || props.placeholder || undefined"
|
|
1057
|
+
:hint="props.hint"
|
|
1058
|
+
:persistent-hint="props.persistentHint"
|
|
1028
1059
|
@focus="onFocus"
|
|
1029
1060
|
@blur="onBlur"
|
|
1030
1061
|
@keydown="handleKeydown"
|