playbook_ui 14.16.0.pre.rc.6 → 14.17.0.pre.alpha.PBNTR766tablenestedcollapsiblerowsborderdoubling7192

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 (185) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts +1 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +104 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +168 -85
  5. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
  6. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +10 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +20 -7
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +90 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +3 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.html.erb +39 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.html.erb +33 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +6 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
  17. data/app/pb_kits/playbook/pb_advanced_table/index.js +1 -1
  18. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
  19. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +19 -9
  20. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +38 -1
  21. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +49 -37
  22. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +39 -0
  23. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -1
  24. data/app/pb_kits/playbook/pb_button/_button.scss +5 -5
  25. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
  26. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +14 -7
  27. data/app/pb_kits/playbook/pb_contact/contact.test.js +7 -7
  28. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +34 -34
  29. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -2
  30. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +16 -0
  31. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +0 -11
  32. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx +0 -7
  33. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +28 -24
  34. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +2 -2
  35. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.test.js +1 -1
  36. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +138 -5
  37. data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +6 -4
  38. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +91 -24
  39. data/app/pb_kits/playbook/pb_draggable/context/types.ts +35 -28
  40. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +181 -0
  41. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +5 -0
  42. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +99 -0
  43. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -0
  44. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +110 -0
  45. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +5 -0
  46. data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_react.jsx → _draggable_with_table.jsx} +1 -1
  47. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +3 -1
  48. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -6
  49. data/app/pb_kits/playbook/pb_draggable/docs/index.js +4 -1
  50. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +71 -3
  51. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +12 -2
  52. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +65 -6
  53. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +3 -0
  54. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -0
  55. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
  56. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
  57. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
  58. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
  59. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +3 -3
  60. data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +3 -4
  61. data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +2 -2
  62. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +2 -2
  63. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +67 -0
  64. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +67 -0
  65. data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -1
  66. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +22 -0
  67. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
  68. data/app/pb_kits/playbook/pb_icon/_icon.scss +8 -1
  69. data/app/pb_kits/playbook/pb_icon/docs/_icon_color.html.erb +10 -4
  70. data/app/pb_kits/playbook/pb_icon/docs/_icon_color.jsx +49 -24
  71. data/app/pb_kits/playbook/pb_icon/icon.test.js +9 -9
  72. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +4 -1
  73. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_click.jsx +13 -0
  74. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +1 -0
  75. data/app/pb_kits/playbook/pb_icon_button/docs/index.js +1 -0
  76. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.test.js +1 -1
  77. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +1 -1
  78. data/app/pb_kits/playbook/pb_icon_value/icon_value.test.js +1 -1
  79. data/app/pb_kits/playbook/pb_label_value/label_value.test.js +1 -1
  80. data/app/pb_kits/playbook/pb_layout/_layout.scss +58 -0
  81. data/app/pb_kits/playbook/pb_layout/_layout.tsx +20 -7
  82. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +190 -0
  83. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +5 -0
  84. data/app/pb_kits/playbook/pb_layout/docs/example.yml +1 -0
  85. data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
  86. data/app/pb_kits/playbook/pb_layout/layout.test.js +4 -0
  87. data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +90 -0
  88. data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +57 -0
  89. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.tsx +1 -1
  90. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +1 -1
  91. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.tsx +1 -1
  92. data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +1 -1
  93. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
  94. data/app/pb_kits/playbook/pb_link/link.test.jsx +2 -2
  95. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +23 -0
  96. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +28 -1
  97. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.html.erb +72 -0
  98. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.jsx +97 -0
  99. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb +71 -0
  100. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx +91 -0
  101. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +4 -0
  102. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +3 -1
  103. data/app/pb_kits/playbook/pb_multi_level_select/index.js +105 -0
  104. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +10 -0
  105. data/app/pb_kits/playbook/pb_nav/_nav.scss +5 -0
  106. data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +5 -3
  107. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +29 -11
  108. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -1
  109. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +4 -4
  110. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +2 -0
  111. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +1 -0
  112. data/app/pb_kits/playbook/pb_stat_change/stat_change.test.js +8 -4
  113. data/app/pb_kits/playbook/pb_table/_table.tsx +4 -0
  114. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.jsx +50 -0
  115. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_react.md +1 -0
  116. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.jsx +59 -0
  117. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -0
  118. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  119. data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
  120. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +24 -0
  121. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +76 -0
  122. data/app/pb_kits/playbook/pb_table/styles/_striped.scss +3 -3
  123. data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +11 -1
  124. data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +11 -1
  125. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +5 -0
  126. data/app/pb_kits/playbook/pb_table/table.test.js +17 -0
  127. data/app/pb_kits/playbook/pb_tooltip/index.js +183 -56
  128. data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +2 -5
  129. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
  130. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
  131. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -0
  132. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.html.erb +19 -0
  133. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.jsx +23 -0
  134. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
  135. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  136. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  137. data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -2
  138. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
  139. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +3 -0
  140. data/app/pb_kits/playbook/pb_user/_user.tsx +78 -13
  141. data/app/pb_kits/playbook/pb_user/docs/_user_font_options.html.erb +22 -0
  142. data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +40 -0
  143. data/app/pb_kits/playbook/pb_user/docs/_user_font_options_rails.md +5 -0
  144. data/app/pb_kits/playbook/pb_user/docs/_user_font_options_react.md +5 -0
  145. data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
  146. data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
  147. data/app/pb_kits/playbook/pb_user/user.html.erb +28 -12
  148. data/app/pb_kits/playbook/pb_user/user.rb +17 -1
  149. data/app/pb_kits/playbook/pb_user/user.test.js +182 -1
  150. data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -6
  151. data/app/pb_kits/playbook/tokens/_colors.scss +1 -4
  152. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
  153. data/app/pb_kits/playbook/utilities/object.test.js +287 -1
  154. data/app/pb_kits/playbook/utilities/object.ts +171 -3
  155. data/app/pb_kits/playbook/utilities/text.ts +1 -1
  156. data/dist/chunks/_typeahead-HqfDnjRe.js +22 -0
  157. data/dist/chunks/_weekday_stacked-DVQITtQ9.js +45 -0
  158. data/dist/chunks/lib-BGzBzFZX.js +29 -0
  159. data/dist/chunks/{pb_form_validation-BvDxpfs-.js → pb_form_validation-BvNy9Bd6.js} +1 -1
  160. data/dist/chunks/vendor.js +1 -1
  161. data/dist/playbook-doc.js +1 -1
  162. data/dist/playbook-rails-react-bindings.js +1 -1
  163. data/dist/playbook-rails.js +1 -1
  164. data/dist/playbook.css +1 -1
  165. data/lib/playbook/forms/builder/multi_level_select_field.rb +2 -0
  166. data/lib/playbook/kit_base.rb +4 -4
  167. data/lib/playbook/version.rb +2 -2
  168. metadata +53 -21
  169. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  170. data/dist/chunks/_typeahead-CRAPc8k-.js +0 -22
  171. data/dist/chunks/_weekday_stacked-T0kFfioG.js +0 -45
  172. data/dist/chunks/lib-BeKPJYlk.js +0 -29
  173. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows.md → _advanced_table_selectable_rows_no_subrows_react.md} +0 -0
  174. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
  175. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_rails.html.erb → _draggable_default.html.erb} +0 -0
  176. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.md → _draggable_default_react.md} +0 -0
  177. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_rails.html.erb → _draggable_multiple_containers.html.erb} +0 -0
  178. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.md → _draggable_multiple_containers_react.md} +0 -0
  179. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_rails.html.erb → _draggable_with_cards.html.erb} +0 -0
  180. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.md → _draggable_with_cards_react.md} +0 -0
  181. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_rails.html.erb → _draggable_with_list.html.erb} +0 -0
  182. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.md → _draggable_with_list_react.md} +0 -0
  183. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_rails.html.erb → _draggable_with_selectable_list.html.erb} +0 -0
  184. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.md → _draggable_with_selectable_list_react.md} +0 -0
  185. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.md → _draggable_with_table_rails.md} +0 -0
@@ -0,0 +1,39 @@
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
+ subrow_headers = ["Quarter", "Month", "Day"]
34
+ %>
35
+
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 }) %>
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
+ <% end %>
@@ -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: "selectable_rows_no_subrows", table_data: @table_data_no_subrows, column_definitions: column_definitions, selectable_rows: true, enable_toggle_expansion: "none", }) %>
@@ -0,0 +1 @@
1
+ `selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
@@ -0,0 +1,6 @@
1
+ `selectable_rows` 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
+ __ALERT TO DEVS__: UPDATE THIS PARAGRAPH IN THE FOLLOW UP STORY WHEN CHECKBOX FUNCTIONALITY IS SET PLEASE
6
+ 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.
@@ -11,6 +11,8 @@ examples:
11
11
  - advanced_table_custom_cell_rails: Custom Components for Cells
12
12
  - advanced_table_column_headers: Multi-Header Columns
13
13
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
14
+ # - advanced_table_selectable_rows: Selectable Rows
15
+ # - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
14
16
 
15
17
 
16
18
  react:
@@ -37,4 +39,5 @@ examples:
37
39
  - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
38
40
  - advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
39
41
  - advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
40
- - advanced_table_inline_editing: Inline Cell Editing
42
+ - advanced_table_inline_editing: Inline Cell Editing
43
+ - advanced_table_fullscreen: Fullscreen
@@ -21,4 +21,5 @@ export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_
21
21
  export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
22
22
  export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
23
23
  export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
24
- export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
24
+ export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
25
+ export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
@@ -231,4 +231,4 @@ window.expandAllRows = (element) => {
231
231
 
232
232
  window.expandAllSubRows = (element, rowDepth) => {
233
233
  PbAdvancedTable.handleToggleAllSubRows(element, rowDepth);
234
- };
234
+ };
@@ -21,6 +21,8 @@ module Playbook
21
21
  prop :responsive, type: Playbook::Props::Enum,
22
22
  values: %w[none scroll],
23
23
  default: "scroll"
24
+ prop :selectable_rows, type: Playbook::Props::Boolean,
25
+ default: false
24
26
 
25
27
  def flatten_columns(columns)
26
28
  columns.flat_map do |col|
@@ -56,7 +58,7 @@ module Playbook
56
58
  current_data_attributes = current_depth.zero? ? { row_depth: 0 } : table_data_attributes
57
59
 
58
60
  # Additional class and data attributes needed for toggle logic
59
- output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes, responsive: responsive, loading: loading })
61
+ output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: leaf_columns, depth: current_depth, collapsible_trail: collapsible_trail, classname: additional_classes, table_data_attributes: current_data_attributes, responsive: responsive, loading: loading, selectable_rows: selectable_rows, row_id: row[:id], enable_toggle_expansion: enable_toggle_expansion })
60
62
 
61
63
  if row[:children].present?
62
64
  row[:children].each do |child_row|
@@ -81,7 +83,7 @@ module Playbook
81
83
  def classname
82
84
  additional_classes = []
83
85
  additional_classes << "advanced-table-responsive-#{responsive} pinned-left" if responsive == "scroll"
84
-
86
+ additional_classes << "selectable-rows-enabled" if selectable_rows && enable_toggle_expansion == "none"
85
87
  generate_classname("pb_advanced_table_body", *additional_classes, separator: " ")
86
88
  end
87
89
 
@@ -1,19 +1,29 @@
1
1
  <%= pb_content_tag(:thead) do %>
2
2
  <% object.header_rows.each_with_index do |header_row, row_index| %>
3
3
  <%= pb_rails("table/table_row") do %>
4
+ <% if row_index == 0 && object.selectable_rows && object.enable_toggle_expansion == "none" %>
5
+ <%= object.render_select_all_header %>
6
+ <% end %>
4
7
  <% header_row.each_with_index do |cell, cell_index| %>
5
8
  <% header_id = cell[:accessor].present? ? cell[:accessor] : "header_#{row_index}_#{cell_index}" %>
6
9
  <%= pb_rails("table/table_header", props: { id: header_id, colspan: cell[:colspan], classname: [object.th_classname(is_first_column: cell_index.zero?), ('last-header-cell' if cell[:is_last_in_group] && cell_index != 0)].compact.join(' '), sort_menu: cell[:accessor] ? cell[:sort_menu] : nil }) do %>
7
10
  <%= pb_rails("flex", props: { align: "center", justify: cell_index.zero? ? "start" : row_index === header_rows.size - 1 ? "end" : "center", text_align: "end" }) do %>
8
- <% if cell_index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") && row_index === header_rows.size - 1 %>
9
- <% if loading %>
10
- <div class="<%= object.loading ? 'loading-toggle-icon' : '' %>"></div>
11
- <% else %>
12
- <button
13
- class="gray-icon toggle-all-icon"
14
- onclick="expandAllRows(this); event.preventDefault();">
15
- <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
16
- </button>
11
+ <% if cell_index.zero? && row_index === header_rows.size - 1 %>
12
+ <% if object.selectable_rows && object.enable_toggle_expansion != "none" %>
13
+ <%= pb_rails("flex/flex_item", props: { padding_right: "xs" }) do %>
14
+ <%= object.render_select_all_checkbox %>
15
+ <% end %>
16
+ <% end %>
17
+ <% if object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all" %>
18
+ <% if loading %>
19
+ <div class="<%= object.loading ? 'loading-toggle-icon' : '' %>"></div>
20
+ <% else %>
21
+ <button
22
+ class="gray-icon toggle-all-icon"
23
+ onclick="expandAllRows(this); event.preventDefault();">
24
+ <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
25
+ </button>
26
+ <% end %>
17
27
  <% end %>
18
28
  <% end %>
19
29
  <%= cell[:label] %>
@@ -13,17 +13,20 @@ module Playbook
13
13
  prop :responsive, type: Playbook::Props::Enum,
14
14
  values: %w[none scroll],
15
15
  default: "scroll"
16
+ prop :selectable_rows, type: Playbook::Props::Boolean,
17
+ default: false
16
18
 
17
19
  def classname
18
20
  additional_classes = []
19
21
  additional_classes << "advanced-table-responsive-#{responsive} pinned-left" if responsive == "scroll"
22
+ additional_classes << "selectable-rows-enabled" if selectable_rows && enable_toggle_expansion == "none"
20
23
 
21
24
  generate_classname("pb_advanced_table_header", "pb_table_thead", *additional_classes, separator: " ")
22
25
  end
23
26
 
24
27
  def th_classname(is_first_column: false)
25
28
  additional_classes = []
26
- additional_classes << "pinned-left" if is_first_column && responsive == "scroll"
29
+ additional_classes << "pinned-left" if is_first_column && responsive == "scroll" && !selectable_rows
27
30
 
28
31
  generate_classname("table-header-cells", *additional_classes, separator: " ")
29
32
  end
@@ -38,6 +41,40 @@ module Playbook
38
41
  rows
39
42
  end
40
43
 
44
+ # Selectable Rows No Subrows - checkboxes in their own first cell
45
+ def render_select_all_header
46
+ if selectable_rows
47
+ additional_classes = []
48
+ additional_classes << "table-header-cells-custom"
49
+ additional_classes << "checkbox-cell-header"
50
+ additional_classes << "pinned-left" if responsive == "scroll"
51
+ pb_rails("table/table_header", props: {
52
+ classname: additional_classes.join(" "),
53
+ }) do
54
+ pb_rails("checkbox", props: {
55
+ id: "select-all-rows",
56
+ name: "select-all-rows",
57
+ data: {
58
+ action: "click->pb-advanced-table#toggleAllRowSelection",
59
+ },
60
+ })
61
+ end
62
+ end
63
+ end
64
+
65
+ # Selectable Rows w/ Subrows - checkboxes part of toggleable first cell
66
+ def render_select_all_checkbox
67
+ if selectable_rows
68
+ pb_rails("checkbox", props: {
69
+ id: "select-all-rows",
70
+ name: "select-all-rows",
71
+ data: {
72
+ action: "click->pb-advanced-table#toggleAllRowSelection",
73
+ },
74
+ })
75
+ end
76
+ end
77
+
41
78
  private
42
79
 
43
80
  def compute_max_depth(columns)
@@ -1,48 +1,60 @@
1
1
  <%= pb_content_tag(:tr) do %>
2
- <% object.column_definitions.each_with_index do |column, index| %>
3
- <% next unless column[:accessor].present? %>
4
- <%= pb_rails("table/table_cell", props: { classname:object.td_classname(column, index)}) do %>
5
- <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", classname: object.loading ? "loading-cell" : "" }) do %>
6
- <% if collapsible_trail && index.zero? %>
7
- <% (1..depth).each do |i| %>
8
- <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
9
- <% left_offset = i * 1.0 + additional_offset %>
10
- <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
11
- <% end %>
2
+ <% has_separate_checkbox = object.selectable_rows && object.enable_toggle_expansion == "none" %>
3
+ <% if has_separate_checkbox %>
4
+ <%= object.render_checkbox_cell %>
5
+ <% end %>
6
+ <% object.column_definitions.each_with_index do |column, index| %>
7
+ <% next unless column[:accessor].present? %>
8
+ <%= pb_rails("table/table_cell", props: { classname:object.td_classname(column, index)}) do %>
9
+ <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", classname: object.loading ? "loading-cell" : "" }) do %>
10
+ <% if collapsible_trail && index.zero? %>
11
+ <% (1..depth).each do |i| %>
12
+ <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
13
+ <% left_offset = i * 1.0 + additional_offset %>
14
+ <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
12
15
  <% end %>
16
+ <% end %>
13
17
 
14
- <div style="padding-left: <%= depth * 1.25 %>em">
15
- <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
16
- <% if index.zero? && object.row[:children].present? %>
17
- <button
18
- id="<%= "#{object.id}_#{object.row.object_id}" %>"
19
- class="gray-icon expand-toggle-icon"
20
- data-advanced-table="true">
21
- <%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
22
- <%= pb_rails("icon", props: { id: "advanced-table_close_icon", display: "none", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
23
- </button>
18
+ <div style="padding-left: <%= depth * 1.25 %>em">
19
+ <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
20
+ <% if index.zero? %>
21
+ <% has_integrated_checkbox = object.selectable_rows && object.enable_toggle_expansion != "none" %>
22
+ <% if has_integrated_checkbox %>
23
+ <%= pb_rails("flex/flex_item", props: { padding_right: "xs" }) do %>
24
+ <%= object.render_row_checkbox %>
25
+ <% end %>
24
26
  <% end %>
25
- <%= pb_rails("flex/flex_item", props:{padding_left: index.zero? && object.row[:children].present? ? "none" : "xs"}) do %>
26
- <% if column[:custom_renderer].present? %>
27
- <%= raw(column[:custom_renderer].call(object.row, custom_renderer_value(column, index))) %>
28
- <% elsif index.zero? %>
29
- <% if object.depth.zero? %>
30
- <%= object.row[column[:accessor].to_sym] %>
31
- <% else %>
32
- <% object.depth_accessors.each_with_index do |item, accessor_index| %>
33
- <% if object.depth - 1 == accessor_index %>
34
- <% key = item.to_sym %>
35
- <%= object.row[key] %>
36
- <% end %>
27
+ <% if object.row[:children].present? %>
28
+ <button
29
+ id="<%= "#{object.id}_#{object.row.object_id}" %>"
30
+ class="gray-icon expand-toggle-icon"
31
+ data-advanced-table="true">
32
+ <%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
33
+ <%= pb_rails("icon", props: { id: "advanced-table_close_icon", display: "none", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
34
+ </button>
35
+ <% end %>
36
+ <% end %>
37
+ <%= pb_rails("flex/flex_item", props:{padding_left: index.zero? && (object.row[:children].present? || has_integrated_checkbox) ? "none" : "xs"}) do %>
38
+ <% if column[:custom_renderer].present? %>
39
+ <%= raw(column[:custom_renderer].call(object.row, custom_renderer_value(column, index))) %>
40
+ <% elsif index.zero? %>
41
+ <% if object.depth.zero? %>
42
+ <%= object.row[column[:accessor].to_sym] %>
43
+ <% else %>
44
+ <% object.depth_accessors.each_with_index do |item, accessor_index| %>
45
+ <% if object.depth - 1 == accessor_index %>
46
+ <% key = item.to_sym %>
47
+ <%= object.row[key] %>
37
48
  <% end %>
38
49
  <% end %>
39
- <% else %>
40
- <%= object.row[column[:accessor].to_sym] %>
41
50
  <% end %>
51
+ <% else %>
52
+ <%= object.row[column[:accessor].to_sym] %>
42
53
  <% end %>
43
54
  <% end %>
44
- </div>
45
- <% end %>
55
+ <% end %>
56
+ </div>
46
57
  <% end %>
47
58
  <% end %>
48
- <% end %>
59
+ <% end %>
60
+ <% end %>
@@ -20,6 +20,13 @@ module Playbook
20
20
  default: "scroll"
21
21
  prop :is_pinned_left, type: Playbook::Props::Boolean,
22
22
  default: false
23
+ prop :selectable_rows, type: Playbook::Props::Boolean,
24
+ default: false
25
+ prop :row_id, type: Playbook::Props::String,
26
+ default: ""
27
+ prop :enable_toggle_expansion, type: Playbook::Props::Enum,
28
+ values: %w[all header none],
29
+ default: "header"
23
30
 
24
31
  def data
25
32
  Hash(prop(:data)).merge(table_data_attributes)
@@ -42,6 +49,38 @@ module Playbook
42
49
  end.compact
43
50
  end
44
51
 
52
+ # Selectable Rows No Subrows - checkboxes in their own first cell
53
+ def render_checkbox_cell
54
+ if selectable_rows
55
+ pb_rails("table/table_cell", props: {
56
+ classname: "checkbox-cell",
57
+ }) do
58
+ pb_rails("checkbox", props: {
59
+ id: "select-row-#{row_id || row.object_id}",
60
+ name: "select-row-#{row_id || row.object_id}",
61
+ data: {
62
+ row_id: row_id || row.object_id.to_s,
63
+ action: "click->pb-advanced-table#toggleRowSelection",
64
+ },
65
+ })
66
+ end
67
+ end
68
+ end
69
+
70
+ # Selectable Rows w/ Subrows - checkboxes part of toggleable first cell
71
+ def render_row_checkbox
72
+ if selectable_rows
73
+ pb_rails("checkbox", props: {
74
+ id: "select-row-#{row_id || row.object_id}",
75
+ name: "select-row-#{row_id || row.object_id}",
76
+ data: {
77
+ row_id: row_id || row.object_id.to_s,
78
+ action: "click->pb-advanced-table#toggleRowSelection",
79
+ },
80
+ })
81
+ end
82
+ end
83
+
45
84
  private
46
85
 
47
86
  def custom_renderer_value(column, index)
@@ -7,7 +7,7 @@ import Highcharts from "highcharts";
7
7
  import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
8
8
  import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
9
9
  import mapColors from "../pb_dashboard/pbChartsColorsHelper";
10
- import { merge } from 'lodash'
10
+ import { merge } from '../utilities/object'
11
11
 
12
12
  import classnames from "classnames";
13
13
 
@@ -63,11 +63,6 @@ $pb_button_sizes: (
63
63
  color: $text_lt_lighter;
64
64
  }
65
65
 
66
- // Disabled =================
67
- &[class*=_disabled] {
68
- @include pb_button_disabled;
69
- }
70
-
71
66
  // Block ====================
72
67
  &[class*=_block] {
73
68
  @include pb_button_block;
@@ -83,6 +78,11 @@ $pb_button_sizes: (
83
78
  @include pb_button_danger;
84
79
  }
85
80
 
81
+ // Disabled =================
82
+ &[class*=_disabled] {
83
+ @include pb_button_disabled;
84
+ }
85
+
86
86
  // Dark Variants =============
87
87
  &.dark {
88
88
  &[class*=_primary] {
@@ -10,7 +10,7 @@ import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
10
10
  import mapColors from "../pb_dashboard/pbChartsColorsHelper";
11
11
  import { globalProps } from "../utilities/globalProps";
12
12
  import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props";
13
- import { merge } from 'lodash'
13
+ import { merge } from '../utilities/object'
14
14
 
15
15
  type CircleChartProps = {
16
16
  align?: "left" | "right" | "center";
@@ -27,13 +27,20 @@ exports[`html structure is correct 1`] = `
27
27
  class="icon_wrapper"
28
28
  style="vertical-align: middle; color: rgb(193, 205, 214);"
29
29
  >
30
- <i
31
- class="pb_icon_kit far fa-lg fa-fw fa-lg fa-chevron-down"
32
- />
33
- <span
34
- aria-label="chevron-down icon"
35
- hidden=""
36
- />
30
+ <svg
31
+ class="pb_custom_icon svg-inline--fa svg_lg svg_fw"
32
+ color="currentColor"
33
+ fill="none"
34
+ height="auto"
35
+ viewBox="0 0 30 25"
36
+ width="auto"
37
+ xmlns="http://www.w3.org/2000/svg"
38
+ >
39
+ <path
40
+ d="M14.203 19.297l-9-9c-.469-.422-.469-1.125 0-1.594.422-.422 1.125-.422 1.594 0L15 16.953l8.203-8.203c.422-.469 1.125-.469 1.594 0a1.103 1.103 0 010 1.547l-9.047 9a1.027 1.027 0 01-1.547 0z"
41
+ fill="#242B42"
42
+ />
43
+ </svg>
37
44
  </div>
38
45
  </div>
39
46
  </div>
@@ -75,15 +75,15 @@ test('returns correct icon', () => {
75
75
  </>
76
76
  )
77
77
 
78
- expect(screen.getByTestId('test-cell').querySelector('.pb_icon_kit')).toHaveClass('fa-mobile')
79
- expect(screen.getByTestId('test-home').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
78
+ expect(screen.getByTestId('test-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
79
+ expect(screen.getByTestId('test-home').querySelector('.pb_custom_icon')).toBeInTheDocument()
80
80
  expect(screen.getByTestId('test-work').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-office')
81
- expect(screen.getByTestId('test-work-cell').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-laptop')
82
- expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).toHaveClass('envelope')
83
- expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-slash')
84
- expect(screen.getByTestId('test-wrong-type').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
81
+ expect(screen.getByTestId('test-work-cell').querySelector('.pb_custom_icon')).toBeInTheDocument()
82
+ expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).toBeInTheDocument()
83
+ expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_custom_icon')).toBeInTheDocument()
84
+ expect(screen.getByTestId('test-wrong-type').querySelector('.pb_custom_icon')).toBeInTheDocument()
85
85
  expect(screen.getByTestId('test-extension').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-plus')
86
- expect(screen.getByTestId('test-empty').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
86
+ expect(screen.getByTestId('test-empty').querySelector('.pb_custom_icon')).toBeInTheDocument()
87
87
  })
88
88
 
89
89
  test("not compliant values return null in phone related contact types", () => {
@@ -106,41 +106,41 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
106
106
  const inputAriaProps = buildAriaProps(inputAria)
107
107
  const inputDataProps = buildDataProps(inputData)
108
108
 
109
- useEffect(() => {
110
- datePickerHelper({
111
- allowInput,
112
- customQuickPickDates,
113
- defaultDate,
114
- disableDate,
115
- disableRange,
116
- disableWeekdays,
117
- enableTime,
118
- format,
119
- hideIcon,
120
- inLine,
121
- maxDate,
122
- minDate,
123
- mode,
124
- onChange,
125
- onClose,
126
- pickerId,
127
- plugins,
128
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
129
- // @ts-ignore
130
- position,
131
- positionElement,
132
- selectionType,
133
- showTimezone,
134
- staticPosition,
135
- thisRangesEndToday,
136
- yearRange,
137
- required: false,
138
- }, scrollContainer)
139
- }, initializeOnce ? [] : undefined)
109
+ useEffect(() => {
110
+ datePickerHelper({
111
+ allowInput,
112
+ customQuickPickDates,
113
+ defaultDate,
114
+ disableDate,
115
+ disableRange,
116
+ disableWeekdays,
117
+ enableTime,
118
+ format,
119
+ hideIcon,
120
+ inLine,
121
+ maxDate,
122
+ minDate,
123
+ mode,
124
+ onChange,
125
+ onClose,
126
+ pickerId,
127
+ plugins,
128
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
129
+ // @ts-ignore
130
+ position,
131
+ positionElement,
132
+ selectionType,
133
+ showTimezone,
134
+ staticPosition,
135
+ thisRangesEndToday,
136
+ yearRange,
137
+ required: false,
138
+ }, scrollContainer)
139
+ }, initializeOnce ? [] : undefined)
140
140
  const filteredProps = {...props}
141
141
  if (filteredProps.marginBottom === undefined) {
142
142
  filteredProps.marginBottom = "sm"
143
- }
143
+ }
144
144
  delete filteredProps?.position
145
145
 
146
146
  const classes = classnames(
@@ -221,7 +221,7 @@ useEffect(() => {
221
221
  {hideIcon && inLine ?
222
222
  <div>
223
223
  <div
224
- className={iconWrapperClass()}
224
+ className={`${iconWrapperClass()} date-picker-inline-icon-plus`}
225
225
  id={`${pickerId}-icon-plus`}
226
226
  >
227
227
  <Icon
@@ -230,7 +230,7 @@ useEffect(() => {
230
230
  />
231
231
  </div>
232
232
  <div
233
- className={iconWrapperClass()}
233
+ className={`${iconWrapperClass()} date-picker-inline-angle-down`}
234
234
  id={`${pickerId}-angle-down`}
235
235
  >
236
236
  <Icon
@@ -44,7 +44,7 @@
44
44
  <% if object.hide_icon && object.inline %>
45
45
  <!-- Plus Icon -->
46
46
  <div
47
- class="<%= object.icon_wrapper_class %>"
47
+ class="<%= object.icon_wrapper_class %> date-picker-inline-icon-plus"
48
48
  id="<%= object.picker_id %>-icon-plus"
49
49
  >
50
50
  <%= pb_rails("icon", props: {
@@ -55,7 +55,7 @@
55
55
 
56
56
  <!-- Angle Down Icon -->
57
57
  <div
58
- class="<%= object.icon_wrapper_class %>"
58
+ class="<%= object.icon_wrapper_class %> date-picker-inline-angle-down"
59
59
  id="<%= object.picker_id %>-angle-down"
60
60
  >
61
61
  <%= pb_rails("icon", props: {