Skip to content

Commit 57e7b1d

Browse files
committed
fix(DsfrDataTable): 🐛 prise en compte de noCaption
fixes #992
1 parent 0cac8c4 commit 57e7b1d

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

src/components/DsfrDataTable/DsfrDataTable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Le composant `DsfrDataTable` est un élément puissant et polyvalent pour affich
88

99
Ce composant est tout neuf et a besoin de vos retours. Son API ne devrait pas changer, elle devrait s’étoffer dans les prochaines semaines ou les prochains mois.
1010

11-
Si vous avez des propositions, lancer une [**discussion**](https://github.com/dnum-mi/vue-dsfr/discussions) avant d’ouvrir une issue.
11+
Si vous avez des propositions, veuillez lancer une [**discussion**](https://github.com/dnum-mi/vue-dsfr/discussions) avant d’ouvrir une issue.
1212

1313
:::
1414

src/components/DsfrDataTable/DsfrDataTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function copyToClipboard (text: string) {
155155
<div class="fr-table__container">
156156
<div class="fr-table__content">
157157
<table :id="id">
158-
<caption>
158+
<caption v-if="!noCaption">
159159
{{ title }}
160160
</caption>
161161
<thead>

src/components/DsfrDataTable/docs-demo/DsfrDataTableDemoSimple.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const rows = [
1818
<DsfrDataTable
1919
title="Titre du tableau (caption)"
2020
:headers-row="headers"
21+
no-caption
2122
:rows="rows"
2223
/>
2324
</div>

src/components/DsfrTable/DsfrTable.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Le composant `DsfrTable` est un élément puissant et polyvalent pour afficher d
88

99
<VIcon name="vi-file-type-storybook" /> La story sur le tableau sur le storybook de [VueDsfr](https://storybook.vue-ds.fr/?path=/docs/composants-dsfrtable--docs)
1010

11+
::: warning
12+
13+
Pour des tableaux complexes, nous vous recommandons d’utiliser [DsfrDataTable](/composants/DsfrDataTable)
14+
15+
:::
16+
1117
## 🛠️ Props
1218

1319
| Nom | Type | Défaut | Obligatoire | Description |

src/components/DsfrTable/docs-demo/DsfrTableDemoComplexe.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import { getCurrentInstance } from 'vue'
2+
import { getCurrentInstance, ref } from 'vue'
33
44
import DsfrTag from '../../DsfrTag/DsfrTag.vue'
55
import DsfrTable from '../DsfrTable.vue'
@@ -61,6 +61,10 @@ const rows: (string | DsfrTableRowProps | DsfrTableCellProps | { component: stri
6161
},
6262
],
6363
]
64+
65+
const noCaption = true
66+
const currentPage = ref(1)
67+
const resultsDisplayed = 5
6468
</script>
6569

6670
<template>
@@ -69,7 +73,6 @@ const rows: (string | DsfrTableRowProps | DsfrTableCellProps | { component: stri
6973
:headers="headers"
7074
:rows="rows"
7175
:no-caption="noCaption"
72-
:pagination="pagination"
7376
:current-page="currentPage"
7477
:results-displayed="resultsDisplayed"
7578
/>

0 commit comments

Comments
 (0)