-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PBNTR-703] Add Expandable/Collapsible Rows to Basic Table Component …
…- RAILS only (#4122) [PBNTR-703](https://runway.powerhrg.com/backlog_items/PBNTR-703) This PR adds the ability to add the collapsible kit to a table row on the rails side! All new rails props match the react side. <img width="842" alt="Screenshot 2025-01-14 at 9 56 51 AM" src="https://github.com/user-attachments/assets/4904418f-5dab-4e0b-9774-6010fd46f58d" /> **How to test?** Steps to confirm the desired behavior: 1. Go to the table kit #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [ ] **TESTS** I have added test coverage to my code. --------- Co-authored-by: Carlos Lima <[email protected]>
- Loading branch information
1 parent
8ef9bba
commit 471dc72
Showing
10 changed files
with
270 additions
and
139 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
playbook/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<%= pb_content_tag do %> | ||
<%= pb_content_tag( | ||
object.tag | ||
) do %> | ||
<%= content.presence %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
playbook/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<% content = capture do %> | ||
<%= pb_rails("card", props: { border_none: true, border_radius: "none", padding: "md" }) do %> | ||
<%= pb_rails("body", props: { text: "Nested content inside a Table Row" }) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= pb_rails("table", props: { size: "sm" }) do %> | ||
<%= pb_rails("table/table_head") do %> | ||
<%= pb_rails("table/table_row") do %> | ||
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %> | ||
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %> | ||
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %> | ||
<%= pb_rails("table/table_header", props: { text: "Column 4"}) %> | ||
<%= pb_rails("table/table_header", props: { text: "Column 5"}) %> | ||
<%= pb_rails("table/table_header", props: { text: ""}) %> | ||
<% end %> | ||
<% end %> | ||
<%= pb_rails("table/table_body") do %> | ||
<%= pb_rails("table/table_row", props: { collapsible: true, collapsible_content: content, collapsible_side_highlight: true, id: "1" }) do %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %> | ||
<%= pb_rails("table/table_cell", props: { text_align: "right"}) do %> | ||
<%= pb_rails("icon", props: { icon: "chevron-down", fixed_width: true, color: "primary" }) %> | ||
<% end %> | ||
<% end %> | ||
<%= pb_rails("table/table_row") do %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: ""}) %> | ||
<% end %> | ||
<%= pb_rails("table/table_row") do %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %> | ||
<%= pb_rails("table/table_cell", props: { text: ""}) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
2 changes: 2 additions & 0 deletions
2
playbook/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The `collapsible` prop can be used on any Table Row to add a collapsible area. Use the additional `collapsible_content` prop to add any content to the collapsible Row. | ||
Please be aware that you will need to pass in an `id` to any table rows you want to be collapsible. Make sure every `id` is unique if you are using multipe collapsibles. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.