view_component_reflex 2.3.6 → 2.3.7
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 +4 -4
- data/README.md +1 -1
- data/lib/view_component_reflex/reflex.rb +1 -18
- data/lib/view_component_reflex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 928f47f83cfe7da7261495c367ebd3690db92cddeb4c09ae0fa1e84f88f03cf4
|
|
4
|
+
data.tar.gz: 043a0dc613483eb6d072868fb1a83e00e7d10e1035d3de549e6a6a57f8d420f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64834d62cc4b729be28f292297d4b73a2eac0654cf8ed99a8fdd28f84935825be14cf1d5722548c01c451d9079ed9ca96f6f05f3aef9907e9b53c1092e403895
|
|
7
|
+
data.tar.gz: 6e684ca6d8a49cb30267263b96830dc60af39c3db047fbdc0e2a0231dd6b321f7cb7b0eb80703336f3311b60e6088c2f28ef5cde12903d54850d3dc042a695fb
|
data/README.md
CHANGED
|
@@ -324,7 +324,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
324
324
|
|
|
325
325
|
## Caveats
|
|
326
326
|
|
|
327
|
-
State uses session to maintain state as of right now. It also assumes your component view is written with
|
|
327
|
+
State uses session to maintain state as of right now. It also assumes your component view is written with a file extension of either `.html.erb`, `.html.haml` or `.html.slim`.
|
|
328
328
|
|
|
329
329
|
## Support me
|
|
330
330
|
|
|
@@ -35,12 +35,7 @@ module ViewComponentReflex
|
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
document = Nokogiri::HTML(controller.render_component_to_string(component))
|
|
38
|
-
|
|
39
|
-
selector: selector,
|
|
40
|
-
children_only: true,
|
|
41
|
-
html: document.css(selector).inner_html,
|
|
42
|
-
permanent_attribute_name: "data-reflex-permanent"
|
|
43
|
-
)
|
|
38
|
+
morph selector, document.css(selector).inner_html
|
|
44
39
|
end
|
|
45
40
|
|
|
46
41
|
def refresh_all!
|
|
@@ -62,19 +57,7 @@ module ViewComponentReflex
|
|
|
62
57
|
!!name.to_proc
|
|
63
58
|
end
|
|
64
59
|
|
|
65
|
-
# this is copied out of stimulus_reflex/reflex.rb and modified
|
|
66
|
-
def morph(selectors, html = "")
|
|
67
|
-
case selectors
|
|
68
|
-
when :nothing
|
|
69
|
-
@broadcaster = StimulusReflex::NothingBroadcaster.new(self)
|
|
70
|
-
else
|
|
71
|
-
@broadcaster = StimulusReflex::SelectorBroadcaster.new(self) unless broadcaster.selector?
|
|
72
|
-
broadcaster.morphs << [selectors, html]
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
60
|
def method_missing(name, *args)
|
|
77
|
-
morph :nothing
|
|
78
61
|
super unless respond_to_missing?(name)
|
|
79
62
|
state.each do |k, v|
|
|
80
63
|
component.instance_variable_set(k, v)
|