playbook_ui_docs 14.12.0.pre.rc.11 → 14.13.0.pre.alpha.PBNTR5596029

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.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb +33 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading_rails.md +1 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_loading.md → _advanced_table_loading_react.md} +2 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +50 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +1 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb +38 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +60 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +5 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +78 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +1 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +53 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +1 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +52 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +1 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +3 -1
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +55 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -0
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +42 -0
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +299 -0
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +8 -0
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +7 -1
  26. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +9 -3
  27. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +6 -2
  28. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -0
  29. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +21 -0
  30. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +5 -0
  31. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +45 -0
  32. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.md +1 -0
  33. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +8 -0
  34. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -0
  35. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +2 -1
  36. data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +13 -5
  37. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
  38. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
  39. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
  40. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.html.erb +99 -0
  41. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +1 -0
  42. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +1 -3
  43. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +7 -0
  44. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +61 -0
  45. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +1 -0
  46. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +89 -0
  47. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +5 -0
  48. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +4 -5
  49. data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
  50. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +38 -0
  51. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -45
  52. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -1
  53. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +9 -16
  54. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +44 -19
  55. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +21 -3
  56. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +16 -21
  57. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +2 -19
  58. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +2 -1
  59. data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
  60. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  61. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +58 -0
  62. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +3 -0
  63. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +1 -0
  64. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
  65. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
  66. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
  67. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
  68. data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
  69. data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
  70. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +3 -0
  71. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +7 -0
  72. data/app/pb_kits/playbook/pb_link/docs/_link_target.html.erb +15 -0
  73. data/app/pb_kits/playbook/pb_link/docs/_link_target.jsx +29 -0
  74. data/app/pb_kits/playbook/pb_link/docs/example.yml +5 -3
  75. data/app/pb_kits/playbook/pb_link/docs/index.js +2 -1
  76. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tooltip.html.erb +6 -6
  77. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
  78. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +4 -1
  79. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +4 -1
  80. data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.html.erb +6 -9
  81. data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.jsx +6 -9
  82. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +47 -0
  83. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +2 -0
  84. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +12 -8
  85. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.html.erb +52 -0
  86. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.md +0 -0
  87. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.html.erb +52 -0
  88. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -0
  89. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.html.erb +80 -0
  90. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -0
  91. data/app/pb_kits/playbook/pb_table/docs/example.yml +4 -0
  92. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +46 -0
  93. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +3 -0
  94. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -1
  95. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
  96. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +19 -0
  97. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +27 -0
  98. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -0
  99. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  100. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  101. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb +42 -0
  102. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx +59 -0
  103. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md +2 -0
  104. data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
  105. data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
  106. data/dist/playbook-doc.js +1 -1
  107. metadata +63 -5
  108. /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close.md → _fixed_confirmation_toast_auto_close_react.md} +0 -0
  109. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible.md → _table_with_collapsible_react.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 427bfc3d5e71d87bb8f069471caf1088e6719e1728f52a5a886e2038d6ab5341
4
- data.tar.gz: 7d1599f0ba6ce11891f0d016c44a2bd40b33384e5ce23fa0a10469f04a36e97e
3
+ metadata.gz: ef838258f5fe69164855ae31d9ab5390d6dc72272d8cb4ccda371e2336aad5eb
4
+ data.tar.gz: e4f140b71b0d066caf6b53ed8321234cd641bace6e45ed2196a8a064ccf74773
5
5
  SHA512:
6
- metadata.gz: 8189c453fcbfe4f344f88eb81c0947da90b34edd40306916a1873ec4afe15f600e65885522e5384e84201ce834a3183cf367453836e83508f6276276590e16f7
7
- data.tar.gz: 4084e79c437a1bf6e5010342721de251c84b9ad8135b401c22d359bbe9d77744bf2056425a6a2c9f8f9d6ce666db903f4da8fd0adeb5779442ace09394a13999
6
+ metadata.gz: df834a5042aa5d1d36b16c6601a44d45d81aa874270dd4d2020a31ed716716aad4674e0eff511a4eb5e8e888bcbbe2d4aac88a1a46b5fe852279ace0ac283e6b
7
+ data.tar.gz: fcb87173fac7628e39828e5413290a11bccaab881241eaee95904f6fc0f5f64f3d20c308d8c8fe015bb8165e4da44d1af306484ae1002b491d8f66f7bb65ca66
@@ -0,0 +1,33 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ }
31
+ ] %>
32
+
33
+ <%= pb_rails("advanced_table", props: { id: "beta_table", table_data: @table_data, column_definitions: column_definitions, loading: true }) %>
@@ -0,0 +1 @@
1
+ The optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
@@ -1,3 +1,3 @@
1
- the optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
1
+ The optional `loading` prop takes a boolean value that can be managed using state. If loading is true, the table will display the loading skeleton and once loading is false, the table will render with the data provided.
2
2
 
3
- By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowCount` prop can be used to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
3
+ By default, the inital row count of the loading skeleton is set to 10. If you want more control over this initial row count, the optional `initialLoadingRowsCount` prop can be used to pass in a number. __NOTE__: This is only for the first render of the table, subsequent loading skeleton row count logic is handled within the kit itself.
@@ -0,0 +1,50 @@
1
+ import React from "react"
2
+ import { AdvancedTable } from "playbook-ui"
3
+ import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
4
+
5
+ const AdvancedTableNoSubrows = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ return (
39
+ <div>
40
+ <AdvancedTable
41
+ columnDefinitions={columnDefinitions}
42
+ enableToggleExpansion="all"
43
+ tableData={MOCK_DATA}
44
+ {...props}
45
+ />
46
+ </div>
47
+ )
48
+ }
49
+
50
+ export default AdvancedTableNoSubrows
@@ -40,6 +40,7 @@ const AdvancedTablePagination = (props) => {
40
40
  <AdvancedTable
41
41
  columnDefinitions={columnDefinitions}
42
42
  pagination
43
+ responsive="none"
43
44
  tableData={PAGINATION_MOCK_DATA}
44
45
  {...props}
45
46
  />
@@ -47,6 +47,7 @@ const AdvancedTablePaginationWithProps = (props) => {
47
47
  columnDefinitions={columnDefinitions}
48
48
  pagination
49
49
  paginationProps={paginationProps}
50
+ responsive="none"
50
51
  tableData={PAGINATION_MOCK_DATA}
51
52
  {...props}
52
53
  />
@@ -0,0 +1,38 @@
1
+
2
+ <% column_definitions = [
3
+ {
4
+ accessor: "year",
5
+ label: "Year",
6
+ cellAccessors: ["quarter", "month", "day"],
7
+ },
8
+ {
9
+ accessor: "newEnrollments",
10
+ label: "New Enrollments",
11
+ },
12
+ {
13
+ accessor: "scheduledMeetings",
14
+ label: "Scheduled Meetings",
15
+ },
16
+ {
17
+ accessor: "attendanceRate",
18
+ label: "Attendance Rate",
19
+ },
20
+ {
21
+ accessor: "completedClasses",
22
+ label: "Completed Classes",
23
+ },
24
+ {
25
+ accessor: "classCompletionRate",
26
+ label: "Class Completion Rate",
27
+ },
28
+ {
29
+ accessor: "graduatedStudents",
30
+ label: "Graduated Students",
31
+ },
32
+ ] %>
33
+
34
+ <%= pb_rails("title", props: { size: 4 }) do %> Not Responsive <% end %>
35
+ <%= pb_rails("advanced_table", props: { id: "table_props_table_non_responsive", table_data: @table_data, column_definitions: column_definitions, responsive: "none" }) %>
36
+
37
+ <%= pb_rails("title", props: { padding_top: "sm", size: 4 }) do %> Responsive as Default <% end %>
38
+ <%= pb_rails("advanced_table", props: { id: "table_props_table_responsive", table_data: @table_data, column_definitions: column_definitions }) %>
@@ -0,0 +1,60 @@
1
+ import React from "react"
2
+ import { AdvancedTable } from "playbook-ui"
3
+ import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
4
+
5
+ const AdvancedTableSelectableRows = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ //Render the subRow header rows
39
+ const subRowHeaders = ["Quarter", "Month", "Day"]
40
+
41
+
42
+ return (
43
+ <div>
44
+ <AdvancedTable
45
+ columnDefinitions={columnDefinitions}
46
+ enableToggleExpansion="all"
47
+ onRowSelectionChange={(selectedRows) => console.log(selectedRows)}
48
+ selectableRows
49
+ tableData={MOCK_DATA}
50
+
51
+ {...props}
52
+ >
53
+ <AdvancedTable.Header />
54
+ <AdvancedTable.Body subRowHeaders={subRowHeaders}/>
55
+ </AdvancedTable>
56
+ </div>
57
+ )
58
+ }
59
+
60
+ export default AdvancedTableSelectableRows
@@ -0,0 +1,5 @@
1
+ `selectableRows` is a boolean prop that if present will add checkboxes to all rows that will allow for selecting rows.
2
+
3
+ When a parent row is clicked, it will check all nested children rows, Children rows can be manually checked or unchecked as well.
4
+
5
+ The `onRowSelectionChange` prop returns an array of ids of all Rows that have been selected. Open the console on this example and check and uncheck checkboxes to see this is action! __NOTE__: Each object within the `tableData`Array must contain a unique id in order to attach an id to all Rows for this to function.
@@ -0,0 +1,78 @@
1
+ import React, {useState} from "react"
2
+ import { AdvancedTable, CircleIconButton, Flex } from "playbook-ui"
3
+ import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
4
+
5
+ const AdvancedTableSelectableRowsActions = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ const [selectedRows, setSelectedRows] = useState()
39
+
40
+ const CustomActions = () => {
41
+ const rowIds = selectedRows ? Object.keys(selectedRows) : [];
42
+
43
+ return (
44
+ <Flex>
45
+ <CircleIconButton
46
+ icon="file-csv"
47
+ onClick={() =>
48
+ alert(rowIds.length === 0 ? "No Selection Made" : `Row ids ${rowIds.join(", ")} will be exported!`)
49
+ }
50
+ variant="link"
51
+ />
52
+ <CircleIconButton
53
+ icon="trash-alt"
54
+ onClick={() =>
55
+ alert(rowIds.length === 0 ? "No Selection Made" : `Row ids ${rowIds.join(", ")} will be deleted!`)
56
+ }
57
+ variant="link"
58
+ />
59
+ </Flex>
60
+ );
61
+ };
62
+
63
+
64
+ return (
65
+ <div>
66
+ <AdvancedTable
67
+ actions={<CustomActions/>}
68
+ columnDefinitions={columnDefinitions}
69
+ onRowSelectionChange={(selected) => setSelectedRows(selected)}
70
+ selectableRows
71
+ tableData={MOCK_DATA}
72
+ {...props}
73
+ />
74
+ </div>
75
+ )
76
+ }
77
+
78
+ export default AdvancedTableSelectableRowsActions
@@ -0,0 +1 @@
1
+ Custom actions content can be rendered within the Actions Bar as shown in this doc example. The component passed to `actions` will be rendered on the right of the actionsBar. The `onRowSelectionChange` can then be used to attach the needed click events to those actions.
@@ -0,0 +1,53 @@
1
+ import React from "react"
2
+ import { AdvancedTable } from "playbook-ui"
3
+ import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
4
+
5
+ const AdvancedTableSelectableRowsHeader = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+
39
+ return (
40
+ <div>
41
+ <AdvancedTable
42
+ columnDefinitions={columnDefinitions}
43
+ onRowSelectionChange={(selectedRows) => console.log(selectedRows)}
44
+ selectableRows
45
+ showActionsBar={false}
46
+ tableData={MOCK_DATA}
47
+ {...props}
48
+ />
49
+ </div>
50
+ )
51
+ }
52
+
53
+ export default AdvancedTableSelectableRowsHeader
@@ -0,0 +1 @@
1
+ `showActionsBar` is an optional prop that renders the header at the top showing the row count. This is set to `true` by default but can be toggled off by setting it to `false`
@@ -0,0 +1,52 @@
1
+ import React from "react"
2
+ import { AdvancedTable } from "playbook-ui"
3
+ import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
4
+
5
+ const AdvancedTableSelectableRowsNoSubrows = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+
39
+ return (
40
+ <div>
41
+ <AdvancedTable
42
+ columnDefinitions={columnDefinitions}
43
+ onRowSelectionChange={(selectedRows) => console.log(selectedRows)}
44
+ selectableRows
45
+ tableData={MOCK_DATA}
46
+ {...props}
47
+ />
48
+ </div>
49
+ )
50
+ }
51
+
52
+ export default AdvancedTableSelectableRowsNoSubrows
@@ -0,0 +1 @@
1
+ `selectableRows` can also be used with tables without nested row data.
@@ -1,3 +1,3 @@
1
- `sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
1
+ `sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
2
2
 
3
- The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort directino is `desc: true`.
3
+ The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort direction is `desc: true`.
@@ -44,6 +44,7 @@ const AdvancedTableTableProps = (props) => {
44
44
  <div>
45
45
  <AdvancedTable
46
46
  columnDefinitions={columnDefinitions}
47
+ responsive="none"
47
48
  tableData={MOCK_DATA}
48
49
  tableProps={tableProps}
49
50
  {...props}
@@ -1 +1,3 @@
1
- This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `tableProps` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table/react).
1
+ This kit uses the [Table kit](https://playbook.powerapp.cloud/kits/table/react) under the hood which comes with it's own set of props. If you want to apply certain Table props to that underlying kit, you can do so by using the optional `tableProps` prop. This prop must be an object that contains valid Table props. For a full list of Table props, see [here](https://playbook.powerapp.cloud/kits/table/react).
2
+
3
+ This doc example showcases how to set a sticky header for a nonresponsive table. To achieve sticky header AND responsive functionality, see the ["Table Props Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table/react#table-props-sticky-header) doc example below.
@@ -0,0 +1,55 @@
1
+ import React from "react"
2
+ import { AdvancedTable } from "playbook-ui"
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
4
+
5
+ const AdvancedTableTablePropsStickyHeader = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ const tableProps = {
39
+ sticky: true
40
+ }
41
+
42
+ return (
43
+ <div>
44
+ <AdvancedTable
45
+ columnDefinitions={columnDefinitions}
46
+ maxHeight="xs"
47
+ tableData={MOCK_DATA}
48
+ tableProps={tableProps}
49
+ {...props}
50
+ />
51
+ </div>
52
+ )
53
+ }
54
+
55
+ export default AdvancedTableTablePropsStickyHeader
@@ -0,0 +1,3 @@
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop. This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
2
+
3
+ A sticky header on a nonresponsive table is demonstrated in the ["Table Props"](https://playbook.powerapp.cloud/kits/advanced_table/react#table-props) doc example above.
@@ -0,0 +1,42 @@
1
+ [
2
+ {
3
+ "year": "2021",
4
+ "id": "1",
5
+ "newEnrollments": "20",
6
+ "scheduledMeetings": "10",
7
+ "attendanceRate": "51%",
8
+ "completedClasses": "3",
9
+ "classCompletionRate": "33%",
10
+ "graduatedStudents": "19"
11
+ },
12
+ {
13
+ "year": "2022",
14
+ "id": "8",
15
+ "newEnrollments": "25",
16
+ "scheduledMeetings": "17",
17
+ "attendanceRate": "75%",
18
+ "completedClasses": "5",
19
+ "classCompletionRate": "45%",
20
+ "graduatedStudents": "32"
21
+ },
22
+ {
23
+ "year": "2023",
24
+ "id": "15",
25
+ "newEnrollments": "10",
26
+ "scheduledMeetings": "15",
27
+ "attendanceRate": "65%",
28
+ "completedClasses": "4",
29
+ "classCompletionRate": "49%",
30
+ "graduatedStudents": "29"
31
+ },
32
+ {
33
+ "year": "2024",
34
+ "id": "14",
35
+ "newEnrollments": "15",
36
+ "scheduledMeetings": "34",
37
+ "attendanceRate": "32%",
38
+ "completedClasses": "6",
39
+ "classCompletionRate": "67%",
40
+ "graduatedStudents": "65"
41
+ }
42
+ ]