@cnamts/synapse 1.0.21 → 1.0.23
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-uN8OURoP.js → DateFilter-Dc-gSGwk.js} +29 -24
- package/dist/{NumberFilter-sm1dQNQi.js → NumberFilter-vP38Wp6j.js} +1 -1
- package/dist/{PeriodFilter-Cklsxnh9.js → PeriodFilter-Ba1uYUnT.js} +1 -1
- package/dist/{SelectFilter-CWefj27Z.js → SelectFilter-BioGT6Nn.js} +1 -1
- package/dist/{TextFilter-Ddyj885L.js → TextFilter-B84dpnoq.js} +1 -1
- package/dist/components/Accordion/Accordion.d.ts +13 -2
- package/dist/components/Accordion/composables/useAccordionState.d.ts +2 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +7405 -5973
- package/dist/components/Amelipro/AmeliproBtn/AmeliproBtn.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproCallback/AmeliproCallback.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +10 -14
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproFirstLogin/AmeliproFirstLogin.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproFooter/AmeliproFooter.d.ts +8 -8
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeader.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIcon/AmeliproIcon.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +16 -20
- package/dist/components/Amelipro/AmeliproMenu/AmeliproMenu.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/AmeliproPaginationBtn.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproPatientBanner/AmeliproPatientBanner.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +1610 -1354
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +2413 -2029
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +8885 -7323
- package/dist/components/Amelipro/AmeliproStateTile/AmeliproStateTile.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproStepper/AmeliproStepper.d.ts +2 -6
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +8884 -7330
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +950 -838
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +1614 -1358
- package/dist/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.d.ts +223 -203
- package/dist/components/Amelipro/AmeliproTransmission/AmeliproTransmission.d.ts +3 -3
- package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +3 -7
- package/dist/components/CollapsibleList/CollapsibleList.d.ts +4 -1
- package/dist/components/CookieBanner/CookieBanner.d.ts +303 -273
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +1297 -1156
- package/dist/components/CookiesSelection/CookiesSelection.d.ts +404 -377
- package/dist/components/Customs/Selects/SelectBtnField/SelectBtnField.d.ts +1 -1
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +1108 -846
- package/dist/components/Customs/Selects/SyAutocomplete/locales.d.ts +5 -0
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +514 -320
- package/dist/components/Customs/Selects/SySelect/locales.d.ts +1 -0
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +40 -38
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +920 -800
- package/dist/components/Customs/SyForm/SyForm.d.ts +356 -348
- package/dist/components/Customs/SyPagination/SyPagination.d.ts +11 -1
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +906 -794
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +1634 -1367
- package/dist/components/DataList/DataList.d.ts +1 -1
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +3869 -3120
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +1947 -1561
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +831 -684
- package/dist/components/DialogBox/DialogBox.d.ts +482 -416
- package/dist/components/DownloadBtn/config.d.ts +1 -1
- package/dist/components/ErrorPage/ErrorPage.d.ts +6 -0
- package/dist/components/FileList/UploadItem/UploadItem.d.ts +6 -0
- package/dist/components/FileList/UploadItem/locales.d.ts +1 -0
- package/dist/components/FileUpload/FileUpload.d.ts +4 -4
- package/dist/components/FileUpload/FileUploadContent.d.ts +2 -0
- package/dist/components/FileUpload/locales.d.ts +1 -0
- package/dist/components/FileUpload/validateFiles.d.ts +2 -1
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +418 -366
- package/dist/components/FooterBar/FooterBar.d.ts +13 -1
- package/dist/components/FooterBar/locales.d.ts +1 -0
- package/dist/components/FooterBar/types.d.ts +1 -0
- package/dist/components/HeaderBar/HeaderBar.d.ts +2 -0
- package/dist/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +2 -0
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +4 -6
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +1031 -643
- package/dist/components/LangBtn/LangBtn.d.ts +277 -239
- package/dist/components/LogoBrandSection/LogoBrandSection.d.ts +4 -0
- package/dist/components/MaintenancePage/MaintenancePage.d.ts +16 -1
- package/dist/components/MonthPicker/MonthPicker.d.ts +1939 -0
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +1899 -0
- package/dist/components/MonthPicker/MonthPickerText/useTextField.d.ts +21 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.d.ts +21 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.d.ts +12 -0
- package/dist/components/MonthPicker/MonthPickerVisual/MonthSelector.d.ts +11 -0
- package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.d.ts +6 -0
- package/dist/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.d.ts +14 -0
- package/dist/components/MonthPicker/MonthPickerVisual/YearSelector.d.ts +14 -0
- package/dist/components/MonthPicker/MonthPickerVisual/useMonthGrid.d.ts +9 -0
- package/dist/components/MonthPicker/MonthPickerVisual/useYearGrid.d.ts +8 -0
- package/dist/components/MonthPicker/MonthPickerVisual/utils.d.ts +8 -0
- package/dist/components/MonthPicker/locales.d.ts +12 -0
- package/dist/components/MonthPicker/useMonthPickerValidation.d.ts +25 -0
- package/dist/components/NirField/NirField.d.ts +1669 -1379
- package/dist/components/NotFoundPage/NotFoundPage.d.ts +9 -3
- package/dist/components/NotificationBar/Notification/Notification.d.ts +3 -0
- package/dist/components/PageContainer/PageContainer.d.ts +3 -1
- package/dist/components/PeriodField/PeriodField.d.ts +7696 -6192
- package/dist/components/PhoneField/PhoneField.d.ts +829 -684
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +4 -12
- package/dist/components/StatusPage/StatusPage.d.ts +12 -1
- package/dist/components/SubHeader/SubHeader.d.ts +2 -0
- package/dist/components/SyAlert/SyAlert.d.ts +74 -70
- package/dist/components/SyBtnMenu/SyBtnMenu.d.ts +9 -0
- package/dist/components/SyHeading/SyHeading.a11y.test.d.ts +1 -0
- package/dist/components/SyHeading/SyHeading.d.ts +22 -0
- package/dist/components/SyHeading/SyHeading.test.d.ts +1 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +475 -419
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +759 -468
- package/dist/components/Tables/SyTable/SyTable.d.ts +761 -470
- package/dist/components/Tables/common/SyTableFilter.d.ts +1 -1
- package/dist/components/Tables/common/SyTablePagination.d.ts +263 -164
- package/dist/components/Tables/common/filters/DateFilter.d.ts +10 -1
- package/dist/components/Tables/common/filters/NumberFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/PeriodFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/SelectFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/TextFilter.d.ts +1 -1
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +166 -138
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +24 -1211
- package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/types.d.ts +2 -0
- package/dist/design-system-v3.js +111 -107
- package/dist/design-system-v3.umd.cjs +158 -158
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +26 -14
- package/dist/designTokens/tokens/amelipro/apSemantic.d.ts +19 -13
- package/dist/designTokens/tokens/cnam/cnamContextual.d.ts +5 -0
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +28 -15
- package/dist/designTokens/tokens/cnam/cnamSemantic.d.ts +20 -13
- package/dist/designTokens/tokens/pa/paLightTheme.d.ts +26 -15
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +19 -13
- package/dist/main-aLKwdMi1.js +37886 -0
- package/dist/main.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/vuetifyConfig.d.ts +14 -14
- package/package.json +21 -9
- package/src/assets/amelipro/img/logo-amelipro.svg +9 -0
- package/src/assets/apTokens.scss +53 -17
- package/src/assets/overrides/_btns.scss +8 -0
- package/src/assets/overrides/_forms.scss +9 -0
- package/src/assets/overrides/_icons.scss +43 -4
- package/src/assets/overrides/_tables.scss +19 -0
- package/src/assets/overrides/_tooltips.scss +5 -6
- package/src/assets/overrides/_typography.scss +17 -2
- package/src/assets/overrides/_utilities.scss +49 -3
- package/src/assets/tokens.scss +53 -17
- package/src/components/Accordion/Accordion.mdx +23 -9
- package/src/components/Accordion/Accordion.stories.ts +153 -3
- package/src/components/Accordion/Accordion.vue +7 -6
- package/src/components/Accordion/accessibilite/Accessibility.mdx +5 -4
- package/src/components/Accordion/composables/__tests__/useAccordionState.spec.ts +40 -12
- package/src/components/Accordion/composables/useAccordionState.ts +3 -4
- package/src/components/Accordion/tests/accordion.spec.ts +131 -19
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.vue +2 -2
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/__tests__/__snapshots__/AmeliproAccordionTemplate.spec.ts.snap +0 -2
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.vue +2 -2
- package/src/components/Amelipro/AmeliproAccordionFrieze/__tests__/__snapshots__/AmeliproAccordionFrieze.spec.ts.snap +14 -56
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +1 -1
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +15 -23
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +1 -1
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +15 -3
- package/src/components/Amelipro/AmeliproCarousel/__tests__/__snapshots__/AmeliproCarousel.spec.ts.snap +0 -2
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +0 -98
- package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.mdx +1 -1
- package/src/components/Amelipro/AmeliproContentLayout/AmeliproContentLayout.stories.ts +5 -16
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.mdx +3 -1
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.stories.ts +7 -0
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproTooth/AmeliproTooth.vue +0 -1
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproTooth/tests/__snapshots__/AmeliproTooth.spec.ts.snap +0 -1
- package/src/components/Amelipro/AmeliproDentalChart/tests/__snapshots__/AmeliproDentalChart.spec.ts.snap +0 -52
- package/src/components/Amelipro/AmeliproDialog/__tests__/__snapshots__/AmeliproDialog.spec.ts.snap +6 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.mdx +3 -1
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.stories.ts +19 -0
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.vue +2 -2
- package/src/components/Amelipro/AmeliproFirstLogin/AmeliproFirstLogin.vue +3 -4
- package/src/components/Amelipro/AmeliproFirstLogin/__tests__/__snapshots__/AmeliproFirstLogin.spec.ts.snap +2 -13
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.mdx +3 -1
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.stories.ts +7 -0
- package/src/components/Amelipro/AmeliproMenu/__tests__/__snapshots__/AmeliproMenu.spec.ts.snap +8 -0
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.mdx +3 -1
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.stories.ts +8 -0
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +9 -2
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/__snapshots__/AmeliproPostalAddressCityRow.spec.ts.snap +28 -10
- package/src/components/Amelipro/AmeliproPostalAddressField/__tests__/__snapshots__/AmeliproPostalAddressField.spec.ts.snap +44 -8
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +1 -1
- package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +15 -3
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +1 -1
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +0 -1
- package/src/components/Amelipro/AmeliproTooltips/__tests__/__snapshots__/AmeliproTooltips.spec.ts.snap +6 -0
- package/src/components/Amelipro/AmeliproUpload/__tests__/__snapshots__/AmeliproUpload.spec.ts.snap +2 -4
- package/src/components/Amelipro/StructureMenu/StructureList/__tests__/__snapshots__/StructureList.spec.ts.snap +0 -2
- package/src/components/Amelipro/UserMenu/__tests__/__snapshots__/UserMenu.spec.ts.snap +8 -0
- package/src/components/BackBtn/BackBtn.vue +1 -1
- package/src/components/BackBtn/accessibilite/Accessibility.mdx +62 -10
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +9 -3
- package/src/components/BackToTopBtn/accessibilite/Accessibility.mdx +86 -6
- package/src/components/Captcha/tests/Captcha.spec.ts +0 -29
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +18 -108
- package/src/components/ChipList/ChipList.vue +4 -2
- package/src/components/CollapsibleList/CollapsibleList.stories.ts +8 -3
- package/src/components/CollapsibleList/CollapsibleList.vue +14 -6
- package/src/components/CollapsibleList/accessibilite/Accessibility.mdx +19 -6
- package/src/components/CollapsibleList/tests/CollapsibleList.a11y.spec.ts +1 -0
- package/src/components/CollapsibleList/tests/CollapsibleList.spec.ts +2 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +10 -0
- package/src/components/CookieBanner/CookieBanner.vue +15 -5
- package/src/components/CookieBanner/accessibilite/Accessibility.mdx +9 -0
- package/src/components/CookieBanner/tests/CookieBanner.spec.ts +10 -2
- package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +21 -15
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +17 -8
- package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.a11y.spec.ts +1 -0
- package/src/components/CookiesSelection/CookiesInformation/tests/CookiesInformation.spec.ts +5 -0
- package/src/components/CookiesSelection/CookiesSelection.vue +7 -2
- package/src/components/CookiesSelection/tests/CookiesSelection.a11y.spec.ts +1 -0
- package/src/components/CookiesSelection/tests/CookiesSelection.spec.ts +5 -0
- package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +21 -15
- package/src/components/CopyBtn/CopyBtn.vue +6 -4
- package/src/components/CopyBtn/accessibilite/Accessibility.mdx +82 -11
- package/src/components/CopyBtn/tests/__snapshots__/CopyBtn.spec.ts.snap +5 -1
- package/src/components/Customs/Selects/SelectBtnField/accessibilite/Accessibility.mdx +133 -10
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +379 -93
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +144 -83
- package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibilite.stories.ts +40 -1
- package/src/components/Customs/Selects/SyAutocomplete/accessibilite/Accessibility.mdx +7 -1
- package/src/components/Customs/Selects/SyAutocomplete/locales.ts +5 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +96 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +234 -9
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +13 -3
- package/src/components/Customs/Selects/SyAutocomplete/utils/useSelectionLogic.ts +9 -10
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.stories.ts +4 -10
- package/src/components/Customs/Selects/SySelect/SySelect.mdx +0 -1
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +10 -10
- package/src/components/Customs/Selects/SySelect/SySelect.vue +63 -3
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +1 -1
- package/src/components/Customs/Selects/SySelect/locales.ts +1 -0
- package/src/components/Customs/Selects/SySelect/tests/SySelect.a11y.spec.ts +1 -3
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +72 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +1 -1
- package/src/components/Customs/SyIcon/SyIcon.a11y.spec.ts +31 -2
- package/src/components/Customs/SyIcon/SyIcon.vue +9 -5
- package/src/components/Customs/SyIcon/tests/SyIcon.a11y.spec.ts +20 -0
- package/src/components/Customs/SyIconButton/SyIconButton.mdx +46 -0
- package/src/components/Customs/SyIconButton/SyIconButton.stories.ts +184 -0
- package/src/components/Customs/SyIconButton/SyIconButton.vue +38 -0
- package/src/components/Customs/SyIconButton/accessibilite/Accessibility.mdx +64 -0
- package/src/components/Customs/SyIconButton/tests/SyIconButton.a11y.spec.ts +87 -0
- package/src/components/Customs/SyIconButton/tests/SyIconButton.spec.ts +152 -0
- package/src/components/Customs/SyIconButton/tests/__snapshots__/SyIconButton.spec.ts.snap +61 -0
- package/src/components/Customs/SyPagination/SyPagination.stories.ts +14 -2
- package/src/components/Customs/SyPagination/SyPagination.vue +25 -10
- package/src/components/Customs/SyPagination/accessibilite/Accessibility.mdx +79 -8
- package/src/components/Customs/SyPagination/tests/SyPagination.a11y.spec.ts +53 -0
- package/src/components/Customs/SyPagination/tests/SyPagination.spec.ts +12 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +4 -0
- package/src/components/Customs/SyTextField/SyTextField.vue +59 -7
- package/src/components/Customs/SyTextField/accessibilite/Accessibility.mdx +67 -9
- package/src/components/Customs/SyTextField/tests/SyTextField.a11y.spec.ts +15 -0
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +36 -0
- package/src/components/DataList/accessibilite/Accessibility.mdx +79 -11
- package/src/components/DataListGroup/accessibilite/Accessibility.mdx +80 -11
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +28 -3
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +20 -8
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.spec.ts +9 -3
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +70 -47
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.a11y.spec.ts +34 -0
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.a11y.spec.ts +27 -0
- package/src/components/DatePicker/docExamples/BidirectionalComplexValidation.vue +23 -9
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +21 -8
- package/src/components/DatePicker/docExamples/DatePickerValidationExamples.vue +50 -22
- package/src/components/DatePicker/playground/ComplexDatePickerPlayground.vue +48 -10
- package/src/components/DatePicker/playground/DatePickerHolidayRule.vue +16 -3
- package/src/components/DialogBox/DialogBox.stories.ts +13 -0
- package/src/components/DialogBox/DialogBox.vue +12 -5
- package/src/components/DialogBox/accessibilite/Accessibility.mdx +27 -7
- package/src/components/DialogBox/tests/DialogBox.a11y.spec.ts +1 -0
- package/src/components/DialogBox/tests/DialogBox.spec.ts +40 -6
- package/src/components/DownloadBtn/accessibilite/Accessibility.mdx +73 -11
- package/src/components/DownloadBtn/config.ts +1 -1
- package/src/components/DownloadBtn/tests/DownloadBtn.a11y.spec.ts +25 -0
- package/src/components/ErrorPage/ErrorPage.stories.ts +176 -47
- package/src/components/ErrorPage/ErrorPage.vue +21 -0
- package/src/components/ErrorPage/accessibilite/Accessibility.mdx +15 -0
- package/src/components/ErrorPage/tests/ErrorPage.a11y.spec.ts +17 -0
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +21 -1
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +1 -0
- package/src/components/ExternalLinks/tests/ExternalLinks.a11y.spec.ts +23 -0
- package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +13 -2
- package/src/components/FileList/FileList.stories.ts +55 -1
- package/src/components/FileList/UploadItem/UploadItem.vue +17 -5
- package/src/components/FileList/UploadItem/locales.ts +3 -2
- package/src/components/FileList/accessibilite/Accessibility.mdx +58 -7
- package/src/components/FileUpload/FileUpload.vue +62 -38
- package/src/components/FileUpload/FileUploadContent.vue +3 -2
- package/src/components/FileUpload/accessibilite/Accessibility.mdx +48 -5
- package/src/components/FileUpload/locales.ts +1 -0
- package/src/components/FileUpload/tests/FileUpload.spec.ts +61 -14
- package/src/components/FileUpload/validateFiles.ts +5 -2
- package/src/components/FilterInline/FilterInline.stories.ts +0 -15
- package/src/components/FilterInline/FilterInline.vue +1 -0
- package/src/components/FilterInline/accessibilite/Accessibility.mdx +70 -7
- package/src/components/FilterInline/tests/__snapshots__/FilterInline.spec.ts.snap +3 -3
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +0 -3
- package/src/components/FilterSideBar/FilterSideBar.vue +2 -1
- package/src/components/FilterSideBar/accessibilite/Accessibility.mdx +70 -9
- package/src/components/FooterBar/FooterBar.stories.ts +298 -34
- package/src/components/FooterBar/FooterBar.vue +67 -9
- package/src/components/FooterBar/config.ts +2 -2
- package/src/components/FooterBar/locales.ts +1 -0
- package/src/components/FooterBar/tests/FooterBarConfig.spec.ts +1 -1
- package/src/components/FooterBar/tests/__snapshots__/FooterBar.spec.ts.snap +6 -25
- package/src/components/FooterBar/types.d.ts +1 -0
- package/src/components/FranceConnectBtn/accessibilite/Accessibility.mdx +62 -9
- package/src/components/HeaderBar/HeaderBar.stories.ts +23 -1
- package/src/components/HeaderBar/HeaderBar.vue +5 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +8 -2
- package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +5 -0
- package/src/components/HeaderBar/accessibilite/Accessibility.mdx +24 -5
- package/src/components/HeaderBar/tests/HeaderBar.a11y.spec.ts +1 -0
- package/src/components/HeaderBar/tests/HeaderBar.spec.ts +3 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +4 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +3 -0
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +3 -0
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +22 -0
- package/src/components/LogoBrandSection/LogoBrandSection.vue +13 -5
- package/src/components/LogoBrandSection/tests/LogoBrandSection.a11y.spec.ts +2 -0
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +44 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +2 -0
- package/src/components/LunarCalendar/accessibilite/Accessibility.mdx +74 -8
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +163 -0
- package/src/components/MaintenancePage/MaintenancePage.vue +33 -6
- package/src/components/MaintenancePage/accessibilite/Accessibility.mdx +3 -1
- package/src/components/MaintenancePage/tests/MaintenancePage.a11y.spec.ts +3 -2
- package/src/components/MaintenancePage/tests/MaintenancePage.spec.ts +18 -1
- package/src/components/MaintenancePage/tests/__snapshots__/MaintenancePage.spec.ts.snap +1 -0
- package/src/components/MonthPicker/MonthPicker.mdx +35 -0
- package/src/components/MonthPicker/MonthPicker.stories.ts +527 -0
- package/src/components/MonthPicker/MonthPicker.vue +79 -0
- package/src/components/MonthPicker/MonthPickerText/MonthPickerInput.vue +89 -0
- package/src/components/MonthPicker/MonthPickerText/useTextField.ts +27 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisual.vue +154 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthPickerVisualProps.ts +13 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthSelector.vue +137 -0
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.vue +60 -0
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +149 -0
- package/src/components/MonthPicker/MonthPickerVisual/YearSelector.vue +143 -0
- package/src/components/MonthPicker/MonthPickerVisual/useMonthGrid.ts +45 -0
- package/src/components/MonthPicker/MonthPickerVisual/useYearGrid.ts +45 -0
- package/src/components/MonthPicker/MonthPickerVisual/utils.ts +17 -0
- package/src/components/MonthPicker/accessibilite/Accessibility.mdx +59 -0
- package/src/components/MonthPicker/locales.ts +12 -0
- package/src/components/MonthPicker/tests/MonthPicker.a11y.spec.ts +71 -0
- package/src/components/MonthPicker/tests/MonthPicker.spec.ts +1248 -0
- package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +2545 -0
- package/src/components/MonthPicker/useMonthPickerValidation.ts +30 -0
- package/src/components/NirField/NirField.mdx +1 -2
- package/src/components/NirField/NirField.stories.ts +66 -6
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +1 -1
- package/src/components/NotFoundPage/NotFoundPage.vue +16 -5
- package/src/components/NotFoundPage/accessibilite/Accessibility.mdx +2 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.a11y.spec.ts +49 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.spec.ts +24 -2
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +24 -14
- package/src/components/NotificationBar/Notification/Notification.vue +3 -1
- package/src/components/NotificationBar/NotificationBar.stories.ts +154 -0
- package/src/components/NotificationBar/tests/NotificationBar.a11y.spec.ts +26 -0
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +60 -0
- package/src/components/PageContainer/PageContainer.stories.ts +47 -0
- package/src/components/PageContainer/PageContainer.vue +4 -2
- package/src/components/PageContainer/accessibilite/Accessibility.mdx +31 -17
- package/src/components/PaginatedTable/PaginatedTable.mdx +3 -3
- package/src/components/PaginatedTable/PaginatedTable.stories.ts +9 -1
- package/src/components/PeriodField/PeriodField.vue +4 -0
- package/src/components/PeriodField/tests/PeriodField.a11y.spec.ts +10 -1
- package/src/components/PhoneField/PhoneField.stories.ts +73 -35
- package/src/components/PhoneField/PhoneField.vue +152 -83
- package/src/components/PhoneField/accessibilite/Accessibility.mdx +306 -9
- package/src/components/PhoneField/indicatifs.ts +2 -2
- package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +47 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +82 -5
- package/src/components/RangeField/accessibilite/Accessibility.mdx +79 -11
- package/src/components/SearchListField/SearchListField.vue +1 -1
- package/src/components/SearchListField/accessibilite/Accessibility.mdx +69 -9
- package/src/components/SearchListField/tests/SearchListField.a11y.spec.ts +37 -0
- package/src/components/SkipLink/tests/SkipLink.a11y.spec.ts +23 -0
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +1 -1
- package/src/components/StatusPage/StatusPage.mdx +10 -1
- package/src/components/StatusPage/StatusPage.stories.ts +161 -0
- package/src/components/StatusPage/StatusPage.vue +29 -5
- package/src/components/StatusPage/accessibilite/Accessibility.mdx +24 -5
- package/src/components/StatusPage/tests/StatusPage.a11y.spec.ts +23 -0
- package/src/components/StatusPage/tests/StatusPage.spec.ts +25 -0
- package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +24 -14
- package/src/components/SubHeader/SubHeader.stories.ts +16 -0
- package/src/components/SubHeader/SubHeader.vue +6 -3
- package/src/components/SubHeader/accessibilite/Accessibility.mdx +27 -6
- package/src/components/SubHeader/tests/SubHeader.a11y.spec.ts +20 -0
- package/src/components/SyAlert/SyAlert.vue +22 -20
- package/src/components/SyAlert/accessibilite/Accessibility.mdx +79 -9
- package/src/components/SyAlert/tests/SyAlert.a11y.spec.ts +23 -0
- package/src/components/SyBtnMenu/SyBtnMenu.vue +33 -17
- package/src/components/SyBtnMenu/tests/SyBtnMenu.a11y.spec.ts +38 -0
- package/src/components/SyBtnMenu/tests/SyBtnMenu.spec.ts +41 -0
- package/src/components/SyHeading/SyHeading.a11y.test.ts +149 -0
- package/src/components/SyHeading/SyHeading.test.ts +115 -0
- package/src/components/SyHeading/SyHeading.vue +20 -0
- package/src/components/SyTextArea/accessibilite/Accessibility.mdx +80 -8
- package/src/components/SyTextArea/tests/SyTextArea.a11y.spec.ts +151 -0
- package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +96 -30
- package/src/components/Tables/SyServerTable/SyServerTable.vue +2 -0
- package/src/components/Tables/SyTable/SyTable.vue +2 -0
- package/src/components/Tables/common/SyTablePagination.vue +16 -10
- package/src/components/Tables/common/filters/DateFilter.vue +5 -0
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +40 -24
- package/src/components/Tables/common/types.ts +3 -0
- package/src/components/ToolbarContainer/tests/ToolbarContainer.a11y.spec.ts +126 -0
- package/src/components/UploadWorkflow/UploadWorkflow.stories.ts +11 -11
- package/src/components/UploadWorkflow/UploadWorkflow.vue +30 -13
- package/src/components/UploadWorkflow/accessibilite/Accessibility.mdx +56 -5
- package/src/components/UploadWorkflow/accessibilite/UploadWorkflow.a11y.spec.ts +110 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +7 -25
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +146 -123
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +53 -31
- package/src/components/UserMenuBtn/UserMenuBtn.vue +4 -1
- package/src/components/UserMenuBtn/accessibilite/Accessibility.mdx +72 -8
- package/src/components/index.ts +2 -0
- package/src/components/types.ts +4 -0
- package/src/composables/date/tests/useDateInitialization.spec.ts +22 -1
- package/src/composables/date/useDateInitializationDayjs.ts +4 -7
- package/src/composables/date/useDatePickerAccessibility.ts +2 -3
- package/src/composables/useFilterable/useFilterable.spec.ts +52 -2
- package/src/composables/useFilterable/useFilterable.ts +7 -1
- package/src/composables/useFormFieldErrorHandling.ts +11 -2
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +27 -15
- package/src/designTokens/tokens/amelipro/apSemantic.ts +21 -15
- package/src/designTokens/tokens/cnam/cnamContextual.ts +6 -1
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +28 -15
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +21 -14
- package/src/designTokens/tokens/pa/paLightTheme.ts +27 -16
- package/src/designTokens/tokens/pa/paSemantic.ts +19 -13
- package/src/directives/rgaaSvgFix.ts +2 -7
- package/src/main.ts +2 -0
- package/src/stories/Accessibilite/{Audit → AuditEtContreAudit}/Exemptions-derogations.mdx +1 -1
- package/src/stories/Accessibilite/AuditEtContreAudit/Introduction.mdx +188 -0
- package/src/stories/Accessibilite/{Audit → AuditEtContreAudit}/RGAA.mdx +1 -1
- package/src/stories/Accessibilite/Introduction.mdx +22 -3
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +21 -22
- package/src/stories/DeprecationNotice/DeprecationNotice.ts +41 -0
- package/src/stories/DesignTokens/ColorDisplay.vue +12 -5
- package/src/stories/DesignTokens/Colors.mdx +8 -59
- package/src/stories/DesignTokens/colors.stories.ts +1862 -1071
- package/src/stories/EcoConception/EcoGuideComponent.vue +10 -4
- package/dist/main-CWniLr0s.js +0 -36919
|
@@ -1,26 +1,53 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
2
3
|
import StatusPage from '../StatusPage/StatusPage.vue'
|
|
3
4
|
import { locales } from './locales'
|
|
4
5
|
import { useThemeLocales } from '@/utils/theme'
|
|
5
6
|
|
|
6
7
|
const { themeLocales } = useThemeLocales(locales)
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
pageTitle?: string
|
|
11
|
+
message?: string
|
|
12
|
+
code?: string
|
|
13
|
+
src?: string
|
|
14
|
+
uniqueId?: string
|
|
15
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
19
|
+
pageTitle: undefined,
|
|
20
|
+
message: undefined,
|
|
21
|
+
code: undefined,
|
|
22
|
+
src: undefined,
|
|
23
|
+
uniqueId: undefined,
|
|
24
|
+
headingLevel: 1,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
// Utiliser les props de l'utilisateur en priorité, sinon les locales du thème
|
|
28
|
+
const pageTitle = computed(() => props.pageTitle || themeLocales.value.pageTitle)
|
|
29
|
+
const message = computed(() => props.message || themeLocales.value.message)
|
|
30
|
+
const code = computed(() => props.code || themeLocales.value.code)
|
|
31
|
+
const src = computed(() => props.src || themeLocales.value.src)
|
|
7
32
|
</script>
|
|
8
33
|
|
|
9
34
|
<template>
|
|
10
35
|
<StatusPage
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
:
|
|
36
|
+
:heading-level="headingLevel"
|
|
37
|
+
:unique-id="props.uniqueId ?? undefined"
|
|
38
|
+
:page-title="pageTitle"
|
|
39
|
+
:message="message"
|
|
40
|
+
:code="code"
|
|
14
41
|
:hide-btn="true"
|
|
15
42
|
>
|
|
16
43
|
<template
|
|
17
|
-
v-if="
|
|
44
|
+
v-if="src || $slots.illustration"
|
|
18
45
|
#illustration
|
|
19
46
|
>
|
|
20
47
|
<slot name="illustration">
|
|
21
48
|
<img
|
|
22
|
-
v-if="
|
|
23
|
-
:src="
|
|
49
|
+
v-if="src"
|
|
50
|
+
:src="src"
|
|
24
51
|
alt=""
|
|
25
52
|
aria-hidden="true"
|
|
26
53
|
>
|
|
@@ -28,7 +28,9 @@ import {
|
|
|
28
28
|
<ul>
|
|
29
29
|
<li><strong>Titre de page</strong> : rendu dans une balise <code>h1</code> via <code>StatusPage</code>, sa valeur provient des locales du thème via <code>useThemeLocales</code></li>
|
|
30
30
|
<li><strong>Code d'erreur</strong> : le code est précédé du texte masqué visuellement <code>codeErrorText</code> (par défaut <em>"Code d'erreur : "</em>) pour les lecteurs d'écran</li>
|
|
31
|
-
<li><strong>Valeurs par défaut</strong> : <code>pageTitle</code>, <code>message</code> et <code>code</code> proviennent des locales du thème via <code>useThemeLocales</code></li>
|
|
31
|
+
<li><strong>Valeurs par défaut</strong> : <code>pageTitle</code>, <code>message</code> <code>src</code> et <code>code</code> proviennent des locales du thème via <code>useThemeLocales</code></li>
|
|
32
|
+
<li><strong>Prop <code>uniqueId</code></strong> : permet de définir un identifiant unique sur le conteneur, facilitant le ciblage par <code>aria-labelledby</code> ou <code>aria-describedby</code> depuis d'autres éléments</li>
|
|
33
|
+
<li><strong>Prop <code>role</code></strong> : aucune prop <code>role</code> n'est exposée sur ce composant — la page de maintenance est une page statique d'information, sa structure sémantique (<code>h1</code>, paragraphe) suffit à en exprimer le rôle sans qu'un attribut ARIA <code>role</code> supplémentaire soit nécessaire ; l'exposer risquerait d'introduire de mauvaises utilisations (ex. <code>role="alert"</code> inapproprié) pouvant nuire à l'expérience des utilisateurs de lecteurs d'écran</li>
|
|
32
34
|
</ul>
|
|
33
35
|
</CriteriaCard>
|
|
34
36
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
|
|
3
3
|
import { describe, it, expect, vi, afterEach } from 'vitest'
|
|
4
|
+
import { ref } from 'vue'
|
|
4
5
|
import { mount } from '@vue/test-utils'
|
|
5
6
|
import { axe } from 'vitest-axe'
|
|
6
7
|
import { assertNoA11yViolations } from '@tests/unit/accessibility/axeUtils'
|
|
@@ -8,14 +9,14 @@ import StatusPage from '../../StatusPage/StatusPage.vue'
|
|
|
8
9
|
|
|
9
10
|
const themeLocales = {
|
|
10
11
|
pageTitle: 'Maintenance en cours',
|
|
11
|
-
message: 'L
|
|
12
|
+
message: 'L\'application n\'est pas disponible pour le moment.',
|
|
12
13
|
code: '503',
|
|
13
14
|
src: '/img/maintenance.svg',
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
vi.mock('@/utils/theme', () => ({
|
|
17
18
|
useThemeLocales: () => ({
|
|
18
|
-
themeLocales,
|
|
19
|
+
themeLocales: ref(themeLocales),
|
|
19
20
|
}),
|
|
20
21
|
}))
|
|
21
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import { mount, shallowMount } from '@vue/test-utils'
|
|
3
3
|
import StatusPage from '../../StatusPage/StatusPage.vue'
|
|
4
4
|
import MaintenancePage from '../MaintenancePage.vue'
|
|
5
5
|
|
|
@@ -26,6 +26,23 @@ describe('MaintenancePage', () => {
|
|
|
26
26
|
expect(statusPage.props('code')).toBeDefined()
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
+
it('uses a generated uniqueId', () => {
|
|
30
|
+
const wrapper = mount(MaintenancePage)
|
|
31
|
+
|
|
32
|
+
expect(wrapper.find('.vd-page-container').attributes('id')).toMatch(/^[-a-z0-9]+-container$/)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('passes a custom uniqueId prop to StatusPage', () => {
|
|
36
|
+
const wrapper = shallowMount(MaintenancePage, {
|
|
37
|
+
props: {
|
|
38
|
+
uniqueId: 'custom-id',
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
const statusPage = wrapper.findComponent(StatusPage)
|
|
42
|
+
|
|
43
|
+
expect(statusPage.props('uniqueId')).toBe('custom-id')
|
|
44
|
+
})
|
|
45
|
+
|
|
29
46
|
it('renders default illustration when no slot is provided', () => {
|
|
30
47
|
const wrapper = shallowMount(MaintenancePage)
|
|
31
48
|
|
|
@@ -5,6 +5,7 @@ exports[`MaintenancePage > renders correctly 1`] = `
|
|
|
5
5
|
btnlink="/"
|
|
6
6
|
code=""
|
|
7
7
|
codeerrortext="Code d'erreur : "
|
|
8
|
+
headinglevel="1"
|
|
8
9
|
hidebtn="true"
|
|
9
10
|
message="L’application n’est pas disponible pour le moment, veuillez nous excuser pour la gêne occasionnée."
|
|
10
11
|
pagetitle="Maintenance en cours"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Controls, Canvas, Meta, Source } from '@storybook/blocks';
|
|
2
|
+
import * as MonthPicker from './MonthPicker.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={MonthPicker} />
|
|
5
|
+
|
|
6
|
+
<div className="header">
|
|
7
|
+
<h1>MonthPicker</h1>
|
|
8
|
+
<p>L’élément `MonthPicker` est utilisé pour sélectionner un mois et une année. Il est composé d'un champ de saisie et d'un sélecteur visuel.</p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<Canvas
|
|
12
|
+
of={MonthPicker.Default}
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
# API
|
|
16
|
+
|
|
17
|
+
<Controls of={MonthPicker.Default} />
|
|
18
|
+
|
|
19
|
+
# Exemple d'utilisation
|
|
20
|
+
|
|
21
|
+
<Source dark code={`
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import { MonthPicker } from '@cnamts/synapse'
|
|
24
|
+
import { ref } from 'vue'
|
|
25
|
+
|
|
26
|
+
const selectedMonth = ref<string | undefined>(undefined) // format: MM/YYYY
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<MonthPicker
|
|
31
|
+
label="Début du projet"
|
|
32
|
+
v-model="selectedMonth"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
`} />
|
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
import { fn } from '@storybook/test'
|
|
2
|
+
import { nextTick, ref } from 'vue'
|
|
3
|
+
import MonthPicker from './MonthPicker.vue'
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
5
|
+
import type SyTextField from '../Customs/SyTextField/SyTextField.vue'
|
|
6
|
+
import SyForm from '../Customs/SyForm/SyForm.vue'
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof MonthPicker> = {
|
|
9
|
+
title: 'Composants/Formulaires/MonthPicker',
|
|
10
|
+
component: MonthPicker,
|
|
11
|
+
argTypes: {
|
|
12
|
+
'modelValue': {
|
|
13
|
+
control: 'text',
|
|
14
|
+
description: 'Valeur du sélecteur de mois au format "MM/YYYY".',
|
|
15
|
+
table: {
|
|
16
|
+
type: { summary: 'string' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
'locales': {
|
|
20
|
+
description: 'Objet de traduction pour le sélecteur de mois. Par défaut, les traductions françaises sont utilisées.',
|
|
21
|
+
table: {
|
|
22
|
+
type: { summary: 'object' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
'minYear': {
|
|
26
|
+
description: 'Année minimale affichée dans le sélecteur visuel. Ne concerne pas la validation.',
|
|
27
|
+
table: {
|
|
28
|
+
type: { summary: 'number' },
|
|
29
|
+
defaultValue: { summary: '1900' },
|
|
30
|
+
category: 'props',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
'maxYear': {
|
|
34
|
+
description: 'Année maximale affichée dans le sélecteur visuel. Ne concerne pas la validation.',
|
|
35
|
+
table: {
|
|
36
|
+
type: { summary: 'number' },
|
|
37
|
+
defaultValue: { summary: '2100' },
|
|
38
|
+
category: 'props',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
'yearsOrder': {
|
|
42
|
+
description: 'Ordre d’affichage des années dans le sélecteur visuel. Peut être "asc" pour un ordre croissant ou "desc" pour un ordre décroissant.',
|
|
43
|
+
control: 'select',
|
|
44
|
+
options: ['asc', 'desc'],
|
|
45
|
+
table: {
|
|
46
|
+
type: { summary: '"asc" | "desc"' },
|
|
47
|
+
defaultValue: { summary: '"asc"' },
|
|
48
|
+
category: 'props',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
'initialView': {
|
|
52
|
+
description: 'Vue initiale affichée lorsque la modale de sélection de mois est ouverte.',
|
|
53
|
+
control: 'select',
|
|
54
|
+
options: ['months', 'years'],
|
|
55
|
+
table: {
|
|
56
|
+
type: { summary: '"months" | "years"' },
|
|
57
|
+
defaultValue: { summary: '"months"' },
|
|
58
|
+
category: 'props',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
'placeholder': {
|
|
62
|
+
description: 'Texte affiché dans le champ de saisie lorsque aucune valeur n’est sélectionnée.',
|
|
63
|
+
control: 'text',
|
|
64
|
+
table: {
|
|
65
|
+
type: { summary: 'string' },
|
|
66
|
+
category: 'props',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
'label': {
|
|
70
|
+
description: 'Label du champ de saisie du sélecteur de mois.',
|
|
71
|
+
control: 'text',
|
|
72
|
+
table: {
|
|
73
|
+
type: { summary: 'string' },
|
|
74
|
+
category: 'props',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
'density': {
|
|
78
|
+
description: 'Densité d’affichage du champ de saisie. Peut être "default", "comfortable" ou "compact".',
|
|
79
|
+
control: 'select',
|
|
80
|
+
options: ['default', 'comfortable', 'compact'],
|
|
81
|
+
table: {
|
|
82
|
+
type: { summary: '"default" | "comfortable" | "compact"' },
|
|
83
|
+
defaultValue: { summary: '"default"' },
|
|
84
|
+
category: 'props',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
'hint': {
|
|
88
|
+
description: 'Texte d’aide affiché sous le champ de saisie.',
|
|
89
|
+
control: 'text',
|
|
90
|
+
table: {
|
|
91
|
+
type: { summary: 'string' },
|
|
92
|
+
category: 'props',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
'customRules': {
|
|
96
|
+
description: 'Règles de validation personnalisées pour les erreurs.',
|
|
97
|
+
table: {
|
|
98
|
+
type: { summary: 'ValidationRule[]' },
|
|
99
|
+
category: 'props',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
'customWarningRules': {
|
|
103
|
+
description: 'Règles de validation personnalisées pour les avertissements.',
|
|
104
|
+
table: {
|
|
105
|
+
type: { summary: 'ValidationRule[]' },
|
|
106
|
+
category: 'props',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
'customSuccessRules': {
|
|
110
|
+
description: 'Règles de validation personnalisées pour les succès.',
|
|
111
|
+
table: {
|
|
112
|
+
type: { summary: 'ValidationRule[]' },
|
|
113
|
+
category: 'props',
|
|
114
|
+
},
|
|
115
|
+
category: 'validation',
|
|
116
|
+
},
|
|
117
|
+
'errorMessages': {
|
|
118
|
+
description: 'Messages d’erreur personnalisés à afficher lorsque la validation échoue. Peut être une chaîne de caractères ou un tableau de chaînes.',
|
|
119
|
+
control: 'text',
|
|
120
|
+
table: {
|
|
121
|
+
type: { summary: 'string | string[]' },
|
|
122
|
+
category: 'props',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
'warningMessages': {
|
|
126
|
+
description: 'Messages d’avertissement personnalisés à afficher lorsque la validation génère un avertissement. Peut être une chaîne de caractères ou un tableau de chaînes.',
|
|
127
|
+
control: 'text',
|
|
128
|
+
table: {
|
|
129
|
+
type: { summary: 'string | string[]' },
|
|
130
|
+
category: 'props',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
'successMessages': {
|
|
134
|
+
description: 'Messages de succès personnalisés à afficher lorsque la validation réussit. Peut être une chaîne de caractères ou un tableau de chaînes.',
|
|
135
|
+
control: 'text',
|
|
136
|
+
table: {
|
|
137
|
+
type: { summary: 'string | string[]' },
|
|
138
|
+
category: 'props',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
'hasError': {
|
|
142
|
+
description: 'Indique si le champ est en état d’erreur. Utilisé pour forcer l’affichage des messages d’erreur.',
|
|
143
|
+
control: 'boolean',
|
|
144
|
+
table: {
|
|
145
|
+
type: { summary: 'boolean' },
|
|
146
|
+
category: 'props',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
'hasWarning': {
|
|
150
|
+
description: 'Indique si le champ est en état d’avertissement. Utilisé pour forcer l’affichage des messages d’avertissement.',
|
|
151
|
+
control: 'boolean',
|
|
152
|
+
table: {
|
|
153
|
+
type: { summary: 'boolean' },
|
|
154
|
+
category: 'props',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
'hasSuccess': {
|
|
158
|
+
description: 'Indique si le champ est en état de succès. Utilisé pour forcer l’affichage des messages de succès.',
|
|
159
|
+
control: 'boolean',
|
|
160
|
+
table: {
|
|
161
|
+
type: { summary: 'boolean' },
|
|
162
|
+
category: 'props',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
'showSuccessMessages': {
|
|
166
|
+
description: 'Indique si les messages de succès doivent être affichés.',
|
|
167
|
+
control: 'boolean',
|
|
168
|
+
table: {
|
|
169
|
+
type: { summary: 'boolean' },
|
|
170
|
+
category: 'props',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
'disabled': {
|
|
174
|
+
description: 'Indique si le champ de saisie est désactivé. Lorsqu’il est désactivé, le sélecteur de mois ne peut pas être ouvert et aucune interaction n’est possible.',
|
|
175
|
+
control: 'boolean',
|
|
176
|
+
table: {
|
|
177
|
+
type: { summary: 'boolean' },
|
|
178
|
+
defaultValue: { summary: 'false' },
|
|
179
|
+
category: 'props',
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
'readonly': {
|
|
183
|
+
description: 'Indique si le champ de saisie est en lecture seule. Lorsqu’il est en lecture seule, le sélecteur de mois peut être ouvert pour afficher la valeur sélectionnée, mais aucune modification n’est possible.',
|
|
184
|
+
control: 'boolean',
|
|
185
|
+
table: {
|
|
186
|
+
type: { summary: 'boolean' },
|
|
187
|
+
defaultValue: { summary: 'false' },
|
|
188
|
+
category: 'props',
|
|
189
|
+
},
|
|
190
|
+
category: 'props',
|
|
191
|
+
},
|
|
192
|
+
'onUpdate:modelValue': {
|
|
193
|
+
action: 'update:modelValue',
|
|
194
|
+
description: 'Événement émis lorsque le champs de saisie change (quelque soit la valeur renseigné même incomplète ou invalide) ou lorsque un mois ET une année sont sélectionnés dans la modale. La valeur est toujours au format "MM/YYYY".',
|
|
195
|
+
table: {
|
|
196
|
+
type: { summary: 'string' },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
'onUpdate:open': {
|
|
200
|
+
action: 'update:open',
|
|
201
|
+
description: 'Événement émis lorsque le sélecteur de mois est ouvert ou fermé. Si seulement une année ou un mois est sélectionné, le contenu de ma modale est réinitialisé et aucun événement "update:modelValue" n’est émis.',
|
|
202
|
+
table: {
|
|
203
|
+
type: { summary: 'boolean' },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
parameters: {
|
|
208
|
+
controls: {
|
|
209
|
+
exclude: ['width', 'undefined', 'onUpdate:modelValue', 'onUpdate:open'],
|
|
210
|
+
},
|
|
211
|
+
docs: {
|
|
212
|
+
controls: {
|
|
213
|
+
exclude: ['onUpdate:modelValue', 'onUpdate:open'],
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export default meta
|
|
220
|
+
type Story = StoryObj<typeof MonthPicker & typeof SyTextField>
|
|
221
|
+
|
|
222
|
+
export const Default: Story = {
|
|
223
|
+
args: {
|
|
224
|
+
'modelValue': '11/2025',
|
|
225
|
+
'label': 'Début du projet',
|
|
226
|
+
'onUpdate:modelValue': fn(),
|
|
227
|
+
'onUpdate:open': fn(),
|
|
228
|
+
'width': '400px',
|
|
229
|
+
'customRules': [{
|
|
230
|
+
type: 'custom',
|
|
231
|
+
options: {
|
|
232
|
+
validate: (value: string) => /^(0[1-9]|1[0-2])\/\d{4}$/.test(value),
|
|
233
|
+
message: 'Le format doit être MM/YYYY. (ex: 12/2026).',
|
|
234
|
+
},
|
|
235
|
+
}],
|
|
236
|
+
},
|
|
237
|
+
parameters: {
|
|
238
|
+
sourceCode: [
|
|
239
|
+
{
|
|
240
|
+
name: 'Template',
|
|
241
|
+
code: `
|
|
242
|
+
<template>
|
|
243
|
+
<MonthPicker
|
|
244
|
+
v-model="selectedMonth"
|
|
245
|
+
label="Début du projet"
|
|
246
|
+
width="400px"
|
|
247
|
+
:custom-rules="rules"
|
|
248
|
+
/>
|
|
249
|
+
</template>
|
|
250
|
+
`,
|
|
251
|
+
}, {
|
|
252
|
+
name: 'Script',
|
|
253
|
+
code: `
|
|
254
|
+
<script setup lang="ts">
|
|
255
|
+
import { MonthPicker } from '@cnamts/synapse'
|
|
256
|
+
import { ref } from 'vue'
|
|
257
|
+
|
|
258
|
+
const selectedMonth = ref('11/2025')
|
|
259
|
+
|
|
260
|
+
const rules = [{
|
|
261
|
+
type: 'custom',
|
|
262
|
+
options: {
|
|
263
|
+
validate: (value: string) => /^(0[1-9]|1[0-2])\\/\\d{4}$/.test(value),
|
|
264
|
+
message: 'Le format doit être MM/YYYY (ex: 12/2026).',
|
|
265
|
+
},
|
|
266
|
+
}]
|
|
267
|
+
</script>
|
|
268
|
+
`,
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export const MonthValidation: Story = {
|
|
275
|
+
args: {
|
|
276
|
+
'modelValue': '11/2025',
|
|
277
|
+
'label': 'Début du projet',
|
|
278
|
+
'onUpdate:modelValue': fn(),
|
|
279
|
+
'onUpdate:open': fn(),
|
|
280
|
+
},
|
|
281
|
+
play: async ({ canvasElement }) => {
|
|
282
|
+
const input = canvasElement.querySelector('input') as HTMLInputElement
|
|
283
|
+
const currentDate = new Date()
|
|
284
|
+
|
|
285
|
+
setTimeout(async () => {
|
|
286
|
+
input.focus()
|
|
287
|
+
const futureYear = currentDate.getFullYear() + 6
|
|
288
|
+
input.value = `11/${futureYear}`
|
|
289
|
+
input.dispatchEvent(new Event('input'))
|
|
290
|
+
await nextTick()
|
|
291
|
+
input.dispatchEvent(new Event('blur'))
|
|
292
|
+
}, 100)
|
|
293
|
+
},
|
|
294
|
+
parameters: {
|
|
295
|
+
sourceCode: [
|
|
296
|
+
{
|
|
297
|
+
name: 'Template',
|
|
298
|
+
code: `
|
|
299
|
+
<template>
|
|
300
|
+
<MonthPicker
|
|
301
|
+
v-model="selectedMonth"
|
|
302
|
+
label="Début du projet"
|
|
303
|
+
:custom-rules
|
|
304
|
+
:custom-warning-rules
|
|
305
|
+
/>
|
|
306
|
+
</template>
|
|
307
|
+
`,
|
|
308
|
+
}, {
|
|
309
|
+
name: 'Script',
|
|
310
|
+
code: `
|
|
311
|
+
<script setup lang="ts">
|
|
312
|
+
import { MonthPicker } from '@cnamts/synapse'
|
|
313
|
+
import { ref } from 'vue'
|
|
314
|
+
|
|
315
|
+
const selectedMonth = ref('11/2025')
|
|
316
|
+
|
|
317
|
+
const customRules = [
|
|
318
|
+
{
|
|
319
|
+
type: 'required',
|
|
320
|
+
options: {
|
|
321
|
+
message: 'Ce champ est requis.',
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
type: 'custom',
|
|
326
|
+
options: {
|
|
327
|
+
validate: (value: string) => {
|
|
328
|
+
const [month] = value.split('/').map(Number)
|
|
329
|
+
if (
|
|
330
|
+
!value ||
|
|
331
|
+
!month ||
|
|
332
|
+
!/^\\d{2}\\/\\d{4}$/.test(value) ||
|
|
333
|
+
month < 1 ||
|
|
334
|
+
month > 12
|
|
335
|
+
) {
|
|
336
|
+
return false
|
|
337
|
+
}
|
|
338
|
+
return true
|
|
339
|
+
},
|
|
340
|
+
message: 'Format de mois invalide.',
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
]
|
|
344
|
+
|
|
345
|
+
const customWarningRules = [{
|
|
346
|
+
type: 'custom',
|
|
347
|
+
options: {
|
|
348
|
+
validate: (value: string) => {
|
|
349
|
+
const [month, year] = value.split('/').map(Number) as [number, number]
|
|
350
|
+
const currentDate = new Date()
|
|
351
|
+
const currentYear = currentDate.getFullYear()
|
|
352
|
+
const currentMonth = currentDate.getMonth() + 1
|
|
353
|
+
if (year > currentYear + 5 || (year === currentYear + 5 && month > currentMonth)) {
|
|
354
|
+
return false
|
|
355
|
+
}
|
|
356
|
+
return true
|
|
357
|
+
},
|
|
358
|
+
warningMessage: 'La date est plus de 5 ans dans le futur.',
|
|
359
|
+
},
|
|
360
|
+
}]
|
|
361
|
+
</script>
|
|
362
|
+
`,
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
render: args => ({
|
|
367
|
+
components: { MonthPicker },
|
|
368
|
+
setup() {
|
|
369
|
+
const customRules = [
|
|
370
|
+
{
|
|
371
|
+
type: 'required',
|
|
372
|
+
options: {
|
|
373
|
+
message: 'Ce champ est requis.',
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
type: 'custom',
|
|
378
|
+
options: {
|
|
379
|
+
validate: (value: string) => {
|
|
380
|
+
const [month] = value.split('/').map(Number)
|
|
381
|
+
if (
|
|
382
|
+
!month
|
|
383
|
+
|| !/^\d{2}\/\d{4}$/.test(value)
|
|
384
|
+
|| month < 1
|
|
385
|
+
|| month > 12
|
|
386
|
+
) {
|
|
387
|
+
return false
|
|
388
|
+
}
|
|
389
|
+
return true
|
|
390
|
+
},
|
|
391
|
+
message: 'Format de mois invalide.',
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
]
|
|
395
|
+
|
|
396
|
+
const customWarningRules = [{
|
|
397
|
+
type: 'custom',
|
|
398
|
+
options: {
|
|
399
|
+
validate: (value: string) => {
|
|
400
|
+
const [month, year] = value.split('/').map(Number) as [number, number]
|
|
401
|
+
const currentDate = new Date()
|
|
402
|
+
const currentYear = currentDate.getFullYear()
|
|
403
|
+
const currentMonth = currentDate.getMonth() + 1
|
|
404
|
+
if (year > currentYear + 5 || (year === currentYear + 5 && month > currentMonth)) {
|
|
405
|
+
return false
|
|
406
|
+
}
|
|
407
|
+
return true
|
|
408
|
+
},
|
|
409
|
+
warningMessage: 'La date est plus de 5 ans dans le futur.',
|
|
410
|
+
},
|
|
411
|
+
}]
|
|
412
|
+
return { args, customRules, customWarningRules }
|
|
413
|
+
},
|
|
414
|
+
template: `
|
|
415
|
+
<MonthPicker
|
|
416
|
+
v-bind="args"
|
|
417
|
+
:custom-rules="customRules"
|
|
418
|
+
:custom-warning-rules="customWarningRules"
|
|
419
|
+
width="400px"
|
|
420
|
+
/>
|
|
421
|
+
`,
|
|
422
|
+
}),
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export const CustomDisplayedYears: Story = {
|
|
426
|
+
args: {
|
|
427
|
+
'modelValue': '11/2025',
|
|
428
|
+
'label': 'Début du projet',
|
|
429
|
+
'minYear': 2000,
|
|
430
|
+
'maxYear': 2025,
|
|
431
|
+
'width': '400px',
|
|
432
|
+
'onUpdate:modelValue': fn(),
|
|
433
|
+
'onUpdate:open': fn(),
|
|
434
|
+
},
|
|
435
|
+
parameters: {
|
|
436
|
+
sourceCode: [
|
|
437
|
+
{
|
|
438
|
+
name: 'Template',
|
|
439
|
+
code: `
|
|
440
|
+
<template>
|
|
441
|
+
<MonthPicker
|
|
442
|
+
v-model="selectedMonth"
|
|
443
|
+
label="Début du projet"
|
|
444
|
+
:min-year="2000"
|
|
445
|
+
:max-year="2025"
|
|
446
|
+
/>
|
|
447
|
+
</template>
|
|
448
|
+
`,
|
|
449
|
+
}, {
|
|
450
|
+
name: 'Script',
|
|
451
|
+
code: `
|
|
452
|
+
<script setup lang="ts">
|
|
453
|
+
import { MonthPicker } from '@cnamts/synapse'
|
|
454
|
+
import { ref } from 'vue'
|
|
455
|
+
|
|
456
|
+
const selectedMonth = ref('11/2025')
|
|
457
|
+
</script>
|
|
458
|
+
`,
|
|
459
|
+
},
|
|
460
|
+
],
|
|
461
|
+
},
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export const Form: Story = {
|
|
465
|
+
args: {
|
|
466
|
+
modelValue: '',
|
|
467
|
+
label: 'Début du projet',
|
|
468
|
+
width: '400px',
|
|
469
|
+
},
|
|
470
|
+
parameters: {
|
|
471
|
+
sourceCode: [
|
|
472
|
+
{
|
|
473
|
+
name: 'Template',
|
|
474
|
+
code: `
|
|
475
|
+
<template>
|
|
476
|
+
<SyForm @submit="handleSubmit">
|
|
477
|
+
<MonthPicker
|
|
478
|
+
v-model="selectedMonth"
|
|
479
|
+
label="Début du projet"
|
|
480
|
+
width="400px"
|
|
481
|
+
:custom-rules="[{ type: 'required', options: { message: 'Ce champ est requis.' } }]"
|
|
482
|
+
/>
|
|
483
|
+
<VBtn type="submit" color="primary" class="mt-4">Soumettre</VBtn>
|
|
484
|
+
</SyForm>
|
|
485
|
+
</template>
|
|
486
|
+
`,
|
|
487
|
+
}, {
|
|
488
|
+
name: 'Script',
|
|
489
|
+
code: `
|
|
490
|
+
<script setup lang="ts">
|
|
491
|
+
import { MonthPicker, SyForm } from '@cnamts/synapse'
|
|
492
|
+
import { ref } from 'vue'
|
|
493
|
+
|
|
494
|
+
const selectedMonth = ref('')
|
|
495
|
+
|
|
496
|
+
const handleSubmit = (e: { isValid: boolean }) => {
|
|
497
|
+
alert(e.isValid ? 'Le formulaire est valide.' : 'Le formulaire est invalide.')
|
|
498
|
+
}
|
|
499
|
+
</script>
|
|
500
|
+
`,
|
|
501
|
+
},
|
|
502
|
+
],
|
|
503
|
+
},
|
|
504
|
+
render: args => ({
|
|
505
|
+
components: { MonthPicker, SyForm },
|
|
506
|
+
setup() {
|
|
507
|
+
const selectedMonth = ref('')
|
|
508
|
+
|
|
509
|
+
const handleSubmit = (e: { isValid: boolean }) => {
|
|
510
|
+
alert(e.isValid ? 'Le formulaire est valide.' : 'Le formulaire est invalide.')
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
return { args, selectedMonth, handleSubmit }
|
|
514
|
+
},
|
|
515
|
+
template: `
|
|
516
|
+
<SyForm @submit="handleSubmit">
|
|
517
|
+
<MonthPicker
|
|
518
|
+
v-bind="args"
|
|
519
|
+
v-model="selectedMonth"
|
|
520
|
+
width="400px"
|
|
521
|
+
:custom-rules="[{ type: 'required', options: { message: 'Ce champ est requis.' } }]"
|
|
522
|
+
/>
|
|
523
|
+
<VBtn type="submit" color="primary" class="mt-4">Soumettre</VBtn>
|
|
524
|
+
</SyForm>
|
|
525
|
+
`,
|
|
526
|
+
}),
|
|
527
|
+
}
|