playbook_ui 13.8.0.pre.alpha.PLAY962SingleSelect1256 → 13.8.0.pre.alpha.PLAY1016reactionbuttonemojibug1245
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_button/_button.tsx +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +22 -27
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +1 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +111 -257
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.html.erb +7 -6
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.jsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -7
- data/dist/playbook-rails.js +5 -5
- data/lib/playbook/version.rb +1 -1
- metadata +2 -4
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.html.erb +0 -73
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.jsx +0 -88
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffbc0de9897a5a39191f65def3ab36d7a9addfba0d1aadafaeafdd49e46cf125
|
4
|
+
data.tar.gz: 812f051276f0e616e9840dbcf2e974c2ac674edf2c40be72a3a104f8c201b652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 570df4d72fdec4376ef4e899e71513012e3653c8ec926b91029f143f3c439dba769fd2840cb6be745ad85dfc835a00a0a39f54c1ead9e576d8dea3443ecd03c4
|
7
|
+
data.tar.gz: f5740a5b50db2488cd4c932c00fd5b8324dad33bb6a67daf61a3d10e51b0e0c14fac249fd4d745b2c4dbb067b780111897fd561b9943e7047e2d1c95d97836df
|
@@ -40,7 +40,7 @@ type ButtonPropTypes = {
|
|
40
40
|
|
41
41
|
const isValidEmoji = (emoji: string) => {
|
42
42
|
// Using regular expression to check if the string is a valid emoji/emoji Unicode
|
43
|
-
const emojiRegex = /^(\p{Emoji}|\uFE0F)+$/u;
|
43
|
+
const emojiRegex = /^(\p{Emoji}|\uFE0F|\u200D|\u20E3)+$/u;
|
44
44
|
return emojiRegex.test(emoji);
|
45
45
|
};
|
46
46
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= pb_rails("button", props: { count: 153, highlight: false, icon: "🎉", classname: "count", id: "reaction-button-highlight", variant: "reaction" }) %>
|
2
|
-
<%= pb_rails("button", props: { count: 5, icon: "
|
2
|
+
<%= pb_rails("button", props: { count: 5, icon: "1️⃣", variant: "reaction", margin_left: "lg" }) %>
|
3
3
|
<%= pb_rails("button", props: { variant: "reaction", margin_left: "lg" }) %>
|
4
4
|
<%= pb_rails("button", props: { icon: "user", variant: "reaction", margin_left: "lg" }) %>
|
5
5
|
|
@@ -106,7 +106,7 @@ const Icon = (props: IconProps) => {
|
|
106
106
|
|
107
107
|
const isValidEmoji = (emoji: string) => {
|
108
108
|
// Using regular expression to check if the string is a valid emoji/emoji Unicode
|
109
|
-
const emojiRegex = /^(\p{Emoji}|\uFE0F)+$/u;
|
109
|
+
const emojiRegex = /^(\p{Emoji}|\uFE0F|\u200D|\u20E3)+$/u;
|
110
110
|
return emojiRegex.test(emoji);
|
111
111
|
};
|
112
112
|
|
@@ -1,9 +1,22 @@
|
|
1
|
-
//
|
2
|
-
|
1
|
+
//function to retrieve all ancestors of unchecked item and set checked to false
|
2
|
+
export const getAncestorsOfUnchecked = (
|
3
|
+
data: { [key: string]: any }[],
|
4
|
+
item: { [key: string]: any }
|
5
|
+
) => {
|
6
|
+
if (item.parent_id) {
|
7
|
+
const ancestor = filterFormattedDataById(data, item.parent_id);
|
8
|
+
ancestor[0].checked = false;
|
9
|
+
ancestor[0].parent_id && getAncestorsOfUnchecked(data, ancestor[0]);
|
10
|
+
}
|
11
|
+
return data;
|
12
|
+
};
|
13
|
+
|
14
|
+
//function is going over formattedData and returning all objects that match the
|
15
|
+
//id of the clicked item from the dropdown
|
3
16
|
export const filterFormattedDataById = (
|
4
17
|
formattedData: { [key: string]: any }[],
|
5
18
|
id: string
|
6
|
-
)
|
19
|
+
) => {
|
7
20
|
const matched: { [key: string]: any }[] = [];
|
8
21
|
const recursiveSearch = (data: { [key: string]: any }[], term: string) => {
|
9
22
|
for (const item of data) {
|
@@ -25,7 +38,7 @@ export const filterFormattedDataById = (
|
|
25
38
|
export const findByFilter = (
|
26
39
|
formattedData: { [key: string]: any }[],
|
27
40
|
searchTerm: string
|
28
|
-
)
|
41
|
+
) => {
|
29
42
|
const matchedItems: { [key: string]: any }[] = [];
|
30
43
|
const recursiveSearch = (data: { [key: string]: any }[], term: string) => {
|
31
44
|
for (const item of data) {
|
@@ -43,20 +56,7 @@ export const findByFilter = (
|
|
43
56
|
return matchedItems;
|
44
57
|
};
|
45
58
|
|
46
|
-
//
|
47
|
-
export const getAncestorsOfUnchecked = (
|
48
|
-
data: { [key: string]: any }[],
|
49
|
-
item: { [key: string]: any }
|
50
|
-
): { [key: string]: any }[] => {
|
51
|
-
if (item.parent_id) {
|
52
|
-
const ancestor = filterFormattedDataById(data, item.parent_id);
|
53
|
-
ancestor[0].checked = false;
|
54
|
-
ancestor[0].parent_id && getAncestorsOfUnchecked(data, ancestor[0]);
|
55
|
-
}
|
56
|
-
return data;
|
57
|
-
};
|
58
|
-
|
59
|
-
// Function to get all items with checked = true
|
59
|
+
//function to get all items with checked = true
|
60
60
|
export const getCheckedItems = (
|
61
61
|
data: { [key: string]: any }[]
|
62
62
|
): { [key: string]: any }[] => {
|
@@ -76,9 +76,7 @@ export const getCheckedItems = (
|
|
76
76
|
return checkedItems;
|
77
77
|
};
|
78
78
|
|
79
|
-
export const getDefaultCheckedItems = (
|
80
|
-
treeData: { [key: string]: any }[]
|
81
|
-
): { [key: string]: any }[] => {
|
79
|
+
export const getDefaultCheckedItems = (treeData: { [key: string]: any }[]) => {
|
82
80
|
const checkedDefault: { [key: string]: any }[] = [];
|
83
81
|
|
84
82
|
const traverseTree = (items: { [key: string]: any }[]) => {
|
@@ -120,7 +118,7 @@ export const getDefaultCheckedItems = (
|
|
120
118
|
export const recursiveCheckParent = (
|
121
119
|
item: { [key: string]: any },
|
122
120
|
data: any
|
123
|
-
)
|
121
|
+
) => {
|
124
122
|
if (item.parent_id !== null) {
|
125
123
|
const parent = filterFormattedDataById(data, item.parent_id);
|
126
124
|
const allChildrenChecked = parent[0].children.every(
|
@@ -137,11 +135,8 @@ export const recursiveCheckParent = (
|
|
137
135
|
return data;
|
138
136
|
};
|
139
137
|
|
140
|
-
export const getExpandedItems = (
|
141
|
-
|
142
|
-
selectedIds: string[]
|
143
|
-
): any[] => {
|
144
|
-
const expandedItems: any[] = [];
|
138
|
+
export const getExpandedItems = (treeData: { [key: string]: string }[], selectedIds: string[]) => {
|
139
|
+
let expandedItems: any[] = [];
|
145
140
|
|
146
141
|
const traverse = (items: string | any[], ancestors: any[] = []) => {
|
147
142
|
for (let i = 0; i < items.length; i++) {
|