@cnamts/synapse 1.0.10 → 1.0.11
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-C0wDuzgn.js → DateFilter-QEfKOz0P.js} +1 -1
- package/dist/{NumberFilter-CBj7zdOi.js → NumberFilter-C0h7gVzp.js} +1 -1
- package/dist/{PeriodFilter-DB4wWyKy.js → PeriodFilter-8dVrKjju.js} +1 -1
- package/dist/{SelectFilter-Dces8572.js → SelectFilter-BI3QGbqb.js} +1 -1
- package/dist/{TextFilter-BU9nlkuS.js → TextFilter-UOp1hcPp.js} +1 -1
- package/dist/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.d.ts +9 -0
- package/dist/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.d.ts +9 -0
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +6 -24
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +18 -0
- package/dist/components/Amelipro/AmeliproFooter/AmeliproFooter.d.ts +9 -0
- package/dist/components/Amelipro/AmeliproFooter/locales.d.ts +0 -1
- package/dist/components/Amelipro/AmeliproFooter/types.d.ts +1 -0
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeader.d.ts +2 -0
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.d.ts +6 -2
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.d.ts +8 -4
- package/dist/components/Amelipro/AmeliproPageLayout/AmeliproPageLayout.d.ts +2 -0
- package/dist/components/Amelipro/AmeliproResultList/AmeliproResultList.d.ts +9 -0
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +5 -5
- package/dist/components/Amelipro/AmeliproTable/AmeliproTable.d.ts +9 -0
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +6 -6
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproUpload/types.d.ts +10 -0
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +2 -2
- package/dist/components/Customs/Selects/SelectBtnField/SelectBtnField.d.ts +1 -1
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +3 -3
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +1 -1
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +12 -12
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +6 -6
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +3 -3
- package/dist/components/DatePicker/tests/setup.d.ts +96 -96
- package/dist/components/LangBtn/LangBtn.d.ts +2 -2
- package/dist/components/NirField/NirField.d.ts +6 -6
- package/dist/components/PeriodField/PeriodField.d.ts +24 -24
- package/dist/components/PhoneField/PhoneField.d.ts +3 -3
- package/dist/components/SearchListField/SearchListField.d.ts +10 -1
- package/dist/components/SyTextArea/SyTextArea.d.ts +2 -2
- package/dist/components/Tables/common/SyTablePagination.d.ts +4 -4
- package/dist/components/Tables/common/TableHeader.d.ts +6 -0
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +2 -2
- package/dist/components/Tables/common/types.d.ts +7 -0
- package/dist/components/Tables/common/useTableHeaders.d.ts +10 -20
- package/dist/design-system-v3.js +1 -1
- package/dist/design-system-v3.umd.cjs +266 -266
- package/dist/main-DyEOPqqn.js +33329 -0
- package/dist/style.css +1 -1
- package/dist/utils/amelipro/rules/uploadFile/index.d.ts +6 -0
- package/dist/utils/amelipro/toKebabCase/toKebabCase.d.ts +1 -0
- package/dist/utils/rules/isRequired/index.d.ts +5 -2
- package/dist/utils/rules/types.d.ts +12 -3
- package/package.json +12 -3
- package/src/assets/amelipro/img/bg-pieces-jointe.svg +28 -0
- package/src/assets/overrides/_btns.scss +1 -0
- package/src/assets/overrides/_forms.scss +5 -0
- package/src/components/Accordion/tests/accordion.spec.ts +0 -55
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/__tests__/AmeliproAccordionTemplate.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordion/__tests__/AmeliproAccordion.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordionFrieze/__tests__/AmeliproAccordionFrieze.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/AmeliproAccordionGroup.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +6 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +5 -1
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/AmeliproAccordionList.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +13 -2
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/AmeliproAccordionResultTemplate.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/AmeliproAccordionResult.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +6 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +5 -1
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/AmeliproAccordionResultList.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +13 -2
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.stories.ts +1 -1
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/AmeliproAutoCompleteField.spec.ts +277 -55
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +113 -233
- package/src/components/Amelipro/AmeliproBadge/__tests__/AmeliproBadge.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproBreadcrumb/__tests__/AmeliproBreadcrumb.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproBtn/__tests__/AmeliproBtn.spec.ts +478 -0
- package/src/components/Amelipro/AmeliproBtn/__tests__/__snapshots__/AmeliproBtn.spec.ts.snap +74 -0
- package/src/components/Amelipro/AmeliproCallback/__tests__/AmeliproCallback.spec.ts +100 -0
- package/src/components/Amelipro/AmeliproCallback/__tests__/__snapshots__/AmeliproCallback.spec.ts.snap +50 -0
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/AmeliproCaptcha.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/__snapshots__/AmeliproCaptcha.spec.ts.snap +10 -2
- package/src/components/Amelipro/AmeliproCard/__tests__/AmeliproCard.spec.ts +402 -0
- package/src/components/Amelipro/AmeliproCard/__tests__/__snapshots__/AmeliproCard.spec.ts.snap +106 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.stories.ts +2 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.vue +11 -1
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/__tests__/AmeliproCarouselItem.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproCarousel/__tests__/AmeliproCarousel.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproCarousel/__tests__/__snapshots__/AmeliproCarousel.spec.ts.snap +0 -2
- package/src/components/Amelipro/AmeliproCheckbox/tests/AmeliproCheckbox.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproCheckboxGroup/tests/AmeliproCheckboxGroup.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproChips/tests/AmeliproChips.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproClickableTile/tests/AmeliproClickableTile.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproContentLayout/__tests__/AmeliproContentLayout.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproCopyBtn/__tests__/AmeliproCopyBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/AmeliproCustomSelector.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproTooth/tests/AmeliproTooth.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproDentalChart/tests/AmeliproDentalChart.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproDialog/tests/AmeliproDialog.spec.ts +0 -2
- package/src/components/Amelipro/AmeliproDisclosure/tests/AmeliproDisclosure.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproErrorTemplate/__tests__/AmeliproErrorTemplate.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/AmeliproFilePreview.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproFirstLogin/__tests__/AmeliproFirstLogin.spec.ts +0 -2
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.stories.ts +1 -0
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.vue +5 -1
- package/src/components/Amelipro/AmeliproFooter/locales.ts +0 -1
- package/src/components/Amelipro/AmeliproFooter/tests/AmeliproFooter.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproFooter/types.d.ts +1 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.stories.ts +18 -8
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +3 -1
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.vue +3 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.vue +10 -2
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/AmeliproHeaderBrandSection.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +2 -3
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/tests/AmeliproLogoAm.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/AmeliproHeaderBar.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/__snapshots__/AmeliproHeaderBar.spec.ts.snap +2 -3
- package/src/components/Amelipro/AmeliproHeader/tests/AmeliproHeader.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +2 -3
- package/src/components/Amelipro/AmeliproIcon/tests/AmeliproIcon.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproIconBtn/tests/AmeliproIconBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproIllustratedDataTile/tests/AmeliproIllustratedDataTile.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/tests/AmeliproIllustratedRadioGroup.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproMailTile/tests/AmeliproMailTile.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproMenu/tests/AmeliproMenu.spec.ts +0 -2
- package/src/components/Amelipro/AmeliproMessage/tests/AmeliproMessage.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenuBtn/tests/AmeliproDropdownMenuBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/tests/AmeliproDropdownMenu.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingMenuBtn/tests/AmeliproMessagingMenuBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproMessagingLayout/tests/AmeliproMessagingLayout.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/tests/AmeliproMultipleFoldingCard.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproNumberedCard/tests/AmeliproNumberedCard.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproOnboarding/tests/AmeliproOnboarding.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPageLayout/AmeliproPageLayout.stories.ts +9 -2
- package/src/components/Amelipro/AmeliproPageLayout/AmeliproPageLayout.vue +4 -1
- package/src/components/Amelipro/AmeliproPageLayout/tests/AmeliproPageLayout.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +2 -3
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/tests/AmeliproPaginationBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPagination/tests/AmeliproPagination.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPatientBanner/tests/AmeliproPatientBanner.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/AmeliproPatientLogged.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +13 -2
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLoginForm/__tests__/AmeliproPatientLoginForm.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPatientLogin/__tests__/AmeliproPatientLogin.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/AmeliproPostalAddressCityRow.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/__snapshots__/AmeliproPostalAddressCityRow.spec.ts.snap +24 -4
- package/src/components/Amelipro/AmeliproPostalAddressField/tests/AmeliproPostalAddressField.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproPostalAddressField/tests/__snapshots__/AmeliproPostalAddressField.spec.ts.snap +40 -8
- package/src/components/Amelipro/AmeliproRadioGroup/tests/AmeliproRadioGroup.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +6 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +5 -1
- package/src/components/Amelipro/AmeliproResultList/__tests__/AmeliproResultList.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +13 -2
- package/src/components/Amelipro/AmeliproSelect/tests/AmeliproSelect.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproSelect/tests/__snapshots__/AmeliproSelect.spec.ts.snap +13 -2
- package/src/components/Amelipro/AmeliproStateTile/tests/AmeliproStateTile.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproStatus/tests/AmeliproStatus.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/tests/AmeliproStepBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproStepper/tests/AmeliproStepper.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +6 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +5 -1
- package/src/components/Amelipro/AmeliproTable/__tests__/AmeliproTable.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +13 -2
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/tests/AmeliproTabBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTabs/tests/AmeliproTabs.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.stories.ts +1 -1
- package/src/components/Amelipro/AmeliproTextArea/__tests__/AmeliproTextArea.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +10 -2
- package/src/components/Amelipro/AmeliproTextField/tests/AmeliproTextField.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTextField/tests/__snapshots__/AmeliproTextField.spec.ts.snap +10 -2
- package/src/components/Amelipro/AmeliproTileBtn/tests/AmeliproTileBtn.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTooltips/tests/AmeliproTooltips.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproTransmission/tests/AmeliproTransmission.spec.ts +0 -4
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.mdx +38 -0
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.stories.ts +99 -0
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.vue +714 -0
- package/src/components/Amelipro/AmeliproUpload/README.md +66 -0
- package/src/components/Amelipro/AmeliproUpload/__tests__/AmeliproUpload.spec.ts +74 -0
- package/src/components/Amelipro/AmeliproUpload/types.d.ts +10 -0
- package/src/components/Amelipro/ServiceMenu/ServiceBtn/tests/ServiceBtn.spec.ts +0 -4
- package/src/components/Amelipro/ServiceMenu/ServiceList/tests/ServiceList.spec.ts +0 -4
- package/src/components/Amelipro/ServiceMenu/ServiceMenuContent/tests/ServiceMenuContent.spec.ts +0 -4
- package/src/components/Amelipro/ServiceMenu/tests/ServiceMenu.spec.ts +0 -4
- package/src/components/Amelipro/StructureMenu/StructureBtn/tests/StructureBtn.spec.ts +0 -4
- package/src/components/Amelipro/StructureMenu/StructureItem/tests/StructureItem.spec.ts +0 -4
- package/src/components/Amelipro/StructureMenu/StructureList/tests/StructureList.spec.ts +0 -4
- package/src/components/Amelipro/StructureMenu/StructureTabs/tests/StructureTabs.spec.ts +0 -4
- package/src/components/Amelipro/StructureMenu/tests/StructureMenu.spec.ts +0 -2
- package/src/components/Amelipro/UserInformationSummary/tests/UserInformationSummary.spec.ts +0 -4
- package/src/components/Amelipro/UserMenu/UserMenuDetails/tests/UserMenuDetails.spec.ts +0 -4
- package/src/components/Amelipro/UserMenu/tests/UserMenu.spec.ts +0 -4
- package/src/components/BackBtn/BackBtn.vue +2 -1
- package/src/components/BackBtn/tests/BackBtn.spec.ts +1 -23
- package/src/components/BackToTopBtn/tests/BackToTopBtn.spec.ts +3 -34
- package/src/components/ChipList/tests/chipList.spec.ts +0 -38
- package/src/components/CollapsibleList/tests/CollapsibleList.spec.ts +0 -8
- package/src/components/ContextualMenu/tests/ContextualMenu.spec.ts +0 -28
- package/src/components/CookieBanner/tests/CookieBanner.spec.ts +1 -11
- package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.spec.ts +0 -16
- package/src/components/CookiesSelection/CookiesTable/tests/CookiesTable.spec.ts +0 -4
- package/src/components/CookiesSelection/tests/CookiesSelection.spec.ts +0 -16
- package/src/components/CopyBtn/tests/CopyBtn.spec.ts +0 -31
- package/src/components/CopyBtn/tests/__snapshots__/CopyBtn.spec.ts.snap +1 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +3 -37
- package/src/components/Customs/Selects/SyBtnSelect/tests/SyBtnSelect.spec.ts +0 -28
- package/src/components/Customs/Selects/SyInputSelect/tests/SyInputSelect.spec.ts +8 -104
- package/src/components/Customs/Selects/SySelect/SySelect.vue +2 -2
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +0 -135
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +1 -1
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +1 -1
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +0 -20
- package/src/components/Customs/SyForm/SyForm.mdx +1 -3
- package/src/components/Customs/SyForm/SyForm.stories.ts +131 -143
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +0 -2
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +1 -27
- package/src/components/DataList/DataListLoading/tests/DataListLoading.spec.ts +0 -4
- package/src/components/DataList/tests/DataList.spec.ts +0 -26
- package/src/components/DataListGroup/tests/DataListGroup.spec.ts +0 -10
- package/src/components/DataListItem/tests/DataListItem.spec.ts +0 -28
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.events.spec.ts +0 -16
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.spec.ts +4 -34
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.events.spec.ts +0 -10
- package/src/components/DatePicker/DateTextInput/DateTextInput.events.spec.ts +0 -13
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +0 -10
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +0 -52
- package/src/components/DatePicker/tests/DatePicker.validation.spec.ts +0 -543
- package/src/components/DiacriticPicker/tests/DiatriticPicker.spec.ts +0 -6
- package/src/components/DialogBox/tests/DialogBox.spec.ts +0 -63
- package/src/components/DownloadBtn/tests/DownloadBtn.spec.ts +0 -7
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +0 -7
- package/src/components/ExternalLinks/tests/ExternalLinks.spec.ts +0 -16
- package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +1 -0
- package/src/components/FileList/tests/FileList.spec.ts +0 -13
- package/src/components/FilePreview/tests/FilePreview.spec.ts +1 -6
- package/src/components/FileUpload/tests/FileUpload.spec.ts +1 -48
- package/src/components/FilterInline/tests/FilterInline.spec.ts +0 -10
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +2 -0
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +0 -10
- package/src/components/FooterBar/tests/FooterBar.spec.ts +7 -19
- package/src/components/FranceConnectBtn/tests/FranceConnectBtn.spec.ts +0 -11
- package/src/components/HeaderBar/HeaderBar.stories.ts +37 -38
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +0 -6
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +0 -6
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/useHandleSubMenus.spec.ts +0 -13
- package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +1 -22
- package/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.ts +0 -10
- package/src/components/HeaderBar/tests/HeaderBar.spec.ts +0 -16
- package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +0 -4
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +22 -15
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +0 -4
- package/src/components/HeaderToolbar/tests/HeaderToolBar.spec.ts +7 -51
- package/src/components/LangBtn/tests/LangBtn.spec.ts +0 -56
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +22 -67
- package/src/components/NirField/NirField.stories.ts +2 -0
- package/src/components/NirField/NirField.vue +48 -25
- package/src/components/NirField/tests/NirField.cursor.spec.ts +315 -0
- package/src/components/NirField/tests/NirField.spec.ts +215 -17
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +2 -12
- package/src/components/NotificationBar/NotificationBar.mdx +1 -1
- package/src/components/NotificationBar/NotificationBar.stories.ts +1 -0
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +5 -44
- package/src/components/PageContainer/tests/PageContainer.spec.ts +1 -15
- package/src/components/PaginatedTable/tests/PaginatedTable.spec.ts +0 -23
- package/src/components/PasswordField/tests/PasswordField.spec.ts +4 -38
- package/src/components/PeriodField/tests/PeriodField.spec.ts +4 -74
- package/src/components/PhoneField/tests/PhoneField.spec.ts +3 -154
- package/src/components/RangeField/RangeSlider/tests/rangeSlider.spec.ts +0 -13
- package/src/components/RangeField/RangeSlider/tests/useThumbKeyboard.spec.ts +0 -34
- package/src/components/RangeField/RangeSlider/tests/useTrack.spec.ts +4 -24
- package/src/components/RangeField/tests/RangeField.spec.ts +0 -31
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +78 -30
- package/src/components/RatingPicker/EmotionPicker/tests/EmotionPicker.spec.ts +2 -23
- package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +2 -17
- package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +3 -22
- package/src/components/RatingPicker/tests/Rating.spec.ts +0 -10
- package/src/components/RatingPicker/tests/RatingPicker.spec.ts +0 -23
- package/src/components/SearchListField/SearchListField.mdx +3 -4
- package/src/components/SearchListField/SearchListField.stories.ts +103 -3
- package/src/components/SearchListField/SearchListField.vue +34 -9
- package/src/components/SearchListField/tests/SearchListField.spec.ts +98 -44
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.spec.ts +0 -32
- package/src/components/SubHeader/tests/SubHeader.spec.ts +0 -18
- package/src/components/SyAlert/tests/SyAlert.spec.ts +0 -14
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +0 -31
- package/src/components/TableToolbar/tests/TableToolbar.spec.ts +0 -31
- package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +72 -24
- package/src/components/Tables/SyServerTable/SyServerTable.vue +15 -3
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +0 -58
- package/src/components/Tables/SyTable/SyTable.vue +30 -7
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +0 -55
- package/src/components/Tables/common/SyTablePagination.vue +1 -1
- package/src/components/Tables/common/TableHeader.vue +57 -2
- package/src/components/Tables/common/filters/tests/DateFilter.spec.ts +0 -11
- package/src/components/Tables/common/filters/tests/NumberFilter.spec.ts +0 -11
- package/src/components/Tables/common/filters/tests/PeriodFilter.spec.ts +0 -11
- package/src/components/Tables/common/filters/tests/SelectFilter.spec.ts +0 -11
- package/src/components/Tables/common/filters/tests/TextFilter.spec.ts +0 -11
- package/src/components/Tables/common/tests/SyTableFilter.spec.ts +0 -31
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +0 -49
- package/src/components/Tables/common/tests/TableHeader.spec.ts +0 -19
- package/src/components/Tables/common/tests/filterByRange.spec.ts +0 -13
- package/src/components/Tables/common/tests/resize.spec.ts +0 -13
- package/src/components/Tables/common/types.ts +7 -0
- package/src/components/Tables/common/useStoredOptions.ts +1 -1
- package/src/components/Tables/common/useTableHeaders.ts +73 -6
- package/src/components/ToolbarContainer/tests/ToolbarContainer.spec.ts +0 -19
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +0 -15
- package/src/components/Usages/tests/Usages.spec.ts +3 -31
- package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +0 -31
- package/src/composables/useFilterable/useFilterable.ts +33 -24
- package/src/stories/GuideDuDev/FormValidationGuide.mdx +746 -114
- package/src/stories/GuideDuDev/UtiliserLesRules.mdx +138 -136
- package/src/utils/amelipro/rules/uploadFile/index.ts +119 -0
- package/src/utils/amelipro/rules/uploadFile/tests/uploadFile.spec.ts +55 -0
- package/src/utils/amelipro/toKebabCase/toKebabCase.ts +11 -0
- package/src/utils/rules/doMatchPattern/index.ts +1 -1
- package/src/utils/rules/isDateValid/index.ts +1 -1
- package/src/utils/rules/isExactLength/index.ts +4 -0
- package/src/utils/rules/isHolidayDay/index.ts +1 -1
- package/src/utils/rules/isHolidayDay/tests/isHolidayDay.spec.ts +24 -14
- package/src/utils/rules/isMaxLength/index.ts +4 -0
- package/src/utils/rules/isMinLength/index.ts +4 -0
- package/src/utils/rules/isNotAfterDate/index.ts +4 -0
- package/src/utils/rules/isNotAfterToday/index.ts +1 -1
- package/src/utils/rules/isNotBeforeDate/index.ts +4 -0
- package/src/utils/rules/isNotBeforeToday/index.ts +1 -1
- package/src/utils/rules/isRequired/index.ts +11 -5
- package/src/utils/rules/isRequired/tests/{isRequred.spec.ts → isRequired.spec.ts} +24 -0
- package/src/utils/rules/isValidEmail/index.ts +1 -1
- package/src/utils/rules/types.d.ts +12 -3
- package/dist/main-Dt4iNotT.js +0 -33147
- package/src/components/Amelipro/AmeliproBtn/tests/AmeliproBtn.spec.ts +0 -22
- package/src/components/Amelipro/AmeliproBtn/tests/__snapshots__/AmeliproBtn.spec.ts.snap +0 -46
- package/src/components/Amelipro/AmeliproCallback/tests/AmeliproCallback.spec.ts +0 -21
- package/src/components/Amelipro/AmeliproCallback/tests/__snapshots__/AmeliproCallback.spec.ts.snap +0 -165
- package/src/components/Amelipro/AmeliproCard/tests/AmeliproCard.spec.ts +0 -23
- package/src/components/Amelipro/AmeliproCard/tests/__snapshots__/AmeliproCard.spec.ts.snap +0 -78
- package/src/components/DialogBox/tests/__snapshots__/DialogBox.spec.ts.snap +0 -204
- /package/src/composables/validation/{AvecVosComposants.mdx → AvecVosComposants.mdx.old} +0 -0
- /package/src/composables/validation/{FormValidation.mdx → FormValidation.mdx.old} +0 -0
- /package/src/composables/validation/{FormValidation.stories.ts → FormValidation.stories.ts.old} +0 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import NirField from '../NirField.vue'
|
|
3
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Tests spécifiques pour la préservation de la position du curseur
|
|
7
|
+
* quand displayKey=false
|
|
8
|
+
*/
|
|
9
|
+
describe('NirField - Cursor Position Preservation', () => {
|
|
10
|
+
let wrapper: ReturnType<typeof mount<typeof NirField>>
|
|
11
|
+
let activeWrappers: ReturnType<typeof mount>[] = []
|
|
12
|
+
|
|
13
|
+
async function flushPromises() {
|
|
14
|
+
return new Promise(resolve => setTimeout(resolve, 0))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
beforeEach(async () => {
|
|
18
|
+
wrapper = mount(NirField, {
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: undefined,
|
|
21
|
+
displayKey: false, // ⚠️ Mode sans clé
|
|
22
|
+
required: false,
|
|
23
|
+
outlined: true,
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
activeWrappers.push(wrapper)
|
|
28
|
+
await wrapper.vm.$nextTick()
|
|
29
|
+
await flushPromises()
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
afterEach(async () => {
|
|
33
|
+
await flushPromises()
|
|
34
|
+
for (const wrapper of activeWrappers) {
|
|
35
|
+
if (wrapper && typeof wrapper.unmount === 'function') {
|
|
36
|
+
wrapper.unmount()
|
|
37
|
+
await flushPromises()
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
activeWrappers = []
|
|
41
|
+
vi.resetAllMocks()
|
|
42
|
+
await flushPromises()
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it('should not reposition cursor when editing middle of NIR', async () => {
|
|
46
|
+
const numberInput = wrapper.find('.number-field input')
|
|
47
|
+
const inputElement = numberInput.element as HTMLInputElement
|
|
48
|
+
|
|
49
|
+
// 1. Saisir un NIR complet
|
|
50
|
+
await numberInput.setValue('2940375120005')
|
|
51
|
+
await wrapper.vm.$nextTick()
|
|
52
|
+
await flushPromises()
|
|
53
|
+
|
|
54
|
+
// 2. Positionner le curseur au milieu (après "2940")
|
|
55
|
+
inputElement.focus()
|
|
56
|
+
inputElement.setSelectionRange(4, 4)
|
|
57
|
+
|
|
58
|
+
// Vérifier la position initiale
|
|
59
|
+
expect(inputElement.selectionStart).toBe(4)
|
|
60
|
+
|
|
61
|
+
// 3. Spy sur les méthodes qui pourraient repositionner le curseur
|
|
62
|
+
const focusSpy = vi.spyOn(inputElement, 'focus')
|
|
63
|
+
const clickSpy = vi.spyOn(inputElement, 'click')
|
|
64
|
+
|
|
65
|
+
// 4. Simuler la suppression d'un chiffre au milieu
|
|
66
|
+
// Supprimer le "4" dans "2940" -> "290"
|
|
67
|
+
const currentValue = inputElement.value.replace(/\s/g, '') // Enlever les espaces
|
|
68
|
+
const newValue = currentValue.slice(0, 3) + currentValue.slice(4) // Supprimer le 4ème caractère
|
|
69
|
+
|
|
70
|
+
await numberInput.setValue(newValue)
|
|
71
|
+
await wrapper.vm.$nextTick()
|
|
72
|
+
await flushPromises()
|
|
73
|
+
|
|
74
|
+
// 5. Vérifier qu'aucun focus/click automatique n'a été déclenché
|
|
75
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
76
|
+
expect(clickSpy).not.toHaveBeenCalled()
|
|
77
|
+
|
|
78
|
+
focusSpy.mockRestore()
|
|
79
|
+
clickSpy.mockRestore()
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('should not trigger watchers when displayKey is false', async () => {
|
|
83
|
+
// Spy sur console.log pour détecter d'éventuels logs de debug
|
|
84
|
+
const consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {})
|
|
85
|
+
const focusSpy = vi.spyOn(HTMLElement.prototype, 'focus')
|
|
86
|
+
|
|
87
|
+
const numberInput = wrapper.find('.number-field input')
|
|
88
|
+
|
|
89
|
+
// Simuler des modifications qui déclencheraient normalement les watchers
|
|
90
|
+
await numberInput.setValue('123')
|
|
91
|
+
await wrapper.vm.$nextTick()
|
|
92
|
+
|
|
93
|
+
// Effacer complètement
|
|
94
|
+
await numberInput.setValue('')
|
|
95
|
+
await wrapper.vm.$nextTick()
|
|
96
|
+
await flushPromises()
|
|
97
|
+
|
|
98
|
+
// Vérifier qu'aucun focus automatique n'a été déclenché
|
|
99
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
100
|
+
|
|
101
|
+
consoleSpy.mockRestore()
|
|
102
|
+
focusSpy.mockRestore()
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it('should not add our custom keydown listeners when displayKey is false', async () => {
|
|
106
|
+
// Créer un nouveau wrapper pour tester onMounted
|
|
107
|
+
const addEventListenerSpy = vi.spyOn(HTMLElement.prototype, 'addEventListener')
|
|
108
|
+
|
|
109
|
+
const newWrapper = mount(NirField, {
|
|
110
|
+
props: {
|
|
111
|
+
displayKey: false,
|
|
112
|
+
required: false,
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
activeWrappers.push(newWrapper)
|
|
116
|
+
|
|
117
|
+
await newWrapper.vm.$nextTick()
|
|
118
|
+
await flushPromises()
|
|
119
|
+
|
|
120
|
+
// Filtrer seulement nos appels keydown spécifiques (avec handleNumberKeydown)
|
|
121
|
+
const ourKeydownListeners = addEventListenerSpy.mock.calls.filter(
|
|
122
|
+
call => call[0] === 'keydown'
|
|
123
|
+
&& call[1]
|
|
124
|
+
&& call[1].toString().includes('handleNumberKeydown'),
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
// Aucun de nos listeners keydown ne devrait être ajouté
|
|
128
|
+
expect(ourKeydownListeners).toHaveLength(0)
|
|
129
|
+
|
|
130
|
+
addEventListenerSpy.mockRestore()
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
it('should handle input changes without cursor interference', async () => {
|
|
134
|
+
const numberInput = wrapper.find('.number-field input')
|
|
135
|
+
const inputElement = numberInput.element as HTMLInputElement
|
|
136
|
+
|
|
137
|
+
// Test avec plusieurs modifications successives
|
|
138
|
+
const testValues = [
|
|
139
|
+
'1',
|
|
140
|
+
'12',
|
|
141
|
+
'123',
|
|
142
|
+
'1234',
|
|
143
|
+
'12345',
|
|
144
|
+
'123456',
|
|
145
|
+
'1234567',
|
|
146
|
+
'12345678',
|
|
147
|
+
'123456789',
|
|
148
|
+
'1234567890',
|
|
149
|
+
'12345678901',
|
|
150
|
+
'123456789012',
|
|
151
|
+
'1234567890123',
|
|
152
|
+
]
|
|
153
|
+
|
|
154
|
+
const focusSpy = vi.spyOn(inputElement, 'focus')
|
|
155
|
+
|
|
156
|
+
for (const value of testValues) {
|
|
157
|
+
await numberInput.setValue(value)
|
|
158
|
+
await wrapper.vm.$nextTick()
|
|
159
|
+
await flushPromises()
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Aucun focus automatique ne devrait avoir été déclenché
|
|
163
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
164
|
+
|
|
165
|
+
focusSpy.mockRestore()
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
it('should emit correct modelValue without cursor side effects', async () => {
|
|
169
|
+
const numberInput = wrapper.find('.number-field input')
|
|
170
|
+
|
|
171
|
+
// Saisir un NIR complet
|
|
172
|
+
await numberInput.setValue('2940375120005')
|
|
173
|
+
await wrapper.vm.$nextTick()
|
|
174
|
+
await flushPromises()
|
|
175
|
+
|
|
176
|
+
// Vérifier que la valeur émise est correcte
|
|
177
|
+
const emittedValues = wrapper.emitted('update:modelValue')
|
|
178
|
+
expect(emittedValues).toBeDefined()
|
|
179
|
+
|
|
180
|
+
// La dernière valeur émise devrait être le NIR complet
|
|
181
|
+
const lastEmittedValue = emittedValues?.[emittedValues.length - 1]?.[0]
|
|
182
|
+
expect(lastEmittedValue).toBe('2940375120005')
|
|
183
|
+
|
|
184
|
+
// Vérifier qu'il n'y a pas de champ clé
|
|
185
|
+
expect(wrapper.find('.key-field').exists()).toBe(false)
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
it('should preserve input behavior during rapid typing', async () => {
|
|
189
|
+
const numberInput = wrapper.find('.number-field input')
|
|
190
|
+
const focusSpy = vi.spyOn(HTMLElement.prototype, 'focus')
|
|
191
|
+
|
|
192
|
+
// Simuler une saisie rapide
|
|
193
|
+
const rapidValues = ['1', '12', '123', '1234', '12345']
|
|
194
|
+
|
|
195
|
+
for (const value of rapidValues) {
|
|
196
|
+
await numberInput.setValue(value)
|
|
197
|
+
// Pas d'attente pour simuler la saisie rapide
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
await wrapper.vm.$nextTick()
|
|
201
|
+
await flushPromises()
|
|
202
|
+
|
|
203
|
+
// Aucun focus automatique ne devrait interférer
|
|
204
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
205
|
+
|
|
206
|
+
focusSpy.mockRestore()
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
it('should not trigger watchers on keyValue changes when displayKey is false', async () => {
|
|
210
|
+
// Spy sur les watchers internes
|
|
211
|
+
const focusSpy = vi.spyOn(HTMLElement.prototype, 'focus')
|
|
212
|
+
|
|
213
|
+
// Accéder aux valeurs internes du composant
|
|
214
|
+
const vm = wrapper.vm as { keyValue?: string }
|
|
215
|
+
|
|
216
|
+
// Simuler un changement de keyValue (qui ne devrait pas déclencher de focus)
|
|
217
|
+
if (vm.keyValue !== undefined) {
|
|
218
|
+
vm.keyValue = '12'
|
|
219
|
+
await wrapper.vm.$nextTick()
|
|
220
|
+
vm.keyValue = ''
|
|
221
|
+
await wrapper.vm.$nextTick()
|
|
222
|
+
await flushPromises()
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Aucun focus ne devrait être déclenché
|
|
226
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
227
|
+
|
|
228
|
+
focusSpy.mockRestore()
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
it('should not interfere with masked input behavior', async () => {
|
|
232
|
+
const numberInput = wrapper.find('.number-field input')
|
|
233
|
+
const inputElement = numberInput.element as HTMLInputElement
|
|
234
|
+
|
|
235
|
+
// Spy sur les méthodes de focus qui pourraient interférer
|
|
236
|
+
const focusSpy = vi.spyOn(inputElement, 'focus')
|
|
237
|
+
const clickSpy = vi.spyOn(inputElement, 'click')
|
|
238
|
+
|
|
239
|
+
// Saisir un NIR avec masque (le masque peut gérer sa propre logique de curseur)
|
|
240
|
+
await numberInput.setValue('123456789')
|
|
241
|
+
await wrapper.vm.$nextTick()
|
|
242
|
+
await flushPromises()
|
|
243
|
+
|
|
244
|
+
// Simuler une modification
|
|
245
|
+
await numberInput.trigger('input')
|
|
246
|
+
await wrapper.vm.$nextTick()
|
|
247
|
+
await flushPromises()
|
|
248
|
+
|
|
249
|
+
// Vérifier que notre logique NirField n'interfère pas avec le masque
|
|
250
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
251
|
+
expect(clickSpy).not.toHaveBeenCalled()
|
|
252
|
+
|
|
253
|
+
focusSpy.mockRestore()
|
|
254
|
+
clickSpy.mockRestore()
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
it('should handle backspace and delete without cursor jump', async () => {
|
|
258
|
+
const numberInput = wrapper.find('.number-field input')
|
|
259
|
+
const inputElement = numberInput.element as HTMLInputElement
|
|
260
|
+
|
|
261
|
+
// Saisir un NIR complet
|
|
262
|
+
await numberInput.setValue('2940375120005')
|
|
263
|
+
await wrapper.vm.$nextTick()
|
|
264
|
+
await flushPromises()
|
|
265
|
+
|
|
266
|
+
// Positionner le curseur au milieu
|
|
267
|
+
inputElement.focus()
|
|
268
|
+
inputElement.setSelectionRange(7, 7)
|
|
269
|
+
|
|
270
|
+
const focusSpy = vi.spyOn(inputElement, 'focus')
|
|
271
|
+
|
|
272
|
+
// Simuler une suppression (backspace)
|
|
273
|
+
const backspaceEvent = new KeyboardEvent('keydown', {
|
|
274
|
+
key: 'Backspace',
|
|
275
|
+
code: 'Backspace',
|
|
276
|
+
keyCode: 8,
|
|
277
|
+
})
|
|
278
|
+
inputElement.dispatchEvent(backspaceEvent)
|
|
279
|
+
|
|
280
|
+
await wrapper.vm.$nextTick()
|
|
281
|
+
await flushPromises()
|
|
282
|
+
|
|
283
|
+
// Vérifier qu'aucun focus automatique n'a été déclenché
|
|
284
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
285
|
+
|
|
286
|
+
focusSpy.mockRestore()
|
|
287
|
+
})
|
|
288
|
+
|
|
289
|
+
it('should not interfere with normal input events', async () => {
|
|
290
|
+
const numberInput = wrapper.find('.number-field input')
|
|
291
|
+
const inputElement = numberInput.element as HTMLInputElement
|
|
292
|
+
|
|
293
|
+
// Spy sur les événements qui pourraient interférer
|
|
294
|
+
const focusSpy = vi.spyOn(inputElement, 'focus')
|
|
295
|
+
const clickSpy = vi.spyOn(inputElement, 'click')
|
|
296
|
+
|
|
297
|
+
// Simuler plusieurs événements input successifs
|
|
298
|
+
await numberInput.setValue('1')
|
|
299
|
+
await numberInput.trigger('input')
|
|
300
|
+
await numberInput.setValue('12')
|
|
301
|
+
await numberInput.trigger('input')
|
|
302
|
+
await numberInput.setValue('123')
|
|
303
|
+
await numberInput.trigger('input')
|
|
304
|
+
|
|
305
|
+
await wrapper.vm.$nextTick()
|
|
306
|
+
await flushPromises()
|
|
307
|
+
|
|
308
|
+
// Aucune interférence ne devrait avoir lieu
|
|
309
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
310
|
+
expect(clickSpy).not.toHaveBeenCalled()
|
|
311
|
+
|
|
312
|
+
focusSpy.mockRestore()
|
|
313
|
+
clickSpy.mockRestore()
|
|
314
|
+
})
|
|
315
|
+
})
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils'
|
|
2
2
|
import NirField from '../NirField.vue'
|
|
3
3
|
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
4
|
-
import { createVuetify } from 'vuetify'
|
|
5
|
-
import * as components from 'vuetify/components'
|
|
6
|
-
import * as directives from 'vuetify/directives'
|
|
7
4
|
import { useValidation } from '@/composables/validation/useValidation'
|
|
8
5
|
|
|
9
|
-
const vuetify = createVuetify({
|
|
10
|
-
components,
|
|
11
|
-
directives,
|
|
12
|
-
})
|
|
13
|
-
|
|
14
6
|
describe('NirField.vue', () => {
|
|
15
7
|
let wrapper: ReturnType<typeof mount<typeof NirField & {
|
|
16
8
|
numberValidation: ReturnType<typeof useValidation>
|
|
@@ -27,9 +19,6 @@ describe('NirField.vue', () => {
|
|
|
27
19
|
|
|
28
20
|
beforeEach(async () => {
|
|
29
21
|
wrapper = mount(NirField, {
|
|
30
|
-
global: {
|
|
31
|
-
plugins: [vuetify],
|
|
32
|
-
},
|
|
33
22
|
props: {
|
|
34
23
|
modelValue: undefined,
|
|
35
24
|
required: true,
|
|
@@ -126,9 +115,6 @@ describe('NirField.vue', () => {
|
|
|
126
115
|
|
|
127
116
|
it('calls validateOnSubmit and returns true if no errors', async () => {
|
|
128
117
|
const testWrapper = mount(NirField, {
|
|
129
|
-
global: {
|
|
130
|
-
plugins: [vuetify],
|
|
131
|
-
},
|
|
132
118
|
props: {
|
|
133
119
|
modelValue: undefined,
|
|
134
120
|
required: false,
|
|
@@ -162,9 +148,6 @@ describe('NirField.vue', () => {
|
|
|
162
148
|
}]
|
|
163
149
|
|
|
164
150
|
const customWrapper = mount(NirField, {
|
|
165
|
-
global: {
|
|
166
|
-
plugins: [vuetify],
|
|
167
|
-
},
|
|
168
151
|
props: {
|
|
169
152
|
modelValue: undefined,
|
|
170
153
|
customKeyRules,
|
|
@@ -300,4 +283,219 @@ describe('NirField.vue', () => {
|
|
|
300
283
|
// Restaurer le spy
|
|
301
284
|
focusSpy.mockRestore()
|
|
302
285
|
})
|
|
286
|
+
|
|
287
|
+
describe('Internal update flag protection', () => {
|
|
288
|
+
it('prevents infinite loops between watch and emitValue', async () => {
|
|
289
|
+
// Spy sur emit pour compter les appels
|
|
290
|
+
const emitSpy = vi.spyOn(wrapper.vm, '$emit')
|
|
291
|
+
|
|
292
|
+
// Définir une valeur initiale
|
|
293
|
+
await wrapper.setProps({ modelValue: '294037512000591' })
|
|
294
|
+
await wrapper.vm.$nextTick()
|
|
295
|
+
await flushPromises()
|
|
296
|
+
|
|
297
|
+
// Réinitialiser le spy pour ne compter que les nouveaux appels
|
|
298
|
+
emitSpy.mockClear()
|
|
299
|
+
|
|
300
|
+
// Simuler une saisie utilisateur qui devrait déclencher emitValue
|
|
301
|
+
const numberField = wrapper.find('.number-field input')
|
|
302
|
+
await numberField.setValue('2940375120006') // Changer le dernier chiffre
|
|
303
|
+
await wrapper.vm.$nextTick()
|
|
304
|
+
await flushPromises()
|
|
305
|
+
|
|
306
|
+
// Vérifier qu'il n'y a qu'un seul appel à emit (pas de boucle infinie)
|
|
307
|
+
const updateModelValueCalls = emitSpy.mock.calls.filter(call => call[0] === 'update:modelValue')
|
|
308
|
+
expect(updateModelValueCalls.length).toBeLessThanOrEqual(2) // Maximum 2 appels (un pour chaque champ)
|
|
309
|
+
|
|
310
|
+
emitSpy.mockRestore()
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
it('allows external modelValue changes to update internal fields', async () => {
|
|
314
|
+
// Définir une valeur initiale
|
|
315
|
+
await wrapper.setProps({ modelValue: '294037512000591' })
|
|
316
|
+
await wrapper.vm.$nextTick()
|
|
317
|
+
await flushPromises()
|
|
318
|
+
|
|
319
|
+
// Vérifier que les champs internes sont mis à jour
|
|
320
|
+
const numberInput = wrapper.find('.number-field input').element as HTMLInputElement
|
|
321
|
+
const keyInput = wrapper.find('.key-field input').element as HTMLInputElement
|
|
322
|
+
|
|
323
|
+
expect(numberInput.value.replace(/\s/g, '')).toBe('2940375120005')
|
|
324
|
+
expect(keyInput.value).toBe('91')
|
|
325
|
+
|
|
326
|
+
// Changer la valeur externe
|
|
327
|
+
await wrapper.setProps({ modelValue: '123456789012345' })
|
|
328
|
+
await wrapper.vm.$nextTick()
|
|
329
|
+
await flushPromises()
|
|
330
|
+
|
|
331
|
+
// Vérifier que les champs internes sont mis à jour correctement
|
|
332
|
+
expect(numberInput.value.replace(/\s/g, '')).toBe('1234567890123')
|
|
333
|
+
expect(keyInput.value).toBe('45')
|
|
334
|
+
})
|
|
335
|
+
|
|
336
|
+
it('handles null/undefined modelValue without triggering loops', async () => {
|
|
337
|
+
// Spy sur emit pour compter les appels
|
|
338
|
+
const emitSpy = vi.spyOn(wrapper.vm, '$emit')
|
|
339
|
+
|
|
340
|
+
// Définir une valeur initiale
|
|
341
|
+
await wrapper.setProps({ modelValue: '294037512000591' })
|
|
342
|
+
await wrapper.vm.$nextTick()
|
|
343
|
+
await flushPromises()
|
|
344
|
+
|
|
345
|
+
// Réinitialiser le spy
|
|
346
|
+
emitSpy.mockClear()
|
|
347
|
+
|
|
348
|
+
// Changer vers null
|
|
349
|
+
await wrapper.setProps({ modelValue: null })
|
|
350
|
+
await wrapper.vm.$nextTick()
|
|
351
|
+
await flushPromises()
|
|
352
|
+
|
|
353
|
+
// Vérifier que les champs sont vidés
|
|
354
|
+
const numberInput = wrapper.find('.number-field input').element as HTMLInputElement
|
|
355
|
+
const keyInput = wrapper.find('.key-field input').element as HTMLInputElement
|
|
356
|
+
|
|
357
|
+
expect(numberInput.value).toBe('')
|
|
358
|
+
expect(keyInput.value).toBe('')
|
|
359
|
+
|
|
360
|
+
// Vérifier qu'il n'y a pas d'appels emit supplémentaires (pas de boucle)
|
|
361
|
+
const updateModelValueCalls = emitSpy.mock.calls.filter(call => call[0] === 'update:modelValue')
|
|
362
|
+
expect(updateModelValueCalls.length).toBe(0) // Aucun emit car c'est un changement externe
|
|
363
|
+
|
|
364
|
+
emitSpy.mockRestore()
|
|
365
|
+
})
|
|
366
|
+
})
|
|
367
|
+
|
|
368
|
+
describe('Cursor position preservation when displayKey=false', () => {
|
|
369
|
+
let wrapperWithoutKey: ReturnType<typeof mount<typeof NirField>>
|
|
370
|
+
|
|
371
|
+
beforeEach(async () => {
|
|
372
|
+
wrapperWithoutKey = mount(NirField, {
|
|
373
|
+
props: {
|
|
374
|
+
modelValue: undefined,
|
|
375
|
+
displayKey: false,
|
|
376
|
+
required: false,
|
|
377
|
+
outlined: true,
|
|
378
|
+
},
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
activeWrappers.push(wrapperWithoutKey)
|
|
382
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
383
|
+
await flushPromises()
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
it('does not add our custom keydown event listener when displayKey is false', async () => {
|
|
387
|
+
// Spy spécifiquement sur notre fonction handleNumberKeydown
|
|
388
|
+
const handleNumberKeydownSpy = vi.spyOn(HTMLElement.prototype, 'addEventListener')
|
|
389
|
+
|
|
390
|
+
// Remonter le composant pour déclencher onMounted
|
|
391
|
+
wrapperWithoutKey.unmount()
|
|
392
|
+
activeWrappers.pop()
|
|
393
|
+
|
|
394
|
+
const newWrapper = mount(NirField, {
|
|
395
|
+
props: {
|
|
396
|
+
displayKey: false,
|
|
397
|
+
required: false,
|
|
398
|
+
},
|
|
399
|
+
})
|
|
400
|
+
activeWrappers.push(newWrapper)
|
|
401
|
+
|
|
402
|
+
await newWrapper.vm.$nextTick()
|
|
403
|
+
await flushPromises()
|
|
404
|
+
|
|
405
|
+
// Vérifier que notre logique onMounted n'a pas ajouté d'écouteur keydown
|
|
406
|
+
// (d'autres composants peuvent en ajouter, mais pas notre logique spécifique)
|
|
407
|
+
const ourKeydownCalls = handleNumberKeydownSpy.mock.calls.filter(call =>
|
|
408
|
+
call[0] === 'keydown'
|
|
409
|
+
&& call[1]
|
|
410
|
+
&& call[1].toString().includes('handleNumberKeydown'),
|
|
411
|
+
)
|
|
412
|
+
expect(ourKeydownCalls).toHaveLength(0)
|
|
413
|
+
|
|
414
|
+
handleNumberKeydownSpy.mockRestore()
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
it('does not trigger focus when editing NIR without key field', async () => {
|
|
418
|
+
// Spy sur la méthode focus
|
|
419
|
+
const focusSpy = vi.spyOn(HTMLElement.prototype, 'focus')
|
|
420
|
+
|
|
421
|
+
// Saisir un NIR complet
|
|
422
|
+
const numberInput = wrapperWithoutKey.find('.number-field input')
|
|
423
|
+
await numberInput.setValue('2940375120005')
|
|
424
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
425
|
+
await flushPromises()
|
|
426
|
+
|
|
427
|
+
// Réinitialiser le spy pour ne compter que les appels suivants
|
|
428
|
+
focusSpy.mockClear()
|
|
429
|
+
|
|
430
|
+
// Modifier un chiffre au milieu (simuler l'édition)
|
|
431
|
+
await numberInput.setValue('2940375120006')
|
|
432
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
433
|
+
await flushPromises()
|
|
434
|
+
|
|
435
|
+
// Vérifier qu'aucun focus n'a été déclenché lors de l'édition
|
|
436
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
437
|
+
|
|
438
|
+
focusSpy.mockRestore()
|
|
439
|
+
})
|
|
440
|
+
|
|
441
|
+
it('watchers do not execute when displayKey is false', async () => {
|
|
442
|
+
// Spy sur les méthodes internes pour vérifier qu'elles ne sont pas appelées
|
|
443
|
+
const focusSpy = vi.spyOn(HTMLElement.prototype, 'focus')
|
|
444
|
+
|
|
445
|
+
// Simuler une modification qui déclencherait normalement les watchers
|
|
446
|
+
const numberInput = wrapperWithoutKey.find('.number-field input')
|
|
447
|
+
|
|
448
|
+
// Saisir puis effacer pour déclencher les watchers
|
|
449
|
+
await numberInput.setValue('123')
|
|
450
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
451
|
+
await numberInput.setValue('')
|
|
452
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
453
|
+
await flushPromises()
|
|
454
|
+
|
|
455
|
+
// Vérifier qu'aucun focus automatique n'a été déclenché
|
|
456
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
457
|
+
|
|
458
|
+
focusSpy.mockRestore()
|
|
459
|
+
})
|
|
460
|
+
|
|
461
|
+
it('preserves cursor position during editing when displayKey is false', async () => {
|
|
462
|
+
const numberInput = wrapperWithoutKey.find('.number-field input')
|
|
463
|
+
const inputElement = numberInput.element as HTMLInputElement
|
|
464
|
+
|
|
465
|
+
// Saisir un NIR complet
|
|
466
|
+
await numberInput.setValue('2940375120005')
|
|
467
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
468
|
+
await flushPromises()
|
|
469
|
+
|
|
470
|
+
// Simuler le positionnement du curseur au milieu (position 7)
|
|
471
|
+
inputElement.setSelectionRange(7, 7)
|
|
472
|
+
|
|
473
|
+
// Simuler une modification (suppression d'un caractère)
|
|
474
|
+
const currentValue = inputElement.value
|
|
475
|
+
const newValue = currentValue.slice(0, 7) + currentValue.slice(8)
|
|
476
|
+
await numberInput.setValue(newValue.replace(/\s/g, ''))
|
|
477
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
478
|
+
await flushPromises()
|
|
479
|
+
|
|
480
|
+
// Dans un comportement correct, le curseur ne devrait pas être forcé à la fin
|
|
481
|
+
// On vérifie que la logique de focus automatique n'interfère pas
|
|
482
|
+
expect(wrapperWithoutKey.find('.key-field').exists()).toBe(false)
|
|
483
|
+
})
|
|
484
|
+
|
|
485
|
+
it('handleKeyInput does not trigger focus when displayKey is false', async () => {
|
|
486
|
+
const focusSpy = vi.spyOn(HTMLElement.prototype, 'focus')
|
|
487
|
+
|
|
488
|
+
// Déclencher handleKeyInput via une saisie
|
|
489
|
+
const numberInput = wrapperWithoutKey.find('.number-field input')
|
|
490
|
+
await numberInput.setValue('123')
|
|
491
|
+
await numberInput.trigger('input')
|
|
492
|
+
await wrapperWithoutKey.vm.$nextTick()
|
|
493
|
+
await flushPromises()
|
|
494
|
+
|
|
495
|
+
// Vérifier qu'aucun focus n'a été déclenché
|
|
496
|
+
expect(focusSpy).not.toHaveBeenCalled()
|
|
497
|
+
|
|
498
|
+
focusSpy.mockRestore()
|
|
499
|
+
})
|
|
500
|
+
})
|
|
303
501
|
})
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
2
|
import { mount } from '@vue/test-utils'
|
|
3
|
-
|
|
4
|
-
import { vuetify } from '@tests/unit/setup'
|
|
5
3
|
import { locales } from '../locales'
|
|
6
4
|
import NotFoundPage from '../NotFoundPage.vue'
|
|
7
5
|
|
|
8
6
|
describe('NotFoundPage', () => {
|
|
9
7
|
it('renders correctly', () => {
|
|
10
|
-
const wrapper = mount(NotFoundPage
|
|
11
|
-
global: {
|
|
12
|
-
plugins: [vuetify],
|
|
13
|
-
},
|
|
14
|
-
})
|
|
8
|
+
const wrapper = mount(NotFoundPage)
|
|
15
9
|
|
|
16
10
|
expect(wrapper.text()).toContain(locales.code)
|
|
17
11
|
expect(wrapper.text()).toContain(locales.message)
|
|
@@ -24,11 +18,7 @@ describe('NotFoundPage', () => {
|
|
|
24
18
|
'',
|
|
25
19
|
'/not-found?support_id=1234567890123456789',
|
|
26
20
|
)
|
|
27
|
-
const wrapper = mount(NotFoundPage
|
|
28
|
-
global: {
|
|
29
|
-
plugins: [vuetify],
|
|
30
|
-
},
|
|
31
|
-
})
|
|
21
|
+
const wrapper = mount(NotFoundPage)
|
|
32
22
|
|
|
33
23
|
await wrapper.vm.$nextTick()
|
|
34
24
|
|
|
@@ -38,7 +38,7 @@ import * as NotificationBarStories from './NotificationBar.stories';
|
|
|
38
38
|
import type { Notification } from '@cnamts/synapse'
|
|
39
39
|
|
|
40
40
|
const { addNotification } = useNotificationService()
|
|
41
|
-
import '../../stories/styles/shared.css';
|
|
41
|
+
import '../../stories/styles/shared.css';
|
|
42
42
|
|
|
43
43
|
const envoyerNotification = (message: string, type: Notification['type']) => {
|
|
44
44
|
const notification: Notification = {
|
|
@@ -16,6 +16,7 @@ const meta: Meta<typeof NotificationBar> = {
|
|
|
16
16
|
title: 'Composants/Feedback/NotificationBar',
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: 'fullscreen',
|
|
19
|
+
controls: { exclude: ['currentNotification', 'isNotificationVisible', 'hasActionSlot', 'isMobileVersion', 'hasLongContent', 'color', 'icon', 'contentStyle', 'smallCloseBtn', 'isVertical'] },
|
|
19
20
|
},
|
|
20
21
|
component: NotificationBar,
|
|
21
22
|
argTypes: {
|