view_component-form 0.2.11 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bbaba838148ba0ba79c3cebbcd9b7ed05cbce8cd560387c9c2ffbf4560105bd6
4
- data.tar.gz: 06b8522d30a3d9395c6041f92377b53bef7d1d0a45a695fc9de056bbb5a87168
3
+ metadata.gz: 303f19a27ddf8ea02dfcaa077fb20686c5100dda7be4f4338db348de5da11958
4
+ data.tar.gz: 3c33a63d1d96faa2fb67d32d12b0d90af844099e19157402487ebdc84a17fb5f
5
5
  SHA512:
6
- metadata.gz: 4690faaca7948671849a45d396f9d1c18959c21168cee26bf010ee875086a6bbc2bb775e77e18115eb8a8defa3bdd8e9d39f1a00c988066b6f9750a440a27a8d
7
- data.tar.gz: 873c9bd135115de3b95d19f32923dc0e24b6646e1a30b1d3512584c51016406dbb3661da3409a4b9233be13b67bd81a0138368190ae7a00eab40108e1af3e419
6
+ metadata.gz: b52a03445c25fffd9f96d84748c5cb0b242b567f1671403578816b384f4b8e64666bdf2f2f645a336708940e0243b7edc8f80915a151294dc82324fc9af776ba
7
+ data.tar.gz: 2e9f447ac870c23cce962c909123aff114fe92024a98282f79fa329499e4aa42a737246fd59d157e9c6e6f026842090cc6a87296360062f1ef3ea43a260a486f
data/CHANGELOG.md CHANGED
@@ -5,7 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
- Nothing yet
8
+
9
+ ## [0.3.0] - 2025-10-24
10
+ ### Added
11
+ - Support for Rails 8.1
12
+ - Support for view_component 4.x
13
+ ### Removed
14
+ - Drop Ruby 3.1 support (EOL March 31, 2025)
15
+ - Drop Rails 7.0 support (EOL)
16
+ - Drop Rails 7.1 support (EOL)
9
17
 
10
18
  ## [0.2.11] - 2025-04-05
11
19
  ### Fixed
data/README.md CHANGED
@@ -13,8 +13,8 @@ Development of this gem is sponsored by:
13
13
 
14
14
  This gem is tested on:
15
15
 
16
- - Rails 7.0+ (with or without ActionText)
17
- - Ruby 3.1+
16
+ - Rails 7.2+ (with or without ActionText)
17
+ - Ruby 3.2+
18
18
 
19
19
  ## Installation
20
20
 
@@ -41,16 +41,6 @@ module ViewComponent
41
41
  ).render(&element_proc)
42
42
  end
43
43
 
44
- # See: https://github.com/rails/rails/blob/83217025a171593547d1268651b446d3533e2019/actionview/lib/action_view/helpers/tags/label.rb#L64
45
- def builder
46
- @builder ||= begin
47
- tag_value = options.delete("value")
48
-
49
- ActionView::Helpers::Tags::Label::LabelBuilder.new(@view_context, object_name, method_name, object, tag_value)
50
- end
51
- end
52
- delegate :translation, to: :builder
53
-
54
44
  protected
55
45
 
56
46
  def set_html_options!
@@ -35,7 +35,7 @@ module ViewComponent
35
35
  def method_errors?
36
36
  return false unless object_errors
37
37
 
38
- (object_errors.attribute_names & object_method_names).any?
38
+ object_errors.attribute_names.intersect?(object_method_names)
39
39
  end
40
40
 
41
41
  def value
@@ -28,7 +28,7 @@ module ViewComponent
28
28
  options).render
29
29
  end
30
30
 
31
- # See: https://github.com/rails/rails/blob/83217025a171593547d1268651b446d3533e2019/actionview/lib/action_view/helpers/tags/label.rb#L64
31
+ # See: https://github.com/rails/rails/blob/83217025a171593547d1268651b446d3533e2019/actionview/lib/action_view/helpers/tags/label.rb#L48
32
32
  def builder
33
33
  @builder ||= begin
34
34
  tag_value = options.delete("value")
@@ -6,6 +6,7 @@ module ViewComponent
6
6
  include ViewComponent::Form::Renderer
7
7
  include ViewComponent::Form::ValidationContext
8
8
  include ViewComponent::Form::Helpers::Rails
9
+
9
10
  if Gem::Version.new(::Rails::VERSION::STRING) >= Gem::Version.new("8.0")
10
11
  include ViewComponent::Form::Helpers::Rails8
11
12
  end
@@ -8,8 +8,8 @@ module ViewComponent
8
8
  render_component(:error_message, @object_name, method, objectify_options(options))
9
9
  end
10
10
 
11
- def hint(method, text = nil, options = {}, &block)
12
- render_component(:hint, @object_name, method, text, objectify_options(options), &block)
11
+ def hint(method, text = nil, options = {}, &)
12
+ render_component(:hint, @object_name, method, text, objectify_options(options), &)
13
13
  end
14
14
  end
15
15
  end
@@ -45,8 +45,8 @@ module ViewComponent
45
45
  end
46
46
 
47
47
  # See: https://github.com/rails/rails/blob/33d60cb02dcac26d037332410eabaeeb0bdc384c/actionview/lib/action_view/helpers/form_helper.rb#L2280
48
- def label(method, text = nil, options = {}, &block)
49
- render_component(:label, @object_name, method, text, objectify_options(options), &block)
48
+ def label(method, text = nil, options = {}, &)
49
+ render_component(:label, @object_name, method, text, objectify_options(options), &)
50
50
  end
51
51
 
52
52
  def datetime_field(method, options = {})
@@ -80,20 +80,20 @@ module ViewComponent
80
80
  render_component(:submit, value, options)
81
81
  end
82
82
 
83
- def button(value = nil, options = {}, &block)
83
+ def button(value = nil, options = {}, &)
84
84
  if value.is_a?(Hash)
85
85
  options = value
86
86
  value = nil
87
87
  end
88
88
  value ||= submit_default_value
89
- render_component(:button, value, options, &block)
89
+ render_component(:button, value, options, &)
90
90
  end
91
91
 
92
92
  # See: https://github.com/rails/rails/blob/fe76a95b0d252a2d7c25e69498b720c96b243ea2/actionview/lib/action_view/helpers/form_options_helper.rb
93
- def select(method, choices = nil, options = {}, html_options = {}, &block)
93
+ def select(method, choices = nil, options = {}, html_options = {}, &)
94
94
  render_component(
95
95
  :select, @object_name, method, choices, objectify_options(options),
96
- @default_html_options.merge(html_options), &block
96
+ @default_html_options.merge(html_options), &
97
97
  )
98
98
  end
99
99
 
@@ -118,10 +118,10 @@ module ViewComponent
118
118
  end
119
119
 
120
120
  def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {},
121
- &block)
121
+ &)
122
122
  render_component(
123
123
  :collection_check_boxes, @object_name, method, collection, value_method, text_method,
124
- objectify_options(options), @default_html_options.merge(html_options), &block
124
+ objectify_options(options), @default_html_options.merge(html_options), &
125
125
  )
126
126
  end
127
127
 
@@ -129,11 +129,11 @@ module ViewComponent
129
129
  method, collection,
130
130
  value_method, text_method,
131
131
  options = {}, html_options = {},
132
- &block
132
+ &
133
133
  )
134
134
  render_component(
135
135
  :collection_radio_buttons, @object_name, method, collection, value_method, text_method,
136
- objectify_options(options), @default_html_options.merge(html_options), &block
136
+ objectify_options(options), @default_html_options.merge(html_options), &
137
137
  )
138
138
  end
139
139
  # rubocop:enable Metrics/ParameterLists
@@ -17,10 +17,10 @@ module ViewComponent
17
17
  end
18
18
 
19
19
  def collection_checkboxes(method, collection, value_method, text_method, options = {}, html_options = {}, # rubocop:disable Metrics/ParameterLists
20
- &block)
20
+ &)
21
21
  render_component(
22
22
  :collection_check_boxes, @object_name, method, collection, value_method, text_method,
23
- objectify_options(options), @default_html_options.merge(html_options), &block
23
+ objectify_options(options), @default_html_options.merge(html_options), &
24
24
  )
25
25
  end
26
26
 
@@ -41,9 +41,9 @@ module ViewComponent
41
41
 
42
42
  private
43
43
 
44
- def render_component(component_name, *args, &block)
45
- component = component_klass(component_name).new(self, *args)
46
- component.render_in(@template, &block)
44
+ def render_component(component_name, *, &)
45
+ component = component_klass(component_name).new(self, *)
46
+ component.render_in(@template, &)
47
47
  end
48
48
 
49
49
  def objectify_options(options)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ViewComponent
4
4
  module Form
5
- VERSION = "0.2.11"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pantographe
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-04-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: actionview
@@ -16,40 +15,40 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 7.0.0
18
+ version: 7.2.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '8.1'
21
+ version: '8.2'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 7.0.0
28
+ version: 7.2.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '8.1'
31
+ version: '8.2'
33
32
  - !ruby/object:Gem::Dependency
34
33
  name: activesupport
35
34
  requirement: !ruby/object:Gem::Requirement
36
35
  requirements:
37
36
  - - ">="
38
37
  - !ruby/object:Gem::Version
39
- version: 7.0.0
38
+ version: 7.2.0
40
39
  - - "<"
41
40
  - !ruby/object:Gem::Version
42
- version: '8.1'
41
+ version: '8.2'
43
42
  type: :runtime
44
43
  prerelease: false
45
44
  version_requirements: !ruby/object:Gem::Requirement
46
45
  requirements:
47
46
  - - ">="
48
47
  - !ruby/object:Gem::Version
49
- version: 7.0.0
48
+ version: 7.2.0
50
49
  - - "<"
51
50
  - !ruby/object:Gem::Version
52
- version: '8.1'
51
+ version: '8.2'
53
52
  - !ruby/object:Gem::Dependency
54
53
  name: view_component
55
54
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +58,7 @@ dependencies:
59
58
  version: 2.34.0
60
59
  - - "<"
61
60
  - !ruby/object:Gem::Version
62
- version: '4.0'
61
+ version: '5.0'
63
62
  type: :runtime
64
63
  prerelease: false
65
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +68,7 @@ dependencies:
69
68
  version: 2.34.0
70
69
  - - "<"
71
70
  - !ruby/object:Gem::Version
72
- version: '4.0'
71
+ version: '5.0'
73
72
  - !ruby/object:Gem::Dependency
74
73
  name: zeitwerk
75
74
  requirement: !ruby/object:Gem::Requirement
@@ -153,7 +152,6 @@ metadata:
153
152
  source_code_uri: https://github.com/pantographe/view_component-form
154
153
  bug_tracker_uri: https://github.com/pantographe/view_component-form/issues
155
154
  rubygems_mfa_required: 'true'
156
- post_install_message:
157
155
  rdoc_options: []
158
156
  require_paths:
159
157
  - lib
@@ -161,15 +159,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
159
  requirements:
162
160
  - - ">="
163
161
  - !ruby/object:Gem::Version
164
- version: 3.0.0
162
+ version: 3.2.0
165
163
  required_rubygems_version: !ruby/object:Gem::Requirement
166
164
  requirements:
167
165
  - - ">="
168
166
  - !ruby/object:Gem::Version
169
167
  version: '0'
170
168
  requirements: []
171
- rubygems_version: 3.5.22
172
- signing_key:
169
+ rubygems_version: 3.6.9
173
170
  specification_version: 4
174
171
  summary: Rails FormBuilder for ViewComponent
175
172
  test_files: []