@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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
| # | Input | Expected Result | Description |
|
|
2
|
+
|----|-------------------|-----------------|-----------------------------------------------------------------------------------------------|
|
|
3
|
+
| 1 | 1840275123456 74 | valid | NIR complet avec clé correcte (ex. homme né en 1984, département 75...). |
|
|
4
|
+
| 2 | 2910256012345 46 | valid | NIR complet avec clé correcte (ex. femme née en 1991, département 25...). |
|
|
5
|
+
| 3 | 198012312345690 | valid | NIR complet (ex. homme né en 1980, département 12...), clé calculée et valide. |
|
|
6
|
+
| 4 | 2551299123457 80 | valid | NIR complet (ex. femme née en 1951, département 29...). |
|
|
7
|
+
| 5 | 2100121101003 73 | valid | NIR complet (ex. femme née en 2000, département 21...). |
|
|
8
|
+
| 6 | 3840275123456 74 | invalid | Le premier chiffre (3) n'est pas valide (doit être 1 ou 2). |
|
|
9
|
+
| 7 | 1841375123456 74 | invalid | Le mois 13 est invalide (doit être compris entre 01 et 12). |
|
|
10
|
+
| 8 | 1840275123456 73 | invalid | Clé de contrôle incorrecte (73 au lieu de 74). |
|
|
11
|
+
| 9 | 1840A75123456 74 | invalid | Contient une lettre 'A' dans la chaîne, format strictement numérique attendu. |
|
|
12
|
+
| 10 | 1840275123456 | invalid | Chaîne trop courte (13 chiffres sans clé). Le NIR doit comporter 15 chiffres. |
|
|
@@ -2,12 +2,20 @@ import { mount } from '@vue/test-utils'
|
|
|
2
2
|
import NirField from '../NirField.vue'
|
|
3
3
|
import { describe, it, expect, beforeEach } from 'vitest'
|
|
4
4
|
import { createVuetify } from 'vuetify'
|
|
5
|
+
import * as components from 'vuetify/components'
|
|
6
|
+
import * as directives from 'vuetify/directives'
|
|
7
|
+
import { useValidation } from '@/composables/validation/useValidation'
|
|
5
8
|
|
|
6
|
-
const vuetify = createVuetify(
|
|
9
|
+
const vuetify = createVuetify({
|
|
10
|
+
components,
|
|
11
|
+
directives,
|
|
12
|
+
})
|
|
7
13
|
|
|
8
14
|
describe('NirField.vue', () => {
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
let wrapper: ReturnType<typeof mount<typeof NirField & {
|
|
16
|
+
numberValidation: ReturnType<typeof useValidation>
|
|
17
|
+
keyValidation: ReturnType<typeof useValidation>
|
|
18
|
+
}>>
|
|
11
19
|
|
|
12
20
|
beforeEach(() => {
|
|
13
21
|
wrapper = mount(NirField, {
|
|
@@ -15,106 +23,134 @@ describe('NirField.vue', () => {
|
|
|
15
23
|
plugins: [vuetify],
|
|
16
24
|
},
|
|
17
25
|
props: {
|
|
18
|
-
modelValue:
|
|
26
|
+
modelValue: undefined,
|
|
19
27
|
required: true,
|
|
20
28
|
showSuccessMessages: true,
|
|
29
|
+
outlined: true,
|
|
21
30
|
},
|
|
22
31
|
})
|
|
23
32
|
})
|
|
24
33
|
|
|
25
34
|
it('renders correctly', () => {
|
|
26
35
|
expect(wrapper.exists()).toBe(true)
|
|
27
|
-
expect(wrapper.find('.
|
|
28
|
-
expect(wrapper.find('.
|
|
36
|
+
expect(wrapper.find('.number-field').exists()).toBe(true)
|
|
37
|
+
expect(wrapper.find('.key-field').exists()).toBe(true)
|
|
29
38
|
})
|
|
30
39
|
|
|
31
40
|
it('displays error message for invalid NIR length', async () => {
|
|
32
|
-
|
|
33
|
-
await
|
|
34
|
-
await
|
|
35
|
-
expect(wrapper.
|
|
41
|
+
await wrapper.find('.number-field input').setValue('123')
|
|
42
|
+
await wrapper.find('.number-field input').trigger('blur')
|
|
43
|
+
await wrapper.vm.$nextTick()
|
|
44
|
+
expect(wrapper.vm.numberValidation.errors.value[0]).toBe('Le numéro de sécurité sociale est invalide.')
|
|
36
45
|
})
|
|
37
46
|
|
|
38
47
|
it('validates the NIR field successfully', async () => {
|
|
39
|
-
|
|
40
|
-
await
|
|
41
|
-
|
|
48
|
+
await wrapper.find('.number-field input').setValue('2940375120005')
|
|
49
|
+
await wrapper.find('.number-field input').trigger('blur')
|
|
50
|
+
await wrapper.vm.$nextTick()
|
|
51
|
+
expect(wrapper.vm.numberValidation.successes.value).toContain('Le numéro de sécurité sociale est valide.')
|
|
42
52
|
})
|
|
43
53
|
|
|
44
54
|
it('displays error message for invalid key length', async () => {
|
|
45
|
-
|
|
46
|
-
await
|
|
47
|
-
|
|
48
|
-
await
|
|
49
|
-
|
|
50
|
-
expect(wrapper.find('.v-messages__message').text()).toContain('La clé du numéro de sécurité sociale doit contenir 2 caractères.')
|
|
55
|
+
await wrapper.find('.number-field input').setValue('2940375120005')
|
|
56
|
+
await wrapper.find('.key-field input').setValue('1')
|
|
57
|
+
await wrapper.find('.key-field input').trigger('blur')
|
|
58
|
+
await wrapper.vm.$nextTick()
|
|
59
|
+
expect(wrapper.vm.keyValidation.errors.value[0]).toBe('La clé du numéro de sécurité sociale est invalide.')
|
|
51
60
|
})
|
|
52
61
|
|
|
53
62
|
it('validates the key field successfully', async () => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
await
|
|
57
|
-
await
|
|
58
|
-
expect(wrapper.
|
|
63
|
+
await wrapper.find('.number-field input').setValue('2940375120005')
|
|
64
|
+
await wrapper.find('.key-field input').setValue('91')
|
|
65
|
+
await wrapper.find('.key-field input').trigger('blur')
|
|
66
|
+
await wrapper.vm.$nextTick()
|
|
67
|
+
expect(wrapper.vm.keyValidation.successes.value).toContain('Le champ Clé est valide.')
|
|
59
68
|
})
|
|
60
69
|
|
|
61
70
|
it('hides the key field when displayKey is false', async () => {
|
|
62
71
|
await wrapper.setProps({ displayKey: false })
|
|
63
|
-
expect(wrapper.find('.
|
|
72
|
+
expect(wrapper.find('.key-field').exists()).toBe(false)
|
|
64
73
|
})
|
|
65
74
|
|
|
66
75
|
it('calls validateOnSubmit and returns true if no errors', async () => {
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
wrapper = mount(NirField, {
|
|
77
|
+
global: {
|
|
78
|
+
plugins: [vuetify],
|
|
79
|
+
},
|
|
80
|
+
props: {
|
|
81
|
+
modelValue: undefined,
|
|
82
|
+
required: false,
|
|
83
|
+
outlined: true,
|
|
84
|
+
},
|
|
85
|
+
})
|
|
69
86
|
|
|
87
|
+
const numberField = wrapper.find('.number-field input')
|
|
70
88
|
await numberField.setValue('2940375120005')
|
|
71
|
-
await
|
|
89
|
+
await numberField.trigger('blur')
|
|
72
90
|
|
|
73
91
|
await wrapper.vm.$nextTick()
|
|
74
|
-
|
|
75
|
-
wrapper.vm.validateFields()
|
|
76
|
-
|
|
77
|
-
const isValid = wrapper.vm.validateOnSubmit()
|
|
92
|
+
const isValid = await wrapper.vm.validateOnSubmit()
|
|
78
93
|
|
|
79
94
|
expect(isValid).toBe(true)
|
|
80
|
-
expect(wrapper.vm.errors.length).toBe(0)
|
|
81
95
|
})
|
|
96
|
+
|
|
82
97
|
it('applies custom key rules when provided', async () => {
|
|
83
|
-
const customKeyRules = [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
successMessage: 'Custom key validation passed.',
|
|
91
|
-
},
|
|
98
|
+
const customKeyRules = [{
|
|
99
|
+
type: 'custom',
|
|
100
|
+
options: {
|
|
101
|
+
validate: (value: string) => value === '91',
|
|
102
|
+
message: 'Custom key validation failed.',
|
|
103
|
+
successMessage: 'Custom key validation passed.',
|
|
104
|
+
fieldIdentifier: 'clé',
|
|
92
105
|
},
|
|
93
|
-
]
|
|
106
|
+
}]
|
|
94
107
|
|
|
95
108
|
wrapper = mount(NirField, {
|
|
96
109
|
global: {
|
|
97
110
|
plugins: [vuetify],
|
|
98
111
|
},
|
|
99
112
|
props: {
|
|
100
|
-
modelValue:
|
|
101
|
-
required: true,
|
|
113
|
+
modelValue: undefined,
|
|
102
114
|
customKeyRules,
|
|
115
|
+
showSuccessMessages: true,
|
|
116
|
+
outlined: true,
|
|
103
117
|
},
|
|
104
118
|
})
|
|
105
|
-
|
|
106
|
-
const
|
|
119
|
+
|
|
120
|
+
const numberField = wrapper.find('.number-field input')
|
|
121
|
+
const keyField = wrapper.find('.key-field input')
|
|
107
122
|
await numberField.setValue('2940375120005')
|
|
108
123
|
await keyField.setValue('91')
|
|
109
|
-
|
|
124
|
+
await keyField.trigger('blur')
|
|
110
125
|
await wrapper.vm.$nextTick()
|
|
126
|
+
expect(wrapper.vm.keyValidation.successes.value).toContain('Custom key validation passed.')
|
|
127
|
+
})
|
|
111
128
|
|
|
112
|
-
|
|
113
|
-
|
|
129
|
+
it('emits update:modelValue with correct format', async () => {
|
|
130
|
+
const numberField = wrapper.find('.number-field input')
|
|
131
|
+
const keyField = wrapper.find('.key-field input')
|
|
132
|
+
await numberField.setValue('2940375120005')
|
|
133
|
+
await wrapper.vm.$nextTick()
|
|
134
|
+
await keyField.setValue('91')
|
|
135
|
+
await wrapper.vm.$nextTick()
|
|
136
|
+
expect(wrapper.emitted('update:modelValue')?.slice(-1)[0]).toEqual(['294037512000591'])
|
|
137
|
+
})
|
|
114
138
|
|
|
115
|
-
|
|
139
|
+
it('emits undefined when both fields are empty', async () => {
|
|
140
|
+
const numberField = wrapper.find('.number-field input')
|
|
141
|
+
const keyField = wrapper.find('.key-field input')
|
|
142
|
+
await numberField.setValue('')
|
|
143
|
+
await keyField.setValue('')
|
|
116
144
|
await wrapper.vm.$nextTick()
|
|
145
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([undefined])
|
|
146
|
+
})
|
|
117
147
|
|
|
118
|
-
|
|
148
|
+
it('splits modelValue correctly when provided', async () => {
|
|
149
|
+
await wrapper.setProps({ modelValue: '294037512000591' })
|
|
150
|
+
await wrapper.vm.$nextTick()
|
|
151
|
+
const numberInput = wrapper.find('.number-field input').element as HTMLInputElement
|
|
152
|
+
const keyInput = wrapper.find('.key-field input').element as HTMLInputElement
|
|
153
|
+
expect(numberInput.value.replace(/\s/g, '')).toBe('2940375120005')
|
|
154
|
+
expect(keyInput.value).toBe('91')
|
|
119
155
|
})
|
|
120
156
|
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import defaultOptions from '../config'
|
|
3
|
+
|
|
4
|
+
describe('NirField config', () => {
|
|
5
|
+
it('should have the correct default options structure', () => {
|
|
6
|
+
expect(defaultOptions).toHaveProperty('persistentHint')
|
|
7
|
+
expect(defaultOptions).toHaveProperty('validateOn')
|
|
8
|
+
expect(defaultOptions).toHaveProperty('icon')
|
|
9
|
+
expect(defaultOptions).toHaveProperty('tooltip')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('should have the correct persistentHint configuration', () => {
|
|
13
|
+
expect(defaultOptions.persistentHint).toEqual({
|
|
14
|
+
persistentHint: true,
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('should have the correct validateOn configuration', () => {
|
|
19
|
+
expect(defaultOptions.validateOn).toEqual({
|
|
20
|
+
validateOn: 'blur',
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('should have the correct icon configuration', () => {
|
|
25
|
+
expect(defaultOptions.icon).toEqual({
|
|
26
|
+
color: '',
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('should have the correct tooltip configuration', () => {
|
|
31
|
+
expect(defaultOptions.tooltip).toEqual({
|
|
32
|
+
location: 'top',
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should be immutable when imported', () => {
|
|
37
|
+
// Vérifier que l'objet ne peut pas être modifié après import
|
|
38
|
+
const originalTooltipLocation = defaultOptions.tooltip.location
|
|
39
|
+
|
|
40
|
+
// Tentative de modification
|
|
41
|
+
const testFunc = () => {
|
|
42
|
+
defaultOptions.tooltip.location = 'bottom'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// En mode strict, la modification d'une propriété en lecture seule devrait lever une erreur
|
|
46
|
+
// En mode non-strict, la modification ne devrait pas être effective
|
|
47
|
+
try {
|
|
48
|
+
testFunc()
|
|
49
|
+
// Si pas d'erreur, vérifions que la valeur n'a pas changé
|
|
50
|
+
expect(defaultOptions.tooltip.location).toBe(originalTooltipLocation)
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
// Si une erreur est levée, c'est que l'objet est correctement protégé
|
|
54
|
+
expect(e).toBeTruthy()
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('should be used correctly in the component', () => {
|
|
59
|
+
// Ce test est un placeholder pour vérifier l'intégration avec le composant
|
|
60
|
+
// Dans un cas réel, on pourrait monter le composant et vérifier que les options
|
|
61
|
+
// par défaut sont correctement appliquées
|
|
62
|
+
expect(defaultOptions.validateOn.validateOn).toBe('blur')
|
|
63
|
+
expect(defaultOptions.persistentHint.persistentHint).toBe(true)
|
|
64
|
+
})
|
|
65
|
+
})
|
|
@@ -159,6 +159,10 @@ export const Legende: StoryObj = {
|
|
|
159
159
|
</div>
|
|
160
160
|
</div>
|
|
161
161
|
</div>
|
|
162
|
+
<div class="mt-4">
|
|
163
|
+
<p>Rapport d’audit manuel : <a href="/audits/NotificationBar.xlsx" style="color:#0C41BD;">Voir le rapport</a></p>
|
|
164
|
+
<p style="color: grey; font-size: 14px">Correctifs en cours (<a href="https://github.com/assurance-maladie-digital/design-system/issues/3967" target="_blank" style="color:#0C41BD;">issue #3967</a>)</p>
|
|
165
|
+
</div>
|
|
162
166
|
`,
|
|
163
167
|
}
|
|
164
168
|
},
|
|
@@ -31,8 +31,8 @@ import * as NotificationBarStories from './NotificationBar.stories';
|
|
|
31
31
|
<script setup lang="ts">
|
|
32
32
|
import { VBtn } from 'vuetify/components'
|
|
33
33
|
import { NotificationBar } from '@cnamts/synapse'
|
|
34
|
-
import { useNotificationService } from '@cnamts/synapse
|
|
35
|
-
import type { Notification } from '@cnamts/synapse
|
|
34
|
+
import { useNotificationService } from '@cnamts/synapse'
|
|
35
|
+
import type { Notification } from '@cnamts/synapse'
|
|
36
36
|
|
|
37
37
|
const { addNotification } = useNotificationService()
|
|
38
38
|
|
|
@@ -115,7 +115,6 @@ Default.args = {
|
|
|
115
115
|
closeBtnText: 'Fermer',
|
|
116
116
|
type: 'info',
|
|
117
117
|
bottom: false,
|
|
118
|
-
rounded: 'rounded',
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
Default.parameters = {
|
|
@@ -128,7 +127,6 @@ Default.parameters = {
|
|
|
128
127
|
v-model="showNotification"
|
|
129
128
|
:close-btn-text="closeBtnText"
|
|
130
129
|
:bottom="bottom"
|
|
131
|
-
:rounded="rounded"
|
|
132
130
|
:type="type"
|
|
133
131
|
>
|
|
134
132
|
<template #default>This is a {{ type }} notification</template>
|
|
@@ -150,7 +148,7 @@ Default.parameters = {
|
|
|
150
148
|
import { VBtn } from 'vuetify/components'
|
|
151
149
|
import { NotificationBar } from '@cnamts/synapse'
|
|
152
150
|
import { ref } from 'vue'
|
|
153
|
-
import { useNotificationService } from '
|
|
151
|
+
import { useNotificationService } from '@cnamts/synpase'
|
|
154
152
|
|
|
155
153
|
const { addNotification } = useNotificationService()
|
|
156
154
|
const showNotification = ref(false)
|
|
@@ -186,7 +184,6 @@ Success.parameters = {
|
|
|
186
184
|
v-model="showNotification"
|
|
187
185
|
:close-btn-text="closeBtnText"
|
|
188
186
|
:bottom="bottom"
|
|
189
|
-
:rounded="rounded"
|
|
190
187
|
type="success"
|
|
191
188
|
>
|
|
192
189
|
<template #default>This is a success notification</template>
|
|
@@ -208,7 +205,7 @@ Success.parameters = {
|
|
|
208
205
|
import { VBtn } from 'vuetify/components'
|
|
209
206
|
import { NotificationBar } from '@cnamts/synapse'
|
|
210
207
|
import { ref } from 'vue'
|
|
211
|
-
import { useNotificationService } from '
|
|
208
|
+
import { useNotificationService } from '@cnamts/synpase'
|
|
212
209
|
|
|
213
210
|
const { addNotification } = useNotificationService()
|
|
214
211
|
const showNotification = ref(false)
|
|
@@ -244,7 +241,6 @@ Warning.parameters = {
|
|
|
244
241
|
v-model="showNotification"
|
|
245
242
|
:close-btn-text="closeBtnText"
|
|
246
243
|
:bottom="bottom"
|
|
247
|
-
:rounded="rounded"
|
|
248
244
|
type="warning"
|
|
249
245
|
>
|
|
250
246
|
<template #default>This is a warning notification</template>
|
|
@@ -266,7 +262,7 @@ Warning.parameters = {
|
|
|
266
262
|
import { VBtn } from 'vuetify/components'
|
|
267
263
|
import { NotificationBar } from '@cnamts/synapse'
|
|
268
264
|
import { ref } from 'vue'
|
|
269
|
-
import { useNotificationService } from '
|
|
265
|
+
import { useNotificationService } from '@cnamts/synpase'
|
|
270
266
|
|
|
271
267
|
const { addNotification } = useNotificationService()
|
|
272
268
|
const showNotification = ref(false)
|
|
@@ -302,7 +298,6 @@ Error.parameters = {
|
|
|
302
298
|
v-model="showNotification"
|
|
303
299
|
:close-btn-text="closeBtnText"
|
|
304
300
|
:bottom="bottom"
|
|
305
|
-
:rounded="rounded"
|
|
306
301
|
type="error"
|
|
307
302
|
>
|
|
308
303
|
<template #default>This is an error notification</template>
|
|
@@ -324,7 +319,7 @@ Error.parameters = {
|
|
|
324
319
|
import { VBtn } from 'vuetify/components'
|
|
325
320
|
import { NotificationBar } from '@cnamts/synapse'
|
|
326
321
|
import { ref } from 'vue'
|
|
327
|
-
import { useNotificationService } from '
|
|
322
|
+
import { useNotificationService } from '@cnamts/synpase'
|
|
328
323
|
|
|
329
324
|
const { addNotification } = useNotificationService()
|
|
330
325
|
const showNotification = ref(false)
|
|
@@ -360,7 +355,6 @@ Bottom.parameters = {
|
|
|
360
355
|
v-model="showNotification"
|
|
361
356
|
:close-btn-text="closeBtnText"
|
|
362
357
|
:bottom="true"
|
|
363
|
-
:rounded="rounded"
|
|
364
358
|
:type="type"
|
|
365
359
|
>
|
|
366
360
|
<template #default>This is a bottom-positioned notification</template>
|
|
@@ -382,7 +376,7 @@ Bottom.parameters = {
|
|
|
382
376
|
import { VBtn } from 'vuetify/components'
|
|
383
377
|
import { NotificationBar } from '@cnamts/synapse'
|
|
384
378
|
import { ref } from 'vue'
|
|
385
|
-
import { useNotificationService } from '
|
|
379
|
+
import { useNotificationService } from '@cnamts/synpase'
|
|
386
380
|
|
|
387
381
|
const { addNotification } = useNotificationService()
|
|
388
382
|
const showNotification = ref(false)
|
|
@@ -418,7 +412,7 @@ CustomCloseBtnText.parameters = {
|
|
|
418
412
|
v-model="showNotification"
|
|
419
413
|
close-btn-text="Masquer"
|
|
420
414
|
:bottom="bottom"
|
|
421
|
-
:rounded="
|
|
415
|
+
:rounded="pill"
|
|
422
416
|
:type="type"
|
|
423
417
|
>
|
|
424
418
|
<template #default>This is a notification with custom close button text</template>
|
|
@@ -440,7 +434,7 @@ CustomCloseBtnText.parameters = {
|
|
|
440
434
|
import { VBtn } from 'vuetify/components'
|
|
441
435
|
import { NotificationBar } from '@cnamts/synapse'
|
|
442
436
|
import { ref } from 'vue'
|
|
443
|
-
import { useNotificationService } from '
|
|
437
|
+
import { useNotificationService } from '@cnamts/synpase'
|
|
444
438
|
|
|
445
439
|
const { addNotification } = useNotificationService()
|
|
446
440
|
const showNotification = ref(false)
|
|
@@ -460,3 +454,62 @@ CustomCloseBtnText.parameters = {
|
|
|
460
454
|
},
|
|
461
455
|
],
|
|
462
456
|
}
|
|
457
|
+
|
|
458
|
+
export const Customization: Story = Default.bind({})
|
|
459
|
+
Customization.args = {
|
|
460
|
+
...Default.args,
|
|
461
|
+
rounded: 'pill',
|
|
462
|
+
type: 'success',
|
|
463
|
+
}
|
|
464
|
+
Customization.parameters = {
|
|
465
|
+
sourceCode: [
|
|
466
|
+
{
|
|
467
|
+
name: 'Template',
|
|
468
|
+
code: `
|
|
469
|
+
<div class="d-flex flex-wrap align-center justify-center">
|
|
470
|
+
<NotificationBar
|
|
471
|
+
v-model="showNotification"
|
|
472
|
+
:close-btn-text="closeBtnText"
|
|
473
|
+
:bottom="bottom"
|
|
474
|
+
:rounded="pill"
|
|
475
|
+
type="success"
|
|
476
|
+
>
|
|
477
|
+
<template #default>This is a success notification</template>
|
|
478
|
+
</NotificationBar>
|
|
479
|
+
<VBtn
|
|
480
|
+
color="success"
|
|
481
|
+
@click="envoyerNotification('This is a success notification')"
|
|
482
|
+
class="ma-6"
|
|
483
|
+
>
|
|
484
|
+
Afficher la notification
|
|
485
|
+
</VBtn>
|
|
486
|
+
</div>
|
|
487
|
+
`,
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
name: 'Script',
|
|
491
|
+
code: `
|
|
492
|
+
<script setup lang="ts">
|
|
493
|
+
import { VBtn } from 'vuetify/components'
|
|
494
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
495
|
+
import { ref } from 'vue'
|
|
496
|
+
import { useNotificationService } from '@cnamts/synpase'
|
|
497
|
+
|
|
498
|
+
const { addNotification } = useNotificationService()
|
|
499
|
+
const showNotification = ref(false)
|
|
500
|
+
|
|
501
|
+
const envoyerNotification = (message: string) => {
|
|
502
|
+
const notification = {
|
|
503
|
+
id: Date.now().toString(),
|
|
504
|
+
message,
|
|
505
|
+
type: 'success',
|
|
506
|
+
timeout: -1,
|
|
507
|
+
}
|
|
508
|
+
addNotification(notification)
|
|
509
|
+
showNotification.value = true
|
|
510
|
+
}
|
|
511
|
+
</script>
|
|
512
|
+
`,
|
|
513
|
+
},
|
|
514
|
+
],
|
|
515
|
+
}
|