playbook_ui_docs 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4073 → 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4077
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_multi_level_select/docs/_multi_level_select_reset.html.erb +93 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +1 -0
- data/dist/playbook-doc.js +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 023c7d0d1b7b60c99fc7d498cc623ad011939c8d159b4f7e0273452554ae281a
|
4
|
+
data.tar.gz: b6895dfcf94b2ccb86f5e8d48929de5d093f50780f352cffb531bb3929a6a243
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 618f0cfcab6553eff5682597bb9dad76bb1224628c246db143844dca2c4b01aae0c4687c342f9e374c3c2a07fcfa795e6fc649dc1c872ffef51150018c93f19e
|
7
|
+
data.tar.gz: 29dec1c961a385eded51856b6b73627af9994cc3002c85b40d0f8b01bd51225ddfbab08b0267915259db5bb1fff330ed8629c1de310bb6e2acf1e724332864a5
|
@@ -0,0 +1,93 @@
|
|
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
|
+
expanded: true,
|
12
|
+
children: [
|
13
|
+
{
|
14
|
+
label: "Talent Acquisition",
|
15
|
+
value: "Talent Acquisition",
|
16
|
+
id: "102",
|
17
|
+
},
|
18
|
+
{
|
19
|
+
label: "Business Affairs",
|
20
|
+
value: "Business Affairs",
|
21
|
+
id: "103",
|
22
|
+
children: [
|
23
|
+
{
|
24
|
+
label: "Initiatives",
|
25
|
+
value: "Initiatives",
|
26
|
+
id: "104",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
label: "Learning & Development",
|
30
|
+
value: "Learning & Development",
|
31
|
+
id: "105",
|
32
|
+
},
|
33
|
+
],
|
34
|
+
},
|
35
|
+
{
|
36
|
+
label: "People Experience",
|
37
|
+
value: "People Experience",
|
38
|
+
id: "106",
|
39
|
+
},
|
40
|
+
],
|
41
|
+
},
|
42
|
+
{
|
43
|
+
label: "Contact Center",
|
44
|
+
value: "Contact Center",
|
45
|
+
id: "107",
|
46
|
+
children: [
|
47
|
+
{
|
48
|
+
label: "Appointment Management",
|
49
|
+
value: "Appointment Management",
|
50
|
+
id: "108",
|
51
|
+
},
|
52
|
+
{
|
53
|
+
label: "Customer Service",
|
54
|
+
value: "Customer Service",
|
55
|
+
id: "109",
|
56
|
+
},
|
57
|
+
{
|
58
|
+
label: "Energy",
|
59
|
+
value: "Energy",
|
60
|
+
id: "110",
|
61
|
+
},
|
62
|
+
],
|
63
|
+
},
|
64
|
+
],
|
65
|
+
}] %>
|
66
|
+
|
67
|
+
<%= pb_rails("multi_level_select", props: {
|
68
|
+
id: "multi-level-select-reset-example",
|
69
|
+
name: "my_array",
|
70
|
+
tree_data: treeData,
|
71
|
+
return_all_selected: true
|
72
|
+
}) %>
|
73
|
+
|
74
|
+
<%= pb_rails("button", props: { text: "Reset", margin_top: "lg", id:"multilevelselect-reset-button" }) %>
|
75
|
+
|
76
|
+
|
77
|
+
<script>
|
78
|
+
window.addEventListener('DOMContentLoaded', () => {
|
79
|
+
const exampleResetButton = document.querySelector("#multilevelselect-reset-button");
|
80
|
+
|
81
|
+
exampleResetButton.addEventListener("click", () => {
|
82
|
+
clearMultiLevelSelectById('multi-level-select-reset-example');
|
83
|
+
});
|
84
|
+
function clearMultiLevelSelectById(id) {
|
85
|
+
const clearFunction = window[`clearMultiLevelSelect_${id}`];
|
86
|
+
if (clearFunction) {
|
87
|
+
clearFunction();
|
88
|
+
} else {
|
89
|
+
console.warn(`No clear function found for MultiLevelSelect with id: ${id}`);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
})
|
93
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
In order to clear the multilevelselect selection using an external trigger (like a reset button), the `clearMultiLevelSelect` function can be used. See the code snippet below to see this in action. The function is scoped by id so an id MUST be used on the multilevelselect kit and passed to the function as shown for it to work.
|