-
-
Notifications
You must be signed in to change notification settings - Fork 162
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 #429 from laratran/add-enable-cell-hover-reveal
Add enableCellHoverReveal column option
- Loading branch information
Showing
7 changed files
with
6,012 additions
and
4,696 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
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
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
62 changes: 62 additions & 0 deletions
62
packages/mantine-react-table/stories/features/CellHoverReveal.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { MantineReactTable, type MRT_ColumnDef } from '../../src'; | ||
|
||
import { faker } from '@faker-js/faker'; | ||
import { type Meta } from '@storybook/react'; | ||
|
||
const meta: Meta = { | ||
title: 'Features/Cell Hover Reveal Examples', | ||
}; | ||
|
||
export default meta; | ||
|
||
const columns: MRT_ColumnDef<(typeof data)[0]>[] = [ | ||
{ | ||
accessorKey: 'firstName', | ||
header: 'First Name', | ||
}, | ||
{ | ||
accessorKey: 'lastName', | ||
header: 'Last Name', | ||
}, | ||
{ | ||
accessorKey: 'address', | ||
header: 'Address', | ||
}, | ||
{ | ||
accessorKey: 'state', | ||
header: 'State', | ||
}, | ||
{ | ||
accessorKey: 'phoneNumber', | ||
header: 'Phone Number', | ||
}, | ||
{ | ||
accessorKey: 'job', | ||
enableCellHoverReveal: true, | ||
header: 'Job', | ||
size: 75, | ||
}, | ||
{ | ||
accessorKey: 'jobDescriptor', | ||
header: 'Job Descriptor', | ||
}, | ||
{ | ||
accessorKey: 'company', | ||
header: 'Company', | ||
}, | ||
]; | ||
|
||
const data = [...Array(100)].map(() => ({ | ||
address: faker.location.streetAddress(), | ||
company: faker.company.name(), | ||
firstName: faker.person.firstName(), | ||
job: faker.person.jobTitle(), | ||
jobDescriptor: faker.person.jobDescriptor(), | ||
lastName: faker.person.lastName(), | ||
phoneNumber: faker.phone.number(), | ||
state: faker.location.state(), | ||
})); | ||
|
||
export const CellHoverReveal = () => ( | ||
<MantineReactTable columns={columns} data={data} layoutMode="grid" /> | ||
); |
Oops, something went wrong.