84 | {!selected ? readContent || children : editContent || children}
85 |
86 | )
87 | }
88 |
89 | export default BaseCell
90 |
--------------------------------------------------------------------------------
/src/components/BooleanCell/index.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | import React from "react"
4 | import BaseCell from "../BaseCell"
5 | import InputBase from "@material-ui/core/InputBase"
6 | import Checkbox from "@material-ui/core/Checkbox"
7 |
8 | export const BooleanCell = props => {
9 | return (
10 |
59 | {typesOpen ? (
60 |
61 |
78 | ) : (
79 |
|
80 | )}
81 |
{
83 | changeTypesOpen(!typesOpen)
84 | }}
85 | style={{
86 | position: "absolute",
87 | top: 8,
88 | alignItems: "center",
89 | justifyContent: "center",
90 | display: "flex",
91 | right: 8,
92 | backgroundColor: blue[300],
93 | border: `2px solid ${blue[500]}`,
94 | borderRadius: 3,
95 | cursor: "pointer",
96 | color: "#fff",
97 | width: 18,
98 | height: 18,
99 | fontSize: 12,
100 | fontWeight: "bold",
101 | cursor: "pointer"
102 | }}
103 | >
104 | {!typesOpen ? (
105 |
109 | ) : (
110 | "V"
111 | )}
112 |
113 |
114 | )
115 | }
116 |
--------------------------------------------------------------------------------
/src/components/DynamicCell/index.story.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | import React from "react"
4 |
5 | import { storiesOf } from "@storybook/react"
6 | import { action } from "@storybook/addon-actions"
7 |
8 | import Waterobject from "../Waterobject"
9 |
10 | storiesOf("Dynamic Cells", module).add("Basic", () => (
11 |