@cnamts/synapse 0.0.5-alpha → 0.0.6-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-system-v3.d.ts +481 -411
- package/dist/design-system-v3.js +2950 -2202
- package/dist/design-system-v3.umd.cjs +6 -6
- package/dist/style.css +1 -1
- package/package.json +17 -17
- package/src/assets/settings.scss +3 -0
- package/src/assets/tokens.scss +16 -16
- package/src/components/BackBtn/AccessibiliteItems.ts +0 -30
- package/src/components/BackBtn/BackBtn.mdx +1 -1
- package/src/components/BackBtn/BackBtn.stories.ts +8 -8
- package/src/components/BackBtn/BackBtn.vue +0 -1
- package/src/components/BackToTopBtn/AccessibiliteItems.ts +0 -30
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +1 -1
- package/src/components/CollapsibleList/Accessibilite.stories.ts +4 -0
- package/src/components/CollapsibleList/AccessibiliteItems.ts +55 -62
- package/src/components/CollapsibleList/CollapsibleList.stories.ts +1 -1
- package/src/components/CookieBanner/Accessibilite.stories.ts +219 -0
- package/src/components/CookieBanner/AccessibiliteItems.ts +356 -0
- package/src/components/CookieBanner/CookieBanner.mdx +219 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +678 -0
- package/src/components/CookieBanner/CookieBanner.vue +225 -0
- package/src/components/CookieBanner/config.ts +38 -0
- package/src/components/CookieBanner/locales.ts +12 -0
- package/src/components/CookieBanner/tests/CookieBanner.spec.ts +129 -0
- package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +197 -0
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +123 -0
- package/src/components/CookiesSelection/CookiesInformation/locales.ts +21 -0
- package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.spec.ts +121 -0
- package/src/components/CookiesSelection/CookiesSelection.vue +127 -0
- package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +47 -0
- package/src/components/CookiesSelection/CookiesTable/headers.ts +14 -0
- package/src/components/CookiesSelection/CookiesTable/tests/CookiesTable.spec.ts +30 -0
- package/src/components/CookiesSelection/CookiesTable/tests/__snapshots__/CookiesTable.spec.ts.snap +3 -0
- package/src/components/CookiesSelection/locales.ts +10 -0
- package/src/components/CookiesSelection/tests/CookiesSelection.spec.ts +184 -0
- package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +192 -0
- package/src/components/CookiesSelection/types.ts +15 -0
- package/src/components/CopyBtn/AccessibiliteItems.ts +0 -30
- package/src/components/CopyBtn/CopyBtn.mdx +1 -1
- package/src/components/CopyBtn/CopyBtn.stories.ts +4 -4
- package/src/components/CopyBtn/CopyBtn.vue +0 -1
- package/src/components/Customs/SyBtnSelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyBtnSelect/Accessibilite.stories.ts +193 -0
- package/src/components/Customs/SyBtnSelect/AccessibiliteItems.ts +139 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +3 -2
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +63 -7
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +21 -13
- package/src/components/Customs/SyBtnSelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyInputSelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyInputSelect/Accessibilite.stories.ts +166 -0
- package/src/components/Customs/SyInputSelect/AccessibiliteItems.ts +96 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +3 -2
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +5 -58
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +36 -4
- package/src/components/Customs/SyInputSelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SySelect/Accessibilite.mdx +14 -0
- package/src/components/Customs/SySelect/Accessibilite.stories.ts +217 -0
- package/src/components/Customs/SySelect/AccessibiliteItems.ts +173 -0
- package/src/components/Customs/SySelect/SySelect.mdx +3 -2
- package/src/components/Customs/SySelect/SySelect.stories.ts +4 -58
- package/src/components/Customs/SySelect/SySelect.vue +35 -8
- package/src/components/Customs/SySelect/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyTextField/Accessibilite.mdx +14 -0
- package/src/components/Customs/SyTextField/Accessibilite.stories.ts +224 -0
- package/src/components/Customs/SyTextField/AccessibiliteItems.ts +198 -0
- package/src/components/Customs/SyTextField/SyTextField.mdx +1 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +118 -7
- package/src/components/Customs/SyTextField/SyTextField.vue +27 -7
- package/src/components/Customs/SyTextField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +2 -1
- package/src/components/DataList/Accessibilite.mdx +14 -0
- package/src/components/DataList/Accessibilite.stories.ts +166 -0
- package/src/components/DataList/AccessibiliteItems.ts +47 -0
- package/src/components/DataList/DataList.mdx +1 -1
- package/src/components/DataList/DataList.stories.ts +10 -10
- package/src/components/DataList/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DataListGroup/Accessibilite.mdx +14 -0
- package/src/components/DataListGroup/Accessibilite.stories.ts +225 -0
- package/src/components/DataListGroup/AccessibiliteItems.ts +79 -0
- package/src/components/DataListGroup/DataListGroup.mdx +1 -1
- package/src/components/DataListGroup/DataListGroup.stories.ts +7 -7
- package/src/components/DataListGroup/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DialogBox/Accessibilite.mdx +14 -0
- package/src/components/DialogBox/Accessibilite.stories.ts +189 -0
- package/src/components/DialogBox/AccessibiliteItems.ts +167 -0
- package/src/components/DialogBox/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DownloadBtn/AccessibiliteItems.ts +1 -31
- package/src/components/DownloadBtn/DownloadBtn.mdx +3 -3
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +6 -6
- package/src/components/ErrorPage/Accessibilite.mdx +14 -0
- package/src/components/ErrorPage/Accessibilite.stories.ts +189 -0
- package/src/components/ErrorPage/AccessibiliteItems.ts +205 -0
- package/src/components/ErrorPage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +4 -4
- package/src/components/FooterBar/Accessibilite.mdx +14 -0
- package/src/components/FooterBar/Accessibilite.stories.ts +223 -0
- package/src/components/FooterBar/AccessibiliteItems.ts +257 -0
- package/src/components/FooterBar/FooterBar.mdx +2 -2
- package/src/components/FooterBar/FooterBar.stories.ts +14 -14
- package/src/components/FooterBar/FooterBar.vue +80 -73
- package/src/components/FooterBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +22 -20
- package/src/components/FranceConnectBtn/AccessibiliteItems.ts +0 -30
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +3 -3
- package/src/components/HeaderBar/Accessibilite.mdx +14 -0
- package/src/components/HeaderBar/Accessibilite.stories.ts +223 -0
- package/src/components/HeaderBar/AccessibiliteItems.ts +194 -0
- package/src/components/HeaderBar/HeaderBar.vue +1 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.mdx +14 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.stories.ts +223 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/AccessibiliteItems.ts +174 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +1 -1
- package/src/components/HeaderLoading/Accessibilite.mdx +14 -0
- package/src/components/HeaderLoading/Accessibilite.stories.ts +167 -0
- package/src/components/HeaderLoading/AccessibiliteItems.ts +29 -0
- package/src/components/HeaderLoading/HeaderLoading.mdx +1 -1
- package/src/components/HeaderLoading/HeaderLoading.stories.ts +1 -1
- package/src/components/HeaderLoading/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +35 -33
- package/src/components/HeaderToolbar/Accessibilite.mdx +14 -0
- package/src/components/HeaderToolbar/Accessibilite.stories.ts +203 -0
- package/src/components/HeaderToolbar/AccessibiliteItems.ts +200 -0
- package/src/components/HeaderToolbar/HeaderToolbar.mdx +1 -1
- package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +2 -2
- package/src/components/HeaderToolbar/HeaderToolbar.vue +1 -0
- package/src/components/HeaderToolbar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/LangBtn/Accessibilite.stories.ts +3 -1
- package/src/components/LangBtn/AccessibiliteItems.ts +0 -31
- package/src/components/LangBtn/LangBtn.mdx +1 -1
- package/src/components/LangBtn/LangBtn.stories.ts +4 -4
- package/src/components/LangBtn/LangBtn.vue +3 -2
- package/src/components/Logo/Accessibilite.mdx +14 -0
- package/src/components/Logo/Accessibilite.stories.ts +223 -0
- package/src/components/Logo/AccessibiliteItems.ts +155 -0
- package/src/components/Logo/Logo.mdx +1 -1
- package/src/components/Logo/Logo.stories.ts +8 -8
- package/src/components/Logo/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/LogoBrandSection/Accessibilite.mdx +14 -0
- package/src/components/LogoBrandSection/Accessibilite.stories.ts +223 -0
- package/src/components/LogoBrandSection/AccessibiliteItems.ts +194 -0
- package/src/components/LogoBrandSection/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/MaintenancePage/Accessibilite.mdx +14 -0
- package/src/components/MaintenancePage/Accessibilite.stories.ts +189 -0
- package/src/components/MaintenancePage/AccessibiliteItems.ts +173 -0
- package/src/components/MaintenancePage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NirField/Accessibilite.mdx +14 -0
- package/src/components/NirField/Accessibilite.stories.ts +214 -0
- package/src/components/NirField/AccessibiliteItems.ts +243 -0
- package/src/components/NirField/NirField.mdx +216 -0
- package/src/components/NirField/NirField.stories.ts +359 -0
- package/src/components/NirField/NirField.vue +450 -0
- package/src/components/NirField/config.ts +16 -0
- package/src/components/NirField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NirField/locales.ts +12 -0
- package/src/components/NirField/nirValidation.ts +42 -0
- package/src/components/NirField/tests/NirField.spec.ts +119 -0
- package/src/components/NotFoundPage/Accessibilite.mdx +14 -0
- package/src/components/NotFoundPage/Accessibilite.stories.ts +190 -0
- package/src/components/NotFoundPage/AccessibiliteItems.ts +205 -0
- package/src/components/NotFoundPage/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +4 -4
- package/src/components/NotificationBar/AccessibiliteItems.ts +0 -30
- package/src/components/NotificationBar/NotificationBar.mdx +1 -1
- package/src/components/PageContainer/PageContainer.mdx +1 -1
- package/src/components/PageContainer/PageContainer.stories.ts +4 -4
- package/src/components/PageContainer/PageContainer.vue +16 -15
- package/src/components/PageContainer/tests/PageContainer.spec.ts +1 -1
- package/src/components/PageContainer/tests/__snapshots__/PageContainer.spec.ts.snap +2 -2
- package/src/components/PhoneField/Accessibilite.mdx +14 -0
- package/src/components/PhoneField/Accessibilite.stories.ts +216 -0
- package/src/components/PhoneField/AccessibiliteItems.ts +238 -0
- package/src/components/PhoneField/PhoneField.mdx +1 -1
- package/src/components/PhoneField/PhoneField.stories.ts +2 -2
- package/src/components/PhoneField/PhoneField.vue +0 -1
- package/src/components/PhoneField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SkipLink/Accessibilite.stories.ts +1 -1
- package/src/components/SkipLink/SkipLink.stories.ts +2 -2
- package/src/components/SocialMediaLinks/Accessibilite.mdx +14 -0
- package/src/components/SocialMediaLinks/Accessibilite.stories.ts +170 -0
- package/src/components/SocialMediaLinks/AccessibiliteItems.ts +160 -0
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +1 -1
- package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +1 -1
- package/src/components/SocialMediaLinks/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SubHeader/Accessibilite.mdx +14 -0
- package/src/components/SubHeader/Accessibilite.stories.ts +166 -0
- package/src/components/SubHeader/AccessibiliteItems.ts +146 -0
- package/src/components/SubHeader/SubHeader.mdx +1 -1
- package/src/components/SubHeader/SubHeader.stories.ts +11 -11
- package/src/components/SubHeader/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SyAlert/Accessibilite.mdx +14 -0
- package/src/components/{Alert → SyAlert}/Accessibilite.stories.ts +1 -1
- package/src/components/{Alert → SyAlert}/AccessibiliteItems.ts +2 -32
- package/src/components/{Alert/Alert.mdx → SyAlert/SyAlert.mdx} +9 -9
- package/src/components/{Alert/Alert.stories.ts → SyAlert/SyAlert.stories.ts} +22 -22
- package/src/components/SyAlert/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/{Alert/tests/Alert.spec.ts → SyAlert/tests/SyAlert.spec.ts} +5 -5
- package/src/components/{Alert/tests/__snapshots__/Alert.spec.ts.snap → SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap} +2 -2
- package/src/components/UserMenuBtn/Accessibilite.mdx +14 -0
- package/src/components/UserMenuBtn/Accessibilite.stories.ts +189 -0
- package/src/components/UserMenuBtn/AccessibiliteItems.ts +155 -0
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +17 -17
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +121 -19
- package/src/components/UserMenuBtn/UserMenuBtn.vue +25 -29
- package/src/components/UserMenuBtn/config.ts +1 -1
- package/src/components/UserMenuBtn/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/index.ts +10 -4
- package/src/composables/rules/tests/useFieldValidation.spec.ts +60 -58
- package/src/composables/rules/useFieldValidation.ts +65 -28
- package/src/main.ts +1 -0
- package/src/stories/GuideDuDev/CommentUtiliserLesRules.mdx +67 -79
- package/src/stories/GuideDuDev/components.stories.ts +5 -5
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
- package/src/stories/Guidelines/Vuetify/Vuetify.mdx +11 -0
- package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +138 -0
- package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +350 -0
- /package/src/components/{Alert → CookieBanner}/Accessibilite.mdx +0 -0
- /package/src/components/{Alert → CookieBanner}/constants/ExpertiseLevelEnum.ts +0 -0
- /package/src/components/{Alert/Alert.vue → SyAlert/SyAlert.vue} +0 -0
- /package/src/components/{Alert → SyAlert}/locales.ts +0 -0
|
@@ -1,60 +1,55 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import SyBtnSelect from '../Customs/SyBtnSelect/SyBtnSelect.vue'
|
|
4
4
|
import { useDisplay } from 'vuetify'
|
|
5
5
|
import { mdiAccount, mdiLoginVariant } from '@mdi/js'
|
|
6
6
|
import useCustomizableOptions, { type CustomizableOptions } from '@/composables/useCustomizableOptions'
|
|
7
7
|
import { defaultOptions } from './config'
|
|
8
8
|
|
|
9
|
+
type MenuItem = { text: string, value: string, link?: string }
|
|
10
|
+
|
|
9
11
|
const props = withDefaults(defineProps<CustomizableOptions & {
|
|
10
|
-
|
|
11
|
-
modelValue: string | Record<string, any> | null | undefined
|
|
12
|
-
menuItems?: { text: string, value: string }[]
|
|
12
|
+
menuItems?: MenuItem[]
|
|
13
13
|
additionalInformation?: string
|
|
14
14
|
fullName?: string
|
|
15
15
|
hideLogoutBtn?: boolean
|
|
16
|
-
logoutIcon?: string
|
|
17
16
|
isMobileView?: boolean
|
|
18
17
|
hideUserIcon?: boolean
|
|
19
18
|
}>(), {
|
|
20
|
-
modelValue: null,
|
|
21
19
|
menuItems: () => [],
|
|
22
20
|
additionalInformation: 'Information supplémentaire',
|
|
23
21
|
fullName: 'Prénom Nom',
|
|
24
22
|
hideLogoutBtn: false,
|
|
25
|
-
logoutIcon: 'mdiLoginVariant',
|
|
26
23
|
isMobileView: false,
|
|
27
24
|
hideUserIcon: false,
|
|
28
25
|
})
|
|
29
26
|
|
|
30
|
-
const
|
|
27
|
+
const modelValue = defineModel<MenuItem | null>({
|
|
28
|
+
default: null,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
defineEmits(['logout'])
|
|
32
|
+
|
|
31
33
|
const { smAndDown } = useDisplay()
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
const options = useCustomizableOptions(defaultOptions, props) as any
|
|
35
|
+
const options = useCustomizableOptions(defaultOptions, props)
|
|
35
36
|
|
|
36
37
|
const isMobileView = computed(() => {
|
|
37
38
|
return props.isMobileView || smAndDown.value
|
|
38
39
|
})
|
|
39
|
-
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
41
|
-
function updateModelValue(value: any) {
|
|
42
|
-
emit('update:modelValue', value)
|
|
43
|
-
}
|
|
44
40
|
</script>
|
|
45
41
|
|
|
46
42
|
<template>
|
|
47
43
|
<SyBtnSelect
|
|
48
|
-
|
|
44
|
+
v-model="modelValue"
|
|
45
|
+
:hide-icon="hideUserIcon"
|
|
49
46
|
:icon-only="isMobileView"
|
|
47
|
+
:is-mobile-view="isMobileView"
|
|
50
48
|
:menu-items="menuItems"
|
|
51
|
-
:model-value="props.modelValue ?? undefined"
|
|
52
49
|
:options="options"
|
|
53
50
|
:primary-info="fullName"
|
|
54
51
|
:secondary-info="additionalInformation"
|
|
55
|
-
:hide-icon="hideUserIcon"
|
|
56
52
|
class="user-menu-btn"
|
|
57
|
-
@update:model-value="updateModelValue"
|
|
58
53
|
>
|
|
59
54
|
<template #append-icon>
|
|
60
55
|
<VIcon
|
|
@@ -88,18 +83,19 @@
|
|
|
88
83
|
</SyBtnSelect>
|
|
89
84
|
</template>
|
|
90
85
|
|
|
91
|
-
<style scoped>
|
|
86
|
+
<style scoped lang="scss">
|
|
92
87
|
@use '@/assets/tokens.scss';
|
|
88
|
+
|
|
93
89
|
.vd-user-icon {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
width: 40px;
|
|
91
|
+
height: 40px;
|
|
92
|
+
background: tokens.$grey-lighten-90;
|
|
93
|
+
border-radius: 50%;
|
|
98
94
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
svg,
|
|
96
|
+
.v-icon__svg {
|
|
97
|
+
width: 24px;
|
|
98
|
+
height: 24px;
|
|
99
|
+
}
|
|
104
100
|
}
|
|
105
101
|
</style>
|
package/src/components/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as SyAlert } from './SyAlert/SyAlert.vue'
|
|
2
2
|
export { default as BackBtn } from './BackBtn/BackBtn.vue'
|
|
3
3
|
export { default as BackToTopBtn } from './BackToTopBtn/BackToTopBtn.vue'
|
|
4
4
|
export { default as CollapsibleList } from './CollapsibleList/CollapsibleList.vue'
|
|
5
5
|
export { default as CopyBtn } from './CopyBtn/CopyBtn.vue'
|
|
6
6
|
export { default as SyBtnSelect } from './Customs/SyBtnSelect/SyBtnSelect.vue'
|
|
7
|
-
export { default as SyInputSelect } from '
|
|
8
|
-
export { default as SySelect } from '
|
|
9
|
-
export { default as SyTextField } from '
|
|
7
|
+
export { default as SyInputSelect } from './Customs/SyInputSelect/SyInputSelect.vue'
|
|
8
|
+
export { default as SySelect } from './Customs/SySelect/SySelect.vue'
|
|
9
|
+
export { default as SyTextField } from './Customs/SyTextField/SyTextField.vue'
|
|
10
10
|
export { default as DataList } from './DataList/DataList.vue'
|
|
11
11
|
export { default as DataListGroup } from './DataListGroup/DataListGroup.vue'
|
|
12
12
|
export { default as DataListItem } from './DataListItem/DataListItem.vue'
|
|
@@ -30,6 +30,8 @@ export { default as Logo } from './Logo/Logo.vue'
|
|
|
30
30
|
export { default as LogoBrandSection } from './LogoBrandSection/LogoBrandSection.vue'
|
|
31
31
|
export { default as MaintenancePage } from './MaintenancePage/MaintenancePage.vue'
|
|
32
32
|
export { default as NotFoundPage } from './NotFoundPage/NotFoundPage.vue'
|
|
33
|
+
export { default as NirField } from './NirField/NirField.vue'
|
|
34
|
+
export * from './NirField/nirValidation'
|
|
33
35
|
export { default as NotificationBar } from './NotificationBar/NotificationBar.vue'
|
|
34
36
|
export * from './NotificationBar/types'
|
|
35
37
|
export { default as PageContainer } from './PageContainer/PageContainer.vue'
|
|
@@ -38,3 +40,7 @@ export { default as SkipLink } from './SkipLink/SkipLink.vue'
|
|
|
38
40
|
export { default as SocialMediaLinks } from './SocialMediaLinks/SocialMediaLinks.vue'
|
|
39
41
|
export { default as SubHeader } from './SubHeader/SubHeader.vue'
|
|
40
42
|
export { default as UserMenuBtn } from './UserMenuBtn/UserMenuBtn.vue'
|
|
43
|
+
export { default as CookieBanner } from './CookieBanner/CookieBanner.vue'
|
|
44
|
+
export { default as CookiesSelection } from './CookiesSelection/CookiesSelection.vue'
|
|
45
|
+
export { default as CookiesInformation } from './CookiesSelection/CookiesInformation/CookiesInformation.vue'
|
|
46
|
+
export { default as CookiesTable } from './CookiesSelection/CookiesTable/CookiesTable.vue'
|
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
import { useFieldValidation } from '../useFieldValidation'
|
|
2
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { useFieldValidation } from '../useFieldValidation'
|
|
3
3
|
|
|
4
4
|
describe('useFieldValidation', () => {
|
|
5
5
|
const { generateRules } = useFieldValidation()
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const requiredRule = rules[0]
|
|
7
|
+
it('should validate required rule', () => {
|
|
8
|
+
const rules = generateRules([{ type: 'required', options: { message: 'This field is required.' } }])
|
|
9
|
+
const rule = rules[0]
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
expect(rule('')).toEqual({ error: 'This field is required.' })
|
|
12
|
+
expect(rule('value')).toEqual({ success: 'Le champ est valide.' })
|
|
13
|
+
})
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
it('should validate min rule', () => {
|
|
16
|
+
const rules = generateRules([{ type: 'min', options: { value: 5, message: 'Value must be at least 5.' } }])
|
|
17
|
+
const rule = rules[0]
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})
|
|
19
|
+
expect(rule(3)).toEqual({ error: 'Value must be at least 5.' })
|
|
20
|
+
expect(rule(5)).toEqual({ success: 'Le champ est valide.' })
|
|
21
|
+
})
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
it('should validate max rule', () => {
|
|
24
|
+
const rules = generateRules([{ type: 'max', options: { value: 10, message: 'Value must be at most 10.' } }])
|
|
25
|
+
const rule = rules[0]
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
expect(rule(15)).toEqual({ error: 'Value must be at most 10.' })
|
|
28
|
+
expect(rule(10)).toEqual({ success: 'Le champ est valide.' })
|
|
29
|
+
})
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
it('should validate minLength rule', () => {
|
|
32
|
+
const rules = generateRules([{ type: 'minLength', options: { length: 5, message: 'Minimum length is 5.' } }])
|
|
33
|
+
const rule = rules[0]
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
35
|
+
expect(rule('1234')).toEqual({ error: 'Minimum length is 5.' })
|
|
36
|
+
expect(rule('12345')).toEqual({ success: 'Le champ est valide.' })
|
|
37
|
+
})
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
it('should validate maxLength rule', () => {
|
|
40
|
+
const rules = generateRules([{ type: 'maxLength', options: { length: 5, message: 'Maximum length is 5.' } }])
|
|
41
|
+
const rule = rules[0]
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
expect(rule('123456')).toEqual({ error: 'Maximum length is 5.' })
|
|
44
|
+
expect(rule('12345')).toEqual({ success: 'Le champ est valide.' })
|
|
45
|
+
})
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
it('should validate exactLength rule', () => {
|
|
48
|
+
const rules = generateRules([{ type: 'exactLength', options: { length: 5, message: 'Length must be exactly 5.' } }])
|
|
49
|
+
const rule = rules[0]
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
expect(rule('1234')).toEqual({ error: 'Length must be exactly 5.' })
|
|
52
|
+
expect(rule('12345')).toEqual({ success: 'Le champ est valide.' })
|
|
53
|
+
})
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
it('should validate email rule', () => {
|
|
56
|
+
const rules = generateRules([{ type: 'email', options: { message: 'Invalid email address.' } }])
|
|
57
|
+
const rule = rules[0]
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
expect(rule('invalid-email')).toEqual({ error: 'Invalid email address.' })
|
|
60
|
+
expect(rule('test@example.com')).toEqual({ success: 'Le champ est valide.' })
|
|
61
|
+
})
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
it('should validate matchPattern rule', () => {
|
|
64
|
+
const rules = generateRules([{
|
|
65
|
+
type: 'matchPattern',
|
|
66
|
+
options: { pattern: /^[a-z]+$/, message: 'Invalid format.' },
|
|
67
|
+
}])
|
|
68
|
+
const rule = rules[0]
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
expect(rule('123')).toEqual({ error: 'Invalid format.' })
|
|
71
|
+
expect(rule('abc')).toEqual({ success: 'Le champ est valide.' })
|
|
72
|
+
})
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
it('should validate custom rule', () => {
|
|
75
|
+
const rules = generateRules([{
|
|
76
|
+
type: 'custom',
|
|
77
|
+
options: { validate: value => value === 'valid', message: 'Custom validation failed.' },
|
|
78
|
+
}])
|
|
79
|
+
const rule = rules[0]
|
|
77
80
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})
|
|
81
|
+
expect(rule('invalid')).toEqual({ error: 'Custom validation failed.' })
|
|
82
|
+
expect(rule('valid')).toEqual({ success: 'Le champ est valide.' })
|
|
81
83
|
})
|
|
82
84
|
})
|
|
@@ -1,50 +1,87 @@
|
|
|
1
1
|
type RuleOptions = {
|
|
2
2
|
fieldName?: string
|
|
3
3
|
message?: string
|
|
4
|
+
successMessage?: string
|
|
4
5
|
length?: number
|
|
5
6
|
value?: number
|
|
6
7
|
pattern?: RegExp
|
|
7
8
|
ignoreSpace?: boolean
|
|
9
|
+
fieldIdentifier?: string
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
11
|
+
validate?: (value: any) => boolean | string
|
|
8
12
|
}
|
|
9
13
|
|
|
14
|
+
type ValidationResult = {
|
|
15
|
+
success?: string
|
|
16
|
+
error?: string
|
|
17
|
+
}
|
|
10
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
11
|
-
type ValidationRule = (value: any) =>
|
|
19
|
+
type ValidationRule = (value: any) => ValidationResult
|
|
12
20
|
|
|
13
21
|
export function useFieldValidation() {
|
|
14
22
|
const createRule = (type: string, options: RuleOptions = {}): ValidationRule => {
|
|
15
23
|
const getValueLength = (value: string) => {
|
|
16
24
|
return options.ignoreSpace ? value.replace(/\s/g, '').length : value.length
|
|
17
25
|
}
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
27
|
+
return (value: any) => {
|
|
28
|
+
if (type !== 'required' && typeof value === 'string' && value.trim() === '') {
|
|
29
|
+
return {}
|
|
30
|
+
}
|
|
31
|
+
switch (type) {
|
|
32
|
+
case 'required':
|
|
33
|
+
return typeof value === 'string' && value.trim()
|
|
34
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
35
|
+
: { error: options.message || `Vous devez renseigner ${options.fieldName || 'ce champ'}.` }
|
|
36
|
+
|
|
37
|
+
case 'min':
|
|
38
|
+
return typeof value === 'number' && value >= (options.value ?? 0)
|
|
39
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
40
|
+
: { error: options.message || `La valeur doit être supérieure ou égale à ${options.value}.` }
|
|
41
|
+
|
|
42
|
+
case 'minLength':
|
|
43
|
+
return typeof value === 'string' && getValueLength(value) >= (options.length ?? 0)
|
|
44
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
45
|
+
: { error: options.message || `Ce champ doit avoir au moins ${options.length} caractères.` }
|
|
46
|
+
|
|
47
|
+
case 'max':
|
|
48
|
+
return typeof value === 'number' && value <= (options.value ?? Infinity)
|
|
49
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
50
|
+
: { error: options.message || `La valeur doit être inférieure ou égale à ${options.value}.` }
|
|
51
|
+
|
|
52
|
+
case 'maxLength':
|
|
53
|
+
return typeof value === 'string' && getValueLength(value) <= (options.length ?? Infinity)
|
|
54
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
55
|
+
: { error: options.message || `Ce champ ne doit pas dépasser ${options.length} caractères.` }
|
|
18
56
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
default:
|
|
45
|
-
return () => `La règle spécifiée n'existe pas.`
|
|
57
|
+
case 'exactLength':
|
|
58
|
+
return typeof value === 'string' && getValueLength(value) === (options.length ?? 0)
|
|
59
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
60
|
+
: { error: options.message || `Ce champ doit avoir exactement ${options.length} caractères.` }
|
|
61
|
+
|
|
62
|
+
case 'email':
|
|
63
|
+
return typeof value === 'string' && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)
|
|
64
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
65
|
+
: { error: options.message || `Veuillez entrer un email valide.` }
|
|
66
|
+
|
|
67
|
+
case 'matchPattern':
|
|
68
|
+
return typeof value === 'string' && options.pattern?.test(value)
|
|
69
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
70
|
+
: { error: options.message || `Format invalide.` }
|
|
71
|
+
|
|
72
|
+
case 'custom': {
|
|
73
|
+
const result = options.validate?.(value)
|
|
74
|
+
return result === true
|
|
75
|
+
? { success: options.successMessage || 'Le champ est valide.' }
|
|
76
|
+
: { error: typeof result === 'string' ? result : options.message || `Validation échouée.` }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
default:
|
|
80
|
+
return { error: `La règle spécifiée n'existe pas.` }
|
|
81
|
+
}
|
|
46
82
|
}
|
|
47
83
|
}
|
|
84
|
+
|
|
48
85
|
const generateRules = (fieldRules: Array<{ type: string, options?: RuleOptions }>) => {
|
|
49
86
|
return fieldRules.map(rule => createRule(rule.type, rule.options))
|
|
50
87
|
}
|
package/src/main.ts
CHANGED
|
@@ -18,16 +18,29 @@ Le composable `useFieldValidation` vous permet de définir des règles de valida
|
|
|
18
18
|
|
|
19
19
|
### Type `RuleOptions`
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
<Source dark code={`
|
|
22
22
|
type RuleOptions = {
|
|
23
|
-
fieldName?: string; // Nom du champ utilisé dans les messages d'erreur
|
|
24
|
-
message?: string; // Message personnalisé pour la règle
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
fieldName?: string; // Nom du champ utilisé dans les messages d'erreur
|
|
24
|
+
message?: string; // Message personnalisé pour la règle
|
|
25
|
+
successMessage?: string; // Message personnalisé de validation réussie
|
|
26
|
+
length?: number; // Longueur minimale ou maximale
|
|
27
|
+
value?: number; // Valeur minimale ou maximale
|
|
28
|
+
pattern?: RegExp; // Motif à valider
|
|
29
|
+
ignoreSpace?: boolean; // Ignorer les espaces lors de la validation de longueur
|
|
30
|
+
validate?: (value: any) => boolean | string; // Validation personnalisée
|
|
29
31
|
};
|
|
30
|
-
`}
|
|
32
|
+
`}
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
### Type `ValidationResult`
|
|
36
|
+
|
|
37
|
+
<Source dark code={`
|
|
38
|
+
type ValidationResult = {
|
|
39
|
+
success?: string; // Message de validation réussie
|
|
40
|
+
error?: string; // Message d'erreur
|
|
41
|
+
};
|
|
42
|
+
`}
|
|
43
|
+
/>
|
|
31
44
|
|
|
32
45
|
---
|
|
33
46
|
|
|
@@ -35,98 +48,73 @@ ignoreSpace?: boolean; // Ignorer les espaces lors de la validation de longueur
|
|
|
35
48
|
|
|
36
49
|
### Script Vue.js
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
<Source dark code={`
|
|
39
52
|
<script lang="ts" setup>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{type: 'required', options: {message: 'Ce champ est requis.'}},
|
|
52
|
-
{type: 'minLength', options: {length: 3, ignoreSpace: true}},
|
|
53
|
-
{type: 'maxLength', options: {length: 20}},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{type: 'required', options: {fieldName: 'Email'}},
|
|
57
|
-
{type: 'email'},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{type: 'min', options: {value: 18}},
|
|
61
|
-
{type: 'max', options: {value: 99}},
|
|
62
|
-
|
|
53
|
+
import { ref } from 'vue';
|
|
54
|
+
import { useFieldValidation } from '@cnamts/synapse';
|
|
55
|
+
|
|
56
|
+
const { generateRules } = useFieldValidation();
|
|
57
|
+
|
|
58
|
+
const firstName = ref('');
|
|
59
|
+
const email = ref('');
|
|
60
|
+
const age = ref('');
|
|
61
|
+
|
|
62
|
+
const rules = {
|
|
63
|
+
firstName: generateRules([
|
|
64
|
+
{ type: 'required', options: { message: 'Ce champ est requis.' } },
|
|
65
|
+
{ type: 'minLength', options: { length: 3, ignoreSpace: true } },
|
|
66
|
+
{ type: 'maxLength', options: { length: 20 } },
|
|
67
|
+
]),
|
|
68
|
+
email: generateRules([
|
|
69
|
+
{ type: 'required', options: { fieldName: 'Email' } },
|
|
70
|
+
{ type: 'email' },
|
|
71
|
+
]),
|
|
72
|
+
age: generateRules([
|
|
73
|
+
{ type: 'min', options: { value: 18 } },
|
|
74
|
+
{ type: 'max', options: { value: 99 } },
|
|
75
|
+
]),
|
|
63
76
|
};
|
|
64
77
|
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
const validateField = (field: string) => {
|
|
79
|
+
return rules[field].every((rule) => rule(field));
|
|
67
80
|
};
|
|
68
81
|
|
|
69
|
-
|
|
70
|
-
|
|
82
|
+
const handleSubmit = () => {
|
|
83
|
+
if (validateField('firstName') && validateField('email') && validateField('age')) {
|
|
71
84
|
alert('Formulaire valide.');
|
|
72
|
-
} else {
|
|
85
|
+
} else {
|
|
73
86
|
alert('Merci de vérifier les champs.');
|
|
74
|
-
}
|
|
87
|
+
}
|
|
75
88
|
};
|
|
76
89
|
</script>
|
|
77
|
-
`}
|
|
78
|
-
|
|
90
|
+
`}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
Vous pouvez retrouver un exemple complet sur le [NirField](/docs/composants-formulaires-nirfield--docs).
|
|
79
94
|
|
|
80
|
-
### Template Vue.js
|
|
81
|
-
|
|
82
|
-
<Source dark code={`
|
|
83
|
-
<template>
|
|
84
|
-
<v-form
|
|
85
|
-
@submit.prevent="handleSubmit">
|
|
86
|
-
<v-text-field
|
|
87
|
-
v-model="firstName"
|
|
88
|
-
:rules="rules.firstName"
|
|
89
|
-
label="Prénom"
|
|
90
|
-
@blur="validateField('firstName')"
|
|
91
|
-
/>
|
|
92
|
-
<v-text-field
|
|
93
|
-
v-model="email"
|
|
94
|
-
:rules="rules.email"
|
|
95
|
-
label="Email"
|
|
96
|
-
@blur="validateField('email')"
|
|
97
|
-
/>
|
|
98
|
-
<v-text-field
|
|
99
|
-
v-model="age"
|
|
100
|
-
:rules="rules.age"
|
|
101
|
-
label="Âge"
|
|
102
|
-
@blur="validateField('age')"
|
|
103
|
-
/>
|
|
104
|
-
<v-btn block class="mt-2" type="submit">Soumettre</v-btn>
|
|
105
|
-
</v-form>
|
|
106
|
-
</template>
|
|
107
|
-
`} />
|
|
108
95
|
---
|
|
109
96
|
|
|
110
97
|
## Fonctionnalités supportées
|
|
111
98
|
|
|
112
|
-
- **Validation requise** (`required`)
|
|
113
|
-
- **Longueur minimale** (`minLength`)
|
|
114
|
-
- **Longueur maximale** (`maxLength`)
|
|
115
|
-
- **Valeur minimale** (`min`)
|
|
116
|
-
- **Valeur maximale** (`max`)
|
|
117
|
-
- **Validation par motif** (`matchPattern`)
|
|
118
|
-
- **Validation d'email** (`email`)
|
|
99
|
+
- **Validation requise** (`required`) : Assurez-vous qu'un champ est rempli.
|
|
100
|
+
- **Longueur minimale** (`minLength`) : Validez un champ avec un nombre minimal de caractères.
|
|
101
|
+
- **Longueur maximale** (`maxLength`) : Limitez un champ à un nombre maximal de caractères.
|
|
102
|
+
- **Valeur minimale** (`min`) : Assurez-vous que la valeur est au moins égale à une valeur définie.
|
|
103
|
+
- **Valeur maximale** (`max`) : Assurez-vous que la valeur ne dépasse pas une valeur définie.
|
|
104
|
+
- **Validation par motif** (`matchPattern`) : Validez un champ à l'aide d'une expression régulière.
|
|
105
|
+
- **Validation d'email** (`email`) : Assurez-vous que la valeur est une adresse email valide.
|
|
106
|
+
- **Validation personnalisée** (`custom`) : Implémentez des règles spécifiques via une fonction.
|
|
119
107
|
|
|
120
108
|
---
|
|
121
109
|
|
|
122
110
|
## Bonnes pratiques
|
|
123
111
|
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
- Documenter les règles complexes pour aider votre équipe à comprendre leur fonctionnement.
|
|
112
|
+
- **Centralisation** : Centralisez la logique de validation pour garantir une maintenance facile.
|
|
113
|
+
- **Accessibilité** : Vérifiez que les messages d'erreur sont clairs et concis pour tous les utilisateurs.
|
|
127
114
|
|
|
128
115
|
---
|
|
129
116
|
|
|
130
117
|
## Conclusion
|
|
131
118
|
|
|
132
|
-
Avec `useFieldValidation`, vous disposez d'un
|
|
119
|
+
Avec `useFieldValidation`, vous disposez d'un outil pour gérer les validations de vos formulaires dans Vue.js. Ce composable est idéal pour créer des validations personnalisées et intégrer des champs avec des bibliothèques comme Vuetify.
|
|
120
|
+
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import SyAlert from '@/components/SyAlert/SyAlert.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Guide Du Dev/Rapport de bug',
|
|
5
|
-
component:
|
|
5
|
+
component: SyAlert,
|
|
6
6
|
}
|
|
7
7
|
export const Info = {
|
|
8
8
|
render: () => {
|
|
9
9
|
return {
|
|
10
|
-
components: {
|
|
10
|
+
components: { SyAlert },
|
|
11
11
|
setup() {
|
|
12
12
|
return { }
|
|
13
13
|
},
|
|
14
14
|
template: `
|
|
15
|
-
<
|
|
15
|
+
<SyAlert type="info" variant="tonal" :closable="false">
|
|
16
16
|
<template #default>Lorsque vous créez une reproduction minimale, supprimez tous les éléments, propriétés, variables, données et autres qui ne sont pas nécessaires pour reproduire le bug. Cela facilitera le traitement du rapport et le temps qu’il faudra pour identifier puis résoudre le bug.
|
|
17
17
|
</template>
|
|
18
|
-
</
|
|
18
|
+
</SyAlert>
|
|
19
19
|
`,
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -122,7 +122,7 @@ Utilisation dans un composant Vue
|
|
|
122
122
|
<Source dark code={`
|
|
123
123
|
<script setup lang="ts">
|
|
124
124
|
import { VBtn } from 'vuetify/components'
|
|
125
|
-
import NotificationBar from '@cnamts/synapse'
|
|
125
|
+
import { NotificationBar } from '@cnamts/synapse'
|
|
126
126
|
import { useNotificationService } from '@cnamts/synapse/src/services/NotificationService'
|
|
127
127
|
import type { Notification } from '@cnamts/synapse/src/components/NotificationBar/types'
|
|
128
128
|
|