@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,420 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import SyInputSelect from './SyInputSelect.vue'
|
|
3
|
+
import { VBtn, VMenu, VList, VListItem, VListItemTitle } from 'vuetify/components'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import Alert from '../../Alert/Alert.vue'
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Composants/Formulaires/SyInputSelect',
|
|
9
|
+
component: SyInputSelect,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
controls: { exclude: ['selectedValue', 'isOpen', 'toggleMenu', 'closeList', 'selectItem', 'selectedItem', 'getItemText'] },
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
selectedValue: { control: 'text' },
|
|
16
|
+
items: { control: 'object' },
|
|
17
|
+
errorMessages: { control: 'object' },
|
|
18
|
+
required: { control: 'boolean' },
|
|
19
|
+
textKey: { control: 'text' },
|
|
20
|
+
valueKey: { control: 'text' },
|
|
21
|
+
vuetifyOptions: { control: 'object' },
|
|
22
|
+
},
|
|
23
|
+
} as Meta<typeof SyInputSelect>
|
|
24
|
+
|
|
25
|
+
export default meta
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof meta>
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
parameters: {
|
|
30
|
+
sourceCode: [
|
|
31
|
+
{
|
|
32
|
+
name: 'Template',
|
|
33
|
+
code: `
|
|
34
|
+
<template>
|
|
35
|
+
<SyInputSelect
|
|
36
|
+
v-model="value"
|
|
37
|
+
:items="items"
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
`,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Script',
|
|
44
|
+
code: `
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import SyInputSelect from '@cnamts/SyInputSelect'
|
|
47
|
+
|
|
48
|
+
const items = [
|
|
49
|
+
{ text: 'Option 1', value: '1' },
|
|
50
|
+
{ text: 'Option 2', value: '2' },
|
|
51
|
+
],
|
|
52
|
+
</script>
|
|
53
|
+
`,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
args: {
|
|
58
|
+
items: [
|
|
59
|
+
{ text: 'Option 1', value: '1' },
|
|
60
|
+
{ text: 'Option 2', value: '2' },
|
|
61
|
+
],
|
|
62
|
+
vuetifyOptions: {
|
|
63
|
+
menu: {
|
|
64
|
+
color: 'primary',
|
|
65
|
+
},
|
|
66
|
+
option: {
|
|
67
|
+
color: 'primary',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
render: (args) => {
|
|
72
|
+
return {
|
|
73
|
+
components: { SyInputSelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
74
|
+
setup() {
|
|
75
|
+
return { args }
|
|
76
|
+
},
|
|
77
|
+
template: `
|
|
78
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
79
|
+
<SyInputSelect
|
|
80
|
+
v-bind="args"
|
|
81
|
+
:vuetify-options="args.vuetifyOptions"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
<br/><br/><br/><br/>
|
|
85
|
+
`,
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const Outlined: Story = {
|
|
91
|
+
parameters: {
|
|
92
|
+
sourceCode: [
|
|
93
|
+
{
|
|
94
|
+
name: 'Template',
|
|
95
|
+
code: `
|
|
96
|
+
<template>
|
|
97
|
+
<SyInputSelect
|
|
98
|
+
v-model="value"
|
|
99
|
+
:items="items"
|
|
100
|
+
outlined
|
|
101
|
+
/>
|
|
102
|
+
</template>
|
|
103
|
+
`,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'Script',
|
|
107
|
+
code: `
|
|
108
|
+
<script setup lang="ts">
|
|
109
|
+
import SyInputSelect from '@cnamts/SyInputSelect'
|
|
110
|
+
|
|
111
|
+
const items = [
|
|
112
|
+
{ text: 'Option 1', value: '1' },
|
|
113
|
+
{ text: 'Option 2', value: '2' },
|
|
114
|
+
],
|
|
115
|
+
</script>
|
|
116
|
+
`,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
args: {
|
|
121
|
+
items: [
|
|
122
|
+
{ text: 'Option 1', value: '1' },
|
|
123
|
+
{ text: 'Option 2', value: '2' },
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
render: (args) => {
|
|
127
|
+
return {
|
|
128
|
+
components: { SyInputSelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
129
|
+
setup() {
|
|
130
|
+
return { args }
|
|
131
|
+
},
|
|
132
|
+
template: `
|
|
133
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
134
|
+
<SyInputSelect
|
|
135
|
+
v-bind="args"
|
|
136
|
+
outlined
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
`,
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const Required: Story = {
|
|
145
|
+
parameters: {
|
|
146
|
+
sourceCode: [
|
|
147
|
+
{
|
|
148
|
+
name: 'Template',
|
|
149
|
+
code: `
|
|
150
|
+
<template>
|
|
151
|
+
<SyInputSelect
|
|
152
|
+
v-model="value"
|
|
153
|
+
:items="items"
|
|
154
|
+
required
|
|
155
|
+
/>
|
|
156
|
+
</template>
|
|
157
|
+
`,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'Script',
|
|
161
|
+
code: `
|
|
162
|
+
<script setup lang="ts">
|
|
163
|
+
import SyInputSelect from '@cnamts/SyInputSelect'
|
|
164
|
+
|
|
165
|
+
const items = [
|
|
166
|
+
{ text: 'Option 1', value: '1' },
|
|
167
|
+
{ text: 'Option 2', value: '2' },
|
|
168
|
+
],
|
|
169
|
+
</script>
|
|
170
|
+
`,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
args: {
|
|
175
|
+
items: [
|
|
176
|
+
{ text: 'Option 1', value: '1' },
|
|
177
|
+
{ text: 'Option 2', value: '2' },
|
|
178
|
+
],
|
|
179
|
+
required: true,
|
|
180
|
+
},
|
|
181
|
+
render: (args) => {
|
|
182
|
+
return {
|
|
183
|
+
components: { SyInputSelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
184
|
+
setup() {
|
|
185
|
+
return { args }
|
|
186
|
+
},
|
|
187
|
+
template: `
|
|
188
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
189
|
+
<SyInputSelect
|
|
190
|
+
v-bind="args"
|
|
191
|
+
:required="args.required"
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
`,
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const withCustomError: Story = {
|
|
200
|
+
parameters: {
|
|
201
|
+
sourceCode: [
|
|
202
|
+
{
|
|
203
|
+
name: 'Template',
|
|
204
|
+
code: `
|
|
205
|
+
<template>
|
|
206
|
+
<SyInputSelect
|
|
207
|
+
v-model="value"
|
|
208
|
+
:items="items"
|
|
209
|
+
:error-messages="errorMessages"
|
|
210
|
+
/>
|
|
211
|
+
<VBtn @click="triggerError">
|
|
212
|
+
Trigger Error
|
|
213
|
+
</VBtn>
|
|
214
|
+
</template>
|
|
215
|
+
`,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'Script',
|
|
219
|
+
code: `
|
|
220
|
+
<script setup lang="ts">
|
|
221
|
+
import SyInputSelect from '@cnamts/SyInputSelect'
|
|
222
|
+
import { ref } from 'vue'
|
|
223
|
+
|
|
224
|
+
const items = [
|
|
225
|
+
{ text: 'Option 1', value: '1' },
|
|
226
|
+
{ text: 'Option 2', value: '2' },
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
const errorMessages = ref([])
|
|
230
|
+
|
|
231
|
+
const triggerError = () => {
|
|
232
|
+
errorMessages.value = ['This is a test error message']
|
|
233
|
+
}
|
|
234
|
+
</script>
|
|
235
|
+
`,
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
args: {
|
|
240
|
+
items: [
|
|
241
|
+
{ text: 'Option 1', value: '1' },
|
|
242
|
+
{ text: 'Option 2', value: '2' },
|
|
243
|
+
],
|
|
244
|
+
},
|
|
245
|
+
render: (args) => {
|
|
246
|
+
return {
|
|
247
|
+
components: { SyInputSelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
248
|
+
setup() {
|
|
249
|
+
const errorMessages = ref([])
|
|
250
|
+
const triggerError = () => {
|
|
251
|
+
// @ts-expect-error test error message
|
|
252
|
+
errorMessages.value = ['This is a test error message']
|
|
253
|
+
}
|
|
254
|
+
return { args, errorMessages, triggerError }
|
|
255
|
+
},
|
|
256
|
+
template: `
|
|
257
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
258
|
+
<SyInputSelect
|
|
259
|
+
v-bind="args"
|
|
260
|
+
:error-messages="errorMessages"
|
|
261
|
+
/>
|
|
262
|
+
<VBtn @click="triggerError">
|
|
263
|
+
Trigger Error
|
|
264
|
+
</VBtn>
|
|
265
|
+
</div>
|
|
266
|
+
`,
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export const withCustomKey: Story = {
|
|
272
|
+
parameters: {
|
|
273
|
+
sourceCode: [
|
|
274
|
+
{
|
|
275
|
+
name: 'Template',
|
|
276
|
+
code: `
|
|
277
|
+
<template>
|
|
278
|
+
<SyInputSelect
|
|
279
|
+
v-model="value"
|
|
280
|
+
:items="items"
|
|
281
|
+
text-key="customKey"
|
|
282
|
+
outlined
|
|
283
|
+
/>
|
|
284
|
+
</template>
|
|
285
|
+
`,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: 'Script',
|
|
289
|
+
code: `
|
|
290
|
+
<script setup lang="ts">
|
|
291
|
+
import SyInputSelect from '@cnamts/SyInputSelect'
|
|
292
|
+
|
|
293
|
+
const items = [
|
|
294
|
+
{ customKey: 'Choix 1', value: '1' },
|
|
295
|
+
{ customKey: 'Choix 2', value: '2' }
|
|
296
|
+
]
|
|
297
|
+
</script>
|
|
298
|
+
`,
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
args: {
|
|
303
|
+
items: [
|
|
304
|
+
{ customKey: 'Choix 1', value: '1' },
|
|
305
|
+
{ customKey: 'Choix 2', value: '2' },
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
render: (args) => {
|
|
309
|
+
return {
|
|
310
|
+
components: { SyInputSelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
311
|
+
setup() {
|
|
312
|
+
return { args }
|
|
313
|
+
},
|
|
314
|
+
template: `
|
|
315
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
316
|
+
<SyInputSelect
|
|
317
|
+
v-bind="args"
|
|
318
|
+
outlined
|
|
319
|
+
text-key="customKey"
|
|
320
|
+
/>
|
|
321
|
+
</div>
|
|
322
|
+
`,
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export const withCustomStyles: Story = {
|
|
328
|
+
parameters: {
|
|
329
|
+
sourceCode: [
|
|
330
|
+
{
|
|
331
|
+
name: 'Template',
|
|
332
|
+
code: `
|
|
333
|
+
<template>
|
|
334
|
+
<SyInputSelect
|
|
335
|
+
v-model="value"
|
|
336
|
+
:items="items"
|
|
337
|
+
:vuetify-options="vuetifyOptions
|
|
338
|
+
/>
|
|
339
|
+
</template>
|
|
340
|
+
`,
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: 'Script',
|
|
344
|
+
code: `
|
|
345
|
+
<script setup lang="ts">
|
|
346
|
+
import SyInputSelect from '@cnamts/SyInputSelect'
|
|
347
|
+
|
|
348
|
+
const items = [
|
|
349
|
+
{ text: 'Option 1', value: '1' },
|
|
350
|
+
{ text: 'Option 2', value: '2' },
|
|
351
|
+
]
|
|
352
|
+
|
|
353
|
+
const vuetifyOptions = {
|
|
354
|
+
menu: {
|
|
355
|
+
color: 'secondary',
|
|
356
|
+
},
|
|
357
|
+
option: {
|
|
358
|
+
color: 'secondary',
|
|
359
|
+
},
|
|
360
|
+
}
|
|
361
|
+
</script>
|
|
362
|
+
`,
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
args: {
|
|
367
|
+
items: [
|
|
368
|
+
{ text: 'Option 1', value: '1' },
|
|
369
|
+
{ text: 'Option 2', value: '2' },
|
|
370
|
+
],
|
|
371
|
+
vuetifyOptions: {
|
|
372
|
+
menu: {
|
|
373
|
+
color: 'secondary',
|
|
374
|
+
},
|
|
375
|
+
option: {
|
|
376
|
+
color: 'secondary',
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
render: (args) => {
|
|
381
|
+
return {
|
|
382
|
+
components: { SyInputSelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
383
|
+
setup() {
|
|
384
|
+
return { args }
|
|
385
|
+
},
|
|
386
|
+
template: `
|
|
387
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
388
|
+
<SyInputSelect
|
|
389
|
+
v-bind="args"
|
|
390
|
+
:items="args.items"
|
|
391
|
+
:vuetify-options="args.vuetifyOptions"
|
|
392
|
+
/>
|
|
393
|
+
</div>
|
|
394
|
+
`,
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export const Info: Story = {
|
|
400
|
+
render: (args) => {
|
|
401
|
+
return {
|
|
402
|
+
components: { Alert },
|
|
403
|
+
setup() {
|
|
404
|
+
return { args }
|
|
405
|
+
},
|
|
406
|
+
template: `
|
|
407
|
+
<Alert v-model="args.modelValue" :type="args.type" :variant="tonal" :closable="false">
|
|
408
|
+
<template #default>
|
|
409
|
+
<b>Format des items :</b>
|
|
410
|
+
<ul>
|
|
411
|
+
<li>- Si les items passés en props sont des objets, le composant les utilisera directement.</li>
|
|
412
|
+
<li>- Si les items sont un tableau de string, le composant les utilisera directement.</li>
|
|
413
|
+
</ul>
|
|
414
|
+
</template>
|
|
415
|
+
</Alert>
|
|
416
|
+
`,
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
tags: ['!dev'],
|
|
420
|
+
}
|
|
@@ -1,51 +1,39 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { mdiChevronDown } from '@mdi/js'
|
|
3
|
+
import { computed, onMounted, ref, watch } from 'vue'
|
|
4
4
|
import { VIcon, VList, VListItem, VListItemTitle } from 'vuetify/components'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
items
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
default: 'custom-select-menu',
|
|
30
|
-
},
|
|
31
|
-
outlined: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false,
|
|
34
|
-
},
|
|
35
|
-
textKey: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: 'text',
|
|
38
|
-
},
|
|
39
|
-
valueKey: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: 'value',
|
|
42
|
-
},
|
|
6
|
+
import useCustomizableOptions, { type CustomizableOptions } from '@/composables/useCustomizableOptions'
|
|
7
|
+
import defaultOptions from './config'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<CustomizableOptions & {
|
|
10
|
+
modelValue?: Record<string, unknown> | string | null
|
|
11
|
+
items?: Record<string, unknown>[] | string[]
|
|
12
|
+
textKey?: string
|
|
13
|
+
valueKey?: string
|
|
14
|
+
label?: string
|
|
15
|
+
outlined?: boolean
|
|
16
|
+
required?: boolean
|
|
17
|
+
errorMessages?: string | string[]
|
|
18
|
+
isHeaderToolbar?: boolean
|
|
19
|
+
}>(), {
|
|
20
|
+
modelValue: null,
|
|
21
|
+
items: () => [],
|
|
22
|
+
textKey: 'text',
|
|
23
|
+
valueKey: 'value',
|
|
24
|
+
label: 'Sélectionnez une option',
|
|
25
|
+
outlined: false,
|
|
26
|
+
required: false,
|
|
27
|
+
errorMessages: () => [],
|
|
28
|
+
isHeaderToolbar: false,
|
|
43
29
|
})
|
|
44
30
|
|
|
31
|
+
const options = useCustomizableOptions(defaultOptions, props)
|
|
32
|
+
|
|
45
33
|
const emit = defineEmits(['update:modelValue'])
|
|
46
34
|
|
|
47
35
|
const isOpen = ref(false)
|
|
48
|
-
const selectedItem = ref<Record<string, unknown
|
|
36
|
+
const selectedItem = ref<Record<string, unknown> | string | null>(props.modelValue)
|
|
49
37
|
|
|
50
38
|
const toggleMenu = () => {
|
|
51
39
|
isOpen.value = !isOpen.value
|
|
@@ -55,7 +43,7 @@
|
|
|
55
43
|
isOpen.value = false
|
|
56
44
|
}
|
|
57
45
|
|
|
58
|
-
const inputId = ref(`
|
|
46
|
+
const inputId = ref(`sy-input-select-${Math.random().toString(36).substring(7)}`)
|
|
59
47
|
|
|
60
48
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
61
49
|
const selectItem = (item: any) => {
|
|
@@ -81,6 +69,24 @@
|
|
|
81
69
|
selectedItem.value = newValue
|
|
82
70
|
})
|
|
83
71
|
|
|
72
|
+
watch(() => props.errorMessages, (newValue) => {
|
|
73
|
+
localErrorMessages.value = newValue
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const menu = ref<HTMLElement | null>(null)
|
|
77
|
+
const menuWidth = ref('')
|
|
78
|
+
onMounted(() => {
|
|
79
|
+
watch(
|
|
80
|
+
[() => isOpen.value, () => menu.value?.getBoundingClientRect().width],
|
|
81
|
+
([newValue, newWidth]) => {
|
|
82
|
+
if (newValue && newWidth) {
|
|
83
|
+
const totalWidth = newWidth + (props.isHeaderToolbar ? 32 : 0)
|
|
84
|
+
menuWidth.value = `${totalWidth}`
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
)
|
|
88
|
+
})
|
|
89
|
+
|
|
84
90
|
const buttonClass = computed(() => {
|
|
85
91
|
return props.outlined ? 'v-btn v-btn--density-default v-btn--size-default v-btn--variant-outlined' : 'text-color'
|
|
86
92
|
})
|
|
@@ -93,22 +99,44 @@
|
|
|
93
99
|
return item
|
|
94
100
|
})
|
|
95
101
|
})
|
|
102
|
+
|
|
103
|
+
const localErrorMessages = ref<string | string[]>(props.errorMessages as string | string[])
|
|
104
|
+
const checkForErrors = () => {
|
|
105
|
+
if (props.required && !selectedItem.value) {
|
|
106
|
+
localErrorMessages.value = ['Le champ est requis.']
|
|
107
|
+
return false
|
|
108
|
+
}
|
|
109
|
+
if (props.errorMessages.length > 0) {
|
|
110
|
+
localErrorMessages.value = props.errorMessages
|
|
111
|
+
return false
|
|
112
|
+
}
|
|
113
|
+
localErrorMessages.value = []
|
|
114
|
+
return true
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
defineExpose({
|
|
118
|
+
isOpen,
|
|
119
|
+
closeList,
|
|
120
|
+
selectItem,
|
|
121
|
+
selectedItem,
|
|
122
|
+
getItemText,
|
|
123
|
+
})
|
|
96
124
|
</script>
|
|
97
125
|
|
|
98
126
|
<template>
|
|
99
127
|
<v-input
|
|
100
128
|
:id="inputId"
|
|
101
129
|
v-model="selectedItem"
|
|
130
|
+
:error-messages="localErrorMessages"
|
|
102
131
|
:label="props.label"
|
|
103
132
|
:title="props.label"
|
|
104
133
|
role="menu"
|
|
105
|
-
|
|
106
|
-
:required="required"
|
|
134
|
+
@click="checkForErrors"
|
|
107
135
|
>
|
|
108
136
|
<div
|
|
109
137
|
ref="menu"
|
|
110
138
|
v-click-outside="closeList"
|
|
111
|
-
:class="['
|
|
139
|
+
:class="['sy-input-select', buttonClass, 'text-'+options.menu.color]"
|
|
112
140
|
role="menu"
|
|
113
141
|
tabindex="0"
|
|
114
142
|
@click="toggleMenu"
|
|
@@ -116,24 +144,28 @@
|
|
|
116
144
|
@keydown.space.prevent="toggleMenu"
|
|
117
145
|
>
|
|
118
146
|
<span>{{ selectedItemText }}</span>
|
|
119
|
-
<VIcon> {{
|
|
147
|
+
<VIcon> {{ mdiChevronDown }}</VIcon>
|
|
120
148
|
</div>
|
|
121
149
|
<VList
|
|
122
150
|
v-if="isOpen"
|
|
123
|
-
class="v-list"
|
|
124
|
-
:style="`max-width: ${$refs.menu ? $refs.menu.getBoundingClientRect().width : 0}px;`"
|
|
125
151
|
:aria-label="props.label"
|
|
152
|
+
:is-header-toolbar="props.isHeaderToolbar"
|
|
153
|
+
:style="`min-width:${menuWidth}px; ${props.outlined ? 'top: 36px;' : 'top: 30px;'}`"
|
|
126
154
|
:title="props.label"
|
|
155
|
+
class="v-list"
|
|
156
|
+
v-bind="options.list"
|
|
127
157
|
@keydown.esc.prevent="isOpen = false"
|
|
128
158
|
>
|
|
129
159
|
<VListItem
|
|
130
160
|
v-for="(item, index) in formattedItems"
|
|
131
161
|
:key="index"
|
|
132
162
|
:ref="'options-' + index"
|
|
133
|
-
role="option"
|
|
134
|
-
class="v-list-item"
|
|
135
163
|
:aria-selected="selectedItem === item"
|
|
164
|
+
:base-color="options.option.color"
|
|
136
165
|
:tabindex="index + 1"
|
|
166
|
+
class="v-list-item"
|
|
167
|
+
role="option"
|
|
168
|
+
v-bind="options.option"
|
|
137
169
|
@click="selectItem(item)"
|
|
138
170
|
>
|
|
139
171
|
<VListItemTitle>
|
|
@@ -144,7 +176,7 @@
|
|
|
144
176
|
</v-input>
|
|
145
177
|
</template>
|
|
146
178
|
|
|
147
|
-
<style
|
|
179
|
+
<style lang="scss" scoped>
|
|
148
180
|
@use '@/assets/tokens.scss';
|
|
149
181
|
|
|
150
182
|
.v-input {
|
|
@@ -154,12 +186,11 @@
|
|
|
154
186
|
|
|
155
187
|
.v-list {
|
|
156
188
|
position: absolute;
|
|
157
|
-
top: 36px;
|
|
158
189
|
width: 100%;
|
|
159
190
|
z-index: 1;
|
|
160
191
|
background-color: white;
|
|
161
192
|
min-width: fit-content;
|
|
162
|
-
max-width:
|
|
193
|
+
max-width: 100px;
|
|
163
194
|
padding: 0;
|
|
164
195
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.08);
|
|
165
196
|
border-radius: 4px;
|
|
@@ -171,8 +202,12 @@
|
|
|
171
202
|
background-color: rgba(0, 0, 0, 0.04);
|
|
172
203
|
}
|
|
173
204
|
|
|
174
|
-
.v-list-item[aria-selected='true'] {
|
|
205
|
+
:deep(.v-list-item[aria-selected='true']) {
|
|
175
206
|
background-color: rgba(0, 0, 0, 0.08);
|
|
207
|
+
|
|
208
|
+
.v-list-item-title {
|
|
209
|
+
font-weight: bold;
|
|
210
|
+
}
|
|
176
211
|
}
|
|
177
212
|
|
|
178
213
|
.v-btn {
|