playbook_ui_docs 13.16.0.pre.alpha.PBNTR178AdvancedTableDocs2072 → 13.16.0.pre.alpha.PBNTR181stripedtable2103

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +1 -4
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx +6 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -10
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -7
  6. data/app/pb_kits/playbook/pb_table/docs/_table_striped.html.erb +48 -0
  7. data/app/pb_kits/playbook/pb_table/docs/_table_striped.jsx +58 -0
  8. data/app/pb_kits/playbook/pb_table/docs/_table_striped.md +1 -0
  9. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  10. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
  11. data/dist/playbook-doc.js +2 -2
  12. metadata +5 -17
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.jsx +0 -52
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.md +0 -1
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx +0 -59
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.md +0 -18
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.jsx +0 -60
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +0 -3
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md +0 -5
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx +0 -63
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +0 -3
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.jsx +0 -57
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +0 -3
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.jsx +0 -61
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +0 -3
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +0 -55
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.md +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed4a12fd883bbb6280c52cc853c9ccfd8950bb16da52eae59e5d1cf1a9cd1006
4
- data.tar.gz: 685191f88948723d27f68adb72dcc979164f35e90c9ef818a480afd193ffee0d
3
+ metadata.gz: 3b44929cb212a17baed8ba206c58b21fa14061d4c5831cac0073f8dc5ce48432
4
+ data.tar.gz: 7acf2cecc8f72ab82093552c9d416d2bbad8aecacd0058143e642e8cababf062
5
5
  SHA512:
6
- metadata.gz: d676c3998ccae8d9fa4ad43eadc1f49a7c64408a8cb86c6f5190036a4e3007b2032757e8892517e95cbbc1f3ec7f3c75f0ba638458b9984d8cd19ade696982e5
7
- data.tar.gz: f897ed4ef733df9948bfde46060fea3ac91a887bb35ba43b7e2fdc740da4e5c18e4c409ffe1b6f40325a0f944a926dad6ea2f2496802d7c5fc144b120b88d153
6
+ metadata.gz: 92e1e989e425df588cc9bb12af04fa9b395e35aeb64cac3433341e9809ca50f59b2a0c5d5fc71352d9a93b4c07b75059764b3d084e36118887f8c977530190ab
7
+ data.tar.gz: 97a14ceb8577e664a71cbfa246f4fa87e75ded70407a1694e3cf30e66a79b44e9126e547ba93e3064473128a22a5c1a6c571e60e354f4e489ee79e6eca835148
@@ -1,10 +1,7 @@
1
- The AdvancedTable kit takes the table data and automatically renders expandable subrows for nested items to any depth needed. In it's simplest form, __the kit has two required props__:
2
-
3
- ### tableData
1
+ The AdvancedTable kit takes the table data and automatically renders expandable subrows for nested items to any depth needed. In it's simplest form, the kit has two required props:
4
2
 
5
3
  `tableData` is the data that the kit needs to consume to render the table. This data will take the structure of an array of objects where each object will be rendered as a row with the key/value pairs being the column values. If an object within that data has children, the kit will automatically create subRows with icon buttons on the parent rows to toggle the subRows open or closed. The toggleExpansionAll button in the first column header can also be used to toggle expansion for the top level parent rows. For a visual of the data structure needed for `tableData`, see [here](https://github.com/powerhome/playbook/blob/PBNTR-177-New-Advanced-Table-Kit/playbook/app/pb_kits/playbook/pb_advanced_table/README.md).
6
4
 
7
- ### columnDefinitions
8
5
 
9
6
  `columnDefinitions` maps to the columns prop on the Tanstack table. Column definitions are the single most important part of building a table as they are responsible for building the underlying data model that is used for all sorting, expansion, etc. `ColumnDefinitions` in the AdvancedTable kit is a array of objects as seen in the code snippet below. Each object within the array has two REQUIRED items:
10
7
 
@@ -35,15 +35,20 @@ const AdvancedTableSort = (props) => {
35
35
  },
36
36
  ];
37
37
 
38
+ //Render the subRow header rows
39
+ const subRowHeaders = ["Quarter", "Month", "Day"]
40
+
41
+
38
42
  return (
39
43
  <div>
40
44
  <AdvancedTable
41
45
  columnDefinitions={columnDefinitions}
46
+ enableToggleExpansion="all"
42
47
  tableData={MOCK_DATA}
43
48
  {...props}
44
49
  >
45
50
  <AdvancedTable.Header enableSorting />
46
- <AdvancedTable.Body />
51
+ <AdvancedTable.Body subRowHeaders={subRowHeaders} />
47
52
  </AdvancedTable>
48
53
  </div>
49
54
  );
@@ -1,12 +1,6 @@
1
1
  examples:
2
2
  react:
3
- - advanced_table_default: Default (Required Props)
4
- - advanced_table_loading: Loading State
5
- - advanced_table_sort: enable Sorting
6
- - advanced_table_sort_control: Sort Control
7
- - advanced_table_expanded_control: Expanded Control
8
- - advanced_table_subrow_headers: SubRow Headers
9
- - advanced_table_collapsible_trail: Collapsible Trail
10
- - advanced_table_table_options: Table Options
11
- - advanced_table_table_props: Table Props
12
-
3
+ - advanced_table_default: Default
4
+ # - advanced_table_sort: enableSorting
5
+
6
+
@@ -1,9 +1,2 @@
1
1
  export { default as AdvancedTableDefault } from './_advanced_table_default.jsx'
2
2
  export { default as AdvancedTableSort } from './_advanced_table_sort.jsx'
3
- export { default as AdvancedTableSortControl } from './_advanced_table_sort_control.jsx'
4
- export { default as AdvancedTableLoading } from './_advanced_table_loading.jsx'
5
- export { default as AdvancedTableExpandedControl } from './_advanced_table_expanded_control.jsx'
6
- export { default as AdvancedTableSubrowHeaders } from './_advanced_table_subrow_headers.jsx'
7
- export { default as AdvancedTableCollapsibleTrail } from './_advanced_table_collapsible_trail.jsx'
8
- export { default as AdvancedTableTableOptions } from './_advanced_table_table_options.jsx'
9
- export { default as AdvancedTableTableProps } from './_advanced_table_table_props.jsx'
@@ -0,0 +1,48 @@
1
+ <%= pb_rails("table", props: { striped: true }) do %>
2
+ <thead>
3
+ <tr>
4
+ <th>Column 1</th>
5
+ <th>Column 2</th>
6
+ <th>Column 3</th>
7
+ <th>Column 4</th>
8
+ <th>Column 5</th>
9
+ </tr>
10
+ </thead>
11
+ <tbody>
12
+ <tr>
13
+ <td>Value 1</td>
14
+ <td>Value 2</td>
15
+ <td>Value 3</td>
16
+ <td>Value 4</td>
17
+ <td>Value 5</td>
18
+ </tr>
19
+ <tr>
20
+ <td>Value 1</td>
21
+ <td>Value 2</td>
22
+ <td>Value 3</td>
23
+ <td>Value 4</td>
24
+ <td>Value 5</td>
25
+ </tr>
26
+ <tr>
27
+ <td>Value 1</td>
28
+ <td>Value 2</td>
29
+ <td>Value 3</td>
30
+ <td>Value 4</td>
31
+ <td>Value 5</td>
32
+ </tr>
33
+ <tr>
34
+ <td>Value 1</td>
35
+ <td>Value 2</td>
36
+ <td>Value 3</td>
37
+ <td>Value 4</td>
38
+ <td>Value 5</td>
39
+ </tr>
40
+ <tr>
41
+ <td>Value 1</td>
42
+ <td>Value 2</td>
43
+ <td>Value 3</td>
44
+ <td>Value 4</td>
45
+ <td>Value 5</td>
46
+ </tr>
47
+ </tbody>
48
+ <% end %>
@@ -0,0 +1,58 @@
1
+ import React from "react"
2
+ import Table from "../_table"
3
+
4
+ const TableStriped = (props) => (
5
+ <Table
6
+ striped
7
+ {...props}
8
+ >
9
+ <thead>
10
+ <tr>
11
+ <th>{'Column 1'}</th>
12
+ <th>{'Column 2'}</th>
13
+ <th>{'Column 3'}</th>
14
+ <th>{'Column 4'}</th>
15
+ <th>{'Column 5'}</th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <tr>
20
+ <td>{'Value 1'}</td>
21
+ <td>{'Value 2'}</td>
22
+ <td>{'Value 3'}</td>
23
+ <td>{'Value 4'}</td>
24
+ <td>{'Value 5'}</td>
25
+ </tr>
26
+ <tr>
27
+ <td>{'Value 1'}</td>
28
+ <td>{'Value 2'}</td>
29
+ <td>{'Value 3'}</td>
30
+ <td>{'Value 4'}</td>
31
+ <td>{'Value 5'}</td>
32
+ </tr>
33
+ <tr>
34
+ <td>{'Value 1'}</td>
35
+ <td>{'Value 2'}</td>
36
+ <td>{'Value 3'}</td>
37
+ <td>{'Value 4'}</td>
38
+ <td>{'Value 5'}</td>
39
+ </tr>
40
+ <tr>
41
+ <td>{'Value 1'}</td>
42
+ <td>{'Value 2'}</td>
43
+ <td>{'Value 3'}</td>
44
+ <td>{'Value 4'}</td>
45
+ <td>{'Value 5'}</td>
46
+ </tr>
47
+ <tr>
48
+ <td>{'Value 1'}</td>
49
+ <td>{'Value 2'}</td>
50
+ <td>{'Value 3'}</td>
51
+ <td>{'Value 4'}</td>
52
+ <td>{'Value 5'}</td>
53
+ </tr>
54
+ </tbody>
55
+ </Table>
56
+ )
57
+
58
+ export default TableStriped
@@ -0,0 +1 @@
1
+ Optionally pass the `striped` (boolean, defaults to false) prop to set odd rows to a contrasting background color. This helps with readability on larger tables with lots of data.
@@ -23,6 +23,7 @@ examples:
23
23
  - table_icon_buttons: Table with Icon Buttons
24
24
  - table_with_background_kit: Table With Background Kit
25
25
  - table_vertical_border: Vertical Borders
26
+ - table_striped: Striped Table
26
27
 
27
28
  react:
28
29
  - table_sm: Small
@@ -47,3 +48,4 @@ examples:
47
48
  - table_icon_buttons: Table with Icon Buttons
48
49
  - table_with_background_kit: Table With Background Kit
49
50
  - table_vertical_border: Vertical Borders
51
+ - table_striped: Striped Table
@@ -20,3 +20,4 @@ export { default as TableAlignmentShiftRow } from './_table_alignment_shift_row.
20
20
  export { default as TableAlignmentShiftData } from './_table_alignment_shift_data.jsx'
21
21
  export { default as TableWithBackgroundKit } from './_table_with_background_kit.jsx'
22
22
  export { default as TableVerticalBorder } from './_table_vertical_border.jsx'
23
+ export { default as TableStriped } from './_table_striped.jsx'