-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
3,498 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.sds--entities { | ||
|
||
.entities-search { | ||
display: flex; | ||
gap: 40px; | ||
div.search { | ||
margin-left: auto; | ||
min-width: 140px; | ||
} | ||
} | ||
} |
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,39 @@ | ||
import React from 'react'; | ||
import {Meta, StoryFn} from '@storybook/react'; | ||
import {ReactComponent as ArrowDownIcon} from "../../icons/functional-icons/arrow-down-2.svg"; | ||
import Table, {defaultTableProps} from './Table'; | ||
import Button from "../Button/Button"; | ||
|
||
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export | ||
export default { | ||
title: 'ReactComponentLibrary/Table', | ||
component: Table, | ||
args: { | ||
...defaultTableProps | ||
} | ||
} as Meta<typeof Table>; | ||
|
||
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args | ||
const Template: StoryFn<typeof Table> = (args) => <Table {...args} />; | ||
|
||
export const Default = Template.bind({}); | ||
// More on args: https://storybook.js.org/docs/react/writing-stories/args | ||
Default.args = { | ||
newEntityFunc: () => alert("New entity"), | ||
searchAttributes: ["name"], | ||
children: <Button txt={"Custom children"}/>, | ||
columns: [ | ||
{key: "name", hasLink: false, showHeader: true}, | ||
{key: "name", hasLink: false, mapper: (obj: any) => obj.birthday.toDateString(), showHeader: true} | ||
], | ||
title: "Persons", | ||
defaultSort: "name", | ||
newLabel: "New Person", | ||
searchPlaceHolder: "Search...", | ||
entities:[ | ||
{name:"John Doe", birthday: new Date("1978-04-09")}, | ||
{name:"Mary Doe", birthday: new Date("1977-04-09")}, | ||
{name:"Paul Doe", birthday: new Date("1979-04-09")} | ||
], | ||
}; | ||
|
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,10 @@ | ||
import React from "react"; | ||
import {render} from "@testing-library/react"; | ||
|
||
import Table,{defaultTableProps} from "./Table"; | ||
|
||
describe("Table", () => { | ||
test("renders the Table component", () => { | ||
render(<Table entities={[]} defaultSort={"name"} columns={[]}/>); | ||
}); | ||
}); |
Oops, something went wrong.