@cnamts/synapse 0.0.14-alpha → 0.0.15-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/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -2
- package/dist/components/Customs/SySelect/SySelect.d.ts +24 -12
- package/dist/components/Customs/SySelect/locales.d.ts +3 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +2 -2
- package/dist/components/DatePicker/DatePicker.d.ts +732 -16
- package/dist/components/DatePicker/DateTextInput.d.ts +8 -8
- package/dist/components/DialogBox/config.d.ts +1 -1
- package/dist/components/DownloadBtn/DownloadBtn.d.ts +2 -0
- package/dist/components/LangBtn/LangBtn.d.ts +467 -1
- package/dist/components/LangBtn/config.d.ts +1 -3
- package/dist/components/NirField/NirField.d.ts +13 -13
- package/dist/components/PasswordField/PasswordField.d.ts +2 -2
- package/dist/components/PeriodField/PeriodField.d.ts +1462 -30
- package/dist/components/PhoneField/PhoneField.d.ts +3 -3
- package/dist/components/SelectBtnField/SelectBtnField.d.ts +1 -1
- package/dist/components/SkipLink/SkipLink.d.ts +3 -2
- package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/design-system-v3.js +3038 -2936
- package/dist/design-system-v3.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/dist/vuetifyConfig.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/BackBtn/Accessibilite.stories.ts +4 -0
- package/src/components/BackBtn/BackBtn.vue +2 -1
- package/src/components/BackToTopBtn/Accessibilite.stories.ts +4 -0
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +78 -21
- package/src/components/BackToTopBtn/BackToTopBtn.vue +15 -0
- package/src/components/BackToTopBtn/config.ts +2 -2
- package/src/components/BackToTopBtn/tests/__snapshots__/BackToTopBtn.spec.ts.snap +4 -4
- package/src/components/CopyBtn/Accessibilite.stories.ts +4 -0
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +2 -2
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +0 -1
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +3 -3
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +4 -4
- package/src/components/Customs/SySelect/SySelect.stories.ts +4 -0
- package/src/components/Customs/SySelect/SySelect.vue +75 -10
- package/src/components/Customs/SySelect/locales.ts +3 -0
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +24 -2
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +1 -1
- package/src/components/Customs/SyTextField/SyTextField.vue +3 -3
- package/src/components/DatePicker/DatePicker.vue +82 -57
- package/src/components/DatePicker/DatePickerValidation.mdx +338 -0
- package/src/components/DatePicker/DatePickerValidation.stories.ts +22 -0
- package/src/components/DatePicker/DatePickerValidationExamples.vue +535 -0
- package/src/components/DatePicker/DateTextInput.vue +3 -3
- package/src/components/DatePicker/tests/DateTextInput.spec.ts +2 -2
- package/src/components/DialogBox/DialogBox.stories.ts +5 -2
- package/src/components/DialogBox/DialogBox.vue +1 -1
- package/src/components/DialogBox/config.ts +1 -1
- package/src/components/DownloadBtn/Accessibilite.stories.ts +4 -0
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +17 -8
- package/src/components/DownloadBtn/DownloadBtn.vue +13 -6
- package/src/components/DownloadBtn/tests/__snapshots__/DownloadBtn.spec.ts.snap +0 -2
- package/src/components/FranceConnectBtn/Accessibilite.stories.ts +4 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +3 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +3 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +19 -0
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +12 -2
- package/src/components/LangBtn/Accessibilite.stories.ts +4 -0
- package/src/components/LangBtn/LangBtn.stories.ts +1 -4
- package/src/components/LangBtn/LangBtn.vue +68 -9
- package/src/components/LangBtn/config.ts +0 -1
- package/src/components/LangBtn/tests/LangBtn.spec.ts +30 -2
- package/src/components/PageContainer/Accessibilite.stories.ts +36 -23
- package/src/components/PaginatedTable/PaginatedTable.stories.ts +144 -18
- package/src/components/PasswordField/PasswordField.stories.ts +6 -6
- package/src/components/PasswordField/PasswordField.vue +3 -3
- package/src/components/PeriodField/PeriodField.vue +4 -4
- package/src/components/PhoneField/PhoneField.stories.ts +216 -24
- package/src/components/PhoneField/PhoneField.vue +32 -2
- package/src/components/PhoneField/tests/PhoneField.spec.ts +161 -14
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +2 -1
- package/src/components/RatingPicker/RatingPicker.stories.ts +1 -1
- package/src/components/SkipLink/Accessibilite.stories.ts +8 -0
- package/src/components/SkipLink/SkipLink.vue +11 -9
- package/src/components/SkipLink/tests/__snapshots__/skipLink.spec.ts.snap +7 -4
- package/src/components/SkipLink/tests/skipLink.spec.ts +120 -6
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +56 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +4 -2
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +41 -0
- package/src/components/index.ts +1 -0
- package/src/composables/rules/useFieldValidation.ts +26 -3
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +1 -1
- package/src/stories/GuideDuDev/LesBreackingChanges.mdx +31 -2
- package/src/components/LangBtn/tests/Config.spec.ts +0 -24
|
@@ -159,6 +159,14 @@ export const Legende: StoryObj = {
|
|
|
159
159
|
Problèmes relevés par Tanaguru
|
|
160
160
|
</div>
|
|
161
161
|
</div>
|
|
162
|
+
<div class="mt-4">
|
|
163
|
+
<p>Rapport d’audit manuel : <a href="/audits/SkipLink.xlsx" style="color:#0C41BD;">Voir le
|
|
164
|
+
rapport</a></p>
|
|
165
|
+
<p style="color: grey; font-size: 14px">Correctifs associés (<a
|
|
166
|
+
href="https://github.com/assurance-maladie-digital/design-system/issues/4012" target="_blank"
|
|
167
|
+
style="color:#0C41BD;"
|
|
168
|
+
>issue #4012</a>)</p>
|
|
169
|
+
</div>
|
|
162
170
|
</div>
|
|
163
171
|
`,
|
|
164
172
|
}
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
if (fail) return
|
|
40
40
|
if (to.path === from.path) return
|
|
41
41
|
nextTick(() => {
|
|
42
|
-
|
|
42
|
+
const link = document.querySelector('a.sy-skip-link') as HTMLAnchorElement
|
|
43
|
+
if (link) link.focus()
|
|
43
44
|
})
|
|
44
45
|
})
|
|
45
46
|
}
|
|
@@ -47,25 +48,26 @@
|
|
|
47
48
|
</script>
|
|
48
49
|
|
|
49
50
|
<template>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/>
|
|
51
|
+
<nav
|
|
52
|
+
aria-label="Liens d'évitement"
|
|
53
|
+
class="sy-skip-link-container"
|
|
54
|
+
>
|
|
55
|
+
<div ref="skipLinkSpan" />
|
|
55
56
|
|
|
56
57
|
<a
|
|
58
|
+
ref="skipLink"
|
|
57
59
|
:href="target"
|
|
58
|
-
class="
|
|
60
|
+
class="sy-skip-link text-primary d-block d-sr-only-focusable px-2"
|
|
59
61
|
>
|
|
60
62
|
<slot>{{ label }}</slot>
|
|
61
63
|
</a>
|
|
62
|
-
</
|
|
64
|
+
</nav>
|
|
63
65
|
</template>
|
|
64
66
|
|
|
65
67
|
<style lang="scss" scoped>
|
|
66
68
|
@use '/src/assets/tokens';
|
|
67
69
|
|
|
68
|
-
.
|
|
70
|
+
.sy-skip-link {
|
|
69
71
|
z-index: 150;
|
|
70
72
|
position: fixed;
|
|
71
73
|
top: 0;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`SkipLink > renders correctly 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
4
|
+
<nav
|
|
5
|
+
aria-label="Liens d'évitement"
|
|
6
|
+
class="sy-skip-link-container"
|
|
7
|
+
>
|
|
8
|
+
<div></div>
|
|
6
9
|
<a
|
|
7
10
|
class="
|
|
8
11
|
d-block
|
|
9
12
|
d-sr-only-focusable
|
|
10
13
|
px-2
|
|
14
|
+
sy-skip-link
|
|
11
15
|
text-primary
|
|
12
|
-
vd-skip-link
|
|
13
16
|
"
|
|
14
17
|
href="#main"
|
|
15
18
|
>Aller au contenu principal</a>
|
|
16
|
-
</
|
|
19
|
+
</nav>
|
|
17
20
|
`;
|
|
@@ -2,6 +2,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest'
|
|
|
2
2
|
import { mount } from '@vue/test-utils'
|
|
3
3
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
4
4
|
import SkipLink from '../SkipLink.vue'
|
|
5
|
+
import { locales } from '../locales'
|
|
5
6
|
|
|
6
7
|
// Create a mock router
|
|
7
8
|
const router = createRouter({
|
|
@@ -28,19 +29,132 @@ describe('SkipLink', () => {
|
|
|
28
29
|
})
|
|
29
30
|
|
|
30
31
|
it('focuses the skip link on route change', async () => {
|
|
31
|
-
|
|
32
|
+
// Monter le composant
|
|
33
|
+
mount(SkipLink, {
|
|
32
34
|
global: {
|
|
33
35
|
plugins: [router],
|
|
34
36
|
},
|
|
35
37
|
})
|
|
36
38
|
|
|
37
|
-
//
|
|
38
|
-
const
|
|
39
|
+
// Espionner querySelector et focus
|
|
40
|
+
const linkElement = document.createElement('a')
|
|
41
|
+
const focusSpy = vi.spyOn(linkElement, 'focus')
|
|
42
|
+
vi.spyOn(document, 'querySelector').mockImplementation(() => linkElement)
|
|
39
43
|
|
|
40
|
-
//
|
|
44
|
+
// Déclencher le changement de route
|
|
41
45
|
await router.push('/about')
|
|
42
|
-
await router.isReady()
|
|
46
|
+
await router.isReady()
|
|
47
|
+
await new Promise(resolve => setTimeout(resolve, 0))
|
|
48
|
+
|
|
49
|
+
expect(focusSpy).toHaveBeenCalled()
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('accepte des props personnalisées', () => {
|
|
53
|
+
const customLabel = 'Accéder au contenu'
|
|
54
|
+
const customTarget = '#content'
|
|
55
|
+
|
|
56
|
+
const wrapper = mount(SkipLink, {
|
|
57
|
+
props: {
|
|
58
|
+
label: customLabel,
|
|
59
|
+
target: customTarget,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const link = wrapper.find('a.sy-skip-link')
|
|
64
|
+
expect(link.text()).toBe(customLabel)
|
|
65
|
+
expect(link.attributes('href')).toBe(customTarget)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('utilise les valeurs par défaut', () => {
|
|
69
|
+
const wrapper = mount(SkipLink)
|
|
70
|
+
|
|
71
|
+
const link = wrapper.find('a.sy-skip-link')
|
|
72
|
+
expect(link.text()).toBe(locales.label)
|
|
73
|
+
expect(link.attributes('href')).toBe('#main')
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('contient les attributs d\'accessibilité corrects', () => {
|
|
77
|
+
const wrapper = mount(SkipLink)
|
|
78
|
+
|
|
79
|
+
expect(wrapper.find('nav').attributes('aria-label')).toBe('Liens d\'évitement')
|
|
80
|
+
expect(wrapper.find('a.sy-skip-link').exists()).toBe(true)
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it('ne déplace pas le focus si la navigation échoue', async () => {
|
|
84
|
+
// Mock du router avec un hook afterEach qui simule un échec
|
|
85
|
+
const mockRouter = {
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
87
|
+
afterEach: (callback: any) => {
|
|
88
|
+
// Simuler un appel avec fail=true
|
|
89
|
+
callback(
|
|
90
|
+
{ path: '/new-path' },
|
|
91
|
+
{ path: '/' },
|
|
92
|
+
true, // fail=true
|
|
93
|
+
)
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Espionner querySelector et focus
|
|
98
|
+
const linkElement = document.createElement('a')
|
|
99
|
+
const focusSpy = vi.spyOn(linkElement, 'focus')
|
|
100
|
+
vi.spyOn(document, 'querySelector').mockImplementation(() => linkElement)
|
|
101
|
+
|
|
102
|
+
// Mock de getCurrentInstance pour injecter notre router
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
104
|
+
vi.spyOn(require('vue'), 'getCurrentInstance').mockReturnValue({
|
|
105
|
+
appContext: {
|
|
106
|
+
app: {
|
|
107
|
+
config: {
|
|
108
|
+
globalProperties: {
|
|
109
|
+
$router: mockRouter,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
mount(SkipLink)
|
|
117
|
+
await new Promise(resolve => setTimeout(resolve, 0))
|
|
118
|
+
|
|
119
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('ne déplace pas le focus si le chemin reste identique', async () => {
|
|
123
|
+
// Mock du router avec un hook afterEach où to.path = from.path
|
|
124
|
+
const mockRouter = {
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
126
|
+
afterEach: (callback: any) => {
|
|
127
|
+
// Simuler un appel avec les mêmes chemins
|
|
128
|
+
callback(
|
|
129
|
+
{ path: '/same-path' },
|
|
130
|
+
{ path: '/same-path' },
|
|
131
|
+
false,
|
|
132
|
+
)
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Espionner querySelector et focus
|
|
137
|
+
const linkElement = document.createElement('a')
|
|
138
|
+
const focusSpy = vi.spyOn(linkElement, 'focus')
|
|
139
|
+
vi.spyOn(document, 'querySelector').mockImplementation(() => linkElement)
|
|
140
|
+
|
|
141
|
+
// Mock de getCurrentInstance
|
|
142
|
+
/* eslint-disable */
|
|
143
|
+
vi.spyOn(require('vue'), 'getCurrentInstance').mockReturnValue({
|
|
144
|
+
appContext: {
|
|
145
|
+
app: {
|
|
146
|
+
config: {
|
|
147
|
+
globalProperties: {
|
|
148
|
+
$router: mockRouter,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
mount(SkipLink)
|
|
156
|
+
await new Promise(resolve => setTimeout(resolve, 0))
|
|
43
157
|
|
|
44
|
-
expect(
|
|
158
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
45
159
|
})
|
|
46
160
|
})
|
|
@@ -44,6 +44,13 @@ const meta = {
|
|
|
44
44
|
type: { summary: 'string' },
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
|
+
'logoutText': {
|
|
48
|
+
control: 'text',
|
|
49
|
+
description: 'Texte dans le bouton de déconnexion',
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: 'string' },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
47
54
|
'additionalInformation': {
|
|
48
55
|
control: 'text',
|
|
49
56
|
description: 'Informations supplémentaires sur l\'utilisateur (ex: rôle, service, etc.)',
|
|
@@ -376,6 +383,55 @@ export const CustomFullName: Story = {
|
|
|
376
383
|
},
|
|
377
384
|
}
|
|
378
385
|
|
|
386
|
+
export const CustomLogoutText: Story = {
|
|
387
|
+
parameters: {
|
|
388
|
+
sourceCode: [
|
|
389
|
+
{
|
|
390
|
+
name: 'Template',
|
|
391
|
+
code: `<template>
|
|
392
|
+
<UserMenuBtn
|
|
393
|
+
v-model="selected"
|
|
394
|
+
:menu-items="menuItems"
|
|
395
|
+
:logout-text="Déconnexion"
|
|
396
|
+
/>
|
|
397
|
+
</template>`,
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: 'Script',
|
|
401
|
+
code: `<script setup lang="ts">
|
|
402
|
+
import { ref } from 'vue'
|
|
403
|
+
import { UserMenuBtn } from '@cnamts/synapse'
|
|
404
|
+
|
|
405
|
+
const selected = ref(null)
|
|
406
|
+
const menuItems = ref([
|
|
407
|
+
{ text: 'Administration', value: 'Administration' },
|
|
408
|
+
{ text: 'Profil', value: 'Profil' },
|
|
409
|
+
{ text: 'Paramètres', value: 'Paramètres' },
|
|
410
|
+
])
|
|
411
|
+
|
|
412
|
+
const logoutText = ref('Déconnexion')
|
|
413
|
+
</script>`,
|
|
414
|
+
},
|
|
415
|
+
],
|
|
416
|
+
},
|
|
417
|
+
args: {
|
|
418
|
+
...Default.args,
|
|
419
|
+
logoutText: 'Déconnexion',
|
|
420
|
+
},
|
|
421
|
+
render: (args) => {
|
|
422
|
+
return {
|
|
423
|
+
components: { UserMenuBtn },
|
|
424
|
+
setup() {
|
|
425
|
+
return { args }
|
|
426
|
+
},
|
|
427
|
+
template: `
|
|
428
|
+
<div class="pa-4">
|
|
429
|
+
<UserMenuBtn v-bind="args"/>
|
|
430
|
+
</div>`,
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
}
|
|
434
|
+
|
|
379
435
|
export const CustomAdditionalInformation: Story = {
|
|
380
436
|
parameters: {
|
|
381
437
|
sourceCode: [
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
hideLogoutBtn?: boolean
|
|
16
16
|
isMobileView?: boolean
|
|
17
17
|
hideUserIcon?: boolean
|
|
18
|
+
logoutText?: string
|
|
18
19
|
}>(), {
|
|
19
20
|
menuItems: () => [],
|
|
20
21
|
additionalInformation: 'Information supplémentaire',
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
hideLogoutBtn: false,
|
|
23
24
|
isMobileView: false,
|
|
24
25
|
hideUserIcon: false,
|
|
26
|
+
logoutText: 'Logout',
|
|
25
27
|
})
|
|
26
28
|
|
|
27
29
|
const modelValue = defineModel<MenuItem | null>({
|
|
@@ -74,8 +76,8 @@
|
|
|
74
76
|
class="mr-4"
|
|
75
77
|
v-bind="options['logoutIcon']"
|
|
76
78
|
/>
|
|
77
|
-
<VListItemTitle>
|
|
78
|
-
|
|
79
|
+
<VListItemTitle class="logout">
|
|
80
|
+
{{ props.logoutText }}
|
|
79
81
|
</VListItemTitle>
|
|
80
82
|
</div>
|
|
81
83
|
</VListItem>
|
|
@@ -122,4 +122,45 @@ describe('UserMenuBtn', () => {
|
|
|
122
122
|
expect(wrapper.emitted('update:modelValue')).toBeTruthy()
|
|
123
123
|
expect(wrapper.emitted('update:modelValue')![0]).toEqual(['test-value'])
|
|
124
124
|
})
|
|
125
|
+
|
|
126
|
+
it('possède la prop logoutText custom', async () => {
|
|
127
|
+
const customLogoutText = 'Déconnexion'
|
|
128
|
+
const wrapper = mount(UserMenuBtn, {
|
|
129
|
+
global: {
|
|
130
|
+
plugins: [vuetify],
|
|
131
|
+
},
|
|
132
|
+
props: {
|
|
133
|
+
modelValue: null,
|
|
134
|
+
logoutText: customLogoutText,
|
|
135
|
+
hideLogoutBtn: false,
|
|
136
|
+
menuItems: [{ text: 'Item 1', value: 'item1' }],
|
|
137
|
+
fullName: 'John Doe',
|
|
138
|
+
isMobileView: false,
|
|
139
|
+
hideUserIcon: false,
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
// Vérifier directement que la prop est correctement passée au composant
|
|
144
|
+
expect(wrapper.props('logoutText')).toBe(customLogoutText)
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it('possède la prop logoutText par défaut', async () => {
|
|
148
|
+
const defaultLogoutText = 'Logout'
|
|
149
|
+
const wrapper = mount(UserMenuBtn, {
|
|
150
|
+
global: {
|
|
151
|
+
plugins: [vuetify],
|
|
152
|
+
},
|
|
153
|
+
props: {
|
|
154
|
+
modelValue: null,
|
|
155
|
+
hideLogoutBtn: false,
|
|
156
|
+
menuItems: [{ text: 'Item 1', value: 'item1' }],
|
|
157
|
+
fullName: 'John Doe',
|
|
158
|
+
isMobileView: false,
|
|
159
|
+
hideUserIcon: false,
|
|
160
|
+
},
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
// Vérifier directement que la prop est correctement passée au composant
|
|
164
|
+
expect(wrapper.props('logoutText')).toBe(defaultLogoutText)
|
|
165
|
+
})
|
|
125
166
|
})
|
package/src/components/index.ts
CHANGED
|
@@ -42,6 +42,7 @@ export { default as HeaderMenuBtn } from './HeaderBar/HeaderMenuBtn/HeaderMenuBt
|
|
|
42
42
|
export { default as HeaderLoading } from './HeaderLoading/HeaderLoading.vue'
|
|
43
43
|
export { default as HeaderNavigationBar } from './HeaderNavigationBar/HeaderNavigationBar.vue'
|
|
44
44
|
export { default as HeaderToolbar } from './HeaderToolbar/HeaderToolbar.vue'
|
|
45
|
+
export { indicatifs } from './PhoneField/indicatifs'
|
|
45
46
|
export { default as LangBtn } from './LangBtn/LangBtn.vue'
|
|
46
47
|
export { default as Logo } from './Logo/Logo.vue'
|
|
47
48
|
export { default as LogoBrandSection } from './LogoBrandSection/LogoBrandSection.vue'
|
|
@@ -177,16 +177,30 @@ export function useFieldValidation() {
|
|
|
177
177
|
|
|
178
178
|
case 'notBeforeToday': {
|
|
179
179
|
const dateValue = new Date(value)
|
|
180
|
+
// Réinitialiser l'heure à minuit pour ne comparer que les dates
|
|
181
|
+
dateValue.setHours(0, 0, 0, 0)
|
|
182
|
+
|
|
183
|
+
// Créer une date aujourd'hui à minuit pour comparaison
|
|
184
|
+
const today = new Date()
|
|
185
|
+
today.setHours(0, 0, 0, 0)
|
|
186
|
+
|
|
180
187
|
return createValidationResult(
|
|
181
|
-
dateValue >=
|
|
188
|
+
dateValue >= today,
|
|
182
189
|
options.message || options.warningMessage || `${identifier} ne peut pas être antérieur à aujourd'hui.`,
|
|
183
190
|
)
|
|
184
191
|
}
|
|
185
192
|
|
|
186
193
|
case 'notAfterToday': {
|
|
187
194
|
const dateValue = new Date(value)
|
|
195
|
+
// Réinitialiser l'heure à minuit pour ne comparer que les dates
|
|
196
|
+
dateValue.setHours(0, 0, 0, 0)
|
|
197
|
+
|
|
198
|
+
// Créer une date aujourd'hui à minuit pour comparaison
|
|
199
|
+
const today = new Date()
|
|
200
|
+
today.setHours(0, 0, 0, 0)
|
|
201
|
+
|
|
188
202
|
return createValidationResult(
|
|
189
|
-
dateValue <=
|
|
203
|
+
dateValue <= today,
|
|
190
204
|
options.message || options.warningMessage || `${identifier} ne peut pas être postérieur à aujourd'hui.`,
|
|
191
205
|
)
|
|
192
206
|
}
|
|
@@ -262,8 +276,17 @@ export function useFieldValidation() {
|
|
|
262
276
|
return { error: 'Date de référence invalide' }
|
|
263
277
|
}
|
|
264
278
|
|
|
279
|
+
// Normaliser les deux dates en réinitialisant les heures/minutes/secondes
|
|
280
|
+
dateValue.setHours(0, 0, 0, 0)
|
|
281
|
+
referenceDate.setHours(0, 0, 0, 0)
|
|
282
|
+
|
|
283
|
+
// Comparer les dates normalisées
|
|
284
|
+
const isSameDate = dateValue.getFullYear() === referenceDate.getFullYear()
|
|
285
|
+
&& dateValue.getMonth() === referenceDate.getMonth()
|
|
286
|
+
&& dateValue.getDate() === referenceDate.getDate()
|
|
287
|
+
|
|
265
288
|
return createValidationResult(
|
|
266
|
-
|
|
289
|
+
isSameDate,
|
|
267
290
|
options.message || options.warningMessage || `${identifier} doit être exactement le ${options.date}.`,
|
|
268
291
|
)
|
|
269
292
|
}
|
|
@@ -37,4 +37,4 @@ Certains contenus sont exemptés de l’obligation d’accessibilité et se situ
|
|
|
37
37
|
7. Les contenus des intranets et des extranets publiés avant le 23 septembre 2019, jusqu’à ce que ces sites fassent l’objet d’une révision en profondeur ;
|
|
38
38
|
8. Les contenus des sites internet et des applications mobiles qui ne sont ni nécessaires à l’accomplissement d’une démarche administrative active ni mis à jour ou modifiés après le 23 septembre 2019, notamment les archives.
|
|
39
39
|
|
|
40
|
-
Il existe un système de dérogation dans la mise en conformité d’un service numérique à l’accessible : la charge disproportionnée. Elle permet de déroger à certaines règles d'accessibilité lorsque leur mise en œuvre engendre une charge excessive pour l'organisation. Cela peut inclure des contraintes techniques, financières ou temporelles qui rendent la conformité à une norme spécifique difficile ou irréalisable. L’absence de priorité, le manque de temps ou de connaissance ne sont pas des circonstances légitimes de dérogations. Cette dérogation doit être justifiée, documentée et nécessite un accord auprès de la
|
|
40
|
+
Il existe un système de dérogation dans la mise en conformité d’un service numérique à l’accessible : la charge disproportionnée. Elle permet de déroger à certaines règles d'accessibilité lorsque leur mise en œuvre engendre une charge excessive pour l'organisation. Cela peut inclure des contraintes techniques, financières ou temporelles qui rendent la conformité à une norme spécifique difficile ou irréalisable. L’absence de priorité, le manque de temps ou de connaissance ne sont pas des circonstances légitimes de dérogations. Cette dérogation doit être justifiée, documentée et nécessite un accord auprès du comité de gouvernance de la l'accessibilité numérique (en attendant sa création, c'est la Filière Digital qui en a le mandat). De plus, des solutions alternatives doivent être proposées pour garantir un accès maximal aux utilisateurs en situation de handicap.
|
|
@@ -12,7 +12,7 @@ Les librairies `vue-dot` et `synapse-bridge` utilisaient en interne la librairie
|
|
|
12
12
|
|
|
13
13
|
Le form builder n'est plus maintenu par le design system dans sa version synapse. Vous pouvez trouvez le code source dans sa version vue2 [ici](https://github.com/assurance-maladie-digital/design-system/tree/v2/packages/form-builder) et sa version vue3 [ici](https://github.com/assurance-maladie-digital/design-system/tree/v2/packages/form-builder).
|
|
14
14
|
|
|
15
|
-
## Les composants
|
|
15
|
+
## Les composants Synapse
|
|
16
16
|
|
|
17
17
|
### CustomIcon
|
|
18
18
|
|
|
@@ -33,4 +33,33 @@ Vous devez désormais utiliser le composant [VIcon](https://vuetifyjs.com/en/com
|
|
|
33
33
|
|
|
34
34
|
### FilterModule
|
|
35
35
|
|
|
36
|
-
Le composant `FilterModule` n'était pas optimisé du point de vue expérience utilisateur, le nombre de clics pour accéder à un filtre était trop important. Il a été remplacé par le composant [
|
|
36
|
+
Le composant `FilterModule` n'était pas optimisé du point de vue expérience utilisateur, le nombre de clics pour accéder à un filtre était trop important. Il a été remplacé par le composant [FilterSideBar](/docs/composants-filtres-filterssidebar--docs) et [FilterInline](/docs/composants-filtres-filterinline--docs).
|
|
37
|
+
|
|
38
|
+
### FilePreview
|
|
39
|
+
|
|
40
|
+
La props `locales` a été ajoutée afin de gérer la localisation des messages d'erreurs.
|
|
41
|
+
|
|
42
|
+
[Voir l'API du composant](https://cnam-design-system.netlify.app/?path=/docs/composants-donn%C3%A9es-filepreview--docs)
|
|
43
|
+
|
|
44
|
+
### NirField
|
|
45
|
+
|
|
46
|
+
- Le variant utilisé par défaut est maintenant 'outlined'.
|
|
47
|
+
- La props `nir-length` a été renomée en `displayKey`.
|
|
48
|
+
- La props `tooltip` a été supprimée au profit des props `nirTooltip` et `keyTooltip`, ainsi que `nirTooltipPosition` et `keyTooltipPosition`.
|
|
49
|
+
- Ajout de nouvelles props pour la gestion des erreurs: `disableErrorHandling`, `customNumberRules` et `customKeyRules`
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
[Voir l'API du composant](https://cnam-design-system.netlify.app/?path=/docs/composants-formulaires-nirfield--docs#api)
|
|
53
|
+
|
|
54
|
+
### DatePicker
|
|
55
|
+
|
|
56
|
+
Des changements sont encore susceptibles d'avoir lieu sur ce composant.
|
|
57
|
+
|
|
58
|
+
- Le variant utilisé par défaut est maintenant 'outlined'.
|
|
59
|
+
- Le composant en mode calendrier ne permet plus la saisie manuelle de la date.
|
|
60
|
+
- Les props `no-prepend-icon` et `append-icon` ont été remplacés par les props `displayIcon` et `displayAppendIcon`.
|
|
61
|
+
- La props `mask` a été retirée.
|
|
62
|
+
- Les modes `birthdate` et `picker-date` ont été retirés.
|
|
63
|
+
- Les slots `prepend` et `append` ont été retirées.
|
|
64
|
+
|
|
65
|
+
[Voir l'API du composant](https://cnam-design-system.netlify.app/?path=/docs/composants-formulaires-nirfield--docs#api)
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import config from '../config'
|
|
2
|
-
import { describe, it, expect } from 'vitest'
|
|
3
|
-
|
|
4
|
-
describe('config', () => {
|
|
5
|
-
it('should have correct menu configuration', () => {
|
|
6
|
-
expect(config.menu).toEqual({
|
|
7
|
-
offsetY: true,
|
|
8
|
-
})
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('should have correct button configuration', () => {
|
|
12
|
-
expect(config.btn).toEqual({
|
|
13
|
-
color: 'primary',
|
|
14
|
-
variant: 'outlined',
|
|
15
|
-
ripple: true,
|
|
16
|
-
})
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('should have correct icon configuration', () => {
|
|
20
|
-
expect(config.icon).toEqual({
|
|
21
|
-
class: 'ml-1',
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
})
|