bulma_form_builder 0.1.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +23 -0
- data/bulma_form_builder.gemspec +3 -3
- data/lib/bulma_form_builder/form_builder.rb +3 -1
- data/lib/bulma_form_builder/inputs.rb +2 -0
- data/lib/bulma_form_builder/inputs/base.rb +1 -1
- data/lib/bulma_form_builder/inputs/check_box.rb +5 -3
- data/lib/bulma_form_builder/inputs/collection_radio_buttons.rb +23 -0
- data/lib/bulma_form_builder/inputs/url_field.rb +13 -0
- data/lib/bulma_form_builder/version.rb +1 -1
- metadata +15 -15
- data/.travis.yml +0 -7
- data/Gemfile.lock +0 -158
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a581612d0a16c72bfcae34bbe63b7ef19294b7459743841350cb1246cf8620c
|
4
|
+
data.tar.gz: bf8a24194bda0d5b1d4d33f0b4a5ff30699a7b0e17a6cf1744e257f01e62ef61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bfd25b8c4887bd2fa8fe47cba40042020e205984023c0eae521dd00ca29ebb958ae82e4a615db20c2efa9f1197a380404e251b1131ef9563c15e3c02fda4bc0
|
7
|
+
data.tar.gz: bd5ffa6a3a92232a8d23f789000e4c6a81f8c8f188bb3e3068f5d6468093eb93be94eb7a9908079ed5d4c7dce901d546ab0f23d2886cb1e46bf7c7cf0963b49c
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
## 0.4.0
|
2
|
+
|
3
|
+
- Update dependency
|
4
|
+
- Fix error display in check_box
|
5
|
+
|
6
|
+
## 0.3.1
|
7
|
+
|
8
|
+
- Update dependency
|
9
|
+
- Support for `tag` helper
|
10
|
+
|
11
|
+
## 0.3.0
|
12
|
+
|
13
|
+
- Add url_field
|
14
|
+
- Update dependency
|
15
|
+
|
16
|
+
## 0.2.1
|
17
|
+
|
18
|
+
- Support the check_box helper option
|
19
|
+
|
20
|
+
## 0.2.0
|
21
|
+
|
22
|
+
- Add collection_radio_buttons
|
23
|
+
|
1
24
|
## 0.1.1
|
2
25
|
|
3
26
|
- Add wrapper_class option
|
data/bulma_form_builder.gemspec
CHANGED
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_dependency "rails", ">=
|
25
|
+
spec.add_dependency "rails", ">= 6.0.3.7"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 2.0"
|
28
|
-
spec.add_development_dependency "rake"
|
29
|
-
spec.add_development_dependency "rspec"
|
28
|
+
spec.add_development_dependency "rake"
|
29
|
+
spec.add_development_dependency "rspec"
|
30
30
|
end
|
@@ -16,6 +16,7 @@ module BulmaFormBuilder
|
|
16
16
|
|
17
17
|
include BulmaFormBuilder::Inputs::Base
|
18
18
|
include BulmaFormBuilder::Inputs::EmailField
|
19
|
+
include BulmaFormBuilder::Inputs::UrlField
|
19
20
|
include BulmaFormBuilder::Inputs::DateField
|
20
21
|
include BulmaFormBuilder::Inputs::TimeField
|
21
22
|
include BulmaFormBuilder::Inputs::MonthField
|
@@ -26,8 +27,9 @@ module BulmaFormBuilder
|
|
26
27
|
include BulmaFormBuilder::Inputs::TextArea
|
27
28
|
include BulmaFormBuilder::Inputs::CheckBox
|
28
29
|
include BulmaFormBuilder::Inputs::CollectionCheckBoxes
|
30
|
+
include BulmaFormBuilder::Inputs::CollectionRadioButtons
|
29
31
|
|
30
|
-
delegate :content_tag, :capture, :concat, to: :@template
|
32
|
+
delegate :content_tag, :capture, :concat, :tag, to: :@template
|
31
33
|
|
32
34
|
def initialize(object_name, object, template, options)
|
33
35
|
@layout = options[:layout]
|
@@ -1,8 +1,10 @@
|
|
1
1
|
require 'bulma_form_builder/inputs/base'
|
2
2
|
require 'bulma_form_builder/inputs/check_box'
|
3
3
|
require 'bulma_form_builder/inputs/collection_check_boxes'
|
4
|
+
require 'bulma_form_builder/inputs/collection_radio_buttons'
|
4
5
|
require 'bulma_form_builder/inputs/date_field'
|
5
6
|
require 'bulma_form_builder/inputs/email_field'
|
7
|
+
require 'bulma_form_builder/inputs/url_field'
|
6
8
|
require 'bulma_form_builder/inputs/month_field'
|
7
9
|
require 'bulma_form_builder/inputs/number_field'
|
8
10
|
require 'bulma_form_builder/inputs/password_field'
|
@@ -3,7 +3,7 @@ module BulmaFormBuilder
|
|
3
3
|
module Base
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
ELEMENTS_WITH_INPUT_CLASS = %i[email_field number_field password_field text_field].freeze
|
6
|
+
ELEMENTS_WITH_INPUT_CLASS = %i[email_field url_field number_field password_field text_field].freeze
|
7
7
|
|
8
8
|
class_methods do
|
9
9
|
def bulma_field(field_name)
|
@@ -9,14 +9,16 @@ module BulmaFormBuilder
|
|
9
9
|
def check_box_with_bulma(name, options = {}, checked_value = '1', unchecked_value = '0', &block)
|
10
10
|
options = options.symbolize_keys!
|
11
11
|
check_box_options = options.except(:class, :label, :label_class, :error_message, :help, :inline, :custom, :hide_label, :skip_label, :wrapper_class)
|
12
|
+
wrapper_class = ['field', options[:wrapper_class]].compact
|
12
13
|
|
13
|
-
content_tag(:div, class:
|
14
|
-
content_tag(:label, class: 'checkbox') do
|
14
|
+
content_tag(:div, class: wrapper_class) do
|
15
|
+
checkbox = content_tag(:label, class: 'checkbox') do
|
15
16
|
html = check_box_without_bulma(name, check_box_options, checked_value, unchecked_value)
|
16
17
|
html.concat(check_box_label(name)) unless options[:skip_label]
|
17
|
-
html.concat(generate_error(name)) if options[:error_message]
|
18
18
|
html
|
19
19
|
end
|
20
|
+
checkbox.concat(field_help(name, options))
|
21
|
+
checkbox
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module BulmaFormBuilder
|
2
|
+
module Inputs
|
3
|
+
module CollectionRadioButtons
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
include Base
|
6
|
+
|
7
|
+
included do
|
8
|
+
def collection_radio_buttons_with_bulma(method, collection, value_method, text_method, options = {}, html_options = {}) # rubocop:disable Metrics/ParameterLists
|
9
|
+
html = form_field_builder(method, options, html_options) do
|
10
|
+
collection_radio_buttons_without_bulma(method, collection, value_method, text_method, options, html_options) do |b|
|
11
|
+
content_tag(:label, class: 'radio') do
|
12
|
+
concat b.radio_button
|
13
|
+
concat content_tag(:span, class: 'control-label') { b.text }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
bulma_alias :collection_radio_buttons
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bulma_form_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki77
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.3.7
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 6.0.3.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,30 +42,30 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
description: bulma_form_builder is a Rails form builder that makes it super easy to
|
70
70
|
integrate Bulma style forms into your Rails application.
|
71
71
|
email:
|
@@ -76,11 +76,9 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
78
|
- ".rspec"
|
79
|
-
- ".travis.yml"
|
80
79
|
- CHANGELOG.md
|
81
80
|
- CODE_OF_CONDUCT.md
|
82
81
|
- Gemfile
|
83
|
-
- Gemfile.lock
|
84
82
|
- LICENSE.txt
|
85
83
|
- README.md
|
86
84
|
- Rakefile
|
@@ -99,6 +97,7 @@ files:
|
|
99
97
|
- lib/bulma_form_builder/inputs/base.rb
|
100
98
|
- lib/bulma_form_builder/inputs/check_box.rb
|
101
99
|
- lib/bulma_form_builder/inputs/collection_check_boxes.rb
|
100
|
+
- lib/bulma_form_builder/inputs/collection_radio_buttons.rb
|
102
101
|
- lib/bulma_form_builder/inputs/date_field.rb
|
103
102
|
- lib/bulma_form_builder/inputs/email_field.rb
|
104
103
|
- lib/bulma_form_builder/inputs/month_field.rb
|
@@ -108,6 +107,7 @@ files:
|
|
108
107
|
- lib/bulma_form_builder/inputs/text_area.rb
|
109
108
|
- lib/bulma_form_builder/inputs/text_field.rb
|
110
109
|
- lib/bulma_form_builder/inputs/time_field.rb
|
110
|
+
- lib/bulma_form_builder/inputs/url_field.rb
|
111
111
|
- lib/bulma_form_builder/railtie.rb
|
112
112
|
- lib/bulma_form_builder/version.rb
|
113
113
|
homepage: https://github.com/aki77/bulma_form_builder
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.1.2
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Rails form builder
|
data/.travis.yml
DELETED
data/Gemfile.lock
DELETED
@@ -1,158 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
bulma_form_builder (0.1.1)
|
5
|
-
rails (>= 5.2.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
actioncable (6.0.1)
|
11
|
-
actionpack (= 6.0.1)
|
12
|
-
nio4r (~> 2.0)
|
13
|
-
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailbox (6.0.1)
|
15
|
-
actionpack (= 6.0.1)
|
16
|
-
activejob (= 6.0.1)
|
17
|
-
activerecord (= 6.0.1)
|
18
|
-
activestorage (= 6.0.1)
|
19
|
-
activesupport (= 6.0.1)
|
20
|
-
mail (>= 2.7.1)
|
21
|
-
actionmailer (6.0.1)
|
22
|
-
actionpack (= 6.0.1)
|
23
|
-
actionview (= 6.0.1)
|
24
|
-
activejob (= 6.0.1)
|
25
|
-
mail (~> 2.5, >= 2.5.4)
|
26
|
-
rails-dom-testing (~> 2.0)
|
27
|
-
actionpack (6.0.1)
|
28
|
-
actionview (= 6.0.1)
|
29
|
-
activesupport (= 6.0.1)
|
30
|
-
rack (~> 2.0)
|
31
|
-
rack-test (>= 0.6.3)
|
32
|
-
rails-dom-testing (~> 2.0)
|
33
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
34
|
-
actiontext (6.0.1)
|
35
|
-
actionpack (= 6.0.1)
|
36
|
-
activerecord (= 6.0.1)
|
37
|
-
activestorage (= 6.0.1)
|
38
|
-
activesupport (= 6.0.1)
|
39
|
-
nokogiri (>= 1.8.5)
|
40
|
-
actionview (6.0.1)
|
41
|
-
activesupport (= 6.0.1)
|
42
|
-
builder (~> 3.1)
|
43
|
-
erubi (~> 1.4)
|
44
|
-
rails-dom-testing (~> 2.0)
|
45
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
46
|
-
activejob (6.0.1)
|
47
|
-
activesupport (= 6.0.1)
|
48
|
-
globalid (>= 0.3.6)
|
49
|
-
activemodel (6.0.1)
|
50
|
-
activesupport (= 6.0.1)
|
51
|
-
activerecord (6.0.1)
|
52
|
-
activemodel (= 6.0.1)
|
53
|
-
activesupport (= 6.0.1)
|
54
|
-
activestorage (6.0.1)
|
55
|
-
actionpack (= 6.0.1)
|
56
|
-
activejob (= 6.0.1)
|
57
|
-
activerecord (= 6.0.1)
|
58
|
-
marcel (~> 0.3.1)
|
59
|
-
activesupport (6.0.1)
|
60
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
61
|
-
i18n (>= 0.7, < 2)
|
62
|
-
minitest (~> 5.1)
|
63
|
-
tzinfo (~> 1.1)
|
64
|
-
zeitwerk (~> 2.2)
|
65
|
-
builder (3.2.3)
|
66
|
-
concurrent-ruby (1.1.5)
|
67
|
-
crass (1.0.5)
|
68
|
-
diff-lcs (1.3)
|
69
|
-
erubi (1.9.0)
|
70
|
-
globalid (0.4.2)
|
71
|
-
activesupport (>= 4.2.0)
|
72
|
-
i18n (1.7.0)
|
73
|
-
concurrent-ruby (~> 1.0)
|
74
|
-
loofah (2.3.1)
|
75
|
-
crass (~> 1.0.2)
|
76
|
-
nokogiri (>= 1.5.9)
|
77
|
-
mail (2.7.1)
|
78
|
-
mini_mime (>= 0.1.1)
|
79
|
-
marcel (0.3.3)
|
80
|
-
mimemagic (~> 0.3.2)
|
81
|
-
method_source (0.9.2)
|
82
|
-
mimemagic (0.3.3)
|
83
|
-
mini_mime (1.0.2)
|
84
|
-
mini_portile2 (2.4.0)
|
85
|
-
minitest (5.13.0)
|
86
|
-
nio4r (2.5.2)
|
87
|
-
nokogiri (1.10.5)
|
88
|
-
mini_portile2 (~> 2.4.0)
|
89
|
-
rack (2.0.7)
|
90
|
-
rack-test (1.1.0)
|
91
|
-
rack (>= 1.0, < 3)
|
92
|
-
rails (6.0.1)
|
93
|
-
actioncable (= 6.0.1)
|
94
|
-
actionmailbox (= 6.0.1)
|
95
|
-
actionmailer (= 6.0.1)
|
96
|
-
actionpack (= 6.0.1)
|
97
|
-
actiontext (= 6.0.1)
|
98
|
-
actionview (= 6.0.1)
|
99
|
-
activejob (= 6.0.1)
|
100
|
-
activemodel (= 6.0.1)
|
101
|
-
activerecord (= 6.0.1)
|
102
|
-
activestorage (= 6.0.1)
|
103
|
-
activesupport (= 6.0.1)
|
104
|
-
bundler (>= 1.3.0)
|
105
|
-
railties (= 6.0.1)
|
106
|
-
sprockets-rails (>= 2.0.0)
|
107
|
-
rails-dom-testing (2.0.3)
|
108
|
-
activesupport (>= 4.2.0)
|
109
|
-
nokogiri (>= 1.6)
|
110
|
-
rails-html-sanitizer (1.3.0)
|
111
|
-
loofah (~> 2.3)
|
112
|
-
railties (6.0.1)
|
113
|
-
actionpack (= 6.0.1)
|
114
|
-
activesupport (= 6.0.1)
|
115
|
-
method_source
|
116
|
-
rake (>= 0.8.7)
|
117
|
-
thor (>= 0.20.3, < 2.0)
|
118
|
-
rake (10.5.0)
|
119
|
-
rspec (3.9.0)
|
120
|
-
rspec-core (~> 3.9.0)
|
121
|
-
rspec-expectations (~> 3.9.0)
|
122
|
-
rspec-mocks (~> 3.9.0)
|
123
|
-
rspec-core (3.9.0)
|
124
|
-
rspec-support (~> 3.9.0)
|
125
|
-
rspec-expectations (3.9.0)
|
126
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
-
rspec-support (~> 3.9.0)
|
128
|
-
rspec-mocks (3.9.0)
|
129
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
130
|
-
rspec-support (~> 3.9.0)
|
131
|
-
rspec-support (3.9.0)
|
132
|
-
sprockets (4.0.0)
|
133
|
-
concurrent-ruby (~> 1.0)
|
134
|
-
rack (> 1, < 3)
|
135
|
-
sprockets-rails (3.2.1)
|
136
|
-
actionpack (>= 4.0)
|
137
|
-
activesupport (>= 4.0)
|
138
|
-
sprockets (>= 3.0.0)
|
139
|
-
thor (0.20.3)
|
140
|
-
thread_safe (0.3.6)
|
141
|
-
tzinfo (1.2.5)
|
142
|
-
thread_safe (~> 0.1)
|
143
|
-
websocket-driver (0.7.1)
|
144
|
-
websocket-extensions (>= 0.1.0)
|
145
|
-
websocket-extensions (0.1.4)
|
146
|
-
zeitwerk (2.2.1)
|
147
|
-
|
148
|
-
PLATFORMS
|
149
|
-
ruby
|
150
|
-
|
151
|
-
DEPENDENCIES
|
152
|
-
bulma_form_builder!
|
153
|
-
bundler (~> 2.0)
|
154
|
-
rake (~> 10.0)
|
155
|
-
rspec (~> 3.0)
|
156
|
-
|
157
|
-
BUNDLED WITH
|
158
|
-
2.0.2
|