playbook_ui_docs 14.22.0.pre.alpha.PLAY2254datepickerdefaultdatenullvalueturbo8533 → 14.22.0.pre.alpha.PLAY22588587
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 +65 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -0
- data/dist/playbook-doc.js +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b29950eaf36cde8e41455fcb9b225c5a8fa790b6d0588652ab34486ef975988
|
4
|
+
data.tar.gz: 42bc8d2dc55415e52c1859cde301dd9ab2c5fcb9d22c75322014bb42cc6bb7f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed13b007fa1aa2b04b67cc989f52b9131187badfcaf49606e01a3b36cb276272b3101ffd0c6e90178b6b038c220ac70e8108f86ad9deb16742a6b58856c9b042
|
7
|
+
data.tar.gz: f926d815792e4c619f3c54dce6d170e00556ddd89e1802e78856c271557eb69f418a45e1f80e83e40ce7c3cebf3c7f46382e7d93f7ccb1eeb95f1b26b9b1dad8
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
+
|
5
|
+
const AdvancedTableCustomSort = (props) => {
|
6
|
+
const columnDefinitions = [
|
7
|
+
{
|
8
|
+
accessor: "year",
|
9
|
+
label: "Year",
|
10
|
+
id: "year",
|
11
|
+
cellAccessors: ["quarter", "month", "day"],
|
12
|
+
},
|
13
|
+
{
|
14
|
+
accessor: "newEnrollments",
|
15
|
+
id: "newEnrollments",
|
16
|
+
label: "New Enrollments",
|
17
|
+
},
|
18
|
+
{
|
19
|
+
accessor: "scheduledMeetings",
|
20
|
+
id: "scheduledMeetings",
|
21
|
+
label: "Scheduled Meetings",
|
22
|
+
},
|
23
|
+
{
|
24
|
+
accessor: "attendanceRate",
|
25
|
+
id: "attendanceRate",
|
26
|
+
label: "Attendance Rate",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "completedClasses",
|
30
|
+
id: "completedClasses",
|
31
|
+
label: "Completed Classes",
|
32
|
+
},
|
33
|
+
{
|
34
|
+
accessor: "classCompletionRate",
|
35
|
+
id: "classCompletionRate",
|
36
|
+
label: "Class Completion Rate",
|
37
|
+
},
|
38
|
+
{
|
39
|
+
accessor: "graduatedStudents",
|
40
|
+
id: "graduatedStudents",
|
41
|
+
label: "Graduated Students",
|
42
|
+
},
|
43
|
+
]
|
44
|
+
|
45
|
+
//Render the subRow header rows
|
46
|
+
const subRowHeaders = ["Quarter", "Month", "Day"]
|
47
|
+
|
48
|
+
return (
|
49
|
+
<div>
|
50
|
+
<AdvancedTable
|
51
|
+
columnDefinitions={columnDefinitions}
|
52
|
+
customSort
|
53
|
+
enableToggleExpansion="all"
|
54
|
+
onCustomSortClick={(subrows)=>{console.log("Custom sort clicked", subrows)}}
|
55
|
+
tableData={MOCK_DATA}
|
56
|
+
{...props}
|
57
|
+
>
|
58
|
+
<AdvancedTable.Header enableSorting />
|
59
|
+
<AdvancedTable.Body subRowHeaders={subRowHeaders} />
|
60
|
+
</AdvancedTable>
|
61
|
+
</div>
|
62
|
+
)
|
63
|
+
}
|
64
|
+
|
65
|
+
export default AdvancedTableCustomSort
|
@@ -0,0 +1,5 @@
|
|
1
|
+
The optional `customSort` prop can be used to add a sort button within a subrow header. The button will only appear if that subrowheader has more than one subrow nested within it. This button comes with a callback function called `onCustomSortClick`.
|
2
|
+
|
3
|
+
The `onCustomSortClick` provides as an argument an array of all the subrows nested within that level of the table.
|
4
|
+
|
5
|
+
__NOTE__: `customSort` must be used in conjunction with the `subRowHeaders` prop. The `customSort` DOES NOT handle the sort logic, this must be handled on the frontend using the callback provided.
|
@@ -19,14 +19,15 @@ 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
|
-
|
23
|
-
|
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
|
30
31
|
- advanced_table_expanded_control: Expanded Control
|
31
32
|
- advanced_table_expand_by_depth: Expand by Depth
|
32
33
|
- advanced_table_subrow_headers: SubRow Headers
|
@@ -38,3 +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 { default as AdvancedTableCustomSort } from './_advanced_table_custom_sort.jsx'
|