view_component-form 0.2.0 → 0.2.3
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 +20 -1
- data/README.md +1 -1
- data/app/components/view_component/form/rich_text_area_component.rb +3 -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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ae76cd3c5205d98673495e26d1c654441054c297bd4d63abe9ca8f1180cc5c
|
4
|
+
data.tar.gz: dd2286deed5dce2a7f7198a09977d17b8744c6e4952276e855c1a4d838ad3385
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b391f6b0196c04a6db7c10c71745747a895ec4f7553c87a0ddcd68126e4897ebb979b70e8e81bb9c772a5c5f9cf0a50a65094ec5967853b6364f785a8676911
|
7
|
+
data.tar.gz: 3efda4bbf9ce7e6a08f71d5f1e1025124a163d0d373e62087ba374f7e7d311bf2907dfd43bc33e14e1a821e24d0c42f7244a25a42232e71bd5503e7016204886
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,22 @@ 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.3] - 2022-03-24
|
11
|
+
### Fixed
|
12
|
+
- Declare empty RichTextAreaComponent if ActionText is not installed, to fix Zeitwerk error (#120)
|
13
|
+
|
14
|
+
## [0.2.2] - 2022-03-23
|
15
|
+
### Changed
|
16
|
+
- Improve conditional ActionText support (#118)
|
17
|
+
|
18
|
+
## [0.2.1] - 2022-03-17
|
19
|
+
### Added
|
20
|
+
- Conditional ActionText support (#117)
|
21
|
+
|
22
|
+
### Fixed
|
23
|
+
- Fix broken gem initialization due to missing ViewComponent::Form constant (#114)
|
24
|
+
- Initialize empty WeekdaySelectComponent if Rails < 7 to fix Zeitwerk error (#115)
|
25
|
+
|
10
26
|
## [0.2.0] - 2022-03-02
|
11
27
|
### Added
|
12
28
|
- Test BuilderGenerator with generator\_spec (#64)
|
@@ -65,7 +81,10 @@ Nothing yet
|
|
65
81
|
- Add CHANGELOG (#50)
|
66
82
|
- Add CI (#2)
|
67
83
|
|
68
|
-
[Unreleased]: https://github.com/pantographe/view_component-form/compare/v0.2.
|
84
|
+
[Unreleased]: https://github.com/pantographe/view_component-form/compare/v0.2.3...HEAD
|
85
|
+
[0.2.3]: https://github.com/pantographe/view_component-form/compare/v0.2.2...v0.2.3
|
86
|
+
[0.2.2]: https://github.com/pantographe/view_component-form/compare/v0.2.1...v0.2.2
|
87
|
+
[0.2.1]: https://github.com/pantographe/view_component-form/compare/v0.2.0...v0.2.1
|
69
88
|
[0.2.0]: https://github.com/pantographe/view_component-form/compare/v0.1.3...v0.2.0
|
70
89
|
[0.1.3]: https://github.com/pantographe/view_component-form/compare/v0.1.2...v0.1.3
|
71
90
|
[0.1.2]: https://github.com/pantographe/view_component-form/compare/v0.1.1...v0.1.2
|
data/README.md
CHANGED
@@ -3,7 +3,9 @@
|
|
3
3
|
module ViewComponent
|
4
4
|
module Form
|
5
5
|
class RichTextAreaComponent < FieldComponent
|
6
|
-
|
6
|
+
if defined?(ActionView::Helpers::Tags::ActionText) # rubocop:disable Style/IfUnlessModifier
|
7
|
+
self.tag_klass = ActionView::Helpers::Tags::ActionText
|
8
|
+
end
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
@@ -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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pantographe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|