playbook_ui_docs 14.23.0 → 14.24.0.pre.alpha.PLAY2116datepickercursorfix9610

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 (110) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +43 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +64 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +60 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +3 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.jsx +57 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.md +1 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.html.erb +46 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +7 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header_rails.html.erb +1 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.jsx +55 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.md +6 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.jsx +80 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.md +1 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +1 -1
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +107 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.md +1 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.html.erb +51 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.md +1 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +9 -0
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +6 -0
  23. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +1 -1
  24. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +1 -1
  25. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +2 -1
  26. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +1 -1
  27. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.html.erb +24 -0
  28. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.md +3 -0
  29. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +1 -0
  30. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
  31. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
  32. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
  33. data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
  34. data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
  35. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.jsx +1 -0
  37. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options.jsx +90 -0
  38. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +4 -0
  39. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +1 -0
  40. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +1 -1
  41. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +3 -2
  42. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  43. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.html.erb +22 -0
  44. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.jsx +43 -0
  45. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.md +1 -0
  46. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  47. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  48. data/app/pb_kits/playbook/pb_gauge/docs/_description.md +1 -0
  49. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +32 -15
  50. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +2 -0
  51. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +35 -9
  52. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +1 -0
  53. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +26 -14
  54. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +32 -15
  55. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +45 -17
  56. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +59 -22
  57. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +40 -9
  58. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +50 -18
  59. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +31 -18
  60. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +34 -17
  61. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +64 -23
  62. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +1 -0
  63. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -1
  64. data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -1
  65. data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +1 -3
  66. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +36 -17
  67. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +3 -0
  68. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +31 -16
  69. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +63 -31
  70. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +3 -0
  71. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +35 -16
  72. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +41 -16
  73. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +107 -62
  74. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +4 -7
  75. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
  76. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
  77. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.html.erb +75 -0
  78. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.jsx +94 -0
  79. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_show_checked_children.md +3 -0
  80. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -1
  81. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_rails.md +3 -1
  82. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_react.md +3 -1
  83. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +112 -0
  84. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +3 -0
  85. data/app/pb_kits/playbook/pb_pagination/docs/example.yml +1 -0
  86. data/app/pb_kits/playbook/pb_pagination/docs/index.js +1 -0
  87. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.html.erb +10 -0
  88. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.jsx +26 -0
  89. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.md +3 -0
  90. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
  91. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  92. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +1 -0
  93. data/dist/playbook-doc.js +2 -2
  94. metadata +46 -18
  95. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +0 -30
  96. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +0 -1
  97. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
  98. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
  99. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_continuous.jsx +0 -69
  100. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_default.jsx +0 -71
  101. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_multi_beacon.jsx +0 -110
  102. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_beacon.jsx +0 -76
  103. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_overlay.jsx +0 -76
  104. data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_styled.jsx +0 -76
  105. data/app/pb_kits/playbook/pb_walkthrough/docs/example.yml +0 -10
  106. data/app/pb_kits/playbook/pb_walkthrough/docs/index.js +0 -6
  107. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_row_styling.md → _advanced_table_row_styling_react.md} +0 -0
  108. /data/app/pb_kits/playbook/pb_gauge/docs/{_gauge_colors.md → _gauge_colors_rails.md} +0 -0
  109. /data/app/pb_kits/playbook/pb_gauge/docs/{_gauge_complex.md → _gauge_complex_rails.md} +0 -0
  110. /data/app/pb_kits/playbook/pb_line_graph/docs/{_line_graph_colors.md → _line_graph_colors_rails.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d28108345083b5bb0083369d7668364f699bb2a6ec6f047603a9e06366e2e337
4
- data.tar.gz: d7a3004f9cff82f33a7cbcdb44ec881a577199f270264bf962b7ceb686f0adc0
3
+ metadata.gz: 5478929830790fd8eb42d8bfcce964f964924308494d7fcc1a29b44dfbfad422
4
+ data.tar.gz: fdfb695bbd6ae33adcfba6ddb4ea1c82bdd3bd6ba04126b21992cf338c89a902
5
5
  SHA512:
6
- metadata.gz: e6d3157b2d294b6f84894fa24f9d803222c38df20a8af76920e1ee18f782f7a97383d0587e88e3a627eea4987e9db286b040ffed512ef1e32874d5e471040c4b
7
- data.tar.gz: b62b6090d9262bee0d96f10e190bc891ca550e3f687561329a571e2ed6cd87f98a1a7cceebbd77c7c7392dbddb52f605b2c884507d97a83956278c99bb9f37f1
6
+ metadata.gz: 2c4a25a2640939f528097cd99db9378d91dddd8f6548cbfe62b698b834ed3e5739169960cabd0f8aecf513a42256db93bf18676921aab07b25f4b5a8aa1862bd
7
+ data.tar.gz: 43daa3977228908e9b89a1fa40502434cdb95e12988c7ba63309ec2b9041ed1b4c57cc2e0f3ba47351b15489895190bc073fb4794e9d2c90723a3d7d81c2bd34
@@ -0,0 +1,43 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ label: "Enrollment Data",
9
+ columns: [
10
+ {
11
+ accessor: "newEnrollments",
12
+ label: "New Enrollments",
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ ],
19
+ },
20
+ {
21
+ label: "Performance Data",
22
+ columns: [
23
+ {
24
+ accessor: "attendanceRate",
25
+ label: "Attendance Rate",
26
+ },
27
+ {
28
+ accessor: "completedClasses",
29
+ label: "Completed Classes",
30
+ },
31
+ {
32
+ accessor: "classCompletionRate",
33
+ label: "Class Completion Rate",
34
+ },
35
+ {
36
+ accessor: "graduatedStudents",
37
+ label: "Graduated Students",
38
+ },
39
+ ],
40
+ },
41
+ ] %>
42
+
43
+ <%= pb_rails("advanced_table", props: { id: "table_multi_headers_vertical_borders", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true } }) %>
@@ -0,0 +1,64 @@
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 AdvancedTableColumnHeadersVerticalBorder = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ label: "Enrollment Data",
14
+ columns: [
15
+ {
16
+ accessor: "newEnrollments",
17
+ label: "New Enrollments",
18
+ },
19
+ {
20
+ accessor: "scheduledMeetings",
21
+ label: "Scheduled Meetings",
22
+ },
23
+ ],
24
+ },
25
+ {
26
+ label: "Performance Data",
27
+ columns: [
28
+ {
29
+ accessor: "attendanceRate",
30
+ label: "Attendance Rate",
31
+ },
32
+ {
33
+ accessor: "completedClasses",
34
+ label: "Completed Classes",
35
+ },
36
+ {
37
+ accessor: "classCompletionRate",
38
+ label: "Class Completion Rate",
39
+ },
40
+ {
41
+ accessor: "graduatedStudents",
42
+ label: "Graduated Students",
43
+ },
44
+ ],
45
+ },
46
+ ];
47
+
48
+ const tableProps = {
49
+ verticalBorder: true
50
+ }
51
+
52
+ return (
53
+ <>
54
+ <AdvancedTable
55
+ columnDefinitions={columnDefinitions}
56
+ tableData={MOCK_DATA}
57
+ tableProps={tableProps}
58
+ {...props}
59
+ />
60
+ </>
61
+ )
62
+ }
63
+
64
+ export default AdvancedTableColumnHeadersVerticalBorder
@@ -0,0 +1,60 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import Background from '../../pb_background/_background'
4
+ import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
5
+
6
+ const AdvancedTablePaddingControl = (props) => {
7
+ const columnDefinitions = [
8
+ {
9
+ accessor: "year",
10
+ label: "Year",
11
+ cellAccessors: ["quarter", "month", "day"],
12
+ },
13
+ {
14
+ accessor: "newEnrollments",
15
+ label: "New Enrollments",
16
+ columnStyling:{cellPadding: "none"},
17
+ customRenderer: (row, value) => (
18
+ <Background
19
+ backgroundColor={row.original.newEnrollments > 20 ? "success_secondary" : "warning_secondary"}
20
+ padding="xs"
21
+ >
22
+ {value}
23
+ </Background>
24
+ ),
25
+
26
+ },
27
+ {
28
+ accessor: "scheduledMeetings",
29
+ label: "Scheduled Meetings",
30
+ },
31
+ {
32
+ accessor: "attendanceRate",
33
+ label: "Attendance Rate",
34
+ },
35
+ {
36
+ accessor: "completedClasses",
37
+ label: "Completed Classes",
38
+ },
39
+ {
40
+ accessor: "classCompletionRate",
41
+ label: "Class Completion Rate",
42
+ },
43
+ {
44
+ accessor: "graduatedStudents",
45
+ label: "Graduated Students",
46
+ },
47
+ ]
48
+
49
+ return (
50
+ <div>
51
+ <AdvancedTable
52
+ columnDefinitions={columnDefinitions}
53
+ tableData={MOCK_DATA}
54
+ {...props}
55
+ />
56
+ </div>
57
+ )
58
+ }
59
+
60
+ export default AdvancedTablePaddingControl
@@ -0,0 +1,3 @@
1
+ `columnStyling` can also be used to control padding on all cells in a given column via the use of the `cellPadding` key/value pair. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
2
+
3
+ This control can be used in conjunction with the `customRenderer` item within each columnDefinition to achieve custom background colors for individual cells as seen here.
@@ -0,0 +1,57 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
4
+
5
+ const AdvancedTablePaddingControlPerRow = (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 rowStyling = [
39
+ {
40
+ rowId: "1",
41
+ cellPadding:"md"
42
+ },
43
+ ];
44
+
45
+ return (
46
+ <div>
47
+ <AdvancedTable
48
+ columnDefinitions={columnDefinitions}
49
+ rowStyling={rowStyling}
50
+ tableData={MOCK_DATA}
51
+ {...props}
52
+ />
53
+ </div>
54
+ )
55
+ }
56
+
57
+ export default AdvancedTablePaddingControlPerRow
@@ -0,0 +1 @@
1
+ `rowStyling` can also be used to control padding on all cells in a given row via the use of the `cellPadding` key/value pair as shown here. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
@@ -0,0 +1,46 @@
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
+ <% row_styling = [
34
+ {
35
+ row_id: "1",
36
+ background_color: "#F9BB00",
37
+ },
38
+ {
39
+ row_id: "8",
40
+ background_color: "#0056CF",
41
+ font_color: "white",
42
+ expand_button_color: "white",
43
+ },
44
+ ] %>
45
+
46
+ <%= pb_rails("advanced_table", props: { id: "row-styling", table_data: @table_data_with_id, column_definitions: column_definitions, row_styling: row_styling }) %>
@@ -0,0 +1,7 @@
1
+ The `row_styling` prop can be used in conjunction with row ids to control certain styling options on individual rows. Currently, `row_styling` gives you 3 optional controls:
2
+
3
+ - `background_color` : use this to control the background color of the row
4
+ - `font_color`: use this to control font color for each row if needed, for example if using a darker background color.
5
+ - `expand_button_color`: use this to control the color of the expand icon if needed, for example if using a darker background color.
6
+
7
+ **NOTE:** Each object within the `table_data` Array must contain a unique id in order to attach an id to all Rows for this to function.
@@ -31,7 +31,7 @@
31
31
  ] %>
32
32
 
33
33
  <%= pb_rails("advanced_table", props: {
34
- id: "selectable_rows_with_actions",
34
+ id: "selectable_rows_with_header_no_action_bar",
35
35
  table_data: @table_data_no_subrows,
36
36
  column_definitions: column_definitions,
37
37
  selectable_rows: true,
@@ -34,6 +34,6 @@
34
34
  %>
35
35
 
36
36
  <%= pb_rails("advanced_table", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, selectable_rows: true }) do %>
37
- <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions, selectable_rows: true }) %>
37
+ <%= pb_rails("advanced_table/table_header", props: { id: "selectable_rows", column_definitions: column_definitions, selectable_rows: true }) %>
38
38
  <%= pb_rails("advanced_table/table_body", props: { id: "selectable_rows", table_data: @table_data_with_id, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all", selectable_rows: true }) %>
39
39
  <% end %>
@@ -0,0 +1,55 @@
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 AdvancedTableSortPerColumn = (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
+ enableSort: true,
16
+ },
17
+ {
18
+ accessor: "scheduledMeetings",
19
+ label: "Scheduled Meetings",
20
+ },
21
+ {
22
+ accessor: "attendanceRate",
23
+ label: "Attendance Rate",
24
+ enableSort: true,
25
+ },
26
+ {
27
+ accessor: "completedClasses",
28
+ label: "Completed Classes",
29
+ },
30
+ {
31
+ accessor: "classCompletionRate",
32
+ label: "Class Completion Rate",
33
+ },
34
+ {
35
+ accessor: "graduatedStudents",
36
+ label: "Graduated Students",
37
+ },
38
+ ]
39
+
40
+ return (
41
+ <div>
42
+ <AdvancedTable
43
+ columnDefinitions={columnDefinitions}
44
+ enableSortingRemoval
45
+ tableData={MOCK_DATA}
46
+ {...props}
47
+ >
48
+ <AdvancedTable.Header />
49
+ <AdvancedTable.Body />
50
+ </AdvancedTable>
51
+ </div>
52
+ )
53
+ }
54
+
55
+ export default AdvancedTableSortPerColumn;
@@ -0,0 +1,6 @@
1
+ Sorting can now be enabled on any of the columns. To do this, add `enableSort:true` to the columnDefinition of the column you want sorting enabled on. Once enabled, clicking on the header will toggle sort between ascending and descending.
2
+
3
+ The optional `enableSortingRemoval` prop can also be used in conjunction with sorting functionality. This prop is set to 'false' by default but if set to 'true' sorting order will circle like: 'none' -> 'desc' -> 'asc' -> 'none' -> ...
4
+ It is recommended that `enableSortingRemoval` be set to 'true' when sort is enabled on mutiple columns so that sorting direction is always clear via the sort icon.
5
+
6
+ __NOTE:__ For sort on the first column, continue to use the separate `enableSorting` prop on AdvancedTable.Header as [shown here](https://playbook.powerapp.cloud/kits/advanced_table/sorting/react#enable-sorting).
@@ -0,0 +1,80 @@
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 AdvancedTableSortPerColumnForMultiColumn = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ label: "Enrollment Data",
14
+ columns: [
15
+ {
16
+ label: "Enrollment Stats",
17
+ columns: [
18
+ {
19
+ accessor: "newEnrollments",
20
+ label: "New Enrollments",
21
+ enableSort: true,
22
+ },
23
+ {
24
+ accessor: "scheduledMeetings",
25
+ label: "Scheduled Meetings",
26
+ },
27
+ ],
28
+ },
29
+ ],
30
+ },
31
+ {
32
+ label: "Performance Data",
33
+ columns: [
34
+ {
35
+ label: "Completion Metrics",
36
+ columns: [
37
+ {
38
+ accessor: "completedClasses",
39
+ label: "Completed Classes",
40
+ enableSort: true,
41
+ },
42
+ {
43
+ accessor: "classCompletionRate",
44
+ label: "Class Completion Rate",
45
+ },
46
+ ],
47
+ },
48
+ {
49
+ label: "Attendance",
50
+ columns: [
51
+ {
52
+ accessor: "attendanceRate",
53
+ label: "Attendance Rate",
54
+ },
55
+ {
56
+ accessor: "scheduledMeetings",
57
+ label: "Scheduled Meetings",
58
+ },
59
+ ],
60
+ },
61
+ ],
62
+ },
63
+ ];
64
+
65
+ return (
66
+ <div>
67
+ <AdvancedTable
68
+ columnDefinitions={columnDefinitions}
69
+ enableSortingRemoval
70
+ tableData={MOCK_DATA}
71
+ {...props}
72
+ >
73
+ <AdvancedTable.Header enableSorting />
74
+ <AdvancedTable.Body />
75
+ </AdvancedTable>
76
+ </div>
77
+ )
78
+ }
79
+
80
+ export default AdvancedTableSortPerColumnForMultiColumn;
@@ -0,0 +1 @@
1
+ Sorting on columns can also be applied to columns when using the multi-header variant, however in this case sorting can only be set on leaf columns NOT on parent columns.
@@ -1 +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.
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.
@@ -0,0 +1,107 @@
1
+ import React from "react"
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"
7
+ import MOCK_DATA from "./advanced_table_mock_data.json"
8
+
9
+ const AdvancedTableWithCustomHeaderMultiHeader = (props) => {
10
+
11
+ const columnDefinitions = [
12
+ {
13
+ accessor: "year",
14
+ label: "Year",
15
+ id: "year",
16
+ cellAccessors: ["quarter", "month", "day"],
17
+ },
18
+ {
19
+ label: "Enrollment Data",
20
+ id: "enrollmentData",
21
+ header: () => (
22
+ <Flex alignItems="center"
23
+ justifyContent="center"
24
+ >
25
+ <Caption marginRight="xs">Enrollments Data</Caption>
26
+ <Tooltip placement="top"
27
+ text="Whoa. I'm a Tooltip"
28
+ zIndex={10}
29
+ >
30
+ <Icon cursor="pointer"
31
+ icon="info"
32
+ size="xs"
33
+ />
34
+ </Tooltip>
35
+ </Flex>
36
+ ),
37
+ columns: [
38
+ {
39
+ label: "Enrollment Stats",
40
+ id: "enrollmentStats",
41
+ columns: [
42
+ {
43
+ accessor: "newEnrollments",
44
+ id: "newEnrollments",
45
+ label: "New Enrollments",
46
+ },
47
+ {
48
+ accessor: "scheduledMeetings",
49
+ id: "scheduledMeetings",
50
+ label: "Scheduled Meetings",
51
+ },
52
+ ],
53
+ },
54
+ ],
55
+ },
56
+ {
57
+ label: "Performance Data",
58
+ id: "performanceData",
59
+ columns: [
60
+ {
61
+ label: "Completion Metrics",
62
+ id: "completionMetrics",
63
+ columns: [
64
+ {
65
+ accessor: "completedClasses",
66
+ label: "Completed Classes",
67
+ id: "completedClasses",
68
+ },
69
+ {
70
+ accessor: "classCompletionRate",
71
+ label: "Class Completion Rate",
72
+ id: "classCompletionRate",
73
+ },
74
+ ],
75
+ },
76
+ {
77
+ label: "Attendance",
78
+ id: "attendance",
79
+ columns: [
80
+ {
81
+ accessor: "attendanceRate",
82
+ label: "Attendance Rate",
83
+ id: "attendanceRate",
84
+ },
85
+ {
86
+ accessor: "scheduledMeetings",
87
+ label: "Scheduled Meetings",
88
+ id: "scheduledMeetings",
89
+ },
90
+ ],
91
+ },
92
+ ],
93
+ },
94
+ ];
95
+
96
+ return (
97
+ <div>
98
+ <AdvancedTable
99
+ columnDefinitions={columnDefinitions}
100
+ tableData={MOCK_DATA}
101
+ {...props}
102
+ />
103
+ </div>
104
+ )
105
+ }
106
+
107
+ export default AdvancedTableWithCustomHeaderMultiHeader;
@@ -0,0 +1 @@
1
+ The optional `header` key/value pair within `columnDefinitions` can also be used with multi headers as seen here.
@@ -0,0 +1,51 @@
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
+ header: ->(cell, label) {
12
+ capture do
13
+ pb_rails("flex", props: { align_items: "center", justify_content: "center" }) do
14
+ pb_rails("caption", props: { margin_right: "xs", text: "New Enrollments" }) +
15
+ pb_rails("icon", props: { id: "tooltip-interact", icon: "info", size: "xs" }) +
16
+ pb_rails("tooltip", props: {
17
+ trigger_element_id: "tooltip-interact",
18
+ tooltip_id: "example-custom-tooltip",
19
+ position: "top",
20
+ z_index: "10"
21
+ }) do
22
+ "Whoa. I'm a Tooltip"
23
+ end
24
+ end
25
+ end
26
+ }
27
+ },
28
+ {
29
+ accessor: "scheduledMeetings",
30
+ label: "Scheduled Meetings",
31
+ },
32
+ {
33
+ accessor: "attendanceRate",
34
+ label: "Attendance Rate",
35
+ },
36
+ {
37
+ accessor: "completedClasses",
38
+ label: "Completed Classes",
39
+ },
40
+ {
41
+ accessor: "classCompletionRate",
42
+ label: "Class Completion Rate",
43
+ },
44
+ {
45
+ accessor: "graduatedStudents",
46
+ label: "Graduated Students",
47
+ }
48
+ ]
49
+ %>
50
+
51
+ <%= pb_rails("advanced_table", props: { id: "custom_header_table", table_data: @table_data, column_definitions: column_definitions }) %>
@@ -0,0 +1 @@
1
+ The optional `header` item can be used within `column_definitions` to render a custom header. This example shows an Icon and Tooltip being used but other kits can be used as well.