@cnamts/synapse 1.0.11 → 1.0.13
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-QEfKOz0P.js → DateFilter-_EFzsvvM.js} +1 -1
- package/dist/{NumberFilter-C0h7gVzp.js → NumberFilter-CUxEbKJh.js} +1 -1
- package/dist/{PeriodFilter-8dVrKjju.js → PeriodFilter-D5ueqtKy.js} +1 -1
- package/dist/{SelectFilter-BI3QGbqb.js → SelectFilter-BciBNydy.js} +1 -1
- package/dist/{TextFilter-UOp1hcPp.js → TextFilter-DMN_WAQB.js} +1 -1
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordion.d.ts +7 -3
- package/dist/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.d.ts +2 -0
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.d.ts +7 -3
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproCard/AmeliproCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIcon/AmeliproIcon.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +5 -5
- package/dist/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproNumberedCard/AmeliproNumberedCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +24 -32
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +36 -48
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproTable/AmeliproTable.d.ts +4 -0
- package/dist/components/Amelipro/AmeliproTable/types.d.ts +11 -0
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +50 -68
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +0 -4
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +12 -16
- package/dist/components/Captcha/Captcha.d.ts +68 -0
- package/dist/components/Captcha/CaptchaAlert.d.ts +13 -0
- package/dist/components/Captcha/CaptchaBase.d.ts +55 -0
- package/dist/components/Captcha/CaptchaBtn.d.ts +12 -0
- package/dist/components/Captcha/CaptchaForm.d.ts +16 -0
- package/dist/components/Captcha/CaptchaImg.d.ts +12 -0
- package/dist/components/Captcha/CaptchaInformation.d.ts +20 -0
- package/dist/components/Captcha/captchaApi.d.ts +41 -0
- package/dist/components/Captcha/icons/volumeUp.d.ts +2 -0
- package/dist/components/Captcha/locales.d.ts +35 -0
- package/dist/components/Captcha/types.d.ts +2 -0
- package/dist/components/ChipList/ChipList.d.ts +2 -2
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +14 -14
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +5 -5
- package/dist/components/Customs/SyForm/SyForm.d.ts +6 -3
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +12 -16
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +96 -68
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +63 -38
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +23 -27
- package/dist/components/DatePicker/composables/useDatePickerViewMode.d.ts +2 -1
- package/dist/components/DatePicker/tests/setup.d.ts +816 -520
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +10 -10
- package/dist/components/NirField/NirField.d.ts +31 -34
- package/dist/components/NirField/locales.d.ts +1 -3
- package/dist/components/PasswordField/PasswordField.d.ts +2 -0
- package/dist/components/PeriodField/PeriodField.d.ts +192 -128
- package/dist/components/PhoneField/PhoneField.d.ts +13 -17
- package/dist/components/SearchListField/SearchListField.d.ts +5 -5
- package/dist/components/SyTextArea/SyTextArea.d.ts +0 -4
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -8
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -8
- package/dist/components/Tables/common/SyTablePagination.d.ts +5 -5
- package/dist/components/Tables/common/types.d.ts +4 -0
- package/dist/components/Tables/common/usePagination.d.ts +3 -4
- package/dist/components/Tables/common/useTableCheckbox.d.ts +10 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/validation/useFormValidation.d.ts +10 -0
- package/dist/composables/validation/useValidatable.d.ts +10 -2
- package/dist/design-system-v3.js +126 -125
- package/dist/design-system-v3.umd.cjs +265 -265
- package/dist/main-DISHlqcd.js +34217 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/overrides/_forms.scss +2 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.stories.ts +7 -4
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordion.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.vue +1 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/__tests__/__snapshots__/AmeliproAccordionFrieze.spec.ts.snap +574 -112
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +5 -2
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +2 -1
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.stories.ts +6 -3
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +5 -2
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +2 -1
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/AmeliproCheckbox.spec.ts +175 -0
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/__snapshots__/AmeliproCheckbox.spec.ts.snap +88 -0
- package/src/components/Amelipro/AmeliproCheckboxGroup/__tests__/AmeliproCheckboxGroup.spec.ts +423 -0
- package/src/components/Amelipro/AmeliproCheckboxGroup/{tests → __tests__}/__snapshots__/AmeliproCheckboxGroup.spec.ts.snap +112 -78
- package/src/components/Amelipro/AmeliproChips/__tests__/AmeliproChips.spec.ts +92 -0
- package/src/components/Amelipro/AmeliproChips/__tests__/__snapshots__/AmeliproChips.spec.ts.snap +81 -0
- package/src/components/Amelipro/AmeliproDialog/__tests__/AmeliproDialog.spec.ts +257 -0
- package/src/components/Amelipro/AmeliproDialog/__tests__/__snapshots__/AmeliproDialog.spec.ts.snap +61 -0
- package/src/components/Amelipro/AmeliproDisclosure/__tests__/AmeliproDisclosure.spec.ts +79 -0
- package/src/components/Amelipro/AmeliproDisclosure/__tests__/__snapshots__/AmeliproDisclosure.spec.ts.snap +89 -0
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.vue +6 -7
- package/src/components/Amelipro/AmeliproFooter/__tests__/AmeliproFooter.spec.ts +787 -0
- package/src/components/Amelipro/AmeliproFooter/__tests__/__snapshots__/AmeliproFooter.spec.ts.snap +318 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/AmeliproHeaderBrandSection.spec.ts +167 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +100 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/__tests__/AmeliproHeaderBar.spec.ts +312 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/__tests__/__snapshots__/AmeliproHeaderBar.spec.ts.snap +98 -0
- package/src/components/Amelipro/AmeliproHeader/__tests__/AmeliproHeader.spec.ts +361 -0
- package/src/components/Amelipro/AmeliproHeader/__tests__/__snapshots__/AmeliproHeader.spec.ts.snap +22 -0
- package/src/components/Amelipro/AmeliproMenu/__tests__/AmeliproMenu.spec.ts +168 -0
- package/src/components/Amelipro/AmeliproMenu/__tests__/__snapshots__/AmeliproMenu.spec.ts.snap +295 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/__tests__/AmeliproDropdownMenuBtn.spec.ts +128 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/__tests__/__snapshots__/AmeliproDropdownMenuBtn.spec.ts.snap +67 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/__tests__/AmeliproDropdownMenu.spec.ts +266 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/__tests__/__snapshots__/AmeliproDropdownMenu.spec.ts.snap +134 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/__tests__/AmeliproMessagingMenuBtn.spec.ts +72 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/__tests__/__snapshots__/AmeliproMessagingMenuBtn.spec.ts.snap +71 -0
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +12 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +81 -9
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +139 -61
- package/src/components/Amelipro/AmeliproTable/__tests__/AmeliproTable.spec.ts +10 -0
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +361 -187
- package/src/components/Amelipro/AmeliproTable/types.d.ts +11 -0
- package/src/components/Captcha/Captcha.mdx +72 -0
- package/src/components/Captcha/Captcha.stories.ts +276 -0
- package/src/components/Captcha/Captcha.vue +325 -0
- package/src/components/Captcha/CaptchaAlert.vue +60 -0
- package/src/components/Captcha/CaptchaBase.vue +219 -0
- package/src/components/Captcha/CaptchaBtn.vue +35 -0
- package/src/components/Captcha/CaptchaForm.vue +58 -0
- package/src/components/Captcha/CaptchaImg.vue +41 -0
- package/src/components/Captcha/CaptchaInformation.vue +64 -0
- package/src/components/Captcha/captchaApi.ts +111 -0
- package/src/components/Captcha/icons/volumeUp.vue +11 -0
- package/src/components/Captcha/locales.ts +35 -0
- package/src/components/Captcha/readme.md +5 -0
- package/src/components/Captcha/tests/Captcha.spec.ts +298 -0
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +716 -0
- package/src/components/Captcha/types.ts +2 -0
- package/src/components/Customs/Selects/SySelect/SySelect.vue +2 -2
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +4 -0
- package/src/components/Customs/SyForm/SyForm.stories.ts +133 -23
- package/src/components/Customs/SyForm/SyForm.vue +17 -1
- package/src/components/Customs/SyTextField/SyTextField.vue +29 -7
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +32 -9
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +154 -18
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +2 -2
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +35 -4
- package/src/components/DatePicker/composables/tests/useDatePickerViewMode.spec.ts +107 -72
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +6 -6
- package/src/components/DatePicker/composables/useDatePickerViewMode.ts +57 -7
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +14 -14
- package/src/components/DatePicker/tests/navigation.regression.spec.ts +74 -0
- package/src/components/DatePicker/tests/navigation.simple.spec.ts +137 -0
- package/src/components/NirField/NirField.stories.ts +85 -2
- package/src/components/NirField/NirField.vue +55 -18
- package/src/components/NirField/locales.ts +1 -3
- package/src/components/PasswordField/PasswordField.vue +39 -7
- package/src/components/PhoneField/PhoneField.vue +43 -10
- package/src/components/RangeField/tests/RangeField.spec.ts +0 -3
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +15 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +309 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +18 -3
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.mdx +15 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +228 -0
- package/src/components/Tables/SyTable/SyTable.vue +18 -3
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +63 -0
- package/src/components/Tables/common/SyTablePagination.vue +10 -8
- package/src/components/Tables/common/types.ts +4 -0
- package/src/components/Tables/common/usePagination.ts +11 -20
- package/src/components/Tables/common/useTableCheckbox.ts +23 -11
- package/src/components/index.ts +1 -0
- package/src/composables/validation/AvecVosComposants.mdx.old +1 -1
- package/src/composables/validation/FormValidation.stories.ts.old +5 -5
- package/src/composables/validation/useFormValidation.ts +46 -8
- package/src/composables/validation/useValidatable.ts +19 -8
- package/src/stories/Accessibilite/Introduction.mdx +1 -1
- package/src/stories/Demarrer/EnrichirLeDesignSystem.mdx +43 -0
- package/src/stories/Demarrer/EnrichirLeDesignSystem.stories.ts +239 -0
- package/src/stories/Demarrer/SignalerUneAnomalie.mdx +39 -0
- package/src/stories/Demarrer/SignalerUneAnomalie.stories.ts +261 -0
- package/dist/main-DyEOPqqn.js +0 -33329
- package/src/components/Amelipro/AmeliproCheckbox/tests/AmeliproCheckbox.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproCheckbox/tests/__snapshots__/AmeliproCheckbox.spec.ts.snap +0 -40
- package/src/components/Amelipro/AmeliproCheckboxGroup/tests/AmeliproCheckboxGroup.spec.ts +0 -46
- package/src/components/Amelipro/AmeliproChips/tests/AmeliproChips.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproChips/tests/__snapshots__/AmeliproChips.spec.ts.snap +0 -97
- package/src/components/Amelipro/AmeliproDialog/tests/AmeliproDialog.spec.ts +0 -24
- package/src/components/Amelipro/AmeliproDialog/tests/__snapshots__/AmeliproDialog.spec.ts.snap +0 -134
- package/src/components/Amelipro/AmeliproDisclosure/tests/AmeliproDisclosure.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproDisclosure/tests/__snapshots__/AmeliproDisclosure.spec.ts.snap +0 -104
- package/src/components/Amelipro/AmeliproFooter/tests/AmeliproFooter.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproFooter/tests/__snapshots__/AmeliproFooter.spec.ts.snap +0 -432
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/AmeliproHeaderBrandSection.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +0 -131
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/AmeliproHeaderBar.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/__snapshots__/AmeliproHeaderBar.spec.ts.snap +0 -172
- package/src/components/Amelipro/AmeliproHeader/tests/AmeliproHeader.spec.ts +0 -159
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +0 -841
- package/src/components/Amelipro/AmeliproMenu/tests/AmeliproMenu.spec.ts +0 -85
- package/src/components/Amelipro/AmeliproMenu/tests/__snapshots__/AmeliproMenu.spec.ts.snap +0 -537
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/tests/AmeliproDropdownMenuBtn.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/tests/__snapshots__/AmeliproDropdownMenuBtn.spec.ts.snap +0 -56
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/tests/AmeliproDropdownMenu.spec.ts +0 -28
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/tests/__snapshots__/AmeliproDropdownMenu.spec.ts.snap +0 -300
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/tests/AmeliproMessagingMenuBtn.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/tests/__snapshots__/AmeliproMessagingMenuBtn.spec.ts.snap +0 -89
- package/src/components/BackBtn/tests/__snapshots__/BackBtn.spec.ts.snap +0 -45
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +0 -1270
- package/src/stories/Demarrer/CreerUneIssue.mdx +0 -67
- package/src/stories/Demarrer/components.stories.ts +0 -25
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
2
2
|
import AmeliproAccordionList from './AmeliproAccordionList.vue'
|
|
3
3
|
import type { IDataListItem } from '../types'
|
|
4
4
|
import { computed, ref } from 'vue'
|
|
5
|
+
import { fn } from '@storybook/test'
|
|
5
6
|
|
|
6
7
|
const meta = {
|
|
7
8
|
argTypes: {
|
|
@@ -158,8 +159,9 @@ export const Default: Story = {
|
|
|
158
159
|
name: 'Par défaut',
|
|
159
160
|
args: {
|
|
160
161
|
items,
|
|
161
|
-
title: 'Exemple de liste de résultats',
|
|
162
|
-
uniqueId: 'amelipro-accordion-list-unique-id',
|
|
162
|
+
'title': 'Exemple de liste de résultats',
|
|
163
|
+
'uniqueId': 'amelipro-accordion-list-unique-id',
|
|
164
|
+
'onOpen-close': fn(),
|
|
163
165
|
},
|
|
164
166
|
parameters: {
|
|
165
167
|
sourceCode: [
|
|
@@ -289,6 +291,7 @@ export const Default: Story = {
|
|
|
289
291
|
template: `
|
|
290
292
|
<AmeliproAccordionList
|
|
291
293
|
v-bind="args"
|
|
294
|
+
@open-close="args['onOpen-close']"
|
|
292
295
|
>
|
|
293
296
|
<template #headingContent="item">
|
|
294
297
|
<p class="mb-0">
|
|
@@ -130,8 +130,10 @@
|
|
|
130
130
|
}
|
|
131
131
|
})
|
|
132
132
|
|
|
133
|
+
const emit = defineEmits(['click', 'change:sort-select', 'change:pagination-select', 'open-close'])
|
|
133
134
|
const openClose = (id: number): void => {
|
|
134
135
|
openId.value = openId.value === String(id) ? null : String(id)
|
|
136
|
+
emit('open-close', id, openId.value)
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
const hideSelectLabel = (): void => {
|
|
@@ -141,7 +143,6 @@
|
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
const emit = defineEmits(['click', 'change:sort-select', 'change:pagination-select'])
|
|
145
146
|
const emitClickEvent = (newCurrentPage: number): void => {
|
|
146
147
|
emit('click')
|
|
147
148
|
if (newCurrentPage !== null && newCurrentPage !== undefined) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import AmeliproAccordionResult from './AmeliproAccordionResult.vue'
|
|
3
|
+
import { fn } from '@storybook/test'
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
argTypes: {
|
|
@@ -21,9 +22,10 @@ type Story = StoryObj<typeof AmeliproAccordionResult>
|
|
|
21
22
|
|
|
22
23
|
export const Default: Story = {
|
|
23
24
|
args: {
|
|
24
|
-
accordionContent: '[Slot: accordionContent]',
|
|
25
|
-
headingContent: '[Slot: headingContent]',
|
|
26
|
-
uniqueId: 'amelipro-accordion-result-unique-id',
|
|
25
|
+
'accordionContent': '[Slot: accordionContent]',
|
|
26
|
+
'headingContent': '[Slot: headingContent]',
|
|
27
|
+
'uniqueId': 'amelipro-accordion-result-unique-id',
|
|
28
|
+
'onOpen-close': fn(),
|
|
27
29
|
},
|
|
28
30
|
parameters: {
|
|
29
31
|
sourceCode: [
|
|
@@ -55,6 +57,7 @@ export const Default: Story = {
|
|
|
55
57
|
<AmeliproAccordionResult
|
|
56
58
|
class="w-100"
|
|
57
59
|
v-bind="args"
|
|
60
|
+
@open-close="args['onOpen-close']"
|
|
58
61
|
>
|
|
59
62
|
<template #headingContent>
|
|
60
63
|
[Slot: headingContent]
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
+
const emit = defineEmits(['open-close'])
|
|
32
33
|
const opened = ref(props.isOpen)
|
|
33
34
|
|
|
34
35
|
const openClose = (): void => {
|
|
35
36
|
opened.value = !opened.value
|
|
37
|
+
emit('open-close', props.uniqueId, opened.value)
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
// Rendre publique la méthode openClose permet à un bouton ou à un composant externe de fermer/ouvrir l'accordéon
|
package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
2
2
|
import AmeliproAccordionResultList from './AmeliproAccordionResultList.vue'
|
|
3
3
|
import type { IDataListItem } from '../types'
|
|
4
4
|
import { computed, ref } from 'vue'
|
|
5
|
+
import { fn } from '@storybook/test'
|
|
5
6
|
|
|
6
7
|
const meta = {
|
|
7
8
|
argTypes: {
|
|
@@ -143,8 +144,9 @@ const items: IDataListItem[] = [
|
|
|
143
144
|
export const Default: Story = {
|
|
144
145
|
args: {
|
|
145
146
|
items,
|
|
146
|
-
title: 'Exemple de liste de résultats',
|
|
147
|
-
uniqueId: 'amelipro-accordion-result-list-unique-id',
|
|
147
|
+
'title': 'Exemple de liste de résultats',
|
|
148
|
+
'uniqueId': 'amelipro-accordion-result-list-unique-id',
|
|
149
|
+
'onOpen-close': fn(),
|
|
148
150
|
},
|
|
149
151
|
parameters: {
|
|
150
152
|
sourceCode: [
|
|
@@ -261,6 +263,7 @@ export const Default: Story = {
|
|
|
261
263
|
template: `
|
|
262
264
|
<AmeliproAccordionResultList
|
|
263
265
|
v-bind="args"
|
|
266
|
+
@open-close="args['onOpen-close']"
|
|
264
267
|
>
|
|
265
268
|
<template #headingContent="item">
|
|
266
269
|
<p class="mb-0">
|
|
@@ -122,8 +122,10 @@
|
|
|
122
122
|
}
|
|
123
123
|
})
|
|
124
124
|
|
|
125
|
+
const emit = defineEmits(['click', 'change:sort-select', 'change:pagination-select', 'open-close'])
|
|
125
126
|
const openClose = (id: number): void => {
|
|
126
127
|
openId.value = openId.value === String(id) ? null : String(id)
|
|
128
|
+
emit('open-close', id, openId.value)
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
const hideSelectLabel = (): void => {
|
|
@@ -133,7 +135,6 @@
|
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
const emit = defineEmits(['click', 'change:sort-select', 'change:pagination-select', 'open-close'])
|
|
137
138
|
const emitClickEvent = (newCurrentPage: number): void => {
|
|
138
139
|
emit('click')
|
|
139
140
|
if (newCurrentPage !== null && newCurrentPage !== undefined) {
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { VueWrapper, mount, shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { beforeEach, describe, expect, it } from 'vitest'
|
|
3
|
+
import AmeliproCheckbox from '../AmeliproCheckbox.vue'
|
|
4
|
+
import type { AmeliproCheckboxItem } from '../types'
|
|
5
|
+
import { AmeliproMessage } from '@/components'
|
|
6
|
+
import type { ComponentProps } from 'vue-component-type-helpers'
|
|
7
|
+
import type { ExpectedPropOptions } from '@tests/types'
|
|
8
|
+
import { type PropType } from 'vue'
|
|
9
|
+
import TestHelper from '@tests/helpers/TestHelper'
|
|
10
|
+
import { attachToApp } from '@tests/helpers/utils'
|
|
11
|
+
|
|
12
|
+
const expectedPropOptions: ExpectedPropOptions<typeof AmeliproCheckbox> = {
|
|
13
|
+
ariaRequired: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
checkbox: {
|
|
18
|
+
type: Object as PropType<AmeliproCheckboxItem>,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false,
|
|
24
|
+
},
|
|
25
|
+
errorDefault: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
isSwitch: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
labelLeft: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
requiredErrorMessage: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'Sélection obligatoire',
|
|
44
|
+
},
|
|
45
|
+
uniqueId: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Values pour les props "required"
|
|
52
|
+
const requiredPropValues = (): ComponentProps<typeof AmeliproCheckbox> => ({
|
|
53
|
+
checkbox: {
|
|
54
|
+
label: 'Required checkbox label',
|
|
55
|
+
value: 'required-checkbox-value',
|
|
56
|
+
},
|
|
57
|
+
uniqueId: 'required-unique-id',
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
// Valeurs pour les props "modified"
|
|
61
|
+
const modifiedPropValues = (): ComponentProps<typeof AmeliproCheckbox> => ({
|
|
62
|
+
ariaRequired: true,
|
|
63
|
+
checkbox: {
|
|
64
|
+
description: 'Modified checkbox description',
|
|
65
|
+
label: 'Modified checkbox label',
|
|
66
|
+
value: 'modified-checkbox-value',
|
|
67
|
+
} as AmeliproCheckboxItem,
|
|
68
|
+
disabled: true,
|
|
69
|
+
errorDefault: true,
|
|
70
|
+
modelValue: true,
|
|
71
|
+
requiredErrorMessage: 'Modified required error message',
|
|
72
|
+
uniqueId: 'modified-unique-id',
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const testHelper = new TestHelper(AmeliproCheckbox)
|
|
76
|
+
testHelper.setExpectedPropOptions(expectedPropOptions)
|
|
77
|
+
.setRequiredPropValues(requiredPropValues)
|
|
78
|
+
.setModifiedPropValues(modifiedPropValues)
|
|
79
|
+
|
|
80
|
+
describe('AmeliproCheckbox', () => {
|
|
81
|
+
describe('Snapshots', () => {
|
|
82
|
+
testHelper.snapshots()
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
describe('Properties', () => {
|
|
86
|
+
testHelper.properties()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
describe.todo('Setting props should update attributes of inner tags')
|
|
90
|
+
|
|
91
|
+
describe.todo('Setting props should update props or attributes of inner components')
|
|
92
|
+
|
|
93
|
+
describe('Events', () => {
|
|
94
|
+
let wrapper: VueWrapper<InstanceType<typeof AmeliproCheckbox>>
|
|
95
|
+
const inputWrapper = () => wrapper.find('[role="checkbox"]')
|
|
96
|
+
|
|
97
|
+
beforeEach(() => {
|
|
98
|
+
wrapper = mount(AmeliproCheckbox, {
|
|
99
|
+
attachTo: attachToApp(),
|
|
100
|
+
props: {
|
|
101
|
+
...requiredPropValues(),
|
|
102
|
+
checkbox: {
|
|
103
|
+
label: 'Exemple',
|
|
104
|
+
value: 'Valeur de la checkbox',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it('should test the input wrapper', () => {
|
|
111
|
+
expect(inputWrapper().attributes()).toMatchObject({
|
|
112
|
+
'aria-checked': 'false',
|
|
113
|
+
'aria-disabled': 'false',
|
|
114
|
+
'class': expect.stringContaining('amelipro-checkbox-input'),
|
|
115
|
+
'id': testHelper.default('uniqueId'),
|
|
116
|
+
'role': 'checkbox',
|
|
117
|
+
'tabindex': '0',
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
// TODO: Le contenu de emitted() semble buggé (non conforme à la doc)
|
|
122
|
+
it.skip('should react to input event', async () => {
|
|
123
|
+
expect(wrapper.emitted('input')).toBeUndefined()
|
|
124
|
+
await inputWrapper().trigger('input')
|
|
125
|
+
expect(wrapper.emitted('input')).toEqual([[true, 'Valeur de la checkbox']])
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
describe('errors', () => {
|
|
130
|
+
let wrapper: VueWrapper<InstanceType<typeof AmeliproCheckbox>>
|
|
131
|
+
|
|
132
|
+
beforeEach(() => {
|
|
133
|
+
wrapper = shallowMount(AmeliproCheckbox, {
|
|
134
|
+
props: {
|
|
135
|
+
...requiredPropValues(),
|
|
136
|
+
checkbox: {
|
|
137
|
+
description: 'The checkbox description',
|
|
138
|
+
label: 'the checkbox label',
|
|
139
|
+
value: 'the-checkbox-value',
|
|
140
|
+
} as AmeliproCheckboxItem,
|
|
141
|
+
},
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
it.skip('should display error message', async () => {
|
|
146
|
+
let componentWrapper = wrapper.findComponent(AmeliproMessage)
|
|
147
|
+
expect(componentWrapper.exists()).toBe(false)
|
|
148
|
+
|
|
149
|
+
await wrapper.setProps({ ariaRequired: true })
|
|
150
|
+
await wrapper.find('[role="checkbox"]').trigger('click')
|
|
151
|
+
await wrapper.find('[role="checkbox"]').trigger('click')
|
|
152
|
+
componentWrapper = wrapper.findComponent(AmeliproMessage)
|
|
153
|
+
|
|
154
|
+
expect(wrapper.find('[role="checkbox"]').attributes('aria-describedby')).toBe('the-id-error The checkbox description')
|
|
155
|
+
expect(componentWrapper.exists()).toBe(true)
|
|
156
|
+
expect(componentWrapper.find('.mb-0').text()).toBe('Sélection obligatoire')
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
it('should update label color classes', async () => {
|
|
160
|
+
const elementWrapper = wrapper.find('.checkbox-label')
|
|
161
|
+
expect(elementWrapper.exists()).toBe(true)
|
|
162
|
+
expect(elementWrapper.attributes('class')).toContain('text-ap-grey-darken-1')
|
|
163
|
+
|
|
164
|
+
await wrapper.setProps({ disabled: true })
|
|
165
|
+
expect(elementWrapper.exists()).toBe(true)
|
|
166
|
+
expect(elementWrapper.attributes('class')).toContain('text-ap-grey')
|
|
167
|
+
|
|
168
|
+
await wrapper.setProps({ disabled: false, ariaRequired: true })
|
|
169
|
+
await wrapper.find('[role="checkbox"]').trigger('click')
|
|
170
|
+
await wrapper.find('[role="checkbox"]').trigger('click')
|
|
171
|
+
expect(elementWrapper.exists()).toBe(true)
|
|
172
|
+
expect(elementWrapper.attributes('class')).toContain('checkbox-label text-ap-error')
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
})
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`AmeliproCheckbox > Snapshots > renders the component with all properties filled in 1`] = `
|
|
4
|
+
<div id="modified-unique-id-container">
|
|
5
|
+
<div class="
|
|
6
|
+
align-center
|
|
7
|
+
amelipro-checkbox
|
|
8
|
+
d-flex
|
|
9
|
+
">
|
|
10
|
+
<div
|
|
11
|
+
aria-checked="true"
|
|
12
|
+
aria-describedby="Modified checkbox description"
|
|
13
|
+
aria-disabled="true"
|
|
14
|
+
aria-required="true"
|
|
15
|
+
class="
|
|
16
|
+
align-center
|
|
17
|
+
amelipro-checkbox-input
|
|
18
|
+
d-inline-flex
|
|
19
|
+
flex-row
|
|
20
|
+
mr-0
|
|
21
|
+
text-body-1
|
|
22
|
+
"
|
|
23
|
+
id="modified-unique-id"
|
|
24
|
+
role="checkbox"
|
|
25
|
+
tabindex="-1"
|
|
26
|
+
>
|
|
27
|
+
<span
|
|
28
|
+
class="
|
|
29
|
+
checkbox-label
|
|
30
|
+
text-ap-grey
|
|
31
|
+
"
|
|
32
|
+
id="modified-unique-id-label-text"
|
|
33
|
+
>
|
|
34
|
+
Modified checkbox label
|
|
35
|
+
<span
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
class="d-inline-flex"
|
|
38
|
+
>
|
|
39
|
+
*
|
|
40
|
+
</span>
|
|
41
|
+
<span class="d-sr-only">
|
|
42
|
+
Champ obligatoire
|
|
43
|
+
</span>
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<!-- v-if -->
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
exports[`AmeliproCheckbox > Snapshots > renders the component with only required properties filled in 1`] = `
|
|
52
|
+
<div id="required-unique-id-container">
|
|
53
|
+
<div class="
|
|
54
|
+
align-center
|
|
55
|
+
amelipro-checkbox
|
|
56
|
+
d-flex
|
|
57
|
+
">
|
|
58
|
+
<div
|
|
59
|
+
aria-checked="false"
|
|
60
|
+
aria-disabled="false"
|
|
61
|
+
class="
|
|
62
|
+
align-center
|
|
63
|
+
amelipro-checkbox-input
|
|
64
|
+
d-inline-flex
|
|
65
|
+
flex-row
|
|
66
|
+
mr-0
|
|
67
|
+
text-body-1
|
|
68
|
+
"
|
|
69
|
+
id="required-unique-id"
|
|
70
|
+
role="checkbox"
|
|
71
|
+
tabindex="0"
|
|
72
|
+
>
|
|
73
|
+
<span
|
|
74
|
+
class="
|
|
75
|
+
checkbox-label
|
|
76
|
+
text-ap-grey-darken-1
|
|
77
|
+
"
|
|
78
|
+
id="required-unique-id-label-text"
|
|
79
|
+
>
|
|
80
|
+
Required checkbox label
|
|
81
|
+
<!-- v-if -->
|
|
82
|
+
<!-- v-if -->
|
|
83
|
+
</span>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<!-- v-if -->
|
|
87
|
+
</div>
|
|
88
|
+
`;
|