@cnamts/synapse 1.1.0 → 1.1.1
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/{AutocompleteFilter-DXd4szWO.js → AutocompleteFilter-CGF33skz.js} +1 -1
- package/dist/{DateFilter-BD59Kgwf.js → DateFilter-D7-MsKtx.js} +1 -1
- package/dist/{NumberFilter-BSMZE7uw.js → NumberFilter-bjQPPfsj.js} +1 -1
- package/dist/{PeriodFilter-keUdSSk0.js → PeriodFilter-B3wJpK8-.js} +1 -1
- package/dist/{SelectFilter-Dhvvwazl.js → SelectFilter-BN6DbKAV.js} +1 -1
- package/dist/{TextFilter-CU8FpXz0.js → TextFilter-BffP0J2f.js} +1 -1
- package/dist/{apLightTheme2026-DbS7BPUf.js → apLightTheme2026-C4ygwMHC.js} +11 -11
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +6 -6
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +6 -6
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +6 -6
- package/dist/components/Captcha/Captcha.d.ts +27 -16
- package/dist/components/Captcha/CaptchaForm.d.ts +29 -3
- package/dist/components/Captcha/types.d.ts +14 -0
- package/dist/components/Captcha/useCaptchaValidation.d.ts +37 -0
- package/dist/components/Customs/Selects/SelectBtnField/SelectBtnField.d.ts +33 -13
- package/dist/components/Customs/Selects/SelectBtnField/composables/useSelectBtnFieldValidation.d.ts +23 -0
- package/dist/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.d.ts +2 -2
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectValidation.d.ts +2 -2
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +17 -48
- package/dist/components/Customs/SyCheckBoxGroup/composables/useSyCheckBoxGroupValidation.d.ts +29 -0
- package/dist/components/Customs/SyCheckBoxGroup/types.d.ts +46 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +16 -51
- package/dist/components/Customs/SyCheckbox/composables/useSyCheckboxValidation.d.ts +27 -0
- package/dist/components/Customs/SyCheckbox/types.d.ts +49 -0
- package/dist/components/Customs/SyTextField/FieldState.d.ts +5 -0
- package/dist/components/Customs/SyTextField/useSyTextFieldValidation.d.ts +3 -3
- package/dist/components/DialogBox/DialogBox.d.ts +2 -0
- package/dist/components/DialogBox/locales.d.ts +1 -0
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +4 -0
- package/dist/components/LunarCalendar/LunarCalendar.d.ts +43 -14
- package/dist/components/LunarCalendar/types.d.ts +35 -0
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +11 -12
- package/dist/components/MonthPicker/MonthPicker.d.ts +72 -1747
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +21 -1733
- package/dist/components/MonthPicker/MonthPickerText/useTextField.d.ts +5 -0
- package/dist/components/MonthPicker/locales.d.ts +1 -0
- package/dist/components/MonthPicker/types.d.ts +11 -0
- package/dist/components/MonthPicker/useMonthPickerValidation.d.ts +37 -24
- package/dist/components/NirField/NirField.d.ts +6 -4
- package/dist/components/NirField/useNirValidation.d.ts +7 -5
- package/dist/components/PageContainer/PageContainer.d.ts +8 -0
- package/dist/components/PasswordField/PasswordField.d.ts +2 -2
- package/dist/components/PasswordField/usePasswordFieldValidation.d.ts +2 -2
- package/dist/components/PhoneField/PhoneField.d.ts +960 -1938
- package/dist/components/PhoneField/indicatifs.d.ts +715 -8
- package/dist/components/PhoneField/locales.d.ts +7 -0
- package/dist/components/PhoneField/types.d.ts +29 -0
- package/dist/components/PhoneField/usePhoneFieldValidation.d.ts +45 -0
- package/dist/components/PhoneField/usePhoneIndicatifs.d.ts +947 -0
- package/dist/components/SyTextArea/composables/useSyTextAreaValidation.d.ts +2 -2
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +1 -1
- package/dist/composables/unifyValidation/useValidation.d.ts +4 -5
- package/dist/design-system-v3.js +2 -2
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +10 -10
- package/dist/designTokens/tokens/baseTokens.d.ts +18 -18
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +10 -10
- package/dist/designTokens/tokens/pa/paLightTheme.d.ts +10 -10
- package/dist/designTokens/tokens/semanticTokens.d.ts +14 -14
- package/dist/{main-D8ryUoS5.js → main-C4wAktOs.js} +13718 -12991
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +1 -1
- package/package.json +7 -7
- package/src/assets/compat/_legacy-tokens.scss +91 -0
- package/src/assets/overrides/_utilities.scss +23 -0
- package/src/components/Accordion/Accordion.stories.ts +121 -1
- package/src/components/BackBtn/BackBtn.mdx +1 -1
- package/src/components/BackToTopBtn/BackToTopBtn.mdx +0 -1
- package/src/components/Captcha/Captcha.stories.ts +134 -31
- package/src/components/Captcha/Captcha.vue +95 -28
- package/src/components/Captcha/CaptchaForm.vue +51 -22
- package/src/components/Captcha/tests/Captcha.focus.spec.ts +214 -0
- package/src/components/Captcha/tests/Captcha.spec.ts +233 -24
- package/src/components/Captcha/tests/CaptchaForm.spec.ts +82 -0
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +16 -42
- package/src/components/Captcha/types.ts +15 -0
- package/src/components/Captcha/useCaptchaValidation.ts +87 -0
- package/src/components/Captcha/validation/validation.stories.ts +1194 -0
- package/src/components/ChipList/ChipList.mdx +0 -1
- package/src/components/CollapsibleList/CollapsibleList.mdx +0 -1
- package/src/components/CookieBanner/CookieBanner.mdx +0 -1
- package/src/components/CopyBtn/CopyBtn.mdx +0 -1
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.stories.ts +123 -439
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +147 -41
- package/src/components/Customs/Selects/SelectBtnField/Validation/Validation.stories.ts +600 -0
- package/src/components/Customs/Selects/SelectBtnField/composables/useSelectBtnFieldValidation.ts +87 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +402 -33
- package/src/components/Customs/Selects/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +52 -38
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +342 -162
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +77 -129
- package/src/components/Customs/SyCheckBoxGroup/Validation/Validation.stories.ts +1008 -0
- package/src/components/Customs/SyCheckBoxGroup/composables/useSyCheckBoxGroupValidation.ts +107 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.spec.ts +180 -7
- package/src/components/Customs/SyCheckBoxGroup/types.ts +49 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +41 -161
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +71 -148
- package/src/components/Customs/SyCheckbox/Validation/Validation.stories.ts +654 -0
- package/src/components/Customs/SyCheckbox/composables/useSyCheckboxValidation.ts +105 -0
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +106 -0
- package/src/components/Customs/SyCheckbox/tests/useSyCheckboxValidation.spec.ts +98 -0
- package/src/components/Customs/SyCheckbox/types.ts +51 -0
- package/src/components/Customs/SyTextField/FieldState.vue +50 -0
- package/src/components/Customs/SyTextField/SyTextField.vue +12 -9
- package/src/components/Customs/SyTextField/useSyTextFieldValidation.ts +2 -11
- package/src/components/DataList/DataList.mdx +0 -1
- package/src/components/DataListGroup/DataListGroup.mdx +0 -1
- package/src/components/DiacriticPicker/DiacriticPicker.mdx +0 -1
- package/src/components/DialogBox/DialogBox.mdx +0 -1
- package/src/components/DialogBox/DialogBox.stories.ts +399 -4
- package/src/components/DialogBox/DialogBox.vue +20 -0
- package/src/components/DialogBox/locales.ts +1 -0
- package/src/components/DialogBox/tests/DialogBox.spec.ts +73 -0
- package/src/components/DialogBox/tests/DialogBox.visual.cy.ts +24 -0
- package/src/components/ErrorPage/ErrorPage.mdx +1 -1
- package/src/components/ExternalLinks/ExternalLinks.mdx +0 -1
- package/src/components/FileList/FileList.mdx +0 -1
- package/src/components/FilterInline/FilterInline.mdx +0 -1
- package/src/components/FilterSideBar/FilterSideBar.mdx +8 -1
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +133 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +19 -2
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +55 -0
- package/src/components/FooterBar/FooterBar.mdx +0 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +0 -1
- package/src/components/HeaderBar/HeaderBar.mdx +0 -1
- package/src/components/HeaderLoading/HeaderLoading.mdx +0 -1
- package/src/components/LangBtn/LangBtn.mdx +0 -1
- package/src/components/Logo/Logo.mdx +1 -1
- package/src/components/LunarCalendar/LunarCalendar.mdx +6 -9
- package/src/components/LunarCalendar/LunarCalendar.stories.ts +243 -46
- package/src/components/LunarCalendar/LunarCalendar.vue +61 -26
- package/src/components/LunarCalendar/Validation/Validation.stories.ts +717 -0
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +1 -1
- package/src/components/LunarCalendar/tests/LunarCalendar.spec.ts +197 -6
- package/src/components/LunarCalendar/tests/useLunarCalendarValidation.spec.ts +287 -0
- package/src/components/LunarCalendar/types.ts +39 -0
- package/src/components/LunarCalendar/useLunarCalendarValidation.ts +115 -39
- package/src/components/MonthPicker/MonthPicker.stories.ts +38 -281
- package/src/components/MonthPicker/MonthPicker.vue +66 -17
- package/src/components/MonthPicker/MonthPickerText/MonthPickerInput.vue +44 -20
- package/src/components/MonthPicker/MonthPickerText/useTextField.ts +5 -0
- package/src/components/MonthPicker/Validation/Validation.stories.ts +1117 -0
- package/src/components/MonthPicker/locales.ts +1 -0
- package/src/components/MonthPicker/tests/MonthPicker.spec.ts +353 -2
- package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +12 -8
- package/src/components/MonthPicker/types.ts +16 -0
- package/src/components/MonthPicker/useMonthPickerValidation.ts +64 -27
- package/src/components/NirField/NirField.mdx +120 -66
- package/src/components/NirField/NirField.stories.ts +216 -0
- package/src/components/NirField/useNirValidation.ts +16 -17
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +263 -245
- package/src/components/NotificationBar/NotificationBar.mdx +0 -1
- package/src/components/PageContainer/PageContainer.mdx +0 -1
- package/src/components/PageContainer/PageContainer.stories.ts +170 -2
- package/src/components/PageContainer/PageContainer.vue +63 -8
- package/src/components/PageContainer/tests/__snapshots__/PageContainer.spec.ts.snap +19 -11
- package/src/components/PaginatedTable/PaginatedTable.mdx +0 -1
- package/src/components/PeriodField/PeriodField.mdx +0 -1
- package/src/components/PhoneField/PhoneField.mdx +2 -3
- package/src/components/PhoneField/PhoneField.stories.ts +227 -410
- package/src/components/PhoneField/PhoneField.vue +204 -438
- package/src/components/PhoneField/indicatifs.ts +1 -1
- package/src/components/PhoneField/locales.ts +7 -0
- package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +0 -1
- package/src/components/PhoneField/tests/PhoneField.spec.ts +517 -220
- package/src/components/PhoneField/types.ts +30 -0
- package/src/components/PhoneField/usePhoneFieldValidation.ts +119 -0
- package/src/components/PhoneField/usePhoneIndicatifs.ts +89 -0
- package/src/components/PhoneField/validation/validation.stories.ts +717 -0
- package/src/components/RangeField/RangeField.mdx +0 -1
- package/src/components/RatingPicker/RatingPicker.mdx +0 -1
- package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +0 -1
- package/src/components/StatusPage/StatusPage.vue +1 -0
- package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +248 -230
- package/src/components/SubHeader/SubHeader.mdx +5 -6
- package/src/components/Tables/common/tests/SyTableFilter.spec.ts +11 -12
- package/src/components/UploadWorkflow/UploadWorkflow.mdx +0 -1
- package/src/components/UserMenuBtn/UserMenuBtn.mdx +0 -1
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +177 -0
- package/src/composables/unifyValidation/documentationValidationProps.ts +1 -1
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +13 -1
- package/src/composables/unifyValidation/useValidation.ts +37 -33
- package/src/composantsVuetify/VCard/VCard.mdx +4 -0
- package/src/composantsVuetify/VCard/v-card.stories.ts +93 -1
- package/src/composantsVuetify/VCarousel/VCarousel.mdx +74 -0
- package/src/composantsVuetify/VCarousel/v-carousel.stories.ts +531 -0
- package/src/composantsVuetify/VNavigationDrawer/VNavgationDrawer.mdx +53 -0
- package/src/composantsVuetify/VNavigationDrawer/v-navigation-drawer.stories.ts +310 -0
- package/src/composantsVuetify/VSlideGroup/VSlideGroup.mdx +105 -0
- package/src/composantsVuetify/VSlideGroup/v-slide-group.stories.ts +463 -0
- package/src/designTokens/tokens/baseColors.ts +1 -1
- package/src/designTokens/tokens/baseTokens.ts +18 -18
- package/src/stories/Components/Components.stories.ts +34 -1
- package/src/stories/Demarrer/Releases.stories.ts +16 -2
- package/src/stories/DesignTokens/Arrondis.mdx +1 -1
- package/src/stories/DesignTokens/Correspondances.mdx +219 -0
- package/src/stories/DesignTokens/UtiliserLesTokens.mdx +235 -0
- package/src/stories/DesignTokens/colors.stories.ts +569 -569
- package/src/stories/GuideDuDev/Amelipro.stories.ts +335 -267
- package/dist/components/LunarCalendar/useLunarCalendarRules.d.ts +0 -5
- package/dist/components/PhoneField/tests/types.d.ts +0 -18
- package/src/components/LunarCalendar/tests/useLunarCalendarRules.spec.ts +0 -184
- package/src/components/LunarCalendar/useLunarCalendarRules.ts +0 -96
- package/src/components/PhoneField/tests/types.d.ts +0 -19
|
@@ -89,6 +89,37 @@ const meta = {
|
|
|
89
89
|
},
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
|
+
'title': {
|
|
93
|
+
description: 'Titre affiché au-dessus des filtres du panneau',
|
|
94
|
+
control: {
|
|
95
|
+
type: 'text',
|
|
96
|
+
},
|
|
97
|
+
table: {
|
|
98
|
+
category: 'props',
|
|
99
|
+
type: {
|
|
100
|
+
summary: 'string',
|
|
101
|
+
},
|
|
102
|
+
defaultValue: {
|
|
103
|
+
summary: 'undefined',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
'headingLevel': {
|
|
108
|
+
description: 'Niveau sémantique du titre (balise h1 à h6), pour l’intégration dans la hiérarchie de titres de la page',
|
|
109
|
+
control: {
|
|
110
|
+
type: 'select',
|
|
111
|
+
},
|
|
112
|
+
options: [1, 2, 3, 4, 5, 6],
|
|
113
|
+
table: {
|
|
114
|
+
category: 'props',
|
|
115
|
+
type: {
|
|
116
|
+
summary: '1 | 2 | 3 | 4 | 5 | 6',
|
|
117
|
+
},
|
|
118
|
+
defaultValue: {
|
|
119
|
+
summary: '2',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
92
123
|
'onUpdate:modelValue': {
|
|
93
124
|
description: 'Événement déclenché lors de la mise à jour des filtres',
|
|
94
125
|
control: {
|
|
@@ -254,7 +285,6 @@ export const Default: Story = {
|
|
|
254
285
|
|
|
255
286
|
<template #profession="{ props }">
|
|
256
287
|
<SearchListField
|
|
257
|
-
label="Profession"
|
|
258
288
|
v-bind="props"
|
|
259
289
|
label="Profession"
|
|
260
290
|
:items="professionList"
|
|
@@ -836,6 +866,108 @@ const professionList = [
|
|
|
836
866
|
},
|
|
837
867
|
}
|
|
838
868
|
|
|
869
|
+
export const Title: Story = {
|
|
870
|
+
parameters: {
|
|
871
|
+
sourceCode: [
|
|
872
|
+
{
|
|
873
|
+
name: 'Template',
|
|
874
|
+
code: `
|
|
875
|
+
<template>
|
|
876
|
+
<FilterSideBar
|
|
877
|
+
v-model="filters"
|
|
878
|
+
title="Filtres du tableau personnalisé"
|
|
879
|
+
>
|
|
880
|
+
<template #name="{ props }">
|
|
881
|
+
<SyTextField
|
|
882
|
+
v-bind="props"
|
|
883
|
+
label="Nom"
|
|
884
|
+
variant="outlined"
|
|
885
|
+
hide-details
|
|
886
|
+
/>
|
|
887
|
+
</template>
|
|
888
|
+
|
|
889
|
+
<template #folder="{ props }">
|
|
890
|
+
<SyTextField
|
|
891
|
+
v-bind="props"
|
|
892
|
+
label="Type de dossier"
|
|
893
|
+
variant="outlined"
|
|
894
|
+
hide-details
|
|
895
|
+
/>
|
|
896
|
+
</template>
|
|
897
|
+
</FilterSideBar>
|
|
898
|
+
</template>
|
|
899
|
+
`,
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
name: 'Script',
|
|
903
|
+
code: `
|
|
904
|
+
<script setup lang="ts">
|
|
905
|
+
import { ref } from 'vue'
|
|
906
|
+
import { FilterSideBar, SyTextField } from '@cnamts/synapse'
|
|
907
|
+
|
|
908
|
+
const filters = ref([
|
|
909
|
+
{
|
|
910
|
+
name: 'name',
|
|
911
|
+
title: 'Identité',
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
name: 'folder',
|
|
915
|
+
title: 'Type de dossier',
|
|
916
|
+
},
|
|
917
|
+
])
|
|
918
|
+
</script>
|
|
919
|
+
`,
|
|
920
|
+
},
|
|
921
|
+
],
|
|
922
|
+
},
|
|
923
|
+
args: {
|
|
924
|
+
'onUpdate:modelValue': fn(),
|
|
925
|
+
'title': 'Filtres du tableau personnalisé',
|
|
926
|
+
},
|
|
927
|
+
decorators: Default.decorators,
|
|
928
|
+
render: args => ({
|
|
929
|
+
components: { FilterSideBar, SyTextField },
|
|
930
|
+
setup() {
|
|
931
|
+
const filters = ref([
|
|
932
|
+
{
|
|
933
|
+
name: 'name',
|
|
934
|
+
title: 'Identité',
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
name: 'folder',
|
|
938
|
+
title: 'Type de dossier',
|
|
939
|
+
},
|
|
940
|
+
])
|
|
941
|
+
|
|
942
|
+
return { args, filters }
|
|
943
|
+
},
|
|
944
|
+
template: `
|
|
945
|
+
<FilterSideBar
|
|
946
|
+
v-bind="args"
|
|
947
|
+
v-model="filters"
|
|
948
|
+
>
|
|
949
|
+
<template #name="{ props }">
|
|
950
|
+
<SyTextField
|
|
951
|
+
v-bind="props"
|
|
952
|
+
label="Nom"
|
|
953
|
+
variant="outlined"
|
|
954
|
+
hide-details
|
|
955
|
+
/>
|
|
956
|
+
</template>
|
|
957
|
+
|
|
958
|
+
<template #folder="{ props }">
|
|
959
|
+
<SyTextField
|
|
960
|
+
v-bind="props"
|
|
961
|
+
label="Type de dossier"
|
|
962
|
+
variant="outlined"
|
|
963
|
+
hide-details
|
|
964
|
+
/>
|
|
965
|
+
</template>
|
|
966
|
+
</FilterSideBar>
|
|
967
|
+
`,
|
|
968
|
+
}),
|
|
969
|
+
}
|
|
970
|
+
|
|
839
971
|
export const ZIndex: Story = {
|
|
840
972
|
args: {
|
|
841
973
|
'onUpdate:modelValue': fn(),
|
|
@@ -2,30 +2,38 @@
|
|
|
2
2
|
import type { FilterProp } from '@/composables/useFilterable/useFilterable'
|
|
3
3
|
import useFilterable from '@/composables/useFilterable/useFilterable'
|
|
4
4
|
import { mdiFilterVariant } from '@mdi/js'
|
|
5
|
-
import { computed, onMounted, ref, toRef, watch } from 'vue'
|
|
5
|
+
import { computed, onMounted, ref, toRef, useId, watch } from 'vue'
|
|
6
6
|
import type { VBtn } from 'vuetify/components/VBtn'
|
|
7
7
|
import type { VNavigationDrawer } from 'vuetify/components/VNavigationDrawer'
|
|
8
8
|
import ChipList from '../ChipList/ChipList.vue'
|
|
9
9
|
import SyIcon from '../Customs/SyIcon/SyIcon.vue'
|
|
10
10
|
import { locales as defaultLocales } from './locales'
|
|
11
11
|
import vLockFocus from '@/directives/lockFocus'
|
|
12
|
+
import SyHeading from '@/components/SyHeading/SyHeading.vue'
|
|
12
13
|
|
|
13
14
|
const props = withDefaults(defineProps<{
|
|
14
15
|
modelValue?: FilterProp
|
|
15
16
|
modale?: boolean
|
|
16
17
|
locales?: typeof defaultLocales
|
|
17
18
|
zIndex?: number
|
|
19
|
+
title?: string
|
|
20
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6
|
|
18
21
|
}>(), {
|
|
19
22
|
modelValue: () => [],
|
|
20
23
|
modale: false,
|
|
21
24
|
locales: () => defaultLocales,
|
|
22
25
|
zIndex: undefined,
|
|
26
|
+
title: undefined,
|
|
27
|
+
headingLevel: 2,
|
|
23
28
|
})
|
|
24
29
|
|
|
25
30
|
const emits = defineEmits<{
|
|
26
31
|
(e: 'update:modelValue', value: FilterProp): void
|
|
27
32
|
}>()
|
|
28
33
|
|
|
34
|
+
// Id du titre pour lier le nom accessible du panneau au titre visible (aria-labelledby)
|
|
35
|
+
const titleId = useId()
|
|
36
|
+
|
|
29
37
|
const {
|
|
30
38
|
filters,
|
|
31
39
|
removeChip,
|
|
@@ -133,7 +141,8 @@
|
|
|
133
141
|
:aria-hidden="drawer ? undefined : 'true'"
|
|
134
142
|
:inert="drawer ? undefined : 'true'"
|
|
135
143
|
:aria-modal="props.modale"
|
|
136
|
-
:aria-label="locales.modaleLabel"
|
|
144
|
+
:aria-label="props.title ? undefined : locales.modaleLabel"
|
|
145
|
+
:aria-labelledby="props.title ? titleId : undefined"
|
|
137
146
|
:style="zIndexStyle"
|
|
138
147
|
@keydown.escape.prevent="drawer = false"
|
|
139
148
|
>
|
|
@@ -141,6 +150,14 @@
|
|
|
141
150
|
v-lock-focus="$props.modale"
|
|
142
151
|
@submit.prevent="applyFilters"
|
|
143
152
|
>
|
|
153
|
+
<SyHeading
|
|
154
|
+
v-if="props.title"
|
|
155
|
+
:id="titleId"
|
|
156
|
+
class="sy-filters-side-bar__title px-4 pt-4 pb-2 text-h6 font-weight-bold"
|
|
157
|
+
:level="props.headingLevel"
|
|
158
|
+
>
|
|
159
|
+
{{ props.title }}
|
|
160
|
+
</SyHeading>
|
|
144
161
|
<VExpansionPanels
|
|
145
162
|
variant="accordion"
|
|
146
163
|
tag="ul"
|
|
@@ -370,4 +370,59 @@ describe('FilterSideBar', () => {
|
|
|
370
370
|
const drawer = wrapper.find('.v-navigation-drawer')
|
|
371
371
|
expect(drawer.attributes('style') ?? '').not.toContain('z-index: 2401')
|
|
372
372
|
})
|
|
373
|
+
|
|
374
|
+
const mountWithTitle = (title?: string, headingLevel?: 1 | 2 | 3 | 4 | 5 | 6) =>
|
|
375
|
+
mount(
|
|
376
|
+
defineComponent({
|
|
377
|
+
components: { VApp, FiltersSideBar: FilterSideBar },
|
|
378
|
+
data: () => ({ title, headingLevel }),
|
|
379
|
+
template: `
|
|
380
|
+
<VApp>
|
|
381
|
+
<FiltersSideBar :model-value="[]" :title="title" :heading-level="headingLevel" />
|
|
382
|
+
</VApp>
|
|
383
|
+
`,
|
|
384
|
+
}),
|
|
385
|
+
{ global: { stubs: { Teleport: true } } },
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
it('displays the title heading above the filters when title is provided', () => {
|
|
389
|
+
const wrapper = mountWithTitle('Filtres du tableau')
|
|
390
|
+
|
|
391
|
+
const heading = wrapper.find('.sy-filters-side-bar__title')
|
|
392
|
+
expect(heading.exists()).toBe(true)
|
|
393
|
+
expect(heading.text()).toBe('Filtres du tableau')
|
|
394
|
+
// Niveau sémantique par défaut : h2
|
|
395
|
+
expect(heading.element.tagName).toBe('H2')
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
it('does not render the title heading when no title is provided', () => {
|
|
399
|
+
const wrapper = mountWithTitle()
|
|
400
|
+
expect(wrapper.find('.sy-filters-side-bar__title').exists()).toBe(false)
|
|
401
|
+
})
|
|
402
|
+
|
|
403
|
+
it('renders the title with the requested heading level', () => {
|
|
404
|
+
const wrapper = mountWithTitle('Filtres', 3)
|
|
405
|
+
expect(wrapper.find('.sy-filters-side-bar__title').element.tagName).toBe('H3')
|
|
406
|
+
})
|
|
407
|
+
|
|
408
|
+
it('links the drawer accessible name to the title via aria-labelledby', () => {
|
|
409
|
+
const wrapper = mountWithTitle('Filtres du tableau')
|
|
410
|
+
|
|
411
|
+
const heading = wrapper.find('.sy-filters-side-bar__title')
|
|
412
|
+
const drawer = wrapper.find('.v-navigation-drawer')
|
|
413
|
+
const titleId = heading.attributes('id')
|
|
414
|
+
|
|
415
|
+
expect(titleId).toBeTruthy()
|
|
416
|
+
expect(drawer.attributes('aria-labelledby')).toBe(titleId)
|
|
417
|
+
// aria-label retiré au profit de aria-labelledby quand un titre est fourni
|
|
418
|
+
expect(drawer.attributes('aria-label')).toBeUndefined()
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
it('falls back to the default aria-label when no title is provided', () => {
|
|
422
|
+
const wrapper = mountWithTitle()
|
|
423
|
+
const drawer = wrapper.find('.v-navigation-drawer')
|
|
424
|
+
|
|
425
|
+
expect(drawer.attributes('aria-label')).toBe('Filtres')
|
|
426
|
+
expect(drawer.attributes('aria-labelledby')).toBeUndefined()
|
|
427
|
+
})
|
|
373
428
|
})
|
|
@@ -254,7 +254,6 @@ Il est nécessaire de faire attention à la place que prendront les éléments e
|
|
|
254
254
|
<script setup lang="ts">
|
|
255
255
|
import { mdiMagnify, mdiAccountCircleOutline } from '@mdi/js'
|
|
256
256
|
</script>
|
|
257
|
-
import '../../stories/styles/shared.css';
|
|
258
257
|
|
|
259
258
|
<template>
|
|
260
259
|
<HeaderBar>
|
|
@@ -21,7 +21,7 @@ import Logo from './Logo.vue';
|
|
|
21
21
|
<script setup lang='ts'>
|
|
22
22
|
import { Logo } from '@cnamts/synapse'
|
|
23
23
|
</script>
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
<template>
|
|
26
26
|
<Logo :hideSignature="false" :hideOrganism="false" :risquePro="false" ariaLabel="" :avatar="false" :dark="false" />
|
|
27
27
|
</template>
|
|
@@ -17,17 +17,14 @@ import * as LunarCalendarStories from './LunarCalendar.stories';
|
|
|
17
17
|
|
|
18
18
|
# Exemples d'utilisation
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Champ requis
|
|
21
21
|
|
|
22
|
-
<Canvas of={LunarCalendarStories.
|
|
22
|
+
<Canvas of={LunarCalendarStories.Required} />
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
## Avec bouton de suppression
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
<Canvas of={LunarCalendarStories.WithClearable} />
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## Avec année maximale seulement
|
|
31
|
-
|
|
32
|
-
<Canvas of={LunarCalendarStories.WithMaxYearOnly} />
|
|
28
|
+
## Avec texte d'aide
|
|
33
29
|
|
|
30
|
+
<Canvas of={LunarCalendarStories.HelpText} />
|