hotwire_combobox 0.2.2 → 0.2.4

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: fbd0907dd22a30683ba48f331a588c125f47ad6ad05d3bd613b5fc44047ed153
4
- data.tar.gz: 330118f1c3cf332a93fe29f3ccf25b4a287362047d1301608c838d601d2f920c
3
+ metadata.gz: 7a06f74ec8d38e109d2fec2b81c56d58ada9e5644e371a072eb690eb3c2ab383
4
+ data.tar.gz: d3e07d9dbc14afe6764ae239609766f7cc5a5374fca55816d47dd167ad54a203
5
5
  SHA512:
6
- metadata.gz: 5cb2373c38c8f9bbe0d7d0276183e516100effd4973c87a9587d2d45dc854cb54dbb0fa55eef0db8eac2226399878c3d02f0868ae1ae6ca45185db0f5b15739d
7
- data.tar.gz: eca06ee9703ec8929bede6a1b706a86e76905c7cd7be23233c2fe997c47db67d412ea5ea437c67416fe43aeb07679074b3f5d493ce491308f99edf78c1df664b
6
+ metadata.gz: 9eedaa03fe6a6c4d1dee68f4c23090c1d6ed4a26208a0a877e3f134fcb15dbe0120d40c9048b8f5009f378c6f8d9e2cfafd04d2f69d3b699810f604339bf45b3
7
+ data.tar.gz: 2be4c0676906f3757f2f8fe5e16cebecd1040cd2161dcdfed9bcb64d39729f46d5ed6e64a51a389a865f190a6bcef8ec2dbafe1f47b2c5102d922ea083e5f74e
@@ -1,5 +1,5 @@
1
1
  /*!
2
- HotwireCombobox 0.2.2
2
+ HotwireCombobox 0.2.4
3
3
  */
4
4
  import { Controller } from '@hotwired/stimulus';
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- HotwireCombobox 0.2.2
2
+ HotwireCombobox 0.2.4
3
3
  */
4
4
  (function (global, factory) {
5
5
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@hotwired/stimulus')) :
@@ -248,7 +248,7 @@ class HotwireCombobox::Component
248
248
  end
249
249
 
250
250
  def association_exists?
251
- form_object&.class&.reflect_on_association(association_name).present?
251
+ association_name && form_object&.respond_to?(association_name)
252
252
  end
253
253
 
254
254
  def form_object
@@ -300,7 +300,7 @@ class HotwireCombobox::Component
300
300
  def hidden_field_value
301
301
  return value if value
302
302
 
303
- if form_object&.defined_enums&.try :[], name
303
+ if form_object&.try(:defined_enums)&.try(:[], name)
304
304
  form_object.public_send "#{name}_before_type_cast"
305
305
  else
306
306
  form_object&.try(name).then do |value|
@@ -4,7 +4,7 @@
4
4
  <%= render "hotwire_combobox/combobox/hidden_field", component: component %>
5
5
 
6
6
  <%= tag.div **component.main_wrapper_attrs do %>
7
- <%# Announcer styles defined here because they're not optional %>
7
+ <%# Essential styles defined here, removing these would break the combobox %>
8
8
  <%= tag.style nonce: content_security_policy_nonce do %>
9
9
  .hw-combobox__announcer {
10
10
  position: absolute;
@@ -16,6 +16,10 @@
16
16
  clip: rect(0, 0, 0, 0);
17
17
  border: 0;
18
18
  }
19
+
20
+ .hw_combobox__pagination__wrapper {
21
+ height: 5px;
22
+ }
19
23
  <% end %>
20
24
  <%= tag.div **component.announcer_attrs %>
21
25
  <%= render "hotwire_combobox/combobox/input", component: component %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (for_id:, src:) -%>
2
2
 
3
- <%= tag.li id: hw_pagination_frame_wrapper_id(for_id), data: {
4
- hw_combobox_target: "endOfOptionsStream", input_type: params[:input_type] },
3
+ <%= tag.li id: hw_pagination_frame_wrapper_id(for_id), class: "hw_combobox__pagination__wrapper",
4
+ data: { hw_combobox_target: "endOfOptionsStream", input_type: params[:input_type] },
5
5
  aria: { hidden: true } do %>
6
6
  <%= turbo_frame_tag hw_pagination_frame_id(for_id), src: src, loading: :lazy %>
7
7
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module HotwireCombobox
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotwire_combobox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Farias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-15 00:00:00.000000000 Z
11
+ date: 2024-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.5.7
147
+ rubygems_version: 3.5.9
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Accessible Autocomplete for Rails apps