vcfb 1.0.0 → 2.0.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 +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +30 -0
- data/lib/generators/vcfb/components/components_generator.rb +5 -0
- data/lib/generators/vcfb/components/templates/button/component.html.erb +1 -1
- data/lib/generators/vcfb/components/templates/button/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/check_box/component.rb.tt +1 -14
- data/lib/generators/vcfb/components/templates/collection_check_boxes/check_box/component.rb.tt +1 -14
- data/lib/generators/vcfb/components/templates/collection_check_boxes/component.html.erb +1 -1
- data/lib/generators/vcfb/components/templates/collection_check_boxes/component.rb.tt +1 -24
- data/lib/generators/vcfb/components/templates/collection_check_boxes/label/component.html.erb +1 -1
- data/lib/generators/vcfb/components/templates/collection_check_boxes/label/component.rb.tt +1 -14
- data/lib/generators/vcfb/components/templates/collection_radio_buttons/component.html.erb +1 -1
- data/lib/generators/vcfb/components/templates/collection_radio_buttons/component.rb.tt +1 -24
- data/lib/generators/vcfb/components/templates/collection_radio_buttons/label/component.html.erb +1 -1
- data/lib/generators/vcfb/components/templates/collection_radio_buttons/label/component.rb.tt +1 -14
- data/lib/generators/vcfb/components/templates/collection_radio_buttons/radio_button/component.rb.tt +1 -13
- data/lib/generators/vcfb/components/templates/collection_select/component.rb.tt +1 -16
- data/lib/generators/vcfb/components/templates/color_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/component.html.erb +3 -0
- data/lib/generators/vcfb/components/templates/component.rb.tt +4 -0
- data/lib/generators/vcfb/components/templates/date_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/date_select/component.rb.tt +1 -13
- data/lib/generators/vcfb/components/templates/datetime_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/datetime_select/component.rb.tt +1 -13
- data/lib/generators/vcfb/components/templates/email_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/file_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/grouped_collection_select/component.rb.tt +1 -18
- data/lib/generators/vcfb/components/templates/label/component.html.erb +1 -1
- data/lib/generators/vcfb/components/templates/label/component.rb.tt +1 -14
- data/lib/generators/vcfb/components/templates/month_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/number_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/password_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/radio_button/component.rb.tt +1 -13
- data/lib/generators/vcfb/components/templates/range_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/rich_text_area/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/search_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/select/component.rb.tt +1 -18
- data/lib/generators/vcfb/components/templates/submit/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/telephone_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/text_area/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/text_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/time_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/time_select/component.rb.tt +1 -13
- data/lib/generators/vcfb/components/templates/time_zone_select/component.rb.tt +1 -14
- data/lib/generators/vcfb/components/templates/url_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/week_field/component.rb.tt +1 -12
- data/lib/generators/vcfb/components/templates/weekday_select/component.rb.tt +1 -13
- data/lib/generators/vcfb/initializer/initializer_generator.rb +12 -0
- data/lib/generators/vcfb/initializer/template/vcfb.rb.tt +3 -0
- data/lib/vcfb/component/base.rb +27 -0
- data/lib/vcfb/component/base_collection.rb +16 -0
- data/lib/vcfb/component/button.rb +17 -0
- data/lib/vcfb/component/check_box.rb +19 -0
- data/lib/vcfb/component/collection_check_boxes.rb +36 -0
- data/lib/vcfb/component/collection_radio_buttons.rb +36 -0
- data/lib/vcfb/component/collection_select.rb +21 -0
- data/lib/vcfb/component/color_field.rb +17 -0
- data/lib/vcfb/component/date_field.rb +17 -0
- data/lib/vcfb/component/date_select.rb +18 -0
- data/lib/vcfb/component/datetime_field.rb +17 -0
- data/lib/vcfb/component/datetime_select.rb +18 -0
- data/lib/vcfb/component/email_field.rb +17 -0
- data/lib/vcfb/component/file_field.rb +17 -0
- data/lib/vcfb/component/form.rb +40 -0
- data/lib/vcfb/component/grouped_collection_select.rb +23 -0
- data/lib/vcfb/component/label.rb +28 -0
- data/lib/vcfb/component/month_field.rb +17 -0
- data/lib/vcfb/component/number_field.rb +17 -0
- data/lib/vcfb/component/password_field.rb +17 -0
- data/lib/vcfb/component/radio_button.rb +18 -0
- data/lib/vcfb/component/range_field.rb +17 -0
- data/lib/vcfb/component/rich_text_area.rb +17 -0
- data/lib/vcfb/component/search_field.rb +17 -0
- data/lib/vcfb/component/select.rb +23 -0
- data/lib/vcfb/component/submit.rb +17 -0
- data/lib/vcfb/component/telephone_field.rb +17 -0
- data/lib/vcfb/component/text_area.rb +17 -0
- data/lib/vcfb/component/text_field.rb +17 -0
- data/lib/vcfb/component/time_field.rb +17 -0
- data/lib/vcfb/component/time_select.rb +18 -0
- data/lib/vcfb/component/time_zone_select.rb +19 -0
- data/lib/vcfb/component/url_field.rb +17 -0
- data/lib/vcfb/component/week_field.rb +17 -0
- data/lib/vcfb/component/weekday_select.rb +18 -0
- data/lib/vcfb/errors/component_missing.rb +5 -0
- data/lib/vcfb/errors/error.rb +5 -0
- data/lib/vcfb/form_builder.rb +56 -19
- data/lib/vcfb/form_helper.rb +12 -0
- data/lib/vcfb/railtie.rb +7 -0
- data/lib/vcfb/resolver.rb +8 -6
- data/lib/vcfb/tags/collection_check_boxes.rb +2 -2
- data/lib/vcfb/tags/collection_helpers.rb +0 -2
- data/lib/vcfb/tags/collection_radio_buttons.rb +2 -2
- data/lib/vcfb/template.rb +8 -6
- data/lib/vcfb/version.rb +1 -1
- data/lib/vcfb.rb +68 -10
- metadata +44 -5
- data/lib/vcfb/acts_as_form_collection_component.rb +0 -19
- data/lib/vcfb/acts_as_form_component.rb +0 -22
- data/lib/vcfb/acts_as_form_label_component.rb +0 -21
data/lib/vcfb.rb
CHANGED
@@ -1,12 +1,70 @@
|
|
1
|
+
require "rails"
|
1
2
|
require "view_component"
|
2
|
-
require "
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
require "view_component/version"
|
4
|
+
|
5
|
+
module VCFB
|
6
|
+
autoload :FormBuilder, "vcfb/form_builder"
|
7
|
+
autoload :FormHelper, "vcfb/form_helper"
|
8
|
+
autoload :Resolver, "vcfb/resolver"
|
9
|
+
autoload :Template, "vcfb/template"
|
10
|
+
|
11
|
+
module Tags
|
12
|
+
autoload :CollectionCheckBoxes, "vcfb/tags/collection_check_boxes"
|
13
|
+
autoload :CollectionHelpers, "vcfb/tags/collection_helpers"
|
14
|
+
autoload :CollectionRadioButtons, "vcfb/tags/collection_radio_buttons"
|
15
|
+
end
|
16
|
+
|
17
|
+
module Errors
|
18
|
+
autoload :ComponentMissing, "vcfb/errors/component_missing"
|
19
|
+
autoload :Error, "vcfb/errors/error"
|
20
|
+
end
|
21
|
+
|
22
|
+
mattr_accessor :parent_component
|
23
|
+
@@parent_component = defined?(ApplicationComponent) ? "ApplicationComponent" : "ViewComponent::Base"
|
24
|
+
|
25
|
+
def self.configure
|
26
|
+
yield self
|
27
|
+
end
|
28
|
+
|
29
|
+
module Component
|
30
|
+
def self.setup!
|
31
|
+
autoload :Base, "vcfb/component/base"
|
32
|
+
autoload :BaseCollection, "vcfb/component/base_collection"
|
33
|
+
autoload :Button, "vcfb/component/button"
|
34
|
+
autoload :CheckBox, "vcfb/component/check_box"
|
35
|
+
autoload :CollectionCheckBoxes, "vcfb/component/collection_check_boxes"
|
36
|
+
autoload :CollectionRadioButtons, "vcfb/component/collection_radio_buttons"
|
37
|
+
autoload :CollectionSelect, "vcfb/component/collection_select"
|
38
|
+
autoload :ColorField, "vcfb/component/color_field"
|
39
|
+
autoload :DateField, "vcfb/component/date_field"
|
40
|
+
autoload :DateSelect, "vcfb/component/date_select"
|
41
|
+
autoload :DatetimeField, "vcfb/component/datetime_field"
|
42
|
+
autoload :DatetimeSelect, "vcfb/component/datetime_select"
|
43
|
+
autoload :EmailField, "vcfb/component/email_field"
|
44
|
+
autoload :FileField, "vcfb/component/file_field"
|
45
|
+
autoload :Form, "vcfb/component/form"
|
46
|
+
autoload :GroupedCollectionSelect, "vcfb/component/grouped_collection_select"
|
47
|
+
autoload :Label, "vcfb/component/label"
|
48
|
+
autoload :MonthField, "vcfb/component/month_field"
|
49
|
+
autoload :NumberField, "vcfb/component/number_field"
|
50
|
+
autoload :PasswordField, "vcfb/component/password_field"
|
51
|
+
autoload :RadioButton, "vcfb/component/radio_button"
|
52
|
+
autoload :RangeField, "vcfb/component/range_field"
|
53
|
+
autoload :RichTextArea, "vcfb/component/rich_text_area"
|
54
|
+
autoload :SearchField, "vcfb/component/search_field"
|
55
|
+
autoload :Select, "vcfb/component/select"
|
56
|
+
autoload :Submit, "vcfb/component/submit"
|
57
|
+
autoload :TelephoneField, "vcfb/component/telephone_field"
|
58
|
+
autoload :TextArea, "vcfb/component/text_area"
|
59
|
+
autoload :TextField, "vcfb/component/text_field"
|
60
|
+
autoload :TimeField, "vcfb/component/time_field"
|
61
|
+
autoload :TimeSelect, "vcfb/component/time_select"
|
62
|
+
autoload :TimeZoneSelect, "vcfb/component/time_zone_select"
|
63
|
+
autoload :UrlField, "vcfb/component/url_field"
|
64
|
+
autoload :WeekField, "vcfb/component/week_field"
|
65
|
+
autoload :WeekdaySelect, "vcfb/component/weekday_select"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
9
70
|
require "vcfb/railtie"
|
10
|
-
require "vcfb/resolver"
|
11
|
-
require "vcfb/template"
|
12
|
-
require "vcfb/version"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcfb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Monroe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -153,6 +153,8 @@ files:
|
|
153
153
|
- lib/generators/vcfb/components/templates/collection_select/component.rb.tt
|
154
154
|
- lib/generators/vcfb/components/templates/color_field/component.html.erb
|
155
155
|
- lib/generators/vcfb/components/templates/color_field/component.rb.tt
|
156
|
+
- lib/generators/vcfb/components/templates/component.html.erb
|
157
|
+
- lib/generators/vcfb/components/templates/component.rb.tt
|
156
158
|
- lib/generators/vcfb/components/templates/date_field/component.html.erb
|
157
159
|
- lib/generators/vcfb/components/templates/date_field/component.rb.tt
|
158
160
|
- lib/generators/vcfb/components/templates/date_select/component.html.erb
|
@@ -205,12 +207,49 @@ files:
|
|
205
207
|
- lib/generators/vcfb/components/templates/week_field/component.rb.tt
|
206
208
|
- lib/generators/vcfb/components/templates/weekday_select/component.html.erb
|
207
209
|
- lib/generators/vcfb/components/templates/weekday_select/component.rb.tt
|
210
|
+
- lib/generators/vcfb/initializer/initializer_generator.rb
|
211
|
+
- lib/generators/vcfb/initializer/template/vcfb.rb.tt
|
208
212
|
- lib/vcfb.rb
|
209
213
|
- lib/vcfb/action_view_tag_patch.rb
|
210
|
-
- lib/vcfb/
|
211
|
-
- lib/vcfb/
|
212
|
-
- lib/vcfb/
|
214
|
+
- lib/vcfb/component/base.rb
|
215
|
+
- lib/vcfb/component/base_collection.rb
|
216
|
+
- lib/vcfb/component/button.rb
|
217
|
+
- lib/vcfb/component/check_box.rb
|
218
|
+
- lib/vcfb/component/collection_check_boxes.rb
|
219
|
+
- lib/vcfb/component/collection_radio_buttons.rb
|
220
|
+
- lib/vcfb/component/collection_select.rb
|
221
|
+
- lib/vcfb/component/color_field.rb
|
222
|
+
- lib/vcfb/component/date_field.rb
|
223
|
+
- lib/vcfb/component/date_select.rb
|
224
|
+
- lib/vcfb/component/datetime_field.rb
|
225
|
+
- lib/vcfb/component/datetime_select.rb
|
226
|
+
- lib/vcfb/component/email_field.rb
|
227
|
+
- lib/vcfb/component/file_field.rb
|
228
|
+
- lib/vcfb/component/form.rb
|
229
|
+
- lib/vcfb/component/grouped_collection_select.rb
|
230
|
+
- lib/vcfb/component/label.rb
|
231
|
+
- lib/vcfb/component/month_field.rb
|
232
|
+
- lib/vcfb/component/number_field.rb
|
233
|
+
- lib/vcfb/component/password_field.rb
|
234
|
+
- lib/vcfb/component/radio_button.rb
|
235
|
+
- lib/vcfb/component/range_field.rb
|
236
|
+
- lib/vcfb/component/rich_text_area.rb
|
237
|
+
- lib/vcfb/component/search_field.rb
|
238
|
+
- lib/vcfb/component/select.rb
|
239
|
+
- lib/vcfb/component/submit.rb
|
240
|
+
- lib/vcfb/component/telephone_field.rb
|
241
|
+
- lib/vcfb/component/text_area.rb
|
242
|
+
- lib/vcfb/component/text_field.rb
|
243
|
+
- lib/vcfb/component/time_field.rb
|
244
|
+
- lib/vcfb/component/time_select.rb
|
245
|
+
- lib/vcfb/component/time_zone_select.rb
|
246
|
+
- lib/vcfb/component/url_field.rb
|
247
|
+
- lib/vcfb/component/week_field.rb
|
248
|
+
- lib/vcfb/component/weekday_select.rb
|
249
|
+
- lib/vcfb/errors/component_missing.rb
|
250
|
+
- lib/vcfb/errors/error.rb
|
213
251
|
- lib/vcfb/form_builder.rb
|
252
|
+
- lib/vcfb/form_helper.rb
|
214
253
|
- lib/vcfb/railtie.rb
|
215
254
|
- lib/vcfb/resolver.rb
|
216
255
|
- lib/vcfb/tags/collection_check_boxes.rb
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require "active_support/concern"
|
2
|
-
|
3
|
-
require "vcfb/acts_as_form_component"
|
4
|
-
|
5
|
-
module VCFB
|
6
|
-
module ActsAsFormCollectionComponent
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
include ActsAsFormComponent
|
9
|
-
|
10
|
-
def content(builder)
|
11
|
-
@__vc_content = if @view_context && @__vc_render_in_block
|
12
|
-
view_context.capture(builder, &@__vc_render_in_block)
|
13
|
-
else
|
14
|
-
default_content(builder)
|
15
|
-
end
|
16
|
-
super()
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require "active_support/concern"
|
2
|
-
|
3
|
-
require "vcfb/tags/collection_check_boxes"
|
4
|
-
require "vcfb/tags/collection_radio_buttons"
|
5
|
-
|
6
|
-
module VCFB
|
7
|
-
module ActsAsFormComponent
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
|
10
|
-
included do
|
11
|
-
delegate :rich_text_area_tag, to: :helpers
|
12
|
-
end
|
13
|
-
|
14
|
-
def collection_check_boxes(object, method, collection, value_method, text_method, options = {}, html_options = {}, &block)
|
15
|
-
Tags::CollectionCheckBoxes.new(object, method, self, collection, value_method, text_method, options, html_options).render(&block)
|
16
|
-
end
|
17
|
-
|
18
|
-
def collection_radio_buttons(object, method, collection, value_method, text_method, options = {}, html_options = {}, &block)
|
19
|
-
Tags::CollectionRadioButtons.new(object, method, self, collection, value_method, text_method, options, html_options).render(&block)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require "active_support/concern"
|
2
|
-
|
3
|
-
require "vcfb/acts_as_form_component"
|
4
|
-
|
5
|
-
module VCFB
|
6
|
-
module ActsAsFormLabelComponent
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
include ActsAsFormComponent
|
9
|
-
|
10
|
-
included do
|
11
|
-
delegate :translation, :to_s, to: :label_builder
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def label_builder
|
17
|
-
@label_builder ||= ActionView::Helpers::Tags::Label::LabelBuilder
|
18
|
-
.new(@form.template, @form.object_name, @method, @form.object, @options[:value])
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|