playbook_ui_docs 14.18.0.pre.alpha.dropdownautocomplete7493 → 14.18.0.pre.alpha.play1736highchartslinegraphdefaultrebuild7431
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_advanced_table/docs/_advanced_table_beta.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_react.jsx → _advanced_table_selectable_rows_no_subrows.jsx} +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -3
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +2 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +64 -17
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_autocomplete_with_subcomponents.jsx → _dropdown_with_autocomplete_and_custom_display.jsx} +25 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx +79 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -2
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.html.erb +1 -5
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb +1 -8
- data/dist/playbook-doc.js +1 -1
- metadata +11 -32
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +0 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +0 -43
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +0 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +0 -58
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +0 -61
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.md +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.md +0 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +0 -41
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +0 -20
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +0 -46
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +0 -1
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_rails.html.erb → _advanced_table_selectable_rows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_rails.html.erb → _advanced_table_selectable_rows_no_subrows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_react.md → _draggable_drop_zones.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors_react.md → _draggable_drop_zones_colors.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ed5ded613687e87d5e85bd61aca50a0a3b1d91f6e4fd0d420862f4f9bb6d93c
|
4
|
+
data.tar.gz: 41ed9ff7483a19513c769071966b209abf6c63bcfef11417b1a0ece1c294cfde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6de7619f72b736a1ed4a995bdd66aaa5ec8710465db9e42886b0f7ff5c24152b936c326bd2a71b7ce0e599fae458d065764f7b5892143255993ab7062460f2
|
7
|
+
data.tar.gz: b849fdf0f8ec633ca35e23922957d3e08113bf5723b9c67a02fd5c6a0b8bab9258a4c9b9afeaf610f15cbe3a1cb8583fb28ee45d125c50ab95fb74d57d3a022e
|
@@ -1,3 +1,9 @@
|
|
1
|
+
**BETA VERSION**
|
2
|
+
This kit's Rails version is currently under development. Some features may not work as expected, and breaking changes may still occur; use with caution.
|
3
|
+
<br />
|
4
|
+
<br />
|
5
|
+
<br />
|
6
|
+
|
1
7
|
The AdvancedTable kit accepts tree data and automatically renders expansion controls for nested subrows, to any depth, based on the data it is given. In it's simplest form, __the kit has two required props__:
|
2
8
|
|
3
9
|
### table_data
|
@@ -2,7 +2,7 @@ import React from "react"
|
|
2
2
|
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
3
|
import MOCK_DATA from "./advanced_table_mock_data_no_subrows.json"
|
4
4
|
|
5
|
-
const
|
5
|
+
const AdvancedTableSelectableRowsNoSubrows = (props) => {
|
6
6
|
const columnDefinitions = [
|
7
7
|
{
|
8
8
|
accessor: "year",
|
@@ -49,4 +49,4 @@ const AdvancedTableSelectableRowsNoSubrowsReact = (props) => {
|
|
49
49
|
)
|
50
50
|
}
|
51
51
|
|
52
|
-
export default
|
52
|
+
export default AdvancedTableSelectableRowsNoSubrows
|
data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md
CHANGED
@@ -1,5 +1 @@
|
|
1
|
-
`selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
|
2
|
-
|
3
|
-
The data attribute `data-selected-rows` on the parent `pb_advanced_table` div will update dynamically with each selection to show an array of ids corresponding to the current selection.
|
4
|
-
|
5
|
-
__NOTE__: Each object within the `table_data` Array must contain a unique id in order to attach an id to all Rows for this to function.
|
1
|
+
`selectable_rows` can also be used with tables without nested row data. Set `enable_toggle_expansion: none` to adjust the Advanced Table styling to fit a table without subrows.
|
@@ -2,6 +2,5 @@
|
|
2
2
|
|
3
3
|
When a parent row is clicked, it will check all nested children rows, Children rows can be manually checked or unchecked as well.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
__NOTE__: Each object within the `table_data` Array must contain a unique id in order to attach an id to all Rows for this to function.
|
5
|
+
__ALERT TO DEVS__: UPDATE THIS PARAGRAPH IN THE FOLLOW UP STORY WHEN CHECKBOX FUNCTIONALITY IS SET PLEASE
|
6
|
+
The `onRowSelectionChange` prop returns an array of ids of all Rows that have been selected. Open the console on this example and check and uncheck checkboxes to see this is action! __NOTE__: Each object within the `tableData`Array must contain a unique id in order to attach an id to all Rows for this to function.
|
@@ -12,9 +12,9 @@ examples:
|
|
12
12
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
13
13
|
- advanced_table_column_headers: Multi-Header Columns
|
14
14
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
15
|
-
-
|
16
|
-
-
|
17
|
-
|
15
|
+
# - advanced_table_selectable_rows: Selectable Rows
|
16
|
+
# - advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
17
|
+
|
18
18
|
|
19
19
|
react:
|
20
20
|
- advanced_table_default: Default (Required Props)
|
@@ -39,11 +39,10 @@ examples:
|
|
39
39
|
- advanced_table_column_headers: Multi-Header Columns
|
40
40
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
41
41
|
- advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
|
42
|
-
- advanced_table_column_border_color: Column Group Border Color
|
43
42
|
# - advanced_table_no_subrows: Table with No Subrows
|
44
43
|
- advanced_table_selectable_rows: Selectable Rows
|
45
|
-
-
|
44
|
+
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
46
45
|
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
47
46
|
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
48
47
|
- advanced_table_inline_editing: Inline Cell Editing
|
49
|
-
- advanced_table_fullscreen: Fullscreen
|
48
|
+
- advanced_table_fullscreen: Fullscreen
|
@@ -15,7 +15,7 @@ export { default as AdvancedTablePaginationWithProps } from './_advanced_table_p
|
|
15
15
|
export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
|
16
16
|
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
17
17
|
export { default as AdvancedTableSelectableRows } from './_advanced_table_selectable_rows.jsx'
|
18
|
-
export { default as
|
18
|
+
export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
|
19
19
|
export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
|
20
20
|
export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
|
21
21
|
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
@@ -26,5 +26,4 @@ export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen
|
|
26
26
|
export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
|
27
27
|
export { default as AdvancedTableStickyHeader } from './_advanced_table_sticky_header.jsx'
|
28
28
|
export { default as AdvancedTableStickyColumnsAndHeader } from './_advanced_table_sticky_columns_and_header.jsx'
|
29
|
-
export { default as AdvancedTableExpandByDepth } from './_advanced_table_expand_by_depth.jsx'
|
30
|
-
export { default as AdvancedTableColumnBorderColor} from './_advanced_table_column_border_color.jsx'
|
29
|
+
export { default as AdvancedTableExpandByDepth } from './_advanced_table_expand_by_depth.jsx'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= pb_rails("date_picker", props: {
|
2
|
-
error:
|
1
|
+
<%= pb_rails("date_picker", props: {
|
2
|
+
error: "Invalid date. Please pick a valid date.",
|
3
3
|
picker_id: "date-picker-error"
|
4
4
|
}) %>
|
@@ -17,6 +17,5 @@ examples:
|
|
17
17
|
- draggable_with_cards: Draggable with Cards
|
18
18
|
- draggable_with_table: Draggable with Table
|
19
19
|
- draggable_multiple_containers: Dragging Across Multiple Containers
|
20
|
-
- draggable_drop_zones: Draggable Drop Zones
|
21
|
-
- draggable_drop_zones_colors: Draggable Drop Zones Colors
|
22
20
|
- draggable_event_listeners: Draggable Event Listeners
|
21
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%
|
1
|
+
<%
|
2
2
|
options = [
|
3
3
|
{ label: 'United States', value: 'United States', id: 'us' },
|
4
4
|
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
@@ -6,7 +6,4 @@
|
|
6
6
|
]
|
7
7
|
%>
|
8
8
|
|
9
|
-
<%= pb_rails("dropdown", props: {
|
10
|
-
error: raw(pb_rails("icon", props: { icon: "warning" }) + " Please make a valid selection"),
|
11
|
-
options: options
|
12
|
-
}) %>
|
9
|
+
<%= pb_rails("dropdown", props: { error: "Please make a valid selection", options: options }) %>
|
@@ -1,39 +1,86 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
|
3
3
|
import Dropdown from '../../pb_dropdown/_dropdown'
|
4
|
+
import Badge from '../../pb_badge/_badge'
|
5
|
+
import FlexItem from '../../pb_flex/_flex_item'
|
6
|
+
import User from '../../pb_user/_user'
|
4
7
|
|
5
8
|
const DropdownWithAutocomplete = (props) => {
|
6
9
|
|
7
10
|
const options = [
|
8
11
|
{
|
9
|
-
label: "
|
10
|
-
value: "
|
11
|
-
|
12
|
-
|
13
|
-
id: "
|
12
|
+
label: "Jasper Furniss",
|
13
|
+
value: "Jasper Furniss",
|
14
|
+
territory: "PHL",
|
15
|
+
title: "Lead UX Engineer",
|
16
|
+
id: "jasper-furniss",
|
17
|
+
status: "Offline"
|
14
18
|
},
|
15
19
|
{
|
16
|
-
label: "
|
17
|
-
value: "
|
18
|
-
|
19
|
-
|
20
|
-
id: "
|
20
|
+
label: "Ramon Ruiz",
|
21
|
+
value: "Ramon Ruiz",
|
22
|
+
territory: "PHL",
|
23
|
+
title: "Senior UX Designer",
|
24
|
+
id: "ramon-ruiz",
|
25
|
+
status: "Away"
|
21
26
|
},
|
22
27
|
{
|
23
|
-
label: "
|
24
|
-
value: "
|
25
|
-
|
26
|
-
|
27
|
-
id: "
|
28
|
+
label: "Carlos Lima",
|
29
|
+
value: "Carlos Lima",
|
30
|
+
territory: "PHL",
|
31
|
+
title: "Nitro Developer",
|
32
|
+
id: "carlos-lima",
|
33
|
+
status: "Online"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
label: "Courtney Long",
|
37
|
+
value: "Courtney Long",
|
38
|
+
territory: "PHL",
|
39
|
+
title: "Lead UX Designer",
|
40
|
+
id: "courtney-long",
|
41
|
+
status: "Online"
|
28
42
|
}
|
29
|
-
]
|
43
|
+
];
|
44
|
+
|
30
45
|
|
31
46
|
return (
|
32
47
|
<div>
|
33
48
|
<Dropdown autocomplete
|
34
49
|
options={options}
|
35
50
|
{...props}
|
36
|
-
|
51
|
+
>
|
52
|
+
{options.map((option) => (
|
53
|
+
<Dropdown.Option key={option.id}
|
54
|
+
option={option}
|
55
|
+
>
|
56
|
+
<>
|
57
|
+
<FlexItem>
|
58
|
+
<User
|
59
|
+
align="left"
|
60
|
+
avatar
|
61
|
+
name={option.label}
|
62
|
+
orientation="horizontal"
|
63
|
+
territory={option.territory}
|
64
|
+
title={option.title}
|
65
|
+
/>
|
66
|
+
</FlexItem>
|
67
|
+
<FlexItem>
|
68
|
+
<Badge
|
69
|
+
rounded
|
70
|
+
text={option.status}
|
71
|
+
variant={`${
|
72
|
+
option.status === "Offline"
|
73
|
+
? "neutral"
|
74
|
+
: option.status === "Online"
|
75
|
+
? "success"
|
76
|
+
: "warning"
|
77
|
+
}`}
|
78
|
+
/>
|
79
|
+
</FlexItem>
|
80
|
+
</>
|
81
|
+
</Dropdown.Option>
|
82
|
+
))}
|
83
|
+
</Dropdown>
|
37
84
|
</div>
|
38
85
|
)
|
39
86
|
}
|
@@ -1,13 +1,15 @@
|
|
1
|
-
import React from 'react'
|
1
|
+
import React, { useState } from 'react'
|
2
2
|
|
3
|
-
import Dropdown from '
|
3
|
+
import Dropdown from '../../pb_dropdown/_dropdown'
|
4
4
|
import Badge from '../../pb_badge/_badge'
|
5
|
-
import Flex from '../../pb_flex/_flex'
|
6
5
|
import FlexItem from '../../pb_flex/_flex_item'
|
6
|
+
import Avatar from '../../pb_avatar/_avatar'
|
7
7
|
import User from '../../pb_user/_user'
|
8
8
|
|
9
9
|
|
10
|
-
const
|
10
|
+
const DropdownWithAutocompleteAndCustomDisplay = (props) => {
|
11
|
+
const [selectedOption, setSelectedOption] = useState();
|
12
|
+
|
11
13
|
const options = [
|
12
14
|
{
|
13
15
|
label: "Jasper Furniss",
|
@@ -43,21 +45,34 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
|
|
43
45
|
}
|
44
46
|
];
|
45
47
|
|
48
|
+
const CustomDisplay = () => {
|
49
|
+
return (
|
50
|
+
<>
|
51
|
+
{
|
52
|
+
selectedOption && (
|
53
|
+
<Avatar
|
54
|
+
name={selectedOption.label}
|
55
|
+
size="xs"
|
56
|
+
/>
|
57
|
+
)
|
58
|
+
}
|
59
|
+
</>
|
60
|
+
)
|
61
|
+
};
|
46
62
|
|
47
63
|
return (
|
48
64
|
<div>
|
49
65
|
<Dropdown autocomplete
|
66
|
+
onSelect={(selectedItem) => setSelectedOption(selectedItem)}
|
50
67
|
options={options}
|
51
68
|
{...props}
|
52
69
|
>
|
70
|
+
<Dropdown.Trigger customDisplay={<CustomDisplay/>} />
|
53
71
|
{options.map((option) => (
|
54
72
|
<Dropdown.Option key={option.id}
|
55
73
|
option={option}
|
56
74
|
>
|
57
|
-
|
58
|
-
align="center"
|
59
|
-
justify="between"
|
60
|
-
>
|
75
|
+
<>
|
61
76
|
<FlexItem>
|
62
77
|
<User
|
63
78
|
align="left"
|
@@ -70,7 +85,6 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
|
|
70
85
|
</FlexItem>
|
71
86
|
<FlexItem>
|
72
87
|
<Badge
|
73
|
-
dark
|
74
88
|
rounded
|
75
89
|
text={option.status}
|
76
90
|
variant={`${
|
@@ -82,7 +96,7 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
|
|
82
96
|
}`}
|
83
97
|
/>
|
84
98
|
</FlexItem>
|
85
|
-
|
99
|
+
</>
|
86
100
|
</Dropdown.Option>
|
87
101
|
))}
|
88
102
|
</Dropdown>
|
@@ -90,4 +104,4 @@ const DropdownWithAutocompleteWithSubcomponents = (props) => {
|
|
90
104
|
)
|
91
105
|
}
|
92
106
|
|
93
|
-
export default
|
107
|
+
export default DropdownWithAutocompleteAndCustomDisplay
|
@@ -0,0 +1 @@
|
|
1
|
+
`autocomplete` prop can also be used in conjunction with the `customDisplay` prop.
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import React, { useRef } from 'react'
|
2
|
+
|
3
|
+
import Dropdown from '../../pb_dropdown/_dropdown'
|
4
|
+
import useDropdown from '../../pb_dropdown/hooks/useDropdown'
|
5
|
+
import CircleIconButton from '../../pb_circle_icon_button/_circle_icon_button'
|
6
|
+
import FlexItem from '../../pb_flex/_flex_item'
|
7
|
+
import Icon from '../../pb_icon/_icon'
|
8
|
+
import Body from '../../pb_body/_body'
|
9
|
+
import Flex from '../../pb_flex/_flex'
|
10
|
+
|
11
|
+
const DropdownWithHook = (props) => {
|
12
|
+
const [isDropDownClosed, setIsDropdownClosed] = useDropdown(true);
|
13
|
+
const buttonRef = useRef(null);
|
14
|
+
|
15
|
+
const options = [
|
16
|
+
{
|
17
|
+
label: "United States",
|
18
|
+
value: "United States",
|
19
|
+
areaCode: "+1",
|
20
|
+
icon: "🇺🇸",
|
21
|
+
id: "United-states"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
label: "Canada",
|
25
|
+
value: "Canada",
|
26
|
+
areaCode: "+1",
|
27
|
+
icon: "🇨🇦",
|
28
|
+
id: "canada"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
label: "Pakistan",
|
32
|
+
value: "Pakistan",
|
33
|
+
areaCode: "+92",
|
34
|
+
icon: "🇵🇰",
|
35
|
+
id: "pakistan"
|
36
|
+
}
|
37
|
+
];
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div>
|
41
|
+
<CircleIconButton
|
42
|
+
htmlOptions={{ref: buttonRef}}
|
43
|
+
icon={"flag"}
|
44
|
+
onClick={() => setIsDropdownClosed(!isDropDownClosed)}
|
45
|
+
variant="secondary"
|
46
|
+
/>
|
47
|
+
<Dropdown
|
48
|
+
isClosed={isDropDownClosed}
|
49
|
+
options={options}
|
50
|
+
triggerRef={buttonRef}
|
51
|
+
{...props}
|
52
|
+
>
|
53
|
+
{options.map((option) => (
|
54
|
+
<Dropdown.Option key={option.id}
|
55
|
+
option={option}
|
56
|
+
>
|
57
|
+
<>
|
58
|
+
<FlexItem>
|
59
|
+
<Flex paddingRight='md'>
|
60
|
+
<Icon icon={option.icon}
|
61
|
+
paddingRight="xs"
|
62
|
+
/>
|
63
|
+
<Body text={option.label} />
|
64
|
+
</Flex>
|
65
|
+
</FlexItem>
|
66
|
+
<FlexItem>
|
67
|
+
<Body color="light"
|
68
|
+
text={option.areaCode}
|
69
|
+
/>
|
70
|
+
</FlexItem>
|
71
|
+
</>
|
72
|
+
</Dropdown.Option>
|
73
|
+
))}
|
74
|
+
</Dropdown>
|
75
|
+
</div>
|
76
|
+
)
|
77
|
+
}
|
78
|
+
|
79
|
+
export default DropdownWithHook
|
@@ -1,15 +1,12 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
3
|
- dropdown_default: Default
|
4
|
-
- dropdown_with_autocomplete: Autocomplete
|
5
4
|
- dropdown_subtle_variant: Subtle Variant
|
6
5
|
- dropdown_subcomponent_structure_rails: Subcomponent Structure
|
7
|
-
- dropdown_with_autocomplete_with_subcomponents: Autocomplete with Subcomponent Structure
|
8
6
|
- dropdown_with_label: With Label
|
9
7
|
- dropdown_with_custom_options_rails: Custom Options
|
10
8
|
- dropdown_with_custom_display_rails: Custom Display
|
11
9
|
- dropdown_with_custom_trigger_rails: Custom Trigger
|
12
|
-
- dropdown_with_search_rails: Custom Trigger Dropdown with Search
|
13
10
|
- dropdown_with_custom_padding: Custom Option Padding
|
14
11
|
- dropdown_error: Dropdown with Error
|
15
12
|
- dropdown_default_value: Default Value
|
@@ -18,20 +15,20 @@ examples:
|
|
18
15
|
|
19
16
|
react:
|
20
17
|
- dropdown_default: Default
|
21
|
-
- dropdown_with_autocomplete: Autocomplete
|
22
18
|
- dropdown_subtle_variant: Subtle Variant
|
23
19
|
- dropdown_subcomponent_structure: Subcomponent Structure
|
24
|
-
- dropdown_with_autocomplete_with_subcomponents: Autocomplete with Subcomponent Structure
|
25
20
|
- dropdown_with_label: With Label
|
26
21
|
- dropdown_with_custom_options: Custom Options
|
27
22
|
- dropdown_with_custom_display: Custom Display
|
28
23
|
- dropdown_with_custom_trigger: Custom Trigger
|
29
|
-
- dropdown_with_search: Custom Trigger Dropdown with Search
|
30
24
|
- dropdown_with_custom_padding: Custom Option Padding
|
31
25
|
- dropdown_error: Dropdown with Error
|
32
26
|
- dropdown_default_value: Default Value
|
33
27
|
- dropdown_blank_selection: Blank Selection
|
34
28
|
- dropdown_clear_selection: Clear Selection
|
35
29
|
- dropdown_separators_hidden: Separators Hidden
|
36
|
-
-
|
30
|
+
# - dropdown_with_autocomplete: Autocomplete
|
31
|
+
# - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
|
32
|
+
# - dropdown_with_external_control: useDropdown Hook
|
33
|
+
# - dropdown_with_hook: useDropdown Hook with Any Trigger
|
37
34
|
|
@@ -3,10 +3,11 @@ export { default as DropdownWithCustomDisplay } from './_dropdown_with_custom_di
|
|
3
3
|
export { default as DropdownWithCustomOptions } from './_dropdown_with_custom_options.jsx'
|
4
4
|
export { default as DropdownWithCustomTrigger } from './_dropdown_with_custom_trigger.jsx'
|
5
5
|
export { default as DropdownWithAutocomplete } from './_dropdown_with_autocomplete.jsx'
|
6
|
-
export { default as
|
6
|
+
export { default as DropdownWithAutocompleteAndCustomDisplay } from './_dropdown_with_autocomplete_and_custom_display.jsx'
|
7
7
|
export { default as DropdownWithCustomPadding } from './_dropdown_with_custom_padding.jsx'
|
8
8
|
export { default as DropdownWithLabel } from './_dropdown_with_label.jsx'
|
9
9
|
export { default as DropdownWithExternalControl } from './_dropdown_with_external_control.jsx'
|
10
|
+
export { default as DropdownWithHook } from './_dropdown_with_hook.jsx'
|
10
11
|
export { default as DropdownSubcomponentStructure } from './_dropdown_subcomponent_structure.jsx'
|
11
12
|
export { default as DropdownError } from './_dropdown_error.jsx'
|
12
13
|
export { default as DropdownDefaultValue } from './_dropdown_default_value.jsx'
|
@@ -14,4 +15,3 @@ export { default as DropdownBlankSelection } from './_dropdown_blank_selection.j
|
|
14
15
|
export { default as DropdownClearSelection } from './_dropdown_clear_selection.jsx'
|
15
16
|
export { default as DropdownSubtleVariant } from './_dropdown_subtle_variant.jsx'
|
16
17
|
export { default as DropdownSeparatorsHidden } from './_dropdown_separators_hidden.jsx'
|
17
|
-
export {default as DropdownWithSearch} from './_dropdown_with_search.jsx'
|
@@ -9,7 +9,6 @@ examples:
|
|
9
9
|
- phone_number_input_clear_field: Clearing the Input Field
|
10
10
|
- phone_number_input_access_input_element: Accessing the Input Element
|
11
11
|
- phone_number_input_format: Format as You Type
|
12
|
-
- phone_number_input_country_search: Country Search
|
13
12
|
|
14
13
|
rails:
|
15
14
|
- phone_number_input_default: Default
|
@@ -19,5 +18,4 @@ examples:
|
|
19
18
|
- phone_number_input_validation: Form Validation
|
20
19
|
- phone_number_input_format: Format as You Type
|
21
20
|
- phone_number_input_hidden_inputs: Hidden Inputs
|
22
|
-
- phone_number_input_country_search: Country Search
|
23
21
|
|
@@ -6,4 +6,3 @@ export { default as PhoneNumberInputValidation } from './_phone_number_input_val
|
|
6
6
|
export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
|
7
7
|
export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
|
8
8
|
export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
|
9
|
-
export { default as PhoneNumberInputCountrySearch } from './_phone_number_input_country_search'
|
@@ -8,14 +8,7 @@
|
|
8
8
|
|
9
9
|
%>
|
10
10
|
|
11
|
-
<%= pb_rails("typeahead", props: {
|
12
|
-
id: "typeahead-error-example",
|
13
|
-
options: options,
|
14
|
-
error: "Please make a valid selection",
|
15
|
-
label: "Products",
|
16
|
-
name: :foo,
|
17
|
-
is_multi: false
|
18
|
-
}) %>
|
11
|
+
<%= pb_rails("typeahead", props: { id: "typeahead-error-example", options: options, error: "Please make a valid selection", label: "Products", name: :foo, is_multi: false }) %>
|
19
12
|
|
20
13
|
<!-- This section is an example of the available JavaScript event hooks -->
|
21
14
|
<%= javascript_tag defer: "defer" do %>
|