Skip to content

Commit 080525f

Browse files
committed
fix: 🐛 rĂ©duit les mismatch, notamment des id
- corrige le mismatch de DsfrSearchBar du DsfrHeader - utilise [useId() de vue 3.5](https://vuejs.org/api/composition-api-helpers.html#useid) dans getRandomId()
1 parent 67c0b28 commit 080525f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+87
-80
lines changed

‎src/components/DsfrAccordion/DsfrAccordion.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Autres props :
2626

2727
| Nom | Type | Défaut | Obligatoire |
2828
| ----------------------- | ----------------------------------------- | ---------------- | -------------|
29-
| `title` | *`string`* | `getRandomId('accordion')` | ✅ |
29+
| `title` | *`string`* | `useRandomId('accordion')` | ✅ |
3030
| `titleTag` | [*`TitleTag`*](/docs/types.md#title-tag) | `'h3'` | |
3131
| `id` | *`string`* | *random string* | |
3232

‎src/components/DsfrAccordion/DsfrAccordion.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { inject, onMounted, ref, toRef, watch } from 'vue'
33
44
import { useCollapsable } from '../../composables'
5-
import { getRandomId } from '../../utils/random-utils'
5+
import { useRandomId } from '../../utils/random-utils'
66
77
import { registerAccordionKey } from './injection-key'
88
import type { DsfrAccordionProps } from './DsfrAccordion.types'
@@ -12,7 +12,7 @@ export type { DsfrAccordionProps }
1212
const props = withDefaults(
1313
defineProps<DsfrAccordionProps>(),
1414
{
15-
id: () => getRandomId('accordion'),
15+
id: () => useRandomId('accordion'),
1616
title: 'Sans intitulé',
1717
titleTag: 'h3',
1818
},

‎src/components/DsfrAlert/DsfrAlert.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { computed } from 'vue'
33
44
import type { DsfrAlertProps } from './DsfrAlert.types.js'
55
6-
import { getRandomId } from '@/utils/random-utils'
6+
import { useRandomId } from '@/utils/random-utils'
77
88
export type { DsfrAlertProps, DsfrAlertType } from './DsfrAlert.types.js'
99
1010
const props = withDefaults(defineProps<DsfrAlertProps>(), {
11-
id: () => getRandomId('basic', 'alert'),
11+
id: () => useRandomId('basic', 'alert'),
1212
title: '',
1313
titleTag: 'h3',
1414
type: 'info',

‎src/components/DsfrBreadcrumb/DsfrBreadcrumb.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Dans l’ordre, il se compose des Ă©lĂ©ments suivants :
2222

2323
| Nom | Type | Défaut | Description |
2424
|---------------------|--------|---------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
25-
| breadcrumbId | String | () => getRandomId('breadcrumb') | Identifiant unique pour le composant breadcrumb, généré automatiquement pour assurer l'accessibilité. |
25+
| breadcrumbId | String | () => useRandomId('breadcrumb') | Identifiant unique pour le composant breadcrumb, généré automatiquement pour assurer l'accessibilité. |
2626
| links | Array | () => [{ text: '' }] | Un tableau d'objets représentant les liens dans le fil d'Ariane. Chaque objet peut avoir une propriété 'text' et, optionnellement, 'to' pour les routes. |
2727
| navigationLabel | String | `'vous ĂȘtes ici :'` | Label affichĂ© sur la balise `nav` du fil d’Ariane. |
2828
| showBreadcrumbLabel | String | `'Voir le fil d’Ariane'` | Label du bouton d'affichage du fil d’Ariane. |

‎src/components/DsfrBreadcrumb/DsfrBreadcrumb.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import { ref, watch } from 'vue'
33
44
import { useCollapsable } from '../../composables'
5-
import { getRandomId } from '../../utils/random-utils'
5+
import { useRandomId } from '../../utils/random-utils'
66
77
import type { DsfrBreadcrumbProps } from './DsfrBreadcrumb.types'
88
99
export type { DsfrBreadcrumbProps }
1010
1111
withDefaults(defineProps<DsfrBreadcrumbProps>(), {
12-
breadcrumbId: () => getRandomId('breadcrumb'),
12+
breadcrumbId: () => useRandomId('breadcrumb'),
1313
links: () => [{ text: '' }],
1414
navigationLabel: 'vous ĂȘtes ici :',
1515
showBreadcrumbLabel: 'Voir le fil d’Ariane',

‎src/components/DsfrCheckbox/DsfrCheckbox.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import { computed } from 'vue'
33
4-
import { getRandomId } from '../../utils/random-utils'
4+
import { useRandomId } from '../../utils/random-utils'
55
66
import type { DsfrCheckboxProps } from './DsfrCheckbox.types'
77
@@ -12,7 +12,7 @@ defineOptions({
1212
})
1313
1414
const props = withDefaults(defineProps<DsfrCheckboxProps>(), {
15-
id: () => getRandomId('basic', 'checkbox'),
15+
id: () => useRandomId('basic', 'checkbox'),
1616
hint: '',
1717
errorMessage: '',
1818
validMessage: '',

‎src/components/DsfrCheckbox/DsfrCheckboxSet.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { computed } from 'vue'
33
4-
import { getRandomId } from '../../utils/random-utils'
4+
import { useRandomId } from '../../utils/random-utils'
55
66
import DsfrCheckbox from './DsfrCheckbox.vue'
77
import type { DsfrCheckboxSetProps } from './DsfrCheckbox.types'
@@ -11,7 +11,7 @@ export type { DsfrCheckboxSetProps }
1111

1212
<script lang="ts" setup>
1313
const props = withDefaults(defineProps<DsfrCheckboxSetProps>(), {
14-
titleId: () => getRandomId('checkbox', 'set'),
14+
titleId: () => useRandomId('checkbox', 'set'),
1515
errorMessage: '',
1616
validMessage: '',
1717
legend: '',

‎src/components/DsfrDataTable/DsfrDataTable.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { computed } from 'vue'
44
import DsfrPagination from '../DsfrPagination/DsfrPagination.vue'
55
import VIcon from '../VIcon/VIcon.vue'
66
7-
import { getRandomId } from '@/utils/random-utils'
7+
import { useRandomId } from '@/utils/random-utils'
88
99
export type Page = { href?: string, label: string, title: string }
1010
@@ -39,7 +39,7 @@ export type DsfrDataTableProps = {
3939
}
4040
4141
const props = withDefaults(defineProps<DsfrDataTableProps>(), {
42-
id: () => getRandomId('table'),
42+
id: () => useRandomId('table'),
4343
topActionsRow: () => [],
4444
bottomActionsRow: () => [],
4545
currentPage: 0,

‎src/components/DsfrFileUpload/DsfrFileUpload.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Bienvenue dans la documentation du composant `DsfrFileUpload`. Ce composant est
1212

1313
| Nom | Type | Défaut | Obligatoire | Description |
1414
|----------------|-------------|-------------------------|---------------|----------------------------------------------------------------|
15-
| `id` | `Function` | `() => getRandomId(...)`| | Identifiant unique pour le composant de téléchargement de fichier. Si non spécifié, un ID aléatoire est généré. |
15+
| `id` | `Function` | `() => useRandomId(...)`| | Identifiant unique pour le composant de téléchargement de fichier. Si non spécifié, un ID aléatoire est généré. |
1616
| `label` | `string` | `'Ajouter un fichier'` | | Libellé pour le bouton de téléchargement de fichier. |
1717
| `accept` | `string \| string[]` | `undefined` | | Types de fichiers acceptĂ©s, spĂ©cifiĂ©s sous forme de chaĂźne de caractĂšres (comme l’attribut `accept` de HTML) ou d'un tableau de chaĂźnes de caractĂšres (qui sera transformĂ© en chaĂźne). |
1818
| `hint` | `string` | `''` | | Texte d'indice pour guider l'utilisateur. |

‎src/components/DsfrFileUpload/DsfrFileUpload.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
22
import { computed } from 'vue'
33
4-
import { getRandomId } from '../../utils/random-utils'
4+
import { useRandomId } from '../../utils/random-utils'
55
66
import type { DsfrFileUploadProps } from './DsfrFileUpload.types'
77
@@ -12,7 +12,7 @@ defineOptions({
1212
})
1313
1414
const props = withDefaults(defineProps<DsfrFileUploadProps>(), {
15-
id: () => getRandomId('file-upload'),
15+
id: () => useRandomId('file-upload'),
1616
label: 'Ajouter un fichier',
1717
accept: undefined,
1818
hint: '',

0 commit comments

Comments
 (0)