hotwire_combobox 0.1.29 → 0.1.31

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: 14372fcb04782e802cee0f9efdb185b7e7c2e4287777eb41516497dfccc52c16
4
- data.tar.gz: f48fb08f024f98b609f1df2c1957df5061d7ab2753481c9e92490e3098752467
3
+ metadata.gz: fad424ae43c806dbdd3225d794d2ddf769baebfb6f88d36f889740a166820b52
4
+ data.tar.gz: bcfe583600ad08b2cbfa207bfcf0b987c34278e0f20b5db41b30d520d29248d3
5
5
  SHA512:
6
- metadata.gz: 227c87a2d231ddaddf2ae337137cb838598b43a9d840efbf6dab74fe14a3f3c00c3eee1afb03a9bd0acd30ddfd171fd9c62828bcd1d6fcb0a3614f5ad4e6e276
7
- data.tar.gz: c8d7917a0034990b07c58bef3f9deeaf8790258b4a7169dab940769513fdc338d0e7433bf275240ef3af9c5086cc2c2645efde2112a4f61e274423a5b433d8d9
6
+ metadata.gz: 042322c92228ec2e631e4ff82fbe093d4c1813a292eaa60792f06616a4d339af1983976dcd8d5788030176942a63831a8a534ad062d8f68df186af8b534ef8c3
7
+ data.tar.gz: 615120f4220a603caf11b86b853c8498113d49d56d695195398cdd9e9c56abc7867a652810106fdcbddad55b23667b16f6d0048964efcb5a370e3f3bb54c9e35
@@ -137,7 +137,7 @@ class HotwireCombobox::Component
137
137
  end
138
138
 
139
139
  def pagination_attrs
140
- { for_id: hidden_field_id, src: async_src }
140
+ { for_id: canonical_id, src: async_src }
141
141
  end
142
142
 
143
143
  private
@@ -153,7 +153,7 @@ class HotwireCombobox::Component
153
153
 
154
154
  def fieldset_data
155
155
  data.reverse_merge \
156
- async_id: hidden_field_id,
156
+ async_id: canonical_id,
157
157
  controller: view.token_list("hw-combobox", data[:controller]),
158
158
  hw_combobox_expanded_value: open,
159
159
  hw_combobox_name_when_new_value: name_when_new,
@@ -186,10 +186,15 @@ class HotwireCombobox::Component
186
186
  end
187
187
 
188
188
 
189
- def hidden_field_id
189
+ def canonical_id
190
190
  id || form&.field_id(name)
191
191
  end
192
192
 
193
+
194
+ def hidden_field_id
195
+ "#{canonical_id}-hw-hidden-field"
196
+ end
197
+
193
198
  def hidden_field_name
194
199
  form&.field_name(name) || name
195
200
  end
@@ -204,7 +209,7 @@ class HotwireCombobox::Component
204
209
 
205
210
 
206
211
  def input_id
207
- "#{hidden_field_id}-hw-combobox"
212
+ canonical_id
208
213
  end
209
214
 
210
215
  def input_type
@@ -220,7 +225,7 @@ class HotwireCombobox::Component
220
225
  click@window->hw-combobox#closeOnClickOutside
221
226
  focusin@window->hw-combobox#closeOnFocusOutside".squish,
222
227
  hw_combobox_target: "combobox",
223
- async_id: hidden_field_id
228
+ async_id: canonical_id
224
229
  end
225
230
 
226
231
  def input_aria
@@ -241,7 +246,7 @@ class HotwireCombobox::Component
241
246
 
242
247
 
243
248
  def listbox_id
244
- "#{hidden_field_id}-hw-listbox"
249
+ "#{canonical_id}-hw-listbox"
245
250
  end
246
251
 
247
252
  def listbox_data
@@ -262,7 +267,7 @@ class HotwireCombobox::Component
262
267
  end
263
268
 
264
269
  def dialog_input_id
265
- "#{hidden_field_id}-hw-dialog-combobox"
270
+ "#{canonical_id}-hw-dialog-combobox"
266
271
  end
267
272
 
268
273
  def dialog_input_data
@@ -284,7 +289,7 @@ class HotwireCombobox::Component
284
289
  end
285
290
 
286
291
  def dialog_listbox_id
287
- "#{hidden_field_id}-hw-dialog-listbox"
292
+ "#{canonical_id}-hw-dialog-listbox"
288
293
  end
289
294
 
290
295
  def dialog_listbox_data
@@ -4,7 +4,8 @@ module HotwireCombobox
4
4
 
5
5
  initializer "hotwire_combobox.view_helpers" do
6
6
  ActiveSupport.on_load :action_view do
7
- include HotwireCombobox::Helper
7
+ require "hotwire_combobox/helper"
8
+ ActionView::Base.include HotwireCombobox::Helper
8
9
 
9
10
  unless HotwireCombobox.bypass_convenience_methods?
10
11
  module FormBuilderExtensions
@@ -1,3 +1,3 @@
1
1
  module HotwireCombobox
2
- VERSION = "0.1.29"
2
+ VERSION = "0.1.31"
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.29
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Farias
@@ -83,7 +83,6 @@ files:
83
83
  - app/assets/javascripts/vendor/bodyScrollLock.js
84
84
  - app/assets/javascripts/vendor/requestjs.js
85
85
  - app/assets/stylesheets/hotwire_combobox.css
86
- - app/helpers/hotwire_combobox/helper.rb
87
86
  - app/presenters/hotwire_combobox/component.rb
88
87
  - app/presenters/hotwire_combobox/listbox/option.rb
89
88
  - app/views/hotwire_combobox/_combobox.html.erb
@@ -97,6 +96,7 @@ files:
97
96
  - config/importmap.rb
98
97
  - lib/hotwire_combobox.rb
99
98
  - lib/hotwire_combobox/engine.rb
99
+ - lib/hotwire_combobox/helper.rb
100
100
  - lib/hotwire_combobox/version.rb
101
101
  homepage: https://github.com/josefarias/hotwire_combobox
102
102
  licenses:
File without changes