@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,101 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { VTextField } from 'vuetify/components'
|
|
3
|
+
import { isRequired, isRequiredFn } from '.'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Guide du dev/Règles De Validation/isRequired',
|
|
7
|
+
component: isRequiredFn,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Default: StoryObj<unknown> = {
|
|
11
|
+
render: () => {
|
|
12
|
+
return {
|
|
13
|
+
components: { VTextField },
|
|
14
|
+
setup() {
|
|
15
|
+
return { isRequired }
|
|
16
|
+
},
|
|
17
|
+
template: `
|
|
18
|
+
<VTextField
|
|
19
|
+
:rules="[isRequired]"
|
|
20
|
+
label="Champ requis"
|
|
21
|
+
variant="outlined"
|
|
22
|
+
/>
|
|
23
|
+
`,
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
sourceCode: [
|
|
28
|
+
{
|
|
29
|
+
name: 'Script',
|
|
30
|
+
code: `
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { VTextField } from 'vuetify/components'
|
|
33
|
+
import { isRequired } from '@cnamts/synapse'
|
|
34
|
+
</script>
|
|
35
|
+
`,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Template',
|
|
39
|
+
code: `
|
|
40
|
+
<template>
|
|
41
|
+
<VTextField
|
|
42
|
+
:rules="[isRequired]"
|
|
43
|
+
label="Champ requis"
|
|
44
|
+
variant="outlined"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
`,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const CustomMessage: StoryObj<unknown> = {
|
|
54
|
+
render: () => {
|
|
55
|
+
return {
|
|
56
|
+
components: { VTextField },
|
|
57
|
+
setup() {
|
|
58
|
+
const isRequiredCustom = isRequiredFn({
|
|
59
|
+
default: 'This field is required',
|
|
60
|
+
})
|
|
61
|
+
return { isRequiredCustom }
|
|
62
|
+
},
|
|
63
|
+
template: `
|
|
64
|
+
<VTextField
|
|
65
|
+
:rules="[isRequiredCustom]"
|
|
66
|
+
label="Required"
|
|
67
|
+
variant="outlined"
|
|
68
|
+
/>
|
|
69
|
+
`,
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
parameters: {
|
|
73
|
+
sourceCode: [
|
|
74
|
+
{
|
|
75
|
+
name: 'Script',
|
|
76
|
+
code: `
|
|
77
|
+
<script setup lang="ts">
|
|
78
|
+
import { VTextField } from 'vuetify/components'
|
|
79
|
+
import { isRequiredFn } from '@cnamts/synapse'
|
|
80
|
+
|
|
81
|
+
const required = isRequiredFn({
|
|
82
|
+
default: 'This field is required',
|
|
83
|
+
})
|
|
84
|
+
</script>
|
|
85
|
+
`,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Template',
|
|
89
|
+
code: `
|
|
90
|
+
<template>
|
|
91
|
+
<VTextField
|
|
92
|
+
:rules="[required]"
|
|
93
|
+
label="Required"
|
|
94
|
+
variant="outlined"
|
|
95
|
+
/>
|
|
96
|
+
</template>
|
|
97
|
+
`,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ruleMessage } from '
|
|
1
|
+
import { ruleMessage } from '../../ruleMessage'
|
|
2
2
|
import type { ValidationRule, ValidationResult, ErrorMessages } from '../types'
|
|
3
3
|
|
|
4
4
|
import { defaultErrorMessages } from './locales'
|
|
5
5
|
|
|
6
6
|
export type Value = string | string[] | null
|
|
7
7
|
|
|
8
|
-
export function
|
|
8
|
+
export function isRequiredFn(
|
|
9
9
|
errorMessages: ErrorMessages = defaultErrorMessages,
|
|
10
10
|
): ValidationRule<Value> {
|
|
11
11
|
return (value: Value): ValidationResult => {
|
|
@@ -22,4 +22,4 @@ export function requiredFn(
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export const
|
|
25
|
+
export const isRequired = isRequiredFn()
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRequiredFn } from '../index'
|
|
2
2
|
import { describe, it, expect } from 'vitest'
|
|
3
3
|
|
|
4
|
-
describe('
|
|
4
|
+
describe('isRequiredFn', () => {
|
|
5
5
|
it('returns true for non-empty string', () => {
|
|
6
|
-
const rule =
|
|
6
|
+
const rule = isRequiredFn()
|
|
7
7
|
const result = rule('non-empty')
|
|
8
8
|
expect(result).toBe(true)
|
|
9
9
|
})
|
|
10
10
|
|
|
11
11
|
it('returns false for empty string', () => {
|
|
12
|
-
const rule =
|
|
12
|
+
const rule = isRequiredFn()
|
|
13
13
|
const result = rule('')
|
|
14
14
|
expect(result).toBe('Le champ est requis.')
|
|
15
15
|
})
|
|
16
16
|
|
|
17
17
|
it('returns true for non-empty array', () => {
|
|
18
|
-
const rule =
|
|
18
|
+
const rule = isRequiredFn()
|
|
19
19
|
const result = rule(['item'])
|
|
20
20
|
expect(result).toBe(true)
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
it('returns false for empty array', () => {
|
|
24
|
-
const rule =
|
|
24
|
+
const rule = isRequiredFn()
|
|
25
25
|
const result = rule([])
|
|
26
26
|
expect(result).toBe('Le champ est requis.')
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
it('returns true for non-null value', () => {
|
|
30
|
-
const rule =
|
|
30
|
+
const rule = isRequiredFn()
|
|
31
31
|
const result = rule('value')
|
|
32
32
|
expect(result).toBe(true)
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
it('returns false for null value', () => {
|
|
36
|
-
const rule =
|
|
36
|
+
const rule = isRequiredFn()
|
|
37
37
|
const result = rule(null)
|
|
38
38
|
expect(result).toBe('Le champ est requis.')
|
|
39
39
|
})
|
|
40
40
|
|
|
41
41
|
it('returns custom error message for empty string', () => {
|
|
42
42
|
const customMessages = { default: 'Custom required message' }
|
|
43
|
-
const rule =
|
|
43
|
+
const rule = isRequiredFn(customMessages)
|
|
44
44
|
const result = rule('')
|
|
45
45
|
expect(result).toBe('Custom required message')
|
|
46
46
|
})
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Meta, Canvas, Source } from '@storybook/blocks';
|
|
2
|
+
import * as IsValidEmailStories from './IsValidEmail.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={IsValidEmailStories} />
|
|
5
|
+
|
|
6
|
+
# Règle de validation `isValidEmail`
|
|
7
|
+
|
|
8
|
+
La règle de validation `isValidEmail` permet de vérifier si une chaîne de caractère est une adresse email valide.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
Pour utiliser cette règle de validation, vous devez importer la fonction d'ordre supérieur `isValidEmailFn` depuis le package `@cnamts/synapse`.
|
|
13
|
+
|
|
14
|
+
<Source dark code={`
|
|
15
|
+
import { isValidEmailFn } from '@cnamts/synapse';
|
|
16
|
+
`} />
|
|
17
|
+
|
|
18
|
+
Vous devez ensuite faire appel à cette fonction pour obtenir la règle de validation.
|
|
19
|
+
|
|
20
|
+
<Source dark code={`
|
|
21
|
+
const isValidEmail = isValidEmailFn(/* optionals options */);
|
|
22
|
+
`} />
|
|
23
|
+
|
|
24
|
+
Vous pouvez ensuite utiliser la fonction retournée comme règle d'un champs de formulaire.
|
|
25
|
+
|
|
26
|
+
<Source dark code={`
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { isValidEmailFn } from '@cnamts/synapse';
|
|
29
|
+
import { VTextField } from 'vuetify/components';
|
|
30
|
+
|
|
31
|
+
const isValidEmail = isValidEmailFn();
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<VTextField
|
|
36
|
+
:rules="[isValidEmail]"
|
|
37
|
+
label="Email"
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
`} />
|
|
42
|
+
|
|
43
|
+
Si vous n'utilisez cette règle sans options, vous pouvez faire appel à la fonction `isValidEmail`.
|
|
44
|
+
|
|
45
|
+
<Source dark code={`
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { isValidEmail } from '@cnamts/synapse';
|
|
48
|
+
import { VTextField } from 'vuetify/components';
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<VTextField
|
|
53
|
+
:rules="[isValidEmail]"
|
|
54
|
+
label="Email"
|
|
55
|
+
/>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
`} />
|
|
59
|
+
|
|
60
|
+
## API
|
|
61
|
+
|
|
62
|
+
<Source dark code={`
|
|
63
|
+
isValidEmailFn(
|
|
64
|
+
errorMessages?: {
|
|
65
|
+
default: string;
|
|
66
|
+
}
|
|
67
|
+
): (value: string) => true | string;
|
|
68
|
+
`} />
|
|
69
|
+
|
|
70
|
+
### Arguments
|
|
71
|
+
|
|
72
|
+
- `errorMessages` : objet optionnel permettant de personnaliser les messages d'erreur. Les clés disponibles sont :
|
|
73
|
+
- `default` : message d'erreur par défaut.
|
|
74
|
+
|
|
75
|
+
### Valeurs de retour
|
|
76
|
+
|
|
77
|
+
Retourne une fonction pouvant être utilisée comme règle de validation pour un champs de formulaire Vuetify.
|
|
78
|
+
|
|
79
|
+
## Exemples
|
|
80
|
+
|
|
81
|
+
<Canvas of={IsValidEmailStories.Default} />
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { VTextField } from 'vuetify/components'
|
|
3
|
+
import { isValidEmail, isValidEmailFn } from './index'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Guide du dev/Règles De Validation/isValidEmail',
|
|
7
|
+
component: isValidEmailFn,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Default: StoryObj<unknown> = {
|
|
11
|
+
render: () => {
|
|
12
|
+
return {
|
|
13
|
+
components: { VTextField },
|
|
14
|
+
setup() {
|
|
15
|
+
return { isValidEmail }
|
|
16
|
+
},
|
|
17
|
+
template: `
|
|
18
|
+
<VTextField
|
|
19
|
+
:rules="[isValidEmail]"
|
|
20
|
+
label="Email"
|
|
21
|
+
variant="outlined"
|
|
22
|
+
/>
|
|
23
|
+
`,
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
sourceCode: [
|
|
28
|
+
{
|
|
29
|
+
name: 'Script',
|
|
30
|
+
code: `
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { VTextField } from 'vuetify/components'
|
|
33
|
+
import { isValidEmail } from '@cnamts/synapse'
|
|
34
|
+
</script>
|
|
35
|
+
`,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Template',
|
|
39
|
+
code: `
|
|
40
|
+
<template>
|
|
41
|
+
<VTextField
|
|
42
|
+
:rules="[isValidEmail]"
|
|
43
|
+
label="Email"
|
|
44
|
+
variant="outlined"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
`,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const CustomMessage: StoryObj<unknown> = {
|
|
54
|
+
render: () => {
|
|
55
|
+
return {
|
|
56
|
+
components: { VTextField },
|
|
57
|
+
setup() {
|
|
58
|
+
const email = isValidEmailFn({
|
|
59
|
+
default: '请输入有效的电子邮件地址。',
|
|
60
|
+
})
|
|
61
|
+
return { email }
|
|
62
|
+
},
|
|
63
|
+
template: `
|
|
64
|
+
<VTextField
|
|
65
|
+
:rules="[email]"
|
|
66
|
+
label="电子邮件"
|
|
67
|
+
variant="outlined"
|
|
68
|
+
/>
|
|
69
|
+
`,
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
parameters: {
|
|
73
|
+
sourceCode: [
|
|
74
|
+
{
|
|
75
|
+
name: 'Script',
|
|
76
|
+
code: `
|
|
77
|
+
<script setup lang="ts">
|
|
78
|
+
import { VTextField } from 'vuetify/components'
|
|
79
|
+
import { isValidEmailFn } from '@cnamts/synapse'
|
|
80
|
+
|
|
81
|
+
const email = isValidEmailFn({
|
|
82
|
+
default: '请输入有效的电子邮件地址。',
|
|
83
|
+
})
|
|
84
|
+
</script>
|
|
85
|
+
`,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Template',
|
|
89
|
+
code: `
|
|
90
|
+
<template>
|
|
91
|
+
<VTextField
|
|
92
|
+
:rules="[email]"
|
|
93
|
+
label="电子邮件"
|
|
94
|
+
variant="outlined"
|
|
95
|
+
/>
|
|
96
|
+
</template>
|
|
97
|
+
`,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
}
|
|
@@ -5,13 +5,11 @@ import type {
|
|
|
5
5
|
ErrorMessages,
|
|
6
6
|
Value,
|
|
7
7
|
} from '@/utils/rules/types'
|
|
8
|
-
|
|
9
|
-
import { isEmailValid } from '../../functions/isEmailValid'
|
|
10
|
-
|
|
11
8
|
import { defaultErrorMessages } from './locales'
|
|
9
|
+
import { isEmailValid } from '@/utils/functions/validation/isEmailValid'
|
|
12
10
|
|
|
13
11
|
/** Check that the value is a valid email */
|
|
14
|
-
export function
|
|
12
|
+
export function isValidEmailFn(
|
|
15
13
|
errorMessages: ErrorMessages = defaultErrorMessages,
|
|
16
14
|
): ValidationRule {
|
|
17
15
|
return (value: Value): ValidationResult => {
|
|
@@ -23,4 +21,4 @@ export function emailFn(
|
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
export const
|
|
24
|
+
export const isValidEmail = isValidEmailFn()
|
package/src/utils/rules/{email/tests/email.spec.ts → isValidEmail/tests/isValidEmail.spec.ts}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isValidEmail, isValidEmailFn } from '..'
|
|
2
2
|
import { describe, it, expect } from 'vitest'
|
|
3
3
|
|
|
4
4
|
describe('email', () => {
|
|
5
5
|
it('returns an error when the email is invalid', () => {
|
|
6
|
-
expect(typeof
|
|
6
|
+
expect(typeof isValidEmail('test')).toBe('string')
|
|
7
7
|
})
|
|
8
8
|
|
|
9
9
|
it('returns true when the email is valid', () => {
|
|
10
|
-
expect(
|
|
10
|
+
expect(isValidEmail('test@example.com')).toBe(true)
|
|
11
11
|
})
|
|
12
12
|
|
|
13
13
|
it('returns true if the value is falsy', () => {
|
|
14
|
-
expect(
|
|
14
|
+
expect(isValidEmail('')).toBe(true)
|
|
15
15
|
})
|
|
16
16
|
|
|
17
17
|
it('works with custom error messages', () => {
|
|
18
|
-
const rule =
|
|
18
|
+
const rule = isValidEmailFn({
|
|
19
19
|
default: 'test',
|
|
20
20
|
})
|
|
21
21
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createVuetify } from 'vuetify'
|
|
2
|
+
import * as components from 'vuetify/components'
|
|
3
|
+
import * as directives from 'vuetify/directives'
|
|
4
|
+
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg'
|
|
5
|
+
import {
|
|
6
|
+
cnamColorsTokens,
|
|
7
|
+
cnamContextualTokens,
|
|
8
|
+
cnamLightTheme,
|
|
9
|
+
cnamDarkTheme,
|
|
10
|
+
paColorsTokens,
|
|
11
|
+
paContextualTokens,
|
|
12
|
+
paLightTheme,
|
|
13
|
+
paDarkTheme,
|
|
14
|
+
} from './designTokens'
|
|
15
|
+
import { createFlattenTheme } from './designTokens/utils'
|
|
16
|
+
import { fr } from 'vuetify/locale'
|
|
17
|
+
|
|
18
|
+
export const createVuetifyInstance = () => createVuetify({
|
|
19
|
+
components,
|
|
20
|
+
directives,
|
|
21
|
+
locale: {
|
|
22
|
+
locale: 'fr',
|
|
23
|
+
messages: { fr },
|
|
24
|
+
},
|
|
25
|
+
theme: {
|
|
26
|
+
defaultTheme: 'cnam',
|
|
27
|
+
themes: {
|
|
28
|
+
cnam: {
|
|
29
|
+
dark: false,
|
|
30
|
+
colors: {
|
|
31
|
+
...cnamLightTheme,
|
|
32
|
+
...cnamDarkTheme,
|
|
33
|
+
},
|
|
34
|
+
variables: {
|
|
35
|
+
'border-color': cnamColorsTokens.grey.base,
|
|
36
|
+
'font-family': '"Arial", sans-serif',
|
|
37
|
+
...createFlattenTheme(cnamContextualTokens),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
pa: {
|
|
41
|
+
dark: false,
|
|
42
|
+
colors: {
|
|
43
|
+
...paLightTheme,
|
|
44
|
+
...paDarkTheme,
|
|
45
|
+
},
|
|
46
|
+
variables: {
|
|
47
|
+
'border-color': paColorsTokens.grey.base,
|
|
48
|
+
'font-family': '"Roboto", sans-serif',
|
|
49
|
+
...createFlattenTheme(paContextualTokens),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
icons: {
|
|
55
|
+
defaultSet: 'mdi',
|
|
56
|
+
aliases,
|
|
57
|
+
sets: {
|
|
58
|
+
mdi,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
})
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ValidationRule, ErrorMessages } from '../types';
|
|
2
|
-
/** Check that the value does not exceeds the specified length */
|
|
3
|
-
export declare function exactLengthFn(lengthValue: number, ignoreSpaces?: boolean, errorMessages?: ErrorMessages<number>): ValidationRule;
|
|
4
|
-
export declare const exactLength: typeof exactLengthFn;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
-
|
|
3
|
-
exports[`SyTextField > matches snapshot 1`] = `
|
|
4
|
-
"<div data-v-8f0b2baf="" class="v-input v-input--horizontal v-input--center-affix v-input--density-default v-theme--light v-locale--is-ltr v-input--error v-text-field error-field">
|
|
5
|
-
<!---->
|
|
6
|
-
<div class="v-input__control">
|
|
7
|
-
<div class="v-field v-field--appended v-field--center-affix v-field--error v-field--prepended v-field--variant-outlined v-theme--light v-locale--is-ltr">
|
|
8
|
-
<div class="v-field__overlay"></div>
|
|
9
|
-
<div class="v-field__loader">
|
|
10
|
-
<div class="v-progress-linear v-theme--light v-locale--is-ltr" style="top: 0px; height: 0px; --v-progress-linear-height: 2px;" role="progressbar" aria-hidden="true" aria-valuemin="0" aria-valuemax="100">
|
|
11
|
-
<!---->
|
|
12
|
-
<div class="v-progress-linear__background bg-error" style="opacity: NaN;"></div>
|
|
13
|
-
<div class="v-progress-linear__buffer bg-error" style="opacity: NaN; width: 0%;"></div>
|
|
14
|
-
<transition-stub name="fade-transition" appear="false" persisted="false" css="true">
|
|
15
|
-
<div class="v-progress-linear__indeterminate">
|
|
16
|
-
<div class="v-progress-linear__indeterminate long bg-error"></div>
|
|
17
|
-
<div class="v-progress-linear__indeterminate short bg-error"></div>
|
|
18
|
-
</div>
|
|
19
|
-
</transition-stub>
|
|
20
|
-
<!---->
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="v-field__prepend-inner">
|
|
24
|
-
<!---->
|
|
25
|
-
<!--v-if-->
|
|
26
|
-
<!--v-if-->
|
|
27
|
-
</div>
|
|
28
|
-
<div class="v-field__field" data-no-activator="">
|
|
29
|
-
<!----><label class="v-label v-field-label" for="input-0">
|
|
30
|
-
<!---->custom label
|
|
31
|
-
</label>
|
|
32
|
-
<!----><input size="1" type="text" id="input-0" aria-describedby="input-0-messages" aria-label="custom label" display-asterisk="false" no-icon="false" class="v-field__input" value="">
|
|
33
|
-
<!---->
|
|
34
|
-
</div>
|
|
35
|
-
<!---->
|
|
36
|
-
<div class="v-field__append-inner"><i data-v-8f0b2baf="" class="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z mdi v-icon notranslate v-theme--light v-icon--size-default" aria-hidden="true"></i>
|
|
37
|
-
<!--v-if-->
|
|
38
|
-
<!---->
|
|
39
|
-
</div>
|
|
40
|
-
<div class="v-field__outline">
|
|
41
|
-
<div class="v-field__outline__start"></div>
|
|
42
|
-
<div class="v-field__outline__notch"><label class="v-label v-field-label v-field-label--floating" aria-hidden="true" for="input-0">
|
|
43
|
-
<!---->custom label
|
|
44
|
-
</label></div>
|
|
45
|
-
<div class="v-field__outline__end"></div>
|
|
46
|
-
<!---->
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<!---->
|
|
51
|
-
<div id="input-0-messages" class="v-input__details" role="alert" aria-live="polite">
|
|
52
|
-
<transition-group-stub name="slide-y-transition" tag="div" appear="false" persisted="false" css="true" class="v-messages">
|
|
53
|
-
<div class="v-messages__message">Test error message</div>
|
|
54
|
-
</transition-group-stub>
|
|
55
|
-
<!---->
|
|
56
|
-
</div>
|
|
57
|
-
</div>"
|
|
58
|
-
`;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** From https://emailregex.com/ */
|
|
2
|
-
// eslint-disable-next-line no-control-regex
|
|
3
|
-
export const EMAIL_REGEXP = /^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/
|
|
4
|
-
|
|
5
|
-
/** Check if an email is valid */
|
|
6
|
-
export function isEmailValid(email: string): boolean {
|
|
7
|
-
return Boolean(EMAIL_REGEXP.exec(email))
|
|
8
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ErrorMessages, GenericFnOpt } from '../types'
|
|
2
|
-
|
|
3
|
-
/** Get the value of an error message */
|
|
4
|
-
export function ruleMessage<T>(
|
|
5
|
-
errorMessages: ErrorMessages<T>,
|
|
6
|
-
key: string,
|
|
7
|
-
args: T[] = [],
|
|
8
|
-
): string {
|
|
9
|
-
if (typeof errorMessages[key] === 'function') {
|
|
10
|
-
return (errorMessages[key] as GenericFnOpt<T>)(...args)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return errorMessages[key] as string
|
|
14
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ruleMessage } from '../ruleMessageHelper'
|
|
2
|
-
import { describe, it, expect } from 'vitest'
|
|
3
|
-
|
|
4
|
-
describe('ruleMessage', () => {
|
|
5
|
-
it('returns the correct message for a string error message', () => {
|
|
6
|
-
const errorMessages = { required: 'This field is required' }
|
|
7
|
-
const result = ruleMessage(errorMessages, 'required')
|
|
8
|
-
expect(result).toBe('This field is required')
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('returns the correct message for a function error message', () => {
|
|
12
|
-
const errorMessages = { minLength: (min: number) => `Minimum length is ${min}` }
|
|
13
|
-
const result = ruleMessage(errorMessages, 'minLength', [5])
|
|
14
|
-
expect(result).toBe('Minimum length is 5')
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('handles multiple arguments for a function error message', () => {
|
|
18
|
-
const errorMessages = { range: (min: number, max: number) => `Value must be between ${min} and ${max}` }
|
|
19
|
-
const result = ruleMessage(errorMessages, 'range', [1, 10])
|
|
20
|
-
expect(result).toBe('Value must be between 1 and 10')
|
|
21
|
-
})
|
|
22
|
-
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/utils/functions/{isEmailValid → validation/isEmailValid}/tests/isEmailValid.spec.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|