katalyst-govuk-formbuilder 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b3226cf4e2ecbf980efe6f5cdab612b5aafe57ffa4377cde05151f42843dc2d
4
- data.tar.gz: 3b2e6aa556e25ffce43e021fe50153a3de7f4385844906c626297cbf36a676dd
3
+ metadata.gz: '0239e89e8855a5ded349983abca46fbf5a5c0bd7afb2acc9c550baf167c10f27'
4
+ data.tar.gz: 1c644907ab50cf26ea1d179d829c0c14498b01e8ce2f1639fc64efdac009d32f
5
5
  SHA512:
6
- metadata.gz: c0c6e25bebd4cb6783b23d99756355dac5f67456eb25df653ca9c47af5cf735e41a3ccc3020632c07056bd02615f6c31001652a3124be9d3660ef8fbd9dfd104
7
- data.tar.gz: 8fe14e36cd46640fa7af588b1ca674ad0fbba35194a9b8b4c663bd0bebd4a6242251fc8d95a126d5256d6e00ac2ead0fb9eb86da56e6f4d5b115c1c015815582
6
+ metadata.gz: 7ce9b3e9bfd4068f39b984d3b8035335b51dc141ad65a56f42ee373688c777ddd4a1db38fdbd8b7f4a4a0b5863e45b63767676ad90927a48899778890670dea9
7
+ data.tar.gz: 4ac11cc52ef5cdffedca22504d96b8571611a62697f5aae4a4277d3828fedf3f87caa1f13cdd3b4617491465462f52a6b3658a334996afef0680f034c8be29e3
@@ -4,7 +4,6 @@ require "govuk_design_system_formbuilder"
4
4
 
5
5
  module GOVUKDesignSystemFormBuilder
6
6
  module Builder
7
-
8
7
  # Generates a check box within a fieldset to be used as a boolean toggle for a single attribute.
9
8
  # The values are 1 (toggled on), and 0 (toggled off).
10
9
  #
@@ -25,14 +24,15 @@ module GOVUKDesignSystemFormBuilder
25
24
  # @return [ActiveSupport::SafeBuffer] HTML output
26
25
  #
27
26
  # @example A single check box for terms and conditions
28
- # = f.govuk_boolean_checkbox_field :terms_agreed,
27
+ # = f.govuk_check_box_field :terms_agreed,
29
28
  # link_errors: true,
30
29
  # label: { text: 'Do you agree with our terms and conditions?' },
31
30
  # hint: { text: 'You will not be able to proceed unless you do' }
32
31
  #
33
- def govuk_boolean_checkbox_field(attribute_name, small: true, hint: {}, label: {}, link_errors: false, **kwargs, &block)
32
+ def govuk_check_box_field(attribute_name, value = 1, unchecked_value = 0,
33
+ small: false, hint: {}, label: {}, link_errors: false, **kwargs, &block)
34
34
  govuk_check_boxes_fieldset(attribute_name, legend: nil, multiple: false, small: small) do
35
- govuk_check_box(attribute_name, 1, 0,
35
+ govuk_check_box(attribute_name, value, unchecked_value,
36
36
  hint: hint,
37
37
  label: label,
38
38
  link_errors: link_errors,
@@ -53,8 +53,6 @@ end
53
53
 
54
54
  module GOVUKDesignSystemFormBuilder
55
55
  module Builder
56
- delegate :config, to: GOVUKDesignSystemFormBuilder
57
-
58
56
  # Generates a pair of +trix-toolbar+ and +trix-editor+ elements with a label, optional hint. Requires action-text to
59
57
  # be correctly setup in the application
60
58
  #
@@ -1,7 +1,7 @@
1
1
  module Katalyst
2
2
  module GOVUK
3
3
  module Formbuilder
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  require "govuk_design_system_formbuilder"
2
2
  require "govuk_design_system_formbuilder/elements/rich_text_area"
3
- require "govuk_design_system_formbuilder/elements/boolean_checkbox_field"
3
+ require "govuk_design_system_formbuilder/elements/check_box_field"
4
4
 
5
5
  require "katalyst/govuk/formbuilder/engine"
6
6
  require "katalyst/govuk/formbuilder/frontend"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-govuk-formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-28 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder
@@ -38,7 +38,7 @@ files:
38
38
  - app/assets/javascripts/katalyst/govuk/formbuilder.js
39
39
  - app/assets/javascripts/katalyst/govuk/formbuilder.min.js
40
40
  - config/importmap.rb
41
- - lib/govuk_design_system_formbuilder/elements/boolean_checkbox_field.rb
41
+ - lib/govuk_design_system_formbuilder/elements/check_box_field.rb
42
42
  - lib/govuk_design_system_formbuilder/elements/rich_text_area.rb
43
43
  - lib/katalyst/govuk/formbuilder.rb
44
44
  - lib/katalyst/govuk/formbuilder/engine.rb