playbook_ui 12.26.1.pre.alpha.railsmultilevelimprovements842 → 12.26.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,75 +1,72 @@
1
1
  <% treeData = [{
2
2
  label: "Power Home Remodeling",
3
3
  value: "Power Home Remodeling",
4
- id: "100",
4
+ id: "powerhome1",
5
5
  expanded: true,
6
+
6
7
  children: [
7
8
  {
8
9
  label: "People",
9
10
  value: "People",
10
- id: "101",
11
+ id: "people1",
11
12
  children: [
12
13
  {
13
14
  label: "Talent Acquisition",
14
15
  value: "Talent Acquisition",
15
- id: "102",
16
+ id: "talent1",
16
17
  },
17
18
  {
18
19
  label: "Business Affairs",
19
20
  value: "Business Affairs",
20
- id: "103",
21
+ id: "business1",
21
22
  children: [
22
23
  {
23
24
  label: "Initiatives",
24
25
  value: "Initiatives",
25
- id: "104",
26
+ id: "initiative1",
26
27
  },
27
28
  {
28
29
  label: "Learning & Development",
29
30
  value: "Learning & Development",
30
- id: "105",
31
+ id: "development1",
31
32
  },
32
33
  ],
33
34
  },
34
35
  {
35
36
  label: "People Experience",
36
37
  value: "People Experience",
37
- id: "106",
38
+ id: "experience1",
38
39
  },
39
40
  ],
40
41
  },
41
42
  {
42
43
  label: "Contact Center",
43
44
  value: "Contact Center",
44
- id: "107",
45
+ id: "contact1",
45
46
  children: [
46
47
  {
47
48
  label: "Appointment Management",
48
49
  value: "Appointment Management",
49
- id: "108",
50
+ id: "appointment1",
50
51
  },
51
52
  {
52
53
  label: "Customer Service",
53
54
  value: "Customer Service",
54
- id: "109",
55
+ id: "customer1",
55
56
  },
56
57
  {
57
58
  label: "Energy",
58
59
  value: "Energy",
59
- id: "110",
60
+ id: "energy1",
60
61
  },
61
62
  ],
62
63
  },
63
64
  ],
64
- }] %>
65
-
66
-
65
+ }] %>
67
66
 
68
67
 
69
68
  <%= pb_rails("multi_level_select", props: {
70
- id: "multi-level-select-return-all-selected-rails",
71
- name: "my_data_array",
72
- tree_data: treeData,
69
+ id: "parent-persistence-multi-level-select",
70
+ tree_data:treeData,
73
71
  return_all_selected: true
74
- }) %>
75
-
72
+ }) %>
@@ -72,9 +72,9 @@ const MultiLevelSelectReturnAllSelected = (props) => {
72
72
  return (
73
73
  <div>
74
74
  <MultiLevelSelect
75
- id="multi-level-select-return-all-selected"
75
+ id="multiselect-parent-persistence"
76
76
  onSelect={(selectedNodes) =>
77
- console.log("Selected Items with Return All Selected Data", selectedNodes)
77
+ console.log("Selected Items", selectedNodes)
78
78
  }
79
79
  returnAllSelected
80
80
  treeData={treeData}
@@ -2,7 +2,6 @@ examples:
2
2
  rails:
3
3
  - multi_level_select_default: Default
4
4
  - multi_level_select_return_all_selected: Return All Selected
5
- - multi_level_select_with_form: With Form
6
5
 
7
6
  react:
8
7
  - multi_level_select_default: Default
@@ -1,7 +1,3 @@
1
- <%= content_tag(:div,
2
- aria: object.aria,
3
- data: object.data,
4
- id: object.id,
5
- class: object.classname) do %>
6
- <%= react_component("MultiLevelSelect", object.multi_level_select_options) %>
7
- <% end %>
1
+ <div id="pb_data_wrapper_<%= object.id %>" data-tree="">
2
+ <%= react_component("MultiLevelSelect", object.multi_level_select_options ) %>
3
+ </div>
@@ -3,14 +3,10 @@
3
3
  module Playbook
4
4
  module PbMultiLevelSelect
5
5
  class MultiLevelSelect < Playbook::KitBase
6
- prop :id
7
- prop :name
8
6
  prop :tree_data, type: Playbook::Props::Array,
9
7
  default: []
10
8
  prop :return_all_selected, type: Playbook::Props::Boolean,
11
9
  default: false
12
- prop :return_complete_data, type: Playbook::Props::Boolean,
13
- default: false
14
10
 
15
11
  def classname
16
12
  generate_classname("pb_multi_level_select")
@@ -19,10 +15,8 @@ module Playbook
19
15
  def multi_level_select_options
20
16
  {
21
17
  id: id,
22
- name: name,
23
18
  treeData: tree_data,
24
19
  returnAllSelected: return_all_selected,
25
- returnCompleteData: return_complete_data,
26
20
  }
27
21
  end
28
22
  end