playbook_ui_docs 14.11.0.pre.rc.1 → 14.11.0.pre.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +60 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx +74 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -0
- data/dist/playbook-doc.js +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b98cd04ee6645a02dddcb8e47a469ce16fe175b1edfdb0926e25555e21a73b49
|
4
|
+
data.tar.gz: '0779d94d75adf2e53b572bc0bbc330e3aedbde8a70b42bb1eb9feca16c31687b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06017500d6c6f15832a99d0e8e4bf3de96ac29b81e2131c841f2622b19e9b6007f1b7b3b7c9e2c3078092ea4836b992f1d5244e4e62dc1a9f85cfd60f33caa76
|
7
|
+
data.tar.gz: cf47ea2181b8e870f4fadf32b6b9eb940ed2231d3385d50cb973b973217447b9b247ed73a560fecaf3dc07d4bf2b07d2f6f04e13eeebe128fcb5d30d0dd5e0f5
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { AdvancedTable } from "playbook-ui"
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableColumnHeaders = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
label: "Enrollment Data",
|
14
|
+
columns: [
|
15
|
+
{
|
16
|
+
accessor: "newEnrollments",
|
17
|
+
label: "New Enrollments",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
accessor: "scheduledMeetings",
|
21
|
+
label: "Scheduled Meetings",
|
22
|
+
},
|
23
|
+
],
|
24
|
+
},
|
25
|
+
{
|
26
|
+
label: "Performance Data",
|
27
|
+
columns: [
|
28
|
+
{
|
29
|
+
accessor: "attendanceRate",
|
30
|
+
label: "Attendance Rate",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
accessor: "completedClasses",
|
34
|
+
label: "Completed Classes",
|
35
|
+
},
|
36
|
+
{
|
37
|
+
accessor: "classCompletionRate",
|
38
|
+
label: "Class Completion Rate",
|
39
|
+
},
|
40
|
+
{
|
41
|
+
accessor: "graduatedStudents",
|
42
|
+
label: "Graduated Students",
|
43
|
+
},
|
44
|
+
],
|
45
|
+
},
|
46
|
+
];
|
47
|
+
|
48
|
+
|
49
|
+
return (
|
50
|
+
<>
|
51
|
+
<AdvancedTable
|
52
|
+
columnDefinitions={columnDefinitions}
|
53
|
+
tableData={MOCK_DATA}
|
54
|
+
{...props}
|
55
|
+
/>
|
56
|
+
</>
|
57
|
+
)
|
58
|
+
}
|
59
|
+
|
60
|
+
export default AdvancedTableColumnHeaders
|
@@ -0,0 +1 @@
|
|
1
|
+
Use a nested `columns` array in your columnDefinitions to create multiple header rows. Any column with `columns` is treated as a grouped header, and its child columns are displayed beneath it.
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { AdvancedTable } from "playbook-ui";
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json";
|
4
|
+
|
5
|
+
const AdvancedTableColumnHeadersMultiple = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
cellAccessors: ["quarter", "month", "day"],
|
11
|
+
},
|
12
|
+
{
|
13
|
+
label: "Enrollment Data",
|
14
|
+
columns: [
|
15
|
+
{
|
16
|
+
label: "Enrollment Stats",
|
17
|
+
columns: [
|
18
|
+
{
|
19
|
+
accessor: "newEnrollments",
|
20
|
+
label: "New Enrollments",
|
21
|
+
},
|
22
|
+
{
|
23
|
+
accessor: "scheduledMeetings",
|
24
|
+
label: "Scheduled Meetings",
|
25
|
+
},
|
26
|
+
],
|
27
|
+
},
|
28
|
+
],
|
29
|
+
},
|
30
|
+
{
|
31
|
+
label: "Performance Data",
|
32
|
+
columns: [
|
33
|
+
{
|
34
|
+
label: "Completion Metrics",
|
35
|
+
columns: [
|
36
|
+
{
|
37
|
+
accessor: "completedClasses",
|
38
|
+
label: "Completed Classes",
|
39
|
+
},
|
40
|
+
{
|
41
|
+
accessor: "classCompletionRate",
|
42
|
+
label: "Class Completion Rate",
|
43
|
+
},
|
44
|
+
],
|
45
|
+
},
|
46
|
+
{
|
47
|
+
label: "Attendance",
|
48
|
+
columns: [
|
49
|
+
{
|
50
|
+
accessor: "attendanceRate",
|
51
|
+
label: "Attendance Rate",
|
52
|
+
},
|
53
|
+
{
|
54
|
+
accessor: "scheduledMeetings",
|
55
|
+
label: "Scheduled Meetings",
|
56
|
+
},
|
57
|
+
],
|
58
|
+
},
|
59
|
+
],
|
60
|
+
},
|
61
|
+
];
|
62
|
+
|
63
|
+
return (
|
64
|
+
<>
|
65
|
+
<AdvancedTable
|
66
|
+
columnDefinitions={columnDefinitions}
|
67
|
+
tableData={MOCK_DATA}
|
68
|
+
{...props}
|
69
|
+
/>
|
70
|
+
</>
|
71
|
+
);
|
72
|
+
};
|
73
|
+
|
74
|
+
export default AdvancedTableColumnHeadersMultiple;
|
@@ -0,0 +1 @@
|
|
1
|
+
Multiple levels of column headers can also be rendered as seen here.
|
@@ -21,3 +21,5 @@ examples:
|
|
21
21
|
- advanced_table_custom_cell: Custom Components for Cells
|
22
22
|
- advanced_table_pagination: Pagination
|
23
23
|
- advanced_table_pagination_with_props: Pagination Props
|
24
|
+
- advanced_table_column_headers: Multi-Header Columns
|
25
|
+
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
@@ -12,3 +12,5 @@ export { default as AdvancedTableResponsive } from './_advanced_table_responsive
|
|
12
12
|
export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cell.jsx'
|
13
13
|
export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
|
14
14
|
export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
|
15
|
+
export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
|
16
|
+
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|