bootstrap_form 4.1.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +18 -0
  3. data/.rubocop.yml +3 -2
  4. data/.travis.yml +7 -1
  5. data/CHANGELOG.md +15 -1
  6. data/CONTRIBUTING.md +11 -0
  7. data/Dangerfile +4 -4
  8. data/Gemfile +7 -2
  9. data/OLD-README.md +795 -0
  10. data/README.md +150 -93
  11. data/Rakefile +2 -4
  12. data/bootstrap_form.gemspec +2 -1
  13. data/demo/.postcssrc.yml +3 -0
  14. data/demo/app/assets/config/manifest.js +2 -0
  15. data/demo/app/assets/stylesheets/actiontext.scss +38 -0
  16. data/demo/app/assets/stylesheets/application.scss +1 -0
  17. data/demo/app/helpers/bootstrap_helper.rb +16 -10
  18. data/demo/app/javascript/channels/consumer.js +6 -0
  19. data/demo/app/javascript/channels/index.js +5 -0
  20. data/demo/app/javascript/packs/application.js +11 -0
  21. data/demo/app/models/user.rb +2 -0
  22. data/demo/app/views/active_storage/blobs/_blob.html.erb +14 -0
  23. data/demo/app/views/bootstrap/form.html.erb +2 -1
  24. data/demo/app/views/layouts/application.html.erb +3 -0
  25. data/demo/bin/webpack +15 -0
  26. data/demo/bin/webpack-dev-server +15 -0
  27. data/demo/config/application.rb +2 -3
  28. data/demo/config/environments/development.rb +3 -1
  29. data/demo/config/environments/production.rb +48 -0
  30. data/demo/config/webpack/development.js +5 -0
  31. data/demo/config/webpack/environment.js +3 -0
  32. data/demo/config/webpack/production.js +5 -0
  33. data/demo/config/webpack/test.js +5 -0
  34. data/demo/config/webpacker.yml +92 -0
  35. data/demo/db/schema.rb +63 -18
  36. data/demo/package.json +13 -1
  37. data/demo/test/fixtures/action_text/rich_texts.yml +4 -0
  38. data/demo/yarn.lock +6257 -0
  39. data/lib/bootstrap_form.rb +34 -8
  40. data/lib/bootstrap_form/action_view_extensions/form_helper.rb +71 -0
  41. data/lib/bootstrap_form/components.rb +17 -0
  42. data/lib/bootstrap_form/components/hints.rb +60 -0
  43. data/lib/bootstrap_form/components/labels.rb +56 -0
  44. data/lib/bootstrap_form/components/layout.rb +39 -0
  45. data/lib/bootstrap_form/components/validation.rb +61 -0
  46. data/lib/bootstrap_form/engine.rb +10 -0
  47. data/lib/bootstrap_form/form_builder.rb +54 -524
  48. data/lib/bootstrap_form/form_group.rb +64 -0
  49. data/lib/bootstrap_form/form_group_builder.rb +103 -0
  50. data/lib/bootstrap_form/helpers.rb +9 -0
  51. data/lib/bootstrap_form/helpers/bootstrap.rb +39 -31
  52. data/lib/bootstrap_form/inputs.rb +40 -0
  53. data/lib/bootstrap_form/inputs/base.rb +40 -0
  54. data/lib/bootstrap_form/inputs/check_box.rb +89 -0
  55. data/lib/bootstrap_form/inputs/collection_check_boxes.rb +23 -0
  56. data/lib/bootstrap_form/inputs/collection_radio_buttons.rb +21 -0
  57. data/lib/bootstrap_form/inputs/collection_select.rb +25 -0
  58. data/lib/bootstrap_form/inputs/color_field.rb +14 -0
  59. data/lib/bootstrap_form/inputs/date_field.rb +14 -0
  60. data/lib/bootstrap_form/inputs/date_select.rb +14 -0
  61. data/lib/bootstrap_form/inputs/datetime_field.rb +14 -0
  62. data/lib/bootstrap_form/inputs/datetime_local_field.rb +14 -0
  63. data/lib/bootstrap_form/inputs/datetime_select.rb +14 -0
  64. data/lib/bootstrap_form/inputs/email_field.rb +14 -0
  65. data/lib/bootstrap_form/inputs/file_field.rb +35 -0
  66. data/lib/bootstrap_form/inputs/grouped_collection_select.rb +29 -0
  67. data/lib/bootstrap_form/inputs/inputs_collection.rb +44 -0
  68. data/lib/bootstrap_form/inputs/month_field.rb +14 -0
  69. data/lib/bootstrap_form/inputs/number_field.rb +14 -0
  70. data/lib/bootstrap_form/inputs/password_field.rb +14 -0
  71. data/lib/bootstrap_form/inputs/phone_field.rb +14 -0
  72. data/lib/bootstrap_form/inputs/radio_button.rb +77 -0
  73. data/lib/bootstrap_form/inputs/range_field.rb +14 -0
  74. data/lib/bootstrap_form/inputs/rich_text_area.rb +23 -0
  75. data/lib/bootstrap_form/inputs/search_field.rb +14 -0
  76. data/lib/bootstrap_form/inputs/select.rb +22 -0
  77. data/lib/bootstrap_form/inputs/telephone_field.rb +14 -0
  78. data/lib/bootstrap_form/inputs/text_area.rb +14 -0
  79. data/lib/bootstrap_form/inputs/text_field.rb +14 -0
  80. data/lib/bootstrap_form/inputs/time_field.rb +14 -0
  81. data/lib/bootstrap_form/inputs/time_select.rb +14 -0
  82. data/lib/bootstrap_form/inputs/time_zone_select.rb +22 -0
  83. data/lib/bootstrap_form/inputs/url_field.rb +14 -0
  84. data/lib/bootstrap_form/inputs/week_field.rb +14 -0
  85. data/lib/bootstrap_form/version.rb +1 -1
  86. metadata +79 -6
  87. data/.rubocop_todo.yml +0 -104
  88. data/lib/bootstrap_form/aliasing.rb +0 -35
  89. data/lib/bootstrap_form/helper.rb +0 -52
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module RichTextArea
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ def rich_text_area_with_bootstrap(name, options={})
11
+ form_group_builder(name, options) do
12
+ prepend_and_append_input(name, options) do
13
+ options[:class] = ["trix-content", options[:class]].compact.join(" ")
14
+ rich_text_area_without_bootstrap(name, options)
15
+ end
16
+ end
17
+ end
18
+
19
+ bootstrap_alias :rich_text_area
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module SearchField
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_field :search_field
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module Select
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ def select_with_bootstrap(method, choices=nil, options={}, html_options={}, &block)
11
+ form_group_builder(method, options, html_options) do
12
+ prepend_and_append_input(method, options) do
13
+ select_without_bootstrap(method, choices, options, html_options, &block)
14
+ end
15
+ end
16
+ end
17
+
18
+ bootstrap_alias :select
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module TelephoneField
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_field :telephone_field
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module TextArea
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_field :text_area
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module TextField
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_field :text_field
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module TimeField
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_field :time_field
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module TimeSelect
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_select_group :time_select
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module TimeZoneSelect
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ def time_zone_select_with_bootstrap(method, priority_zones=nil, options={}, html_options={})
11
+ form_group_builder(method, options, html_options) do
12
+ input_with_error(method) do
13
+ time_zone_select_without_bootstrap(method, priority_zones, options, html_options)
14
+ end
15
+ end
16
+ end
17
+
18
+ bootstrap_alias :time_zone_select
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module UrlField
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_field :url_field
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BootstrapForm
4
+ module Inputs
5
+ module WeekField
6
+ extend ActiveSupport::Concern
7
+ include Base
8
+
9
+ included do
10
+ bootstrap_field :week_field
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,3 @@
1
1
  module BootstrapForm
2
- VERSION = "4.1.0".freeze
2
+ VERSION = "4.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Potenza
@@ -9,10 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-01-19 00:00:00.000000000 Z
12
+ date: 2019-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rails
15
+ name: actionpack
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '5.0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '5.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: activemodel
16
30
  requirement: !ruby/object:Gem::Requirement
17
31
  requirements:
18
32
  - - ">="
@@ -36,7 +50,6 @@ extra_rdoc_files: []
36
50
  files:
37
51
  - ".gitignore"
38
52
  - ".rubocop.yml"
39
- - ".rubocop_todo.yml"
40
53
  - ".travis.yml"
41
54
  - CHANGELOG.md
42
55
  - CODE_OF_CONDUCT.md
@@ -44,22 +57,31 @@ files:
44
57
  - Dangerfile
45
58
  - Gemfile
46
59
  - LICENSE.txt
60
+ - OLD-README.md
47
61
  - README.md
48
62
  - RELEASING.md
49
63
  - Rakefile
50
64
  - UPGRADE-4.0.md
51
65
  - app/assets/stylesheets/rails_bootstrap_forms.css
52
66
  - bootstrap_form.gemspec
67
+ - demo/.postcssrc.yml
53
68
  - demo/README.md
54
69
  - demo/Rakefile
70
+ - demo/app/assets/config/manifest.js
71
+ - demo/app/assets/stylesheets/actiontext.scss
72
+ - demo/app/assets/stylesheets/application.scss
55
73
  - demo/app/controllers/application_controller.rb
56
74
  - demo/app/controllers/bootstrap_controller.rb
57
75
  - demo/app/helpers/bootstrap_helper.rb
76
+ - demo/app/javascript/channels/consumer.js
77
+ - demo/app/javascript/channels/index.js
78
+ - demo/app/javascript/packs/application.js
58
79
  - demo/app/models/address.rb
59
80
  - demo/app/models/application_record.rb
60
81
  - demo/app/models/faux_user.rb
61
82
  - demo/app/models/super_user.rb
62
83
  - demo/app/models/user.rb
84
+ - demo/app/views/active_storage/blobs/_blob.html.erb
63
85
  - demo/app/views/bootstrap/form.html.erb
64
86
  - demo/app/views/layouts/application.html.erb
65
87
  - demo/bin/bundle
@@ -67,6 +89,8 @@ files:
67
89
  - demo/bin/rake
68
90
  - demo/bin/setup
69
91
  - demo/bin/update
92
+ - demo/bin/webpack
93
+ - demo/bin/webpack-dev-server
70
94
  - demo/bin/yarn
71
95
  - demo/config.ru
72
96
  - demo/config/application.rb
@@ -74,6 +98,7 @@ files:
74
98
  - demo/config/database.yml
75
99
  - demo/config/environment.rb
76
100
  - demo/config/environments/development.rb
101
+ - demo/config/environments/production.rb
77
102
  - demo/config/environments/test.rb
78
103
  - demo/config/initializers/application_controller_renderer.rb
79
104
  - demo/config/initializers/assets.rb
@@ -88,15 +113,63 @@ files:
88
113
  - demo/config/routes.rb
89
114
  - demo/config/spring.rb
90
115
  - demo/config/storage.yml
116
+ - demo/config/webpack/development.js
117
+ - demo/config/webpack/environment.js
118
+ - demo/config/webpack/production.js
119
+ - demo/config/webpack/test.js
120
+ - demo/config/webpacker.yml
91
121
  - demo/db/schema.rb
92
122
  - demo/log/.keep
93
123
  - demo/package.json
94
124
  - demo/public/favicon.ico
125
+ - demo/test/fixtures/action_text/rich_texts.yml
126
+ - demo/yarn.lock
95
127
  - lib/bootstrap_form.rb
96
- - lib/bootstrap_form/aliasing.rb
128
+ - lib/bootstrap_form/action_view_extensions/form_helper.rb
129
+ - lib/bootstrap_form/components.rb
130
+ - lib/bootstrap_form/components/hints.rb
131
+ - lib/bootstrap_form/components/labels.rb
132
+ - lib/bootstrap_form/components/layout.rb
133
+ - lib/bootstrap_form/components/validation.rb
134
+ - lib/bootstrap_form/engine.rb
97
135
  - lib/bootstrap_form/form_builder.rb
98
- - lib/bootstrap_form/helper.rb
136
+ - lib/bootstrap_form/form_group.rb
137
+ - lib/bootstrap_form/form_group_builder.rb
138
+ - lib/bootstrap_form/helpers.rb
99
139
  - lib/bootstrap_form/helpers/bootstrap.rb
140
+ - lib/bootstrap_form/inputs.rb
141
+ - lib/bootstrap_form/inputs/base.rb
142
+ - lib/bootstrap_form/inputs/check_box.rb
143
+ - lib/bootstrap_form/inputs/collection_check_boxes.rb
144
+ - lib/bootstrap_form/inputs/collection_radio_buttons.rb
145
+ - lib/bootstrap_form/inputs/collection_select.rb
146
+ - lib/bootstrap_form/inputs/color_field.rb
147
+ - lib/bootstrap_form/inputs/date_field.rb
148
+ - lib/bootstrap_form/inputs/date_select.rb
149
+ - lib/bootstrap_form/inputs/datetime_field.rb
150
+ - lib/bootstrap_form/inputs/datetime_local_field.rb
151
+ - lib/bootstrap_form/inputs/datetime_select.rb
152
+ - lib/bootstrap_form/inputs/email_field.rb
153
+ - lib/bootstrap_form/inputs/file_field.rb
154
+ - lib/bootstrap_form/inputs/grouped_collection_select.rb
155
+ - lib/bootstrap_form/inputs/inputs_collection.rb
156
+ - lib/bootstrap_form/inputs/month_field.rb
157
+ - lib/bootstrap_form/inputs/number_field.rb
158
+ - lib/bootstrap_form/inputs/password_field.rb
159
+ - lib/bootstrap_form/inputs/phone_field.rb
160
+ - lib/bootstrap_form/inputs/radio_button.rb
161
+ - lib/bootstrap_form/inputs/range_field.rb
162
+ - lib/bootstrap_form/inputs/rich_text_area.rb
163
+ - lib/bootstrap_form/inputs/search_field.rb
164
+ - lib/bootstrap_form/inputs/select.rb
165
+ - lib/bootstrap_form/inputs/telephone_field.rb
166
+ - lib/bootstrap_form/inputs/text_area.rb
167
+ - lib/bootstrap_form/inputs/text_field.rb
168
+ - lib/bootstrap_form/inputs/time_field.rb
169
+ - lib/bootstrap_form/inputs/time_select.rb
170
+ - lib/bootstrap_form/inputs/time_zone_select.rb
171
+ - lib/bootstrap_form/inputs/url_field.rb
172
+ - lib/bootstrap_form/inputs/week_field.rb
100
173
  - lib/bootstrap_form/version.rb
101
174
  homepage: https://github.com/bootstrap-ruby/bootstrap_form
102
175
  licenses:
@@ -1,104 +0,0 @@
1
- inherit_from: .rubocop.yml
2
-
3
- # This configuration was generated by
4
- # `rubocop --auto-gen-config`
5
- # on 2018-11-01 19:28:56 +0000 using RuboCop version 0.60.0.
6
- # The point is for the user to remove these configuration records
7
- # one by one as the offenses are removed from the code base.
8
- # Note that changes in the inspected code, or installation of new
9
- # versions of RuboCop, may require this file to be generated again.
10
-
11
- # Offense count: 1
12
- # Cop supports --auto-correct.
13
- # Configuration parameters: EnforcedStyle.
14
- # SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
15
- Layout/IndentHeredoc:
16
- Exclude:
17
- - 'Dangerfile'
18
-
19
- # Offense count: 9
20
- Metrics/AbcSize:
21
- Max: 67
22
-
23
- # Offense count: 2
24
- # Configuration parameters: CountComments.
25
- Metrics/ClassLength:
26
- Max: 445
27
-
28
- # Offense count: 7
29
- Metrics/CyclomaticComplexity:
30
- Max: 17
31
-
32
- # Offense count: 1
33
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
34
- # URISchemes: http, https
35
- Metrics/LineLength:
36
- Max: 137
37
-
38
- # Offense count: 11
39
- # Configuration parameters: CountComments, ExcludedMethods.
40
- Metrics/MethodLength:
41
- Max: 45
42
-
43
- # Offense count: 2
44
- # Configuration parameters: CountKeywordArgs.
45
- Metrics/ParameterLists:
46
- Max: 8
47
-
48
- # Offense count: 5
49
- Metrics/PerceivedComplexity:
50
- Max: 19
51
-
52
- # Offense count: 2
53
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
54
- # NamePrefix: is_, has_, have_
55
- # NamePrefixBlacklist: is_, has_, have_
56
- # NameWhitelist: is_a?
57
- # MethodDefinitionMacros: define_method, define_singleton_method
58
- Naming/PredicateName:
59
- Exclude:
60
- - 'spec/**/*'
61
- - 'lib/bootstrap_form/form_builder.rb'
62
-
63
- # Offense count: 1
64
- # Configuration parameters: EnforcedStyle.
65
- # SupportedStyles: slashes, arguments
66
- Rails/FilePath:
67
- Exclude:
68
- - 'demo/config/environments/development.rb'
69
-
70
- # Offense count: 23
71
- Rails/OutputSafety:
72
- Exclude:
73
- - 'bootstrap_error_rendering_test.rb'
74
- - 'lib/bootstrap_form/form_builder.rb'
75
- - 'lib/bootstrap_form/helpers/bootstrap.rb'
76
- - 'test/bootstrap_checkbox_test.rb'
77
- - 'test/bootstrap_form_group_test.rb'
78
- - 'test/bootstrap_other_components_test.rb'
79
- - 'test/bootstrap_radio_button_test.rb'
80
-
81
- # Offense count: 1
82
- Style/CaseEquality:
83
- Exclude:
84
- - 'test/test_helper.rb'
85
-
86
- # Offense count: 6
87
- # Configuration parameters: MinBodyLength.
88
- Style/GuardClause:
89
- Exclude:
90
- - 'lib/bootstrap_form/form_builder.rb'
91
- - 'lib/bootstrap_form/helpers/bootstrap.rb'
92
-
93
- # Offense count: 2
94
- # Cop supports --auto-correct.
95
- Style/IfUnlessModifier:
96
- Exclude:
97
- - 'demo/config/application.rb'
98
- - 'lib/bootstrap_form/helper.rb'
99
-
100
- # Offense count: 2
101
- Style/MixinUsage:
102
- Exclude:
103
- - 'demo/bin/setup'
104
- - 'demo/bin/update'