hotwire_combobox 0.1.8 → 0.1.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cb2abe7ffd7dc81c39b774fb0028f0f9650182978735f3d21a3d375a32a948e
4
- data.tar.gz: a038bd3ce8baff5a47e281be380cc0c4c0b77433cab3161174958a0f135fab08
3
+ metadata.gz: 115007b81c7f19287376a49f41aa34c43e2fb331a18459b9f47877bf282d15cf
4
+ data.tar.gz: b5eb9f21bd0f46f39a434ef8dea3d82a639e00b0dfb7f131c8264c77a55ac2ae
5
5
  SHA512:
6
- metadata.gz: 52b14433be746e89f6e0612f42d3a84ed323ebb2931a93d535b90bb9eb1fbde555ea3bf0a3496774b9eb91c30ba0035576e6c3fab7da69e97e7228e927767e69
7
- data.tar.gz: '09662cb44deb6854dca5d7a6919ae6170dff3ebcbbae9cab7ea7b1b368ec85e0db82f823a3471886cb55b9e4a44da6bd7e141bdc0e5948266b118ed96b2873bc'
6
+ metadata.gz: fd39e53b94270d271b0b397d4e983346ea3b99a8054d0f2ab59756a38e440b23d7bf53d63cd34e1422530aaa1fa2fe0fec57aa5d0f693778d52f0f3a2e722b18
7
+ data.tar.gz: b8ef213bc60a3b722d25bf4532e562151b4c660ebac0c5c75283cb045532787ff51bcb12ecafdeac28af54dc20262646d4953d5a7f306bdd43950442160831bc
@@ -16,6 +16,7 @@ export default class extends Controller {
16
16
  }
17
17
 
18
18
  close() {
19
+ if (!this.isOpen) return
19
20
  this.commitSelection()
20
21
  this.expandedValue = false
21
22
  }
@@ -1,8 +1,13 @@
1
1
  module HotwireCombobox
2
2
  module Helper
3
+ class << self
4
+ delegate :bypass_convenience_methods?, to: :HotwireCombobox
5
+ end
6
+
3
7
  def hw_combobox_options(options)
4
8
  options.map { |option| hw_combobox_option(**option) }
5
9
  end
10
+ alias_method :combobox_options, :hw_combobox_options unless bypass_convenience_methods?
6
11
 
7
12
  def hw_combobox_tag(name, value = nil, form: nil, options: [], data: {}, input: {}, **attrs)
8
13
  value_field_attrs = {}.tap do |h|
@@ -23,11 +28,7 @@ module HotwireCombobox
23
28
  listbox_id: hw_combobox_listbox_id(value_field_attrs[:id]),
24
29
  parent_data: default_hw_combobox_parent_data(attrs, data)
25
30
  end
26
-
27
- unless HotwireCombobox.bypass_convenience_methods?
28
- alias_method :combobox_options, :hw_combobox_options
29
- alias_method :combobox_tag, :hw_combobox_tag
30
- end
31
+ alias_method :combobox_tag, :hw_combobox_tag unless bypass_convenience_methods?
31
32
 
32
33
  def hw_listbox_option_id(option)
33
34
  option.try(:id)
@@ -1,3 +1,3 @@
1
1
  module HotwireCombobox
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.10"
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.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Farias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-12 00:00:00.000000000 Z
11
+ date: 2023-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails