vident-typed-view_component 0.1.0 → 0.3.0
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 +10 -3
- data/lib/vident/typed/view_component/base.rb +1 -7
- data/lib/vident/typed/view_component/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4f375aebb6538a709d020fdbbcbc155630f8dba3b530c94131f25b1936a1d37
|
4
|
+
data.tar.gz: 27655ab98b6f7934f4195b55fa2989e64eeee4c1bc572aa49c494dba6864c4c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c29b1e14e63da63426141c943acdf924168ea1610735699a49ac567ddfddff2b08836f3b654dfb2cf1798df1aba47fb70fbc9bfa9377b1423b049b0ba2ef82b4
|
7
|
+
data.tar.gz: c9d19cc030d57a624f22b0c62b98e72eda3bde614657acead29d1ec4d334982deff397ae756feaa24fc626cba458a092d5692e84ad561d7df0fd22241cd191e8
|
data/README.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Vident::Typed::ViewComponent
|
2
|
-
Short description and motivation.
|
3
2
|
|
3
|
+
Adds typed attributes to Vident ViewComponent components.
|
4
|
+
|
5
|
+
```ruby
|
6
|
+
class ApplicationComponent < ::Vident::Typed::ViewComponent::Base
|
7
|
+
end
|
8
|
+
```
|
9
|
+
|
10
|
+
For more details see [vident](https://github.com/stevegeek/vident).
|
4
11
|
|
5
12
|
# Examples
|
6
13
|
|
@@ -29,7 +36,7 @@ It supports numerous sizes and shapes and can optionally have a border. It also
|
|
29
36
|
```ruby
|
30
37
|
class AvatarComponent < ::Vident::Typed::ViewComponent::Base
|
31
38
|
include ::Vident::Tailwind
|
32
|
-
include ::Vident::
|
39
|
+
include ::Vident::Caching
|
33
40
|
|
34
41
|
no_stimulus_controller
|
35
42
|
with_cache_key :attributes
|
@@ -168,7 +175,7 @@ used to greet the user. At the same time the button changes to be a 'reset' butt
|
|
168
175
|
<!-- render the Greeter ViewComponent (that uses Vident) -->
|
169
176
|
<%= render ::GreeterComponent.new(cta: "Hey!", html_options: {class: "my-4"}) do |greeter| %>
|
170
177
|
<%# this component has a slot called `trigger` that renders a `ButtonComponent` (which also uses Vident) %>
|
171
|
-
<% greeter.
|
178
|
+
<% greeter.with_trigger(
|
172
179
|
|
173
180
|
# The button component has attributes that are typed
|
174
181
|
before_clicked: "Greet",
|
@@ -1,14 +1,8 @@
|
|
1
1
|
module Vident
|
2
2
|
module Typed
|
3
3
|
module ViewComponent
|
4
|
-
class Base < ::ViewComponent::
|
4
|
+
class Base < ::Vident::ViewComponent::Core
|
5
5
|
include ::Vident::Typed::Component
|
6
|
-
|
7
|
-
# Helper to create the main element
|
8
|
-
def parent_element(**options)
|
9
|
-
@parent_element ||= ::Vident::ViewComponent::RootComponent.new(**parent_element_attributes(options))
|
10
|
-
end
|
11
|
-
alias_method :root, :parent_element
|
12
6
|
end
|
13
7
|
end
|
14
8
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vident-typed-view_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Ierodiaconou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.
|
59
|
+
version: 0.3.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '1'
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.3.0
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '1'
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.4.
|
110
|
+
rubygems_version: 3.4.10
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Vident with ViewComponent & typed attributes
|