@cnamts/synapse 0.0.4-alpha → 0.0.6-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.d.ts +1277 -499
- package/dist/design-system-v3.js +4193 -1573
- package/dist/design-system-v3.umd.cjs +8 -8
- package/dist/style.css +1 -1
- package/package.json +18 -17
- package/src/assets/settings.scss +3 -0
- package/src/assets/tokens.scss +16 -17
- package/src/components/BackBtn/Accessibilite.mdx +14 -0
- package/src/components/BackBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackBtn/AccessibiliteItems.ts +102 -0
- package/src/components/BackBtn/BackBtn.mdx +1 -1
- package/src/components/BackBtn/BackBtn.stories.ts +8 -8
- package/src/components/BackBtn/BackBtn.vue +0 -1
- package/src/components/BackBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/BackToTopBtn/Accessibilite.mdx +14 -0
- package/src/components/BackToTopBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackToTopBtn/AccessibiliteItems.ts +52 -0
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +1 -1
- package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CollapsibleList/Accessibilite.mdx +14 -0
- package/src/components/CollapsibleList/Accessibilite.stories.ts +170 -0
- package/src/components/CollapsibleList/AccessibiliteItems.ts +122 -0
- package/src/components/CollapsibleList/CollapsibleList.stories.ts +1 -1
- package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CookieBanner/Accessibilite.mdx +14 -0
- package/src/components/CookieBanner/Accessibilite.stories.ts +219 -0
- package/src/components/CookieBanner/AccessibiliteItems.ts +356 -0
- package/src/components/CookieBanner/CookieBanner.mdx +219 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +678 -0
- package/src/components/CookieBanner/CookieBanner.vue +225 -0
- package/src/components/CookieBanner/config.ts +38 -0
- package/src/components/CookieBanner/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CookieBanner/locales.ts +12 -0
- package/src/components/CookieBanner/tests/CookieBanner.spec.ts +129 -0
- package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +197 -0
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +123 -0
- package/src/components/CookiesSelection/CookiesInformation/locales.ts +21 -0
- package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.spec.ts +121 -0
- package/src/components/CookiesSelection/CookiesSelection.vue +127 -0
- package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +47 -0
- package/src/components/CookiesSelection/CookiesTable/headers.ts +14 -0
- package/src/components/CookiesSelection/CookiesTable/tests/CookiesTable.spec.ts +30 -0
- package/src/components/CookiesSelection/CookiesTable/tests/__snapshots__/CookiesTable.spec.ts.snap +3 -0
- package/src/components/CookiesSelection/locales.ts +10 -0
- package/src/components/CookiesSelection/tests/CookiesSelection.spec.ts +184 -0
- package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +192 -0
- package/src/components/CookiesSelection/types.ts +15 -0
- package/src/components/CopyBtn/Accessibilite.mdx +14 -0
- package/src/components/CopyBtn/Accessibilite.stories.ts +166 -0
- package/src/components/CopyBtn/AccessibiliteItems.ts +105 -0
- package/src/components/CopyBtn/CopyBtn.mdx +1 -1
- package/src/components/CopyBtn/CopyBtn.stories.ts +4 -4
- package/src/components/CopyBtn/CopyBtn.vue +0 -1
- package/src/components/CopyBtn/config.ts +2 -0
- package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyBtnSelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyBtnSelect/Accessibilite.stories.ts +193 -0
- package/src/components/Customs/SyBtnSelect/AccessibiliteItems.ts +139 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +45 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +662 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +254 -0
- package/src/components/Customs/SyBtnSelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.ts +168 -0
- package/src/components/Customs/SyInputSelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyInputSelect/Accessibilite.stories.ts +166 -0
- package/src/components/Customs/SyInputSelect/AccessibiliteItems.ts +96 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +41 -0
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.stories.ts → SyInputSelect/SyInputSelect.stories.ts} +30 -83
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.vue → SyInputSelect/SyInputSelect.vue} +46 -6
- package/src/components/Customs/SyInputSelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +140 -0
- package/src/components/Customs/SySelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SySelect/Accessibilite.stories.ts +217 -0
- package/src/components/Customs/SySelect/AccessibiliteItems.ts +173 -0
- package/src/components/Customs/{CustomSelect/CustomSelect.mdx → SySelect/SySelect.mdx} +9 -8
- package/src/components/Customs/{CustomSelect/CustomSelect.stories.ts → SySelect/SySelect.stories.ts} +25 -79
- package/src/components/Customs/{CustomSelect/CustomSelect.vue → SySelect/SySelect.vue} +44 -13
- package/src/components/Customs/SySelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/{CustomInputSelect/tests/CustomInputSelect.spec.ts → SySelect/tests/SySelect.spec.ts} +48 -71
- package/src/components/Customs/SyTextField/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyTextField/Accessibilite.stories.ts +224 -0
- package/src/components/Customs/SyTextField/AccessibiliteItems.ts +198 -0
- package/src/components/Customs/SyTextField/SyTextField.mdx +44 -0
- package/src/components/Customs/{CustomTextField/CustomTextField.stories.ts → SyTextField/SyTextField.stories.ts} +145 -34
- package/src/components/Customs/{CustomTextField/CustomTextField.vue → SyTextField/SyTextField.vue} +27 -7
- package/src/components/Customs/SyTextField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/{CustomTextField/tests/CustomTextField.spec.ts → SyTextField/tests/SyTextField.spec.ts} +3 -3
- package/src/components/Customs/{CustomTextField/tests/__snapshots__/CustomTextField.spec.ts.snap → SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap} +5 -6
- package/src/components/DataList/Accessibilite.mdx +14 -0
- package/src/components/DataList/Accessibilite.stories.ts +166 -0
- package/src/components/DataList/AccessibiliteItems.ts +47 -0
- package/src/components/DataList/DataList.mdx +1 -1
- package/src/components/DataList/DataList.stories.ts +10 -10
- package/src/components/DataList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DataListGroup/Accessibilite.mdx +14 -0
- package/src/components/DataListGroup/Accessibilite.stories.ts +225 -0
- package/src/components/DataListGroup/AccessibiliteItems.ts +79 -0
- package/src/components/DataListGroup/DataListGroup.mdx +1 -1
- package/src/components/DataListGroup/DataListGroup.stories.ts +7 -7
- package/src/components/DataListGroup/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DialogBox/Accessibilite.mdx +14 -0
- package/src/components/DialogBox/Accessibilite.stories.ts +189 -0
- package/src/components/DialogBox/AccessibiliteItems.ts +167 -0
- package/src/components/DialogBox/DialogBox.mdx +14 -0
- package/src/components/DialogBox/DialogBox.stories.ts +798 -0
- package/src/components/DialogBox/DialogBox.vue +181 -0
- package/src/components/DialogBox/config.ts +25 -0
- package/src/components/DialogBox/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DialogBox/locales.ts +5 -0
- package/src/components/DialogBox/tests/DialogBox.spec.ts +329 -0
- package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +46 -0
- package/src/components/DownloadBtn/AccessibiliteItems.ts +1 -31
- package/src/components/DownloadBtn/DownloadBtn.mdx +3 -3
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +6 -6
- package/src/components/ErrorPage/Accessibilite.mdx +14 -0
- package/src/components/ErrorPage/Accessibilite.stories.ts +189 -0
- package/src/components/ErrorPage/AccessibiliteItems.ts +205 -0
- package/src/components/ErrorPage/ErrorPage.mdx +21 -0
- package/src/components/ErrorPage/ErrorPage.stories.ts +133 -0
- package/src/components/ErrorPage/ErrorPage.vue +93 -0
- package/src/components/ErrorPage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/ErrorPage/locales.ts +5 -0
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +40 -0
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +78 -0
- package/src/components/FooterBar/Accessibilite.mdx +14 -0
- package/src/components/FooterBar/Accessibilite.stories.ts +223 -0
- package/src/components/FooterBar/AccessibiliteItems.ts +257 -0
- package/src/components/FooterBar/FooterBar.mdx +2 -2
- package/src/components/FooterBar/FooterBar.stories.ts +556 -8
- package/src/components/FooterBar/FooterBar.vue +80 -73
- package/src/components/FooterBar/config.ts +2 -3
- package/src/components/FooterBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/FooterBar/tests/FooterBar.spec.ts +1 -1
- package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
- package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +24 -22
- package/src/components/FranceConnectBtn/Accessibilite.mdx +14 -0
- package/src/components/FranceConnectBtn/Accessibilite.stories.ts +194 -0
- package/src/components/FranceConnectBtn/AccessibiliteItems.ts +169 -0
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +3 -3
- package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/Accessibilite.mdx +14 -0
- package/src/components/HeaderBar/Accessibilite.stories.ts +223 -0
- package/src/components/HeaderBar/AccessibiliteItems.ts +194 -0
- package/src/components/HeaderBar/HeaderBar.stories.ts +60 -2
- package/src/components/HeaderBar/HeaderBar.vue +1 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.mdx +14 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.stories.ts +223 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/AccessibiliteItems.ts +174 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +1 -1
- package/src/components/HeaderLoading/Accessibilite.mdx +14 -0
- package/src/components/HeaderLoading/Accessibilite.stories.ts +167 -0
- package/src/components/HeaderLoading/AccessibiliteItems.ts +29 -0
- package/src/components/HeaderLoading/HeaderLoading.mdx +1 -1
- package/src/components/HeaderLoading/HeaderLoading.stories.ts +1 -1
- package/src/components/HeaderLoading/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +6 -6
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +35 -33
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +1 -1
- package/src/components/HeaderToolbar/Accessibilite.mdx +14 -0
- package/src/components/HeaderToolbar/Accessibilite.stories.ts +203 -0
- package/src/components/HeaderToolbar/AccessibiliteItems.ts +200 -0
- package/src/components/HeaderToolbar/HeaderToolbar.mdx +1 -1
- package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +2 -2
- package/src/components/HeaderToolbar/HeaderToolbar.vue +3 -2
- package/src/components/HeaderToolbar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +36 -2
- package/src/components/LangBtn/Accessibilite.mdx +14 -0
- package/src/components/LangBtn/Accessibilite.stories.ts +168 -0
- package/src/components/LangBtn/AccessibiliteItems.ts +101 -0
- package/src/components/LangBtn/LangBtn.mdx +1 -1
- package/src/components/LangBtn/LangBtn.stories.ts +4 -4
- package/src/components/LangBtn/LangBtn.vue +3 -2
- package/src/components/LangBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/LangBtn/tests/LangBtn.spec.ts +1 -1
- package/src/components/LangBtn/tests/__snapshots__/LangBtn.spec.ts.snap +1 -1
- package/src/components/Logo/Accessibilite.mdx +14 -0
- package/src/components/Logo/Accessibilite.stories.ts +223 -0
- package/src/components/Logo/AccessibiliteItems.ts +155 -0
- package/src/components/Logo/Logo.mdx +1 -1
- package/src/components/Logo/Logo.stories.ts +8 -8
- package/src/components/Logo/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/LogoBrandSection/Accessibilite.mdx +14 -0
- package/src/components/LogoBrandSection/Accessibilite.stories.ts +223 -0
- package/src/components/LogoBrandSection/AccessibiliteItems.ts +194 -0
- package/src/components/LogoBrandSection/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/MaintenancePage/Accessibilite.mdx +14 -0
- package/src/components/MaintenancePage/Accessibilite.stories.ts +189 -0
- package/src/components/MaintenancePage/AccessibiliteItems.ts +173 -0
- package/src/components/MaintenancePage/MaintenancePage.mdx +11 -0
- package/src/components/MaintenancePage/MaintenancePage.stories.ts +41 -0
- package/src/components/MaintenancePage/MaintenancePage.vue +25 -0
- package/src/components/MaintenancePage/assets/maintenance.svg +1 -0
- package/src/components/MaintenancePage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/MaintenancePage/index.ts +3 -0
- package/src/components/MaintenancePage/locales.ts +5 -0
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +12 -0
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +3 -0
- package/src/components/NirField/Accessibilite.mdx +14 -0
- package/src/components/NirField/Accessibilite.stories.ts +214 -0
- package/src/components/NirField/AccessibiliteItems.ts +243 -0
- package/src/components/NirField/NirField.mdx +216 -0
- package/src/components/NirField/NirField.stories.ts +359 -0
- package/src/components/NirField/NirField.vue +450 -0
- package/src/components/NirField/config.ts +16 -0
- package/src/components/NirField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NirField/locales.ts +12 -0
- package/src/components/NirField/nirValidation.ts +42 -0
- package/src/components/NirField/tests/NirField.spec.ts +119 -0
- package/src/components/NotFoundPage/Accessibilite.mdx +14 -0
- package/src/components/NotFoundPage/Accessibilite.stories.ts +190 -0
- package/src/components/NotFoundPage/AccessibiliteItems.ts +205 -0
- package/src/components/NotFoundPage/NotFoundPage.mdx +19 -0
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +76 -0
- package/src/components/NotFoundPage/NotFoundPage.vue +52 -0
- package/src/components/NotFoundPage/assets/not-found.svg +1 -0
- package/src/components/NotFoundPage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotFoundPage/locales.ts +6 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +38 -0
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +76 -0
- package/src/components/NotificationBar/Accessibilite.mdx +14 -0
- package/src/components/NotificationBar/Accessibilite.stories.ts +166 -0
- package/src/components/NotificationBar/AccessibiliteItems.ts +144 -0
- package/src/components/NotificationBar/NotificationBar.mdx +1 -1
- package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotificationBar/options.ts +1 -0
- package/src/components/PageContainer/Accessibilite.mdx +14 -0
- package/src/components/PageContainer/Accessibilite.stories.ts +166 -0
- package/src/components/PageContainer/AccessibiliteItems.ts +52 -0
- package/src/components/PageContainer/PageContainer.mdx +1 -1
- package/src/components/PageContainer/PageContainer.stories.ts +4 -4
- package/src/components/PageContainer/PageContainer.vue +16 -15
- package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PageContainer/tests/PageContainer.spec.ts +1 -1
- package/src/components/PageContainer/tests/__snapshots__/PageContainer.spec.ts.snap +2 -2
- package/src/components/PhoneField/Accessibilite.mdx +14 -0
- package/src/components/PhoneField/Accessibilite.stories.ts +216 -0
- package/src/components/PhoneField/AccessibiliteItems.ts +238 -0
- package/src/components/PhoneField/PhoneField.mdx +1 -1
- package/src/components/PhoneField/PhoneField.stories.ts +2 -2
- package/src/components/PhoneField/PhoneField.vue +5 -6
- package/src/components/PhoneField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +3 -3
- package/src/components/SkipLink/Accessibilite.mdx +14 -0
- package/src/components/SkipLink/Accessibilite.stories.ts +167 -0
- package/src/components/SkipLink/AccessibiliteItems.ts +77 -0
- package/src/components/SkipLink/SkipLink.stories.ts +2 -2
- package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SocialMediaLinks/Accessibilite.mdx +14 -0
- package/src/components/SocialMediaLinks/Accessibilite.stories.ts +170 -0
- package/src/components/SocialMediaLinks/AccessibiliteItems.ts +160 -0
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +18 -14
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +3 -2
- package/src/components/SocialMediaLinks/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +1 -1
- package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +2 -2
- package/src/components/SubHeader/Accessibilite.mdx +14 -0
- package/src/components/SubHeader/Accessibilite.stories.ts +166 -0
- package/src/components/SubHeader/AccessibiliteItems.ts +146 -0
- package/src/components/SubHeader/SubHeader.mdx +1 -1
- package/src/components/SubHeader/SubHeader.stories.ts +11 -11
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SubHeader/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SyAlert/Accessibilite.mdx +14 -0
- package/src/components/SyAlert/Accessibilite.stories.ts +166 -0
- package/src/components/SyAlert/AccessibiliteItems.ts +122 -0
- package/src/components/{Alert/Alert.mdx → SyAlert/SyAlert.mdx} +9 -9
- package/src/components/{Alert/Alert.stories.ts → SyAlert/SyAlert.stories.ts} +22 -22
- package/src/components/SyAlert/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/{Alert/tests/Alert.spec.ts → SyAlert/tests/SyAlert.spec.ts} +5 -5
- package/src/components/{Alert/tests/__snapshots__/Alert.spec.ts.snap → SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap} +2 -2
- package/src/components/UserMenuBtn/Accessibilite.mdx +14 -0
- package/src/components/UserMenuBtn/Accessibilite.stories.ts +189 -0
- package/src/components/UserMenuBtn/AccessibiliteItems.ts +155 -0
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +35 -0
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +540 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +101 -0
- package/src/components/UserMenuBtn/config.ts +24 -0
- package/src/components/UserMenuBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +125 -0
- package/src/components/index.ts +19 -4
- package/src/composables/index.ts +8 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +84 -0
- package/src/composables/rules/useFieldValidation.ts +90 -0
- package/src/designTokens/index.ts +2 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +5 -0
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +1 -0
- package/src/main.ts +3 -0
- package/src/stories/Fondamentaux/Arrondis.mdx +24 -0
- package/src/stories/{Guidelines → Fondamentaux}/Colors.mdx +1 -1
- package/src/stories/Fondamentaux/Conteneurs.mdx +7 -0
- package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +7 -0
- package/src/stories/Fondamentaux/Elevations.mdx +14 -0
- package/src/stories/Fondamentaux/Espacements.mdx +29 -0
- package/src/stories/{Guidelines → Fondamentaux}/Introduction.mdx +1 -1
- package/src/stories/Fondamentaux/StylesTypographiques.mdx +33 -0
- package/src/stories/Fondamentaux/Typographie.mdx +58 -0
- package/src/stories/GuideDuDev/CommentUtiliserLesRules.mdx +120 -0
- package/src/stories/GuideDuDev/components.stories.ts +5 -5
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
- package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.stories.ts +1 -1
- package/src/stories/{Fondamentaux → Guidelines}/EcoConception/Econception.stories.ts +2 -2
- package/src/stories/Guidelines/Vuetify/Vuetify.mdx +11 -0
- package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +138 -0
- package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +350 -0
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +0 -40
- package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +0 -236
- package/src/components/Customs/CustomTextField/CustomTextField.mdx +0 -44
- package/src/stories/Guidelines/CustomisationEtThemes.mdx +0 -3
- package/src/stories/Guidelines/Typo.mdx +0 -53
- /package/src/components/Customs/{CustomInputSelect → SyInputSelect}/config.ts +0 -0
- /package/src/components/Customs/{CustomTextField → SyTextField}/types.d.ts +0 -0
- /package/src/components/{Alert/Alert.vue → SyAlert/SyAlert.vue} +0 -0
- /package/src/components/{Alert → SyAlert}/locales.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.mdx +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/AccessibiliteItems.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/ExpertiseLevelEnum.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/constants/RGAALevelEnum.ts +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/EcoConception.mdx +0 -0
- /package/src/stories/{Fondamentaux → Guidelines}/EcoConception/ecoDesignItems.ts +0 -0
package/src/components/Customs/{CustomSelect/CustomSelect.stories.ts → SySelect/SySelect.stories.ts}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
-
import
|
|
2
|
+
import SySelect from '@/components/Customs/SySelect/SySelect.vue'
|
|
3
3
|
import { VBtn, VMenu, VList, VListItem, VListItemTitle } from 'vuetify/components'
|
|
4
4
|
import { ref } from 'vue'
|
|
5
|
-
import
|
|
5
|
+
import SyAlert from '@/components/SyAlert/SyAlert.vue'
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: 'Composants/Formulaires/
|
|
9
|
-
component:
|
|
8
|
+
title: 'Composants/Formulaires/SySelect',
|
|
9
|
+
component: SySelect,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'fullscreen',
|
|
12
|
-
controls: { exclude: ['selectedValue'] },
|
|
12
|
+
controls: { exclude: ['selectedValue', 'isOpen', 'closeList'] },
|
|
13
13
|
},
|
|
14
14
|
argTypes: {
|
|
15
15
|
selectedValue: { control: 'text' },
|
|
@@ -17,7 +17,7 @@ const meta = {
|
|
|
17
17
|
errorMessages: { control: 'object' },
|
|
18
18
|
required: { control: 'boolean' },
|
|
19
19
|
},
|
|
20
|
-
} as Meta<typeof
|
|
20
|
+
} as Meta<typeof SySelect>
|
|
21
21
|
|
|
22
22
|
export default meta
|
|
23
23
|
|
|
@@ -29,7 +29,7 @@ export const Default: Story = {
|
|
|
29
29
|
name: 'Template',
|
|
30
30
|
code: `
|
|
31
31
|
<template>
|
|
32
|
-
<
|
|
32
|
+
<SySelect
|
|
33
33
|
v-model="value"
|
|
34
34
|
:items="items"
|
|
35
35
|
/>
|
|
@@ -40,7 +40,7 @@ export const Default: Story = {
|
|
|
40
40
|
name: 'Script',
|
|
41
41
|
code: `
|
|
42
42
|
<script setup lang="ts">
|
|
43
|
-
import
|
|
43
|
+
import SySelect from '@cnamts/SySelect'
|
|
44
44
|
|
|
45
45
|
const items = [
|
|
46
46
|
{ text: 'Option 1', value: '1' },
|
|
@@ -59,13 +59,13 @@ export const Default: Story = {
|
|
|
59
59
|
},
|
|
60
60
|
render: (args) => {
|
|
61
61
|
return {
|
|
62
|
-
components: {
|
|
62
|
+
components: { SySelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
63
63
|
setup() {
|
|
64
64
|
return { args }
|
|
65
65
|
},
|
|
66
66
|
template: `
|
|
67
67
|
<div class="d-flex flex-wrap align-center pa-4">
|
|
68
|
-
<
|
|
68
|
+
<SySelect
|
|
69
69
|
v-bind="args"
|
|
70
70
|
/>
|
|
71
71
|
</div>
|
|
@@ -75,60 +75,6 @@ export const Default: Story = {
|
|
|
75
75
|
},
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
export const Outlined: Story = {
|
|
79
|
-
parameters: {
|
|
80
|
-
sourceCode: [
|
|
81
|
-
{
|
|
82
|
-
name: 'Template',
|
|
83
|
-
code: `
|
|
84
|
-
<template>
|
|
85
|
-
<CustomSelect
|
|
86
|
-
v-model="value"
|
|
87
|
-
:items="items"
|
|
88
|
-
outlined
|
|
89
|
-
/>
|
|
90
|
-
</template>
|
|
91
|
-
`,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'Script',
|
|
95
|
-
code: `
|
|
96
|
-
<script setup lang="ts">
|
|
97
|
-
import CustomSelect from '@cnamts/CustomSelect'
|
|
98
|
-
|
|
99
|
-
const items = [
|
|
100
|
-
{ text: 'Option 1', value: '1' },
|
|
101
|
-
{ text: 'Option 2', value: '2' },
|
|
102
|
-
],
|
|
103
|
-
</script>
|
|
104
|
-
`,
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
args: {
|
|
109
|
-
items: [
|
|
110
|
-
{ text: 'Option 1', value: '1' },
|
|
111
|
-
{ text: 'Option 2', value: '2' },
|
|
112
|
-
],
|
|
113
|
-
},
|
|
114
|
-
render: (args) => {
|
|
115
|
-
return {
|
|
116
|
-
components: { CustomSelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
117
|
-
setup() {
|
|
118
|
-
return { args }
|
|
119
|
-
},
|
|
120
|
-
template: `
|
|
121
|
-
<div class="d-flex flex-wrap align-center pa-4" style="z-index: 99999">
|
|
122
|
-
<CustomSelect
|
|
123
|
-
v-bind="args"
|
|
124
|
-
outlined
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
`,
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
}
|
|
131
|
-
|
|
132
78
|
export const Required: Story = {
|
|
133
79
|
parameters: {
|
|
134
80
|
sourceCode: [
|
|
@@ -136,7 +82,7 @@ export const Required: Story = {
|
|
|
136
82
|
name: 'Template',
|
|
137
83
|
code: `
|
|
138
84
|
<template>
|
|
139
|
-
<
|
|
85
|
+
<SySelect
|
|
140
86
|
v-model="value"
|
|
141
87
|
:items="items"
|
|
142
88
|
required
|
|
@@ -148,7 +94,7 @@ export const Required: Story = {
|
|
|
148
94
|
name: 'Script',
|
|
149
95
|
code: `
|
|
150
96
|
<script setup lang="ts">
|
|
151
|
-
import
|
|
97
|
+
import SySelect from '@cnamts/SySelect'
|
|
152
98
|
|
|
153
99
|
const items = [
|
|
154
100
|
{ text: 'Option 1', value: '1' },
|
|
@@ -168,13 +114,13 @@ export const Required: Story = {
|
|
|
168
114
|
},
|
|
169
115
|
render: (args) => {
|
|
170
116
|
return {
|
|
171
|
-
components: {
|
|
117
|
+
components: { SySelect },
|
|
172
118
|
setup() {
|
|
173
119
|
return { args }
|
|
174
120
|
},
|
|
175
121
|
template: `
|
|
176
122
|
<div class="d-flex flex-wrap align-center pa-4">
|
|
177
|
-
<
|
|
123
|
+
<SySelect
|
|
178
124
|
v-bind="args"
|
|
179
125
|
:required="args.required"
|
|
180
126
|
/>
|
|
@@ -191,7 +137,7 @@ export const withCustomError: Story = {
|
|
|
191
137
|
name: 'Template',
|
|
192
138
|
code: `
|
|
193
139
|
<template>
|
|
194
|
-
<
|
|
140
|
+
<SySelect
|
|
195
141
|
v-model="value"
|
|
196
142
|
:items="items"
|
|
197
143
|
:error-messages="errorMessages"
|
|
@@ -206,7 +152,7 @@ export const withCustomError: Story = {
|
|
|
206
152
|
name: 'Script',
|
|
207
153
|
code: `
|
|
208
154
|
<script setup lang="ts">
|
|
209
|
-
import
|
|
155
|
+
import SySelect from '@cnamts/SySelect'
|
|
210
156
|
import { ref } from 'vue'
|
|
211
157
|
|
|
212
158
|
const items = [
|
|
@@ -232,7 +178,7 @@ export const withCustomError: Story = {
|
|
|
232
178
|
},
|
|
233
179
|
render: (args) => {
|
|
234
180
|
return {
|
|
235
|
-
components: {
|
|
181
|
+
components: { SySelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
236
182
|
setup() {
|
|
237
183
|
const errorMessages = ref([])
|
|
238
184
|
const triggerError = () => {
|
|
@@ -243,7 +189,7 @@ export const withCustomError: Story = {
|
|
|
243
189
|
},
|
|
244
190
|
template: `
|
|
245
191
|
<div class="d-flex flex-wrap align-center pa-4">
|
|
246
|
-
<
|
|
192
|
+
<SySelect
|
|
247
193
|
v-bind="args"
|
|
248
194
|
:error-messages="errorMessages"
|
|
249
195
|
/>
|
|
@@ -265,7 +211,7 @@ export const withCustomKey: Story = {
|
|
|
265
211
|
name: 'Template',
|
|
266
212
|
code: `
|
|
267
213
|
<template>
|
|
268
|
-
<
|
|
214
|
+
<SySelect
|
|
269
215
|
v-model="value"
|
|
270
216
|
:items="items"
|
|
271
217
|
text-key="customKey"
|
|
@@ -278,7 +224,7 @@ export const withCustomKey: Story = {
|
|
|
278
224
|
name: 'Script',
|
|
279
225
|
code: `
|
|
280
226
|
<script setup lang="ts">
|
|
281
|
-
import
|
|
227
|
+
import SySelect from '@cnamts/SySelect'
|
|
282
228
|
|
|
283
229
|
const items = [
|
|
284
230
|
{ customKey: 'Choix 1', value: '1' },
|
|
@@ -297,13 +243,13 @@ export const withCustomKey: Story = {
|
|
|
297
243
|
},
|
|
298
244
|
render: (args) => {
|
|
299
245
|
return {
|
|
300
|
-
components: {
|
|
246
|
+
components: { SySelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
301
247
|
setup() {
|
|
302
248
|
return { args }
|
|
303
249
|
},
|
|
304
250
|
template: `
|
|
305
251
|
<div class="d-flex flex-wrap align-center pa-4">
|
|
306
|
-
<
|
|
252
|
+
<SySelect
|
|
307
253
|
v-bind="args"
|
|
308
254
|
outlined
|
|
309
255
|
text-key="customKey"
|
|
@@ -317,12 +263,12 @@ export const withCustomKey: Story = {
|
|
|
317
263
|
export const Info: Story = {
|
|
318
264
|
render: (args) => {
|
|
319
265
|
return {
|
|
320
|
-
components: {
|
|
266
|
+
components: { SyAlert },
|
|
321
267
|
setup() {
|
|
322
268
|
return { args }
|
|
323
269
|
},
|
|
324
270
|
template: `
|
|
325
|
-
<
|
|
271
|
+
<SyAlert v-model="args.modelValue" :type="args.type" :variant="tonal" :closable="false">
|
|
326
272
|
<template #default>
|
|
327
273
|
<b>Format des items :</b>
|
|
328
274
|
<ul>
|
|
@@ -330,7 +276,7 @@ export const Info: Story = {
|
|
|
330
276
|
<li>- Si les items sont un tableau de string, le composant les utilisera directement.</li>
|
|
331
277
|
</ul>
|
|
332
278
|
</template>
|
|
333
|
-
</
|
|
279
|
+
</SyAlert>
|
|
334
280
|
`,
|
|
335
281
|
}
|
|
336
282
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { mdiInformation, mdiMenuDown } from '@mdi/js'
|
|
3
|
-
import { ref, watch, computed, type PropType } from 'vue'
|
|
4
|
-
import { VIcon, VTextField, VList, VListItem, VListItemTitle } from 'vuetify/components'
|
|
3
|
+
import { ref, watch, onMounted, computed, type PropType } from 'vue'
|
|
5
4
|
|
|
6
5
|
const props = defineProps({
|
|
7
6
|
modelValue: {
|
|
@@ -26,11 +25,11 @@
|
|
|
26
25
|
},
|
|
27
26
|
menuId: {
|
|
28
27
|
type: String,
|
|
29
|
-
default: '
|
|
28
|
+
default: 'sy-select-menu',
|
|
30
29
|
},
|
|
31
30
|
outlined: {
|
|
32
31
|
type: Boolean,
|
|
33
|
-
default:
|
|
32
|
+
default: true,
|
|
34
33
|
},
|
|
35
34
|
textKey: {
|
|
36
35
|
type: String,
|
|
@@ -45,16 +44,19 @@
|
|
|
45
44
|
const emit = defineEmits(['update:modelValue'])
|
|
46
45
|
|
|
47
46
|
const isOpen = ref(false)
|
|
48
|
-
const selectedItem = ref<Record<string, unknown > | string | null>(props.modelValue)
|
|
47
|
+
const selectedItem = ref<Record<string, unknown > | string | null | undefined>(props.modelValue)
|
|
49
48
|
const hasError = ref(false)
|
|
50
49
|
|
|
50
|
+
const labelWidth = ref(0)
|
|
51
|
+
const labelRef = ref<HTMLElement | null>(null)
|
|
52
|
+
|
|
51
53
|
const toggleMenu = () => {
|
|
52
54
|
isOpen.value = !isOpen.value
|
|
53
55
|
}
|
|
54
56
|
const closeList = () => {
|
|
55
57
|
isOpen.value = false
|
|
56
58
|
}
|
|
57
|
-
const inputId = ref(`
|
|
59
|
+
const inputId = ref(`sy-select-${Math.random().toString(36).substring(7)}`)
|
|
58
60
|
|
|
59
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
60
62
|
const selectItem = (item: any) => {
|
|
@@ -93,10 +95,29 @@
|
|
|
93
95
|
selectedItem.value = newValue
|
|
94
96
|
})
|
|
95
97
|
|
|
96
|
-
watch(isOpen, (
|
|
97
|
-
|
|
98
|
+
watch([isOpen, hasError], ([newIsOpen, newHasError]) => {
|
|
99
|
+
if (!newIsOpen) {
|
|
100
|
+
hasError.value = (!selectedItem.value && isRequired.value) || props.errorMessages.length > 0
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
hasError.value = newHasError
|
|
104
|
+
}
|
|
98
105
|
})
|
|
99
106
|
|
|
107
|
+
watch(() => props.errorMessages, (newValue) => {
|
|
108
|
+
hasError.value = newValue.length > 0
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
onMounted(() => {
|
|
112
|
+
if (labelRef.value) {
|
|
113
|
+
labelWidth.value = labelRef.value.offsetWidth + 64
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
defineExpose({
|
|
118
|
+
isOpen,
|
|
119
|
+
closeList,
|
|
120
|
+
})
|
|
100
121
|
</script>
|
|
101
122
|
|
|
102
123
|
<template>
|
|
@@ -115,7 +136,8 @@
|
|
|
115
136
|
:error-messages="errorMessages"
|
|
116
137
|
:variant="outlined ? 'outlined' : 'underlined'"
|
|
117
138
|
:rules="isRequired ? ['Le champ est requis.'] : []"
|
|
118
|
-
class="
|
|
139
|
+
class="sy-select"
|
|
140
|
+
:style="hasError ? { minWidth: `${labelWidth + 18}px`} : {minWidth: `${labelWidth}px`}"
|
|
119
141
|
@click="toggleMenu"
|
|
120
142
|
@keydown.enter.prevent="toggleMenu"
|
|
121
143
|
@keydown.space.prevent="toggleMenu"
|
|
@@ -127,11 +149,15 @@
|
|
|
127
149
|
>
|
|
128
150
|
{{ mdiInformation }}
|
|
129
151
|
</VIcon>
|
|
130
|
-
<VIcon>
|
|
152
|
+
<VIcon class="arrow">
|
|
131
153
|
{{ mdiMenuDown }}
|
|
132
154
|
</VIcon>
|
|
133
155
|
</template>
|
|
134
156
|
</VTextField>
|
|
157
|
+
<span
|
|
158
|
+
ref="labelRef"
|
|
159
|
+
class="hidden-label"
|
|
160
|
+
>{{ label }}</span>
|
|
135
161
|
<VList
|
|
136
162
|
v-if="isOpen"
|
|
137
163
|
class="v-list"
|
|
@@ -159,17 +185,16 @@
|
|
|
159
185
|
<style scoped lang="scss">
|
|
160
186
|
@use '@/assets/tokens.scss';
|
|
161
187
|
|
|
162
|
-
.
|
|
188
|
+
.sy-select {
|
|
163
189
|
display: flex;
|
|
164
190
|
flex-direction: column;
|
|
165
|
-
min-width: 225px;
|
|
166
191
|
}
|
|
167
192
|
|
|
168
193
|
.v-field {
|
|
169
194
|
position: relative;
|
|
170
195
|
}
|
|
171
196
|
.v-field--focused {
|
|
172
|
-
.v-icon {
|
|
197
|
+
.v-icon.arrow {
|
|
173
198
|
transform: rotateX(180deg);
|
|
174
199
|
}
|
|
175
200
|
}
|
|
@@ -204,4 +229,10 @@
|
|
|
204
229
|
:deep(.v-field__input) {
|
|
205
230
|
color: tokens.$grey-darken-20
|
|
206
231
|
}
|
|
232
|
+
|
|
233
|
+
.hidden-label {
|
|
234
|
+
visibility: hidden;
|
|
235
|
+
position: absolute;
|
|
236
|
+
white-space: nowrap;
|
|
237
|
+
}
|
|
207
238
|
</style>
|
|
@@ -1,90 +1,51 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils'
|
|
2
2
|
import { expect, describe, it } from 'vitest'
|
|
3
|
-
import
|
|
3
|
+
import SySelect from '../SySelect.vue'
|
|
4
4
|
import { vuetify } from '@tests/unit/setup'
|
|
5
5
|
|
|
6
|
-
describe('
|
|
6
|
+
describe('SySelect.vue', () => {
|
|
7
7
|
it('renders the component with default props', () => {
|
|
8
|
-
const wrapper = mount(
|
|
8
|
+
const wrapper = mount(SySelect, {
|
|
9
9
|
global: {
|
|
10
10
|
plugins: [vuetify],
|
|
11
11
|
},
|
|
12
12
|
})
|
|
13
13
|
expect(wrapper.exists()).toBe(true)
|
|
14
|
-
expect(wrapper.find('.
|
|
14
|
+
expect(wrapper.find('.sy-select').text()).toBe('')
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
it('
|
|
18
|
-
const wrapper = mount(CustomSelect, {
|
|
19
|
-
global: {
|
|
20
|
-
plugins: [vuetify],
|
|
21
|
-
},
|
|
22
|
-
})
|
|
23
|
-
await wrapper.find('.custom-select').trigger('click')
|
|
24
|
-
expect(wrapper.find('.v-list').exists()).toBe(true)
|
|
25
|
-
await wrapper.find('.custom-select').trigger('click')
|
|
26
|
-
expect(wrapper.find('.v-list').exists()).toBe(false)
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
it('selects an item when clicked', async () => {
|
|
30
|
-
const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
|
|
31
|
-
const wrapper = mount(CustomSelect, {
|
|
32
|
-
props: { items },
|
|
33
|
-
global: {
|
|
34
|
-
plugins: [vuetify],
|
|
35
|
-
},
|
|
36
|
-
})
|
|
37
|
-
await wrapper.find('.custom-select').trigger('click')
|
|
38
|
-
const firstItem = wrapper.findAll('.v-list-item').at(0)
|
|
39
|
-
if (firstItem) {
|
|
40
|
-
await firstItem.trigger('click')
|
|
41
|
-
}
|
|
42
|
-
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([{ text: 'Option 1', value: '1' }])
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
it('closes the menu when an item is selected', async () => {
|
|
17
|
+
it('displays the selected item text', async () => {
|
|
46
18
|
const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
|
|
47
|
-
const wrapper = mount(
|
|
48
|
-
props: { items },
|
|
19
|
+
const wrapper = mount(SySelect, {
|
|
20
|
+
props: { items, modelValue: { text: 'Option 1', value: '1' } },
|
|
49
21
|
global: {
|
|
50
22
|
plugins: [vuetify],
|
|
51
23
|
},
|
|
52
24
|
})
|
|
53
|
-
await wrapper.find('.
|
|
25
|
+
await wrapper.find('.sy-select').trigger('click')
|
|
54
26
|
const firstItem = wrapper.findAll('.v-list-item').at(0)
|
|
55
27
|
if (firstItem) {
|
|
56
28
|
await firstItem.trigger('click')
|
|
57
29
|
}
|
|
58
|
-
expect(wrapper.find('
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('displays the selected item text', async () => {
|
|
62
|
-
const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
|
|
63
|
-
const wrapper = mount(CustomSelect, {
|
|
64
|
-
props: { items, modelValue: { text: 'Option 1', value: '1' } },
|
|
65
|
-
global: {
|
|
66
|
-
plugins: [vuetify],
|
|
67
|
-
},
|
|
68
|
-
})
|
|
69
|
-
expect(wrapper.find('.custom-select').text()).toContain('Option 1')
|
|
30
|
+
expect(wrapper.find('input').element.value).toBe('Option 1')
|
|
70
31
|
})
|
|
71
32
|
|
|
72
33
|
it('closes the menu on escape key press', async () => {
|
|
73
34
|
const items = [{ text: 'Option 1', value: '1' }, { text: 'Option 2', value: '2' }]
|
|
74
|
-
const wrapper = mount(
|
|
35
|
+
const wrapper = mount(SySelect, {
|
|
75
36
|
props: { items },
|
|
76
37
|
global: {
|
|
77
38
|
plugins: [vuetify],
|
|
78
39
|
},
|
|
79
40
|
})
|
|
80
|
-
await wrapper.find('.
|
|
41
|
+
await wrapper.find('.sy-select').trigger('click')
|
|
81
42
|
await wrapper.find('.v-list').trigger('keydown.esc')
|
|
82
43
|
expect(wrapper.find('.v-list').exists()).toBe(false)
|
|
83
44
|
})
|
|
84
45
|
|
|
85
46
|
it('renders error messages when provided', () => {
|
|
86
47
|
const errorMessages = ['Error 1']
|
|
87
|
-
const wrapper = mount(
|
|
48
|
+
const wrapper = mount(SySelect, {
|
|
88
49
|
props: { errorMessages },
|
|
89
50
|
global: {
|
|
90
51
|
plugins: [vuetify],
|
|
@@ -94,7 +55,7 @@ describe('CustomInputSelect.vue', () => {
|
|
|
94
55
|
})
|
|
95
56
|
|
|
96
57
|
it('does not render error messages when not provided', () => {
|
|
97
|
-
const wrapper = mount(
|
|
58
|
+
const wrapper = mount(SySelect, {
|
|
98
59
|
global: {
|
|
99
60
|
plugins: [vuetify],
|
|
100
61
|
},
|
|
@@ -102,17 +63,8 @@ describe('CustomInputSelect.vue', () => {
|
|
|
102
63
|
expect(wrapper.find('.v-messages__message').exists()).toBe(false)
|
|
103
64
|
})
|
|
104
65
|
|
|
105
|
-
it('does not render the label when not provided', () => {
|
|
106
|
-
const wrapper = mount(CustomSelect, {
|
|
107
|
-
global: {
|
|
108
|
-
plugins: [vuetify],
|
|
109
|
-
},
|
|
110
|
-
})
|
|
111
|
-
expect(wrapper.find('label').exists()).toBe(false)
|
|
112
|
-
})
|
|
113
|
-
|
|
114
66
|
it('returns the correct item text using getItemText', () => {
|
|
115
|
-
const wrapper = mount(
|
|
67
|
+
const wrapper = mount(SySelect, {
|
|
116
68
|
props: { textKey: 'text' },
|
|
117
69
|
global: {
|
|
118
70
|
plugins: [vuetify],
|
|
@@ -125,7 +77,7 @@ describe('CustomInputSelect.vue', () => {
|
|
|
125
77
|
})
|
|
126
78
|
|
|
127
79
|
it('returns default text when selectedItem is null', () => {
|
|
128
|
-
const wrapper = mount(
|
|
80
|
+
const wrapper = mount(SySelect, {
|
|
129
81
|
global: {
|
|
130
82
|
plugins: [vuetify],
|
|
131
83
|
},
|
|
@@ -136,7 +88,7 @@ describe('CustomInputSelect.vue', () => {
|
|
|
136
88
|
})
|
|
137
89
|
|
|
138
90
|
it('returns the correct text when selectedItem is an object', async () => {
|
|
139
|
-
const wrapper = mount(
|
|
91
|
+
const wrapper = mount(SySelect, {
|
|
140
92
|
props: { modelValue: { text: 'Option 1', value: '1' }, textKey: 'text' },
|
|
141
93
|
global: {
|
|
142
94
|
plugins: [vuetify],
|
|
@@ -150,7 +102,7 @@ describe('CustomInputSelect.vue', () => {
|
|
|
150
102
|
|
|
151
103
|
it('formats items correctly', () => {
|
|
152
104
|
const items = ['Option 1', 'Option 2']
|
|
153
|
-
const wrapper = mount(
|
|
105
|
+
const wrapper = mount(SySelect, {
|
|
154
106
|
props: { items, textKey: 'text', valueKey: 'value' },
|
|
155
107
|
global: {
|
|
156
108
|
plugins: [vuetify],
|
|
@@ -165,27 +117,27 @@ describe('CustomInputSelect.vue', () => {
|
|
|
165
117
|
})
|
|
166
118
|
|
|
167
119
|
it('applies the correct button class when outlined is true', () => {
|
|
168
|
-
const wrapper = mount(
|
|
120
|
+
const wrapper = mount(SySelect, {
|
|
169
121
|
props: { outlined: true },
|
|
170
122
|
global: {
|
|
171
123
|
plugins: [vuetify],
|
|
172
124
|
},
|
|
173
125
|
})
|
|
174
|
-
expect(wrapper.find('.
|
|
126
|
+
expect(wrapper.find('.v-field--variant-outlined').exists()).toBe(true)
|
|
175
127
|
})
|
|
176
128
|
|
|
177
129
|
it('does not apply the outlined button class when outlined is false', () => {
|
|
178
|
-
const wrapper = mount(
|
|
130
|
+
const wrapper = mount(SySelect, {
|
|
179
131
|
props: { outlined: false },
|
|
180
132
|
global: {
|
|
181
133
|
plugins: [vuetify],
|
|
182
134
|
},
|
|
183
135
|
})
|
|
184
|
-
expect(wrapper.find('.
|
|
136
|
+
expect(wrapper.find('.sy-select').classes()).not.toContain('v-btn--variant-outlined')
|
|
185
137
|
})
|
|
186
138
|
|
|
187
139
|
it('updates selectedItem when v-model changes', async () => {
|
|
188
|
-
const wrapper = mount(
|
|
140
|
+
const wrapper = mount(SySelect, {
|
|
189
141
|
props: { modelValue: { text: 'Option 1', value: '1' }, textKey: 'text' },
|
|
190
142
|
global: {
|
|
191
143
|
plugins: [vuetify],
|
|
@@ -200,7 +152,7 @@ describe('CustomInputSelect.vue', () => {
|
|
|
200
152
|
})
|
|
201
153
|
|
|
202
154
|
it('emits update:modelValue when selectedItem changes', async () => {
|
|
203
|
-
const wrapper = mount(
|
|
155
|
+
const wrapper = mount(SySelect, {
|
|
204
156
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
205
157
|
props: { modelValue: null as any, textKey: 'text' },
|
|
206
158
|
global: {
|
|
@@ -213,4 +165,29 @@ describe('CustomInputSelect.vue', () => {
|
|
|
213
165
|
await wrapper.vm.$nextTick()
|
|
214
166
|
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([{ text: 'Option 1', value: '1' }])
|
|
215
167
|
})
|
|
168
|
+
|
|
169
|
+
it('closes the menu when v-click-outside directive is called', async () => {
|
|
170
|
+
const wrapper = mount(SySelect, {
|
|
171
|
+
global: {
|
|
172
|
+
plugins: [vuetify],
|
|
173
|
+
},
|
|
174
|
+
})
|
|
175
|
+
await wrapper.find('.sy-select').trigger('click')
|
|
176
|
+
expect(wrapper.find('.v-list').exists()).toBe(true)
|
|
177
|
+
await wrapper.find('.sy-select').trigger('mouseleave')
|
|
178
|
+
await wrapper.find('.sy-select').trigger('click')
|
|
179
|
+
await wrapper.vm.$nextTick()
|
|
180
|
+
|
|
181
|
+
expect(wrapper.find('.v-list').exists()).toBe(false)
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
it('use closeList method', async () => {
|
|
185
|
+
const wrapper = mount(SySelect, {
|
|
186
|
+
global: {
|
|
187
|
+
plugins: [vuetify],
|
|
188
|
+
},
|
|
189
|
+
})
|
|
190
|
+
await wrapper.vm.closeList()
|
|
191
|
+
expect(wrapper.vm.isOpen).toBe(false)
|
|
192
|
+
})
|
|
216
193
|
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import * as AccessStories from './Accessibilite.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={AccessStories} />
|
|
5
|
+
|
|
6
|
+
Accessibilité
|
|
7
|
+
=============
|
|
8
|
+
<Story of={AccessStories.Legende} />
|
|
9
|
+
<br />
|
|
10
|
+
|
|
11
|
+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
<Story of={AccessStories.AccessibilitePanel} />
|
|
14
|
+
<br />
|