turbo_power 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 678db176d816e2a22ddf77a35a42447fef3f823c956a69e5f107186c632dde36
4
- data.tar.gz: c91240c7d009cf7ed54195d77de945c6a2cd013745673d47393a8a83305952fa
3
+ metadata.gz: c978af0e8802736440fb1efdaefb241555a5f0c459aef82b19d5b025c74cc22f
4
+ data.tar.gz: 3aae4c0251a81ce63c8b8d3309439d6bed7cacd9481951ffac2c448eaaac0d81
5
5
  SHA512:
6
- metadata.gz: e24d81bd1d2ef91938458dc7c2c2e1a109d9ff2d29336010b97e835d7a905f9ddf4163ac7d14887712c62d109751ca0b601cee24c9ae14f0cde376a6f3a75f30
7
- data.tar.gz: cdf838e14aa5e3f7c9a9b9285ec0c5b58e96464bcf36b8826709b79551437814c0e074bcfa7343b4f7ee954ba8a565a43a932b4d4955744edf9b2cd022f661ae
6
+ metadata.gz: 69834c88a1c011c11056a602f0ef2cb58f7de402dbd9ddf98b9f5aea2fc042f2594552e79e909eb5505f4eeceaee9b5a0232af861e6600274a92673ee3664048
7
+ data.tar.gz: d15b8707abaa450e0a791a860d6457462be7325ed718887ad99be53d640f5ef88c21a3cc86198029aca6ced23504eb975149d86ccd2f9f641cf9ae40e212fd29
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbo_power (0.5.0)
5
- turbo-rails (~> 1.3)
4
+ turbo_power (0.6.0)
5
+ turbo-rails (>= 1.3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -108,6 +108,8 @@ import 'controllers'
108
108
  * `turbo_stream.set_style(targets, name, value, **attributes)`
109
109
  * `turbo_stream.set_styles(targets, styles, **attributes)`
110
110
  * `turbo_stream.set_value(targets, value, **attributes)`
111
+ * `turbo_stream.toggle_css_class(targets, classes, **attributes)`
112
+ * `turbo_stream.replace_css_class(targets, from, to, **attributes)`
111
113
 
112
114
 
113
115
  ### Event Actions
@@ -106,6 +106,20 @@ module TurboPower
106
106
  custom_action_all :set_value, targets: targets, attributes: attributes.reverse_merge(value: value)
107
107
  end
108
108
 
109
+ def toggle_css_class(targets = nil, classes = "", **attributes)
110
+ classes = attributes[:classes] || classes
111
+ classes = classes.join(" ") if classes.is_a?(Array)
112
+
113
+ custom_action_all :toggle_css_class, targets: targets, attributes: attributes.merge(classes: classes)
114
+ end
115
+
116
+ def replace_css_class(targets = nil, from = "", to = "", **attributes)
117
+ from = attributes[:from] || from
118
+ to = attributes[:to] || to
119
+
120
+ custom_action_all :replace_css_class, targets: targets, attributes: attributes.merge(from: from, to: to)
121
+ end
122
+
109
123
  # Event Actions
110
124
 
111
125
  def dispatch_event(targets = nil, name = nil, detail: {}, **attributes)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurboPower
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
data/turbo_power.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  "[A-Z]*"
28
28
  ]
29
29
 
30
- spec.add_dependency "turbo-rails", "~> 1.3"
30
+ spec.add_dependency "turbo-rails", ">= 1.3.0"
31
31
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_power
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-15 00:00:00.000000000 Z
11
+ date: 2023-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: turbo-rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: 1.3.0
27
27
  description: Power-pack for Turbo Streams
28
28
  email:
29
29
  - marco.roth@hey.com