@cnamts/synapse 1.0.27 → 1.1.0
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 +1 -1
- package/dist/{AutocompleteFilter-C9eLKyW8.js → AutocompleteFilter-DXd4szWO.js} +3 -3
- package/dist/{DateFilter-y-GLkAkn.js → DateFilter-BD59Kgwf.js} +8 -8
- package/dist/{NumberFilter-DN6hIBS7.js → NumberFilter-BSMZE7uw.js} +1 -1
- package/dist/{PeriodFilter-MoUUp9qS.js → PeriodFilter-keUdSSk0.js} +1 -1
- package/dist/{SelectFilter-bCbrdLmu.js → SelectFilter-Dhvvwazl.js} +1 -1
- package/dist/{TextFilter-CvjgEaoM.js → TextFilter-CU8FpXz0.js} +4 -4
- package/dist/{apLightTheme2026-ug4Y23ns.js → apLightTheme2026-DbS7BPUf.js} +12 -11
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +6 -6
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +4 -4
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +2 -2
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +85 -313
- package/dist/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.d.ts +2 -2
- package/dist/components/Customs/Selects/SyInputSelect/SyInputSelect.d.ts +1 -1
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +9 -11
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectValidation.d.ts +7 -7
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +3 -3
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +5 -5
- package/dist/components/Customs/SyIcon/SyIcon.d.ts +77 -1
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +10 -10
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +19 -79
- package/dist/components/Customs/SyTextField/locales.d.ts +7 -0
- package/dist/components/Customs/SyTextField/types.d.ts +67 -4
- package/dist/components/Customs/SyTextField/useNumberField.d.ts +23 -0
- package/dist/components/Customs/SyTextField/useSyTextFieldValidation.d.ts +38 -0
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +170 -622
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +85 -311
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +39 -152
- package/dist/components/FilterInline/FilterInline.d.ts +3 -3
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +4 -4
- package/dist/components/MonthPicker/MonthPicker.d.ts +37 -150
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +37 -150
- package/dist/components/NirField/NirField.d.ts +90 -321
- package/dist/components/NirField/useNirValidation.d.ts +10 -20
- package/dist/components/PasswordField/PasswordField.d.ts +20 -39
- package/dist/components/PasswordField/locales.d.ts +2 -0
- package/dist/components/PasswordField/types.d.ts +16 -0
- package/dist/components/PasswordField/usePasswordFieldValidation.d.ts +38 -0
- package/dist/components/PeriodField/PeriodField.d.ts +349 -1253
- package/dist/components/PhoneField/PhoneField.d.ts +37 -150
- package/dist/components/SearchListField/SearchListField.d.ts +3 -3
- package/dist/components/SyTextArea/SyTextArea.d.ts +14 -11
- package/dist/components/SyTextArea/composables/useSyTextAreaValidation.d.ts +7 -7
- package/dist/components/Tables/common/SyTablePagination.d.ts +19 -20
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +1 -1
- package/dist/composables/unifyValidation/useValidation.d.ts +1 -9
- package/dist/composables/useFilterable/useFilterable.d.ts +1 -2
- package/dist/design-system-v3.js +19 -19
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +1 -0
- package/dist/designTokens/tokens/pa/paLightTheme.d.ts +1 -0
- package/dist/{main-CI6Q9nmO.js → main-D8ryUoS5.js} +13605 -13358
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +27 -25
- package/package.json +6 -5
- package/src/components/Accordion/tests/Accordion.visual.cy.ts +44 -0
- package/src/components/Accordion/tests/__snapshots__/accordion-default.snap.png +0 -0
- package/src/components/Accordion/tests/__snapshots__/accordion-disabled-item.snap.png +0 -0
- package/src/components/Accordion/tests/__snapshots__/accordion-open-first.snap.png +0 -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/BackToTopBtn/tests/BackToTopBtn.visual.cy.ts +34 -0
- package/src/components/BackToTopBtn/tests/__snapshots__/back-to-top-btn-custom-nudge.snap.png +0 -0
- package/src/components/BackToTopBtn/tests/__snapshots__/back-to-top-btn-default.snap.png +0 -0
- package/src/components/Captcha/tests/Captcha.visual.cy.ts +45 -0
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +4 -0
- package/src/components/Captcha/tests/__snapshots__/captcha-audio-type.snap.png +0 -0
- package/src/components/Captcha/tests/__snapshots__/captcha-image-type.snap.png +0 -0
- package/src/components/Captcha/tests/__snapshots__/captcha-no-helpdesk.snap.png +0 -0
- package/src/components/ChipList/tests/ChipList.visual.cy.ts +46 -0
- package/src/components/ChipList/tests/__snapshots__/chip-list-default.snap.png +0 -0
- package/src/components/ChipList/tests/__snapshots__/chip-list-readonly.snap.png +0 -0
- package/src/components/ChipList/tests/__snapshots__/chip-list-state-icons.snap.png +0 -0
- package/src/components/CollapsibleList/tests/CollapsibleList.visual.cy.ts +33 -0
- package/src/components/CollapsibleList/tests/__snapshots__/collapsible-list-default.snap.png +0 -0
- package/src/components/CollapsibleList/tests/__snapshots__/collapsible-list-no-title.snap.png +0 -0
- package/src/components/ContextualMenu/tests/ContextualMenu.visual.cy.ts +35 -0
- package/src/components/ContextualMenu/tests/__snapshots__/contextual-menu-default.snap.png +0 -0
- package/src/components/ContextualMenu/tests/__snapshots__/contextual-menu-selected.snap.png +0 -0
- package/src/components/CookieBanner/tests/CookieBanner.visual.cy.ts +29 -0
- package/src/components/CookieBanner/tests/__snapshots__/cookie-banner-default.snap.png +0 -0
- package/src/components/CookieBanner/tests/__snapshots__/cookie-banner-with-items.snap.png +0 -0
- package/src/components/CookiesSelection/tests/CookiesSelection.visual.cy.ts +21 -0
- package/src/components/CookiesSelection/tests/__snapshots__/cookies-selection-default.snap.png +0 -0
- package/src/components/CopyBtn/tests/CopyBtn.visual.cy.ts +24 -0
- package/src/components/CopyBtn/tests/__snapshots__/copy-btn-default.snap.png +0 -0
- package/src/components/CopyBtn/tests/__snapshots__/copy-btn-no-tooltip.snap.png +0 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.visual.cy.ts +60 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/__snapshots__/select-btn-field-default.snap.png +0 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/__snapshots__/select-btn-field-inline.snap.png +0 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/__snapshots__/select-btn-field-readonly.snap.png +0 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/__snapshots__/select-btn-field-selected.snap.png +0 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +1 -1
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +2 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.visual.cy.ts +63 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/__snapshots__/sy-autocomplete-default.snap.png +0 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/__snapshots__/sy-autocomplete-loading.snap.png +0 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/__snapshots__/sy-autocomplete-multiple.snap.png +0 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/__snapshots__/sy-autocomplete-with-value.snap.png +0 -0
- package/src/components/Customs/Selects/SyAutocomplete/validation/Validation.stories.ts +0 -93
- package/src/components/Customs/Selects/SyInputSelect/tests/SyInputSelect.visual.cy.ts +48 -0
- package/src/components/Customs/Selects/SyInputSelect/tests/__snapshots__/sy-input-select-default.snap.png +0 -0
- package/src/components/Customs/Selects/SyInputSelect/tests/__snapshots__/sy-input-select-required.snap.png +0 -0
- package/src/components/Customs/Selects/SyInputSelect/tests/__snapshots__/sy-input-select-with-value.snap.png +0 -0
- package/src/components/Customs/Selects/SySelect/SySelect.vue +22 -47
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +3 -3
- package/src/components/Customs/Selects/SySelect/tests/SySelect.visual.cy.ts +77 -0
- package/src/components/Customs/Selects/SySelect/tests/__snapshots__/sy-select-clearable.snap.png +0 -0
- package/src/components/Customs/Selects/SySelect/tests/__snapshots__/sy-select-default.snap.png +0 -0
- package/src/components/Customs/Selects/SySelect/tests/__snapshots__/sy-select-multiple-chips.snap.png +0 -0
- package/src/components/Customs/Selects/SySelect/tests/__snapshots__/sy-select-required.snap.png +0 -0
- package/src/components/Customs/Selects/SySelect/tests/__snapshots__/sy-select-with-value.snap.png +0 -0
- package/src/components/Customs/Selects/SySelect/validation/Validation.stories.ts +1 -92
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +1 -1
- package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.visual.cy.ts +55 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/__snapshots__/sy-checkbox-group-default.snap.png +0 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/__snapshots__/sy-checkbox-group-disabled.snap.png +0 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/__snapshots__/sy-checkbox-group-selected.snap.png +0 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/__snapshots__/sy-checkbox-group-with-label.snap.png +0 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +1 -9
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.visual.cy.ts +61 -0
- package/src/components/Customs/SyCheckbox/tests/__snapshots__/sy-checkbox-checked.snap.png +0 -0
- package/src/components/Customs/SyCheckbox/tests/__snapshots__/sy-checkbox-disabled.snap.png +0 -0
- package/src/components/Customs/SyCheckbox/tests/__snapshots__/sy-checkbox-indeterminate.snap.png +0 -0
- package/src/components/Customs/SyCheckbox/tests/__snapshots__/sy-checkbox-required.snap.png +0 -0
- package/src/components/Customs/SyCheckbox/tests/__snapshots__/sy-checkbox-unchecked.snap.png +0 -0
- package/src/components/Customs/SyIcon/SyIcon.vue +19 -1
- package/src/components/Customs/SyIcon/tests/SyIcon.visual.cy.ts +83 -0
- package/src/components/Customs/SyIcon/tests/__snapshots__/sy-icon-color-error.snap.png +0 -0
- package/src/components/Customs/SyIcon/tests/__snapshots__/sy-icon-decorative.snap.png +0 -0
- package/src/components/Customs/SyIcon/tests/__snapshots__/sy-icon-informative.snap.png +0 -0
- package/src/components/Customs/SyIcon/tests/__snapshots__/sy-icon-role-button.snap.png +0 -0
- package/src/components/Customs/SyIcon/tests/__snapshots__/sy-icon-size-large.snap.png +0 -0
- package/src/components/Customs/SyIconButton/tests/SyIconButton.visual.cy.ts +55 -0
- package/src/components/Customs/SyIconButton/tests/__snapshots__/sy-icon-button-default.snap.png +0 -0
- package/src/components/Customs/SyIconButton/tests/__snapshots__/sy-icon-button-disabled.snap.png +0 -0
- package/src/components/Customs/SyIconButton/tests/__snapshots__/sy-icon-button-error.snap.png +0 -0
- package/src/components/Customs/SyIconButton/tests/__snapshots__/sy-icon-button-large.snap.png +0 -0
- package/src/components/Customs/SyPagination/tests/SyPagination.visual.cy.ts +40 -0
- package/src/components/Customs/SyPagination/tests/__snapshots__/sy-pagination-first-page.snap.png +0 -0
- package/src/components/Customs/SyPagination/tests/__snapshots__/sy-pagination-middle-page.snap.png +0 -0
- package/src/components/Customs/SyPagination/tests/__snapshots__/sy-pagination-with-label.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.stories.ts +0 -1
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +4 -3
- package/src/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.ts +1 -1
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-asterisk.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-comfortable.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-compact.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-default.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-disabled.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-error.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-no-details.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-readonly.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-selected.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-success.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/tests/__snapshots__/sy-radio-group-warning.snap.png +0 -0
- package/src/components/Customs/SyRadioGroup/validation/Validation.stories.ts +63 -27
- package/src/components/Customs/SyTabs/tests/SyTabs.visual.cy.ts +30 -0
- package/src/components/Customs/SyTabs/tests/__snapshots__/sy-tabs-default.snap.png +0 -0
- package/src/components/Customs/SyTabs/tests/__snapshots__/sy-tabs-second-active.snap.png +0 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +160 -778
- package/src/components/Customs/SyTextField/SyTextField.vue +168 -153
- package/src/components/Customs/SyTextField/Validation/Validation.stories.ts +1164 -0
- package/src/components/Customs/SyTextField/locales.ts +12 -0
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +174 -8
- package/src/components/Customs/SyTextField/tests/SyTextField.visual.cy.ts +116 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-clearable.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-default.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-number-disabled.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-number-no-spinner.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-number.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-prepend-icon.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-readonly.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-required.snap.png +0 -0
- package/src/components/Customs/SyTextField/tests/__snapshots__/sy-text-field-with-value.snap.png +0 -0
- package/src/components/Customs/SyTextField/types.ts +70 -0
- package/src/components/Customs/SyTextField/useNumberField.ts +93 -0
- package/src/components/Customs/SyTextField/useSyTextFieldValidation.ts +104 -0
- package/src/components/DataList/tests/DataList.visual.cy.ts +85 -0
- package/src/components/DataList/tests/__snapshots__/data-list-default.snap.png +0 -0
- package/src/components/DataList/tests/__snapshots__/data-list-loading.snap.png +0 -0
- package/src/components/DataList/tests/__snapshots__/data-list-row.snap.png +0 -0
- package/src/components/DataList/tests/__snapshots__/data-list-with-icons.snap.png +0 -0
- package/src/components/DataList/tests/__snapshots__/data-list-with-title.snap.png +0 -0
- package/src/components/DataListGroup/tests/DataListGroup.visual.cy.ts +51 -0
- package/src/components/DataListGroup/tests/__snapshots__/data-list-group-default.snap.png +0 -0
- package/src/components/DataListGroup/tests/__snapshots__/data-list-group-loading.snap.png +0 -0
- package/src/components/DataListItem/tests/DataListItem.visual.cy.ts +53 -0
- package/src/components/DataListItem/tests/__snapshots__/data-list-item-chip.snap.png +0 -0
- package/src/components/DataListItem/tests/__snapshots__/data-list-item-default.snap.png +0 -0
- package/src/components/DataListItem/tests/__snapshots__/data-list-item-placeholder.snap.png +0 -0
- package/src/components/DataListItem/tests/__snapshots__/data-list-item-row.snap.png +0 -0
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +7 -7
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +7 -8
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +2 -2
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +1 -1
- package/src/components/DatePicker/composables/tests/useTodayButton.spec.ts +10 -10
- package/src/components/DatePicker/composables/useCalendarKeyboardNavigation.ts +11 -2
- package/src/components/DeclarationAccessibilityPage/tests/DeclarationAccessibilityPage.visual.cy.ts +35 -0
- package/src/components/DeclarationAccessibilityPage/tests/__snapshots__/declaration-a11y-page-default.snap.png +0 -0
- package/src/components/DeclarationAccessibilityPage/tests/__snapshots__/declaration-a11y-page-full.snap.png +0 -0
- package/src/components/DiacriticPicker/tests/DiacriticPicker.visual.cy.ts +24 -0
- package/src/components/DiacriticPicker/tests/__snapshots__/diacritic-picker-custom-title.snap.png +0 -0
- package/src/components/DiacriticPicker/tests/__snapshots__/diacritic-picker-default.snap.png +0 -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/DownloadBtn/tests/DownloadBtn.spec.ts +2 -2
- package/src/components/DownloadBtn/tests/DownloadBtn.visual.cy.ts +38 -0
- package/src/components/DownloadBtn/tests/__snapshots__/download-btn-dark.snap.png +0 -0
- package/src/components/DownloadBtn/tests/__snapshots__/download-btn-idle.snap.png +0 -0
- package/src/components/ErrorPage/tests/ErrorPage.visual.cy.ts +32 -0
- package/src/components/ErrorPage/tests/__snapshots__/error-page-custom.snap.png +0 -0
- package/src/components/ErrorPage/tests/__snapshots__/error-page-default.snap.png +0 -0
- package/src/components/ErrorPage/tests/__snapshots__/error-page-no-btn.snap.png +0 -0
- package/src/components/ExternalLinks/tests/ExternalLinks.visual.cy.ts +30 -0
- package/src/components/ExternalLinks/tests/__snapshots__/external-links-default.snap.png +0 -0
- package/src/components/ExternalLinks/tests/__snapshots__/external-links-fixed.snap.png +0 -0
- package/src/components/FileList/tests/FileList.visual.cy.ts +31 -0
- package/src/components/FileList/tests/__snapshots__/file-list-default.snap.png +0 -0
- package/src/components/FileList/tests/__snapshots__/file-list-with-delete.snap.png +0 -0
- package/src/components/FilePreview/accessibilite/Accessibility.mdx +86 -8
- package/src/components/FileUpload/tests/FileUpload.visual.cy.ts +36 -0
- package/src/components/FileUpload/tests/__snapshots__/file-upload-default.snap.png +0 -0
- package/src/components/FileUpload/tests/__snapshots__/file-upload-disabled.snap.png +0 -0
- package/src/components/FileUpload/tests/__snapshots__/file-upload-multiple.snap.png +0 -0
- package/src/components/FilterInline/FilterInline.stories.ts +2 -0
- package/src/components/FilterInline/FilterInline.vue +10 -5
- package/src/components/FilterInline/tests/FilterInline.visual.cy.ts +25 -0
- package/src/components/FilterInline/tests/__snapshots__/filter-inline-default.snap.png +0 -0
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +4 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +11 -6
- package/src/components/FilterSideBar/tests/FilterSideBar.visual.cy.ts +37 -0
- package/src/components/FilterSideBar/tests/__snapshots__/filter-sidebar-default.snap.png +0 -0
- package/src/components/FilterSideBar/tests/__snapshots__/filter-sidebar-modale.snap.png +0 -0
- package/src/components/FooterBar/tests/FooterBar.visual.cy.ts +37 -0
- package/src/components/FooterBar/tests/__snapshots__/footer-bar-default.snap.png +0 -0
- package/src/components/FooterBar/tests/__snapshots__/footer-bar-no-logo.snap.png +0 -0
- package/src/components/FooterBar/tests/__snapshots__/footer-bar-no-social.snap.png +0 -0
- package/src/components/FooterBar/tests/__snapshots__/footer-bar-version.snap.png +0 -0
- package/src/components/FranceConnectBtn/tests/FranceConnectBtn.visual.cy.ts +38 -0
- package/src/components/FranceConnectBtn/tests/__snapshots__/france-connect-btn-dark.snap.png +0 -0
- package/src/components/FranceConnectBtn/tests/__snapshots__/france-connect-btn-default.snap.png +0 -0
- package/src/components/FranceConnectBtn/tests/__snapshots__/france-connect-btn-plus.snap.png +0 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +4 -4
- 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/HeaderLoading/tests/HeaderLoading.visual.cy.ts +34 -0
- package/src/components/HeaderLoading/tests/__snapshots__/header-loading-custom-size.snap.png +0 -0
- package/src/components/HeaderLoading/tests/__snapshots__/header-loading-default.snap.png +0 -0
- package/src/components/HeaderLoading/tests/__snapshots__/header-loading-standalone.snap.png +0 -0
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +4 -4
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.visual.cy.ts +34 -0
- package/src/components/HeaderNavigationBar/tests/__snapshots__/header-navigation-bar-default.snap.png +0 -0
- package/src/components/HeaderNavigationBar/tests/__snapshots__/header-navigation-bar-subtitle.snap.png +0 -0
- package/src/components/HeaderToolbar/tests/HeaderToolbar.visual.cy.ts +25 -0
- package/src/components/HeaderToolbar/tests/__snapshots__/header-toolbar-custom.snap.png +0 -0
- package/src/components/HeaderToolbar/tests/__snapshots__/header-toolbar-default.snap.png +0 -0
- package/src/components/LangBtn/tests/LangBtn.visual.cy.ts +33 -0
- package/src/components/LangBtn/tests/__snapshots__/lang-btn-default.snap.png +0 -0
- package/src/components/LangBtn/tests/__snapshots__/lang-btn-english.snap.png +0 -0
- package/src/components/LangBtn/tests/__snapshots__/lang-btn-no-arrow.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/LogoBrandSection/tests/LogoBrandSection.visual.cy.ts +43 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/logo-brand-section-default.snap.png +0 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/logo-brand-section-mobile.snap.png +0 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/logo-brand-section-reduced.snap.png +0 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/logo-brand-section-with-title.snap.png +0 -0
- package/src/components/LunarCalendar/tests/LunarCalendar.visual.cy.ts +36 -0
- package/src/components/LunarCalendar/tests/__snapshots__/lunar-calendar-default.snap.png +0 -0
- package/src/components/LunarCalendar/tests/__snapshots__/lunar-calendar-required.snap.png +0 -0
- package/src/components/LunarCalendar/tests/__snapshots__/lunar-calendar-with-value.snap.png +0 -0
- package/src/components/MaintenancePage/tests/MaintenancePage.visual.cy.ts +22 -0
- package/src/components/MaintenancePage/tests/__snapshots__/maintenance-page-custom.snap.png +0 -0
- package/src/components/MaintenancePage/tests/__snapshots__/maintenance-page-default.snap.png +0 -0
- package/src/components/MonthPicker/tests/MonthPicker.visual.cy.ts +37 -0
- package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +2 -0
- package/src/components/MonthPicker/tests/__snapshots__/month-picker-default.snap.png +0 -0
- package/src/components/MonthPicker/tests/__snapshots__/month-picker-disabled.snap.png +0 -0
- package/src/components/MonthPicker/tests/__snapshots__/month-picker-readonly.snap.png +0 -0
- package/src/components/MonthPicker/tests/__snapshots__/month-picker-with-value.snap.png +0 -0
- package/src/components/NirField/NirField.stories.ts +40 -682
- package/src/components/NirField/NirField.vue +98 -32
- package/src/components/NirField/tests/NirField.spec.ts +135 -14
- package/src/components/NirField/tests/NirField.visual.cy.ts +28 -0
- package/src/components/NirField/tests/__snapshots__/nir-field-complex.snap.png +0 -0
- package/src/components/NirField/tests/__snapshots__/nir-field-default.snap.png +0 -0
- package/src/components/NirField/tests/__snapshots__/nir-field-with-key.snap.png +0 -0
- package/src/components/NirField/tests/useNirValidation.spec.ts +168 -0
- package/src/components/NirField/useNirValidation.ts +28 -2
- package/src/components/NirField/validation/Validation.stories.ts +866 -0
- package/src/components/NotFoundPage/tests/NotFoundPage.visual.cy.ts +28 -0
- package/src/components/NotFoundPage/tests/__snapshots__/not-found-page-custom-btn.snap.png +0 -0
- package/src/components/NotFoundPage/tests/__snapshots__/not-found-page-default.snap.png +0 -0
- package/src/components/NotFoundPage/tests/__snapshots__/not-found-page-no-btn.snap.png +0 -0
- package/src/components/NotificationBar/tests/NotificationBar.visual.cy.ts +54 -0
- package/src/components/NotificationBar/tests/__snapshots__/notification-bar-bottom.snap.png +0 -0
- package/src/components/NotificationBar/tests/__snapshots__/notification-bar-info.snap.png +0 -0
- package/src/components/NotificationBar/tests/__snapshots__/notification-bar-multiple.snap.png +0 -0
- package/src/components/PageContainer/tests/PageContainer.visual.cy.ts +33 -0
- package/src/components/PageContainer/tests/__snapshots__/page-container-color.snap.png +0 -0
- package/src/components/PageContainer/tests/__snapshots__/page-container-default.snap.png +0 -0
- package/src/components/PageContainer/tests/__snapshots__/page-container-md.snap.png +0 -0
- package/src/components/PaginatedTable/accessibilite/Accessibility.mdx +99 -7
- package/src/components/PaginatedTable/tests/PaginatedTable.visual.cy.ts +41 -0
- package/src/components/PaginatedTable/tests/__snapshots__/paginated-table-default.snap.png +0 -0
- package/src/components/PaginatedTable/tests/__snapshots__/paginated-table-server.snap.png +0 -0
- package/src/components/PasswordField/PasswordField.mdx +5 -52
- package/src/components/PasswordField/PasswordField.stories.ts +74 -931
- package/src/components/PasswordField/PasswordField.vue +120 -191
- package/src/components/PasswordField/Validation/Validation.stories.ts +1295 -0
- package/src/components/PasswordField/locales.ts +2 -0
- package/src/components/PasswordField/tests/PasswordField.spec.ts +144 -106
- package/src/components/PasswordField/tests/PasswordField.visual.cy.ts +49 -0
- package/src/components/PasswordField/tests/__snapshots__/password-field-default.snap.png +0 -0
- package/src/components/PasswordField/tests/__snapshots__/password-field-disabled.snap.png +0 -0
- package/src/components/PasswordField/tests/__snapshots__/password-field-required.snap.png +0 -0
- package/src/components/PasswordField/tests/__snapshots__/password-field-underlined.snap.png +0 -0
- package/src/components/PasswordField/types.ts +17 -0
- package/src/components/PasswordField/usePasswordFieldValidation.ts +100 -0
- package/src/components/PeriodField/PeriodField.stories.ts +3 -1
- package/src/components/PeriodField/PeriodField.vue +1 -1
- package/src/components/PeriodField/tests/PeriodField.visual.cy.ts +39 -0
- package/src/components/PeriodField/tests/__snapshots__/period-field-default.snap.png +0 -0
- package/src/components/PeriodField/tests/__snapshots__/period-field-no-calendar.snap.png +0 -0
- package/src/components/PeriodField/tests/__snapshots__/period-field-required.snap.png +0 -0
- package/src/components/PeriodField/tests/__snapshots__/period-field-with-value.snap.png +0 -0
- package/src/components/PhoneField/PhoneField.vue +2 -2
- package/src/components/PhoneField/tests/PhoneField.spec.ts +1 -0
- package/src/components/PhoneField/tests/PhoneField.visual.cy.ts +28 -0
- package/src/components/PhoneField/tests/__snapshots__/phone-field-default.snap.png +0 -0
- package/src/components/PhoneField/tests/__snapshots__/phone-field-with-country-code.snap.png +0 -0
- package/src/components/PhoneField/tests/__snapshots__/phone-field-with-value.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/RatingPicker/tests/RatingPicker.visual.cy.ts +52 -0
- package/src/components/RatingPicker/tests/__snapshots__/rating-picker-emotion.snap.png +0 -0
- package/src/components/RatingPicker/tests/__snapshots__/rating-picker-number.snap.png +0 -0
- package/src/components/RatingPicker/tests/__snapshots__/rating-picker-readonly.snap.png +0 -0
- package/src/components/RatingPicker/tests/__snapshots__/rating-picker-stars.snap.png +0 -0
- package/src/components/SearchListField/SearchListField.mdx +1 -1
- package/src/components/SearchListField/SearchListField.stories.ts +1 -1
- package/src/components/SearchListField/SearchListField.vue +9 -4
- package/src/components/SearchListField/tests/SearchListField.spec.ts +127 -0
- package/src/components/SearchListField/tests/SearchListField.visual.cy.ts +35 -0
- package/src/components/SearchListField/tests/__snapshots__/search-list-field-default.snap.png +0 -0
- package/src/components/SearchListField/tests/__snapshots__/search-list-field-with-selection.snap.png +0 -0
- package/src/components/SkipLink/tests/SkipLink.visual.cy.ts +16 -0
- package/src/components/SkipLink/tests/__snapshots__/skip-link-focused.snap.png +0 -0
- package/src/components/SocialMediaLinks/tests/SocialMediaLinks.visual.cy.ts +33 -0
- package/src/components/SocialMediaLinks/tests/__snapshots__/social-media-links-default.snap.png +0 -0
- package/src/components/SocialMediaLinks/tests/__snapshots__/social-media-links-no-native-heading.snap.png +0 -0
- package/src/components/StatusPage/tests/StatusPage.visual.cy.ts +47 -0
- package/src/components/StatusPage/tests/__snapshots__/status-page-default.snap.png +0 -0
- package/src/components/StatusPage/tests/__snapshots__/status-page-full.snap.png +0 -0
- package/src/components/StatusPage/tests/__snapshots__/status-page-no-btn.snap.png +0 -0
- package/src/components/SubHeader/tests/SubHeader.visual.cy.ts +48 -0
- package/src/components/SubHeader/tests/__snapshots__/sub-header-default.snap.png +0 -0
- package/src/components/SubHeader/tests/__snapshots__/sub-header-loading.snap.png +0 -0
- package/src/components/SubHeader/tests/__snapshots__/sub-header-no-back-btn.snap.png +0 -0
- package/src/components/SubHeader/tests/__snapshots__/sub-header-with-subtitle.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/SyHeading/tests/SyHeading.visual.cy.ts +33 -0
- package/src/components/SyHeading/tests/__snapshots__/sy-heading-level-1.snap.png +0 -0
- package/src/components/SyHeading/tests/__snapshots__/sy-heading-level-2.snap.png +0 -0
- package/src/components/SyHeading/tests/__snapshots__/sy-heading-level-3.snap.png +0 -0
- package/src/components/SyTextArea/SyTextArea.stories.ts +25 -0
- package/src/components/SyTextArea/SyTextArea.vue +7 -0
- package/src/components/SyTextArea/composables/useSyTextAreaValidation.ts +1 -1
- package/src/components/SyTextArea/tests/SyTextArea.a11y.spec.ts +18 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +135 -1
- package/src/components/SyTextArea/tests/SyTextArea.visual.cy.ts +48 -0
- package/src/components/SyTextArea/tests/__snapshots__/sy-textarea-default.snap.png +0 -0
- package/src/components/SyTextArea/tests/__snapshots__/sy-textarea-filled.snap.png +0 -0
- package/src/components/SyTextArea/tests/__snapshots__/sy-textarea-required.snap.png +0 -0
- package/src/components/SyTextArea/tests/__snapshots__/sy-textarea-with-value.snap.png +0 -0
- package/src/components/SyTextArea/validation/Validation.stories.ts +6 -86
- package/src/components/TableToolbar/tests/TableToolbar.visual.cy.ts +49 -0
- package/src/components/TableToolbar/tests/__snapshots__/table-toolbar-default.snap.png +0 -0
- package/src/components/TableToolbar/tests/__snapshots__/table-toolbar-filtered.snap.png +0 -0
- package/src/components/TableToolbar/tests/__snapshots__/table-toolbar-loading.snap.png +0 -0
- package/src/components/TableToolbar/tests/__snapshots__/table-toolbar-with-add-btn.snap.png +0 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +3 -3
- package/src/components/Tables/SyServerTable/accessibilite/Accessibility.mdx +114 -7
- package/src/components/Tables/SyServerTable/tests/SyServerTable.visual.cy.ts +58 -0
- package/src/components/Tables/SyServerTable/tests/__snapshots__/sy-server-table-default.snap.png +0 -0
- package/src/components/Tables/SyServerTable/tests/__snapshots__/sy-server-table-loading.snap.png +0 -0
- package/src/components/Tables/SyServerTable/tests/__snapshots__/sy-server-table-with-select.snap.png +0 -0
- package/src/components/Tables/SyTable/accessibilite/Accessibility.mdx +116 -7
- package/src/components/Tables/SyTable/tests/SyTable.visual.cy.ts +70 -0
- package/src/components/Tables/SyTable/tests/__snapshots__/sy-table-compact.snap.png +0 -0
- package/src/components/Tables/SyTable/tests/__snapshots__/sy-table-default.snap.png +0 -0
- package/src/components/Tables/SyTable/tests/__snapshots__/sy-table-striped.snap.png +0 -0
- package/src/components/Tables/SyTable/tests/__snapshots__/sy-table-with-select.snap.png +0 -0
- package/src/components/Tables/common/tableStyles.scss +4 -4
- package/src/components/Tables/common/tests/SyTableFilter.spec.ts +8 -1
- package/src/components/Tables/common/tests/filterByRange.spec.ts +23 -22
- package/src/components/ToolbarContainer/tests/ToolbarContainer.visual.cy.ts +34 -0
- package/src/components/ToolbarContainer/tests/__snapshots__/toolbar-container-default.snap.png +0 -0
- package/src/components/ToolbarContainer/tests/__snapshots__/toolbar-container-links.snap.png +0 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +1 -2
- package/src/components/UploadWorkflow/tests/UploadWorkflow.visual.cy.ts +39 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/upload-workflow-default.snap.png +0 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/upload-workflow-with-title.snap.png +0 -0
- package/src/components/UserMenuBtn/tests/UserMenuBtn.visual.cy.ts +42 -0
- package/src/components/UserMenuBtn/tests/__snapshots__/user-menu-btn-default.snap.png +0 -0
- package/src/components/UserMenuBtn/tests/__snapshots__/user-menu-btn-no-logout.snap.png +0 -0
- package/src/components/UserMenuBtn/tests/__snapshots__/user-menu-btn-with-name.snap.png +0 -0
- package/src/composables/unifyValidation/documentationValidationProps.ts +1 -1
- package/src/composables/unifyValidation/tests/documentationValidationProps.spec.ts +2 -2
- package/src/composables/unifyValidation/useValidation.ts +17 -11
- package/src/composables/useFilterable/useFilterable.spec.ts +105 -142
- package/src/composables/useFilterable/useFilterable.ts +6 -17
- package/src/composables/useFormFieldErrorHandling.ts +1 -1
- package/src/composables/validation/tests/useFormValidation.spec.ts +11 -2
- package/src/composables/validation/tests/useValidatable.spec.ts +16 -6
- package/src/composables/validation/tests/useValidation.spec.ts +2 -2
- package/src/composables/validation/useValidation.ts +1 -1
- package/src/composantsVuetify/VCard/VCard.mdx +8 -0
- package/src/composantsVuetify/VCard/v-card.stories.ts +191 -1
- package/src/composantsVuetify/VStepper/VStepper.mdx +56 -0
- package/src/composantsVuetify/VStepper/v-stepper.stories.ts +563 -0
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +1 -0
- package/src/designTokens/tokens/amelipro/apSemantic.ts +1 -1
- package/src/designTokens/tokens/pa/paLightTheme.ts +1 -0
- package/src/stories/Accessibilite/DesignSystem/a11y-status.json +1 -1
- package/src/stories/Components/Components.stories.ts +61 -10
- package/src/stories/Demarrer/Releases.stories.ts +45 -2
- package/src/stories/DesignTokens/Colors.mdx +2 -0
- package/src/stories/DesignTokens/colors.stories.ts +13 -0
- package/src/stories/EcoConception/EcoBestPracticesDoc.vue +930 -0
- package/src/stories/EcoConception/EcoBestPratices.mdx +38 -0
- package/src/stories/EcoConception/Introduction.mdx +8 -1
- package/src/stories/EcoConception/datas/bonnes_pratiques_essentielles.json +1018 -0
- package/src/stories/EcoConception/ecoconception-best-practices.stories.ts +20 -0
- package/src/stories/GuideDuDev/Amelipro.mdx +9 -1
- package/src/stories/GuideDuDev/Amelipro.stories.ts +955 -168
- package/src/stories/GuideDuDev/PortailAgent.stories.ts +0 -1
- package/src/utils/functions/deepCopy/index.ts +2 -3
- package/dist/components/Customs/SyCheckbox/locales.d.ts +0 -3
- package/dist/components/SyHeading/SyHeading.a11y.test.d.ts +0 -1
- package/dist/components/SyHeading/SyHeading.test.d.ts +0 -1
- package/src/components/Customs/SyCheckbox/locales.ts +0 -3
- package/src/components/Customs/SyTextField/types.d.ts +0 -4
|
@@ -3,9 +3,9 @@ import SyTextField from '@/components/Customs/SyTextField/SyTextField.vue'
|
|
|
3
3
|
import { VIcon } from 'vuetify/components'
|
|
4
4
|
import { ref, watch } from 'vue'
|
|
5
5
|
import { mdiAccountBox } from '@mdi/js'
|
|
6
|
-
import { VBtn } from 'vuetify/components'
|
|
7
6
|
import { getValidationDocumentation } from '@/composables/unifyValidation/documentationValidationProps'
|
|
8
7
|
import { fn } from '@storybook/test'
|
|
8
|
+
import type { SyTextFieldProps } from './types'
|
|
9
9
|
|
|
10
10
|
const meta = {
|
|
11
11
|
title: 'Composants/Formulaires/SyTextField',
|
|
@@ -22,6 +22,9 @@ const meta = {
|
|
|
22
22
|
component: `SyTextField`,
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
|
+
controls: {
|
|
26
|
+
exclude: /^on*/,
|
|
27
|
+
},
|
|
25
28
|
},
|
|
26
29
|
argTypes: {
|
|
27
30
|
...getValidationDocumentation('string'),
|
|
@@ -29,221 +32,373 @@ const meta = {
|
|
|
29
32
|
'label': {
|
|
30
33
|
description: 'Texte affiché comme label du champ',
|
|
31
34
|
control: 'text',
|
|
35
|
+
table: {
|
|
36
|
+
type: { summary: 'string' },
|
|
37
|
+
},
|
|
32
38
|
},
|
|
33
39
|
'autocomplete': {
|
|
34
40
|
description: 'Valeur de l\'attribut autocomplete',
|
|
35
41
|
control: 'text',
|
|
42
|
+
table: {
|
|
43
|
+
type: { summary: 'on|off' },
|
|
44
|
+
},
|
|
36
45
|
},
|
|
37
46
|
'prependIcon': {
|
|
38
47
|
control: 'select',
|
|
39
48
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
49
|
+
table: {
|
|
50
|
+
type: { summary: 'string' },
|
|
51
|
+
},
|
|
40
52
|
},
|
|
41
53
|
'appendIcon': {
|
|
42
54
|
control: 'select',
|
|
43
55
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
56
|
+
table: {
|
|
57
|
+
type: { summary: 'string' },
|
|
58
|
+
},
|
|
44
59
|
},
|
|
45
60
|
'prependInnerIcon': {
|
|
46
61
|
control: 'select',
|
|
47
62
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
63
|
+
table: {
|
|
64
|
+
type: { summary: 'string' },
|
|
65
|
+
},
|
|
48
66
|
},
|
|
49
67
|
'appendInnerIcon': {
|
|
50
68
|
control: 'select',
|
|
51
69
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
70
|
+
table: {
|
|
71
|
+
type: { summary: 'string' },
|
|
72
|
+
},
|
|
52
73
|
},
|
|
53
74
|
'variantStyle': {
|
|
54
75
|
control: 'select',
|
|
55
76
|
options: ['outlined', 'plain', 'underlined', 'filled', 'solo', 'solo-inverted', 'solo-filled'],
|
|
77
|
+
table: {
|
|
78
|
+
type: { summary: 'string' },
|
|
79
|
+
},
|
|
56
80
|
},
|
|
57
81
|
'color': {
|
|
58
82
|
control: 'select',
|
|
59
83
|
options: ['primary', 'secondary', 'success', 'error', 'warning'],
|
|
60
84
|
description: 'Couleur du champ',
|
|
85
|
+
table: {
|
|
86
|
+
type: { summary: 'string' },
|
|
87
|
+
},
|
|
61
88
|
},
|
|
62
89
|
'density': {
|
|
63
90
|
control: 'select',
|
|
64
91
|
options: ['default', 'comfortable', 'compact'],
|
|
65
92
|
description: 'Densité du champ',
|
|
93
|
+
table: {
|
|
94
|
+
type: { summary: 'string' },
|
|
95
|
+
},
|
|
66
96
|
},
|
|
67
97
|
'isActive': {
|
|
68
98
|
description: 'Force l\'état actif du champ (label flottant et styles visuels)',
|
|
69
99
|
control: 'boolean',
|
|
70
100
|
default: false,
|
|
101
|
+
table: {
|
|
102
|
+
type: { summary: 'boolean' },
|
|
103
|
+
},
|
|
71
104
|
},
|
|
72
105
|
'isClearable': {
|
|
73
106
|
description: 'Affiche un bouton pour effacer le contenu du champ',
|
|
74
107
|
control: 'boolean',
|
|
75
108
|
default: false,
|
|
109
|
+
table: {
|
|
110
|
+
type: { summary: 'boolean' },
|
|
111
|
+
},
|
|
76
112
|
},
|
|
77
113
|
'prependTooltip': {
|
|
78
114
|
description: 'Si le texte du prepend tooltip est renseigné alors l\'icône du tooltip s\'affiche',
|
|
79
115
|
control: 'text',
|
|
116
|
+
table: {
|
|
117
|
+
type: { summary: 'string' },
|
|
118
|
+
},
|
|
80
119
|
},
|
|
81
120
|
'appendTooltip': {
|
|
82
121
|
description: 'Si le texte du append tooltip est renseigné alors l\'icône du tooltip s\'affiche',
|
|
83
122
|
control: 'text',
|
|
123
|
+
table: {
|
|
124
|
+
type: { summary: 'string' },
|
|
125
|
+
},
|
|
84
126
|
},
|
|
85
127
|
'tooltipLocation': {
|
|
86
128
|
description: 'Position des tooltips',
|
|
87
129
|
control: 'select',
|
|
88
130
|
options: ['top', 'bottom', 'start', 'end'],
|
|
89
131
|
default: 'top',
|
|
132
|
+
table: {
|
|
133
|
+
type: { summary: 'string' },
|
|
134
|
+
},
|
|
90
135
|
},
|
|
91
136
|
'displayAsterisk': {
|
|
92
137
|
description: 'Affiche un astérisque à côté du label',
|
|
93
138
|
control: 'boolean',
|
|
94
139
|
default: false,
|
|
140
|
+
table: {
|
|
141
|
+
type: { summary: 'boolean' },
|
|
142
|
+
},
|
|
95
143
|
},
|
|
96
144
|
'disableClickButton': {
|
|
97
145
|
description: 'Désactive le click sur les icônes append et prepend',
|
|
98
146
|
control: 'boolean',
|
|
99
147
|
default: true,
|
|
148
|
+
table: {
|
|
149
|
+
type: { summary: 'boolean' },
|
|
150
|
+
},
|
|
100
151
|
},
|
|
101
152
|
'baseColor': {
|
|
102
153
|
description: 'Couleur de base du champ (par défaut hérite de color)',
|
|
103
154
|
control: 'text',
|
|
155
|
+
table: {
|
|
156
|
+
type: { summary: 'string' },
|
|
157
|
+
},
|
|
104
158
|
},
|
|
105
159
|
'bgColor': {
|
|
106
160
|
description: 'Couleur de fond du champ',
|
|
107
161
|
control: 'color',
|
|
162
|
+
table: {
|
|
163
|
+
type: { summary: 'string' },
|
|
164
|
+
},
|
|
108
165
|
},
|
|
109
166
|
'centerAffix': {
|
|
110
167
|
description: 'Centre verticalement les éléments ajoutés avant/après le champ',
|
|
111
168
|
control: 'boolean',
|
|
169
|
+
table: {
|
|
170
|
+
type: { summary: 'boolean' },
|
|
171
|
+
},
|
|
112
172
|
},
|
|
113
173
|
'counter': {
|
|
114
174
|
description: 'Affiche un compteur de caractères',
|
|
115
175
|
control: 'boolean',
|
|
176
|
+
table: {
|
|
177
|
+
type: { summary: 'boolean' },
|
|
178
|
+
},
|
|
116
179
|
},
|
|
117
180
|
'counterValue': {
|
|
118
181
|
description: 'Fonction personnalisée pour calculer la valeur du compteur',
|
|
119
182
|
control: 'object',
|
|
183
|
+
table: {
|
|
184
|
+
type: { summary: '(value: unknown) => number' },
|
|
185
|
+
},
|
|
120
186
|
},
|
|
121
187
|
'direction': {
|
|
122
188
|
description: 'Direction du champ (horizontal ou vertical)',
|
|
123
189
|
control: 'select',
|
|
124
190
|
options: ['horizontal', 'vertical'],
|
|
191
|
+
table: {
|
|
192
|
+
type: { summary: 'horizontal | vertical' },
|
|
193
|
+
},
|
|
125
194
|
},
|
|
126
195
|
'isDirty': {
|
|
127
196
|
description: 'Indique si le champ a été modifié',
|
|
128
197
|
control: 'boolean',
|
|
198
|
+
table: {
|
|
199
|
+
type: { summary: 'boolean' },
|
|
200
|
+
},
|
|
129
201
|
},
|
|
130
202
|
'isFlat': {
|
|
131
203
|
description: 'Supprime l\'élévation du champ',
|
|
132
204
|
control: 'boolean',
|
|
205
|
+
table: {
|
|
206
|
+
type: { summary: 'boolean' },
|
|
207
|
+
},
|
|
133
208
|
},
|
|
134
209
|
'isFocused': {
|
|
135
210
|
description: 'Force l\'état focus du champ',
|
|
136
211
|
control: 'boolean',
|
|
212
|
+
table: {
|
|
213
|
+
type: { summary: 'boolean' },
|
|
214
|
+
},
|
|
137
215
|
},
|
|
138
|
-
'
|
|
216
|
+
'hideDetails': {
|
|
139
217
|
description: 'Masque la section des détails (messages d\'erreur, compteur)',
|
|
140
218
|
control: 'boolean',
|
|
219
|
+
table: {
|
|
220
|
+
type: { summary: 'boolean' },
|
|
221
|
+
},
|
|
141
222
|
},
|
|
142
223
|
'areSpinButtonsHidden': {
|
|
143
224
|
description: 'Masque les boutons d\'incrémentation pour les champs numériques',
|
|
144
225
|
control: 'boolean',
|
|
226
|
+
table: {
|
|
227
|
+
type: { summary: 'boolean' },
|
|
228
|
+
},
|
|
145
229
|
},
|
|
146
230
|
'hint': {
|
|
147
231
|
description: 'Texte d\'aide affiché sous le champ',
|
|
148
232
|
control: 'text',
|
|
233
|
+
table: {
|
|
234
|
+
type: { summary: 'string' },
|
|
235
|
+
},
|
|
149
236
|
},
|
|
150
237
|
'helpText': {
|
|
151
238
|
description: 'Texte d\'aide affiché sous le champ',
|
|
152
239
|
control: 'text',
|
|
240
|
+
table: {
|
|
241
|
+
type: { summary: 'string' },
|
|
242
|
+
},
|
|
153
243
|
},
|
|
154
244
|
'maxlength': {
|
|
155
245
|
description: 'Nombre maximal de caractères autorisés dans le champ',
|
|
156
246
|
control: { type: 'text' },
|
|
247
|
+
table: {
|
|
248
|
+
type: { summary: 'number' },
|
|
249
|
+
},
|
|
157
250
|
},
|
|
158
251
|
'loading': {
|
|
159
252
|
description: 'Affiche un indicateur de chargement',
|
|
160
253
|
control: 'boolean',
|
|
254
|
+
table: {
|
|
255
|
+
type: { summary: 'boolean' },
|
|
256
|
+
},
|
|
161
257
|
},
|
|
162
258
|
'maxWidth': {
|
|
163
259
|
description: 'Largeur maximale du champ',
|
|
164
260
|
control: { type: 'text' },
|
|
261
|
+
table: {
|
|
262
|
+
type: { summary: 'string' },
|
|
263
|
+
},
|
|
165
264
|
},
|
|
166
265
|
'minWidth': {
|
|
167
266
|
description: 'Largeur minimale du champ',
|
|
168
267
|
control: { type: 'text' },
|
|
268
|
+
table: {
|
|
269
|
+
type: { summary: 'string' },
|
|
270
|
+
},
|
|
169
271
|
},
|
|
170
272
|
'name': {
|
|
171
273
|
description: 'Nom du champ pour les formulaires',
|
|
172
274
|
control: 'text',
|
|
275
|
+
table: {
|
|
276
|
+
type: { summary: 'string' },
|
|
277
|
+
},
|
|
173
278
|
},
|
|
174
279
|
'displayPersistentClear': {
|
|
175
280
|
description: 'Affiche toujours le bouton de réinitialisation',
|
|
176
281
|
control: 'boolean',
|
|
177
282
|
default: false,
|
|
283
|
+
table: {
|
|
284
|
+
type: { summary: 'boolean' },
|
|
285
|
+
},
|
|
178
286
|
},
|
|
179
287
|
'displayPersistentCounter': {
|
|
180
288
|
description: 'Affiche toujours le compteur',
|
|
181
289
|
control: 'boolean',
|
|
182
290
|
default: false,
|
|
291
|
+
table: {
|
|
292
|
+
type: { summary: 'boolean' },
|
|
293
|
+
},
|
|
183
294
|
},
|
|
184
295
|
'displayPersistentHint': {
|
|
185
296
|
description: 'Affiche toujours le texte d\'aide',
|
|
186
297
|
control: 'boolean',
|
|
187
298
|
default: false,
|
|
299
|
+
table: {
|
|
300
|
+
type: { summary: 'boolean' },
|
|
301
|
+
},
|
|
188
302
|
},
|
|
189
303
|
'displayPersistentPlaceholder': {
|
|
190
304
|
description: 'Garde le placeholder visible. Si le champ est vide, le placeholder reste affiché',
|
|
191
305
|
control: 'boolean',
|
|
192
306
|
default: false,
|
|
307
|
+
table: {
|
|
308
|
+
type: { summary: 'boolean' },
|
|
309
|
+
},
|
|
193
310
|
},
|
|
194
311
|
'placeholder': {
|
|
195
312
|
description: 'Texte affiché quand le champ est vide',
|
|
196
313
|
control: 'text',
|
|
197
314
|
default: 'Placeholder',
|
|
315
|
+
table: {
|
|
316
|
+
type: { summary: 'string' },
|
|
317
|
+
},
|
|
198
318
|
},
|
|
199
319
|
'prefix': {
|
|
200
320
|
description: 'Texte affiché avant la valeur: prefix="€" : affichera "€" avant la valeur saisie',
|
|
201
321
|
control: 'text',
|
|
322
|
+
table: {
|
|
323
|
+
type: { summary: 'string' },
|
|
324
|
+
},
|
|
202
325
|
},
|
|
203
326
|
'isReversed': {
|
|
204
327
|
description: 'Inverse l\'ordre des éléments',
|
|
205
328
|
control: 'boolean',
|
|
206
329
|
default: false,
|
|
330
|
+
table: {
|
|
331
|
+
type: { summary: 'boolean' },
|
|
332
|
+
},
|
|
207
333
|
},
|
|
208
334
|
'role': {
|
|
209
335
|
description: 'Rôle ARIA du champ',
|
|
210
336
|
control: 'text',
|
|
337
|
+
table: {
|
|
338
|
+
type: { summary: 'string' },
|
|
339
|
+
},
|
|
211
340
|
},
|
|
212
341
|
'rounded': {
|
|
213
342
|
description: 'Arrondit les coins du champ',
|
|
214
343
|
control: { type: 'text' },
|
|
344
|
+
table: {
|
|
345
|
+
type: { summary: 'string' },
|
|
346
|
+
},
|
|
215
347
|
},
|
|
216
348
|
'isOnSingleLine': {
|
|
217
349
|
description: 'Force l\'affichage sur une seule ligne',
|
|
218
350
|
control: 'boolean',
|
|
219
351
|
default: false,
|
|
352
|
+
table: {
|
|
353
|
+
type: { summary: 'boolean' },
|
|
354
|
+
},
|
|
220
355
|
},
|
|
221
356
|
'suffix': {
|
|
222
357
|
description: 'Texte affiché après la valeur',
|
|
223
358
|
control: 'text',
|
|
359
|
+
table: {
|
|
360
|
+
type: { summary: 'string' },
|
|
361
|
+
},
|
|
224
362
|
},
|
|
225
363
|
'theme': {
|
|
226
364
|
description: 'Thème à appliquer au champ',
|
|
227
365
|
control: 'text',
|
|
366
|
+
table: {
|
|
367
|
+
type: { summary: 'string' },
|
|
368
|
+
},
|
|
228
369
|
},
|
|
229
370
|
'isTiled': {
|
|
230
371
|
description: 'Applique un style tuile',
|
|
231
372
|
control: 'boolean',
|
|
232
373
|
default: false,
|
|
374
|
+
table: {
|
|
375
|
+
type: { summary: 'boolean' },
|
|
376
|
+
},
|
|
233
377
|
},
|
|
234
378
|
'type': {
|
|
235
379
|
description: 'Type du champ de saisie',
|
|
236
380
|
control: 'select',
|
|
237
381
|
options: ['text', 'number', 'password', 'email', 'tel', 'url', 'search'],
|
|
238
382
|
default: 'text',
|
|
383
|
+
table: {
|
|
384
|
+
type: {
|
|
385
|
+
summary: 'string',
|
|
386
|
+
detail: 'text | number | password | email | tel | url | search',
|
|
387
|
+
},
|
|
388
|
+
},
|
|
239
389
|
},
|
|
240
390
|
'width': {
|
|
241
391
|
description: 'Largeur du champ',
|
|
242
392
|
control: { type: 'text' },
|
|
393
|
+
table: {
|
|
394
|
+
type: { summary: 'string' },
|
|
395
|
+
},
|
|
243
396
|
},
|
|
244
397
|
'validateOnSubmit': {
|
|
245
398
|
description: 'Valide le champ avec la valeur donnée',
|
|
246
|
-
|
|
399
|
+
table: {
|
|
400
|
+
type: { summary: '(value: string | number | null) => Promise<void>' },
|
|
401
|
+
},
|
|
247
402
|
},
|
|
248
403
|
'append': {
|
|
249
404
|
description: 'Slot pour ajouter du contenu à droite du champ',
|
|
@@ -308,7 +463,7 @@ const meta = {
|
|
|
308
463
|
|
|
309
464
|
export default meta
|
|
310
465
|
|
|
311
|
-
type Story = StoryObj<
|
|
466
|
+
type Story = StoryObj<SyTextFieldProps>
|
|
312
467
|
export const Default: Story = {
|
|
313
468
|
parameters: {
|
|
314
469
|
sourceCode: [
|
|
@@ -340,7 +495,7 @@ export const Default: Story = {
|
|
|
340
495
|
},
|
|
341
496
|
render: (args) => {
|
|
342
497
|
return {
|
|
343
|
-
components: { SyTextField
|
|
498
|
+
components: { SyTextField },
|
|
344
499
|
setup() {
|
|
345
500
|
const value = ref(args.modelValue)
|
|
346
501
|
watch(() => args.modelValue, (newValue) => {
|
|
@@ -851,196 +1006,6 @@ export const SlotCustomIcon: Story = {
|
|
|
851
1006
|
},
|
|
852
1007
|
}
|
|
853
1008
|
|
|
854
|
-
export const ValidationRules: Story = {
|
|
855
|
-
parameters: {
|
|
856
|
-
docs: {
|
|
857
|
-
description: {
|
|
858
|
-
story: `
|
|
859
|
-
### Validation avec règles standard
|
|
860
|
-
|
|
861
|
-
Cette story montre l'utilisation des règles de validation standard. Le champ :
|
|
862
|
-
- Est requis
|
|
863
|
-
- Doit contenir au moins 3 caractères
|
|
864
|
-
- Affiche un message de succès quand valide
|
|
865
|
-
`,
|
|
866
|
-
},
|
|
867
|
-
},
|
|
868
|
-
sourceCode: [
|
|
869
|
-
{
|
|
870
|
-
name: 'Template',
|
|
871
|
-
code: `<SyTextField
|
|
872
|
-
v-model="value"
|
|
873
|
-
label="Champ avec validation"
|
|
874
|
-
helpText="Le champ doit contenir à minima 3 caractères"
|
|
875
|
-
:customRules="[
|
|
876
|
-
{
|
|
877
|
-
type: 'minLength',
|
|
878
|
-
options: {
|
|
879
|
-
length: 3,
|
|
880
|
-
message: 'Le champ doit contenir au moins 3 caractères'
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
]"
|
|
884
|
-
showSuccessMessages
|
|
885
|
-
/>`,
|
|
886
|
-
},
|
|
887
|
-
],
|
|
888
|
-
},
|
|
889
|
-
render: args => ({
|
|
890
|
-
components: { SyTextField },
|
|
891
|
-
setup() {
|
|
892
|
-
const value = ref('')
|
|
893
|
-
return { args, value }
|
|
894
|
-
},
|
|
895
|
-
template: `
|
|
896
|
-
<SyTextField
|
|
897
|
-
v-model="value"
|
|
898
|
-
v-bind="args"
|
|
899
|
-
label="Champ avec validation"
|
|
900
|
-
helpText="Le champ doit contenir à minima 3 caractères"
|
|
901
|
-
:customRules="[
|
|
902
|
-
{
|
|
903
|
-
type: 'minLength',
|
|
904
|
-
options: {
|
|
905
|
-
length: 3,
|
|
906
|
-
message: 'Le champ doit contenir au moins 3 caractères'
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
]"
|
|
910
|
-
showSuccessMessages
|
|
911
|
-
/>
|
|
912
|
-
`,
|
|
913
|
-
}),
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
export const ValidationWithWarnings: Story = {
|
|
917
|
-
parameters: {
|
|
918
|
-
docs: {
|
|
919
|
-
description: {
|
|
920
|
-
story: `
|
|
921
|
-
### Validation avec avertissements
|
|
922
|
-
|
|
923
|
-
Cette story montre l'utilisation combinée des règles standard et d'avertissement. Le champ :
|
|
924
|
-
- Est requis (règle standard)
|
|
925
|
-
- Affiche un avertissement si le texte dépasse 10 caractères
|
|
926
|
-
- Les avertissements sont affichés en orange et n'empêchent pas la validation
|
|
927
|
-
`,
|
|
928
|
-
},
|
|
929
|
-
},
|
|
930
|
-
sourceCode: [
|
|
931
|
-
{
|
|
932
|
-
name: 'Template',
|
|
933
|
-
code: `<SyTextField
|
|
934
|
-
v-model="value"
|
|
935
|
-
label="Champ avec avertissements"
|
|
936
|
-
required
|
|
937
|
-
:customWarningRules="[
|
|
938
|
-
{
|
|
939
|
-
type: 'minLength',
|
|
940
|
-
options: {
|
|
941
|
-
length: 10,
|
|
942
|
-
message: 'Le texte doit comporter plus de 10 caracteres'
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
]"
|
|
946
|
-
showSuccessMessages
|
|
947
|
-
/>`,
|
|
948
|
-
},
|
|
949
|
-
],
|
|
950
|
-
},
|
|
951
|
-
render: args => ({
|
|
952
|
-
components: { SyTextField },
|
|
953
|
-
setup() {
|
|
954
|
-
const value = ref('')
|
|
955
|
-
return { args, value }
|
|
956
|
-
},
|
|
957
|
-
template: `
|
|
958
|
-
<SyTextField
|
|
959
|
-
v-model="value"
|
|
960
|
-
v-bind="args"
|
|
961
|
-
label="avec avertissements"
|
|
962
|
-
required
|
|
963
|
-
:customWarningRules="[
|
|
964
|
-
{
|
|
965
|
-
type: 'minLength',
|
|
966
|
-
options: {
|
|
967
|
-
length: 10,
|
|
968
|
-
message: 'Le texte doit comporter plus de 10 caracteres'
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
]"
|
|
972
|
-
showSuccessMessages
|
|
973
|
-
/>
|
|
974
|
-
`,
|
|
975
|
-
}),
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
export const EmailValidation: Story = {
|
|
979
|
-
parameters: {
|
|
980
|
-
docs: {
|
|
981
|
-
description: {
|
|
982
|
-
story: `
|
|
983
|
-
### Validation d'email
|
|
984
|
-
|
|
985
|
-
Cette story montre un cas d'usage courant : la validation d'une adresse email. Le champ :
|
|
986
|
-
- Est requis
|
|
987
|
-
- Vérifie le format de l'email
|
|
988
|
-
- Affiche un message de succès quand l'email est valide
|
|
989
|
-
`,
|
|
990
|
-
},
|
|
991
|
-
},
|
|
992
|
-
sourceCode: [
|
|
993
|
-
{
|
|
994
|
-
name: 'Template',
|
|
995
|
-
code: `<SyTextField
|
|
996
|
-
v-model="value"
|
|
997
|
-
autocomplete="email"
|
|
998
|
-
label="Email"
|
|
999
|
-
helpText="Format attendu : nom@domaine.fr"
|
|
1000
|
-
required
|
|
1001
|
-
:customRules="[
|
|
1002
|
-
{
|
|
1003
|
-
type: 'email',
|
|
1004
|
-
options: {
|
|
1005
|
-
message: 'L'email n'est pas valide'
|
|
1006
|
-
successMessage: 'L'email est valide'
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
]"
|
|
1010
|
-
showSuccessMessages
|
|
1011
|
-
/>`,
|
|
1012
|
-
},
|
|
1013
|
-
],
|
|
1014
|
-
},
|
|
1015
|
-
render: args => ({
|
|
1016
|
-
components: { SyTextField },
|
|
1017
|
-
setup() {
|
|
1018
|
-
const value = ref('')
|
|
1019
|
-
return { args, value }
|
|
1020
|
-
},
|
|
1021
|
-
template: `
|
|
1022
|
-
<SyTextField
|
|
1023
|
-
v-model="value"
|
|
1024
|
-
v-bind="args"
|
|
1025
|
-
label="Email"
|
|
1026
|
-
helpText="Format attendu : nom@domaine.fr"
|
|
1027
|
-
autocomplete="email"
|
|
1028
|
-
required
|
|
1029
|
-
:customRules="[
|
|
1030
|
-
{
|
|
1031
|
-
type: 'email',
|
|
1032
|
-
options: {
|
|
1033
|
-
message: 'L\\'email n\\'est pas valide',
|
|
1034
|
-
successMessage: 'L\\'email est valide'
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
]"
|
|
1038
|
-
showSuccessMessages
|
|
1039
|
-
/>
|
|
1040
|
-
`,
|
|
1041
|
-
}),
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
1009
|
export const PatternValidation: Story = {
|
|
1045
1010
|
parameters: {
|
|
1046
1011
|
docs: {
|
|
@@ -1164,384 +1129,6 @@ export const WithTooltips: Story = {
|
|
|
1164
1129
|
},
|
|
1165
1130
|
}
|
|
1166
1131
|
|
|
1167
|
-
/**
|
|
1168
|
-
* Story avec validation désactivée au blur
|
|
1169
|
-
*/
|
|
1170
|
-
export const ValidateOnBlur: Story = {
|
|
1171
|
-
args: {
|
|
1172
|
-
modelValue: '',
|
|
1173
|
-
label: 'Champ texte',
|
|
1174
|
-
required: true,
|
|
1175
|
-
isValidateOnBlur: true,
|
|
1176
|
-
customRules: [
|
|
1177
|
-
{
|
|
1178
|
-
type: 'custom',
|
|
1179
|
-
options: {
|
|
1180
|
-
message: 'Le champ doit contenir au moins 3 caractères',
|
|
1181
|
-
validate: (value: string) => value.length >= 3,
|
|
1182
|
-
},
|
|
1183
|
-
},
|
|
1184
|
-
],
|
|
1185
|
-
},
|
|
1186
|
-
render: args => ({
|
|
1187
|
-
components: { SyTextField, VBtn },
|
|
1188
|
-
setup() {
|
|
1189
|
-
const value = ref(args.modelValue)
|
|
1190
|
-
const fieldRef = ref()
|
|
1191
|
-
|
|
1192
|
-
watch(() => args.modelValue, (newValue) => {
|
|
1193
|
-
if (value.value !== newValue) {
|
|
1194
|
-
value.value = newValue
|
|
1195
|
-
}
|
|
1196
|
-
})
|
|
1197
|
-
|
|
1198
|
-
async function handleSubmit() {
|
|
1199
|
-
const isValid = await fieldRef.value?.validateOnSubmit()
|
|
1200
|
-
alert(isValid ? 'Formulaire valide !' : 'Formulaire invalide, veuillez corriger les erreurs.')
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
return { args, value, fieldRef, handleSubmit }
|
|
1204
|
-
},
|
|
1205
|
-
template: `
|
|
1206
|
-
<form @submit.prevent="handleSubmit">
|
|
1207
|
-
<p class="mb-4">
|
|
1208
|
-
La validation ne se déclenche qu'à la perte de focus ou à la soumission du formulaire.
|
|
1209
|
-
</p>
|
|
1210
|
-
<SyTextField
|
|
1211
|
-
ref="fieldRef"
|
|
1212
|
-
v-bind="args"
|
|
1213
|
-
v-model="value"
|
|
1214
|
-
/>
|
|
1215
|
-
<div class="mt-4">
|
|
1216
|
-
<VBtn type="submit" color="primary">
|
|
1217
|
-
Valider
|
|
1218
|
-
</VBtn>
|
|
1219
|
-
</div>
|
|
1220
|
-
</form>
|
|
1221
|
-
`,
|
|
1222
|
-
}),
|
|
1223
|
-
parameters: {
|
|
1224
|
-
docs: {
|
|
1225
|
-
description: {
|
|
1226
|
-
story: 'Exemple de champ avec validation désactivée au blur. La validation ne se déclenche que lors de la soumission du formulaire.',
|
|
1227
|
-
},
|
|
1228
|
-
},
|
|
1229
|
-
sourceCode: [
|
|
1230
|
-
{
|
|
1231
|
-
name: 'Template',
|
|
1232
|
-
code: `
|
|
1233
|
-
<template>
|
|
1234
|
-
<form @submit.prevent="handleSubmit">
|
|
1235
|
-
<SyTextField
|
|
1236
|
-
ref="fieldRef"
|
|
1237
|
-
v-model="value"
|
|
1238
|
-
label="Champ texte"
|
|
1239
|
-
required
|
|
1240
|
-
:is-validate-on-blur="true"
|
|
1241
|
-
:custom-rules="[
|
|
1242
|
-
{
|
|
1243
|
-
type: 'custom',
|
|
1244
|
-
options: {
|
|
1245
|
-
message: 'Le champ doit contenir au moins 3 caractères',
|
|
1246
|
-
validate: value => value.length >= 3
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
]"
|
|
1250
|
-
/>
|
|
1251
|
-
<button type="submit">
|
|
1252
|
-
Valider
|
|
1253
|
-
</button>
|
|
1254
|
-
</form>
|
|
1255
|
-
</template>
|
|
1256
|
-
`,
|
|
1257
|
-
},
|
|
1258
|
-
{
|
|
1259
|
-
name: 'Script',
|
|
1260
|
-
code: `
|
|
1261
|
-
<script setup lang="ts">
|
|
1262
|
-
import { ref } from 'vue'
|
|
1263
|
-
import { SyTextField } from '@cnamts/synapse'
|
|
1264
|
-
|
|
1265
|
-
const value = ref('')
|
|
1266
|
-
const fieldRef = ref()
|
|
1267
|
-
|
|
1268
|
-
async function handleSubmit() {
|
|
1269
|
-
const isValid = await fieldRef.value?.validateOnSubmit()
|
|
1270
|
-
if (!isValid) {
|
|
1271
|
-
// Gérer l'erreur
|
|
1272
|
-
return
|
|
1273
|
-
}
|
|
1274
|
-
// Continuer avec la soumission
|
|
1275
|
-
}
|
|
1276
|
-
</script>
|
|
1277
|
-
`,
|
|
1278
|
-
},
|
|
1279
|
-
],
|
|
1280
|
-
},
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
export const FormValidation: Story = {
|
|
1284
|
-
render: args => ({
|
|
1285
|
-
components: { SyTextField },
|
|
1286
|
-
setup() {
|
|
1287
|
-
const nomField = ref()
|
|
1288
|
-
const prenomField = ref()
|
|
1289
|
-
const ageField = ref()
|
|
1290
|
-
const nomValue = ref('')
|
|
1291
|
-
const prenomValue = ref('')
|
|
1292
|
-
const ageValue = ref('')
|
|
1293
|
-
|
|
1294
|
-
// Règle minLength pour le prénom
|
|
1295
|
-
const prenomRules = [{
|
|
1296
|
-
type: 'minLength',
|
|
1297
|
-
options: {
|
|
1298
|
-
length: 3,
|
|
1299
|
-
message: 'Le prénom doit contenir au moins 3 caractères',
|
|
1300
|
-
successMessage: 'Le prénom est valide',
|
|
1301
|
-
fieldIdentifier: 'prénom',
|
|
1302
|
-
},
|
|
1303
|
-
}]
|
|
1304
|
-
|
|
1305
|
-
// Règle pattern pour l'âge (uniquement des chiffres)
|
|
1306
|
-
const ageRules = [{
|
|
1307
|
-
type: 'matchPattern',
|
|
1308
|
-
options: {
|
|
1309
|
-
pattern: /^\d+$/,
|
|
1310
|
-
message: 'L\'âge doit contenir uniquement des chiffres',
|
|
1311
|
-
successMessage: 'L\'âge est valide',
|
|
1312
|
-
fieldIdentifier: 'âge',
|
|
1313
|
-
},
|
|
1314
|
-
}]
|
|
1315
|
-
|
|
1316
|
-
const handleSubmit = async () => {
|
|
1317
|
-
const fields = [
|
|
1318
|
-
{ ref: nomField, name: 'Nom' },
|
|
1319
|
-
{ ref: prenomField, name: 'Prénom' },
|
|
1320
|
-
{ ref: ageField, name: 'Âge' },
|
|
1321
|
-
]
|
|
1322
|
-
|
|
1323
|
-
const invalidFields: string[] = []
|
|
1324
|
-
for (const { ref, name } of fields) {
|
|
1325
|
-
const isValid = await ref.value?.validateOnSubmit()
|
|
1326
|
-
if (!isValid) {
|
|
1327
|
-
invalidFields.push(name)
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
if (invalidFields.length > 0) {
|
|
1332
|
-
alert(`Les champs suivants sont invalides: ${invalidFields.join(', ')}`)
|
|
1333
|
-
}
|
|
1334
|
-
else {
|
|
1335
|
-
alert('Formulaire soumis avec succès !')
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
return {
|
|
1340
|
-
args,
|
|
1341
|
-
nomField,
|
|
1342
|
-
prenomField,
|
|
1343
|
-
ageField,
|
|
1344
|
-
nomValue,
|
|
1345
|
-
prenomValue,
|
|
1346
|
-
ageValue,
|
|
1347
|
-
prenomRules,
|
|
1348
|
-
ageRules,
|
|
1349
|
-
handleSubmit,
|
|
1350
|
-
}
|
|
1351
|
-
},
|
|
1352
|
-
template: `
|
|
1353
|
-
<div style="max-width: 500px;">
|
|
1354
|
-
<h3>Validation de formulaire</h3>
|
|
1355
|
-
<form @submit.prevent="handleSubmit">
|
|
1356
|
-
<div class="mb-4">
|
|
1357
|
-
<SyTextField
|
|
1358
|
-
ref="nomField"
|
|
1359
|
-
v-model="nomValue"
|
|
1360
|
-
label="Nom"
|
|
1361
|
-
placeholder="Votre nom"
|
|
1362
|
-
autocomplete="family-name"
|
|
1363
|
-
required
|
|
1364
|
-
show-success-messages
|
|
1365
|
-
class="mb-4"
|
|
1366
|
-
aria-describedby="nom-rule"
|
|
1367
|
-
/>
|
|
1368
|
-
|
|
1369
|
-
<SyTextField
|
|
1370
|
-
ref="prenomField"
|
|
1371
|
-
v-model="prenomValue"
|
|
1372
|
-
label="Prénom"
|
|
1373
|
-
placeholder="Votre prénom"
|
|
1374
|
-
autocomplete="given-name"
|
|
1375
|
-
required
|
|
1376
|
-
:custom-rules="prenomRules"
|
|
1377
|
-
show-success-messages
|
|
1378
|
-
class="mb-4"
|
|
1379
|
-
aria-describedby="prenom-rule"
|
|
1380
|
-
/>
|
|
1381
|
-
|
|
1382
|
-
<SyTextField
|
|
1383
|
-
ref="ageField"
|
|
1384
|
-
v-model="ageValue"
|
|
1385
|
-
label="Âge"
|
|
1386
|
-
required
|
|
1387
|
-
placeholder="Votre âge"
|
|
1388
|
-
:custom-rules="ageRules"
|
|
1389
|
-
show-success-messages
|
|
1390
|
-
class="mb-4"
|
|
1391
|
-
aria-describedby="age-rule"
|
|
1392
|
-
/>
|
|
1393
|
-
</div>
|
|
1394
|
-
|
|
1395
|
-
<div class="text-caption mb-4">
|
|
1396
|
-
<strong>Règles de validation :</strong>
|
|
1397
|
-
<ul>
|
|
1398
|
-
<li id="nom-rule">Nom : Champ requis</li>
|
|
1399
|
-
<li id="prenom-rule">Prénom : Minimum 3 caractères</li>
|
|
1400
|
-
<li id="age-rule">Âge : Uniquement des chiffres</li>
|
|
1401
|
-
</ul>
|
|
1402
|
-
</div>
|
|
1403
|
-
|
|
1404
|
-
<VBtn type="submit" color="primary">
|
|
1405
|
-
Soumettre
|
|
1406
|
-
</VBtn>
|
|
1407
|
-
</form>
|
|
1408
|
-
</div>
|
|
1409
|
-
`,
|
|
1410
|
-
}),
|
|
1411
|
-
parameters: {
|
|
1412
|
-
docs: {
|
|
1413
|
-
description: {
|
|
1414
|
-
story: 'Exemple de champ avec validation désactivée au blur. La validation ne se déclenche que lors de la soumission du formulaire.',
|
|
1415
|
-
},
|
|
1416
|
-
},
|
|
1417
|
-
sourceCode: [
|
|
1418
|
-
{
|
|
1419
|
-
name: 'Template',
|
|
1420
|
-
code: `
|
|
1421
|
-
<template>
|
|
1422
|
-
<div>
|
|
1423
|
-
<div style="max-width: 500px;">
|
|
1424
|
-
<h3>Validation de formulaire</h3>
|
|
1425
|
-
<form @submit.prevent="handleSubmit">
|
|
1426
|
-
<div class="mb-4">
|
|
1427
|
-
<SyTextField
|
|
1428
|
-
ref="nomField"
|
|
1429
|
-
v-model="nomValue"
|
|
1430
|
-
label="Nom"
|
|
1431
|
-
placeholder="Votre nom"
|
|
1432
|
-
autocomplete="family-name"
|
|
1433
|
-
required
|
|
1434
|
-
show-success-messages
|
|
1435
|
-
class="mb-4"
|
|
1436
|
-
aria-describedby="nom-rule"
|
|
1437
|
-
/>
|
|
1438
|
-
|
|
1439
|
-
<SyTextField
|
|
1440
|
-
ref="prenomField"
|
|
1441
|
-
v-model="prenomValue"
|
|
1442
|
-
label="Prénom"
|
|
1443
|
-
placeholder="Votre prénom"
|
|
1444
|
-
autocomplete="given-name"
|
|
1445
|
-
required
|
|
1446
|
-
:custom-rules="prenomRules"
|
|
1447
|
-
show-success-messages
|
|
1448
|
-
class="mb-4"
|
|
1449
|
-
aria-describedby="prenom-rule"
|
|
1450
|
-
/>
|
|
1451
|
-
|
|
1452
|
-
<SyTextField
|
|
1453
|
-
ref="ageField"
|
|
1454
|
-
v-model="ageValue"
|
|
1455
|
-
label="Âge"
|
|
1456
|
-
required
|
|
1457
|
-
placeholder="Votre âge"
|
|
1458
|
-
:custom-rules="ageRules"
|
|
1459
|
-
show-success-messages
|
|
1460
|
-
class="mb-4"
|
|
1461
|
-
aria-describedby="age-rule"
|
|
1462
|
-
/>
|
|
1463
|
-
</div>
|
|
1464
|
-
|
|
1465
|
-
<div class="text-caption mb-4">
|
|
1466
|
-
<strong>Règles de validation :</strong>
|
|
1467
|
-
<ul>
|
|
1468
|
-
<li id="nom-rule">Nom : Champ requis</li>
|
|
1469
|
-
<li id="prenom-rule">Prénom : Minimum 3 caractères</li>
|
|
1470
|
-
<li id="age-rule">Âge : Uniquement des chiffres</li>
|
|
1471
|
-
</ul>
|
|
1472
|
-
</div>
|
|
1473
|
-
|
|
1474
|
-
<VBtn type="submit" color="primary">
|
|
1475
|
-
Soumettre
|
|
1476
|
-
</VBtn>
|
|
1477
|
-
</form>
|
|
1478
|
-
</div>
|
|
1479
|
-
</div>
|
|
1480
|
-
</template>
|
|
1481
|
-
`,
|
|
1482
|
-
},
|
|
1483
|
-
{
|
|
1484
|
-
name: 'Script',
|
|
1485
|
-
code: `
|
|
1486
|
-
<script setup lang="ts">
|
|
1487
|
-
const nomField = ref()
|
|
1488
|
-
const prenomField = ref()
|
|
1489
|
-
const ageField = ref()
|
|
1490
|
-
const nomValue = ref('')
|
|
1491
|
-
const prenomValue = ref('')
|
|
1492
|
-
const ageValue = ref('')
|
|
1493
|
-
|
|
1494
|
-
// Règle minLength pour le prénom
|
|
1495
|
-
const prenomRules = [{
|
|
1496
|
-
type: 'minLength',
|
|
1497
|
-
options: {
|
|
1498
|
-
length: 3,
|
|
1499
|
-
message: 'Le prénom doit contenir au moins 3 caractères',
|
|
1500
|
-
successMessage: 'Le prénom est valide',
|
|
1501
|
-
fieldIdentifier: 'prénom',
|
|
1502
|
-
},
|
|
1503
|
-
}]
|
|
1504
|
-
|
|
1505
|
-
// Règle pattern pour l'âge (uniquement des chiffres)
|
|
1506
|
-
const ageRules = [{
|
|
1507
|
-
type: 'matchPattern',
|
|
1508
|
-
options: {
|
|
1509
|
-
pattern: /^d+$/,
|
|
1510
|
-
message: 'L'âge doit contenir uniquement des chiffres',
|
|
1511
|
-
successMessage: 'L'âge est valide',
|
|
1512
|
-
fieldIdentifier: 'âge',
|
|
1513
|
-
},
|
|
1514
|
-
}]
|
|
1515
|
-
|
|
1516
|
-
const handleSubmit = () => {
|
|
1517
|
-
const fields = [
|
|
1518
|
-
{ ref: nomField, name: 'Nom' },
|
|
1519
|
-
{ ref: prenomField, name: 'Prénom' },
|
|
1520
|
-
{ ref: ageField, name: 'Âge' },
|
|
1521
|
-
]
|
|
1522
|
-
|
|
1523
|
-
const invalidFields: string[] = []
|
|
1524
|
-
for (const { ref, name } of fields) {
|
|
1525
|
-
const isValid = await ref.value?.validateOnSubmit()
|
|
1526
|
-
if (!isValid) {
|
|
1527
|
-
invalidFields.push(name)
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
if (invalidFields.length > 0) {
|
|
1532
|
-
alert('Les champs suivants sont invalides: ' + invalidFields.join('\\n'))
|
|
1533
|
-
}
|
|
1534
|
-
else {
|
|
1535
|
-
alert('Formulaire soumis avec succès !')
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
</script>
|
|
1539
|
-
`,
|
|
1540
|
-
},
|
|
1541
|
-
],
|
|
1542
|
-
},
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
1132
|
export const WithPrefixAndSuffix: Story = {
|
|
1546
1133
|
args: {
|
|
1547
1134
|
modelValue: '42',
|
|
@@ -1591,208 +1178,3 @@ export const WithPrefixAndSuffix: Story = {
|
|
|
1591
1178
|
],
|
|
1592
1179
|
},
|
|
1593
1180
|
}
|
|
1594
|
-
|
|
1595
|
-
export const DisabledErrorHandling: Story = {
|
|
1596
|
-
args: {
|
|
1597
|
-
label: 'Champ requis',
|
|
1598
|
-
required: true,
|
|
1599
|
-
customRules: [
|
|
1600
|
-
{
|
|
1601
|
-
type: 'required',
|
|
1602
|
-
options: {
|
|
1603
|
-
message: 'Ce champ est obligatoire.',
|
|
1604
|
-
},
|
|
1605
|
-
},
|
|
1606
|
-
],
|
|
1607
|
-
},
|
|
1608
|
-
render: (args) => {
|
|
1609
|
-
return {
|
|
1610
|
-
components: { SyTextField },
|
|
1611
|
-
setup() {
|
|
1612
|
-
const value1 = ref('')
|
|
1613
|
-
const value2 = ref('')
|
|
1614
|
-
|
|
1615
|
-
return { args, value1, value2 }
|
|
1616
|
-
},
|
|
1617
|
-
template: `
|
|
1618
|
-
<div>
|
|
1619
|
-
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
|
|
1620
|
-
<div>
|
|
1621
|
-
<p class="text-subtitle-2 mb-2">Validation normale</p>
|
|
1622
|
-
<SyTextField
|
|
1623
|
-
v-model="value1"
|
|
1624
|
-
v-bind="args"
|
|
1625
|
-
is-validate-on-blur
|
|
1626
|
-
/>
|
|
1627
|
-
</div>
|
|
1628
|
-
|
|
1629
|
-
<div>
|
|
1630
|
-
<p class="text-subtitle-2 mb-2">Sans gestion d'erreurs</p>
|
|
1631
|
-
<SyTextField
|
|
1632
|
-
v-model="value2"
|
|
1633
|
-
v-bind="args"
|
|
1634
|
-
disableErrorHandling
|
|
1635
|
-
is-validate-on-blur
|
|
1636
|
-
/>
|
|
1637
|
-
</div>
|
|
1638
|
-
</div>
|
|
1639
|
-
|
|
1640
|
-
<div class="mt-4 text-body-2">
|
|
1641
|
-
<p>Instructions :</p>
|
|
1642
|
-
<ol>
|
|
1643
|
-
<li class="ml-4">Cliquez dans un champ puis en dehors pour déclencher la validation</li>
|
|
1644
|
-
<li class="ml-4">Observez que le champ de gauche affiche un message d'erreur</li>
|
|
1645
|
-
<li class="ml-4">Le champ de droite n'affiche aucune erreur malgré les mêmes règles</li>
|
|
1646
|
-
</ol>
|
|
1647
|
-
</div>
|
|
1648
|
-
</div>
|
|
1649
|
-
`,
|
|
1650
|
-
}
|
|
1651
|
-
},
|
|
1652
|
-
parameters: {
|
|
1653
|
-
docs: {
|
|
1654
|
-
description: {
|
|
1655
|
-
story: 'La prop `disableErrorHandling` permet de désactiver complètement la gestion des erreurs de validation, même si des règles sont définies.',
|
|
1656
|
-
},
|
|
1657
|
-
},
|
|
1658
|
-
sourceCode: [
|
|
1659
|
-
{
|
|
1660
|
-
name: 'Template',
|
|
1661
|
-
code: `
|
|
1662
|
-
<template>
|
|
1663
|
-
<!-- Champ avec validation normale -->
|
|
1664
|
-
<SyTextField
|
|
1665
|
-
v-model="value"
|
|
1666
|
-
label="Champ obligatoire"
|
|
1667
|
-
required
|
|
1668
|
-
:custom-rules="[{
|
|
1669
|
-
type: 'required',
|
|
1670
|
-
options: { message: 'Ce champ est obligatoire.' }
|
|
1671
|
-
}]"
|
|
1672
|
-
is-validate-on-blur
|
|
1673
|
-
/>
|
|
1674
|
-
|
|
1675
|
-
<!-- Champ avec gestion d'erreur désactivée -->
|
|
1676
|
-
<SyTextField
|
|
1677
|
-
v-model="value"
|
|
1678
|
-
label="Champ obligatoire"
|
|
1679
|
-
required
|
|
1680
|
-
:custom-rules="[{
|
|
1681
|
-
type: 'required',
|
|
1682
|
-
options: { message: 'Ce champ est obligatoire.' }
|
|
1683
|
-
}]"
|
|
1684
|
-
disableErrorHandling
|
|
1685
|
-
is-validate-on-blur
|
|
1686
|
-
/>
|
|
1687
|
-
</template>`,
|
|
1688
|
-
},
|
|
1689
|
-
],
|
|
1690
|
-
},
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
export const WithoutSuccessMessages: Story = {
|
|
1694
|
-
args: {
|
|
1695
|
-
label: 'Email',
|
|
1696
|
-
customRules: [
|
|
1697
|
-
{
|
|
1698
|
-
type: 'matchPattern',
|
|
1699
|
-
options: {
|
|
1700
|
-
pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
1701
|
-
message: 'Veuillez entrer une adresse email valide',
|
|
1702
|
-
successMessage: 'Le format de l\'email est correct',
|
|
1703
|
-
fieldIdentifier: 'Email',
|
|
1704
|
-
},
|
|
1705
|
-
},
|
|
1706
|
-
],
|
|
1707
|
-
},
|
|
1708
|
-
render: (args) => {
|
|
1709
|
-
return {
|
|
1710
|
-
components: { SyTextField },
|
|
1711
|
-
setup() {
|
|
1712
|
-
const value1 = ref('user@example.com')
|
|
1713
|
-
const value2 = ref('user@example.com')
|
|
1714
|
-
|
|
1715
|
-
return { args, value1, value2 }
|
|
1716
|
-
},
|
|
1717
|
-
template: `
|
|
1718
|
-
<div>
|
|
1719
|
-
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
|
|
1720
|
-
<div>
|
|
1721
|
-
<p class="text-subtitle-2 mb-2">Avec messages de succès (défaut)</p>
|
|
1722
|
-
<SyTextField
|
|
1723
|
-
v-model="value1"
|
|
1724
|
-
v-bind="args"
|
|
1725
|
-
autocomplete="email"
|
|
1726
|
-
showSuccessMessages
|
|
1727
|
-
/>
|
|
1728
|
-
</div>
|
|
1729
|
-
|
|
1730
|
-
<div>
|
|
1731
|
-
<p class="text-subtitle-2 mb-2">Sans messages de succès</p>
|
|
1732
|
-
<SyTextField
|
|
1733
|
-
v-model="value2"
|
|
1734
|
-
v-bind="args"
|
|
1735
|
-
autocomplete="email"
|
|
1736
|
-
:showSuccessMessages="false"
|
|
1737
|
-
/>
|
|
1738
|
-
</div>
|
|
1739
|
-
</div>
|
|
1740
|
-
|
|
1741
|
-
<div class="mt-4 text-body-2">
|
|
1742
|
-
<p>Les deux champs ont la même valeur et passent la validation :</p>
|
|
1743
|
-
<ul >
|
|
1744
|
-
<li class="ml-4">Le champ de gauche affiche le message de succès</li>
|
|
1745
|
-
<li class="ml-4">Le champ de droite n'affiche aucun message</li>
|
|
1746
|
-
</ul>
|
|
1747
|
-
<p class="mt-2">Essayez de modifier les valeurs pour voir le comportement.</p>
|
|
1748
|
-
</div>
|
|
1749
|
-
</div>
|
|
1750
|
-
`,
|
|
1751
|
-
}
|
|
1752
|
-
},
|
|
1753
|
-
parameters: {
|
|
1754
|
-
docs: {
|
|
1755
|
-
description: {
|
|
1756
|
-
story: 'La prop `showSuccessMessages` (par défaut: `true`) permet de contrôler l\'affichage des messages de succès lors de la validation.',
|
|
1757
|
-
},
|
|
1758
|
-
},
|
|
1759
|
-
sourceCode: [
|
|
1760
|
-
{
|
|
1761
|
-
name: 'Template',
|
|
1762
|
-
code: `
|
|
1763
|
-
<template>
|
|
1764
|
-
<!-- Champ avec messages de succès (défaut) -->
|
|
1765
|
-
<SyTextField
|
|
1766
|
-
v-model="email"
|
|
1767
|
-
label="Email"
|
|
1768
|
-
autocomplete="email"
|
|
1769
|
-
:custom-rules="[{
|
|
1770
|
-
type: 'matchPattern',
|
|
1771
|
-
options: {
|
|
1772
|
-
pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,
|
|
1773
|
-
message: 'Veuillez entrer une adresse email valide',
|
|
1774
|
-
successMessage: 'Le format de l\\'email est correct',
|
|
1775
|
-
}
|
|
1776
|
-
}]"
|
|
1777
|
-
/>
|
|
1778
|
-
|
|
1779
|
-
<!-- Champ sans messages de succès -->
|
|
1780
|
-
<SyTextField
|
|
1781
|
-
v-model="email"
|
|
1782
|
-
label="Email"
|
|
1783
|
-
autocomplete="email"
|
|
1784
|
-
:custom-rules="[{
|
|
1785
|
-
type: 'matchPattern',
|
|
1786
|
-
options: {
|
|
1787
|
-
pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,
|
|
1788
|
-
message: 'Veuillez entrer une adresse email valide',
|
|
1789
|
-
successMessage: 'Le format de l\\'email est correct',
|
|
1790
|
-
}
|
|
1791
|
-
}]"
|
|
1792
|
-
:showSuccessMessages="false"
|
|
1793
|
-
/>
|
|
1794
|
-
</template>`,
|
|
1795
|
-
},
|
|
1796
|
-
],
|
|
1797
|
-
},
|
|
1798
|
-
}
|