hotwire_combobox 0.1.12 → 0.1.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f868770ad8adc907437ea9d7c0f2a9550b848a1ab0ca3dddb3592aacd4ce75a
|
4
|
+
data.tar.gz: 6d1932f507fd650da412d2bacc1d6dc01faed6b8d3f2230fe9df1251b66baaf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31127e0fa02f231b604b10b25f5ff514b33065814a3283ae4d6c338ab59835ef8696e19496f867bec8ddc564066a1b5af2c6c7fa1a88e88507c1943bb741f6ce
|
7
|
+
data.tar.gz: 77070143486b82fa1b0d3179e1fb74fe43300988a6a6c2c3654dc883a06d1b4b3a9e069e10d8e71f543ee72ee6a242cba42ef7e595e6ba377a530e73954a1aca
|
@@ -3,26 +3,28 @@ module HotwireCombobox
|
|
3
3
|
class << self
|
4
4
|
delegate :bypass_convenience_methods?, to: :HotwireCombobox
|
5
5
|
|
6
|
-
def
|
6
|
+
def hw_alias(method_name)
|
7
7
|
unless bypass_convenience_methods?
|
8
8
|
alias_method method_name.to_s.sub(/^hw_/, ""), method_name
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
def hw_combobox_style_tag(*args, **kwargs)
|
14
14
|
stylesheet_link_tag HotwireCombobox.stylesheet_path, *args, **kwargs
|
15
15
|
end
|
16
|
+
hw_alias :hw_combobox_style_tag
|
16
17
|
|
17
|
-
|
18
|
+
def hw_combobox_tag(*args, async_src: nil, options: [], render_in: {}, **kwargs)
|
18
19
|
options = hw_combobox_options options, render_in: render_in
|
19
20
|
src = hw_uri_with_params async_src, format: :turbo_stream
|
20
21
|
component = HotwireCombobox::Component.new self, *args, options: options, async_src: src, **kwargs
|
21
22
|
|
22
23
|
render "hotwire_combobox/combobox", component: component
|
23
24
|
end
|
25
|
+
hw_alias :hw_combobox_tag
|
24
26
|
|
25
|
-
|
27
|
+
def hw_combobox_options(options, render_in: {}, display: :to_combobox_display, **methods)
|
26
28
|
if options.first.is_a? HotwireCombobox::Listbox::Option
|
27
29
|
options
|
28
30
|
else
|
@@ -35,17 +37,20 @@ module HotwireCombobox
|
|
35
37
|
hw_parse_combobox_options options, **methods.merge(display: display, content: content)
|
36
38
|
end
|
37
39
|
end
|
40
|
+
hw_alias :hw_combobox_options
|
38
41
|
|
39
|
-
|
42
|
+
def hw_paginated_combobox_options(options, for_id:, src:, next_page:, render_in: {}, **methods)
|
40
43
|
this_page = render("hotwire_combobox/paginated_options", for_id: for_id, options: hw_combobox_options(options, render_in: render_in, **methods), format: :turbo_stream)
|
41
44
|
next_page = render("hotwire_combobox/next_page", src: src, next_page: next_page, format: :turbo_stream)
|
42
45
|
|
43
46
|
safe_join [ this_page, next_page ]
|
44
47
|
end
|
48
|
+
hw_alias :hw_paginated_combobox_options
|
45
49
|
|
46
|
-
|
50
|
+
def hw_listbox_options_id(id)
|
47
51
|
"#{id}-hw-listbox__options"
|
48
52
|
end
|
53
|
+
hw_alias :hw_listbox_options_id
|
49
54
|
|
50
55
|
private
|
51
56
|
def hw_uri_with_params(url_or_path, **params)
|