@cnamts/synapse 0.0.3-alpha → 0.0.5-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 +1461 -68
- package/dist/design-system-v3.js +4775 -1673
- package/dist/design-system-v3.umd.cjs +10 -1
- package/dist/style.css +1 -1
- package/package.json +6 -2
- package/src/assets/tokens.scss +0 -1
- package/src/components/Alert/Accessibilite.mdx +14 -0
- package/src/components/Alert/Accessibilite.stories.ts +166 -0
- package/src/components/Alert/AccessibiliteItems.ts +152 -0
- package/src/components/Alert/Alert.mdx +1 -1
- package/src/components/Alert/Alert.stories.ts +91 -1
- package/src/components/Alert/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/BackBtn/Accessibilite.mdx +14 -0
- package/src/components/BackBtn/Accessibilite.stories.ts +166 -0
- package/src/components/BackBtn/AccessibiliteItems.ts +132 -0
- package/src/components/BackBtn/BackBtn.mdx +1 -1
- package/src/components/BackBtn/BackBtn.stories.ts +84 -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 +82 -0
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +3 -3
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +172 -11
- package/src/components/BackToTopBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CollapsibleList/Accessibilite.mdx +14 -0
- package/src/components/CollapsibleList/Accessibilite.stories.ts +166 -0
- package/src/components/CollapsibleList/AccessibiliteItems.ts +129 -0
- package/src/components/CollapsibleList/CollapsibleList.mdx +2 -2
- package/src/components/CollapsibleList/CollapsibleList.stories.ts +37 -1
- package/src/components/CollapsibleList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/CopyBtn/Accessibilite.mdx +14 -0
- package/src/components/CopyBtn/Accessibilite.stories.ts +166 -0
- package/src/components/CopyBtn/AccessibiliteItems.ts +135 -0
- package/src/components/CopyBtn/CopyBtn.mdx +1 -1
- package/src/components/CopyBtn/CopyBtn.stories.ts +120 -1
- package/src/components/CopyBtn/CopyBtn.vue +1 -1
- package/src/components/CopyBtn/config.ts +2 -0
- package/src/components/CopyBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +44 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +606 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +246 -0
- package/src/components/Customs/SyBtnSelect/tests/SyBtnSelect.spec.ts +168 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +40 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +420 -0
- package/src/components/Customs/{CustomInputSelect/CustomInputSelect.vue → SyInputSelect/SyInputSelect.vue} +89 -54
- package/src/components/Customs/SyInputSelect/config.ts +10 -0
- package/src/components/Customs/SyInputSelect/tests/SyInputSelect.spec.ts +140 -0
- package/src/components/Customs/{CustomSelect/CustomSelect.mdx → SySelect/SySelect.mdx} +10 -10
- package/src/components/Customs/SySelect/SySelect.stories.ts +338 -0
- package/src/components/Customs/{CustomSelect/CustomSelect.vue → SySelect/SySelect.vue} +34 -11
- package/src/components/Customs/{CustomInputSelect/tests/CustomInputSelect.spec.ts → SySelect/tests/SySelect.spec.ts} +48 -71
- package/src/components/Customs/SyTextField/SyTextField.mdx +44 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +403 -0
- package/src/components/Customs/SyTextField/SyTextField.vue +110 -0
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +93 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +57 -0
- package/src/components/Customs/SyTextField/types.d.ts +3 -0
- package/src/components/DataList/DataList.mdx +77 -0
- package/src/components/DataList/DataList.stories.ts +960 -0
- package/src/components/DataList/DataList.vue +140 -0
- package/src/components/DataList/DataListLoading/DataListLoading.vue +56 -0
- package/src/components/DataList/DataListLoading/tests/DataListLoading.spec.ts +23 -0
- package/src/components/DataList/locales.ts +3 -0
- package/src/components/DataList/tests/DataList.spec.ts +194 -0
- package/src/components/DataList/types.d.ts +23 -0
- package/src/components/DataListGroup/DataListGroup.mdx +77 -0
- package/src/components/DataListGroup/DataListGroup.stories.ts +987 -0
- package/src/components/DataListGroup/DataListGroup.vue +59 -0
- package/src/components/DataListGroup/tests/DataListGroup.spec.ts +54 -0
- package/src/components/DataListGroup/tests/data/dataListGroupItems.ts +41 -0
- package/src/components/DataListGroup/types.d.ts +15 -0
- package/src/components/DataListItem/DataListItem.vue +135 -0
- package/src/components/DataListItem/config.ts +17 -0
- package/src/components/DataListItem/locales.ts +3 -0
- package/src/components/DataListItem/tests/DataListItem.spec.ts +156 -0
- package/src/components/DataListItem/types.d.ts +23 -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/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/Accessibilite.mdx +14 -0
- package/src/components/DownloadBtn/Accessibilite.stories.ts +166 -0
- package/src/components/DownloadBtn/AccessibiliteItems.ts +129 -0
- package/src/components/DownloadBtn/DownloadBtn.mdx +5 -6
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +207 -2
- package/src/components/DownloadBtn/constants/ExpertiseLevelEnum.ts +4 -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/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/FooterBar.mdx +2 -2
- package/src/components/FooterBar/FooterBar.stories.ts +557 -9
- package/src/components/FooterBar/config.ts +2 -3
- 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 +2 -2
- package/src/components/FranceConnectBtn/Accessibilite.mdx +14 -0
- package/src/components/FranceConnectBtn/Accessibilite.stories.ts +194 -0
- package/src/components/FranceConnectBtn/AccessibiliteItems.ts +199 -0
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +58 -1
- package/src/components/FranceConnectBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/HeaderBar.mdx +164 -45
- package/src/components/HeaderBar/HeaderBar.stories.ts +618 -16
- package/src/components/HeaderBar/HeaderBar.vue +60 -22
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +433 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +1089 -0
- package/src/components/HeaderBar/{HeaderComplexMenu/HeaderComplexMenu.vue → HeaderBurgerMenu/HeaderBurgerMenu.vue} +74 -45
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +38 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +89 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/__snapshots__/HeaderMenuItem.spec.ts.snap +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +17 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +121 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/HeaderMenuSection.vue +2 -2
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +1 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +43 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +261 -0
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/HeaderSubMenu.vue +17 -3
- package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +180 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +13 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +13 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +62 -25
- package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +49 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +19 -23
- package/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.ts +70 -0
- package/src/components/HeaderBar/Usages.mdx +85 -0
- package/src/components/HeaderBar/consts.scss +0 -1
- package/src/components/HeaderBar/tests/HeaderBar.spec.ts +8 -2
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +5 -10
- package/src/components/HeaderLoading/HeaderLoading.mdx +28 -0
- package/src/components/HeaderLoading/HeaderLoading.stories.ts +62 -0
- package/src/components/HeaderLoading/HeaderLoading.vue +45 -0
- package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +22 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +128 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +784 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +194 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +74 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/config.ts +18 -0
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +127 -0
- package/src/components/HeaderNavigationBar/types.ts +7 -0
- package/src/components/HeaderToolbar/HeaderToolbar.mdx +31 -0
- package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +343 -0
- package/src/components/HeaderToolbar/HeaderToolbar.vue +487 -0
- package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +230 -0
- package/src/components/HeaderToolbar/types.d.ts +20 -0
- package/src/components/LangBtn/Accessibilite.mdx +14 -0
- package/src/components/LangBtn/Accessibilite.stories.ts +166 -0
- package/src/components/LangBtn/AccessibiliteItems.ts +132 -0
- package/src/components/LangBtn/LangBtn.mdx +1 -1
- package/src/components/LangBtn/LangBtn.stories.ts +125 -8
- 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/Logo.mdx +2 -2
- package/src/components/Logo/Logo.stories.ts +147 -1
- package/src/components/LogoBrandSection/LogoBrandSection.mdx +14 -0
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +158 -0
- package/src/components/LogoBrandSection/LogoBrandSection.vue +312 -0
- package/src/components/LogoBrandSection/assets/ameli-pro.svg +1 -0
- package/src/components/LogoBrandSection/assets/ameli.svg +1 -0
- package/src/components/LogoBrandSection/assets/cnam.svg +1 -0
- package/src/components/LogoBrandSection/assets/compte-ameli.svg +1 -0
- package/src/components/LogoBrandSection/dividerDimensionsMapping.ts +14 -0
- package/src/components/LogoBrandSection/locales.ts +14 -0
- package/src/components/LogoBrandSection/secondaryLogoMapping.ts +24 -0
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +365 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +14 -0
- package/src/components/LogoBrandSection/types.ts +8 -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/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/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/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 +174 -0
- package/src/components/NotificationBar/NotificationBar.mdx +6 -6
- package/src/components/NotificationBar/NotificationBar.stories.ts +1 -1
- package/src/components/NotificationBar/NotificationBar.vue +2 -2
- package/src/components/NotificationBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotificationBar/options.ts +1 -0
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +1 -1
- 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 +86 -1
- package/src/components/PageContainer/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PhoneField/PhoneField.mdx +49 -0
- package/src/components/PhoneField/PhoneField.stories.ts +869 -0
- package/src/components/PhoneField/PhoneField.vue +230 -0
- package/src/components/PhoneField/indicatifs.ts +104 -0
- package/src/components/PhoneField/locales.ts +4 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +179 -0
- 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 +50 -1
- package/src/components/SkipLink/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +33 -2
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +38 -1
- 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/SubHeader.mdx +31 -0
- package/src/components/SubHeader/SubHeader.stories.ts +1032 -0
- package/src/components/SubHeader/SubHeader.vue +185 -0
- package/src/components/SubHeader/config.ts +12 -0
- package/src/components/SubHeader/locales.ts +3 -0
- package/src/components/SubHeader/tests/SubHeader.spec.ts +144 -0
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +35 -0
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +438 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +105 -0
- package/src/components/UserMenuBtn/config.ts +24 -0
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +125 -0
- package/src/components/index.ts +33 -7
- package/src/composables/index.ts +8 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +82 -0
- package/src/composables/rules/useFieldValidation.ts +53 -0
- package/src/composables/widthable/index.ts +29 -0
- package/src/composables/widthable/tests/widthable.spec.ts +52 -0
- package/src/designTokens/index.ts +2 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +5 -0
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +3 -2
- package/src/main.ts +3 -0
- package/src/modules.d.ts +4 -0
- package/src/services/index.ts +1 -0
- package/src/stories/Demarrer/Accueil.mdx +10 -0
- package/src/stories/Demarrer/Accueil.stories.ts +76 -0
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +9 -0
- package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +20 -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 +132 -0
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +52 -48
- package/src/stories/GuideDuDev/vuetifyOptions.mdx +31 -28
- package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.mdx +1 -2
- package/src/stories/{Fondamentaux → Guidelines}/Accessibilite/Accessibilite.stories.ts +1 -1
- package/src/stories/{Fondamentaux → Guidelines}/EcoConception/Econception.stories.ts +2 -2
- package/src/utils/functions/throttleDisplayFn/tests/throttleDisplayFn.spec.ts +47 -0
- package/src/utils/functions/throttleDisplayFn/throttleDisplayFn.ts +26 -0
- package/src/utils/rules/exactLength/index.ts +33 -0
- package/src/utils/rules/exactLength/locales.ts +6 -0
- package/src/utils/rules/required/index.ts +25 -0
- package/src/utils/rules/required/locales.ts +5 -0
- package/src/utils/rules/required/ruleMessageHelper.ts +14 -0
- package/src/utils/rules/required/tests/index.spec.ts +47 -0
- package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +22 -0
- package/src/utils/rules/types.d.ts +15 -0
- package/src/components/Beta/beta.mdx +0 -5
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +0 -42
- package/src/components/Customs/CustomInputSelect/CustomInputSelect.stories.ts +0 -154
- package/src/components/Customs/CustomSelect/CustomSelect.stories.ts +0 -182
- package/src/components/Customs/CustomSelect/tests/CustomSelect.spec.ts +0 -236
- package/src/components/Deprecated/deprecated.mdx +0 -5
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderComplexMenu.stories.ts +0 -272
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +0 -49
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +0 -56
- package/src/components/HeaderBar/HeaderComplexMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +0 -137
- package/src/components/HeaderBar/HeaderComplexMenu/tests/HeaderComplexMenu.spec.ts +0 -129
- package/src/components/HeaderBar/HeaderComplexMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +0 -18
- package/src/stories/Guidelines/CustomisationEtThemes.mdx +0 -3
- package/src/stories/Guidelines/Typo.mdx +0 -53
- package/src/stories/Home/Accueil.mdx +0 -7
- package/src/stories/Home/PolitiqueDeConfidentialite.mdx +0 -4
- package/src/stories/Home/synapse.webp +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/HeaderMenuItem.vue +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/HeaderMenuItem.spec.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/conts.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/locals.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/tests/useHandleSubMenus.spec.ts +0 -0
- /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/useHandleSubMenus.ts +0 -0
- /package/src/components/Logo/{types.d.ts → types.ts} +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
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import useCustomizableOptions, { type CustomizableOptions } from '@/composables/useCustomizableOptions'
|
|
3
|
+
import { mdiClose } from '@mdi/js'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import type { VDialog } from 'vuetify/components'
|
|
6
|
+
import { config } from './config'
|
|
7
|
+
import { locales } from './locales'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
title?: string
|
|
11
|
+
width?: string
|
|
12
|
+
cancelBtnText?: string
|
|
13
|
+
confirmBtnText?: string
|
|
14
|
+
hideActions?: boolean
|
|
15
|
+
persistent?: boolean
|
|
16
|
+
} & CustomizableOptions>(), {
|
|
17
|
+
title: undefined,
|
|
18
|
+
width: '800px',
|
|
19
|
+
cancelBtnText: locales.cancelBtn,
|
|
20
|
+
confirmBtnText: locales.confirmBtn,
|
|
21
|
+
hideActions: false,
|
|
22
|
+
persistent: false,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
defineEmits(['cancel', 'confirm', 'update:modelValue'])
|
|
26
|
+
defineSlots<{
|
|
27
|
+
default?: () => undefined
|
|
28
|
+
title?: () => undefined
|
|
29
|
+
actions?: () => undefined
|
|
30
|
+
}>()
|
|
31
|
+
|
|
32
|
+
const dialog = defineModel<boolean>({
|
|
33
|
+
default: false,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const dialogContent = ref<VDialog | undefined>(undefined)
|
|
37
|
+
|
|
38
|
+
const options = useCustomizableOptions(config, props)
|
|
39
|
+
|
|
40
|
+
const closeIcon = mdiClose
|
|
41
|
+
|
|
42
|
+
async function getSelectableElements(): Promise<HTMLElement[]> {
|
|
43
|
+
const parentNode = dialogContent?.value?.$el // Is undefined when dialog is closed
|
|
44
|
+
|
|
45
|
+
if (!parentNode) {
|
|
46
|
+
return []
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const elements = Array.from<HTMLElement>(parentNode.querySelectorAll(
|
|
50
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',
|
|
51
|
+
))
|
|
52
|
+
|
|
53
|
+
const filteredElements = elements.filter(element => (
|
|
54
|
+
!element.hasAttribute('disabled')
|
|
55
|
+
&& !element.getAttribute('aria-hidden')
|
|
56
|
+
))
|
|
57
|
+
|
|
58
|
+
return filteredElements
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function handleFocus(e: KeyboardEvent): Promise<void> {
|
|
62
|
+
const selectableElements = await getSelectableElements()
|
|
63
|
+
|
|
64
|
+
const focused = selectableElements.findIndex(
|
|
65
|
+
(el: HTMLElement) => el === e.target,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
const isOutside = focused === -1
|
|
69
|
+
const lastElement = selectableElements.length - 1
|
|
70
|
+
|
|
71
|
+
if (!e.shiftKey && (isOutside || focused === lastElement)) {
|
|
72
|
+
e.preventDefault()
|
|
73
|
+
selectableElements[0].focus()
|
|
74
|
+
}
|
|
75
|
+
else if (e.shiftKey && (isOutside || focused === 0)) {
|
|
76
|
+
e.preventDefault()
|
|
77
|
+
selectableElements[lastElement].focus()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<VDialog
|
|
84
|
+
v-model="dialog"
|
|
85
|
+
v-bind="$attrs"
|
|
86
|
+
:width="props.width"
|
|
87
|
+
:persistent="props.persistent"
|
|
88
|
+
:retain-focus="false"
|
|
89
|
+
aria-modal="true"
|
|
90
|
+
class="vd-dialog-box"
|
|
91
|
+
@keydown.tab="handleFocus"
|
|
92
|
+
>
|
|
93
|
+
<VCard
|
|
94
|
+
v-bind="options.card"
|
|
95
|
+
id="dialogContent"
|
|
96
|
+
ref="dialogContent"
|
|
97
|
+
:aria-labelledby="props.title ? props.title : 'dialogContent'"
|
|
98
|
+
>
|
|
99
|
+
<VCardTitle v-bind="options.cardTitle">
|
|
100
|
+
<slot name="title">
|
|
101
|
+
<h2
|
|
102
|
+
v-if="title"
|
|
103
|
+
class="text-h6 font-weight-bold"
|
|
104
|
+
>
|
|
105
|
+
{{ props.title }}
|
|
106
|
+
</h2>
|
|
107
|
+
</slot>
|
|
108
|
+
|
|
109
|
+
<VSpacer v-bind="options.spacer" />
|
|
110
|
+
|
|
111
|
+
<VBtn
|
|
112
|
+
v-if="!props.persistent"
|
|
113
|
+
v-bind="options.closeBtn"
|
|
114
|
+
:aria-label="locales.closeBtn"
|
|
115
|
+
@click="dialog = false"
|
|
116
|
+
>
|
|
117
|
+
<VIcon v-bind="options.icon">
|
|
118
|
+
{{ closeIcon }}
|
|
119
|
+
</VIcon>
|
|
120
|
+
</VBtn>
|
|
121
|
+
</VCardTitle>
|
|
122
|
+
<slot />
|
|
123
|
+
|
|
124
|
+
<div
|
|
125
|
+
v-if="!props.hideActions"
|
|
126
|
+
v-bind="options.actionsCtn"
|
|
127
|
+
class="vd-dialog-box-actions-ctn"
|
|
128
|
+
>
|
|
129
|
+
<VSpacer v-bind="options.actionsSpacer" />
|
|
130
|
+
|
|
131
|
+
<slot name="actions">
|
|
132
|
+
<VBtn
|
|
133
|
+
v-bind="options.cancelBtn"
|
|
134
|
+
@click="$emit('cancel')"
|
|
135
|
+
>
|
|
136
|
+
{{ props.cancelBtnText }}
|
|
137
|
+
</VBtn>
|
|
138
|
+
|
|
139
|
+
<VBtn
|
|
140
|
+
v-bind="options.confirmBtn"
|
|
141
|
+
data-test-id="confirm-btn"
|
|
142
|
+
@click="$emit('confirm')"
|
|
143
|
+
>
|
|
144
|
+
{{ props.confirmBtnText }}
|
|
145
|
+
</VBtn>
|
|
146
|
+
</slot>
|
|
147
|
+
</div>
|
|
148
|
+
</VCard>
|
|
149
|
+
</VDialog>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<style lang="scss" scoped>
|
|
153
|
+
@use '@/assets/tokens' as *;
|
|
154
|
+
.v-card__title > * {
|
|
155
|
+
line-height: 1em;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.v-btn--icon {
|
|
159
|
+
color: $colors-icon-base;
|
|
160
|
+
position: absolute;
|
|
161
|
+
right: 24px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
h2 {
|
|
165
|
+
word-break: break-word;
|
|
166
|
+
text-wrap: balance;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.vd-dialog-box-actions-ctn {
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: column-reverse;
|
|
172
|
+
justify-content: stretch;
|
|
173
|
+
gap: $spacing-small;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@media screen and (min-width: $container-mobile-max-width) {
|
|
177
|
+
.vd-dialog-box-actions-ctn {
|
|
178
|
+
flex-direction: row;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const config = {
|
|
2
|
+
card: {
|
|
3
|
+
class: 'pa-6',
|
|
4
|
+
},
|
|
5
|
+
cardTitle: {
|
|
6
|
+
class: 'd-flex align-start flex-nowrap pa-0 mb-6 mr-6',
|
|
7
|
+
},
|
|
8
|
+
closeBtn: {
|
|
9
|
+
icon: true,
|
|
10
|
+
elevation: 0,
|
|
11
|
+
width: '32px',
|
|
12
|
+
height: '32px',
|
|
13
|
+
class: 'mt-n2 mr-n2 ml-4',
|
|
14
|
+
},
|
|
15
|
+
actionsCtn: {
|
|
16
|
+
class: 'd-flex flex-wrap mt-6',
|
|
17
|
+
},
|
|
18
|
+
cancelBtn: {
|
|
19
|
+
color: 'primary',
|
|
20
|
+
variant: 'text',
|
|
21
|
+
},
|
|
22
|
+
confirmBtn: {
|
|
23
|
+
color: 'primary',
|
|
24
|
+
},
|
|
25
|
+
} as const
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/* eslint-disable vue/one-component-per-file */
|
|
2
|
+
import { describe, it, expect } from 'vitest'
|
|
3
|
+
import { mount, shallowMount } from '@vue/test-utils'
|
|
4
|
+
import { vuetify } from '@tests/unit/setup'
|
|
5
|
+
|
|
6
|
+
import { VCard } from 'vuetify/components'
|
|
7
|
+
import { defineComponent } from 'vue'
|
|
8
|
+
import DialogBox from '../DialogBox.vue'
|
|
9
|
+
|
|
10
|
+
const defaultProps = {
|
|
11
|
+
modelValue: true,
|
|
12
|
+
title: 'Test title',
|
|
13
|
+
width: '600px',
|
|
14
|
+
cancelBtnText: 'Cancel',
|
|
15
|
+
confirmBtnText: 'Confirm',
|
|
16
|
+
hideActions: false,
|
|
17
|
+
persistent: false,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe('DialogBox', () => {
|
|
21
|
+
describe('rendering and props', () => {
|
|
22
|
+
it('renders correctly with props', () => {
|
|
23
|
+
const wrapper = mount(DialogBox, {
|
|
24
|
+
props: defaultProps,
|
|
25
|
+
global: {
|
|
26
|
+
plugins: [vuetify],
|
|
27
|
+
stubs: {
|
|
28
|
+
VDialog: {
|
|
29
|
+
template: '<div><slot></slot></div>',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('is closed when model value is false', async () => {
|
|
39
|
+
const wrapper = mount(DialogBox, {
|
|
40
|
+
props: {
|
|
41
|
+
...defaultProps,
|
|
42
|
+
modelValue: false,
|
|
43
|
+
},
|
|
44
|
+
global: {
|
|
45
|
+
plugins: [vuetify],
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
expect(wrapper.html()).toBe('')
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('becomes visible when the model value is updated', async () => {
|
|
53
|
+
const wrapper = mount(DialogBox, {
|
|
54
|
+
props: defaultProps,
|
|
55
|
+
global: {
|
|
56
|
+
plugins: [vuetify],
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const card = wrapper.getComponent(VCard)
|
|
61
|
+
expect(card.isVisible()).toBe(true)
|
|
62
|
+
|
|
63
|
+
await wrapper.setProps({ modelValue: false })
|
|
64
|
+
expect(card.isVisible()).toBe(false)
|
|
65
|
+
|
|
66
|
+
await wrapper.setProps({ modelValue: true })
|
|
67
|
+
expect(card.isVisible()).toBe(true)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('renders the title slot', async () => {
|
|
71
|
+
const wrapper = mount(DialogBox, {
|
|
72
|
+
slots: {
|
|
73
|
+
title: '<h2>Test title</h2>',
|
|
74
|
+
},
|
|
75
|
+
props: defaultProps,
|
|
76
|
+
global: {
|
|
77
|
+
plugins: [vuetify],
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const modal = wrapper.getComponent(VCard)
|
|
82
|
+
const title = modal.find<HTMLElement>('h2').text()
|
|
83
|
+
|
|
84
|
+
await modal.vm.$nextTick()
|
|
85
|
+
|
|
86
|
+
expect(title).toBe('Test title')
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
describe('focusable elements and tab navigation', () => {
|
|
91
|
+
it('gets the correct focusable elements', async () => {
|
|
92
|
+
const wrapper = mount(DialogBox, {
|
|
93
|
+
slots: {
|
|
94
|
+
default: `
|
|
95
|
+
<button id="first">First</button>
|
|
96
|
+
<button id="second" disabled>Second</button>
|
|
97
|
+
<button id="third">third</button>
|
|
98
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
99
|
+
`,
|
|
100
|
+
},
|
|
101
|
+
props: {
|
|
102
|
+
...defaultProps,
|
|
103
|
+
hideActions: true,
|
|
104
|
+
persistent: true,
|
|
105
|
+
},
|
|
106
|
+
global: {
|
|
107
|
+
plugins: [vuetify],
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const modal = wrapper.getComponent(VCard)
|
|
112
|
+
|
|
113
|
+
const firstBtn = modal.find<HTMLElement>('#first')
|
|
114
|
+
const thirdBtn = modal.find<HTMLElement>('#third')
|
|
115
|
+
const theLink = modal.find<HTMLElement>('#link')
|
|
116
|
+
|
|
117
|
+
await modal.vm.$nextTick()
|
|
118
|
+
|
|
119
|
+
// @ts-expect-error - Testing private method
|
|
120
|
+
expect(await wrapper.vm.getSelectableElements()).toEqual([
|
|
121
|
+
firstBtn.element,
|
|
122
|
+
thirdBtn.element,
|
|
123
|
+
theLink.element,
|
|
124
|
+
])
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('handles the internal tab navigation', async () => {
|
|
128
|
+
const wrapper = mount(DialogBox, {
|
|
129
|
+
slots: {
|
|
130
|
+
default: `
|
|
131
|
+
<button id="first">First</button>
|
|
132
|
+
<button id="second" disabled>Second</button>
|
|
133
|
+
<button id="third">third</button>
|
|
134
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
135
|
+
`,
|
|
136
|
+
},
|
|
137
|
+
props: {
|
|
138
|
+
...defaultProps,
|
|
139
|
+
hideActions: true,
|
|
140
|
+
persistent: true,
|
|
141
|
+
},
|
|
142
|
+
global: {
|
|
143
|
+
plugins: [vuetify],
|
|
144
|
+
},
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
async function triggerTab() {
|
|
148
|
+
await modal.find(':focus').trigger('keydown', {
|
|
149
|
+
keyCode: 9,
|
|
150
|
+
key: 'Tab',
|
|
151
|
+
code: 'Tab',
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function triggerShiftTab() {
|
|
156
|
+
await modal.find(':focus').trigger('keydown', {
|
|
157
|
+
keyCode: 9,
|
|
158
|
+
key: 'Tab',
|
|
159
|
+
code: 'Tab',
|
|
160
|
+
shiftKey: true,
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const modal = wrapper.getComponent(VCard)
|
|
165
|
+
|
|
166
|
+
const firstBtn = modal.find<HTMLElement>('#first')
|
|
167
|
+
const link = modal.find<HTMLElement>('#link')
|
|
168
|
+
await modal.vm.$nextTick()
|
|
169
|
+
|
|
170
|
+
firstBtn.element.focus()
|
|
171
|
+
await modal.vm.$nextTick()
|
|
172
|
+
|
|
173
|
+
await triggerShiftTab()
|
|
174
|
+
expect(link.element).toEqual(document.activeElement)
|
|
175
|
+
|
|
176
|
+
await triggerTab()
|
|
177
|
+
expect(firstBtn.element).toEqual(document.activeElement)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it('return to the first focusable element', async () => {
|
|
181
|
+
const testComponent = defineComponent({
|
|
182
|
+
components: { DialogBox },
|
|
183
|
+
setup() {
|
|
184
|
+
return {
|
|
185
|
+
dialog: true,
|
|
186
|
+
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
template: `
|
|
190
|
+
<DialogBox v-model="dialog" title="Test title" :hide-actions="true">
|
|
191
|
+
<button id="first">First</button>
|
|
192
|
+
<button id="second" disabled>Second</button>
|
|
193
|
+
<button id="third">third</button>
|
|
194
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
195
|
+
</DialogBox>
|
|
196
|
+
<button id="external">External</button>
|
|
197
|
+
`,
|
|
198
|
+
})
|
|
199
|
+
const wrapper = mount(testComponent, {
|
|
200
|
+
global: {
|
|
201
|
+
plugins: [vuetify],
|
|
202
|
+
},
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
const externalBtn = wrapper.find<HTMLButtonElement>('#external')
|
|
206
|
+
externalBtn.element.focus()
|
|
207
|
+
await wrapper.vm.$nextTick()
|
|
208
|
+
|
|
209
|
+
await externalBtn.trigger('keydown', {
|
|
210
|
+
keyCode: 9,
|
|
211
|
+
key: 'Tab',
|
|
212
|
+
code: 'Tab',
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
const modal = wrapper.getComponent(VCard)
|
|
216
|
+
|
|
217
|
+
const firstBtn = modal.find<HTMLElement>('#first')
|
|
218
|
+
expect(firstBtn.element).toEqual(document.activeElement)
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
it('return the last focusable element', async () => {
|
|
222
|
+
const testComponent = defineComponent({
|
|
223
|
+
components: { DialogBox },
|
|
224
|
+
setup() {
|
|
225
|
+
return {
|
|
226
|
+
dialog: true,
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
template: `
|
|
230
|
+
<button id="external">External</button>
|
|
231
|
+
<DialogBox v-model="dialog" title="Test title" :hide-actions="true">
|
|
232
|
+
<button id="first">First</button>
|
|
233
|
+
<button id="second" disabled>Second</button>
|
|
234
|
+
<button id="third">third</button>
|
|
235
|
+
<a href="https://www.ameli.fr/" id="link">ameli.fr</a>
|
|
236
|
+
</DialogBox>
|
|
237
|
+
`,
|
|
238
|
+
})
|
|
239
|
+
const wrapper = mount(testComponent, {
|
|
240
|
+
global: {
|
|
241
|
+
plugins: [vuetify],
|
|
242
|
+
},
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
const external = wrapper.find<HTMLElement>('#external')
|
|
246
|
+
const modal = wrapper.getComponent(VCard)
|
|
247
|
+
external.element.focus()
|
|
248
|
+
await wrapper.vm.$nextTick()
|
|
249
|
+
|
|
250
|
+
await modal.trigger('keydown', {
|
|
251
|
+
keyCode: 9,
|
|
252
|
+
key: 'Tab',
|
|
253
|
+
code: 'Tab',
|
|
254
|
+
shiftKey: true,
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
const link = modal.find<HTMLButtonElement>('#link')
|
|
258
|
+
expect(link.element).toEqual(document.activeElement)
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
describe('event emissions', () => {
|
|
263
|
+
it('emits an event when close button is clicked', async () => {
|
|
264
|
+
const wrapper = mount(DialogBox, {
|
|
265
|
+
props: {
|
|
266
|
+
modelValue: true,
|
|
267
|
+
},
|
|
268
|
+
global: {
|
|
269
|
+
plugins: [vuetify],
|
|
270
|
+
},
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
const modal = wrapper.getComponent(VCard)
|
|
274
|
+
|
|
275
|
+
expect(modal.isVisible()).toBe(true)
|
|
276
|
+
|
|
277
|
+
const closeBtn = modal.find('button')
|
|
278
|
+
await closeBtn.trigger('click')
|
|
279
|
+
|
|
280
|
+
expect(wrapper.emitted('update:modelValue')).toBeTruthy()
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
it('emits a cancel event when cancel button is clicked', async () => {
|
|
284
|
+
const wrapper = mount(DialogBox, {
|
|
285
|
+
props: defaultProps,
|
|
286
|
+
global: {
|
|
287
|
+
plugins: [vuetify],
|
|
288
|
+
},
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
const modal = wrapper.getComponent(VCard)
|
|
292
|
+
|
|
293
|
+
const cancelBtn = modal.find('.vd-dialog-box-actions-ctn button')
|
|
294
|
+
await cancelBtn.trigger('click')
|
|
295
|
+
|
|
296
|
+
expect(wrapper.emitted('cancel')).toBeTruthy()
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
it('emits a confirm event when confirm button is clicked', async () => {
|
|
300
|
+
const wrapper = mount(DialogBox, {
|
|
301
|
+
props: defaultProps,
|
|
302
|
+
global: {
|
|
303
|
+
plugins: [vuetify],
|
|
304
|
+
},
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
const modal = wrapper.getComponent(VCard)
|
|
308
|
+
|
|
309
|
+
const confirmBtn = modal.find('[data-test-id="confirm-btn"]')
|
|
310
|
+
await confirmBtn.trigger('click')
|
|
311
|
+
|
|
312
|
+
expect(wrapper.emitted('confirm')).toBeTruthy()
|
|
313
|
+
})
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
describe('Test methods', () => {
|
|
317
|
+
it('getSelectableElements if this.$refs.dialogContent.$el is undefined', async () => {
|
|
318
|
+
const wrapper = shallowMount(DialogBox, {
|
|
319
|
+
props: defaultProps,
|
|
320
|
+
global: {
|
|
321
|
+
plugins: [vuetify],
|
|
322
|
+
},
|
|
323
|
+
})
|
|
324
|
+
// @ts-expect-error - Testing private method
|
|
325
|
+
const result = await wrapper.vm.getSelectableElements()
|
|
326
|
+
expect(result).toEqual([])
|
|
327
|
+
})
|
|
328
|
+
})
|
|
329
|
+
})
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`DialogBox > rendering and props > renders correctly with props 1`] = `
|
|
4
|
+
"<div data-v-e77b7070="" modelvalue="true" width="600px" persistent="false" retain-focus="false" aria-modal="true" class="vd-dialog-box">
|
|
5
|
+
<div data-v-e77b7070="" class="v-card v-theme--light v-card--density-default v-card--variant-elevated pa-6" id="dialogContent" aria-labelledby="Test title">
|
|
6
|
+
<!---->
|
|
7
|
+
<div class="v-card__loader">
|
|
8
|
+
<div class="v-progress-linear v-theme--light v-locale--is-ltr" style="top: 0px; height: 0px; --v-progress-linear-height: 2px;" role="progressbar" aria-hidden="true" aria-valuemin="0" aria-valuemax="100">
|
|
9
|
+
<!---->
|
|
10
|
+
<div class="v-progress-linear__background" style="opacity: NaN;"></div>
|
|
11
|
+
<div class="v-progress-linear__buffer" style="opacity: NaN; width: 0%;"></div>
|
|
12
|
+
<transition-stub name="fade-transition" appear="false" persisted="false" css="true">
|
|
13
|
+
<div class="v-progress-linear__indeterminate">
|
|
14
|
+
<div class="v-progress-linear__indeterminate long"></div>
|
|
15
|
+
<div class="v-progress-linear__indeterminate short"></div>
|
|
16
|
+
</div>
|
|
17
|
+
</transition-stub>
|
|
18
|
+
<!---->
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<!---->
|
|
22
|
+
<!---->
|
|
23
|
+
<div data-v-e77b7070="" class="v-card-title d-flex align-start flex-nowrap pa-0 mb-6 mr-6">
|
|
24
|
+
<h2 data-v-e77b7070="" class="text-h6 font-weight-bold">Test title</h2>
|
|
25
|
+
<div data-v-e77b7070="" class="v-spacer"></div><button data-v-e77b7070="" type="button" class="v-btn v-btn--elevated v-btn--icon v-theme--light v-btn--density-default elevation-0 v-btn--size-default v-btn--variant-elevated mt-n2 mr-n2 ml-4" style="height: 32px; width: 32px;" aria-label="Fermer la boîte de dialogue"><span class="v-btn__overlay"></span><span class="v-btn__underlay"></span>
|
|
26
|
+
<!----><span class="v-btn__content" data-no-activator=""><i data-v-e77b7070="" class="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z mdi v-icon notranslate v-theme--light v-icon--size-default" aria-hidden="true"></i></span>
|
|
27
|
+
<!---->
|
|
28
|
+
<!---->
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
<div data-v-e77b7070="" class="d-flex flex-wrap mt-6 vd-dialog-box-actions-ctn">
|
|
32
|
+
<div data-v-e77b7070="" class="v-spacer"></div><button data-v-e77b7070="" type="button" class="v-btn v-theme--light text-primary v-btn--density-default v-btn--size-default v-btn--variant-text"><span class="v-btn__overlay"></span><span class="v-btn__underlay"></span>
|
|
33
|
+
<!----><span class="v-btn__content" data-no-activator="">Cancel</span>
|
|
34
|
+
<!---->
|
|
35
|
+
<!---->
|
|
36
|
+
</button><button data-v-e77b7070="" type="button" class="v-btn v-btn--elevated v-theme--light bg-primary v-btn--density-default v-btn--size-default v-btn--variant-elevated" data-test-id="confirm-btn"><span class="v-btn__overlay"></span><span class="v-btn__underlay"></span>
|
|
37
|
+
<!----><span class="v-btn__content" data-no-activator="">Confirm</span>
|
|
38
|
+
<!---->
|
|
39
|
+
<!---->
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
<!---->
|
|
43
|
+
<!----><span class="v-card__underlay"></span>
|
|
44
|
+
</div>
|
|
45
|
+
</div>"
|
|
46
|
+
`;
|
|
@@ -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 />
|