playbook_ui 12.25.0.pre.alpha.play822bolddefaultfortitle3764 → 12.25.0.pre.alpha.play824786
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 +212 -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 +340 -86
- 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/pb_phone_number_input/_phone_number_input.tsx +109 -44
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +14 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +60 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +6 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +110 -62
- data/app/pb_kits/playbook/pb_title/_title.scss +1 -1
- data/app/pb_kits/playbook/pb_title/_title.tsx +3 -2
- data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.html.erb +0 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.jsx +0 -6
- data/app/pb_kits/playbook/pb_title/docs/_title_light_weight.md +2 -1
- data/app/pb_kits/playbook/pb_title/title.rb +10 -3
- data/app/pb_kits/playbook/pb_title/title.test.js +3 -3
- data/app/pb_kits/playbook/playbook-doc.js +2 -0
- data/app/pb_kits/playbook/utilities/object.ts +3 -0
- data/dist/menu.yml +1 -0
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/forms/builder/intl_telephone_field.rb +12 -0
- data/lib/playbook/forms/builder.rb +1 -0
- data/lib/playbook/version.rb +1 -1
- metadata +26 -4
- 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
@@ -10,6 +10,7 @@ module Playbook
|
|
10
10
|
require_relative "builder/form_field_builder"
|
11
11
|
require_relative "builder/select_field"
|
12
12
|
require_relative "builder/typeahead_field"
|
13
|
+
require_relative "builder/intl_telephone_field"
|
13
14
|
|
14
15
|
prepend(FormFieldBuilder.new(:email_field, kit_name: "text_input"))
|
15
16
|
prepend(FormFieldBuilder.new(:number_field, kit_name: "text_input"))
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.25.0.pre.alpha.
|
4
|
+
version: 12.25.0.pre.alpha.play824786
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-06-
|
12
|
+
date: 2023-06-15 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
|
@@ -1582,6 +1600,8 @@ files:
|
|
1582
1600
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.html.erb
|
1583
1601
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.jsx
|
1584
1602
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md
|
1603
|
+
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb
|
1604
|
+
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx
|
1585
1605
|
- app/pb_kits/playbook/pb_phone_number_input/docs/example.yml
|
1586
1606
|
- app/pb_kits/playbook/pb_phone_number_input/docs/index.js
|
1587
1607
|
- app/pb_kits/playbook/pb_phone_number_input/phone_number_input.html.erb
|
@@ -2393,6 +2413,7 @@ files:
|
|
2393
2413
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_justify_self.scss
|
2394
2414
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_order.scss
|
2395
2415
|
- app/pb_kits/playbook/utilities/globalProps.ts
|
2416
|
+
- app/pb_kits/playbook/utilities/object.ts
|
2396
2417
|
- app/pb_kits/playbook/utilities/props.ts
|
2397
2418
|
- app/pb_kits/playbook/utilities/test-utils.js
|
2398
2419
|
- app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js
|
@@ -2431,6 +2452,7 @@ files:
|
|
2431
2452
|
- lib/playbook/forms/builder/collection_select_field.rb
|
2432
2453
|
- lib/playbook/forms/builder/date_picker_field.rb
|
2433
2454
|
- lib/playbook/forms/builder/form_field_builder.rb
|
2455
|
+
- lib/playbook/forms/builder/intl_telephone_field.rb
|
2434
2456
|
- lib/playbook/forms/builder/select_field.rb
|
2435
2457
|
- lib/playbook/forms/builder/typeahead_field.rb
|
2436
2458
|
- lib/playbook/justify_content.rb
|
@@ -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
|
-
}
|