hotwire_combobox 0.1.23 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/presenters/hotwire_combobox/component.rb +7 -7
- data/lib/hotwire_combobox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed7d6d8db12168ce351163deb6c0a115ff0bcd4c48782c0100451e468973a734
|
4
|
+
data.tar.gz: eca9d97a02259ab886364ca4501c1b94e3945bbd4d101f7bf0905149ff216219
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 431f3651c5479d5f6a0ab164067f7192a75601f73dbc4ae14d85f7d7cfc52c5e70d544e63ad33bf594b722a8ffb8c6825bc29a6255e1d32bada70b4920bb2ad7
|
7
|
+
data.tar.gz: f0110e653d8fd260bcc7f942d0fba4609c840b179bcf3d12e0e576187d2ede18f053bca3a5cb28a18d43b3d753101bacdbf18db52bab381617a6468f0ddf03ff
|
@@ -14,13 +14,13 @@ class HotwireCombobox::Component
|
|
14
14
|
name_when_new: nil,
|
15
15
|
open: false,
|
16
16
|
options: [],
|
17
|
-
|
17
|
+
mobile_at: "640px",
|
18
18
|
value: nil,
|
19
19
|
**rest
|
20
20
|
@view, @autocomplete, @id, @name, @value, @form, @async_src,
|
21
|
-
@name_when_new, @open, @data, @
|
21
|
+
@name_when_new, @open, @data, @mobile_at, @options, @dialog_label =
|
22
22
|
view, autocomplete, id, name, value, form, async_src,
|
23
|
-
name_when_new, open, data,
|
23
|
+
name_when_new, open, data, mobile_at, options, dialog_label
|
24
24
|
|
25
25
|
@combobox_attrs = input.reverse_merge(rest).with_indifferent_access
|
26
26
|
@association_name = association_name || infer_association_name
|
@@ -136,7 +136,7 @@ class HotwireCombobox::Component
|
|
136
136
|
|
137
137
|
private
|
138
138
|
attr_reader :view, :autocomplete, :id, :name, :value, :form,
|
139
|
-
:name_when_new, :open, :data, :combobox_attrs, :
|
139
|
+
:name_when_new, :open, :data, :combobox_attrs, :mobile_at,
|
140
140
|
:association_name
|
141
141
|
|
142
142
|
def infer_association_name
|
@@ -153,7 +153,7 @@ class HotwireCombobox::Component
|
|
153
153
|
hw_combobox_name_when_new_value: name_when_new,
|
154
154
|
hw_combobox_original_name_value: hidden_field_name,
|
155
155
|
hw_combobox_autocomplete_value: autocomplete,
|
156
|
-
hw_combobox_small_viewport_max_width_value:
|
156
|
+
hw_combobox_small_viewport_max_width_value: mobile_at,
|
157
157
|
hw_combobox_async_src_value: async_src,
|
158
158
|
hw_combobox_prefilled_display_value: prefilled_display,
|
159
159
|
hw_combobox_filterable_attribute_value: "data-filterable-as",
|
@@ -164,8 +164,8 @@ class HotwireCombobox::Component
|
|
164
164
|
def prefilled_display
|
165
165
|
if async_src && associated_object
|
166
166
|
associated_object.to_combobox_display
|
167
|
-
elsif
|
168
|
-
options.find { |option| option.value ==
|
167
|
+
elsif hidden_field_value
|
168
|
+
options.find { |option| option.value == hidden_field_value }&.content
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|