@cnamts/synapse 1.0.1 → 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-BmRuzQ9Z.js → DateFilter-YWOTbfeL.js} +1 -1
- package/dist/{NumberFilter-CnIPDHqx.js → NumberFilter-DMmMgALM.js} +1 -1
- package/dist/{PeriodFilter-CZwZ8CnQ.js → PeriodFilter-Bok5BHcn.js} +1 -1
- package/dist/SelectFilter-BKud2WhN.js +136 -0
- package/dist/{TextFilter-DTxZHJwX.js → TextFilter-DvMf2thH.js} +1 -1
- 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/Customs/SyCheckbox/SyCheckbox.d.ts +85 -0
- package/dist/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -0
- package/dist/components/Customs/SySelect/SySelect.d.ts +33 -13
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +2 -2
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +1585 -1452
- package/dist/components/DatePicker/DatePicker/DatePicker.d.ts +16 -2
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +3 -1
- package/dist/components/DatePicker/composables/index.d.ts +2 -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/useDateRangeInput.d.ts +1 -1
- package/dist/components/DatePicker/composables/useDisplayedDateString.d.ts +3 -0
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +1 -0
- package/dist/components/DatePicker/composables/useMonthButtonCustomization.d.ts +5 -2
- package/dist/components/NirField/NirField.d.ts +7 -3
- package/dist/components/NirField/nirValidation.d.ts +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +2 -0
- package/dist/components/PeriodField/PeriodField.d.ts +52 -8
- package/dist/components/PhoneField/PhoneField.d.ts +2 -2
- package/dist/components/RangeField/RangeField.d.ts +2 -0
- package/dist/components/SearchListField/SearchListField.d.ts +9 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +2 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +14 -9
- package/dist/components/Tables/SyTable/SyTable.d.ts +12 -7
- package/dist/components/Tables/common/SyTablePagination.d.ts +1636 -0
- package/dist/components/Tables/common/TableHeader.d.ts +2 -20
- package/dist/components/Tables/common/filters/SelectFilter.d.ts +5 -5
- 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/locales.d.ts +21 -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/tableFilterUtils.d.ts +1 -0
- package/dist/components/Tables/common/tableStorageUtils.d.ts +41 -1
- package/dist/components/Tables/common/tableUtils.d.ts +42 -5
- package/dist/components/Tables/common/types.d.ts +19 -8
- 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/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/ToolbarContainer/ToolbarContainer.d.ts +11 -0
- package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +9 -2
- package/dist/components/index.d.ts +8 -6
- package/dist/design-system-v3.js +58 -56
- package/dist/design-system-v3.umd.cjs +22 -22
- 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/package.json +1 -1
- 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/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/SyInputSelect.stories.ts +1 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +8 -1
- package/src/components/Customs/SySelect/SySelect.stories.ts +160 -0
- package/src/components/Customs/SySelect/SySelect.vue +291 -32
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +230 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +3 -2
- package/src/components/Customs/SyTextField/SyTextField.vue +19 -8
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +241 -31
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +305 -57
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.events.spec.ts +161 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +4 -2
- package/src/components/DatePicker/DatePicker/DatePicker.stories.ts +259 -137
- package/src/components/DatePicker/DatePicker/DatePicker.vue +153 -25
- package/src/components/DatePicker/DatePicker/tests/DatePicker.events.spec.ts +189 -0
- package/src/components/DatePicker/DatePicker/{DatePicker.spec.ts → tests/DatePicker.spec.ts} +1 -15
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +24 -14
- package/src/components/DatePicker/DateTextInput/DateTextInput.events.spec.ts +148 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +3 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +200 -5
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +241 -31
- package/src/components/DatePicker/composables/index.ts +2 -0
- package/src/components/DatePicker/composables/tests/useDateAutoClamp.spec.ts +190 -0
- package/src/components/DatePicker/composables/tests/useInputBlurHandler.spec.ts +182 -4
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +105 -80
- package/src/components/DatePicker/composables/useAsteriskDisplay.ts +31 -0
- package/src/components/DatePicker/composables/useDateAutoClamp.ts +136 -0
- package/src/components/DatePicker/composables/useDateRangeInput.ts +21 -18
- package/src/components/DatePicker/composables/useDisplayedDateString.ts +13 -1
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +84 -20
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +149 -51
- package/src/components/DiacriticPicker/DiacriticPicker.stories.ts +10 -0
- package/src/components/ErrorPage/Accessibilite.stories.ts +8 -0
- package/src/components/ErrorPage/ErrorPage.vue +12 -6
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +4 -4
- 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/NotFoundPage.vue +2 -1
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +8 -6
- package/src/components/PaginatedTable/PaginatedTable.mdx +2 -0
- package/src/components/PasswordField/PasswordField.stories.ts +4 -0
- package/src/components/PasswordField/PasswordField.vue +3 -0
- package/src/components/PeriodField/PeriodField.vue +2 -0
- package/src/components/PhoneField/PhoneField.stories.ts +15 -15
- package/src/components/PhoneField/PhoneField.vue +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/SearchListField/SearchListField.vue +5 -0
- package/src/components/SyTextArea/SyTextArea.vue +3 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +0 -1
- package/src/components/Tables/SyServerTable/FilterRules.stories.ts +632 -15
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +15 -5
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +2844 -1377
- package/src/components/Tables/SyServerTable/SyServerTable.vue +155 -66
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +256 -4
- package/src/components/Tables/SyTable/FilterRules.stories.ts +183 -0
- package/src/components/Tables/SyTable/SyTable.mdx +14 -4
- package/src/components/Tables/SyTable/SyTable.stories.ts +1265 -477
- package/src/components/Tables/SyTable/SyTable.vue +152 -72
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +366 -4
- package/src/components/Tables/common/SyTableFilter.vue +3 -56
- package/src/components/Tables/common/SyTablePagination.vue +375 -0
- package/src/components/Tables/common/TableHeader.vue +10 -26
- package/src/components/Tables/common/filters/SelectFilter.vue +131 -22
- 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/TextFilter.spec.ts +11 -11
- package/src/components/Tables/common/locales.ts +24 -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/tableFilterUtils.ts +43 -295
- package/src/components/Tables/common/tableStorageUtils.ts +27 -2
- package/src/components/Tables/common/tableStyles.scss +26 -0
- package/src/components/Tables/common/tableUtils.ts +3 -16
- 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/tableFilterUtils.spec.ts +0 -14
- package/src/components/Tables/common/tests/tableUtils.spec.ts +7 -51
- package/src/components/Tables/common/types.ts +17 -6
- package/src/components/Tables/common/usePagination.ts +83 -0
- package/src/components/Tables/common/useTableCheckbox.ts +58 -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/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/UserMenuBtn/UserMenuBtn.stories.ts +74 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +19 -17
- package/src/components/index.ts +8 -6
- 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 +20 -5
- 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/dist/SelectFilter-Cj-GW2Cc.js +0 -97
- package/dist/main-WDqeoGM-.js +0 -14788
- package/src/components/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +0 -886
- package/src/components/Tables/SyServerTable/tests/__snapshots__/SyServerTable.spec.ts.snap +0 -521
- package/src/components/Tables/SyTable/tests/__snapshots__/SyTable.spec.ts.snap +0 -521
- package/src/stories/DesignTokens/ThemePA.mdx +0 -35
|
@@ -78,18 +78,21 @@ export function useDateRangeInput(
|
|
|
78
78
|
* @param cursorPosition Position actuelle du curseur (optionnel)
|
|
79
79
|
* @returns Objet contenant les informations sur la plage de dates
|
|
80
80
|
*/
|
|
81
|
-
const handleRangeInput = (inputValue: string, newValue: string, cursorPosition?: number): {
|
|
81
|
+
const handleRangeInput = (inputValue: string | unknown, newValue: string | unknown, cursorPosition?: number): {
|
|
82
82
|
formattedValue: string
|
|
83
83
|
dates: [Date | null, Date | null]
|
|
84
84
|
isComplete: boolean
|
|
85
85
|
justCompletedFirstDate?: boolean
|
|
86
86
|
cursorPosition?: number
|
|
87
87
|
} => {
|
|
88
|
+
// S'assurer que inputValue et newValue sont des chaînes de caractères
|
|
89
|
+
const safeInputValue = typeof inputValue === 'string' ? inputValue : ''
|
|
90
|
+
const safeNewValue = typeof newValue === 'string' ? newValue : ''
|
|
88
91
|
// Si le mode plage n'est pas activé, traiter comme une date unique
|
|
89
92
|
if (!isRangeMode) {
|
|
90
|
-
const date = parseDate(
|
|
93
|
+
const date = parseDate(safeNewValue, format)
|
|
91
94
|
return {
|
|
92
|
-
formattedValue: date ? formatDate(date, format) :
|
|
95
|
+
formattedValue: date ? formatDate(date, format) : safeNewValue,
|
|
93
96
|
dates: [date, null],
|
|
94
97
|
isComplete: !!date,
|
|
95
98
|
cursorPosition: cursorPosition,
|
|
@@ -98,32 +101,32 @@ export function useDateRangeInput(
|
|
|
98
101
|
|
|
99
102
|
// Cas spécial : si la valeur précédente se terminait par un séparateur et que la nouvelle valeur
|
|
100
103
|
// contient du texte après le séparateur, c'est qu'on commence à saisir la seconde date
|
|
101
|
-
if (
|
|
102
|
-
&&
|
|
103
|
-
&&
|
|
104
|
+
if (safeInputValue && safeInputValue.endsWith(rangeSeparator)
|
|
105
|
+
&& safeNewValue.startsWith(safeInputValue)
|
|
106
|
+
&& safeNewValue.length > safeInputValue.length) {
|
|
104
107
|
// On est en train de saisir la seconde date pour la première fois
|
|
105
108
|
isEditingSecondDate.value = true
|
|
106
109
|
|
|
107
110
|
// Extraire la première date et le nouveau caractère saisi
|
|
108
|
-
const firstPart =
|
|
111
|
+
const firstPart = safeInputValue.substring(0, safeInputValue.length - rangeSeparator.length)
|
|
109
112
|
const firstDateObj = parseDate(firstPart, format)
|
|
110
113
|
firstDate.value = firstDateObj
|
|
111
114
|
|
|
112
115
|
// Extraire le caractère nouvellement saisi (après le séparateur)
|
|
113
|
-
const secondPart =
|
|
116
|
+
const secondPart = safeNewValue.substring(safeInputValue.length)
|
|
114
117
|
secondDate.value = parseDate(secondPart, format)
|
|
115
118
|
|
|
116
119
|
return {
|
|
117
120
|
formattedValue: `${firstPart}${rangeSeparator}${secondPart}`,
|
|
118
121
|
dates: [firstDateObj, secondDate.value],
|
|
119
122
|
isComplete: false,
|
|
120
|
-
cursorPosition:
|
|
123
|
+
cursorPosition: safeNewValue.length,
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
// Si la valeur contient déjà un séparateur de plage
|
|
125
|
-
if (hasRangeSeparator(
|
|
126
|
-
const [startStr, endStr] = extractRangeParts(
|
|
128
|
+
if (hasRangeSeparator(safeNewValue)) {
|
|
129
|
+
const [startStr, endStr] = extractRangeParts(safeNewValue)
|
|
127
130
|
const startDate = parseDate(startStr, format)
|
|
128
131
|
const endDate = parseDate(endStr, format)
|
|
129
132
|
|
|
@@ -143,7 +146,7 @@ export function useDateRangeInput(
|
|
|
143
146
|
|
|
144
147
|
// Si la position du curseur est dans la première partie de la date
|
|
145
148
|
if (cursorPosition !== undefined) {
|
|
146
|
-
const separatorPos =
|
|
149
|
+
const separatorPos = safeInputValue.indexOf(rangeSeparator)
|
|
147
150
|
if (separatorPos !== -1 && cursorPosition <= separatorPos) {
|
|
148
151
|
// Ajuster la position si la première partie a été formatée
|
|
149
152
|
if (startStr !== formattedStart) {
|
|
@@ -172,24 +175,24 @@ export function useDateRangeInput(
|
|
|
172
175
|
// (ce cas ne devrait pas arriver souvent car la valeur devrait contenir un séparateur)
|
|
173
176
|
if (isEditingSecondDate.value && firstDate.value) {
|
|
174
177
|
// Formater la valeur pour afficher la première date + séparateur + nouvelle valeur
|
|
175
|
-
const formattedValue = `${formatDate(firstDate.value, format)}${rangeSeparator}${newValue}`
|
|
176
|
-
const secondDateParsed = parseDate(newValue, format)
|
|
178
|
+
const formattedValue = `${formatDate(firstDate.value, format)}${rangeSeparator}${typeof newValue === 'string' ? newValue : ''}`
|
|
179
|
+
const secondDateParsed = parseDate(typeof newValue === 'string' ? newValue : '', format)
|
|
177
180
|
secondDate.value = secondDateParsed
|
|
178
181
|
|
|
179
182
|
return {
|
|
180
183
|
formattedValue,
|
|
181
184
|
dates: [firstDate.value, secondDateParsed],
|
|
182
185
|
isComplete: !!firstDate.value && !!secondDateParsed,
|
|
183
|
-
cursorPosition: cursorPosition !== undefined ? formatDate(firstDate.value, format).length + rangeSeparator.length + Math.min(cursorPosition, newValue.length) : undefined,
|
|
186
|
+
cursorPosition: cursorPosition !== undefined ? formatDate(firstDate.value, format).length + rangeSeparator.length + Math.min(cursorPosition, typeof newValue === 'string' ? newValue.length : 0) : undefined,
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
|
|
187
190
|
// Si nous éditons la première date
|
|
188
|
-
const date = parseDate(newValue, format)
|
|
191
|
+
const date = parseDate(typeof newValue === 'string' ? newValue : '', format)
|
|
189
192
|
firstDate.value = date
|
|
190
193
|
|
|
191
194
|
// Si la première date est complète, passer à la saisie de la deuxième date
|
|
192
|
-
if (date && newValue.length >= format.length) {
|
|
195
|
+
if (date && typeof newValue === 'string' && newValue.length >= format.length) {
|
|
193
196
|
isEditingSecondDate.value = true
|
|
194
197
|
const formattedDate = formatDate(date, format)
|
|
195
198
|
|
|
@@ -203,7 +206,7 @@ export function useDateRangeInput(
|
|
|
203
206
|
}
|
|
204
207
|
|
|
205
208
|
return {
|
|
206
|
-
formattedValue:
|
|
209
|
+
formattedValue: safeNewValue,
|
|
207
210
|
dates: [date, null],
|
|
208
211
|
isComplete: false,
|
|
209
212
|
cursorPosition: cursorPosition,
|
|
@@ -4,6 +4,7 @@ import { type DateObjectValue } from '../types'
|
|
|
4
4
|
|
|
5
5
|
export interface DisplayedDateStringProps {
|
|
6
6
|
selectedDates: { value: DateObjectValue }
|
|
7
|
+
rangeBoundaryDates?: { value: [Date | null, Date | null] | null }
|
|
7
8
|
todayInString: ComputedRef<string>
|
|
8
9
|
}
|
|
9
10
|
|
|
@@ -21,7 +22,18 @@ export function useDisplayedDateString(props: DisplayedDateStringProps): Display
|
|
|
21
22
|
// Si nous n'avons pas de date sélectionnée, afficher la date du jour
|
|
22
23
|
if (!props.selectedDates.value) return props.todayInString.value
|
|
23
24
|
|
|
24
|
-
//
|
|
25
|
+
// Priorité aux rangeBoundaryDates pour les plages
|
|
26
|
+
if (props.rangeBoundaryDates?.value && props.rangeBoundaryDates.value[0] && props.rangeBoundaryDates.value[1]) {
|
|
27
|
+
const startDate = dayjs(props.rangeBoundaryDates.value[0])
|
|
28
|
+
const endDate = dayjs(props.rangeBoundaryDates.value[1])
|
|
29
|
+
|
|
30
|
+
if (startDate.isValid() && endDate.isValid()) {
|
|
31
|
+
// Format court pour la date de début, format complet pour la date de fin
|
|
32
|
+
return `${startDate.format('D MMMM')} - ${endDate.format('D MMMM YYYY')}`
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Si nous avons une plage de dates dans selectedDates
|
|
25
37
|
if (Array.isArray(props.selectedDates.value)) {
|
|
26
38
|
// Si nous avons les deux dates de la plage
|
|
27
39
|
if (props.selectedDates.value.length >= 2) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type Ref } from 'vue'
|
|
1
|
+
import { type Ref, ref } from 'vue'
|
|
2
2
|
import { type DateValue } from '@/composables/date/useDateInitializationDayjs'
|
|
3
3
|
import { type DateObjectValue } from '../types'
|
|
4
|
+
import { DATE_PICKER_MESSAGES } from '../constants/messages'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Composable pour gérer le comportement lors de la perte de focus d'un champ de date
|
|
@@ -20,6 +21,7 @@ export const useInputBlurHandler = (options: {
|
|
|
20
21
|
isManualInputActive: Ref<boolean>
|
|
21
22
|
isUpdatingFromInternal: Ref<boolean>
|
|
22
23
|
selectedDates: Ref<DateObjectValue>
|
|
24
|
+
errors?: Ref<string[]>
|
|
23
25
|
|
|
24
26
|
// Fonctions
|
|
25
27
|
validateDateFormat: (dateStr: string) => { isValid: boolean, message: string }
|
|
@@ -40,6 +42,7 @@ export const useInputBlurHandler = (options: {
|
|
|
40
42
|
isManualInputActive,
|
|
41
43
|
isUpdatingFromInternal,
|
|
42
44
|
selectedDates,
|
|
45
|
+
errors = ref([]),
|
|
43
46
|
validateDateFormat,
|
|
44
47
|
parseDate,
|
|
45
48
|
formatDate,
|
|
@@ -63,25 +66,82 @@ export const useInputBlurHandler = (options: {
|
|
|
63
66
|
|
|
64
67
|
// Gérer la mise à jour du modèle en fonction de la validité de la date
|
|
65
68
|
if (displayFormattedDate.value) {
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
// S'assurer que displayFormattedDate.value est une chaîne de caractères
|
|
70
|
+
if (typeof displayFormattedDate.value !== 'string') {
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Vérifier si c'est une plage de dates (contient un séparateur)
|
|
75
|
+
if (displayFormattedDate.value.includes(' - ')) {
|
|
76
|
+
const parts = displayFormattedDate.value.split(' - ')
|
|
77
|
+
const startDateStr = parts[0]?.trim() || ''
|
|
78
|
+
const endDateStr = parts[1]?.trim() || ''
|
|
79
|
+
|
|
80
|
+
// Si les deux dates sont présentes, valider et mettre à jour
|
|
81
|
+
if (startDateStr && endDateStr) {
|
|
82
|
+
const startValidation = validateDateFormat(startDateStr)
|
|
83
|
+
const endValidation = validateDateFormat(endDateStr)
|
|
84
|
+
|
|
85
|
+
if (startValidation.isValid && endValidation.isValid) {
|
|
86
|
+
const startDate = parseDate(startDateStr, format)
|
|
87
|
+
const endDate = parseDate(endDateStr, format)
|
|
88
|
+
|
|
89
|
+
if (startDate && endDate) {
|
|
90
|
+
// Vérifier que la date de fin est postérieure ou égale à la date de début
|
|
91
|
+
if (startDate.getTime() <= endDate.getTime()) {
|
|
92
|
+
try {
|
|
93
|
+
isUpdatingFromInternal.value = true
|
|
94
|
+
selectedDates.value = [startDate, endDate]
|
|
95
|
+
|
|
96
|
+
// Formater les dates selon le format de retour
|
|
97
|
+
const formattedStartDate = dateFormatReturn
|
|
98
|
+
? formatDate(startDate, dateFormatReturn)
|
|
99
|
+
: formatDate(startDate, format)
|
|
100
|
+
const formattedEndDate = dateFormatReturn
|
|
101
|
+
? formatDate(endDate, dateFormatReturn)
|
|
102
|
+
: formatDate(endDate, format)
|
|
103
|
+
|
|
104
|
+
// Mettre à jour le modèle avec un tableau de dates formatées
|
|
105
|
+
updateModel([formattedStartDate, formattedEndDate])
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
isUpdatingFromInternal.value = false
|
|
110
|
+
}, 0)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// Ajouter un message d'erreur si la date de fin est antérieure à la date de début
|
|
115
|
+
if (errors && errors.value) {
|
|
116
|
+
errors.value = [DATE_PICKER_MESSAGES.ERROR_END_BEFORE_START]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
80
120
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
// Traitement pour une date unique
|
|
125
|
+
const validation = validateDateFormat(displayFormattedDate.value)
|
|
126
|
+
if (validation.isValid) {
|
|
127
|
+
const date = parseDate(displayFormattedDate.value, format)
|
|
128
|
+
if (date) {
|
|
129
|
+
// Si la date est valide, mettre à jour selectedDates et le modèle
|
|
130
|
+
try {
|
|
131
|
+
isUpdatingFromInternal.value = true
|
|
132
|
+
selectedDates.value = date
|
|
133
|
+
|
|
134
|
+
// Si on a un format de retour, formater la date dans ce format
|
|
135
|
+
const formattedValue = dateFormatReturn
|
|
136
|
+
? formatDate(date, dateFormatReturn)
|
|
137
|
+
: formatDate(date, format)
|
|
138
|
+
updateModel(formattedValue)
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
isUpdatingFromInternal.value = false
|
|
143
|
+
}, 0)
|
|
144
|
+
}
|
|
85
145
|
}
|
|
86
146
|
}
|
|
87
147
|
}
|
|
@@ -92,7 +152,11 @@ export const useInputBlurHandler = (options: {
|
|
|
92
152
|
}
|
|
93
153
|
|
|
94
154
|
// Valider la saisie manuelle (affiche les messages d'erreur)
|
|
95
|
-
|
|
155
|
+
// Note: La vérification du type string a déjà été faite plus haut
|
|
156
|
+
// et on retourne si ce n'est pas une chaîne, donc ici displayFormattedDate.value est forcément une chaîne
|
|
157
|
+
if (displayFormattedDate.value) {
|
|
158
|
+
validateManualInput(displayFormattedDate.value || '')
|
|
159
|
+
}
|
|
96
160
|
}
|
|
97
161
|
|
|
98
162
|
return {
|
|
@@ -1,82 +1,180 @@
|
|
|
1
|
-
import { ref, nextTick } from 'vue'
|
|
1
|
+
import { ref, nextTick, type Ref } from 'vue'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Composable pour personnaliser les boutons du mois et de l'année dans les composants DatePicker
|
|
5
5
|
* @param isPickerVisibleGetter - Fonction qui retourne l'état de visibilité du DatePicker
|
|
6
|
+
* @param monthName - Référence au nom du mois à utiliser
|
|
7
|
+
* @param yearName - Référence au nom de l'année à utiliser
|
|
6
8
|
*/
|
|
7
|
-
export function useMonthButtonCustomization(
|
|
9
|
+
export function useMonthButtonCustomization(
|
|
10
|
+
isPickerVisibleGetter: () => boolean,
|
|
11
|
+
monthName?: Ref<string | null>,
|
|
12
|
+
yearName?: Ref<string | null>,
|
|
13
|
+
) {
|
|
8
14
|
const monthButtonText = ref('')
|
|
9
15
|
const yearText = ref('')
|
|
10
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Retourne un nom personnalisé pour le mois en fonction de sa valeur
|
|
19
|
+
* @param monthName - Le nom du mois à personnaliser
|
|
20
|
+
* @returns Le nom personnalisé du mois
|
|
21
|
+
*/
|
|
22
|
+
const getCustomMonthName = (monthName: string | null | undefined): string => {
|
|
23
|
+
if (!monthName) return ''
|
|
24
|
+
|
|
25
|
+
// Convertir en minuscules pour faciliter la comparaison
|
|
26
|
+
const lowerMonth = monthName.toLowerCase()
|
|
27
|
+
|
|
28
|
+
switch (lowerMonth) {
|
|
29
|
+
case 'january':
|
|
30
|
+
case 'janvier':
|
|
31
|
+
return 'Janv.'
|
|
32
|
+
case 'february':
|
|
33
|
+
case 'février':
|
|
34
|
+
return 'Févr.'
|
|
35
|
+
case 'march':
|
|
36
|
+
case 'mars':
|
|
37
|
+
return 'Mars'
|
|
38
|
+
case 'april':
|
|
39
|
+
case 'avril':
|
|
40
|
+
return 'Avr.'
|
|
41
|
+
case 'may':
|
|
42
|
+
case 'mai':
|
|
43
|
+
return 'Mai'
|
|
44
|
+
case 'june':
|
|
45
|
+
case 'juin':
|
|
46
|
+
return 'Juin'
|
|
47
|
+
case 'july':
|
|
48
|
+
case 'juillet':
|
|
49
|
+
return 'Juil.'
|
|
50
|
+
case 'august':
|
|
51
|
+
case 'août':
|
|
52
|
+
return 'Août'
|
|
53
|
+
case 'september':
|
|
54
|
+
case 'septembre':
|
|
55
|
+
return 'Sept.'
|
|
56
|
+
case 'october':
|
|
57
|
+
case 'octobre':
|
|
58
|
+
return 'Oct.'
|
|
59
|
+
case 'november':
|
|
60
|
+
case 'novembre':
|
|
61
|
+
return 'Nov.'
|
|
62
|
+
case 'december':
|
|
63
|
+
case 'décembre':
|
|
64
|
+
return 'Déc.'
|
|
65
|
+
default:
|
|
66
|
+
// Si le mois n'est pas reconnu, retourner le mois avec la première lettre en majuscule
|
|
67
|
+
return monthName.charAt(0).toUpperCase() + monthName.slice(1)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
11
71
|
/**
|
|
12
72
|
* Récupère et modifie les boutons du mois et de l'année avec une icône SVG chevron-down
|
|
13
73
|
*/
|
|
14
74
|
const customizeMonthButton = () => {
|
|
15
|
-
if (isPickerVisibleGetter()) {
|
|
75
|
+
if (isPickerVisibleGetter() || monthName?.value) {
|
|
16
76
|
nextTick(() => {
|
|
17
|
-
// Personnalisation
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
// Récupérer le texte original et le nettoyer
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// Extraire le mois et l'année
|
|
77
|
+
// Personnalisation des boutons du mois pour tous les DatePickers
|
|
78
|
+
const monthBtns = document.querySelectorAll('.v-date-picker-controls__month-btn')
|
|
79
|
+
if (monthBtns.length > 0) {
|
|
80
|
+
// Récupérer le texte original et le nettoyer du premier bouton pour référence
|
|
81
|
+
// Cela n'affectera pas la personnalisation des autres boutons
|
|
82
|
+
monthButtonText.value = monthBtns[0].textContent?.trim() || ''
|
|
24
83
|
const parts = monthButtonText.value.split(' ')
|
|
25
|
-
const monthText = parts[0]
|
|
26
84
|
yearText.value = parts.length > 1 ? parts[1] : ''
|
|
27
85
|
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
86
|
+
// Appliquer la personnalisation à tous les boutons du mois
|
|
87
|
+
monthBtns.forEach((monthBtn) => {
|
|
88
|
+
// Extraire le mois et l'année pour ce bouton spécifique
|
|
89
|
+
const btnText = monthBtn.textContent?.trim() || ''
|
|
90
|
+
const btnParts = btnText.split(' ')
|
|
91
|
+
// Utiliser le monthName fourni s'il existe, sinon utiliser le texte extrait
|
|
92
|
+
const rawMonthText = monthName?.value || btnParts[0]
|
|
93
|
+
// Personnaliser le nom du mois avec notre fonction switch case
|
|
94
|
+
const monthText = getCustomMonthName(rawMonthText)
|
|
95
|
+
|
|
96
|
+
// Créer un bouton stylisé comme un VBtn avec une icône Material Design
|
|
97
|
+
const buttonHTML = `
|
|
98
|
+
<button class="v-btn v-btn--density-comfortable v-btn--variant-text v-theme--light v-btn--size-default" style="color: var(--v-theme-primary); margin-left: -12px;" data-ripple="false">
|
|
99
|
+
<span class="v-btn__overlay"></span>
|
|
100
|
+
<span class="v-btn__underlay"></span>
|
|
101
|
+
<div class="v-btn__content" data-no-activator="" style="color: var(--v-theme-primary);">
|
|
102
|
+
<span style="color: var(--v-theme-primary);">${monthText.charAt(0).toUpperCase() + monthText.slice(1)}</span>
|
|
103
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" class="ms-1" style="fill: var(--v-theme-primary);" aria-label="chevron-down"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg>
|
|
104
|
+
</div>
|
|
105
|
+
</button>
|
|
106
|
+
`
|
|
107
|
+
|
|
108
|
+
// Remplacer le contenu du bouton original
|
|
109
|
+
monthBtn.innerHTML = buttonHTML
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
// Personnalisation des boutons d'année pour tous les DatePickers
|
|
113
|
+
const yearBtns = document.querySelectorAll('.v-date-picker-controls__mode-btn')
|
|
114
|
+
yearBtns.forEach((yearBtn) => {
|
|
115
|
+
// Trouver le parent DatePicker-controls pour ce bouton d'année
|
|
116
|
+
const parentControl = yearBtn.closest('.v-date-picker-controls')
|
|
117
|
+
if (!parentControl) return
|
|
118
|
+
|
|
119
|
+
// Trouver le bouton de mois correspondant dans le même contrôle
|
|
120
|
+
const siblingMonthBtn = parentControl.querySelector('.v-date-picker-controls__month-btn')
|
|
121
|
+
if (!siblingMonthBtn) return
|
|
122
|
+
|
|
123
|
+
// Extraire le texte du bouton de mois pour obtenir l'année
|
|
124
|
+
const monthBtnText = siblingMonthBtn.textContent?.trim() || ''
|
|
125
|
+
const monthBtnParts = monthBtnText.split(' ')
|
|
126
|
+
|
|
127
|
+
// Déterminer l'année à afficher selon les priorités
|
|
128
|
+
let displayedYear = ''
|
|
129
|
+
if (yearName?.value) {
|
|
130
|
+
displayedYear = yearName.value
|
|
131
|
+
}
|
|
132
|
+
else if (monthBtnParts.length > 1) {
|
|
133
|
+
displayedYear = monthBtnParts[1]
|
|
61
134
|
}
|
|
62
|
-
|
|
135
|
+
else if (yearText.value) {
|
|
136
|
+
displayedYear = yearText.value
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// Si aucune année n'est trouvée, utiliser l'année courante
|
|
140
|
+
displayedYear = new Date().getFullYear().toString()
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Créer un bouton stylisé pour l'année
|
|
144
|
+
const yearButtonHTML = `
|
|
145
|
+
<button class="v-btn v-btn--density-comfortable v-btn--variant-text v-theme--light v-btn--size-default" style="color: var(--v-theme-primary);" data-ripple="false">
|
|
146
|
+
<span class="v-btn__overlay"></span>
|
|
147
|
+
<span class="v-btn__underlay"></span>
|
|
148
|
+
<div class="v-btn__content" data-no-activator="" style="color: var(--v-theme-primary);">
|
|
149
|
+
<span style="color: var(--v-theme-primary);">${displayedYear}</span>
|
|
150
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" class="ms-1" style="fill: var(--v-theme-primary);" aria-label="chevron-down"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg>
|
|
151
|
+
</div>
|
|
152
|
+
</button>
|
|
153
|
+
`
|
|
154
|
+
|
|
155
|
+
// Remplacer le contenu du bouton d'année
|
|
156
|
+
yearBtn.innerHTML = yearButtonHTML
|
|
157
|
+
})
|
|
63
158
|
}
|
|
64
159
|
})
|
|
65
160
|
}
|
|
66
161
|
}
|
|
67
162
|
|
|
68
163
|
/**
|
|
69
|
-
* Configure
|
|
164
|
+
* Configure des observateurs pour détecter les changements dans le DOM
|
|
70
165
|
* et personnaliser les boutons du mois et de l'année automatiquement avec une icône SVG chevron-down
|
|
166
|
+
* pour tous les DatePickers présents sur la page
|
|
71
167
|
*/
|
|
72
168
|
const setupMonthButtonObserver = () => {
|
|
73
169
|
nextTick(() => {
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
170
|
+
const targetNodes = document.querySelectorAll('.v-date-picker-controls')
|
|
171
|
+
if (targetNodes.length > 0) {
|
|
172
|
+
targetNodes.forEach((targetNode) => {
|
|
173
|
+
const observer = new MutationObserver(() => {
|
|
174
|
+
customizeMonthButton()
|
|
175
|
+
})
|
|
176
|
+
observer.observe(targetNode, { childList: true, subtree: true })
|
|
78
177
|
})
|
|
79
|
-
observer.observe(targetNode, { childList: true, subtree: true })
|
|
80
178
|
}
|
|
81
179
|
})
|
|
82
180
|
}
|
|
@@ -51,6 +51,7 @@ export const Default: Story = {
|
|
|
51
51
|
label="Nom avec accents"
|
|
52
52
|
color="primary"
|
|
53
53
|
variant="outlined"
|
|
54
|
+
bg-color="white"
|
|
54
55
|
/>
|
|
55
56
|
</DiacriticPicker>
|
|
56
57
|
</template>`,
|
|
@@ -110,6 +111,7 @@ export const Default: Story = {
|
|
|
110
111
|
label="Nom avec accents"
|
|
111
112
|
color="primary"
|
|
112
113
|
variant="outlined"
|
|
114
|
+
bg-color="white"
|
|
113
115
|
/>
|
|
114
116
|
</DiacriticPicker>
|
|
115
117
|
<div class="mt-2">Valeur actuelle: {{ value }}</div>
|
|
@@ -130,6 +132,7 @@ export const WithTextarea: Story = {
|
|
|
130
132
|
v-model="adresse"
|
|
131
133
|
label="Adresse"
|
|
132
134
|
color="primary"
|
|
135
|
+
bg-color="white"
|
|
133
136
|
variant="outlined"
|
|
134
137
|
auto-grow
|
|
135
138
|
/>
|
|
@@ -190,6 +193,7 @@ export const WithTextarea: Story = {
|
|
|
190
193
|
v-model="value"
|
|
191
194
|
label="Adresse"
|
|
192
195
|
color="primary"
|
|
196
|
+
bg-color="white"
|
|
193
197
|
variant="outlined"
|
|
194
198
|
auto-grow
|
|
195
199
|
/>
|
|
@@ -213,6 +217,7 @@ export const CustomDiacritics: Story = {
|
|
|
213
217
|
label="Texte avec accents personnalisés"
|
|
214
218
|
color="primary"
|
|
215
219
|
variant="outlined"
|
|
220
|
+
bg-color="white"
|
|
216
221
|
/>
|
|
217
222
|
</DiacriticPicker>
|
|
218
223
|
</template>`,
|
|
@@ -265,6 +270,7 @@ export const CustomDiacritics: Story = {
|
|
|
265
270
|
label="Texte avec accents personnalisés"
|
|
266
271
|
color="primary"
|
|
267
272
|
variant="outlined"
|
|
273
|
+
bg-color="white"
|
|
268
274
|
/>
|
|
269
275
|
</DiacriticPicker>
|
|
270
276
|
<div class="mt-2">Valeur actuelle: {{ value }}</div>
|
|
@@ -286,6 +292,7 @@ export const CustomButtonTitle: Story = {
|
|
|
286
292
|
label="Texte avec bouton personnalisé"
|
|
287
293
|
color="primary"
|
|
288
294
|
variant="outlined"
|
|
295
|
+
bg-color="white"
|
|
289
296
|
/>
|
|
290
297
|
</DiacriticPicker>
|
|
291
298
|
</template>`,
|
|
@@ -345,6 +352,7 @@ export const CustomButtonTitle: Story = {
|
|
|
345
352
|
label="Texte avec bouton personnalisé"
|
|
346
353
|
color="primary"
|
|
347
354
|
variant="outlined"
|
|
355
|
+
bg-color="white"
|
|
348
356
|
/>
|
|
349
357
|
</DiacriticPicker>
|
|
350
358
|
<div class="mt-2">Valeur actuelle: {{ value }}</div>
|
|
@@ -379,6 +387,7 @@ export const Customization: Story = {
|
|
|
379
387
|
label="Options Vuetify personnalisées"
|
|
380
388
|
color="secondary"
|
|
381
389
|
variant="outlined"
|
|
390
|
+
bg-color="white"
|
|
382
391
|
/>
|
|
383
392
|
</DiacriticPicker>
|
|
384
393
|
</template>`,
|
|
@@ -437,6 +446,7 @@ export const Customization: Story = {
|
|
|
437
446
|
label="Options Vuetify personnalisées"
|
|
438
447
|
color="secondary"
|
|
439
448
|
variant="outlined"
|
|
449
|
+
bg-color="white"
|
|
440
450
|
/>
|
|
441
451
|
</DiacriticPicker>
|
|
442
452
|
<div class="mt-2">Valeur actuelle: {{ value }}</div>
|
|
@@ -181,6 +181,14 @@ export const Legende: StoryObj = {
|
|
|
181
181
|
Problèmes relevés par Tanaguru
|
|
182
182
|
</div>
|
|
183
183
|
</div>
|
|
184
|
+
<div class="mt-4">
|
|
185
|
+
<p>Rapport d’audit manuel : <a href="/audits/ErrorPage.xlsx" style="color:#0C41BD;">Voir le
|
|
186
|
+
rapport</a></p>
|
|
187
|
+
<p style="color: grey; font-size: 14px">Correctifs associés (<a
|
|
188
|
+
href="https://github.com/assurance-maladie-digital/design-system-v3/issues/652" target="_blank"
|
|
189
|
+
style="color:#0C41BD;"
|
|
190
|
+
>issue #652</a>)</p>
|
|
191
|
+
</div>
|
|
184
192
|
</div>
|
|
185
193
|
`,
|
|
186
194
|
}
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
import { locales } from './locales'
|
|
4
4
|
import PageContainer from '../PageContainer/PageContainer.vue'
|
|
5
5
|
|
|
6
|
+
// Fonction pour formater le message et ajouter des liens tel: aux numéros de téléphone
|
|
7
|
+
const formatMessage = (message: string): string => {
|
|
8
|
+
// Regex pour détecter les numéros de téléphone comme 3646
|
|
9
|
+
return message.replace(/\b(3646|\d{10})\b/g, '<a href="tel:$1">$1</a>')
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
withDefaults(defineProps<{
|
|
7
13
|
pageTitle?: string
|
|
8
14
|
message?: string
|
|
@@ -44,16 +50,17 @@
|
|
|
44
50
|
{{ code }}
|
|
45
51
|
</div>
|
|
46
52
|
|
|
47
|
-
<
|
|
53
|
+
<h1
|
|
48
54
|
v-if="pageTitle"
|
|
49
55
|
class="mb-2 font-weight-bold text-h5 mb-4"
|
|
50
56
|
>
|
|
51
57
|
{{ pageTitle }}
|
|
52
|
-
</
|
|
58
|
+
</h1>
|
|
53
59
|
|
|
54
|
-
<p
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
<p
|
|
61
|
+
v-if="message"
|
|
62
|
+
v-html="formatMessage(message)"
|
|
63
|
+
/>
|
|
57
64
|
|
|
58
65
|
<slot name="additional-content" />
|
|
59
66
|
|
|
@@ -63,7 +70,6 @@
|
|
|
63
70
|
:to="btnLink"
|
|
64
71
|
:href="btnHref"
|
|
65
72
|
color="primary"
|
|
66
|
-
exact
|
|
67
73
|
class="mt-6"
|
|
68
74
|
>
|
|
69
75
|
{{ btnText }}
|