-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces the Column component to the library. The Column will take 3 properties: - cellRenderer The cellRenderer will expect a function which returns a JSX.Element which will be used to render the Datum cell. - width The width will expect a function to calculate the width it should return a number. As a parameter the total count of columns, total width, remaining width and current column index are provided in a single object. - label The label expects a JSX Element or a string which will be used to render the header. closes DCOS-38064
- Loading branch information
Poltergeist
committed
Jul 3, 2018
1 parent
069d652
commit 6550051
Showing
4 changed files
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { Badge } from "./badge"; | ||
export { BadgeButton } from "./badge"; | ||
export { Column } from "./table"; |
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,3 @@ | ||
# Table Name | ||
|
||
Table documentation |
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,16 @@ | ||
import * as React from "react"; | ||
interface IWidthArgs { | ||
width: number; | ||
totalColumns: number; | ||
remainingWidth: number; | ||
currentIndex: number; | ||
} | ||
export interface IColumnProps { | ||
header: string | React.ReactNode; | ||
cellRenderer: (data: any) => React.ReactNode; | ||
width: (args: IWidthArgs) => number; | ||
} | ||
|
||
export class Column extends React.PureComponent<IColumnProps, {}> {} | ||
|
||
export default Column; |
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 @@ | ||
export { default as Column } from "./components/Column"; |