superform 0.4.9 → 0.5.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: 9d16f47143b0d36f13ce0da8685af303d7f56f219f15a0fb2e45e7bfe53d3b49
4
- data.tar.gz: f2fcc38800000aecfa952683f48393550516b87063521c8b23510dd5058affd4
3
+ metadata.gz: 5525e912faf72d0525d0aa35d7ec2ef22ced3a4e8b8cf7d99483850f4bfe5074
4
+ data.tar.gz: f0dfde4e0c1ec94e036addce561fee83039627e65236872922525b361abb34d2
5
5
  SHA512:
6
- metadata.gz: b7cc285d0bb21f5df995e5adc1fc1a141af0e5854a8807930a17533a6d74f123ea843db207de163e3d202e4166d59422a97c80aabd8926b4c5140e823d8c4a8d
7
- data.tar.gz: c9e5bb9ba72a9ca35104f41a6dacd63102e795f0cbb882b808efdd976b320b649d51e4cee2951dc7fa463ef0fd441d621e983add1746c96116a91247763e170e
6
+ metadata.gz: a513255c99aee3da7992521e0d56db5ac14a7cb1d5ed52ad918124a3722b07adcab9490a35587f5c0386659e8173404e58d541d1cb7a277634c9d2929955bbb9
7
+ data.tar.gz: df12f03bb89cd6d76c058ad8100ef9b75bf6dce91dc6c0f146bbddf596502e659279b7c58ff2a9db6641fa12d1ac8eaace4e1096dc604b956501b9e6960d83b7
data/Gemfile.lock CHANGED
@@ -1,93 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superform (0.4.8)
4
+ superform (0.5.0)
5
5
  phlex-rails (~> 1.0)
6
6
  zeitwerk (~> 2.6)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (7.0.6)
12
- actionpack (= 7.0.6)
13
- activesupport (= 7.0.6)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- actionmailbox (7.0.6)
17
- actionpack (= 7.0.6)
18
- activejob (= 7.0.6)
19
- activerecord (= 7.0.6)
20
- activestorage (= 7.0.6)
21
- activesupport (= 7.0.6)
22
- mail (>= 2.7.1)
23
- net-imap
24
- net-pop
25
- net-smtp
26
- actionmailer (7.0.6)
27
- actionpack (= 7.0.6)
28
- actionview (= 7.0.6)
29
- activejob (= 7.0.6)
30
- activesupport (= 7.0.6)
31
- mail (~> 2.5, >= 2.5.4)
32
- net-imap
33
- net-pop
34
- net-smtp
35
- rails-dom-testing (~> 2.0)
36
- actionpack (7.0.6)
37
- actionview (= 7.0.6)
38
- activesupport (= 7.0.6)
39
- rack (~> 2.0, >= 2.2.4)
40
- rack-test (>= 0.6.3)
41
- rails-dom-testing (~> 2.0)
42
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
43
- actiontext (7.0.6)
44
- actionpack (= 7.0.6)
45
- activerecord (= 7.0.6)
46
- activestorage (= 7.0.6)
47
- activesupport (= 7.0.6)
48
- globalid (>= 0.6.0)
11
+ actionpack (7.2.1)
12
+ actionview (= 7.2.1)
13
+ activesupport (= 7.2.1)
49
14
  nokogiri (>= 1.8.5)
50
- actionview (7.0.6)
51
- activesupport (= 7.0.6)
15
+ racc
16
+ rack (>= 2.2.4, < 3.2)
17
+ rack-session (>= 1.0.1)
18
+ rack-test (>= 0.6.3)
19
+ rails-dom-testing (~> 2.2)
20
+ rails-html-sanitizer (~> 1.6)
21
+ useragent (~> 0.16)
22
+ actionview (7.2.1)
23
+ activesupport (= 7.2.1)
52
24
  builder (~> 3.1)
53
- erubi (~> 1.4)
54
- rails-dom-testing (~> 2.0)
55
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
56
- activejob (7.0.6)
57
- activesupport (= 7.0.6)
58
- globalid (>= 0.3.6)
59
- activemodel (7.0.6)
60
- activesupport (= 7.0.6)
61
- activerecord (7.0.6)
62
- activemodel (= 7.0.6)
63
- activesupport (= 7.0.6)
64
- activestorage (7.0.6)
65
- actionpack (= 7.0.6)
66
- activejob (= 7.0.6)
67
- activerecord (= 7.0.6)
68
- activesupport (= 7.0.6)
69
- marcel (~> 1.0)
70
- mini_mime (>= 1.1.0)
71
- activesupport (7.0.6)
72
- concurrent-ruby (~> 1.0, >= 1.0.2)
25
+ erubi (~> 1.11)
26
+ rails-dom-testing (~> 2.2)
27
+ rails-html-sanitizer (~> 1.6)
28
+ activesupport (7.2.1)
29
+ base64
30
+ bigdecimal
31
+ concurrent-ruby (~> 1.0, >= 1.3.1)
32
+ connection_pool (>= 2.2.5)
33
+ drb
73
34
  i18n (>= 1.6, < 2)
35
+ logger (>= 1.4.2)
74
36
  minitest (>= 5.1)
75
- tzinfo (~> 2.0)
76
- builder (3.2.4)
77
- cgi (0.3.6)
37
+ securerandom (>= 0.3)
38
+ tzinfo (~> 2.0, >= 2.0.5)
39
+ base64 (0.2.0)
40
+ bigdecimal (3.1.8)
41
+ builder (3.3.0)
78
42
  coderay (1.1.3)
79
- concurrent-ruby (1.2.2)
43
+ concurrent-ruby (1.3.4)
44
+ connection_pool (2.4.1)
80
45
  crass (1.0.6)
81
- date (3.3.3)
82
- diff-lcs (1.5.0)
83
- erb (4.0.2)
84
- cgi (>= 0.3.3)
85
- erubi (1.12.0)
86
- ffi (1.15.5)
46
+ diff-lcs (1.5.1)
47
+ drb (2.2.1)
48
+ erubi (1.13.0)
49
+ ffi (1.17.0-arm64-darwin)
50
+ ffi (1.17.0-x86_64-linux-gnu)
87
51
  formatador (1.1.0)
88
- globalid (1.1.0)
89
- activesupport (>= 5.0)
90
- guard (2.18.0)
52
+ guard (2.18.1)
91
53
  formatador (>= 0.2.4)
92
54
  listen (>= 2.7, < 4.0)
93
55
  lumberjack (>= 1.0.12, < 2.0)
@@ -101,111 +63,93 @@ GEM
101
63
  guard (~> 2.1)
102
64
  guard-compat (~> 1.1)
103
65
  rspec (>= 2.99.0, < 4.0)
104
- i18n (1.14.1)
66
+ i18n (1.14.6)
105
67
  concurrent-ruby (~> 1.0)
106
- listen (3.8.0)
68
+ io-console (0.7.2)
69
+ irb (1.14.1)
70
+ rdoc (>= 4.0.0)
71
+ reline (>= 0.4.2)
72
+ listen (3.9.0)
107
73
  rb-fsevent (~> 0.10, >= 0.10.3)
108
74
  rb-inotify (~> 0.9, >= 0.9.10)
109
- loofah (2.21.3)
75
+ logger (1.6.1)
76
+ loofah (2.22.0)
110
77
  crass (~> 1.0.2)
111
78
  nokogiri (>= 1.12.0)
112
- lumberjack (1.2.8)
113
- mail (2.8.1)
114
- mini_mime (>= 0.1.1)
115
- net-imap
116
- net-pop
117
- net-smtp
118
- marcel (1.0.2)
119
- method_source (1.0.0)
120
- mini_mime (1.1.2)
121
- mini_portile2 (2.8.5)
122
- minitest (5.18.1)
79
+ lumberjack (1.2.10)
80
+ method_source (1.1.0)
81
+ minitest (5.25.1)
123
82
  nenv (0.3.0)
124
- net-imap (0.3.6)
125
- date
126
- net-protocol
127
- net-pop (0.1.2)
128
- net-protocol
129
- net-protocol (0.2.1)
130
- timeout
131
- net-smtp (0.3.3)
132
- net-protocol
133
- nio4r (2.5.9)
134
- nokogiri (1.15.3)
135
- mini_portile2 (~> 2.8.2)
83
+ nokogiri (1.16.7-arm64-darwin)
84
+ racc (~> 1.4)
85
+ nokogiri (1.16.7-x86_64-linux)
136
86
  racc (~> 1.4)
137
87
  notiffany (0.1.3)
138
88
  nenv (~> 0.1)
139
89
  shellany (~> 0.0)
140
- phlex (1.8.1)
141
- concurrent-ruby (~> 1.2)
142
- erb (>= 4)
143
- zeitwerk (~> 2.6)
144
- phlex-rails (1.0.0)
145
- phlex (~> 1.7)
146
- rails (>= 6.1, < 8)
147
- zeitwerk (~> 2.6)
90
+ phlex (1.10.3)
91
+ phlex-rails (1.2.1)
92
+ phlex (~> 1.10.0)
93
+ railties (>= 6.1, < 8)
148
94
  pry (0.14.2)
149
95
  coderay (~> 1.1)
150
96
  method_source (~> 1.0)
151
- racc (1.7.1)
152
- rack (2.2.7)
97
+ psych (5.1.2)
98
+ stringio
99
+ racc (1.8.1)
100
+ rack (3.1.8)
101
+ rack-session (2.0.0)
102
+ rack (>= 3.0.0)
153
103
  rack-test (2.1.0)
154
104
  rack (>= 1.3)
155
- rails (7.0.6)
156
- actioncable (= 7.0.6)
157
- actionmailbox (= 7.0.6)
158
- actionmailer (= 7.0.6)
159
- actionpack (= 7.0.6)
160
- actiontext (= 7.0.6)
161
- actionview (= 7.0.6)
162
- activejob (= 7.0.6)
163
- activemodel (= 7.0.6)
164
- activerecord (= 7.0.6)
165
- activestorage (= 7.0.6)
166
- activesupport (= 7.0.6)
167
- bundler (>= 1.15.0)
168
- railties (= 7.0.6)
169
- rails-dom-testing (2.1.1)
105
+ rackup (2.1.0)
106
+ rack (>= 3)
107
+ webrick (~> 1.8)
108
+ rails-dom-testing (2.2.0)
170
109
  activesupport (>= 5.0.0)
171
110
  minitest
172
111
  nokogiri (>= 1.6)
173
112
  rails-html-sanitizer (1.6.0)
174
113
  loofah (~> 2.21)
175
114
  nokogiri (~> 1.14)
176
- railties (7.0.6)
177
- actionpack (= 7.0.6)
178
- activesupport (= 7.0.6)
179
- method_source
115
+ railties (7.2.1)
116
+ actionpack (= 7.2.1)
117
+ activesupport (= 7.2.1)
118
+ irb (~> 1.13)
119
+ rackup (>= 1.0.0)
180
120
  rake (>= 12.2)
181
- thor (~> 1.0)
182
- zeitwerk (~> 2.5)
183
- rake (13.0.6)
121
+ thor (~> 1.0, >= 1.2.2)
122
+ zeitwerk (~> 2.6)
123
+ rake (13.2.1)
184
124
  rb-fsevent (0.11.2)
185
- rb-inotify (0.10.1)
125
+ rb-inotify (0.11.1)
186
126
  ffi (~> 1.0)
187
- rspec (3.12.0)
188
- rspec-core (~> 3.12.0)
189
- rspec-expectations (~> 3.12.0)
190
- rspec-mocks (~> 3.12.0)
191
- rspec-core (3.12.2)
192
- rspec-support (~> 3.12.0)
193
- rspec-expectations (3.12.3)
127
+ rdoc (6.7.0)
128
+ psych (>= 4.0.0)
129
+ reline (0.5.10)
130
+ io-console (~> 0.5)
131
+ rspec (3.13.0)
132
+ rspec-core (~> 3.13.0)
133
+ rspec-expectations (~> 3.13.0)
134
+ rspec-mocks (~> 3.13.0)
135
+ rspec-core (3.13.1)
136
+ rspec-support (~> 3.13.0)
137
+ rspec-expectations (3.13.3)
194
138
  diff-lcs (>= 1.2.0, < 2.0)
195
- rspec-support (~> 3.12.0)
196
- rspec-mocks (3.12.5)
139
+ rspec-support (~> 3.13.0)
140
+ rspec-mocks (3.13.2)
197
141
  diff-lcs (>= 1.2.0, < 2.0)
198
- rspec-support (~> 3.12.0)
199
- rspec-support (3.12.0)
142
+ rspec-support (~> 3.13.0)
143
+ rspec-support (3.13.1)
144
+ securerandom (0.3.1)
200
145
  shellany (0.0.1)
201
- thor (1.2.2)
202
- timeout (0.4.0)
146
+ stringio (3.1.1)
147
+ thor (1.3.2)
203
148
  tzinfo (2.0.6)
204
149
  concurrent-ruby (~> 1.0)
205
- websocket-driver (0.7.5)
206
- websocket-extensions (>= 0.1.0)
207
- websocket-extensions (0.1.5)
208
- zeitwerk (2.6.8)
150
+ useragent (0.16.10)
151
+ webrick (1.8.2)
152
+ zeitwerk (2.7.0)
209
153
 
210
154
  PLATFORMS
211
155
  arm64-darwin-22
@@ -219,4 +163,4 @@ DEPENDENCIES
219
163
  superform!
220
164
 
221
165
  BUNDLED WITH
222
- 2.4.8
166
+ 2.5.9
@@ -30,7 +30,7 @@ module Superform
30
30
  # ```ruby
31
31
  # class MyForm < Superform::Rails::Form
32
32
  # class MyLabel < Superform::Rails::Components::LabelComponent
33
- # def template(&content)
33
+ # def view_template(&content)
34
34
  # label(form: @field.dom.name, class: "text-bold", &content)
35
35
  # end
36
36
  # end
@@ -57,8 +57,8 @@ module Superform
57
57
  Components::CheckboxComponent.new(self, attributes: attributes)
58
58
  end
59
59
 
60
- def label(**attributes)
61
- Components::LabelComponent.new(self, attributes: attributes)
60
+ def label(**attributes, &)
61
+ Components::LabelComponent.new(self, attributes: attributes, &)
62
62
  end
63
63
 
64
64
  def textarea(**attributes)
@@ -94,7 +94,7 @@ module Superform
94
94
  form action: form_action, method: form_method, **@attributes, &
95
95
  end
96
96
 
97
- def template(&block)
97
+ def view_template(&block)
98
98
  yield_content(&block)
99
99
  end
100
100
 
@@ -231,7 +231,7 @@ module Superform
231
231
  end
232
232
 
233
233
  class LabelComponent < BaseComponent
234
- def template(&content)
234
+ def view_template(&content)
235
235
  content ||= Proc.new { field.key.to_s.titleize }
236
236
  label(**attributes, &content)
237
237
  end
@@ -242,7 +242,7 @@ module Superform
242
242
  end
243
243
 
244
244
  class ButtonComponent < FieldComponent
245
- def template(&content)
245
+ def view_template(&content)
246
246
  content ||= Proc.new { button_text }
247
247
  button(**attributes, &content)
248
248
  end
@@ -257,7 +257,7 @@ module Superform
257
257
  end
258
258
 
259
259
  class CheckboxComponent < FieldComponent
260
- def template(&)
260
+ def view_template(&)
261
261
  # Rails has a hidden and checkbox input to deal with sending back a value
262
262
  # to the server regardless of if the input is checked or not.
263
263
  input(name: dom.name, type: :hidden, value: "0")
@@ -271,7 +271,7 @@ module Superform
271
271
  end
272
272
 
273
273
  class InputComponent < FieldComponent
274
- def template(&)
274
+ def view_template(&)
275
275
  input(**attributes)
276
276
  end
277
277
 
@@ -325,7 +325,7 @@ module Superform
325
325
  end
326
326
 
327
327
  class TextareaComponent < FieldComponent
328
- def template(&content)
328
+ def view_template(&content)
329
329
  content ||= Proc.new { dom.value }
330
330
  textarea(**attributes, &content)
331
331
  end
@@ -337,7 +337,7 @@ module Superform
337
337
  @collection = collection
338
338
  end
339
339
 
340
- def template(&options)
340
+ def view_template(&options)
341
341
  if block_given?
342
342
  select(**attributes, &options)
343
343
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Superform
4
- VERSION = "0.4.9"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-04 00:00:00.000000000 Z
11
+ date: 2024-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex-rails
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.5.6
87
+ rubygems_version: 3.5.9
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Build forms in Rails