playbook_ui 13.9.0 → 13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21328

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default_swift.md +12 -0
  3. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_monogram_swift.md +12 -0
  4. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_props_swift.md +8 -0
  5. data/app/pb_kits/playbook/pb_avatar/docs/example.yml +3 -1
  6. data/app/pb_kits/playbook/pb_background/_background.tsx +103 -52
  7. data/app/pb_kits/playbook/pb_badge/docs/_badge_colors_swift.md +1 -1
  8. data/app/pb_kits/playbook/pb_button/_button.scss +2 -2
  9. data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +27 -22
  10. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +6 -1
  11. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +272 -111
  12. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.html.erb +6 -7
  13. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.jsx +1 -1
  14. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.html.erb +73 -0
  15. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.jsx +87 -0
  16. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.html.erb +74 -0
  17. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.jsx +88 -0
  18. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +5 -2
  19. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +3 -1
  20. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +10 -0
  21. data/dist/playbook-rails.js +5 -5
  22. data/lib/playbook/version.rb +2 -2
  23. metadata +14 -8
  24. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_swift.md +0 -82
@@ -0,0 +1,87 @@
1
+ import React from "react";
2
+ import MultiLevelSelect from "../_multi_level_select";
3
+
4
+ const treeData = [
5
+ {
6
+ label: "Power Home Remodeling",
7
+ value: "Power Home Remodeling",
8
+ id: "powerhome2",
9
+ expanded: true,
10
+ children: [
11
+ {
12
+ label: "People",
13
+ value: "People",
14
+ id: "people2",
15
+ expanded: true,
16
+ children: [
17
+ {
18
+ label: "Talent Acquisition",
19
+ value: "Talent Acquisition",
20
+ id: "talent2",
21
+ },
22
+ {
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
+ ],
38
+ },
39
+ {
40
+ label: "People Experience",
41
+ value: "People Experience",
42
+ id: "experience2",
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ label: "Contact Center",
48
+ value: "Contact Center",
49
+ id: "contact2",
50
+ children: [
51
+ {
52
+ label: "Appointment Management",
53
+ value: "Appointment Management",
54
+ id: "appointment2",
55
+ },
56
+ {
57
+ label: "Customer Service",
58
+ value: "Customer Service",
59
+ id: "customer2",
60
+ },
61
+ {
62
+ label: "Energy",
63
+ value: "Energy",
64
+ id: "energy2",
65
+ },
66
+ ],
67
+ },
68
+ ],
69
+ },
70
+ ];
71
+
72
+ const MultiLevelSelectSingle = (props) => {
73
+ return (
74
+ <div>
75
+ <MultiLevelSelect
76
+ id="multiselect-single"
77
+ inputName="Power"
78
+ onSelect={(selectedNode) => console.log("Selected Node", selectedNode)}
79
+ treeData={treeData}
80
+ variant="single"
81
+ {...props}
82
+ />
83
+ </div>
84
+ )
85
+ };
86
+
87
+ export default MultiLevelSelectSingle;
@@ -0,0 +1,74 @@
1
+ <% treeData = [{
2
+ label: "Power Home Remodeling",
3
+ value: "Power Home Remodeling",
4
+ id: "300",
5
+ expanded: true,
6
+ children: [
7
+ {
8
+ label: "People",
9
+ value: "People",
10
+ id: "301",
11
+ expanded: true,
12
+ children: [
13
+ {
14
+ label: "Talent Acquisition",
15
+ value: "Talent Acquisition",
16
+ id: "302",
17
+ },
18
+ {
19
+ label: "Business Affairs",
20
+ value: "Business Affairs",
21
+ id: "303",
22
+ children: [
23
+ {
24
+ label: "Initiatives",
25
+ value: "Initiatives",
26
+ id: "304",
27
+ },
28
+ {
29
+ label: "Learning & Development",
30
+ value: "Learning & Development",
31
+ id: "305",
32
+ },
33
+ ],
34
+ },
35
+ {
36
+ label: "People Experience",
37
+ value: "People Experience",
38
+ id: "306",
39
+ },
40
+ ],
41
+ },
42
+ {
43
+ label: "Contact Center",
44
+ value: "Contact Center",
45
+ id: "307",
46
+ children: [
47
+ {
48
+ label: "Appointment Management",
49
+ value: "Appointment Management",
50
+ id: "308",
51
+ },
52
+ {
53
+ label: "Customer Service",
54
+ value: "Customer Service",
55
+ id: "309",
56
+ },
57
+ {
58
+ label: "Energy",
59
+ value: "Energy",
60
+ id: "310",
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ }] %>
66
+
67
+ <%= pb_rails("multi_level_select", props: {
68
+ id: "multi-level-select-single-children-only-rails",
69
+ name: "my_single_children_only_select_array",
70
+ tree_data: treeData,
71
+ input_name: "PowerChildren",
72
+ ultimate_children_only: true,
73
+ variant: "single"
74
+ }) %>
@@ -0,0 +1,88 @@
1
+ import React from "react";
2
+ import MultiLevelSelect from "../_multi_level_select";
3
+
4
+ const treeData = [
5
+ {
6
+ label: "Power Home Remodeling",
7
+ value: "Power Home Remodeling",
8
+ id: "powerhome3",
9
+ expanded: true,
10
+ children: [
11
+ {
12
+ label: "People",
13
+ value: "People",
14
+ id: "people3",
15
+ expanded: true,
16
+ children: [
17
+ {
18
+ label: "Talent Acquisition",
19
+ value: "Talent Acquisition",
20
+ id: "talent3",
21
+ },
22
+ {
23
+ label: "Business Affairs",
24
+ value: "Business Affairs",
25
+ id: "business3",
26
+ children: [
27
+ {
28
+ label: "Initiatives",
29
+ value: "Initiatives",
30
+ id: "initiative3",
31
+ },
32
+ {
33
+ label: "Learning & Development",
34
+ value: "Learning & Development",
35
+ id: "development3",
36
+ },
37
+ ],
38
+ },
39
+ {
40
+ label: "People Experience",
41
+ value: "People Experience",
42
+ id: "experience3",
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ label: "Contact Center",
48
+ value: "Contact Center",
49
+ id: "contact3",
50
+ children: [
51
+ {
52
+ label: "Appointment Management",
53
+ value: "Appointment Management",
54
+ id: "appointment3",
55
+ },
56
+ {
57
+ label: "Customer Service",
58
+ value: "Customer Service",
59
+ id: "customer3",
60
+ },
61
+ {
62
+ label: "Energy",
63
+ value: "Energy",
64
+ id: "energy3",
65
+ },
66
+ ],
67
+ },
68
+ ],
69
+ },
70
+ ];
71
+
72
+ const MultiLevelSelectSingleChildrenOnly = (props) => {
73
+ return (
74
+ <div>
75
+ <MultiLevelSelect
76
+ id="multiselect-single-children-only"
77
+ inputName="PowerChildren"
78
+ onSelect={(selectedNode) => console.log("Selected Node", selectedNode)}
79
+ treeData={treeData}
80
+ ultimateChildrenOnly
81
+ variant="single"
82
+ {...props}
83
+ />
84
+ </div>
85
+ )
86
+ };
87
+
88
+ export default MultiLevelSelectSingleChildrenOnly;
@@ -1,12 +1,15 @@
1
1
  examples:
2
2
  rails:
3
3
  - multi_level_select_default: Default
4
+ - multi_level_select_single: Single Select
5
+ - multi_level_select_single_children_only: Single Select Ultimate Children Only
4
6
  - multi_level_select_return_all_selected: Return All Selected
5
7
  - multi_level_select_selected_ids: Selected Ids
6
8
  - multi_level_select_with_form: With Form
7
-
9
+
8
10
  react:
9
11
  - multi_level_select_default: Default
12
+ - multi_level_select_single: Single Select
13
+ - multi_level_select_single_children_only: Single Select Ultimate Children Only
10
14
  - multi_level_select_return_all_selected: Return All Selected
11
15
  - multi_level_select_selected_ids: Selected Ids
12
-
@@ -1,3 +1,5 @@
1
1
  export { default as MultiLevelSelectDefault } from './_multi_level_select_default.jsx'
2
+ export { default as MultiLevelSelectSingle } from './_multi_level_select_single.jsx'
3
+ export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_select_single_children_only.jsx'
2
4
  export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
3
- export { default as MultiLevelSelectSelectedIds } from "./_multi_level_select_selected_ids.jsx"
5
+ export { default as MultiLevelSelectSelectedIds } from "./_multi_level_select_selected_ids.jsx"
@@ -14,6 +14,13 @@ module Playbook
14
14
  prop :input_display, type: Playbook::Props::Enum,
15
15
  values: %w[pills none],
16
16
  default: "pills"
17
+ prop :input_name, type: Playbook::Props::String,
18
+ default: ""
19
+ prop :ultimate_children_only, type: Playbook::Props::Boolean,
20
+ default: false
21
+ prop :variant, type: Playbook::Props::Enum,
22
+ values: %w[multi single],
23
+ default: "multi"
17
24
 
18
25
  def classname
19
26
  generate_classname("pb_multi_level_select")
@@ -27,6 +34,9 @@ module Playbook
27
34
  treeData: tree_data,
28
35
  returnAllSelected: return_all_selected,
29
36
  selectedIds: selected_ids,
37
+ input_name: input_name,
38
+ ultimateChildrenOnly: ultimate_children_only,
39
+ variant: variant,
30
40
  }
31
41
  end
32
42
  end