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 +4 -4
- data/lib/shimmer/form/builder.rb +2 -2
- data/lib/shimmer/utils/remote_navigation.rb +16 -4
- data/lib/shimmer/version.rb +1 -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: c29fbc043f70767d14167a6da3f50d85790e85f3244628c207c41412a9d0db65
|
4
|
+
data.tar.gz: 8b33c52bf110c85c72427fe5dd320bbb26ff782aecba81f4aae17fe3f1eb81f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c9bbb1b1ef81986d70a3101ec86ed3222c015ab2466d585bc5ebcc83cc0c80adfdc57e4ac223a01ae96fa2ab5be0aedebf60efeffba32507fd44402779e4f34
|
7
|
+
data.tar.gz: 0b8e06125388ce26ae9e88adfdd3616828180a46332f584d4a631630a68c69fff6cd59f0242c8d9db69ed3c0a72ab77abdee84655785ae7f8f0a861e96513814
|
data/lib/shimmer/form/builder.rb
CHANGED
@@ -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:
|
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
|
73
|
-
queued_updates.push turbo_stream.
|
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
|
81
|
-
queued_updates.push turbo_stream.
|
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
|
data/lib/shimmer/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2023-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|