@cnamts/synapse 0.0.15-alpha → 0.0.16-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CookiesSelection/CookiesSelection.d.ts +26 -26
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +1391 -1
- package/dist/components/DatePicker/DatePicker.d.ts +2810 -16
- package/dist/components/DatePicker/DateTextInput.d.ts +1401 -4
- package/dist/components/LangBtn/LangBtn.d.ts +4 -4
- package/dist/components/NirField/NirField.d.ts +2794 -4
- package/dist/components/PeriodField/PeriodField.d.ts +5636 -48
- package/dist/components/SyAlert/SyAlert.d.ts +72 -1
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +26 -26
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/date/useDateFormat.d.ts +2 -2
- package/dist/composables/date/useDateFormatDayjs.d.ts +23 -0
- package/dist/composables/date/useDateInitializationDayjs.d.ts +18 -0
- package/dist/design-system-v3.js +3953 -3728
- package/dist/design-system-v3.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Customs/SyTextField/Accessibilite.stories.ts +7 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +13 -0
- package/src/components/Customs/SyTextField/SyTextField.vue +82 -17
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +795 -0
- package/src/components/DatePicker/DatePicker.stories.ts +432 -1
- package/src/components/DatePicker/DatePicker.vue +66 -24
- package/src/components/DatePicker/DatePickerValidation.stories.ts +9 -1
- package/src/components/DatePicker/DateTextInput.vue +85 -133
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +282 -0
- package/src/components/DatePicker/tests/DatePicker.spec.ts +33 -32
- package/src/components/DatePicker/tests/DateTextInput.spec.ts +81 -33
- package/src/components/SyAlert/Accessibilite.stories.ts +4 -0
- package/src/components/SyAlert/SyAlert.mdx +3 -7
- package/src/components/SyAlert/SyAlert.stories.ts +19 -12
- package/src/components/SyAlert/SyAlert.vue +88 -51
- package/src/components/SyAlert/tests/SyAlert.spec.ts +20 -2
- package/src/components/SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap +83 -75
- package/src/components/index.ts +1 -0
- package/src/composables/date/useDateFormat.ts +17 -1
- package/src/composables/date/useDateFormatDayjs.ts +84 -0
- package/src/composables/date/useDateInitializationDayjs.ts +133 -0
- package/src/stories/Accessibilite/Avancement/Avancement.mdx +12 -0
- package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +134 -0
- /package/src/components/DatePicker/{DatePickerValidationExamples.vue → docExamples/DatePickerValidationExamples.vue} +0 -0
package/package.json
CHANGED
|
@@ -217,6 +217,13 @@ export const Legende: StoryObj = {
|
|
|
217
217
|
</div>
|
|
218
218
|
</div>
|
|
219
219
|
</div>
|
|
220
|
+
<div class="mt-4">
|
|
221
|
+
<p>Rapport d’audit manuel : <a href="/audits/SyTextField.xlsx" style="color:#0C41BD;">Voir le
|
|
222
|
+
rapport</a></p>
|
|
223
|
+
<p style="color: grey; font-size: 14px">Correctifs associés (<a
|
|
224
|
+
href="https://github.com/assurance-maladie-digital/design-system/issues/4028" target="_blank"
|
|
225
|
+
style="color:#0C41BD;">issue #4028</a>)</p>
|
|
226
|
+
</div>
|
|
220
227
|
`,
|
|
221
228
|
}
|
|
222
229
|
},
|
|
@@ -28,6 +28,10 @@ const meta = {
|
|
|
28
28
|
description: 'Texte affiché comme label du champ',
|
|
29
29
|
control: 'text',
|
|
30
30
|
},
|
|
31
|
+
'autocomplete': {
|
|
32
|
+
description: 'Valeur de l\'attribut autocomplete',
|
|
33
|
+
control: 'text',
|
|
34
|
+
},
|
|
31
35
|
'prependIcon': {
|
|
32
36
|
control: 'select',
|
|
33
37
|
options: ['info', 'success', 'warning', 'error', 'close'],
|
|
@@ -118,6 +122,11 @@ const meta = {
|
|
|
118
122
|
control: 'boolean',
|
|
119
123
|
default: false,
|
|
120
124
|
},
|
|
125
|
+
'disableClickButton': {
|
|
126
|
+
description: 'Désactive le click sur les icônes append et prepend',
|
|
127
|
+
control: 'boolean',
|
|
128
|
+
default: true,
|
|
129
|
+
},
|
|
121
130
|
'readonly': {
|
|
122
131
|
description: 'Rend le champ en lecture seule',
|
|
123
132
|
control: 'boolean',
|
|
@@ -948,6 +957,7 @@ Cette story montre un cas d'usage courant : la validation d'une adresse email. L
|
|
|
948
957
|
name: 'Template',
|
|
949
958
|
code: `<SyTextField
|
|
950
959
|
v-model="value"
|
|
960
|
+
autocomplete="email"
|
|
951
961
|
label="Email"
|
|
952
962
|
required
|
|
953
963
|
:customRules="[
|
|
@@ -975,6 +985,7 @@ Cette story montre un cas d'usage courant : la validation d'une adresse email. L
|
|
|
975
985
|
v-model="value"
|
|
976
986
|
v-bind="args"
|
|
977
987
|
label="Email"
|
|
988
|
+
autocomplete="email"
|
|
978
989
|
required
|
|
979
990
|
:customRules="[
|
|
980
991
|
{
|
|
@@ -1011,6 +1022,7 @@ Cette story montre l'utilisation de la règle \`matchPattern\` pour valider un f
|
|
|
1011
1022
|
code: `<SyTextField
|
|
1012
1023
|
v-model="value"
|
|
1013
1024
|
label="Code postal"
|
|
1025
|
+
autocomplete="postal-code"
|
|
1014
1026
|
required
|
|
1015
1027
|
:customRules="[
|
|
1016
1028
|
{
|
|
@@ -1038,6 +1050,7 @@ Cette story montre l'utilisation de la règle \`matchPattern\` pour valider un f
|
|
|
1038
1050
|
v-model="value"
|
|
1039
1051
|
v-bind="args"
|
|
1040
1052
|
label="Code postal"
|
|
1053
|
+
autocomplete="postal-code"
|
|
1041
1054
|
required
|
|
1042
1055
|
:customRules="[
|
|
1043
1056
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref, watch } from 'vue'
|
|
2
|
+
import { computed, onMounted, ref, watch, nextTick, type ComponentPublicInstance } from 'vue'
|
|
3
3
|
import type { IconType, VariantStyle, ColorType } from './types'
|
|
4
4
|
import { useValidation, type ValidationRule } from '@/composables/validation/useValidation'
|
|
5
5
|
import {
|
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
showSuccessMessages?: boolean
|
|
79
79
|
isValidateOnBlur?: boolean
|
|
80
80
|
disableErrorHandling?: boolean
|
|
81
|
+
disableClickButton?: boolean
|
|
82
|
+
autocomplete?: string
|
|
81
83
|
}>(),
|
|
82
84
|
{
|
|
83
85
|
modelValue: undefined,
|
|
@@ -142,6 +144,8 @@
|
|
|
142
144
|
showSuccessMessages: true,
|
|
143
145
|
isValidateOnBlur: true,
|
|
144
146
|
disableErrorHandling: false,
|
|
147
|
+
disableClickButton: true,
|
|
148
|
+
autocomplete: 'off',
|
|
145
149
|
},
|
|
146
150
|
)
|
|
147
151
|
|
|
@@ -289,6 +293,52 @@
|
|
|
289
293
|
opacity: '1',
|
|
290
294
|
}
|
|
291
295
|
|
|
296
|
+
const syTextFieldRef = ref<ComponentPublicInstance | null>(null)
|
|
297
|
+
|
|
298
|
+
onMounted(() => {
|
|
299
|
+
nextTick(() => {
|
|
300
|
+
const removeSvgRole = () => {
|
|
301
|
+
const svgElements = syTextFieldRef.value?.$el?.querySelectorAll('svg[role="img"]')
|
|
302
|
+
if (svgElements) {
|
|
303
|
+
svgElements.forEach((svg) => {
|
|
304
|
+
svg.removeAttribute('role')
|
|
305
|
+
})
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const setAriaHidden = (selector: string) => {
|
|
310
|
+
const element = syTextFieldRef.value?.$el?.querySelector(`${selector} span`)
|
|
311
|
+
if (element) {
|
|
312
|
+
element.setAttribute('aria-hidden', 'true')
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const addSrOnlySpan = (selector: string) => {
|
|
317
|
+
const element = syTextFieldRef.value?.$el?.querySelector(selector)
|
|
318
|
+
if (element && element.textContent) {
|
|
319
|
+
const srSpan = document.createElement('span')
|
|
320
|
+
srSpan.className = 'd-sr-only'
|
|
321
|
+
srSpan.textContent = element.textContent
|
|
322
|
+
element.appendChild(srSpan)
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const removeInputSizeAttr = () => {
|
|
327
|
+
const inputElement = syTextFieldRef.value?.$el?.querySelector('input[size]')
|
|
328
|
+
if (inputElement) {
|
|
329
|
+
inputElement.removeAttribute('size')
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
removeSvgRole()
|
|
334
|
+
removeInputSizeAttr()
|
|
335
|
+
setAriaHidden('.v-text-field__prefix')
|
|
336
|
+
setAriaHidden('.v-text-field__suffix')
|
|
337
|
+
addSrOnlySpan('.v-text-field__prefix')
|
|
338
|
+
addSrOnlySpan('.v-text-field__suffix')
|
|
339
|
+
})
|
|
340
|
+
})
|
|
341
|
+
|
|
292
342
|
defineExpose({
|
|
293
343
|
validation,
|
|
294
344
|
validateOnSubmit,
|
|
@@ -299,7 +349,9 @@
|
|
|
299
349
|
<template>
|
|
300
350
|
<VTextField
|
|
301
351
|
:id="props.id"
|
|
352
|
+
ref="syTextFieldRef"
|
|
302
353
|
v-model="model"
|
|
354
|
+
:autocomplete="props.autocomplete"
|
|
303
355
|
:active="props.isActive"
|
|
304
356
|
:title="props.label"
|
|
305
357
|
:aria-label="props.label"
|
|
@@ -314,7 +366,6 @@
|
|
|
314
366
|
:direction="props.direction"
|
|
315
367
|
:dirty="props.isDirty"
|
|
316
368
|
:disabled="props.disabled"
|
|
317
|
-
:display-asterisk="isShouldDisplayAsterisk"
|
|
318
369
|
:error="hasError"
|
|
319
370
|
:error-messages="errors"
|
|
320
371
|
:flat="props.isFlat"
|
|
@@ -329,11 +380,10 @@
|
|
|
329
380
|
:messages="hasError ? errors : (hasWarning ? warnings : (hasSuccess && props.showSuccessMessages ? successes : []))"
|
|
330
381
|
:min-width="props.minWidth"
|
|
331
382
|
:name="props.name"
|
|
332
|
-
:no-icon="props.noIcon"
|
|
333
383
|
:persistent-clear="props.displayPersistentClear"
|
|
334
384
|
:persistent-counter="props.displayPersistentCounter"
|
|
335
385
|
:persistent-hint="props.displayPersistentHint"
|
|
336
|
-
:persistent-placeholder="displayPersistentPlaceholder"
|
|
386
|
+
:persistent-placeholder="props.displayPersistentPlaceholder"
|
|
337
387
|
:placeholder="props.placeholder"
|
|
338
388
|
:prefix="props.prefix"
|
|
339
389
|
:readonly="props.readonly"
|
|
@@ -355,6 +405,7 @@
|
|
|
355
405
|
}"
|
|
356
406
|
@blur="checkErrorOnBlur"
|
|
357
407
|
>
|
|
408
|
+
<!-- Prepend -->
|
|
358
409
|
<template
|
|
359
410
|
v-if="props.prependIcon || props.prependTooltip"
|
|
360
411
|
#prepend
|
|
@@ -377,15 +428,18 @@
|
|
|
377
428
|
</VTooltip>
|
|
378
429
|
</template>
|
|
379
430
|
<VIcon
|
|
380
|
-
v-else-if="props.prependIcon"
|
|
381
|
-
:aria-label="props.label ? `${props.label} - bouton ${props.prependIcon}` : `Bouton ${props.prependIcon}`"
|
|
431
|
+
v-else-if="props.prependIcon && !props.noIcon"
|
|
432
|
+
:aria-label="disableClickButton ? (props.label ? props.label : props.prependIcon) : (props.label ? `${props.label} - bouton ${props.prependIcon}` : `Bouton ${props.prependIcon}`)"
|
|
382
433
|
:color="appendInnerIconColor"
|
|
383
434
|
:icon="ICONS[props.prependIcon]"
|
|
384
|
-
role="button"
|
|
435
|
+
:role="disableClickButton ? 'presentation' : 'button'"
|
|
436
|
+
:class="disableClickButton ? 'cursor-default' : 'cursor-pointer'"
|
|
385
437
|
@click="handlePrependIconClick"
|
|
386
438
|
/>
|
|
387
439
|
</slot>
|
|
388
440
|
</template>
|
|
441
|
+
|
|
442
|
+
<!-- Append -->
|
|
389
443
|
<template
|
|
390
444
|
v-if="props.appendIcon || props.appendTooltip"
|
|
391
445
|
#append
|
|
@@ -408,44 +462,52 @@
|
|
|
408
462
|
</VTooltip>
|
|
409
463
|
</template>
|
|
410
464
|
<VIcon
|
|
411
|
-
v-else-if="props.appendIcon"
|
|
412
|
-
:aria-label="props.label ? `${props.label} - bouton ${props.appendIcon}` : `Bouton ${props.appendIcon}`"
|
|
465
|
+
v-else-if="props.appendIcon && !props.noIcon"
|
|
466
|
+
:aria-label="disableClickButton ? (props.label ? props.label : props.appendIcon) : (props.label ? `${props.label} - bouton ${props.appendIcon}` : `Bouton ${props.appendIcon}`)"
|
|
413
467
|
:color="appendInnerIconColor"
|
|
414
468
|
:icon="ICONS[props.appendIcon]"
|
|
415
|
-
role="button"
|
|
469
|
+
:role="disableClickButton ? 'presentation' : 'button'"
|
|
470
|
+
:class="disableClickButton ? 'cursor-default' : 'cursor-pointer'"
|
|
416
471
|
@click="handleAppendIconClick"
|
|
417
472
|
/>
|
|
418
473
|
</slot>
|
|
419
474
|
</template>
|
|
475
|
+
|
|
476
|
+
<!-- Prepend inner -->
|
|
420
477
|
<template #prepend-inner>
|
|
421
478
|
<slot name="prepend-inner">
|
|
422
479
|
<VIcon
|
|
423
480
|
v-if="props.prependInnerIcon && !props.noIcon"
|
|
424
|
-
:aria-label="props.label ? `${props.label} - bouton ${props.prependInnerIcon}` : `Bouton ${props.prependInnerIcon}`"
|
|
425
481
|
:icon="ICONS[props.prependInnerIcon]"
|
|
482
|
+
role="presentation"
|
|
483
|
+
/>
|
|
484
|
+
<VDivider
|
|
485
|
+
v-if="props.showDivider"
|
|
486
|
+
class="mt-4 pa-1"
|
|
487
|
+
v-bind="dividerProps"
|
|
488
|
+
vertical
|
|
426
489
|
/>
|
|
427
490
|
</slot>
|
|
428
|
-
<VDivider
|
|
429
|
-
v-if="props.showDivider"
|
|
430
|
-
class="mt-4 pa-1"
|
|
431
|
-
v-bind="dividerProps"
|
|
432
|
-
vertical
|
|
433
|
-
/>
|
|
434
491
|
</template>
|
|
492
|
+
|
|
493
|
+
<!-- Append inner -->
|
|
435
494
|
<template #append-inner>
|
|
436
495
|
<slot name="append-inner">
|
|
437
496
|
<VIcon
|
|
438
497
|
v-if="validationIcon && !props.appendInnerIcon"
|
|
439
498
|
:icon="validationIcon"
|
|
499
|
+
role="presentation"
|
|
440
500
|
/>
|
|
441
501
|
<VIcon
|
|
442
502
|
v-if="props.appendInnerIcon && !props.noIcon"
|
|
443
503
|
:color="appendInnerIconColor"
|
|
504
|
+
role="presentation"
|
|
444
505
|
>
|
|
445
506
|
{{ ICONS[props.appendInnerIcon] }}
|
|
446
507
|
</VIcon>
|
|
447
508
|
</slot>
|
|
448
509
|
</template>
|
|
510
|
+
|
|
449
511
|
<template #details>
|
|
450
512
|
<slot name="details" />
|
|
451
513
|
</template>
|
|
@@ -506,6 +568,8 @@
|
|
|
506
568
|
:deep(.v-field) {
|
|
507
569
|
color: tokens.$colors-border-success !important;
|
|
508
570
|
|
|
571
|
+
--v-medium-emphasis-opacity: 1;
|
|
572
|
+
|
|
509
573
|
.v-field__outline {
|
|
510
574
|
color: tokens.$colors-border-success !important;
|
|
511
575
|
}
|
|
@@ -525,4 +589,5 @@
|
|
|
525
589
|
fill: rgb(0 0 0 / 100%);
|
|
526
590
|
}
|
|
527
591
|
}
|
|
592
|
+
|
|
528
593
|
</style>
|