playbook_ui 14.10.0.pre.alpha.play16825301 → 14.10.0.pre.rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +6 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +19 -32
  5. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +1 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -46
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +36 -94
  8. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -8
  10. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -2
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +3 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +1 -1
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +1 -1
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -8
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -4
  16. data/app/pb_kits/playbook/pb_advanced_table/index.js +92 -185
  17. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
  18. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +8 -57
  19. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +13 -18
  20. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -78
  21. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +3 -12
  22. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -15
  23. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +6 -10
  24. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +4 -8
  25. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -0
  26. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +9 -11
  27. data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -4
  28. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +49 -53
  29. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +36 -29
  30. data/app/pb_kits/playbook/pb_body/_body.scss +13 -14
  31. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +16 -22
  32. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -3
  33. data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +0 -6
  34. data/app/pb_kits/playbook/pb_button/_button.scss +1 -3
  35. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -2
  36. data/app/pb_kits/playbook/pb_card/_card.scss +3 -21
  37. data/app/pb_kits/playbook/pb_card/_card.tsx +7 -7
  38. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -2
  39. data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -39
  40. data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +0 -90
  41. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  42. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +2 -4
  43. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -3
  44. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -1
  45. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -1
  46. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.html.erb +0 -8
  47. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.jsx +0 -9
  48. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +4 -9
  49. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
  50. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
  51. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -3
  52. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +3 -5
  53. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -6
  54. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +2 -4
  55. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +2 -2
  56. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +8 -10
  57. data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +0 -5
  58. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +17 -31
  59. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx +1 -3
  60. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx +1 -4
  61. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_max_size.jsx +1 -1
  62. data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +2 -8
  63. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -11
  64. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +4 -6
  65. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +1 -31
  66. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +3 -3
  67. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +5 -25
  68. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -17
  69. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +1 -17
  70. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +0 -15
  71. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +1 -2
  72. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +1 -15
  73. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +14 -4
  74. data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -4
  75. data/app/pb_kits/playbook/pb_layout/_layout.tsx +11 -30
  76. data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
  77. data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -3
  78. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +1 -3
  79. data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +1 -11
  80. data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +2 -16
  81. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
  82. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
  83. data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -5
  84. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -10
  85. data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -4
  86. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -4
  87. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -4
  88. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +1 -64
  89. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -3
  90. data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +0 -2
  91. data/app/pb_kits/playbook/pb_section_separator/docs/index.js +0 -1
  92. data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +1 -4
  93. data/app/pb_kits/playbook/pb_select/_select.scss +3 -5
  94. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +7 -9
  95. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
  96. data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.scss +2 -2
  97. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.html.erb +1 -1
  98. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +2 -8
  99. data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +3 -9
  100. data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +0 -2
  101. data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.html.erb +12 -8
  102. data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.rb +1 -48
  103. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +36 -44
  104. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
  105. data/app/pb_kits/playbook/pb_table/_table.tsx +24 -80
  106. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +1 -1
  107. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +1 -4
  108. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -9
  109. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -7
  110. data/app/pb_kits/playbook/pb_table/index.ts +26 -102
  111. data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -2
  112. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +2 -63
  113. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +4 -17
  114. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -106
  115. data/app/pb_kits/playbook/pb_table/table.html.erb +2 -8
  116. data/app/pb_kits/playbook/pb_table/table.rb +2 -21
  117. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -3
  118. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +4 -43
  119. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -1
  120. data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
  121. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +2 -219
  122. data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -3
  123. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -5
  124. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -4
  125. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -5
  126. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +5 -4
  127. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +4 -4
  128. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -1
  129. data/app/pb_kits/playbook/pb_timeline/timeline.rb +6 -6
  130. data/app/pb_kits/playbook/pb_title/_title.scss +5 -6
  131. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -13
  132. data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -5
  133. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +46 -115
  134. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -9
  135. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -3
  136. data/app/pb_kits/playbook/tokens/_titles.scss +8 -0
  137. data/app/pb_kits/playbook/utilities/_hover.scss +2 -11
  138. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
  139. data/app/pb_kits/playbook/utilities/globalProps.ts +9 -20
  140. data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +0 -15
  141. data/dist/chunks/_typeahead-B8fkIeXA.js +22 -0
  142. data/dist/chunks/_weekday_stacked-CiL8BjKa.js +45 -0
  143. data/dist/chunks/{lib-B7sgJtGS.js → lib-SyD3buPZ.js} +3 -3
  144. data/dist/chunks/{pb_form_validation-C5Cc0-1v.js → pb_form_validation-Dt8UJgrJ.js} +1 -1
  145. data/dist/chunks/vendor.js +1 -1
  146. data/dist/menu.yml +2 -2
  147. data/dist/playbook-doc.js +1 -1
  148. data/dist/playbook-rails-react-bindings.js +1 -1
  149. data/dist/playbook-rails.js +1 -1
  150. data/dist/playbook.css +1 -1
  151. data/lib/playbook/classnames.rb +0 -1
  152. data/lib/playbook/hover.rb +1 -7
  153. data/lib/playbook/spacing.rb +0 -21
  154. data/lib/playbook/version.rb +2 -2
  155. metadata +8 -59
  156. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +0 -36
  157. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +0 -1
  158. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.html.erb +0 -43
  159. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +0 -60
  160. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.md +0 -1
  161. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.html.erb +0 -58
  162. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx +0 -74
  163. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.md +0 -1
  164. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -50
  165. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +0 -1
  166. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -57
  167. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +0 -5
  168. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +0 -5600
  169. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.md +0 -1
  170. data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +0 -57
  171. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +0 -32
  172. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +0 -29
  173. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.html.erb +0 -10
  174. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.jsx +0 -42
  175. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.md +0 -3
  176. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_description.md +0 -3
  177. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.html.erb +0 -9
  178. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_rails.md +0 -1
  179. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.html.erb +0 -7
  180. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.html.erb +0 -119
  181. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +0 -174
  182. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.html.erb +0 -15
  183. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width_rails.md +0 -3
  184. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.html.erb +0 -3
  185. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.html.erb +0 -63
  186. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +0 -97
  187. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +0 -88
  188. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +0 -3
  189. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +0 -77
  190. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +0 -3
  191. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +0 -87
  192. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +0 -5
  193. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +0 -75
  194. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +0 -1
  195. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +0 -108
  196. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +0 -2
  197. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +0 -94
  198. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
  199. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +0 -83
  200. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +0 -3
  201. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +0 -120
  202. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +0 -1
  203. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -35
  204. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +0 -106
  205. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +0 -108
  206. data/app/pb_kits/playbook/utilities/_gap.scss +0 -29
  207. data/dist/chunks/_typeahead-C2iCBqxQ.js +0 -36
  208. data/dist/chunks/_weekday_stacked-CWnbnW7m.js +0 -45
  209. /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_border_radius_react.md → _skeleton_loading_border_radius.md} +0 -0
  210. /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_height_width_react.md → _skeleton_loading_height_width.md} +0 -0
@@ -1,231 +1,138 @@
1
- import PbEnhancedElement from "../pb_enhanced_element";
1
+ import PbEnhancedElement from '../pb_enhanced_element'
2
2
 
3
- const ADVANCED_TABLE_SELECTOR = "[data-advanced-table]";
4
- const DOWN_ARROW_SELECTOR = "#advanced-table_open_icon";
5
- const UP_ARROW_SELECTOR = "#advanced-table_close_icon";
3
+ const ADVANCED_TABLE_SELECTOR = '[data-advanced-table]'
4
+ const CONTENT_SELECTOR = '[data-advanced-table-content="id"]'
5
+ const DOWN_ARROW_SELECTOR = '#advanced-table_open_icon'
6
+ const UP_ARROW_SELECTOR = '#advanced-table_close_icon'
6
7
 
7
8
  export default class PbAdvancedTable extends PbEnhancedElement {
8
9
  static get selector() {
9
- return ADVANCED_TABLE_SELECTOR;
10
+ return ADVANCED_TABLE_SELECTOR
10
11
  }
11
12
 
12
13
  get target() {
13
- const table = this.element.closest("table");
14
- return table.querySelectorAll(`[data-row-parent="${this.element.id}"]`);
14
+ return document.querySelector(CONTENT_SELECTOR.replace("id", this.element.id))
15
15
  }
16
-
17
- static expandedRows = new Set();
18
- static isCollapsing = false;
16
+
17
+ static expandedRows = new Set()
18
+ static isCollapsing = false
19
19
 
20
20
  connect() {
21
- this.element.addEventListener("click", () => {
21
+ this.element.addEventListener('click', () => {
22
22
  if (!PbAdvancedTable.isCollapsing) {
23
- const isExpanded =
24
- this.element.querySelector(UP_ARROW_SELECTOR).style.display ===
25
- "inline-block";
23
+ const isExpanded = this.element.querySelector(UP_ARROW_SELECTOR).style.display === 'inline-block'
26
24
  if (!isExpanded) {
27
- PbAdvancedTable.expandedRows.add(this.element.id);
25
+ PbAdvancedTable.expandedRows.add(this.element.id)
28
26
  } else {
29
- PbAdvancedTable.expandedRows.delete(this.element.id);
27
+ PbAdvancedTable.expandedRows.delete(this.element.id)
30
28
  }
31
- this.toggleElement(this.target);
32
29
  }
33
- });
34
-
35
- const nestedButtons = this.element
36
- .closest("table")
37
- .querySelectorAll("[data-advanced-table]");
38
- nestedButtons.forEach((button) => {
39
- button.addEventListener("click", () => {
40
- const isExpanded =
41
- button.querySelector(UP_ARROW_SELECTOR).style.display ===
42
- "inline-block";
43
- if (isExpanded) {
44
- PbAdvancedTable.expandedRows.add(button.id);
45
- } else {
46
- PbAdvancedTable.expandedRows.delete(button.id);
47
- }
48
- });
49
- });
30
+ this.toggleElement(this.target)
31
+ })
50
32
  }
51
33
 
52
- showElement(elements) {
53
- elements.forEach((elem) => {
54
- elem.style.display = "table-row";
55
- elem.classList.add("is-visible");
56
- const childRowsAll = this.element
57
- .closest("table")
58
- .querySelectorAll(
59
- `[data-advanced-table-content^="${elem.dataset.advancedTableContent}-"]`
60
- );
61
-
62
- childRowsAll.forEach((childRow) => {
63
- const dataContent = childRow.dataset.advancedTableContent;
64
-
65
- if (!dataContent) {
66
- return;
67
- }
68
- // Split the dataContent to get all ancestor IDs, check against ExpandedRows
69
- const ancestorIds = dataContent.split("-").slice(0, -1);
70
-
71
- const prefixedAncestorIds = ancestorIds.map(
72
- (id) => `${childRow.id}_${id}`
73
- );
74
- const allAncestorsExpanded = prefixedAncestorIds.every((id) =>
75
- PbAdvancedTable.expandedRows.has(id)
76
- );
77
-
78
- const checkIfParentIsExpanded = () => {
79
- if (dataContent.endsWith("sr")) {
80
- const parentRowId = childRow.dataset.rowParent;
81
- const isParentVisible =
82
- childRow.previousElementSibling.classList.contains("is-visible");
83
- if (parentRowId) {
84
- const isInSet = PbAdvancedTable.expandedRows.has(parentRowId);
85
- if (isInSet && isParentVisible) {
86
- return true;
87
- }
88
- }
89
- }
90
- return false;
91
- };
92
-
93
- if (allAncestorsExpanded || checkIfParentIsExpanded()) {
94
- childRow.style.display = "table-row";
95
- childRow.classList.add("is-visible");
96
- } else {
97
- childRow.style.display = "none";
98
- childRow.classList.remove("is-visible");
99
- }
100
- });
101
- });
34
+ showElement(elem) {
35
+ const getHeight = () => {
36
+ elem.style.display = 'block'
37
+ const height = elem.scrollHeight + 'px'
38
+ elem.style.display = ''
39
+ return height
40
+ }
41
+
42
+ const height = getHeight()
43
+ elem.classList.add('is-visible')
44
+ elem.style.height = height
45
+ elem.style.overflow = "hidden"
46
+
47
+ window.setTimeout(() => {
48
+ elem.style.height = ''
49
+ elem.style.overflow = "visible"
50
+ }, 250)
102
51
  }
103
52
 
104
- hideElement(elements) {
105
- elements.forEach((elem) => {
106
- elem.style.display = "none";
107
- elem.classList.remove("is-visible");
53
+ hideElement(elem) {
54
+ elem.style.height = elem.scrollHeight + 'px'
108
55
 
109
- // Remove the row ID from expandedRows when this row is hidden
110
- if (PbAdvancedTable.expandedRows.has(elem.id)) {
111
- PbAdvancedTable.expandedRows.delete(elem.id);
112
- }
56
+ window.setTimeout(() => {
57
+ elem.style.height = '0'
58
+ elem.style.paddingTop = '0'
59
+ elem.style.paddingBottom = '0'
60
+ elem.style.overflow = "hidden"
61
+ }, 1)
113
62
 
114
- const childrenArray = elem.dataset.advancedTableContent.split("-");
115
- const currentDepth = parseInt(elem.dataset.rowDepth);
116
- if (childrenArray.length > currentDepth) {
117
- // Find the child rows corresponding to this parent row
118
- const childRows = this.element
119
- .closest("table")
120
- .querySelectorAll(
121
- `[data-advanced-table-content^="${elem.dataset.advancedTableContent}-"]`
122
- );
123
-
124
- childRows.forEach((childRow) => {
125
- childRow.style.display = "none";
126
- childRow.classList.remove("is-visible");
127
- });
128
- }
129
- });
63
+ window.setTimeout(() => {
64
+ elem.classList.remove('is-visible')
65
+ elem.style.overflow = ""
66
+ }, 200)
130
67
  }
131
68
 
132
- toggleElement(elements) {
133
- if (!elements.length) return;
134
-
135
- const isVisible = elements[0].classList.contains("is-visible");
136
- if (isVisible) {
137
- this.hideElement(elements);
138
- this.displayDownArrow();
139
- } else {
140
- this.showElement(elements);
141
- this.displayUpArrow();
69
+ toggleElement(elem) {
70
+ if (elem.classList.contains('is-visible')) {
71
+ this.hideElement(elem)
72
+ this.displayDownArrow()
73
+ return
142
74
  }
75
+
76
+ this.showElement(elem)
77
+ this.displayUpArrow()
143
78
  }
144
79
 
145
80
  displayDownArrow() {
146
- this.element.querySelector(DOWN_ARROW_SELECTOR).style.display =
147
- "inline-block";
148
- this.element.querySelector(UP_ARROW_SELECTOR).style.display = "none";
81
+ this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = 'inline-block'
82
+ this.element.querySelector(UP_ARROW_SELECTOR).style.display = 'none'
149
83
  }
150
84
 
151
85
  displayUpArrow() {
152
- this.element.querySelector(UP_ARROW_SELECTOR).style.display =
153
- "inline-block";
154
- this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = "none";
86
+ this.element.querySelector(UP_ARROW_SELECTOR).style.display = 'inline-block'
87
+ this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = 'none'
155
88
  }
156
89
 
157
90
  static handleToggleAllHeaders(element) {
158
- const table = element.closest(".pb_table");
159
- const firstLevelButtons = table.querySelectorAll(
160
- ".pb_advanced_table_body > .pb_table_tr[data-row-depth='0'] [data-advanced-table]"
161
- );
162
-
163
- const allExpanded = Array.from(firstLevelButtons).every(
164
- (button) =>
165
- button.querySelector(UP_ARROW_SELECTOR).style.display === "inline-block"
166
- );
167
-
168
- if (allExpanded) {
169
- firstLevelButtons.forEach((button) => {
170
- button.click();
171
- PbAdvancedTable.expandedRows.delete(button.id);
172
- });
91
+ const table = element.closest('.pb_table')
92
+ const firstLevelButtons = table.querySelectorAll('.pb_advanced_table_body > .pb_table_tr [data-advanced-table]')
93
+
94
+ const expandedRows = Array.from(firstLevelButtons).filter(button =>
95
+ button.querySelector(UP_ARROW_SELECTOR).style.display === 'inline-block'
96
+ )
97
+
98
+ if (expandedRows.length === firstLevelButtons.length) {
99
+ expandedRows.forEach(button => {
100
+ button.click()
101
+ })
102
+ this.expandedRows.clear()
173
103
  } else {
174
- firstLevelButtons.forEach((button) => {
175
- if (!PbAdvancedTable.expandedRows.has(button.id)) {
176
- button.click();
177
- PbAdvancedTable.expandedRows.add(button.id);
178
- }
179
- });
180
-
181
- PbAdvancedTable.expandedRows.forEach((rowId) => {
182
- const nestedButton = table.querySelector(
183
- `[data-advanced-table][id="${rowId}"]`
184
- );
185
- if (nestedButton && !firstLevelButtons.contains(nestedButton)) {
186
- nestedButton.click();
104
+ firstLevelButtons.forEach(button => {
105
+ if (!this.expandedRows.has(button.id)) {
106
+ button.click()
187
107
  }
188
- });
108
+ })
189
109
  }
190
110
  }
191
-
192
111
  static handleToggleAllSubRows(element, rowDepth) {
193
- const table = element.closest(".pb_table");
194
- const parentRow = element.closest("tr");
195
- if (!parentRow) {
196
- return;
197
- }
198
- const rowParentId = parentRow.dataset.rowParent;
199
- // Select all buttons that for subrows at that depth and with same rowParent
200
- const subRowButtons = table.querySelectorAll(
201
- `.pb_advanced_table_body > .pb_table_tr[data-row-depth='${rowDepth}'].pb_table_tr[data-row-parent='${rowParentId}'] [data-advanced-table]`
202
- );
203
-
204
- const allExpanded = Array.from(subRowButtons).every(
205
- (button) =>
206
- button.querySelector(UP_ARROW_SELECTOR).style.display === "inline-block"
207
- );
208
-
209
- if (allExpanded) {
210
- subRowButtons.forEach((button) => {
211
- button.click();
212
- PbAdvancedTable.expandedRows.delete(button.id);
213
- });
112
+ const parentElement = element.closest(".toggle-content")
113
+ const subrowButtons = parentElement.querySelectorAll('.depth-sub-row-' + rowDepth + ' [data-advanced-table]')
114
+
115
+ const expandedSubRows = Array.from(subrowButtons).filter(button =>
116
+ button.querySelector(UP_ARROW_SELECTOR).style.display === 'inline-block'
117
+ )
118
+
119
+ if (expandedSubRows.length === subrowButtons.length) {
120
+ expandedSubRows.forEach(button => {
121
+ button.click()
122
+ })
214
123
  } else {
215
- subRowButtons.forEach((button) => {
216
- if (!PbAdvancedTable.expandedRows.has(button.id)) {
217
- button.click();
218
- PbAdvancedTable.expandedRows.add(button.id);
124
+ subrowButtons.forEach(button => {
125
+ if (!this.expandedRows.has(button.id)) {
126
+ button.click()
219
127
  }
220
- });
128
+ })
221
129
  }
222
130
  }
223
131
  }
224
132
 
225
133
  window.expandAllRows = (element) => {
226
- PbAdvancedTable.handleToggleAllHeaders(element);
227
- };
228
-
134
+ PbAdvancedTable.handleToggleAllHeaders(element)
135
+ }
229
136
  window.expandAllSubRows = (element, rowDepth) => {
230
- PbAdvancedTable.handleToggleAllSubRows(element, rowDepth);
231
- };
137
+ PbAdvancedTable.handleToggleAllSubRows(element, rowDepth)
138
+ }
@@ -1,4 +1,4 @@
1
- <%= pb_content_tag(:tbody) do %>
1
+ <%= pb_content_tag do %>
2
2
  <% object.table_data.each do |row| %>
3
3
  <%= render_row_and_children(row, object.column_definitions, 0, false) %>
4
4
  <% end %>
@@ -14,59 +14,20 @@ module Playbook
14
14
  default: "header"
15
15
  prop :subrow_headers, type: Playbook::Props::Array,
16
16
  default: []
17
- prop :collapsible_trail, type: Playbook::Props::Boolean,
18
- default: true
19
-
20
- def flatten_columns(columns)
21
- columns.flat_map do |col|
22
- if col[:columns]
23
- flatten_columns(col[:columns])
24
- elsif col[:accessor].present?
25
- if has_grouped_headers?
26
- col.merge(is_last_in_group: last_in_group?(columns, col))
27
- else
28
- col
29
- end
30
- end
31
- end.compact
32
- end
33
-
34
- def render_row_and_children(row, column_definitions, current_depth, first_parent_child, ancestor_ids = [], top_parent_id = nil, additional_classes: "", table_data_attributes: {})
35
- top_parent_id ||= row.object_id
36
- new_ancestor_ids = ancestor_ids + [row.object_id]
37
- leaf_columns = flatten_columns(column_definitions)
38
17
 
18
+ def render_row_and_children(row, column_definitions, current_depth, first_parent_child)
39
19
  output = ActiveSupport::SafeBuffer.new
40
20
  is_first_child_of_subrow = current_depth.positive? && first_parent_child && subrow_headers[current_depth - 1].present?
41
21
 
42
- subrow_ancestor_ids = ancestor_ids + ["#{row.object_id}sr"]
43
- subrow_data_attributes = {
44
- advanced_table_content: subrow_ancestor_ids.join("-"),
45
- row_depth: current_depth,
46
- row_parent: "#{id}_#{ancestor_ids.last}",
47
- }
48
- # Subrow header if applicable
49
- output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: leaf_columns, depth: current_depth, subrow_header: subrow_headers[current_depth - 1], collapsible_trail: collapsible_trail, classname: "toggle-content", subrow_data_attributes: subrow_data_attributes }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
50
-
51
- current_data_attributes = current_depth.zero? ? { row_depth: 0 } : table_data_attributes
22
+ output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: column_definitions, depth: current_depth, subrow_header: subrow_headers[current_depth - 1] }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
52
23
 
53
- # Additional class and data attributes needed for toggle logic
54
- 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 })
24
+ output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth })
55
25
 
56
26
  if row[:children].present?
57
- row[:children].each do |child_row|
58
- is_first_child = row[:children].first == child_row
59
- immediate_parent_id = row.object_id
60
- data_content = new_ancestor_ids.join("-") + "-#{child_row.object_id}"
61
-
62
- child_data_attributes = {
63
- top_parent: "#{id}_#{top_parent_id}",
64
- row_depth: current_depth + 1,
65
- row_parent: "#{id}_#{immediate_parent_id}",
66
- advanced_table_content: data_content,
67
- }
68
-
69
- output << render_row_and_children(child_row, column_definitions, current_depth + 1, is_first_child, new_ancestor_ids, top_parent_id, additional_classes: "toggle-content", table_data_attributes: child_data_attributes)
27
+ output << content_tag(:div, class: "toggle-content", data: { advanced_table_content: row.object_id.to_s + id }) do
28
+ row[:children].map do |child_row|
29
+ render_row_and_children(child_row, column_definitions, current_depth + 1, row.children.first == child_row)
30
+ end.join.html_safe
70
31
  end
71
32
  end
72
33
 
@@ -74,17 +35,7 @@ module Playbook
74
35
  end
75
36
 
76
37
  def classname
77
- generate_classname("pb_advanced_table_body", separator: " ")
78
- end
79
-
80
- private
81
-
82
- def has_grouped_headers?
83
- column_definitions.any? { |col| col.key?(:columns) }
84
- end
85
-
86
- def last_in_group?(columns, current_col)
87
- columns.last[:accessor] == current_col[:accessor]
38
+ generate_classname("pb_advanced_table_body", "pb_table_tbody", separator: " ")
88
39
  end
89
40
  end
90
41
  end
@@ -1,21 +1,16 @@
1
- <%= pb_content_tag(:thead) do %>
2
- <% object.header_rows.each_with_index do |header_row, row_index| %>
3
- <%= pb_rails("table/table_row") do %>
4
- <% header_row.each_with_index do |cell, cell_index| %>
5
- <% header_id = cell[:accessor].present? ? cell[:accessor] : "header_#{row_index}_#{cell_index}" %>
6
- <%= pb_rails("table/table_header", props: { id: header_id, colspan: cell[:colspan], classname: [object.th_classname, ('last-header-cell' if cell[:is_last_in_group] && cell_index != 0)].compact.join(' '), sort_menu: cell[:accessor] ? cell[:sort_menu] : nil }) do %>
7
- <%= 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
- <button
10
- class="gray-icon toggle-all-icon"
11
- onclick="expandAllRows(this); event.preventDefault();">
12
- <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
13
- </button>
1
+ <%= pb_content_tag do %>
2
+ <%= pb_rails("table/table_row", props: { tag: "div" }) do %>
3
+ <% object.column_definitions.each_with_index do |item, index| %>
4
+ <%= pb_rails("table/table_header", props: { tag: "div", id: item[:accessor], classname: object.th_classname, sort_menu: item[:sort_menu] }) do %>
5
+ <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align: "end" }) do %>
6
+ <% if index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") %>
7
+ <button class="gray-icon toggle-all-icon" onclick="expandAllRows(this)">
8
+ <%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right: "xs" }) %>
9
+ </button>
10
+ <% end %>
11
+ <%= item[:label] %>
14
12
  <% end %>
15
- <%= cell[:label] %>
16
13
  <% end %>
14
+ <% end %>
17
15
  <% end %>
18
- <% end %>
19
- <% end %>
20
- <% end %>
21
- <% end %>
16
+ <% end %>
@@ -16,84 +16,6 @@ module Playbook
16
16
  def th_classname
17
17
  generate_classname("table-header-cells", separator: " ")
18
18
  end
19
-
20
- def header_rows
21
- wrapped_columns = wrap_leaf_columns(column_definitions)
22
-
23
- rows = []
24
- max_depth = compute_max_depth(wrapped_columns)
25
- max_depth.times { rows << [] }
26
- process_columns(wrapped_columns, rows, 0, max_depth)
27
- rows
28
- end
29
-
30
- private
31
-
32
- def compute_max_depth(columns)
33
- columns.map do |col|
34
- col[:columns] ? 1 + compute_max_depth(col[:columns]) : 1
35
- end.max || 1
36
- end
37
-
38
- def process_columns(columns, rows, current_depth, max_depth)
39
- total_columns = columns.size
40
- columns.each_with_index do |col, index|
41
- is_last = index == total_columns - 1
42
- if col[:columns]
43
- colspan = compute_leaf_columns(col[:columns])
44
- rows[current_depth] << {
45
- label: col[:label],
46
- colspan: colspan,
47
- is_last_in_group: is_last && current_depth.positive?,
48
- }
49
-
50
- process_columns(col[:columns], rows, current_depth + 1, max_depth)
51
- else
52
- colspan = 1
53
- rows[current_depth] << {
54
- label: col[:label],
55
- colspan: colspan,
56
- accessor: col[:accessor],
57
- sort_menu: col[:sort_menu],
58
- is_last_in_group: is_last && current_depth.positive?,
59
- }
60
- end
61
- end
62
- end
63
-
64
- def compute_leaf_columns(columns)
65
- columns.reduce(0) do |sum, col|
66
- col[:columns] ? sum + compute_leaf_columns(col[:columns]) : sum + 1
67
- end
68
- end
69
-
70
- def wrap_leaf_columns(column_definitions)
71
- max_depth = compute_max_depth(column_definitions)
72
-
73
- column_definitions.map do |col|
74
- if col.key?(:columns)
75
- {
76
- label: col[:label],
77
- columns: wrap_leaf_columns(col[:columns]),
78
- }
79
- else
80
- # For leaf columns, wrap with empty labels up to max depth to get proper structure
81
- wrap_leaf_column(col, max_depth)
82
- end
83
- end
84
- end
85
-
86
- def wrap_leaf_column(col, max_depth)
87
- wrapped = {
88
- accessor: col[:accessor],
89
- label: col[:label] || "",
90
- sort_menu: col[:sort_menu] || nil,
91
- }
92
- (max_depth - 1).times do
93
- wrapped = { label: "", columns: [wrapped] }
94
- end
95
- wrapped
96
- end
97
19
  end
98
20
  end
99
21
  end
@@ -1,20 +1,11 @@
1
- <%= pb_content_tag(:tr) do %>
1
+ <%= pb_content_tag do %>
2
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)}) do %>
3
+ <%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
5
4
  <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) 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 %>
12
- <% end %>
13
-
14
5
  <div style="padding-left: <%= depth * 1.25 %>em">
15
6
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
16
7
  <% if index.zero? && object.row[:children].present? %>
17
- <button id="<%= "#{object.id}_#{object.row.object_id}" %>" class="gray-icon expand-toggle-icon" data-advanced-table="true" >
8
+ <button id="<%= object.row.object_id.to_s + object.id %>" class="gray-icon expand-toggle-icon" data-advanced-table="true" >
18
9
  <%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
19
10
  <%= pb_rails("icon", props: { id: "advanced-table_close_icon", display: "none", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
20
11
  </button>
@@ -9,23 +9,13 @@ module Playbook
9
9
  default: []
10
10
  prop :row
11
11
  prop :depth
12
- prop :collapsible_trail, type: Playbook::Props::Boolean,
13
- default: true
14
- prop :table_data_attributes, type: Playbook::Props::HashProp,
15
- default: {}
16
-
17
- def data
18
- Hash(prop(:data)).merge(table_data_attributes)
19
- end
20
12
 
21
13
  def classname
22
14
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
23
15
  end
24
16
 
25
- def td_classname(column)
26
- classes = %w[id-cell chrome-styles]
27
- classes << "last-cell" if column[:is_last_in_group]
28
- classes.join(" ")
17
+ def td_classname
18
+ generate_classname("id-cell", "chrome-styles", separator: " ")
29
19
  end
30
20
 
31
21
  def depth_accessors
@@ -37,8 +27,6 @@ module Playbook
37
27
  private
38
28
 
39
29
  def custom_renderer_value(column, index)
40
- return nil unless column[:accessor].present?
41
-
42
30
  if index.zero?
43
31
  if depth.zero?
44
32
  row[column[:accessor].to_sym]
@@ -47,7 +35,6 @@ module Playbook
47
35
  key = item.to_sym
48
36
  return row[key] if depth - 1 == accessor_index
49
37
  end
50
- nil
51
38
  end
52
39
  else
53
40
  row[column[:accessor].to_sym]
@@ -1,15 +1,11 @@
1
- <%= pb_content_tag(:tr) do %>
1
+ <%= content_tag(:div,
2
+ aria: object.aria,
3
+ class: object.classname,
4
+ data: object.data,
5
+ id: object.id) do %>
2
6
  <% object.column_definitions.each_with_index do |column, index| %>
3
- <%= pb_rails("table/table_cell", props: { classname: "id-cell chrome-styles"}) do %>
7
+ <%= pb_rails("table/table_cell", props: { tag: "div", classname: object.td_classname}) do %>
4
8
  <%= pb_rails("flex", props:{ align: "center", justify: "start" }) do %>
5
- <% if collapsible_trail && index.zero? %>
6
- <% (1..depth).each do |i| %>
7
- <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
8
- <% left_offset = i * 1.0 + additional_offset %>
9
- <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
10
- <% end %>
11
- <% end %>
12
-
13
9
  <div style="padding-left: <%= depth * 1.25 %>em">
14
10
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
15
11
  <% if index.zero? && object.row[:children].present? %>
@@ -12,17 +12,13 @@ module Playbook
12
12
  default: "header"
13
13
  prop :subrow_header, type: Playbook::Props::String,
14
14
  default: ""
15
- prop :collapsible_trail, type: Playbook::Props::Boolean,
16
- default: true
17
- prop :subrow_data_attributes, type: Playbook::Props::HashProp,
18
- default: {}
19
15
 
20
- def data
21
- Hash(prop(:data)).merge(subrow_data_attributes)
16
+ def classname
17
+ generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
22
18
  end
23
19
 
24
- def classname
25
- generate_classname("pb_table_tr", "bg-silver", "pb_subrow_header", subrow_depth_classname, separator: " ")
20
+ def td_classname
21
+ generate_classname("id-cell", "chrome-styles", separator: " ")
26
22
  end
27
23
 
28
24
  private