stimulizer 0.1.2 → 0.2.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 +1 -1
- data/lib/stimulizer/version.rb +1 -1
- data/lib/stimulizer.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef63a4056af8d47a2575a6b1fa341cc66f0f4c890ca2545222f939813e81c083
|
|
4
|
+
data.tar.gz: 2b73dca03393d1ec003e8fcf34a4421bd0f3e76026e81b6f79f65de58909229b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9cb1aee522e337bde660667dcf52180fd1d731eb3b99af5959a624e1106883b422d84cf8df1a56c60662dca04a7224ab8bb7e37525638ccb4026dbcdb149205
|
|
7
|
+
data.tar.gz: 0b80d55d640ea93bef07aa5ce379b42963ffc9496c031eb36a853dc4b5a63cf4c4cc6888413938cafff6210bb94d8a9ab851bf173387702be0eb8da0d1fbf170
|
data/README.md
CHANGED
|
@@ -16,7 +16,7 @@ For example:
|
|
|
16
16
|
<div
|
|
17
17
|
data-controller="mynamespace--deeper--buttons-grid-component"
|
|
18
18
|
data-mynamespace--deeper--buttons-grid-component-url-value="http://example.com"
|
|
19
|
-
data-mynamespace--deeper--buttons-grid-component-
|
|
19
|
+
data-mynamespace--deeper--buttons-grid-component-color-value="#ff0000"
|
|
20
20
|
data-action="click->data-mynamespace--deeper--buttons-grid-component#doSomething"
|
|
21
21
|
>
|
|
22
22
|
```
|
data/lib/stimulizer/version.rb
CHANGED
data/lib/stimulizer.rb
CHANGED
|
@@ -85,7 +85,7 @@ module Stimulizer
|
|
|
85
85
|
# ... or combine them:
|
|
86
86
|
#
|
|
87
87
|
# <%= stimulus(:controller, target: "button", action: "click->doThing")
|
|
88
|
-
def build_stimulus_hash(default_controller = false, controller_name: nil, controller: nil, target: nil, action: nil, params: nil, values: nil, classes: nil)
|
|
88
|
+
def build_stimulus_hash(default_controller = false, controller_name: nil, controller: nil, target: nil, action: nil, params: nil, values: nil, classes: nil, outlets: nil)
|
|
89
89
|
raise ArgumentError(":controller_name specified, but blank") if controller_name&.blank?
|
|
90
90
|
raise ArgumentError(":controller specified, but blank") if controller&.blank?
|
|
91
91
|
raise ArgumentError(":target specified, but blank") if target&.blank?
|
|
@@ -93,6 +93,7 @@ module Stimulizer
|
|
|
93
93
|
raise ArgumentError(":params specified, but blank") if params&.blank?
|
|
94
94
|
raise ArgumentError(":values specified, but blank") if values&.blank?
|
|
95
95
|
raise ArgumentError(":classes specified, but blank") if classes&.blank?
|
|
96
|
+
raise ArgumentError(":outlets specified, but blank") if outlets&.blank?
|
|
96
97
|
|
|
97
98
|
{}.tap do |hash|
|
|
98
99
|
hash[:"data-controller"] = ""
|
|
@@ -139,6 +140,10 @@ module Stimulizer
|
|
|
139
140
|
hash[:"data-#{local_controller_name}-#{LuckyCase.dash_case(key.to_s)}-class"] = value
|
|
140
141
|
end
|
|
141
142
|
|
|
143
|
+
outlets&.each do |key, value|
|
|
144
|
+
hash[:"data-#{local_controller_name}-#{LuckyCase.dash_case(key.to_s)}-outlet"] = value
|
|
145
|
+
end
|
|
146
|
+
|
|
142
147
|
hash[:"data-#{local_controller_name}-target"] = target if target
|
|
143
148
|
end
|
|
144
149
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stimulizer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt E Patterson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-11-
|
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dry-configurable
|