playbook_ui_docs 12.30.1.pre.alpha.PLAY906multilevelselectedidsprop916 → 12.30.1.pre.alpha.PLAY906multilevelselectedidsprop917

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4d3a4967fb4c8f9593eb1ceebc7e7a69717a82bf2aee336027758a80f9f8980
4
- data.tar.gz: 52c186d4eda53fca37c5d5da2a8feca7bac8186a599574c4cd61e936f45ea164
3
+ metadata.gz: 28fa02afaade79bc679ffc4c72c34f0a300b0e6f8e1a537f38ea877379b6050d
4
+ data.tar.gz: df08a3924b7358c54568eeb0226f3fbbafb611dfb5f63c6168c2b251a7e46f6e
5
5
  SHA512:
6
- metadata.gz: 2e6c6478d5af03fd81e6dc2f24e31242300fb3cd0250f0b0924ee7d82d3817f791305b90f4800cd225215d31d64e9ba3ee7abad72abee05883610c9a9be40fc1
7
- data.tar.gz: fe23dbdf929fe2fc97bc2f7ddd154f569a47276851baa1b016a51c8bd9cd401e14b39cbd13ea673842c29e8df12430de717d9830496248d2c513279b78541d9d
6
+ metadata.gz: 77d58ee8f64a111a6b13fda285e05d6a768f6f46a6a60386b0bb8829e09f5ebd9f233dabda240b8fa4e14fb82d2131072a8a2ef8225477354f8d9a219cf7ee65
7
+ data.tar.gz: 03abe7476d9abd96f78fb76309ff100e89ba7570e2e223d18e03930608c01560456e2f9b6e44582be59453a2e6c07e16f626a566aaeab39d30300fe57c80b059
@@ -0,0 +1,76 @@
1
+ <% treeData = [{
2
+ label: "Power Home Remodeling",
3
+ value: "Power Home Remodeling",
4
+ id: "100",
5
+ expanded: true,
6
+ children: [
7
+ {
8
+ label: "People",
9
+ value: "People",
10
+ id: "101",
11
+ children: [
12
+ {
13
+ label: "Talent Acquisition",
14
+ value: "Talent Acquisition",
15
+ id: "102",
16
+ },
17
+ {
18
+ label: "Business Affairs",
19
+ value: "Business Affairs",
20
+ id: "103",
21
+ children: [
22
+ {
23
+ label: "Initiatives",
24
+ value: "Initiatives",
25
+ id: "104",
26
+ },
27
+ {
28
+ label: "Learning & Development",
29
+ value: "Learning & Development",
30
+ id: "105",
31
+ },
32
+ ],
33
+ },
34
+ {
35
+ label: "People Experience",
36
+ value: "People Experience",
37
+ id: "106",
38
+ },
39
+ ],
40
+ },
41
+ {
42
+ label: "Contact Center",
43
+ value: "Contact Center",
44
+ id: "107",
45
+ children: [
46
+ {
47
+ label: "Appointment Management",
48
+ value: "Appointment Management",
49
+ id: "108",
50
+ },
51
+ {
52
+ label: "Customer Service",
53
+ value: "Customer Service",
54
+ id: "109",
55
+ },
56
+ {
57
+ label: "Energy",
58
+ value: "Energy",
59
+ id: "110",
60
+ },
61
+ ],
62
+ },
63
+ ],
64
+ }] %>
65
+
66
+
67
+
68
+
69
+ <%= pb_rails("multi_level_select", props: {
70
+ id: "multi-level-select-seelcted_ids",
71
+ name: "my_data_array_selected",
72
+ return_all_selected: true,
73
+ selected_ids:["110","102"],
74
+ tree_data: treeData,
75
+ }) %>
76
+
@@ -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: "powerhome1",
9
+ expanded: true,
10
+ children: [
11
+ {
12
+ label: "People",
13
+ value: "People",
14
+ id: "people1",
15
+ children: [
16
+ {
17
+ label: "Talent Acquisition",
18
+ value: "Talent Acquisition",
19
+ id: "talent1",
20
+ },
21
+ {
22
+ label: "Business Affairs",
23
+ value: "Business Affairs",
24
+ id: "business1",
25
+ children: [
26
+ {
27
+ label: "Initiatives",
28
+ value: "Initiatives",
29
+ id: "initiative1",
30
+ },
31
+ {
32
+ label: "Learning & Development",
33
+ value: "Learning & Development",
34
+ id: "development1",
35
+ },
36
+ ],
37
+ },
38
+ {
39
+ label: "People Experience",
40
+ value: "People Experience",
41
+ id: "experience1",
42
+ },
43
+ ],
44
+ },
45
+ {
46
+ label: "Contact Center",
47
+ value: "Contact Center",
48
+ id: "contact1",
49
+ children: [
50
+ {
51
+ label: "Appointment Management",
52
+ value: "Appointment Management",
53
+ id: "appointment1",
54
+ },
55
+ {
56
+ label: "Customer Service",
57
+ value: "Customer Service",
58
+ id: "customer1",
59
+ },
60
+ {
61
+ label: "Energy",
62
+ value: "Energy",
63
+ id: "energy1",
64
+ },
65
+ ],
66
+ },
67
+ ],
68
+ },
69
+ ];
70
+
71
+ const MultiLevelSelectSelectedIds = (props) => {
72
+ return (
73
+ <div>
74
+ <MultiLevelSelect
75
+ id="multi-level-select-selected_ids"
76
+ onSelect={(selectedNodes) =>
77
+ console.log("Selected Items with Return All Selected Data", selectedNodes)
78
+ }
79
+ returnAllSelected
80
+ selectedIds={["energy1","talent1"]}
81
+ treeData={treeData}
82
+ {...props}
83
+ />
84
+ </div>
85
+ );
86
+ };
87
+
88
+ export default MultiLevelSelectSelectedIds;
@@ -0,0 +1,3 @@
1
+ The `selectedIds` prop (`selected_ids` for Rails) allows you to pass in an array of ids that, if present, will mark the corresponding nodes on the treeData as checked on page load. The prop however is optional, and items that include checked:true on the treeData itself will also load checked data.
2
+
3
+ When an item is marked as checked on page load, the dropdown will expand to show the checked items for easier accessibility.
@@ -2,9 +2,11 @@ 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_selected_ids: Selected Ids
5
6
  - multi_level_select_with_form: With Form
6
7
 
7
8
  react:
8
9
  - multi_level_select_default: Default
9
10
  - multi_level_select_return_all_selected: Return All Selected
11
+ - multi_level_select_selected_ids: Selected Ids
10
12
 
@@ -1,2 +1,3 @@
1
1
  export { default as MultiLevelSelectDefault } from './_multi_level_select_default.jsx'
2
- export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
2
+ export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
3
+ export { default as MultiLevelSelectSelectedIds } from "./_multi_level_select_selected_ids.jsx"