@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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
|
|
3
3
|
import { VIcon } from 'vuetify/components'
|
|
4
|
-
import { ref } from 'vue'
|
|
4
|
+
import { ref, watch } from 'vue'
|
|
5
5
|
import { mdiAccountBox } from '@mdi/js'
|
|
6
|
+
import { VBtn } from 'vuetify/components'
|
|
6
7
|
|
|
7
8
|
const meta = {
|
|
8
9
|
title: 'Composants/Formulaires/SyTextField',
|
|
@@ -14,7 +15,7 @@ const meta = {
|
|
|
14
15
|
],
|
|
15
16
|
parameters: {
|
|
16
17
|
layout: 'fullscreen',
|
|
17
|
-
controls: { exclude: ['modelValue', 'appendInnerIconColor'] },
|
|
18
|
+
controls: { exclude: ['modelValue', 'appendInnerIconColor', 'errorMessages', 'warningMessages', 'successMessages'] },
|
|
18
19
|
docs: {
|
|
19
20
|
description: {
|
|
20
21
|
component: `SyTextField`,
|
|
@@ -22,55 +23,296 @@ const meta = {
|
|
|
22
23
|
},
|
|
23
24
|
},
|
|
24
25
|
argTypes: {
|
|
25
|
-
modelValue: { control: 'text' },
|
|
26
|
-
label: {
|
|
27
|
-
|
|
26
|
+
'modelValue': { control: 'text' },
|
|
27
|
+
'label': {
|
|
28
|
+
description: 'Texte affiché comme label du champ',
|
|
29
|
+
control: 'text',
|
|
30
|
+
},
|
|
31
|
+
'prependIcon': {
|
|
28
32
|
control: 'select',
|
|
29
33
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
30
34
|
},
|
|
31
|
-
appendIcon: {
|
|
35
|
+
'appendIcon': {
|
|
32
36
|
control: 'select',
|
|
33
37
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
34
38
|
},
|
|
35
|
-
prependInnerIcon: {
|
|
39
|
+
'prependInnerIcon': {
|
|
36
40
|
control: 'select',
|
|
37
41
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
38
42
|
},
|
|
39
|
-
appendInnerIcon: {
|
|
43
|
+
'appendInnerIcon': {
|
|
40
44
|
control: 'select',
|
|
41
45
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
42
46
|
},
|
|
43
|
-
variantStyle: {
|
|
47
|
+
'variantStyle': {
|
|
44
48
|
control: 'select',
|
|
45
49
|
options: ['outlined', 'plain', 'underlined', 'filled', 'solo', 'solo-inverted', 'solo-filled'],
|
|
46
50
|
},
|
|
47
|
-
color: {
|
|
51
|
+
'color': {
|
|
48
52
|
control: 'select',
|
|
49
53
|
options: ['primary', 'secondary', 'success', 'error', 'warning'],
|
|
50
54
|
description: 'Couleur du champ',
|
|
51
55
|
},
|
|
52
|
-
density: {
|
|
56
|
+
'density': {
|
|
53
57
|
control: 'select',
|
|
54
58
|
options: ['default', 'comfortable', 'compact'],
|
|
55
59
|
description: 'Densité du champ',
|
|
56
60
|
},
|
|
57
|
-
|
|
58
|
-
control: 'select',
|
|
59
|
-
options: ['horizontal', 'vertical'],
|
|
60
|
-
description: 'Direction d\'affichage',
|
|
61
|
-
},
|
|
62
|
-
customRules: {
|
|
61
|
+
'customRules': {
|
|
63
62
|
description: 'Règles de validation personnalisées',
|
|
64
63
|
control: 'object',
|
|
65
64
|
},
|
|
66
|
-
customWarningRules: {
|
|
65
|
+
'customWarningRules': {
|
|
67
66
|
description: 'Règles d\'avertissement personnalisées',
|
|
68
67
|
control: 'object',
|
|
69
68
|
},
|
|
70
|
-
showSuccessMessages: {
|
|
69
|
+
'showSuccessMessages': {
|
|
71
70
|
description: 'Afficher les messages de succès',
|
|
72
71
|
control: 'boolean',
|
|
73
72
|
},
|
|
73
|
+
'isValidateOnBlur': {
|
|
74
|
+
description: 'Vérifie la validité lors de la perte de focus',
|
|
75
|
+
control: 'boolean',
|
|
76
|
+
default: true,
|
|
77
|
+
},
|
|
78
|
+
'disableErrorHandling': {
|
|
79
|
+
control: 'boolean',
|
|
80
|
+
description: 'Désactive complètement la validation des règles et l\'affichage des erreurs',
|
|
81
|
+
},
|
|
82
|
+
'isActive': {
|
|
83
|
+
description: 'Force l\'état actif du champ (label flottant et styles visuels)',
|
|
84
|
+
control: 'boolean',
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
'isClearable': {
|
|
88
|
+
description: 'Affiche un bouton pour effacer le contenu du champ',
|
|
89
|
+
control: 'boolean',
|
|
90
|
+
default: false,
|
|
91
|
+
},
|
|
92
|
+
'prependTooltip': {
|
|
93
|
+
description: 'Si le texte du prepend tooltip est renseigné alors l\'icône du tooltip s\'affiche',
|
|
94
|
+
control: 'text',
|
|
95
|
+
},
|
|
96
|
+
'appendTooltip': {
|
|
97
|
+
description: 'Si le texte du append tooltip est renseigné alors l\'icône du tooltip s\'affiche',
|
|
98
|
+
control: 'text',
|
|
99
|
+
},
|
|
100
|
+
'tooltipLocation': {
|
|
101
|
+
description: 'Position des tooltips',
|
|
102
|
+
control: 'select',
|
|
103
|
+
options: ['top', 'bottom', 'start', 'end'],
|
|
104
|
+
default: 'top',
|
|
105
|
+
},
|
|
106
|
+
'required': {
|
|
107
|
+
description: 'Indique si le champ est obligatoire',
|
|
108
|
+
control: 'boolean',
|
|
109
|
+
default: false,
|
|
110
|
+
},
|
|
111
|
+
'displayAsterisk': {
|
|
112
|
+
description: 'Affiche un astérisque à côté du label',
|
|
113
|
+
control: 'boolean',
|
|
114
|
+
default: false,
|
|
115
|
+
},
|
|
116
|
+
'isDisabled': {
|
|
117
|
+
description: 'Désactive le champ',
|
|
118
|
+
control: 'boolean',
|
|
119
|
+
default: false,
|
|
120
|
+
},
|
|
121
|
+
'isReadOnly': {
|
|
122
|
+
description: 'Rend le champ en lecture seule',
|
|
123
|
+
control: 'boolean',
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
'baseColor': {
|
|
127
|
+
description: 'Couleur de base du champ (par défaut hérite de color)',
|
|
128
|
+
control: 'text',
|
|
129
|
+
},
|
|
130
|
+
'bgColor': {
|
|
131
|
+
description: 'Couleur de fond du champ',
|
|
132
|
+
control: 'text',
|
|
133
|
+
},
|
|
134
|
+
'centerAffix': {
|
|
135
|
+
description: 'Centre verticalement les éléments ajoutés avant/après le champ',
|
|
136
|
+
control: 'boolean',
|
|
137
|
+
},
|
|
138
|
+
'counter': {
|
|
139
|
+
description: 'Affiche un compteur de caractères',
|
|
140
|
+
control: 'boolean',
|
|
141
|
+
},
|
|
142
|
+
'counterValue': {
|
|
143
|
+
description: 'Fonction personnalisée pour calculer la valeur du compteur',
|
|
144
|
+
control: 'object',
|
|
145
|
+
},
|
|
146
|
+
'direction': {
|
|
147
|
+
description: 'Direction du champ (horizontal ou vertical)',
|
|
148
|
+
control: 'select',
|
|
149
|
+
options: ['horizontal', 'vertical'],
|
|
150
|
+
},
|
|
151
|
+
'isDirty': {
|
|
152
|
+
description: 'Indique si le champ a été modifié',
|
|
153
|
+
control: 'boolean',
|
|
154
|
+
},
|
|
155
|
+
'isFlat': {
|
|
156
|
+
description: 'Supprime l\'élévation du champ',
|
|
157
|
+
control: 'boolean',
|
|
158
|
+
},
|
|
159
|
+
'isFocused': {
|
|
160
|
+
description: 'Force l\'état focus du champ',
|
|
161
|
+
control: 'boolean',
|
|
162
|
+
},
|
|
163
|
+
'areDetailsHidden': {
|
|
164
|
+
description: 'Masque la section des détails (messages d\'erreur, compteur)',
|
|
165
|
+
control: 'boolean',
|
|
166
|
+
},
|
|
167
|
+
'areSpinButtonsHidden': {
|
|
168
|
+
description: 'Masque les boutons d\'incrémentation pour les champs numériques',
|
|
169
|
+
control: 'boolean',
|
|
170
|
+
},
|
|
171
|
+
'hint': {
|
|
172
|
+
description: 'Texte d\'aide affiché sous le champ',
|
|
173
|
+
control: 'text',
|
|
174
|
+
},
|
|
175
|
+
'loading': {
|
|
176
|
+
description: 'Affiche un indicateur de chargement',
|
|
177
|
+
control: 'boolean',
|
|
178
|
+
},
|
|
179
|
+
'maxErrors': {
|
|
180
|
+
description: 'Nombre maximum de messages d\'erreur à afficher',
|
|
181
|
+
control: { type: 'text' },
|
|
182
|
+
},
|
|
183
|
+
'maxWidth': {
|
|
184
|
+
description: 'Largeur maximale du champ',
|
|
185
|
+
control: { type: 'text' },
|
|
186
|
+
},
|
|
187
|
+
'minWidth': {
|
|
188
|
+
description: 'Largeur minimale du champ',
|
|
189
|
+
control: { type: 'text' },
|
|
190
|
+
},
|
|
191
|
+
'name': {
|
|
192
|
+
description: 'Nom du champ pour les formulaires',
|
|
193
|
+
control: 'text',
|
|
194
|
+
},
|
|
195
|
+
'displayPersistentClear': {
|
|
196
|
+
description: 'Affiche toujours le bouton de réinitialisation',
|
|
197
|
+
control: 'boolean',
|
|
198
|
+
default: false,
|
|
199
|
+
},
|
|
200
|
+
'displayPersistentCounter': {
|
|
201
|
+
description: 'Affiche toujours le compteur',
|
|
202
|
+
control: 'boolean',
|
|
203
|
+
default: false,
|
|
204
|
+
},
|
|
205
|
+
'displayPersistentHint': {
|
|
206
|
+
description: 'Affiche toujours le texte d\'aide',
|
|
207
|
+
control: 'boolean',
|
|
208
|
+
default: false,
|
|
209
|
+
},
|
|
210
|
+
'displayPersistentPlaceholder': {
|
|
211
|
+
description: 'Garde le placeholder visible même avec une valeur',
|
|
212
|
+
control: 'boolean',
|
|
213
|
+
default: false,
|
|
214
|
+
},
|
|
215
|
+
'placeholder': {
|
|
216
|
+
description: 'Texte affiché quand le champ est vide',
|
|
217
|
+
control: 'text',
|
|
218
|
+
},
|
|
219
|
+
'prefix': {
|
|
220
|
+
description: 'Texte affiché avant la valeur: prefix="€" : affichera "€" avant la valeur saisie',
|
|
221
|
+
control: 'text',
|
|
222
|
+
},
|
|
223
|
+
'isReversed': {
|
|
224
|
+
description: 'Inverse l\'ordre des éléments',
|
|
225
|
+
control: 'boolean',
|
|
226
|
+
default: false,
|
|
227
|
+
},
|
|
228
|
+
'role': {
|
|
229
|
+
description: 'Rôle ARIA du champ',
|
|
230
|
+
control: 'text',
|
|
231
|
+
},
|
|
232
|
+
'rounded': {
|
|
233
|
+
description: 'Arrondit les coins du champ',
|
|
234
|
+
control: { type: 'text' },
|
|
235
|
+
},
|
|
236
|
+
'isOnSingleLine': {
|
|
237
|
+
description: 'Force l\'affichage sur une seule ligne',
|
|
238
|
+
control: 'boolean',
|
|
239
|
+
default: false,
|
|
240
|
+
},
|
|
241
|
+
'suffix': {
|
|
242
|
+
description: 'Texte affiché après la valeur',
|
|
243
|
+
control: 'text',
|
|
244
|
+
},
|
|
245
|
+
'theme': {
|
|
246
|
+
description: 'Thème à appliquer au champ',
|
|
247
|
+
control: 'text',
|
|
248
|
+
},
|
|
249
|
+
'isTiled': {
|
|
250
|
+
description: 'Applique un style tuile',
|
|
251
|
+
control: 'boolean',
|
|
252
|
+
default: false,
|
|
253
|
+
},
|
|
254
|
+
'type': {
|
|
255
|
+
description: 'Type du champ de saisie',
|
|
256
|
+
control: 'select',
|
|
257
|
+
options: ['text', 'number', 'password', 'email', 'tel', 'url', 'search'],
|
|
258
|
+
default: 'text',
|
|
259
|
+
},
|
|
260
|
+
'width': {
|
|
261
|
+
description: 'Largeur du champ',
|
|
262
|
+
control: { type: 'text' },
|
|
263
|
+
},
|
|
264
|
+
'validation': {
|
|
265
|
+
description: 'Valide le champ avec la valeur donnée',
|
|
266
|
+
type: '(value: string | number | null) => void',
|
|
267
|
+
},
|
|
268
|
+
'validateOnSubmit': {
|
|
269
|
+
description: 'Valide le champ lors de la soumission du formulaire',
|
|
270
|
+
type: '() => void',
|
|
271
|
+
},
|
|
272
|
+
'checkErrorOnBlur': {
|
|
273
|
+
description: 'Vérifie les erreurs lors de la perte de focus',
|
|
274
|
+
type: '() => void',
|
|
275
|
+
},
|
|
276
|
+
'append': {
|
|
277
|
+
description: 'Slot pour ajouter du contenu à droite du champ',
|
|
278
|
+
control: false,
|
|
279
|
+
table: {
|
|
280
|
+
type: { summary: 'VNode' },
|
|
281
|
+
category: 'slots',
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
'prepend': {
|
|
285
|
+
description: 'Slot pour ajouter du contenu à gauche du champ',
|
|
286
|
+
control: false,
|
|
287
|
+
table: {
|
|
288
|
+
type: { summary: 'VNode' },
|
|
289
|
+
category: 'slots',
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
'append-inner': {
|
|
293
|
+
description: 'Slot pour ajouter du contenu à droite dans le champ',
|
|
294
|
+
control: false,
|
|
295
|
+
table: {
|
|
296
|
+
type: { summary: 'VNode' },
|
|
297
|
+
category: 'slots',
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
'prepend-inner': {
|
|
301
|
+
description: 'Slot pour ajouter du contenu à gauche dans le champ',
|
|
302
|
+
control: false,
|
|
303
|
+
table: {
|
|
304
|
+
type: { summary: 'VNode' },
|
|
305
|
+
category: 'slots',
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
'details': {
|
|
309
|
+
description: 'Slot pour personnaliser la section des détails (messages d\'erreur, compteur)',
|
|
310
|
+
control: false,
|
|
311
|
+
table: {
|
|
312
|
+
type: { summary: 'VNode' },
|
|
313
|
+
category: 'slots',
|
|
314
|
+
},
|
|
315
|
+
},
|
|
74
316
|
},
|
|
75
317
|
} as Meta<typeof SyTextField>
|
|
76
318
|
|
|
@@ -110,7 +352,10 @@ export const Default: Story = {
|
|
|
110
352
|
return {
|
|
111
353
|
components: { SyTextField, VIcon },
|
|
112
354
|
setup() {
|
|
113
|
-
const value = ref(
|
|
355
|
+
const value = ref(args.modelValue)
|
|
356
|
+
watch(() => args.modelValue, (newValue) => {
|
|
357
|
+
value.value = newValue
|
|
358
|
+
})
|
|
114
359
|
return { args, value }
|
|
115
360
|
},
|
|
116
361
|
template: `
|
|
@@ -123,51 +368,117 @@ export const Default: Story = {
|
|
|
123
368
|
}
|
|
124
369
|
|
|
125
370
|
export const Required: Story = {
|
|
371
|
+
args: {
|
|
372
|
+
...Default.args,
|
|
373
|
+
required: true,
|
|
374
|
+
},
|
|
375
|
+
render: (args) => {
|
|
376
|
+
return {
|
|
377
|
+
components: { SyTextField, VIcon },
|
|
378
|
+
setup() {
|
|
379
|
+
const value = ref(args.modelValue)
|
|
380
|
+
watch(() => args.modelValue, (newValue) => {
|
|
381
|
+
value.value = newValue
|
|
382
|
+
})
|
|
383
|
+
return { args, value }
|
|
384
|
+
},
|
|
385
|
+
template: `
|
|
386
|
+
<div class="d-flex flex-wrap align-center">
|
|
387
|
+
<SyTextField v-bind="args" v-model="value" />
|
|
388
|
+
</div>
|
|
389
|
+
`,
|
|
390
|
+
}
|
|
391
|
+
},
|
|
126
392
|
parameters: {
|
|
393
|
+
docs: {
|
|
394
|
+
description: {
|
|
395
|
+
story: `
|
|
396
|
+
### Champ requis sans astérisque
|
|
397
|
+
|
|
398
|
+
Cette story montre un champ requis sans astérisque.
|
|
399
|
+
Pour afficher l'astérisque sur un champ requis, il faut activer la prop \`displayAsterisk\`.`,
|
|
400
|
+
},
|
|
401
|
+
},
|
|
127
402
|
sourceCode: [
|
|
128
403
|
{
|
|
129
404
|
name: 'Template',
|
|
130
|
-
code:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
`,
|
|
405
|
+
code: `<template>
|
|
406
|
+
<SyTextField
|
|
407
|
+
v-model="value"
|
|
408
|
+
required
|
|
409
|
+
label="Champ requis sans astérisque"
|
|
410
|
+
/>
|
|
411
|
+
</template>`,
|
|
138
412
|
},
|
|
139
413
|
{
|
|
140
414
|
name: 'Script',
|
|
141
|
-
code:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
415
|
+
code: `<script setup lang="ts">
|
|
416
|
+
import { SyTextField } from '@cnamts/synapse'
|
|
417
|
+
import { ref } from 'vue'
|
|
418
|
+
|
|
419
|
+
const value = ref('')
|
|
420
|
+
</script>`,
|
|
146
421
|
},
|
|
147
422
|
],
|
|
148
423
|
},
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export const RequiredWithAsterisk: Story = {
|
|
149
427
|
args: {
|
|
150
|
-
|
|
151
|
-
variantStyle: 'outlined',
|
|
152
|
-
color: 'primary',
|
|
153
|
-
isClearable: true,
|
|
154
|
-
label: 'Label',
|
|
428
|
+
...Default.args,
|
|
155
429
|
required: true,
|
|
156
|
-
|
|
430
|
+
displayAsterisk: true,
|
|
157
431
|
},
|
|
158
432
|
render: (args) => {
|
|
159
433
|
return {
|
|
160
434
|
components: { SyTextField, VIcon },
|
|
161
435
|
setup() {
|
|
162
|
-
|
|
436
|
+
const value = ref(args.modelValue)
|
|
437
|
+
watch(() => args.modelValue, (newValue) => {
|
|
438
|
+
value.value = newValue
|
|
439
|
+
})
|
|
440
|
+
return { args, value }
|
|
163
441
|
},
|
|
164
442
|
template: `
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
443
|
+
<div class="d-flex flex-wrap align-center">
|
|
444
|
+
<SyTextField v-bind="args" v-model="value" />
|
|
445
|
+
</div>
|
|
446
|
+
`,
|
|
169
447
|
}
|
|
170
448
|
},
|
|
449
|
+
parameters: {
|
|
450
|
+
docs: {
|
|
451
|
+
description: {
|
|
452
|
+
story: `
|
|
453
|
+
### Champ requis avec astérisque
|
|
454
|
+
|
|
455
|
+
Cette story montre un champ requis avec astérisque.
|
|
456
|
+
L'astérisque ne peut être affiché que sur un champ requis, en activant la prop \`displayAsterisk\`.`,
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
sourceCode: [
|
|
460
|
+
{
|
|
461
|
+
name: 'Template',
|
|
462
|
+
code: `<template>
|
|
463
|
+
<SyTextField
|
|
464
|
+
v-model="value"
|
|
465
|
+
required
|
|
466
|
+
display-asterisk
|
|
467
|
+
label="Champ requis avec astérisque"
|
|
468
|
+
/>
|
|
469
|
+
</template>`,
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: 'Script',
|
|
473
|
+
code: `<script setup lang="ts">
|
|
474
|
+
import { SyTextField } from '@cnamts/synapse'
|
|
475
|
+
import { ref } from 'vue'
|
|
476
|
+
|
|
477
|
+
const value = ref('')
|
|
478
|
+
</script>`,
|
|
479
|
+
},
|
|
480
|
+
],
|
|
481
|
+
},
|
|
171
482
|
}
|
|
172
483
|
|
|
173
484
|
export const SlotPrepend: Story = {
|
|
@@ -207,15 +518,15 @@ export const SlotPrepend: Story = {
|
|
|
207
518
|
return {
|
|
208
519
|
components: { SyTextField, VIcon },
|
|
209
520
|
setup() {
|
|
210
|
-
|
|
521
|
+
const value = ref(args.modelValue)
|
|
522
|
+
watch(() => args.modelValue, (newValue) => {
|
|
523
|
+
value.value = newValue
|
|
524
|
+
})
|
|
525
|
+
return { args, value }
|
|
211
526
|
},
|
|
212
527
|
template: `
|
|
213
528
|
<div class="d-flex flex-wrap align-center">
|
|
214
|
-
<SyTextField
|
|
215
|
-
v-bind="args"
|
|
216
|
-
:label="args.label"
|
|
217
|
-
:prepend-icon="args.prependIcon"
|
|
218
|
-
/>
|
|
529
|
+
<SyTextField v-bind="args" v-model="value" />
|
|
219
530
|
</div>
|
|
220
531
|
`,
|
|
221
532
|
}
|
|
@@ -259,14 +570,15 @@ export const SlotAppend: Story = {
|
|
|
259
570
|
return {
|
|
260
571
|
components: { SyTextField, VIcon },
|
|
261
572
|
setup() {
|
|
262
|
-
|
|
573
|
+
const value = ref(args.modelValue)
|
|
574
|
+
watch(() => args.modelValue, (newValue) => {
|
|
575
|
+
value.value = newValue
|
|
576
|
+
})
|
|
577
|
+
return { args, value }
|
|
263
578
|
},
|
|
264
579
|
template: `
|
|
265
580
|
<div class="d-flex flex-wrap align-center">
|
|
266
|
-
<SyTextField
|
|
267
|
-
v-bind="args"
|
|
268
|
-
:append-icon="args.appendIcon"
|
|
269
|
-
/>
|
|
581
|
+
<SyTextField v-bind="args" v-model="value" />
|
|
270
582
|
</div>
|
|
271
583
|
`,
|
|
272
584
|
}
|
|
@@ -310,14 +622,15 @@ export const SlotPrependInner: Story = {
|
|
|
310
622
|
return {
|
|
311
623
|
components: { SyTextField, VIcon },
|
|
312
624
|
setup() {
|
|
313
|
-
|
|
625
|
+
const value = ref(args.modelValue)
|
|
626
|
+
watch(() => args.modelValue, (newValue) => {
|
|
627
|
+
value.value = newValue
|
|
628
|
+
})
|
|
629
|
+
return { args, value }
|
|
314
630
|
},
|
|
315
631
|
template: `
|
|
316
632
|
<div class="d-flex flex-wrap align-center">
|
|
317
|
-
<SyTextField
|
|
318
|
-
v-bind="args"
|
|
319
|
-
:prepend-inner-icon="args.prependInnerIcon"
|
|
320
|
-
/>
|
|
633
|
+
<SyTextField v-bind="args" v-model="value" />
|
|
321
634
|
</div>
|
|
322
635
|
`,
|
|
323
636
|
}
|
|
@@ -362,15 +675,15 @@ export const SlotPrependInnerDivider: Story = {
|
|
|
362
675
|
return {
|
|
363
676
|
components: { SyTextField, VIcon },
|
|
364
677
|
setup() {
|
|
365
|
-
|
|
678
|
+
const value = ref(args.modelValue)
|
|
679
|
+
watch(() => args.modelValue, (newValue) => {
|
|
680
|
+
value.value = newValue
|
|
681
|
+
})
|
|
682
|
+
return { args, value }
|
|
366
683
|
},
|
|
367
684
|
template: `
|
|
368
685
|
<div class="d-flex flex-wrap align-center">
|
|
369
|
-
<SyTextField
|
|
370
|
-
v-bind="args"
|
|
371
|
-
:prepend-inner-icon="args.prependInnerIcon"
|
|
372
|
-
:show-divider="args.showDivider"
|
|
373
|
-
/>
|
|
686
|
+
<SyTextField v-bind="args" v-model="value" />
|
|
374
687
|
</div>
|
|
375
688
|
`,
|
|
376
689
|
}
|
|
@@ -414,14 +727,15 @@ export const SlotAppendInner: Story = {
|
|
|
414
727
|
return {
|
|
415
728
|
components: { SyTextField, VIcon },
|
|
416
729
|
setup() {
|
|
417
|
-
|
|
730
|
+
const value = ref(args.modelValue)
|
|
731
|
+
watch(() => args.modelValue, (newValue) => {
|
|
732
|
+
value.value = newValue
|
|
733
|
+
})
|
|
734
|
+
return { args, value }
|
|
418
735
|
},
|
|
419
736
|
template: `
|
|
420
737
|
<div class="d-flex flex-wrap align-center">
|
|
421
|
-
<SyTextField
|
|
422
|
-
v-bind="args"
|
|
423
|
-
:append-inner-icon="args.appendInnerIcon"
|
|
424
|
-
/>
|
|
738
|
+
<SyTextField v-bind="args" v-model="value" />
|
|
425
739
|
</div>
|
|
426
740
|
`,
|
|
427
741
|
}
|
|
@@ -470,15 +784,17 @@ export const SlotCustomIcon: Story = {
|
|
|
470
784
|
return {
|
|
471
785
|
components: { SyTextField, VIcon },
|
|
472
786
|
setup() {
|
|
787
|
+
const value = ref(args.modelValue)
|
|
788
|
+
watch(() => args.modelValue, (newValue) => {
|
|
789
|
+
value.value = newValue
|
|
790
|
+
})
|
|
473
791
|
const iconName = ref(mdiAccountBox)
|
|
474
792
|
|
|
475
|
-
return { args, iconName }
|
|
793
|
+
return { args, value, iconName }
|
|
476
794
|
},
|
|
477
795
|
template: `
|
|
478
796
|
<div class="d-flex flex-wrap align-center">
|
|
479
|
-
<SyTextField
|
|
480
|
-
v-bind="args"
|
|
481
|
-
>
|
|
797
|
+
<SyTextField v-bind="args" v-model="value">
|
|
482
798
|
<template #append-inner>
|
|
483
799
|
<VIcon>
|
|
484
800
|
{{ iconName }}
|
|
@@ -574,10 +890,10 @@ Cette story montre l'utilisation combinée des règles standard et d'avertisseme
|
|
|
574
890
|
required
|
|
575
891
|
:customWarningRules="[
|
|
576
892
|
{
|
|
577
|
-
type: '
|
|
893
|
+
type: 'minLength',
|
|
578
894
|
options: {
|
|
579
895
|
length: 10,
|
|
580
|
-
message: 'Le texte
|
|
896
|
+
message: 'Le texte doit comporter plus de 10 caracteres'
|
|
581
897
|
}
|
|
582
898
|
}
|
|
583
899
|
]"
|
|
@@ -600,10 +916,10 @@ Cette story montre l'utilisation combinée des règles standard et d'avertisseme
|
|
|
600
916
|
required
|
|
601
917
|
:customWarningRules="[
|
|
602
918
|
{
|
|
603
|
-
type: '
|
|
919
|
+
type: 'minLength',
|
|
604
920
|
options: {
|
|
605
921
|
length: 10,
|
|
606
|
-
message: 'Le texte
|
|
922
|
+
message: 'Le texte doit comporter plus de 10 caracteres'
|
|
607
923
|
}
|
|
608
924
|
}
|
|
609
925
|
]"
|
|
@@ -739,6 +1055,169 @@ Cette story montre l'utilisation de la règle \`matchPattern\` pour valider un f
|
|
|
739
1055
|
}),
|
|
740
1056
|
}
|
|
741
1057
|
|
|
1058
|
+
export const WithTooltips: Story = {
|
|
1059
|
+
args: {
|
|
1060
|
+
modelValue: '',
|
|
1061
|
+
label: 'Champ avec tooltips',
|
|
1062
|
+
prependTooltip: 'Information à gauche du champ',
|
|
1063
|
+
appendTooltip: 'Information à droite du champ',
|
|
1064
|
+
tooltipLocation: 'top',
|
|
1065
|
+
},
|
|
1066
|
+
render: args => ({
|
|
1067
|
+
components: { SyTextField },
|
|
1068
|
+
setup() {
|
|
1069
|
+
const value = ref(args.modelValue)
|
|
1070
|
+
return { args, value }
|
|
1071
|
+
},
|
|
1072
|
+
template: `
|
|
1073
|
+
<div>
|
|
1074
|
+
<p class="mb-4">
|
|
1075
|
+
Des icônes d'information avec tooltips sont affichées de chaque côté du champ.
|
|
1076
|
+
Survolez-les pour voir les messages d'aide qui apparaissent en haut grâce à la prop tooltipLocation="top".
|
|
1077
|
+
</p>
|
|
1078
|
+
<SyTextField
|
|
1079
|
+
v-model="value"
|
|
1080
|
+
v-bind="args"
|
|
1081
|
+
/>
|
|
1082
|
+
</div>
|
|
1083
|
+
`,
|
|
1084
|
+
}),
|
|
1085
|
+
parameters: {
|
|
1086
|
+
docs: {
|
|
1087
|
+
description: {
|
|
1088
|
+
story: 'Exemple de champ avec des tooltips d\'information. Les icônes d\'information apparaissent automatiquement lorsque les props prependTooltip et/ou appendTooltip sont renseignées. La position des tooltips peut être contrôlée avec la prop tooltipLocation.',
|
|
1089
|
+
},
|
|
1090
|
+
},
|
|
1091
|
+
sourceCode: [
|
|
1092
|
+
{
|
|
1093
|
+
name: 'Template',
|
|
1094
|
+
code: `
|
|
1095
|
+
<template>
|
|
1096
|
+
<SyTextField
|
|
1097
|
+
v-model="value"
|
|
1098
|
+
label="Champ avec tooltips"
|
|
1099
|
+
prependTooltip="Information à gauche du champ"
|
|
1100
|
+
appendTooltip="Information à droite du champ"
|
|
1101
|
+
tooltipLocation="top"
|
|
1102
|
+
/>
|
|
1103
|
+
</template>
|
|
1104
|
+
`,
|
|
1105
|
+
},
|
|
1106
|
+
],
|
|
1107
|
+
},
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Story avec validation désactivée au blur
|
|
1112
|
+
*/
|
|
1113
|
+
export const ValidateOnBlur: Story = {
|
|
1114
|
+
args: {
|
|
1115
|
+
modelValue: '',
|
|
1116
|
+
label: 'Champ texte',
|
|
1117
|
+
required: true,
|
|
1118
|
+
isValidateOnBlur: true,
|
|
1119
|
+
customRules: [
|
|
1120
|
+
{
|
|
1121
|
+
type: 'custom',
|
|
1122
|
+
options: {
|
|
1123
|
+
message: 'Le champ doit contenir au moins 3 caractères',
|
|
1124
|
+
validate: (value: string) => value.length >= 3,
|
|
1125
|
+
},
|
|
1126
|
+
},
|
|
1127
|
+
],
|
|
1128
|
+
},
|
|
1129
|
+
render: args => ({
|
|
1130
|
+
components: { SyTextField, VBtn },
|
|
1131
|
+
setup() {
|
|
1132
|
+
const value = ref(args.modelValue)
|
|
1133
|
+
const fieldRef = ref()
|
|
1134
|
+
|
|
1135
|
+
function handleSubmit() {
|
|
1136
|
+
const isValid = fieldRef.value?.validateOnSubmit()
|
|
1137
|
+
alert(isValid ? 'Formulaire valide !' : 'Formulaire invalide, veuillez corriger les erreurs.')
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
return { args, value, fieldRef, handleSubmit }
|
|
1141
|
+
},
|
|
1142
|
+
template: `
|
|
1143
|
+
<form @submit.prevent="handleSubmit">
|
|
1144
|
+
<p class="mb-4">
|
|
1145
|
+
La validation ne se déclenche qu'à la perte de focus ou à la soumission du formulaire.
|
|
1146
|
+
</p>
|
|
1147
|
+
<SyTextField
|
|
1148
|
+
ref="fieldRef"
|
|
1149
|
+
v-model="value"
|
|
1150
|
+
v-bind="args"
|
|
1151
|
+
@update:model-value="args.modelValue = $event"
|
|
1152
|
+
/>
|
|
1153
|
+
<div class="mt-4">
|
|
1154
|
+
<VBtn type="submit" color="primary">
|
|
1155
|
+
Valider
|
|
1156
|
+
</VBtn>
|
|
1157
|
+
</div>
|
|
1158
|
+
</form>
|
|
1159
|
+
`,
|
|
1160
|
+
}),
|
|
1161
|
+
parameters: {
|
|
1162
|
+
docs: {
|
|
1163
|
+
description: {
|
|
1164
|
+
story: 'Exemple de champ avec validation désactivée au blur. La validation ne se déclenche que lors de la soumission du formulaire.',
|
|
1165
|
+
},
|
|
1166
|
+
},
|
|
1167
|
+
sourceCode: [
|
|
1168
|
+
{
|
|
1169
|
+
name: 'Template',
|
|
1170
|
+
code: `
|
|
1171
|
+
<template>
|
|
1172
|
+
<form @submit.prevent="handleSubmit">
|
|
1173
|
+
<SyTextField
|
|
1174
|
+
ref="fieldRef"
|
|
1175
|
+
v-model="value"
|
|
1176
|
+
label="Champ texte"
|
|
1177
|
+
required
|
|
1178
|
+
:is-validate-on-blur="true"
|
|
1179
|
+
:custom-rules="[
|
|
1180
|
+
{
|
|
1181
|
+
type: 'custom',
|
|
1182
|
+
options: {
|
|
1183
|
+
message: 'Le champ doit contenir au moins 3 caractères',
|
|
1184
|
+
validate: value => value.length >= 3
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
]"
|
|
1188
|
+
/>
|
|
1189
|
+
<button type="submit">
|
|
1190
|
+
Valider
|
|
1191
|
+
</button>
|
|
1192
|
+
</form>
|
|
1193
|
+
</template>
|
|
1194
|
+
`,
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
name: 'Script',
|
|
1198
|
+
code: `
|
|
1199
|
+
<script setup lang="ts">
|
|
1200
|
+
import { ref } from 'vue'
|
|
1201
|
+
import { SyTextField } from '@cnamts/synapse'
|
|
1202
|
+
|
|
1203
|
+
const value = ref('')
|
|
1204
|
+
const fieldRef = ref()
|
|
1205
|
+
|
|
1206
|
+
function handleSubmit() {
|
|
1207
|
+
const isValid = fieldRef.value?.validateOnSubmit()
|
|
1208
|
+
if (!isValid) {
|
|
1209
|
+
// Gérer l'erreur
|
|
1210
|
+
return
|
|
1211
|
+
}
|
|
1212
|
+
// Continuer avec la soumission
|
|
1213
|
+
}
|
|
1214
|
+
</script>
|
|
1215
|
+
`,
|
|
1216
|
+
},
|
|
1217
|
+
],
|
|
1218
|
+
},
|
|
1219
|
+
}
|
|
1220
|
+
|
|
742
1221
|
export const FormValidation: Story = {
|
|
743
1222
|
render: args => ({
|
|
744
1223
|
components: { SyTextField },
|
|
@@ -868,3 +1347,254 @@ export const FormValidation: Story = {
|
|
|
868
1347
|
`,
|
|
869
1348
|
}),
|
|
870
1349
|
}
|
|
1350
|
+
|
|
1351
|
+
export const WithPrefixAndSuffix: Story = {
|
|
1352
|
+
args: {
|
|
1353
|
+
modelValue: '42',
|
|
1354
|
+
label: 'Montant',
|
|
1355
|
+
prefix: '€',
|
|
1356
|
+
suffix: 'TTC',
|
|
1357
|
+
},
|
|
1358
|
+
render: args => ({
|
|
1359
|
+
components: { SyTextField },
|
|
1360
|
+
setup() {
|
|
1361
|
+
const value = ref(args.modelValue)
|
|
1362
|
+
return { args, value }
|
|
1363
|
+
},
|
|
1364
|
+
template: `
|
|
1365
|
+
<div>
|
|
1366
|
+
<p class="mb-4">
|
|
1367
|
+
Utilisation des props prefix et suffix pour ajouter des unités ou des informations complémentaires
|
|
1368
|
+
directement dans le champ.
|
|
1369
|
+
</p>
|
|
1370
|
+
<SyTextField
|
|
1371
|
+
v-model="value"
|
|
1372
|
+
v-bind="args"
|
|
1373
|
+
/>
|
|
1374
|
+
</div>
|
|
1375
|
+
`,
|
|
1376
|
+
}),
|
|
1377
|
+
parameters: {
|
|
1378
|
+
docs: {
|
|
1379
|
+
description: {
|
|
1380
|
+
story: 'Exemple d\'utilisation des props prefix et suffix pour ajouter des informations complémentaires directement dans le champ de saisie.',
|
|
1381
|
+
},
|
|
1382
|
+
},
|
|
1383
|
+
sourceCode: [
|
|
1384
|
+
{
|
|
1385
|
+
name: 'Template',
|
|
1386
|
+
code: `
|
|
1387
|
+
<template>
|
|
1388
|
+
<SyTextField
|
|
1389
|
+
v-model="value"
|
|
1390
|
+
label="Montant"
|
|
1391
|
+
prefix="€"
|
|
1392
|
+
suffix="TTC"
|
|
1393
|
+
/>
|
|
1394
|
+
</template>
|
|
1395
|
+
`,
|
|
1396
|
+
},
|
|
1397
|
+
],
|
|
1398
|
+
},
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
export const DisabledErrorHandling: Story = {
|
|
1402
|
+
args: {
|
|
1403
|
+
label: 'Champ requis',
|
|
1404
|
+
required: true,
|
|
1405
|
+
customRules: [
|
|
1406
|
+
{
|
|
1407
|
+
type: 'required',
|
|
1408
|
+
options: {
|
|
1409
|
+
message: 'Ce champ est obligatoire.',
|
|
1410
|
+
},
|
|
1411
|
+
},
|
|
1412
|
+
],
|
|
1413
|
+
},
|
|
1414
|
+
render: (args) => {
|
|
1415
|
+
return {
|
|
1416
|
+
components: { SyTextField },
|
|
1417
|
+
setup() {
|
|
1418
|
+
const value1 = ref('')
|
|
1419
|
+
const value2 = ref('')
|
|
1420
|
+
|
|
1421
|
+
return { args, value1, value2 }
|
|
1422
|
+
},
|
|
1423
|
+
template: `
|
|
1424
|
+
<div>
|
|
1425
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
|
|
1426
|
+
<div>
|
|
1427
|
+
<p class="text-subtitle-2 mb-2">Validation normale</p>
|
|
1428
|
+
<SyTextField
|
|
1429
|
+
v-model="value1"
|
|
1430
|
+
v-bind="args"
|
|
1431
|
+
is-validate-on-blur
|
|
1432
|
+
/>
|
|
1433
|
+
</div>
|
|
1434
|
+
|
|
1435
|
+
<div>
|
|
1436
|
+
<p class="text-subtitle-2 mb-2">Sans gestion d'erreurs</p>
|
|
1437
|
+
<SyTextField
|
|
1438
|
+
v-model="value2"
|
|
1439
|
+
v-bind="args"
|
|
1440
|
+
disableErrorHandling
|
|
1441
|
+
is-validate-on-blur
|
|
1442
|
+
/>
|
|
1443
|
+
</div>
|
|
1444
|
+
</div>
|
|
1445
|
+
|
|
1446
|
+
<div class="mt-4 text-body-2">
|
|
1447
|
+
<p>Instructions :</p>
|
|
1448
|
+
<ol>
|
|
1449
|
+
<li class="ml-4">Cliquez dans un champ puis en dehors pour déclencher la validation</li>
|
|
1450
|
+
<li class="ml-4">Observez que le champ de gauche affiche un message d'erreur</li>
|
|
1451
|
+
<li class="ml-4">Le champ de droite n'affiche aucune erreur malgré les mêmes règles</li>
|
|
1452
|
+
</ol>
|
|
1453
|
+
</div>
|
|
1454
|
+
</div>
|
|
1455
|
+
`,
|
|
1456
|
+
}
|
|
1457
|
+
},
|
|
1458
|
+
parameters: {
|
|
1459
|
+
docs: {
|
|
1460
|
+
description: {
|
|
1461
|
+
story: 'La prop `disableErrorHandling` permet de désactiver complètement la gestion des erreurs de validation, même si des règles sont définies.',
|
|
1462
|
+
},
|
|
1463
|
+
},
|
|
1464
|
+
sourceCode: [
|
|
1465
|
+
{
|
|
1466
|
+
name: 'Template',
|
|
1467
|
+
code: `
|
|
1468
|
+
<template>
|
|
1469
|
+
<!-- Champ avec validation normale -->
|
|
1470
|
+
<SyTextField
|
|
1471
|
+
v-model="value"
|
|
1472
|
+
label="Champ obligatoire"
|
|
1473
|
+
required
|
|
1474
|
+
:custom-rules="[{
|
|
1475
|
+
type: 'required',
|
|
1476
|
+
options: { message: 'Ce champ est obligatoire.' }
|
|
1477
|
+
}]"
|
|
1478
|
+
is-validate-on-blur
|
|
1479
|
+
/>
|
|
1480
|
+
|
|
1481
|
+
<!-- Champ avec gestion d'erreur désactivée -->
|
|
1482
|
+
<SyTextField
|
|
1483
|
+
v-model="value"
|
|
1484
|
+
label="Champ obligatoire"
|
|
1485
|
+
required
|
|
1486
|
+
:custom-rules="[{
|
|
1487
|
+
type: 'required',
|
|
1488
|
+
options: { message: 'Ce champ est obligatoire.' }
|
|
1489
|
+
}]"
|
|
1490
|
+
disableErrorHandling
|
|
1491
|
+
is-validate-on-blur
|
|
1492
|
+
/>
|
|
1493
|
+
</template>`,
|
|
1494
|
+
},
|
|
1495
|
+
],
|
|
1496
|
+
},
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
export const WithoutSuccessMessages: Story = {
|
|
1500
|
+
args: {
|
|
1501
|
+
label: 'Email',
|
|
1502
|
+
customRules: [
|
|
1503
|
+
{
|
|
1504
|
+
type: 'matchPattern',
|
|
1505
|
+
options: {
|
|
1506
|
+
pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
1507
|
+
message: 'Veuillez entrer une adresse email valide',
|
|
1508
|
+
successMessage: 'Le format de l\'email est correct',
|
|
1509
|
+
fieldIdentifier: 'Email',
|
|
1510
|
+
},
|
|
1511
|
+
},
|
|
1512
|
+
],
|
|
1513
|
+
},
|
|
1514
|
+
render: (args) => {
|
|
1515
|
+
return {
|
|
1516
|
+
components: { SyTextField },
|
|
1517
|
+
setup() {
|
|
1518
|
+
const value1 = ref('user@example.com')
|
|
1519
|
+
const value2 = ref('user@example.com')
|
|
1520
|
+
|
|
1521
|
+
return { args, value1, value2 }
|
|
1522
|
+
},
|
|
1523
|
+
template: `
|
|
1524
|
+
<div>
|
|
1525
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
|
|
1526
|
+
<div>
|
|
1527
|
+
<p class="text-subtitle-2 mb-2">Avec messages de succès (défaut)</p>
|
|
1528
|
+
<SyTextField
|
|
1529
|
+
v-model="value1"
|
|
1530
|
+
v-bind="args"
|
|
1531
|
+
showSuccessMessages
|
|
1532
|
+
/>
|
|
1533
|
+
</div>
|
|
1534
|
+
|
|
1535
|
+
<div>
|
|
1536
|
+
<p class="text-subtitle-2 mb-2">Sans messages de succès</p>
|
|
1537
|
+
<SyTextField
|
|
1538
|
+
v-model="value2"
|
|
1539
|
+
v-bind="args"
|
|
1540
|
+
:showSuccessMessages="false"
|
|
1541
|
+
/>
|
|
1542
|
+
</div>
|
|
1543
|
+
</div>
|
|
1544
|
+
|
|
1545
|
+
<div class="mt-4 text-body-2">
|
|
1546
|
+
<p>Les deux champs ont la même valeur et passent la validation :</p>
|
|
1547
|
+
<ul >
|
|
1548
|
+
<li class="ml-4">Le champ de gauche affiche le message de succès</li>
|
|
1549
|
+
<li class="ml-4">Le champ de droite n'affiche aucun message</li>
|
|
1550
|
+
</ul>
|
|
1551
|
+
<p class="mt-2">Essayez de modifier les valeurs pour voir le comportement.</p>
|
|
1552
|
+
</div>
|
|
1553
|
+
</div>
|
|
1554
|
+
`,
|
|
1555
|
+
}
|
|
1556
|
+
},
|
|
1557
|
+
parameters: {
|
|
1558
|
+
docs: {
|
|
1559
|
+
description: {
|
|
1560
|
+
story: 'La prop `showSuccessMessages` (par défaut: `true`) permet de contrôler l\'affichage des messages de succès lors de la validation.',
|
|
1561
|
+
},
|
|
1562
|
+
},
|
|
1563
|
+
sourceCode: [
|
|
1564
|
+
{
|
|
1565
|
+
name: 'Template',
|
|
1566
|
+
code: `
|
|
1567
|
+
<template>
|
|
1568
|
+
<!-- Champ avec messages de succès (défaut) -->
|
|
1569
|
+
<SyTextField
|
|
1570
|
+
v-model="email"
|
|
1571
|
+
label="Email"
|
|
1572
|
+
:custom-rules="[{
|
|
1573
|
+
type: 'matchPattern',
|
|
1574
|
+
options: {
|
|
1575
|
+
pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,
|
|
1576
|
+
message: 'Veuillez entrer une adresse email valide',
|
|
1577
|
+
successMessage: 'Le format de l\\'email est correct',
|
|
1578
|
+
}
|
|
1579
|
+
}]"
|
|
1580
|
+
/>
|
|
1581
|
+
|
|
1582
|
+
<!-- Champ sans messages de succès -->
|
|
1583
|
+
<SyTextField
|
|
1584
|
+
v-model="email"
|
|
1585
|
+
label="Email"
|
|
1586
|
+
:custom-rules="[{
|
|
1587
|
+
type: 'matchPattern',
|
|
1588
|
+
options: {
|
|
1589
|
+
pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,
|
|
1590
|
+
message: 'Veuillez entrer une adresse email valide',
|
|
1591
|
+
successMessage: 'Le format de l\\'email est correct',
|
|
1592
|
+
}
|
|
1593
|
+
}]"
|
|
1594
|
+
:showSuccessMessages="false"
|
|
1595
|
+
/>
|
|
1596
|
+
</template>`,
|
|
1597
|
+
},
|
|
1598
|
+
],
|
|
1599
|
+
},
|
|
1600
|
+
}
|