shimmer 0.0.26 → 0.0.28

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: 56d4b2433dce6cff2fbaee9f1eb4591caf4f9abdbbc50aa9154f9eb81c5ce068
4
- data.tar.gz: 9f95b3f5e0dfda4d102f529d7bd0334dbbbd4cbc31c026069be0a949f49f04c3
3
+ metadata.gz: c29fbc043f70767d14167a6da3f50d85790e85f3244628c207c41412a9d0db65
4
+ data.tar.gz: 8b33c52bf110c85c72427fe5dd320bbb26ff782aecba81f4aae17fe3f1eb81f3
5
5
  SHA512:
6
- metadata.gz: 5625382dc2804fd1d0f6b93c8a2bdb391f2c2d632c70ab023ca22abdb7d661a746a799f13772f269ed160f420b32712825ec0ae5693683c98beb84f57c324f89
7
- data.tar.gz: 559862f18bca1477be21b2cf40666da06c2b294177ecf4fac46a4d769ede304d55c767eab945c87b470d145bef7fbba3e0ebc1635f8174a633c7925279fadb94
6
+ metadata.gz: 8c9bbb1b1ef81986d70a3101ec86ed3222c015ab2466d585bc5ebcc83cc0c80adfdc57e4ac223a01ae96fa2ab5be0aedebf60efeffba32507fd44402779e4f34
7
+ data.tar.gz: 0b8e06125388ce26ae9e88adfdd3616828180a46332f584d4a631630a68c69fff6cd59f0242c8d9db69ed3c0a72ab77abdee84655785ae7f8f0a861e96513814
@@ -13,7 +13,7 @@ module Shimmer
13
13
  end
14
14
  end
15
15
 
16
- def input(method, as: guess_type(method), wrapper_options: {}, description: nil, label_method: nil, **options)
16
+ def input(method, as: guess_type(method), wrapper_options: {}, description: nil, label_method: nil, id_method: :id, name_method: nil, label: nil, **options)
17
17
  as ||= guess_type(method)
18
18
  options[:class] ||= "input__input"
19
19
  collection = options.delete :collection
@@ -32,7 +32,7 @@ module Shimmer
32
32
  input.prepare
33
33
  wrapper_options.reverse_merge! input.wrapper_options
34
34
  label_method ||= wrapper_options.delete(:label_method)
35
- wrap method: method, content: input.render, classes: classes + ["input--#{as}"], label: options[:label], extra: extra, description: description, options: wrapper_options, label_method: label_method
35
+ wrap method: method, content: input.render, classes: classes + ["input--#{as}"], label: label, extra: extra, description: description, options: wrapper_options, label_method: label_method
36
36
  end
37
37
 
38
38
  private
@@ -69,22 +69,34 @@ module Shimmer
69
69
  queued_updates.push turbo_stream.append "shimmer", "<div class='hidden' data-controller='remote-navigation'>#{script}</div>"
70
70
  end
71
71
 
72
- def replace(id, with: id, **locals)
73
- queued_updates.push turbo_stream.replace(id, partial: with, locals: locals)
72
+ def append(id, with:, **locals)
73
+ queued_updates.push turbo_stream.append(id, partial: with, locals: locals)
74
74
  end
75
75
 
76
76
  def prepend(id, with:, **locals)
77
77
  queued_updates.push turbo_stream.prepend(id, partial: with, locals: locals)
78
78
  end
79
79
 
80
- def append(id, with:, **locals)
81
- queued_updates.push turbo_stream.append(id, partial: with, locals: locals)
80
+ def replace(id, with: id, **locals)
81
+ queued_updates.push turbo_stream.replace(id, partial: with, locals: locals)
82
+ end
83
+
84
+ def update(id, with: id, **locals)
85
+ queued_updates.push turbo_stream.update(id, partial: with, locals: locals)
82
86
  end
83
87
 
84
88
  def remove(id)
85
89
  queued_updates.push turbo_stream.remove(id)
86
90
  end
87
91
 
92
+ def insert_before(id, with:, **locals)
93
+ queued_updates.push turbo_stream.before(id, partial: with, locals: locals)
94
+ end
95
+
96
+ def insert_after(id, with:, **locals)
97
+ queued_updates.push turbo_stream.after(id, partial: with, locals: locals)
98
+ end
99
+
88
100
  def open_modal(url, id: nil, size: nil, close: true)
89
101
  run_javascript "ui.modal.open(#{{url: url, id: id, size: size, close: close}.to_json})"
90
102
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shimmer
4
- VERSION = "0.0.26"
4
+ VERSION = "0.0.28"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shimmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Ravens
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-02 00:00:00.000000000 Z
11
+ date: 2023-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake