vident-view_component 1.0.0.beta1 → 1.0.0.beta2
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/CHANGELOG.md +10 -0
- data/README.md +6 -6
- data/lib/vident/view_component/base.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 04f65c3476a4173c32cc063c60eaaef6d588d0c66a6e94d9ae1237e8130ccf12
|
|
4
|
+
data.tar.gz: 40731bc5242a66c80a5a71b731adb97ef4c5f558da0580aff635c80a707171d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fca4cc83f6bb06224ef3e3925f246459067bd12c72797b3542517c49092262f649ba1f2547fa169b93638ff64a7fce14cec943b780db4dd8864cd4a5d8e3439b
|
|
7
|
+
data.tar.gz: dbeb376b521f65809985226254496164ca5454f5988f376d0345a438578e8fe5a1497e10f9dfff1fba9ab1adc5af3abe711613c03c98406242fdcc66c0bdba09
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## [1.0.0.beta2] - 2026-04-16
|
|
10
|
+
|
|
11
|
+
### Breaking
|
|
12
|
+
|
|
13
|
+
- Renamed the `tag(...)` helper to `child_element(...)` (and the internal `Vident::TagHelper` module to `Vident::ChildElementHelper`). The old name shadowed Rails' own `tag(name, options)` positional API, which breaks Rails helpers like `hidden_field_tag` and `image_tag` when called inside vident components. Rename any `component.tag(...)` calls to `component.child_element(...)`.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `stimulus_outlet` parser now accepts `(String, String)` arguments so string-keyed outlets produced by the DSL actually render.
|
|
18
|
+
|
|
9
19
|
## [1.0.0.beta1] - 2026-04-16
|
|
10
20
|
|
|
11
21
|
### Fixed
|
data/README.md
CHANGED
|
@@ -93,7 +93,7 @@ class ButtonComponent < Vident::ViewComponent::Base
|
|
|
93
93
|
def call
|
|
94
94
|
root_element do |component|
|
|
95
95
|
# Wire up targets etc
|
|
96
|
-
component.
|
|
96
|
+
component.child_element(:span, stimulus_target: :status) do
|
|
97
97
|
@text
|
|
98
98
|
end
|
|
99
99
|
end
|
|
@@ -483,13 +483,13 @@ or you can use tag helpers to generate HTML with Stimulus attributes:
|
|
|
483
483
|
<% end %>
|
|
484
484
|
<%= content_tag(:span, class: "...", data: {**greeter.stimulus_target(:output)}) %>
|
|
485
485
|
|
|
486
|
-
<%# OR use the vident
|
|
486
|
+
<%# OR use the vident child_element helper %>
|
|
487
487
|
|
|
488
|
-
<%= greeter.
|
|
489
|
-
<%= greeter.
|
|
488
|
+
<%= greeter.child_element(:input, stimulus_target: :name, type: "text", class: "...") %>
|
|
489
|
+
<%= greeter.child_element(:button, stimulus_action: [:click, :greet], class: "...") do %>
|
|
490
490
|
<%= @cta %>
|
|
491
491
|
<% end %>
|
|
492
|
-
<%= greeter.
|
|
492
|
+
<%= greeter.child_element(:span, stimulus_target: :output, class: "...") %>
|
|
493
493
|
```
|
|
494
494
|
|
|
495
495
|
or in your Phlex templates:
|
|
@@ -498,7 +498,7 @@ or in your Phlex templates:
|
|
|
498
498
|
root_element do |greeter|
|
|
499
499
|
input(type: "text", data: {**greeter.stimulus_target(:name)}, class: %(...))
|
|
500
500
|
trigger_or_default(greeter)
|
|
501
|
-
greeter.
|
|
501
|
+
greeter.child_element(:span, stimulus_target: :output, class: "ml-4 #{greeter.class_list_for_stimulus_classes(:pre_click)}") do
|
|
502
502
|
plain %( ... )
|
|
503
503
|
end
|
|
504
504
|
end
|
|
@@ -102,7 +102,7 @@ module Vident
|
|
|
102
102
|
|
|
103
103
|
private
|
|
104
104
|
|
|
105
|
-
def
|
|
105
|
+
def generate_child_element(tag_name, stimulus_data_attributes, options, &block)
|
|
106
106
|
options[:data] ||= {}
|
|
107
107
|
options[:data].merge!(stimulus_data_attributes)
|
|
108
108
|
if SELF_CLOSING_TAGS.include?(tag_name.to_sym)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vident-view_component
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.
|
|
4
|
+
version: 1.0.0.beta2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen Ierodiaconou
|
|
@@ -55,14 +55,14 @@ dependencies:
|
|
|
55
55
|
requirements:
|
|
56
56
|
- - "~>"
|
|
57
57
|
- !ruby/object:Gem::Version
|
|
58
|
-
version: 1.0.0.
|
|
58
|
+
version: 1.0.0.beta2
|
|
59
59
|
type: :runtime
|
|
60
60
|
prerelease: false
|
|
61
61
|
version_requirements: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
|
63
63
|
- - "~>"
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
|
-
version: 1.0.0.
|
|
65
|
+
version: 1.0.0.beta2
|
|
66
66
|
- !ruby/object:Gem::Dependency
|
|
67
67
|
name: view_component
|
|
68
68
|
requirement: !ruby/object:Gem::Requirement
|