playbook_ui 13.19.0.pre.alpha.PBNTR207tabledivsupport2245 → 13.19.0.pre.alpha.PBNTR211tablekitsubcomponentsreact2318
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/index.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +28 -16
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +5 -11
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +44 -18
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +4 -8
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +6 -4
- data/app/pb_kits/playbook/pb_icon/icon.rb +27 -10
- data/app/pb_kits/playbook/pb_table/SubKits/_table_body.tsx +64 -0
- data/app/pb_kits/playbook/pb_table/SubKits/_table_cell.tsx +66 -0
- data/app/pb_kits/playbook/pb_table/SubKits/_table_head.tsx +64 -0
- data/app/pb_kits/playbook/pb_table/SubKits/_table_header.tsx +66 -0
- data/app/pb_kits/playbook/pb_table/SubKits/_table_row.tsx +74 -0
- data/app/pb_kits/playbook/pb_table/SubKits/index.tsx +5 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +99 -67
- data/app/pb_kits/playbook/pb_table/docs/_table_div.html.erb +26 -26
- data/app/pb_kits/playbook/pb_table/docs/_table_div.jsx +27 -26
- data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.jsx +24 -25
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents.jsx +47 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_subcomponents_as_divs.jsx +48 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +7 -2
- data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_content.scss +3 -3
- data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +15 -15
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +3 -3
- data/app/pb_kits/playbook/pb_table/styles/_hover.scss +11 -11
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +15 -15
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +15 -15
- data/app/pb_kits/playbook/pb_table/styles/_reset.scss +3 -3
- data/app/pb_kits/playbook/pb_table/styles/_side_highlight.scss +2 -2
- data/app/pb_kits/playbook/pb_table/styles/_single-line.scss +4 -4
- data/app/pb_kits/playbook/pb_table/styles/_sticky_header.scss +2 -2
- data/app/pb_kits/playbook/pb_table/styles/_striped.scss +4 -4
- data/app/pb_kits/playbook/pb_table/styles/_structure.scss +22 -8
- data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +7 -7
- data/app/pb_kits/playbook/pb_table/styles/_table-dark.scss +14 -14
- data/app/pb_kits/playbook/pb_table/styles/_table_header.scss +2 -2
- data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +15 -15
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +3 -3
- data/app/pb_kits/playbook/pb_table/table.html.erb +1 -3
- data/app/pb_kits/playbook/pb_table/table.test.js +142 -1
- data/app/pb_kits/playbook/pb_table/table_body.html.erb +17 -0
- data/app/pb_kits/playbook/pb_table/table_body.rb +15 -0
- data/app/pb_kits/playbook/pb_table/table_cell.html.erb +17 -0
- data/app/pb_kits/playbook/pb_table/table_cell.rb +17 -0
- data/app/pb_kits/playbook/pb_table/table_head.html.erb +17 -0
- data/app/pb_kits/playbook/pb_table/table_head.rb +15 -0
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +49 -39
- data/app/pb_kits/playbook/pb_table/table_header.rb +8 -1
- data/app/pb_kits/playbook/pb_table/table_row.html.erb +17 -7
- data/app/pb_kits/playbook/pb_table/table_row.rb +8 -1
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/version.rb +1 -1
- metadata +18 -4
- data/app/pb_kits/playbook/pb_table/_table_row.tsx +0 -47
- data/app/pb_kits/playbook/pb_table/styles/_div_support.scss +0 -22
@@ -0,0 +1,74 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import classnames from "classnames";
|
3
|
+
import {
|
4
|
+
buildAriaProps,
|
5
|
+
buildCss,
|
6
|
+
buildDataProps,
|
7
|
+
buildHtmlProps,
|
8
|
+
} from "../../utilities/props";
|
9
|
+
import { globalProps } from "../../utilities/globalProps";
|
10
|
+
|
11
|
+
type TableRowPropTypes = {
|
12
|
+
aria?: { [key: string]: string };
|
13
|
+
children: React.ReactNode[] | React.ReactNode;
|
14
|
+
className: string;
|
15
|
+
data?: { [key: string]: string };
|
16
|
+
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
17
|
+
id?: string;
|
18
|
+
sideHighlightColor: string;
|
19
|
+
tag?: "table" | "div";
|
20
|
+
};
|
21
|
+
|
22
|
+
const TableRow = (props: TableRowPropTypes) => {
|
23
|
+
const {
|
24
|
+
aria = {},
|
25
|
+
children,
|
26
|
+
className,
|
27
|
+
data = {},
|
28
|
+
htmlOptions = {},
|
29
|
+
id,
|
30
|
+
sideHighlightColor = "none",
|
31
|
+
tag = "table",
|
32
|
+
} = props;
|
33
|
+
|
34
|
+
const ariaProps = buildAriaProps(aria);
|
35
|
+
const dataProps = buildDataProps(data);
|
36
|
+
const htmlProps = buildHtmlProps(htmlOptions);
|
37
|
+
const sideHighlightClass =
|
38
|
+
sideHighlightColor != "" ? `side_highlight_${sideHighlightColor}` : null;
|
39
|
+
const classes = classnames(
|
40
|
+
buildCss("pb_table_row_kit", sideHighlightClass),
|
41
|
+
"pb_table_tr",
|
42
|
+
globalProps(props),
|
43
|
+
className
|
44
|
+
);
|
45
|
+
const isTableTag = tag === "table";
|
46
|
+
|
47
|
+
return (
|
48
|
+
<>
|
49
|
+
{isTableTag ? (
|
50
|
+
<tr
|
51
|
+
{...ariaProps}
|
52
|
+
{...dataProps}
|
53
|
+
{...htmlProps}
|
54
|
+
className={classes}
|
55
|
+
id={id}
|
56
|
+
>
|
57
|
+
{children}
|
58
|
+
</tr>
|
59
|
+
) : (
|
60
|
+
<div
|
61
|
+
{...ariaProps}
|
62
|
+
{...dataProps}
|
63
|
+
{...htmlProps}
|
64
|
+
className={classes}
|
65
|
+
id={id}
|
66
|
+
>
|
67
|
+
{children}
|
68
|
+
</div>
|
69
|
+
)}
|
70
|
+
</>
|
71
|
+
);
|
72
|
+
};
|
73
|
+
|
74
|
+
export default TableRow;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { default as TableHead } from './_table_head';
|
2
|
+
export { default as TableHeader } from './_table_header';
|
3
|
+
export { default as TableBody } from './_table_body';
|
4
|
+
export { default as TableRow } from './_table_row';
|
5
|
+
export { default as TableCell } from './_table_cell';
|
@@ -3,69 +3,69 @@ import classnames from 'classnames'
|
|
3
3
|
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
4
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
5
5
|
import PbTable from '.'
|
6
|
+
import {
|
7
|
+
TableHead,
|
8
|
+
TableHeader,
|
9
|
+
TableBody,
|
10
|
+
TableRow,
|
11
|
+
TableCell,
|
12
|
+
} from "./SubKits";
|
6
13
|
|
7
14
|
type TableProps = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
aria?: { [key: string]: string },
|
16
|
+
children: React.ReactNode[] | React.ReactNode,
|
17
|
+
className: string,
|
18
|
+
collapse?: "sm" | "md" | "lg",
|
19
|
+
container?: boolean,
|
20
|
+
dark?: boolean,
|
21
|
+
data?: { [key: string]: string },
|
22
|
+
dataTable: boolean,
|
23
|
+
disableHover?: boolean,
|
24
|
+
htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
|
25
|
+
id?: string,
|
26
|
+
responsive?: "collapse" | "scroll" | "none",
|
27
|
+
singleLine?: boolean,
|
28
|
+
size?: "sm" | "md" | "lg",
|
29
|
+
sticky?: boolean,
|
30
|
+
striped?: boolean,
|
31
|
+
tag?: "table" | "div",
|
32
|
+
verticalBorder?: boolean,
|
25
33
|
} & GlobalProps
|
26
34
|
|
27
35
|
const Table = (props: TableProps) => {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
36
|
+
const {
|
37
|
+
aria = {},
|
38
|
+
children,
|
39
|
+
className,
|
40
|
+
collapse = 'sm',
|
41
|
+
container = true,
|
42
|
+
dark,
|
43
|
+
data = {},
|
44
|
+
dataTable = false,
|
45
|
+
disableHover = false,
|
46
|
+
htmlOptions = {},
|
47
|
+
id,
|
48
|
+
responsive = 'collapse',
|
49
|
+
singleLine = false,
|
50
|
+
size = 'sm',
|
51
|
+
sticky = false,
|
52
|
+
striped = false,
|
53
|
+
tag = 'table',
|
54
|
+
verticalBorder = false,
|
55
|
+
} = props
|
47
56
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
57
|
+
const ariaProps = buildAriaProps(aria)
|
58
|
+
const dataProps = buildDataProps(data)
|
59
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
60
|
+
const tableCollapseCss = responsive !== 'none' ? `table-collapse-${collapse}` : ''
|
61
|
+
const verticalBorderCss = verticalBorder ? 'vertical-border' : ''
|
62
|
+
const isTableTag = tag === 'table'
|
53
63
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
return (
|
60
|
-
<table
|
61
|
-
{...ariaProps}
|
62
|
-
{...dataProps}
|
63
|
-
{...htmlProps}
|
64
|
-
className={classnames(
|
65
|
-
'pb_table',
|
66
|
-
`table-${size}`,
|
67
|
-
`table-responsive-${responsive}`,
|
68
|
-
{
|
64
|
+
const classNames = classnames(
|
65
|
+
'pb_table',
|
66
|
+
`table-${size}`,
|
67
|
+
`table-responsive-${responsive}`,
|
68
|
+
{
|
69
69
|
'table-card': container,
|
70
70
|
'table-dark': dark,
|
71
71
|
'data_table': dataTable,
|
@@ -73,17 +73,49 @@ const Table = (props: TableProps) => {
|
|
73
73
|
'no-hover': disableHover,
|
74
74
|
'sticky-header': sticky,
|
75
75
|
'striped': striped,
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
76
|
+
},
|
77
|
+
globalProps(props),
|
78
|
+
tableCollapseCss,
|
79
|
+
verticalBorderCss,
|
80
|
+
className
|
81
|
+
)
|
82
|
+
|
83
|
+
useEffect(() => {
|
84
|
+
const instance = new PbTable()
|
85
|
+
instance.connect()
|
86
|
+
}, [])
|
87
|
+
|
88
|
+
return (
|
89
|
+
<>
|
90
|
+
{isTableTag ? (
|
91
|
+
<table
|
92
|
+
{...ariaProps}
|
93
|
+
{...dataProps}
|
94
|
+
{...htmlProps}
|
95
|
+
className={classNames}
|
96
|
+
id={id}
|
97
|
+
>
|
98
|
+
{children}
|
99
|
+
</table>
|
100
|
+
) : (
|
101
|
+
<div
|
102
|
+
{...ariaProps}
|
103
|
+
{...dataProps}
|
104
|
+
{...htmlProps}
|
105
|
+
className={classNames}
|
106
|
+
id={id}
|
107
|
+
>
|
108
|
+
{children}
|
109
|
+
</div>
|
110
|
+
)}
|
111
|
+
</>
|
112
|
+
)
|
87
113
|
}
|
88
114
|
|
115
|
+
Table.Head = TableHead
|
116
|
+
Table.Header = TableHeader
|
117
|
+
Table.Body = TableBody
|
118
|
+
Table.Row = TableRow
|
119
|
+
Table.Cell = TableCell
|
120
|
+
|
89
121
|
export default Table
|
@@ -1,34 +1,34 @@
|
|
1
1
|
<%= pb_rails("table", props: { size: "sm", tag: "div" }) do %>
|
2
|
-
<div class="
|
3
|
-
<div class="
|
4
|
-
<div class="
|
5
|
-
<div class="
|
6
|
-
<div class="
|
7
|
-
<div class="
|
8
|
-
<div class="
|
2
|
+
<div class="pb_table_thead">
|
3
|
+
<div class="pb_table_tr">
|
4
|
+
<div class="pb_table_th">Column 1</div>
|
5
|
+
<div class="pb_table_th">Column 2</div>
|
6
|
+
<div class="pb_table_th">Column 3</div>
|
7
|
+
<div class="pb_table_th">Column 4</div>
|
8
|
+
<div class="pb_table_th">Column 5</div>
|
9
9
|
</div>
|
10
10
|
</div>
|
11
|
-
<div class="
|
12
|
-
<div class="
|
13
|
-
<div class="
|
14
|
-
<div class="
|
15
|
-
<div class="
|
16
|
-
<div class="
|
17
|
-
<div class="
|
11
|
+
<div class="pb_table_tbody">
|
12
|
+
<div class="pb_table_tr">
|
13
|
+
<div class="pb_table_td">Value 1</div>
|
14
|
+
<div class="pb_table_td">Value 2</div>
|
15
|
+
<div class="pb_table_td">Value 3</div>
|
16
|
+
<div class="pb_table_td">Value 4</div>
|
17
|
+
<div class="pb_table_td">Value 5</div>
|
18
18
|
</div>
|
19
|
-
<div class="
|
20
|
-
<div class="
|
21
|
-
<div class="
|
22
|
-
<div class="
|
23
|
-
<div class="
|
24
|
-
<div class="
|
19
|
+
<div class="pb_table_tr">
|
20
|
+
<div class="pb_table_td">Value 1</div>
|
21
|
+
<div class="pb_table_td">Value 2</div>
|
22
|
+
<div class="pb_table_td">Value 3</div>
|
23
|
+
<div class="pb_table_td">Value 4</div>
|
24
|
+
<div class="pb_table_td">Value 5</div>
|
25
25
|
</div>
|
26
|
-
<div class="
|
27
|
-
<div class="
|
28
|
-
<div class="
|
29
|
-
<div class="
|
30
|
-
<div class="
|
31
|
-
<div class="
|
26
|
+
<div class="pb_table_tr">
|
27
|
+
<div class="pb_table_td">Value 1</div>
|
28
|
+
<div class="pb_table_td">Value 2</div>
|
29
|
+
<div class="pb_table_td">Value 3</div>
|
30
|
+
<div class="pb_table_td">Value 4</div>
|
31
|
+
<div class="pb_table_td">Value 5</div>
|
32
32
|
</div>
|
33
33
|
</div>
|
34
34
|
<% end %>
|
@@ -5,38 +5,39 @@ const TableDiv = (props) => {
|
|
5
5
|
return (
|
6
6
|
<Table
|
7
7
|
size="sm"
|
8
|
+
tag="div"
|
8
9
|
{...props}
|
9
10
|
>
|
10
|
-
<div className="
|
11
|
-
<div className="
|
12
|
-
<div className="
|
13
|
-
<div className="
|
14
|
-
<div className="
|
15
|
-
<div className="
|
16
|
-
<div className="
|
11
|
+
<div className="pb_table_thead">
|
12
|
+
<div className="pb_table_tr">
|
13
|
+
<div className="pb_table_th">{'Column 1'}</div>
|
14
|
+
<div className="pb_table_th">{'Column 2'}</div>
|
15
|
+
<div className="pb_table_th">{'Column 3'}</div>
|
16
|
+
<div className="pb_table_th">{'Column 4'}</div>
|
17
|
+
<div className="pb_table_th">{'Column 5'}</div>
|
17
18
|
</div>
|
18
19
|
</div>
|
19
|
-
<div className="
|
20
|
-
<div className="
|
21
|
-
<div className="
|
22
|
-
<div className="
|
23
|
-
<div className="
|
24
|
-
<div className="
|
25
|
-
<div className="
|
20
|
+
<div className="pb_table_tbody">
|
21
|
+
<div className="pb_table_tr">
|
22
|
+
<div className="pb_table_td">{'Value 1'}</div>
|
23
|
+
<div className="pb_table_td">{'Value 2'}</div>
|
24
|
+
<div className="pb_table_td">{'Value 3'}</div>
|
25
|
+
<div className="pb_table_td">{'Value 4'}</div>
|
26
|
+
<div className="pb_table_td">{'Value 5'}</div>
|
26
27
|
</div>
|
27
|
-
<div className="
|
28
|
-
<div className="
|
29
|
-
<div className="
|
30
|
-
<div className="
|
31
|
-
<div className="
|
32
|
-
<div className="
|
28
|
+
<div className="pb_table_tr">
|
29
|
+
<div className="pb_table_td">{'Value 1'}</div>
|
30
|
+
<div className="pb_table_td">{'Value 2'}</div>
|
31
|
+
<div className="pb_table_td">{'Value 3'}</div>
|
32
|
+
<div className="pb_table_td">{'Value 4'}</div>
|
33
|
+
<div className="pb_table_td">{'Value 5'}</div>
|
33
34
|
</div>
|
34
|
-
<div className="
|
35
|
-
<div className="
|
36
|
-
<div className="
|
37
|
-
<div className="
|
38
|
-
<div className="
|
39
|
-
<div className="
|
35
|
+
<div className="pb_table_tr">
|
36
|
+
<div className="pb_table_td">{'Value 1'}</div>
|
37
|
+
<div className="pb_table_td">{'Value 2'}</div>
|
38
|
+
<div className="pb_table_td">{'Value 3'}</div>
|
39
|
+
<div className="pb_table_td">{'Value 4'}</div>
|
40
|
+
<div className="pb_table_td">{'Value 5'}</div>
|
40
41
|
</div>
|
41
42
|
</div>
|
42
43
|
</Table>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
|
3
3
|
import Table from '../_table'
|
4
|
-
import TableRow from '../_table_row'
|
5
4
|
|
6
5
|
const TableSideHighlight = (props) => {
|
7
6
|
return (
|
@@ -20,7 +19,7 @@ const TableSideHighlight = (props) => {
|
|
20
19
|
</tr>
|
21
20
|
</thead>
|
22
21
|
<tbody>
|
23
|
-
<
|
22
|
+
<Table.Row
|
24
23
|
sideHighlightColor="product_1_highlight"
|
25
24
|
{...props}
|
26
25
|
>
|
@@ -29,8 +28,8 @@ const TableSideHighlight = (props) => {
|
|
29
28
|
<td>{'Value 3'}</td>
|
30
29
|
<td>{'Value 4'}</td>
|
31
30
|
<td>{'Value 5'}</td>
|
32
|
-
</
|
33
|
-
<
|
31
|
+
</Table.Row>
|
32
|
+
<Table.Row
|
34
33
|
sideHighlightColor="product_2_highlight"
|
35
34
|
{...props}
|
36
35
|
>
|
@@ -39,8 +38,8 @@ const TableSideHighlight = (props) => {
|
|
39
38
|
<td>{'Value 3'}</td>
|
40
39
|
<td>{'Value 4'}</td>
|
41
40
|
<td>{'Value 5'}</td>
|
42
|
-
</
|
43
|
-
<
|
41
|
+
</Table.Row>
|
42
|
+
<Table.Row
|
44
43
|
sideHighlightColor="product_3_highlight"
|
45
44
|
{...props}
|
46
45
|
>
|
@@ -49,8 +48,8 @@ const TableSideHighlight = (props) => {
|
|
49
48
|
<td>{'Value 3'}</td>
|
50
49
|
<td>{'Value 4'}</td>
|
51
50
|
<td>{'Value 5'}</td>
|
52
|
-
</
|
53
|
-
<
|
51
|
+
</Table.Row>
|
52
|
+
<Table.Row
|
54
53
|
sideHighlightColor="none"
|
55
54
|
{...props}
|
56
55
|
>
|
@@ -59,7 +58,7 @@ const TableSideHighlight = (props) => {
|
|
59
58
|
<td>{'Value 3'}</td>
|
60
59
|
<td>{'Value 4'}</td>
|
61
60
|
<td>{'Value 5'}</td>
|
62
|
-
</
|
61
|
+
</Table.Row>
|
63
62
|
</tbody>
|
64
63
|
</Table>
|
65
64
|
|
@@ -79,7 +78,7 @@ const TableSideHighlight = (props) => {
|
|
79
78
|
</tr>
|
80
79
|
</thead>
|
81
80
|
<tbody>
|
82
|
-
<
|
81
|
+
<Table.Row
|
83
82
|
sideHighlightColor="success"
|
84
83
|
{...props}
|
85
84
|
>
|
@@ -88,8 +87,8 @@ const TableSideHighlight = (props) => {
|
|
88
87
|
<td>{'Value 3'}</td>
|
89
88
|
<td>{'Value 4'}</td>
|
90
89
|
<td>{'Value 5'}</td>
|
91
|
-
</
|
92
|
-
<
|
90
|
+
</Table.Row>
|
91
|
+
<Table.Row
|
93
92
|
sideHighlightColor="warning"
|
94
93
|
{...props}
|
95
94
|
>
|
@@ -98,8 +97,8 @@ const TableSideHighlight = (props) => {
|
|
98
97
|
<td>{'Value 3'}</td>
|
99
98
|
<td>{'Value 4'}</td>
|
100
99
|
<td>{'Value 5'}</td>
|
101
|
-
</
|
102
|
-
<
|
100
|
+
</Table.Row>
|
101
|
+
<Table.Row
|
103
102
|
sideHighlightColor="error"
|
104
103
|
{...props}
|
105
104
|
>
|
@@ -108,8 +107,8 @@ const TableSideHighlight = (props) => {
|
|
108
107
|
<td>{'Value 3'}</td>
|
109
108
|
<td>{'Value 4'}</td>
|
110
109
|
<td>{'Value 5'}</td>
|
111
|
-
</
|
112
|
-
<
|
110
|
+
</Table.Row>
|
111
|
+
<Table.Row
|
113
112
|
sideHighlightColor="none"
|
114
113
|
{...props}
|
115
114
|
>
|
@@ -118,7 +117,7 @@ const TableSideHighlight = (props) => {
|
|
118
117
|
<td>{'Value 3'}</td>
|
119
118
|
<td>{'Value 4'}</td>
|
120
119
|
<td>{'Value 5'}</td>
|
121
|
-
</
|
120
|
+
</Table.Row>
|
122
121
|
</tbody>
|
123
122
|
</Table>
|
124
123
|
|
@@ -138,7 +137,7 @@ const TableSideHighlight = (props) => {
|
|
138
137
|
</tr>
|
139
138
|
</thead>
|
140
139
|
<tbody>
|
141
|
-
<
|
140
|
+
<Table.Row
|
142
141
|
sideHighlightColor="category_1"
|
143
142
|
{...props}
|
144
143
|
>
|
@@ -147,8 +146,8 @@ const TableSideHighlight = (props) => {
|
|
147
146
|
<td>{'Value 3'}</td>
|
148
147
|
<td>{'Value 4'}</td>
|
149
148
|
<td>{'Value 5'}</td>
|
150
|
-
</
|
151
|
-
<
|
149
|
+
</Table.Row>
|
150
|
+
<Table.Row
|
152
151
|
sideHighlightColor="category_2"
|
153
152
|
{...props}
|
154
153
|
>
|
@@ -157,8 +156,8 @@ const TableSideHighlight = (props) => {
|
|
157
156
|
<td>{'Value 3'}</td>
|
158
157
|
<td>{'Value 4'}</td>
|
159
158
|
<td>{'Value 5'}</td>
|
160
|
-
</
|
161
|
-
<
|
159
|
+
</Table.Row>
|
160
|
+
<Table.Row
|
162
161
|
sideHighlightColor="category_3"
|
163
162
|
{...props}
|
164
163
|
>
|
@@ -167,8 +166,8 @@ const TableSideHighlight = (props) => {
|
|
167
166
|
<td>{'Value 3'}</td>
|
168
167
|
<td>{'Value 4'}</td>
|
169
168
|
<td>{'Value 5'}</td>
|
170
|
-
</
|
171
|
-
<
|
169
|
+
</Table.Row>
|
170
|
+
<Table.Row
|
172
171
|
sideHighlightColor="none"
|
173
172
|
{...props}
|
174
173
|
>
|
@@ -177,7 +176,7 @@ const TableSideHighlight = (props) => {
|
|
177
176
|
<td>{'Value 3'}</td>
|
178
177
|
<td>{'Value 4'}</td>
|
179
178
|
<td>{'Value 5'}</td>
|
180
|
-
</
|
179
|
+
</Table.Row>
|
181
180
|
</tbody>
|
182
181
|
</Table>
|
183
182
|
</div>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= pb_rails("table", props: { size: "sm" }) do %>
|
2
|
+
<%= pb_rails("table/table_head") do %>
|
3
|
+
<%= pb_rails("table/table_row") do %>
|
4
|
+
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
|
5
|
+
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
|
6
|
+
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
|
7
|
+
<%= pb_rails("table/table_header", props: { text: "Column 4"}) %>
|
8
|
+
<%= pb_rails("table/table_header", props: { text: "Column 5"}) %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<%= pb_rails("table/table_body") do %>
|
12
|
+
<%= pb_rails("table/table_row") do %>
|
13
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
14
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
15
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
16
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
17
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
18
|
+
<% end %>
|
19
|
+
<%= pb_rails("table/table_row") do %>
|
20
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
21
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
22
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
23
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
24
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
25
|
+
<% end %>
|
26
|
+
<%= pb_rails("table/table_row") do %>
|
27
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
28
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
29
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
30
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
31
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Table from '../_table'
|
4
|
+
|
5
|
+
const TableWithSubcomponents = (props) => {
|
6
|
+
return (
|
7
|
+
<Table
|
8
|
+
size="sm"
|
9
|
+
{...props}
|
10
|
+
>
|
11
|
+
<Table.Head>
|
12
|
+
<Table.Row>
|
13
|
+
<Table.Header>{'Column 1'}</Table.Header>
|
14
|
+
<Table.Header>{'Column 2'}</Table.Header>
|
15
|
+
<Table.Header>{'Column 3'}</Table.Header>
|
16
|
+
<Table.Header>{'Column 4'}</Table.Header>
|
17
|
+
<Table.Header>{'Column 5'}</Table.Header>
|
18
|
+
</Table.Row>
|
19
|
+
</Table.Head>
|
20
|
+
<Table.Body>
|
21
|
+
<Table.Row>
|
22
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
23
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
24
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
25
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
26
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
27
|
+
</Table.Row>
|
28
|
+
<Table.Row>
|
29
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
30
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
31
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
32
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
33
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
34
|
+
</Table.Row>
|
35
|
+
<Table.Row>
|
36
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
37
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
38
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
39
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
40
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
41
|
+
</Table.Row>
|
42
|
+
</Table.Body>
|
43
|
+
</Table>
|
44
|
+
)
|
45
|
+
}
|
46
|
+
|
47
|
+
export default TableWithSubcomponents
|