@cnamts/synapse 1.0.13 → 1.0.15
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/README.md +72 -72
- package/dist/{DateFilter-_EFzsvvM.js → DateFilter-isr8mXVb.js} +1 -1
- package/dist/{NumberFilter-CUxEbKJh.js → NumberFilter-BOe7DqWX.js} +1 -1
- package/dist/{PeriodFilter-D5ueqtKy.js → PeriodFilter-WTprpO40.js} +1 -1
- package/dist/{SelectFilter-BciBNydy.js → SelectFilter-CqlG5dmI.js} +1 -1
- package/dist/{TextFilter-DMN_WAQB.js → TextFilter-fVW5bsRw.js} +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +60 -28
- package/dist/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +60 -28
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +61 -29
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +5 -1
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +3 -1
- package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +1 -1
- package/dist/components/Captcha/Captcha.d.ts +2 -0
- package/dist/components/Captcha/CaptchaBase.d.ts +1 -0
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +29 -17
- package/dist/components/Customs/SyTabs/SyTabs.d.ts +20 -0
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +100 -10
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +108 -21
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +6 -6
- package/dist/components/DatePicker/composables/useDateFormatDisplay.d.ts +3 -0
- package/dist/components/DatePicker/tests/setup.d.ts +768 -48
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +8 -0
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +58 -34
- package/dist/components/LangBtn/LangBtn.d.ts +4 -0
- package/dist/components/PeriodField/PeriodField.d.ts +192 -12
- package/dist/components/RatingPicker/RatingPicker.d.ts +9 -0
- package/dist/components/SearchListField/SearchListField.d.ts +42 -413
- package/dist/components/SearchListField/locales.d.ts +1 -2
- package/dist/components/SyAlert/SyAlert.d.ts +1 -1
- package/dist/components/SyTextArea/SyTextArea.d.ts +2 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +15 -8
- package/dist/components/Tables/SyTable/SyTable.d.ts +15 -8
- package/dist/components/Tables/common/SyTablePagination.d.ts +29 -17
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +4 -0
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/design-system-v3.js +1 -1
- package/dist/design-system-v3.umd.cjs +32 -16
- package/dist/{main-DISHlqcd.js → main-CbBVJ_le.js} +9911 -9751
- package/dist/style.css +1 -1
- package/package.json +5 -2
- package/src/assets/amelipro/icons.ts +17 -0
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.stories.ts +40 -36
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/AmeliproAccordionGroup.spec.ts +226 -26
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/__snapshots__/AmeliproAccordionGroup.spec.ts.snap +55 -506
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +1 -1
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +7 -2
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +2 -1
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/__snapshots__/AmeliproAccordionResultTemplate.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/__snapshots__/AmeliproAccordionResult.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +1 -1
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +9 -3
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +42 -11
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.stories.ts +4 -4
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.vue +7 -5
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +4 -2
- package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.stories.ts +1 -40
- package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.vue +4 -0
- package/src/components/Amelipro/AmeliproCallback/AmeliproCallback.stories.ts +4 -2
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/__snapshots__/AmeliproCaptcha.spec.ts.snap +2 -1
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.stories.ts +39 -29
- package/src/components/Amelipro/AmeliproCopyBtn/__tests__/__snapshots__/AmeliproCopyBtn.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +3 -3
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +8 -6
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.mdx +3 -1
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.stories.ts +23 -5
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +5 -6
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/AmeliproFilePreview.spec.ts +2 -2
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/__snapshots__/AmeliproFilePreview.spec.ts.snap +5 -6
- package/src/components/Amelipro/AmeliproFirstLogin/__tests__/__snapshots__/AmeliproFirstLogin.spec.ts.snap +4 -1
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +1 -2
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/__tests__/AmeliproLogoAm.spec.ts +78 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/{tests → __tests__}/__snapshots__/AmeliproLogoAm.spec.ts.snap +64 -2
- package/src/components/Amelipro/AmeliproIcon/__tests__/AmeliproIcon.spec.ts +358 -0
- package/src/components/Amelipro/AmeliproIcon/{tests → __tests__}/__snapshots__/AmeliproIcon.spec.ts.snap +30 -3
- package/src/components/Amelipro/AmeliproIcon/iconList.ts +1 -0
- package/src/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.vue +1 -1
- package/src/components/Amelipro/AmeliproIconBtn/__tests__/AmeliproIconBtn.spec.ts +459 -0
- package/src/components/Amelipro/AmeliproIconBtn/__tests__/__snapshots__/AmeliproIconBtn.spec.ts.snap +58 -0
- package/src/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.stories.ts +38 -26
- package/src/components/Amelipro/AmeliproIllustratedDataTile/__tests__/AmeliproIllustratedDataTile.spec.ts +321 -0
- package/src/components/Amelipro/AmeliproIllustratedDataTile/__tests__/__snapshots__/AmeliproIllustratedDataTile.spec.ts.snap +148 -0
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.stories.ts +14 -5
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.vue +1 -1
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/AmeliproIllustratedRadioGroup.spec.ts +498 -0
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/__snapshots__/AmeliproIllustratedRadioGroup.spec.ts.snap +325 -0
- package/src/components/Amelipro/AmeliproMailTile/__tests__/AmeliproMailTile.spec.ts +210 -0
- package/src/components/Amelipro/AmeliproMailTile/__tests__/__snapshots__/AmeliproMailTile.spec.ts.snap +98 -0
- package/src/components/Amelipro/AmeliproMessage/__tests__/AmeliproMessage.spec.ts +446 -0
- package/src/components/Amelipro/AmeliproMessage/__tests__/__snapshots__/AmeliproMessage.spec.ts.snap +60 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/__tests__/AmeliproMessagingLayout.spec.ts +300 -0
- package/src/components/Amelipro/AmeliproMessagingLayout/__tests__/__snapshots__/AmeliproMessagingLayout.spec.ts.snap +197 -0
- package/src/components/Amelipro/AmeliproNumberedCard/__tests__/AmeliproNumberedCard.spec.ts +117 -0
- package/src/components/Amelipro/AmeliproNumberedCard/{tests → __tests__}/__snapshots__/AmeliproNumberedCard.spec.ts.snap +47 -45
- package/src/components/Amelipro/AmeliproOnboarding/__tests__/AmeliproOnboarding.spec.ts +219 -0
- package/src/components/Amelipro/AmeliproOnboarding/__tests__/__snapshots__/AmeliproOnboarding.spec.ts.snap +41 -0
- package/src/components/Amelipro/AmeliproPageLayout/__tests__/AmeliproPageLayout.spec.ts +129 -0
- package/src/components/Amelipro/AmeliproPageLayout/__tests__/__snapshots__/AmeliproPageLayout.spec.ts.snap +189 -0
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/__tests__/AmeliproPaginationBtn.spec.ts +92 -0
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/__tests__/__snapshots__/AmeliproPaginationBtn.spec.ts.snap +56 -0
- package/src/components/Amelipro/AmeliproPagination/__tests__/AmeliproPagination.spec.ts +165 -0
- package/src/components/Amelipro/AmeliproPagination/__tests__/__snapshots__/AmeliproPagination.spec.ts.snap +83 -0
- package/src/components/Amelipro/AmeliproPatientBanner/__tests__/AmeliproPatientBanner.spec.ts +208 -0
- package/src/components/Amelipro/AmeliproPatientBanner/__tests__/__snapshots__/AmeliproPatientBanner.spec.ts.snap +285 -0
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +26 -7
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/__snapshots__/AmeliproPostalAddressCityRow.spec.ts.snap +12 -4
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.stories.ts +28 -8
- package/src/components/Amelipro/AmeliproRadioGroup/__tests__/AmeliproRadioGroup.spec.ts +332 -0
- package/src/components/Amelipro/AmeliproRadioGroup/__tests__/__snapshots__/AmeliproRadioGroup.spec.ts.snap +255 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +1 -2
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +3 -1
- package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +2 -1
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +11 -5
- package/src/components/Amelipro/AmeliproSelect/__tests__/AmeliproSelect.spec.ts +481 -0
- package/src/components/Amelipro/AmeliproSelect/__tests__/__snapshots__/AmeliproSelect.spec.ts.snap +117 -0
- package/src/components/Amelipro/AmeliproStateTile/AmeliproStateTile.vue +5 -2
- package/src/components/Amelipro/AmeliproStateTile/__tests__/AmeliproStateTile.spec.ts +206 -0
- package/src/components/Amelipro/AmeliproStateTile/__tests__/__snapshots__/AmeliproStateTile.spec.ts.snap +158 -0
- package/src/components/Amelipro/AmeliproStatus/__tests__/AmeliproStatus.spec.ts +120 -0
- package/src/components/Amelipro/AmeliproStatus/__tests__/__snapshots__/AmeliproStatus.spec.ts.snap +39 -0
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/__tests__/AmeliproStepBtn.spec.ts +97 -0
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/__tests__/__snapshots__/AmeliproStepBtn.spec.ts.snap +61 -0
- package/src/components/Amelipro/AmeliproStepper/__tests__/AmeliproStepper.spec.ts +248 -0
- package/src/components/Amelipro/AmeliproStepper/__tests__/__snapshots__/AmeliproStepper.spec.ts.snap +179 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.stories.ts +14 -13
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +2 -1
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +10 -3
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/__tests__/AmeliproTabBtn.spec.ts +129 -0
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/__tests__/__snapshots__/AmeliproTabBtn.spec.ts.snap +81 -0
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +2 -2
- package/src/components/Amelipro/AmeliproTabs/__tests__/AmeliproTabs.spec.ts +234 -0
- package/src/components/Amelipro/AmeliproTabs/__tests__/__snapshots__/AmeliproTabs.spec.ts.snap +122 -0
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.vue +7 -5
- package/src/components/Amelipro/AmeliproTextArea/__tests__/AmeliproTextArea.spec.ts +265 -9
- package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +98 -155
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +7 -5
- package/src/components/Amelipro/AmeliproTextField/__tests__/AmeliproTextField.spec.ts +375 -0
- package/src/components/Amelipro/AmeliproTextField/__tests__/__snapshots__/AmeliproTextField.spec.ts.snap +143 -0
- package/src/components/Amelipro/AmeliproTileBtn/__tests__/AmeliproTileBtn.spec.ts +241 -0
- package/src/components/Amelipro/AmeliproTileBtn/__tests__/__snapshots__/AmeliproTileBtn.spec.ts.snap +74 -0
- package/src/components/Amelipro/AmeliproTooltips/__tests__/AmeliproTooltips.spec.ts +212 -0
- package/src/components/Amelipro/AmeliproTooltips/__tests__/__snapshots__/AmeliproTooltips.spec.ts.snap +71 -0
- package/src/components/Amelipro/AmeliproTransmission/__tests__/AmeliproTransmission.spec.ts +155 -0
- package/src/components/Amelipro/AmeliproTransmission/__tests__/__snapshots__/AmeliproTransmission.spec.ts.snap +240 -0
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.stories.ts +0 -1
- package/src/components/Amelipro/ServiceMenu/tests/__snapshots__/ServiceMenu.spec.ts.snap +4 -1
- package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +4 -0
- package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +4 -5
- package/src/components/Amelipro/StructureMenu/StructureTabs/tests/__snapshots__/StructureTabs.spec.ts.snap +5 -4
- package/src/components/Amelipro/StructureMenu/tests/__snapshots__/StructureMenu.spec.ts.snap +13 -6
- package/src/components/Amelipro/UserMenu/UserMenu.vue +2 -1
- package/src/components/Amelipro/UserMenu/tests/__snapshots__/UserMenu.spec.ts.snap +4 -1
- package/src/components/Captcha/Captcha.mdx +4 -4
- package/src/components/Captcha/Captcha.stories.ts +8 -1
- package/src/components/Captcha/Captcha.vue +3 -0
- package/src/components/Captcha/CaptchaBase.vue +3 -0
- package/src/components/Captcha/captchaApi.ts +0 -1
- package/src/components/Customs/Selects/SySelect/SySelect.vue +2 -2
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +5 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +1 -1
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +174 -10
- package/src/components/Customs/SyTabs/SyTabs.vue +62 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +98 -0
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +13 -13
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +13 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +11 -11
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +5 -0
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.mdx +7 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +3 -3
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +50 -2
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +15 -15
- package/src/components/DatePicker/composables/tests/useDateFormatValidation.spec.ts +2 -2
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +1 -1
- package/src/components/DatePicker/composables/useDateFormatDisplay.ts +25 -0
- package/src/components/DatePicker/composables/useDateFormatValidation.ts +5 -2
- package/src/components/DatePicker/composables/useManualDateValidation.ts +5 -1
- package/src/components/DatePicker/tests/DatePicker.validation.spec.ts +1 -1
- package/src/components/ErrorPage/ErrorPage.vue +54 -7
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +6 -2
- package/src/components/ExternalLinks/ExternalLinks.vue +2 -4
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +6 -2
- package/src/components/PasswordField/PasswordField.vue +6 -6
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +3 -2
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +2 -1
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +2 -0
- package/src/components/RatingPicker/RatingPicker.stories.ts +10 -0
- package/src/components/RatingPicker/RatingPicker.vue +23 -1
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +2 -0
- package/src/components/SearchListField/Accessibilite.stories.ts +4 -0
- package/src/components/SearchListField/SearchListField.stories.ts +16 -0
- package/src/components/SearchListField/SearchListField.vue +121 -109
- package/src/components/SearchListField/locales.ts +11 -2
- package/src/components/SearchListField/tests/SearchListField.spec.ts +91 -25
- package/src/components/SyAlert/SyAlert.vue +8 -0
- package/src/components/SyAlert/tests/SyAlert.spec.ts +1 -22
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +304 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +12 -4
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +186 -0
- package/src/components/Tables/SyTable/SyTable.vue +12 -4
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +65 -1
- package/src/components/Tables/common/types.ts +2 -0
- package/src/composables/rules/useFieldValidation.ts +47 -7
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproLogoAm/tests/AmeliproLogoAm.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproIcon/tests/AmeliproIcon.spec.ts +0 -19
- package/src/components/Amelipro/AmeliproIconBtn/tests/AmeliproIconBtn.spec.ts +0 -22
- package/src/components/Amelipro/AmeliproIconBtn/tests/__snapshots__/AmeliproIconBtn.spec.ts.snap +0 -87
- package/src/components/Amelipro/AmeliproIllustratedDataTile/tests/AmeliproIllustratedDataTile.spec.ts +0 -20
- package/src/components/Amelipro/AmeliproIllustratedDataTile/tests/__snapshots__/AmeliproIllustratedDataTile.spec.ts.snap +0 -69
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/tests/AmeliproIllustratedRadioGroup.spec.ts +0 -53
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/tests/__snapshots__/AmeliproIllustratedRadioGroup.spec.ts.snap +0 -544
- package/src/components/Amelipro/AmeliproMailTile/tests/AmeliproMailTile.spec.ts +0 -25
- package/src/components/Amelipro/AmeliproMailTile/tests/__snapshots__/AmeliproMailTile.spec.ts.snap +0 -164
- package/src/components/Amelipro/AmeliproMessage/tests/AmeliproMessage.spec.ts +0 -18
- package/src/components/Amelipro/AmeliproMessage/tests/__snapshots__/AmeliproMessage.spec.ts.snap +0 -94
- package/src/components/Amelipro/AmeliproMessagingLayout/tests/AmeliproMessagingLayout.spec.ts +0 -30
- package/src/components/Amelipro/AmeliproMessagingLayout/tests/__snapshots__/AmeliproMessagingLayout.spec.ts.snap +0 -439
- package/src/components/Amelipro/AmeliproNumberedCard/tests/AmeliproNumberedCard.spec.ts +0 -23
- package/src/components/Amelipro/AmeliproOnboarding/tests/AmeliproOnboarding.spec.ts +0 -41
- package/src/components/Amelipro/AmeliproOnboarding/tests/__snapshots__/AmeliproOnboarding.spec.ts.snap +0 -3
- package/src/components/Amelipro/AmeliproPageLayout/tests/AmeliproPageLayout.spec.ts +0 -183
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +0 -1602
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/tests/AmeliproPaginationBtn.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/tests/__snapshots__/AmeliproPaginationBtn.spec.ts.snap +0 -46
- package/src/components/Amelipro/AmeliproPagination/tests/AmeliproPagination.spec.ts +0 -15
- package/src/components/Amelipro/AmeliproPagination/tests/__snapshots__/AmeliproPagination.spec.ts.snap +0 -116
- package/src/components/Amelipro/AmeliproPatientBanner/tests/AmeliproPatientBanner.spec.ts +0 -24
- package/src/components/Amelipro/AmeliproPatientBanner/tests/__snapshots__/AmeliproPatientBanner.spec.ts.snap +0 -268
- package/src/components/Amelipro/AmeliproRadioGroup/tests/AmeliproRadioGroup.spec.ts +0 -43
- package/src/components/Amelipro/AmeliproRadioGroup/tests/__snapshots__/AmeliproRadioGroup.spec.ts.snap +0 -262
- package/src/components/Amelipro/AmeliproSelect/tests/AmeliproSelect.spec.ts +0 -38
- package/src/components/Amelipro/AmeliproSelect/tests/__snapshots__/AmeliproSelect.spec.ts.snap +0 -196
- package/src/components/Amelipro/AmeliproStateTile/tests/AmeliproStateTile.spec.ts +0 -20
- package/src/components/Amelipro/AmeliproStateTile/tests/__snapshots__/AmeliproStateTile.spec.ts.snap +0 -90
- package/src/components/Amelipro/AmeliproStatus/tests/AmeliproStatus.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproStatus/tests/__snapshots__/AmeliproStatus.spec.ts.snap +0 -21
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/tests/AmeliproStepBtn.spec.ts +0 -18
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepBtn/tests/__snapshots__/AmeliproStepBtn.spec.ts.snap +0 -34
- package/src/components/Amelipro/AmeliproStepper/tests/AmeliproStepper.spec.ts +0 -36
- package/src/components/Amelipro/AmeliproStepper/tests/__snapshots__/AmeliproStepper.spec.ts.snap +0 -354
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/tests/AmeliproTabBtn.spec.ts +0 -20
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/tests/__snapshots__/AmeliproTabBtn.spec.ts.snap +0 -34
- package/src/components/Amelipro/AmeliproTabs/tests/AmeliproTabs.spec.ts +0 -39
- package/src/components/Amelipro/AmeliproTabs/tests/__snapshots__/AmeliproTabs.spec.ts.snap +0 -217
- package/src/components/Amelipro/AmeliproTextField/tests/AmeliproTextField.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproTextField/tests/__snapshots__/AmeliproTextField.spec.ts.snap +0 -162
- package/src/components/Amelipro/AmeliproTileBtn/tests/AmeliproTileBtn.spec.ts +0 -17
- package/src/components/Amelipro/AmeliproTileBtn/tests/__snapshots__/AmeliproTileBtn.spec.ts.snap +0 -65
- package/src/components/Amelipro/AmeliproTooltips/tests/AmeliproTooltips.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproTooltips/tests/__snapshots__/AmeliproTooltips.spec.ts.snap +0 -105
- package/src/components/Amelipro/AmeliproTransmission/tests/AmeliproTransmission.spec.ts +0 -16
- package/src/components/Amelipro/AmeliproTransmission/tests/__snapshots__/AmeliproTransmission.spec.ts.snap +0 -246
- package/src/components/SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap +0 -99
|
@@ -660,6 +660,73 @@ describe('SyServerTable', () => {
|
|
|
660
660
|
const dataTable = wrapper.findComponent({ name: 'VDataTableServer' })
|
|
661
661
|
expect(dataTable.props('showSelect')).toBe(true)
|
|
662
662
|
})
|
|
663
|
+
|
|
664
|
+
it('hides header checkbox when showSelectSingle is true', () => {
|
|
665
|
+
const wrapper = mount(SyServerTable, {
|
|
666
|
+
props: {
|
|
667
|
+
headers,
|
|
668
|
+
items: fakeItems,
|
|
669
|
+
serverItemsLength: fakeItems.length,
|
|
670
|
+
showSelectSingle: true,
|
|
671
|
+
suffix: 'single-select',
|
|
672
|
+
},
|
|
673
|
+
})
|
|
674
|
+
|
|
675
|
+
const dataTable = wrapper.findComponent({ name: 'VDataTableServer' })
|
|
676
|
+
expect(dataTable.exists()).toBe(true)
|
|
677
|
+
|
|
678
|
+
// show-select is enabled
|
|
679
|
+
expect(dataTable.props('showSelect')).toBe(true)
|
|
680
|
+
|
|
681
|
+
// In single-select mode, the header "select all" checkbox should not be rendered
|
|
682
|
+
const headerCheckbox = wrapper.find('th.checkbox-column .v-selection-control input[type="checkbox"]')
|
|
683
|
+
expect(headerCheckbox.exists()).toBe(false)
|
|
684
|
+
})
|
|
685
|
+
|
|
686
|
+
it('shows header checkbox when showSelect is true and showSelectSingle is false', () => {
|
|
687
|
+
const wrapper = mount(SyServerTable, {
|
|
688
|
+
props: {
|
|
689
|
+
headers,
|
|
690
|
+
items: fakeItems,
|
|
691
|
+
serverItemsLength: fakeItems.length,
|
|
692
|
+
showSelect: true,
|
|
693
|
+
showSelectSingle: false,
|
|
694
|
+
suffix: 'multi-select',
|
|
695
|
+
},
|
|
696
|
+
})
|
|
697
|
+
|
|
698
|
+
const dataTable = wrapper.findComponent({ name: 'VDataTableServer' })
|
|
699
|
+
expect(dataTable.exists()).toBe(true)
|
|
700
|
+
|
|
701
|
+
// Multi-select mode
|
|
702
|
+
expect(dataTable.props('showSelect')).toBe(true)
|
|
703
|
+
|
|
704
|
+
// Header "select all" checkbox should be present
|
|
705
|
+
const headerCheckbox = wrapper.find('th.checkbox-column .v-selection-control input[type="checkbox"]')
|
|
706
|
+
expect(headerCheckbox.exists()).toBe(true)
|
|
707
|
+
})
|
|
708
|
+
})
|
|
709
|
+
|
|
710
|
+
it('properly binds the v-model for single selection', async () => {
|
|
711
|
+
const selectedItems = [fakeItems[0].id]
|
|
712
|
+
const wrapper = mount(SyServerTable, {
|
|
713
|
+
props: {
|
|
714
|
+
headers,
|
|
715
|
+
items: fakeItems,
|
|
716
|
+
serverItemsLength: fakeItems.length,
|
|
717
|
+
showSelect: false,
|
|
718
|
+
showSelectSingle: true,
|
|
719
|
+
modelValue: selectedItems,
|
|
720
|
+
suffix: 'single-select',
|
|
721
|
+
},
|
|
722
|
+
})
|
|
723
|
+
|
|
724
|
+
// select the second item
|
|
725
|
+
await wrapper.setProps({ modelValue: [fakeItems[1].id] })
|
|
726
|
+
|
|
727
|
+
// Check that the VDataTable has the correct model value
|
|
728
|
+
const dataTable = wrapper.findComponent({ name: 'VDataTableServer' })
|
|
729
|
+
expect(dataTable.props('modelValue')).toEqual([2])
|
|
663
730
|
})
|
|
664
731
|
|
|
665
732
|
describe('SyServerTable Checkbox selectionKey', () => {
|
|
@@ -148,6 +148,14 @@ const meta = {
|
|
|
148
148
|
type: { summary: 'boolean' },
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
|
+
showSelectSingle: {
|
|
152
|
+
description: 'Affiche des cases à cocher pour sélectionner une seule ligne à la fois',
|
|
153
|
+
control: { type: 'boolean' },
|
|
154
|
+
table: {
|
|
155
|
+
category: 'props',
|
|
156
|
+
type: { summary: 'boolean' },
|
|
157
|
+
},
|
|
158
|
+
},
|
|
151
159
|
selectionKey: {
|
|
152
160
|
description: 'Clé utilisée pour identifier chaque ligne lors de la sélection. Par défaut, utilise "id" si présent, sinon l\'objet complet.',
|
|
153
161
|
control: { type: 'text' },
|
|
@@ -2877,6 +2885,184 @@ export const RowSelection: Story = {
|
|
|
2877
2885
|
},
|
|
2878
2886
|
}
|
|
2879
2887
|
|
|
2888
|
+
export const SingleRowSelection: Story = {
|
|
2889
|
+
name: 'Single Row Selection',
|
|
2890
|
+
parameters: {
|
|
2891
|
+
sourceCode: [
|
|
2892
|
+
{
|
|
2893
|
+
name: 'Template',
|
|
2894
|
+
code: `
|
|
2895
|
+
<template>
|
|
2896
|
+
<SyTable
|
|
2897
|
+
v-model:options="options"
|
|
2898
|
+
v-model="selection"
|
|
2899
|
+
:headers="headers"
|
|
2900
|
+
:items="items"
|
|
2901
|
+
show-select-single
|
|
2902
|
+
show-filters
|
|
2903
|
+
suffix="selection-table"
|
|
2904
|
+
/>
|
|
2905
|
+
<div v-if="selection.length" class="mt-4 pa-4 bg-grey-lighten-4">
|
|
2906
|
+
<h3 class="text-h6 mb-3">Item(s) sélectionné(s) ({{ selection.length }})</h3>
|
|
2907
|
+
<div v-for="(item, index) in selection" :key="index" class="mb-2 pa-2 bg-grey-lighten-3">
|
|
2908
|
+
<div><strong>Nom:</strong> {{ typeof item === 'object' ? item.lastname : items.find(i => JSON.stringify(i) === item)?.lastname }}</div>
|
|
2909
|
+
<div><strong>Prénom:</strong> {{ typeof item === 'object' ? item.firstname : items.find(i => JSON.stringify(i) === item)?.firstname }}</div>
|
|
2910
|
+
<div><strong>Email:</strong> {{ typeof item === 'object' ? item.email : items.find(i => JSON.stringify(i) === item)?.email }}</div>
|
|
2911
|
+
</div>
|
|
2912
|
+
</div>
|
|
2913
|
+
</template>
|
|
2914
|
+
`,
|
|
2915
|
+
},
|
|
2916
|
+
{
|
|
2917
|
+
name: 'Script',
|
|
2918
|
+
code: `
|
|
2919
|
+
<script setup lang="ts">
|
|
2920
|
+
import { ref } from 'vue'
|
|
2921
|
+
import { SyTable } from '@cnamts/synapse'
|
|
2922
|
+
|
|
2923
|
+
const options = ref({
|
|
2924
|
+
itemsPerPage: 4,
|
|
2925
|
+
})
|
|
2926
|
+
|
|
2927
|
+
const headers = ref([
|
|
2928
|
+
{
|
|
2929
|
+
title: 'Nom',
|
|
2930
|
+
key: 'lastname',
|
|
2931
|
+
},
|
|
2932
|
+
{
|
|
2933
|
+
title: 'Prénom',
|
|
2934
|
+
key: 'firstname',
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
title: 'Email',
|
|
2938
|
+
value: 'email',
|
|
2939
|
+
},
|
|
2940
|
+
])
|
|
2941
|
+
|
|
2942
|
+
const items = ref([
|
|
2943
|
+
{
|
|
2944
|
+
firstname: 'Virginie',
|
|
2945
|
+
lastname: 'Beauchesne',
|
|
2946
|
+
email: 'virginie.beauchesne@example.com',
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
firstname: 'Simone',
|
|
2950
|
+
lastname: 'Bellefeuille',
|
|
2951
|
+
email: 'simone.bellefeuille@example.com',
|
|
2952
|
+
},
|
|
2953
|
+
{
|
|
2954
|
+
firstname: 'Étienne',
|
|
2955
|
+
lastname: 'Salois',
|
|
2956
|
+
email: 'etienne.salois@example.com',
|
|
2957
|
+
},
|
|
2958
|
+
{
|
|
2959
|
+
firstname: 'Thierry',
|
|
2960
|
+
lastname: 'Bobu',
|
|
2961
|
+
email: 'thierry.bobu@example.com',
|
|
2962
|
+
},
|
|
2963
|
+
{
|
|
2964
|
+
firstname: 'Bernadette',
|
|
2965
|
+
lastname: 'Langelier',
|
|
2966
|
+
email: 'bernadette.langelier@exemple.com'
|
|
2967
|
+
},
|
|
2968
|
+
{
|
|
2969
|
+
firstname: 'Agate',
|
|
2970
|
+
lastname: 'Roy',
|
|
2971
|
+
email: 'agate.roy@exemple.com'
|
|
2972
|
+
}
|
|
2973
|
+
])
|
|
2974
|
+
</script>
|
|
2975
|
+
`,
|
|
2976
|
+
},
|
|
2977
|
+
],
|
|
2978
|
+
},
|
|
2979
|
+
args: {
|
|
2980
|
+
headers: [
|
|
2981
|
+
{
|
|
2982
|
+
title: 'Nom',
|
|
2983
|
+
key: 'lastname',
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
title: 'Prénom',
|
|
2987
|
+
key: 'firstname',
|
|
2988
|
+
},
|
|
2989
|
+
{
|
|
2990
|
+
title: 'Email',
|
|
2991
|
+
value: 'email',
|
|
2992
|
+
},
|
|
2993
|
+
],
|
|
2994
|
+
items: [
|
|
2995
|
+
{
|
|
2996
|
+
firstname: 'Virginie',
|
|
2997
|
+
lastname: 'Beauchesne',
|
|
2998
|
+
email: 'virginie.beauchesne@example.com',
|
|
2999
|
+
},
|
|
3000
|
+
{
|
|
3001
|
+
firstname: 'Simone',
|
|
3002
|
+
lastname: 'Bellefeuille',
|
|
3003
|
+
email: 'simone.bellefeuille@example.com',
|
|
3004
|
+
},
|
|
3005
|
+
{
|
|
3006
|
+
firstname: 'Étienne',
|
|
3007
|
+
lastname: 'Salois',
|
|
3008
|
+
email: 'etienne.salois@example.com',
|
|
3009
|
+
},
|
|
3010
|
+
{
|
|
3011
|
+
firstname: 'Thierry',
|
|
3012
|
+
lastname: 'Bobu',
|
|
3013
|
+
email: 'thierry.bobu@example.com',
|
|
3014
|
+
},
|
|
3015
|
+
{
|
|
3016
|
+
firstname: 'Bernadette',
|
|
3017
|
+
lastname: 'Langelier',
|
|
3018
|
+
email: 'bernadette.langelier@exemple.com',
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
firstname: 'Agate',
|
|
3022
|
+
lastname: 'Roy',
|
|
3023
|
+
email: 'agate.roy@exemple.com',
|
|
3024
|
+
},
|
|
3025
|
+
],
|
|
3026
|
+
options: {
|
|
3027
|
+
itemsPerPage: 4,
|
|
3028
|
+
},
|
|
3029
|
+
caption: '',
|
|
3030
|
+
suffix: 'selection-table',
|
|
3031
|
+
density: 'default',
|
|
3032
|
+
striped: false,
|
|
3033
|
+
showSelectSingle: true,
|
|
3034
|
+
showFilters: true,
|
|
3035
|
+
},
|
|
3036
|
+
render(args) {
|
|
3037
|
+
return {
|
|
3038
|
+
components: { SyTable },
|
|
3039
|
+
setup() {
|
|
3040
|
+
const items = ref(args.items)
|
|
3041
|
+
const selection = ref([])
|
|
3042
|
+
return { args, selection, items }
|
|
3043
|
+
},
|
|
3044
|
+
template: `
|
|
3045
|
+
<div>
|
|
3046
|
+
<SyTable
|
|
3047
|
+
v-model:options="args.options"
|
|
3048
|
+
v-model="selection"
|
|
3049
|
+
v-bind="args"
|
|
3050
|
+
suffix="selection-table"
|
|
3051
|
+
/>
|
|
3052
|
+
<div v-if="selection.length" class="mt-4 pa-4 bg-grey-lighten-4">
|
|
3053
|
+
<h3 class="text-h6 mb-3">Item(s) sélectionné(s) ({{ selection.length }})</h3>
|
|
3054
|
+
<div v-for="(item, index) in selection" :key="index" class="mb-2 pa-2 bg-grey-lighten-3">
|
|
3055
|
+
<div><strong>Nom:</strong> {{ typeof item === 'object' ? item.lastname : args.items.find(i => JSON.stringify(i) === item)?.lastname }}</div>
|
|
3056
|
+
<div><strong>Prénom:</strong> {{ typeof item === 'object' ? item.firstname : args.items.find(i => JSON.stringify(i) === item)?.firstname }}</div>
|
|
3057
|
+
<div><strong>Email:</strong> {{ typeof item === 'object' ? item.email : args.items.find(i => JSON.stringify(i) === item)?.email }}</div>
|
|
3058
|
+
</div>
|
|
3059
|
+
</div>
|
|
3060
|
+
</div>
|
|
3061
|
+
`,
|
|
3062
|
+
}
|
|
3063
|
+
},
|
|
3064
|
+
}
|
|
3065
|
+
|
|
2880
3066
|
export const ColumnControls: Story = {
|
|
2881
3067
|
parameters: {
|
|
2882
3068
|
sourceCode: [
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
density: 'default',
|
|
31
31
|
striped: false,
|
|
32
32
|
showSelect: false,
|
|
33
|
+
showSelectSingle: false,
|
|
33
34
|
multiSort: false,
|
|
34
35
|
mustSort: false,
|
|
35
36
|
itemsPerPageOptions: undefined,
|
|
@@ -123,7 +124,13 @@
|
|
|
123
124
|
items: filteredItems,
|
|
124
125
|
modelValue: model,
|
|
125
126
|
updateModelValue: (value) => {
|
|
126
|
-
|
|
127
|
+
if (props.showSelectSingle && Array.isArray(value)) {
|
|
128
|
+
// In single-select mode, always keep at most one selected value
|
|
129
|
+
model.value = value.length > 0 ? [value[0]] : []
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
model.value = value
|
|
133
|
+
}
|
|
127
134
|
},
|
|
128
135
|
selectionKey: toRef(props, 'selectionKey'),
|
|
129
136
|
})
|
|
@@ -240,7 +247,8 @@
|
|
|
240
247
|
v-bind="propsFacade"
|
|
241
248
|
:items="processItems(filteredItems)"
|
|
242
249
|
:density="props.density"
|
|
243
|
-
:show-select="props.showSelect"
|
|
250
|
+
:show-select="props.showSelect || props.showSelectSingle"
|
|
251
|
+
:select-strategy="props.showSelectSingle ? 'single' : 'page'"
|
|
244
252
|
:item-selectable="(item) => true"
|
|
245
253
|
:item-value="getItemValue"
|
|
246
254
|
:multi-sort="props.multiSort"
|
|
@@ -272,7 +280,7 @@
|
|
|
272
280
|
...(getHeaderForColumn(column)?.width ? { width: getHeaderForColumn(column)?.width as any } : {}),
|
|
273
281
|
}"
|
|
274
282
|
>
|
|
275
|
-
<template v-if="column.key === 'data-table-select' && props.showSelect">
|
|
283
|
+
<template v-if="column.key === 'data-table-select' && props.showSelect && !props.showSelectSingle">
|
|
276
284
|
<SyCheckbox
|
|
277
285
|
:model-value="slotProps.allSelected"
|
|
278
286
|
:indeterminate="slotProps.someSelected && !slotProps.allSelected"
|
|
@@ -305,7 +313,7 @@
|
|
|
305
313
|
v-if="props.showFilters"
|
|
306
314
|
class="filters"
|
|
307
315
|
>
|
|
308
|
-
<th v-if="props.showSelect" />
|
|
316
|
+
<th v-if="props.showSelect || props.showSelectSingle" />
|
|
309
317
|
<template
|
|
310
318
|
v-for="column in slotProps.columns.filter(c => c.key !== 'data-table-select')"
|
|
311
319
|
:key="column.key"
|
|
@@ -435,7 +435,71 @@ describe('SyTable', () => {
|
|
|
435
435
|
expect(dataTable.props('showSelect')).toBe(true)
|
|
436
436
|
})
|
|
437
437
|
|
|
438
|
-
it('
|
|
438
|
+
it('hides header checkbox when showSelectSingle is true', () => {
|
|
439
|
+
const wrapper = mount(SyTable, {
|
|
440
|
+
props: {
|
|
441
|
+
headers,
|
|
442
|
+
items: fakeItems,
|
|
443
|
+
showSelectSingle: true,
|
|
444
|
+
suffix: 'single-select',
|
|
445
|
+
},
|
|
446
|
+
})
|
|
447
|
+
|
|
448
|
+
const dataTable = wrapper.findComponent({ name: 'VDataTable' })
|
|
449
|
+
expect(dataTable.exists()).toBe(true)
|
|
450
|
+
|
|
451
|
+
// show-select is enabled
|
|
452
|
+
expect(dataTable.props('showSelect')).toBe(true)
|
|
453
|
+
|
|
454
|
+
// In single-select mode, the header "select all" checkbox should not be rendered
|
|
455
|
+
const headerCheckbox = wrapper.find('th.checkbox-column .v-selection-control input[type="checkbox"]')
|
|
456
|
+
expect(headerCheckbox.exists()).toBe(false)
|
|
457
|
+
})
|
|
458
|
+
|
|
459
|
+
it('shows header checkbox when showSelect is true and showSelectSingle is false', () => {
|
|
460
|
+
const wrapper = mount(SyTable, {
|
|
461
|
+
props: {
|
|
462
|
+
headers,
|
|
463
|
+
items: fakeItems,
|
|
464
|
+
showSelect: true,
|
|
465
|
+
showSelectSingle: false,
|
|
466
|
+
suffix: 'multi-select',
|
|
467
|
+
},
|
|
468
|
+
})
|
|
469
|
+
|
|
470
|
+
const dataTable = wrapper.findComponent({ name: 'VDataTable' })
|
|
471
|
+
expect(dataTable.exists()).toBe(true)
|
|
472
|
+
|
|
473
|
+
// Multi-select mode keeps page strategy
|
|
474
|
+
expect(dataTable.props('showSelect')).toBe(true)
|
|
475
|
+
|
|
476
|
+
// Header "select all" checkbox should be present
|
|
477
|
+
const headerCheckbox = wrapper.find('th.checkbox-column .v-selection-control input[type="checkbox"]')
|
|
478
|
+
expect(headerCheckbox.exists()).toBe(true)
|
|
479
|
+
})
|
|
480
|
+
|
|
481
|
+
it('properly binds the v-model for single selection', async () => {
|
|
482
|
+
const selectedItems = [fakeItems[0].id]
|
|
483
|
+
const wrapper = mount(SyTable, {
|
|
484
|
+
props: {
|
|
485
|
+
headers,
|
|
486
|
+
items: fakeItems,
|
|
487
|
+
showSelect: false,
|
|
488
|
+
showSelectSingle: true,
|
|
489
|
+
modelValue: selectedItems,
|
|
490
|
+
suffix: 'single-select',
|
|
491
|
+
},
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
// select the second item
|
|
495
|
+
await wrapper.setProps({ modelValue: [fakeItems[1].id] })
|
|
496
|
+
|
|
497
|
+
// Check that the VDataTable has the correct model value
|
|
498
|
+
const dataTable = wrapper.findComponent({ name: 'VDataTable' })
|
|
499
|
+
expect(dataTable.props('modelValue')).toEqual([2])
|
|
500
|
+
})
|
|
501
|
+
|
|
502
|
+
it('should hide a column when hideColumn is called', async () => {
|
|
439
503
|
// Create a mock for OrganizeColumns component
|
|
440
504
|
const mockOrganizeColumns = {
|
|
441
505
|
name: 'OrganizeColumns',
|
|
@@ -90,6 +90,7 @@ export type SyTableProps = {
|
|
|
90
90
|
enableColumnControls?: boolean
|
|
91
91
|
headers?: DataTableHeaders[]
|
|
92
92
|
showSelect?: boolean
|
|
93
|
+
showSelectSingle?: boolean
|
|
93
94
|
showExpand?: boolean
|
|
94
95
|
selectionKey?: string
|
|
95
96
|
multiSort?: boolean
|
|
@@ -111,6 +112,7 @@ export type SyServerTableProps = {
|
|
|
111
112
|
enableColumnControls?: boolean
|
|
112
113
|
headers?: DataTableHeaders[]
|
|
113
114
|
showSelect?: boolean
|
|
115
|
+
showSelectSingle?: boolean
|
|
114
116
|
showExpand?: boolean
|
|
115
117
|
selectionKey?: string
|
|
116
118
|
multiSort?: boolean
|
|
@@ -171,7 +171,15 @@ export function useFieldValidation() {
|
|
|
171
171
|
)
|
|
172
172
|
|
|
173
173
|
case 'notWeekend': {
|
|
174
|
-
|
|
174
|
+
if (value === null || value === undefined || value === '') {
|
|
175
|
+
return {}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const dateValue = parseDate(value)
|
|
179
|
+
if (!dateValue) {
|
|
180
|
+
return { error: 'Date invalide' }
|
|
181
|
+
}
|
|
182
|
+
|
|
175
183
|
return createValidationResult(
|
|
176
184
|
!(dateValue.getDay() === 0 || dateValue.getDay() === 6),
|
|
177
185
|
options.message || options.warningMessage || `${identifier} ne peut pas être un jour de weekend.`,
|
|
@@ -179,7 +187,15 @@ export function useFieldValidation() {
|
|
|
179
187
|
}
|
|
180
188
|
|
|
181
189
|
case 'notBeforeToday': {
|
|
182
|
-
|
|
190
|
+
if (value === null || value === undefined || value === '') {
|
|
191
|
+
return {}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const dateValue = parseDate(value)
|
|
195
|
+
if (!dateValue) {
|
|
196
|
+
return { error: 'Date invalide' }
|
|
197
|
+
}
|
|
198
|
+
|
|
183
199
|
// Réinitialiser l'heure à minuit pour ne comparer que les dates
|
|
184
200
|
dateValue.setHours(0, 0, 0, 0)
|
|
185
201
|
|
|
@@ -194,7 +210,15 @@ export function useFieldValidation() {
|
|
|
194
210
|
}
|
|
195
211
|
|
|
196
212
|
case 'notAfterToday': {
|
|
197
|
-
|
|
213
|
+
if (value === null || value === undefined || value === '') {
|
|
214
|
+
return {}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const dateValue = parseDate(value)
|
|
218
|
+
if (!dateValue) {
|
|
219
|
+
return { error: 'Date invalide' }
|
|
220
|
+
}
|
|
221
|
+
|
|
198
222
|
// Réinitialiser l'heure à minuit pour ne comparer que les dates
|
|
199
223
|
dateValue.setHours(0, 0, 0, 0)
|
|
200
224
|
|
|
@@ -209,13 +233,16 @@ export function useFieldValidation() {
|
|
|
209
233
|
}
|
|
210
234
|
|
|
211
235
|
case 'notBeforeDate': {
|
|
212
|
-
if (
|
|
236
|
+
if (typeof options.date === 'undefined') {
|
|
213
237
|
return { error: 'Configuration de la règle invalide' }
|
|
214
238
|
}
|
|
215
239
|
// Si la valeur est null ou vide, ne pas valider (champ vide autorisé)
|
|
216
240
|
if (value === null || value === undefined || value === '') {
|
|
217
241
|
return {}
|
|
218
242
|
}
|
|
243
|
+
if (options.date === null || (typeof options.date === 'string' && options.date.trim() === '')) {
|
|
244
|
+
return {}
|
|
245
|
+
}
|
|
219
246
|
const dateValue = parseDate(value)
|
|
220
247
|
if (!dateValue) {
|
|
221
248
|
return { error: 'Date invalide' }
|
|
@@ -242,13 +269,16 @@ export function useFieldValidation() {
|
|
|
242
269
|
}
|
|
243
270
|
|
|
244
271
|
case 'notAfterDate': {
|
|
245
|
-
if (
|
|
272
|
+
if (typeof options.date === 'undefined') {
|
|
246
273
|
return { error: 'Configuration de la règle invalide' }
|
|
247
274
|
}
|
|
248
275
|
// Si la valeur est null ou vide, ne pas valider (champ vide autorisé)
|
|
249
276
|
if (value === null || value === undefined || value === '') {
|
|
250
277
|
return {}
|
|
251
278
|
}
|
|
279
|
+
if (options.date === null || (typeof options.date === 'string' && options.date.trim() === '')) {
|
|
280
|
+
return {}
|
|
281
|
+
}
|
|
252
282
|
const dateValue = parseDate(value)
|
|
253
283
|
if (!dateValue) {
|
|
254
284
|
return { error: 'Date invalide' }
|
|
@@ -275,13 +305,16 @@ export function useFieldValidation() {
|
|
|
275
305
|
}
|
|
276
306
|
|
|
277
307
|
case 'dateExact': {
|
|
278
|
-
if (
|
|
308
|
+
if (typeof options.date === 'undefined') {
|
|
279
309
|
return { error: 'Configuration de la règle invalide' }
|
|
280
310
|
}
|
|
281
311
|
// Si la valeur est null ou vide, ne pas valider (champ vide autorisé)
|
|
282
312
|
if (value === null || value === undefined || value === '') {
|
|
283
313
|
return {}
|
|
284
314
|
}
|
|
315
|
+
if (options.date === null || (typeof options.date === 'string' && options.date.trim() === '')) {
|
|
316
|
+
return {}
|
|
317
|
+
}
|
|
285
318
|
const dateValue = parseDate(value)
|
|
286
319
|
if (!dateValue) {
|
|
287
320
|
return { error: 'Date invalide' }
|
|
@@ -313,7 +346,14 @@ export function useFieldValidation() {
|
|
|
313
346
|
|
|
314
347
|
case 'isHolidayDay': {
|
|
315
348
|
const { isHolidayDay } = useHolidayDay()
|
|
316
|
-
|
|
349
|
+
if (value === null || value === undefined || value === '') {
|
|
350
|
+
return {}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const dateValue = parseDate(value)
|
|
354
|
+
if (!dateValue) {
|
|
355
|
+
return { error: 'Date invalide' }
|
|
356
|
+
}
|
|
317
357
|
|
|
318
358
|
return createValidationResult(
|
|
319
359
|
!isHolidayDay(dateValue),
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
2
|
-
import { expect, describe, it } from 'vitest'
|
|
3
|
-
import AmeliproLogoAm from '../AmeliproLogoAm.vue'
|
|
4
|
-
|
|
5
|
-
describe('AmeliproLogoAm', () => {
|
|
6
|
-
it('render correctly', async () => {
|
|
7
|
-
const wrapper = mount(AmeliproLogoAm, {
|
|
8
|
-
props: {
|
|
9
|
-
uniqueId: 'amelipro-logo-id',
|
|
10
|
-
},
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
expect(wrapper.html()).toMatchSnapshot()
|
|
14
|
-
})
|
|
15
|
-
})
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
2
|
-
import { expect, describe, it } from 'vitest'
|
|
3
|
-
import AmeliproIcon from '../AmeliproIcon.vue'
|
|
4
|
-
|
|
5
|
-
describe('AmeliproIcon', () => {
|
|
6
|
-
it('render correctly', async () => {
|
|
7
|
-
const wrapper = mount(AmeliproIcon, {
|
|
8
|
-
props: {
|
|
9
|
-
icon: 'utilisateur',
|
|
10
|
-
iconBgColor: 'ap-blue-darken-1',
|
|
11
|
-
iconColor: 'ap-white',
|
|
12
|
-
uniqueId: 'amelipro-icon-id',
|
|
13
|
-
xLarge: true,
|
|
14
|
-
},
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
expect(wrapper.html()).toMatchSnapshot()
|
|
18
|
-
})
|
|
19
|
-
})
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
2
|
-
import { expect, describe, it } from 'vitest'
|
|
3
|
-
import AmeliproIconBtn from '../AmeliproIconBtn.vue'
|
|
4
|
-
|
|
5
|
-
describe('AmeliproIconBtn', () => {
|
|
6
|
-
it('render correctly', async () => {
|
|
7
|
-
const wrapper = mount(AmeliproIconBtn, {
|
|
8
|
-
props: {
|
|
9
|
-
btnLabel: 'Libellé du bouton',
|
|
10
|
-
icon: 'utilisateur',
|
|
11
|
-
iconBgColor: 'ap-blue-darken-1',
|
|
12
|
-
iconColor: 'ap-white',
|
|
13
|
-
iconHoverBgColor: 'ap-blue-darken-2',
|
|
14
|
-
iconHoverColor: 'ap-white',
|
|
15
|
-
uniqueId: 'amelipro-icon-id',
|
|
16
|
-
xLarge: true,
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
expect(wrapper.html()).toMatchSnapshot()
|
|
21
|
-
})
|
|
22
|
-
})
|
package/src/components/Amelipro/AmeliproIconBtn/tests/__snapshots__/AmeliproIconBtn.spec.ts.snap
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
-
|
|
3
|
-
exports[`AmeliproIconBtn > render correctly 1`] = `
|
|
4
|
-
<button
|
|
5
|
-
class="
|
|
6
|
-
btn--icon
|
|
7
|
-
elevation-0
|
|
8
|
-
rounded-0
|
|
9
|
-
v-btn
|
|
10
|
-
v-btn--density-default
|
|
11
|
-
v-btn--elevated
|
|
12
|
-
v-btn--icon
|
|
13
|
-
v-btn--size-default
|
|
14
|
-
v-btn--variant-elevated
|
|
15
|
-
v-theme--light
|
|
16
|
-
"
|
|
17
|
-
id="amelipro-icon-id"
|
|
18
|
-
plain=""
|
|
19
|
-
style="
|
|
20
|
-
height: auto;
|
|
21
|
-
width: auto;
|
|
22
|
-
"
|
|
23
|
-
type="button"
|
|
24
|
-
>
|
|
25
|
-
<span class="v-btn__overlay"></span>
|
|
26
|
-
<span class="v-btn__underlay"></span>
|
|
27
|
-
<!---->
|
|
28
|
-
<span
|
|
29
|
-
class="v-btn__content"
|
|
30
|
-
data-no-activator=""
|
|
31
|
-
>
|
|
32
|
-
<span
|
|
33
|
-
class="d-sr-only"
|
|
34
|
-
id="amelipro-icon-id-btn-label"
|
|
35
|
-
>
|
|
36
|
-
Libellé du bouton
|
|
37
|
-
</span>
|
|
38
|
-
<span
|
|
39
|
-
class="
|
|
40
|
-
amelipro-icon
|
|
41
|
-
icon-custom
|
|
42
|
-
"
|
|
43
|
-
id="amelipro-icon-id-icon"
|
|
44
|
-
>
|
|
45
|
-
<span
|
|
46
|
-
aria-hidden="true"
|
|
47
|
-
class="
|
|
48
|
-
amelipro-custom-icon
|
|
49
|
-
custom-color
|
|
50
|
-
x-large
|
|
51
|
-
"
|
|
52
|
-
focusable="false"
|
|
53
|
-
role="img"
|
|
54
|
-
style="color: #FFFFFF;"
|
|
55
|
-
>
|
|
56
|
-
<span>
|
|
57
|
-
<svg
|
|
58
|
-
aria-hidden="true"
|
|
59
|
-
clip-rule="evenodd"
|
|
60
|
-
fill-rule="evenodd"
|
|
61
|
-
height="34"
|
|
62
|
-
image-rendering="optimizeQuality"
|
|
63
|
-
shape-rendering="geometricPrecision"
|
|
64
|
-
text-rendering="geometricPrecision"
|
|
65
|
-
viewBox="0 0 1823 1823"
|
|
66
|
-
width="34"
|
|
67
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
68
|
-
>
|
|
69
|
-
<circle
|
|
70
|
-
class="circle-color"
|
|
71
|
-
cx="912"
|
|
72
|
-
cy="912"
|
|
73
|
-
r="912"
|
|
74
|
-
/>
|
|
75
|
-
<path
|
|
76
|
-
class="shape-color"
|
|
77
|
-
d="M962 454c117 0 125 154 125 154v145s1 111-73 152c-2 10-3 20-1 30 4-2-21 146 106 165 92 15 178 57 247 120 23 23 40 186 40 186H418s-2-132 40-186c73-62 162-104 257-120 128-19 85-160 89-158 2-10 1-21-1-31 0 0-69-89-68-169 1-81 0-134 0-134s-4-190 126-190l101 36z"
|
|
78
|
-
/>
|
|
79
|
-
</svg>
|
|
80
|
-
</span>
|
|
81
|
-
</span>
|
|
82
|
-
</span>
|
|
83
|
-
</span>
|
|
84
|
-
<!---->
|
|
85
|
-
<!---->
|
|
86
|
-
</button>
|
|
87
|
-
`;
|