govuk_design_system_formbuilder 0.7.7 → 0.7.8
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 565cc7ff4c3fb10dc379619a8e38f1f752e3b91c519211755445c6bf35460d33
|
|
4
|
+
data.tar.gz: ed70e2d57585104bc397a61ab41ef784cad77f43629b913aee8c8c9bd0c48e1e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
{
|
|
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
|
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.
|
|
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-
|
|
11
|
+
date: 2019-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|