govuk_publishing_components 23.0.0 → 23.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +56 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +9 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +0 -46
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +4 -0
- data/app/views/govuk_publishing_components/components/_input.html.erb +6 -6
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +18 -11
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +14 -0
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +31 -37
- data/node_modules/govuk-frontend/govuk/components/accordion/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +235 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +56 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +172 -0
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -3
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +275 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +170 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1015 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +499 -0
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +83 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +66 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +181 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +93 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +5 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +151 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +482 -0
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +2 -5
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +360 -0
- data/node_modules/govuk-frontend/govuk/components/header/header.js +665 -316
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +13 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -5
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +50 -0
- data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +91 -0
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +538 -0
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +64 -0
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +17 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +49 -0
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +75 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +6 -2
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +74 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +65 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1066 -0
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +248 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +72 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +2 -10
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +991 -0
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +468 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +3 -6
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +229 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +117 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +199 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +68 -0
- data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +3 -3
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +9 -11
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -3
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -5
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +2 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +7 -6
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -1
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +2 -3
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -1
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +1 -1
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +1 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -3
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +9 -2
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -1
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -4
- data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +2 -2
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +11 -5
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +6 -2
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -1
- data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -4
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +32 -3
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js.erb +0 -50
@@ -0,0 +1,499 @@
|
|
1
|
+
{
|
2
|
+
"component": "date-input",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "default",
|
6
|
+
"options": {
|
7
|
+
"id": "dob"
|
8
|
+
},
|
9
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\" id=\"dob\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"name": "complete question",
|
13
|
+
"options": {
|
14
|
+
"id": "dob",
|
15
|
+
"namePrefix": "dob",
|
16
|
+
"fieldset": {
|
17
|
+
"legend": {
|
18
|
+
"text": "What is your date of birth?"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"hint": {
|
22
|
+
"text": "For example, 31 3 1980"
|
23
|
+
},
|
24
|
+
"items": [
|
25
|
+
{
|
26
|
+
"name": "day",
|
27
|
+
"classes": "govuk-input--width-2"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"name": "month",
|
31
|
+
"classes": "govuk-input--width-2"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"name": "year",
|
35
|
+
"classes": "govuk-input--width-4"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
},
|
39
|
+
"html": "<div class=\"govuk-form-group\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-hint\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n <div class=\"govuk-date-input\" id=\"dob\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-day\" name=\"dob-day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-month\" name=\"dob-month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-year\" name=\"dob-year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"name": "with errors only",
|
43
|
+
"options": {
|
44
|
+
"id": "dob-errors",
|
45
|
+
"fieldset": {
|
46
|
+
"legend": {
|
47
|
+
"text": "What is your date of birth?"
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"errorMessage": {
|
51
|
+
"text": "Error message goes here"
|
52
|
+
},
|
53
|
+
"items": [
|
54
|
+
{
|
55
|
+
"name": "day",
|
56
|
+
"classes": "govuk-input--width-2 govuk-input--error"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"name": "month",
|
60
|
+
"classes": "govuk-input--width-2 govuk-input--error"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"name": "year",
|
64
|
+
"classes": "govuk-input--width-4 govuk-input--error"
|
65
|
+
}
|
66
|
+
]
|
67
|
+
},
|
68
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-errors-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <span id=\"dob-errors-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n\n <div class=\"govuk-date-input\" id=\"dob-errors\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--error\" id=\"dob-errors-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--error\" id=\"dob-errors-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--error\" id=\"dob-errors-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"name": "with errors and hint",
|
72
|
+
"options": {
|
73
|
+
"id": "dob-errors",
|
74
|
+
"fieldset": {
|
75
|
+
"legend": {
|
76
|
+
"text": "What is your date of birth?"
|
77
|
+
}
|
78
|
+
},
|
79
|
+
"hint": {
|
80
|
+
"text": "For example, 31 3 1980"
|
81
|
+
},
|
82
|
+
"errorMessage": {
|
83
|
+
"text": "Error message goes here"
|
84
|
+
},
|
85
|
+
"items": [
|
86
|
+
{
|
87
|
+
"name": "day",
|
88
|
+
"classes": "govuk-input--width-2 govuk-input--error"
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"name": "month",
|
92
|
+
"classes": "govuk-input--width-2 govuk-input--error"
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"name": "year",
|
96
|
+
"classes": "govuk-input--width-4 govuk-input--error"
|
97
|
+
}
|
98
|
+
]
|
99
|
+
},
|
100
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-errors-hint dob-errors-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-errors-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n \n \n <span id=\"dob-errors-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n\n <div class=\"govuk-date-input\" id=\"dob-errors\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--error\" id=\"dob-errors-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--error\" id=\"dob-errors-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--error\" id=\"dob-errors-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"name": "with error on day input",
|
104
|
+
"options": {
|
105
|
+
"id": "dob-day-error",
|
106
|
+
"namePrefix": "dob-day-error",
|
107
|
+
"fieldset": {
|
108
|
+
"legend": {
|
109
|
+
"text": "What is your date of birth?"
|
110
|
+
}
|
111
|
+
},
|
112
|
+
"hint": {
|
113
|
+
"text": "For example, 31 3 1980"
|
114
|
+
},
|
115
|
+
"errorMessage": {
|
116
|
+
"text": "Error message goes here"
|
117
|
+
},
|
118
|
+
"items": [
|
119
|
+
{
|
120
|
+
"name": "day",
|
121
|
+
"classes": "govuk-input--width-2 govuk-input--error"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"name": "month",
|
125
|
+
"classes": "govuk-input--width-2"
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"name": "year",
|
129
|
+
"classes": "govuk-input--width-4"
|
130
|
+
}
|
131
|
+
]
|
132
|
+
},
|
133
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-day-error-hint dob-day-error-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-day-error-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n \n \n <span id=\"dob-day-error-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n\n <div class=\"govuk-date-input\" id=\"dob-day-error\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-day-error-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--error\" id=\"dob-day-error-day\" name=\"dob-day-error-day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-day-error-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-day-error-month\" name=\"dob-day-error-month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-day-error-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-day-error-year\" name=\"dob-day-error-year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"name": "with error on month input",
|
137
|
+
"options": {
|
138
|
+
"id": "dob-month-error",
|
139
|
+
"namePrefix": "dob-month-error",
|
140
|
+
"fieldset": {
|
141
|
+
"legend": {
|
142
|
+
"text": "What is your date of birth?"
|
143
|
+
}
|
144
|
+
},
|
145
|
+
"hint": {
|
146
|
+
"text": "For example, 31 3 1980"
|
147
|
+
},
|
148
|
+
"errorMessage": {
|
149
|
+
"text": "Error message goes here"
|
150
|
+
},
|
151
|
+
"items": [
|
152
|
+
{
|
153
|
+
"name": "day",
|
154
|
+
"classes": "govuk-input--width-2"
|
155
|
+
},
|
156
|
+
{
|
157
|
+
"name": "month",
|
158
|
+
"classes": "govuk-input--width-2 govuk-input--error"
|
159
|
+
},
|
160
|
+
{
|
161
|
+
"name": "year",
|
162
|
+
"classes": "govuk-input--width-4"
|
163
|
+
}
|
164
|
+
]
|
165
|
+
},
|
166
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-month-error-hint dob-month-error-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-month-error-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n \n \n <span id=\"dob-month-error-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n\n <div class=\"govuk-date-input\" id=\"dob-month-error\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-month-error-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-month-error-day\" name=\"dob-month-error-day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-month-error-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--error\" id=\"dob-month-error-month\" name=\"dob-month-error-month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-month-error-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-month-error-year\" name=\"dob-month-error-year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
167
|
+
},
|
168
|
+
{
|
169
|
+
"name": "with error on year input",
|
170
|
+
"options": {
|
171
|
+
"id": "dob-year-error",
|
172
|
+
"namePrefix": "dob-year-error",
|
173
|
+
"fieldset": {
|
174
|
+
"legend": {
|
175
|
+
"text": "What is your date of birth?"
|
176
|
+
}
|
177
|
+
},
|
178
|
+
"hint": {
|
179
|
+
"text": "For example, 31 3 1980"
|
180
|
+
},
|
181
|
+
"errorMessage": {
|
182
|
+
"text": "Error message goes here"
|
183
|
+
},
|
184
|
+
"items": [
|
185
|
+
{
|
186
|
+
"name": "day",
|
187
|
+
"classes": "govuk-input--width-2"
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"name": "month",
|
191
|
+
"classes": "govuk-input--width-2"
|
192
|
+
},
|
193
|
+
{
|
194
|
+
"name": "year",
|
195
|
+
"classes": "govuk-input--width-4 govuk-input--error"
|
196
|
+
}
|
197
|
+
]
|
198
|
+
},
|
199
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-year-error-hint dob-year-error-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-year-error-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n \n \n <span id=\"dob-year-error-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n\n <div class=\"govuk-date-input\" id=\"dob-year-error\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-year-error-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-year-error-day\" name=\"dob-year-error-day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-year-error-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-year-error-month\" name=\"dob-year-error-month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-year-error-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--error\" id=\"dob-year-error-year\" name=\"dob-year-error-year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
200
|
+
},
|
201
|
+
{
|
202
|
+
"name": "with default items",
|
203
|
+
"options": {
|
204
|
+
"id": "dob",
|
205
|
+
"namePrefix": "dob",
|
206
|
+
"fieldset": {
|
207
|
+
"legend": {
|
208
|
+
"text": "What is your date of birth?"
|
209
|
+
}
|
210
|
+
},
|
211
|
+
"hint": {
|
212
|
+
"text": "For example, 31 3 1980"
|
213
|
+
}
|
214
|
+
},
|
215
|
+
"html": "<div class=\"govuk-form-group\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-hint\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n <div class=\"govuk-date-input\" id=\"dob\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-day\" name=\"dob-day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-month\" name=\"dob-month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-year\" name=\"dob-year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
216
|
+
},
|
217
|
+
{
|
218
|
+
"name": "with optional form-group classes",
|
219
|
+
"options": {
|
220
|
+
"id": "dob",
|
221
|
+
"namePrefix": "dob",
|
222
|
+
"fieldset": {
|
223
|
+
"legend": {
|
224
|
+
"text": "What is your date of birth?"
|
225
|
+
}
|
226
|
+
},
|
227
|
+
"hint": {
|
228
|
+
"text": "For example, 31 3 1980"
|
229
|
+
},
|
230
|
+
"formGroup": {
|
231
|
+
"classes": "extra-class"
|
232
|
+
}
|
233
|
+
},
|
234
|
+
"html": "<div class=\"govuk-form-group extra-class\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-hint\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n <div class=\"govuk-date-input\" id=\"dob\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-day\" name=\"dob-day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-month\" name=\"dob-month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-year\" name=\"dob-year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
235
|
+
},
|
236
|
+
{
|
237
|
+
"name": "with autocomplete values",
|
238
|
+
"options": {
|
239
|
+
"id": "dob-with-autocomplete-attribute",
|
240
|
+
"namePrefix": "dob-with-autocomplete",
|
241
|
+
"fieldset": {
|
242
|
+
"legend": {
|
243
|
+
"text": "What is your date of birth?"
|
244
|
+
}
|
245
|
+
},
|
246
|
+
"hint": {
|
247
|
+
"text": "For example, 31 3 1980"
|
248
|
+
},
|
249
|
+
"items": [
|
250
|
+
{
|
251
|
+
"name": "day",
|
252
|
+
"classes": "govuk-input--width-2",
|
253
|
+
"autocomplete": "bday-day"
|
254
|
+
},
|
255
|
+
{
|
256
|
+
"name": "month",
|
257
|
+
"classes": "govuk-input--width-2",
|
258
|
+
"autocomplete": "bday-month"
|
259
|
+
},
|
260
|
+
{
|
261
|
+
"name": "year",
|
262
|
+
"classes": "govuk-input--width-4",
|
263
|
+
"autocomplete": "bday-year"
|
264
|
+
}
|
265
|
+
]
|
266
|
+
},
|
267
|
+
"html": "<div class=\"govuk-form-group\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-with-autocomplete-attribute-hint\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-with-autocomplete-attribute-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n <div class=\"govuk-date-input\" id=\"dob-with-autocomplete-attribute\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-with-autocomplete-attribute-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-with-autocomplete-attribute-day\" name=\"dob-with-autocomplete-day\" type=\"text\" autocomplete=\"bday-day\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-with-autocomplete-attribute-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-with-autocomplete-attribute-month\" name=\"dob-with-autocomplete-month\" type=\"text\" autocomplete=\"bday-month\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-with-autocomplete-attribute-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-with-autocomplete-attribute-year\" name=\"dob-with-autocomplete-year\" type=\"text\" autocomplete=\"bday-year\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
268
|
+
},
|
269
|
+
{
|
270
|
+
"name": "with input attributes",
|
271
|
+
"options": {
|
272
|
+
"id": "dob-with-input-attributes",
|
273
|
+
"namePrefix": "dob-with-input-attributes",
|
274
|
+
"fieldset": {
|
275
|
+
"legend": {
|
276
|
+
"text": "What is your date of birth?"
|
277
|
+
}
|
278
|
+
},
|
279
|
+
"hint": {
|
280
|
+
"text": "For example, 31 3 1980"
|
281
|
+
},
|
282
|
+
"items": [
|
283
|
+
{
|
284
|
+
"name": "day",
|
285
|
+
"classes": "govuk-input--width-2",
|
286
|
+
"attributes": {
|
287
|
+
"data-example-day": "day"
|
288
|
+
}
|
289
|
+
},
|
290
|
+
{
|
291
|
+
"name": "month",
|
292
|
+
"classes": "govuk-input--width-2",
|
293
|
+
"attributes": {
|
294
|
+
"data-example-month": "month"
|
295
|
+
}
|
296
|
+
},
|
297
|
+
{
|
298
|
+
"name": "year",
|
299
|
+
"classes": "govuk-input--width-4",
|
300
|
+
"attributes": {
|
301
|
+
"data-example-year": "year"
|
302
|
+
}
|
303
|
+
}
|
304
|
+
]
|
305
|
+
},
|
306
|
+
"html": "<div class=\"govuk-form-group\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"dob-with-input-attributes-hint\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-with-input-attributes-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n <div class=\"govuk-date-input\" id=\"dob-with-input-attributes\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-with-input-attributes-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-with-input-attributes-day\" name=\"dob-with-input-attributes-day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\" data-example-day=\"day\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-with-input-attributes-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-with-input-attributes-month\" name=\"dob-with-input-attributes-month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\" data-example-month=\"month\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-with-input-attributes-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-with-input-attributes-year\" name=\"dob-with-input-attributes-year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\" data-example-year=\"year\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
307
|
+
},
|
308
|
+
{
|
309
|
+
"name": "no data",
|
310
|
+
"options": {},
|
311
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"undefined-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
312
|
+
},
|
313
|
+
{
|
314
|
+
"name": "classes",
|
315
|
+
"options": {
|
316
|
+
"classes": "app-date-input--custom-modifier"
|
317
|
+
},
|
318
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input app-date-input--custom-modifier\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"undefined-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
319
|
+
},
|
320
|
+
{
|
321
|
+
"name": "attributes",
|
322
|
+
"options": {
|
323
|
+
"attributes": {
|
324
|
+
"data-attribute": "my data value"
|
325
|
+
}
|
326
|
+
},
|
327
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\" data-attribute=\"my data value\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"undefined-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
328
|
+
},
|
329
|
+
{
|
330
|
+
"name": "with empty items",
|
331
|
+
"options": {
|
332
|
+
"items": []
|
333
|
+
},
|
334
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"undefined-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
335
|
+
},
|
336
|
+
{
|
337
|
+
"name": "custom pattern",
|
338
|
+
"options": {
|
339
|
+
"items": [
|
340
|
+
{
|
341
|
+
"name": "day",
|
342
|
+
"pattern": "[0-8]*"
|
343
|
+
}
|
344
|
+
]
|
345
|
+
},
|
346
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-8]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
347
|
+
},
|
348
|
+
{
|
349
|
+
"name": "with nested name",
|
350
|
+
"options": {
|
351
|
+
"items": [
|
352
|
+
{
|
353
|
+
"name": "day[dd]"
|
354
|
+
},
|
355
|
+
{
|
356
|
+
"name": "month[mm]"
|
357
|
+
},
|
358
|
+
{
|
359
|
+
"name": "year[yyyy]"
|
360
|
+
}
|
361
|
+
]
|
362
|
+
},
|
363
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day[dd]\">\n Day[dd]\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-day[dd]\" name=\"day[dd]\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month[mm]\">\n Month[mm]\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-month[mm]\" name=\"month[mm]\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year[yyyy]\">\n Year[yyyy]\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-year[yyyy]\" name=\"year[yyyy]\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
364
|
+
},
|
365
|
+
{
|
366
|
+
"name": "with id on items",
|
367
|
+
"options": {
|
368
|
+
"items": [
|
369
|
+
{
|
370
|
+
"id": "day"
|
371
|
+
},
|
372
|
+
{
|
373
|
+
"id": "month"
|
374
|
+
},
|
375
|
+
{
|
376
|
+
"year": "year"
|
377
|
+
}
|
378
|
+
]
|
379
|
+
},
|
380
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n \n \n <input class=\"govuk-input govuk-date-input__input \" id=\"day\" name=\"\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n \n \n <input class=\"govuk-input govuk-date-input__input \" id=\"month\" name=\"\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n \n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-undefined\" name=\"\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
381
|
+
},
|
382
|
+
{
|
383
|
+
"name": "suffixed id",
|
384
|
+
"options": {
|
385
|
+
"id": "my-date-input",
|
386
|
+
"items": [
|
387
|
+
{
|
388
|
+
"name": "day"
|
389
|
+
},
|
390
|
+
{
|
391
|
+
"name": "month"
|
392
|
+
},
|
393
|
+
{
|
394
|
+
"name": "year"
|
395
|
+
}
|
396
|
+
]
|
397
|
+
},
|
398
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\" id=\"my-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"my-date-input-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"my-date-input-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"my-date-input-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"my-date-input-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"my-date-input-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"my-date-input-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"name": "with values",
|
402
|
+
"options": {
|
403
|
+
"items": [
|
404
|
+
{
|
405
|
+
"id": "day"
|
406
|
+
},
|
407
|
+
{
|
408
|
+
"id": "month"
|
409
|
+
},
|
410
|
+
{
|
411
|
+
"id": "year",
|
412
|
+
"value": 2018
|
413
|
+
}
|
414
|
+
]
|
415
|
+
},
|
416
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n \n \n <input class=\"govuk-input govuk-date-input__input \" id=\"day\" name=\"\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n \n \n <input class=\"govuk-input govuk-date-input__input \" id=\"month\" name=\"\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n \n \n <input class=\"govuk-input govuk-date-input__input \" id=\"year\" name=\"\" type=\"text\" value=\"2018\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
417
|
+
},
|
418
|
+
{
|
419
|
+
"name": "with hint and describedBy",
|
420
|
+
"options": {
|
421
|
+
"id": "dob-errors",
|
422
|
+
"fieldset": {
|
423
|
+
"describedBy": "some-id",
|
424
|
+
"legend": {
|
425
|
+
"text": "What is your date of birth?"
|
426
|
+
}
|
427
|
+
},
|
428
|
+
"hint": {
|
429
|
+
"text": "For example, 31 3 1980"
|
430
|
+
}
|
431
|
+
},
|
432
|
+
"html": "<div class=\"govuk-form-group\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"some-id dob-errors-hint\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <div id=\"dob-errors-hint\" class=\"govuk-hint\">\n For example, 31 3 1980\n </div>\n\n\n <div class=\"govuk-date-input\" id=\"dob-errors\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-errors-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-errors-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-errors-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
433
|
+
},
|
434
|
+
{
|
435
|
+
"name": "with error and describedBy",
|
436
|
+
"options": {
|
437
|
+
"id": "dob-errors",
|
438
|
+
"fieldset": {
|
439
|
+
"describedBy": "some-id",
|
440
|
+
"legend": {
|
441
|
+
"text": "What is your date of birth?"
|
442
|
+
}
|
443
|
+
},
|
444
|
+
"errorMessage": {
|
445
|
+
"text": "Error message goes here"
|
446
|
+
}
|
447
|
+
},
|
448
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n<fieldset class=\"govuk-fieldset\" role=\"group\" aria-describedby=\"some-id dob-errors-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your date of birth?\n \n </legend>\n \n\n <span id=\"dob-errors-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n\n <div class=\"govuk-date-input\" id=\"dob-errors\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-errors-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"dob-errors-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"dob-errors-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"dob-errors-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
449
|
+
},
|
450
|
+
{
|
451
|
+
"name": "fieldset html",
|
452
|
+
"options": {
|
453
|
+
"fieldset": {
|
454
|
+
"legend": {
|
455
|
+
"html": "What is your <b>date of birth</b>?"
|
456
|
+
}
|
457
|
+
}
|
458
|
+
},
|
459
|
+
"html": "<div class=\"govuk-form-group\">\n<fieldset class=\"govuk-fieldset\" role=\"group\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your <b>date of birth</b>?\n \n </legend>\n \n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\" id=\"undefined-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\" id=\"undefined-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
460
|
+
},
|
461
|
+
{
|
462
|
+
"name": "items with classes",
|
463
|
+
"options": {
|
464
|
+
"items": [
|
465
|
+
{
|
466
|
+
"name": "day",
|
467
|
+
"classes": "app-date-input__day"
|
468
|
+
},
|
469
|
+
{
|
470
|
+
"name": "month",
|
471
|
+
"classes": "app-date-input__month"
|
472
|
+
},
|
473
|
+
{
|
474
|
+
"name": "year",
|
475
|
+
"classes": "app-date-input__year"
|
476
|
+
}
|
477
|
+
]
|
478
|
+
},
|
479
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input app-date-input__day\" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input app-date-input__month\" id=\"undefined-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input app-date-input__year\" id=\"undefined-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
480
|
+
},
|
481
|
+
{
|
482
|
+
"name": "items without classes",
|
483
|
+
"options": {
|
484
|
+
"items": [
|
485
|
+
{
|
486
|
+
"name": "day"
|
487
|
+
},
|
488
|
+
{
|
489
|
+
"name": "month"
|
490
|
+
},
|
491
|
+
{
|
492
|
+
"name": "year"
|
493
|
+
}
|
494
|
+
]
|
495
|
+
},
|
496
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-date-input\">\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-day\">\n Day\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-day\" name=\"day\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-month\">\n Month\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-month\" name=\"month\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-date-input__label\" for=\"undefined-year\">\n Year\n </label>\n \n <input class=\"govuk-input govuk-date-input__input \" id=\"undefined-year\" name=\"year\" type=\"text\" pattern=\"[0-9]*\" inputmode=\"numeric\">\n </div>\n </div>\n \n </div>\n\n</div>"
|
497
|
+
}
|
498
|
+
]
|
499
|
+
}
|