govuk_design_system_formbuilder 0.7.7 → 0.7.8

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: e6685d3566f5cb5c92a953b68294c59d35470853cd3802d0671f893df5b4e8dd
4
- data.tar.gz: d598a5153f570008c05562511ca3e164a93aa151050663a1f30b2434c3869661
3
+ metadata.gz: 565cc7ff4c3fb10dc379619a8e38f1f752e3b91c519211755445c6bf35460d33
4
+ data.tar.gz: ed70e2d57585104bc397a61ab41ef784cad77f43629b913aee8c8c9bd0c48e1e
5
5
  SHA512:
6
- metadata.gz: d6cda652f21dfc6f7a654943d80ce8830c2aa6d0ccab953925eb656d3a8e2b0a3177fa876031910cfef8d59733859cc7b8902442c734d354b66b4d4c10f6fa20
7
- data.tar.gz: f8f65e2eae38bd02a1b58d675b966abe4849489d09e73b320cc3a21e5f13a81c2694bfbde7bb641b2019e333857aebf723ccd215fb135551442b48c0889d5667
6
+ metadata.gz: '08b4fea1733ea6f2fdfc21c20cf440329853c9f7fc417b22fd57581cfb810b55a4c5598061a2188315efb9360e365fb1002bfd9da6c9e8c3540e2c90decf611c'
7
+ data.tar.gz: 8f4edf90bb37402b2d26ac0a47e8983227ccde0130a5cd23b0f19faa620a9b1ab6eed8b6f7f5231604797e402ac74f36008cd0e2c3c9e26de47014757ddbd4b8
@@ -208,8 +208,6 @@ module GOVUKDesignSystemFormBuilder
208
208
  # @option legend text [String] the fieldset legend's text content
209
209
  # @option legend size [String] the size of the fieldset legend font, can be +xl+, +l+, +m+ or +s+
210
210
  # @option legend tag [Symbol,String] the tag used for the fieldset's header, defaults to +h1+, defaults to +h1+
211
- # @param block [Block] any HTML passed in is inserted inside the fieldset container,
212
- # between the error and the radios container element
213
211
  # @return [ActiveSupport::SafeBuffer] HTML output
214
212
  #
215
213
  # @example A collection of radio buttons for favourite colours
@@ -263,8 +261,6 @@ module GOVUKDesignSystemFormBuilder
263
261
  # @option legend text [String] the fieldset legend's text content
264
262
  # @option legend size [String] the size of the fieldset legend font, can be +xl+, +l+, +m+ or +s+
265
263
  # @option legend tag [Symbol,String] the tag used for the fieldset's header, defaults to +h1+
266
- # @param block [Block] any HTML passed in will be injected into the fieldset
267
- # element and should contain radio buttons and optionally a divider
268
264
  # @see https://design-system.service.gov.uk/components/radios/ GOV.UK Radios
269
265
  # @return [ActiveSupport::SafeBuffer] HTML output
270
266
  #
@@ -400,8 +396,8 @@ module GOVUKDesignSystemFormBuilder
400
396
  # = f.govuk_submit "Proceed", prevent_double_click: true do
401
397
  # = link_to 'Cancel', some_other_path, class: 'govuk-button__secondary'
402
398
  #
403
- def govuk_submit(text = 'Continue', warning: false, secondary: false, prevent_double_click: true, &block)
404
- Elements::Submit.new(self, text, warning: warning, secondary: secondary, prevent_double_click: prevent_double_click, &block).html
399
+ def govuk_submit(text = 'Continue', warning: false, secondary: false, prevent_double_click: true, validate: false, &block)
400
+ Elements::Submit.new(self, text, warning: warning, secondary: secondary, prevent_double_click: prevent_double_click, validate: validate, &block).html
405
401
  end
406
402
 
407
403
  # Generates three inputs for the +day+, +month+ and +year+ components of a date
@@ -1,7 +1,7 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
2
  module Elements
3
3
  class Submit < GOVUKDesignSystemFormBuilder::Base
4
- def initialize(builder, text, warning:, secondary:, prevent_double_click:, &block)
4
+ def initialize(builder, text, warning:, secondary:, prevent_double_click:, validate:, &block)
5
5
  fail ArgumentError, 'buttons can be warning or secondary' if warning && secondary
6
6
 
7
7
  @builder = builder
@@ -9,6 +9,7 @@ module GOVUKDesignSystemFormBuilder
9
9
  @prevent_double_click = prevent_double_click
10
10
  @warning = warning
11
11
  @secondary = secondary
12
+ @validate = validate
12
13
  @block_content = @builder.capture { block.call } if block_given?
13
14
  end
14
15
 
@@ -35,7 +36,10 @@ module GOVUKDesignSystemFormBuilder
35
36
  end
36
37
 
37
38
  def extra_args
38
- { data: { 'prevent-double-click' => (@prevent_double_click || nil) }.compact }
39
+ {}.tap do |ea|
40
+ ea[:data] = { 'prevent-double-click' => @prevent_double_click } if @prevent_double_click
41
+ ea[:novalidate] = !@validate
42
+ end
39
43
  end
40
44
  end
41
45
  end
@@ -1,3 +1,3 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
- VERSION = '0.7.7'.freeze
2
+ VERSION = '0.7.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_design_system_formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Yates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-06 00:00:00.000000000 Z
11
+ date: 2019-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails