playbook_ui 15.2.0.pre.alpha.PLAY2542formatasyoutypebug11501 → 15.2.0.pre.alpha.PLAY2589advancedtableinlinerowloadingtoggleicon11607
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/index.js +5 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +6 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +6 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +5 -5
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +5 -3
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_description.md +2 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +4 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +10 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +3 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +3 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.scss +3 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.tsx +69 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +3 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.html.erb +12 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +24 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +5 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.html.erb +45 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +119 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.md +1 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.html.erb +5 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.jsx +17 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.html.erb +12 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.jsx +24 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.html.erb +23 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +37 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.html.erb +40 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +56 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_live_data.jsx +64 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.html.erb +27 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +40 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.md +1 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.html.erb +19 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.jsx +65 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.md +3 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.html.erb +14 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.jsx +27 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.html.erb +39 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +58 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.md +1 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/example.yml +29 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/index.js +11 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pbGaugeGraphTheme.ts +91 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.html.erb +1 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.rb +25 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +80 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +18 -37
- data/app/pb_kits/playbook/tokens/_positioning.scss +1 -0
- data/app/pb_kits/playbook/utilities/_positioning.scss +6 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +3 -1
- data/dist/chunks/{_line_graph-eXNg1pX_.js → _line_graph-BnVgr42C.js} +1 -1
- data/dist/chunks/_typeahead-BH_dkgOy.js +6 -0
- data/dist/chunks/{_weekday_stacked-D6SPyi5u.js → _weekday_stacked-Duv09EWo.js} +3 -3
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +6 -0
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- data/lib/playbook/z_index.rb +1 -1
- metadata +42 -5
- data/dist/chunks/_typeahead-B6jpvyrP.js +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fcd436ebf1d8c2a0442f88c7bd24280b90e805a2cbf764d36e60a73bf04f8a3e
|
|
4
|
+
data.tar.gz: 57f069f6198858056e3217cd8032a03a41a78204bea676892f9cdc4ccd1fb4e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39bf03e47685ed9c93b72ca94fc4b47a3decb6de1c61b690db4f84295595a5d3375378f83c37fab02c72bbecd4feea2bb792861c19efe4ce4201901907d2b2b2
|
|
7
|
+
data.tar.gz: d95721f238cf35d91464c1efe1e6f7aa0852a5e17facd89dc03c45c45c431eb5f80924ea9e0c261955bc596860d973f11814692b711a33bc95a1a02baff033f4
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
@import 'pb_advanced_table/advanced_table';
|
|
2
3
|
@import 'pb_avatar/avatar';
|
|
3
4
|
@import 'pb_background/background';
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
@import 'pb_passphrase/passphrase';
|
|
71
72
|
@import 'pb_pb_bar_graph/pb_bar_graph';
|
|
72
73
|
@import 'pb_pb_circle_chart/pb_circle_chart';
|
|
74
|
+
@import 'pb_pb_gauge_chart/pb_gauge_chart';
|
|
73
75
|
@import 'pb_pb_line_graph/pb_line_graph';
|
|
74
76
|
@import 'pb_person/person';
|
|
75
77
|
@import 'pb_person_contact/person_contact';
|
|
@@ -220,7 +220,7 @@ const isToggleExpansionEnabled =
|
|
|
220
220
|
/>
|
|
221
221
|
)
|
|
222
222
|
}
|
|
223
|
-
{isToggleExpansionEnabled && hasAnySubRows && !expandByDepth && (
|
|
223
|
+
{isToggleExpansionEnabled && (hasAnySubRows || inlineRowLoading) && !expandByDepth && (
|
|
224
224
|
<ToggleIconButton onClick={handleExpandOrCollapse} />
|
|
225
225
|
)}
|
|
226
226
|
{isToggleExpansionEnabled && hasAnySubRows && expandByDepth && (
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<% if content.present? %>
|
|
12
12
|
<% content.presence %>
|
|
13
13
|
<% else %>
|
|
14
|
-
<%= pb_rails("advanced_table/table_header", props: {
|
|
15
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
14
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: object.id, column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, show_actions_bar: object.show_actions_bar }) %>
|
|
15
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: object.id, table_data: object.table_data, column_definitions: object.column_definitions, responsive: object.responsive, loading: object.loading, selectable_rows: object.selectable_rows, enable_toggle_expansion: object.enable_toggle_expansion, row_styling: object.row_styling }) %>
|
|
16
16
|
<% end %>
|
|
17
17
|
<% end %>
|
|
18
18
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
] %>
|
|
35
35
|
|
|
36
|
-
<%= pb_rails("advanced_table", props: { id: "
|
|
37
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
38
|
-
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
|
|
36
|
+
<%= pb_rails("advanced_table", props: { id: "background-control", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
37
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "background-control", column_definitions: column_definitions }) %>
|
|
38
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "background-control", table_data: @table_data, column_definitions: column_definitions }) %>
|
|
39
39
|
<% end %>
|
|
@@ -2,7 +2,9 @@ The AdvancedTable kit accepts tree data and automatically renders expansion cont
|
|
|
2
2
|
|
|
3
3
|
### id
|
|
4
4
|
|
|
5
|
-
A unique `id` is required to allow the table functionality to work properly. Without it, certain functions like the action bar will not be able to properly reference the correct table.
|
|
5
|
+
A unique `id` is required to allow the table functionality to work properly. Without it, certain functions like the action bar, expand/collapse caching, or selectable rows will not be able to properly reference the correct table.
|
|
6
|
+
|
|
7
|
+
You must also set `table_id` when using subcomponents like `table_header` or `table_body`.
|
|
6
8
|
|
|
7
9
|
### table_data
|
|
8
10
|
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
]
|
|
52
52
|
%>
|
|
53
53
|
|
|
54
|
-
<%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions, id: "beta_sort" }) do %>
|
|
55
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
56
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
54
|
+
<%= pb_rails("advanced_table", props: { id: "sort", table_data: @table_data, column_definitions: column_definitions, id: "beta_sort" }) do %>
|
|
55
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "sort", column_definitions: column_definitions }) %>
|
|
56
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "sort", table_data: @table_data, column_definitions: column_definitions, enable_toggle_expansion: "all" }) %>
|
|
57
57
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
subrow_headers = ["Quarter", "Month", "Day"]
|
|
35
35
|
%>
|
|
36
36
|
|
|
37
|
-
<%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions, id: "test_table" }) do %>
|
|
38
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
39
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
37
|
+
<%= pb_rails("advanced_table", props: { id: "subrow-headers", table_data: @table_data, column_definitions: column_definitions, id: "test_table" }) do %>
|
|
38
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "subrow-headers", column_definitions: column_definitions }) %>
|
|
39
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "subrow-headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
|
|
40
40
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb
CHANGED
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
] %>
|
|
32
32
|
|
|
33
33
|
<%= pb_rails("advanced_table", props: { id: "collapsible_trail", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
34
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
35
|
-
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions, collapsible_trail: false }) %>
|
|
34
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "collapsible_trail", column_definitions: column_definitions }) %>
|
|
35
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "collapsible_trail", table_data: @table_data, column_definitions: column_definitions, collapsible_trail: false }) %>
|
|
36
36
|
<% end %>
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
] %>
|
|
59
59
|
|
|
60
60
|
<%= pb_rails("advanced_table", props: { id: "column-styling-multi", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
61
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
62
|
-
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
|
|
61
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "column-styling-multi", column_definitions: column_definitions }) %>
|
|
62
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "column-styling-multi", table_data: @table_data, column_definitions: column_definitions }) %>
|
|
63
63
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb
CHANGED
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
] %>
|
|
34
34
|
|
|
35
35
|
<%= pb_rails("advanced_table", props: { id: "column-styling", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
36
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
37
|
-
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
|
|
36
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "column-styling", column_definitions: column_definitions }) %>
|
|
37
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "column-styling", table_data: @table_data, column_definitions: column_definitions }) %>
|
|
38
38
|
<% end %>
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
] %>
|
|
47
47
|
|
|
48
48
|
<%= pb_rails("advanced_table", props: { id: "padding-control-per-row", table_data: @table_data_with_id, column_definitions: column_definitions, row_styling: row_styling }) do %>
|
|
49
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
50
|
-
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data_with_id, column_definitions: column_definitions, row_styling: row_styling }) %>
|
|
49
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "padding-control-per-row", column_definitions: column_definitions }) %>
|
|
50
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "padding-control-per-row", table_data: @table_data_with_id, column_definitions: column_definitions, row_styling: row_styling }) %>
|
|
51
51
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.html.erb
CHANGED
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
] %>
|
|
36
36
|
|
|
37
37
|
<%= pb_rails("advanced_table", props: { id: "padding-control", table_data: @table_data, column_definitions: column_definitions }) do %>
|
|
38
|
-
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
|
39
|
-
<%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions }) %>
|
|
38
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "padding-control", column_definitions: column_definitions }) %>
|
|
39
|
+
<%= pb_rails("advanced_table/table_body", props: { table_id: "padding-control", table_data: @table_data, column_definitions: column_definitions }) %>
|
|
40
40
|
<% end %>
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb
CHANGED
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
%>
|
|
35
35
|
|
|
36
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: {
|
|
38
|
-
<%= pb_rails("advanced_table/table_body", props: {
|
|
37
|
+
<%= pb_rails("advanced_table/table_header", props: { table_id: "selectable_rows", column_definitions: column_definitions, selectable_rows: true }) %>
|
|
38
|
+
<%= pb_rails("advanced_table/table_body", props: { table_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
39
|
<% end %>
|
|
@@ -331,8 +331,12 @@ export default class PbAdvancedTable extends PbEnhancedElement {
|
|
|
331
331
|
// Split the dataContent to get all ancestor IDs, check against ExpandedRows
|
|
332
332
|
const ancestorIds = dataContent.split("-").slice(0, -1);
|
|
333
333
|
|
|
334
|
+
// Get the table_id from the child row's parent to construct proper prefixed IDs
|
|
335
|
+
const parentRowId = childRow.dataset.rowParent;
|
|
336
|
+
const tableId = parentRowId ? parentRowId.split('_').slice(0, -1).join('_') : '';
|
|
337
|
+
|
|
334
338
|
const prefixedAncestorIds = ancestorIds.map(
|
|
335
|
-
(id) => `${
|
|
339
|
+
(id) => `${tableId}_${id}`
|
|
336
340
|
);
|
|
337
341
|
const allAncestorsExpanded = prefixedAncestorIds.every((id) =>
|
|
338
342
|
PbAdvancedTable.expandedRows.has(id)
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Playbook
|
|
4
4
|
module PbAdvancedTable
|
|
5
5
|
class TableBody < Playbook::KitBase
|
|
6
|
-
prop :
|
|
7
|
-
|
|
6
|
+
prop :table_id, type: Playbook::Props::String,
|
|
7
|
+
default: ""
|
|
8
8
|
prop :table_data, type: Playbook::Props::Array,
|
|
9
9
|
default: []
|
|
10
10
|
prop :column_definitions, type: Playbook::Props::Array,
|
|
@@ -53,7 +53,7 @@ module Playbook
|
|
|
53
53
|
subrow_data_attributes = {
|
|
54
54
|
advanced_table_content: subrow_ancestor_ids.join("-"),
|
|
55
55
|
row_depth: current_depth,
|
|
56
|
-
row_parent: "#{
|
|
56
|
+
row_parent: "#{table_id}_#{ancestor_ids.last}",
|
|
57
57
|
}
|
|
58
58
|
# Subrow header if applicable
|
|
59
59
|
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", responsive: responsive, subrow_data_attributes: subrow_data_attributes, last_row: last_row, immediate_parent_row_id: immediate_parent_row_id }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
|
|
@@ -69,7 +69,7 @@ module Playbook
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
# Additional class and data attributes needed for toggle logic
|
|
72
|
-
output << pb_rails("advanced_table/table_row", props: {
|
|
72
|
+
output << pb_rails("advanced_table/table_row", props: { table_id: table_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, row_styling: row_styling, last_row: last_row, immediate_parent_row_id: immediate_parent_row_id })
|
|
73
73
|
|
|
74
74
|
if row[:children].present?
|
|
75
75
|
row[:children].each do |child_row|
|
|
@@ -78,9 +78,9 @@ module Playbook
|
|
|
78
78
|
data_content = new_ancestor_ids.join("-") + "-#{child_row.object_id}"
|
|
79
79
|
|
|
80
80
|
child_data_attributes = {
|
|
81
|
-
top_parent: "#{
|
|
81
|
+
top_parent: "#{table_id}_#{top_parent_id}",
|
|
82
82
|
row_depth: current_depth + 1,
|
|
83
|
-
row_parent: "#{
|
|
83
|
+
row_parent: "#{table_id}_#{immediate_parent_id}",
|
|
84
84
|
advanced_table_content: data_content,
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Playbook
|
|
4
4
|
module PbAdvancedTable
|
|
5
5
|
class TableHeader < Playbook::KitBase
|
|
6
|
-
prop :
|
|
7
|
-
|
|
6
|
+
prop :table_id, type: Playbook::Props::String,
|
|
7
|
+
default: ""
|
|
8
8
|
prop :column_definitions, type: Playbook::Props::Array,
|
|
9
9
|
default: []
|
|
10
10
|
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
|
@@ -58,10 +58,10 @@ module Playbook
|
|
|
58
58
|
classname: additional_classes.join(" "),
|
|
59
59
|
}) do
|
|
60
60
|
pb_rails("checkbox", props: {
|
|
61
|
-
id: "#{
|
|
61
|
+
id: "#{table_id ? "#{table_id}-" : ''}select-all-rows",
|
|
62
62
|
indeterminate_main: true,
|
|
63
63
|
indeterminate_main_labels: ["", ""],
|
|
64
|
-
name: "#{
|
|
64
|
+
name: "#{table_id ? "#{table_id}-" : ''}select-all-rows",
|
|
65
65
|
})
|
|
66
66
|
end
|
|
67
67
|
end
|
|
@@ -71,10 +71,10 @@ module Playbook
|
|
|
71
71
|
def render_select_all_checkbox
|
|
72
72
|
if selectable_rows
|
|
73
73
|
pb_rails("checkbox", props: {
|
|
74
|
-
id: "#{
|
|
74
|
+
id: "#{table_id ? "#{table_id}-" : ''}select-all-rows",
|
|
75
75
|
indeterminate_main: true,
|
|
76
76
|
indeterminate_main_labels: ["", ""],
|
|
77
|
-
name: "#{
|
|
77
|
+
name: "#{table_id ? "#{table_id}-" : ''}select-all-rows",
|
|
78
78
|
data: {
|
|
79
79
|
action: "click->pb-advanced-table#toggleAllRowSelection",
|
|
80
80
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<% end %>
|
|
35
35
|
<% if object.row[:children].present? %>
|
|
36
36
|
<button
|
|
37
|
-
id="<%= "#{object.
|
|
37
|
+
id="<%= "#{object.table_id}_#{object.row.object_id}" %>"
|
|
38
38
|
class="gray-icon expand-toggle-icon"
|
|
39
39
|
data-advanced-table="true"
|
|
40
40
|
style="color: <%= button_color %>"
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module Playbook
|
|
4
4
|
module PbAdvancedTable
|
|
5
5
|
class TableRow < Playbook::KitBase
|
|
6
|
-
prop :
|
|
7
|
-
|
|
6
|
+
prop :table_id, type: Playbook::Props::String,
|
|
7
|
+
default: ""
|
|
8
8
|
prop :column_definitions, type: Playbook::Props::Array,
|
|
9
9
|
default: []
|
|
10
10
|
prop :row
|
|
@@ -102,13 +102,13 @@ module Playbook
|
|
|
102
102
|
# Selectable Rows No Subrows - checkboxes in their own first cell
|
|
103
103
|
def render_checkbox_cell
|
|
104
104
|
if selectable_rows
|
|
105
|
-
prefix =
|
|
105
|
+
prefix = table_id ? "#{table_id}-" : ""
|
|
106
106
|
pb_rails("table/table_cell", props: {
|
|
107
107
|
classname: "checkbox-cell",
|
|
108
108
|
}) do
|
|
109
109
|
pb_rails("checkbox", props: {
|
|
110
110
|
id: "#{prefix}select-row-#{row_id || row.object_id}",
|
|
111
|
-
indeterminate_parent: "#{
|
|
111
|
+
indeterminate_parent: "#{table_id ? "#{table_id}-" : ''}select-all-rows",
|
|
112
112
|
name: "#{prefix}select-row-#{row_id || row.object_id}",
|
|
113
113
|
data: {
|
|
114
114
|
row_id: row_id || row.object_id.to_s,
|
|
@@ -122,7 +122,7 @@ module Playbook
|
|
|
122
122
|
# Selectable Rows w/ Subrows - checkboxes part of toggleable first cell
|
|
123
123
|
def render_row_checkbox
|
|
124
124
|
if selectable_rows
|
|
125
|
-
prefix =
|
|
125
|
+
prefix = table_id ? "#{table_id}-" : ""
|
|
126
126
|
indeterminate_parent =
|
|
127
127
|
if depth.zero?
|
|
128
128
|
"#{prefix}select-all-rows"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
|
|
4
|
-
import { globalProps } from "../utilities/globalProps";
|
|
4
|
+
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
|
5
5
|
import { buildHtmlProps } from "../utilities/props";
|
|
6
6
|
import { VoidCallback } from "../types";
|
|
7
7
|
|
|
@@ -31,7 +31,8 @@ type FixedConfirmationToastProps = {
|
|
|
31
31
|
status?: "success" | "error" | "neutral" | "tip";
|
|
32
32
|
text?: string;
|
|
33
33
|
vertical?: "top" | "bottom";
|
|
34
|
-
|
|
34
|
+
zIndex?: number | string;
|
|
35
|
+
} & GlobalProps
|
|
35
36
|
|
|
36
37
|
const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.ReactElement => {
|
|
37
38
|
const [showToast, toggleToast] = useState(true);
|
|
@@ -50,6 +51,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
|
50
51
|
status = "neutral",
|
|
51
52
|
text,
|
|
52
53
|
vertical,
|
|
54
|
+
zIndex = 'max',
|
|
53
55
|
} = props;
|
|
54
56
|
|
|
55
57
|
const returnedIcon = icon || iconMap[status]
|
|
@@ -59,7 +61,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
|
59
61
|
`pb_fixed_confirmation_toast_kit_${status}${multiLine ? '_multi_line' : ''}`,
|
|
60
62
|
{ [`positioned_toast ${vertical} ${horizontal}`]: vertical && horizontal },
|
|
61
63
|
`${iconClass}`,
|
|
62
|
-
globalProps(props),
|
|
64
|
+
globalProps(props, { zIndex }),
|
|
63
65
|
className
|
|
64
66
|
);
|
|
65
67
|
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
|
|
2
2
|
Fixed Confirmation Toast is used as an alert. Success is used when a user successfully completes an action. Error is used when there is an error and the user cannot proceed. Neutral is used to display information to a user to complete a task.
|
|
3
|
+
|
|
4
|
+
**NOTE**: z index for Fixed Confirmation Toast is set to 'max' by default which has the value of `999999`. the z Index global prop can be used to override this if you want to set it to a different value.
|
|
@@ -60,7 +60,10 @@ module Playbook
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def classname
|
|
63
|
-
|
|
63
|
+
default_z_index = z_index.present? ? "" : " z_index_max"
|
|
64
|
+
# IMPORTANT: the AutoClose class must be the last class in the string for JS to read it correctly
|
|
65
|
+
# Changing the order will break the auto_close functionality
|
|
66
|
+
generate_classname("pb_fixed_confirmation_toast_kit", status, multi_line_class) + close_class + position_class + icon_class + default_z_index + auto_close_class
|
|
64
67
|
end
|
|
65
68
|
end
|
|
66
69
|
end
|
|
@@ -75,4 +75,14 @@ test('renders position when provided', () => {
|
|
|
75
75
|
/>
|
|
76
76
|
);
|
|
77
77
|
expect(container.querySelector('.positioned_toast')).toBeInTheDocument();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('renders max zIndex by default', () => {
|
|
81
|
+
const { container } = render(<FixedConfirmationToast />);
|
|
82
|
+
expect(container.querySelector('.z_index_max')).toBeInTheDocument();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('applies custom zIndex when provided', () => {
|
|
86
|
+
const { container } = render(<FixedConfirmationToast zIndex={10} />);
|
|
87
|
+
expect(container.querySelector('.z_index_10')).toBeInTheDocument();
|
|
78
88
|
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
2
|
+
|
|
3
|
+
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
2
|
+
|
|
3
|
+
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import React, { useMemo } from 'react'
|
|
3
|
+
import classnames from 'classnames'
|
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
|
5
|
+
import Highcharts from "highcharts"
|
|
6
|
+
import HighchartsReact from "highcharts-react-official"
|
|
7
|
+
import pbGaugeGraphTheme from './pbGaugeGraphTheme'
|
|
8
|
+
import highchartsMore from "highcharts/highcharts-more";
|
|
9
|
+
import solidGauge from "highcharts/modules/solid-gauge";
|
|
10
|
+
import { globalProps } from '../utilities/globalProps'
|
|
11
|
+
|
|
12
|
+
type PbGaugeChartProps = {
|
|
13
|
+
aria?: { [key: string]: string },
|
|
14
|
+
className?: string,
|
|
15
|
+
data?: { [key: string]: string },
|
|
16
|
+
htmlOptions?: { [key: string]: string | number | boolean | (() => void) | ((arg?: Event) => void) },
|
|
17
|
+
id?: string,
|
|
18
|
+
ref?: React.RefObject<any>,
|
|
19
|
+
options: Record<string, unknown>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const PbGaugeChart = (props: PbGaugeChartProps) => {
|
|
23
|
+
const {
|
|
24
|
+
aria = {},
|
|
25
|
+
className,
|
|
26
|
+
data = {},
|
|
27
|
+
htmlOptions = {},
|
|
28
|
+
id,
|
|
29
|
+
ref,
|
|
30
|
+
options = {},
|
|
31
|
+
} = props
|
|
32
|
+
|
|
33
|
+
const ariaProps = buildAriaProps(aria)
|
|
34
|
+
const dataProps = buildDataProps(data)
|
|
35
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
|
36
|
+
const classes = classnames(buildCss('pb_pb_gauge_chart'), globalProps(props), className)
|
|
37
|
+
|
|
38
|
+
const mergedOptions = useMemo(() => {
|
|
39
|
+
if (!options || typeof options !== "object") {
|
|
40
|
+
// eslint-disable-next-line no-console
|
|
41
|
+
console.error("❌ Invalid options passed to <PbLineGraph />", options)
|
|
42
|
+
return {}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return Highcharts.merge({}, pbGaugeGraphTheme, options)
|
|
46
|
+
}, [options])
|
|
47
|
+
|
|
48
|
+
highchartsMore(Highcharts);
|
|
49
|
+
solidGauge(Highcharts);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div>
|
|
53
|
+
<HighchartsReact
|
|
54
|
+
containerProps={{
|
|
55
|
+
className: classnames(classes),
|
|
56
|
+
id: id,
|
|
57
|
+
ref: ref,
|
|
58
|
+
...ariaProps,
|
|
59
|
+
...dataProps,
|
|
60
|
+
...htmlProps
|
|
61
|
+
}}
|
|
62
|
+
highcharts={Highcharts}
|
|
63
|
+
options={mergedOptions}
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default PbGaugeChart
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
2
|
+
|
|
3
|
+
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
|
|
3
|
+
import { colors } from 'playbook-ui'
|
|
4
|
+
|
|
5
|
+
const data = [{ name: "Name", y: 67 }]
|
|
6
|
+
|
|
7
|
+
const chartOptions = {
|
|
8
|
+
series: [{ data: data }],
|
|
9
|
+
plotOptions: {
|
|
10
|
+
solidgauge: {
|
|
11
|
+
borderColor: colors.data_7,
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const PbGaugeChartColor = (props) => (
|
|
16
|
+
<div>
|
|
17
|
+
<PbGaugeChart
|
|
18
|
+
options={chartOptions}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export default PbGaugeChartColor
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Highcharts allows for any custom colors to be used. Custom data colors allow for color customization to match the needs of business requirements.
|
|
2
|
+
|
|
3
|
+
For React, pass the prop `plotOptions.solidgauge.borderColor` with a Playbook token like `colors.` + `data_1 | data_2 | data_3 | data_4 | data_5 | data_6 | data_7 | data_8`. HEX colors are also available `eg: #CA0095`
|
|
4
|
+
|
|
5
|
+
For Rails, the prop `plotOptions.solidgauge.borderColor` can only be used with HEX values as shown.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<% chart_options = {
|
|
2
|
+
series:[{data:[{ name: "Name", y: 10 }]}],
|
|
3
|
+
chart: {
|
|
4
|
+
height: "150",
|
|
5
|
+
},
|
|
6
|
+
plotOptions: {
|
|
7
|
+
series: {
|
|
8
|
+
animation: false,
|
|
9
|
+
},
|
|
10
|
+
solidgauge: {
|
|
11
|
+
dataLabels: {
|
|
12
|
+
format:
|
|
13
|
+
'<span class="fix">{y:,f}</span>' +
|
|
14
|
+
'<span style="fill: #687887; font-size: 27px;">%</span>',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
} %>
|
|
19
|
+
|
|
20
|
+
<%= pb_rails("flex", props: {wrap: true, padding: "xl", gap: "sm"}) do %>
|
|
21
|
+
<%= pb_rails("flex/flex_item", props: {flex: 1, grow: true }) do %>
|
|
22
|
+
<%= pb_rails("card", props: {max_width: "xs", padding: "md", }) do %>
|
|
23
|
+
<%= pb_rails("title", props: {padding_bottom: "sm", size: 4, text: "Abandoned Calls" })%>
|
|
24
|
+
<%= pb_rails("flex", props: {align: "stretch"}) do %>
|
|
25
|
+
<%= pb_rails("flex", props: {margin_right: "sm", orientation: "column"}) do %>
|
|
26
|
+
<%= pb_rails("body", props: {color: "light", padding_bottom: "sm",text: "Total Abandoned"}) %>
|
|
27
|
+
<%= pb_rails("flex", props: {align: "baseline", padding_bottom: "sx"}) do %>
|
|
28
|
+
<%= pb_rails("title", props: {size: 1, text: "39"})%>
|
|
29
|
+
<%= pb_rails("title", props: {color: "light", size: 3, text: "calls"}) %>
|
|
30
|
+
<% end %>
|
|
31
|
+
<%= pb_rails("caption", props: {size: "xs", text: "of 390" }) %>
|
|
32
|
+
<%end %>
|
|
33
|
+
<%= pb_rails("section_separator", props: {align_self: "stretch", margin_right: "sm", orientation: "vertical" }) %>
|
|
34
|
+
<%= pb_rails("flex", props: {orientation: "column", wrap: true}) do %>
|
|
35
|
+
<%= pb_rails("body", props: {color: "light", text: "% Abandoned"}) %>
|
|
36
|
+
<%= pb_rails("flex", props: {wrap: true}) do %>
|
|
37
|
+
<%= pb_rails("flex/flex_item", props: {fixed_size: "150px", overflow: "hidden", shrink: true}) do %>
|
|
38
|
+
<%= pb_rails("pb_gauge_chart", props: { options: chart_options }) %>
|
|
39
|
+
<% end %>
|
|
40
|
+
<% end %>
|
|
41
|
+
<% end %>
|
|
42
|
+
<%end %>
|
|
43
|
+
<% end %>
|
|
44
|
+
<% end %>
|
|
45
|
+
<% end %>
|