playbook_ui 12.25.0 → 12.26.0.pre.alpha.multiselectfixes795
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/index.js +1 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_swift.md +82 -1
- data/app/pb_kits/playbook/pb_detail/_detail.scss +44 -0
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +55 -0
- data/app/pb_kits/playbook/pb_detail/_detail_mixins.scss +29 -0
- data/app/pb_kits/playbook/pb_detail/detail.html.erb +7 -0
- data/app/pb_kits/playbook/pb_detail/detail.rb +31 -0
- data/app/pb_kits/playbook/pb_detail/detail.test.jsx +46 -0
- data/app/pb_kits/playbook/pb_detail/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.html.erb +34 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.jsx +49 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_bold.md +1 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.html.erb +24 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.jsx +38 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_colors.md +6 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_default.html.erb +3 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_default.jsx +13 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_styled.html.erb +22 -0
- data/app/pb_kits/playbook/pb_detail/docs/_detail_styled.jsx +32 -0
- data/app/pb_kits/playbook/pb_detail/docs/example.yml +11 -0
- data/app/pb_kits/playbook/pb_detail/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_docs/kit_example.html.erb +14 -13
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +3 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +228 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +58 -98
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +344 -86
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +727 -61
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.md +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_return_all_selected.html.erb +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +1 -1
- data/app/pb_kits/playbook/playbook-doc.js +2 -0
- data/dist/menu.yml +1 -0
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +2 -2
- metadata +27 -9
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_select_helper.tsx +0 -31
- data/app/pb_kits/playbook/pb_multi_level_select/helper_functions.ts +0 -87
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.26.0.pre.alpha.multiselectfixes795
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
8
8
|
- Power Devs
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-06-
|
12
|
+
date: 2023-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -823,6 +823,25 @@ files:
|
|
823
823
|
- app/pb_kits/playbook/pb_date_year_stacked/docs/_footer.md
|
824
824
|
- app/pb_kits/playbook/pb_date_year_stacked/docs/example.yml
|
825
825
|
- app/pb_kits/playbook/pb_date_year_stacked/docs/index.js
|
826
|
+
- app/pb_kits/playbook/pb_detail/_detail.scss
|
827
|
+
- app/pb_kits/playbook/pb_detail/_detail.tsx
|
828
|
+
- app/pb_kits/playbook/pb_detail/_detail_mixins.scss
|
829
|
+
- app/pb_kits/playbook/pb_detail/detail.html.erb
|
830
|
+
- app/pb_kits/playbook/pb_detail/detail.rb
|
831
|
+
- app/pb_kits/playbook/pb_detail/detail.test.jsx
|
832
|
+
- app/pb_kits/playbook/pb_detail/docs/_description.md
|
833
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_bold.html.erb
|
834
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_bold.jsx
|
835
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_bold.md
|
836
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_colors.html.erb
|
837
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_colors.jsx
|
838
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_colors.md
|
839
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_default.html.erb
|
840
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_default.jsx
|
841
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_styled.html.erb
|
842
|
+
- app/pb_kits/playbook/pb_detail/docs/_detail_styled.jsx
|
843
|
+
- app/pb_kits/playbook/pb_detail/docs/example.yml
|
844
|
+
- app/pb_kits/playbook/pb_detail/docs/index.js
|
826
845
|
- app/pb_kits/playbook/pb_dialog/_close_icon.tsx
|
827
846
|
- app/pb_kits/playbook/pb_dialog/_dialog.scss
|
828
847
|
- app/pb_kits/playbook/pb_dialog/_dialog.tsx
|
@@ -1407,9 +1426,9 @@ files:
|
|
1407
1426
|
- app/pb_kits/playbook/pb_message/message.html.erb
|
1408
1427
|
- app/pb_kits/playbook/pb_message/message.rb
|
1409
1428
|
- app/pb_kits/playbook/pb_message/message.test.js
|
1429
|
+
- app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx
|
1410
1430
|
- app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss
|
1411
1431
|
- app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx
|
1412
|
-
- app/pb_kits/playbook/pb_multi_level_select/_multi_select_helper.tsx
|
1413
1432
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.html.erb
|
1414
1433
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx
|
1415
1434
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.md
|
@@ -1418,7 +1437,6 @@ files:
|
|
1418
1437
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_return_all_selected.md
|
1419
1438
|
- app/pb_kits/playbook/pb_multi_level_select/docs/example.yml
|
1420
1439
|
- app/pb_kits/playbook/pb_multi_level_select/docs/index.js
|
1421
|
-
- app/pb_kits/playbook/pb_multi_level_select/helper_functions.ts
|
1422
1440
|
- app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb
|
1423
1441
|
- app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb
|
1424
1442
|
- app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx
|
@@ -2469,7 +2487,7 @@ homepage: https://playbook.powerapp.cloud/
|
|
2469
2487
|
licenses:
|
2470
2488
|
- ISC
|
2471
2489
|
metadata: {}
|
2472
|
-
post_install_message:
|
2490
|
+
post_install_message:
|
2473
2491
|
rdoc_options: []
|
2474
2492
|
require_paths:
|
2475
2493
|
- lib
|
@@ -2480,12 +2498,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2480
2498
|
version: '0'
|
2481
2499
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2482
2500
|
requirements:
|
2483
|
-
- - "
|
2501
|
+
- - ">"
|
2484
2502
|
- !ruby/object:Gem::Version
|
2485
|
-
version:
|
2503
|
+
version: 1.3.1
|
2486
2504
|
requirements: []
|
2487
2505
|
rubygems_version: 3.3.7
|
2488
|
-
signing_key:
|
2506
|
+
signing_key:
|
2489
2507
|
specification_version: 4
|
2490
2508
|
summary: Playbook Design System
|
2491
2509
|
test_files: []
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import DropdownTreeSelect from "react-dropdown-tree-select"
|
3
|
-
import "react-dropdown-tree-select/dist/styles.css"
|
4
|
-
|
5
|
-
type HelperProps = {
|
6
|
-
id?: string
|
7
|
-
treeData?: { [key: string]: string }[]
|
8
|
-
treeMode?: boolean
|
9
|
-
onChange?: any
|
10
|
-
|
11
|
-
}
|
12
|
-
|
13
|
-
const MultiSelectHelper = (props: HelperProps) => {
|
14
|
-
const { id, treeData, onChange, treeMode } = props
|
15
|
-
|
16
|
-
|
17
|
-
return (
|
18
|
-
<DropdownTreeSelect
|
19
|
-
data={treeData}
|
20
|
-
id={id}
|
21
|
-
keepOpenOnSelect
|
22
|
-
keepTreeOnSearch
|
23
|
-
keepChildrenOnSearch
|
24
|
-
onChange={onChange}
|
25
|
-
texts={{ placeholder: "Select..." }}
|
26
|
-
mode={treeMode ? 'hierarchical' : 'multiSelect'}
|
27
|
-
/>
|
28
|
-
)
|
29
|
-
}
|
30
|
-
|
31
|
-
export default MultiSelectHelper
|
@@ -1,87 +0,0 @@
|
|
1
|
-
export const findItemById = (
|
2
|
-
items: { [key: string]: any }[],
|
3
|
-
id: string
|
4
|
-
): any => {
|
5
|
-
for (const item of items) {
|
6
|
-
if (item.id === id) {
|
7
|
-
return item;
|
8
|
-
}
|
9
|
-
if (item.children) {
|
10
|
-
const found = findItemById(item.children, id);
|
11
|
-
if (found) {
|
12
|
-
return found;
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
16
|
-
return null;
|
17
|
-
};
|
18
|
-
|
19
|
-
export const checkIt = (
|
20
|
-
foundItem: { [key: string]: any },
|
21
|
-
selectedItems: any[],
|
22
|
-
setSelectedItems: Function,
|
23
|
-
expand: boolean
|
24
|
-
) => {
|
25
|
-
if (!foundItem) {
|
26
|
-
return;
|
27
|
-
}
|
28
|
-
|
29
|
-
foundItem.checked = true;
|
30
|
-
foundItem.expanded = expand;
|
31
|
-
selectedItems.push(foundItem);
|
32
|
-
|
33
|
-
if (foundItem.children) {
|
34
|
-
foundItem.children.map((x: any) => {
|
35
|
-
checkIt(x, selectedItems, setSelectedItems, expand);
|
36
|
-
});
|
37
|
-
}
|
38
|
-
|
39
|
-
setSelectedItems([...selectedItems]);
|
40
|
-
};
|
41
|
-
|
42
|
-
export const unCheckIt = (
|
43
|
-
foundItem: { [key: string]: any },
|
44
|
-
selectedItems: any,
|
45
|
-
setSelectedItems: any,
|
46
|
-
expand: boolean
|
47
|
-
) => {
|
48
|
-
if (!foundItem) {
|
49
|
-
return;
|
50
|
-
}
|
51
|
-
|
52
|
-
foundItem.checked = false;
|
53
|
-
foundItem.expanded = false;
|
54
|
-
const newSelectedItems = selectedItems.filter(
|
55
|
-
(item: any) => item.id !== foundItem.id
|
56
|
-
);
|
57
|
-
if (foundItem.children) {
|
58
|
-
foundItem.children.map((x: any) => {
|
59
|
-
unCheckIt(x, selectedItems, setSelectedItems, expand);
|
60
|
-
});
|
61
|
-
}
|
62
|
-
setSelectedItems([...newSelectedItems]);
|
63
|
-
};
|
64
|
-
|
65
|
-
|
66
|
-
export const getParentAndAncestorsIds = (itemId:string, items:{ [key: string]: string; }[], ancestors:string[] = []):any => {
|
67
|
-
for (let i = 0; i < items.length; i++) {
|
68
|
-
const item:any = items[i];
|
69
|
-
if (item.id === itemId) {
|
70
|
-
// item found in current level of items array
|
71
|
-
return [...ancestors, item.id];
|
72
|
-
}
|
73
|
-
if (item.children && item.children.length > 0) {
|
74
|
-
// recursively search through children
|
75
|
-
const foundAncestors = getParentAndAncestorsIds(
|
76
|
-
itemId,
|
77
|
-
item.children,
|
78
|
-
[...ancestors, item.id]
|
79
|
-
);
|
80
|
-
if (foundAncestors) {
|
81
|
-
return foundAncestors;
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
// item not found in this level of items array or its children
|
86
|
-
return null;
|
87
|
-
}
|