playbook_ui 13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21358 → 13.10.0.pre.alpha.dependabotnpmandyarntiptapextensionlink21121407
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_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_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/dist/playbook-rails.js +5 -5
- data/lib/playbook/version.rb +1 -1
- metadata +21 -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
@@ -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 %>
|