view_component_reflex 3.3.12 → 3.3.14
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a75a8301629627371f3bf6e3b29b8d71dfb390030aa2da3d07895e3c4b8cb6c
|
4
|
+
data.tar.gz: b893a78ec0167b1e67b4a028b816114cce099232b0fc20761675cdb885e611bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b6e1bb7975e7e1a97aae420ac3b179adaf410d123aac06c070b94b98e9345d265d83a89848fb50f14d1f65e66a23b06981e95ac0adf8f35bab86fbfcebea390
|
7
|
+
data.tar.gz: 9a47ab602fa6ca508d56426fdaeeab407ed281bf240e2293694e616f165de151b48fb9634840acea6169eb9cb9b23a0a9d4f9d28841849acfa65c68cbd0e8aff
|
@@ -32,8 +32,12 @@ module ViewComponentReflex
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def register_callbacks(key)
|
35
|
-
|
36
|
-
|
35
|
+
ancestors.each do |klass|
|
36
|
+
next unless klass.respond_to?(:callbacks)
|
37
|
+
break if klass == ViewComponentReflex::Component
|
38
|
+
klass.callbacks(key).each do |cb|
|
39
|
+
@stimulus_reflex.send("#{key}_reflex", *cb[:args], &cb[:blk])
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
@@ -253,7 +257,7 @@ module ViewComponentReflex
|
|
253
257
|
:@virtual_path, :@variant, :@current_template, :@output_buffer, :@key,
|
254
258
|
:@helpers, :@controller, :@request, :@tag_builder, :@state_initialized,
|
255
259
|
:@_content_evaluated, :@_render_in_block, :@__cached_content,
|
256
|
-
:@original_view_context, :@compiler,
|
260
|
+
:@original_view_context, :@compiler,
|
257
261
|
]
|
258
262
|
end
|
259
263
|
|
@@ -34,24 +34,12 @@ module ViewComponentReflex
|
|
34
34
|
@reflex_instance ||= build_reflex_instance
|
35
35
|
end
|
36
36
|
|
37
|
-
def reflex_methods
|
38
|
-
arr = []
|
39
|
-
current_class = @component
|
40
|
-
loop do
|
41
|
-
arr += current_class.instance_methods
|
42
|
-
current_class = current_class.superclass
|
43
|
-
break if current_class == ViewComponentReflex::Component || current_class.nil?
|
44
|
-
end
|
45
|
-
arr -= ViewComponentReflex::Component.instance_methods
|
46
|
-
arr -= [:call, :"_call_#{@component.name.underscore}"]
|
47
|
-
arr
|
48
|
-
end
|
49
|
-
|
50
37
|
##
|
51
38
|
# Beyond just creating the <Component>Reflex class, we need to define all the component methods on the reflex
|
52
39
|
# class.
|
53
40
|
# This replaces the old method_missing implementation, and passes more strict validation of recent SR versions
|
54
41
|
def build_reflex_instance
|
42
|
+
reflex_methods = @component.instance_methods - ViewComponentReflex::Component.instance_methods - [:call, :"_call_#{@component.name.underscore}"]
|
55
43
|
component_allocate = @component.allocate
|
56
44
|
Class.new(@component.reflex_base_class).tap do |klass|
|
57
45
|
klass.instance_variable_set(:@__method_parameters, {})
|