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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b29950eaf36cde8e41455fcb9b225c5a8fa790b6d0588652ab34486ef975988
4
- data.tar.gz: 42bc8d2dc55415e52c1859cde301dd9ab2c5fcb9d22c75322014bb42cc6bb7f4
3
+ metadata.gz: 76db03ead6e3e424b1d2b607fef50fee913d58fdbcb6a404fc75f05d5d1e0a9c
4
+ data.tar.gz: b2839d04fee219e071f0a9935e5bc3daf881eb46a815c499e44edc88a29ae8a6
5
5
  SHA512:
6
- metadata.gz: ed13b007fa1aa2b04b67cc989f52b9131187badfcaf49606e01a3b36cb276272b3101ffd0c6e90178b6b038c220ac70e8108f86ad9deb16742a6b58856c9b042
7
- data.tar.gz: f926d815792e4c619f3c54dce6d170e00556ddd89e1802e78856c271557eb69f418a45e1f80e83e40ce7c3cebf3c7f46382e7d93f7ccb1eeb95f1b26b9b1dad8
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 AdvancedTableCustomSort = (props) => {
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 AdvancedTableCustomSort
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 { default as AdvancedTableCustomSort } from './_advanced_table_custom_sort.jsx'
41
+ export {default as AdvancedTableWithCustomHeader} from './_advanced_table_with_custom_header.jsx'