@cnamts/synapse 1.0.27 → 1.1.1
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-CGF33skz.js} +3 -3
- package/dist/{DateFilter-y-GLkAkn.js → DateFilter-D7-MsKtx.js} +8 -8
- package/dist/{NumberFilter-DN6hIBS7.js → NumberFilter-bjQPPfsj.js} +1 -1
- package/dist/{PeriodFilter-MoUUp9qS.js → PeriodFilter-B3wJpK8-.js} +1 -1
- package/dist/{SelectFilter-bCbrdLmu.js → SelectFilter-BN6DbKAV.js} +1 -1
- package/dist/{TextFilter-CvjgEaoM.js → TextFilter-BffP0J2f.js} +4 -4
- package/dist/{apLightTheme2026-ug4Y23ns.js → apLightTheme2026-C4ygwMHC.js} +23 -22
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +10 -10
- 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 +10 -10
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +10 -10
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +4 -4
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +4 -4
- package/dist/components/Captcha/Captcha.d.ts +27 -16
- package/dist/components/Captcha/CaptchaForm.d.ts +29 -3
- package/dist/components/Captcha/types.d.ts +14 -0
- package/dist/components/Captcha/useCaptchaValidation.d.ts +37 -0
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +2 -2
- package/dist/components/Customs/Selects/SelectBtnField/SelectBtnField.d.ts +33 -13
- package/dist/components/Customs/Selects/SelectBtnField/composables/useSelectBtnFieldValidation.d.ts +23 -0
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +85 -313
- package/dist/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.d.ts +4 -4
- 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 +18 -49
- package/dist/components/Customs/SyCheckBoxGroup/composables/useSyCheckBoxGroupValidation.d.ts +29 -0
- package/dist/components/Customs/SyCheckBoxGroup/types.d.ts +46 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +19 -54
- package/dist/components/Customs/SyCheckbox/composables/useSyCheckboxValidation.d.ts +27 -0
- package/dist/components/Customs/SyCheckbox/types.d.ts +49 -0
- 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/FieldState.d.ts +5 -0
- 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/DialogBox/DialogBox.d.ts +2 -0
- package/dist/components/DialogBox/locales.d.ts +1 -0
- package/dist/components/FilterInline/FilterInline.d.ts +3 -3
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +8 -4
- package/dist/components/LunarCalendar/LunarCalendar.d.ts +43 -14
- package/dist/components/LunarCalendar/types.d.ts +35 -0
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +11 -12
- package/dist/components/MonthPicker/MonthPicker.d.ts +72 -1860
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +21 -1846
- package/dist/components/MonthPicker/MonthPickerText/useTextField.d.ts +5 -0
- package/dist/components/MonthPicker/locales.d.ts +1 -0
- package/dist/components/MonthPicker/types.d.ts +11 -0
- package/dist/components/MonthPicker/useMonthPickerValidation.d.ts +37 -24
- package/dist/components/NirField/NirField.d.ts +96 -325
- package/dist/components/NirField/useNirValidation.d.ts +17 -25
- package/dist/components/PageContainer/PageContainer.d.ts +8 -0
- package/dist/components/PasswordField/PasswordField.d.ts +18 -37
- 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 +960 -2051
- package/dist/components/PhoneField/indicatifs.d.ts +715 -8
- package/dist/components/PhoneField/locales.d.ts +7 -0
- package/dist/components/PhoneField/types.d.ts +29 -0
- package/dist/components/PhoneField/usePhoneFieldValidation.d.ts +45 -0
- package/dist/components/PhoneField/usePhoneIndicatifs.d.ts +947 -0
- 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 +2 -2
- package/dist/composables/unifyValidation/useValidation.d.ts +4 -13
- 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 +11 -10
- package/dist/designTokens/tokens/baseTokens.d.ts +18 -18
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +10 -10
- package/dist/designTokens/tokens/pa/paLightTheme.d.ts +11 -10
- package/dist/designTokens/tokens/semanticTokens.d.ts +14 -14
- package/dist/{main-CI6Q9nmO.js → main-C4wAktOs.js} +14999 -14025
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +27 -25
- package/package.json +12 -11
- package/src/assets/compat/_legacy-tokens.scss +91 -0
- package/src/assets/overrides/_utilities.scss +23 -0
- package/src/components/Accordion/Accordion.stories.ts +121 -1
- 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/BackBtn.mdx +1 -1
- 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/BackToTopBtn.mdx +0 -1
- 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/Captcha.stories.ts +134 -31
- package/src/components/Captcha/Captcha.vue +95 -28
- package/src/components/Captcha/CaptchaForm.vue +51 -22
- package/src/components/Captcha/tests/Captcha.focus.spec.ts +214 -0
- package/src/components/Captcha/tests/Captcha.spec.ts +233 -24
- package/src/components/Captcha/tests/Captcha.visual.cy.ts +45 -0
- package/src/components/Captcha/tests/CaptchaForm.spec.ts +82 -0
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +20 -42
- 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/Captcha/types.ts +15 -0
- package/src/components/Captcha/useCaptchaValidation.ts +87 -0
- package/src/components/Captcha/validation/validation.stories.ts +1194 -0
- package/src/components/ChipList/ChipList.mdx +0 -1
- 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/CollapsibleList.mdx +0 -1
- 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/CookieBanner.mdx +0 -1
- 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.mdx +0 -1
- 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 +123 -439
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +147 -41
- package/src/components/Customs/Selects/SelectBtnField/Validation/Validation.stories.ts +600 -0
- package/src/components/Customs/Selects/SelectBtnField/composables/useSelectBtnFieldValidation.ts +87 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +402 -33
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.visual.cy.ts +60 -0
- package/src/components/Customs/Selects/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +52 -38
- 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.stories.ts +342 -162
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +77 -129
- package/src/components/Customs/SyCheckBoxGroup/Validation/Validation.stories.ts +1008 -0
- package/src/components/Customs/SyCheckBoxGroup/composables/useSyCheckBoxGroupValidation.ts +107 -0
- package/src/components/Customs/SyCheckBoxGroup/tests/SyCheckBoxGroup.spec.ts +180 -7
- 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/SyCheckBoxGroup/types.ts +49 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +41 -161
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +71 -156
- package/src/components/Customs/SyCheckbox/Validation/Validation.stories.ts +654 -0
- package/src/components/Customs/SyCheckbox/composables/useSyCheckboxValidation.ts +105 -0
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +106 -0
- 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/SyCheckbox/tests/useSyCheckboxValidation.spec.ts +98 -0
- package/src/components/Customs/SyCheckbox/types.ts +51 -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/FieldState.vue +50 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +160 -778
- package/src/components/Customs/SyTextField/SyTextField.vue +178 -160
- 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 +95 -0
- package/src/components/DataList/DataList.mdx +0 -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/DataListGroup.mdx +0 -1
- 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/DiacriticPicker.mdx +0 -1
- 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.mdx +0 -1
- package/src/components/DialogBox/DialogBox.stories.ts +399 -4
- package/src/components/DialogBox/DialogBox.vue +20 -0
- package/src/components/DialogBox/locales.ts +1 -0
- package/src/components/DialogBox/tests/DialogBox.spec.ts +73 -0
- package/src/components/DialogBox/tests/DialogBox.visual.cy.ts +24 -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/ErrorPage.mdx +1 -1
- 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/ExternalLinks.mdx +0 -1
- 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/FileList.mdx +0 -1
- 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.mdx +0 -1
- 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.mdx +8 -1
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +136 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +30 -8
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +55 -0
- 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.mdx +0 -1
- 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.mdx +0 -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/HeaderBar.mdx +0 -1
- 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/HeaderLoading.mdx +0 -1
- 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/LangBtn.mdx +0 -1
- 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/Logo.mdx +1 -1
- 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/LunarCalendar.mdx +6 -9
- package/src/components/LunarCalendar/LunarCalendar.stories.ts +243 -46
- package/src/components/LunarCalendar/LunarCalendar.vue +61 -26
- package/src/components/LunarCalendar/Validation/Validation.stories.ts +717 -0
- package/src/components/LunarCalendar/tests/LunarCalendar.a11y.spec.ts +1 -1
- package/src/components/LunarCalendar/tests/LunarCalendar.spec.ts +197 -6
- 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/useLunarCalendarValidation.spec.ts +287 -0
- package/src/components/LunarCalendar/types.ts +39 -0
- package/src/components/LunarCalendar/useLunarCalendarValidation.ts +115 -39
- 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/MonthPicker.stories.ts +38 -281
- package/src/components/MonthPicker/MonthPicker.vue +66 -17
- package/src/components/MonthPicker/MonthPickerText/MonthPickerInput.vue +44 -20
- package/src/components/MonthPicker/MonthPickerText/useTextField.ts +5 -0
- package/src/components/MonthPicker/Validation/Validation.stories.ts +1117 -0
- package/src/components/MonthPicker/locales.ts +1 -0
- package/src/components/MonthPicker/tests/MonthPicker.spec.ts +353 -2
- package/src/components/MonthPicker/tests/MonthPicker.visual.cy.ts +37 -0
- package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +14 -8
- 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/MonthPicker/types.ts +16 -0
- package/src/components/MonthPicker/useMonthPickerValidation.ts +64 -27
- package/src/components/NirField/NirField.mdx +120 -66
- package/src/components/NirField/NirField.stories.ts +256 -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 +44 -19
- 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__/NotFoundPage.spec.ts.snap +263 -245
- 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/NotificationBar.mdx +0 -1
- 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/PageContainer.mdx +0 -1
- package/src/components/PageContainer/PageContainer.stories.ts +170 -2
- package/src/components/PageContainer/PageContainer.vue +63 -8
- package/src/components/PageContainer/tests/PageContainer.visual.cy.ts +33 -0
- package/src/components/PageContainer/tests/__snapshots__/PageContainer.spec.ts.snap +19 -11
- 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/PaginatedTable.mdx +0 -1
- 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.mdx +0 -1
- 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.mdx +2 -3
- package/src/components/PhoneField/PhoneField.stories.ts +227 -410
- package/src/components/PhoneField/PhoneField.vue +205 -439
- package/src/components/PhoneField/indicatifs.ts +1 -1
- package/src/components/PhoneField/locales.ts +7 -0
- package/src/components/PhoneField/tests/PhoneField.a11y.spec.ts +0 -1
- package/src/components/PhoneField/tests/PhoneField.spec.ts +518 -220
- 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/PhoneField/types.ts +30 -0
- package/src/components/PhoneField/usePhoneFieldValidation.ts +119 -0
- package/src/components/PhoneField/usePhoneIndicatifs.ts +89 -0
- package/src/components/PhoneField/validation/validation.stories.ts +717 -0
- package/src/components/RangeField/RangeField.mdx +0 -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/RatingPicker.mdx +0 -1
- 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/SocialMediaLinks.mdx +0 -1
- 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/StatusPage.vue +1 -0
- package/src/components/StatusPage/tests/StatusPage.visual.cy.ts +47 -0
- package/src/components/StatusPage/tests/__snapshots__/StatusPage.spec.ts.snap +248 -230
- 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.mdx +5 -6
- 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 +19 -13
- 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/UploadWorkflow.mdx +0 -1
- 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/UserMenuBtn.mdx +0 -1
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +177 -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 +2 -2
- package/src/composables/unifyValidation/tests/documentationValidationProps.spec.ts +2 -2
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +13 -1
- package/src/composables/unifyValidation/useValidation.ts +41 -31
- 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 +12 -0
- package/src/composantsVuetify/VCard/v-card.stories.ts +283 -1
- package/src/composantsVuetify/VCarousel/VCarousel.mdx +74 -0
- package/src/composantsVuetify/VCarousel/v-carousel.stories.ts +531 -0
- package/src/composantsVuetify/VNavigationDrawer/VNavgationDrawer.mdx +53 -0
- package/src/composantsVuetify/VNavigationDrawer/v-navigation-drawer.stories.ts +310 -0
- package/src/composantsVuetify/VSlideGroup/VSlideGroup.mdx +105 -0
- package/src/composantsVuetify/VSlideGroup/v-slide-group.stories.ts +463 -0
- 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/baseColors.ts +1 -1
- package/src/designTokens/tokens/baseTokens.ts +18 -18
- 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 +95 -11
- package/src/stories/Demarrer/Releases.stories.ts +59 -2
- package/src/stories/DesignTokens/Arrondis.mdx +1 -1
- package/src/stories/DesignTokens/Colors.mdx +2 -0
- package/src/stories/DesignTokens/Correspondances.mdx +219 -0
- package/src/stories/DesignTokens/UtiliserLesTokens.mdx +235 -0
- package/src/stories/DesignTokens/colors.stories.ts +582 -569
- 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 +1023 -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/LunarCalendar/useLunarCalendarRules.d.ts +0 -5
- package/dist/components/PhoneField/tests/types.d.ts +0 -18
- 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
- package/src/components/LunarCalendar/tests/useLunarCalendarRules.spec.ts +0 -184
- package/src/components/LunarCalendar/useLunarCalendarRules.ts +0 -96
- package/src/components/PhoneField/tests/types.d.ts +0 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj, Meta } from '@storybook/vue3'
|
|
2
2
|
import { ref } from 'vue'
|
|
3
|
-
import { VBtn } from 'vuetify/components'
|
|
4
3
|
import NirField from './NirField.vue'
|
|
4
|
+
import { getValidationDocumentation } from '@/composables/unifyValidation/documentationValidationProps'
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof NirField> = {
|
|
7
7
|
title: 'Composants/Formulaires/NirField',
|
|
@@ -15,6 +15,21 @@ const meta: Meta<typeof NirField> = {
|
|
|
15
15
|
layout: 'fullscreen',
|
|
16
16
|
},
|
|
17
17
|
argTypes: {
|
|
18
|
+
...getValidationDocumentation('string'),
|
|
19
|
+
customRulesPrecedence: {
|
|
20
|
+
description: 'Définit si les règles personnalisées ont priorité sur la validation standard du NIR. `custom` = les règles personnalisées remplacent la validation standard (utile pour les NIR migrants), `default` = la validation standard est appliquée puis les règles personnalisées.',
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['custom', 'default'],
|
|
23
|
+
default: 'custom',
|
|
24
|
+
table: {
|
|
25
|
+
type: {
|
|
26
|
+
summary: 'string',
|
|
27
|
+
},
|
|
28
|
+
defaultValue: {
|
|
29
|
+
summary: 'custom',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
18
33
|
modelValue: {
|
|
19
34
|
description: 'La valeur du modèle pour le champ.',
|
|
20
35
|
control: 'text',
|
|
@@ -349,6 +364,21 @@ const meta: Meta<typeof NirField> = {
|
|
|
349
364
|
},
|
|
350
365
|
},
|
|
351
366
|
},
|
|
367
|
+
helpText: {
|
|
368
|
+
description: 'Texte d\'aide affiché sous le champ. Remplace la zone de messages quand il n\'y a pas d\'erreur, sinon s\'affiche en dessous des messages.',
|
|
369
|
+
control: 'text',
|
|
370
|
+
table: {
|
|
371
|
+
type: { summary: 'string' },
|
|
372
|
+
defaultValue: { summary: '\'\'' },
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
successMessages: {
|
|
376
|
+
description: 'Permet d\'injecter des messages de succès depuis le parent pour le champ numéro. Aucun calcul de validation n\'est exécuté.',
|
|
377
|
+
control: 'object',
|
|
378
|
+
table: {
|
|
379
|
+
type: { summary: 'array<string>' },
|
|
380
|
+
},
|
|
381
|
+
},
|
|
352
382
|
customLocale: {
|
|
353
383
|
description: 'Objet permettant de surcharger les messages du composant. Clés supportées : `errorRequiredNumber`, `errorInvalidNumber`, `errorRequiredKey`, `errorInvalidKey`, `successNumberValid`, `successKeyValid`.',
|
|
354
384
|
control: 'object',
|
|
@@ -520,262 +550,43 @@ export const WithoutKey: Story = {
|
|
|
520
550
|
},
|
|
521
551
|
}
|
|
522
552
|
|
|
523
|
-
export const
|
|
524
|
-
args: {
|
|
525
|
-
...Default.args,
|
|
526
|
-
showSuccessMessages: true,
|
|
527
|
-
},
|
|
528
|
-
parameters: {
|
|
529
|
-
...Default.parameters,
|
|
530
|
-
sourceCode: [
|
|
531
|
-
{
|
|
532
|
-
name: 'Template',
|
|
533
|
-
code: `
|
|
534
|
-
<template>
|
|
535
|
-
<NirField
|
|
536
|
-
v-model="value"
|
|
537
|
-
:required="false"
|
|
538
|
-
numberLabel="Numéro de sécurité sociale"
|
|
539
|
-
keyLabel="Clé"
|
|
540
|
-
:showSuccessMessages="true"
|
|
541
|
-
/>
|
|
542
|
-
</template>
|
|
543
|
-
`,
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
name: 'Script',
|
|
547
|
-
code: `
|
|
548
|
-
<script setup lang="ts">
|
|
549
|
-
import { NirField } from '@cnamts/synapse'
|
|
550
|
-
import { ref } from 'vue'
|
|
551
|
-
|
|
552
|
-
const value = ref('')
|
|
553
|
-
</script>
|
|
554
|
-
`,
|
|
555
|
-
},
|
|
556
|
-
],
|
|
557
|
-
},
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
export const WithoutSuccessMessages: Story = {
|
|
553
|
+
export const WithHelpText: Story = {
|
|
561
554
|
parameters: {
|
|
562
555
|
docs: {
|
|
563
556
|
description: {
|
|
564
|
-
story:
|
|
565
|
-
### Messages de succès
|
|
566
|
-
|
|
567
|
-
Cette story illustre l'utilisation de la propriété \`showSuccessMessages\` qui permet de contrôler
|
|
568
|
-
l'affichage des messages de succès lors de la validation. Par défaut, cette propriété est à \`true\`.
|
|
569
|
-
|
|
570
|
-
Cela peut être utile pour réduire la verbosité de l'interface lorsque les messages de succès
|
|
571
|
-
ne sont pas nécessaires dans certains contextes.
|
|
572
|
-
`,
|
|
557
|
+
story: 'Un texte d\'aide s\'affiche sous le champ quand il n\'y a pas de message de validation. Il se déplace sous les messages quand une erreur est présente.',
|
|
573
558
|
},
|
|
574
559
|
},
|
|
575
560
|
sourceCode: [
|
|
576
561
|
{
|
|
577
562
|
name: 'Template',
|
|
578
|
-
code:
|
|
579
|
-
|
|
580
|
-
<NirField
|
|
581
|
-
v-model="value"
|
|
582
|
-
label="NIR avec messages de succès"
|
|
583
|
-
required
|
|
584
|
-
/>
|
|
585
|
-
|
|
586
|
-
<!-- Champ sans messages de succès -->
|
|
563
|
+
code: `
|
|
564
|
+
<template>
|
|
587
565
|
<NirField
|
|
588
566
|
v-model="value"
|
|
589
|
-
label="
|
|
567
|
+
label="Identifiant assuré"
|
|
590
568
|
required
|
|
591
|
-
|
|
569
|
+
help-text="Saisissez les 13 chiffres du numéro de sécurité sociale, puis la clé à 2 chiffres."
|
|
592
570
|
/>
|
|
593
571
|
</template>`,
|
|
594
572
|
},
|
|
595
|
-
],
|
|
596
|
-
},
|
|
597
|
-
render: () => ({
|
|
598
|
-
components: { NirField },
|
|
599
|
-
setup() {
|
|
600
|
-
const value1 = ref('184027512345674')
|
|
601
|
-
const value2 = ref('184027512345674')
|
|
602
|
-
|
|
603
|
-
return { value1, value2 }
|
|
604
|
-
},
|
|
605
|
-
template: `
|
|
606
|
-
<div>
|
|
607
|
-
<div>
|
|
608
|
-
<div>
|
|
609
|
-
<p class="text-subtitle-2 mb-2">Avec messages de succès</p>
|
|
610
|
-
<NirField
|
|
611
|
-
v-model="value1"
|
|
612
|
-
label="NIR avec messages de succès"
|
|
613
|
-
required
|
|
614
|
-
showSuccessMessages
|
|
615
|
-
/>
|
|
616
|
-
</div>
|
|
617
|
-
|
|
618
|
-
<div>
|
|
619
|
-
<p class="text-subtitle-2 mb-2">Sans messages de succès</p>
|
|
620
|
-
<NirField
|
|
621
|
-
v-model="value2"
|
|
622
|
-
label="NIR sans messages de succès"
|
|
623
|
-
required
|
|
624
|
-
:showSuccessMessages="false"
|
|
625
|
-
/>
|
|
626
|
-
</div>
|
|
627
|
-
</div>
|
|
628
|
-
|
|
629
|
-
<div class="mt-4 text-body-2">
|
|
630
|
-
<p>Observations :</p>
|
|
631
|
-
<ul>
|
|
632
|
-
<li>Les deux champs ont la même valeur valide</li>
|
|
633
|
-
<li>Le premier champ affiche un message de succès et un indicateur visuel vert au blur</li>
|
|
634
|
-
<li>Le second champ n'affiche pas de message de succès, au blur</li>
|
|
635
|
-
<li>Essayez de modifier les valeurs pour voir le comportement avec des données invalides puis valides</li>
|
|
636
|
-
</ul>
|
|
637
|
-
</div>
|
|
638
|
-
</div>
|
|
639
|
-
`,
|
|
640
|
-
}),
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
export const CustomPatternRules: Story = {
|
|
644
|
-
args: {
|
|
645
|
-
...Default.args,
|
|
646
|
-
customRulesPrecedence: true,
|
|
647
|
-
customNumberRules: [
|
|
648
|
-
{
|
|
649
|
-
type: 'custom',
|
|
650
|
-
options: {
|
|
651
|
-
validate: (value: string) => {
|
|
652
|
-
if (!value) return true
|
|
653
|
-
|
|
654
|
-
// Supprimer les espaces pour la validation
|
|
655
|
-
const valueWithoutSpaces = value.replace(/\s/g, '')
|
|
656
|
-
|
|
657
|
-
// Vérifier la longueur
|
|
658
|
-
if (valueWithoutSpaces.length !== 13) {
|
|
659
|
-
return 'Le numéro de sécurité sociale doit contenir 13 caractères.'
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
// Vérifier le pattern selon les règles spécifiques du NIR français
|
|
663
|
-
// Rang 1: sexe (1 pour homme, 2 pour femme)
|
|
664
|
-
if (!/^[12]/.test(valueWithoutSpaces)) {
|
|
665
|
-
return 'Le premier chiffre doit être 1 (homme) ou 2 (femme).'
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
// Rangs 2-3: deux derniers chiffres de l'année de naissance
|
|
669
|
-
const anneeNaissance = valueWithoutSpaces.substring(1, 3)
|
|
670
|
-
if (!/^[0-9]{2}$/.test(anneeNaissance)) {
|
|
671
|
-
return 'Les chiffres 2 et 3 doivent représenter l\'année de naissance.'
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// Rangs 4-5: mois de naissance (01-12)
|
|
675
|
-
const moisNaissance = valueWithoutSpaces.substring(3, 5)
|
|
676
|
-
if (!/^(0[1-9]|1[0-2])$/.test(moisNaissance)) {
|
|
677
|
-
return 'Les chiffres 4 et 5 doivent représenter un mois valide (01-12).'
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
// Rangs 6-7: département de naissance
|
|
681
|
-
const departement = valueWithoutSpaces.substring(5, 7)
|
|
682
|
-
if (!((/^[0-9]{2}$/.test(departement) && departement !== '00')
|
|
683
|
-
|| departement === '2A' || departement === '2B' || departement === '99')) {
|
|
684
|
-
return 'Les chiffres 6 et 7 doivent représenter un département valide.'
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
// Rangs 8-10: code commune ou pays
|
|
688
|
-
const codeCommune = valueWithoutSpaces.substring(7, 10)
|
|
689
|
-
if (!/^[0-9]{3}$/.test(codeCommune)) {
|
|
690
|
-
return 'Les chiffres 8 à 10 doivent représenter un code commune ou pays valide.'
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
// Rangs 11-13: numéro d'ordre
|
|
694
|
-
const numeroOrdre = valueWithoutSpaces.substring(10, 13)
|
|
695
|
-
if (!/^[0-9]{3}$/.test(numeroOrdre)) {
|
|
696
|
-
return 'Les chiffres 11 à 13 doivent représenter un numéro d\'ordre valide.'
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
return true
|
|
700
|
-
},
|
|
701
|
-
message: 'Le numéro de sécurité sociale est invalide.',
|
|
702
|
-
successMessage: 'Le numéro de sécurité sociale est valide.',
|
|
703
|
-
fieldIdentifier: 'Numéro de sécurité sociale',
|
|
704
|
-
},
|
|
705
|
-
},
|
|
706
|
-
],
|
|
707
|
-
},
|
|
708
|
-
parameters: {
|
|
709
|
-
...Default.parameters,
|
|
710
|
-
docs: {
|
|
711
|
-
description: {
|
|
712
|
-
story: 'Exemple d\'utilisation avec une règle personnalisée qui prend la prévalence sur la validation standard. Cette règle valide le format du NIR selon les règles officielles françaises : 1er chiffre pour le sexe, 2 chiffres pour l\'année de naissance, 2 chiffres pour le mois, 5 chiffres pour le lieu de naissance et 3 chiffres pour le numéro d\'ordre.',
|
|
713
|
-
},
|
|
714
|
-
},
|
|
715
|
-
sourceCode: [
|
|
716
573
|
{
|
|
717
|
-
name: '
|
|
574
|
+
name: 'Script',
|
|
718
575
|
code: `
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
:required="false"
|
|
723
|
-
numberLabel="Numéro de sécurité sociale"
|
|
724
|
-
keyLabel="Clé"
|
|
725
|
-
:displayKey="true"
|
|
726
|
-
:customRulesPrecedence="true"
|
|
727
|
-
:customNumberRules="[
|
|
728
|
-
{
|
|
729
|
-
type: 'custom',
|
|
730
|
-
options: {
|
|
731
|
-
validate: (value) => {
|
|
732
|
-
if (!value) return true;
|
|
733
|
-
|
|
734
|
-
// Supprimer les espaces pour la validation
|
|
735
|
-
const valueWithoutSpaces = value.replace(/\\s/g, '');
|
|
736
|
-
|
|
737
|
-
// Vérifier la longueur
|
|
738
|
-
if (valueWithoutSpaces.length !== 13) {
|
|
739
|
-
return 'Le numéro de sécurité sociale doit contenir 13 caractères.';
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
// Vérification selon les règles spécifiques du NIR français
|
|
743
|
-
// Rang 1: sexe (1 pour homme, 2 pour femme)
|
|
744
|
-
if (!/^[12]/.test(valueWithoutSpaces)) {
|
|
745
|
-
return 'Le premier chiffre doit être 1 (homme) ou 2 (femme).';
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
// Rangs 2-3: deux derniers chiffres de l'année de naissance
|
|
749
|
-
if (!/^[12][0-9]{2}/.test(valueWithoutSpaces)) {
|
|
750
|
-
return 'Les chiffres 2 et 3 doivent représenter l'année de naissance.';
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
// Rangs 4-5: mois de naissance (01-12)
|
|
754
|
-
const moisNaissance = valueWithoutSpaces.substring(3, 5);
|
|
755
|
-
if (!/^(0[1-9]|1[0-2])$/.test(moisNaissance)) {
|
|
756
|
-
return 'Les chiffres 4 et 5 doivent représenter un mois valide (01-12).';
|
|
757
|
-
}
|
|
576
|
+
<script setup lang="ts">
|
|
577
|
+
import { ref } from 'vue'
|
|
578
|
+
import { NirField } from '@cnamts/synapse'
|
|
758
579
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
if (!formatComplet.test(valueWithoutSpaces)) {
|
|
762
|
-
return 'Le format du numéro de sécurité sociale est invalide.';
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
return true;
|
|
766
|
-
},
|
|
767
|
-
message: 'Le numéro de sécurité sociale est invalide.',
|
|
768
|
-
successMessage: 'Le numéro de sécurité sociale est valide.',
|
|
769
|
-
fieldIdentifier: 'Numéro de sécurité sociale',
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
]"
|
|
773
|
-
/>
|
|
774
|
-
</template>
|
|
775
|
-
`,
|
|
580
|
+
const value = ref('')
|
|
581
|
+
</script>`,
|
|
776
582
|
},
|
|
777
583
|
],
|
|
778
584
|
},
|
|
585
|
+
args: {
|
|
586
|
+
label: 'Identifiant assuré',
|
|
587
|
+
required: true,
|
|
588
|
+
helpText: 'Saisissez les 13 chiffres du numéro de sécurité sociale, puis la clé à 2 chiffres.',
|
|
589
|
+
},
|
|
779
590
|
render: args => ({
|
|
780
591
|
components: { NirField },
|
|
781
592
|
setup() {
|
|
@@ -783,94 +594,14 @@ export const CustomPatternRules: Story = {
|
|
|
783
594
|
return { args, value }
|
|
784
595
|
},
|
|
785
596
|
template: `
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
<ul>
|
|
792
|
-
<li><strong>X</strong> (rang 1) : sexe (1 pour les hommes, 2 pour les femmes)</li>
|
|
793
|
-
<li><strong>XX</strong> (rangs 2-3) : deux derniers chiffres de l'année de naissance</li>
|
|
794
|
-
<li><strong>XX</strong> (rangs 4-5) : mois de naissance (01-12)</li>
|
|
795
|
-
<li><strong>XXX</strong> (rangs 6-10) : lieu de naissance
|
|
796
|
-
<ul>
|
|
797
|
-
<li>Rangs 6-7 : département (99 si étranger, 2A/2B pour la Corse)</li>
|
|
798
|
-
<li>Rangs 8-10 : code commune ou pays</li>
|
|
799
|
-
</ul>
|
|
800
|
-
</li>
|
|
801
|
-
<li><strong>XXX</strong> (rangs 11-13) : numéro d’ordre</li>
|
|
802
|
-
</ul>
|
|
803
|
-
<p>La propriété <code>customRulesPrecedence</code> est définie à <code>true</code> pour que cette règle soit appliquée avant la validation standard.</p>
|
|
804
|
-
<NirField
|
|
805
|
-
v-model="value"
|
|
806
|
-
v-bind="args"
|
|
807
|
-
class="mt-4"
|
|
808
|
-
/>
|
|
809
|
-
<div class="mt-4">Valeur actuelle : {{ value }}</div>
|
|
810
|
-
</div>
|
|
811
|
-
`,
|
|
597
|
+
<NirField
|
|
598
|
+
v-model="value"
|
|
599
|
+
v-bind="args"
|
|
600
|
+
/>
|
|
601
|
+
`,
|
|
812
602
|
}),
|
|
813
603
|
}
|
|
814
604
|
|
|
815
|
-
export const CustomRules: Story = {
|
|
816
|
-
args: {
|
|
817
|
-
...Default.args,
|
|
818
|
-
customNumberRules: [
|
|
819
|
-
{
|
|
820
|
-
type: 'minLength',
|
|
821
|
-
options: {
|
|
822
|
-
length: 10,
|
|
823
|
-
message: 'Le numéro de sécurité sociale doit avoir au moins 10 caractères.',
|
|
824
|
-
successMessage: 'Le numéro de sécurité sociale a une longueur valide.',
|
|
825
|
-
ignoreSpace: true,
|
|
826
|
-
},
|
|
827
|
-
},
|
|
828
|
-
],
|
|
829
|
-
customKeyRules: [
|
|
830
|
-
{
|
|
831
|
-
type: 'minLength',
|
|
832
|
-
options: {
|
|
833
|
-
length: 1,
|
|
834
|
-
message: 'La clé doit avoir au moins 1 caractère.',
|
|
835
|
-
successMessage: 'La clé a une longueur valide.',
|
|
836
|
-
},
|
|
837
|
-
},
|
|
838
|
-
],
|
|
839
|
-
},
|
|
840
|
-
parameters: {
|
|
841
|
-
...Default.parameters,
|
|
842
|
-
sourceCode: [
|
|
843
|
-
{
|
|
844
|
-
name: 'Template',
|
|
845
|
-
code: `
|
|
846
|
-
<template>
|
|
847
|
-
<NirField
|
|
848
|
-
v-model="value"
|
|
849
|
-
:required="false"
|
|
850
|
-
numberLabel="Numéro de sécurité sociale"
|
|
851
|
-
keyLabel="Clé"
|
|
852
|
-
:displayKey="true"
|
|
853
|
-
:customNumberRules="[{ type: 'minLength', options: { length: 10, ignoreSpace: true, message: 'Le numéro de sécurité sociale doit avoir au moins 10 caractères.', successMessage: 'Le numéro de sécurité sociale a une longueur valide.' } }]"
|
|
854
|
-
:customKeyRules="[{ type: 'minLength', options: { length: 1, message: 'La clé doit avoir au moins 1 caractère.', successMessage: 'La clé a une longueur valide.' } }]"
|
|
855
|
-
/>
|
|
856
|
-
</template>
|
|
857
|
-
`,
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
name: 'Script',
|
|
861
|
-
code: `
|
|
862
|
-
<script setup lang="ts">
|
|
863
|
-
import { NirField } from '@cnamts/synapse'
|
|
864
|
-
import { ref } from 'vue'
|
|
865
|
-
|
|
866
|
-
const value = ref('')
|
|
867
|
-
</script>
|
|
868
|
-
`,
|
|
869
|
-
},
|
|
870
|
-
],
|
|
871
|
-
},
|
|
872
|
-
}
|
|
873
|
-
|
|
874
605
|
export const WithNirTooltip: Story = {
|
|
875
606
|
args: {
|
|
876
607
|
...Default.args,
|
|
@@ -910,7 +641,7 @@ L'infobulle est positionnée avant le champ et s'affiche au survol de l'icône d
|
|
|
910
641
|
<script setup lang="ts">
|
|
911
642
|
import { NirField } from '@cnamts/synapse'
|
|
912
643
|
import { ref } from 'vue'
|
|
913
|
-
|
|
644
|
+
|
|
914
645
|
const value = ref('')
|
|
915
646
|
</script>
|
|
916
647
|
`,
|
|
@@ -958,184 +689,7 @@ L'infobulle est positionnée après le champ et s'affiche au survol de l'icône
|
|
|
958
689
|
<script setup lang="ts">
|
|
959
690
|
import { NirField } from '@cnamts/synapse'
|
|
960
691
|
import { ref } from 'vue'
|
|
961
|
-
|
|
962
|
-
const value = ref('')
|
|
963
|
-
</script>
|
|
964
|
-
`,
|
|
965
|
-
},
|
|
966
|
-
],
|
|
967
|
-
},
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
export const WithWarnings: Story = {
|
|
971
|
-
args: {
|
|
972
|
-
...Default.args,
|
|
973
|
-
showSuccessMessages: false,
|
|
974
|
-
customNumberWarningRules: [
|
|
975
|
-
{
|
|
976
|
-
type: 'custom',
|
|
977
|
-
options: {
|
|
978
|
-
message: 'Attention : ce NIR commence par 1 (homme)',
|
|
979
|
-
warningMessage: 'Attention : ce NIR commence par 1 (homme)',
|
|
980
|
-
validate: (value: string) => {
|
|
981
|
-
if (!value) return false
|
|
982
|
-
// On retourne true si la règle n'est PAS respectée (= warning)
|
|
983
|
-
return !value.startsWith('1')
|
|
984
|
-
},
|
|
985
|
-
isWarning: true,
|
|
986
|
-
},
|
|
987
|
-
},
|
|
988
|
-
{
|
|
989
|
-
type: 'custom',
|
|
990
|
-
options: {
|
|
991
|
-
message: 'Attention : ce NIR commence par 2 (femme)',
|
|
992
|
-
warningMessage: 'Attention : ce NIR commence par 2 (femme)',
|
|
993
|
-
validate: (value: string) => {
|
|
994
|
-
if (!value) return false
|
|
995
|
-
// On retourne true si la règle n'est PAS respectée (= warning)
|
|
996
|
-
return !value.startsWith('2')
|
|
997
|
-
},
|
|
998
|
-
isWarning: true,
|
|
999
|
-
},
|
|
1000
|
-
},
|
|
1001
|
-
],
|
|
1002
|
-
customKeyRules: [
|
|
1003
|
-
{
|
|
1004
|
-
type: 'custom',
|
|
1005
|
-
options: {
|
|
1006
|
-
message: 'La clé doit être comprise entre 01 et 97',
|
|
1007
|
-
validate: (value: string) => {
|
|
1008
|
-
if (!value) return true
|
|
1009
|
-
const numValue = parseInt(value)
|
|
1010
|
-
return numValue >= 1 && numValue <= 97
|
|
1011
|
-
},
|
|
1012
|
-
},
|
|
1013
|
-
},
|
|
1014
|
-
],
|
|
1015
|
-
customKeyWarningRules: [
|
|
1016
|
-
{
|
|
1017
|
-
type: 'custom',
|
|
1018
|
-
options: {
|
|
1019
|
-
message: 'Attention : la clé est supérieure à 50',
|
|
1020
|
-
warningMessage: 'Attention : la clé est supérieure à 50',
|
|
1021
|
-
validate: (value: string) => {
|
|
1022
|
-
if (!value) return false
|
|
1023
|
-
const numValue = parseInt(value)
|
|
1024
|
-
// On retourne true si la règle n'est PAS respectée (= warning)
|
|
1025
|
-
return !(numValue > 50)
|
|
1026
|
-
},
|
|
1027
|
-
isWarning: true,
|
|
1028
|
-
},
|
|
1029
|
-
},
|
|
1030
|
-
],
|
|
1031
|
-
},
|
|
1032
|
-
parameters: {
|
|
1033
|
-
...Default.parameters,
|
|
1034
|
-
docs: {
|
|
1035
|
-
description: {
|
|
1036
|
-
story: `
|
|
1037
|
-
## Exemple d'utilisation des warnings
|
|
1038
|
-
|
|
1039
|
-
Le NirField peut afficher des warnings pour guider l'utilisateur sans bloquer la validation.
|
|
1040
692
|
|
|
1041
|
-
### Warnings sur le NIR
|
|
1042
|
-
- Un warning s'affiche si le NIR commence par 1 (homme)
|
|
1043
|
-
- Un warning s'affiche si le NIR commence par 2 (femme)
|
|
1044
|
-
|
|
1045
|
-
### Warnings sur la clé
|
|
1046
|
-
- Un warning s'affiche si la clé est supérieure à 50
|
|
1047
|
-
- Une erreur s'affiche si la clé n'est pas entre 01 et 97
|
|
1048
|
-
|
|
1049
|
-
### Exemples de NIR valides avec warnings :
|
|
1050
|
-
- \`1234567891011\` (warning : homme)
|
|
1051
|
-
- \`2234567891011\` (warning : femme)
|
|
1052
|
-
- Clé \`51\` (warning : clé > 50)
|
|
1053
|
-
|
|
1054
|
-
Les warnings sont affichés en jaune avec une icône d'avertissement mais ne bloquent pas la validation.
|
|
1055
|
-
Les erreurs sont affichées en rouge et bloquent la validation.
|
|
1056
|
-
`,
|
|
1057
|
-
},
|
|
1058
|
-
},
|
|
1059
|
-
sourceCode: [
|
|
1060
|
-
{
|
|
1061
|
-
name: 'Template',
|
|
1062
|
-
code: `
|
|
1063
|
-
<template>
|
|
1064
|
-
<NirField
|
|
1065
|
-
v-model="value"
|
|
1066
|
-
:required="false"
|
|
1067
|
-
:show-success-messages="true"
|
|
1068
|
-
numberLabel="Numéro de sécurité sociale"
|
|
1069
|
-
keyLabel="Clé"
|
|
1070
|
-
:display-key="true"
|
|
1071
|
-
:customNumberWarningRules="[
|
|
1072
|
-
{
|
|
1073
|
-
type: 'custom',
|
|
1074
|
-
options: {
|
|
1075
|
-
message: 'Attention : ce NIR commence par 1 (homme)',
|
|
1076
|
-
warningMessage: 'Attention : ce NIR commence par 1 (homme)',
|
|
1077
|
-
validate: (value) => {
|
|
1078
|
-
if (!value) return false
|
|
1079
|
-
// On retourne true si la règle n'est PAS respectée (= warning)
|
|
1080
|
-
return !value.startsWith('1')
|
|
1081
|
-
},
|
|
1082
|
-
isWarning: true,
|
|
1083
|
-
},
|
|
1084
|
-
},
|
|
1085
|
-
{
|
|
1086
|
-
type: 'custom',
|
|
1087
|
-
options: {
|
|
1088
|
-
message: 'Attention : ce NIR commence par 2 (femme)',
|
|
1089
|
-
warningMessage: 'Attention : ce NIR commence par 2 (femme)',
|
|
1090
|
-
validate: (value) => {
|
|
1091
|
-
if (!value) return false
|
|
1092
|
-
// On retourne true si la règle n'est PAS respectée (= warning)
|
|
1093
|
-
return !value.startsWith('2')
|
|
1094
|
-
},
|
|
1095
|
-
isWarning: true,
|
|
1096
|
-
},
|
|
1097
|
-
},
|
|
1098
|
-
]"
|
|
1099
|
-
:customKeyRules="[
|
|
1100
|
-
{
|
|
1101
|
-
type: 'custom',
|
|
1102
|
-
options: {
|
|
1103
|
-
message: 'La clé doit être comprise entre 01 et 97',
|
|
1104
|
-
validate: (value) => {
|
|
1105
|
-
if (!value) return true
|
|
1106
|
-
const numValue = parseInt(value)
|
|
1107
|
-
return numValue >= 1 && numValue <= 97
|
|
1108
|
-
},
|
|
1109
|
-
},
|
|
1110
|
-
},
|
|
1111
|
-
]"
|
|
1112
|
-
:customKeyWarningRules="[
|
|
1113
|
-
{
|
|
1114
|
-
type: 'custom',
|
|
1115
|
-
options: {
|
|
1116
|
-
message: 'Attention : la clé est supérieure à 50',
|
|
1117
|
-
warningMessage: 'Attention : la clé est supérieure à 50',
|
|
1118
|
-
validate: (value) => {
|
|
1119
|
-
if (!value) return false
|
|
1120
|
-
const numValue = parseInt(value)
|
|
1121
|
-
// On retourne true si la règle n'est PAS respectée (= warning)
|
|
1122
|
-
return !(numValue > 50)
|
|
1123
|
-
},
|
|
1124
|
-
isWarning: true,
|
|
1125
|
-
},
|
|
1126
|
-
},
|
|
1127
|
-
]"
|
|
1128
|
-
/>
|
|
1129
|
-
</template>
|
|
1130
|
-
`,
|
|
1131
|
-
},
|
|
1132
|
-
{
|
|
1133
|
-
name: 'Script',
|
|
1134
|
-
code: `
|
|
1135
|
-
<script setup lang="ts">
|
|
1136
|
-
import { NirField } from '@cnamts/synapse'
|
|
1137
|
-
import { ref } from 'vue'
|
|
1138
|
-
|
|
1139
693
|
const value = ref('')
|
|
1140
694
|
</script>
|
|
1141
695
|
`,
|
|
@@ -1144,188 +698,6 @@ Les erreurs sont affichées en rouge et bloquent la validation.
|
|
|
1144
698
|
},
|
|
1145
699
|
}
|
|
1146
700
|
|
|
1147
|
-
export const FormValidation: Story = {
|
|
1148
|
-
parameters: {
|
|
1149
|
-
docs: {
|
|
1150
|
-
description: {
|
|
1151
|
-
story: `
|
|
1152
|
-
### Validation de formulaire
|
|
1153
|
-
|
|
1154
|
-
Cette story montre l'utilisation du NirField dans un formulaire avec validation. Le formulaire :
|
|
1155
|
-
- Requiert un NIR valide (13 chiffres)
|
|
1156
|
-
- Requiert une clé valide (2 chiffres)
|
|
1157
|
-
- Affiche des messages de succès quand les champs sont valides
|
|
1158
|
-
- Affiche des messages d'erreur quand les champs sont invalides
|
|
1159
|
-
`,
|
|
1160
|
-
},
|
|
1161
|
-
},
|
|
1162
|
-
sourceCode: [
|
|
1163
|
-
{
|
|
1164
|
-
name: 'Template',
|
|
1165
|
-
code: `<form @submit.prevent="onSubmit">
|
|
1166
|
-
<NirField
|
|
1167
|
-
v-model="value"
|
|
1168
|
-
label="NirField"
|
|
1169
|
-
required
|
|
1170
|
-
:displayKey="false"
|
|
1171
|
-
showSuccessMessages
|
|
1172
|
-
ref="nirField"
|
|
1173
|
-
/>
|
|
1174
|
-
<v-btn
|
|
1175
|
-
type="submit"
|
|
1176
|
-
color="primary"
|
|
1177
|
-
class="mt-4"
|
|
1178
|
-
>
|
|
1179
|
-
Valider
|
|
1180
|
-
</v-btn>
|
|
1181
|
-
</form>`,
|
|
1182
|
-
},
|
|
1183
|
-
{
|
|
1184
|
-
name: 'Script',
|
|
1185
|
-
code: `<script setup lang="ts">
|
|
1186
|
-
import { ref } from 'vue'
|
|
1187
|
-
import { NirField } from '@cnamts/synapse'
|
|
1188
|
-
|
|
1189
|
-
const value = ref('')
|
|
1190
|
-
const nirField = ref()
|
|
1191
|
-
|
|
1192
|
-
const onSubmit = async () => {
|
|
1193
|
-
const isValid = await nirField.value?.validateOnSubmit()
|
|
1194
|
-
|
|
1195
|
-
if (isValid) {
|
|
1196
|
-
alert('Formulaire soumis avec succès !')
|
|
1197
|
-
}
|
|
1198
|
-
else {
|
|
1199
|
-
alert('Formulaire non soumis !')
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
</script>`,
|
|
1203
|
-
},
|
|
1204
|
-
],
|
|
1205
|
-
},
|
|
1206
|
-
render: args => ({
|
|
1207
|
-
components: { NirField, VBtn },
|
|
1208
|
-
setup() {
|
|
1209
|
-
const value = ref('')
|
|
1210
|
-
const nirField = ref()
|
|
1211
|
-
|
|
1212
|
-
const onSubmit = async () => {
|
|
1213
|
-
const isValid = await nirField.value?.validateOnSubmit()
|
|
1214
|
-
|
|
1215
|
-
if (isValid) {
|
|
1216
|
-
alert('Formulaire soumis avec succès !')
|
|
1217
|
-
}
|
|
1218
|
-
else {
|
|
1219
|
-
alert('Formulaire non soumis !')
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
return { args, value, nirField, onSubmit }
|
|
1224
|
-
},
|
|
1225
|
-
template: `
|
|
1226
|
-
<form @submit.prevent="onSubmit">
|
|
1227
|
-
<NirField
|
|
1228
|
-
v-model="value"
|
|
1229
|
-
v-bind="args"
|
|
1230
|
-
label="NirField"
|
|
1231
|
-
required
|
|
1232
|
-
showSuccessMessages
|
|
1233
|
-
:displayKey="false"
|
|
1234
|
-
ref="nirField"
|
|
1235
|
-
/>
|
|
1236
|
-
<v-btn
|
|
1237
|
-
type="submit"
|
|
1238
|
-
color="primary"
|
|
1239
|
-
class="mt-4"
|
|
1240
|
-
>
|
|
1241
|
-
Valider
|
|
1242
|
-
</v-btn>
|
|
1243
|
-
</form>
|
|
1244
|
-
`,
|
|
1245
|
-
}),
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
export const DisableErrorHandling: Story = {
|
|
1249
|
-
parameters: {
|
|
1250
|
-
docs: {
|
|
1251
|
-
description: {
|
|
1252
|
-
story: `
|
|
1253
|
-
### Désactivation de la gestion des erreurs
|
|
1254
|
-
|
|
1255
|
-
Cette story illustre l'utilisation de la propriété \`disableErrorHandling\` qui permet de désactiver complètement
|
|
1256
|
-
la gestion et l'affichage des erreurs dans un champ, même si des règles de validation sont définies.
|
|
1257
|
-
|
|
1258
|
-
Cela peut être utile dans des cas particuliers où vous souhaitez définir des règles de validation
|
|
1259
|
-
mais gérer leur affichage différemment, ou utiliser la validation uniquement au niveau du formulaire parent.
|
|
1260
|
-
`,
|
|
1261
|
-
},
|
|
1262
|
-
},
|
|
1263
|
-
sourceCode: [
|
|
1264
|
-
{
|
|
1265
|
-
name: 'Template',
|
|
1266
|
-
code: `<template>
|
|
1267
|
-
<!-- Champ avec validation normale -->
|
|
1268
|
-
<NirField
|
|
1269
|
-
v-model="value"
|
|
1270
|
-
label="NIR avec validation"
|
|
1271
|
-
required
|
|
1272
|
-
/>
|
|
1273
|
-
|
|
1274
|
-
<!-- Champ avec gestion d'erreurs désactivée -->
|
|
1275
|
-
<NirField
|
|
1276
|
-
v-model="value"
|
|
1277
|
-
label="NIR sans gestion d'erreurs"
|
|
1278
|
-
required
|
|
1279
|
-
disableErrorHandling
|
|
1280
|
-
/>
|
|
1281
|
-
</template>`,
|
|
1282
|
-
},
|
|
1283
|
-
],
|
|
1284
|
-
},
|
|
1285
|
-
render: () => ({
|
|
1286
|
-
components: { NirField },
|
|
1287
|
-
setup() {
|
|
1288
|
-
const value1 = ref('')
|
|
1289
|
-
const value2 = ref('')
|
|
1290
|
-
|
|
1291
|
-
return { value1, value2 }
|
|
1292
|
-
},
|
|
1293
|
-
template: `
|
|
1294
|
-
<div>
|
|
1295
|
-
<div>
|
|
1296
|
-
<div>
|
|
1297
|
-
<p class="text-subtitle-2 mb-2">Validation normale</p>
|
|
1298
|
-
<NirField
|
|
1299
|
-
v-model="value1"
|
|
1300
|
-
label="NIR avec validation"
|
|
1301
|
-
required
|
|
1302
|
-
/>
|
|
1303
|
-
</div>
|
|
1304
|
-
|
|
1305
|
-
<div>
|
|
1306
|
-
<p class="text-subtitle-2 mb-2">Sans gestion d'erreurs</p>
|
|
1307
|
-
<NirField
|
|
1308
|
-
v-model="value2"
|
|
1309
|
-
label="NIR sans gestion d'erreurs"
|
|
1310
|
-
required
|
|
1311
|
-
disableErrorHandling
|
|
1312
|
-
/>
|
|
1313
|
-
</div>
|
|
1314
|
-
</div>
|
|
1315
|
-
|
|
1316
|
-
<div class="mt-4 text-body-2">
|
|
1317
|
-
<p>Instructions :</p>
|
|
1318
|
-
<ol>
|
|
1319
|
-
<li class="ml-4">Cliquez dans un champ puis en dehors pour déclencher la validation</li>
|
|
1320
|
-
<li class="ml-4">Essayez de saisir des valeurs invalides (moins de 13 chiffres)</li>
|
|
1321
|
-
<li class="ml-4">Notez que le premier champ affiche des erreurs, mais pas le second</li>
|
|
1322
|
-
</ol>
|
|
1323
|
-
</div>
|
|
1324
|
-
</div>
|
|
1325
|
-
`,
|
|
1326
|
-
}),
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
701
|
export const WithCustomLocale: Story = {
|
|
1330
702
|
args: {
|
|
1331
703
|
...Default.args,
|
|
@@ -1459,3 +831,205 @@ export const ComplexNirType: Story = {
|
|
|
1459
831
|
`,
|
|
1460
832
|
}),
|
|
1461
833
|
}
|
|
834
|
+
|
|
835
|
+
export const CustomRulesPrecedence: Story = {
|
|
836
|
+
args: {
|
|
837
|
+
modelValue: '',
|
|
838
|
+
required: false,
|
|
839
|
+
numberLabel: 'Numéro de sécurité sociale',
|
|
840
|
+
keyLabel: 'Clé',
|
|
841
|
+
displayKey: true,
|
|
842
|
+
nirType: 'complexe',
|
|
843
|
+
customNumberRules: [
|
|
844
|
+
{
|
|
845
|
+
type: 'custom',
|
|
846
|
+
options: {
|
|
847
|
+
validate: (value: string) => {
|
|
848
|
+
if (!value) return true
|
|
849
|
+
if (value.length < 13) return true
|
|
850
|
+
|
|
851
|
+
// Accepte tous les codes sexe 1-8 (y compris 5 et 6 pour migrants)
|
|
852
|
+
const migrantRegex = /^[1-8]\d{12}$/
|
|
853
|
+
return migrantRegex.test(value.replace(/\s/g, ''))
|
|
854
|
+
},
|
|
855
|
+
message: 'Format du NIR invalide',
|
|
856
|
+
successMessage: 'Le numéro de sécurité sociale est valide',
|
|
857
|
+
},
|
|
858
|
+
},
|
|
859
|
+
],
|
|
860
|
+
customKeyRules: [
|
|
861
|
+
{
|
|
862
|
+
type: 'custom',
|
|
863
|
+
options: {
|
|
864
|
+
validate: (value: string) => {
|
|
865
|
+
if (!value) return true
|
|
866
|
+
if (value.length !== 2) return true
|
|
867
|
+
return /^\d{2}$/.test(value)
|
|
868
|
+
},
|
|
869
|
+
message: 'Format de clé invalide',
|
|
870
|
+
successMessage: 'La clé de contrôle est valide',
|
|
871
|
+
},
|
|
872
|
+
},
|
|
873
|
+
],
|
|
874
|
+
customRulesPrecedence: true,
|
|
875
|
+
showSuccessMessages: true,
|
|
876
|
+
},
|
|
877
|
+
parameters: {
|
|
878
|
+
docs: {
|
|
879
|
+
description: {
|
|
880
|
+
story: `
|
|
881
|
+
### Custom Rules Precedence - Support des NIR migrants
|
|
882
|
+
|
|
883
|
+
Cette story démontre l'utilisation de la prop \`customRulesPrecedence\` pour contourner la validation standard
|
|
884
|
+
et accepter des formats de NIR non prévus initialement, comme les NIR de migrants (codes sexe 5 et 6).
|
|
885
|
+
|
|
886
|
+
#### Cas d'usage
|
|
887
|
+
- **NIR migrants** : Codes sexe 5 (masculin) et 6 (féminin) non supportés par la validation standard
|
|
888
|
+
- **Formats spécifiques** : Besoin de valider des formats particuliers non couverts par la regex standard
|
|
889
|
+
- **Migration progressive** : Accepter temporairement des formats legacy en attendant une correction native
|
|
890
|
+
|
|
891
|
+
#### Fonctionnement
|
|
892
|
+
1. **customRulesPrecedence="true"** : Donne priorité absolue aux règles personnalisées
|
|
893
|
+
2. **Ignorer la validation standard** : La règle de validation NIR native n'est pas exécutée
|
|
894
|
+
3. **Contrôle total** : Vous définissez complètement la logique de validation
|
|
895
|
+
|
|
896
|
+
#### Exemples de NIR acceptés avec cette configuration :
|
|
897
|
+
- \`5900175120005\` (masculin migrant)
|
|
898
|
+
- \`6900175120005\` (féminin migrante)
|
|
899
|
+
- \`1900175120005\` (masculin standard)
|
|
900
|
+
- \`2900175120005\` (féminin standard)
|
|
901
|
+
|
|
902
|
+
#### Limitations
|
|
903
|
+
- La clé de contrôle n'est pas calculée avec l'algorithme standard pour les NIR migrants
|
|
904
|
+
- C'est un contournement, pas une correction native du composant
|
|
905
|
+
- Nécessite de maintenir les règles personnalisées en parallèle
|
|
906
|
+
|
|
907
|
+
Pour plus d'informations, voir la [documentation technique](/?path=/docs/composants-formulaires-nirfield--docs#ancre-customrulesprecedent).`,
|
|
908
|
+
},
|
|
909
|
+
},
|
|
910
|
+
sourceCode: [
|
|
911
|
+
{
|
|
912
|
+
name: 'Template',
|
|
913
|
+
code: `
|
|
914
|
+
<template>
|
|
915
|
+
<NirField
|
|
916
|
+
v-model="value"
|
|
917
|
+
:required="false"
|
|
918
|
+
numberLabel="Numéro de sécurité sociale"
|
|
919
|
+
keyLabel="Clé"
|
|
920
|
+
:displayKey="true"
|
|
921
|
+
nirType="complexe"
|
|
922
|
+
:custom-number-rules="customNumberRules"
|
|
923
|
+
:custom-key-rules="customKeyRules"
|
|
924
|
+
custom-rules-precedence
|
|
925
|
+
:show-success-messages="true"
|
|
926
|
+
/>
|
|
927
|
+
</template>
|
|
928
|
+
`,
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
name: 'Script',
|
|
932
|
+
code: `
|
|
933
|
+
<script setup lang="ts">
|
|
934
|
+
import { NirField } from '@cnamts/synapse'
|
|
935
|
+
import { ref } from 'vue'
|
|
936
|
+
|
|
937
|
+
const value = ref('')
|
|
938
|
+
|
|
939
|
+
const customNumberRules = [
|
|
940
|
+
{
|
|
941
|
+
type: 'custom',
|
|
942
|
+
options: {
|
|
943
|
+
validate: (value: string) => {
|
|
944
|
+
if (!value) return true
|
|
945
|
+
if (value.length < 13) return true
|
|
946
|
+
|
|
947
|
+
// Accepte tous les codes sexe 1-8 (y compris 5 et 6 pour migrants)
|
|
948
|
+
const migrantRegex = /^[1-8]\\d{12}$/
|
|
949
|
+
return migrantRegex.test(value.replace(/\\s/g, ''))
|
|
950
|
+
},
|
|
951
|
+
message: 'Format du NIR invalide',
|
|
952
|
+
successMessage: 'Le numéro de sécurité sociale est valide',
|
|
953
|
+
},
|
|
954
|
+
},
|
|
955
|
+
]
|
|
956
|
+
|
|
957
|
+
const customKeyRules = [
|
|
958
|
+
{
|
|
959
|
+
type: 'custom',
|
|
960
|
+
options: {
|
|
961
|
+
validate: (value: string) => {
|
|
962
|
+
if (!value) return true
|
|
963
|
+
if (value.length !== 2) return true
|
|
964
|
+
return /^\\d{2}$/.test(value)
|
|
965
|
+
},
|
|
966
|
+
message: 'Format de clé invalide',
|
|
967
|
+
successMessage: 'La clé de contrôle est valide',
|
|
968
|
+
},
|
|
969
|
+
},
|
|
970
|
+
]
|
|
971
|
+
</script>
|
|
972
|
+
`,
|
|
973
|
+
},
|
|
974
|
+
],
|
|
975
|
+
},
|
|
976
|
+
render: () => ({
|
|
977
|
+
components: { NirField },
|
|
978
|
+
setup() {
|
|
979
|
+
const value = ref('')
|
|
980
|
+
|
|
981
|
+
const customNumberRules = [
|
|
982
|
+
{
|
|
983
|
+
type: 'custom',
|
|
984
|
+
options: {
|
|
985
|
+
validate: (value: string) => {
|
|
986
|
+
if (!value) return true
|
|
987
|
+
if (value.length < 13) return true
|
|
988
|
+
|
|
989
|
+
// Accepte tous les codes sexe 1-8 (y compris 5 et 6 pour migrants)
|
|
990
|
+
const migrantRegex = /^[1-8]\d{12}$/
|
|
991
|
+
return migrantRegex.test(value.replace(/\s/g, ''))
|
|
992
|
+
},
|
|
993
|
+
message: 'Format du NIR invalide',
|
|
994
|
+
successMessage: 'Le numéro de sécurité sociale est valide',
|
|
995
|
+
},
|
|
996
|
+
},
|
|
997
|
+
]
|
|
998
|
+
|
|
999
|
+
const customKeyRules = [
|
|
1000
|
+
{
|
|
1001
|
+
type: 'custom',
|
|
1002
|
+
options: {
|
|
1003
|
+
validate: (value: string) => {
|
|
1004
|
+
if (!value) return true
|
|
1005
|
+
if (value.length !== 2) return true
|
|
1006
|
+
return /^\d{2}$/.test(value)
|
|
1007
|
+
},
|
|
1008
|
+
message: 'Format de clé invalide',
|
|
1009
|
+
successMessage: 'La clé de contrôle est valide',
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
]
|
|
1013
|
+
|
|
1014
|
+
return { value, customNumberRules, customKeyRules }
|
|
1015
|
+
},
|
|
1016
|
+
template: `
|
|
1017
|
+
<div>
|
|
1018
|
+
<p class="mt-2">Cette configuration utilise <code>customRulesPrecedence</code> pour accepter les NIR migrants (codes 5 et 6).</p>
|
|
1019
|
+
<p class="mb-4">Essayez de saisir : <strong>5900175120005</strong> ou <strong>6900175120005</strong></p>
|
|
1020
|
+
</div>
|
|
1021
|
+
<NirField
|
|
1022
|
+
v-model="value"
|
|
1023
|
+
:required="false"
|
|
1024
|
+
:numberLabel="'Numéro de sécurité sociale'"
|
|
1025
|
+
:keyLabel="'Clé'"
|
|
1026
|
+
:displayKey="true"
|
|
1027
|
+
nirType="complexe"
|
|
1028
|
+
:custom-number-rules="customNumberRules"
|
|
1029
|
+
:custom-key-rules="customKeyRules"
|
|
1030
|
+
custom-rules-precedence
|
|
1031
|
+
:show-success-messages="true"
|
|
1032
|
+
/>
|
|
1033
|
+
`,
|
|
1034
|
+
}),
|
|
1035
|
+
}
|