@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
|
@@ -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,44 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls, Source } from '@storybook/blocks';
|
|
2
|
+
import * as SyTextFieldStories from "./SyTextField.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={SyTextFieldStories} />
|
|
5
|
+
|
|
6
|
+
# SyTextField
|
|
7
|
+
|
|
8
|
+
Le composant `SyTextField` est utilisé pour proposer une alternative au `TextField` de Vuetify, conforme au style du Design System et qui respecte les règles d'accessibilité RGAA.
|
|
9
|
+
|
|
10
|
+
<Canvas of={SyTextFieldStories.Default} />
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# API
|
|
14
|
+
|
|
15
|
+
<Controls of={SyTextFieldStories.Default} />
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# Exemple d'utilisation
|
|
19
|
+
|
|
20
|
+
<Source
|
|
21
|
+
dark code={`
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import { ref } from 'vue'
|
|
24
|
+
import SyTextField from '@cnamts/synapse'
|
|
25
|
+
|
|
26
|
+
const model = ref('')
|
|
27
|
+
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<main class="ma-12">
|
|
32
|
+
Text saisie: {{ model }}
|
|
33
|
+
<div class="d-flex flex-wrap align-center">
|
|
34
|
+
<SyTextField
|
|
35
|
+
v-model="model"
|
|
36
|
+
label="Label"
|
|
37
|
+
color="primary"
|
|
38
|
+
is-clearable
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</main>
|
|
42
|
+
</template>
|
|
43
|
+
`}
|
|
44
|
+
/>
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
|
|
3
|
+
import { VIcon } from 'vuetify/components'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import { mdiAccountBox } from '@mdi/js'
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Composants/Formulaires/SyTextField',
|
|
9
|
+
component: SyTextField,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
controls: { exclude: ['modelValue', 'appendInnerIconColor'] },
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
modelValue: { control: 'text' },
|
|
16
|
+
label: { control: 'text' },
|
|
17
|
+
prependIcon: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
20
|
+
},
|
|
21
|
+
appendIcon: {
|
|
22
|
+
control: 'select',
|
|
23
|
+
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
24
|
+
},
|
|
25
|
+
prependInnerIcon: {
|
|
26
|
+
control: 'select',
|
|
27
|
+
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
28
|
+
},
|
|
29
|
+
appendInnerIcon: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
32
|
+
},
|
|
33
|
+
variantStyle: {
|
|
34
|
+
control: 'select',
|
|
35
|
+
options: ['outlined', 'plain', 'underlined', 'filled', 'solo', 'solo-inverted', 'solo-filled'],
|
|
36
|
+
},
|
|
37
|
+
color: {
|
|
38
|
+
control: 'select',
|
|
39
|
+
options: ['primary', 'secondary', 'success', 'error', 'warning'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
} as Meta<typeof SyTextField>
|
|
43
|
+
|
|
44
|
+
export default meta
|
|
45
|
+
|
|
46
|
+
type Story = StoryObj<typeof meta>
|
|
47
|
+
export const Default: Story = {
|
|
48
|
+
parameters: {
|
|
49
|
+
sourceCode: [
|
|
50
|
+
{
|
|
51
|
+
name: 'Template',
|
|
52
|
+
code: `
|
|
53
|
+
<template>
|
|
54
|
+
<SyTextField v-model="value" />
|
|
55
|
+
</template>
|
|
56
|
+
`,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Script',
|
|
60
|
+
code: `
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import SyTextField from '@cnamts/synapse'
|
|
63
|
+
</script>
|
|
64
|
+
`,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
args: {
|
|
69
|
+
showDivider: false,
|
|
70
|
+
variantStyle: 'outlined',
|
|
71
|
+
color: 'primary',
|
|
72
|
+
isClearable: true,
|
|
73
|
+
label: 'Label',
|
|
74
|
+
},
|
|
75
|
+
render: (args) => {
|
|
76
|
+
return {
|
|
77
|
+
components: { SyTextField, VIcon },
|
|
78
|
+
setup() {
|
|
79
|
+
return { args }
|
|
80
|
+
},
|
|
81
|
+
template: `
|
|
82
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
83
|
+
<SyTextField v-bind="args" />
|
|
84
|
+
</div>
|
|
85
|
+
`,
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const SlotPrepend: Story = {
|
|
91
|
+
parameters: {
|
|
92
|
+
sourceCode: [
|
|
93
|
+
{
|
|
94
|
+
name: 'Template',
|
|
95
|
+
code: `
|
|
96
|
+
<template>
|
|
97
|
+
<SyTextField
|
|
98
|
+
v-model="value"
|
|
99
|
+
prepend-icon="info"
|
|
100
|
+
/>
|
|
101
|
+
</template>
|
|
102
|
+
`,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Script',
|
|
106
|
+
code: `
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import SyTextField from '@cnamts/synapse'
|
|
109
|
+
</script>
|
|
110
|
+
`,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
args: {
|
|
115
|
+
variantStyle: 'outlined',
|
|
116
|
+
isClearable: true,
|
|
117
|
+
showDivider: false,
|
|
118
|
+
label: 'Label',
|
|
119
|
+
color: 'primary',
|
|
120
|
+
prependIcon: 'info',
|
|
121
|
+
},
|
|
122
|
+
render: (args) => {
|
|
123
|
+
return {
|
|
124
|
+
components: { SyTextField, VIcon },
|
|
125
|
+
setup() {
|
|
126
|
+
return { args }
|
|
127
|
+
},
|
|
128
|
+
template: `
|
|
129
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
130
|
+
<SyTextField
|
|
131
|
+
v-bind="args"
|
|
132
|
+
:label="args.label"
|
|
133
|
+
:prepend-icon="args.prependIcon"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
`,
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const SlotAppend: Story = {
|
|
142
|
+
parameters: {
|
|
143
|
+
sourceCode: [
|
|
144
|
+
{
|
|
145
|
+
name: 'Template',
|
|
146
|
+
code: `
|
|
147
|
+
<template>
|
|
148
|
+
<SyTextField
|
|
149
|
+
v-model="value"
|
|
150
|
+
append-icon="success"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
`,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'Script',
|
|
157
|
+
code: `
|
|
158
|
+
<script setup lang="ts">
|
|
159
|
+
import SyTextField from '@cnamts/synapse'
|
|
160
|
+
</script>
|
|
161
|
+
`,
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
args: {
|
|
166
|
+
variantStyle: 'outlined',
|
|
167
|
+
isClearable: true,
|
|
168
|
+
showDivider: false,
|
|
169
|
+
label: 'champs de text',
|
|
170
|
+
color: 'primary',
|
|
171
|
+
appendIcon: 'success',
|
|
172
|
+
},
|
|
173
|
+
render: (args) => {
|
|
174
|
+
return {
|
|
175
|
+
components: { SyTextField, VIcon },
|
|
176
|
+
setup() {
|
|
177
|
+
return { args }
|
|
178
|
+
},
|
|
179
|
+
template: `
|
|
180
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
181
|
+
<SyTextField
|
|
182
|
+
v-bind="args"
|
|
183
|
+
:append-icon="args.appendIcon"
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
`,
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const SlotPrependInner: Story = {
|
|
192
|
+
parameters: {
|
|
193
|
+
sourceCode: [
|
|
194
|
+
{
|
|
195
|
+
name: 'Template',
|
|
196
|
+
code: `
|
|
197
|
+
<template>
|
|
198
|
+
<SyTextField
|
|
199
|
+
v-model="value"
|
|
200
|
+
prepend-inner-icon="info"
|
|
201
|
+
/>
|
|
202
|
+
</template>
|
|
203
|
+
`,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'Script',
|
|
207
|
+
code: `
|
|
208
|
+
<script setup lang="ts">
|
|
209
|
+
import SyTextField from '@cnamts/synapse'
|
|
210
|
+
</script>
|
|
211
|
+
`,
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
args: {
|
|
216
|
+
variantStyle: 'outlined',
|
|
217
|
+
isClearable: true,
|
|
218
|
+
showDivider: false,
|
|
219
|
+
label: 'Label',
|
|
220
|
+
color: 'primary',
|
|
221
|
+
prependInnerIcon: 'info',
|
|
222
|
+
},
|
|
223
|
+
render: (args) => {
|
|
224
|
+
return {
|
|
225
|
+
components: { SyTextField, VIcon },
|
|
226
|
+
setup() {
|
|
227
|
+
return { args }
|
|
228
|
+
},
|
|
229
|
+
template: `
|
|
230
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
231
|
+
<SyTextField
|
|
232
|
+
v-bind="args"
|
|
233
|
+
:prepend-inner-icon="args.prependInnerIcon"
|
|
234
|
+
/>
|
|
235
|
+
</div>
|
|
236
|
+
`,
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export const SlotPrependInnerDivider: Story = {
|
|
242
|
+
parameters: {
|
|
243
|
+
sourceCode: [
|
|
244
|
+
{
|
|
245
|
+
name: 'Template',
|
|
246
|
+
code: `
|
|
247
|
+
<template>
|
|
248
|
+
<SyTextField
|
|
249
|
+
v-model="value"
|
|
250
|
+
prepend-inner-icon="info"
|
|
251
|
+
show-divider
|
|
252
|
+
/>
|
|
253
|
+
</template>
|
|
254
|
+
`,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: 'Script',
|
|
258
|
+
code: `
|
|
259
|
+
<script setup lang="ts">
|
|
260
|
+
import SyTextField from '@cnamts/synapse'
|
|
261
|
+
</script>
|
|
262
|
+
`,
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
args: {
|
|
267
|
+
variantStyle: 'outlined',
|
|
268
|
+
isClearable: true,
|
|
269
|
+
showDivider: true,
|
|
270
|
+
label: 'Label',
|
|
271
|
+
color: 'primary',
|
|
272
|
+
prependInnerIcon: 'info',
|
|
273
|
+
},
|
|
274
|
+
render: (args) => {
|
|
275
|
+
return {
|
|
276
|
+
components: { SyTextField, VIcon },
|
|
277
|
+
setup() {
|
|
278
|
+
return { args }
|
|
279
|
+
},
|
|
280
|
+
template: `
|
|
281
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
282
|
+
<SyTextField
|
|
283
|
+
v-bind="args"
|
|
284
|
+
:prepend-inner-icon="args.prependInnerIcon"
|
|
285
|
+
:show-divider="args.showDivider"
|
|
286
|
+
/>
|
|
287
|
+
</div>
|
|
288
|
+
`,
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export const SlotAppendInner: Story = {
|
|
294
|
+
parameters: {
|
|
295
|
+
sourceCode: [
|
|
296
|
+
{
|
|
297
|
+
name: 'Template',
|
|
298
|
+
code: `
|
|
299
|
+
<template>
|
|
300
|
+
<SyTextField
|
|
301
|
+
v-model="value"
|
|
302
|
+
append-inner-icon="success"
|
|
303
|
+
/>
|
|
304
|
+
</template>
|
|
305
|
+
`,
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: 'Script',
|
|
309
|
+
code: `
|
|
310
|
+
<script setup lang="ts">
|
|
311
|
+
import SyTextField from '@cnamts/synapse'
|
|
312
|
+
</script>
|
|
313
|
+
`,
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
},
|
|
317
|
+
args: {
|
|
318
|
+
variantStyle: 'outlined',
|
|
319
|
+
isClearable: true,
|
|
320
|
+
showDivider: false,
|
|
321
|
+
label: 'Label',
|
|
322
|
+
color: 'primary',
|
|
323
|
+
appendInnerIcon: 'success',
|
|
324
|
+
},
|
|
325
|
+
render: (args) => {
|
|
326
|
+
return {
|
|
327
|
+
components: { SyTextField, VIcon },
|
|
328
|
+
setup() {
|
|
329
|
+
return { args }
|
|
330
|
+
},
|
|
331
|
+
template: `
|
|
332
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
333
|
+
<SyTextField
|
|
334
|
+
v-bind="args"
|
|
335
|
+
:append-inner-icon="args.appendInnerIcon"
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
`,
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export const SlotCustomIcon: Story = {
|
|
344
|
+
parameters: {
|
|
345
|
+
sourceCode: [
|
|
346
|
+
{
|
|
347
|
+
name: 'Template',
|
|
348
|
+
code: `
|
|
349
|
+
<template>
|
|
350
|
+
<SyTextField v-model="value">
|
|
351
|
+
<template #append-inner>
|
|
352
|
+
<VIcon>
|
|
353
|
+
{{ iconName }}
|
|
354
|
+
</VIcon>
|
|
355
|
+
</template>
|
|
356
|
+
</SyTextField>
|
|
357
|
+
</template>
|
|
358
|
+
`,
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'Script',
|
|
362
|
+
code: `
|
|
363
|
+
<script setup lang="ts">
|
|
364
|
+
import SyTextField from '@cnamts/synapse'
|
|
365
|
+
import { mdiAccountBox } from '@mdi/js'
|
|
366
|
+
|
|
367
|
+
const iconName = mdiAccountBox
|
|
368
|
+
</script>
|
|
369
|
+
`,
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
},
|
|
373
|
+
args: {
|
|
374
|
+
variantStyle: 'outlined',
|
|
375
|
+
isClearable: true,
|
|
376
|
+
showDivider: false,
|
|
377
|
+
label: 'Label',
|
|
378
|
+
color: 'primary',
|
|
379
|
+
},
|
|
380
|
+
render: (args) => {
|
|
381
|
+
return {
|
|
382
|
+
components: { SyTextField, VIcon },
|
|
383
|
+
setup() {
|
|
384
|
+
const iconName = ref(mdiAccountBox)
|
|
385
|
+
|
|
386
|
+
return { args, iconName }
|
|
387
|
+
},
|
|
388
|
+
template: `
|
|
389
|
+
<div class="d-flex flex-wrap align-center pa-4">
|
|
390
|
+
<SyTextField
|
|
391
|
+
v-bind="args"
|
|
392
|
+
>
|
|
393
|
+
<template #append-inner>
|
|
394
|
+
<VIcon>
|
|
395
|
+
{{ iconName }}
|
|
396
|
+
</VIcon>
|
|
397
|
+
</template>
|
|
398
|
+
</SyTextField>
|
|
399
|
+
</div>
|
|
400
|
+
`,
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
}
|