playbook_ui 13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21358 → 13.10.0.pre.alpha.PLAY1051removinghighchartsdependency1465
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_bar_graph/_bar_graph.tsx +36 -32
- data/app/pb_kits/playbook/pb_button/docs/_button_circle_swift.md +28 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_default_swift.md +23 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width_swift.md +9 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_options_swift.md +18 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_size_swift.md +20 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_background_swift.md +29 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_border_none_swift.md +7 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_border_radius_swift.md +33 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_header_swift.md +33 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight_swift.md +17 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_light_swift.md +7 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_padding_swift.md +33 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_props_swift.md +10 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_selected_swift.md +0 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_separator_swift.md +11 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_shadow_swift.md +21 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_styles_swift.md +17 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_tag_swift.md +0 -0
- data/app/pb_kits/playbook/pb_card/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default_swift.md +10 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_error_swift.md +12 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_swift.md +12 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_props_swift.md +7 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +67 -63
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +57 -46
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color_props.md +6 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color_swift.md +16 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_defaul_swift.md +7 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_sizes_swift.md +11 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +39 -34
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -7
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.html.erb +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.html.erb +45 -104
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.jsx +43 -100
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_header.html.erb +47 -31
- data/app/pb_kits/playbook/pb_table/docs/_table_header.md +5 -0
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +33 -28
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +1 -1
- metadata +29 -4
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.html.erb +0 -133
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.jsx +0 -145
@@ -1,127 +1,68 @@
|
|
1
|
-
<% treeData = [
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<% treeData = [{
|
2
|
+
label: "Power Home Remodeling",
|
3
|
+
value: "Power Home Remodeling",
|
4
|
+
id: "200",
|
5
|
+
expanded: true,
|
6
6
|
children: [
|
7
7
|
{
|
8
|
-
label: "
|
9
|
-
value: "
|
10
|
-
id: "
|
11
|
-
|
12
|
-
{
|
13
|
-
label: "Marketing & Sales PHL",
|
14
|
-
value: "Marketing & Sales PHL",
|
15
|
-
id: "marketing1",
|
16
|
-
},
|
17
|
-
{
|
18
|
-
label: "Installation Office PHL",
|
19
|
-
value: "Installation Office PHL",
|
20
|
-
id: "installation1",
|
21
|
-
},
|
22
|
-
{
|
23
|
-
label: "Warehouse PHL",
|
24
|
-
value: "Warehouse PHL",
|
25
|
-
id: "warehouse1",
|
26
|
-
},
|
27
|
-
]
|
28
|
-
},
|
29
|
-
{
|
30
|
-
label: "New Jersey",
|
31
|
-
value: "New Jersey",
|
32
|
-
id: "nj",
|
33
|
-
children: [
|
34
|
-
{
|
35
|
-
label: "New Jersey",
|
36
|
-
value: "New Jersey",
|
37
|
-
id: "nj1",
|
8
|
+
label: "People",
|
9
|
+
value: "People",
|
10
|
+
id: "201",
|
11
|
+
expanded: true,
|
38
12
|
children: [
|
39
13
|
{
|
40
|
-
label: "
|
41
|
-
value: "
|
42
|
-
id: "
|
14
|
+
label: "Talent Acquisition",
|
15
|
+
value: "Talent Acquisition",
|
16
|
+
id: "202",
|
43
17
|
},
|
44
18
|
{
|
45
|
-
label: "
|
46
|
-
value: "
|
47
|
-
id: "
|
19
|
+
label: "Business Affairs",
|
20
|
+
value: "Business Affairs",
|
21
|
+
id: "203",
|
22
|
+
children: [
|
23
|
+
{
|
24
|
+
label: "Initiatives",
|
25
|
+
value: "Initiatives",
|
26
|
+
id: "204",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
label: "Learning & Development",
|
30
|
+
value: "Learning & Development",
|
31
|
+
id: "205",
|
32
|
+
},
|
33
|
+
],
|
48
34
|
},
|
49
35
|
{
|
50
|
-
label: "
|
51
|
-
value: "
|
52
|
-
id: "
|
36
|
+
label: "People Experience",
|
37
|
+
value: "People Experience",
|
38
|
+
id: "206",
|
53
39
|
},
|
54
40
|
],
|
55
41
|
},
|
56
42
|
{
|
57
|
-
label: "
|
58
|
-
value: "
|
59
|
-
id: "
|
43
|
+
label: "Contact Center",
|
44
|
+
value: "Contact Center",
|
45
|
+
id: "207",
|
60
46
|
children: [
|
61
47
|
{
|
62
|
-
label: "
|
63
|
-
value: "
|
64
|
-
id: "
|
48
|
+
label: "Appointment Management",
|
49
|
+
value: "Appointment Management",
|
50
|
+
id: "208",
|
65
51
|
},
|
66
52
|
{
|
67
|
-
label: "
|
68
|
-
value: "
|
69
|
-
id: "
|
53
|
+
label: "Customer Service",
|
54
|
+
value: "Customer Service",
|
55
|
+
id: "209",
|
70
56
|
},
|
71
57
|
{
|
72
|
-
label: "
|
73
|
-
value: "
|
74
|
-
id: "
|
58
|
+
label: "Energy",
|
59
|
+
value: "Energy",
|
60
|
+
id: "210",
|
75
61
|
},
|
76
|
-
]
|
77
|
-
},
|
78
|
-
]
|
79
|
-
},
|
80
|
-
{
|
81
|
-
label: "Maryland",
|
82
|
-
value: "Maryland",
|
83
|
-
id: "MD",
|
84
|
-
children: [
|
85
|
-
{
|
86
|
-
label: "Marketing & Sales MD",
|
87
|
-
value: "Marketing & Sales MD",
|
88
|
-
id: "marketing4",
|
89
|
-
},
|
90
|
-
{
|
91
|
-
label: "Installation Office MD",
|
92
|
-
value: "Installation Office MD",
|
93
|
-
id: "installation4",
|
94
|
-
},
|
95
|
-
{
|
96
|
-
label: "Warehouse MD",
|
97
|
-
value: "Warehouse MD",
|
98
|
-
id: "warehouse4",
|
99
|
-
},
|
100
|
-
]
|
101
|
-
},
|
102
|
-
{
|
103
|
-
label: "Connecticut",
|
104
|
-
value: "Connecticut",
|
105
|
-
id: "CT",
|
106
|
-
children: [
|
107
|
-
{
|
108
|
-
label: "Marketing & Sales CT",
|
109
|
-
value: "Marketing & Sales CT",
|
110
|
-
id: "marketing5",
|
111
|
-
},
|
112
|
-
{
|
113
|
-
label: "Installation Office CT",
|
114
|
-
value: "Installation Office CT",
|
115
|
-
id: "installation5",
|
116
|
-
},
|
117
|
-
{
|
118
|
-
label: "Warehouse CT",
|
119
|
-
value: "Warehouse CT",
|
120
|
-
id: "warehouse5",
|
62
|
+
],
|
121
63
|
},
|
122
|
-
]
|
123
|
-
|
124
|
-
]; %>
|
64
|
+
],
|
65
|
+
}] %>
|
125
66
|
|
126
67
|
<%= pb_rails("multi_level_select", props: {
|
127
68
|
id: "multi-level-select-single-rails",
|
@@ -3,126 +3,69 @@ import MultiLevelSelect from "../_multi_level_select";
|
|
3
3
|
|
4
4
|
const treeData = [
|
5
5
|
{
|
6
|
-
label: "
|
7
|
-
value: "
|
8
|
-
id: "
|
6
|
+
label: "Power Home Remodeling",
|
7
|
+
value: "Power Home Remodeling",
|
8
|
+
id: "powerhome2",
|
9
|
+
expanded: true,
|
9
10
|
children: [
|
10
11
|
{
|
11
|
-
label: "
|
12
|
-
value: "
|
13
|
-
id: "
|
14
|
-
|
15
|
-
{
|
16
|
-
label: "Marketing & Sales PHL",
|
17
|
-
value: "Marketing & Sales PHL",
|
18
|
-
id: "marketing1",
|
19
|
-
},
|
20
|
-
{
|
21
|
-
label: "Installation Office PHL",
|
22
|
-
value: "Installation Office PHL",
|
23
|
-
id: "installation1",
|
24
|
-
},
|
25
|
-
{
|
26
|
-
label: "Warehouse PHL",
|
27
|
-
value: "Warehouse PHL",
|
28
|
-
id: "warehouse1",
|
29
|
-
},
|
30
|
-
]
|
31
|
-
},
|
32
|
-
{
|
33
|
-
label: "New Jersey",
|
34
|
-
value: "New Jersey",
|
35
|
-
id: "nj",
|
36
|
-
children: [
|
37
|
-
{
|
38
|
-
label: "New Jersey",
|
39
|
-
value: "New Jersey",
|
40
|
-
id: "nj1",
|
12
|
+
label: "People",
|
13
|
+
value: "People",
|
14
|
+
id: "people2",
|
15
|
+
expanded: true,
|
41
16
|
children: [
|
42
17
|
{
|
43
|
-
label: "
|
44
|
-
value: "
|
45
|
-
id: "
|
18
|
+
label: "Talent Acquisition",
|
19
|
+
value: "Talent Acquisition",
|
20
|
+
id: "talent2",
|
46
21
|
},
|
47
22
|
{
|
48
|
-
label: "
|
49
|
-
value: "
|
50
|
-
id: "
|
23
|
+
label: "Business Affairs",
|
24
|
+
value: "Business Affairs",
|
25
|
+
id: "business2",
|
26
|
+
children: [
|
27
|
+
{
|
28
|
+
label: "Initiatives",
|
29
|
+
value: "Initiatives",
|
30
|
+
id: "initiative2",
|
31
|
+
},
|
32
|
+
{
|
33
|
+
label: "Learning & Development",
|
34
|
+
value: "Learning & Development",
|
35
|
+
id: "development2",
|
36
|
+
},
|
37
|
+
],
|
51
38
|
},
|
52
39
|
{
|
53
|
-
label: "
|
54
|
-
value: "
|
55
|
-
id: "
|
40
|
+
label: "People Experience",
|
41
|
+
value: "People Experience",
|
42
|
+
id: "experience2",
|
56
43
|
},
|
57
44
|
],
|
58
45
|
},
|
59
46
|
{
|
60
|
-
label: "
|
61
|
-
value: "
|
62
|
-
id: "
|
47
|
+
label: "Contact Center",
|
48
|
+
value: "Contact Center",
|
49
|
+
id: "contact2",
|
63
50
|
children: [
|
64
51
|
{
|
65
|
-
label: "
|
66
|
-
value: "
|
67
|
-
id: "
|
52
|
+
label: "Appointment Management",
|
53
|
+
value: "Appointment Management",
|
54
|
+
id: "appointment2",
|
68
55
|
},
|
69
56
|
{
|
70
|
-
label: "
|
71
|
-
value: "
|
72
|
-
id: "
|
57
|
+
label: "Customer Service",
|
58
|
+
value: "Customer Service",
|
59
|
+
id: "customer2",
|
73
60
|
},
|
74
61
|
{
|
75
|
-
label: "
|
76
|
-
value: "
|
77
|
-
id: "
|
62
|
+
label: "Energy",
|
63
|
+
value: "Energy",
|
64
|
+
id: "energy2",
|
78
65
|
},
|
79
|
-
]
|
80
|
-
},
|
81
|
-
]
|
82
|
-
},
|
83
|
-
{
|
84
|
-
label: "Maryland",
|
85
|
-
value: "Maryland",
|
86
|
-
id: "MD",
|
87
|
-
children: [
|
88
|
-
{
|
89
|
-
label: "Marketing & Sales MD",
|
90
|
-
value: "Marketing & Sales MD",
|
91
|
-
id: "marketing4",
|
92
|
-
},
|
93
|
-
{
|
94
|
-
label: "Installation Office MD",
|
95
|
-
value: "Installation Office MD",
|
96
|
-
id: "installation4",
|
97
|
-
},
|
98
|
-
{
|
99
|
-
label: "Warehouse MD",
|
100
|
-
value: "Warehouse MD",
|
101
|
-
id: "warehouse4",
|
102
|
-
},
|
103
|
-
]
|
104
|
-
},
|
105
|
-
{
|
106
|
-
label: "Connecticut",
|
107
|
-
value: "Connecticut",
|
108
|
-
id: "CT",
|
109
|
-
children: [
|
110
|
-
{
|
111
|
-
label: "Marketing & Sales CT",
|
112
|
-
value: "Marketing & Sales CT",
|
113
|
-
id: "marketing5",
|
114
|
-
},
|
115
|
-
{
|
116
|
-
label: "Installation Office CT",
|
117
|
-
value: "Installation Office CT",
|
118
|
-
id: "installation5",
|
119
|
-
},
|
120
|
-
{
|
121
|
-
label: "Warehouse CT",
|
122
|
-
value: "Warehouse CT",
|
123
|
-
id: "warehouse5",
|
66
|
+
],
|
124
67
|
},
|
125
|
-
]
|
68
|
+
],
|
126
69
|
},
|
127
70
|
];
|
128
71
|
|
@@ -2,7 +2,6 @@ examples:
|
|
2
2
|
rails:
|
3
3
|
- multi_level_select_default: Default
|
4
4
|
- multi_level_select_single: Single Select
|
5
|
-
- multi_level_select_single_children_only: Single Select Ultimate Children Only
|
6
5
|
- multi_level_select_return_all_selected: Return All Selected
|
7
6
|
- multi_level_select_selected_ids: Selected Ids
|
8
7
|
- multi_level_select_with_form: With Form
|
@@ -10,6 +9,5 @@ examples:
|
|
10
9
|
react:
|
11
10
|
- multi_level_select_default: Default
|
12
11
|
- multi_level_select_single: Single Select
|
13
|
-
- multi_level_select_single_children_only: Single Select Ultimate Children Only
|
14
12
|
- multi_level_select_return_all_selected: Return All Selected
|
15
13
|
- multi_level_select_selected_ids: Selected Ids
|
@@ -1,5 +1,4 @@
|
|
1
1
|
export { default as MultiLevelSelectDefault } from './_multi_level_select_default.jsx'
|
2
2
|
export { default as MultiLevelSelectSingle } from './_multi_level_select_single.jsx'
|
3
|
-
export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_select_single_children_only.jsx'
|
4
3
|
export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
|
5
4
|
export { default as MultiLevelSelectSelectedIds } from "./_multi_level_select_selected_ids.jsx"
|
@@ -16,8 +16,6 @@ module Playbook
|
|
16
16
|
default: "pills"
|
17
17
|
prop :input_name, type: Playbook::Props::String,
|
18
18
|
default: ""
|
19
|
-
prop :ultimate_children_only, type: Playbook::Props::Boolean,
|
20
|
-
default: false
|
21
19
|
prop :variant, type: Playbook::Props::Enum,
|
22
20
|
values: %w[multi single],
|
23
21
|
default: "multi"
|
@@ -35,7 +33,6 @@ module Playbook
|
|
35
33
|
returnAllSelected: return_all_selected,
|
36
34
|
selectedIds: selected_ids,
|
37
35
|
input_name: input_name,
|
38
|
-
ultimateChildrenOnly: ultimate_children_only,
|
39
36
|
variant: variant,
|
40
37
|
}
|
41
38
|
end
|
@@ -1,12 +1,37 @@
|
|
1
|
-
|
1
|
+
<%# Example data for demonstration purposes %>
|
2
|
+
<% data_rows = [
|
3
|
+
{ 'territory' => 'North', 'firstname' => 'John', 'lastname' => 'Doe', 'age' => 30, 'job' => 'Engineer' },
|
4
|
+
{ 'territory' => 'South', 'firstname' => 'Alice', 'lastname' => 'Smith', 'age' => 28, 'job' => 'Designer' },
|
5
|
+
{ 'territory' => 'East', 'firstname' => 'Mike', 'lastname' => 'Johnson', 'age' => 35, 'job' => 'Manager' },
|
6
|
+
{ 'territory' => 'West', 'firstname' => 'Sarah', 'lastname' => 'Brown', 'age' => 29, 'job' => 'Developer' },
|
7
|
+
{ 'territory' => 'Central', 'firstname' => 'David', 'lastname' => 'Wilson', 'age' => 32, 'job' => 'Analyst' }
|
8
|
+
]
|
9
|
+
%>
|
10
|
+
|
11
|
+
<%# Example sort method for demonstration purposes %>
|
12
|
+
<% if params["sort"] %>
|
13
|
+
<% sort_param = params["sort"].gsub(/_(asc|desc)\z/, "") %>
|
14
|
+
<% sort_direction = params["sort"].end_with?("_asc") ? 1 : -1 %>
|
15
|
+
<% data_rows.sort! do |a, b|
|
16
|
+
value_a = a[sort_param]
|
17
|
+
value_b = b[sort_param]
|
18
|
+
|
19
|
+
value_a = value_a.to_i if value_a.is_a?(String) && value_a.match?(/^\d+$/)
|
20
|
+
value_b = value_b.to_i if value_b.is_a?(String) && value_b.match?(/^\d+$/)
|
21
|
+
|
22
|
+
sort_direction * (value_a <=> value_b)
|
23
|
+
end %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<%= pb_rails("table", props: { data_table: true, vertical_border: true, id: "table-header" } ) do %>
|
2
27
|
<thead>
|
3
28
|
<tr>
|
4
29
|
<%= pb_rails("table/table_header", props: {
|
5
30
|
text: "Territory",
|
6
31
|
id: "territory",
|
7
32
|
sort_menu: [
|
8
|
-
{ item: "Territory", link: "?sort=
|
9
|
-
{ item: "Territory", link: "?sort=
|
33
|
+
{ item: "Territory", link: "?sort=territory_asc#table-header", active: params["sort"] == "territory_asc", direction: "asc" },
|
34
|
+
{ item: "Territory", link: "?sort=territory_desc#table-header", active: params["sort"] == "territory_desc", direction: "desc" }
|
10
35
|
],
|
11
36
|
}) %>
|
12
37
|
<%= pb_rails("table/table_header", props: {
|
@@ -14,45 +39,36 @@
|
|
14
39
|
text: "Full Name",
|
15
40
|
colspan: 2,
|
16
41
|
sort_menu: [
|
17
|
-
{ item: "First Name Descending", link: "?sort=firstname_desc", active: params["sort"] == "firstname_desc", direction: "desc" },
|
18
|
-
{ item: "First Name Ascending", link: "?sort=firstname_asc", active: params["sort"] == "firstname_asc", direction: "asc" },
|
19
|
-
{ item: "Last Name Descending", link: "?sort=lastname_desc", active: params["sort"] == "lastname_desc", direction: "desc" },
|
20
|
-
{ item: "Last Name Ascending", link: "?sort=lastname_asc", active: params["sort"] == "lastname_asc", direction: "asc" }
|
42
|
+
{ item: "First Name Descending", link: "?sort=firstname_desc#table-header", active: params["sort"] == "firstname_desc", direction: "desc" },
|
43
|
+
{ item: "First Name Ascending", link: "?sort=firstname_asc#table-header", active: params["sort"] == "firstname_asc", direction: "asc" },
|
44
|
+
{ item: "Last Name Descending", link: "?sort=lastname_desc#table-header", active: params["sort"] == "lastname_desc", direction: "desc" },
|
45
|
+
{ item: "Last Name Ascending", link: "?sort=lastname_asc#table-header", active: params["sort"] == "lastname_asc", direction: "asc" }
|
21
46
|
],
|
22
47
|
}) %>
|
23
48
|
<%= pb_rails("table/table_header", props: {
|
24
49
|
text: "Age",
|
25
50
|
id: "age",
|
26
|
-
sort_dropdown: true,
|
27
51
|
sort_menu: [
|
28
|
-
{ item: "Age Descending", link: "?sort=age_desc", active: params["sort"] == "age_desc", direction: "desc" },
|
29
|
-
{ item: "Age Ascending", link: "?sort=age_asc", active: params["sort"] == "age_asc", direction: "asc" }
|
52
|
+
{ item: "Age Descending", link: "?sort=age_desc#table-header", active: params["sort"] == "age_desc", direction: "desc" },
|
53
|
+
{ item: "Age Ascending", link: "?sort=age_asc#table-header", active: params["sort"] == "age_asc", direction: "asc" }
|
30
54
|
],
|
31
55
|
}) %>
|
32
56
|
<%= pb_rails("table/table_header", props: { text: "Job Title" }) %>
|
33
57
|
</tr>
|
34
58
|
</thead>
|
35
59
|
<tbody>
|
36
|
-
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
</tr>
|
50
|
-
<tr>
|
51
|
-
<td>Ter 3</td>
|
52
|
-
<td>First Name 3</td>
|
53
|
-
<td>Last Name 3</td>
|
54
|
-
<td>Age 3</td>
|
55
|
-
<td>Job 3</td>
|
56
|
-
</tr>
|
60
|
+
<% data_rows.each do |row| %>
|
61
|
+
<tr>
|
62
|
+
<% row.each do |key, value| %>
|
63
|
+
<%= pb_rails("background", props: {
|
64
|
+
background_color: (params["sort"] && params["sort"].start_with?(key) ? "info_subtle" : "card_light"),
|
65
|
+
text_align: (value.is_a?(Integer) ? "right" : ""),
|
66
|
+
tag: "td"
|
67
|
+
}) do %>
|
68
|
+
<%= value %>
|
69
|
+
<% end %>
|
70
|
+
<% end %>
|
71
|
+
</tr>
|
72
|
+
<% end %>
|
57
73
|
</tbody>
|
58
74
|
<% end %>
|
@@ -6,3 +6,8 @@ presence of `sort_menu` enables the sort link within the header
|
|
6
6
|
* `sort_dropdown` (boolean) optionally declares that (true) clicking a header's sort link opens a dropdown of sort options, or (false) each sort link click cycles through available sort_menu items in the order they are passed
|
7
7
|
* passing a valid `colspan` will render sort options within a dropdown by default, without requiring `sort_dropdown` explicitly. Alternatively, the default sort dropdown can be prevented on headers with `colspan` by setting `sort_dropdown: false`, which reverts the column to sorting to multi-click default (each click of the sort link cycles through the available sort_menu items in the order they are passed)
|
8
8
|
* `id` (string) is required for headers that have a dropdown (for popover reference); otherwise they are optional
|
9
|
+
|
10
|
+
</br>
|
11
|
+
<div class="pb_pill_kit_warning"><div class="pb_title_kit_size_4 pb_pill_text">Disclaimer</div></div>
|
12
|
+
|
13
|
+
This example uses a custom sort method that may need to be modified or replaced within your project.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
aria: object.aria,
|
4
4
|
class: object.classname,
|
5
5
|
data: object.data,
|
6
|
-
id: "pb-th#{object.id}") do %>
|
6
|
+
id: "pb-th#{object.id}" ) do %>
|
7
7
|
<% unless sorting_style? %>
|
8
8
|
<%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_nolink" }) do %>
|
9
9
|
<%= content.presence || object.text %>
|
@@ -5,7 +5,6 @@ import { globalProps } from "../utilities/globalProps";
|
|
5
5
|
import { buildAriaProps, buildDataProps } from "../utilities/props";
|
6
6
|
|
7
7
|
import HighchartsReact from "highcharts-react-official";
|
8
|
-
import Highcharts from "highcharts";
|
9
8
|
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
10
9
|
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
11
10
|
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
@@ -13,24 +12,24 @@ import treemap from 'highcharts/modules/treemap'
|
|
13
12
|
|
14
13
|
type TreemapChartProps = {
|
15
14
|
chartData: {
|
16
|
-
name: string
|
17
|
-
parent?: string | number
|
18
|
-
value: number
|
19
|
-
color?: string
|
20
|
-
id?: string | number
|
21
|
-
}[]
|
22
|
-
className?: string
|
23
|
-
colors: string[]
|
24
|
-
dark?: boolean
|
25
|
-
drillable: boolean
|
26
|
-
grouped: boolean
|
27
|
-
height?: string
|
28
|
-
id: number | string
|
29
|
-
title?: string
|
30
|
-
tooltipHtml: string
|
31
|
-
type?: string
|
32
|
-
aria?: { [key: string]: string }
|
33
|
-
data?: { [key: string]: string }
|
15
|
+
name: string,
|
16
|
+
parent?: string | number,
|
17
|
+
value: number,
|
18
|
+
color?: string,
|
19
|
+
id?: string | number,
|
20
|
+
}[],
|
21
|
+
className?: string,
|
22
|
+
colors: string[],
|
23
|
+
dark?: boolean,
|
24
|
+
drillable: boolean,
|
25
|
+
grouped: boolean,
|
26
|
+
height?: string,
|
27
|
+
id: number | string,
|
28
|
+
title?: string,
|
29
|
+
tooltipHtml: string,
|
30
|
+
type?: string,
|
31
|
+
aria?: { [key: string]: string },
|
32
|
+
data?: { [key: string]: string },
|
34
33
|
};
|
35
34
|
|
36
35
|
const TreemapChart = ({
|
@@ -50,13 +49,6 @@ const TreemapChart = ({
|
|
50
49
|
}: TreemapChartProps) => {
|
51
50
|
const ariaProps = buildAriaProps(aria);
|
52
51
|
const dataProps = buildDataProps(data);
|
53
|
-
const setupTheme = () => {
|
54
|
-
dark
|
55
|
-
? Highcharts.setOptions(highchartsDarkTheme)
|
56
|
-
: Highcharts.setOptions(highchartsTheme);
|
57
|
-
};
|
58
|
-
treemap(Highcharts)
|
59
|
-
setupTheme();
|
60
52
|
|
61
53
|
const staticOptions = {
|
62
54
|
title: {
|
@@ -88,13 +80,26 @@ const TreemapChart = ({
|
|
88
80
|
};
|
89
81
|
|
90
82
|
const [options, setOptions] = useState({});
|
83
|
+
const [isHighchartsLoaded, setIsHighchartsLoaded] = useState(false);
|
91
84
|
|
92
85
|
useEffect(() => {
|
93
|
-
|
94
86
|
setOptions({ ...staticOptions });
|
87
|
+
|
88
|
+
const interval = setInterval(() => {
|
89
|
+
if (window.Highcharts) {
|
90
|
+
clearInterval(interval)
|
91
|
+
dark
|
92
|
+
? window.Highcharts.setOptions(highchartsDarkTheme)
|
93
|
+
: window.Highcharts.setOptions(highchartsTheme)
|
94
|
+
|
95
|
+
treemap(window.Highcharts)
|
96
|
+
setIsHighchartsLoaded(true)
|
97
|
+
}
|
98
|
+
}, 0)
|
95
99
|
}, [chartData]);
|
96
100
|
|
97
101
|
return (
|
102
|
+
isHighchartsLoaded &&
|
98
103
|
<HighchartsReact
|
99
104
|
containerProps={{
|
100
105
|
className: classnames(globalProps(props), "pb_treemap_chart"),
|
@@ -102,7 +107,7 @@ const TreemapChart = ({
|
|
102
107
|
...ariaProps,
|
103
108
|
...dataProps,
|
104
109
|
}}
|
105
|
-
highcharts={Highcharts}
|
110
|
+
highcharts={window.Highcharts}
|
106
111
|
options={options}
|
107
112
|
/>
|
108
113
|
);
|