@cnamts/synapse 1.0.24 → 1.0.26
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 +27 -5
- package/dist/{AutocompleteFilter-BWLR3U7W.js → AutocompleteFilter-BPR-a55G.js} +1 -1
- package/dist/{DateFilter-BpwFexzi.js → DateFilter-CknrJWs2.js} +2 -2
- package/dist/{NumberFilter-Bz_NTdX9.js → NumberFilter-DJ-yNlzv.js} +1 -1
- package/dist/{PeriodFilter-DX_wy9g-.js → PeriodFilter-CiB5Oa9Z.js} +1 -1
- package/dist/{SelectFilter-xqiPtPgX.js → SelectFilter-EiafX97M.js} +2 -2
- package/dist/{TextFilter-BBl3JFqK.js → TextFilter-BzOmpdxj.js} +1 -1
- package/dist/{apLightTheme-D1P4jcD0.js → apLightTheme-DS0Uy44H.js} +446 -723
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +14 -8
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +60 -289
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +1 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +4 -0
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +1 -0
- package/dist/components/Customs/SyTabs/SyTabs.d.ts +13 -11
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +0 -2
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +54 -73
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +31 -40
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +9 -14
- package/dist/components/DatePicker/composables/useDatePickerState.d.ts +4 -3
- package/dist/components/DatePicker/composables/useDateTextField.d.ts +2 -2
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +2 -2
- package/dist/components/DatePicker/types.d.ts +1 -2
- package/dist/components/FileList/FileList.d.ts +6 -0
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +2 -0
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +13 -13
- package/dist/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +3 -3
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +1 -0
- package/dist/components/MonthPicker/MonthPicker.d.ts +2 -7
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +2 -7
- package/dist/components/NirField/NirField.d.ts +12 -20
- package/dist/components/NirField/useNirValidation.d.ts +6 -2
- package/dist/components/PeriodField/PeriodField.d.ts +110 -150
- package/dist/components/PhoneField/PhoneField.d.ts +12 -7
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +0 -3
- package/dist/components/RatingPicker/EmotionPicker/EmotionPicker.d.ts +3 -1
- package/dist/components/RatingPicker/NumberPicker/NumberPicker.d.ts +4 -3
- package/dist/components/RatingPicker/RatingPicker.d.ts +18 -5
- package/dist/components/RatingPicker/StarsPicker/StarsPicker.d.ts +3 -1
- package/dist/components/RatingPicker/tests/RatingPicker.a11y.spect.d.ts +1 -0
- package/dist/components/RatingPicker/useRatingFocus.d.ts +18 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -4
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -4
- package/dist/components/Tables/common/SyTablePagination.d.ts +154 -364
- package/dist/components/Tables/common/TableHeader.d.ts +6 -1
- package/dist/components/Tables/common/filters/DateFilter.d.ts +4 -4
- package/dist/components/Tables/common/locales.d.ts +3 -0
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +1 -0
- package/dist/composables/date/useDateInitializationDayjs.d.ts +3 -1
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +230 -0
- package/dist/composables/unifyValidation/useCustomValidation.d.ts +3 -1
- package/dist/composables/unifyValidation/useValidation.d.ts +12 -6
- package/dist/composables/unifyValidation/useVuetifyValidation.d.ts +1 -1
- package/dist/composables/validation/useValidation.d.ts +6 -1
- package/dist/design-system-v3.js +2 -2
- package/dist/designTokens/tokens/amelipro/apColors.d.ts +10 -10
- package/dist/designTokens/tokens/amelipro/apColors2026.d.ts +1 -2
- package/dist/designTokens/tokens/amelipro/apContextual.d.ts +44 -0
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +2 -0
- package/dist/designTokens/tokens/amelipro/apSemantic.d.ts +1 -1
- package/dist/designTokens/tokens/baseColors.d.ts +127 -0
- package/dist/designTokens/tokens/baseContextualTokens.d.ts +50 -0
- package/dist/designTokens/tokens/cnam/cnamColors.d.ts +10 -10
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +2 -0
- package/dist/designTokens/tokens/cnam/cnamSemantic.d.ts +1 -1
- package/dist/designTokens/tokens/pa/paColors.d.ts +1 -166
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +1 -1
- package/dist/designTokens/utils/buildColorClassMap.d.ts +12 -0
- package/dist/designTokens/utils/createFlattenTheme.d.ts +1 -3
- package/dist/designTokens/utils/index.d.ts +2 -2
- package/dist/{main-BtTqyn4z.js → main-BsJ9ec3i.js} +16021 -15715
- package/dist/synapse.css +1 -1
- package/dist/utils/functions/classToHex.d.ts +1 -1
- package/dist/utils/functions/createHexResolver.d.ts +16 -0
- package/dist/vuetifyConfig.js +113 -152
- package/package.json +35 -23
- package/src/assets/amelipro/apTokens2026.scss +5 -5
- package/src/assets/overrides/_breakpoints.scss +25 -0
- package/src/assets/overrides/_btns.scss +0 -2
- package/src/assets/overrides/_forms.scss +1 -3
- package/src/assets/overrides/_icons.scss +5 -22
- package/src/assets/overrides/_otp.scss +40 -0
- package/src/assets/overrides/_tables.scss +11 -20
- package/src/assets/overrides/_tooltips.scss +17 -7
- package/src/assets/overrides/_typography.scss +35 -37
- package/src/assets/overrides/_utilities.scss +43 -47
- package/src/assets/themes.scss +1 -0
- package/src/components/Accordion/Accordion.vue +2 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.vue +20 -20
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.vue +12 -14
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +4 -6
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.vue +5 -5
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +4 -6
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.vue +4 -6
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.vue +4 -6
- package/src/components/Amelipro/AmeliproBreadcrumb/AmeliproBreadcrumb.vue +1 -3
- package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.vue +4 -6
- package/src/components/Amelipro/AmeliproCallback/AmeliproCallback.vue +2 -2
- package/src/components/Amelipro/AmeliproCard/AmeliproCard.vue +31 -31
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.vue +5 -7
- package/src/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.vue +13 -15
- package/src/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.vue +23 -23
- package/src/components/Amelipro/AmeliproChips/AmeliproChips.vue +1 -3
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.vue +17 -12
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.vue +4 -6
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +13 -13
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproDentalChart.vue +4 -2
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproTooth/AmeliproTooth.vue +4 -4
- package/src/components/Amelipro/AmeliproDialog/AmeliproDialog.vue +5 -7
- package/src/components/Amelipro/AmeliproDisclosure/AmeliproDisclosure.vue +1 -3
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.vue +2 -4
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +4 -6
- package/src/components/Amelipro/AmeliproFilters/AmeliproFilters.vue +13 -13
- package/src/components/Amelipro/AmeliproFirstLogin/AmeliproFirstLogin.vue +3 -5
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.vue +1 -3
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +2 -4
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.vue +1 -3
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.vue +20 -16
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.vue +2 -4
- package/src/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.vue +5 -7
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.vue +6 -8
- package/src/components/Amelipro/AmeliproMailTile/AmeliproMailTile.vue +14 -14
- package/src/components/Amelipro/AmeliproMenu/AmeliproMenu.vue +11 -13
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenu.vue +2 -4
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingLayout.vue +8 -8
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.vue +40 -40
- package/src/components/Amelipro/AmeliproNumberedCard/AmeliproNumberedCard.vue +27 -27
- package/src/components/Amelipro/AmeliproOnboarding/AmeliproOnboarding.vue +3 -5
- package/src/components/Amelipro/AmeliproPageLayout/AmeliproPageLayout.vue +2 -4
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.vue +2 -4
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/AmeliproPaginationBtn.vue +3 -5
- package/src/components/Amelipro/AmeliproPatientBanner/AmeliproPatientBanner.vue +1 -3
- package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.vue +2 -4
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLogin.vue +4 -4
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLoginForm/AmeliproPatientLoginForm.vue +1 -3
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.vue +3 -5
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.vue +3 -5
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.vue +23 -23
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +4 -6
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +12 -22
- package/src/components/Amelipro/AmeliproStateTile/AmeliproStateTile.vue +10 -12
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepper.vue +17 -17
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +8 -10
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/AmeliproTabBtn.vue +6 -8
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +4 -4
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.vue +4 -6
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +7 -9
- package/src/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.vue +3 -5
- package/src/components/Amelipro/AmeliproTooltips/AmeliproTooltips.vue +0 -2
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.vue +6 -6
- package/src/components/Amelipro/ServiceMenu/ServiceMenu.vue +2 -2
- package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +4 -4
- package/src/components/Amelipro/StructureMenu/StructureItem/StructureItem.vue +4 -6
- package/src/components/Amelipro/StructureMenu/StructureMenu.vue +2 -2
- package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +2 -2
- package/src/components/Amelipro/UserMenu/UserMenu.vue +1 -3
- package/src/components/BackBtn/tests/BackBtn.visual.cy.ts +43 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-custom-bg.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-dark-mode.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-default.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-no-icon.snap.png +0 -0
- package/src/components/Captcha/Captcha.vue +1 -3
- package/src/components/ChipList/ChipList.vue +14 -16
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -3
- package/src/components/CookiesSelection/CookiesSelection.vue +2 -1
- package/src/components/CopyBtn/CopyBtn.vue +10 -3
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +17 -17
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +31 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +66 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +8 -4
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +18 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +66 -0
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.vue +4 -6
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +414 -135
- package/src/components/Customs/Selects/SySelect/SySelect.vue +502 -257
- package/src/components/Customs/Selects/SySelect/accessibilite/Accessibility.mdx +199 -269
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +278 -4
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +3 -3
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +5 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +52 -2
- package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +18 -3
- package/src/components/Customs/SyPagination/SyPagination.vue +0 -2
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +23 -5
- package/src/components/Customs/SyTabs/SyTabs.mdx +0 -58
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +34 -35
- package/src/components/Customs/SyTabs/SyTabs.vue +87 -67
- package/src/components/Customs/SyTabs/accessibilite/Accessibility.mdx +83 -23
- package/src/components/Customs/SyTabs/config.ts +3 -3
- package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +88 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +46 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +21 -41
- package/src/components/Customs/SyTextField/SyTextField.vue +34 -9
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +29 -28
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +28 -23
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +24 -1
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +65 -33
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +1 -1
- package/src/components/DatePicker/composables/tests/useDatePickerState.spec.ts +53 -0
- package/src/components/DatePicker/composables/useDatePickerState.ts +56 -13
- package/src/components/DatePicker/composables/useDateRangeInput.ts +2 -1
- package/src/components/DatePicker/composables/useDateSelection.ts +2 -1
- package/src/components/DatePicker/composables/useDateTextField.ts +2 -3
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +2 -2
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +9 -8
- package/src/components/DatePicker/playground/DatePickerHolidayRule.vue +1 -1
- package/src/components/DatePicker/types.ts +1 -2
- package/src/components/DialogBox/DialogBox.stories.ts +8 -8
- package/src/components/DialogBox/DialogBox.vue +3 -5
- package/src/components/DialogBox/accessibilite/Accessibility.mdx +86 -22
- package/src/components/DialogBox/tests/DialogBox.visual.cy.ts +76 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-custom-texts.snap.png +0 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-default.snap.png +0 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-no-actions.snap.png +0 -0
- package/src/components/FileList/FileList.vue +9 -2
- package/src/components/FileList/UploadItem/UploadItem.vue +11 -13
- package/src/components/FileList/tests/FileList.spec.ts +47 -0
- package/src/components/FileUpload/FileUpload.vue +3 -5
- package/src/components/FileUpload/FileUploadContent.vue +3 -5
- package/src/components/FilterInline/FilterInline.vue +1 -3
- package/src/components/FilterSideBar/FilterSideBar.mdx +44 -1
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +105 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +9 -1
- package/src/components/FilterSideBar/tests/FilterSideBar.a11y.spec.ts +54 -1
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +42 -0
- package/src/components/FooterBar/FooterBar.vue +9 -13
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +1 -1
- package/src/components/HeaderBar/HeaderBar.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +0 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +8 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +0 -8
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.visual.cy.ts +196 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/header-burger-menu-generated-submenu-open.snap.png +0 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/header-burger-menu-generated.snap.png +0 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +0 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +6 -7
- package/src/components/HeaderBar/tests/HeaderBar.visual.cy.ts +81 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-custom-width.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-default.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-no-sticky.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-prepend.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-side.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-subtitle.snap.png +0 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +12 -3
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +15 -8
- package/src/components/HeaderToolbar/HeaderToolbar.vue +6 -7
- package/src/components/LangBtn/LangBtn.vue +4 -5
- package/src/components/Logo/tests/Logo.visual.cy.ts +57 -0
- package/src/components/Logo/tests/__snapshots__/logo-avatar.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-dark.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-default.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-no-organism.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-no-signature.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-risque-pro.snap.png +0 -0
- package/src/components/LogoBrandSection/LogoBrandSection.vue +2 -2
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +1 -1
- package/src/components/NirField/NirField.stories.ts +2 -2
- package/src/components/NirField/NirField.vue +3 -5
- package/src/components/NirField/accessibilite/Accessibility.mdx +100 -5
- package/src/components/NirField/tests/NirField.spec.ts +118 -0
- package/src/components/NirField/tests/useNirValidation.spec.ts +449 -0
- package/src/components/NirField/useNirValidation.ts +38 -32
- package/src/components/NotificationBar/Notification/Notification.vue +7 -9
- package/src/components/NotificationBar/NotificationBar.vue +1 -3
- package/src/components/PaginatedTable/PaginatedTable.vue +3 -4
- package/src/components/PaginatedTable/Pagination.vue +4 -6
- package/src/components/PasswordField/PasswordField.vue +15 -13
- package/src/components/PhoneField/PhoneField.vue +7 -5
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +11 -20
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +1 -1
- package/src/components/RangeField/tests/RangeField.visual.cy.ts +65 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-custom-bg.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-custom-range.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-default.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-step.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-with-label.snap.png +0 -0
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +38 -56
- package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +5 -0
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +48 -53
- package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +2 -1
- package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +40 -13
- package/src/components/RatingPicker/RatingPicker.stories.ts +65 -88
- package/src/components/RatingPicker/RatingPicker.vue +71 -15
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +31 -42
- package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +1 -1
- package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +5 -0
- package/src/components/RatingPicker/accessibilite/Accessibility.mdx +137 -9
- package/src/components/RatingPicker/tests/RatingPicker.a11y.spect.ts +123 -0
- package/src/components/RatingPicker/tests/RatingPicker.spec.ts +3 -2
- package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +40 -11
- package/src/components/RatingPicker/useRatingFocus.ts +97 -0
- package/src/components/SearchListField/SearchListField.vue +0 -2
- package/src/components/SkipLink/SkipLink.vue +2 -4
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +6 -6
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SyAlert/SyAlert.vue +7 -9
- package/src/components/SyAlert/tests/SyAlert.visual.cy.ts +46 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-closable.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-error.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-info.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-success.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-variant-outlined.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-variant-tonal.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-warning.snap.png +0 -0
- package/src/components/SyBtnMenu/SyBtnMenu.vue +2 -4
- package/src/components/SyTextArea/SyTextArea.vue +32 -1
- package/src/components/TableToolbar/TableToolbar.vue +6 -8
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +166 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +10 -8
- package/src/components/Tables/SyServerTable/tests/SyServerTable.a11y.spec.ts +23 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +268 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +104 -0
- package/src/components/Tables/SyTable/SyTable.vue +10 -8
- package/src/components/Tables/SyTable/tests/SyTable.a11y.spec.ts +22 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +274 -0
- package/src/components/Tables/common/SyTableFilter.vue +31 -6
- package/src/components/Tables/common/SyTablePagination.vue +143 -19
- package/src/components/Tables/common/TableHeader.vue +41 -4
- package/src/components/Tables/common/filters/DateFilter.vue +2 -2
- package/src/components/Tables/common/filters/SelectFilter.vue +1 -1
- package/src/components/Tables/common/locales.ts +3 -0
- package/src/components/Tables/common/tableStyles.scss +16 -19
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +18 -0
- package/src/components/Tables/common/tests/TableHeader.spec.ts +39 -0
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/Tables/common/useTableHeaders.ts +49 -27
- package/src/components/UploadWorkflow/UploadWorkflow.vue +1 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +23 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +66 -0
- package/src/components/UploadWorkflow/useFileList.ts +3 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -3
- package/src/composables/date/tests/useDateFormatDayjs.spec.ts +81 -0
- package/src/composables/date/tests/{useDateInitialization.spec.ts → useDateInitializationDayjs.spec.ts} +39 -3
- package/src/composables/date/useDateInitializationDayjs.ts +4 -1
- package/src/composables/unifyValidation/documentationValidationProps.ts +235 -0
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +2 -1
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +22 -0
- package/src/composables/unifyValidation/useCustomValidation.ts +16 -4
- package/src/composables/unifyValidation/useValidation.ts +46 -15
- package/src/composables/unifyValidation/useVuetifyValidation.ts +2 -2
- package/src/composables/useFormFieldErrorHandling.ts +4 -1
- package/src/composables/validation/tests/useValidation.spec.ts +2 -2
- package/src/composables/validation/useValidation.ts +32 -4
- package/src/composantsVuetify/VBreadcrumbs/VBreadcrumbs.mdx +28 -0
- package/src/composantsVuetify/VBreadcrumbs/v-breadcrumbs.stories.ts +108 -0
- package/src/composantsVuetify/VCard/VCard.mdx +59 -0
- package/src/composantsVuetify/VCard/v-card.stories.ts +279 -0
- package/src/composantsVuetify/VOtpInput/VOtpInput.mdx +39 -0
- package/src/composantsVuetify/VOtpInput/v-otp-input.stories.ts +56 -0
- package/src/composantsVuetify/VSkeletonLoader/VSkeletonLoader.mdx +42 -0
- package/src/composantsVuetify/VSkeletonLoader/v-skeleton-loader.stories.ts +77 -0
- package/src/composantsVuetify/VSwitch/VSwitch.mdx +47 -0
- package/src/composantsVuetify/VSwitch/v-switch.stories.ts +166 -0
- package/src/designTokens/tests/buildColorClassMap.spec.ts +31 -0
- package/src/designTokens/tests/generateScssTokens.spec.ts +12 -0
- package/src/designTokens/tests/themeUtils.spec.ts +53 -0
- package/src/designTokens/tokens/amelipro/apColors.ts +8 -130
- package/src/designTokens/tokens/amelipro/apColors2026.ts +3 -15
- package/src/designTokens/tokens/amelipro/apContextual.ts +55 -47
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +4 -1
- package/src/designTokens/tokens/amelipro/apSemantic.ts +1 -1
- package/src/designTokens/tokens/baseColors.ts +129 -0
- package/src/designTokens/tokens/baseContextualTokens.ts +52 -0
- package/src/designTokens/tokens/cnam/cnamColors.ts +3 -125
- package/src/designTokens/tokens/cnam/cnamContextual.ts +4 -48
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +4 -1
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +1 -1
- package/src/designTokens/tokens/pa/paColors.ts +2 -166
- package/src/designTokens/tokens/pa/paContextual.ts +3 -48
- package/src/designTokens/tokens/pa/paLightTheme.ts +1 -1
- package/src/designTokens/tokens/pa/paSemantic.ts +2 -2
- package/src/designTokens/utils/buildColorClassMap.ts +34 -0
- package/src/designTokens/utils/convertSemanticsToken.ts +8 -11
- package/src/designTokens/utils/createFlattenTheme.ts +15 -7
- package/src/designTokens/utils/index.ts +2 -2
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +61 -91
- package/src/stories/Accessibilite/AuditDesignSystem.mdx +5 -19
- package/src/stories/Accessibilite/AuditEtContreAudit/Exemptions-derogations.mdx +1 -1
- package/src/stories/Accessibilite/AuditEtContreAudit/Introduction.mdx +11 -8
- package/src/stories/Accessibilite/AuditEtContreAudit/RGAA.mdx +6 -7
- package/src/stories/Accessibilite/DesignSystem/Avancement.mdx +433 -0
- package/src/stories/Accessibilite/DesignSystem/a11y-status.json +692 -0
- package/src/stories/Accessibilite/Introduction.mdx +30 -30
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +176 -79
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +67 -19
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +78 -50
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +23 -49
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/FauxPositifs.stories.ts +6 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru/Utilisation.mdx +7 -19
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +55 -67
- package/src/stories/Components/Components.stories.ts +92 -4
- package/src/stories/Demarrer/EnrichirLeDesignSystem.mdx +4 -9
- package/src/stories/Demarrer/EnrichirLeDesignSystem.stories.ts +28 -0
- package/src/stories/Demarrer/Releases.stories.ts +48 -5
- package/src/stories/DesignTokens/ColorDisplay.vue +6 -5
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +2 -4
- package/src/stories/DesignTokens/colors.stories.ts +5 -6
- package/src/stories/GuideDuDev/CreateVuetifyInstance.mdx +95 -0
- package/src/stories/GuideDuDev/Theme.mdx +36 -26
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +3 -2
- package/src/stories/styles/accessibility-guide.css +3 -3
- package/src/utils/functions/classToHex.ts +6 -34
- package/src/utils/functions/createHexResolver.ts +45 -0
- package/src/utils/functions/tests/classToHex.spec.ts +36 -0
- package/src/utils/functions/tests/convertToHex.spec.ts +31 -0
- package/src/utils/functions/tests/createHexResolver.spec.ts +66 -0
- package/src/utils/functions/tests/isCssColor.spec.ts +48 -0
- package/dist/AutocompleteFilter-D9jzRzAL.cjs +0 -1
- package/dist/DateFilter-DTUl8hb1.cjs +0 -1
- package/dist/NumberFilter-MAEojdk0.cjs +0 -1
- package/dist/PeriodFilter-CC4WgIhl.cjs +0 -1
- package/dist/SelectFilter-BR3fvl-a.cjs +0 -1
- package/dist/TextFilter-CCfYFl5F.cjs +0 -1
- package/dist/apLightTheme-CFSRrjv2.cjs +0 -1
- package/dist/composables/date/useDateFormat.d.ts +0 -26
- package/dist/composables/date/useDateInitialization.d.ts +0 -18
- package/dist/design-system-v3.umd.cjs +0 -1
- package/dist/designTokens/utils/convertGaps.d.ts +0 -5
- package/dist/main-C1e3eoxd.cjs +0 -1067
- package/dist/tooth-11-D3sLWv2n.cjs +0 -1
- package/dist/tooth-12-CXrLuH03.cjs +0 -1
- package/dist/tooth-13-BSfo5fpT.cjs +0 -1
- package/dist/tooth-14-DMzulx0h.cjs +0 -1
- package/dist/tooth-15-BKRFVi-9.cjs +0 -1
- package/dist/tooth-16-CpuxAbuM.cjs +0 -1
- package/dist/tooth-17-BPoahUdg.cjs +0 -1
- package/dist/tooth-18-DhHJz8sy.cjs +0 -1
- package/dist/tooth-21-Dgd5hn_X.cjs +0 -1
- package/dist/tooth-22-C2Tn19sB.cjs +0 -1
- package/dist/tooth-23-C9uaaSGb.cjs +0 -1
- package/dist/tooth-24-BrK9UGpf.cjs +0 -1
- package/dist/tooth-25-CE_EfGNp.cjs +0 -1
- package/dist/tooth-26-Ctv4i9Fy.cjs +0 -1
- package/dist/tooth-27-C5J7JkWM.cjs +0 -1
- package/dist/tooth-28-Z9oWqjo0.cjs +0 -1
- package/dist/tooth-31-BrYqmkTi.cjs +0 -1
- package/dist/tooth-32-BNNR0oCZ.cjs +0 -1
- package/dist/tooth-33-DuxvqO2J.cjs +0 -1
- package/dist/tooth-34-BCSCXMB6.cjs +0 -1
- package/dist/tooth-35-BLUXkX88.cjs +0 -1
- package/dist/tooth-36-IrKHYqlA.cjs +0 -1
- package/dist/tooth-37-BYqpdMwo.cjs +0 -1
- package/dist/tooth-38-B_eNXXdu.cjs +0 -1
- package/dist/tooth-41-Ddva4Ot8.cjs +0 -1
- package/dist/tooth-42-szcDqlM0.cjs +0 -1
- package/dist/tooth-43-B3ka6rQm.cjs +0 -1
- package/dist/tooth-44-CazyQucj.cjs +0 -1
- package/dist/tooth-45-B4HQtc8n.cjs +0 -1
- package/dist/tooth-46-BPM40gbG.cjs +0 -1
- package/dist/tooth-47-Dvr20dlh.cjs +0 -1
- package/dist/tooth-48-Bd8ljGsF.cjs +0 -1
- package/dist/tooth-51-OBpwCOF3.cjs +0 -1
- package/dist/tooth-52-aKxyHcmq.cjs +0 -1
- package/dist/tooth-53-vCwJjTOc.cjs +0 -1
- package/dist/tooth-54-DsWu2iFy.cjs +0 -1
- package/dist/tooth-55-BxC1X2Dn.cjs +0 -1
- package/dist/tooth-61-BbLvxMQi.cjs +0 -1
- package/dist/tooth-62-CmTkWczP.cjs +0 -1
- package/dist/tooth-63-DI7l_2qI.cjs +0 -1
- package/dist/tooth-64-B21sOsJh.cjs +0 -1
- package/dist/tooth-65-D2ZC2VEr.cjs +0 -1
- package/dist/tooth-71-D473PPO5.cjs +0 -1
- package/dist/tooth-72-Drh1wnNu.cjs +0 -1
- package/dist/tooth-73-DzlwYI23.cjs +0 -1
- package/dist/tooth-74-8aGvcZPg.cjs +0 -1
- package/dist/tooth-75-BFK7At_r.cjs +0 -1
- package/dist/tooth-81-BZmR-I0M.cjs +0 -1
- package/dist/tooth-82-euVfUUZV.cjs +0 -1
- package/dist/tooth-83-KV010j64.cjs +0 -1
- package/dist/tooth-84-BBg1RjhZ.cjs +0 -1
- package/dist/tooth-85-Cr-kc1wM.cjs +0 -1
- package/dist/vuetifyConfig.umd.cjs +0 -1
- package/src/assets/apTokens.scss +0 -343
- package/src/assets/overrides/_container.scss +0 -36
- package/src/assets/tokens.scss +0 -388
- package/src/composables/date/tests/useDateFormat.spec.ts +0 -67
- package/src/composables/date/useDateFormat.ts +0 -110
- package/src/composables/date/useDateInitialization.ts +0 -92
- package/src/designTokens/apColors.md +0 -66
- package/src/designTokens/cnamColors.md +0 -193
- package/src/designTokens/paColors.md +0 -66
- package/src/designTokens/tokens/json/contextual-tokens.json +0 -156
- package/src/designTokens/tokens/json/primitives.json +0 -209
- package/src/designTokens/tokens/json/semantic.json +0 -120
- package/src/designTokens/utils/convertGaps.ts +0 -11
- package/src/stories/Accessibilite/Avancement/Avancement.mdx +0 -533
- package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +0 -306
|
@@ -3,21 +3,21 @@ import SySelect from '@/components/Customs/Selects/SySelect/SySelect.vue'
|
|
|
3
3
|
import SyAlert from '../../../SyAlert/SyAlert.vue'
|
|
4
4
|
import SyForm from '../../SyForm/SyForm.vue'
|
|
5
5
|
import { VBtn, VMenu, VList, VListItem, VListItemTitle } from 'vuetify/components'
|
|
6
|
-
import { ref } from 'vue'
|
|
6
|
+
import { ref, onMounted } from 'vue'
|
|
7
7
|
import { fn } from '@storybook/test'
|
|
8
|
+
import { getValidationDocumentation } from '@/composables/unifyValidation/documentationValidationProps'
|
|
8
9
|
|
|
9
10
|
const meta: Meta<typeof SySelect> = {
|
|
10
11
|
title: 'Composants/Formulaires/Selects/SySelect',
|
|
11
12
|
component: SySelect,
|
|
12
13
|
parameters: {
|
|
13
14
|
layout: 'fullscreen',
|
|
14
|
-
controls: { exclude: ['selectedValue', 'isOpen', 'closeList'] },
|
|
15
|
+
controls: { exclude: ['onUpdate:modelValue', 'selectedValue', 'isOpen', 'closeList'] },
|
|
15
16
|
},
|
|
16
17
|
argTypes: {
|
|
18
|
+
...getValidationDocumentation('string'),
|
|
17
19
|
selectedValue: { control: 'text' },
|
|
18
20
|
items: { control: 'object' },
|
|
19
|
-
errorMessages: { control: 'object' },
|
|
20
|
-
required: { control: 'boolean' },
|
|
21
21
|
displayAsterisk: { control: 'boolean' },
|
|
22
22
|
textKey: {
|
|
23
23
|
control: 'text',
|
|
@@ -51,10 +51,6 @@ const meta: Meta<typeof SySelect> = {
|
|
|
51
51
|
control: 'boolean',
|
|
52
52
|
description: 'Affiche les options sélectionnées sous forme de chips',
|
|
53
53
|
},
|
|
54
|
-
hideMessages: {
|
|
55
|
-
control: 'boolean',
|
|
56
|
-
description: 'Masque les messages d\'erreur',
|
|
57
|
-
},
|
|
58
54
|
variantStyle: {
|
|
59
55
|
control: 'select',
|
|
60
56
|
options: ['outlined', 'plain', 'underlined', 'filled', 'solo', 'solo-inverted', 'solo-filled'],
|
|
@@ -115,9 +111,6 @@ export default meta
|
|
|
115
111
|
type Story = StoryObj<typeof meta>
|
|
116
112
|
export const Default: Story = {
|
|
117
113
|
parameters: {
|
|
118
|
-
a11y: {
|
|
119
|
-
disable: false,
|
|
120
|
-
},
|
|
121
114
|
sourceCode: [
|
|
122
115
|
{
|
|
123
116
|
name: 'Template',
|
|
@@ -166,21 +159,29 @@ export const Default: Story = {
|
|
|
166
159
|
{ text: 'Emensis itaque difficultatibus multis et nive obrutis callibus', value: 'Louis' },
|
|
167
160
|
{ text: 'Plurimis ubi prope Rauracum ventum est ad supercilia', value: 'Valentin' },
|
|
168
161
|
],
|
|
162
|
+
'customSuccessRules': [{
|
|
163
|
+
type: 'custom',
|
|
164
|
+
options: {
|
|
165
|
+
validate: (v: unknown) => v !== null && v !== undefined,
|
|
166
|
+
successMessage: 'Option sélectionnée avec succès.',
|
|
167
|
+
},
|
|
168
|
+
}],
|
|
169
169
|
'onUpdate:modelValue': fn(),
|
|
170
170
|
},
|
|
171
171
|
render: (args) => {
|
|
172
172
|
return {
|
|
173
173
|
components: { SySelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
174
174
|
setup() {
|
|
175
|
-
|
|
175
|
+
const value = ref(null)
|
|
176
|
+
return { args, value }
|
|
176
177
|
},
|
|
177
178
|
template: `
|
|
178
179
|
<div class="pa-4">
|
|
179
180
|
<SySelect
|
|
181
|
+
v-model="value"
|
|
180
182
|
v-bind="args"
|
|
181
183
|
/>
|
|
182
184
|
</div>
|
|
183
|
-
<br/><br/><br/><br/>
|
|
184
185
|
`,
|
|
185
186
|
}
|
|
186
187
|
},
|
|
@@ -188,9 +189,6 @@ export const Default: Story = {
|
|
|
188
189
|
|
|
189
190
|
export const HelpText: Story = {
|
|
190
191
|
parameters: {
|
|
191
|
-
a11y: {
|
|
192
|
-
disable: false,
|
|
193
|
-
},
|
|
194
192
|
sourceCode: [
|
|
195
193
|
{
|
|
196
194
|
name: 'Template',
|
|
@@ -241,23 +239,30 @@ export const HelpText: Story = {
|
|
|
241
239
|
{ text: 'Valentin', value: 'Valentin' },
|
|
242
240
|
],
|
|
243
241
|
'helpText': 'Texte d\'aide à la saisie',
|
|
244
|
-
'
|
|
245
|
-
'
|
|
242
|
+
'hideDetails': false,
|
|
243
|
+
'customSuccessRules': [{
|
|
244
|
+
type: 'custom',
|
|
245
|
+
options: {
|
|
246
|
+
validate: (v: unknown) => v !== null && v !== undefined,
|
|
247
|
+
successMessage: 'Option sélectionnée avec succès.',
|
|
248
|
+
},
|
|
249
|
+
}],
|
|
246
250
|
'onUpdate:modelValue': fn(),
|
|
247
251
|
},
|
|
248
252
|
render: (args) => {
|
|
249
253
|
return {
|
|
250
254
|
components: { SySelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
251
255
|
setup() {
|
|
252
|
-
|
|
256
|
+
const value = ref(null)
|
|
257
|
+
return { args, value }
|
|
253
258
|
},
|
|
254
259
|
template: `
|
|
255
260
|
<div class="pa-4">
|
|
256
261
|
<SySelect
|
|
262
|
+
v-model="value"
|
|
257
263
|
v-bind="args"
|
|
258
264
|
/>
|
|
259
265
|
</div>
|
|
260
|
-
<br/><br/><br/><br/>
|
|
261
266
|
`,
|
|
262
267
|
}
|
|
263
268
|
},
|
|
@@ -265,9 +270,6 @@ export const HelpText: Story = {
|
|
|
265
270
|
|
|
266
271
|
export const Required: Story = {
|
|
267
272
|
parameters: {
|
|
268
|
-
a11y: {
|
|
269
|
-
disable: false,
|
|
270
|
-
},
|
|
271
273
|
sourceCode: [
|
|
272
274
|
{
|
|
273
275
|
name: 'Template',
|
|
@@ -286,12 +288,13 @@ export const Required: Story = {
|
|
|
286
288
|
name: 'Script',
|
|
287
289
|
code: `
|
|
288
290
|
<script setup lang="ts">
|
|
291
|
+
import { ref } from 'vue'
|
|
289
292
|
import { SySelect } from '@cnamts/synapse'
|
|
290
|
-
|
|
293
|
+
const value = ref(null)
|
|
291
294
|
const items = [
|
|
292
295
|
{ text: 'Option 1', value: '1' },
|
|
293
296
|
{ text: 'Option 2', value: '2' },
|
|
294
|
-
]
|
|
297
|
+
]
|
|
295
298
|
</script>
|
|
296
299
|
`,
|
|
297
300
|
},
|
|
@@ -309,14 +312,15 @@ export const Required: Story = {
|
|
|
309
312
|
return {
|
|
310
313
|
components: { SySelect },
|
|
311
314
|
setup() {
|
|
312
|
-
|
|
315
|
+
const value = ref(null)
|
|
316
|
+
return { args, value }
|
|
313
317
|
},
|
|
314
318
|
template: `
|
|
315
319
|
<div class="pa-4">
|
|
316
320
|
<p class="mb-2 text-caption text-grey-darken-2">Ce champ est obligatoire</p>
|
|
317
321
|
<SySelect
|
|
322
|
+
v-model="value"
|
|
318
323
|
v-bind="args"
|
|
319
|
-
:required="args.required"
|
|
320
324
|
/>
|
|
321
325
|
</div>
|
|
322
326
|
`,
|
|
@@ -326,9 +330,6 @@ export const Required: Story = {
|
|
|
326
330
|
|
|
327
331
|
export const RequiredWithAsterisk: Story = {
|
|
328
332
|
parameters: {
|
|
329
|
-
a11y: {
|
|
330
|
-
disable: false,
|
|
331
|
-
},
|
|
332
333
|
docs: {
|
|
333
334
|
description: {
|
|
334
335
|
story: 'Version du champ de sélection requis avec un astérisque visuel.',
|
|
@@ -377,14 +378,14 @@ const items = [
|
|
|
377
378
|
return {
|
|
378
379
|
components: { SySelect },
|
|
379
380
|
setup() {
|
|
380
|
-
|
|
381
|
+
const value = ref(null)
|
|
382
|
+
return { args, value }
|
|
381
383
|
},
|
|
382
384
|
template: `
|
|
383
385
|
<div class="pa-4">
|
|
384
386
|
<SySelect
|
|
387
|
+
v-model="value"
|
|
385
388
|
v-bind="args"
|
|
386
|
-
:required="args.required"
|
|
387
|
-
:display-asterisk="args.displayAsterisk"
|
|
388
389
|
/>
|
|
389
390
|
</div>
|
|
390
391
|
`,
|
|
@@ -392,11 +393,275 @@ const items = [
|
|
|
392
393
|
},
|
|
393
394
|
}
|
|
394
395
|
|
|
395
|
-
export const
|
|
396
|
+
export const WithError: Story = {
|
|
396
397
|
parameters: {
|
|
397
|
-
|
|
398
|
-
|
|
398
|
+
docs: {
|
|
399
|
+
description: {
|
|
400
|
+
story: '« Option 1 » est présélectionnée et déclenche une erreur bloquante au chargement.',
|
|
401
|
+
},
|
|
399
402
|
},
|
|
403
|
+
sourceCode: [
|
|
404
|
+
{
|
|
405
|
+
name: 'Template',
|
|
406
|
+
code: `
|
|
407
|
+
<template>
|
|
408
|
+
<SySelect
|
|
409
|
+
ref="selectRef"
|
|
410
|
+
v-model="value"
|
|
411
|
+
:items="items"
|
|
412
|
+
label="Option"
|
|
413
|
+
:customRules="[
|
|
414
|
+
{
|
|
415
|
+
type: 'custom',
|
|
416
|
+
options: {
|
|
417
|
+
validate: (v) => v !== '1',
|
|
418
|
+
message: 'Option 1 n\\'est pas autorisée, choisissez Option 2 ou 3.'
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
]"
|
|
422
|
+
/>
|
|
423
|
+
</template>`,
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: 'Script',
|
|
427
|
+
code: `
|
|
428
|
+
<script setup lang="ts">
|
|
429
|
+
import { onMounted, ref } from 'vue'
|
|
430
|
+
import { SySelect } from '@cnamts/synapse'
|
|
431
|
+
const value = ref('1')
|
|
432
|
+
const items = [
|
|
433
|
+
{ text: 'Option 1', value: '1' },
|
|
434
|
+
{ text: 'Option 2', value: '2' },
|
|
435
|
+
{ text: 'Option 3', value: '3' },
|
|
436
|
+
]
|
|
437
|
+
|
|
438
|
+
const selectRef = ref(null)
|
|
439
|
+
|
|
440
|
+
onMounted(() => {
|
|
441
|
+
selectRef.value?.validateOnSubmit()
|
|
442
|
+
})
|
|
443
|
+
</script>`,
|
|
444
|
+
},
|
|
445
|
+
],
|
|
446
|
+
},
|
|
447
|
+
args: {
|
|
448
|
+
'items': [
|
|
449
|
+
{ text: 'Option 1', value: '1' },
|
|
450
|
+
{ text: 'Option 2', value: '2' },
|
|
451
|
+
{ text: 'Option 3', value: '3' },
|
|
452
|
+
],
|
|
453
|
+
'label': 'Option',
|
|
454
|
+
'onUpdate:modelValue': fn(),
|
|
455
|
+
},
|
|
456
|
+
render: args => ({
|
|
457
|
+
components: { SySelect },
|
|
458
|
+
setup() {
|
|
459
|
+
const value = ref('1')
|
|
460
|
+
const selectRef = ref<{ validateOnSubmit: () => Promise<boolean> } | null>(null)
|
|
461
|
+
|
|
462
|
+
onMounted(() => {
|
|
463
|
+
selectRef.value?.validateOnSubmit()
|
|
464
|
+
})
|
|
465
|
+
|
|
466
|
+
return { args, value, selectRef }
|
|
467
|
+
},
|
|
468
|
+
template: `
|
|
469
|
+
<div class="pa-4">
|
|
470
|
+
<SySelect
|
|
471
|
+
ref="selectRef"
|
|
472
|
+
v-model="value"
|
|
473
|
+
v-bind="args"
|
|
474
|
+
:customRules="[
|
|
475
|
+
{
|
|
476
|
+
type: 'custom',
|
|
477
|
+
options: {
|
|
478
|
+
validate: (v) => v !== '1',
|
|
479
|
+
message: 'Option 1 n\\'est pas autorisée, choisissez Option 2 ou 3.'
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
]"
|
|
483
|
+
/>
|
|
484
|
+
</div>
|
|
485
|
+
`,
|
|
486
|
+
}),
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export const WithWarning: Story = {
|
|
490
|
+
parameters: {
|
|
491
|
+
docs: {
|
|
492
|
+
description: {
|
|
493
|
+
story: '« Option 1 » est présélectionnée et déclenche un avertissement (non bloquant) au chargement.',
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
sourceCode: [
|
|
497
|
+
{
|
|
498
|
+
name: 'Template',
|
|
499
|
+
code: `
|
|
500
|
+
<template>
|
|
501
|
+
<SySelect
|
|
502
|
+
v-model="value"
|
|
503
|
+
:items="items"
|
|
504
|
+
label="Option"
|
|
505
|
+
:customWarningRules="[
|
|
506
|
+
{
|
|
507
|
+
type: 'custom',
|
|
508
|
+
options: {
|
|
509
|
+
validate: (v) => v !== '1',
|
|
510
|
+
message: 'Option 1 est dépréciée, préférez Option 2 ou 3.'
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
]"
|
|
514
|
+
/>
|
|
515
|
+
</template>`,
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
name: 'Script',
|
|
519
|
+
code: `
|
|
520
|
+
<script setup lang="ts">
|
|
521
|
+
import { ref } from 'vue'
|
|
522
|
+
import { SySelect } from '@cnamts/synapse'
|
|
523
|
+
const value = ref(null)
|
|
524
|
+
const items = [
|
|
525
|
+
{ text: 'Option 1', value: '1' },
|
|
526
|
+
{ text: 'Option 2', value: '2' },
|
|
527
|
+
{ text: 'Option 3', value: '3' },
|
|
528
|
+
]
|
|
529
|
+
</script>`,
|
|
530
|
+
},
|
|
531
|
+
],
|
|
532
|
+
},
|
|
533
|
+
args: {
|
|
534
|
+
'items': [
|
|
535
|
+
{ text: 'Option 1', value: '1' },
|
|
536
|
+
{ text: 'Option 2', value: '2' },
|
|
537
|
+
{ text: 'Option 3', value: '3' },
|
|
538
|
+
],
|
|
539
|
+
'label': 'Option',
|
|
540
|
+
'onUpdate:modelValue': fn(),
|
|
541
|
+
},
|
|
542
|
+
render: args => ({
|
|
543
|
+
components: { SySelect },
|
|
544
|
+
setup() {
|
|
545
|
+
const value = ref('1')
|
|
546
|
+
const selectRef = ref<{ validateOnSubmit: () => Promise<boolean> } | null>(null)
|
|
547
|
+
|
|
548
|
+
onMounted(() => {
|
|
549
|
+
selectRef.value?.validateOnSubmit()
|
|
550
|
+
})
|
|
551
|
+
|
|
552
|
+
return { args, value, selectRef }
|
|
553
|
+
},
|
|
554
|
+
template: `
|
|
555
|
+
<div class="pa-4">
|
|
556
|
+
<SySelect
|
|
557
|
+
ref="selectRef"
|
|
558
|
+
v-model="value"
|
|
559
|
+
v-bind="args"
|
|
560
|
+
:customWarningRules="[
|
|
561
|
+
{
|
|
562
|
+
type: 'custom',
|
|
563
|
+
options: {
|
|
564
|
+
validate: (v) => v !== '1',
|
|
565
|
+
message: 'Option 1 est dépréciée, préférez Option 2 ou 3.'
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
]"
|
|
569
|
+
/>
|
|
570
|
+
</div>
|
|
571
|
+
`,
|
|
572
|
+
}),
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export const WithSuccess: Story = {
|
|
576
|
+
parameters: {
|
|
577
|
+
docs: {
|
|
578
|
+
description: {
|
|
579
|
+
story: 'Une option est présélectionnée et déclenche la confirmation de succès au chargement.',
|
|
580
|
+
},
|
|
581
|
+
},
|
|
582
|
+
sourceCode: [
|
|
583
|
+
{
|
|
584
|
+
name: 'Template',
|
|
585
|
+
code: `
|
|
586
|
+
<template>
|
|
587
|
+
<SySelect
|
|
588
|
+
v-model="value"
|
|
589
|
+
:items="items"
|
|
590
|
+
label="Option"
|
|
591
|
+
show-success-messages
|
|
592
|
+
:customSuccessRules="[
|
|
593
|
+
{
|
|
594
|
+
type: 'custom',
|
|
595
|
+
options: {
|
|
596
|
+
validate: (v) => v !== null && v !== undefined,
|
|
597
|
+
message: 'Option sélectionnée avec succès.'
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
]"
|
|
601
|
+
/>
|
|
602
|
+
</template>`,
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: 'Script',
|
|
606
|
+
code: `
|
|
607
|
+
<script setup lang="ts">
|
|
608
|
+
import { ref } from 'vue'
|
|
609
|
+
import { SySelect } from '@cnamts/synapse'
|
|
610
|
+
const value = ref(null)
|
|
611
|
+
const items = [
|
|
612
|
+
{ text: 'Option 1', value: '1' },
|
|
613
|
+
{ text: 'Option 2', value: '2' },
|
|
614
|
+
{ text: 'Option 3', value: '3' },
|
|
615
|
+
]
|
|
616
|
+
</script>`,
|
|
617
|
+
},
|
|
618
|
+
],
|
|
619
|
+
},
|
|
620
|
+
args: {
|
|
621
|
+
'items': [
|
|
622
|
+
{ text: 'Option 1', value: '1' },
|
|
623
|
+
{ text: 'Option 2', value: '2' },
|
|
624
|
+
{ text: 'Option 3', value: '3' },
|
|
625
|
+
],
|
|
626
|
+
'label': 'Option',
|
|
627
|
+
'showSuccessMessages': true,
|
|
628
|
+
'onUpdate:modelValue': fn(),
|
|
629
|
+
},
|
|
630
|
+
render: args => ({
|
|
631
|
+
components: { SySelect },
|
|
632
|
+
setup() {
|
|
633
|
+
const value = ref('1')
|
|
634
|
+
const selectRef = ref<{ validateOnSubmit: () => Promise<boolean> } | null>(null)
|
|
635
|
+
|
|
636
|
+
onMounted(() => {
|
|
637
|
+
selectRef.value?.validateOnSubmit()
|
|
638
|
+
})
|
|
639
|
+
|
|
640
|
+
return { args, value, selectRef }
|
|
641
|
+
},
|
|
642
|
+
template: `
|
|
643
|
+
<div class="pa-4">
|
|
644
|
+
<SySelect
|
|
645
|
+
ref="selectRef"
|
|
646
|
+
v-model="value"
|
|
647
|
+
v-bind="args"
|
|
648
|
+
:customSuccessRules="[
|
|
649
|
+
{
|
|
650
|
+
type: 'custom',
|
|
651
|
+
options: {
|
|
652
|
+
validate: (v) => v !== null && v !== undefined,
|
|
653
|
+
message: 'Option sélectionnée avec succès.'
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
]"
|
|
657
|
+
/>
|
|
658
|
+
</div>
|
|
659
|
+
`,
|
|
660
|
+
}),
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export const SlotPrepend: Story = {
|
|
664
|
+
parameters: {
|
|
400
665
|
sourceCode: [
|
|
401
666
|
{
|
|
402
667
|
name: 'Template',
|
|
@@ -461,9 +726,6 @@ export const SlotPrepend: Story = {
|
|
|
461
726
|
|
|
462
727
|
export const SlotAppend: Story = {
|
|
463
728
|
parameters: {
|
|
464
|
-
a11y: {
|
|
465
|
-
disable: false,
|
|
466
|
-
},
|
|
467
729
|
sourceCode: [
|
|
468
730
|
{
|
|
469
731
|
name: 'Template',
|
|
@@ -561,9 +823,6 @@ export const WithTooltips: Story = {
|
|
|
561
823
|
}
|
|
562
824
|
},
|
|
563
825
|
parameters: {
|
|
564
|
-
a11y: {
|
|
565
|
-
disable: false,
|
|
566
|
-
},
|
|
567
826
|
docs: {
|
|
568
827
|
description: {
|
|
569
828
|
story: 'Exemple de champ avec des tooltips d\'information. Les icônes d\'information apparaissent automatiquement lorsque les props prependTooltip et/ou appendTooltip sont renseignées. La position des tooltips peut être contrôlée avec la prop tooltipLocation.',
|
|
@@ -606,9 +865,6 @@ export const WithTooltips: Story = {
|
|
|
606
865
|
|
|
607
866
|
export const MultipleSelection: Story = {
|
|
608
867
|
parameters: {
|
|
609
|
-
a11y: {
|
|
610
|
-
disable: true,
|
|
611
|
-
},
|
|
612
868
|
docs: {
|
|
613
869
|
description: {
|
|
614
870
|
story: 'Exemple de sélection multiple avec SySelect. Les options dans le menu déroulant sont affichées avec des cases à cocher pour faciliter la sélection multiple.',
|
|
@@ -678,7 +934,7 @@ const options = [
|
|
|
678
934
|
return {
|
|
679
935
|
components: { SySelect },
|
|
680
936
|
setup() {
|
|
681
|
-
const selectedOptions = ref(
|
|
937
|
+
const selectedOptions = ref(null)
|
|
682
938
|
|
|
683
939
|
return { args, selectedOptions }
|
|
684
940
|
},
|
|
@@ -699,9 +955,6 @@ const options = [
|
|
|
699
955
|
|
|
700
956
|
export const ChipsDisplay: Story = {
|
|
701
957
|
parameters: {
|
|
702
|
-
a11y: {
|
|
703
|
-
disable: true,
|
|
704
|
-
},
|
|
705
958
|
docs: {
|
|
706
959
|
description: {
|
|
707
960
|
story: 'Exemple de sélection multiple avec affichage en chips. Les options sélectionnées sont affichées sous forme de chips dans le champ, et les options dans le menu déroulant sont affichées avec des cases à cocher.',
|
|
@@ -758,7 +1011,7 @@ const options = [
|
|
|
758
1011
|
return {
|
|
759
1012
|
components: { SySelect },
|
|
760
1013
|
setup() {
|
|
761
|
-
const selectedOptions = ref(
|
|
1014
|
+
const selectedOptions = ref(null)
|
|
762
1015
|
|
|
763
1016
|
return { args, selectedOptions }
|
|
764
1017
|
},
|
|
@@ -774,89 +1027,8 @@ const options = [
|
|
|
774
1027
|
},
|
|
775
1028
|
}
|
|
776
1029
|
|
|
777
|
-
export const withCustomError: Story = {
|
|
778
|
-
parameters: {
|
|
779
|
-
a11y: {
|
|
780
|
-
disable: false,
|
|
781
|
-
},
|
|
782
|
-
sourceCode: [
|
|
783
|
-
{
|
|
784
|
-
name: 'Template',
|
|
785
|
-
code: `
|
|
786
|
-
<template>
|
|
787
|
-
<SySelect
|
|
788
|
-
v-model="value"
|
|
789
|
-
:items="items"
|
|
790
|
-
:error-messages="errorMessages"
|
|
791
|
-
/>
|
|
792
|
-
<VBtn @click="triggerError">
|
|
793
|
-
Trigger Error
|
|
794
|
-
</VBtn>
|
|
795
|
-
</template>
|
|
796
|
-
`,
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
name: 'Script',
|
|
800
|
-
code: `
|
|
801
|
-
<script setup lang="ts">
|
|
802
|
-
import { SySelect } from '@cnamts/synapse'
|
|
803
|
-
import { ref } from 'vue'
|
|
804
|
-
|
|
805
|
-
const items = [
|
|
806
|
-
{ text: 'Option 1', value: '1' },
|
|
807
|
-
{ text: 'Option 2', value: '2' },
|
|
808
|
-
],
|
|
809
|
-
|
|
810
|
-
const errorMessages = ref([])
|
|
811
|
-
|
|
812
|
-
const triggerError = () => {
|
|
813
|
-
errorMessages.value = ['This is a test error message']
|
|
814
|
-
}
|
|
815
|
-
</script>
|
|
816
|
-
`,
|
|
817
|
-
},
|
|
818
|
-
],
|
|
819
|
-
},
|
|
820
|
-
args: {
|
|
821
|
-
'items': [
|
|
822
|
-
{ text: 'Option 1', value: '1' },
|
|
823
|
-
{ text: 'Option 2', value: '2' },
|
|
824
|
-
],
|
|
825
|
-
'onUpdate:modelValue': fn(),
|
|
826
|
-
},
|
|
827
|
-
render: (args) => {
|
|
828
|
-
return {
|
|
829
|
-
components: { SySelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
830
|
-
setup() {
|
|
831
|
-
const errorMessages = ref([])
|
|
832
|
-
const triggerError = () => {
|
|
833
|
-
// @ts-expect-error test error message
|
|
834
|
-
errorMessages.value = ['This is a test error message']
|
|
835
|
-
}
|
|
836
|
-
return { args, errorMessages, triggerError }
|
|
837
|
-
},
|
|
838
|
-
template: `
|
|
839
|
-
<div class="pa-4">
|
|
840
|
-
<SySelect
|
|
841
|
-
v-bind="args"
|
|
842
|
-
:error-messages="errorMessages"
|
|
843
|
-
/>
|
|
844
|
-
</div>
|
|
845
|
-
<div class="px-4">
|
|
846
|
-
<VBtn @click="triggerError">
|
|
847
|
-
Trigger Error
|
|
848
|
-
</VBtn>
|
|
849
|
-
</div>
|
|
850
|
-
`,
|
|
851
|
-
}
|
|
852
|
-
},
|
|
853
|
-
}
|
|
854
|
-
|
|
855
1030
|
export const withCustomKey: Story = {
|
|
856
1031
|
parameters: {
|
|
857
|
-
a11y: {
|
|
858
|
-
disable: false,
|
|
859
|
-
},
|
|
860
1032
|
sourceCode: [
|
|
861
1033
|
{
|
|
862
1034
|
name: 'Template',
|
|
@@ -890,17 +1062,26 @@ export const withCustomKey: Story = {
|
|
|
890
1062
|
{ customKey: 'Choix 1', value: '1' },
|
|
891
1063
|
{ customKey: 'Choix 2', value: '2' },
|
|
892
1064
|
],
|
|
1065
|
+
'customSuccessRules': [{
|
|
1066
|
+
type: 'custom',
|
|
1067
|
+
options: {
|
|
1068
|
+
validate: (v: unknown) => v !== null && v !== undefined,
|
|
1069
|
+
successMessage: 'Option sélectionnée avec succès.',
|
|
1070
|
+
},
|
|
1071
|
+
}],
|
|
893
1072
|
'onUpdate:modelValue': fn(),
|
|
894
1073
|
},
|
|
895
1074
|
render: (args) => {
|
|
896
1075
|
return {
|
|
897
1076
|
components: { SySelect, VBtn, VMenu, VList, VListItem, VListItemTitle },
|
|
898
1077
|
setup() {
|
|
899
|
-
|
|
1078
|
+
const value = ref(null)
|
|
1079
|
+
return { args, value }
|
|
900
1080
|
},
|
|
901
1081
|
template: `
|
|
902
1082
|
<div class="pa-4">
|
|
903
1083
|
<SySelect
|
|
1084
|
+
v-model="value"
|
|
904
1085
|
v-bind="args"
|
|
905
1086
|
text-key="customKey"
|
|
906
1087
|
/>
|
|
@@ -935,9 +1116,6 @@ export const Info: Story = {
|
|
|
935
1116
|
|
|
936
1117
|
export const FormValidation: Story = {
|
|
937
1118
|
parameters: {
|
|
938
|
-
a11y: {
|
|
939
|
-
disable: false,
|
|
940
|
-
},
|
|
941
1119
|
docs: {
|
|
942
1120
|
description: {
|
|
943
1121
|
story: 'Exemple d\'utilisation du SySelect dans un formulaire.',
|
|
@@ -1049,3 +1227,104 @@ const onSubmit = (event) => {
|
|
|
1049
1227
|
}
|
|
1050
1228
|
},
|
|
1051
1229
|
}
|
|
1230
|
+
|
|
1231
|
+
export const VuetifyValidation: Story = {
|
|
1232
|
+
parameters: {
|
|
1233
|
+
docs: {
|
|
1234
|
+
description: {
|
|
1235
|
+
story: 'Exemple d\'utilisation de la validation native Vuetify via la prop `useVuetifyValidation`. Les règles sont définies au format Vuetify : des fonctions retournant `true` ou un message d\'erreur. Soumettez le formulaire pour déclencher la validation.',
|
|
1236
|
+
},
|
|
1237
|
+
},
|
|
1238
|
+
sourceCode: [
|
|
1239
|
+
{
|
|
1240
|
+
name: 'Template',
|
|
1241
|
+
code: `
|
|
1242
|
+
<template>
|
|
1243
|
+
<SyForm @submit="onSubmit">
|
|
1244
|
+
<SySelect
|
|
1245
|
+
v-model="value"
|
|
1246
|
+
:items="items"
|
|
1247
|
+
label="Option"
|
|
1248
|
+
use-vuetify-validation
|
|
1249
|
+
:show-success-messages="false"
|
|
1250
|
+
:rules="[v => !!v || 'Ce champ est requis']"
|
|
1251
|
+
/>
|
|
1252
|
+
<VBtn type="submit" color="primary" class="mt-4">
|
|
1253
|
+
Soumettre
|
|
1254
|
+
</VBtn>
|
|
1255
|
+
</SyForm>
|
|
1256
|
+
</template>`,
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
name: 'Script',
|
|
1260
|
+
code: `
|
|
1261
|
+
<script setup lang="ts">
|
|
1262
|
+
import { ref } from 'vue'
|
|
1263
|
+
import { SySelect, SyForm } from '@cnamts/synapse'
|
|
1264
|
+
import { VBtn } from 'vuetify/components'
|
|
1265
|
+
|
|
1266
|
+
const value = ref(null)
|
|
1267
|
+
const items = [
|
|
1268
|
+
{ text: 'Option 1', value: '1' },
|
|
1269
|
+
{ text: 'Option 2', value: '2' },
|
|
1270
|
+
{ text: 'Option 3', value: '3' },
|
|
1271
|
+
]
|
|
1272
|
+
|
|
1273
|
+
function onSubmit(event: { isValid: boolean }) {
|
|
1274
|
+
if (event.isValid) {
|
|
1275
|
+
alert('Formulaire valide : ' + value.value)
|
|
1276
|
+
} else {
|
|
1277
|
+
alert('Formulaire invalide : veuillez choisir une option.')
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
</script>`,
|
|
1281
|
+
},
|
|
1282
|
+
],
|
|
1283
|
+
},
|
|
1284
|
+
args: {
|
|
1285
|
+
'items': [
|
|
1286
|
+
{ text: 'Option 1', value: '1' },
|
|
1287
|
+
{ text: 'Option 2', value: '2' },
|
|
1288
|
+
{ text: 'Option 3', value: '3' },
|
|
1289
|
+
],
|
|
1290
|
+
'label': 'Option',
|
|
1291
|
+
'useVuetifyValidation': true,
|
|
1292
|
+
'showSuccessMessages': false,
|
|
1293
|
+
'onUpdate:modelValue': fn(),
|
|
1294
|
+
},
|
|
1295
|
+
render: args => ({
|
|
1296
|
+
components: { SySelect, SyForm, VBtn },
|
|
1297
|
+
setup() {
|
|
1298
|
+
const value = ref(null)
|
|
1299
|
+
|
|
1300
|
+
function onSubmit(event: { isValid: boolean }) {
|
|
1301
|
+
if (event.isValid) {
|
|
1302
|
+
alert(`Formulaire valide : ${value.value}`)
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
alert('Formulaire invalide : veuillez choisir une option.')
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
return { args, value, onSubmit }
|
|
1310
|
+
},
|
|
1311
|
+
template: `
|
|
1312
|
+
<div class="pa-4">
|
|
1313
|
+
<SyForm @submit="onSubmit">
|
|
1314
|
+
<SySelect
|
|
1315
|
+
v-model="value"
|
|
1316
|
+
v-bind="args"
|
|
1317
|
+
:rules="[v => !!v || 'Ce champ est requis']"
|
|
1318
|
+
/>
|
|
1319
|
+
<VBtn
|
|
1320
|
+
type="submit"
|
|
1321
|
+
color="primary"
|
|
1322
|
+
class="mt-4"
|
|
1323
|
+
>
|
|
1324
|
+
Soumettre
|
|
1325
|
+
</VBtn>
|
|
1326
|
+
</SyForm>
|
|
1327
|
+
</div>
|
|
1328
|
+
`,
|
|
1329
|
+
}),
|
|
1330
|
+
}
|