govuk_design_system_formbuilder 6.2.1 → 6.3.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/README.md +1 -1
- data/lib/govuk_design_system_formbuilder/builder.rb +13 -6
- data/lib/govuk_design_system_formbuilder/containers/form_group.rb +1 -3
- data/lib/govuk_design_system_formbuilder/elements/file.rb +21 -11
- data/lib/govuk_design_system_formbuilder/elements/password.rb +14 -14
- data/lib/govuk_design_system_formbuilder/elements/text_area.rb +23 -19
- data/lib/govuk_design_system_formbuilder/traits/data_attributes_i18n.rb +25 -0
- data/lib/govuk_design_system_formbuilder/version.rb +1 -1
- data/lib/govuk_design_system_formbuilder.rb +114 -6
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dfdf0864ed3515a6d8288ba92293650d4430b91f9cf1e72663d2b813c6576ba6
|
|
4
|
+
data.tar.gz: 640b2dc86d4d105734f069c16c80ed5fc9f777935ff1c2e10333d7c9d9807c57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea11dba93d248dcd5a767fb22def76b7d25d95a117d4091c58a5c6110c761167d38094b4e2a460f88ec98767a9e64948ff65a5d990d2b2d48063d35cc51c7bb5
|
|
7
|
+
data.tar.gz: 32ea4ccb138206c492aa2e484baf58bd7c6be8769cb4dee660126a6a616027540b658812032bd9957bd08fbfb7f955138019f45abad5747ecdf9734866466c39
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://badge.fury.io/rb/govuk_design_system_formbuilder)
|
|
5
5
|
[](https://rubygems.org/gems/govuk_design_system_formbuilder)
|
|
6
6
|

|
|
7
|
-
[](https://design-system.service.gov.uk)
|
|
8
8
|
[](https://weblog.rubyonrails.org/releases/)
|
|
9
9
|
[](https://www.ruby-lang.org/en/downloads/)
|
|
10
10
|
|
|
@@ -329,12 +329,12 @@ module GOVUKDesignSystemFormBuilder
|
|
|
329
329
|
label: {},
|
|
330
330
|
caption: {},
|
|
331
331
|
form_group: {},
|
|
332
|
-
show_password_text:
|
|
333
|
-
hide_password_text:
|
|
334
|
-
show_password_aria_label_text:
|
|
335
|
-
hide_password_aria_label_text:
|
|
336
|
-
password_shown_announcement_text:
|
|
337
|
-
password_hidden_announcement_text:
|
|
332
|
+
show_password_text: nil,
|
|
333
|
+
hide_password_text: nil,
|
|
334
|
+
show_password_aria_label_text: nil,
|
|
335
|
+
hide_password_aria_label_text: nil,
|
|
336
|
+
password_shown_announcement_text: nil,
|
|
337
|
+
password_hidden_announcement_text: nil,
|
|
338
338
|
**kwargs,
|
|
339
339
|
&block
|
|
340
340
|
)
|
|
@@ -1165,6 +1165,9 @@ module GOVUKDesignSystemFormBuilder
|
|
|
1165
1165
|
# @param choose_files_button_text [String] The text of the button that opens the file picker. Default is "Choose file". If javascript is not provided, this option will be ignored.
|
|
1166
1166
|
# @param drop_instruction_text [String] The text informing users they can drop files. Default is "or drop file". If javascript is not provided, this option will be ignored.
|
|
1167
1167
|
# @param multiple_files_chosen_text [Hash] The text displayed when multiple files have been chosen by the user. The component will replace the %{count} placeholder with the number of files selected. This uses the govuk-frontend pluralisation rules. If javascript is not provided, this option will be ignored.
|
|
1168
|
+
# @param multiple_files_chosen_one_text [String] The text displayed when JavaScript is enabled and one file has been chosen by the user. The component will replace the %{count} placeholder with the number of files selected. This can also be set by passing a hash with key +one:+ to +multiple_files_chosen_text+.
|
|
1169
|
+
# @param multiple_files_chosen_other_text [String] The text displayed when JavaScript is enabled and multiple files have been chosen by the user. The component will replace the %{count} placeholder with the number of files selected. This can also be set by passing a hash with key +other:+ to +multiple_files_chosen_text+.
|
|
1170
|
+
|
|
1168
1171
|
# @param no_file_chosen_text [String] The text displayed when no file has been chosen by the user. Default is "No file chosen". If javascript is not provided, this option will be ignored.
|
|
1169
1172
|
# @param entered_drop_zone_text [String] The text announced by assistive technology when user drags files and enters the drop zone. Default is "Entered drop zone". If javascript is not provided, this option will be ignored.
|
|
1170
1173
|
# @param left_drop_zone_text [String] The text announced by assistive technology when user drags files and leaves the drop zone without dropping. Default is "Left drop zone". If javascript is not provided, this option will be ignored.
|
|
@@ -1198,6 +1201,8 @@ module GOVUKDesignSystemFormBuilder
|
|
|
1198
1201
|
choose_files_button_text: nil,
|
|
1199
1202
|
drop_instruction_text: nil,
|
|
1200
1203
|
multiple_files_chosen_text: nil,
|
|
1204
|
+
multiple_files_chosen_one_text: nil,
|
|
1205
|
+
multiple_files_chosen_other_text: nil,
|
|
1201
1206
|
no_file_chosen_text: nil,
|
|
1202
1207
|
entered_drop_zone_text: nil,
|
|
1203
1208
|
left_drop_zone_text: nil,
|
|
@@ -1218,6 +1223,8 @@ module GOVUKDesignSystemFormBuilder
|
|
|
1218
1223
|
choose_files_button_text:,
|
|
1219
1224
|
drop_instruction_text:,
|
|
1220
1225
|
multiple_files_chosen_text:,
|
|
1226
|
+
multiple_files_chosen_one_text:,
|
|
1227
|
+
multiple_files_chosen_other_text:,
|
|
1221
1228
|
no_file_chosen_text:,
|
|
1222
1229
|
entered_drop_zone_text:,
|
|
1223
1230
|
left_drop_zone_text:,
|
|
@@ -4,10 +4,9 @@ module GOVUKDesignSystemFormBuilder
|
|
|
4
4
|
include Traits::HTMLAttributes
|
|
5
5
|
include Traits::HTMLClasses
|
|
6
6
|
|
|
7
|
-
def initialize(builder, object_name, attribute_name,
|
|
7
|
+
def initialize(builder, object_name, attribute_name, **kwargs)
|
|
8
8
|
super(builder, object_name, attribute_name)
|
|
9
9
|
|
|
10
|
-
@options = options
|
|
11
10
|
@html_attributes = kwargs
|
|
12
11
|
end
|
|
13
12
|
|
|
@@ -19,7 +18,6 @@ module GOVUKDesignSystemFormBuilder
|
|
|
19
18
|
|
|
20
19
|
def options
|
|
21
20
|
{
|
|
22
|
-
**@options,
|
|
23
21
|
class: build_classes(
|
|
24
22
|
%(#{brand}-form-group),
|
|
25
23
|
%(#{brand}-form-group--error) => has_errors?
|
|
@@ -10,8 +10,9 @@ module GOVUKDesignSystemFormBuilder
|
|
|
10
10
|
include Traits::HTMLAttributes
|
|
11
11
|
include Traits::HTMLClasses
|
|
12
12
|
include Traits::ContentBeforeAndAfter
|
|
13
|
+
include Traits::DataAttributesI18n
|
|
13
14
|
|
|
14
|
-
def initialize(builder, object_name, attribute_name, hint:, label:, caption:, form_group:, javascript:, before_input:, after_input:, choose_files_button_text:, drop_instruction_text:, multiple_files_chosen_text:, no_file_chosen_text:, entered_drop_zone_text:, left_drop_zone_text:, **kwargs, &block)
|
|
15
|
+
def initialize(builder, object_name, attribute_name, hint:, label:, caption:, form_group:, javascript:, before_input:, after_input:, choose_files_button_text:, drop_instruction_text:, multiple_files_chosen_text:, multiple_files_chosen_one_text:, multiple_files_chosen_other_text:, no_file_chosen_text:, entered_drop_zone_text:, left_drop_zone_text:, **kwargs, &block)
|
|
15
16
|
super(builder, object_name, attribute_name, &block)
|
|
16
17
|
|
|
17
18
|
@label = label
|
|
@@ -26,6 +27,8 @@ module GOVUKDesignSystemFormBuilder
|
|
|
26
27
|
@choose_files_button_text = choose_files_button_text
|
|
27
28
|
@drop_instruction_text = drop_instruction_text
|
|
28
29
|
@multiple_files_chosen_text = multiple_files_chosen_text
|
|
30
|
+
@multiple_files_chosen_one_text = multiple_files_chosen_one_text
|
|
31
|
+
@multiple_files_chosen_other_text = multiple_files_chosen_other_text
|
|
29
32
|
@no_file_chosen_text = no_file_chosen_text
|
|
30
33
|
@entered_drop_zone_text = entered_drop_zone_text
|
|
31
34
|
@left_drop_zone_text = left_drop_zone_text
|
|
@@ -64,21 +67,28 @@ module GOVUKDesignSystemFormBuilder
|
|
|
64
67
|
end
|
|
65
68
|
|
|
66
69
|
def i18n_data
|
|
67
|
-
|
|
68
|
-
"data-i18n.choose-files-button"
|
|
69
|
-
"data-i18n.drop-instruction"
|
|
70
|
-
"data-i18n.no-file-chosen"
|
|
71
|
-
"data-i18n.
|
|
72
|
-
"data-i18n.
|
|
73
|
-
|
|
70
|
+
attrs = [
|
|
71
|
+
I18nAttr.new("data-i18n.choose-files-button", @choose_files_button_text, :default_file_choose_files_button_text),
|
|
72
|
+
I18nAttr.new("data-i18n.drop-instruction", @drop_instruction_text, :default_file_drop_instruction_text),
|
|
73
|
+
I18nAttr.new("data-i18n.no-file-chosen", @no_file_chosen_text, :default_file_no_file_chosen_text),
|
|
74
|
+
I18nAttr.new("data-i18n.multiple-files-chosen.one", @multiple_files_chosen_one_text, :default_file_multiple_files_chosen_one_text),
|
|
75
|
+
I18nAttr.new("data-i18n.multiple-files-chosen.other", @multiple_files_chosen_other_text, :default_file_multiple_files_chosen_other_text),
|
|
76
|
+
I18nAttr.new("data-i18n.entered-drop-zone", @entered_drop_zone_text, :default_file_entered_drop_zone),
|
|
77
|
+
I18nAttr.new("data-i18n.left-drop-zone", @left_drop_zone_text, :default_file_left_drop_zone)
|
|
78
|
+
]
|
|
74
79
|
|
|
80
|
+
# deal with the Nunjucks stlye hash format as an alternative
|
|
75
81
|
if @multiple_files_chosen_text.is_a?(Hash)
|
|
76
|
-
@multiple_files_chosen_text.
|
|
77
|
-
|
|
82
|
+
if (text = @multiple_files_chosen_text.symbolize_keys[:other])
|
|
83
|
+
attrs << I18nAttr.new("data-i18n.multiple-files-chosen.other", text, :default_file_multiple_files_chosen_other_text)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if (text = @multiple_files_chosen_text.symbolize_keys[:one])
|
|
87
|
+
attrs << I18nAttr.new("data-i18n.multiple-files-chosen.one", text, :default_file_multiple_files_chosen_one_text)
|
|
78
88
|
end
|
|
79
89
|
end
|
|
80
90
|
|
|
81
|
-
|
|
91
|
+
build_data_attr_hash(attrs)
|
|
82
92
|
end
|
|
83
93
|
end
|
|
84
94
|
end
|
|
@@ -2,14 +2,14 @@ module GOVUKDesignSystemFormBuilder
|
|
|
2
2
|
module Elements
|
|
3
3
|
class Password < Base
|
|
4
4
|
using PrefixableArray
|
|
5
|
+
using HTMLAttributesUtils
|
|
5
6
|
|
|
6
7
|
include Traits::Error
|
|
7
8
|
include Traits::Hint
|
|
8
9
|
include Traits::Label
|
|
9
10
|
include Traits::HTMLAttributes
|
|
10
11
|
include Traits::HTMLClasses
|
|
11
|
-
|
|
12
|
-
I18nAttr = Struct.new(:key, :text, :default)
|
|
12
|
+
include Traits::DataAttributesI18n
|
|
13
13
|
|
|
14
14
|
def initialize(builder, object_name, attribute_name, label:, caption:, hint:, form_group:, show_password_text:, hide_password_text:, show_password_aria_label_text:, hide_password_aria_label_text:, password_hidden_announcement_text:, password_shown_announcement_text:, **kwargs, &block)
|
|
15
15
|
super(builder, object_name, attribute_name, &block)
|
|
@@ -31,7 +31,7 @@ module GOVUKDesignSystemFormBuilder
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def html
|
|
34
|
-
Containers::FormGroup.new(*bound,
|
|
34
|
+
Containers::FormGroup.new(*bound, **form_group_options).html do
|
|
35
35
|
safe_join([label_element, hint_element, error_element, password_input_and_button])
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -60,7 +60,7 @@ module GOVUKDesignSystemFormBuilder
|
|
|
60
60
|
**i18n_data,
|
|
61
61
|
class: %(#{brand}-password-input),
|
|
62
62
|
data: { module: %(#{brand}-password-input) },
|
|
63
|
-
}
|
|
63
|
+
}.deep_merge_html_attributes(@form_group)
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
def password_input
|
|
@@ -90,16 +90,16 @@ module GOVUKDesignSystemFormBuilder
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def i18n_data
|
|
93
|
-
[
|
|
94
|
-
I18nAttr.new("data-i18n.show-password", @show_password_text,
|
|
95
|
-
I18nAttr.new("data-i18n.hide-password", @hide_password_text,
|
|
96
|
-
I18nAttr.new("data-i18n.show-password-aria-label", @show_password_aria_label_text,
|
|
97
|
-
I18nAttr.new("data-i18n.hide-password-aria-label", @hide_password_aria_label_text,
|
|
98
|
-
I18nAttr.new("data-i18n.password-shown-announcement", @password_shown_announcement_text,
|
|
99
|
-
I18nAttr.new("data-i18n.password-hidden-announcement", @password_hidden_announcement_text,
|
|
100
|
-
]
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
attrs = [
|
|
94
|
+
I18nAttr.new("data-i18n.show-password", @show_password_text, :default_show_password_text),
|
|
95
|
+
I18nAttr.new("data-i18n.hide-password", @hide_password_text, :default_hide_password_text),
|
|
96
|
+
I18nAttr.new("data-i18n.show-password-aria-label", @show_password_aria_label_text, :default_show_password_aria_label_text),
|
|
97
|
+
I18nAttr.new("data-i18n.hide-password-aria-label", @hide_password_aria_label_text, :default_hide_password_aria_label_text),
|
|
98
|
+
I18nAttr.new("data-i18n.password-shown-announcement", @password_shown_announcement_text, :default_password_shown_announcement_text),
|
|
99
|
+
I18nAttr.new("data-i18n.password-hidden-announcement", @password_hidden_announcement_text, :default_password_hidden_announcement_text),
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
build_data_attr_hash(attrs)
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
end
|
|
@@ -9,6 +9,7 @@ module GOVUKDesignSystemFormBuilder
|
|
|
9
9
|
include Traits::Supplemental
|
|
10
10
|
include Traits::HTMLAttributes
|
|
11
11
|
include Traits::HTMLClasses
|
|
12
|
+
include Traits::DataAttributesI18n
|
|
12
13
|
|
|
13
14
|
def initialize(
|
|
14
15
|
builder,
|
|
@@ -138,25 +139,28 @@ module GOVUKDesignSystemFormBuilder
|
|
|
138
139
|
end
|
|
139
140
|
|
|
140
141
|
def i18n_data
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
142
|
+
return {} unless limit_quantity
|
|
143
|
+
|
|
144
|
+
attrs = case limit_type
|
|
145
|
+
when 'characters'
|
|
146
|
+
[
|
|
147
|
+
I18nAttr.new('data-i18n.characters-under-limit.other', @under_limit_other_text, :default_text_area_characters_under_limit_other_text),
|
|
148
|
+
I18nAttr.new('data-i18n.characters-under-limit.one', @under_limit_one_text, :default_text_area_characters_under_limit_one_text),
|
|
149
|
+
I18nAttr.new('data-i18n.characters-at-limit', @at_limit_text, :default_text_area_characters_at_limit_text),
|
|
150
|
+
I18nAttr.new('data-i18n.characters-over-limit.other', @over_limit_other_text, :default_text_area_characters_over_limit_other_text),
|
|
151
|
+
I18nAttr.new('data-i18n.characters-over-limit.one', @over_limit_one_text, :default_text_area_characters_over_limit_one_text),
|
|
152
|
+
]
|
|
153
|
+
when 'words'
|
|
154
|
+
[
|
|
155
|
+
I18nAttr.new('data-i18n.words-under-limit.other', @under_limit_other_text, :default_text_area_words_under_limit_other_text),
|
|
156
|
+
I18nAttr.new('data-i18n.words-under-limit.one', @under_limit_one_text, :default_text_area_words_under_limit_one_text),
|
|
157
|
+
I18nAttr.new('data-i18n.words-at-limit', @at_limit_text, :default_text_area_words_at_limit_text),
|
|
158
|
+
I18nAttr.new('data-i18n.words-over-limit.other', @over_limit_other_text, :default_text_area_words_over_limit_other_text),
|
|
159
|
+
I18nAttr.new('data-i18n.words-over-limit.one', @over_limit_one_text, :default_text_area_words_over_limit_one_text),
|
|
160
|
+
]
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
build_data_attr_hash(attrs)
|
|
160
164
|
end
|
|
161
165
|
end
|
|
162
166
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module GOVUKDesignSystemFormBuilder
|
|
2
|
+
module Traits
|
|
3
|
+
module DataAttributesI18n
|
|
4
|
+
I18nAttr = Struct.new(:data_attribute_key, :text, :config_key) do
|
|
5
|
+
def default
|
|
6
|
+
GOVUKDesignSystemFormBuilder.config[config_key]
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
private
|
|
11
|
+
|
|
12
|
+
def build_data_attr_hash(attrs)
|
|
13
|
+
attrs.each_with_object({}) do |attr, h|
|
|
14
|
+
text = attr.text || attr.default
|
|
15
|
+
|
|
16
|
+
h[attr.data_attribute_key] = text unless govuk_default?(attr.config_key, text)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def govuk_default?(key, value)
|
|
21
|
+
GOVUKDesignSystemFormBuilder::GOVUK_FRONTEND_DEFAULTS.fetch(key) == value
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -17,6 +17,38 @@ module GOVUKDesignSystemFormBuilder
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
GOVUK_FRONTEND_DEFAULTS = {
|
|
21
|
+
# password field
|
|
22
|
+
default_show_password_text: 'Show',
|
|
23
|
+
default_hide_password_text: 'Hide',
|
|
24
|
+
default_show_password_aria_label_text: 'Show password',
|
|
25
|
+
default_hide_password_aria_label_text: 'Hide password',
|
|
26
|
+
default_password_shown_announcement_text: 'Your password is visible',
|
|
27
|
+
default_password_hidden_announcement_text: 'Your password is hidden',
|
|
28
|
+
|
|
29
|
+
# text area (character count)
|
|
30
|
+
default_text_area_description_text: nil,
|
|
31
|
+
default_text_area_words_under_limit_other_text: 'You have %{count} words remaining',
|
|
32
|
+
default_text_area_words_under_limit_one_text: 'You have %{count} word remaining',
|
|
33
|
+
default_text_area_words_at_limit_text: 'You have 0 words remaining',
|
|
34
|
+
default_text_area_words_over_limit_other_text: 'You have %{count} words too many',
|
|
35
|
+
default_text_area_words_over_limit_one_text: 'You have %{count} word too many',
|
|
36
|
+
default_text_area_characters_under_limit_other_text: 'You have %{count} characters remaining',
|
|
37
|
+
default_text_area_characters_under_limit_one_text: 'You have %{count} character remaining',
|
|
38
|
+
default_text_area_characters_at_limit_text: 'You have 0 characters remaining',
|
|
39
|
+
default_text_area_characters_over_limit_other_text: 'You have %{count} characters too many',
|
|
40
|
+
default_text_area_characters_over_limit_one_text: 'You have %{count} character too many',
|
|
41
|
+
|
|
42
|
+
# file upload
|
|
43
|
+
default_file_choose_files_button_text: 'Choose file',
|
|
44
|
+
default_file_drop_instruction_text: 'or drop file',
|
|
45
|
+
default_file_no_file_chosen_text: 'No file chosen',
|
|
46
|
+
default_file_multiple_files_chosen_one_text: 'One file chosen',
|
|
47
|
+
default_file_multiple_files_chosen_other_text: '%{count} files chosen',
|
|
48
|
+
default_file_entered_drop_zone: 'Entered drop zone',
|
|
49
|
+
default_file_left_drop_zone: 'Left drop zone',
|
|
50
|
+
}.freeze
|
|
51
|
+
|
|
20
52
|
# @!group Defaults
|
|
21
53
|
|
|
22
54
|
# Default form builder configuration
|
|
@@ -82,6 +114,86 @@ module GOVUKDesignSystemFormBuilder
|
|
|
82
114
|
# When nil, no data attribute will be added. Defaults to turbo since Rails 7,
|
|
83
115
|
# change to 'turbolinks' for Rails 6.1
|
|
84
116
|
#
|
|
117
|
+
# * +:default_text_area_description_text+ sets the text that's displayed beneath
|
|
118
|
+
# the text area when word counts are enabled. Defaults to nil
|
|
119
|
+
#
|
|
120
|
+
# * +:default_text_area_words_under_limit_other_text+ sets the text displayed when the
|
|
121
|
+
# user is approaching the limit of words. Defaults to "You have %{count} words remaining"
|
|
122
|
+
#
|
|
123
|
+
# * +:default_text_area_words_under_limit_one_text+ sets the text that's displayed when the
|
|
124
|
+
# user is 1 word below the limit. Defaults to "You have %{count} word remaining"
|
|
125
|
+
#
|
|
126
|
+
# * +:default_text_area_words_at_limit_text+ sets the text that's displayed when the user
|
|
127
|
+
# has reached the limit. Defaults to "You have 0 words remaining"
|
|
128
|
+
#
|
|
129
|
+
# * +:default_text_area_words_over_limit_other_text+ sets the text displayed when the
|
|
130
|
+
# user is more than 1 word above the limit. Defaults to "You have %{count}
|
|
131
|
+
# words too many"
|
|
132
|
+
#
|
|
133
|
+
# * +:default_text_area_words_over_limit_one_text+ sets the text that's displayed when the
|
|
134
|
+
# user is 1 word above the limit. Defaults to "You have %{count} word too many"
|
|
135
|
+
#
|
|
136
|
+
# * +:default_text_area_characters_under_limit_other_text+ sets the text displayed when the
|
|
137
|
+
# user is approaching the limit of characters. Defaults to "You have %{count} characters
|
|
138
|
+
# remaining"
|
|
139
|
+
#
|
|
140
|
+
# * +:default_text_area_characters_under_limit_one_text+ sets the text that's displayed when the
|
|
141
|
+
# user is 1 character below the limit. Defaults to "You have %{count} character remaining"
|
|
142
|
+
#
|
|
143
|
+
# * +:default_text_area_characters_at_limit_text+ sets the text that's displayed when the user
|
|
144
|
+
# has reached the limit. Defaults to "You have 0 characters remaining"
|
|
145
|
+
#
|
|
146
|
+
# * +:default_text_area_characters_over_limit_other_text+ sets the text displayed when the
|
|
147
|
+
# user is more than 1 character above the limit. Defaults to "You have %{count}
|
|
148
|
+
# characters too many"
|
|
149
|
+
#
|
|
150
|
+
# * +:default_text_area_characters_over_limit_one_text+ sets the text that's displayed when the
|
|
151
|
+
# user is 1 character above the limit. Defaults to "You have %{count} character too many"
|
|
152
|
+
#
|
|
153
|
+
# * +:default_show_password_text+ Button text when the password is hidden. Defaults to 'Show'
|
|
154
|
+
#
|
|
155
|
+
# * +:default_hide_password_text+ Button text when the password is revealed. Defaults to 'Hide'
|
|
156
|
+
#
|
|
157
|
+
# * +:default_show_password_aria_label_text+ Button text exposed to assistive technologies like
|
|
158
|
+
# screen readers, when the password is hidden. Defaults to "Show password"
|
|
159
|
+
#
|
|
160
|
+
# * +:default_hide_password_aria_label_text+ Button text exposed to assistive technologies like
|
|
161
|
+
# screen readers, when the password is visible. Defaults to "Hide password".
|
|
162
|
+
#
|
|
163
|
+
# * +:default_password_shown_announcement_text+ Announcement made to screen reader users when
|
|
164
|
+
# their password has become visible in plain text. Defaults to "Your password is visible"
|
|
165
|
+
#
|
|
166
|
+
# * +:default_password_hidden_announcement_text+ Announcement made to screen reader users when
|
|
167
|
+
# their password has been obscured and is not visible. Defaults to "Your password is hidden"
|
|
168
|
+
#
|
|
169
|
+
# * +:default_file_choose_files_button_text+ The text of the button that opens the file picker.
|
|
170
|
+
# Default is "Choose file". If javascript is not provided, this option will be ignored
|
|
171
|
+
#
|
|
172
|
+
# * +:default_file_drop_instruction_text+ The text informing users they can drop files.
|
|
173
|
+
# Default is "or drop file". If javascript is not provided, this option will be ignore
|
|
174
|
+
#
|
|
175
|
+
# * +:default_file_no_file_chosen_text+ The text displayed when no file has been chosen by
|
|
176
|
+
# the user. Default is "No file chosen". If javascript is not provided, this option will be
|
|
177
|
+
# ignored
|
|
178
|
+
#
|
|
179
|
+
# * +:default_file_multiple_files_chosen_one_text+ The text displayed when multiple files are
|
|
180
|
+
# enabled and one file has been chosen by the user. The component will replace the %{count}
|
|
181
|
+
# placeholder with the number of files selected. If javascript is not provided, this option
|
|
182
|
+
# will be ignored. Defaults to 'One file chosen'
|
|
183
|
+
#
|
|
184
|
+
# * +:default_file_multiple_files_chosen_other_text+ The text displayed when multiple files are
|
|
185
|
+
# enabled and multiple files have been chosen by the user. The component will replace the %{count}
|
|
186
|
+
# placeholder with the number of files selected. If javascript is not provided, this option
|
|
187
|
+
# will be ignored. Defaults to '%{count} files chosen'
|
|
188
|
+
#
|
|
189
|
+
# * +:default_file_entered_drop_zone+ The text announced by assistive technology when user drags
|
|
190
|
+
# files and enters the drop zone. Default is "Entered drop zone". If javascript is not provided,
|
|
191
|
+
# this option will be ignored
|
|
192
|
+
#
|
|
193
|
+
# * +:default_file_left_drop_zone+ The text announced by assistive technology when user drags
|
|
194
|
+
# files and leaves the drop zone without dropping. Default is "Left drop zone". If javascript
|
|
195
|
+
# is not provided, this option will be ignored.
|
|
196
|
+
#
|
|
85
197
|
# * +:localisation_schema_fallback+ sets the prefix elements for the array
|
|
86
198
|
# used to build the localisation string. The final two elements are always
|
|
87
199
|
# are the object name and attribute name. The _special_ value +__context__+,
|
|
@@ -124,12 +236,6 @@ module GOVUKDesignSystemFormBuilder
|
|
|
124
236
|
default_collection_radio_buttons_include_hidden: true,
|
|
125
237
|
default_collection_radio_buttons_auto_bold_labels: true,
|
|
126
238
|
default_submit_validate: false,
|
|
127
|
-
default_show_password_text: "Show",
|
|
128
|
-
default_hide_password_text: "Hide",
|
|
129
|
-
default_show_password_aria_label_text: "Show password",
|
|
130
|
-
default_hide_password_aria_label_text: "Hide password",
|
|
131
|
-
default_password_shown_announcement_text: "Your password is visible",
|
|
132
|
-
default_password_hidden_announcement_text: "Your password is hidden",
|
|
133
239
|
localisation_schema_fallback: %i(helpers __context__),
|
|
134
240
|
localisation_schema_label: nil,
|
|
135
241
|
localisation_schema_hint: nil,
|
|
@@ -142,6 +248,8 @@ module GOVUKDesignSystemFormBuilder
|
|
|
142
248
|
# temporarily allow the new nested localisation functionality to be
|
|
143
249
|
# disabled
|
|
144
250
|
enable_nested_localisation: true,
|
|
251
|
+
|
|
252
|
+
**GOVUK_FRONTEND_DEFAULTS
|
|
145
253
|
}.freeze
|
|
146
254
|
|
|
147
255
|
DEFAULTS.each do |key, value|
|
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: 6.
|
|
4
|
+
version: 6.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Yates
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: html-attributes-utils
|
|
@@ -344,6 +344,7 @@ files:
|
|
|
344
344
|
- lib/govuk_design_system_formbuilder/traits/caption.rb
|
|
345
345
|
- lib/govuk_design_system_formbuilder/traits/collection_item.rb
|
|
346
346
|
- lib/govuk_design_system_formbuilder/traits/content_before_and_after.rb
|
|
347
|
+
- lib/govuk_design_system_formbuilder/traits/data_attributes_i18n.rb
|
|
347
348
|
- lib/govuk_design_system_formbuilder/traits/date_input.rb
|
|
348
349
|
- lib/govuk_design_system_formbuilder/traits/error.rb
|
|
349
350
|
- lib/govuk_design_system_formbuilder/traits/fieldset_item.rb
|
|
@@ -374,7 +375,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
374
375
|
requirements:
|
|
375
376
|
- - ">="
|
|
376
377
|
- !ruby/object:Gem::Version
|
|
377
|
-
version: '
|
|
378
|
+
version: '3.3'
|
|
378
379
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
379
380
|
requirements:
|
|
380
381
|
- - ">="
|
|
@@ -384,5 +385,5 @@ requirements: []
|
|
|
384
385
|
rubygems_version: 3.5.22
|
|
385
386
|
signing_key:
|
|
386
387
|
specification_version: 4
|
|
387
|
-
summary: GOV.UK Form Builder for
|
|
388
|
+
summary: GOV.UK Form Builder for Ruby on Rails
|
|
388
389
|
test_files: []
|