playbook_ui_docs 14.9.0.pre.rc.9 → 14.9.0.pre.rc.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ed68fdf82c1b710877b76a6c4f06f2aca624d64d428e0cdd1be758dcf53a636
4
- data.tar.gz: 90059eae3d22b070801b24742031b7ff0f5ac33fe788e40bfa7aec775cf553c2
3
+ metadata.gz: 4b11c2914a6946617494ccc3a839735bea447a02b9c9540db61a665f9044accf
4
+ data.tar.gz: 46ca1d26653f44182d7da6f588dd9b400667a4358d670dcdd0046f07fa19e811
5
5
  SHA512:
6
- metadata.gz: c3d1d37290cbb8e3e4ffa050969138ddb2357cef1855e8fb924fbd4e8deee2d8a1277860c1788a5c8d12814d09befeebe687806f3f107eebe961944badfe64bd
7
- data.tar.gz: 6bc296b4197cdd798d0dd4e1aa41bbb87c6015550060a90e0eec093934f6dbde48bccab49eb7022aef4b63f28c6c6d715874f2cd49e62c6221a7ed37c6009efb
6
+ metadata.gz: d5a40ee3d3da9be2c33320d2cf17aeb7e45ce83538b946966423140260e8e19b3194a31e820872a28748f37ce75e73bbb42ede9305d9067910c1b9164c65da84
7
+ data.tar.gz: a414e5e40c1644096d7fc0a5d35145af98483851e44999c922a932de4879c5da32a001750738c6f7a59be64926156a5f8e6b7b818763e3f6df8be80e55d3c2f6
@@ -30,4 +30,4 @@
30
30
  }
31
31
  ] %>
32
32
 
33
- <%= pb_rails("advanced_table", props: {table_data: @table_data, column_definitions: column_definitions}) %>
33
+ <%= pb_rails("advanced_table", props: { id: "beta_table", table_data: @table_data, column_definitions: column_definitions }) %>
@@ -55,5 +55,5 @@
55
55
 
56
56
  <%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions }) do %>
57
57
  <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
58
- <%= pb_rails("advanced_table/table_body", props: { id: "subrow_headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
58
+ <%= pb_rails("advanced_table/table_body", props: { id: "beta_sort", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
59
59
  <% end %>
@@ -0,0 +1,53 @@
1
+ <%
2
+ column_definitions = [
3
+ {
4
+ accessor: "year",
5
+ label: "Year",
6
+ cellAccessors: ["quarter", "month", "day"],
7
+ custom_renderer: ->(row, value) {
8
+ capture do
9
+ pb_rails("flex") do
10
+ pb_rails("title", props: { text: value, size: 4 }) +
11
+ pb_rails("badge", props: { dark: true, margin_left: "xxs", text: row[:newEnrollments].to_i > 20 ? "High" : "Low", variant: "neutral" })
12
+ end
13
+ end
14
+ }
15
+ },
16
+ {
17
+ accessor: "newEnrollments",
18
+ label: "New Enrollments",
19
+ custom_renderer: ->(row, value) { pb_rails("pill", props: { text: value, variant: "success" }) }
20
+ },
21
+ {
22
+ accessor: "scheduledMeetings",
23
+ label: "Scheduled Meetings",
24
+ custom_renderer: ->(row, value) { content_tag(:a, value, href: "#") }
25
+ },
26
+ {
27
+ accessor: "attendanceRate",
28
+ label: "Attendance Rate",
29
+ custom_renderer: ->(row, value) {
30
+ capture do
31
+ pb_rails("flex", props: { align_items: "end", orientation: "column" }) do
32
+ pb_rails("detail", props: { bold: true, color: "default", text: value }) +
33
+ pb_rails("caption", props: { size: "xs", text: row[:graduatedStudents] })
34
+ end
35
+ end
36
+ }
37
+ },
38
+ {
39
+ accessor: "completedClasses",
40
+ label: "Completed Classes",
41
+ },
42
+ {
43
+ accessor: "classCompletionRate",
44
+ label: "Class Completion Rate",
45
+ },
46
+ {
47
+ accessor: "graduatedStudents",
48
+ label: "Graduated Students",
49
+ }
50
+ ]
51
+ %>
52
+
53
+ <%= pb_rails("advanced_table", props: { id: "custom_cell", table_data: @table_data, column_definitions: column_definitions }) %>
@@ -0,0 +1,5 @@
1
+ The Advanced Table also allows for rendering custom components within individual Cells. To achieve this, you can make use of the optional `custom_renderer` item within each column_definitions. This function gives you access to the current Cell's value if you just want to use that with a custom Kit, but it also gives you access to the entire `row` object. The row object provides all data for the current row.
2
+
3
+ See [here](https://playbook.powerapp.cloud/kits/advanced_table/rails#column_definitions) for more indepth information on column_definitions are how to use them.
4
+
5
+ See [here](https://github.com/powerhome/playbook/tree/master/playbook/app/pb_kits/playbook/pb_advanced_table#readme) for the structure of the table_data used.
@@ -3,6 +3,7 @@ examples:
3
3
  - advanced_table_beta: Default (Required Props)
4
4
  - advanced_table_beta_subrow_headers: SubRow Headers
5
5
  - advanced_table_beta_sort: Enable Sorting
6
+ - advanced_table_custom_cell_rails: Custom Components for Cells
6
7
 
7
8
  react:
8
9
  - advanced_table_default: Default (Required Props)