@cnamts/synapse 1.0.26 → 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-BPR-a55G.js → AutocompleteFilter-DXd4szWO.js} +1 -1
- package/dist/{DateFilter-CknrJWs2.js → DateFilter-BD59Kgwf.js} +1 -1
- package/dist/{NumberFilter-DJ-yNlzv.js → NumberFilter-BSMZE7uw.js} +1 -1
- package/dist/{PeriodFilter-CiB5Oa9Z.js → PeriodFilter-keUdSSk0.js} +1 -1
- package/dist/{SelectFilter-EiafX97M.js → SelectFilter-Dhvvwazl.js} +1 -1
- package/dist/{TextFilter-BzOmpdxj.js → TextFilter-CU8FpXz0.js} +1 -1
- package/dist/apLightTheme2026-DbS7BPUf.js +612 -0
- 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 +2275 -487
- 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/SyInputSelect/SyInputSelect.d.ts +1 -1
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +12 -15
- 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 +4 -4
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +6 -6
- package/dist/components/Customs/SyIcon/SyIcon.d.ts +77 -1
- package/dist/components/Customs/SyIconButton/SyIconButton.d.ts +18 -0
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +23 -41
- package/dist/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.d.ts +50 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +20 -80
- 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 +253 -694
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +121 -339
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +54 -164
- package/dist/components/DatePicker/composables/index.d.ts +1 -0
- package/dist/components/DatePicker/composables/useDatePickerValidationBridge.d.ts +51 -0
- 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 +49 -162
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +49 -162
- package/dist/components/NirField/NirField.d.ts +120 -351
- package/dist/components/NirField/useNirValidation.d.ts +10 -20
- package/dist/components/PasswordField/PasswordField.d.ts +21 -40
- 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 +485 -1365
- package/dist/components/PhoneField/PhoneField.d.ts +49 -162
- package/dist/components/SearchListField/SearchListField.d.ts +3 -3
- package/dist/components/SyTextArea/SyTextArea.d.ts +30 -17
- 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 +33 -34
- 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 +17 -23
- package/dist/composables/useFilterable/useFilterable.d.ts +1 -2
- 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 +54 -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 +54 -97
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +1 -0
- package/dist/designTokens/tokens/semanticTokens.d.ts +112 -0
- package/dist/main-D8ryUoS5.js +39481 -0
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +212 -74
- package/package.json +8 -5
- 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/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-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/ChipList.vue +30 -18
- 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/ChipList/tests/chipList.spec.ts +4 -4
- 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/CopyBtn.vue +2 -2
- 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/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/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.stories.ts +283 -351
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +183 -219
- package/src/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.ts +101 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +763 -1
- 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/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 +936 -0
- 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.stories.ts +9 -491
- package/src/components/Customs/Selects/SySelect/SySelect.vue +68 -126
- 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 +199 -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 +935 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +18 -7
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +3 -3
- 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.stories.ts +8 -8
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +9 -17
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +1 -1
- 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/accessibilite/Accessibility.mdx +0 -6
- 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/SyIcon/utils/tests/iconUtils.spec.ts +107 -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.mdx +2 -2
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.stories.ts +395 -201
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +83 -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/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 +809 -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/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/SyTabs/tests/useTabTransition.spec.ts +188 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +166 -803
- package/src/components/Customs/SyTextField/SyTextField.vue +191 -168
- 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/DataList.stories.ts +1 -1
- 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.spec.ts +3 -1
- 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 +43 -148
- 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.stories.ts +1 -1
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +51 -71
- 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/DateRange.stories.ts +1 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +131 -56
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +1 -1
- 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/tests/useTodayButton.spec.ts +10 -10
- package/src/components/DatePicker/composables/useCalendarKeyboardNavigation.ts +11 -2
- 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/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/DialogBox.vue +1 -1
- 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/UploadItem/UploadItem.vue +4 -4
- 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/FileUpload.vue +2 -2
- package/src/components/FileUpload/FileUploadContent.vue +1 -1
- 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.mdx +2 -2
- 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 +5 -2
- package/src/components/FilterSideBar/FilterSideBar.vue +13 -8
- 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/FooterBar.vue +7 -7
- 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/FranceConnectBtn.vue +1 -1
- 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/HeaderMenuItem/HeaderMenuItem.vue +2 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +7 -7
- 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/HeaderMenuBtn/HeaderMenuBtn.vue +2 -2
- 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.spec.ts +87 -8
- 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/HorizontalNavbar/HorizontalNavbar.vue +3 -3
- package/src/components/HeaderNavigationBar/HorizontalNavbar/tests/HorizontalNavbar.spec.ts +589 -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.spec.ts +153 -1
- 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/HeaderToolbar/tests/useMobileRightMenu.spec.ts +258 -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-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.spec.ts +2 -2
- package/src/components/LogoBrandSection/tests/LogoBrandSection.visual.cy.ts +43 -0
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +1 -1
- 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/LunarCalendar/tests/useLunarCalendarRules.spec.ts +184 -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/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/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 +101 -35
- 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/Notification/Notification.vue +12 -12
- package/src/components/NotificationBar/NotificationBar.stories.ts +8 -8
- 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/Pagination.vue +2 -2
- 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 +128 -199
- 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 +147 -109
- 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/RangeSlider/RangeSlider.vue +2 -2
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +1 -1
- 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.spec.ts +149 -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/SubHeader.vue +1 -1
- 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/SyAlert.vue +23 -23
- 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 +202 -131
- package/src/components/SyTextArea/SyTextArea.vue +242 -83
- package/src/components/SyTextArea/composables/useSyTextAreaValidation.ts +81 -0
- package/src/components/SyTextArea/locales.ts +1 -0
- package/src/components/SyTextArea/tests/SyTextArea.a11y.spec.ts +18 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +583 -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/useDefaultValidationRules.ts +2 -7
- package/src/components/SyTextArea/validation/Validation.stories.ts +776 -0
- package/src/components/TableToolbar/TableToolbar.vue +6 -6
- package/src/components/TableToolbar/accessibilite/Accessibility.mdx +81 -7
- 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.stories.ts +163 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +5 -4
- package/src/components/Tables/SyServerTable/accessibilite/Accessibility.mdx +114 -7
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- 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/SyTable.stories.ts +94 -0
- package/src/components/Tables/SyTable/SyTable.vue +2 -1
- package/src/components/Tables/SyTable/accessibilite/Accessibility.mdx +116 -7
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +64 -0
- 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/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 +10 -10
- 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/Tables/common/types.ts +2 -0
- 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 +3 -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/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 +6 -6
- 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 +35 -32
- package/src/composables/useFilterable/useFilterable.spec.ts +139 -134
- package/src/composables/useFilterable/useFilterable.ts +17 -24
- package/src/composables/useFormFieldErrorHandling.ts +3 -3
- 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/VBtn/VBtn.mdx +9 -39
- package/src/composantsVuetify/VBtn/v-btn.stories.ts +26 -86
- 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/apContextual.ts +6 -0
- package/src/designTokens/tokens/amelipro/apDarkTheme.ts +2 -2
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +73 -103
- package/src/designTokens/tokens/amelipro/apSemantic.ts +2 -2
- 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 +74 -99
- package/src/designTokens/tokens/pa/paSemantic.ts +2 -0
- package/src/designTokens/tokens/semanticTokens.ts +114 -0
- package/src/stories/Accessibilite/DesignSystem/a11y-status.json +1 -1
- package/src/stories/Components/Components.stories.ts +68 -13
- package/src/stories/Demarrer/Releases.stories.ts +45 -2
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +2 -3
- package/src/stories/DesignTokens/Colors.mdx +8 -8
- package/src/stories/DesignTokens/colors.stories.ts +257 -1081
- 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/amelipro/toKebabCase/tests/toKebabCase.spec.ts +52 -0
- package/src/utils/formatNir/tests/formatNir.spec.ts +34 -0
- package/src/utils/functions/deepCopy/index.ts +2 -3
- package/src/utils/tests/insertAt.spec.ts +44 -0
- package/dist/apLightTheme-DS0Uy44H.js +0 -954
- package/dist/components/Customs/SyCheckbox/locales.d.ts +0 -3
- package/dist/components/RatingPicker/tests/RatingPicker.a11y.spect.d.ts +0 -1
- package/dist/components/SyHeading/SyHeading.a11y.test.d.ts +0 -1
- package/dist/components/SyHeading/SyHeading.test.d.ts +0 -1
- package/dist/main-BsJ9ec3i.js +0 -38954
- package/src/components/Customs/SyCheckbox/locales.ts +0 -3
- package/src/components/Customs/SyTextField/types.d.ts +0 -4
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.events.spec.ts +0 -178
- /package/src/components/RatingPicker/tests/{RatingPicker.a11y.spect.ts → RatingPicker.a11y.spec.ts} +0 -0
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import PasswordField from './PasswordField.vue'
|
|
4
|
+
import type { PasswordFieldProps } from './types'
|
|
5
|
+
import { fn } from '@storybook/test'
|
|
6
|
+
import { getValidationDocumentation } from '@/composables/unifyValidation/documentationValidationProps'
|
|
7
|
+
|
|
8
|
+
type PasswordFieldStoryArgs = PasswordFieldProps & {
|
|
9
|
+
'onUpdate:modelValue': (...args: unknown[]) => unknown
|
|
10
|
+
'onSubmit': (...args: unknown[]) => unknown
|
|
11
|
+
}
|
|
4
12
|
|
|
5
13
|
const meta = {
|
|
6
14
|
title: 'Composants/Formulaires/PasswordField',
|
|
@@ -12,6 +20,7 @@ const meta = {
|
|
|
12
20
|
],
|
|
13
21
|
parameters: {
|
|
14
22
|
layout: 'fullscreen',
|
|
23
|
+
controls: { exclude: '^on*' },
|
|
15
24
|
docs: {
|
|
16
25
|
description: {
|
|
17
26
|
component: `PasswordField est un champ de saisie sécurisé pour les mots de passe`,
|
|
@@ -19,112 +28,87 @@ const meta = {
|
|
|
19
28
|
},
|
|
20
29
|
},
|
|
21
30
|
argTypes: {
|
|
22
|
-
|
|
31
|
+
...getValidationDocumentation('string'),
|
|
32
|
+
'modelValue': {
|
|
23
33
|
control: 'text',
|
|
24
34
|
description: 'Valeur du champ de mot de passe',
|
|
25
35
|
},
|
|
26
|
-
variantStyle: {
|
|
36
|
+
'variantStyle': {
|
|
27
37
|
control: 'select',
|
|
28
38
|
options: ['outlined', 'underlined'],
|
|
29
39
|
description: 'Style du champ (contour ou souligné)',
|
|
30
40
|
},
|
|
31
|
-
color: {
|
|
41
|
+
'color': {
|
|
32
42
|
control: 'select',
|
|
33
43
|
options: ['primary', 'secondary', 'error', 'warning', 'success', 'info'],
|
|
34
44
|
description: 'Couleur principale du champ',
|
|
35
45
|
},
|
|
36
|
-
label: {
|
|
46
|
+
'label': {
|
|
37
47
|
control: 'text',
|
|
38
48
|
description: 'Libellé du champ',
|
|
39
49
|
},
|
|
40
|
-
|
|
41
|
-
control: 'boolean',
|
|
42
|
-
description: 'Indique si le champ est obligatoire',
|
|
43
|
-
},
|
|
44
|
-
errorMessages: {
|
|
45
|
-
control: 'object',
|
|
46
|
-
description: 'Messages d\'erreur à afficher',
|
|
47
|
-
},
|
|
48
|
-
warningMessages: {
|
|
49
|
-
control: 'object',
|
|
50
|
-
description: 'Messages d\'avertissement à afficher',
|
|
51
|
-
},
|
|
52
|
-
successMessages: {
|
|
53
|
-
control: 'object',
|
|
54
|
-
description: 'Messages de succès à afficher',
|
|
55
|
-
},
|
|
56
|
-
readonly: {
|
|
57
|
-
control: 'boolean',
|
|
58
|
-
description: 'Indique si le champ est en lecture seule',
|
|
59
|
-
},
|
|
60
|
-
disabled: {
|
|
61
|
-
control: 'boolean',
|
|
62
|
-
description: 'Indique si le champ est désactivé',
|
|
63
|
-
},
|
|
64
|
-
placeholder: {
|
|
65
|
-
control: 'text',
|
|
66
|
-
description: 'Texte d\'indication affiché lorsque le champ est vide',
|
|
67
|
-
},
|
|
68
|
-
customRules: {
|
|
69
|
-
control: 'object',
|
|
70
|
-
description: 'Règles de validation personnalisées',
|
|
71
|
-
},
|
|
72
|
-
customWarningRules: {
|
|
73
|
-
control: 'object',
|
|
74
|
-
description: 'Règles d\'avertissement personnalisées',
|
|
75
|
-
},
|
|
76
|
-
customSuccessRules: {
|
|
77
|
-
control: 'object',
|
|
78
|
-
description: 'Règles de succès personnalisées',
|
|
79
|
-
},
|
|
80
|
-
showSuccessMessages: {
|
|
81
|
-
control: 'boolean',
|
|
82
|
-
description: 'Indique si les messages de succès doivent être affichés',
|
|
83
|
-
},
|
|
84
|
-
displayAsterisk: {
|
|
50
|
+
'displayAsterisk': {
|
|
85
51
|
control: 'boolean',
|
|
86
52
|
description: 'Affiche un astérisque à côté du libellé pour indiquer que le champ est obligatoire',
|
|
87
53
|
},
|
|
88
|
-
|
|
89
|
-
control: 'boolean',
|
|
90
|
-
description: 'Indique si la validation doit être effectuée lors de la perte de focus',
|
|
91
|
-
},
|
|
92
|
-
bgColor: {
|
|
54
|
+
'bgColor': {
|
|
93
55
|
control: 'color',
|
|
94
56
|
description: 'Couleur de fond du champ',
|
|
95
57
|
},
|
|
96
|
-
|
|
58
|
+
'clearable': {
|
|
59
|
+
control: 'boolean',
|
|
60
|
+
description: 'Affiche un bouton pour vider le champ',
|
|
61
|
+
},
|
|
62
|
+
'autocompleteType': {
|
|
97
63
|
control: 'select',
|
|
98
64
|
options: ['current-password', 'new-password'],
|
|
99
65
|
description: 'Type d\'auto-complétion',
|
|
100
66
|
default: 'current-password',
|
|
101
67
|
},
|
|
68
|
+
'helpText': {
|
|
69
|
+
control: 'text',
|
|
70
|
+
description: 'Texte d\'aide affiché sous le champ',
|
|
71
|
+
},
|
|
72
|
+
'hideDetails': {
|
|
73
|
+
control: 'boolean',
|
|
74
|
+
description: 'Masque la zone de détails (messages d\'erreur, d\'aide…) sous le champ',
|
|
75
|
+
},
|
|
76
|
+
'update:modelValue': {
|
|
77
|
+
action: 'update:modelValue',
|
|
78
|
+
description: 'Événement émis lors de la mise à jour de la valeur du champ',
|
|
79
|
+
table: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
},
|
|
82
|
+
category: 'Events',
|
|
83
|
+
},
|
|
102
84
|
},
|
|
103
85
|
args: {
|
|
104
|
-
modelValue: '',
|
|
105
|
-
variantStyle: 'outlined',
|
|
106
|
-
color: 'primary',
|
|
107
|
-
label: 'Mot de passe',
|
|
108
|
-
required: false,
|
|
109
|
-
errorMessages: null,
|
|
110
|
-
warningMessages: null,
|
|
111
|
-
successMessages: null,
|
|
112
|
-
readonly: false,
|
|
113
|
-
disabled: false,
|
|
114
|
-
placeholder: 'Entrez votre mot de passe',
|
|
115
|
-
customRules: [],
|
|
116
|
-
customWarningRules: [],
|
|
117
|
-
customSuccessRules: [],
|
|
118
|
-
showSuccessMessages:
|
|
119
|
-
displayAsterisk: false,
|
|
120
|
-
|
|
121
|
-
|
|
86
|
+
'modelValue': '',
|
|
87
|
+
'variantStyle': 'outlined',
|
|
88
|
+
'color': 'primary',
|
|
89
|
+
'label': 'Mot de passe',
|
|
90
|
+
'required': false,
|
|
91
|
+
'errorMessages': null,
|
|
92
|
+
'warningMessages': null,
|
|
93
|
+
'successMessages': null,
|
|
94
|
+
'readonly': false,
|
|
95
|
+
'disabled': false,
|
|
96
|
+
'placeholder': 'Entrez votre mot de passe',
|
|
97
|
+
'customRules': [],
|
|
98
|
+
'customWarningRules': [],
|
|
99
|
+
'customSuccessRules': [],
|
|
100
|
+
'showSuccessMessages': false,
|
|
101
|
+
'displayAsterisk': false,
|
|
102
|
+
'clearable': false,
|
|
103
|
+
'isValidateOnBlur': true,
|
|
104
|
+
'bgColor': 'white',
|
|
105
|
+
'onUpdate:modelValue': fn(),
|
|
122
106
|
},
|
|
123
|
-
}
|
|
107
|
+
} as Meta<PasswordFieldStoryArgs>
|
|
124
108
|
|
|
125
109
|
export default meta
|
|
126
110
|
|
|
127
|
-
type Story = StoryObj<
|
|
111
|
+
type Story = StoryObj<PasswordFieldStoryArgs>
|
|
128
112
|
|
|
129
113
|
/**
|
|
130
114
|
* Story par défaut montrant un champ de mot de passe basique.
|
|
@@ -163,28 +147,13 @@ export const Default: Story = {
|
|
|
163
147
|
render: args => ({
|
|
164
148
|
components: { PasswordField },
|
|
165
149
|
setup() {
|
|
166
|
-
const password = ref(args.modelValue)
|
|
150
|
+
const password = ref(args.modelValue ?? '')
|
|
167
151
|
return { args, password }
|
|
168
152
|
},
|
|
169
153
|
template: `
|
|
170
154
|
<PasswordField
|
|
155
|
+
v-bind="args"
|
|
171
156
|
v-model="password"
|
|
172
|
-
:variant-style="args.variantStyle"
|
|
173
|
-
:color="args.color"
|
|
174
|
-
:label="args.label"
|
|
175
|
-
:required="args.required"
|
|
176
|
-
:error-messages="args.errorMessages"
|
|
177
|
-
:warning-messages="args.warningMessages"
|
|
178
|
-
:success-messages="args.successMessages"
|
|
179
|
-
:readonly="args.readonly"
|
|
180
|
-
:disabled="args.disabled"
|
|
181
|
-
:placeholder="args.placeholder"
|
|
182
|
-
:custom-rules="args.customRules"
|
|
183
|
-
:custom-warning-rules="args.customWarningRules"
|
|
184
|
-
:custom-success-rules="args.customSuccessRules"
|
|
185
|
-
:show-success-messages="args.showSuccessMessages"
|
|
186
|
-
:display-asterisk="args.displayAsterisk"
|
|
187
|
-
:is-validate-on-blur="args.isValidateOnBlur"
|
|
188
157
|
/>
|
|
189
158
|
`,
|
|
190
159
|
}),
|
|
@@ -351,78 +320,7 @@ export const ReadOnly: Story = {
|
|
|
351
320
|
},
|
|
352
321
|
}
|
|
353
322
|
|
|
354
|
-
|
|
355
|
-
* Champ de mot de passe avec règles de validation qui génèrent une erreur.
|
|
356
|
-
*/
|
|
357
|
-
export const WithError: Story = {
|
|
358
|
-
parameters: {
|
|
359
|
-
a11y: {
|
|
360
|
-
disable: true,
|
|
361
|
-
},
|
|
362
|
-
sourceCode: [
|
|
363
|
-
{
|
|
364
|
-
name: 'Template',
|
|
365
|
-
code: `
|
|
366
|
-
<template>
|
|
367
|
-
<PasswordField
|
|
368
|
-
v-model="password"
|
|
369
|
-
label="Mot de passe"
|
|
370
|
-
:custom-rules="customRules"
|
|
371
|
-
/>
|
|
372
|
-
</template>
|
|
373
|
-
`,
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
name: 'Script',
|
|
377
|
-
code: `
|
|
378
|
-
<script setup lang="ts">
|
|
379
|
-
import { ref } from 'vue'
|
|
380
|
-
import { PasswordField } from '@cnamts/synapse'
|
|
381
|
-
|
|
382
|
-
const password = ref('Mdp123')
|
|
383
|
-
|
|
384
|
-
const customRules = [
|
|
385
|
-
{
|
|
386
|
-
type: 'custom',
|
|
387
|
-
options: {
|
|
388
|
-
validate: (value: string) => {
|
|
389
|
-
if (!value || value.length < 8) {
|
|
390
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
391
|
-
}
|
|
392
|
-
return true
|
|
393
|
-
},
|
|
394
|
-
fieldIdentifier: 'password',
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
]
|
|
398
|
-
</script>
|
|
399
|
-
`,
|
|
400
|
-
},
|
|
401
|
-
],
|
|
402
|
-
},
|
|
403
|
-
args: {
|
|
404
|
-
modelValue: 'Mdp123',
|
|
405
|
-
customRules: [
|
|
406
|
-
{
|
|
407
|
-
type: 'custom',
|
|
408
|
-
options: {
|
|
409
|
-
validate: (value: string) => {
|
|
410
|
-
if (!value || value.length < 8) {
|
|
411
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
412
|
-
}
|
|
413
|
-
return true
|
|
414
|
-
},
|
|
415
|
-
fieldIdentifier: 'password',
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
],
|
|
419
|
-
},
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Champ de mot de passe avec règles de validation qui génèrent un avertissement.
|
|
424
|
-
*/
|
|
425
|
-
export const WithWarning: Story = {
|
|
323
|
+
export const HelpText: Story = {
|
|
426
324
|
parameters: {
|
|
427
325
|
a11y: {
|
|
428
326
|
disable: true,
|
|
@@ -435,7 +333,7 @@ export const WithWarning: Story = {
|
|
|
435
333
|
<PasswordField
|
|
436
334
|
v-model="password"
|
|
437
335
|
label="Mot de passe"
|
|
438
|
-
:
|
|
336
|
+
:help-text="helpText"
|
|
439
337
|
/>
|
|
440
338
|
</template>
|
|
441
339
|
`,
|
|
@@ -447,308 +345,20 @@ export const WithWarning: Story = {
|
|
|
447
345
|
import { ref } from 'vue'
|
|
448
346
|
import { PasswordField } from '@cnamts/synapse'
|
|
449
347
|
|
|
450
|
-
const password = ref('
|
|
451
|
-
|
|
452
|
-
const customWarningRules = [
|
|
453
|
-
{
|
|
454
|
-
type: 'custom',
|
|
455
|
-
options: {
|
|
456
|
-
validate: (value: string) => {
|
|
457
|
-
const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(value)
|
|
458
|
-
if (!hasSpecialChar) {
|
|
459
|
-
return 'Le mot de passe pourrait être plus fort avec des caractères spéciaux'
|
|
460
|
-
}
|
|
461
|
-
return true
|
|
462
|
-
},
|
|
463
|
-
fieldIdentifier: 'password',
|
|
464
|
-
},
|
|
465
|
-
},
|
|
466
|
-
]
|
|
467
|
-
</script>
|
|
468
|
-
`,
|
|
469
|
-
},
|
|
470
|
-
],
|
|
471
|
-
},
|
|
472
|
-
args: {
|
|
473
|
-
modelValue: 'MotDePasse123',
|
|
474
|
-
customWarningRules: [
|
|
475
|
-
{
|
|
476
|
-
type: 'custom',
|
|
477
|
-
options: {
|
|
478
|
-
validate: (value: string) => {
|
|
479
|
-
const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(value)
|
|
480
|
-
if (!hasSpecialChar) {
|
|
481
|
-
return 'Le mot de passe pourrait être plus fort avec des caractères spéciaux'
|
|
482
|
-
}
|
|
483
|
-
return true
|
|
484
|
-
},
|
|
485
|
-
fieldIdentifier: 'password',
|
|
486
|
-
},
|
|
487
|
-
},
|
|
488
|
-
],
|
|
489
|
-
},
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* Champ de mot de passe avec règles de validation qui génèrent un succès.
|
|
494
|
-
*/
|
|
495
|
-
export const WithSuccess: Story = {
|
|
496
|
-
parameters: {
|
|
497
|
-
a11y: {
|
|
498
|
-
disable: true,
|
|
499
|
-
},
|
|
500
|
-
sourceCode: [
|
|
501
|
-
{
|
|
502
|
-
name: 'Template',
|
|
503
|
-
code: `
|
|
504
|
-
<template>
|
|
505
|
-
<PasswordField
|
|
506
|
-
v-model="password"
|
|
507
|
-
label="Mot de passe"
|
|
508
|
-
:custom-success-rules="customSuccessRules"
|
|
509
|
-
/>
|
|
510
|
-
</template>
|
|
511
|
-
`,
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
name: 'Script',
|
|
515
|
-
code: `
|
|
516
|
-
<script setup lang="ts">
|
|
517
|
-
import { ref } from 'vue'
|
|
518
|
-
import { PasswordField } from '@cnamts/synapse'
|
|
519
|
-
|
|
520
|
-
const password = ref('MotDePasse123!@#')
|
|
521
|
-
|
|
522
|
-
const customSuccessRules = [
|
|
523
|
-
{
|
|
524
|
-
type: 'custom',
|
|
525
|
-
options: {
|
|
526
|
-
validate: (value: string) => {
|
|
527
|
-
const hasUpperCase = /[A-Z]/.test(value)
|
|
528
|
-
const hasLowerCase = /[a-z]/.test(value)
|
|
529
|
-
const hasNumber = /[0-9]/.test(value)
|
|
530
|
-
const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(value)
|
|
531
|
-
const hasMinLength = value.length >= 8
|
|
532
|
-
|
|
533
|
-
if (hasUpperCase && hasLowerCase && hasNumber && hasSpecialChar && hasMinLength) {
|
|
534
|
-
return 'Mot de passe fort'
|
|
535
|
-
}
|
|
536
|
-
return true
|
|
537
|
-
},
|
|
538
|
-
fieldIdentifier: 'password',
|
|
539
|
-
},
|
|
540
|
-
},
|
|
541
|
-
]
|
|
348
|
+
const password = ref('MonMotDePasse123')
|
|
349
|
+
const helpText = ref('Votre mot de passe doit contenir au moins 8 caractères.')
|
|
542
350
|
</script>
|
|
543
351
|
`,
|
|
544
352
|
},
|
|
545
353
|
],
|
|
546
354
|
},
|
|
547
355
|
args: {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
{
|
|
551
|
-
type: 'custom',
|
|
552
|
-
options: {
|
|
553
|
-
validate: (value: string) => {
|
|
554
|
-
const hasUpperCase = /[A-Z]/.test(value)
|
|
555
|
-
const hasLowerCase = /[a-z]/.test(value)
|
|
556
|
-
const hasNumber = /[0-9]/.test(value)
|
|
557
|
-
const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(value)
|
|
558
|
-
const isLongEnough = value.length >= 8
|
|
559
|
-
|
|
560
|
-
if (hasUpperCase && hasLowerCase && hasNumber && hasSpecialChar && isLongEnough) {
|
|
561
|
-
return true
|
|
562
|
-
}
|
|
563
|
-
return false
|
|
564
|
-
},
|
|
565
|
-
successMessage: 'Mot de passe fort',
|
|
566
|
-
},
|
|
567
|
-
},
|
|
568
|
-
],
|
|
569
|
-
},
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* Démonstration des différents types de validation (erreurs, avertissements, succès).
|
|
574
|
-
*/
|
|
575
|
-
export const WithValidation: Story = {
|
|
576
|
-
parameters: {
|
|
577
|
-
a11y: {
|
|
578
|
-
disable: true,
|
|
579
|
-
},
|
|
580
|
-
sourceCode: [
|
|
581
|
-
{
|
|
582
|
-
name: 'Template',
|
|
583
|
-
code: `
|
|
584
|
-
<template>
|
|
585
|
-
<PasswordField
|
|
586
|
-
v-model="password"
|
|
587
|
-
label="Mot de passe"
|
|
588
|
-
:required="true"
|
|
589
|
-
:custom-rules="customRules"
|
|
590
|
-
:custom-warning-rules="customWarningRules"
|
|
591
|
-
:custom-success-rules="customSuccessRules"
|
|
592
|
-
:show-success-messages="true"
|
|
593
|
-
:display-asterisk="true"
|
|
594
|
-
:is-validate-on-blur="false"
|
|
595
|
-
/>
|
|
596
|
-
</template>
|
|
597
|
-
`,
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
name: 'Script',
|
|
601
|
-
code: `
|
|
602
|
-
<script setup lang="ts">
|
|
603
|
-
import { ref } from 'vue'
|
|
604
|
-
import { PasswordField } from '@cnamts/synapse'
|
|
605
|
-
|
|
606
|
-
const password = ref('')
|
|
607
|
-
|
|
608
|
-
// Règles personnalisées pour la validation du mot de passe
|
|
609
|
-
const customRules = [
|
|
610
|
-
{
|
|
611
|
-
type: 'custom',
|
|
612
|
-
options: {
|
|
613
|
-
validate: (value: string) => {
|
|
614
|
-
if (!value || value.length < 8) {
|
|
615
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
616
|
-
}
|
|
617
|
-
return true
|
|
618
|
-
},
|
|
619
|
-
fieldIdentifier: 'password',
|
|
620
|
-
},
|
|
621
|
-
},
|
|
622
|
-
]
|
|
623
|
-
|
|
624
|
-
const customWarningRules = [
|
|
625
|
-
{
|
|
626
|
-
type: 'custom',
|
|
627
|
-
options: {
|
|
628
|
-
validate: (value: string) => {
|
|
629
|
-
if (!value || !/[!@#$%^&*(),.?":{}|<>]/.test(value)) {
|
|
630
|
-
return 'Le mot de passe pourrait être plus fort avec des caractères spéciaux (ex: ! @ &)'
|
|
631
|
-
}
|
|
632
|
-
return true
|
|
633
|
-
},
|
|
634
|
-
fieldIdentifier: 'password',
|
|
635
|
-
},
|
|
636
|
-
},
|
|
637
|
-
]
|
|
638
|
-
|
|
639
|
-
const customSuccessRules = [
|
|
640
|
-
{
|
|
641
|
-
type: 'custom',
|
|
642
|
-
options: {
|
|
643
|
-
validate: (value: string) => {
|
|
644
|
-
if (value && value.length >= 12
|
|
645
|
-
&& /[A-Z]/.test(value)
|
|
646
|
-
&& /[0-9]/.test(value)
|
|
647
|
-
&& /[!@#$%^&*(),.?":{}|<>]/.test(value)) {
|
|
648
|
-
return 'Mot de passe très sécurisé !'
|
|
649
|
-
}
|
|
650
|
-
return true
|
|
651
|
-
},
|
|
652
|
-
fieldIdentifier: 'password',
|
|
653
|
-
},
|
|
654
|
-
},
|
|
655
|
-
]
|
|
656
|
-
</script>
|
|
657
|
-
`,
|
|
658
|
-
},
|
|
659
|
-
],
|
|
356
|
+
helpText: 'Votre mot de passe doit contenir au moins 8 caractères.',
|
|
357
|
+
modelValue: 'MonMotDePasse123',
|
|
660
358
|
},
|
|
661
|
-
render: args => ({
|
|
662
|
-
components: { PasswordField },
|
|
663
|
-
setup() {
|
|
664
|
-
const password = ref('')
|
|
665
|
-
|
|
666
|
-
// Règles personnalisées pour la validation du mot de passe
|
|
667
|
-
const customRules = [
|
|
668
|
-
{
|
|
669
|
-
type: 'custom',
|
|
670
|
-
options: {
|
|
671
|
-
validate: (value: string) => {
|
|
672
|
-
if (!value || value.length < 8) {
|
|
673
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
674
|
-
}
|
|
675
|
-
return true
|
|
676
|
-
},
|
|
677
|
-
fieldIdentifier: 'password',
|
|
678
|
-
},
|
|
679
|
-
},
|
|
680
|
-
]
|
|
681
|
-
|
|
682
|
-
const customWarningRules = [
|
|
683
|
-
{
|
|
684
|
-
type: 'custom',
|
|
685
|
-
options: {
|
|
686
|
-
validate: (value: string) => {
|
|
687
|
-
if (!value || !/[!@#$%^&*(),.?":{}|<>]/.test(value)) {
|
|
688
|
-
return 'Le mot de passe pourrait être plus fort avec des caractères spéciaux'
|
|
689
|
-
}
|
|
690
|
-
return true
|
|
691
|
-
},
|
|
692
|
-
fieldIdentifier: 'password',
|
|
693
|
-
},
|
|
694
|
-
},
|
|
695
|
-
]
|
|
696
|
-
|
|
697
|
-
const customSuccessRules = [
|
|
698
|
-
{
|
|
699
|
-
type: 'custom',
|
|
700
|
-
options: {
|
|
701
|
-
validate: (value: string) => {
|
|
702
|
-
if (value && value.length >= 12
|
|
703
|
-
&& /[A-Z]/.test(value)
|
|
704
|
-
&& /[0-9]/.test(value)
|
|
705
|
-
&& /[!@#$%^&*(),.?":{}|<>]/.test(value)) {
|
|
706
|
-
return true
|
|
707
|
-
}
|
|
708
|
-
return 'Pas encore un mot de passe fort'
|
|
709
|
-
},
|
|
710
|
-
successMessage: 'Mot de passe très sécurisé !',
|
|
711
|
-
fieldIdentifier: 'password',
|
|
712
|
-
},
|
|
713
|
-
},
|
|
714
|
-
]
|
|
715
|
-
|
|
716
|
-
return { args, password, customRules, customWarningRules, customSuccessRules }
|
|
717
|
-
},
|
|
718
|
-
template: `
|
|
719
|
-
<div>
|
|
720
|
-
<p class="mb-2">Entrez un mot de passe pour voir les différents types de validation :</p>
|
|
721
|
-
<PasswordField
|
|
722
|
-
v-model="password"
|
|
723
|
-
:variant-style="args.variantStyle"
|
|
724
|
-
:color="args.color"
|
|
725
|
-
label="Mot de passe"
|
|
726
|
-
:required="true"
|
|
727
|
-
:custom-rules="customRules"
|
|
728
|
-
:custom-warning-rules="customWarningRules"
|
|
729
|
-
:custom-success-rules="customSuccessRules"
|
|
730
|
-
:show-success-messages="true"
|
|
731
|
-
:display-asterisk="true"
|
|
732
|
-
:is-validate-on-blur="true"
|
|
733
|
-
/>
|
|
734
|
-
<div class="mt-4">
|
|
735
|
-
<p><strong>Conseils pour tester :</strong></p>
|
|
736
|
-
<ul>
|
|
737
|
-
<li>Laissez le champ vide pour voir l'erreur de champ requis</li>
|
|
738
|
-
<li>Entrez moins de 8 caractères pour voir l'erreur de longueur</li>
|
|
739
|
-
<li>Entrez un mot de passe sans caractères spéciaux pour voir l'avertissement</li>
|
|
740
|
-
<li>Entrez un mot de passe fort (12+ caractères avec majuscules, chiffres et caractères spéciaux) pour voir le message de succès</li>
|
|
741
|
-
</ul>
|
|
742
|
-
</div>
|
|
743
|
-
</div>
|
|
744
|
-
`,
|
|
745
|
-
}),
|
|
746
359
|
}
|
|
747
360
|
|
|
748
|
-
|
|
749
|
-
* Champ de mot de passe avec règles de validation personnalisées.
|
|
750
|
-
*/
|
|
751
|
-
export const WithCustomRules: Story = {
|
|
361
|
+
export const HideDetails: Story = {
|
|
752
362
|
parameters: {
|
|
753
363
|
a11y: {
|
|
754
364
|
disable: true,
|
|
@@ -761,7 +371,8 @@ export const WithCustomRules: Story = {
|
|
|
761
371
|
<PasswordField
|
|
762
372
|
v-model="password"
|
|
763
373
|
label="Mot de passe"
|
|
764
|
-
:
|
|
374
|
+
:hide-details="true"
|
|
375
|
+
required
|
|
765
376
|
/>
|
|
766
377
|
</template>
|
|
767
378
|
`,
|
|
@@ -774,482 +385,14 @@ export const WithCustomRules: Story = {
|
|
|
774
385
|
import { PasswordField } from '@cnamts/synapse'
|
|
775
386
|
|
|
776
387
|
const password = ref('')
|
|
777
|
-
|
|
778
|
-
// Règles personnalisées pour la validation du mot de passe
|
|
779
|
-
const customRules = [
|
|
780
|
-
{
|
|
781
|
-
type: 'custom',
|
|
782
|
-
options: {
|
|
783
|
-
validate: (value: string) => {
|
|
784
|
-
if (!value || value.length < 8) {
|
|
785
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
786
|
-
}
|
|
787
|
-
return true
|
|
788
|
-
},
|
|
789
|
-
fieldIdentifier: 'password',
|
|
790
|
-
},
|
|
791
|
-
},
|
|
792
|
-
{
|
|
793
|
-
type: 'custom',
|
|
794
|
-
options: {
|
|
795
|
-
validate: (value) => {
|
|
796
|
-
if (!value || !/[A-Z]/.test(value)) {
|
|
797
|
-
return 'Le mot de passe doit contenir au moins une lettre majuscule'
|
|
798
|
-
}
|
|
799
|
-
return true
|
|
800
|
-
},
|
|
801
|
-
fieldIdentifier: 'password',
|
|
802
|
-
},
|
|
803
|
-
},
|
|
804
|
-
{
|
|
805
|
-
type: 'custom',
|
|
806
|
-
options: {
|
|
807
|
-
validate: (value) => {
|
|
808
|
-
if (!value || !/[0-9]/.test(value)) {
|
|
809
|
-
return 'Le mot de passe doit contenir au moins un chiffre'
|
|
810
|
-
}
|
|
811
|
-
return true
|
|
812
|
-
},
|
|
813
|
-
fieldIdentifier: 'password',
|
|
814
|
-
},
|
|
815
|
-
},
|
|
816
|
-
]
|
|
817
|
-
</script>
|
|
818
|
-
`,
|
|
819
|
-
},
|
|
820
|
-
],
|
|
821
|
-
},
|
|
822
|
-
render: args => ({
|
|
823
|
-
components: { PasswordField },
|
|
824
|
-
setup() {
|
|
825
|
-
const password = ref(args.modelValue)
|
|
826
|
-
|
|
827
|
-
// Règles personnalisées pour la validation du mot de passe
|
|
828
|
-
const customRules = [
|
|
829
|
-
{
|
|
830
|
-
type: 'custom',
|
|
831
|
-
options: {
|
|
832
|
-
validate: (value: string) => {
|
|
833
|
-
if (!value || value.length < 8) {
|
|
834
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
835
|
-
}
|
|
836
|
-
return true
|
|
837
|
-
},
|
|
838
|
-
fieldIdentifier: 'password',
|
|
839
|
-
},
|
|
840
|
-
},
|
|
841
|
-
{
|
|
842
|
-
type: 'custom',
|
|
843
|
-
options: {
|
|
844
|
-
validate: (value: string) => {
|
|
845
|
-
if (!value || !/[A-Z]/.test(value)) {
|
|
846
|
-
return 'Le mot de passe doit contenir au moins une lettre majuscule'
|
|
847
|
-
}
|
|
848
|
-
return true
|
|
849
|
-
},
|
|
850
|
-
fieldIdentifier: 'password',
|
|
851
|
-
successMessage: 'Le mot de passe est sécurisé',
|
|
852
|
-
},
|
|
853
|
-
},
|
|
854
|
-
{
|
|
855
|
-
type: 'custom',
|
|
856
|
-
options: {
|
|
857
|
-
validate: (value: string) => {
|
|
858
|
-
if (!value || !/[0-9]/.test(value)) {
|
|
859
|
-
return 'Le mot de passe doit contenir au moins un chiffre'
|
|
860
|
-
}
|
|
861
|
-
return true
|
|
862
|
-
},
|
|
863
|
-
fieldIdentifier: 'password',
|
|
864
|
-
},
|
|
865
|
-
},
|
|
866
|
-
]
|
|
867
|
-
|
|
868
|
-
return { args, password, customRules }
|
|
869
|
-
},
|
|
870
|
-
template: `
|
|
871
|
-
<PasswordField
|
|
872
|
-
v-model="password"
|
|
873
|
-
:variant-style="args.variantStyle"
|
|
874
|
-
:color="args.color"
|
|
875
|
-
:label="args.label"
|
|
876
|
-
:required="args.required"
|
|
877
|
-
:readonly="args.readonly"
|
|
878
|
-
:disabled="args.disabled"
|
|
879
|
-
:placeholder="args.placeholder"
|
|
880
|
-
:custom-rules="customRules"
|
|
881
|
-
:show-success-messages="args.showSuccessMessages"
|
|
882
|
-
:display-asterisk="args.displayAsterisk"
|
|
883
|
-
:is-validate-on-blur="args.isValidateOnBlur"
|
|
884
|
-
/>
|
|
885
|
-
`,
|
|
886
|
-
}),
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* Démonstration de la validation de formulaire avec la méthode validateOnSubmit.
|
|
891
|
-
*/
|
|
892
|
-
export const WithFormValidation: Story = {
|
|
893
|
-
parameters: {
|
|
894
|
-
a11y: {
|
|
895
|
-
disable: true,
|
|
896
|
-
},
|
|
897
|
-
sourceCode: [
|
|
898
|
-
{
|
|
899
|
-
name: 'Template',
|
|
900
|
-
code: `
|
|
901
|
-
<template>
|
|
902
|
-
<form @submit.prevent="handleSubmit">
|
|
903
|
-
<PasswordField
|
|
904
|
-
ref="passwordFieldRef"
|
|
905
|
-
v-model="password"
|
|
906
|
-
label="Mot de passe"
|
|
907
|
-
:required="true"
|
|
908
|
-
:custom-rules="customRules"
|
|
909
|
-
:display-asterisk="true"
|
|
910
|
-
:is-validate-on-blur="false"
|
|
911
|
-
/>
|
|
912
|
-
<button
|
|
913
|
-
type="submit"
|
|
914
|
-
class="mt-4 px-4 py-2 bg-primary text-white rounded"
|
|
915
|
-
>
|
|
916
|
-
Valider
|
|
917
|
-
</button>
|
|
918
|
-
</form>
|
|
919
|
-
<div v-if="formStatus" class="mt-4 p-4 rounded" :class="formStatus.includes('succès') ? 'bg-success-lighten5' : 'bg-error-lighten5'">
|
|
920
|
-
{{ formStatus }}
|
|
921
|
-
</div>
|
|
922
|
-
</template>
|
|
923
|
-
`,
|
|
924
|
-
},
|
|
925
|
-
{
|
|
926
|
-
name: 'Script',
|
|
927
|
-
code: `
|
|
928
|
-
<script setup lang="ts">
|
|
929
|
-
import { ref } from 'vue'
|
|
930
|
-
import { PasswordField } from '@cnamts/synapse'
|
|
931
|
-
|
|
932
|
-
const password = ref('')
|
|
933
|
-
const passwordFieldRef = ref(null)
|
|
934
|
-
const formStatus = ref('')
|
|
935
|
-
|
|
936
|
-
// Règles personnalisées pour la validation du mot de passe
|
|
937
|
-
const customRules = [
|
|
938
|
-
{
|
|
939
|
-
type: 'custom',
|
|
940
|
-
options: {
|
|
941
|
-
validate: (value) => {
|
|
942
|
-
if (!value || value.length < 8) {
|
|
943
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
944
|
-
}
|
|
945
|
-
return true
|
|
946
|
-
},
|
|
947
|
-
fieldIdentifier: 'password',
|
|
948
|
-
},
|
|
949
|
-
},
|
|
950
|
-
{
|
|
951
|
-
type: 'custom',
|
|
952
|
-
options: {
|
|
953
|
-
validate: (value) => {
|
|
954
|
-
if (!value || !/[A-Z]/.test(value)) {
|
|
955
|
-
return 'Le mot de passe doit contenir au moins une lettre majuscule'
|
|
956
|
-
}
|
|
957
|
-
return true
|
|
958
|
-
},
|
|
959
|
-
fieldIdentifier: 'password',
|
|
960
|
-
},
|
|
961
|
-
},
|
|
962
|
-
]
|
|
963
|
-
|
|
964
|
-
// Fonction de soumission du formulaire
|
|
965
|
-
const handleSubmit = async (): Promise<void> => {
|
|
966
|
-
if (passwordFieldRef.value) {
|
|
967
|
-
const isValid = await passwordFieldRef.value.validateOnSubmit()
|
|
968
|
-
if (isValid) {
|
|
969
|
-
formStatus.value = 'Formulaire soumis avec succès !'
|
|
970
|
-
} else {
|
|
971
|
-
formStatus.value = 'Erreur de validation, veuillez corriger les champs'
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
388
|
</script>
|
|
976
389
|
`,
|
|
977
390
|
},
|
|
978
391
|
],
|
|
979
392
|
},
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
const passwordFieldRef = ref<InstanceType<typeof PasswordField> | null>(null)
|
|
985
|
-
const formStatus = ref('')
|
|
986
|
-
|
|
987
|
-
// Règles personnalisées pour la validation du mot de passe
|
|
988
|
-
const customRules = [
|
|
989
|
-
{
|
|
990
|
-
type: 'custom',
|
|
991
|
-
options: {
|
|
992
|
-
validate: (value: string) => {
|
|
993
|
-
if (!value || value.length < 8) {
|
|
994
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
995
|
-
}
|
|
996
|
-
return true
|
|
997
|
-
},
|
|
998
|
-
fieldIdentifier: 'password',
|
|
999
|
-
},
|
|
1000
|
-
},
|
|
1001
|
-
{
|
|
1002
|
-
type: 'custom',
|
|
1003
|
-
options: {
|
|
1004
|
-
validate: (value: string) => {
|
|
1005
|
-
if (!value || !/[A-Z]/.test(value)) {
|
|
1006
|
-
return 'Le mot de passe doit contenir au moins une lettre majuscule'
|
|
1007
|
-
}
|
|
1008
|
-
return true
|
|
1009
|
-
},
|
|
1010
|
-
fieldIdentifier: 'password',
|
|
1011
|
-
},
|
|
1012
|
-
},
|
|
1013
|
-
]
|
|
1014
|
-
|
|
1015
|
-
// Fonction de soumission du formulaire
|
|
1016
|
-
const handleSubmit = async () => {
|
|
1017
|
-
if (passwordFieldRef.value) {
|
|
1018
|
-
const isValid = await passwordFieldRef.value.validateOnSubmit()
|
|
1019
|
-
if (isValid) {
|
|
1020
|
-
formStatus.value = 'Formulaire soumis avec succès !'
|
|
1021
|
-
}
|
|
1022
|
-
else {
|
|
1023
|
-
formStatus.value = 'Erreur de validation, veuillez corriger les champs'
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
return { args, password, passwordFieldRef, customRules, handleSubmit, formStatus }
|
|
1029
|
-
},
|
|
1030
|
-
template: `
|
|
1031
|
-
<div>
|
|
1032
|
-
<form @submit.prevent="handleSubmit" class="mb-4">
|
|
1033
|
-
<PasswordField
|
|
1034
|
-
ref="passwordFieldRef"
|
|
1035
|
-
v-model="password"
|
|
1036
|
-
:variant-style="args.variantStyle"
|
|
1037
|
-
:color="args.color"
|
|
1038
|
-
label="Mot de passe"
|
|
1039
|
-
:required="true"
|
|
1040
|
-
:custom-rules="customRules"
|
|
1041
|
-
:display-asterisk="true"
|
|
1042
|
-
:is-validate-on-blur="false"
|
|
1043
|
-
/>
|
|
1044
|
-
<button
|
|
1045
|
-
type="submit"
|
|
1046
|
-
class="mt-4 px-4 py-2 bg-primary text-white rounded"
|
|
1047
|
-
>
|
|
1048
|
-
Valider
|
|
1049
|
-
</button>
|
|
1050
|
-
</form>
|
|
1051
|
-
<div v-if="formStatus" class="mt-4 p-4 rounded" :class="formStatus.includes('succès') ? 'bg-success-lighten5' : 'bg-error-lighten5'">
|
|
1052
|
-
{{ formStatus }}
|
|
1053
|
-
</div>
|
|
1054
|
-
<div class="mt-4">
|
|
1055
|
-
<p><strong>Instructions :</strong></p>
|
|
1056
|
-
<p>Ce formulaire utilise la méthode <code>validateOnSubmit()</code> pour valider le champ lors de la soumission.</p>
|
|
1057
|
-
<p>La validation ne se fait pas à la perte de focus (<code>isValidateOnBlur="false"</code>) mais uniquement lors du clic sur le bouton.</p>
|
|
1058
|
-
</div>
|
|
1059
|
-
</div>
|
|
1060
|
-
`,
|
|
1061
|
-
}),
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
export const WithoutSuccessMessages: Story = {
|
|
1065
|
-
parameters: {
|
|
1066
|
-
a11y: {
|
|
1067
|
-
disable: true,
|
|
1068
|
-
},
|
|
1069
|
-
docs: {
|
|
1070
|
-
description: {
|
|
1071
|
-
story: `
|
|
1072
|
-
### Messages de succès
|
|
1073
|
-
|
|
1074
|
-
Cette story illustre l'utilisation de la propriété \`showSuccessMessages\` qui permet de contrôler
|
|
1075
|
-
l'affichage des messages de succès lors de la validation. Par défaut, cette propriété est à \`true\`.
|
|
1076
|
-
|
|
1077
|
-
Cela peut être utile pour réduire la verbosité de l'interface lorsque les messages de succès
|
|
1078
|
-
ne sont pas nécessaires dans certains contextes.
|
|
1079
|
-
`,
|
|
1080
|
-
},
|
|
1081
|
-
},
|
|
1082
|
-
sourceCode: [
|
|
1083
|
-
{
|
|
1084
|
-
name: 'Template',
|
|
1085
|
-
code: `<template>
|
|
1086
|
-
<!-- Champ avec messages de succès (par défaut) -->
|
|
1087
|
-
<PasswordField
|
|
1088
|
-
v-model="value1"
|
|
1089
|
-
label="Mot de passe avec messages de succès"
|
|
1090
|
-
required
|
|
1091
|
-
/>
|
|
1092
|
-
|
|
1093
|
-
<!-- Champ sans messages de succès -->
|
|
1094
|
-
<PasswordField
|
|
1095
|
-
v-model="value2"
|
|
1096
|
-
label="Mot de passe sans messages de succès"
|
|
1097
|
-
required
|
|
1098
|
-
:showSuccessMessages="false"
|
|
1099
|
-
/>
|
|
1100
|
-
</template>`,
|
|
1101
|
-
},
|
|
1102
|
-
],
|
|
1103
|
-
},
|
|
1104
|
-
render: () => ({
|
|
1105
|
-
components: { PasswordField },
|
|
1106
|
-
setup() {
|
|
1107
|
-
const value1 = ref('P@ssw0rd123')
|
|
1108
|
-
const value2 = ref('P@ssw0rd123')
|
|
1109
|
-
|
|
1110
|
-
return { value1, value2 }
|
|
1111
|
-
},
|
|
1112
|
-
template: `
|
|
1113
|
-
<div>
|
|
1114
|
-
<p class="mb-4">Cette démonstration compare un PasswordField avec <code>showSuccessMessages=true</code> (par défaut) et un avec <code>showSuccessMessages=false</code>.</p>
|
|
1115
|
-
|
|
1116
|
-
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
|
|
1117
|
-
<div>
|
|
1118
|
-
<p class="text-subtitle-2 mb-2">Avec messages de succès</p>
|
|
1119
|
-
<PasswordField
|
|
1120
|
-
v-model="value1"
|
|
1121
|
-
label="Mot de passe avec messages de succès"
|
|
1122
|
-
required
|
|
1123
|
-
showSuccessMessages
|
|
1124
|
-
/>
|
|
1125
|
-
</div>
|
|
1126
|
-
|
|
1127
|
-
<div>
|
|
1128
|
-
<p class="text-subtitle-2 mb-2">Sans messages de succès</p>
|
|
1129
|
-
<PasswordField
|
|
1130
|
-
v-model="value2"
|
|
1131
|
-
label="Mot de passe sans messages de succès"
|
|
1132
|
-
required
|
|
1133
|
-
:showSuccessMessages="false"
|
|
1134
|
-
/>
|
|
1135
|
-
</div>
|
|
1136
|
-
</div>
|
|
1137
|
-
|
|
1138
|
-
<div class="mt-4 text-body-2">
|
|
1139
|
-
<p>Observations :</p>
|
|
1140
|
-
<ul>
|
|
1141
|
-
<li class="ml-4">Les deux champs ont la même valeur valide</li>
|
|
1142
|
-
<li class="ml-4">Le champ de gauche affiche un message de succès et un indicateur visuel vert</li>
|
|
1143
|
-
<li class="ml-4">Le champ de droite n'affiche pas de message de succès, mais conserve l'indicateur visuel</li>
|
|
1144
|
-
<li class="ml-4">Essayez de modifier les valeurs puis de les rendre à nouveau valides</li>
|
|
1145
|
-
</ul>
|
|
1146
|
-
</div>
|
|
1147
|
-
</div>
|
|
1148
|
-
`,
|
|
1149
|
-
}),
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
export const DisableErrorHandling: Story = {
|
|
1153
|
-
parameters: {
|
|
1154
|
-
a11y: {
|
|
1155
|
-
disable: true,
|
|
1156
|
-
},
|
|
1157
|
-
docs: {
|
|
1158
|
-
description: {
|
|
1159
|
-
story: `
|
|
1160
|
-
### Désactivation de la gestion des erreurs
|
|
1161
|
-
|
|
1162
|
-
Cette story illustre l'utilisation de la propriété \`disableErrorHandling\` qui permet de désactiver complètement
|
|
1163
|
-
la gestion et l'affichage des erreurs dans un champ, même si des règles de validation sont définies.
|
|
1164
|
-
|
|
1165
|
-
Cela peut être utile dans des cas particuliers où vous souhaitez définir des règles de validation
|
|
1166
|
-
mais gérer leur affichage différemment, ou utiliser la validation uniquement au niveau du formulaire parent.
|
|
1167
|
-
`,
|
|
1168
|
-
},
|
|
1169
|
-
},
|
|
1170
|
-
sourceCode: [
|
|
1171
|
-
{
|
|
1172
|
-
name: 'Template',
|
|
1173
|
-
code: `<template>
|
|
1174
|
-
<!-- Champ avec validation normale -->
|
|
1175
|
-
<PasswordField
|
|
1176
|
-
v-model="value1"
|
|
1177
|
-
label="Mot de passe avec validation"
|
|
1178
|
-
required
|
|
1179
|
-
:custom-rules="customRules"
|
|
1180
|
-
/>
|
|
1181
|
-
|
|
1182
|
-
<!-- Champ avec gestion d'erreurs désactivée -->
|
|
1183
|
-
<PasswordField
|
|
1184
|
-
v-model="value2"
|
|
1185
|
-
label="Mot de passe sans gestion d'erreurs"
|
|
1186
|
-
required
|
|
1187
|
-
disableErrorHandling
|
|
1188
|
-
:custom-rules="customRules"
|
|
1189
|
-
/>
|
|
1190
|
-
</template>`,
|
|
1191
|
-
},
|
|
1192
|
-
],
|
|
393
|
+
args: {
|
|
394
|
+
hideDetails: true,
|
|
395
|
+
required: true,
|
|
396
|
+
modelValue: '',
|
|
1193
397
|
},
|
|
1194
|
-
render: () => ({
|
|
1195
|
-
components: { PasswordField },
|
|
1196
|
-
setup() {
|
|
1197
|
-
const value1 = ref('')
|
|
1198
|
-
const value2 = ref('')
|
|
1199
|
-
|
|
1200
|
-
const customRules = [
|
|
1201
|
-
{
|
|
1202
|
-
type: 'custom',
|
|
1203
|
-
options: {
|
|
1204
|
-
validate: (value: string) => {
|
|
1205
|
-
if (!value || value.length < 8) {
|
|
1206
|
-
return 'Le mot de passe doit contenir au moins 8 caractères'
|
|
1207
|
-
}
|
|
1208
|
-
return true
|
|
1209
|
-
},
|
|
1210
|
-
fieldIdentifier: 'password',
|
|
1211
|
-
},
|
|
1212
|
-
},
|
|
1213
|
-
]
|
|
1214
|
-
|
|
1215
|
-
return { value1, value2, customRules }
|
|
1216
|
-
},
|
|
1217
|
-
template: `
|
|
1218
|
-
<div>
|
|
1219
|
-
<p class="mb-4">Cette démonstration compare un PasswordField standard et un avec \`disableErrorHandling=true\`.</p>
|
|
1220
|
-
|
|
1221
|
-
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px;">
|
|
1222
|
-
<div>
|
|
1223
|
-
<p class="text-subtitle-2 mb-2">Validation normale</p>
|
|
1224
|
-
<PasswordField
|
|
1225
|
-
v-model="value1"
|
|
1226
|
-
label="Mot de passe avec validation"
|
|
1227
|
-
required
|
|
1228
|
-
:custom-rules="customRules"
|
|
1229
|
-
/>
|
|
1230
|
-
</div>
|
|
1231
|
-
|
|
1232
|
-
<div>
|
|
1233
|
-
<p class="text-subtitle-2 mb-2">Sans gestion d'erreurs</p>
|
|
1234
|
-
<PasswordField
|
|
1235
|
-
v-model="value2"
|
|
1236
|
-
label="Mot de passe sans gestion d'erreurs"
|
|
1237
|
-
required
|
|
1238
|
-
disableErrorHandling
|
|
1239
|
-
:custom-rules="customRules"
|
|
1240
|
-
/>
|
|
1241
|
-
</div>
|
|
1242
|
-
</div>
|
|
1243
|
-
|
|
1244
|
-
<div class="mt-4 text-body-2">
|
|
1245
|
-
<p>Instructions :</p>
|
|
1246
|
-
<ol>
|
|
1247
|
-
<li class="ml-4">Cliquez dans un champ puis en dehors pour déclencher la validation</li>
|
|
1248
|
-
<li class="ml-4">Le champ de gauche affichera une erreur requise, mais pas celui de droite</li>
|
|
1249
|
-
<li class="ml-4">Vous pouvez également essayer de soumettre les deux champs pour voir la différence de comportement</li>
|
|
1250
|
-
</ol>
|
|
1251
|
-
</div>
|
|
1252
|
-
</div>
|
|
1253
|
-
`,
|
|
1254
|
-
}),
|
|
1255
398
|
}
|