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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3e569c002283e9c7607436fe40d39d4789c022ce674068eaefc6a069d08a62f
4
- data.tar.gz: 17221f3d22206fb0dd4255f5e8bbb122786bea3cc061f75277c8dd6aa676a948
3
+ metadata.gz: ed7d6d8db12168ce351163deb6c0a115ff0bcd4c48782c0100451e468973a734
4
+ data.tar.gz: eca9d97a02259ab886364ca4501c1b94e3945bbd4d101f7bf0905149ff216219
5
5
  SHA512:
6
- metadata.gz: 0d645d16b89e63e2960f534c7c6a3efe69c3d9636d290afd32a6fde0a4849057e5dbb87b247e48ee6a58349d488cd7e58ca11a102a70781e58a1eb57f970be09
7
- data.tar.gz: df0d0ae02c7bfb5056b290649d28f08823c42793ade4f6198e82aa9ddc144a842f1a416eebd960ef4d233e1197531a9ea45bb2f1eceb3b740432311838f930c6
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
- small_width: "640px",
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, @small_width, @options, @dialog_label =
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, small_width, options, dialog_label
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, :small_width,
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: small_width,
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 value
168
- options.find { |option| option.value == value }&.content
167
+ elsif hidden_field_value
168
+ options.find { |option| option.value == hidden_field_value }&.content
169
169
  end
170
170
  end
171
171
 
@@ -1,3 +1,3 @@
1
1
  module HotwireCombobox
2
- VERSION = "0.1.23"
2
+ VERSION = "0.1.25"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotwire_combobox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Farias