@cnamts/synapse 1.0.1 → 1.0.2
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/{DateFilter-BmRuzQ9Z.js → DateFilter-YWOTbfeL.js} +1 -1
- package/dist/{NumberFilter-CnIPDHqx.js → NumberFilter-DMmMgALM.js} +1 -1
- package/dist/{PeriodFilter-CZwZ8CnQ.js → PeriodFilter-Bok5BHcn.js} +1 -1
- package/dist/SelectFilter-BKud2WhN.js +136 -0
- package/dist/{TextFilter-DTxZHJwX.js → TextFilter-DvMf2thH.js} +1 -1
- package/dist/components/Accordion/Accordion.d.ts +2 -1
- package/dist/components/Accordion/composables/useAccordionGroupCommunication.d.ts +5 -0
- package/dist/components/Accordion/composables/useAccordionKeyboardNavigation.d.ts +12 -0
- package/dist/components/Accordion/composables/useAccordionState.d.ts +13 -0
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +85 -0
- package/dist/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -0
- package/dist/components/Customs/SySelect/SySelect.d.ts +33 -13
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +2 -2
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +1585 -1452
- package/dist/components/DatePicker/DatePicker/DatePicker.d.ts +16 -2
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +3 -1
- package/dist/components/DatePicker/composables/index.d.ts +2 -0
- package/dist/components/DatePicker/composables/useAsteriskDisplay.d.ts +14 -0
- package/dist/components/DatePicker/composables/useDateAutoClamp.d.ts +16 -0
- package/dist/components/DatePicker/composables/useDateRangeInput.d.ts +1 -1
- package/dist/components/DatePicker/composables/useDisplayedDateString.d.ts +3 -0
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +1 -0
- package/dist/components/DatePicker/composables/useMonthButtonCustomization.d.ts +5 -2
- package/dist/components/NirField/NirField.d.ts +7 -3
- package/dist/components/NirField/nirValidation.d.ts +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +2 -0
- package/dist/components/PeriodField/PeriodField.d.ts +52 -8
- package/dist/components/PhoneField/PhoneField.d.ts +2 -2
- package/dist/components/RangeField/RangeField.d.ts +2 -0
- package/dist/components/SearchListField/SearchListField.d.ts +9 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +2 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +14 -9
- package/dist/components/Tables/SyTable/SyTable.d.ts +12 -7
- package/dist/components/Tables/common/SyTablePagination.d.ts +1636 -0
- package/dist/components/Tables/common/TableHeader.d.ts +2 -20
- package/dist/components/Tables/common/filters/SelectFilter.d.ts +5 -5
- package/dist/components/Tables/common/filters/getFilterComponent.d.ts +1 -0
- package/dist/components/Tables/common/filters/locales.d.ts +4 -0
- package/dist/components/Tables/common/filters/logics/date.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/number.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/period.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/select.d.ts +1 -0
- package/dist/components/Tables/common/filters/logics/text.d.ts +1 -0
- package/dist/components/Tables/common/locales.d.ts +21 -0
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +267 -0
- package/dist/components/Tables/common/organizeColumns/sortHeaders.d.ts +2 -0
- package/dist/components/Tables/common/tableFilterUtils.d.ts +1 -0
- package/dist/components/Tables/common/tableStorageUtils.d.ts +41 -1
- package/dist/components/Tables/common/tableUtils.d.ts +42 -5
- package/dist/components/Tables/common/types.d.ts +19 -8
- package/dist/components/Tables/common/usePagination.d.ts +22 -0
- package/dist/components/Tables/common/useTableCheckbox.d.ts +20 -0
- package/dist/components/Tables/common/useTableHeaders.d.ts +76 -0
- package/dist/components/Tables/common/useTableItems.d.ts +24 -0
- package/dist/components/Tables/common/useTableOptions.d.ts +18 -0
- package/dist/components/ToolbarContainer/ToolbarContainer.d.ts +11 -0
- package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +9 -2
- package/dist/components/index.d.ts +8 -6
- package/dist/design-system-v3.js +58 -56
- package/dist/design-system-v3.umd.cjs +22 -22
- package/dist/main-Cx8qG7YR.js +16344 -0
- package/dist/stories/Accessibilite/Vuetify/VuetifyItems.d.ts +14 -2
- package/dist/stories/DesignTokens/StylesTypographiques.stories.new.d.ts +8 -0
- package/dist/stories/DesignTokens/TypographyDisplay.d.ts +28 -0
- package/dist/stories/DesignTokens/vue-shims.d.ts +6 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/common/imgs/accessibility-svgrepo-com.svg +4 -0
- package/src/components/Accordion/Accessibilite/AccessibilityGuide.mdx +249 -0
- package/src/components/Accordion/Accordion.vue +48 -76
- package/src/components/Accordion/composables/__tests__/useAccordionGroupCommunication.spec.ts +146 -0
- package/src/components/Accordion/composables/__tests__/useAccordionKeyboardNavigation.spec.ts +209 -0
- package/src/components/Accordion/composables/__tests__/useAccordionState.spec.ts +144 -0
- package/src/components/Accordion/composables/useAccordionGroupCommunication.ts +52 -0
- package/src/components/Accordion/composables/useAccordionKeyboardNavigation.ts +111 -0
- package/src/components/Accordion/composables/useAccordionState.ts +59 -0
- package/src/components/Accordion/tests/__snapshots__/accordion.spec.ts.snap +3 -0
- package/src/components/Customs/SyCheckbox/Accessibilite.mdx +303 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +50 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +630 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +326 -0
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +201 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +1 -0
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +8 -1
- package/src/components/Customs/SySelect/SySelect.stories.ts +160 -0
- package/src/components/Customs/SySelect/SySelect.vue +291 -32
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +230 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +3 -2
- package/src/components/Customs/SyTextField/SyTextField.vue +19 -8
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +241 -31
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +305 -57
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.events.spec.ts +161 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +4 -2
- package/src/components/DatePicker/DatePicker/DatePicker.stories.ts +259 -137
- package/src/components/DatePicker/DatePicker/DatePicker.vue +153 -25
- package/src/components/DatePicker/DatePicker/tests/DatePicker.events.spec.ts +189 -0
- package/src/components/DatePicker/DatePicker/{DatePicker.spec.ts → tests/DatePicker.spec.ts} +1 -15
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +24 -14
- package/src/components/DatePicker/DateTextInput/DateTextInput.events.spec.ts +148 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +3 -1
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +200 -5
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +241 -31
- package/src/components/DatePicker/composables/index.ts +2 -0
- package/src/components/DatePicker/composables/tests/useDateAutoClamp.spec.ts +190 -0
- package/src/components/DatePicker/composables/tests/useInputBlurHandler.spec.ts +182 -4
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +105 -80
- package/src/components/DatePicker/composables/useAsteriskDisplay.ts +31 -0
- package/src/components/DatePicker/composables/useDateAutoClamp.ts +136 -0
- package/src/components/DatePicker/composables/useDateRangeInput.ts +21 -18
- package/src/components/DatePicker/composables/useDisplayedDateString.ts +13 -1
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +84 -20
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +149 -51
- package/src/components/DiacriticPicker/DiacriticPicker.stories.ts +10 -0
- package/src/components/ErrorPage/Accessibilite.stories.ts +8 -0
- package/src/components/ErrorPage/ErrorPage.vue +12 -6
- package/src/components/ErrorPage/tests/__snapshots__/ErrorPage.spec.ts.snap +4 -4
- package/src/components/NirField/NirField.mdx +22 -9
- package/src/components/NirField/NirField.stories.ts +26 -2
- package/src/components/NirField/NirField.vue +209 -22
- package/src/components/NirField/nirValidation.ts +17 -3
- package/src/components/NirField/tests/NirField.spec.ts +2 -2
- package/src/components/NotFoundPage/Accessibilite.stories.ts +8 -0
- package/src/components/NotFoundPage/NotFoundPage.vue +2 -1
- package/src/components/NotFoundPage/tests/__snapshots__/NotFoundPage.spec.ts.snap +8 -6
- package/src/components/PaginatedTable/PaginatedTable.mdx +2 -0
- package/src/components/PasswordField/PasswordField.stories.ts +4 -0
- package/src/components/PasswordField/PasswordField.vue +3 -0
- package/src/components/PeriodField/PeriodField.vue +2 -0
- package/src/components/PhoneField/PhoneField.stories.ts +15 -15
- package/src/components/PhoneField/PhoneField.vue +1 -1
- package/src/components/RangeField/RangeField.stories.ts +9 -0
- package/src/components/RangeField/RangeField.vue +4 -0
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +12 -0
- package/src/components/SearchListField/SearchListField.vue +5 -0
- package/src/components/SyTextArea/SyTextArea.vue +3 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +0 -1
- package/src/components/Tables/SyServerTable/FilterRules.stories.ts +632 -15
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +15 -5
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +2844 -1377
- package/src/components/Tables/SyServerTable/SyServerTable.vue +155 -66
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +256 -4
- package/src/components/Tables/SyTable/FilterRules.stories.ts +183 -0
- package/src/components/Tables/SyTable/SyTable.mdx +14 -4
- package/src/components/Tables/SyTable/SyTable.stories.ts +1265 -477
- package/src/components/Tables/SyTable/SyTable.vue +152 -72
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +366 -4
- package/src/components/Tables/common/SyTableFilter.vue +3 -56
- package/src/components/Tables/common/SyTablePagination.vue +375 -0
- package/src/components/Tables/common/TableHeader.vue +10 -26
- package/src/components/Tables/common/filters/SelectFilter.vue +131 -22
- package/src/components/Tables/common/filters/getFilterComponent.ts +54 -0
- package/src/components/Tables/common/filters/locales.ts +4 -0
- package/src/components/Tables/common/filters/logics/date.ts +12 -0
- package/src/components/Tables/common/filters/logics/number.ts +48 -0
- package/src/components/Tables/common/filters/logics/period.ts +25 -0
- package/src/components/Tables/common/filters/logics/select.ts +27 -0
- package/src/components/Tables/common/filters/logics/tests/TextFilterLogic.spec.ts +177 -0
- package/src/components/Tables/common/filters/logics/text.ts +62 -0
- package/src/components/Tables/common/filters/tests/TextFilter.spec.ts +11 -11
- package/src/components/Tables/common/locales.ts +24 -0
- package/src/components/Tables/common/organizeColumns/OrganizeColumns.vue +269 -0
- package/src/components/Tables/common/organizeColumns/sortHeaders.ts +9 -0
- package/src/components/Tables/common/tableFilterUtils.ts +43 -295
- package/src/components/Tables/common/tableStorageUtils.ts +27 -2
- package/src/components/Tables/common/tableStyles.scss +26 -0
- package/src/components/Tables/common/tableUtils.ts +3 -16
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +170 -0
- package/src/components/Tables/common/tests/filterByRange.spec.ts +215 -0
- package/src/components/Tables/common/tests/tableFilterUtils.spec.ts +0 -14
- package/src/components/Tables/common/tests/tableUtils.spec.ts +7 -51
- package/src/components/Tables/common/types.ts +17 -6
- package/src/components/Tables/common/usePagination.ts +83 -0
- package/src/components/Tables/common/useTableCheckbox.ts +58 -0
- package/src/components/Tables/common/useTableHeaders.ts +88 -0
- package/src/components/Tables/common/useTableItems.ts +87 -0
- package/src/components/Tables/common/useTableOptions.ts +93 -0
- package/src/components/ToolbarContainer/ToolbarContainer.mdx +16 -0
- package/src/components/ToolbarContainer/ToolbarContainer.stories.ts +675 -0
- package/src/components/ToolbarContainer/ToolbarContainer.vue +128 -0
- package/src/components/ToolbarContainer/tests/ToolbarContainer.spec.ts +156 -0
- package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +74 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +19 -17
- package/src/components/index.ts +8 -6
- package/src/stories/Accessibilite/Aculturation/AuditDesignSystem.mdx +293 -20
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +448 -54
- package/src/stories/Accessibilite/Audit/RGAA.mdx +231 -23
- package/src/stories/Accessibilite/Avancement/Avancement.mdx +591 -7
- package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +139 -38
- package/src/stories/Accessibilite/Introduction.mdx +258 -18
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +221 -31
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +204 -22
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +537 -24
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +577 -70
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru.mdx +382 -31
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +419 -81
- package/src/stories/Accessibilite/Vuetify/Vuetify.mdx +132 -6
- package/src/stories/Accessibilite/Vuetify/Vuetify.stories.ts +370 -146
- package/src/stories/Accessibilite/Vuetify/VuetifyItems.ts +35 -57
- package/src/stories/Demarrer/Accueil.stories.ts +20 -5
- package/src/stories/DesignTokens/StylesTypographiques.mdx +10 -9
- package/src/stories/DesignTokens/StylesTypographiques.stories.new.ts +397 -0
- package/src/stories/DesignTokens/StylesTypographiques.stories.ts +397 -0
- package/src/stories/DesignTokens/TypographyDisplay.vue +155 -0
- package/src/stories/DesignTokens/vue-shims.d.ts +6 -0
- package/src/stories/GuideDuDev/LesBreackingChanges.mdx +0 -2
- package/src/stories/GuideDuDev/MigrationDepuisBridge.mdx +1 -1
- package/src/stories/GuideDuDev/MigrationDepuisVue2.mdx +1 -1
- package/src/stories/GuideDuDev/PortailAgent.mdx +10 -0
- package/src/stories/GuideDuDev/PortailAgent.stories.ts +506 -0
- package/src/stories/GuideDuDev/Theme.mdx +41 -0
- package/dist/SelectFilter-Cj-GW2Cc.js +0 -97
- package/dist/main-WDqeoGM-.js +0 -14788
- package/src/components/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +0 -886
- package/src/components/Tables/SyServerTable/tests/__snapshots__/SyServerTable.spec.ts.snap +0 -521
- package/src/components/Tables/SyTable/tests/__snapshots__/SyTable.spec.ts.snap +0 -521
- package/src/stories/DesignTokens/ThemePA.mdx +0 -35
|
@@ -87,14 +87,14 @@ exports[`ErrorPage > renders correctly 1`] = `
|
|
|
87
87
|
v-col-sm-12
|
|
88
88
|
">
|
|
89
89
|
<!-- v-if -->
|
|
90
|
-
<
|
|
90
|
+
<h1 class="
|
|
91
91
|
font-weight-bold
|
|
92
92
|
mb-2
|
|
93
93
|
mb-4
|
|
94
94
|
text-h5
|
|
95
95
|
">
|
|
96
96
|
Something went wrong
|
|
97
|
-
</
|
|
97
|
+
</h1>
|
|
98
98
|
<p>
|
|
99
99
|
Error message
|
|
100
100
|
</p>
|
|
@@ -206,14 +206,14 @@ exports[`ErrorPage > renders correctly with undefined route 1`] = `
|
|
|
206
206
|
</span>
|
|
207
207
|
501
|
|
208
208
|
</div>
|
|
209
|
-
<
|
|
209
|
+
<h1 class="
|
|
210
210
|
font-weight-bold
|
|
211
211
|
mb-2
|
|
212
212
|
mb-4
|
|
213
213
|
text-h5
|
|
214
214
|
">
|
|
215
215
|
Error
|
|
216
|
-
</
|
|
216
|
+
</h1>
|
|
217
217
|
<p>
|
|
218
218
|
Error message
|
|
219
219
|
</p>
|
|
@@ -65,15 +65,28 @@ Le composant `NirField` est utilisé pour afficher un champ de saisie de numéro
|
|
|
65
65
|
Le composant `NirField` utilise des règles de validation par défaut pour le numéro NIR et la Clé. Voici les règles de validation par défaut :
|
|
66
66
|
|
|
67
67
|
#### Pour le numéro NIR :
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- 3 chiffres
|
|
76
|
-
- Le
|
|
68
|
+
|
|
69
|
+
- Props: `nirType` à simple (par defaut) d'après le [repo](https://github.com/assurance-maladie-digital/nir-validation) :
|
|
70
|
+
|
|
71
|
+
- Le 1er chiffre (1er composant) permet d'identifier le sexe de l'assuré (1 pour un homme et 2 pour une femme) ;
|
|
72
|
+
- Le second composant est un groupe de deux chiffres permettant de distinguer l'année de naissance (exemple 77 pour 1977) ;
|
|
73
|
+
- Le 3ème composant est un groupe de deux chiffres correspondant au mois de naissance (de 01 à 12) mais peut aussi prendre d’autres valeurs (de 20 à 99) qui indiquent que le mois de naissance de l’individu n’est pas connu (cela peut arriver pour des personnes nées à l’étranger) (https://www.insee.fr/fr/information/6665190?sommaire=6665196#titre-bloc-encadre4) ;
|
|
74
|
+
- Le 4ème correspond au département de naissance selon le code géographique officiel (de 01 à 95 et 97 pour les DOM et COM 976, 98 pour les TOM et COM et enfin 99 pour les nés hors de France) ;
|
|
75
|
+
- Le 5ème est un groupe de 3 chiffres permettant d'identifier la commune de naissance, selon le code géographique officiel édité par l'INSEE (https://www.insee.fr/fr/information/5057840) ;
|
|
76
|
+
- Le 6ème est un groupe de 3 chiffres, correspondant au rang d'inscription sur la liste du répertoire régional de l'INSEE ;
|
|
77
|
+
- Le 7ème composant optionnel est un groupe de 2 chiffres appelé la clé de contrôle du NIR.
|
|
78
|
+
|
|
79
|
+
- Props: `nirType` à complexe : d'après la page [Wikipedia](https://fr.wikipedia.org/wiki/Num%C3%A9ro_de_s%C3%A9curit%C3%A9_sociale_en_France)
|
|
80
|
+
|
|
81
|
+
- Le numéro NIR doit être composé de 13 chiffres.
|
|
82
|
+
- Le numéro NIR doit respecter le format suivant :
|
|
83
|
+
- 1 chiffre pour le sexe (1-4, 7, 8)
|
|
84
|
+
- 2 chiffres pour l'année de naissance
|
|
85
|
+
- 2 chiffres pour le mois de naissance (01-12, 20-42)
|
|
86
|
+
- 2 chiffres pour le département de naissance (01-99, 2A, 2B, 96, 97X, 98X)
|
|
87
|
+
- 3 chiffres pour la commune de naissance
|
|
88
|
+
- 3 chiffres pour le rang d'inscription
|
|
89
|
+
- Le numéro NIR doit passer la validation de la clé de contrôle (2 chiffres).
|
|
77
90
|
|
|
78
91
|
#### Pour la Clé :
|
|
79
92
|
- La clé doit être composée de 2 chiffres.
|
|
@@ -127,6 +127,20 @@ const meta: Meta<typeof NirField> = {
|
|
|
127
127
|
},
|
|
128
128
|
},
|
|
129
129
|
},
|
|
130
|
+
nirType: {
|
|
131
|
+
description: 'Type de validation de NIR.',
|
|
132
|
+
control: 'select',
|
|
133
|
+
options: ['simple', 'complexe'],
|
|
134
|
+
default: 'simple',
|
|
135
|
+
table: {
|
|
136
|
+
type: {
|
|
137
|
+
summary: 'string',
|
|
138
|
+
},
|
|
139
|
+
defaultValue: {
|
|
140
|
+
summary: 'simple',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
130
144
|
showSuccessMessages: {
|
|
131
145
|
description: 'Indique si les messages de succès sont affichés.',
|
|
132
146
|
control: 'boolean',
|
|
@@ -326,6 +340,16 @@ const meta: Meta<typeof NirField> = {
|
|
|
326
340
|
},
|
|
327
341
|
},
|
|
328
342
|
},
|
|
343
|
+
withoutFieldset: {
|
|
344
|
+
description: 'Indique si le champ NIR est affiché sans fieldset. (Par défaut, le champ NIR est affiché dans un fieldset si displayKey est true pour des raisons d\'accessibilité)',
|
|
345
|
+
control: 'boolean',
|
|
346
|
+
default: false,
|
|
347
|
+
table: {
|
|
348
|
+
type: {
|
|
349
|
+
summary: 'boolean',
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
},
|
|
329
353
|
},
|
|
330
354
|
} satisfies Meta<typeof NirField>
|
|
331
355
|
|
|
@@ -1133,7 +1157,7 @@ Cette story montre l'utilisation du NirField dans un formulaire avec validation.
|
|
|
1133
1157
|
code: `<form @submit.prevent="onSubmit">
|
|
1134
1158
|
<NirField
|
|
1135
1159
|
v-model="value"
|
|
1136
|
-
label="
|
|
1160
|
+
label="NirField"
|
|
1137
1161
|
required
|
|
1138
1162
|
showSuccessMessages
|
|
1139
1163
|
ref="nirField"
|
|
@@ -1194,7 +1218,7 @@ const onSubmit = async () => {
|
|
|
1194
1218
|
<NirField
|
|
1195
1219
|
v-model="value"
|
|
1196
1220
|
v-bind="args"
|
|
1197
|
-
label="
|
|
1221
|
+
label="NirField"
|
|
1198
1222
|
required
|
|
1199
1223
|
showSuccessMessages
|
|
1200
1224
|
ref="nirField"
|
|
@@ -40,9 +40,11 @@
|
|
|
40
40
|
persistentHint?: boolean
|
|
41
41
|
persistentPlaceholder?: boolean
|
|
42
42
|
disableErrorHandling?: boolean
|
|
43
|
+
nirType?: 'simple' | 'complexe'
|
|
44
|
+
withoutFieldset?: boolean
|
|
43
45
|
}>(), {
|
|
44
46
|
modelValue: undefined,
|
|
45
|
-
label:
|
|
47
|
+
label: 'NirField',
|
|
46
48
|
numberLabel: 'Numéro de sécurité sociale',
|
|
47
49
|
keyLabel: 'Clé',
|
|
48
50
|
displayKey: true,
|
|
@@ -60,7 +62,7 @@
|
|
|
60
62
|
customRulesPrecedence: false,
|
|
61
63
|
showSuccessMessages: true,
|
|
62
64
|
width: '100%',
|
|
63
|
-
bgColor:
|
|
65
|
+
bgColor: 'white',
|
|
64
66
|
disabled: false,
|
|
65
67
|
density: 'default',
|
|
66
68
|
hideDetails: false,
|
|
@@ -74,6 +76,8 @@
|
|
|
74
76
|
persistentHint: false,
|
|
75
77
|
persistentPlaceholder: false,
|
|
76
78
|
disableErrorHandling: false,
|
|
79
|
+
nirType: 'simple',
|
|
80
|
+
withoutFieldset: false,
|
|
77
81
|
})
|
|
78
82
|
|
|
79
83
|
const emit = defineEmits(['update:modelValue'])
|
|
@@ -89,8 +93,8 @@
|
|
|
89
93
|
const numberField = ref<InstanceType<typeof SyTextField> | null>(null)
|
|
90
94
|
|
|
91
95
|
// Valeurs non masquées
|
|
92
|
-
const unmaskedNumberValue = computed(() => numberValue.value.replace(/\s/g, ''))
|
|
93
|
-
const unmaskedKeyValue = computed(() => keyValue.value.replace(/\s/g, ''))
|
|
96
|
+
const unmaskedNumberValue = computed(() => numberValue.value ? numberValue.value.replace(/\s/g, '') : '')
|
|
97
|
+
const unmaskedKeyValue = computed(() => keyValue.value ? keyValue.value.replace(/\s/g, '') : '')
|
|
94
98
|
|
|
95
99
|
// Masques
|
|
96
100
|
const numberMask = {
|
|
@@ -132,7 +136,7 @@
|
|
|
132
136
|
|
|
133
137
|
// Watch sur la valeur non masquée du numéro pour gérer le focus automatique
|
|
134
138
|
watch(unmaskedNumberValue, (newValue) => {
|
|
135
|
-
if (newValue.length === 13 && props.displayKey) {
|
|
139
|
+
if (newValue && newValue.length === 13 && props.displayKey) {
|
|
136
140
|
focusField(keyField)
|
|
137
141
|
}
|
|
138
142
|
})
|
|
@@ -146,7 +150,11 @@
|
|
|
146
150
|
// Watch pour détecter la suppression des chiffres de la clé
|
|
147
151
|
watch(keyValue, (newValue, oldValue) => {
|
|
148
152
|
// Si l'ancienne valeur avait des chiffres et la nouvelle est vide ou ne contient que des espaces
|
|
149
|
-
if (oldValue.trim() && !newValue.trim()) {
|
|
153
|
+
if (oldValue && newValue !== null && oldValue.trim() && !newValue.trim()) {
|
|
154
|
+
focusField(numberField)
|
|
155
|
+
}
|
|
156
|
+
else if (oldValue && newValue === null) {
|
|
157
|
+
// Cas où newValue est null (effacement avec clearable)
|
|
150
158
|
focusField(numberField)
|
|
151
159
|
}
|
|
152
160
|
})
|
|
@@ -196,7 +204,7 @@
|
|
|
196
204
|
if (value.length < 13) {
|
|
197
205
|
return 'Le numéro de sécurité sociale est invalide.'
|
|
198
206
|
}
|
|
199
|
-
const result = checkNIR(value)
|
|
207
|
+
const result = checkNIR(value, props.nirType)
|
|
200
208
|
return result === true ? true : 'Le numéro de sécurité sociale est invalide.'
|
|
201
209
|
},
|
|
202
210
|
message: 'Le numéro de sécurité sociale est invalide.',
|
|
@@ -247,8 +255,8 @@
|
|
|
247
255
|
type: 'custom',
|
|
248
256
|
options: {
|
|
249
257
|
validate: validateKey,
|
|
250
|
-
message: '
|
|
251
|
-
successMessage:
|
|
258
|
+
message: 'Le numéro de sécurité sociale est invalide.',
|
|
259
|
+
successMessage: 'Le numéro de sécurité sociale est valide.',
|
|
252
260
|
fieldIdentifier: props.keyLabel,
|
|
253
261
|
},
|
|
254
262
|
})
|
|
@@ -296,8 +304,29 @@
|
|
|
296
304
|
emit('update:modelValue', `${number}${key}`)
|
|
297
305
|
}
|
|
298
306
|
|
|
307
|
+
// État pour suivre si une validation est en cours
|
|
308
|
+
const isValidating = ref(false)
|
|
309
|
+
const shouldValidateOnBlur = ref(false)
|
|
310
|
+
|
|
311
|
+
// Fonction utilitaire pour créer une fonction debounced
|
|
312
|
+
const createDebouncedFunction = <T extends (...args: unknown[]) => void>(fn: T, delay: number) => {
|
|
313
|
+
let timeout: number | undefined
|
|
314
|
+
return (...args: Parameters<T>) => {
|
|
315
|
+
window.clearTimeout(timeout)
|
|
316
|
+
timeout = window.setTimeout(() => fn(...args), delay)
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
299
320
|
// Validation des champs
|
|
300
321
|
const validateFields = async (onBlur = false) => {
|
|
322
|
+
// Éviter les validations redondantes
|
|
323
|
+
if (isValidating.value) {
|
|
324
|
+
shouldValidateOnBlur.value = shouldValidateOnBlur.value || onBlur
|
|
325
|
+
return true
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
isValidating.value = true
|
|
329
|
+
|
|
301
330
|
// Valider le numéro
|
|
302
331
|
const numberResult = numberValidation.validateField(
|
|
303
332
|
unmaskedNumberValue.value,
|
|
@@ -318,7 +347,7 @@
|
|
|
318
347
|
}
|
|
319
348
|
|
|
320
349
|
// Si on est en mode blur et qu'il y a des erreurs, focus sur le premier champ en erreur
|
|
321
|
-
if (onBlur) {
|
|
350
|
+
if (onBlur || shouldValidateOnBlur.value) {
|
|
322
351
|
await nextTick()
|
|
323
352
|
if (numberResult.hasError) {
|
|
324
353
|
numberField.value?.$el.querySelector('input')?.focus()
|
|
@@ -326,8 +355,10 @@
|
|
|
326
355
|
else if (keyResult.hasError) {
|
|
327
356
|
keyField.value?.$el.querySelector('input')?.focus()
|
|
328
357
|
}
|
|
358
|
+
shouldValidateOnBlur.value = false
|
|
329
359
|
}
|
|
330
360
|
|
|
361
|
+
isValidating.value = false
|
|
331
362
|
return !numberResult.hasError && !keyResult.hasError
|
|
332
363
|
}
|
|
333
364
|
|
|
@@ -343,6 +374,32 @@
|
|
|
343
374
|
const hasKeyWarning = computed(() => !hasKeyErrors.value && keyValidation.hasWarning.value)
|
|
344
375
|
const hasKeySuccess = computed(() => !hasKeyErrors.value && !hasKeyWarning.value && keyValidation.hasSuccess.value)
|
|
345
376
|
|
|
377
|
+
// Propriétés calculées pour les attributs ARIA et les états d'erreur
|
|
378
|
+
const hasFieldErrors = computed(() => hasNumberErrors.value || hasKeyErrors.value)
|
|
379
|
+
const ariaRequired = computed(() => props.required ? 'true' : undefined)
|
|
380
|
+
const ariaInvalidNumber = computed(() => hasFieldErrors.value ? 'true' : undefined)
|
|
381
|
+
const ariaInvalidKey = computed(() => hasKeyErrors.value ? 'true' : undefined)
|
|
382
|
+
|
|
383
|
+
// Propriétés calculées pour les messages
|
|
384
|
+
const numberMessages = computed(() => {
|
|
385
|
+
if (hasNumberErrors.value) {
|
|
386
|
+
return numberValidation.errors.value
|
|
387
|
+
}
|
|
388
|
+
else if (hasNumberWarning.value) {
|
|
389
|
+
return numberValidation.warnings.value
|
|
390
|
+
}
|
|
391
|
+
else if (hasNumberSuccess.value && props.showSuccessMessages) {
|
|
392
|
+
return numberValidation.successes.value
|
|
393
|
+
}
|
|
394
|
+
return []
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
// Messages d'erreur combinés pour le champ numéro
|
|
398
|
+
const combinedErrorMessages = computed(() => [
|
|
399
|
+
...numberValidation.errors.value,
|
|
400
|
+
...keyValidation.errors.value,
|
|
401
|
+
])
|
|
402
|
+
|
|
346
403
|
const numberLabelWithAsterisk = computed(() => {
|
|
347
404
|
return props.required && props.displayAsterisk ? `${props.numberLabel} *` : props.numberLabel
|
|
348
405
|
})
|
|
@@ -351,14 +408,21 @@
|
|
|
351
408
|
return props.required && props.displayAsterisk ? `${props.keyLabel} *` : props.keyLabel
|
|
352
409
|
})
|
|
353
410
|
|
|
411
|
+
// Utilisation de debounce pour limiter les validations pendant la saisie
|
|
412
|
+
const debouncedValidate = createDebouncedFunction(() => {
|
|
413
|
+
validateFields(false)
|
|
414
|
+
}, 300) // 300ms de délai
|
|
415
|
+
|
|
354
416
|
const handleNumberInput = () => {
|
|
355
417
|
emitValue()
|
|
356
|
-
|
|
418
|
+
// Utiliser la validation debounced pour la saisie
|
|
419
|
+
debouncedValidate()
|
|
357
420
|
}
|
|
358
421
|
|
|
359
422
|
const handleKeyInput = () => {
|
|
360
423
|
emitValue()
|
|
361
|
-
|
|
424
|
+
// Utiliser la validation debounced pour la saisie
|
|
425
|
+
debouncedValidate()
|
|
362
426
|
|
|
363
427
|
// Si on supprime le contenu de la clé, on revient au champ NIR
|
|
364
428
|
if (unmaskedKeyValue.value.length === 0) {
|
|
@@ -394,7 +458,100 @@
|
|
|
394
458
|
</script>
|
|
395
459
|
|
|
396
460
|
<template>
|
|
461
|
+
<fieldset
|
|
462
|
+
v-if="displayKey && !withoutFieldset"
|
|
463
|
+
class="nir-field nir-field--fieldset"
|
|
464
|
+
>
|
|
465
|
+
<legend v-if="label">
|
|
466
|
+
{{ label }}
|
|
467
|
+
</legend>
|
|
468
|
+
<div class="number-field-container">
|
|
469
|
+
<SyTextField
|
|
470
|
+
ref="numberField"
|
|
471
|
+
v-model="numberValue"
|
|
472
|
+
v-maska="numberMask"
|
|
473
|
+
:label="numberLabelWithAsterisk"
|
|
474
|
+
:variant-style="outlined ? 'outlined' : 'underlined'"
|
|
475
|
+
:prepend-icon="nirTooltip && nirTooltipPosition === 'prepend' ? 'info' : undefined"
|
|
476
|
+
:append-icon="nirTooltip && nirTooltipPosition === 'append' ? 'info' : undefined"
|
|
477
|
+
:prepend-tooltip="nirTooltip && nirTooltipPosition === 'prepend' ? nirTooltip : undefined"
|
|
478
|
+
:append-tooltip="nirTooltip && nirTooltipPosition === 'append' ? nirTooltip : undefined"
|
|
479
|
+
:max-errors="2"
|
|
480
|
+
:error-messages="[...new Set([...numberValidation.errors.value, ...keyValidation.errors.value])]"
|
|
481
|
+
:warning-messages="numberValidation.warnings.value"
|
|
482
|
+
:success-messages="numberValidation.successes.value"
|
|
483
|
+
:show-success-messages="showSuccessMessages"
|
|
484
|
+
:has-warning="hasNumberWarning"
|
|
485
|
+
:has-success="hasNumberSuccess"
|
|
486
|
+
:error="hasNumberErrors || hasKeyErrors"
|
|
487
|
+
:messages="hasNumberErrors || hasKeyErrors ? numberValidation.errors.value ?? keyValidation.errors.value : (hasNumberWarning ? numberValidation.warnings.value : (hasNumberSuccess && props.showSuccessMessages ? numberValidation.successes.value : []))"
|
|
488
|
+
:has-error="hasNumberErrors || hasKeyErrors"
|
|
489
|
+
:required="required"
|
|
490
|
+
:aria-required="ariaRequired"
|
|
491
|
+
:aria-invalid="ariaInvalidNumber"
|
|
492
|
+
:disabled="disabled"
|
|
493
|
+
:bg-color="bgColor"
|
|
494
|
+
:density="props.density"
|
|
495
|
+
:hide-details="props.hideDetails"
|
|
496
|
+
:hide-spin-buttons="props.hideSpinButtons"
|
|
497
|
+
:placeholder="props.placeholder"
|
|
498
|
+
:readonly="props.readonly"
|
|
499
|
+
:variant="props.variant"
|
|
500
|
+
:clearable="props.clearable"
|
|
501
|
+
:counter="props.counter"
|
|
502
|
+
:persistent-hint="props.persistentHint"
|
|
503
|
+
:persistent-placeholder="props.persistentPlaceholder"
|
|
504
|
+
:hint="props.hint || locales.numberHint"
|
|
505
|
+
class="number-field"
|
|
506
|
+
:display-asterisk="false"
|
|
507
|
+
@input="handleNumberInput"
|
|
508
|
+
@blur="handleNumberBlur"
|
|
509
|
+
/>
|
|
510
|
+
</div>
|
|
511
|
+
<div
|
|
512
|
+
v-if="displayKey"
|
|
513
|
+
class="key-field-container"
|
|
514
|
+
>
|
|
515
|
+
<SyTextField
|
|
516
|
+
ref="keyField"
|
|
517
|
+
v-model="keyValue"
|
|
518
|
+
v-maska="keyMask"
|
|
519
|
+
:label="keyLabelWithAsterisk"
|
|
520
|
+
:variant-style="outlined ? 'outlined' : 'underlined'"
|
|
521
|
+
:prepend-icon="keyTooltip && keyTooltipPosition === 'prepend' ? 'info' : undefined"
|
|
522
|
+
:append-icon="keyTooltip && keyTooltipPosition === 'append' ? 'info' : undefined"
|
|
523
|
+
:prepend-tooltip="keyTooltip && keyTooltipPosition === 'prepend' ? keyTooltip : undefined"
|
|
524
|
+
:append-tooltip="keyTooltip && keyTooltipPosition === 'append' ? keyTooltip : undefined"
|
|
525
|
+
:error-messages="keyValidation.errors.value.length > 0 ? [''] : []"
|
|
526
|
+
:warning-messages="keyValidation.warnings.value"
|
|
527
|
+
:show-success-messages="false"
|
|
528
|
+
:has-warning="hasKeyWarning"
|
|
529
|
+
:has-success="hasKeySuccess"
|
|
530
|
+
:hint="props.hint || locales.keyHint"
|
|
531
|
+
:has-error="hasKeyErrors"
|
|
532
|
+
:disabled="disabled"
|
|
533
|
+
:bg-color="bgColor"
|
|
534
|
+
:density="props.density"
|
|
535
|
+
:hide-details="props.hideDetails"
|
|
536
|
+
:hide-spin-buttons="props.hideSpinButtons"
|
|
537
|
+
:placeholder="props.placeholder"
|
|
538
|
+
:readonly="props.readonly"
|
|
539
|
+
:variant="props.variant"
|
|
540
|
+
:clearable="props.clearable"
|
|
541
|
+
:counter="props.counter"
|
|
542
|
+
:persistent-hint="props.persistentHint"
|
|
543
|
+
:persistent-placeholder="props.persistentPlaceholder"
|
|
544
|
+
:aria-required="ariaRequired"
|
|
545
|
+
:aria-invalid="ariaInvalidKey"
|
|
546
|
+
class="key-field"
|
|
547
|
+
:display-asterisk="false"
|
|
548
|
+
@input="handleKeyInput"
|
|
549
|
+
@blur="handleKeyBlur"
|
|
550
|
+
/>
|
|
551
|
+
</div>
|
|
552
|
+
</fieldset>
|
|
397
553
|
<div
|
|
554
|
+
v-else
|
|
398
555
|
class="nir-field"
|
|
399
556
|
>
|
|
400
557
|
<div class="number-field-container">
|
|
@@ -409,16 +566,18 @@
|
|
|
409
566
|
:prepend-tooltip="nirTooltip && nirTooltipPosition === 'prepend' ? nirTooltip : undefined"
|
|
410
567
|
:append-tooltip="nirTooltip && nirTooltipPosition === 'append' ? nirTooltip : undefined"
|
|
411
568
|
:max-errors="2"
|
|
412
|
-
:error-messages="
|
|
569
|
+
:error-messages="combinedErrorMessages"
|
|
413
570
|
:warning-messages="numberValidation.warnings.value"
|
|
414
571
|
:success-messages="numberValidation.successes.value"
|
|
415
572
|
:show-success-messages="showSuccessMessages"
|
|
416
573
|
:has-warning="hasNumberWarning"
|
|
417
574
|
:has-success="hasNumberSuccess"
|
|
418
|
-
:error="hasNumberErrors"
|
|
419
|
-
:messages="
|
|
420
|
-
:has-error="hasNumberErrors"
|
|
575
|
+
:error="hasNumberErrors || hasKeyErrors"
|
|
576
|
+
:messages="numberMessages"
|
|
577
|
+
:has-error="hasNumberErrors || hasKeyErrors"
|
|
421
578
|
:required="required"
|
|
579
|
+
:aria-required="ariaRequired"
|
|
580
|
+
:aria-invalid="ariaInvalidNumber"
|
|
422
581
|
:disabled="disabled"
|
|
423
582
|
:bg-color="bgColor"
|
|
424
583
|
:density="props.density"
|
|
@@ -454,12 +613,10 @@
|
|
|
454
613
|
:append-tooltip="keyTooltip && keyTooltipPosition === 'append' ? keyTooltip : undefined"
|
|
455
614
|
:error-messages="keyValidation.errors.value.length > 0 ? [''] : []"
|
|
456
615
|
:warning-messages="keyValidation.warnings.value"
|
|
457
|
-
:success-messages="
|
|
458
|
-
:show-success-messages="showSuccessMessages"
|
|
616
|
+
:show-success-messages="false"
|
|
459
617
|
:has-warning="hasKeyWarning"
|
|
460
618
|
:has-success="hasKeySuccess"
|
|
461
619
|
:hint="props.hint || locales.keyHint"
|
|
462
|
-
:messages="hasKeyErrors ? keyValidation.errors.value : (hasKeyWarning ? keyValidation.warnings.value : (hasKeySuccess && props.showSuccessMessages ? keyValidation.successes.value : []))"
|
|
463
620
|
:has-error="hasKeyErrors"
|
|
464
621
|
:disabled="disabled"
|
|
465
622
|
:bg-color="bgColor"
|
|
@@ -473,6 +630,8 @@
|
|
|
473
630
|
:counter="props.counter"
|
|
474
631
|
:persistent-hint="props.persistentHint"
|
|
475
632
|
:persistent-placeholder="props.persistentPlaceholder"
|
|
633
|
+
:aria-required="ariaRequired"
|
|
634
|
+
:aria-invalid="ariaInvalidKey"
|
|
476
635
|
class="key-field"
|
|
477
636
|
:display-asterisk="false"
|
|
478
637
|
@input="handleKeyInput"
|
|
@@ -486,18 +645,46 @@
|
|
|
486
645
|
.nir-field {
|
|
487
646
|
display: flex;
|
|
488
647
|
gap: 16px;
|
|
489
|
-
width: calc(v-bind('props.width') - 16px);
|
|
648
|
+
width: calc(v-bind('props.width || "100%"') - 16px);
|
|
649
|
+
align-items: flex-start;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.nir-field--fieldset {
|
|
653
|
+
width: calc(v-bind('props.width || "100%"') + 5px);
|
|
654
|
+
border: 1px solid #b9b9b9;
|
|
655
|
+
border-radius: 4px;
|
|
656
|
+
padding: 25px;
|
|
657
|
+
margin: 0;
|
|
658
|
+
display: flex;
|
|
659
|
+
gap: 16px;
|
|
490
660
|
align-items: flex-start;
|
|
661
|
+
box-sizing: border-box;
|
|
491
662
|
}
|
|
492
663
|
|
|
493
|
-
.
|
|
664
|
+
.nir-field--fieldset legend {
|
|
665
|
+
padding: 0 8px;
|
|
666
|
+
font-weight: 500;
|
|
667
|
+
color: #666;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/* Styles pour le mode standard (div) */
|
|
671
|
+
.nir-field:not(.nir-field--fieldset) .number-field-container {
|
|
494
672
|
flex: 0 0 80%;
|
|
495
673
|
}
|
|
496
674
|
|
|
497
|
-
.key-field-container {
|
|
675
|
+
.nir-field:not(.nir-field--fieldset) .key-field-container {
|
|
498
676
|
flex: 0 0 20%;
|
|
499
677
|
}
|
|
500
678
|
|
|
679
|
+
/* Styles pour le mode fieldset */
|
|
680
|
+
.nir-field--fieldset .number-field-container {
|
|
681
|
+
flex: v-bind('props.clearable ? "0 0 70%" : "0 0 78%"');
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.nir-field--fieldset .key-field-container {
|
|
685
|
+
flex: v-bind('props.clearable ? "0 0 29%" : "0 0 18%"');
|
|
686
|
+
}
|
|
687
|
+
|
|
501
688
|
.number-field,
|
|
502
689
|
.key-field {
|
|
503
690
|
width: 100%;
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
export const NUMBER_LENGTH = 13
|
|
2
2
|
export const KEY_LENGTH = 2
|
|
3
3
|
|
|
4
|
-
export function checkNIR(nir: string): boolean {
|
|
4
|
+
export function checkNIR(nir: string, nirType: string): boolean {
|
|
5
5
|
nir = nir.replace(/\s+/g, '').toUpperCase()
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const nirRegexComplex = new RegExp(
|
|
8
8
|
'^'
|
|
9
9
|
+ '(?<sexe>[1-4]|7|8)'
|
|
10
10
|
+ '(?<anneeNaissance>\\d{2})'
|
|
11
11
|
+ '(?<moisNaissance>0[1-9]|1[0-2]|2[0-9]|3[0-9]|4[0-2])'
|
|
12
|
-
+ '(?<departementNaissance>\\d{2}|2A|2B|96|97\\d|98\\d)'
|
|
12
|
+
+ '(?<departementNaissance>\\d{2}|2A|2B|96|97\\d|98\\d|99\\d)'
|
|
13
13
|
+ '(?<communeNaissance>\\d{3})'
|
|
14
14
|
+ '(?<rangInscription>\\d{3})'
|
|
15
15
|
+ '(?<cle>[0-9]{2})?'
|
|
16
16
|
+ '$',
|
|
17
17
|
'i',
|
|
18
18
|
)
|
|
19
|
+
|
|
20
|
+
const nirSimpleRegex = new RegExp(
|
|
21
|
+
'^'
|
|
22
|
+
+ '(?<sexe>[12])'
|
|
23
|
+
+ '(?<anneeNaissance>\\d{2})'
|
|
24
|
+
+ '(?<moisNaissance>0[1-9]|1[0-2]|[2-9][0-9])'
|
|
25
|
+
+ '(?<departementNaissance>\\d{2}|2A|2B)'
|
|
26
|
+
+ '(?<communeNaissance>\\d{3})'
|
|
27
|
+
+ '(?<rangInscription>\\d{3})'
|
|
28
|
+
+ '(?<cle>9[0-7]|[0-8]\\d)?'
|
|
29
|
+
+ '$',
|
|
30
|
+
'i',
|
|
31
|
+
)
|
|
32
|
+
const nirRegex = nirType === 'simple' ? nirSimpleRegex : nirRegexComplex
|
|
19
33
|
return nirRegex.test(nir)
|
|
20
34
|
}
|
|
21
35
|
|
|
@@ -56,7 +56,7 @@ describe('NirField.vue', () => {
|
|
|
56
56
|
await wrapper.find('.key-field input').setValue('1')
|
|
57
57
|
await wrapper.find('.key-field input').trigger('blur')
|
|
58
58
|
await wrapper.vm.$nextTick()
|
|
59
|
-
expect(wrapper.vm.keyValidation.errors.value[0]).toBe('
|
|
59
|
+
expect(wrapper.vm.keyValidation.errors.value[0]).toBe('Le numéro de sécurité sociale est invalide.')
|
|
60
60
|
})
|
|
61
61
|
|
|
62
62
|
it('validates the key field successfully', async () => {
|
|
@@ -64,7 +64,7 @@ describe('NirField.vue', () => {
|
|
|
64
64
|
await wrapper.find('.key-field input').setValue('91')
|
|
65
65
|
await wrapper.find('.key-field input').trigger('blur')
|
|
66
66
|
await wrapper.vm.$nextTick()
|
|
67
|
-
expect(wrapper.vm.keyValidation.successes.value).toContain('Le
|
|
67
|
+
expect(wrapper.vm.keyValidation.successes.value).toContain('Le numéro de sécurité sociale est valide.')
|
|
68
68
|
})
|
|
69
69
|
|
|
70
70
|
it('hides the key field when displayKey is false', async () => {
|
|
@@ -181,6 +181,14 @@ export const Legende: StoryObj = {
|
|
|
181
181
|
</v-btn>
|
|
182
182
|
Problèmes relevés par Tanaguru
|
|
183
183
|
</div>
|
|
184
|
+
</div>
|
|
185
|
+
<div class="mt-4">
|
|
186
|
+
<p>Rapport d’audit manuel : <a href="/audits/NotFoundPage.xlsx" style="color:#0C41BD;">Voir le
|
|
187
|
+
rapport</a></p>
|
|
188
|
+
<p style="color: grey; font-size: 14px">Correctifs associés (<a
|
|
189
|
+
href="https://github.com/assurance-maladie-digital/design-system-v3/issues/654" target="_blank"
|
|
190
|
+
style="color:#0C41BD;"
|
|
191
|
+
>issue #654</a>)</p>
|
|
184
192
|
</div>
|
|
185
193
|
</div>
|
|
186
194
|
`,
|
|
@@ -96,14 +96,14 @@ exports[`NotFoundPage > display the support ID if provided in the url 1`] = `
|
|
|
96
96
|
</span>
|
|
97
97
|
404
|
|
98
98
|
</div>
|
|
99
|
-
<
|
|
99
|
+
<h1 class="
|
|
100
100
|
font-weight-bold
|
|
101
101
|
mb-2
|
|
102
102
|
mb-4
|
|
103
103
|
text-h5
|
|
104
104
|
">
|
|
105
105
|
Page non trouvée
|
|
106
|
-
</
|
|
106
|
+
</h1>
|
|
107
107
|
<p>
|
|
108
108
|
Cette page n’existe pas ou a été déplacée.
|
|
109
109
|
</p>
|
|
@@ -124,7 +124,8 @@ exports[`NotFoundPage > display the support ID if provided in the url 1`] = `
|
|
|
124
124
|
v-col-sm-6
|
|
125
125
|
">
|
|
126
126
|
<img
|
|
127
|
-
alt="
|
|
127
|
+
alt=""
|
|
128
|
+
aria-hidden="true"
|
|
128
129
|
src="/src/components/NotFoundPage/assets/not-found.svg"
|
|
129
130
|
/>
|
|
130
131
|
</div>
|
|
@@ -233,14 +234,14 @@ exports[`NotFoundPage > renders correctly 1`] = `
|
|
|
233
234
|
</span>
|
|
234
235
|
404
|
|
235
236
|
</div>
|
|
236
|
-
<
|
|
237
|
+
<h1 class="
|
|
237
238
|
font-weight-bold
|
|
238
239
|
mb-2
|
|
239
240
|
mb-4
|
|
240
241
|
text-h5
|
|
241
242
|
">
|
|
242
243
|
Page non trouvée
|
|
243
|
-
</
|
|
244
|
+
</h1>
|
|
244
245
|
<p>
|
|
245
246
|
Cette page n’existe pas ou a été déplacée.
|
|
246
247
|
</p>
|
|
@@ -254,7 +255,8 @@ exports[`NotFoundPage > renders correctly 1`] = `
|
|
|
254
255
|
v-col-sm-6
|
|
255
256
|
">
|
|
256
257
|
<img
|
|
257
|
-
alt="
|
|
258
|
+
alt=""
|
|
259
|
+
aria-hidden="true"
|
|
258
260
|
src="/src/components/NotFoundPage/assets/not-found.svg"
|
|
259
261
|
/>
|
|
260
262
|
</div>
|
|
@@ -7,6 +7,8 @@ import * as PaginatedTableStories from "./PaginatedTable.stories.ts";
|
|
|
7
7
|
|
|
8
8
|
Le composant `PaginatedTable` est utilisé pour afficher une `VDataTable` de Vuetify avec une pagination persistante.
|
|
9
9
|
|
|
10
|
+
> **⚠️ Attention** : Ce composant est déprécié au profit des composants [SyTable](?path=/docs/composants-tableaux-sytable--docs) et [SyServerTable](?path=/docs/composants-tableaux-syservertable--docs).
|
|
11
|
+
|
|
10
12
|
<Canvas story={{height: '550px'}} of={PaginatedTableStories.Default}/>
|
|
11
13
|
|
|
12
14
|
# API
|