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 +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.html.erb +53 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell_rails.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/dist/playbook-doc.js +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b11c2914a6946617494ccc3a839735bea447a02b9c9540db61a665f9044accf
|
4
|
+
data.tar.gz: 46ca1d26653f44182d7da6f588dd9b400667a4358d670dcdd0046f07fa19e811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5a40ee3d3da9be2c33320d2cf17aeb7e45ce83538b946966423140260e8e19b3194a31e820872a28748f37ce75e73bbb42ede9305d9067910c1b9164c65da84
|
7
|
+
data.tar.gz: a414e5e40c1644096d7fc0a5d35145af98483851e44999c922a932de4879c5da32a001750738c6f7a59be64926156a5f8e6b7b818763e3f6df8be80e55d3c2f6
|
@@ -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: "
|
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)
|