@cnamts/synapse 1.0.26 → 1.0.27
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/{AutocompleteFilter-BPR-a55G.js → AutocompleteFilter-C9eLKyW8.js} +3 -3
- package/dist/{DateFilter-CknrJWs2.js → DateFilter-y-GLkAkn.js} +8 -8
- package/dist/{NumberFilter-DJ-yNlzv.js → NumberFilter-DN6hIBS7.js} +1 -1
- package/dist/{PeriodFilter-CiB5Oa9Z.js → PeriodFilter-MoUUp9qS.js} +1 -1
- package/dist/{SelectFilter-EiafX97M.js → SelectFilter-bCbrdLmu.js} +1 -1
- package/dist/{TextFilter-BzOmpdxj.js → TextFilter-CvjgEaoM.js} +4 -4
- package/dist/apLightTheme2026-ug4Y23ns.js +611 -0
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +2369 -353
- package/dist/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.d.ts +18 -0
- package/dist/components/Customs/Selects/SyAutocomplete/utils/ariaManager.d.ts +1 -1
- package/dist/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.d.ts +3 -1
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +9 -10
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +1 -0
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectValidation.d.ts +15 -0
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +3 -3
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +3 -3
- package/dist/components/Customs/SyIconButton/SyIconButton.d.ts +18 -0
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +20 -38
- package/dist/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.d.ts +50 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +6 -6
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +147 -136
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +62 -54
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +27 -24
- package/dist/components/DatePicker/composables/index.d.ts +1 -0
- package/dist/components/DatePicker/composables/useDatePickerValidationBridge.d.ts +51 -0
- package/dist/components/MonthPicker/MonthPicker.d.ts +23 -23
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +23 -23
- package/dist/components/NirField/NirField.d.ts +56 -56
- package/dist/components/PasswordField/PasswordField.d.ts +3 -3
- package/dist/components/PeriodField/PeriodField.d.ts +236 -212
- package/dist/components/PhoneField/PhoneField.d.ts +23 -23
- package/dist/components/SyTextArea/SyTextArea.d.ts +25 -15
- package/dist/components/SyTextArea/composables/useSyTextAreaValidation.d.ts +20 -0
- package/dist/components/SyTextArea/locales.d.ts +1 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +1 -0
- package/dist/components/Tables/SyTable/SyTable.d.ts +1 -0
- package/dist/components/Tables/common/SyTablePagination.d.ts +25 -25
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +160 -160
- package/dist/composables/unifyValidation/useValidation.d.ts +16 -14
- package/dist/design-system-v3.js +81 -80
- package/dist/designTokens/tokens/amelipro/apContextual.d.ts +6 -6
- package/dist/designTokens/tokens/amelipro/apDarkTheme.d.ts +3 -1
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +53 -100
- package/dist/designTokens/tokens/baseContextualTokens.d.ts +0 -6
- package/dist/designTokens/tokens/baseTokens.d.ts +232 -0
- package/dist/designTokens/tokens/cnam/cnamContextual.d.ts +6 -6
- package/dist/designTokens/tokens/cnam/cnamDarkTheme.d.ts +1 -1
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +57 -101
- package/dist/designTokens/tokens/pa/paContextual.d.ts +0 -6
- package/dist/designTokens/tokens/pa/paDarkTheme.d.ts +1 -1
- package/dist/designTokens/tokens/pa/paLightTheme.d.ts +53 -97
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +1 -0
- package/dist/designTokens/tokens/semanticTokens.d.ts +112 -0
- package/dist/main-CI6Q9nmO.js +39234 -0
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +208 -72
- package/package.json +4 -2
- package/src/assets/overrides/_icons.scss +5 -4
- package/src/assets/overrides/_otp.scss +4 -4
- package/src/assets/overrides/_typography.scss +2 -1
- package/src/assets/overrides/_utilities.scss +1 -42
- package/src/components/ChipList/ChipList.vue +30 -18
- package/src/components/ChipList/tests/chipList.spec.ts +4 -4
- package/src/components/CopyBtn/CopyBtn.vue +2 -2
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.stories.ts +4 -0
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +7 -6
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +223 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +283 -351
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +182 -218
- package/src/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.ts +101 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +761 -1
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +3 -1
- package/src/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.ts +79 -5
- package/src/components/Customs/Selects/SyAutocomplete/validation/Validation.stories.ts +1029 -0
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +9 -491
- package/src/components/Customs/Selects/SySelect/SySelect.vue +46 -79
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +3 -0
- package/src/components/Customs/Selects/SySelect/composables/useSySelectValidation.ts +64 -0
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +196 -0
- package/src/components/Customs/Selects/SySelect/validation/Validation.stories.ts +1026 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +18 -7
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +2 -2
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +8 -8
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +8 -8
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +1 -1
- package/src/components/Customs/SyIcon/accessibilite/Accessibility.mdx +0 -6
- package/src/components/Customs/SyIcon/utils/tests/iconUtils.spec.ts +107 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.mdx +2 -2
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.stories.ts +395 -200
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +82 -127
- package/src/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.ts +127 -0
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.a11y.spec.ts +93 -1
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.spec.ts +146 -9
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.visual.cy.ts +165 -0
- package/src/components/Customs/SyRadioGroup/validation/Validation.stories.ts +773 -0
- package/src/components/Customs/SyTabs/config.ts +3 -3
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +265 -0
- package/src/components/Customs/SyTabs/tests/useTabTransition.spec.ts +188 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +10 -29
- package/src/components/Customs/SyTextField/SyTextField.vue +23 -15
- package/src/components/DataList/DataList.stories.ts +1 -1
- package/src/components/DataListItem/tests/DataListItem.spec.ts +3 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +37 -142
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.coverage.spec.ts +156 -0
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.spec.ts +495 -4
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +47 -66
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +206 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/bridge-integration.regression.spec.ts +210 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/calendar-navigation.regression.spec.ts +214 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/validation-cross.regression.spec.ts +194 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/validation-success-messages.regression.spec.ts +83 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +129 -54
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.spec.ts +320 -0
- package/src/components/DatePicker/composables/index.ts +1 -0
- package/src/components/DatePicker/composables/tests/useCalendarKeyboardNavigation.spec.ts +360 -0
- package/src/components/DatePicker/composables/tests/useDatePickerValidationBridge.spec.ts +129 -0
- package/src/components/DatePicker/composables/useDatePickerValidationBridge.ts +205 -0
- package/src/components/DatePicker/docExamples/BidirectionalComplexValidation.vue +1 -1
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +1 -1
- package/src/components/DatePicker/tests/exposed-methods.coverage.spec.ts +75 -0
- package/src/components/DialogBox/DialogBox.vue +1 -1
- package/src/components/FileList/UploadItem/UploadItem.vue +4 -4
- package/src/components/FileUpload/FileUpload.vue +2 -2
- package/src/components/FileUpload/FileUploadContent.vue +1 -1
- package/src/components/FilterInline/FilterInline.mdx +2 -2
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +1 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +2 -2
- package/src/components/FooterBar/FooterBar.vue +7 -7
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +2 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +7 -7
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +2 -2
- package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +87 -8
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +3 -3
- package/src/components/HeaderNavigationBar/HorizontalNavbar/tests/HorizontalNavbar.spec.ts +589 -0
- package/src/components/HeaderToolbar/tests/HeaderToolBar.spec.ts +153 -1
- package/src/components/HeaderToolbar/tests/useMobileRightMenu.spec.ts +258 -0
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +2 -2
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +1 -1
- package/src/components/LunarCalendar/tests/useLunarCalendarRules.spec.ts +184 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthSelector.vue +3 -3
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.vue +1 -1
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +2 -2
- package/src/components/MonthPicker/MonthPickerVisual/YearSelector.vue +1 -1
- package/src/components/NirField/NirField.vue +3 -3
- package/src/components/NotificationBar/Notification/Notification.vue +12 -12
- package/src/components/NotificationBar/NotificationBar.stories.ts +8 -8
- package/src/components/PaginatedTable/Pagination.vue +2 -2
- package/src/components/PasswordField/PasswordField.vue +8 -8
- package/src/components/PasswordField/tests/PasswordField.spec.ts +3 -3
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +2 -2
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +1 -1
- package/src/components/StatusPage/tests/StatusPage.spec.ts +149 -0
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SyAlert/SyAlert.vue +23 -23
- package/src/components/SyTextArea/SyTextArea.stories.ts +177 -131
- package/src/components/SyTextArea/SyTextArea.vue +235 -83
- package/src/components/SyTextArea/composables/useSyTextAreaValidation.ts +81 -0
- package/src/components/SyTextArea/locales.ts +1 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +449 -1
- package/src/components/SyTextArea/useDefaultValidationRules.ts +2 -7
- package/src/components/SyTextArea/validation/Validation.stories.ts +856 -0
- package/src/components/TableToolbar/TableToolbar.vue +6 -6
- package/src/components/TableToolbar/accessibilite/Accessibility.mdx +81 -7
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +163 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +2 -1
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +94 -0
- package/src/components/Tables/SyTable/SyTable.vue +2 -1
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +64 -0
- package/src/components/Tables/common/TableHeader.vue +2 -2
- package/src/components/Tables/common/filters/logics/tests/NumberFilterLogic.spec.ts +176 -0
- package/src/components/Tables/common/filters/logics/tests/SelectFilterLogic.spec.ts +111 -0
- package/src/components/Tables/common/tableStyles.scss +6 -6
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/composables/date/tests/useDateFormatDayjs.spec.ts +31 -0
- package/src/composables/date/tests/useHolidayDay.spec.ts +109 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +374 -0
- package/src/composables/tests/useError.spec.ts +30 -0
- package/src/composables/tests/useFormFieldErrorHandling.spec.ts +234 -0
- package/src/composables/unifyValidation/documentationValidationProps.ts +5 -5
- package/src/composables/unifyValidation/tests/documentationValidationProps.spec.ts +177 -0
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +30 -0
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +6 -2
- package/src/composables/unifyValidation/useCustomValidation.ts +19 -9
- package/src/composables/unifyValidation/useValidation.ts +18 -21
- package/src/composables/useFilterable/useFilterable.spec.ts +42 -0
- package/src/composables/useFilterable/useFilterable.ts +11 -7
- package/src/composables/useFormFieldErrorHandling.ts +2 -2
- package/src/composantsVuetify/VBtn/VBtn.mdx +9 -39
- package/src/composantsVuetify/VBtn/v-btn.stories.ts +26 -86
- package/src/designTokens/tokens/amelipro/apContextual.ts +6 -0
- package/src/designTokens/tokens/amelipro/apDarkTheme.ts +2 -2
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +72 -103
- package/src/designTokens/tokens/amelipro/apSemantic.ts +1 -1
- package/src/designTokens/tokens/baseContextualTokens.ts +1 -6
- package/src/designTokens/tokens/baseTokens.ts +232 -0
- package/src/designTokens/tokens/cnam/cnamContextual.ts +6 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +2 -2
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +76 -104
- package/src/designTokens/tokens/pa/paDarkTheme.ts +2 -2
- package/src/designTokens/tokens/pa/paLightTheme.ts +73 -99
- package/src/designTokens/tokens/pa/paSemantic.ts +2 -0
- package/src/designTokens/tokens/semanticTokens.ts +114 -0
- package/src/stories/Components/Components.stories.ts +7 -3
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +2 -3
- package/src/stories/DesignTokens/Colors.mdx +6 -8
- package/src/stories/DesignTokens/colors.stories.ts +244 -1081
- package/src/utils/amelipro/toKebabCase/tests/toKebabCase.spec.ts +52 -0
- package/src/utils/formatNir/tests/formatNir.spec.ts +34 -0
- package/src/utils/tests/insertAt.spec.ts +44 -0
- package/dist/apLightTheme-DS0Uy44H.js +0 -954
- package/dist/components/RatingPicker/tests/RatingPicker.a11y.spect.d.ts +0 -1
- package/dist/main-BsJ9ec3i.js +0 -38954
- 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/DatePicker/CalendarMode/tests/DatePicker.events.spec.ts +0 -178
- 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/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/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/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/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/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/RatingPicker/tests/{RatingPicker.a11y.spect.ts → RatingPicker.a11y.spec.ts} +0 -0
|
@@ -3,6 +3,7 @@ import { ref } from 'vue'
|
|
|
3
3
|
import SyRadioGroup from '@/components/Customs/SyRadioGroup/SyRadioGroup.vue'
|
|
4
4
|
import SyForm from '../SyForm/SyForm.vue'
|
|
5
5
|
import { VBtn } from 'vuetify/components'
|
|
6
|
+
import { getValidationDocumentation } from '@/composables/unifyValidation/documentationValidationProps'
|
|
6
7
|
|
|
7
8
|
const meta: Meta<typeof SyRadioGroup> = {
|
|
8
9
|
title: 'Composants/Formulaires/SyRadioGroup',
|
|
@@ -24,21 +25,49 @@ Il permet de choisir **une seule valeur** parmi une liste d’options.
|
|
|
24
25
|
},
|
|
25
26
|
},
|
|
26
27
|
argTypes: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
...getValidationDocumentation(),
|
|
29
|
+
modelValue: { control: false },
|
|
30
|
+
label: {
|
|
31
|
+
description: 'Label du groupe',
|
|
32
|
+
control: 'text',
|
|
33
|
+
},
|
|
34
|
+
options: {
|
|
35
|
+
description: 'Liste des options du radio-group',
|
|
36
|
+
control: 'object',
|
|
37
|
+
},
|
|
38
|
+
color: {
|
|
36
39
|
control: 'select',
|
|
37
40
|
options: ['primary', 'secondary', 'success', 'error', 'warning'],
|
|
41
|
+
description: 'Couleur du groupe',
|
|
38
42
|
},
|
|
39
|
-
|
|
43
|
+
density: {
|
|
40
44
|
control: 'select',
|
|
41
45
|
options: ['default', 'comfortable', 'compact'],
|
|
46
|
+
description: 'Densité du groupe',
|
|
47
|
+
},
|
|
48
|
+
displayAsterisk: {
|
|
49
|
+
description: 'Affiche un astérisque pour les champs requis',
|
|
50
|
+
control: 'boolean',
|
|
51
|
+
},
|
|
52
|
+
helpText: {
|
|
53
|
+
description: 'Texte d\'aide affiché sous le champ',
|
|
54
|
+
control: 'text',
|
|
55
|
+
},
|
|
56
|
+
ariaLabel: {
|
|
57
|
+
description: 'Label ARIA pour les lecteurs d\'écran',
|
|
58
|
+
control: 'text',
|
|
59
|
+
},
|
|
60
|
+
ariaLabelledby: {
|
|
61
|
+
description: 'ID d\'un élément qui labelise le groupe',
|
|
62
|
+
control: 'text',
|
|
63
|
+
},
|
|
64
|
+
title: {
|
|
65
|
+
description: 'Attribut title du groupe',
|
|
66
|
+
control: 'text',
|
|
67
|
+
},
|
|
68
|
+
name: {
|
|
69
|
+
description: 'Nom du groupe (attribut name)',
|
|
70
|
+
control: 'text',
|
|
42
71
|
},
|
|
43
72
|
},
|
|
44
73
|
}
|
|
@@ -165,127 +194,67 @@ export const Required: Story = {
|
|
|
165
194
|
},
|
|
166
195
|
}
|
|
167
196
|
|
|
168
|
-
export const
|
|
197
|
+
export const RequiredWithAsterisk: Story = {
|
|
169
198
|
args: {
|
|
170
|
-
label: '
|
|
199
|
+
label: 'Champ obligatoire',
|
|
171
200
|
required: true,
|
|
201
|
+
displayAsterisk: true,
|
|
172
202
|
options: [
|
|
173
203
|
{ label: 'Option A', value: 'a' },
|
|
174
204
|
{ label: 'Option B', value: 'b' },
|
|
175
205
|
],
|
|
176
|
-
showSuccessMessages: true,
|
|
177
206
|
},
|
|
178
207
|
|
|
179
|
-
render: args => ({
|
|
180
|
-
components: { SyRadioGroup, SyForm, VBtn },
|
|
181
|
-
setup() {
|
|
182
|
-
const selected = ref(null)
|
|
183
|
-
const onSubmit = (event: { isValid: boolean }) => {
|
|
184
|
-
if (event.isValid) {
|
|
185
|
-
alert('Inscription réussie !')
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return { args, selected, onSubmit }
|
|
189
|
-
},
|
|
190
|
-
template: `
|
|
191
|
-
<SyForm ref="form" @submit="onSubmit">
|
|
192
|
-
<SyRadioGroup v-model="selected" required v-bind="args" />
|
|
193
|
-
<v-btn type="submit" class="mt-2 mr-2" color="primary">Valider</v-btn>
|
|
194
|
-
</SyForm>
|
|
195
|
-
`,
|
|
196
|
-
}),
|
|
197
208
|
parameters: {
|
|
198
|
-
|
|
199
|
-
{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
v-model="selected"
|
|
205
|
-
label="Choisissez une option (obligatoire)"
|
|
206
|
-
:options="options"
|
|
207
|
-
required
|
|
208
|
-
/>
|
|
209
|
-
<VBtn type="submit" class="mt-2 mr-2" color="primary">Valider</VBtn>
|
|
210
|
-
</SyForm>`,
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
name: 'Script',
|
|
214
|
-
code: `
|
|
215
|
-
<script setup lang="ts">
|
|
216
|
-
import { ref } from 'vue'
|
|
217
|
-
import { VBtn } from 'vuetify/components'
|
|
218
|
-
import { SyForm, SyRadioGroup } from '@cnamts/synapse'
|
|
219
|
-
|
|
220
|
-
const selected = ref<string | null>(null)
|
|
221
|
-
|
|
222
|
-
const options = [
|
|
223
|
-
{ label: 'Option A', value: 'a' },
|
|
224
|
-
{ label: 'Option B', value: 'b' },
|
|
225
|
-
]
|
|
226
|
-
|
|
227
|
-
const onSubmit = (event: { isValid: boolean }) => {
|
|
228
|
-
if (event.isValid) {
|
|
229
|
-
alert('Formulaire valide !')
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
</script>
|
|
233
|
-
`,
|
|
209
|
+
docs: {
|
|
210
|
+
description: {
|
|
211
|
+
story: `
|
|
212
|
+
### Affichage de l'astérisque
|
|
213
|
+
Ce story démontre l'affichage d'un astérisque (*) sur le label pour indiquer qu'un champ est obligatoire.
|
|
214
|
+
`,
|
|
234
215
|
},
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export const Disabled: Story = {
|
|
240
|
-
parameters: {
|
|
216
|
+
},
|
|
241
217
|
sourceCode: [
|
|
242
218
|
{
|
|
243
219
|
name: 'Template',
|
|
244
220
|
code: `
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
221
|
+
<SyRadioGroup
|
|
222
|
+
v-model="selected"
|
|
223
|
+
label="Champ obligatoire"
|
|
224
|
+
:options="options"
|
|
225
|
+
required
|
|
226
|
+
display-asterisk
|
|
227
|
+
/>`,
|
|
252
228
|
},
|
|
253
229
|
{
|
|
254
230
|
name: 'Script',
|
|
255
|
-
code:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
import { SyRadioGroup } from '@cnamts/synapse'
|
|
231
|
+
code: `<script setup lang="ts">
|
|
232
|
+
import { ref } from 'vue'
|
|
233
|
+
import { SyRadioGroup } from '@cnamts/synapse'
|
|
259
234
|
|
|
260
|
-
|
|
235
|
+
const selected = ref<string | null>(null)
|
|
261
236
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
`,
|
|
237
|
+
const options = [
|
|
238
|
+
{ label: 'Option A', value: 'a' },
|
|
239
|
+
{ label: 'Option B', value: 'b' },
|
|
240
|
+
]
|
|
241
|
+
</script>`,
|
|
268
242
|
},
|
|
269
243
|
],
|
|
270
244
|
},
|
|
271
|
-
args: {
|
|
272
|
-
label: 'Radio-group désactivé',
|
|
273
|
-
disabled: true,
|
|
274
|
-
options: [
|
|
275
|
-
{ label: 'Option A', value: 'a' },
|
|
276
|
-
{ label: 'Option B', value: 'b' },
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
245
|
|
|
280
246
|
render: args => ({
|
|
281
247
|
components: { SyRadioGroup },
|
|
282
248
|
setup() {
|
|
283
|
-
const selected = ref(
|
|
249
|
+
const selected = ref<string | null>(null)
|
|
284
250
|
return { args, selected }
|
|
285
251
|
},
|
|
286
252
|
template: `
|
|
287
|
-
|
|
288
|
-
|
|
253
|
+
<SyRadioGroup
|
|
254
|
+
v-model="selected"
|
|
255
|
+
v-bind="args"
|
|
256
|
+
/>
|
|
257
|
+
`,
|
|
289
258
|
}),
|
|
290
259
|
}
|
|
291
260
|
|
|
@@ -312,7 +281,7 @@ export const CustomColors: Story = {
|
|
|
312
281
|
/>
|
|
313
282
|
<SyRadioGroup
|
|
314
283
|
v-model="value3"
|
|
315
|
-
color="
|
|
284
|
+
color="onSuccessVariant"
|
|
316
285
|
label="Couleur succès"
|
|
317
286
|
:options="[{label:'Value 1',value:'a'},{label:'Value 2',value:'b'}]"
|
|
318
287
|
:show-success-messages="false"
|
|
@@ -326,7 +295,7 @@ export const CustomColors: Story = {
|
|
|
326
295
|
/>
|
|
327
296
|
<SyRadioGroup
|
|
328
297
|
v-model="value5"
|
|
329
|
-
color="
|
|
298
|
+
color="onWarningVariant"
|
|
330
299
|
label="Couleur avertissement"
|
|
331
300
|
:options="[{label:'Value 1',value:'a'},{label:'Value 2',value:'b'}]"
|
|
332
301
|
:show-success-messages="false"
|
|
@@ -370,36 +339,36 @@ Le composant SyRadioGroup peut être personnalisé avec différentes couleurs po
|
|
|
370
339
|
template: `
|
|
371
340
|
<div>
|
|
372
341
|
<SyRadioGroup
|
|
373
|
-
v-model="value1"
|
|
374
|
-
color="primary"
|
|
342
|
+
v-model="value1"
|
|
343
|
+
color="primary"
|
|
375
344
|
label="Couleur primaire (par défaut)"
|
|
376
345
|
:options="[{label:'Value 1',value:'a'},{label:'Value 2',value:'b'}]"
|
|
377
346
|
:show-success-messages="false"
|
|
378
347
|
/>
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
348
|
+
<SyRadioGroup
|
|
349
|
+
v-model="value2"
|
|
350
|
+
color="secondary"
|
|
382
351
|
label="Couleur secondaire"
|
|
383
352
|
:options="[{label:'Value 1',value:'a'},{label:'Value 2',value:'b'}]"
|
|
384
353
|
:show-success-messages="false"
|
|
385
354
|
/>
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
355
|
+
<SyRadioGroup
|
|
356
|
+
v-model="value3"
|
|
357
|
+
color="onSuccessVariant"
|
|
389
358
|
label="Couleur succès"
|
|
390
359
|
:options="[{label:'Value 1',value:'a'},{label:'Value 2',value:'b'}]"
|
|
391
360
|
:show-success-messages="false"
|
|
392
361
|
/>
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
362
|
+
<SyRadioGroup
|
|
363
|
+
v-model="value4"
|
|
364
|
+
color="error"
|
|
396
365
|
label="Couleur erreur"
|
|
397
366
|
:options="[{label:'Value 1',value:'a'},{label:'Value 2',value:'b'}]"
|
|
398
367
|
:show-success-messages="false"
|
|
399
368
|
/>
|
|
400
|
-
<SyRadioGroup
|
|
401
|
-
v-model="value5"
|
|
402
|
-
color="
|
|
369
|
+
<SyRadioGroup
|
|
370
|
+
v-model="value5"
|
|
371
|
+
color="onWarningVariant"
|
|
403
372
|
label="Couleur avertissement"
|
|
404
373
|
:options="[{label:'Value 1',value:'a'},{label:'Value 2',value:'b'}]"
|
|
405
374
|
:show-success-messages="false"
|
|
@@ -496,6 +465,160 @@ Le composant SyRadioGroup prend en charge différentes densités pour s'adapter
|
|
|
496
465
|
}),
|
|
497
466
|
}
|
|
498
467
|
|
|
468
|
+
export const Disabled: Story = {
|
|
469
|
+
parameters: {
|
|
470
|
+
sourceCode: [
|
|
471
|
+
{
|
|
472
|
+
name: 'Template',
|
|
473
|
+
code: `
|
|
474
|
+
<SyRadioGroup
|
|
475
|
+
v-model="selected"
|
|
476
|
+
disabled
|
|
477
|
+
label="Radio-group désactivé"
|
|
478
|
+
:options="options"
|
|
479
|
+
/>
|
|
480
|
+
`,
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
name: 'Script',
|
|
484
|
+
code: `
|
|
485
|
+
<script setup lang="ts">
|
|
486
|
+
import { ref } from 'vue'
|
|
487
|
+
import { SyRadioGroup } from '@cnamts/synapse'
|
|
488
|
+
|
|
489
|
+
const selected = ref('a')
|
|
490
|
+
|
|
491
|
+
const options = [
|
|
492
|
+
{ label: 'Option A', value: 'a' },
|
|
493
|
+
{ label: 'Option B', value: 'b' },
|
|
494
|
+
]
|
|
495
|
+
</script>
|
|
496
|
+
`,
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
},
|
|
500
|
+
args: {
|
|
501
|
+
label: 'Radio-group désactivé',
|
|
502
|
+
disabled: true,
|
|
503
|
+
options: [
|
|
504
|
+
{ label: 'Option A', value: 'a' },
|
|
505
|
+
{ label: 'Option B', value: 'b' },
|
|
506
|
+
],
|
|
507
|
+
},
|
|
508
|
+
|
|
509
|
+
render: args => ({
|
|
510
|
+
components: { SyRadioGroup },
|
|
511
|
+
setup() {
|
|
512
|
+
const selected = ref('a')
|
|
513
|
+
return { args, selected }
|
|
514
|
+
},
|
|
515
|
+
template: `
|
|
516
|
+
<SyRadioGroup v-model="selected" v-bind="args" />
|
|
517
|
+
`,
|
|
518
|
+
}),
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export const EventShowcase: Story = {
|
|
522
|
+
parameters: {
|
|
523
|
+
docs: {
|
|
524
|
+
description: {
|
|
525
|
+
story: `
|
|
526
|
+
### Événements
|
|
527
|
+
Ce story démontre les événements émis par le composant :
|
|
528
|
+
- **update:modelValue** : Émis lorsque la valeur change
|
|
529
|
+
- **change** : Émis lorsque la sélection change
|
|
530
|
+
`,
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
sourceCode: [
|
|
534
|
+
{
|
|
535
|
+
name: 'Template',
|
|
536
|
+
code: `
|
|
537
|
+
<template>
|
|
538
|
+
<div>
|
|
539
|
+
<SyRadioGroup
|
|
540
|
+
v-model="selected"
|
|
541
|
+
label="Sélectionnez une option"
|
|
542
|
+
:options="options"
|
|
543
|
+
@update:model-value="onUpdate"
|
|
544
|
+
@change="onChange"
|
|
545
|
+
/>
|
|
546
|
+
<div class="mt-4">
|
|
547
|
+
<p>Valeur sélectionnée : {{ selected }}</p>
|
|
548
|
+
<p>Dernier événement : {{ lastEvent }}</p>
|
|
549
|
+
</div>
|
|
550
|
+
</div>
|
|
551
|
+
</template>`,
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: 'Script',
|
|
555
|
+
code: `<script setup lang="ts">
|
|
556
|
+
import { ref } from 'vue'
|
|
557
|
+
import { SyRadioGroup } from '@cnamts/synapse'
|
|
558
|
+
|
|
559
|
+
const selected = ref<string | null>(null)
|
|
560
|
+
const lastEvent = ref('')
|
|
561
|
+
|
|
562
|
+
const options = [
|
|
563
|
+
{ label: 'Option A', value: 'a' },
|
|
564
|
+
{ label: 'Option B', value: 'b' },
|
|
565
|
+
{ label: 'Option C', value: 'c' },
|
|
566
|
+
]
|
|
567
|
+
|
|
568
|
+
const onUpdate = (value: string | null) => {
|
|
569
|
+
lastEvent.value = \`update:modelValue: \${value}\`
|
|
570
|
+
console.log('update:modelValue', value)
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
const onChange = (value: string | null) => {
|
|
574
|
+
lastEvent.value = \`change: \${value}\`
|
|
575
|
+
console.log('change', value)
|
|
576
|
+
}
|
|
577
|
+
</script>`,
|
|
578
|
+
},
|
|
579
|
+
],
|
|
580
|
+
},
|
|
581
|
+
|
|
582
|
+
render: args => ({
|
|
583
|
+
components: { SyRadioGroup },
|
|
584
|
+
setup() {
|
|
585
|
+
const selected = ref<string | null>(null)
|
|
586
|
+
const lastEvent = ref('Aucun événement')
|
|
587
|
+
|
|
588
|
+
const options = [
|
|
589
|
+
{ label: 'Option A', value: 'a' },
|
|
590
|
+
{ label: 'Option B', value: 'b' },
|
|
591
|
+
{ label: 'Option C', value: 'c' },
|
|
592
|
+
]
|
|
593
|
+
|
|
594
|
+
const onUpdate = (value: string | null) => {
|
|
595
|
+
lastEvent.value = `update:modelValue: ${value}`
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
const onChange = (value: string | null) => {
|
|
599
|
+
lastEvent.value = `change: ${value}`
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
return { args, selected, options, lastEvent, onUpdate, onChange }
|
|
603
|
+
},
|
|
604
|
+
template: `
|
|
605
|
+
<div>
|
|
606
|
+
<SyRadioGroup
|
|
607
|
+
v-model="selected"
|
|
608
|
+
label="Sélectionnez une option"
|
|
609
|
+
:options="options"
|
|
610
|
+
@update:model-value="onUpdate"
|
|
611
|
+
@change="onChange"
|
|
612
|
+
/>
|
|
613
|
+
<div class="mt-4 pa-4 bg-grey-lighten-4 rounded">
|
|
614
|
+
<p><strong>Valeur sélectionnée :</strong> {{ selected || 'Aucune' }}</p>
|
|
615
|
+
<p><strong>Dernier événement :</strong> {{ lastEvent }}</p>
|
|
616
|
+
</div>
|
|
617
|
+
</div>
|
|
618
|
+
`,
|
|
619
|
+
}),
|
|
620
|
+
}
|
|
621
|
+
|
|
499
622
|
export const Readonly: Story = {
|
|
500
623
|
args: {
|
|
501
624
|
readonly: true,
|
|
@@ -550,116 +673,188 @@ Ce button radio est en lecture seule et ne peut pas être modifiée par l'utilis
|
|
|
550
673
|
|
|
551
674
|
}
|
|
552
675
|
|
|
553
|
-
export const
|
|
676
|
+
export const HideDetails: Story = {
|
|
554
677
|
parameters: {
|
|
678
|
+
docs: {
|
|
679
|
+
description: {
|
|
680
|
+
story: `
|
|
681
|
+
### hideDetails
|
|
682
|
+
Contrôle l'affichage de la zone de messages sous le champ.
|
|
683
|
+
|
|
684
|
+
| Valeur | Comportement |
|
|
685
|
+
|--------|-------------|
|
|
686
|
+
| \`'auto'\` (défaut) | Zone affichée uniquement si un message est présent |
|
|
687
|
+
| \`false\` | Zone toujours affichée (espace réservé même sans message) |
|
|
688
|
+
| \`true\` | Zone toujours masquée |
|
|
689
|
+
`,
|
|
690
|
+
},
|
|
691
|
+
},
|
|
555
692
|
sourceCode: [
|
|
556
693
|
{
|
|
557
694
|
name: 'Template',
|
|
558
695
|
code: `
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
696
|
+
<template>
|
|
697
|
+
<SyForm @submit="onSubmit">
|
|
698
|
+
<p>hide-details="auto" (défaut)</p>
|
|
699
|
+
<SyRadioGroup v-model="selected" label="Option" :options="options" required hide-details="auto" />
|
|
700
|
+
|
|
701
|
+
<p>:hide-details="false" (espace toujours réservé)</p>
|
|
702
|
+
<SyRadioGroup v-model="selected" label="Option" :options="options" required :hide-details="false" />
|
|
703
|
+
|
|
704
|
+
<p>:hide-details="true" (messages jamais affichés)</p>
|
|
705
|
+
<SyRadioGroup v-model="selected" label="Option" :options="options" required :hide-details="true" />
|
|
706
|
+
|
|
707
|
+
<VBtn type="submit" color="primary" class="mt-4">Valider</VBtn>
|
|
708
|
+
</SyForm>
|
|
709
|
+
</template>`,
|
|
569
710
|
},
|
|
570
711
|
{
|
|
571
712
|
name: 'Script',
|
|
572
713
|
code: `<script setup lang="ts">
|
|
573
714
|
import { ref } from 'vue'
|
|
574
|
-
import { SyRadioGroup } from '@cnamts/synapse'
|
|
575
|
-
|
|
576
|
-
const selected = ref('A')
|
|
715
|
+
import { SyRadioGroup, SyForm } from '@cnamts/synapse'
|
|
716
|
+
import { VBtn } from 'vuetify/components'
|
|
577
717
|
|
|
718
|
+
const selected = ref<string | null>(null)
|
|
578
719
|
const options = [
|
|
579
|
-
{ label: 'Option A', value: '
|
|
580
|
-
{ label: 'Option B', value: '
|
|
720
|
+
{ label: 'Option A', value: 'a' },
|
|
721
|
+
{ label: 'Option B', value: 'b' },
|
|
581
722
|
]
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
options: {
|
|
587
|
-
validate: (value: string | null) => {
|
|
588
|
-
if (value !== 'A') {
|
|
589
|
-
return 'Vous devez sélectionner l’option A'
|
|
590
|
-
}
|
|
591
|
-
return true
|
|
723
|
+
const onSubmit = (event: { isValid: boolean }) => {
|
|
724
|
+
if (event.isValid) alert('Formulaire valide !')
|
|
725
|
+
}
|
|
726
|
+
</script>`,
|
|
592
727
|
},
|
|
593
|
-
|
|
594
|
-
},
|
|
728
|
+
],
|
|
595
729
|
},
|
|
596
|
-
]
|
|
597
730
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
731
|
+
render: () => ({
|
|
732
|
+
components: { SyRadioGroup, SyForm, VBtn },
|
|
733
|
+
setup() {
|
|
734
|
+
const selected = ref<string | null>(null)
|
|
735
|
+
const options = [
|
|
736
|
+
{ label: 'Option A', value: 'a' },
|
|
737
|
+
{ label: 'Option B', value: 'b' },
|
|
738
|
+
]
|
|
739
|
+
const onSubmit = (event: { isValid: boolean }) => {
|
|
740
|
+
if (event.isValid) alert('Formulaire valide !')
|
|
741
|
+
}
|
|
742
|
+
return { selected, options, onSubmit }
|
|
605
743
|
},
|
|
606
|
-
|
|
744
|
+
template: `
|
|
745
|
+
<SyForm @submit="onSubmit">
|
|
746
|
+
<p class="mb-1 text-body-2">hide-details="auto" (défaut)</p>
|
|
747
|
+
<SyRadioGroup v-model="selected" label="Choisissez une option" :options="options" required hide-details="auto" />
|
|
748
|
+
|
|
749
|
+
<p class="mt-4 mb-1 text-body-2">:hide-details="false" (espace toujours réservé)</p>
|
|
750
|
+
<SyRadioGroup v-model="selected" label="Choisissez une option" :options="options" required :hide-details="false" />
|
|
751
|
+
|
|
752
|
+
<p class="mt-4 mb-1 text-body-2">:hide-details="true" (messages jamais affichés)</p>
|
|
753
|
+
<SyRadioGroup v-model="selected" label="Choisissez une option" :options="options" required :hide-details="true" />
|
|
754
|
+
|
|
755
|
+
<VBtn type="submit" class="mt-6" color="primary">Valider</VBtn>
|
|
756
|
+
</SyForm>
|
|
757
|
+
`,
|
|
758
|
+
}),
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
export const HelpText: Story = {
|
|
762
|
+
parameters: {
|
|
763
|
+
docs: {
|
|
764
|
+
description: {
|
|
765
|
+
story: `
|
|
766
|
+
### helpText
|
|
767
|
+
Texte d'aide contextuel affiché sous le champ.
|
|
768
|
+
|
|
769
|
+
**Comportement :**
|
|
770
|
+
- Sans message de validation → affiché **à la place du message**
|
|
771
|
+
- Avec message (erreur/warning/succès) → affiché **en dessous** du message
|
|
772
|
+
`,
|
|
773
|
+
},
|
|
774
|
+
},
|
|
775
|
+
sourceCode: [
|
|
776
|
+
{
|
|
777
|
+
name: 'Template',
|
|
778
|
+
code: `
|
|
779
|
+
<template>
|
|
780
|
+
<SyForm @submit="onSubmit">
|
|
781
|
+
<p>Sans erreur : helpText affiché à la place du message</p>
|
|
782
|
+
<SyRadioGroup
|
|
783
|
+
v-model="selected"
|
|
784
|
+
label="Choisissez une option"
|
|
785
|
+
:options="options"
|
|
786
|
+
help-text="Sélectionnez l'option qui correspond à votre situation."
|
|
787
|
+
/>
|
|
788
|
+
|
|
789
|
+
<p>Avec erreur (required + soumis vide) : helpText affiché en dessous</p>
|
|
790
|
+
<SyRadioGroup
|
|
791
|
+
v-model="selectedWithError"
|
|
792
|
+
label="Choisissez une option"
|
|
793
|
+
:options="options"
|
|
794
|
+
help-text="Sélectionnez l'option qui correspond à votre situation."
|
|
795
|
+
required
|
|
796
|
+
/>
|
|
797
|
+
|
|
798
|
+
<VBtn type="submit" color="primary" class="mt-6">Valider</VBtn>
|
|
799
|
+
</SyForm>
|
|
800
|
+
</template>`,
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: 'Script',
|
|
804
|
+
code: `<script setup lang="ts">
|
|
805
|
+
import { ref } from 'vue'
|
|
806
|
+
import { SyRadioGroup, SyForm } from '@cnamts/synapse'
|
|
807
|
+
import { VBtn } from 'vuetify/components'
|
|
808
|
+
|
|
809
|
+
const selected = ref<string | null>(null)
|
|
810
|
+
const selectedWithError = ref<string | null>(null)
|
|
811
|
+
const options = [
|
|
812
|
+
{ label: 'Option A', value: 'a' },
|
|
813
|
+
{ label: 'Option B', value: 'b' },
|
|
607
814
|
]
|
|
815
|
+
const onSubmit = (event: { isValid: boolean }) => {
|
|
816
|
+
if (event.isValid) alert('Formulaire valide !')
|
|
817
|
+
}
|
|
608
818
|
</script>`,
|
|
609
819
|
},
|
|
610
820
|
],
|
|
611
821
|
},
|
|
612
822
|
|
|
613
|
-
render:
|
|
614
|
-
components: { SyRadioGroup },
|
|
823
|
+
render: () => ({
|
|
824
|
+
components: { SyRadioGroup, SyForm, VBtn },
|
|
615
825
|
setup() {
|
|
616
|
-
const selected = ref(
|
|
617
|
-
|
|
826
|
+
const selected = ref<string | null>(null)
|
|
827
|
+
const selectedWithError = ref<string | null>(null)
|
|
618
828
|
const options = [
|
|
619
|
-
{ label: 'Option A', value: '
|
|
620
|
-
{ label: 'Option B', value: '
|
|
829
|
+
{ label: 'Option A', value: 'a' },
|
|
830
|
+
{ label: 'Option B', value: 'b' },
|
|
621
831
|
]
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
{
|
|
625
|
-
type: 'custom',
|
|
626
|
-
options: {
|
|
627
|
-
validate: (value: string | null) => {
|
|
628
|
-
if (value !== 'A') {
|
|
629
|
-
return 'Vous devez sélectionner l’option A'
|
|
630
|
-
}
|
|
631
|
-
return true
|
|
632
|
-
},
|
|
633
|
-
},
|
|
634
|
-
},
|
|
635
|
-
]
|
|
636
|
-
|
|
637
|
-
const successRules = [
|
|
638
|
-
{
|
|
639
|
-
type: 'custom',
|
|
640
|
-
options: {
|
|
641
|
-
validate: (value: string | null) => value === 'A',
|
|
642
|
-
successMessage: 'Option A sélectionnée',
|
|
643
|
-
},
|
|
644
|
-
},
|
|
645
|
-
]
|
|
646
|
-
return {
|
|
647
|
-
args,
|
|
648
|
-
selected,
|
|
649
|
-
options,
|
|
650
|
-
warningRules,
|
|
651
|
-
successRules,
|
|
832
|
+
const onSubmit = (event: { isValid: boolean }) => {
|
|
833
|
+
if (event.isValid) alert('Formulaire valide !')
|
|
652
834
|
}
|
|
835
|
+
return { selected, selectedWithError, options, onSubmit }
|
|
653
836
|
},
|
|
654
837
|
template: `
|
|
655
|
-
<
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
838
|
+
<SyForm @submit="onSubmit">
|
|
839
|
+
<p class="mb-1 text-body-2">Sans erreur : helpText affiché à la place du message</p>
|
|
840
|
+
<SyRadioGroup
|
|
841
|
+
v-model="selected"
|
|
842
|
+
label="Choisissez une option"
|
|
843
|
+
:options="options"
|
|
844
|
+
help-text="Sélectionnez l'option qui correspond à votre situation."
|
|
845
|
+
/>
|
|
846
|
+
|
|
847
|
+
<p class="mt-6 mb-1 text-body-2">Avec erreur (required + soumis vide) : helpText affiché en dessous</p>
|
|
848
|
+
<SyRadioGroup
|
|
849
|
+
v-model="selectedWithError"
|
|
850
|
+
label="Choisissez une option"
|
|
851
|
+
:options="options"
|
|
852
|
+
help-text="Sélectionnez l'option qui correspond à votre situation."
|
|
853
|
+
required
|
|
854
|
+
/>
|
|
855
|
+
|
|
856
|
+
<VBtn type="submit" class="mt-6" color="primary">Valider</VBtn>
|
|
857
|
+
</SyForm>
|
|
858
|
+
`,
|
|
664
859
|
}),
|
|
665
860
|
}
|