@cnamts/synapse 0.0.11-alpha → 0.0.13-alpha
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/design-system-v3.js +5394 -3813
- package/dist/design-system-v3.umd.cjs +1 -1
- package/dist/src/components/Amelipro/types/types.d.ts +38 -0
- package/dist/src/components/CookieBanner/CookieBanner.d.ts +1 -1
- package/dist/src/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -0
- package/dist/src/components/Customs/SyTextField/SyTextField.d.ts +31 -23
- package/dist/src/components/Customs/SyTextField/types.d.ts +1 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +105 -102
- package/dist/src/components/DatePicker/DateTextInput.d.ts +82 -74
- package/dist/src/components/ErrorPage/ErrorPage.d.ts +1 -1
- package/dist/src/components/FileList/FileList.d.ts +1 -0
- package/dist/src/components/FileList/UploadItem/UploadItem.d.ts +1 -1
- package/dist/src/components/FilterInline/AccessibiliteItems.d.ts +30 -0
- package/dist/src/components/FilterInline/constants/ExpertiseLevelEnum.d.ts +4 -0
- package/dist/src/components/FilterSideBar/AccessibiliteItems.d.ts +29 -0
- package/dist/src/components/FilterSideBar/FilterSideBar.d.ts +31 -0
- package/dist/src/components/FilterSideBar/constants/ExpertiseLevelEnum.d.ts +4 -0
- package/dist/src/components/FilterSideBar/locales.d.ts +7 -0
- package/dist/src/components/LangBtn/LangBtn.d.ts +2 -2
- package/dist/src/components/NirField/NirField.d.ts +952 -0
- package/dist/src/components/NotificationBar/NotificationBar.d.ts +6 -6
- package/dist/src/components/PasswordField/PasswordField.d.ts +42 -8
- package/dist/src/components/PeriodField/PeriodField.d.ts +259 -235
- package/dist/src/components/PhoneField/PhoneField.d.ts +33 -3
- package/dist/src/components/RatingPicker/EmotionPicker/EmotionPicker.d.ts +1 -1
- package/dist/src/components/RatingPicker/NumberPicker/NumberPicker.d.ts +1 -1
- package/dist/src/components/RatingPicker/StarsPicker/StarsPicker.d.ts +1 -1
- package/dist/src/components/UploadWorkflow/AccessibiliteItems.d.ts +29 -0
- package/dist/src/components/UploadWorkflow/config.d.ts +29 -0
- package/dist/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.d.ts +4 -0
- package/dist/src/components/UploadWorkflow/locales.d.ts +7 -0
- package/dist/src/components/UploadWorkflow/types.d.ts +19 -0
- package/dist/src/components/UploadWorkflow/useFileList.d.ts +10 -0
- package/dist/src/components/UploadWorkflow/useFileUploadJourney.d.ts +9 -0
- package/dist/src/components/Usages/Usages.d.ts +10 -0
- package/dist/src/components/index.d.ts +5 -0
- package/dist/src/composables/date/tests/useDateFormat.spec.d.ts +1 -0
- package/dist/src/composables/date/tests/useDateInitialization.spec.d.ts +1 -0
- package/dist/src/composables/date/tests/useDatePickerAccessibility.spec.d.ts +1 -0
- package/dist/src/composables/date/useDateFormat.d.ts +26 -0
- package/dist/src/composables/date/useDateInitialization.d.ts +18 -0
- package/dist/src/composables/date/useDatePickerAccessibility.d.ts +8 -0
- package/dist/src/composables/rules/useFieldValidation.d.ts +1 -0
- package/dist/src/composables/useFilterable/useFilterable.d.ts +1 -1
- package/dist/src/composables/validation/tests/useValidation.spec.d.ts +1 -0
- package/dist/src/composables/validation/useValidation.d.ts +40 -0
- package/dist/src/designTokens/index.d.ts +3 -1
- package/dist/src/main.d.ts +1 -0
- package/dist/src/utils/formatDate/index.d.ts +3 -0
- package/dist/src/utils/formatDate/tests/formatDate.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateAfter/index.d.ts +2 -0
- package/dist/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateBefore/index.d.ts +2 -0
- package/dist/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateInRange/index.d.ts +3 -0
- package/dist/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateValid/index.d.ts +9 -0
- package/dist/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isEmailValid/tests/isEmailValid.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isWeekend/index.d.ts +3 -0
- package/dist/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.d.ts +1 -0
- package/dist/src/utils/parseDate/index.d.ts +3 -0
- package/dist/src/utils/parseDate/tests/parseDate.spec.d.ts +1 -0
- package/dist/src/utils/rules/doMatchPattern/index.d.ts +3 -0
- package/dist/src/utils/rules/doMatchPattern/tests/matchPattern.spec.d.ts +1 -0
- package/dist/src/utils/rules/index.d.ts +11 -0
- package/dist/src/utils/rules/isDateValid/index.d.ts +4 -0
- package/dist/src/utils/rules/isDateValid/tests/isDateValid.spec.d.ts +1 -0
- package/dist/src/utils/rules/isExactLength/index.d.ts +3 -0
- package/dist/src/utils/rules/isExactLength/locales.d.ts +2 -0
- package/dist/src/utils/rules/isExactLength/tests/exactLength.spec.d.ts +1 -0
- package/dist/src/utils/rules/isMaxLength/index.d.ts +3 -0
- package/dist/src/utils/rules/isMaxLength/locales.d.ts +2 -0
- package/dist/src/utils/rules/isMaxLength/tests/isMaxLength.spec.d.ts +1 -0
- package/dist/src/utils/rules/isMinLength/index.d.ts +3 -0
- package/dist/src/utils/rules/isMinLength/locales.d.ts +2 -0
- package/dist/src/utils/rules/isMinLength/tests/isMinLength.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotAfterDate/index.d.ts +3 -0
- package/dist/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotAfterToday/index.d.ts +4 -0
- package/dist/src/utils/rules/isNotAfterToday/locales.d.ts +2 -0
- package/dist/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotBeforeDate/index.d.ts +3 -0
- package/dist/src/utils/rules/isNotBeforeDate/locales.d.ts +2 -0
- package/dist/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotBeforeToday/index.d.ts +4 -0
- package/dist/src/utils/rules/isNotBeforeToday/locales.d.ts +2 -0
- package/dist/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.d.ts +1 -0
- package/dist/src/utils/rules/isRequired/index.d.ts +4 -0
- package/dist/src/utils/rules/isRequired/locales.d.ts +2 -0
- package/dist/src/utils/rules/isRequired/tests/isRequred.spec.d.ts +1 -0
- package/dist/src/utils/rules/isValidEmail/index.d.ts +4 -0
- package/dist/src/utils/rules/isValidEmail/locales.d.ts +2 -0
- package/dist/src/utils/rules/isValidEmail/tests/isValidEmail.spec.d.ts +1 -0
- package/dist/src/vuetifyConfig.d.ts +81 -0
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/src/assets/_elevations.scss +89 -0
- package/src/assets/_fonts.scss +6 -0
- package/src/assets/_radius.scss +92 -0
- package/src/assets/_spacers.scss +149 -0
- package/src/assets/settings.scss +15 -3
- package/src/assets/tokens.scss +32 -29
- package/src/components/Amelipro/types/types.ts +40 -0
- package/src/components/ChipList/ChipList.stories.ts +26 -27
- package/src/components/ChipList/ChipList.vue +5 -1
- package/src/components/ChipList/config.ts +1 -0
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -2
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +1 -1
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +1 -1
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +65 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +13 -3
- package/src/components/Customs/SySelect/SySelect.mdx +1 -1
- package/src/components/Customs/SySelect/SySelect.stories.ts +88 -5
- package/src/components/Customs/SySelect/SySelect.vue +55 -14
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +135 -2
- package/src/components/Customs/SyTextField/SyTextField.mdx +2 -2
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +809 -79
- package/src/components/Customs/SyTextField/SyTextField.vue +135 -104
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +190 -38
- package/src/components/Customs/SyTextField/types.d.ts +1 -0
- package/src/components/DatePicker/DatePicker.stories.ts +177 -5
- package/src/components/DatePicker/DatePicker.vue +302 -233
- package/src/components/DatePicker/DateTextInput.vue +101 -246
- package/src/components/DatePicker/tests/DatePicker.spec.ts +123 -60
- package/src/components/DatePicker/tests/DateTextInput.spec.ts +202 -6
- package/src/components/FileList/Accessibilite.stories.ts +1 -1
- package/src/components/FileList/AccessibiliteItems.ts +22 -0
- package/src/components/FileList/FileList.vue +2 -1
- package/src/components/FileList/UploadItem/UploadItem.vue +10 -0
- package/src/components/FileUpload/FileUpload.stories.ts +93 -7
- package/src/components/FileUpload/FileUpload.vue +1 -0
- package/src/components/FileUpload/tests/FileUpload.spec.ts +4 -4
- package/src/components/FilterInline/Accessibilite.mdx +14 -0
- package/src/components/FilterInline/Accessibilite.stories.ts +216 -0
- package/src/components/FilterInline/AccessibiliteItems.ts +132 -0
- package/src/components/FilterInline/FilterInline.mdx +180 -34
- package/src/components/FilterInline/FilterInline.stories.ts +363 -6
- package/src/components/FilterInline/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/FilterSideBar/Accessibilite.mdx +14 -0
- package/src/components/FilterSideBar/Accessibilite.stories.ts +216 -0
- package/src/components/FilterSideBar/AccessibiliteItems.ts +153 -0
- package/src/components/FilterSideBar/FilterSideBar.mdx +237 -0
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +798 -0
- package/src/components/FilterSideBar/FilterSideBar.vue +193 -0
- package/src/components/FilterSideBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/FilterSideBar/locales.ts +8 -0
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +305 -0
- package/src/components/FilterSideBar/tests/__snapshots__/FilterSideBar.spec.ts.snap +39 -0
- package/src/components/HeaderBar/Usages.mdx +1 -1
- package/src/components/NirField/NirField.stories.ts +738 -29
- package/src/components/NirField/NirField.vue +401 -359
- package/src/components/NirField/examples//342/200/257dataset/342/200/257.md +12 -0
- package/src/components/NirField/tests/NirField.spec.ts +88 -52
- package/src/components/NirField/tests/config.spec.ts +65 -0
- package/src/components/NotificationBar/Accessibilite.stories.ts +4 -0
- package/src/components/NotificationBar/NotificationBar.mdx +2 -2
- package/src/components/NotificationBar/NotificationBar.stories.ts +66 -13
- package/src/components/NotificationBar/NotificationBar.vue +42 -114
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +28 -33
- package/src/components/NotificationBar/tests/__snapshots__/NotificationBar.spec.ts.snap +1 -1
- package/src/components/PaginatedTable/PaginatedTable.vue +6 -10
- package/src/components/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +4 -4
- package/src/components/PasswordField/PasswordField.mdx +129 -47
- package/src/components/PasswordField/PasswordField.stories.ts +1111 -120
- package/src/components/PasswordField/PasswordField.vue +212 -99
- package/src/components/PasswordField/tests/PasswordField.spec.ts +138 -9
- package/src/components/PeriodField/PeriodField.stories.ts +214 -118
- package/src/components/PeriodField/PeriodField.vue +238 -190
- package/src/components/PeriodField/tests/PeriodField.spec.ts +146 -0
- package/src/components/PhoneField/PhoneField.stories.ts +170 -0
- package/src/components/PhoneField/PhoneField.vue +76 -17
- package/src/components/PhoneField/indicatifs.ts +1 -1
- package/src/components/PhoneField/tests/PhoneField.spec.ts +40 -0
- package/src/components/RatingPicker/RatingPicker.stories.ts +7 -7
- package/src/components/SearchListField/SearchListField.stories.ts +1 -1
- package/src/components/UploadWorkflow/Accessibilite.mdx +14 -0
- package/src/components/UploadWorkflow/Accessibilite.stories.ts +216 -0
- package/src/components/UploadWorkflow/AccessibiliteItems.ts +192 -0
- package/src/components/UploadWorkflow/UploadWorkflow.mdx +75 -0
- package/src/components/UploadWorkflow/UploadWorkflow.stories.ts +943 -0
- package/src/components/UploadWorkflow/UploadWorkflow.vue +230 -0
- package/src/components/UploadWorkflow/config.ts +29 -0
- package/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/UploadWorkflow/locales.ts +8 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +257 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +54 -0
- package/src/components/UploadWorkflow/types.ts +21 -0
- package/src/components/UploadWorkflow/useFileList.ts +84 -0
- package/src/components/UploadWorkflow/useFileUploadJourney.ts +18 -0
- package/src/components/Usages/tests/Usages.spec.ts +183 -0
- package/src/components/index.ts +5 -0
- package/src/composables/date/tests/useDateFormat.spec.ts +67 -0
- package/src/composables/date/tests/useDateInitialization.spec.ts +89 -0
- package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +102 -0
- package/src/composables/date/useDateFormat.ts +94 -0
- package/src/composables/date/useDateInitialization.ts +92 -0
- package/src/composables/date/useDatePickerAccessibility.ts +78 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +385 -4
- package/src/composables/rules/useFieldValidation.ts +5 -2
- package/src/composables/useFilterable/useFilterable.ts +5 -4
- package/src/composables/validation/tests/useValidation.spec.ts +154 -0
- package/src/composables/validation/useValidation.ts +180 -0
- package/src/designTokens/index.ts +4 -0
- package/src/main.ts +1 -0
- package/src/stories/Accessibilite/Aculturation/AuditDesignSystem.mdx +28 -0
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +2 -2
- package/src/stories/Accessibilite/Audit/RGAA.mdx +6 -6
- package/src/stories/Accessibilite/Introduction.mdx +2 -1
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +1 -1
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +1 -1
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +8 -11
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +77 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru.mdx +9 -3
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +2 -2
- package/src/stories/Demarrer/Accueil.mdx +1 -1
- package/src/stories/Demarrer/Introduction.stories.ts +3 -3
- package/src/stories/Demarrer/Releases.mdx +8 -0
- package/src/stories/Demarrer/Releases.stories.ts +66 -0
- package/src/stories/DesignTokens/Conteneurs.stories.ts +3 -3
- package/src/stories/DesignTokens/ThemePA.mdx +4 -30
- package/src/stories/GuideDuDev/LesBreackingChanges.mdx +36 -0
- package/src/stories/GuideDuDev/UtiliserLesRules.mdx +321 -78
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
- package/src/utils/formatDate/index.ts +6 -0
- package/src/utils/formatDate/tests/formatDate.spec.ts +18 -0
- package/src/utils/functions/validation/isDateAfter/index.ts +9 -0
- package/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.ts +18 -0
- package/src/utils/functions/validation/isDateBefore/index.ts +9 -0
- package/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.ts +23 -0
- package/src/utils/functions/validation/isDateInRange/index.ts +22 -0
- package/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.ts +28 -0
- package/src/utils/functions/validation/isDateValid/index.ts +67 -0
- package/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.ts +46 -0
- package/src/utils/functions/validation/isEmailValid/index.ts +9 -0
- package/src/utils/functions/validation/isWeekend/index.ts +10 -0
- package/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.ts +16 -0
- package/src/utils/parseDate/index.ts +29 -0
- package/src/utils/parseDate/tests/parseDate.spec.ts +52 -0
- package/src/utils/rules/Rules.mdx +16 -0
- package/src/utils/rules/doMatchPattern/DoMachPattern.mdx +66 -0
- package/src/utils/rules/doMatchPattern/DoMatchPattern.stories.ts +106 -0
- package/src/utils/rules/doMatchPattern/index.ts +28 -0
- package/src/utils/rules/doMatchPattern/locales.ts +5 -0
- package/src/utils/rules/doMatchPattern/tests/matchPattern.spec.ts +38 -0
- package/src/utils/rules/index.ts +11 -0
- package/src/utils/rules/isDateValid/IsDateValid.mdx +87 -0
- package/src/utils/rules/isDateValid/IsDateValid.stories.ts +113 -0
- package/src/utils/rules/isDateValid/index.ts +32 -0
- package/src/utils/rules/isDateValid/locales.ts +10 -0
- package/src/utils/rules/isDateValid/tests/isDateValid.spec.ts +27 -0
- package/src/utils/rules/isExactLength/IsExactLenght.mdx +68 -0
- package/src/utils/rules/isExactLength/IsExactLength.stories.ts +151 -0
- package/src/utils/rules/{exactLength → isExactLength}/index.ts +2 -4
- package/src/utils/rules/isExactLength/tests/exactLength.spec.ts +48 -0
- package/src/utils/rules/isMaxLength/IsMaxLength.mdx +68 -0
- package/src/utils/rules/isMaxLength/IsMaxLength.stories.ts +152 -0
- package/src/utils/rules/isMaxLength/index.ts +30 -0
- package/src/utils/rules/isMaxLength/locales.ts +6 -0
- package/src/utils/rules/isMaxLength/tests/isMaxLength.spec.ts +42 -0
- package/src/utils/rules/isMinLength/IsMinLength.mdx +68 -0
- package/src/utils/rules/isMinLength/IsMinLength.stories.ts +152 -0
- package/src/utils/rules/isMinLength/index.ts +30 -0
- package/src/utils/rules/isMinLength/locales.ts +6 -0
- package/src/utils/rules/isMinLength/tests/isMinLength.spec.ts +42 -0
- package/src/utils/rules/isNotAfterDate/IsNotAfterDate.mdx +68 -0
- package/src/utils/rules/isNotAfterDate/IsNotAfterDate.stories.ts +109 -0
- package/src/utils/rules/isNotAfterDate/index.ts +25 -0
- package/src/utils/rules/isNotAfterDate/locales.ts +6 -0
- package/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.ts +25 -0
- package/src/utils/rules/isNotAfterToday/IsNotAfterToday.mdx +83 -0
- package/src/utils/rules/isNotAfterToday/IsNotAfterToday.stories.ts +110 -0
- package/src/utils/rules/isNotAfterToday/index.ts +28 -0
- package/src/utils/rules/isNotAfterToday/locales.ts +5 -0
- package/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.ts +30 -0
- package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.mdx +68 -0
- package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.stories.ts +114 -0
- package/src/utils/rules/isNotBeforeDate/index.ts +25 -0
- package/src/utils/rules/isNotBeforeDate/locales.ts +6 -0
- package/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.ts +25 -0
- package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.mdx +83 -0
- package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.stories.ts +110 -0
- package/src/utils/rules/isNotBeforeToday/index.ts +28 -0
- package/src/utils/rules/isNotBeforeToday/locales.ts +5 -0
- package/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.ts +36 -0
- package/src/utils/rules/isRequired/IsRequired.mdx +81 -0
- package/src/utils/rules/isRequired/IsRequired.stories.ts +101 -0
- package/src/utils/rules/{required → isRequired}/index.ts +3 -3
- package/src/utils/rules/{required/tests/index.spec.ts → isRequired/tests/isRequred.spec.ts} +9 -9
- package/src/utils/rules/isValidEmail/IsValidEmail.mdx +81 -0
- package/src/utils/rules/isValidEmail/IsValidEmail.stories.ts +101 -0
- package/src/utils/rules/{email → isValidEmail}/index.ts +3 -5
- package/src/utils/rules/{email/tests/email.spec.ts → isValidEmail/tests/isValidEmail.spec.ts} +5 -5
- package/src/vuetifyConfig.ts +61 -0
- package/dist/src/utils/rules/email/index.d.ts +0 -4
- package/dist/src/utils/rules/exactLength/index.d.ts +0 -4
- package/dist/src/utils/rules/required/index.d.ts +0 -4
- package/dist/src/utils/rules/required/ruleMessageHelper.d.ts +0 -3
- package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +0 -58
- package/src/composables/useFilterable/__snapshots__/useFilterable.spec.ts.snap +0 -3
- package/src/utils/functions/isEmailValid/index.ts +0 -8
- package/src/utils/rules/required/ruleMessageHelper.ts +0 -14
- package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +0 -22
- /package/dist/src/{utils/functions/isEmailValid/tests/isEmailValid.spec.d.ts → components/FilterSideBar/tests/FilterSideBar.spec.d.ts} +0 -0
- /package/dist/src/{utils/rules/email/tests/email.spec.d.ts → components/NirField/tests/config.spec.d.ts} +0 -0
- /package/dist/src/{utils/rules/required/tests/index.spec.d.ts → components/UploadWorkflow/tests/UploadWorkflow.spec.d.ts} +0 -0
- /package/dist/src/{utils/rules/required/tests/rulesMessageHelper.spec.d.ts → components/Usages/tests/Usages.spec.d.ts} +0 -0
- /package/dist/src/utils/functions/{isEmailValid → validation/isEmailValid}/index.d.ts +0 -0
- /package/dist/src/utils/rules/{exactLength → doMatchPattern}/locales.d.ts +0 -0
- /package/dist/src/utils/rules/{email → isDateValid}/locales.d.ts +0 -0
- /package/dist/src/utils/rules/{required → isNotAfterDate}/locales.d.ts +0 -0
- /package/src/utils/functions/{isEmailValid → validation/isEmailValid}/tests/isEmailValid.spec.ts +0 -0
- /package/src/utils/rules/{exactLength → isExactLength}/locales.ts +0 -0
- /package/src/utils/rules/{required → isRequired}/locales.ts +0 -0
- /package/src/utils/rules/{email → isValidEmail}/locales.ts +0 -0
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
const currentNotification = ref<Notification>()
|
|
29
29
|
const isNotificationVisible = ref(false)
|
|
30
30
|
|
|
31
|
-
const isProcessingNotifications = ref(false) // Nouvelle variable pour suivre le traitement
|
|
32
|
-
|
|
33
31
|
const hasActionSlot = computed(() => !!instance?.slots.action)
|
|
34
32
|
const isMobileVersion = computed(() => display.name.value === 'xs')
|
|
35
33
|
const isTabletVersion = computed(() => display.name.value === 'sm')
|
|
@@ -73,91 +71,47 @@
|
|
|
73
71
|
|
|
74
72
|
const smallCloseBtn = computed(() => isMobileVersion.value && !hasLongContent.value && !hasActionSlot.value)
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
currentNotification.value
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
isProcessingNotifications.value = true
|
|
74
|
+
watch(() => notificationQueue.value.length, async (queueLength) => {
|
|
75
|
+
if (queueLength > 0 && currentNotification.value === undefined) {
|
|
76
|
+
openNotification(notificationQueue.value[0])
|
|
77
|
+
}
|
|
78
|
+
}, { immediate: true })
|
|
82
79
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
let timeoutID: ReturnType<typeof setTimeout>
|
|
81
|
+
function openNotification(notification: Notification) {
|
|
82
|
+
currentNotification.value = notification
|
|
83
|
+
isNotificationVisible.value = true
|
|
87
84
|
|
|
88
|
-
|
|
85
|
+
if ((notification.timeout || 0) > 0) {
|
|
86
|
+
timeoutID = setTimeout(() => {
|
|
87
|
+
isNotificationVisible.value = false
|
|
88
|
+
}, notification.timeout)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
resolve()
|
|
97
|
-
}
|
|
98
|
-
})
|
|
99
|
-
})
|
|
92
|
+
watch(isNotificationVisible, async (isVisible) => {
|
|
93
|
+
if (!isVisible) {
|
|
94
|
+
// wait for the snackbar close animation to finish
|
|
95
|
+
await new Promise(resolve => setTimeout(resolve, 100))
|
|
96
|
+
if (currentNotification.value) {
|
|
97
|
+
removeNotification(currentNotification.value.id)
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
// Attend la fin du délai du timeout avant de fermer la notification automatiquement
|
|
103
|
-
await new Promise<void>((resolve) => {
|
|
104
|
-
const timeoutId = setTimeout(() => {
|
|
105
|
-
handleClearNotification()
|
|
106
|
-
resolve()
|
|
107
|
-
}, timeout)
|
|
99
|
+
currentNotification.value = undefined
|
|
108
100
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
clearTimeout(timeoutId)
|
|
112
|
-
stopWatch()
|
|
113
|
-
resolve()
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
})
|
|
101
|
+
if (notificationQueue.value.length > 0) {
|
|
102
|
+
openNotification(notificationQueue.value[0])
|
|
117
103
|
}
|
|
118
|
-
|
|
119
|
-
// Retire la notification de la file
|
|
120
|
-
removeNotification(nextNotification.id)
|
|
121
104
|
}
|
|
105
|
+
})
|
|
122
106
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const handleClearNotification = () => {
|
|
107
|
+
function showNextNotification() {
|
|
108
|
+
clearTimeout(timeoutID)
|
|
127
109
|
isNotificationVisible.value = false
|
|
128
|
-
if (currentNotification.value) {
|
|
129
|
-
removeNotification(currentNotification.value.id)
|
|
130
|
-
currentNotification.value = undefined
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const openNotification = (notification: Notification) => {
|
|
135
|
-
setNotification(notification)
|
|
136
|
-
isNotificationVisible.value = true
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const showNextNotification = () => {
|
|
140
|
-
if (notificationQueue.value.length > 0) {
|
|
141
|
-
const nextNotification = notificationQueue.value[0]
|
|
142
|
-
setNotification(nextNotification)
|
|
143
|
-
isNotificationVisible.value = true
|
|
144
|
-
}
|
|
145
110
|
}
|
|
146
111
|
|
|
147
|
-
watch(
|
|
148
|
-
() => notificationQueue.value.length,
|
|
149
|
-
(newLength) => {
|
|
150
|
-
if (newLength > 0 && !isProcessingNotifications.value) {
|
|
151
|
-
processNotificationQueue()
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
)
|
|
155
|
-
|
|
156
112
|
defineExpose({
|
|
157
113
|
openNotification,
|
|
158
|
-
handleClearNotification,
|
|
159
114
|
showNextNotification,
|
|
160
|
-
processNotificationQueue,
|
|
161
115
|
currentNotification,
|
|
162
116
|
isNotificationVisible,
|
|
163
117
|
hasActionSlot,
|
|
@@ -173,11 +127,12 @@
|
|
|
173
127
|
</script>
|
|
174
128
|
|
|
175
129
|
<template>
|
|
176
|
-
<div
|
|
130
|
+
<div>
|
|
177
131
|
<VSnackbar
|
|
178
132
|
v-bind="options.snackbar"
|
|
179
133
|
v-model="isNotificationVisible"
|
|
180
134
|
role="status"
|
|
135
|
+
:eager="true"
|
|
181
136
|
:color="color"
|
|
182
137
|
:location="props.bottom ? 'bottom' : 'top'"
|
|
183
138
|
:vertical="hasLongContent"
|
|
@@ -195,7 +150,10 @@
|
|
|
195
150
|
size="24"
|
|
196
151
|
aria-hidden="true"
|
|
197
152
|
/>
|
|
198
|
-
<p
|
|
153
|
+
<p
|
|
154
|
+
class="sy-notification-content"
|
|
155
|
+
:class="'text-' + contentStyle.contentColor"
|
|
156
|
+
>
|
|
199
157
|
{{ currentNotification?.message }}
|
|
200
158
|
</p>
|
|
201
159
|
</div>
|
|
@@ -212,7 +170,7 @@
|
|
|
212
170
|
:class="{ 'ma-0': smallCloseBtn }"
|
|
213
171
|
aria-label="Fermer la notification"
|
|
214
172
|
v-bind="options.btn"
|
|
215
|
-
@click="
|
|
173
|
+
@click="isNotificationVisible = false"
|
|
216
174
|
>
|
|
217
175
|
<template v-if="!smallCloseBtn">
|
|
218
176
|
{{ closeBtnText }}
|
|
@@ -230,18 +188,12 @@
|
|
|
230
188
|
<style lang="scss" scoped>
|
|
231
189
|
@use '@/assets/tokens';
|
|
232
190
|
|
|
233
|
-
.
|
|
234
|
-
|
|
235
|
-
align-items: center;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.vd-notification-bar :deep(.v-snack__wrapper) {
|
|
239
|
-
padding: 16px;
|
|
240
|
-
min-width: 0;
|
|
241
|
-
max-width: none;
|
|
191
|
+
:deep(.v-overlay__content) {
|
|
192
|
+
max-width: 100%;
|
|
242
193
|
}
|
|
243
194
|
|
|
244
195
|
:deep(.v-snackbar__content) {
|
|
196
|
+
width: 100%;
|
|
245
197
|
padding: tokens.$padding-4 !important;
|
|
246
198
|
}
|
|
247
199
|
|
|
@@ -249,35 +201,6 @@
|
|
|
249
201
|
margin-inline-end: 10px;
|
|
250
202
|
}
|
|
251
203
|
|
|
252
|
-
.vd-notification-bar.v-snackbar--vertical :deep() {
|
|
253
|
-
.v-snackbar--vertical .v-snackbar__wrapper .v-snackbar__actions {
|
|
254
|
-
width: 100% !important;
|
|
255
|
-
align-self: auto;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.v-snack__wrapper {
|
|
259
|
-
align-items: stretch;
|
|
260
|
-
flex-direction: row;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.v-snack__action {
|
|
264
|
-
align-self: stretch;
|
|
265
|
-
align-items: stretch;
|
|
266
|
-
flex-direction: column;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.v-snackbar__content {
|
|
270
|
-
margin: 0;
|
|
271
|
-
width: 100%;
|
|
272
|
-
display: flex;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.vd-notification-content {
|
|
276
|
-
flex-direction: column;
|
|
277
|
-
display: flex;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
204
|
.long-text :deep(.v-snackbar__actions) {
|
|
282
205
|
width: 98% !important;
|
|
283
206
|
}
|
|
@@ -293,4 +216,9 @@
|
|
|
293
216
|
.action-section-short-text {
|
|
294
217
|
justify-content: end !important;
|
|
295
218
|
}
|
|
219
|
+
|
|
220
|
+
.sy-notification-content {
|
|
221
|
+
min-width: 0;
|
|
222
|
+
word-wrap: break-word;
|
|
223
|
+
}
|
|
296
224
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from 'vitest'
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
|
2
2
|
import { vi } from 'vitest'
|
|
3
3
|
import { mount, shallowMount } from '@vue/test-utils'
|
|
4
4
|
import NotificationBar from '../NotificationBar.vue'
|
|
@@ -6,6 +6,7 @@ import { type Notification } from '@/components/NotificationBar/types'
|
|
|
6
6
|
import { useNotificationService } from '@/services/NotificationService'
|
|
7
7
|
import { nextTick, type Ref, ref } from 'vue'
|
|
8
8
|
import { vuetify } from '@tests/unit/setup'
|
|
9
|
+
import { VDefaultsProvider } from 'vuetify/components'
|
|
9
10
|
|
|
10
11
|
vi.mock('@/services/NotificationService')
|
|
11
12
|
describe('NotificationBar.vue', () => {
|
|
@@ -17,6 +18,7 @@ describe('NotificationBar.vue', () => {
|
|
|
17
18
|
|
|
18
19
|
let notificationServiceMock: NotificationServiceMock
|
|
19
20
|
beforeEach(() => {
|
|
21
|
+
vi.useFakeTimers()
|
|
20
22
|
notificationServiceMock = {
|
|
21
23
|
notificationQueue: ref([]),
|
|
22
24
|
addNotification: vi.fn(),
|
|
@@ -26,6 +28,11 @@ describe('NotificationBar.vue', () => {
|
|
|
26
28
|
(useNotificationService as vi.Mock).mockReturnValue(notificationServiceMock)
|
|
27
29
|
})
|
|
28
30
|
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
vi.restoreAllMocks()
|
|
33
|
+
vi.useRealTimers()
|
|
34
|
+
})
|
|
35
|
+
|
|
29
36
|
it('should render notification bar', async () => {
|
|
30
37
|
const notification: Notification = {
|
|
31
38
|
id: '1',
|
|
@@ -67,29 +74,11 @@ describe('NotificationBar.vue', () => {
|
|
|
67
74
|
expect(wrapper.vm.color).toBe('#56C271')
|
|
68
75
|
})
|
|
69
76
|
|
|
70
|
-
it('should
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
message: 'Test message',
|
|
74
|
-
type: 'info',
|
|
75
|
-
timeout: -1,
|
|
76
|
-
icon: null,
|
|
77
|
-
}
|
|
78
|
-
const wrapper = mount(NotificationBar, {
|
|
79
|
-
props: { notification },
|
|
80
|
-
global: {
|
|
81
|
-
plugins: [vuetify],
|
|
82
|
-
},
|
|
77
|
+
it('should show the next notification in the queue', async () => {
|
|
78
|
+
notificationServiceMock.removeNotification = vi.fn(() => {
|
|
79
|
+
notificationServiceMock.notificationQueue.value.shift()
|
|
83
80
|
})
|
|
84
|
-
wrapper.vm.openNotification(notification)
|
|
85
|
-
wrapper.vm.handleClearNotification()
|
|
86
81
|
|
|
87
|
-
await nextTick()
|
|
88
|
-
expect(wrapper.vm.isNotificationVisible).toBe(false)
|
|
89
|
-
expect(notificationServiceMock.removeNotification).toHaveBeenCalledWith(notification.id)
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
it('should show the next notification in the queue', async () => {
|
|
93
82
|
const notification1: Notification = {
|
|
94
83
|
id: '1',
|
|
95
84
|
message: 'Test message 1',
|
|
@@ -97,26 +86,28 @@ describe('NotificationBar.vue', () => {
|
|
|
97
86
|
timeout: -1,
|
|
98
87
|
icon: null,
|
|
99
88
|
}
|
|
100
|
-
const notification2
|
|
89
|
+
const notification2 = {
|
|
101
90
|
id: '2',
|
|
102
91
|
message: 'Test message 2',
|
|
103
92
|
type: 'success',
|
|
104
93
|
timeout: -1,
|
|
105
94
|
icon: null,
|
|
106
|
-
}
|
|
95
|
+
} as const satisfies Notification
|
|
107
96
|
notificationServiceMock.notificationQueue.value = [notification1, notification2]
|
|
108
97
|
|
|
109
98
|
const wrapper = mount(NotificationBar, {
|
|
110
|
-
props: { notification: notification1 },
|
|
111
99
|
global: {
|
|
112
100
|
plugins: [vuetify],
|
|
113
101
|
},
|
|
114
102
|
})
|
|
115
103
|
|
|
116
104
|
wrapper.vm.showNextNotification()
|
|
117
|
-
|
|
118
105
|
await nextTick()
|
|
119
|
-
|
|
106
|
+
vi.runAllTimers()
|
|
107
|
+
await nextTick()
|
|
108
|
+
|
|
109
|
+
expect(notificationServiceMock.removeNotification).toHaveBeenCalledWith(notification1.id)
|
|
110
|
+
expect(wrapper.vm.currentNotification).toEqual(notification2)
|
|
120
111
|
expect(wrapper.vm.isNotificationVisible).toBe(true)
|
|
121
112
|
})
|
|
122
113
|
|
|
@@ -315,8 +306,14 @@ describe('NotificationBar.vue', () => {
|
|
|
315
306
|
expect(removeNotification).toHaveBeenCalledWith(1)
|
|
316
307
|
})
|
|
317
308
|
|
|
318
|
-
it('should
|
|
319
|
-
notificationServiceMock.notificationQueue.value = [
|
|
309
|
+
it('should show the item in queue', async () => {
|
|
310
|
+
notificationServiceMock.notificationQueue.value = [{
|
|
311
|
+
id: '1',
|
|
312
|
+
message: 'Test message',
|
|
313
|
+
type: 'info',
|
|
314
|
+
timeout: -1,
|
|
315
|
+
icon: null,
|
|
316
|
+
}]
|
|
320
317
|
|
|
321
318
|
const wrapper = mount(NotificationBar, {
|
|
322
319
|
global: {
|
|
@@ -324,9 +321,7 @@ describe('NotificationBar.vue', () => {
|
|
|
324
321
|
},
|
|
325
322
|
})
|
|
326
323
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
expect(wrapper.vm.isNotificationVisible).toBe(false)
|
|
330
|
-
expect(notificationServiceMock.removeNotification).not.toHaveBeenCalled()
|
|
324
|
+
const provider = wrapper.findComponent(VDefaultsProvider)
|
|
325
|
+
expect(provider.element.parentElement.textContent).toContain('Test message')
|
|
331
326
|
})
|
|
332
327
|
})
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`NotificationBar.vue > should render notification bar 1`] = `
|
|
4
4
|
"<div data-v-867cdd3c="" notification="[object Object]">
|
|
5
|
-
<v-snackbar-stub data-v-867cdd3c="" color="info" width="960px" class="" multiline="false" timer="false" timeout="-1" vertical="false" location="top" rounded="4" tile="false" variant="elevated" absolute="false" attach="false" closeonback="true" contained="false" disabled="false" modelvalue="true" zindex="2000" activatorprops="[object Object]" openonhover="false" closeoncontentclick="false" eager="
|
|
5
|
+
<v-snackbar-stub data-v-867cdd3c="" color="info" width="960px" class="" multiline="false" timer="false" timeout="-1" vertical="false" location="top" rounded="4" tile="false" variant="elevated" absolute="false" attach="false" closeonback="true" contained="false" disabled="false" modelvalue="true" zindex="2000" activatorprops="[object Object]" openonhover="false" closeoncontentclick="false" eager="true" locationstrategy="static" origin="auto" transition="v-snackbar-transition" role="status"></v-snackbar-stub>
|
|
6
6
|
</div>"
|
|
7
7
|
`;
|
|
@@ -134,7 +134,10 @@
|
|
|
134
134
|
</script>
|
|
135
135
|
|
|
136
136
|
<template>
|
|
137
|
-
<div
|
|
137
|
+
<div
|
|
138
|
+
id="paginated-table"
|
|
139
|
+
class="sy-paginated-table"
|
|
140
|
+
>
|
|
138
141
|
<VDataTable
|
|
139
142
|
v-if="!serverItemsLength"
|
|
140
143
|
color="primary"
|
|
@@ -170,11 +173,10 @@
|
|
|
170
173
|
</div>
|
|
171
174
|
</template>
|
|
172
175
|
|
|
173
|
-
<style lang="scss">
|
|
176
|
+
<style lang="scss" scoped>
|
|
174
177
|
@use '@/assets/tokens';
|
|
175
178
|
|
|
176
|
-
.
|
|
177
|
-
.v-data-table {
|
|
179
|
+
.sy-paginated-table :deep() {
|
|
178
180
|
table thead tr {
|
|
179
181
|
white-space: nowrap;
|
|
180
182
|
}
|
|
@@ -187,12 +189,6 @@
|
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
|
|
190
|
-
table :not(thead) tr {
|
|
191
|
-
&:hover {
|
|
192
|
-
background-color: rgb(12 65 154 / 10%);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
192
|
&.row-clickable table tbody tr {
|
|
197
193
|
cursor: pointer;
|
|
198
194
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`PaginatedTable > render correctly in server mode 1`] = `
|
|
4
|
-
"<div id="paginated-table">
|
|
5
|
-
<div class="v-table v-table--has-top v-table--has-bottom v-theme--light v-table--density-default v-data-table" itemslength="0">
|
|
4
|
+
"<div data-v-50a8727d="" id="paginated-table" class="sy-paginated-table">
|
|
5
|
+
<div data-v-50a8727d="" class="v-table v-table--has-top v-table--has-bottom v-theme--light v-table--density-default v-data-table" itemslength="0">
|
|
6
6
|
<!---->
|
|
7
7
|
<div class="v-table__wrapper">
|
|
8
8
|
<table>
|
|
@@ -109,8 +109,8 @@ exports[`PaginatedTable > render correctly in server mode 1`] = `
|
|
|
109
109
|
`;
|
|
110
110
|
|
|
111
111
|
exports[`PaginatedTable > renders correctly in local mode 1`] = `
|
|
112
|
-
"<div id="paginated-table" items="[object Object],[object Object],[object Object]" headers="[object Object],[object Object],[object Object]">
|
|
113
|
-
<div class="v-table v-table--has-top v-table--has-bottom v-theme--light v-table--density-default v-data-table" itemslength="0">
|
|
112
|
+
"<div data-v-50a8727d="" id="paginated-table" class="sy-paginated-table" items="[object Object],[object Object],[object Object]" headers="[object Object],[object Object],[object Object]">
|
|
113
|
+
<div data-v-50a8727d="" class="v-table v-table--has-top v-table--has-bottom v-theme--light v-table--density-default v-data-table" itemslength="0">
|
|
114
114
|
<!---->
|
|
115
115
|
<div class="v-table__wrapper">
|
|
116
116
|
<table>
|
|
@@ -1,70 +1,152 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as PasswordFieldStories from './PasswordField.stories'
|
|
3
|
-
import PasswordField from './PasswordField.vue';
|
|
1
|
+
import { Meta, Canvas, Controls, Source } from '@storybook/blocks'
|
|
2
|
+
import * as PasswordFieldStories from './PasswordField.stories'
|
|
4
3
|
|
|
5
|
-
<Meta
|
|
4
|
+
<Meta of={PasswordFieldStories} />
|
|
6
5
|
|
|
7
6
|
# PasswordField
|
|
8
7
|
|
|
9
|
-
Le composant `PasswordField` est
|
|
10
|
-
Il permet également d’afficher ou de masquer le contenu du champ à l’aide d’une icône.
|
|
8
|
+
Le composant `PasswordField` est un champ de saisie sécurisé conçu pour la gestion des mots de passe. Il hérite des fonctionnalités du composant `SyTextField` tout en ajoutant des fonctionnalités spécifiques à la saisie de mots de passe.
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
## Utilisation basique
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
La version de base du composant avec le style outlined par défaut.
|
|
15
13
|
|
|
16
|
-
<
|
|
14
|
+
<Canvas of={PasswordFieldStories.Default} />
|
|
17
15
|
|
|
18
|
-
##
|
|
16
|
+
## Fonctionnalités principales
|
|
17
|
+
|
|
18
|
+
- **Masquage/affichage du mot de passe** : Une icône permet de basculer entre l'affichage en clair et masqué
|
|
19
|
+
- **Validation personnalisable** : Support des messages d'erreur, d'avertissement et de succès
|
|
20
|
+
- **Styles configurables** : Choix entre les styles `outlined` et `underlined`
|
|
21
|
+
- **États spéciaux** : Support des états désactivé et lecture seule
|
|
22
|
+
- **Validation automatique** : Validation à la perte de focus configurable
|
|
23
|
+
|
|
24
|
+
## API
|
|
25
|
+
|
|
26
|
+
<Controls of={PasswordFieldStories.Default} />
|
|
27
|
+
|
|
28
|
+
<Source
|
|
29
|
+
dark code={`
|
|
30
|
+
<template>
|
|
31
|
+
<PasswordField
|
|
32
|
+
v-model="password"
|
|
33
|
+
label="Mot de passe"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
19
36
|
|
|
20
|
-
<Source
|
|
21
|
-
dark
|
|
22
|
-
code={`
|
|
23
37
|
<script setup lang="ts">
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const password = ref('')
|
|
28
|
-
const passwordFieldRef = ref() // Référence Vue pour accéder au composant enfant
|
|
29
|
-
|
|
30
|
-
function handleSubmit() {
|
|
31
|
-
// Appeler la méthode exposée validateOnSubmit via la référence
|
|
32
|
-
const isValid = passwordFieldRef.value?.validateOnSubmit()
|
|
33
|
-
if (!isValid) {
|
|
34
|
-
alert('Veuillez corriger les erreurs avant de soumettre.')
|
|
35
|
-
} else {
|
|
36
|
-
alert('Formulaire soumis avec succès !')
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
38
|
+
import { ref } from 'vue'
|
|
39
|
+
import { PasswordField } from '@cnamts/synapse'
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<PasswordField
|
|
44
|
-
ref="passwordFieldRef"
|
|
45
|
-
v-model="password"
|
|
46
|
-
outlined
|
|
47
|
-
:is-validate-on-blur="true"
|
|
48
|
-
/>
|
|
49
|
-
<button type="submit">Soumettre</button>
|
|
50
|
-
</form>
|
|
51
|
-
</template>
|
|
41
|
+
const password = ref('')
|
|
42
|
+
</script>
|
|
52
43
|
`}
|
|
53
44
|
/>
|
|
54
45
|
|
|
55
|
-
##
|
|
46
|
+
## Validation
|
|
47
|
+
|
|
48
|
+
### Validation simple
|
|
49
|
+
|
|
50
|
+
Le composant peut être requis et afficher un message d'erreur si le champ est vide.
|
|
51
|
+
|
|
52
|
+
<Canvas of={PasswordFieldStories.Required} />
|
|
53
|
+
|
|
54
|
+
### Validation avancée
|
|
55
|
+
|
|
56
|
+
Exemple complet montrant les différents types de validation (erreurs, avertissements, succès).
|
|
57
|
+
|
|
58
|
+
<Canvas of={PasswordFieldStories.WithValidation} />
|
|
59
|
+
|
|
60
|
+
### Exemples d'états de validation
|
|
61
|
+
|
|
62
|
+
<div className="sb-grid">
|
|
63
|
+
<div>
|
|
64
|
+
<h4>Avec erreur</h4>
|
|
65
|
+
<Canvas of={PasswordFieldStories.WithError} />
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<h4>Avec avertissement</h4>
|
|
69
|
+
<Canvas of={PasswordFieldStories.WithWarning} />
|
|
70
|
+
</div>
|
|
71
|
+
<div>
|
|
72
|
+
<h4>Avec succès</h4>
|
|
73
|
+
<Canvas of={PasswordFieldStories.WithSuccess} />
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
### Validation de formulaire
|
|
78
|
+
|
|
79
|
+
Le composant expose une méthode `validateOnSubmit` pour valider le champ lors de la soumission d'un formulaire.
|
|
80
|
+
|
|
81
|
+
<Canvas of={PasswordFieldStories.WithFormValidation} />
|
|
82
|
+
|
|
83
|
+
<Source
|
|
84
|
+
dark code={`
|
|
85
|
+
<template>
|
|
86
|
+
<form @submit.prevent="handleSubmit">
|
|
87
|
+
<PasswordField
|
|
88
|
+
ref="passwordFieldRef"
|
|
89
|
+
v-model="password"
|
|
90
|
+
required
|
|
91
|
+
:custom-rules="customRules"
|
|
92
|
+
/>
|
|
93
|
+
<button type="submit">Valider</button>
|
|
94
|
+
</form>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<script setup lang="ts">
|
|
98
|
+
import { ref } from 'vue'
|
|
99
|
+
import { PasswordField } from '@cnamts/synapse'
|
|
100
|
+
|
|
101
|
+
const password = ref('')
|
|
102
|
+
const passwordFieldRef = ref()
|
|
103
|
+
|
|
104
|
+
const customRules = [{
|
|
105
|
+
type: 'custom',
|
|
106
|
+
options: {
|
|
107
|
+
message: 'Le mot de passe doit contenir au moins 8 caractères',
|
|
108
|
+
validate: (value: string) => value.length >= 8
|
|
109
|
+
}
|
|
110
|
+
}]
|
|
111
|
+
|
|
112
|
+
function handleSubmit() {
|
|
113
|
+
const isValid = passwordFieldRef.value?.validateOnSubmit()
|
|
114
|
+
if (!isValid) {
|
|
115
|
+
// Gérer l'erreur
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
// Continuer avec la soumission
|
|
119
|
+
}
|
|
120
|
+
</script>
|
|
121
|
+
`}
|
|
122
|
+
/>
|
|
56
123
|
|
|
57
|
-
###
|
|
124
|
+
### Méthodes exposées
|
|
58
125
|
|
|
59
|
-
|
|
60
|
-
- **isValidateOnBlur** : Si `true`, la validation se déclenche automatiquement lors du blur (perte de focus).
|
|
126
|
+
Le composant expose les méthodes et propriétés suivantes via `defineExpose` :
|
|
61
127
|
|
|
62
|
-
|
|
128
|
+
- **showEyeIcon** : (ref) Contrôle l'affichage du mot de passe
|
|
129
|
+
- **errors** : (ref) Liste des erreurs de validation actuelles
|
|
130
|
+
- **warnings** : (ref) Liste des avertissements actuels
|
|
131
|
+
- **successes** : (ref) Liste des messages de succès actuels
|
|
132
|
+
- **validateOnSubmit** : () => boolean - Méthode pour valider le champ, retourne true si valide
|
|
63
133
|
|
|
64
|
-
|
|
134
|
+
## Bonnes pratiques
|
|
65
135
|
|
|
66
|
-
|
|
136
|
+
1. **Validation progressive** :
|
|
137
|
+
- Utilisez `isValidateOnBlur` pour une validation en temps réel
|
|
138
|
+
- Combinez erreurs, avertissements et succès pour guider l'utilisateur
|
|
67
139
|
|
|
140
|
+
2. **Messages clairs** :
|
|
141
|
+
- Utilisez des messages d'erreur explicites
|
|
142
|
+
- Fournissez des suggestions d'amélioration via les warnings
|
|
143
|
+
- Confirmez les bonnes pratiques avec les messages de succès
|
|
68
144
|
|
|
145
|
+
3. **Accessibilité** :
|
|
146
|
+
- Toujours fournir un label explicite
|
|
147
|
+
- Utiliser la prop `required` quand nécessaire
|
|
148
|
+
- Considérer l'utilisation de `displayAsterisk` pour les champs requis
|
|
69
149
|
|
|
150
|
+
## En savoir plus
|
|
70
151
|
|
|
152
|
+
Pour plus d'informations sur l'utilisation des règles de validation, consultez la section [Comment utiliser les rules](/docs/guide-du-dev-comment-utiliser-les-rules--docs).
|