playbook_ui 16.1.0.pre.alpha.play264213818 → 16.1.0.pre.alpha.play273614090
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/Components/RegularTableView.tsx +12 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.jsx +71 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.md +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +3 -35
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +17 -0
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +10 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +2 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.html.erb +6 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.jsx +17 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +14 -5
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.md +1 -0
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +8 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +6 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +83 -13
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_rails.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_react.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.html.erb +52 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.jsx +72 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.md +5 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height.jsx +33 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.html.erb +20 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.md +8 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_react.md +8 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +3 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.html.erb +9 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.jsx +33 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +4 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +12 -6
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +15 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +94 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +5 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +15 -10
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +4 -0
- data/app/pb_kits/playbook/pb_dropdown/index.js +191 -83
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +3 -0
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +18 -1
- data/app/pb_kits/playbook/pb_dropdown/utilities/clickOutsideHelper.tsx +6 -0
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +2 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +16 -9
- data/app/pb_kits/playbook/pb_filter/filter.rb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +6 -2
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +9 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +5 -5
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +4 -4
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +4 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +7 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +638 -549
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx +4 -7
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.md +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +4 -4
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +40 -7
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx +1 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.html.erb +7 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.jsx +24 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +2 -0
- data/app/pb_kits/playbook/pb_passphrase/passphrase.test.jsx +30 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.html.erb +5 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.jsx +14 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +2 -0
- 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 +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +34 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +51 -16
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx +44 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +28 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_table/index.ts +29 -27
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +10 -10
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +10 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.jsx +3 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.md +1 -0
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +25 -9
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +7 -1
- data/app/pb_kits/playbook/pb_time_picker/_time_picker.tsx +97 -11
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.jsx +5 -2
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.html.erb +6 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.jsx +16 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_time_picker/time_picker.rb +3 -0
- data/app/pb_kits/playbook/pb_time_picker/time_picker.test.jsx +47 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +24 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +412 -324
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +2 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +4 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.html.erb +16 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.jsx +23 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +22 -21
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +3 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +7 -1
- data/dist/chunks/{_pb_line_graph-BgKF_zz1.js → _pb_line_graph-DuJNCf7N.js} +1 -1
- data/dist/chunks/_typeahead-BKSzddAX.js +1 -0
- data/dist/chunks/{globalProps-BhVYCqRf.js → globalProps-Bc-FVsRt.js} +1 -1
- data/dist/chunks/lib-BwX82vim.js +29 -0
- data/dist/chunks/vendor.js +3 -3
- data/dist/menu.yml +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/forms/builder/form_field_builder.rb +1 -1
- data/lib/playbook/forms/builder/phone_number_field.rb +9 -0
- data/lib/playbook/forms/builder/typeahead_field.rb +15 -1
- data/lib/playbook/forms/builder.rb +2 -2
- data/lib/playbook/truncate.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +42 -6
- data/dist/chunks/_typeahead-B9a6ZsEP.js +0 -1
- data/dist/chunks/lib-DD34ZrWL.js +0 -29
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
The `blankSelection` prop adds a blank option at the top of the dropdown options list. This allows users to explicitly clear their selection by choosing the blank option.
|
|
2
|
+
|
|
3
|
+
The blank selection option appears as the first item in the dropdown and has an empty value (`id: ""`, `value: ""`). When selected, it effectively clears the dropdown selection.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<%
|
|
2
|
+
options = [
|
|
3
|
+
{ label: 'United States', value: 'unitedStates', id: 'us' },
|
|
4
|
+
{ label: 'Canada', value: 'canada', id: 'ca' },
|
|
5
|
+
{ label: 'Pakistan', value: 'pakistan', id: 'pk' },
|
|
6
|
+
]
|
|
7
|
+
%>
|
|
8
|
+
|
|
9
|
+
<%= pb_rails("dropdown", props: {
|
|
10
|
+
id: "date-range-quickpick-reset-closeable",
|
|
11
|
+
label: "Quick Pick",
|
|
12
|
+
variant: "quickpick",
|
|
13
|
+
clearable: false
|
|
14
|
+
}) %>
|
|
15
|
+
|
|
16
|
+
<%= pb_rails("button", props: {
|
|
17
|
+
margin_y: "md",
|
|
18
|
+
text: "Reset",
|
|
19
|
+
html_options: {
|
|
20
|
+
onclick: "handleReset()"
|
|
21
|
+
}
|
|
22
|
+
}) %>
|
|
23
|
+
|
|
24
|
+
<%= pb_rails("dropdown", props: {
|
|
25
|
+
id: "closeable-default",
|
|
26
|
+
options: options,
|
|
27
|
+
clearable: false,
|
|
28
|
+
default_value: options.last,
|
|
29
|
+
margin_bottom: "md",
|
|
30
|
+
label: "Default"
|
|
31
|
+
}) %>
|
|
32
|
+
|
|
33
|
+
<%= pb_rails("dropdown", props: {
|
|
34
|
+
id: "closeable-subtle",
|
|
35
|
+
options: options,
|
|
36
|
+
clearable: false,
|
|
37
|
+
default_value: options.second,
|
|
38
|
+
variant: "subtle",
|
|
39
|
+
separators: false,
|
|
40
|
+
label: "Subtle"
|
|
41
|
+
}) %>
|
|
42
|
+
|
|
43
|
+
<script>
|
|
44
|
+
function handleReset() {
|
|
45
|
+
const dropdown = document.querySelector("#date-range-quickpick-reset-closeable[data-pb-dropdown]");
|
|
46
|
+
const instance = dropdown?._pbDropdownInstance;
|
|
47
|
+
|
|
48
|
+
if (instance) {
|
|
49
|
+
instance.clearSelection();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
|
+
|
|
3
|
+
import Button from '../../pb_button/_button'
|
|
4
|
+
import Dropdown from '../../pb_dropdown/_dropdown'
|
|
5
|
+
|
|
6
|
+
const DropdownWithClearable = (props) => {
|
|
7
|
+
const dropdownRef = useRef(null)
|
|
8
|
+
|
|
9
|
+
const options = [
|
|
10
|
+
{
|
|
11
|
+
label: "United States",
|
|
12
|
+
value: "unitedStates",
|
|
13
|
+
id: "us"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: "Canada",
|
|
17
|
+
value: "canada",
|
|
18
|
+
id: "ca"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Pakistan",
|
|
22
|
+
value: "pakistan",
|
|
23
|
+
id: "pk"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
const handleReset = () => {
|
|
28
|
+
if (dropdownRef.current) {
|
|
29
|
+
dropdownRef.current.clearSelected()
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<Dropdown
|
|
36
|
+
clearable={false}
|
|
37
|
+
label="Quick Pick"
|
|
38
|
+
onSelect={() => {}}
|
|
39
|
+
ref={dropdownRef}
|
|
40
|
+
variant="quickpick"
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
<Button
|
|
44
|
+
marginY="md"
|
|
45
|
+
onClick={handleReset}
|
|
46
|
+
text="Reset"
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<Dropdown
|
|
50
|
+
clearable={false}
|
|
51
|
+
defaultValue={options[options.length - 1]}
|
|
52
|
+
label="Default"
|
|
53
|
+
marginBottom="md"
|
|
54
|
+
options={options}
|
|
55
|
+
variant="default"
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
<Dropdown
|
|
60
|
+
clearable={false}
|
|
61
|
+
defaultValue={options[1]}
|
|
62
|
+
label="Subtle"
|
|
63
|
+
options={options}
|
|
64
|
+
separators={false}
|
|
65
|
+
variant="subtle"
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
</>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export default DropdownWithClearable
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
The `clearable` prop controls whether the clear (X) button appears in the dropdown. When set to `false`, the clear button is hidden.
|
|
2
|
+
|
|
3
|
+
This is useful in two scenarios:
|
|
4
|
+
1. When you have a separate "Reset" or "Defaults" button that handles clearing the selection (as shown in the Quick Pick example)
|
|
5
|
+
2. When you don't want to provide any way to clear the selection (as shown in the Default and Subtle examples)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Dropdown from '../../pb_dropdown/_dropdown'
|
|
3
|
+
|
|
4
|
+
const DropdownWithConstrainHeight = (props) => {
|
|
5
|
+
// Create a long list of options to demonstrate height constraint
|
|
6
|
+
const options = Array.from({ length: 30 }, (_, i) => ({
|
|
7
|
+
label: `Option ${i + 1}`,
|
|
8
|
+
value: `option_${i + 1}`,
|
|
9
|
+
id: `opt_${i + 1}`
|
|
10
|
+
}))
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<Dropdown
|
|
15
|
+
data={{ testid: "dropdown-no-constrain" }}
|
|
16
|
+
label="Without Constrain Height (Default)"
|
|
17
|
+
marginBottom="md"
|
|
18
|
+
options={options}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<Dropdown
|
|
23
|
+
constrainHeight
|
|
24
|
+
data={{ testid: "dropdown-constrain" }}
|
|
25
|
+
label="With Constrain Height"
|
|
26
|
+
options={options}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
</>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default DropdownWithConstrainHeight
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<%
|
|
2
|
+
# Create a long list of options to demonstrate height constraint
|
|
3
|
+
options = (1..30).map do |i|
|
|
4
|
+
{ label: "Option #{i}", value: "option_#{i}", id: "opt_#{i}" }
|
|
5
|
+
end
|
|
6
|
+
%>
|
|
7
|
+
|
|
8
|
+
<%= pb_rails("dropdown", props: {
|
|
9
|
+
id: "dropdown-no-constrain",
|
|
10
|
+
options: options,
|
|
11
|
+
label: "Without Constrain Height (Default)",
|
|
12
|
+
margin_bottom: "md"
|
|
13
|
+
}) %>
|
|
14
|
+
|
|
15
|
+
<%= pb_rails("dropdown", props: {
|
|
16
|
+
id: "dropdown-constrain",
|
|
17
|
+
options: options,
|
|
18
|
+
constrain_height: true,
|
|
19
|
+
label: "With Constrain Height"
|
|
20
|
+
}) %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
The `constrain_height` prop limits the dropdown container height to 18em and enables vertical scrolling when the content exceeds this height. This prevents long dropdown lists from rendering off-screen.
|
|
2
|
+
|
|
3
|
+
When `constrain_height` is `true`, the dropdown will:
|
|
4
|
+
- Have a maximum height of 18em
|
|
5
|
+
- Show a scrollbar when content exceeds the max height
|
|
6
|
+
- Prevent the dropdown from extending beyond the viewport
|
|
7
|
+
|
|
8
|
+
This is particularly useful for dropdowns with many options, such as long lists or quickpick variants with many date range options.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
The `constrainHeight` prop limits the dropdown container height to 18em and enables vertical scrolling when the content exceeds this height. This prevents long dropdown lists from rendering off-screen.
|
|
2
|
+
|
|
3
|
+
When `constrainHeight` is `true`, the dropdown will:
|
|
4
|
+
- Have a maximum height of 18em
|
|
5
|
+
- Show a scrollbar when content exceeds the max height
|
|
6
|
+
- Prevent the dropdown from extending beyond the viewport
|
|
7
|
+
|
|
8
|
+
This is particularly useful for dropdowns with many options, such as long lists or quickpick variants with many date range options.
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
const option = e.detail;
|
|
77
77
|
const dropdown = e.target;
|
|
78
78
|
|
|
79
|
-
const display = dropdown.querySelector("
|
|
79
|
+
const display = dropdown.querySelector("[data-dropdown-trigger-custom-display]");
|
|
80
80
|
if (!display) return;
|
|
81
81
|
|
|
82
82
|
const nameEl = display.querySelector("#dropdown-avatar-name");
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<%
|
|
2
2
|
options = [
|
|
3
3
|
{ label: 'United States', value: 'unitedStates', id: 'us' },
|
|
4
4
|
{ label: 'Canada', value: 'canada', id: 'ca' },
|
|
5
5
|
{ label: 'Pakistan', value: 'pakistan', id: 'pk' },
|
|
6
6
|
]
|
|
7
|
-
|
|
8
7
|
%>
|
|
9
8
|
|
|
10
|
-
<%= pb_rails("dropdown", props: {
|
|
9
|
+
<%= pb_rails("dropdown", props: {
|
|
10
|
+
id: "select_a_country",
|
|
11
|
+
label: "Select a Country",
|
|
12
|
+
options: options
|
|
13
|
+
}) %>
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
The top-level Dropdown component optionally accepts any string through a `label` prop to produce a label above your trigger element.
|
|
1
|
+
The top-level Dropdown component optionally accepts any string through a `label` prop to produce a label above your trigger element.
|
|
2
|
+
|
|
3
|
+
Add an `id` to wire the label to the trigger so that clicking the label will move focus directly to the input, and open the drop-down.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<%
|
|
2
|
+
options = [
|
|
3
|
+
{ label: 'United States', value: 'unitedStates', id: 'us' },
|
|
4
|
+
{ label: 'Canada', value: 'canada', id: 'ca' },
|
|
5
|
+
{ label: 'Pakistan', value: 'pakistan', id: 'pk' },
|
|
6
|
+
]
|
|
7
|
+
%>
|
|
8
|
+
|
|
9
|
+
<%= pb_rails("dropdown", props: { options: options, placeholder: "Choose a country" }) %>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Dropdown from '../../pb_dropdown/_dropdown'
|
|
3
|
+
|
|
4
|
+
const DropdownWithPlaceholder = (props) => {
|
|
5
|
+
|
|
6
|
+
const options = [
|
|
7
|
+
{
|
|
8
|
+
label: "United States",
|
|
9
|
+
value: "unitedStates",
|
|
10
|
+
id: "us"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: "Canada",
|
|
14
|
+
value: "canada",
|
|
15
|
+
id: "ca"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "Pakistan",
|
|
19
|
+
value: "pakistan",
|
|
20
|
+
id: "pk"
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Dropdown
|
|
26
|
+
options={options}
|
|
27
|
+
placeholder="Choose a country"
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default DropdownWithPlaceholder
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
The `placeholder` prop allows you to customize the placeholder text that appears when no option is selected in the dropdown.
|
|
2
|
+
|
|
3
|
+
The placeholder prop works with all dropdown variants (`default`, `subtle`, and `quickpick`). When no option is selected, the placeholder text is displayed. When an option is selected, the placeholder is replaced by the selected option's label. The default placeholder text is "Select..." if no placeholder is provided.
|
|
@@ -21,7 +21,10 @@ examples:
|
|
|
21
21
|
- dropdown_default_value: Default Value
|
|
22
22
|
- dropdown_multi_select_with_default: Multi Select Default Value
|
|
23
23
|
- dropdown_blank_selection: Blank Selection
|
|
24
|
+
- dropdown_with_placeholder: Placeholder
|
|
24
25
|
- dropdown_separators_hidden: Separators Hidden
|
|
26
|
+
- dropdown_with_clearable: Clearable
|
|
27
|
+
- dropdown_with_constrain_height_rails: Constrain Height
|
|
25
28
|
- dropdown_quickpick_rails: Quick Pick Variant
|
|
26
29
|
- dropdown_quickpick_range_end_rails: Quick Pick Variant (Range Ends Today)
|
|
27
30
|
- dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
|
|
@@ -52,7 +55,10 @@ examples:
|
|
|
52
55
|
- dropdown_default_value: Default Value
|
|
53
56
|
- dropdown_multi_select_with_default: Multi Select Default Value
|
|
54
57
|
- dropdown_blank_selection: Blank Selection
|
|
58
|
+
- dropdown_with_placeholder: Placeholder
|
|
55
59
|
- dropdown_clear_selection: Clear Selection
|
|
60
|
+
- dropdown_with_clearable: Clearable
|
|
61
|
+
- dropdown_with_constrain_height: Constrain Height
|
|
56
62
|
- dropdown_separators_hidden: Separators Hidden
|
|
57
63
|
- dropdown_with_external_control: useDropdown Hook
|
|
58
64
|
- dropdown_quickpick: Quick Pick Variant
|
|
@@ -11,6 +11,7 @@ export { default as DropdownSubcomponentStructure } from './_dropdown_subcompone
|
|
|
11
11
|
export { default as DropdownError } from './_dropdown_error.jsx'
|
|
12
12
|
export { default as DropdownDefaultValue } from './_dropdown_default_value.jsx'
|
|
13
13
|
export { default as DropdownBlankSelection } from './_dropdown_blank_selection.jsx'
|
|
14
|
+
export { default as DropdownWithPlaceholder } from './_dropdown_with_placeholder.jsx'
|
|
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'
|
|
@@ -27,4 +28,6 @@ export { default as DropdownQuickpick } from './_dropdown_quickpick.jsx'
|
|
|
27
28
|
export { default as DropdownQuickpickRangeEnd } from './_dropdown_quickpick_range_end.jsx'
|
|
28
29
|
export { default as DropdownQuickpickDefaultDates } from './_dropdown_quickpick_default_dates.jsx'
|
|
29
30
|
export { default as DropdownQuickpickWithDatePickers } from './_dropdown_quickpick_with_date_pickers.jsx'
|
|
30
|
-
export { default as DropdownQuickpickCustom } from './_dropdown_quickpick_custom.jsx'
|
|
31
|
+
export { default as DropdownQuickpickCustom } from './_dropdown_quickpick_custom.jsx'
|
|
32
|
+
export { default as DropdownWithClearable } from './_dropdown_with_clearable.jsx'
|
|
33
|
+
export { default as DropdownWithConstrainHeight } from './_dropdown_with_constrain_height.jsx'
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<%= pb_content_tag do %>
|
|
2
2
|
<% if object.label.present? %>
|
|
3
|
-
|
|
3
|
+
<label for="<%= object.select_id %>" data-dropdown="pb-dropdown-label">
|
|
4
|
+
<%= pb_rails("caption", props: { text: object.label, margin_bottom: "xs", classname: "pb_dropdown_kit_label", dark: object.dark }) %>
|
|
5
|
+
</label>
|
|
4
6
|
<% end %>
|
|
5
7
|
<div class="dropdown_wrapper<%= error_class %>" style="position: relative">
|
|
6
8
|
<input
|
|
7
9
|
data-default-value="<%= input_default_value %>"
|
|
8
|
-
|
|
10
|
+
data-dropdown-selected-option
|
|
9
11
|
name="<%= object.name %><%= '[]' if object.multi_select %>"
|
|
10
12
|
style="display: none"
|
|
11
13
|
<%= object.required ? "required" : ""%>
|
|
@@ -16,10 +18,12 @@
|
|
|
16
18
|
<% end %>
|
|
17
19
|
<% if content.present? %>
|
|
18
20
|
<%= content.presence %>
|
|
19
|
-
|
|
21
|
+
<% if object.error.present? %>
|
|
22
|
+
<%= pb_rails("body", props: { status: "negative", text: object.error, id: object.error_id, aria: { atomic: "true", live: "polite" }, html_options: { role: "alert" }, dark: object.dark }) %>
|
|
23
|
+
<% end %>
|
|
20
24
|
<% else %>
|
|
21
|
-
<%= pb_rails("dropdown/dropdown_trigger", props:{ autocomplete: object.autocomplete, multi_select:object.multi_select }) %>
|
|
22
|
-
<%= pb_rails("dropdown/dropdown_container", props: { searchbar: object.searchbar }) do %>
|
|
25
|
+
<%= pb_rails("dropdown/dropdown_trigger", props: { autocomplete: object.autocomplete, multi_select: object.multi_select, placeholder: object.placeholder, select_id: object.select_id, label: object.label, error_id: object.error_id, error: object.error }) %>
|
|
26
|
+
<%= pb_rails("dropdown/dropdown_container", props: { searchbar: object.searchbar, constrain_height: object.constrain_height }) do %>
|
|
23
27
|
<% if options_with_blank.present? %>
|
|
24
28
|
<% options_with_blank.each do |option| %>
|
|
25
29
|
<%= pb_rails("dropdown/dropdown_option", props: {option: option}) %>
|
|
@@ -27,7 +31,9 @@
|
|
|
27
31
|
<% end %>
|
|
28
32
|
<% end %>
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
<% if object.error.present? %>
|
|
35
|
+
<%= pb_rails("body", props: { status: "negative", text: object.error, id: object.error_id, aria: { atomic: "true", live: "polite" }, html_options: { role: "alert" }, dark: object.dark }) %>
|
|
36
|
+
<% end %>
|
|
31
37
|
<% end %>
|
|
32
38
|
</div>
|
|
33
39
|
<% end %>
|
|
@@ -10,6 +10,7 @@ module Playbook
|
|
|
10
10
|
prop :label, type: Playbook::Props::String
|
|
11
11
|
prop :name, type: Playbook::Props::String
|
|
12
12
|
prop :error, type: Playbook::Props::String
|
|
13
|
+
prop :id, type: Playbook::Props::String
|
|
13
14
|
prop :required, type: Playbook::Props::Boolean,
|
|
14
15
|
default: false
|
|
15
16
|
prop :default_value
|
|
@@ -36,6 +37,8 @@ module Playbook
|
|
|
36
37
|
default: ""
|
|
37
38
|
prop :controls_start_id, type: Playbook::Props::String,
|
|
38
39
|
default: ""
|
|
40
|
+
prop :clearable, type: Playbook::Props::Boolean,
|
|
41
|
+
default: true
|
|
39
42
|
prop :start_date_id, type: Playbook::Props::String,
|
|
40
43
|
default: "start_date_id"
|
|
41
44
|
prop :start_date_name, type: Playbook::Props::String,
|
|
@@ -44,12 +47,16 @@ module Playbook
|
|
|
44
47
|
default: "end_date_id"
|
|
45
48
|
prop :end_date_name, type: Playbook::Props::String,
|
|
46
49
|
default: "end_date_name"
|
|
50
|
+
prop :placeholder, type: Playbook::Props::String
|
|
51
|
+
prop :constrain_height, type: Playbook::Props::Boolean,
|
|
52
|
+
default: false
|
|
47
53
|
|
|
48
54
|
def data
|
|
49
55
|
Hash(prop(:data)).merge(
|
|
50
56
|
pb_dropdown: true,
|
|
51
57
|
pb_dropdown_multi_select: multi_select,
|
|
52
58
|
pb_dropdown_variant: variant,
|
|
59
|
+
pb_dropdown_clearable: clearable,
|
|
53
60
|
form_pill_props: form_pill_props.to_json,
|
|
54
61
|
start_date_id: variant == "quickpick" ? start_date_id : nil,
|
|
55
62
|
end_date_id: variant == "quickpick" ? end_date_id : nil,
|
|
@@ -62,6 +69,14 @@ module Playbook
|
|
|
62
69
|
generate_classname("pb_dropdown", variant, separators_class)
|
|
63
70
|
end
|
|
64
71
|
|
|
72
|
+
def select_id
|
|
73
|
+
id.presence || (label.present? ? label.downcase.gsub(/\s+/, "_").gsub(/[^a-z0-9_]/, "") : nil)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def error_id
|
|
77
|
+
error.present? ? "#{select_id || 'dropdown_trigger'}-error" : nil
|
|
78
|
+
end
|
|
79
|
+
|
|
65
80
|
private
|
|
66
81
|
|
|
67
82
|
def error_class
|
|
@@ -122,6 +122,80 @@ test('generated placeholder prop', () => {
|
|
|
122
122
|
|
|
123
123
|
})
|
|
124
124
|
|
|
125
|
+
test('placeholder prop passed directly to Dropdown', () => {
|
|
126
|
+
render(
|
|
127
|
+
<Dropdown
|
|
128
|
+
data={{ testid: testId }}
|
|
129
|
+
options={options}
|
|
130
|
+
placeholder="Choose a country"
|
|
131
|
+
/>
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
const kit = screen.getByTestId(testId)
|
|
135
|
+
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
|
136
|
+
expect(trigger).toHaveTextContent('Choose a country')
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
test('placeholder works with default variant', () => {
|
|
140
|
+
render(
|
|
141
|
+
<Dropdown
|
|
142
|
+
data={{ testid: testId }}
|
|
143
|
+
options={options}
|
|
144
|
+
placeholder="Select an option"
|
|
145
|
+
variant="default"
|
|
146
|
+
/>
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
const kit = screen.getByTestId(testId)
|
|
150
|
+
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
|
151
|
+
expect(trigger).toHaveTextContent('Select an option')
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
test('placeholder works with subtle variant', () => {
|
|
155
|
+
render(
|
|
156
|
+
<Dropdown
|
|
157
|
+
data={{ testid: testId }}
|
|
158
|
+
options={options}
|
|
159
|
+
placeholder="Pick an option"
|
|
160
|
+
separators={false}
|
|
161
|
+
variant="subtle"
|
|
162
|
+
/>
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
const kit = screen.getByTestId(testId)
|
|
166
|
+
expect(kit).toHaveClass('pb_dropdown_subtle_separators_hidden')
|
|
167
|
+
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
|
168
|
+
expect(trigger).toHaveTextContent('Pick an option')
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
test('placeholder works with quickpick variant', () => {
|
|
172
|
+
render(
|
|
173
|
+
<Dropdown
|
|
174
|
+
data={{ testid: testId }}
|
|
175
|
+
placeholder="Select a date range"
|
|
176
|
+
variant="quickpick"
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
const kit = screen.getByTestId(testId)
|
|
181
|
+
expect(kit).toHaveClass('pb_dropdown_quickpick')
|
|
182
|
+
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
|
183
|
+
expect(trigger).toHaveTextContent('Select a date range')
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
test('placeholder shows default "Select..." when not provided', () => {
|
|
187
|
+
render(
|
|
188
|
+
<Dropdown
|
|
189
|
+
data={{ testid: testId }}
|
|
190
|
+
options={options}
|
|
191
|
+
/>
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
const kit = screen.getByTestId(testId)
|
|
195
|
+
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
|
196
|
+
expect(trigger).toHaveTextContent('Select...')
|
|
197
|
+
})
|
|
198
|
+
|
|
125
199
|
test('generated label prop', () => {
|
|
126
200
|
render (
|
|
127
201
|
<Dropdown
|
|
@@ -466,7 +540,27 @@ test("quickpick clears selection when clicking X icon", () => {
|
|
|
466
540
|
expect(trigger).toHaveTextContent("Select...")
|
|
467
541
|
})
|
|
468
542
|
|
|
543
|
+
test("quickpick hides clear icon when clearable is false", () => {
|
|
544
|
+
render(
|
|
545
|
+
<Dropdown
|
|
546
|
+
clearable={false}
|
|
547
|
+
data={{ testid: testId }}
|
|
548
|
+
defaultValue="This Week"
|
|
549
|
+
variant="quickpick"
|
|
550
|
+
/>
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
const kit = screen.getByTestId(testId)
|
|
554
|
+
const trigger = kit.querySelector('.pb_dropdown_trigger')
|
|
555
|
+
|
|
556
|
+
expect(trigger).toHaveTextContent("This Week")
|
|
557
|
+
|
|
558
|
+
const clearIcon = kit.querySelector('[aria-label="times icon"]')
|
|
559
|
+
expect(clearIcon).not.toBeInTheDocument()
|
|
560
|
+
})
|
|
561
|
+
|
|
469
562
|
test("quickpick returns date array values when option selected", () => {
|
|
563
|
+
// eslint-disable-next-line react/no-multi-comp
|
|
470
564
|
const TestComponent = () => {
|
|
471
565
|
const [selected, setSelected] = useState(null)
|
|
472
566
|
return (
|
|
@@ -5,9 +5,13 @@ module Playbook
|
|
|
5
5
|
class DropdownContainer < Playbook::KitBase
|
|
6
6
|
prop :searchbar, type: Playbook::Props::Boolean,
|
|
7
7
|
default: false
|
|
8
|
+
prop :constrain_height, type: Playbook::Props::Boolean,
|
|
9
|
+
default: false
|
|
8
10
|
|
|
9
11
|
def classname
|
|
10
|
-
|
|
12
|
+
classes = %w[pb_dropdown_container close]
|
|
13
|
+
classes << "constrain_height" if constrain_height
|
|
14
|
+
generate_classname(*classes, separator: " ")
|
|
11
15
|
end
|
|
12
16
|
|
|
13
17
|
def data
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<%= pb_content_tag do %>
|
|
2
2
|
<% if content.present? %>
|
|
3
|
-
<div style="display: inline-block" tabindex="0" data-dropdown-custom-trigger
|
|
3
|
+
<div style="display: inline-block" tabindex="0" data-dropdown="pb-dropdown-trigger" data-dropdown-custom-trigger aria-invalid="<%= object.error.present? %>"
|
|
4
|
+
<% if object.label.present? %> aria-label="<%= [object.label, object.default_display_placeholder].join(', ') %>"<% end %>
|
|
5
|
+
<% if object.select_id.present? %> id="<%= object.select_id %>"<% end %>
|
|
6
|
+
<% if object.error_id.present? %> aria-describedby="<%= object.error_id %>"<% end %>
|
|
7
|
+
>
|
|
4
8
|
<%= content.presence %>
|
|
5
9
|
</div>
|
|
6
10
|
<% else %>
|
|
@@ -9,24 +13,25 @@
|
|
|
9
13
|
border_radius:"lg",
|
|
10
14
|
classname: object.trigger_wrapper_classes,
|
|
11
15
|
cursor: object.autocomplete ? "text" : "pointer",
|
|
16
|
+
id: object.select_id,
|
|
12
17
|
justify: "between",
|
|
13
18
|
padding_x:"sm",
|
|
14
19
|
padding_y:"xs",
|
|
15
|
-
html_options: {tabindex:"0"}
|
|
20
|
+
html_options: { tabindex: "0", "aria-label": object.label.present? ? [object.label, object.default_display_placeholder].join(", ") : nil, "aria-describedby": object.error_id, "aria-invalid": object.error.present?, "data-dropdown": "pb-dropdown-trigger" }
|
|
16
21
|
}) do %>
|
|
17
22
|
<%= pb_rails("flex/flex_item", props: { fixed_size: object.multi_select ? "85%" : "" }) do %>
|
|
18
23
|
<%= pb_rails("flex", props: {align: "center"}) do %>
|
|
19
24
|
<% if object.custom_display.present? %>
|
|
20
25
|
<%= pb_rails("flex", props: {align: "center"}) do %>
|
|
21
|
-
<div
|
|
26
|
+
<div data-dropdown-trigger-custom-display style="display: none;">
|
|
22
27
|
<%= object.custom_display %>
|
|
23
28
|
</div>
|
|
24
|
-
<%= pb_rails("body", props: {text: object.default_display_placeholder,
|
|
29
|
+
<%= pb_rails("body", props: {text: object.default_display_placeholder, data: { 'dropdown-trigger-display': true }}) %>
|
|
25
30
|
<% end %>
|
|
26
31
|
<% else %>
|
|
27
32
|
<% if object.multi_select %>
|
|
28
33
|
<%= pb_rails("flex", props: { align: "center", wrap: true }) do %>
|
|
29
|
-
<%= pb_rails("flex", props: {
|
|
34
|
+
<%= pb_rails("flex", props: { data: { 'dropdown-pills-wrapper': true }, wrap: true }) do %>
|
|
30
35
|
<% end %>
|
|
31
36
|
<% if object.autocomplete %>
|
|
32
37
|
<input
|
|
@@ -37,7 +42,7 @@
|
|
|
37
42
|
autocomplete="off"
|
|
38
43
|
/>
|
|
39
44
|
<% else %>
|
|
40
|
-
<%= pb_rails("body", props: {text: object.default_display_placeholder,
|
|
45
|
+
<%= pb_rails("body", props: {text: object.default_display_placeholder, data: { "dropdown-trigger-display-multi-select": true }}) %>
|
|
41
46
|
<% end %>
|
|
42
47
|
<% end %>
|
|
43
48
|
<% else %>
|
|
@@ -50,7 +55,7 @@
|
|
|
50
55
|
autocomplete="off"
|
|
51
56
|
/>
|
|
52
57
|
<% else %>
|
|
53
|
-
<%= pb_rails("body", props: {text: object.default_display_placeholder,
|
|
58
|
+
<%= pb_rails("body", props: {text: object.default_display_placeholder, data: { 'dropdown-trigger-display': true }}) %>
|
|
54
59
|
<% end %>
|
|
55
60
|
<% end %>
|
|
56
61
|
<% end %>
|
|
@@ -58,9 +63,9 @@
|
|
|
58
63
|
<% end %>
|
|
59
64
|
<%= pb_rails("flex/flex_item") do %>
|
|
60
65
|
<%= pb_rails("body", props: {display: "flex", align_items:"center" }) do %>
|
|
61
|
-
<%= pb_rails("icon", props: {icon: "times", cursor: "pointer", size:"sm",
|
|
62
|
-
<%= pb_rails("icon", props: {icon: "chevron-down", cursor: "pointer", size:"sm",
|
|
63
|
-
<%= pb_rails("icon", props: {icon: "chevron-up", cursor: "pointer", size:"sm",
|
|
66
|
+
<%= pb_rails("icon", props: {icon: "times", cursor: "pointer", size:"sm", data:{'dropdown-clear-icon': true }, padding_right:"xs" }) %>
|
|
67
|
+
<%= pb_rails("icon", props: {icon: "chevron-down", cursor: "pointer", size:"sm", data:{'dropdown-open-icon': true }}) %>
|
|
68
|
+
<%= pb_rails("icon", props: {icon: "chevron-up", cursor: "pointer", size:"sm", data:{ 'dropdown-close-icon': true }}) %>
|
|
64
69
|
<% end %>
|
|
65
70
|
<% end %>
|
|
66
71
|
<% end %>
|
|
@@ -13,6 +13,10 @@ module Playbook
|
|
|
13
13
|
default: false
|
|
14
14
|
prop :multi_select, type: Playbook::Props::Boolean,
|
|
15
15
|
default: false
|
|
16
|
+
prop :select_id, type: Playbook::Props::String
|
|
17
|
+
prop :label, type: Playbook::Props::String
|
|
18
|
+
prop :error_id, type: Playbook::Props::String
|
|
19
|
+
prop :error, type: Playbook::Props::String
|
|
16
20
|
|
|
17
21
|
def data
|
|
18
22
|
Hash(prop(:data)).merge(dropdown_trigger: true, dropdown_placeholder: default_display_placeholder)
|