view_component-form 0.2.0 → 0.2.1
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/CHANGELOG.md +10 -1
- data/app/components/view_component/form/weekday_select_component.rb +18 -16
- data/lib/view_component/form/version.rb +1 -1
- data/lib/view_component/form.rb +5 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a9199cdd2815e1711c5799426cf9e8ba25ecd6352c34616c973a269894f4a71
|
4
|
+
data.tar.gz: 21f504ee76b9eaf898ac3a125bab5234fef641df64e04554a3bdf5d748185858
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 486ba4c74fd76b83e58c355234d0d65a2a06568634561d2a887b8623e115500c911ca810040f3fa5b41c66c37e3e80d58052065550281300bf7e355e635c3a76
|
7
|
+
data.tar.gz: 56d58c623a852b428d5b6440aeeb6a4f3c18c93ffd748a759588c0a5a4726b5e089517d48bdfebc2431447753c23a43b4612d639679f429d01f7208bcde9a87b
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
## [Unreleased]
|
8
8
|
Nothing yet
|
9
9
|
|
10
|
+
## [0.2.1] - 2022-03-17
|
11
|
+
### Added
|
12
|
+
- Conditional ActionText in CI (#117)
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
- Fix broken gem initialization due to missing ViewComponent::Form constant (#114)
|
16
|
+
- Initialize empty WeekdaySelectComponent if Rails < 7 to fix Zeitwerk error (#115)
|
17
|
+
|
10
18
|
## [0.2.0] - 2022-03-02
|
11
19
|
### Added
|
12
20
|
- Test BuilderGenerator with generator\_spec (#64)
|
@@ -65,7 +73,8 @@ Nothing yet
|
|
65
73
|
- Add CHANGELOG (#50)
|
66
74
|
- Add CI (#2)
|
67
75
|
|
68
|
-
[Unreleased]: https://github.com/pantographe/view_component-form/compare/v0.2.
|
76
|
+
[Unreleased]: https://github.com/pantographe/view_component-form/compare/v0.2.1...HEAD
|
77
|
+
[0.2.1]: https://github.com/pantographe/view_component-form/compare/v0.2.0...v0.2.1
|
69
78
|
[0.2.0]: https://github.com/pantographe/view_component-form/compare/v0.1.3...v0.2.0
|
70
79
|
[0.1.3]: https://github.com/pantographe/view_component-form/compare/v0.1.2...v0.1.3
|
71
80
|
[0.1.2]: https://github.com/pantographe/view_component-form/compare/v0.1.1...v0.1.2
|
@@ -1,20 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
attr_reader :html_options
|
3
|
+
module ViewComponent
|
4
|
+
module Form
|
5
|
+
class WeekdaySelectComponent < FieldComponent
|
6
|
+
attr_reader :html_options
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
def initialize(form, object_name, method_name, options = {}, html_options = {})
|
9
|
+
@html_options = html_options
|
11
10
|
|
12
|
-
|
11
|
+
super(form, object_name, method_name, options)
|
13
12
|
|
14
|
-
|
15
|
-
|
13
|
+
set_html_options!
|
14
|
+
end
|
16
15
|
|
17
|
-
|
16
|
+
def call # rubocop:disable Metrics/MethodLength
|
17
|
+
if Rails::VERSION::MAJOR >= 7 # rubocop:disable Style/GuardClause
|
18
18
|
ActionView::Helpers::Tags::WeekdaySelect.new(
|
19
19
|
object_name,
|
20
20
|
method_name,
|
@@ -22,14 +22,16 @@ if Rails::VERSION::MAJOR >= 7
|
|
22
22
|
options,
|
23
23
|
html_options
|
24
24
|
).render
|
25
|
+
else
|
26
|
+
raise NotImplementedError, "#{self.class} is only available in Rails >= 7"
|
25
27
|
end
|
28
|
+
end
|
26
29
|
|
27
|
-
|
30
|
+
protected
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
32
|
+
def set_html_options!
|
33
|
+
@html_options[:class] = class_names(html_options[:class], html_class)
|
34
|
+
@html_options.delete(:class) if @html_options[:class].blank?
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
data/lib/view_component/form.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component-form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pantographe
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -147,7 +147,7 @@ metadata:
|
|
147
147
|
source_code_uri: https://github.com/pantographe/view_component-form
|
148
148
|
bug_tracker_uri: https://github.com/pantographe/view_component-form/issues
|
149
149
|
rubygems_mfa_required: 'true'
|
150
|
-
post_install_message:
|
150
|
+
post_install_message:
|
151
151
|
rdoc_options: []
|
152
152
|
require_paths:
|
153
153
|
- lib
|
@@ -162,8 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
166
|
-
signing_key:
|
165
|
+
rubygems_version: 3.2.32
|
166
|
+
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: Rails FormBuilder for ViewComponent
|
169
169
|
test_files: []
|