@cnamts/synapse 1.0.4 → 1.0.6
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/DateFilter-BlOpwEVq.js +98 -0
- package/dist/NumberFilter-BPUXE4wY.js +121 -0
- package/dist/PeriodFilter-B2yx329_.js +112 -0
- package/dist/SelectFilter-CedKn1oV.js +136 -0
- package/dist/TextFilter-DkhJjRtR.js +114 -0
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordion.d.ts +103 -0
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.d.ts +105 -0
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.d.ts +132 -0
- package/dist/components/Amelipro/AmeliproCaptcha/types.d.ts +5 -0
- package/dist/components/Amelipro/AmeliproCard/AmeliproCard.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.d.ts +126 -0
- package/dist/components/Amelipro/AmeliproCustomSelector/types.d.ts +6 -0
- package/dist/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproTable/AmeliproTable.d.ts +190 -0
- package/dist/components/Amelipro/AmeliproTable/types.d.ts +34 -0
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.d.ts +1 -1
- package/dist/components/Amelipro/types.d.ts +6 -0
- package/dist/components/CookieBanner/CookieBanner.d.ts +1 -1
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +11 -2
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +6 -1
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +3 -1
- package/dist/components/DataList/DataList.d.ts +9 -0
- package/dist/components/DataListGroup/DataListGroup.d.ts +10 -1
- package/dist/components/DataListItem/DataListItem.d.ts +1 -1
- package/dist/components/DataListItem/config.d.ts +1 -1
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +18 -8
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +16 -6
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +6 -1
- package/dist/components/DatePicker/composables/useDateInputEditing.d.ts +17 -8
- package/dist/components/DatePicker/composables/useKeyboardEvents.d.ts +41 -0
- package/dist/components/DatePicker/composables/useManualDateValidation.d.ts +4 -9
- package/dist/components/DatePicker/utils/dateFormattingUtils.d.ts +72 -0
- package/dist/components/DatePicker/utils/validationUtils.d.ts +38 -0
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.d.ts +9 -3
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.d.ts +6 -1
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.d.ts +11 -1
- package/dist/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.d.ts +11 -1
- package/dist/components/HeaderBar/HeaderBurgerMenu/locals.d.ts +2 -0
- package/dist/components/HeaderBar/HeaderBurgerMenu/useMenuPosition.d.ts +4 -0
- package/dist/components/NirField/NirField.d.ts +14 -4
- package/dist/components/PeriodField/PeriodField.d.ts +24 -4
- package/dist/components/Tables/common/SyTablePagination.d.ts +10 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/usePagination.d.ts +16 -0
- package/dist/design-system-v3.js +165 -160
- package/dist/design-system-v3.umd.cjs +120 -138
- package/dist/directives/lockFocus.d.ts +17 -0
- package/dist/{main-BzyNNvHX.js → main-BXPFSAB4.js} +14664 -13282
- package/dist/style.css +1 -0
- package/package.json +5 -2
- package/src/assets/amelipro/apTheme.scss +149 -0
- package/src/assets/amelipro/apTokens.scss +0 -148
- package/src/assets/overrides/_btns.scss +15 -0
- package/src/assets/overrides/_container.scss +36 -0
- package/src/assets/overrides/_forms.scss +7 -0
- package/src/assets/{_spacers.scss → overrides/_spacers.scss} +0 -7
- package/src/assets/overrides/_tables.scss +18 -0
- package/src/assets/overrides/_tooltips.scss +10 -0
- package/src/assets/overrides/_typography.scss +196 -0
- package/src/assets/settings.scss +11 -51
- package/src/assets/themes.scss +10 -0
- package/src/assets/tokens.scss +9 -156
- package/src/components/Accordion/composables/__tests__/useAccordionGroupCommunication.spec.ts +80 -40
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.mdx +15 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.stories.ts +83 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.vue +86 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.vue +242 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/__tests__/AmeliproAccordionTemplate.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/__tests__/__snapshots__/AmeliproAccordionTemplate.spec.ts.snap +124 -0
- package/src/components/Amelipro/AmeliproAccordion/__tests__/AmeliproAccordion.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproAccordion/__tests__/__snapshots__/AmeliproAccordion.spec.ts.snap +124 -0
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.mdx +15 -0
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.stories.ts +87 -0
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.vue +233 -0
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/AmeliproCaptcha.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/__snapshots__/AmeliproCaptcha.spec.ts.snap +384 -0
- package/src/components/Amelipro/AmeliproCaptcha/types.d.ts +5 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.mdx +15 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.stories.ts +143 -0
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +351 -0
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/AmeliproCustomSelector.spec.ts +50 -0
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +186 -0
- package/src/components/Amelipro/AmeliproCustomSelector/types.d.ts +6 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/__snapshots__/AmeliproHeaderBar.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +1 -708
- package/src/components/Amelipro/AmeliproMenu/tests/__snapshots__/AmeliproMenu.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +1 -708
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.mdx +22 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +550 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +421 -0
- package/src/components/Amelipro/AmeliproTable/__tests__/AmeliproTable.spec.ts +72 -0
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +427 -0
- package/src/components/Amelipro/AmeliproTable/types.d.ts +34 -0
- package/src/components/Amelipro/ServiceMenu/ServiceMenu.vue +12 -1
- package/src/components/Amelipro/ServiceMenu/tests/__snapshots__/ServiceMenu.spec.ts.snap +0 -820
- package/src/components/Amelipro/types.ts +8 -0
- package/src/components/CollapsibleList/CollapsibleList.vue +0 -2
- package/src/components/CookieBanner/CookieBanner.vue +1 -3
- package/src/components/CopyBtn/CopyBtn.vue +9 -2
- package/src/components/CopyBtn/tests/CopyBtn.spec.ts +3 -1
- package/src/components/Customs/Selects/SySelect/Accessibilite.mdx +7 -0
- package/src/components/Customs/Selects/SySelect/Accessibilite.stories.ts +4 -1
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +80 -0
- package/src/components/Customs/Selects/SySelect/SySelect.vue +280 -34
- package/src/components/Customs/Selects/SySelect/composables/tests/useSySelectKeyboard.spec.ts +14 -5
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +129 -12
- package/src/components/Customs/SyIcon/SyIcon.spec.ts +3 -0
- package/src/components/Customs/SyTextField/Accessibilite.stories.ts +3 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +79 -6
- package/src/components/Customs/SyTextField/SyTextField.vue +218 -24
- package/src/components/DataList/Accessibilite.stories.ts +4 -0
- package/src/components/DataList/DataList.vue +19 -12
- package/src/components/DataListGroup/Accessibilite.stories.ts +4 -0
- package/src/components/DataListGroup/DataListGroup.vue +32 -15
- package/src/components/DataListItem/DataListItem.vue +14 -11
- package/src/components/DataListItem/config.ts +1 -1
- package/src/components/DataListItem/tests/DataListItem.spec.ts +2 -2
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +12 -7
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +174 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +27 -5
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +286 -0
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +29 -31
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +11 -3
- package/src/components/DatePicker/composables/useDateInputEditing.ts +73 -209
- package/src/components/DatePicker/composables/useKeyboardEvents.ts +149 -0
- package/src/components/DatePicker/composables/useManualDateValidation.ts +27 -68
- package/src/components/DatePicker/utils/dateFormattingUtils.ts +228 -0
- package/src/components/DatePicker/utils/validationUtils.ts +90 -0
- package/src/components/DialogBox/Accessibilite.stories.ts +4 -0
- package/src/components/DialogBox/DialogBox.stories.ts +10 -10
- package/src/components/DialogBox/DialogBox.vue +83 -21
- package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +12 -6
- package/src/components/FileUpload/tests/FileUpload.spec.ts +3 -0
- package/src/components/FooterBar/FooterBar.vue +1 -0
- package/src/components/HeaderBar/Accessibilite.stories.ts +4 -0
- package/src/components/HeaderBar/HeaderBar.mdx +47 -22
- package/src/components/HeaderBar/HeaderBar.stories.ts +54 -13
- package/src/components/HeaderBar/HeaderBar.vue +2 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/Accessibilite.stories.ts +4 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +160 -82
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +41 -56
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +10 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +41 -18
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +7 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +36 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +41 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/locals.ts +2 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +8 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/useMenuPosition.ts +50 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +5 -5
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +7 -4
- package/src/components/HeaderBar/locales.ts +1 -1
- package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +2 -1
- package/src/components/HeaderLoading/HeaderLoading.vue +0 -1
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +2 -0
- package/src/components/LangBtn/LangBtn.vue +0 -3
- package/src/components/LogoBrandSection/Accessibilite.stories.ts +4 -1
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +2 -2
- package/src/components/LogoBrandSection/LogoBrandSection.vue +13 -8
- package/src/components/LogoBrandSection/locales.ts +1 -1
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +1 -1
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +6 -4
- package/src/components/NirField/NirField.vue +5 -5
- package/src/components/NirField/tests/NirField.spec.ts +78 -12
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +104 -6
- package/src/components/Tables/common/TableHeader.vue +10 -7
- package/src/components/Tables/common/tableAccessibilityUtils.ts +13 -2
- package/src/components/Tables/common/useTableAria.ts +17 -1
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +2 -1
- package/src/components/index.ts +4 -0
- package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +34 -5
- package/src/composables/index.ts +3 -0
- package/src/composables/useFilterable/useFilterable.ts +13 -1
- package/src/composables/usePagination.ts +103 -0
- package/src/directives/lockFocus.ts +48 -0
- package/src/main.ts +1 -2
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +1 -8
- package/src/stories/Accessibilite/{Aculturation/AuditDesignSystem.mdx → AuditDesignSystem.mdx} +1 -1
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.mdx +102 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.stories.ts +219 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/{Tanaguru.mdx → Tanaguru/Utilisation.mdx} +1 -1
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +43 -0
- package/src/stories/DesignTokens/Colors.mdx +2 -0
- package/src/stories/DesignTokens/colors.stories.ts +9 -0
- package/src/vuetifyConfig.ts +3 -3
- package/dist/DateFilter-yrwJv_2R.js +0 -95
- package/dist/NumberFilter-BQXtywZI.js +0 -117
- package/dist/PeriodFilter-BYXVSzr5.js +0 -108
- package/dist/SelectFilter-CJV_mlN3.js +0 -133
- package/dist/TextFilter-DN0ejYIs.js +0 -110
- package/dist/design-system-v3.css +0 -1
- package/dist/directives/letterSpacing.d.ts +0 -27
- package/src/assets/_fonts.scss +0 -6
- package/src/assets/_typography.scss +0 -157
- package/src/directives/letterSpacing.ts +0 -233
- /package/src/assets/{_elevations.scss → overrides/_elevations.scss} +0 -0
- /package/src/assets/{_radius.scss → overrides/_radius.scss} +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, useSlots } from 'vue'
|
|
3
|
+
import AmeliproIcon from '../../AmeliproIcon/AmeliproIcon.vue'
|
|
4
|
+
import type { IndexedObject } from '../../types'
|
|
5
|
+
import { convertToHex } from '@/utils/functions/convertToHex'
|
|
6
|
+
import { useDisplay } from 'vuetify'
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
accordionTitle: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
borderColor: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'ap-grey-lighten-2',
|
|
16
|
+
},
|
|
17
|
+
bordered: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true,
|
|
20
|
+
},
|
|
21
|
+
cardColor: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'ap-white',
|
|
24
|
+
},
|
|
25
|
+
headerRightWidth: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: '50%',
|
|
28
|
+
},
|
|
29
|
+
hideSeparator: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
isOpen: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
titleLevel: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 2,
|
|
40
|
+
},
|
|
41
|
+
titleUppercase: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
uniqueId: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const { smAndUp } = useDisplay()
|
|
52
|
+
const focus = ref(false)
|
|
53
|
+
const hover = ref(false)
|
|
54
|
+
const borderHexColor = computed<string>(() => convertToHex(props.borderColor))
|
|
55
|
+
const generalAccordionStyles = computed<IndexedObject>(() => {
|
|
56
|
+
const cardStyle: IndexedObject = { backgroundColor: `${convertToHex(props.cardColor)}` }
|
|
57
|
+
|
|
58
|
+
if (props.bordered) {
|
|
59
|
+
cardStyle.border = `1px solid ${borderHexColor.value}`
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return cardStyle
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const slots = useSlots()
|
|
66
|
+
const hasRightSlot = computed((): boolean => Boolean(slots.headerRight))
|
|
67
|
+
|
|
68
|
+
const headerLeftStyles = computed<IndexedObject>((): IndexedObject => {
|
|
69
|
+
if (hasRightSlot.value && smAndUp.value) {
|
|
70
|
+
return {
|
|
71
|
+
width: `calc(100% - (${props.headerRightWidth} + 10px))`,
|
|
72
|
+
marginRight: '10px',
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return { width: '100%' }
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const headerRightStyles = computed<IndexedObject>((): IndexedObject => {
|
|
79
|
+
if (hasRightSlot.value && smAndUp.value) {
|
|
80
|
+
return {
|
|
81
|
+
width: `calc(${props.headerRightWidth} - 10px)`,
|
|
82
|
+
marginLeft: '10px',
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return { width: '100%' }
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const emit = defineEmits(['open-close'])
|
|
89
|
+
const emitOpenCloseEvent = (): void => {
|
|
90
|
+
emit('open-close', props.uniqueId, !props.isOpen)
|
|
91
|
+
}
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<div
|
|
96
|
+
:id="`${uniqueId}-container`"
|
|
97
|
+
class="amelipro-accordion w-100 mb-4"
|
|
98
|
+
:class="{
|
|
99
|
+
'amelipro-accordion--opened': isOpen
|
|
100
|
+
}"
|
|
101
|
+
:style="generalAccordionStyles"
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
:id="`${uniqueId}-header`"
|
|
105
|
+
class="amelipro-accordion__header w-100 d-flex flex-column flex-sm-row align-center"
|
|
106
|
+
>
|
|
107
|
+
<div
|
|
108
|
+
class="btn-wrapper"
|
|
109
|
+
:style="headerLeftStyles"
|
|
110
|
+
>
|
|
111
|
+
<p
|
|
112
|
+
:id="uniqueId + 'title'"
|
|
113
|
+
:aria-level="titleLevel"
|
|
114
|
+
class="font-weight-semibold text-h3 mb-0"
|
|
115
|
+
role="heading"
|
|
116
|
+
>
|
|
117
|
+
<button
|
|
118
|
+
:id="`${uniqueId}-header-btn-open-close`"
|
|
119
|
+
:aria-controls="uniqueId"
|
|
120
|
+
:aria-expanded="isOpen === true ? 'true' : 'false'"
|
|
121
|
+
class="text-ap-grey-darken-1 text-left d-inline-flex align-center accordion-btn font-weight-semibold"
|
|
122
|
+
:class="titleUppercase ? 'text-uppercase' : undefined"
|
|
123
|
+
type="button"
|
|
124
|
+
@blur="focus = false"
|
|
125
|
+
@click="emitOpenCloseEvent()"
|
|
126
|
+
@focus="focus = false"
|
|
127
|
+
@mouseenter="hover = true"
|
|
128
|
+
@mouseleave="hover = false"
|
|
129
|
+
>
|
|
130
|
+
<AmeliproIcon
|
|
131
|
+
class="mr-2 accordion-icon"
|
|
132
|
+
:icon="isOpen ? 'triangleUp' : 'triangleDown'"
|
|
133
|
+
icon-bg-color="transparent"
|
|
134
|
+
:icon-color="hover ? 'ap-blue darken-2' : 'ap-blue darken-1'"
|
|
135
|
+
size="11px"
|
|
136
|
+
:unique-id="`${uniqueId}-icon`"
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
{{ accordionTitle }}
|
|
140
|
+
</button>
|
|
141
|
+
</p>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div
|
|
145
|
+
v-if="hasRightSlot"
|
|
146
|
+
class="right-slot"
|
|
147
|
+
:style="headerRightStyles"
|
|
148
|
+
>
|
|
149
|
+
<slot name="headerRight" />
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<div
|
|
153
|
+
v-show="isOpen === true"
|
|
154
|
+
:id="uniqueId"
|
|
155
|
+
:aria-labelledby="uniqueId + 'title'"
|
|
156
|
+
class="amelipro-accordion__wrapper"
|
|
157
|
+
role="region"
|
|
158
|
+
>
|
|
159
|
+
<div
|
|
160
|
+
class="w-100 amelipro-accordion__content text-ap-grey-darken-1"
|
|
161
|
+
:style="!hideSeparator ? `border-top: 1px solid ${borderHexColor}` : undefined"
|
|
162
|
+
>
|
|
163
|
+
<slot />
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</template>
|
|
168
|
+
|
|
169
|
+
<style lang="scss" scoped>
|
|
170
|
+
@use '@/assets/amelipro/apTokens';
|
|
171
|
+
|
|
172
|
+
.accordion-btn {
|
|
173
|
+
padding: 0;
|
|
174
|
+
background-color: transparent;
|
|
175
|
+
border: 0;
|
|
176
|
+
|
|
177
|
+
&:focus {
|
|
178
|
+
outline: 1px dotted apTokens.$ap-grey-darken1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.amelipro-accordion {
|
|
183
|
+
display: block;
|
|
184
|
+
position: relative;
|
|
185
|
+
max-width: 100%;
|
|
186
|
+
border-radius: apTokens.$card-radius;
|
|
187
|
+
text-decoration: none;
|
|
188
|
+
overflow-wrap: break-word;
|
|
189
|
+
white-space: normal;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.amelipro-accordion__header {
|
|
193
|
+
padding: apTokens.$card-padding-desktop;
|
|
194
|
+
word-break: break-all;
|
|
195
|
+
|
|
196
|
+
@media #{apTokens.$media-down-md} {
|
|
197
|
+
padding: apTokens.$card-padding-tablet;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@media #{apTokens.$media-down-sm} {
|
|
201
|
+
padding: apTokens.$card-padding-mobile;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.btn-wrapper {
|
|
205
|
+
display: inline-block;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.amelipro-accordion--opened & {
|
|
209
|
+
padding-bottom: apTokens.$card-padding-mobile;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.amelipro-accordion__wrapper {
|
|
214
|
+
width: 100%;
|
|
215
|
+
padding: 0 apTokens.$card-padding-desktop;
|
|
216
|
+
font-size: apTokens.$font-size-xs;
|
|
217
|
+
font-weight: apTokens.$ap-font-weight-regular;
|
|
218
|
+
|
|
219
|
+
@media #{apTokens.$media-down-md} {
|
|
220
|
+
padding: 0 apTokens.$card-padding-tablet;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@media #{apTokens.$media-down-sm} {
|
|
224
|
+
padding: 0 apTokens.$card-padding-mobile;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.amelipro-accordion__content {
|
|
229
|
+
padding-top: apTokens.$card-padding-desktop;
|
|
230
|
+
padding-bottom: apTokens.$card-padding-tablet;
|
|
231
|
+
|
|
232
|
+
@media #{apTokens.$media-down-sm} {
|
|
233
|
+
padding-bottom: apTokens.$card-padding-mobile;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.accordion-icon {
|
|
238
|
+
& :deep(.amelipro-custom-icon) {
|
|
239
|
+
height: auto !important;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import { expect, describe, it } from 'vitest'
|
|
3
|
+
import { vuetify } from '@tests/unit/setup'
|
|
4
|
+
import AmeliproAccordionTemplate from '../AmeliproAccordionTemplate.vue'
|
|
5
|
+
|
|
6
|
+
describe('AmeliproAccordionTemplate', () => {
|
|
7
|
+
it('render correctly', async () => {
|
|
8
|
+
const wrapper = mount(AmeliproAccordionTemplate, {
|
|
9
|
+
global: {
|
|
10
|
+
plugins: [vuetify],
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
accordionTitle: 'titre accordion',
|
|
14
|
+
uniqueId: 'amelipro-accordion-template-unique-id',
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproAccordionTemplate > render correctly 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="
|
|
6
|
+
amelipro-accordion
|
|
7
|
+
mb-4
|
|
8
|
+
w-100
|
|
9
|
+
"
|
|
10
|
+
id="amelipro-accordion-template-unique-id-container"
|
|
11
|
+
style="
|
|
12
|
+
background-color: #FFFFFF;
|
|
13
|
+
border: 1px solid #DDDEDE;
|
|
14
|
+
"
|
|
15
|
+
>
|
|
16
|
+
<div
|
|
17
|
+
class="
|
|
18
|
+
align-center
|
|
19
|
+
amelipro-accordion__header
|
|
20
|
+
d-flex
|
|
21
|
+
flex-column
|
|
22
|
+
flex-sm-row
|
|
23
|
+
w-100
|
|
24
|
+
"
|
|
25
|
+
id="amelipro-accordion-template-unique-id-header"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="btn-wrapper"
|
|
29
|
+
style="width: 100%;"
|
|
30
|
+
>
|
|
31
|
+
<p
|
|
32
|
+
aria-level="2"
|
|
33
|
+
class="
|
|
34
|
+
font-weight-semibold
|
|
35
|
+
mb-0
|
|
36
|
+
text-h3
|
|
37
|
+
"
|
|
38
|
+
id="amelipro-accordion-template-unique-idtitle"
|
|
39
|
+
role="heading"
|
|
40
|
+
>
|
|
41
|
+
<button
|
|
42
|
+
aria-controls="amelipro-accordion-template-unique-id"
|
|
43
|
+
aria-expanded="false"
|
|
44
|
+
class="
|
|
45
|
+
accordion-btn
|
|
46
|
+
align-center
|
|
47
|
+
d-inline-flex
|
|
48
|
+
font-weight-semibold
|
|
49
|
+
text-ap-grey-darken-1
|
|
50
|
+
text-left
|
|
51
|
+
"
|
|
52
|
+
id="amelipro-accordion-template-unique-id-header-btn-open-close"
|
|
53
|
+
type="button"
|
|
54
|
+
>
|
|
55
|
+
<span
|
|
56
|
+
class="
|
|
57
|
+
accordion-icon
|
|
58
|
+
amelipro-icon
|
|
59
|
+
mr-2
|
|
60
|
+
"
|
|
61
|
+
id="amelipro-accordion-template-unique-id-icon"
|
|
62
|
+
>
|
|
63
|
+
<span
|
|
64
|
+
aria-hidden="true"
|
|
65
|
+
class="
|
|
66
|
+
amelipro-custom-icon
|
|
67
|
+
custom-color
|
|
68
|
+
"
|
|
69
|
+
focusable="false"
|
|
70
|
+
role="img"
|
|
71
|
+
style="
|
|
72
|
+
color: #0C419A;
|
|
73
|
+
height: 11px;
|
|
74
|
+
width: 11px;
|
|
75
|
+
"
|
|
76
|
+
>
|
|
77
|
+
<span>
|
|
78
|
+
<svg
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
style="enable-background:new 0 0 42 42;"
|
|
81
|
+
version="1.1"
|
|
82
|
+
viewBox="0 0 42 42"
|
|
83
|
+
x="0px"
|
|
84
|
+
xml:space="preserve"
|
|
85
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
86
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
87
|
+
y="0px"
|
|
88
|
+
>
|
|
89
|
+
<polygon
|
|
90
|
+
class="shape-color"
|
|
91
|
+
points="21,39.2 42,2.8 0,2.8 "
|
|
92
|
+
/>
|
|
93
|
+
</svg>
|
|
94
|
+
</span>
|
|
95
|
+
</span>
|
|
96
|
+
</span>
|
|
97
|
+
titre accordion
|
|
98
|
+
</button>
|
|
99
|
+
</p>
|
|
100
|
+
</div>
|
|
101
|
+
<!-- v-if -->
|
|
102
|
+
</div>
|
|
103
|
+
<div
|
|
104
|
+
aria-labelledby="amelipro-accordion-template-unique-idtitle"
|
|
105
|
+
class="amelipro-accordion__wrapper"
|
|
106
|
+
id="amelipro-accordion-template-unique-id"
|
|
107
|
+
role="region"
|
|
108
|
+
style="display: none;"
|
|
109
|
+
>
|
|
110
|
+
<div
|
|
111
|
+
class="
|
|
112
|
+
amelipro-accordion__content
|
|
113
|
+
text-ap-grey-darken-1
|
|
114
|
+
w-100
|
|
115
|
+
"
|
|
116
|
+
style="
|
|
117
|
+
border-top-width: 1px;
|
|
118
|
+
border-top-style: solid;
|
|
119
|
+
border-top-color: #DDDEDE;
|
|
120
|
+
"
|
|
121
|
+
></div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
`;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import { expect, describe, it } from 'vitest'
|
|
3
|
+
import { vuetify } from '@tests/unit/setup'
|
|
4
|
+
import AmeliproAccordion from '../AmeliproAccordion.vue'
|
|
5
|
+
|
|
6
|
+
describe('AmeliproAccordion', () => {
|
|
7
|
+
it('render correctly', async () => {
|
|
8
|
+
const wrapper = mount(AmeliproAccordion, {
|
|
9
|
+
global: {
|
|
10
|
+
plugins: [vuetify],
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
accordionTitle: 'titre accordion',
|
|
14
|
+
uniqueId: 'amelipro-accordion-unique-id',
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
19
|
+
})
|
|
20
|
+
})
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproAccordion > render correctly 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
class="
|
|
6
|
+
amelipro-accordion
|
|
7
|
+
mb-4
|
|
8
|
+
w-100
|
|
9
|
+
"
|
|
10
|
+
id="amelipro-accordion-unique-id-container"
|
|
11
|
+
style="
|
|
12
|
+
background-color: #FFFFFF;
|
|
13
|
+
border: 1px solid #DDDEDE;
|
|
14
|
+
"
|
|
15
|
+
>
|
|
16
|
+
<div
|
|
17
|
+
class="
|
|
18
|
+
align-center
|
|
19
|
+
amelipro-accordion__header
|
|
20
|
+
d-flex
|
|
21
|
+
flex-column
|
|
22
|
+
flex-sm-row
|
|
23
|
+
w-100
|
|
24
|
+
"
|
|
25
|
+
id="amelipro-accordion-unique-id-header"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="btn-wrapper"
|
|
29
|
+
style="width: 100%;"
|
|
30
|
+
>
|
|
31
|
+
<p
|
|
32
|
+
aria-level="2"
|
|
33
|
+
class="
|
|
34
|
+
font-weight-semibold
|
|
35
|
+
mb-0
|
|
36
|
+
text-h3
|
|
37
|
+
"
|
|
38
|
+
id="amelipro-accordion-unique-idtitle"
|
|
39
|
+
role="heading"
|
|
40
|
+
>
|
|
41
|
+
<button
|
|
42
|
+
aria-controls="amelipro-accordion-unique-id"
|
|
43
|
+
aria-expanded="false"
|
|
44
|
+
class="
|
|
45
|
+
accordion-btn
|
|
46
|
+
align-center
|
|
47
|
+
d-inline-flex
|
|
48
|
+
font-weight-semibold
|
|
49
|
+
text-ap-grey-darken-1
|
|
50
|
+
text-left
|
|
51
|
+
"
|
|
52
|
+
id="amelipro-accordion-unique-id-header-btn-open-close"
|
|
53
|
+
type="button"
|
|
54
|
+
>
|
|
55
|
+
<span
|
|
56
|
+
class="
|
|
57
|
+
accordion-icon
|
|
58
|
+
amelipro-icon
|
|
59
|
+
mr-2
|
|
60
|
+
"
|
|
61
|
+
id="amelipro-accordion-unique-id-icon"
|
|
62
|
+
>
|
|
63
|
+
<span
|
|
64
|
+
aria-hidden="true"
|
|
65
|
+
class="
|
|
66
|
+
amelipro-custom-icon
|
|
67
|
+
custom-color
|
|
68
|
+
"
|
|
69
|
+
focusable="false"
|
|
70
|
+
role="img"
|
|
71
|
+
style="
|
|
72
|
+
color: #0C419A;
|
|
73
|
+
height: 11px;
|
|
74
|
+
width: 11px;
|
|
75
|
+
"
|
|
76
|
+
>
|
|
77
|
+
<span>
|
|
78
|
+
<svg
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
style="enable-background:new 0 0 42 42;"
|
|
81
|
+
version="1.1"
|
|
82
|
+
viewBox="0 0 42 42"
|
|
83
|
+
x="0px"
|
|
84
|
+
xml:space="preserve"
|
|
85
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
86
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
87
|
+
y="0px"
|
|
88
|
+
>
|
|
89
|
+
<polygon
|
|
90
|
+
class="shape-color"
|
|
91
|
+
points="21,39.2 42,2.8 0,2.8 "
|
|
92
|
+
/>
|
|
93
|
+
</svg>
|
|
94
|
+
</span>
|
|
95
|
+
</span>
|
|
96
|
+
</span>
|
|
97
|
+
titre accordion
|
|
98
|
+
</button>
|
|
99
|
+
</p>
|
|
100
|
+
</div>
|
|
101
|
+
<!-- v-if -->
|
|
102
|
+
</div>
|
|
103
|
+
<div
|
|
104
|
+
aria-labelledby="amelipro-accordion-unique-idtitle"
|
|
105
|
+
class="amelipro-accordion__wrapper"
|
|
106
|
+
id="amelipro-accordion-unique-id"
|
|
107
|
+
role="region"
|
|
108
|
+
style="display: none;"
|
|
109
|
+
>
|
|
110
|
+
<div
|
|
111
|
+
class="
|
|
112
|
+
amelipro-accordion__content
|
|
113
|
+
text-ap-grey-darken-1
|
|
114
|
+
w-100
|
|
115
|
+
"
|
|
116
|
+
style="
|
|
117
|
+
border-top-width: 1px;
|
|
118
|
+
border-top-style: solid;
|
|
119
|
+
border-top-color: #DDDEDE;
|
|
120
|
+
"
|
|
121
|
+
></div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Controls, Canvas, Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as AmeliproCaptchaStories from './AmeliproCaptcha.stories';
|
|
4
|
+
|
|
5
|
+
<Meta of={AmeliproCaptchaStories} />
|
|
6
|
+
|
|
7
|
+
# AmeliproCaptcha
|
|
8
|
+
|
|
9
|
+
L’élément `AmeliproCaptcha` est utilisé pour afficher des captchas.
|
|
10
|
+
|
|
11
|
+
<Canvas of={AmeliproCaptchaStories.Default} />
|
|
12
|
+
|
|
13
|
+
## API
|
|
14
|
+
|
|
15
|
+
<Controls of={AmeliproCaptchaStories.Default} />
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { ref, watch } from 'vue'
|
|
3
|
+
import AmeliproCaptcha from './AmeliproCaptcha.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
argTypes: {
|
|
7
|
+
'captchaInputLabelAudio': { description: 'Libellé du champ texte pour le captcha audio' },
|
|
8
|
+
'captchaInputLabelImg': { description: 'Libellé du champ texte pour le captcha image' },
|
|
9
|
+
'captchaTitle': { description: 'Titre du bloc captcha' },
|
|
10
|
+
'click-play': { description: 'Événement émis au clic sur le bouton lecture', type: 'void' },
|
|
11
|
+
'click-switch': { description: 'Événement émis au clic sur le bouton permettant de passer du captcha image au captcha audio (et inversement). Retourne `true` si l’on bascule vers le captcha audio, `false` dans le cas inverse.', type: 'boolean' },
|
|
12
|
+
'click-update': { description: 'Événement émis au clic sur le bouton permettant de changer d’image ou d’audio', type: 'void' },
|
|
13
|
+
'defaultAudio': { description: 'Charge le composant avec le captcha audio par défaut' },
|
|
14
|
+
'imgAlt': { description: 'Défini une alternative textuelle pour le captcha image' },
|
|
15
|
+
'imgMaxWidth': { description: 'Défini la largeur maximale du captcha image' },
|
|
16
|
+
'imgWidth': { description: 'Défini la largeur du captcha image' },
|
|
17
|
+
'modelValue': { description: 'Défini la valeur du champ de saisie' },
|
|
18
|
+
'switchCaptchaTypeLabelAudio': { description: 'Libellé du bouton permettant de passer du captcha audio au captcha image' },
|
|
19
|
+
'switchCaptchaTypeLabelImg': { description: 'Libellé du bouton permettant de passer du captcha image au captcha audio' },
|
|
20
|
+
'uniqueId': { description: 'Identifiant unique du bloc captcha' },
|
|
21
|
+
'update:model-value': { description: 'Événement émis au changement de valeur du champ de saisie. Retourne un object ICaptcha.', type: 'ICaptcha' },
|
|
22
|
+
'updateCaptchaLabelAudio': { description: 'Libellé du bouton permettant de changer d’audio' },
|
|
23
|
+
'updateCaptchaLabelImg': { description: 'Libellé du bouton permettant de changer d’image' },
|
|
24
|
+
},
|
|
25
|
+
component: AmeliproCaptcha,
|
|
26
|
+
title: 'Composants/Amelipro/Formulaires/AmeliproCaptcha',
|
|
27
|
+
} as Meta<typeof AmeliproCaptcha>
|
|
28
|
+
export default meta
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof AmeliproCaptcha>
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
modelValue: {
|
|
35
|
+
audioSrc: '/amelipro/sound/captcha.wav',
|
|
36
|
+
imgSrc: '/amelipro/img/captcha.png',
|
|
37
|
+
inputValue: '',
|
|
38
|
+
},
|
|
39
|
+
uniqueId: 'amelipro-captcha-unique-id',
|
|
40
|
+
},
|
|
41
|
+
parameters: {
|
|
42
|
+
sourceCode: [
|
|
43
|
+
{
|
|
44
|
+
name: 'Template',
|
|
45
|
+
code: `<template>
|
|
46
|
+
<AmeliproCaptcha
|
|
47
|
+
v-model="model"
|
|
48
|
+
unique-id="amelipro-captcha-unique-id"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
`,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Script',
|
|
55
|
+
code: `<script setup lang="ts">
|
|
56
|
+
import { AmeliproCaptcha } from '@cnamts/synapse'
|
|
57
|
+
import { ref } from 'vue'
|
|
58
|
+
|
|
59
|
+
const model = ref({
|
|
60
|
+
audioSrc: '/amelipro/sound/captcha.wav',
|
|
61
|
+
imgSrc: '/amelipro/img/captcha.png',
|
|
62
|
+
inputValue: '',
|
|
63
|
+
})
|
|
64
|
+
</script>
|
|
65
|
+
`,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
render: args => ({
|
|
70
|
+
components: { AmeliproCaptcha },
|
|
71
|
+
setup() {
|
|
72
|
+
const model = ref(args.modelValue)
|
|
73
|
+
|
|
74
|
+
// Optional: Keeps v-model in sync with storybook args
|
|
75
|
+
watch(() => args.modelValue, (newValue) => {
|
|
76
|
+
model.value = newValue
|
|
77
|
+
})
|
|
78
|
+
return { args, model }
|
|
79
|
+
},
|
|
80
|
+
template: `
|
|
81
|
+
<AmeliproCaptcha
|
|
82
|
+
v-bind="args"
|
|
83
|
+
v-model="model"
|
|
84
|
+
/>
|
|
85
|
+
`,
|
|
86
|
+
}),
|
|
87
|
+
}
|