@cnamts/synapse 1.0.22 → 1.0.24
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-BWLR3U7W.js +114 -0
- package/dist/AutocompleteFilter-D9jzRzAL.cjs +1 -0
- package/dist/{DateFilter-B5n-ZkLi.js → DateFilter-BpwFexzi.js} +1 -1
- package/dist/DateFilter-DTUl8hb1.cjs +1 -0
- package/dist/{NumberFilter-CtiZ9uj8.js → NumberFilter-Bz_NTdX9.js} +3 -3
- package/dist/NumberFilter-MAEojdk0.cjs +1 -0
- package/dist/PeriodFilter-CC4WgIhl.cjs +1 -0
- package/dist/{PeriodFilter-DzqiMb-b.js → PeriodFilter-DX_wy9g-.js} +1 -1
- package/dist/SelectFilter-BR3fvl-a.cjs +1 -0
- package/dist/SelectFilter-xqiPtPgX.js +135 -0
- package/dist/{TextFilter-BOFRNfcX.js → TextFilter-BBl3JFqK.js} +7 -7
- package/dist/TextFilter-CCfYFl5F.cjs +1 -0
- package/dist/apLightTheme-CFSRrjv2.cjs +1 -0
- package/dist/apLightTheme-D1P4jcD0.js +1231 -0
- package/dist/components/Accordion/Accordion.d.ts +13 -2
- package/dist/components/Accordion/composables/useAccordionState.d.ts +2 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +7022 -9616
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +40 -40
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +61 -61
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +7168 -9762
- package/dist/components/Amelipro/AmeliproStepper/AmeliproStepper.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +7506 -10100
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +22 -22
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +42 -42
- package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +2 -2
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +20 -498
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +130 -147
- package/dist/components/Customs/Selects/SyAutocomplete/locales.d.ts +5 -0
- package/dist/components/Customs/Selects/SyInputSelect/SyInputSelect.d.ts +6 -6
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +13 -17
- package/dist/components/Customs/Selects/SySelect/locales.d.ts +1 -0
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +9 -9
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +29 -507
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +29 -507
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +64 -81
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +640 -780
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +322 -407
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +114 -156
- package/dist/components/DatePicker/composables/index.d.ts +1 -0
- package/dist/components/DatePicker/composables/useDatePickerFocusTrap.d.ts +11 -0
- package/dist/components/DatePicker/composables/useDateTextField.d.ts +4 -4
- package/dist/components/DatePicker/composables/useDateValidation.d.ts +3 -3
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +2 -2
- package/dist/components/DatePicker/composables/useManualDateValidation.d.ts +2 -2
- package/dist/components/ErrorPage/ErrorPage.d.ts +3 -1
- package/dist/components/FileList/UploadItem/UploadItem.d.ts +6 -0
- package/dist/components/FileList/UploadItem/locales.d.ts +1 -4
- package/dist/components/FileUpload/FileUploadContent.d.ts +2 -0
- package/dist/components/FileUpload/validateFiles.d.ts +2 -1
- package/dist/components/HeaderBar/HeaderBar.d.ts +2 -1
- package/dist/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +2 -1
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +6 -5
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +20 -28
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +3 -3
- package/dist/components/MonthPicker/MonthPicker.d.ts +1903 -0
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +1863 -0
- package/dist/components/MonthPicker/MonthPickerText/useTextField.d.ts +21 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.d.ts +21 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.d.ts +12 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthSelector.d.ts +11 -0
- package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.d.ts +6 -0
- package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.d.ts +14 -0
- package/dist/components/MonthPicker/MonthPickerVisual/YearSelector.d.ts +14 -0
- package/dist/components/MonthPicker/MonthPickerVisual/useMonthGrid.d.ts +9 -0
- package/dist/components/MonthPicker/MonthPickerVisual/useYearGrid.d.ts +8 -0
- package/dist/components/MonthPicker/MonthPickerVisual/utils.d.ts +8 -0
- package/dist/components/MonthPicker/locales.d.ts +12 -0
- package/dist/components/MonthPicker/useMonthPickerValidation.d.ts +25 -0
- package/dist/components/NirField/NirField.d.ts +209 -271
- package/dist/components/NirField/locales.d.ts +10 -10
- package/dist/components/NirField/useNirValidation.d.ts +64 -0
- package/dist/components/NotificationBar/Notification/Notification.d.ts +3 -0
- package/dist/components/PasswordField/PasswordField.d.ts +9 -10
- package/dist/components/PeriodField/PeriodField.d.ts +1379 -1659
- package/dist/components/PhoneField/PhoneField.d.ts +90 -125
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +12 -12
- package/dist/components/SyBtnMenu/SyBtnMenu.d.ts +1 -1
- package/dist/components/SyHeading/SyHeading.a11y.test.d.ts +1 -0
- package/dist/components/SyHeading/SyHeading.d.ts +4 -2
- package/dist/components/SyHeading/SyHeading.test.d.ts +1 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +35 -15
- package/dist/components/SyTextArea/useDefaultValidationRules.d.ts +11 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +11 -8
- package/dist/components/Tables/SyTable/SyTable.d.ts +11 -8
- package/dist/components/Tables/common/SyTableFilter.d.ts +2 -3
- package/dist/components/Tables/common/SyTablePagination.d.ts +21 -23
- package/dist/components/Tables/common/filters/AutocompleteFilter.d.ts +120 -0
- package/dist/components/Tables/common/filters/locales.d.ts +0 -1
- package/dist/components/Tables/common/types.d.ts +19 -3
- package/dist/components/Tables/common/useClickableTableRow.d.ts +17 -0
- package/dist/components/Tables/common/usePagination.d.ts +3 -1
- package/dist/components/Tables/common/usePinnedColumns.d.ts +31 -0
- package/dist/components/Tables/common/useTableHeaders.d.ts +2 -0
- package/dist/components/Tables/common/useTableRowCheckboxAccessibility.d.ts +5 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +6 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/date/useDatePickerAccessibility.d.ts +1 -1
- package/dist/composables/rules/useFieldValidation.d.ts +4 -4
- package/dist/composables/unifyValidation/useCustomValidation.d.ts +8 -0
- package/dist/composables/unifyValidation/useValidation.d.ts +102 -0
- package/dist/composables/unifyValidation/useVuetifyValidation.d.ts +18 -0
- package/dist/composables/useFormFieldErrorHandling.d.ts +2 -2
- package/dist/composables/validation/useFormValidation.d.ts +11 -2
- package/dist/composables/validation/useValidation.d.ts +15 -9
- package/dist/design-system-v3.d.ts +2 -0
- package/dist/design-system-v3.js +196 -194
- package/dist/design-system-v3.umd.cjs +1 -1066
- package/dist/designTokens/tokens/cnam/cnamContextual.d.ts +5 -0
- package/dist/{main-CEl4J8_T.js → main-BtTqyn4z.js} +16983 -15576
- package/dist/main-C1e3eoxd.cjs +1067 -0
- package/dist/synapse.css +1 -0
- package/dist/tooth-11-D3sLWv2n.cjs +1 -0
- package/dist/tooth-12-CXrLuH03.cjs +1 -0
- package/dist/tooth-13-BSfo5fpT.cjs +1 -0
- package/dist/tooth-14-DMzulx0h.cjs +1 -0
- package/dist/tooth-15-BKRFVi-9.cjs +1 -0
- package/dist/tooth-16-CpuxAbuM.cjs +1 -0
- package/dist/tooth-17-BPoahUdg.cjs +1 -0
- package/dist/tooth-18-DhHJz8sy.cjs +1 -0
- package/dist/tooth-21-Dgd5hn_X.cjs +1 -0
- package/dist/tooth-22-C2Tn19sB.cjs +1 -0
- package/dist/tooth-23-C9uaaSGb.cjs +1 -0
- package/dist/tooth-24-BrK9UGpf.cjs +1 -0
- package/dist/tooth-25-CE_EfGNp.cjs +1 -0
- package/dist/tooth-26-Ctv4i9Fy.cjs +1 -0
- package/dist/tooth-27-C5J7JkWM.cjs +1 -0
- package/dist/tooth-28-Z9oWqjo0.cjs +1 -0
- package/dist/tooth-31-BrYqmkTi.cjs +1 -0
- package/dist/tooth-32-BNNR0oCZ.cjs +1 -0
- package/dist/tooth-33-DuxvqO2J.cjs +1 -0
- package/dist/tooth-34-BCSCXMB6.cjs +1 -0
- package/dist/tooth-35-BLUXkX88.cjs +1 -0
- package/dist/tooth-36-IrKHYqlA.cjs +1 -0
- package/dist/tooth-37-BYqpdMwo.cjs +1 -0
- package/dist/tooth-38-B_eNXXdu.cjs +1 -0
- package/dist/tooth-41-Ddva4Ot8.cjs +1 -0
- package/dist/tooth-42-szcDqlM0.cjs +1 -0
- package/dist/tooth-43-B3ka6rQm.cjs +1 -0
- package/dist/tooth-44-CazyQucj.cjs +1 -0
- package/dist/tooth-45-B4HQtc8n.cjs +1 -0
- package/dist/tooth-46-BPM40gbG.cjs +1 -0
- package/dist/tooth-47-Dvr20dlh.cjs +1 -0
- package/dist/tooth-48-Bd8ljGsF.cjs +1 -0
- package/dist/tooth-51-OBpwCOF3.cjs +1 -0
- package/dist/tooth-52-aKxyHcmq.cjs +1 -0
- package/dist/tooth-53-vCwJjTOc.cjs +1 -0
- package/dist/tooth-54-DsWu2iFy.cjs +1 -0
- package/dist/tooth-55-BxC1X2Dn.cjs +1 -0
- package/dist/tooth-61-BbLvxMQi.cjs +1 -0
- package/dist/tooth-62-CmTkWczP.cjs +1 -0
- package/dist/tooth-63-DI7l_2qI.cjs +1 -0
- package/dist/tooth-64-B21sOsJh.cjs +1 -0
- package/dist/tooth-65-D2ZC2VEr.cjs +1 -0
- package/dist/tooth-71-D473PPO5.cjs +1 -0
- package/dist/tooth-72-Drh1wnNu.cjs +1 -0
- package/dist/tooth-73-DzlwYI23.cjs +1 -0
- package/dist/tooth-74-8aGvcZPg.cjs +1 -0
- package/dist/tooth-75-BFK7At_r.cjs +1 -0
- package/dist/tooth-81-BZmR-I0M.cjs +1 -0
- package/dist/tooth-82-euVfUUZV.cjs +1 -0
- package/dist/tooth-83-KV010j64.cjs +1 -0
- package/dist/tooth-84-BBg1RjhZ.cjs +1 -0
- package/dist/tooth-85-Cr-kc1wM.cjs +1 -0
- package/dist/vuetifyConfig.js +561 -0
- package/dist/vuetifyConfig.umd.cjs +1 -0
- package/package.json +18 -6
- package/src/assets/apTokens.scss +2 -2
- package/src/assets/overrides/_btns.scss +2 -0
- package/src/assets/overrides/_forms.scss +9 -0
- package/src/assets/overrides/_icons.scss +41 -4
- package/src/assets/overrides/_tables.scss +19 -0
- package/src/assets/overrides/_typography.scss +0 -10
- package/src/components/Accordion/Accordion.mdx +23 -9
- package/src/components/Accordion/Accordion.stories.ts +153 -3
- package/src/components/Accordion/Accordion.vue +7 -6
- package/src/components/Accordion/composables/__tests__/useAccordionState.spec.ts +40 -12
- package/src/components/Accordion/composables/useAccordionState.ts +3 -4
- package/src/components/Accordion/tests/accordion.spec.ts +131 -19
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.mdx +3 -1
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.stories.ts +8 -0
- package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +2 -2
- package/src/components/BackBtn/accessibilite/Accessibility.mdx +62 -10
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +9 -3
- package/src/components/BackToTopBtn/accessibilite/Accessibility.mdx +86 -6
- package/src/components/Captcha/accessibilite/Accessibility.mdx +86 -8
- package/src/components/Captcha/tests/Captcha.spec.ts +0 -29
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +14 -122
- package/src/components/ChipList/ChipList.stories.ts +0 -15
- package/src/components/ChipList/ChipList.vue +5 -1
- package/src/components/ChipList/accessibilite/Accessibility.mdx +83 -10
- package/src/components/ChipList/tests/ChipList.a11y.spec.ts +41 -0
- package/src/components/Customs/Selects/SelectBtnField/accessibilite/Accessibility.mdx +124 -10
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +379 -93
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +162 -84
- package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibilite.stories.ts +40 -1
- package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibility.mdx +7 -1
- package/src/components/Customs/Selects/SyAutocomplete/locales.ts +5 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +96 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +377 -9
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +27 -13
- package/src/components/Customs/Selects/SyAutocomplete/utils/useSelectionLogic.ts +9 -10
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.stories.ts +4 -4
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.vue +8 -9
- package/src/components/Customs/Selects/SyInputSelect/tests/SyInputSelect.spec.ts +10 -10
- package/src/components/Customs/Selects/SySelect/SySelect.vue +60 -14
- package/src/components/Customs/Selects/SySelect/locales.ts +1 -0
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +54 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +6 -9
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +10 -16
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +16 -11
- package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +35 -0
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.a11y.spec.ts +134 -2
- package/src/components/Customs/SyForm/SyForm.stories.ts +31 -5
- package/src/components/Customs/SyIcon/SyIcon.vue +1 -1
- package/src/components/Customs/SyIcon/tests/SyIcon.a11y.spec.ts +20 -0
- package/src/components/Customs/SyIconButton/SyIconButton.mdx +46 -0
- package/src/components/Customs/SyIconButton/SyIconButton.stories.ts +184 -0
- package/src/components/Customs/SyIconButton/SyIconButton.vue +38 -0
- package/src/components/Customs/SyIconButton/accessibilite/Accessibility.mdx +64 -0
- package/src/components/Customs/SyIconButton/tests/SyIconButton.a11y.spec.ts +87 -0
- package/src/components/Customs/SyIconButton/tests/SyIconButton.spec.ts +152 -0
- package/src/components/Customs/SyIconButton/tests/__snapshots__/SyIconButton.spec.ts.snap +61 -0
- package/src/components/Customs/SyPagination/SyPagination.vue +5 -5
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +4 -7
- package/src/components/Customs/SyTextField/SyTextField.mdx +1 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +29 -27
- package/src/components/Customs/SyTextField/SyTextField.vue +174 -159
- package/src/components/Customs/SyTextField/accessibilite/Accessibility.mdx +67 -9
- package/src/components/Customs/SyTextField/tests/SyTextField.a11y.spec.ts +47 -0
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +155 -10
- package/src/components/DataList/accessibilite/Accessibility.mdx +79 -11
- package/src/components/DataListGroup/accessibilite/Accessibility.mdx +80 -11
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +62 -58
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +330 -223
- package/src/components/DatePicker/CalendarMode/accessibilite/Accessibility.mdx +82 -0
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +141 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +2 -56
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +195 -159
- package/src/components/DatePicker/ComplexDatePicker/accessibilite/Accessibility.mdx +76 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +10 -10
- package/src/components/DatePicker/DatePickerValidationExample/CalendarMode.stories.ts +8 -8
- package/src/components/DatePicker/DatePickerValidationExample/ComplexDatePicker.stories.ts +106 -8
- package/src/components/DatePicker/DatePickerValidationExample/DateTextInput.stories.ts +12 -11
- package/src/components/DatePicker/DatePickerValidationExample/MultiMode.stories.ts +12 -12
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +0 -12
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +63 -57
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +3 -0
- package/src/components/DatePicker/DateTextInput/accessibilite/Accessibility.mdx +66 -0
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.spec.ts +52 -1
- package/src/components/DatePicker/composables/index.ts +1 -0
- package/src/components/DatePicker/composables/tests/useCalendarKeyboardNavigation.spec.ts +109 -65
- package/src/components/DatePicker/composables/tests/useDatePickerFocusTrap.spec.ts +138 -0
- package/src/components/DatePicker/composables/tests/useDateValidation.spec.ts +74 -18
- package/src/components/DatePicker/composables/tests/useInputBlurHandler.spec.ts +39 -0
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +91 -0
- package/src/components/DatePicker/composables/useCalendarKeyboardNavigation.ts +442 -36
- package/src/components/DatePicker/composables/useDatePickerFocusTrap.ts +92 -0
- package/src/components/DatePicker/composables/useDateTextField.ts +7 -6
- package/src/components/DatePicker/composables/useDateValidation.ts +36 -35
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +3 -3
- package/src/components/DatePicker/composables/useManualDateValidation.ts +6 -2
- package/src/components/DiacriticPicker/accessibilite/Accessibility.mdx +76 -8
- package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +25 -0
- package/src/components/ErrorPage/ErrorPage.stories.ts +113 -19
- package/src/components/ErrorPage/ErrorPage.vue +17 -2
- package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +17 -0
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +21 -1
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +0 -1
- package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +23 -0
- package/src/components/FileList/FileList.stories.ts +51 -1
- package/src/components/FileList/UploadItem/UploadItem.vue +13 -6
- package/src/components/FileList/UploadItem/locales.ts +3 -12
- package/src/components/FileList/accessibilite/Accessibility.mdx +3 -0
- package/src/components/FileUpload/FileUpload.vue +2 -1
- package/src/components/FileUpload/FileUploadContent.vue +2 -1
- package/src/components/FileUpload/tests/FileUpload.spec.ts +47 -0
- package/src/components/FileUpload/validateFiles.ts +5 -2
- package/src/components/FranceConnectBtn/accessibilite/Accessibility.mdx +62 -9
- package/src/components/HeaderBar/HeaderBar.stories.ts +14 -2
- package/src/components/HeaderBar/HeaderBar.vue +2 -1
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -1
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
- package/src/components/Logo/accessibilite/Accessibility.mdx +73 -11
- package/src/components/LogoBrandSection/accessibilite/Accessibility.mdx +85 -9
- package/src/components/LunarCalendar/accessibilite/Accessibility.mdx +74 -8
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +163 -0
- package/src/components/LunarCalendar/tests/LunarCalendar.spec.ts +3 -1
- package/src/components/LunarCalendar/useLunarCalendarValidation.ts +4 -5
- package/src/components/MaintenancePage/MaintenancePage.vue +1 -1
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +4 -5
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +0 -1
- package/src/components/MonthPicker/MonthPicker.mdx +35 -0
- package/src/components/MonthPicker/MonthPicker.stories.ts +527 -0
- package/src/components/MonthPicker/MonthPicker.vue +79 -0
- package/src/components/MonthPicker/MonthPickerText/MonthPickerInput.vue +89 -0
- package/src/components/MonthPicker/MonthPickerText/useTextField.ts +27 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.vue +154 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.ts +13 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthSelector.vue +137 -0
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.vue +60 -0
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +149 -0
- package/src/components/MonthPicker/MonthPickerVisual/YearSelector.vue +143 -0
- package/src/components/MonthPicker/MonthPickerVisual/useMonthGrid.ts +45 -0
- package/src/components/MonthPicker/MonthPickerVisual/useYearGrid.ts +45 -0
- package/src/components/MonthPicker/MonthPickerVisual/utils.ts +17 -0
- package/src/components/MonthPicker/accessibilite/Accessibility.mdx +59 -0
- package/src/components/MonthPicker/locales.ts +12 -0
- package/src/components/MonthPicker/tests/MonthPicker.a11y.spec.ts +71 -0
- package/src/components/MonthPicker/tests/MonthPicker.spec.ts +1249 -0
- package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +2545 -0
- package/src/components/MonthPicker/useMonthPickerValidation.ts +30 -0
- package/src/components/NirField/NirField.mdx +1 -2
- package/src/components/NirField/NirField.stories.ts +70 -6
- package/src/components/NirField/NirField.vue +64 -260
- package/src/components/NirField/accessibilite/Accessibility.mdx +2 -2
- package/src/components/NirField/locales.ts +1 -1
- package/src/components/NirField/tests/NirField.spec.ts +6 -0
- package/src/components/NirField/useNirValidation.ts +271 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +2 -3
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +22 -14
- package/src/components/NotificationBar/Notification/Notification.vue +3 -1
- package/src/components/NotificationBar/NotificationBar.stories.ts +154 -0
- package/src/components/NotificationBar/tests/NotificationBar.a11y.spec.ts +26 -0
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +60 -0
- package/src/components/PasswordField/PasswordField.stories.ts +4 -4
- package/src/components/PasswordField/PasswordField.vue +18 -24
- package/src/components/PasswordField/tests/PasswordField.spec.ts +6 -3
- package/src/components/PeriodField/PeriodField.stories.ts +4 -4
- package/src/components/PeriodField/PeriodField.vue +57 -57
- package/src/components/PeriodField/__tests__/PeriodField.async.spec.ts +32 -0
- package/src/components/PeriodField/accessibilite/Accessibility.mdx +68 -8
- package/src/components/PeriodField/tests/PeriodField.spec.ts +28 -2
- package/src/components/PhoneField/PhoneField.vue +5 -6
- package/src/components/PhoneField/tests/PhoneField.spec.ts +1 -0
- package/src/components/RangeField/RangeField.vue +6 -0
- package/src/components/RangeField/accessibilite/Accessibility.mdx +79 -11
- package/src/components/SkipLink/tests/SkipLink.a11y.spec.ts +23 -0
- package/src/components/StatusPage/StatusPage.stories.ts +118 -0
- package/src/components/StatusPage/StatusPage.vue +5 -3
- package/src/components/StatusPage/tests/StatusPage.a11y.spec.ts +22 -0
- package/src/components/StatusPage/tests/StatusPage.spec.ts +22 -0
- package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +22 -14
- package/src/components/SubHeader/tests/SubHeader.a11y.spec.ts +20 -0
- package/src/components/SyAlert/SyAlert.vue +1 -0
- package/src/components/SyAlert/accessibilite/Accessibility.mdx +79 -9
- package/src/components/SyAlert/tests/SyAlert.a11y.spec.ts +23 -0
- package/src/components/SyHeading/SyHeading.a11y.test.ts +149 -0
- package/src/components/SyHeading/SyHeading.test.ts +115 -0
- package/src/components/SyHeading/SyHeading.vue +5 -3
- package/src/components/SyTextArea/SyTextArea.stories.ts +138 -2
- package/src/components/SyTextArea/SyTextArea.vue +53 -23
- package/src/components/SyTextArea/accessibilite/Accessibility.mdx +80 -8
- package/src/components/SyTextArea/tests/SyTextArea.a11y.spec.ts +151 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +126 -3
- package/src/components/SyTextArea/useDefaultValidationRules.ts +74 -0
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +25 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +673 -1
- package/src/components/Tables/SyServerTable/SyServerTable.vue +148 -91
- package/src/components/Tables/SyServerTable/tests/SyServerTable.a11y.spec.ts +58 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +122 -0
- package/src/components/Tables/SyTable/SyTable.mdx +25 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +452 -1
- package/src/components/Tables/SyTable/SyTable.vue +130 -56
- package/src/components/Tables/SyTable/tests/SyTable.a11y.spec.ts +57 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +108 -0
- package/src/components/Tables/common/SyTableFilter.vue +22 -2
- package/src/components/Tables/common/TableHeader.vue +5 -1
- package/src/components/Tables/common/filters/AutocompleteFilter.vue +160 -0
- package/src/components/Tables/common/filters/NumberFilter.vue +1 -1
- package/src/components/Tables/common/filters/SelectFilter.vue +10 -11
- package/src/components/Tables/common/filters/TextFilter.vue +1 -1
- package/src/components/Tables/common/filters/getFilterComponent.ts +8 -1
- package/src/components/Tables/common/filters/locales.ts +0 -1
- package/src/components/Tables/common/filters/tests/AutocompleteFilter.a11y.spec.ts +110 -0
- package/src/components/Tables/common/filters/tests/AutocompleteFilter.spec.ts +203 -0
- package/src/components/Tables/common/filters/tests/SelectFilter.a11y.spec.ts +104 -0
- package/src/components/Tables/common/filters/tests/SelectFilter.spec.ts +152 -16
- package/src/components/Tables/common/tableFilterUtils.ts +3 -0
- package/src/components/Tables/common/tableStyles.scss +48 -4
- package/src/components/Tables/common/tests/filterByRange.spec.ts +2 -1
- package/src/components/Tables/common/types.ts +13 -4
- package/src/components/Tables/common/useClickableTableRow.ts +103 -0
- package/src/components/Tables/common/usePagination.ts +13 -0
- package/src/components/Tables/common/usePinnedColumns.ts +237 -0
- package/src/components/Tables/common/useTableHeaders.ts +3 -3
- package/src/components/Tables/common/useTableRowCheckboxAccessibility.ts +41 -0
- package/src/components/ToolbarContainer/tests/ToolbarContainer.a11y.spec.ts +126 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +2 -2
- package/src/components/index.ts +1 -0
- package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +2 -6
- package/src/composables/date/useDatePickerAccessibility.ts +42 -207
- package/src/composables/rules/tests/useFieldValidation.spec.ts +120 -120
- package/src/composables/rules/useFieldValidation.ts +34 -17
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +601 -0
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +2048 -0
- package/src/composables/unifyValidation/tests/useVuetifyValidation.spec.ts +184 -0
- package/src/composables/unifyValidation/useCustomValidation.ts +95 -0
- package/src/composables/unifyValidation/useValidation.ts +190 -0
- package/src/composables/unifyValidation/useVuetifyValidation.ts +54 -0
- package/src/composables/useFormFieldErrorHandling.ts +15 -9
- package/src/composables/validation/tests/useFormValidation.spec.ts +14 -0
- package/src/composables/validation/tests/useValidation.spec.ts +116 -21
- package/src/composables/validation/useFormValidation.ts +20 -13
- package/src/composables/validation/useValidatable.ts +8 -1
- package/src/composables/validation/useValidation.ts +135 -99
- package/src/composantsVuetify/Introduction.mdx +48 -0
- package/src/composantsVuetify/VBtn/VBtn.mdx +72 -0
- package/src/composantsVuetify/VBtn/v-btn.stories.ts +121 -0
- package/src/composantsVuetify/VTooltip/VTooltip.mdx +32 -0
- package/src/composantsVuetify/VTooltip/v-tooltip.stories.ts +95 -0
- package/src/designTokens/tokens/cnam/cnamContextual.ts +6 -1
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +2 -2
- package/src/stories/Components/Components.stories.ts +74 -9
- package/src/stories/Demarrer/Accueil.stories.ts +3 -3
- package/src/stories/GuideDuDev/Amelipro.mdx +15 -0
- package/src/stories/GuideDuDev/Amelipro.stories.ts +209 -0
- package/src/stories/GuideDuDev/vuetifyOptions.mdx +3 -3
- package/dist/SelectFilter-BOYlF7rX.js +0 -136
- package/dist/style.css +0 -1
- package/src/components/DatePicker/Accessibilite.mdx +0 -14
|
@@ -67,6 +67,7 @@ describe('NirField.vue', () => {
|
|
|
67
67
|
})
|
|
68
68
|
|
|
69
69
|
it('displays error message for invalid NIR length', async () => {
|
|
70
|
+
await wrapper.find('.number-field input').trigger('focus')
|
|
70
71
|
await wrapper.find('.number-field input').setValue('123')
|
|
71
72
|
await wrapper.vm.$nextTick()
|
|
72
73
|
await wrapper.find('.number-field input').trigger('blur')
|
|
@@ -76,6 +77,7 @@ describe('NirField.vue', () => {
|
|
|
76
77
|
})
|
|
77
78
|
|
|
78
79
|
it('validates the NIR field successfully', async () => {
|
|
80
|
+
await wrapper.find('.number-field input').trigger('focus')
|
|
79
81
|
await wrapper.find('.number-field input').setValue('2940375120005')
|
|
80
82
|
await wrapper.vm.$nextTick()
|
|
81
83
|
await wrapper.find('.number-field input').trigger('blur')
|
|
@@ -87,6 +89,7 @@ describe('NirField.vue', () => {
|
|
|
87
89
|
it('displays error message for invalid key length', async () => {
|
|
88
90
|
await wrapper.find('.number-field input').setValue('2940375120005')
|
|
89
91
|
await wrapper.vm.$nextTick()
|
|
92
|
+
await wrapper.find('.key-field input').trigger('focus')
|
|
90
93
|
await wrapper.find('.key-field input').setValue('1')
|
|
91
94
|
await wrapper.vm.$nextTick()
|
|
92
95
|
await wrapper.find('.key-field input').trigger('blur')
|
|
@@ -98,6 +101,7 @@ describe('NirField.vue', () => {
|
|
|
98
101
|
it('validates the key field successfully', async () => {
|
|
99
102
|
await wrapper.find('.number-field input').setValue('2940375120005')
|
|
100
103
|
await wrapper.vm.$nextTick()
|
|
104
|
+
await wrapper.find('.key-field input').trigger('focus')
|
|
101
105
|
await wrapper.find('.key-field input').setValue('91')
|
|
102
106
|
await wrapper.vm.$nextTick()
|
|
103
107
|
await wrapper.find('.key-field input').trigger('blur')
|
|
@@ -149,6 +153,7 @@ describe('NirField.vue', () => {
|
|
|
149
153
|
|
|
150
154
|
const customWrapper = mount(NirField, {
|
|
151
155
|
props: {
|
|
156
|
+
label: 'NIR Field with custom key validation',
|
|
152
157
|
modelValue: undefined,
|
|
153
158
|
customKeyRules,
|
|
154
159
|
showSuccessMessages: true,
|
|
@@ -164,6 +169,7 @@ describe('NirField.vue', () => {
|
|
|
164
169
|
const numberField = customWrapper.find('.number-field input')
|
|
165
170
|
const keyField = customWrapper.find('.key-field input')
|
|
166
171
|
await numberField.setValue('2940375120005')
|
|
172
|
+
await keyField.trigger('focus')
|
|
167
173
|
await keyField.setValue('91')
|
|
168
174
|
await keyField.trigger('blur')
|
|
169
175
|
await customWrapper.vm.$nextTick()
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { type ValidationRule as SyValidationRule } from '@/composables/validation/useValidation'
|
|
2
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, ref, type Ref } from 'vue'
|
|
3
|
+
import { checkNIR, isNIRKeyValid } from './nirValidation'
|
|
4
|
+
import type { locales } from './locales'
|
|
5
|
+
import { useValidation } from '@/composables/unifyValidation/useValidation'
|
|
6
|
+
import type { SyTextField } from '@/main'
|
|
7
|
+
import type { ValidationRule as VuetifyValidationRule } from 'vuetify'
|
|
8
|
+
|
|
9
|
+
export type NirValidationProps = {
|
|
10
|
+
customKeyRules?: SyValidationRule[]
|
|
11
|
+
customKeyWarningRules?: SyValidationRule[]
|
|
12
|
+
customNumberRules?: SyValidationRule[]
|
|
13
|
+
customNumberWarningRules?: SyValidationRule[]
|
|
14
|
+
customRulesPrecedence?: boolean
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
isValidateOnBlur?: boolean
|
|
17
|
+
keyLabel?: string
|
|
18
|
+
keyRules?: VuetifyValidationRule[]
|
|
19
|
+
nirType?: 'simple' | 'complexe'
|
|
20
|
+
numberLabel?: string
|
|
21
|
+
numberRules?: VuetifyValidationRule[]
|
|
22
|
+
readonly?: boolean
|
|
23
|
+
required?: boolean
|
|
24
|
+
showSuccessMessages?: boolean
|
|
25
|
+
useVuetifyValidation?: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Handle validation for NIR fields, including both the number and the key
|
|
30
|
+
*/
|
|
31
|
+
export function useNirValidation(
|
|
32
|
+
numberValue: Ref<string>,
|
|
33
|
+
keyValue: Ref<string>,
|
|
34
|
+
unmaskedNumberValue: Ref<string>,
|
|
35
|
+
unmaskedKeyValue: Ref<string>,
|
|
36
|
+
readonly: Ref<boolean>,
|
|
37
|
+
disabled: Ref<boolean>,
|
|
38
|
+
required: Ref<boolean>,
|
|
39
|
+
numberField: Ref<InstanceType<typeof SyTextField> | null>,
|
|
40
|
+
keyField: Ref<InstanceType<typeof SyTextField> | null>,
|
|
41
|
+
customLocale: Ref<typeof locales>,
|
|
42
|
+
numberLabel: Ref<string>,
|
|
43
|
+
keyLabel: Ref<string>,
|
|
44
|
+
customNumberRules: Ref<SyValidationRule[]>,
|
|
45
|
+
customKeyRules: Ref<SyValidationRule[]>,
|
|
46
|
+
customNumberWarningRules: Ref<SyValidationRule[]>,
|
|
47
|
+
customKeyWarningRules: Ref<SyValidationRule[]>,
|
|
48
|
+
displayKey: Ref<boolean>,
|
|
49
|
+
customRulesPrecedence: Ref<boolean>,
|
|
50
|
+
nirType: Ref<'simple' | 'complexe'>,
|
|
51
|
+
label: Ref<string>,
|
|
52
|
+
showSuccessMessages: Ref<boolean>,
|
|
53
|
+
disableErrorHandling: Ref<boolean>,
|
|
54
|
+
isValidateOnBlur: Ref<boolean>,
|
|
55
|
+
useVuetifyValidation: Ref<boolean>,
|
|
56
|
+
vuetifyNumberRules: Ref<VuetifyValidationRule[]>,
|
|
57
|
+
vuetifyKeyRules: Ref<VuetifyValidationRule[]>,
|
|
58
|
+
) {
|
|
59
|
+
// Règles de validation
|
|
60
|
+
const numberRules = computed(() => {
|
|
61
|
+
if (useVuetifyValidation.value) {
|
|
62
|
+
return []
|
|
63
|
+
}
|
|
64
|
+
const rules: SyValidationRule[] = []
|
|
65
|
+
if (required.value) {
|
|
66
|
+
rules.push({
|
|
67
|
+
type: 'required',
|
|
68
|
+
options: {
|
|
69
|
+
message: customLocale.value.errorRequiredNumber,
|
|
70
|
+
fieldIdentifier: numberLabel.value,
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Ajout des règles personnalisées avec prévalence si demandé
|
|
76
|
+
if (customRulesPrecedence.value && customNumberRules.value && customNumberRules.value.length > 0) {
|
|
77
|
+
rules.push(...customNumberRules.value.map(rule => ({
|
|
78
|
+
...rule,
|
|
79
|
+
options: rule.options || {},
|
|
80
|
+
})))
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Règle de validation standard du NIR
|
|
84
|
+
rules.push({
|
|
85
|
+
type: 'custom',
|
|
86
|
+
options: {
|
|
87
|
+
validate: (value: string) => {
|
|
88
|
+
if (!value) return true
|
|
89
|
+
// Ne valider que si tous les caractères sont saisis
|
|
90
|
+
if (value.length < 13) {
|
|
91
|
+
return customLocale.value.errorInvalidNumber || customLocale.value.errorInvalidNumber
|
|
92
|
+
}
|
|
93
|
+
const result = checkNIR(value, nirType.value)
|
|
94
|
+
return result ? true : customLocale.value.errorInvalidNumber || customLocale.value.errorInvalidNumber
|
|
95
|
+
},
|
|
96
|
+
message: customLocale.value.errorInvalidNumber,
|
|
97
|
+
successMessage: customLocale.value.successNumberValid,
|
|
98
|
+
fieldIdentifier: numberLabel.value,
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
// Ajout des règles personnalisées sans prévalence (comportement par défaut)
|
|
103
|
+
if (!customRulesPrecedence.value && customNumberRules.value && customNumberRules.value.length > 0) {
|
|
104
|
+
rules.push(...customNumberRules.value.map(rule => ({
|
|
105
|
+
...rule,
|
|
106
|
+
options: rule.options || {},
|
|
107
|
+
})))
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return rules
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const keyRules = computed(() => {
|
|
114
|
+
if (useVuetifyValidation.value) {
|
|
115
|
+
return []
|
|
116
|
+
}
|
|
117
|
+
const rules: SyValidationRule[] = []
|
|
118
|
+
if (required.value) {
|
|
119
|
+
rules.push({
|
|
120
|
+
type: 'required',
|
|
121
|
+
options: {
|
|
122
|
+
message: customLocale.value.errorRequiredKey,
|
|
123
|
+
fieldIdentifier: keyLabel.value,
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const validateKey = (value: string) => {
|
|
129
|
+
if (!value) return true
|
|
130
|
+
if (!unmaskedNumberValue.value) return true
|
|
131
|
+
const fullNir = unmaskedNumberValue.value + value
|
|
132
|
+
return isNIRKeyValid(fullNir)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Ajout des règles personnalisées
|
|
136
|
+
if (customKeyRules.value) {
|
|
137
|
+
rules.push(...customKeyRules.value)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Ajout de la règle de validation par défaut si pas de règle personnalisée avec validation de clé
|
|
141
|
+
if (!customKeyRules.value?.some(rule => rule.options.validate)) {
|
|
142
|
+
rules.push({
|
|
143
|
+
type: 'custom',
|
|
144
|
+
options: {
|
|
145
|
+
validate: validateKey,
|
|
146
|
+
message: customLocale.value.errorInvalidKey,
|
|
147
|
+
successMessage: customLocale.value.successKeyValid,
|
|
148
|
+
fieldIdentifier: keyLabel.value,
|
|
149
|
+
},
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return rules
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
// État pour suivre si une validation est en cours
|
|
157
|
+
const isValidating = ref(false)
|
|
158
|
+
const shouldValidateOnBlur = ref(false)
|
|
159
|
+
const numberFieldFocused = ref(false)
|
|
160
|
+
const keyFieldFocused = ref(false)
|
|
161
|
+
|
|
162
|
+
// update focus state on blur and focus
|
|
163
|
+
const onNumberFocus = () => {
|
|
164
|
+
numberFieldFocused.value = true
|
|
165
|
+
}
|
|
166
|
+
const onNumberBlur = () => {
|
|
167
|
+
numberFieldFocused.value = false
|
|
168
|
+
}
|
|
169
|
+
const onKeyFocus = () => {
|
|
170
|
+
keyFieldFocused.value = true
|
|
171
|
+
}
|
|
172
|
+
const onKeyBlur = () => {
|
|
173
|
+
keyFieldFocused.value = false
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
let numberInput: HTMLInputElement | null = null
|
|
177
|
+
let keyInput: HTMLInputElement | null = null
|
|
178
|
+
|
|
179
|
+
onMounted(() => {
|
|
180
|
+
numberInput = numberField.value?.$el?.querySelector('input') ?? null
|
|
181
|
+
if (numberInput) {
|
|
182
|
+
numberInput.addEventListener('focus', onNumberFocus)
|
|
183
|
+
numberInput.addEventListener('blur', onNumberBlur)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
keyInput = keyField.value?.$el?.querySelector('input') ?? null
|
|
187
|
+
if (keyInput) {
|
|
188
|
+
keyInput.addEventListener('focus', onKeyFocus)
|
|
189
|
+
keyInput.addEventListener('blur', onKeyBlur)
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
onBeforeUnmount(() => {
|
|
194
|
+
numberInput?.removeEventListener('focus', onNumberFocus)
|
|
195
|
+
numberInput?.removeEventListener('blur', onNumberBlur)
|
|
196
|
+
keyInput?.removeEventListener('focus', onKeyFocus)
|
|
197
|
+
keyInput?.removeEventListener('blur', onKeyBlur)
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
const numberValidation = useValidation({
|
|
201
|
+
modelValue: numberValue,
|
|
202
|
+
readonly,
|
|
203
|
+
disabled,
|
|
204
|
+
required,
|
|
205
|
+
isValidateOnBlur,
|
|
206
|
+
showSuccessMessages,
|
|
207
|
+
disableErrorHandling,
|
|
208
|
+
useVuetifyValidation,
|
|
209
|
+
label,
|
|
210
|
+
customRules: numberRules,
|
|
211
|
+
customWarningRules: computed(() => unmaskedNumberValue.value.length === 13 ? customNumberWarningRules.value : []),
|
|
212
|
+
rules: vuetifyNumberRules,
|
|
213
|
+
focused: numberFieldFocused,
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
const keyValidation = useValidation({
|
|
217
|
+
modelValue: keyValue,
|
|
218
|
+
readonly,
|
|
219
|
+
disabled,
|
|
220
|
+
required,
|
|
221
|
+
isValidateOnBlur,
|
|
222
|
+
showSuccessMessages,
|
|
223
|
+
disableErrorHandling,
|
|
224
|
+
useVuetifyValidation,
|
|
225
|
+
label,
|
|
226
|
+
customRules: keyRules,
|
|
227
|
+
customWarningRules: computed(() => (displayKey.value && unmaskedKeyValue.value.length === 2) ? customKeyWarningRules.value : []),
|
|
228
|
+
rules: vuetifyKeyRules,
|
|
229
|
+
focused: keyFieldFocused,
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
// Validation des champs
|
|
233
|
+
const validateFields = async (onBlur = false) => {
|
|
234
|
+
// Éviter les validations redondantes
|
|
235
|
+
if (isValidating.value) {
|
|
236
|
+
shouldValidateOnBlur.value = shouldValidateOnBlur.value || onBlur
|
|
237
|
+
return true
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
isValidating.value = true
|
|
241
|
+
|
|
242
|
+
await numberValidation.validate()
|
|
243
|
+
|
|
244
|
+
if (displayKey.value) {
|
|
245
|
+
await keyValidation.validate()
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (onBlur || shouldValidateOnBlur.value) {
|
|
249
|
+
await nextTick()
|
|
250
|
+
if (numberValidation.hasError.value) {
|
|
251
|
+
numberField.value?.$el?.querySelector?.('input')?.focus()
|
|
252
|
+
}
|
|
253
|
+
else if (keyValidation.hasError.value) {
|
|
254
|
+
keyField.value?.$el?.querySelector?.('input')?.focus()
|
|
255
|
+
}
|
|
256
|
+
shouldValidateOnBlur.value = false
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
isValidating.value = false
|
|
260
|
+
return !numberValidation.hasError.value && !keyValidation.hasError.value
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const hasFieldErrors = computed(() => numberValidation.hasError.value || keyValidation.hasError.value)
|
|
264
|
+
|
|
265
|
+
return {
|
|
266
|
+
numberValidation,
|
|
267
|
+
keyValidation,
|
|
268
|
+
validateFields,
|
|
269
|
+
hasFieldErrors,
|
|
270
|
+
}
|
|
271
|
+
}
|
|
@@ -115,13 +115,12 @@ describe('NotFoundPage', () => {
|
|
|
115
115
|
expect(img.attributes('src')).toBe('/custom.svg')
|
|
116
116
|
})
|
|
117
117
|
|
|
118
|
-
it('
|
|
118
|
+
it('uses a generated uniqueId', async () => {
|
|
119
119
|
const wrapper = mount(NotFoundPage)
|
|
120
120
|
await flushPromises()
|
|
121
121
|
await wrapper.vm.$nextTick()
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
expect(statusPage.props('uniqueId')).toBeDefined()
|
|
123
|
+
expect(wrapper.find('.vd-page-container').attributes('id')).toMatch(/^[-a-z0-9]+-container$/)
|
|
125
124
|
})
|
|
126
125
|
|
|
127
126
|
it('passes a custom uniqueId prop to StatusPage', async () => {
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`NotFoundPage > display the support ID if provided in the url 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
<div
|
|
5
|
+
class="
|
|
6
|
+
d-flex
|
|
7
|
+
justify-center
|
|
8
|
+
px-14
|
|
9
|
+
py-10
|
|
10
|
+
vd-page-container
|
|
11
|
+
"
|
|
12
|
+
id="v-0-container"
|
|
13
|
+
>
|
|
11
14
|
<div
|
|
12
15
|
class="
|
|
13
16
|
bg-transparent
|
|
14
17
|
v-sheet
|
|
15
18
|
v-theme--light
|
|
16
19
|
"
|
|
20
|
+
id="v-0-content"
|
|
17
21
|
style="width: 800px;"
|
|
18
22
|
>
|
|
19
23
|
<div class="
|
|
@@ -149,19 +153,23 @@ exports[`NotFoundPage > display the support ID if provided in the url 1`] = `
|
|
|
149
153
|
`;
|
|
150
154
|
|
|
151
155
|
exports[`NotFoundPage > renders correctly 1`] = `
|
|
152
|
-
<div
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
<div
|
|
157
|
+
class="
|
|
158
|
+
d-flex
|
|
159
|
+
justify-center
|
|
160
|
+
px-14
|
|
161
|
+
py-10
|
|
162
|
+
vd-page-container
|
|
163
|
+
"
|
|
164
|
+
id="v-0-container"
|
|
165
|
+
>
|
|
159
166
|
<div
|
|
160
167
|
class="
|
|
161
168
|
bg-transparent
|
|
162
169
|
v-sheet
|
|
163
170
|
v-theme--light
|
|
164
171
|
"
|
|
172
|
+
id="v-0-content"
|
|
165
173
|
style="width: 800px;"
|
|
166
174
|
>
|
|
167
175
|
<div class="
|
|
@@ -74,7 +74,9 @@
|
|
|
74
74
|
decorative
|
|
75
75
|
/>
|
|
76
76
|
|
|
77
|
-
<span class="notification__message">
|
|
77
|
+
<span class="notification__message">
|
|
78
|
+
<slot :notification="props.notification">{{ notification.message }}</slot>
|
|
79
|
+
</span>
|
|
78
80
|
<div
|
|
79
81
|
class="d-flex ga-2 notification__actions"
|
|
80
82
|
:class="notification.message.length > 50 ? 'action-section-long-text' : 'action-section-short-text'"
|
|
@@ -408,6 +408,160 @@ CustomCloseBtnText.parameters = {
|
|
|
408
408
|
],
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
+
export const DefaultSlot: Story = (args) => {
|
|
412
|
+
return {
|
|
413
|
+
components: { NotificationBar, VBtn },
|
|
414
|
+
setup() {
|
|
415
|
+
const { addNotification } = useNotificationService()
|
|
416
|
+
|
|
417
|
+
const envoyerNotification = () => {
|
|
418
|
+
const notification: Notification = {
|
|
419
|
+
id: Date.now().toString(),
|
|
420
|
+
message: 'Notification avec contenu principal personnalisé.',
|
|
421
|
+
type: 'info',
|
|
422
|
+
timeout: -1,
|
|
423
|
+
}
|
|
424
|
+
addNotification(notification)
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return { args, envoyerNotification }
|
|
428
|
+
},
|
|
429
|
+
template: `
|
|
430
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
431
|
+
<NotificationBar v-bind="args">
|
|
432
|
+
<template #default="{ notification }">
|
|
433
|
+
Contenu personnalisé pour <strong>{{ notification.id }}</strong>
|
|
434
|
+
</template>
|
|
435
|
+
</NotificationBar>
|
|
436
|
+
<VBtn
|
|
437
|
+
color="primary"
|
|
438
|
+
@click="envoyerNotification()"
|
|
439
|
+
class="ma-6"
|
|
440
|
+
>
|
|
441
|
+
Afficher la notification
|
|
442
|
+
</VBtn>
|
|
443
|
+
</div>
|
|
444
|
+
`,
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
DefaultSlot.args = {
|
|
449
|
+
...Default.args,
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
DefaultSlot.parameters = {
|
|
453
|
+
sourceCode: [
|
|
454
|
+
{
|
|
455
|
+
name: 'Template',
|
|
456
|
+
code: `
|
|
457
|
+
<NotificationBar>
|
|
458
|
+
<template #default="{ notification }">
|
|
459
|
+
Contenu personnalisé pour <strong>{{ notification.id }}</strong>
|
|
460
|
+
</template>
|
|
461
|
+
</NotificationBar>
|
|
462
|
+
`,
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: 'Script',
|
|
466
|
+
code: `
|
|
467
|
+
<script setup lang="ts">
|
|
468
|
+
import { NotificationBar, useNotificationService } from '@cnamts/synapse'
|
|
469
|
+
|
|
470
|
+
const { addNotification } = useNotificationService()
|
|
471
|
+
|
|
472
|
+
const envoyerNotification = () => {
|
|
473
|
+
addNotification({
|
|
474
|
+
id: Date.now().toString(),
|
|
475
|
+
message: 'Notification avec contenu principal personnalisé.',
|
|
476
|
+
type: 'info',
|
|
477
|
+
timeout: -1,
|
|
478
|
+
})
|
|
479
|
+
}
|
|
480
|
+
</script>
|
|
481
|
+
`,
|
|
482
|
+
},
|
|
483
|
+
],
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export const ActionSlot: Story = (args) => {
|
|
487
|
+
return {
|
|
488
|
+
components: { NotificationBar, VBtn },
|
|
489
|
+
setup() {
|
|
490
|
+
const { addNotification } = useNotificationService()
|
|
491
|
+
|
|
492
|
+
const envoyerNotification = () => {
|
|
493
|
+
const notification: Notification = {
|
|
494
|
+
id: Date.now().toString(),
|
|
495
|
+
message: 'Notification avec contenu personnalisé via slot.',
|
|
496
|
+
type: 'info',
|
|
497
|
+
timeout: -1,
|
|
498
|
+
}
|
|
499
|
+
addNotification(notification)
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return { args, envoyerNotification }
|
|
503
|
+
},
|
|
504
|
+
template: `
|
|
505
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
506
|
+
<NotificationBar v-bind="args">
|
|
507
|
+
<template #action>
|
|
508
|
+
<VBtn variant="outlined">
|
|
509
|
+
Voir le détail
|
|
510
|
+
</VBtn>
|
|
511
|
+
</template>
|
|
512
|
+
</NotificationBar>
|
|
513
|
+
<VBtn
|
|
514
|
+
color="primary"
|
|
515
|
+
@click="envoyerNotification()"
|
|
516
|
+
class="ma-6"
|
|
517
|
+
>
|
|
518
|
+
Afficher la notification
|
|
519
|
+
</VBtn>
|
|
520
|
+
</div>
|
|
521
|
+
`,
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
ActionSlot.args = {
|
|
526
|
+
...Default.args,
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
ActionSlot.parameters = {
|
|
530
|
+
sourceCode: [
|
|
531
|
+
{
|
|
532
|
+
name: 'Template',
|
|
533
|
+
code: `
|
|
534
|
+
<NotificationBar>
|
|
535
|
+
<template #action>
|
|
536
|
+
<VBtn variant="outlined">
|
|
537
|
+
Voir le détail
|
|
538
|
+
</VBtn>
|
|
539
|
+
</template>
|
|
540
|
+
</NotificationBar>
|
|
541
|
+
`,
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
name: 'Script',
|
|
545
|
+
code: `
|
|
546
|
+
<script setup lang="ts">
|
|
547
|
+
import { NotificationBar, useNotificationService } from '@cnamts/synapse'
|
|
548
|
+
|
|
549
|
+
const { addNotification } = useNotificationService()
|
|
550
|
+
|
|
551
|
+
const envoyerNotification = () => {
|
|
552
|
+
addNotification({
|
|
553
|
+
id: Date.now().toString(),
|
|
554
|
+
message: 'Notification avec contenu personnalisé via slot.',
|
|
555
|
+
type: 'info',
|
|
556
|
+
timeout: -1,
|
|
557
|
+
})
|
|
558
|
+
}
|
|
559
|
+
</script>
|
|
560
|
+
`,
|
|
561
|
+
},
|
|
562
|
+
],
|
|
563
|
+
}
|
|
564
|
+
|
|
411
565
|
export const Customization: Story = Default.bind({})
|
|
412
566
|
Customization.args = {
|
|
413
567
|
...Default.args,
|
|
@@ -41,6 +41,32 @@ describe('NotificationBar – accessibility (axe)', () => {
|
|
|
41
41
|
vi.restoreAllMocks()
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
+
it('has no obvious axe violations with default slot content', async () => {
|
|
45
|
+
const notification: Notification = {
|
|
46
|
+
id: '1',
|
|
47
|
+
message: 'Message original',
|
|
48
|
+
type: 'info',
|
|
49
|
+
timeout: -1,
|
|
50
|
+
icon: null,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
useNotificationService().notificationQueue.value = [notification]
|
|
54
|
+
|
|
55
|
+
const wrapper = mount(NotificationBar, {
|
|
56
|
+
attachTo: document.body,
|
|
57
|
+
slots: {
|
|
58
|
+
default: '<span>Contenu personnalisé via slot default</span>',
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const results = await axe(document.body)
|
|
63
|
+
assertNoA11yViolations(results, 'NotificationBar – default slot content', {
|
|
64
|
+
ignoreRules: ['region'],
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
wrapper.unmount()
|
|
68
|
+
})
|
|
69
|
+
|
|
44
70
|
it('has no obvious axe violations with visible info notification', async () => {
|
|
45
71
|
const notification: Notification = {
|
|
46
72
|
id: '1',
|
|
@@ -186,6 +186,66 @@ describe('NotificationBar.vue', () => {
|
|
|
186
186
|
expect(wrapper.html()).not.toContain('Test message 1')
|
|
187
187
|
})
|
|
188
188
|
|
|
189
|
+
it('should render default slot content instead of message', async () => {
|
|
190
|
+
const notification: Notification = {
|
|
191
|
+
id: '1',
|
|
192
|
+
message: 'Message original',
|
|
193
|
+
type: 'info',
|
|
194
|
+
timeout: -1,
|
|
195
|
+
icon: null,
|
|
196
|
+
}
|
|
197
|
+
notificationServiceMock.notificationQueue.value = [notification]
|
|
198
|
+
|
|
199
|
+
const wrapper = mount(NotificationBar, {
|
|
200
|
+
slots: {
|
|
201
|
+
default: '<span>Contenu personnalisé</span>',
|
|
202
|
+
},
|
|
203
|
+
})
|
|
204
|
+
vi.runAllTimers()
|
|
205
|
+
await nextTick()
|
|
206
|
+
|
|
207
|
+
expect(wrapper.html()).toContain('Contenu personnalisé')
|
|
208
|
+
expect(wrapper.html()).not.toContain('Message original')
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
it('should expose notification slotProp in default slot', async () => {
|
|
212
|
+
const notification: Notification = {
|
|
213
|
+
id: 'abc',
|
|
214
|
+
message: 'Message original',
|
|
215
|
+
type: 'info',
|
|
216
|
+
timeout: -1,
|
|
217
|
+
icon: null,
|
|
218
|
+
}
|
|
219
|
+
notificationServiceMock.notificationQueue.value = [notification]
|
|
220
|
+
|
|
221
|
+
const wrapper = mount(NotificationBar, {
|
|
222
|
+
slots: {
|
|
223
|
+
default: `<template #default="{ notification }"><span>id: {{ notification.id }}</span></template>`,
|
|
224
|
+
},
|
|
225
|
+
})
|
|
226
|
+
vi.runAllTimers()
|
|
227
|
+
await nextTick()
|
|
228
|
+
|
|
229
|
+
expect(wrapper.html()).toContain('id: abc')
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
it('should fall back to message when no default slot is provided', async () => {
|
|
233
|
+
const notification: Notification = {
|
|
234
|
+
id: '1',
|
|
235
|
+
message: 'Message fallback',
|
|
236
|
+
type: 'info',
|
|
237
|
+
timeout: -1,
|
|
238
|
+
icon: null,
|
|
239
|
+
}
|
|
240
|
+
notificationServiceMock.notificationQueue.value = [notification]
|
|
241
|
+
|
|
242
|
+
const wrapper = mount(NotificationBar)
|
|
243
|
+
vi.runAllTimers()
|
|
244
|
+
await nextTick()
|
|
245
|
+
|
|
246
|
+
expect(wrapper.html()).toContain('Message fallback')
|
|
247
|
+
})
|
|
248
|
+
|
|
189
249
|
it('should compute action', async () => {
|
|
190
250
|
const notification: Notification = {
|
|
191
251
|
id: '1',
|
|
@@ -962,9 +962,9 @@ export const WithFormValidation: Story = {
|
|
|
962
962
|
]
|
|
963
963
|
|
|
964
964
|
// Fonction de soumission du formulaire
|
|
965
|
-
const handleSubmit = () => {
|
|
965
|
+
const handleSubmit = async (): Promise<void> => {
|
|
966
966
|
if (passwordFieldRef.value) {
|
|
967
|
-
const isValid = passwordFieldRef.value.validateOnSubmit()
|
|
967
|
+
const isValid = await passwordFieldRef.value.validateOnSubmit()
|
|
968
968
|
if (isValid) {
|
|
969
969
|
formStatus.value = 'Formulaire soumis avec succès !'
|
|
970
970
|
} else {
|
|
@@ -1013,9 +1013,9 @@ export const WithFormValidation: Story = {
|
|
|
1013
1013
|
]
|
|
1014
1014
|
|
|
1015
1015
|
// Fonction de soumission du formulaire
|
|
1016
|
-
const handleSubmit = () => {
|
|
1016
|
+
const handleSubmit = async () => {
|
|
1017
1017
|
if (passwordFieldRef.value) {
|
|
1018
|
-
const isValid = passwordFieldRef.value.validateOnSubmit()
|
|
1018
|
+
const isValid = await passwordFieldRef.value.validateOnSubmit()
|
|
1019
1019
|
if (isValid) {
|
|
1020
1020
|
formStatus.value = 'Formulaire soumis avec succès !'
|
|
1021
1021
|
}
|