playbook_ui_docs 14.22.0.pre.alpha.PLAY22588587 → 14.22.0.pre.alpha.customheaderat8564
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/pb_advanced_table/docs/{_advanced_table_custom_sort.jsx → _advanced_table_with_custom_header.jsx} +24 -20
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -1
- data/dist/playbook-doc.js +1 -1
- metadata +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76db03ead6e3e424b1d2b607fef50fee913d58fdbcb6a404fc75f05d5d1e0a9c
|
4
|
+
data.tar.gz: b2839d04fee219e071f0a9935e5bc3daf881eb46a815c499e44edc88a29ae8a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aa4299336b6e87ce95e1d99a9cad0e8a2a2ec4fae296af27f6b5d832412b3e673103a0324365f31fa1035f4dcbaaa823f8f6c80f2d6b39ffef35bbca427f4f7
|
7
|
+
data.tar.gz: 51460484b334b4980e914e655132d52c964357e7c5b64d1561005755f52e4ee0832fd09cfc0359929358cf5b32e226b46a71f5dde47b139394e801454f2c19a7
|
@@ -1,65 +1,69 @@
|
|
1
1
|
import React from "react"
|
2
2
|
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
|
+
import Icon from "../../pb_icon/_icon"
|
4
|
+
import Flex from "../../pb_flex/_flex"
|
5
|
+
import Caption from "../../pb_caption/_caption"
|
6
|
+
import Tooltip from "../../pb_tooltip/_tooltip"
|
3
7
|
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
8
|
|
5
|
-
const
|
9
|
+
const AdvancedTableWithCustomHeader = (props) => {
|
6
10
|
const columnDefinitions = [
|
7
11
|
{
|
8
12
|
accessor: "year",
|
9
13
|
label: "Year",
|
10
|
-
id: "year",
|
11
14
|
cellAccessors: ["quarter", "month", "day"],
|
12
15
|
},
|
13
16
|
{
|
14
17
|
accessor: "newEnrollments",
|
15
|
-
id: "newEnrollments",
|
16
18
|
label: "New Enrollments",
|
19
|
+
header: () => (
|
20
|
+
<Flex alignItems="center"
|
21
|
+
justifyContent="center"
|
22
|
+
>
|
23
|
+
<Caption marginRight="xs">New Enrollments</Caption>
|
24
|
+
<Tooltip placement="top"
|
25
|
+
text="Whoa. I'm a Tooltip"
|
26
|
+
zIndex={10}
|
27
|
+
>
|
28
|
+
<Icon cursor="pointer"
|
29
|
+
icon="info"
|
30
|
+
size="xs"
|
31
|
+
/>
|
32
|
+
</Tooltip>
|
33
|
+
</Flex>
|
34
|
+
),
|
17
35
|
},
|
18
36
|
{
|
19
37
|
accessor: "scheduledMeetings",
|
20
|
-
id: "scheduledMeetings",
|
21
38
|
label: "Scheduled Meetings",
|
22
39
|
},
|
23
40
|
{
|
24
41
|
accessor: "attendanceRate",
|
25
|
-
id: "attendanceRate",
|
26
42
|
label: "Attendance Rate",
|
27
43
|
},
|
28
44
|
{
|
29
45
|
accessor: "completedClasses",
|
30
|
-
id: "completedClasses",
|
31
46
|
label: "Completed Classes",
|
32
47
|
},
|
33
48
|
{
|
34
49
|
accessor: "classCompletionRate",
|
35
|
-
id: "classCompletionRate",
|
36
50
|
label: "Class Completion Rate",
|
37
51
|
},
|
38
52
|
{
|
39
53
|
accessor: "graduatedStudents",
|
40
|
-
id: "graduatedStudents",
|
41
54
|
label: "Graduated Students",
|
42
55
|
},
|
43
|
-
]
|
44
|
-
|
45
|
-
//Render the subRow header rows
|
46
|
-
const subRowHeaders = ["Quarter", "Month", "Day"]
|
56
|
+
];
|
47
57
|
|
48
58
|
return (
|
49
59
|
<div>
|
50
60
|
<AdvancedTable
|
51
61
|
columnDefinitions={columnDefinitions}
|
52
|
-
customSort
|
53
|
-
enableToggleExpansion="all"
|
54
|
-
onCustomSortClick={(subrows)=>{console.log("Custom sort clicked", subrows)}}
|
55
62
|
tableData={MOCK_DATA}
|
56
63
|
{...props}
|
57
|
-
|
58
|
-
<AdvancedTable.Header enableSorting />
|
59
|
-
<AdvancedTable.Body subRowHeaders={subRowHeaders} />
|
60
|
-
</AdvancedTable>
|
64
|
+
/>
|
61
65
|
</div>
|
62
66
|
)
|
63
67
|
}
|
64
68
|
|
65
|
-
export default
|
69
|
+
export default AdvancedTableWithCustomHeader
|
@@ -0,0 +1 @@
|
|
1
|
+
The optional `header` key/value pair can be used within `columnDefinitions` to render a custom header. This example shows an Icon and Tooltip being used but other kits can be used as well.
|
@@ -19,15 +19,14 @@ examples:
|
|
19
19
|
- advanced_table_selectable_rows_actions_rails: Selectable Rows (With Actions)
|
20
20
|
- advanced_table_selectable_rows_header_rails: Selectable Rows (No Actions Bar)
|
21
21
|
- advanced_table_scrollbar_none: Advanced Table Scrollbar None
|
22
|
-
- advanced_table_column_styling_rails: Column Styling
|
23
|
-
- advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
|
22
|
+
# - advanced_table_column_styling_rails: Column Styling
|
23
|
+
# - advanced_table_column_styling_column_headers_rails: Column Styling with Multiple Headers
|
24
24
|
|
25
25
|
react:
|
26
26
|
- advanced_table_default: Default (Required Props)
|
27
27
|
- advanced_table_loading: Loading State
|
28
28
|
- advanced_table_sort: Enable Sorting
|
29
29
|
- advanced_table_sort_control: Sort Control
|
30
|
-
- advanced_table_custom_sort: Custom Sort
|
31
30
|
- advanced_table_expanded_control: Expanded Control
|
32
31
|
- advanced_table_expand_by_depth: Expand by Depth
|
33
32
|
- advanced_table_subrow_headers: SubRow Headers
|
@@ -41,6 +40,7 @@ examples:
|
|
41
40
|
- advanced_table_inline_row_loading: Inline Row Loading
|
42
41
|
- advanced_table_responsive: Responsive Tables
|
43
42
|
- advanced_table_custom_cell: Custom Components for Cells
|
43
|
+
- advanced_table_with_custom_header: Custom Header Cell
|
44
44
|
- advanced_table_pagination: Pagination
|
45
45
|
- advanced_table_pagination_with_props: Pagination Props
|
46
46
|
- advanced_table_column_headers: Multi-Header Columns
|
@@ -38,4 +38,4 @@ export { default as AdvancedTableRowStyling } from './_advanced_table_row_stylin
|
|
38
38
|
export { default as AdvancedTableColumnStyling } from './_advanced_table_column_styling.jsx'
|
39
39
|
export { default as AdvancedTableColumnStylingColumnHeaders } from './_advanced_table_column_styling_column_headers.jsx'
|
40
40
|
export { default as AdvancedTableInfiniteScroll} from './_advanced_table_infinite_scroll.jsx'
|
41
|
-
export {
|
41
|
+
export {default as AdvancedTableWithCustomHeader} from './_advanced_table_with_custom_header.jsx'
|