-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #586 from dnum-mi/develop
Develop
- Loading branch information
Showing
3 changed files
with
272 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,10 @@ export default { | |
control: 'boolean', | ||
description: 'Indique si la balise caption doit être visible (`false`, défaut) ou cachée (`true`)', | ||
}, | ||
pagination: { | ||
control: 'boolean', | ||
description: 'Intègre une pagination au tableau', | ||
}, | ||
headers: { | ||
control: 'object', | ||
description: 'Liste des en-têtes du tableau (tableau de string). Il existe un slot nommé `headers` pour gérer les en-têtes avec d’autres composants. C’est la même props attendue par <a href="/?path=/docs/composants-tableau-en-t%C3%AAtes-de-tableau-dsfrtableheaders--en-tetes-de-tableau">DsfrTableHeaders</a>', | ||
|
@@ -40,6 +44,14 @@ export default { | |
action: 'clicked on row', | ||
description: 'Fonction pour montrer le clic sur une ligne (Ici seulement la 2e ligne)', | ||
}, | ||
defaultCurrentPage: { | ||
control: 'number', | ||
description: 'Le numéro de la page dans la pagination', | ||
}, | ||
defaultOptionSelected: { | ||
control: 'number', | ||
description: 'La sélection du nombre d\'enregistrements par page', | ||
}, | ||
}, | ||
} | ||
|
||
|
@@ -49,9 +61,9 @@ const rows = [ | |
[ | ||
'EGAUD', | ||
'Pierre-Louis', | ||
'pierre.egaud@ninja.com', | ||
'01 02 03 04 05', | ||
'06 01 02 03 04', | ||
'pierre.egaud@castor.fr', | ||
'02 04 06 08 10', | ||
'06 05 04 03 02', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Erreur', | ||
|
@@ -66,9 +78,9 @@ const rows = [ | |
rowData: [ | ||
'DEBROIZE', | ||
'Clément', | ||
'clement.debroize@ninja.com', | ||
'01 02 03 04 05', | ||
'06 01 02 03 04', | ||
'clement.debroize@exile.com', | ||
'02 44 66 55 99', | ||
'07 88 77 22 33', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Succès', | ||
|
@@ -81,21 +93,168 @@ const rows = [ | |
'Stan', | ||
'[email protected]', | ||
{ | ||
text: '01 02 03 04 05', | ||
text: '02 77 00 00 77', | ||
cellAttrs: { | ||
class: 'pointer', | ||
onClick: () => {}, // eslint-disable-line @typescript-eslint/no-empty-function | ||
}, | ||
}, | ||
'06 01 02 03 04', | ||
'06 08 07 09 08', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Info', | ||
class: 'info', | ||
}, | ||
], | ||
[ | ||
'MONTANA', | ||
'Tony', | ||
'[email protected]', | ||
'02 07 03 19 84', | ||
'06 07 03 19 84', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Erreur', | ||
class: 'error', | ||
}, | ||
], | ||
[ | ||
'BOND', | ||
'James', | ||
'[email protected]', | ||
'02 00 07 19 62', | ||
'06 00 07 19 62', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Succès', | ||
class: 'success', | ||
}, | ||
], | ||
[ | ||
'RAMBO', | ||
'John', | ||
'[email protected]', | ||
'02 00 00 19 82', | ||
'06 00 00 19 82', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Info', | ||
class: 'info', | ||
}, | ||
], | ||
[ | ||
'CONNOR', | ||
'Sarah', | ||
'[email protected]', | ||
'02 00 00 19 84', | ||
'06 00 00 19 84', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Erreur', | ||
class: 'error', | ||
}, | ||
], | ||
[ | ||
'KENOBI', | ||
'Obiwan', | ||
'[email protected]', | ||
'02 00 00 19 77', | ||
'06 00 00 19 77', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Succès', | ||
class: 'success', | ||
}, | ||
], | ||
[ | ||
'KRUEGER', | ||
'Freddy', | ||
'[email protected]', | ||
'02 00 00 19 84', | ||
'06 00 00 19 84', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Info', | ||
class: 'info', | ||
}, | ||
], | ||
[ | ||
'LEGRIS', | ||
'Gandalf', | ||
'[email protected]', | ||
'02 00 00 20 01', | ||
'06 00 00 20 01', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Erreur', | ||
class: 'error', | ||
}, | ||
], | ||
[ | ||
'SÖZE', | ||
'Keyser', | ||
'[email protected]', | ||
'02 00 00 19 95', | ||
'06 00 00 19 95', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Info', | ||
class: 'info', | ||
}, | ||
], | ||
[ | ||
'HUNT', | ||
'Ethan', | ||
'[email protected]', | ||
'02 00 00 19 96', | ||
'06 00 00 19 96', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Erreur', | ||
class: 'error', | ||
}, | ||
], | ||
[ | ||
'HOLMES', | ||
'Sherlock', | ||
'[email protected]', | ||
'02 00 00 18 87', | ||
'06 00 00 18 87', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Succès', | ||
class: 'success', | ||
}, | ||
], | ||
[ | ||
'JONES', | ||
'Indiana', | ||
'[email protected]', | ||
'02 00 00 19 81', | ||
'06 00 00 19 81', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Info', | ||
class: 'info', | ||
}, | ||
], | ||
[ | ||
'WAYNE', | ||
'Bruce', | ||
'[email protected]', | ||
'02 00 00 19 89', | ||
'06 00 00 19 89', | ||
{ | ||
component: 'DsfrTag', | ||
label: 'Erreur', | ||
class: 'error', | ||
}, | ||
], | ||
] | ||
const noCaption = false | ||
const pagination = true | ||
const defaultCurrentPage = 2 | ||
const defaultOptionSelected = 5 | ||
|
||
export const TableauEntier = (args) => ({ | ||
components: { | ||
|
@@ -120,6 +279,9 @@ export const TableauEntier = (args) => ({ | |
:headers="headers" | ||
:rows="rows" | ||
:no-caption="noCaption" | ||
:pagination="pagination" | ||
:defaultCurrentPage="defaultCurrentPage" | ||
:defaultOptionSelected="defaultOptionSelected" | ||
/> | ||
`, | ||
|
||
|
@@ -129,4 +291,7 @@ TableauEntier.args = { | |
headers, | ||
rows, | ||
noCaption, | ||
pagination, | ||
defaultCurrentPage, | ||
defaultOptionSelected, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters