-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLATUI-2916: Add beforeInput(s) and afterInput(s) options to form gro…
…ups in play-frontend
- Loading branch information
1 parent
57a2517
commit 5fe7be2
Showing
43 changed files
with
437 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...d/additional-fixtures/character-count-with-beforeInput-and-afterInput-html/component.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name" : "govukCharacterCount" | ||
} |
16 changes: 16 additions & 0 deletions
16
...ntend/additional-fixtures/character-count-with-beforeInput-and-afterInput-html/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"id" : "with-formgroup", | ||
"name" : "with-formgroup", | ||
"maxlength" : 10, | ||
"label" : { | ||
"text" : "With formgroup" | ||
}, | ||
"formGroup" : { | ||
"beforeInput": { "html": "<p>test before</p>"}, | ||
"afterInput": { "html": "<p>test after</p>"}, | ||
"attributes" : { | ||
"some-data-attribute": "true", | ||
"some-other-data-attribute": "eleven" | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ntend/additional-fixtures/character-count-with-beforeInput-and-afterInput-html/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="govuk-form-group govuk-character-count" data-module="govuk-character-count" data-maxlength="10" some-data-attribute="true" some-other-data-attribute="eleven"> | ||
<label class="govuk-label" for="with-formgroup"> | ||
With formgroup | ||
</label> | ||
<p>test before</p> | ||
<textarea class="govuk-textarea govuk-js-character-count" id="with-formgroup" name="with-formgroup" rows="5" aria-describedby="with-formgroup-info"></textarea> | ||
<div id="with-formgroup-info" class="govuk-hint govuk-character-count__message"> | ||
You can enter up to 10 characters | ||
</div> | ||
<p>test after</p> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
...d/additional-fixtures/character-count-with-beforeInput-and-afterInput-text/component.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name" : "govukCharacterCount" | ||
} |
16 changes: 16 additions & 0 deletions
16
...ntend/additional-fixtures/character-count-with-beforeInput-and-afterInput-text/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"id" : "with-formgroup", | ||
"name" : "with-formgroup", | ||
"maxlength" : 10, | ||
"label" : { | ||
"text" : "With formgroup" | ||
}, | ||
"formGroup" : { | ||
"beforeInput": { "text": "test before"}, | ||
"afterInput": { "text": "test after"}, | ||
"attributes" : { | ||
"some-data-attribute": "true", | ||
"some-other-data-attribute": "eleven" | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ntend/additional-fixtures/character-count-with-beforeInput-and-afterInput-text/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="govuk-form-group govuk-character-count" data-module="govuk-character-count" data-maxlength="10" some-data-attribute="true" some-other-data-attribute="eleven"> | ||
<label class="govuk-label" for="with-formgroup"> | ||
With formgroup | ||
</label> | ||
test before | ||
<textarea class="govuk-textarea govuk-js-character-count" id="with-formgroup" name="with-formgroup" rows="5" aria-describedby="with-formgroup-info"></textarea> | ||
<div id="with-formgroup-info" class="govuk-hint govuk-character-count__message"> | ||
You can enter up to 10 characters | ||
</div> | ||
test after | ||
</div> |
3 changes: 3 additions & 0 deletions
3
...ontend/additional-fixtures/checkboxes-with-beforeInput-and-afterInput-html/component.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name" : "govukCheckboxes" | ||
} |
37 changes: 37 additions & 0 deletions
37
...k-frontend/additional-fixtures/checkboxes-with-beforeInput-and-afterInput-html/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name" : "how-contacted-checked", | ||
"idPrefix" : "how-contacted-checked", | ||
"formGroup" : { | ||
"beforeInputs": { "html": "<p>test before</p>"}, | ||
"afterInputs": { "html": "<p>test after</p>"}, | ||
"attributes" : { | ||
"some-data-attribute": "true", | ||
"some-other-data-attribute": "eleven" | ||
} | ||
}, | ||
"fieldset" : { | ||
"legend" : { | ||
"text" : "How do you want to be contacted?" | ||
} | ||
}, | ||
"items" : [ { | ||
"value" : "email", | ||
"text" : "Email", | ||
"conditional" : { | ||
"html" : "<label class=\"govuk-label\" for=\"context-email\">Email address</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n" | ||
} | ||
}, { | ||
"value" : "phone", | ||
"text" : "Phone", | ||
"checked" : true, | ||
"conditional" : { | ||
"html" : "<label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<span id=\"contact-phone-error\" class=\"govuk-error-message\">Problem with input</span>\n<input class=\"govuk-input govuk-input--error govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\" aria-describedby=\"contact-phone-error\">\n" | ||
} | ||
}, { | ||
"value" : "text", | ||
"text" : "Text message", | ||
"conditional" : { | ||
"html" : "<label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n" | ||
} | ||
} ] | ||
} |
42 changes: 42 additions & 0 deletions
42
...k-frontend/additional-fixtures/checkboxes-with-beforeInput-and-afterInput-html/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div class="govuk-form-group" some-data-attribute="true" some-other-data-attribute="eleven"> | ||
<fieldset class="govuk-fieldset"> | ||
<legend class="govuk-fieldset__legend"> | ||
How do you want to be contacted? | ||
</legend> | ||
<div class="govuk-checkboxes" data-module="govuk-checkboxes"> | ||
<p>test before</p> | ||
<div class="govuk-checkboxes__item"> | ||
<input class="govuk-checkboxes__input" id="how-contacted-checked" name="how-contacted-checked" type="checkbox" value="email" data-aria-controls="conditional-how-contacted-checked"> | ||
<label class="govuk-label govuk-checkboxes__label" for="how-contacted-checked"> | ||
</label> | ||
</div> | ||
<div class="govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden" id="conditional-how-contacted-checked"> | ||
<label class="govuk-label" for="context-email">Email address</label> | ||
<input class="govuk-input govuk-!-width-one-third" name="context-email" type="text" id="context-email"> | ||
</div> | ||
<div class="govuk-checkboxes__item"> | ||
<input class="govuk-checkboxes__input" id="how-contacted-checked-2" name="how-contacted-checked" type="checkbox" value="phone" checked data-aria-controls="conditional-how-contacted-checked-2"> | ||
<label class="govuk-label govuk-checkboxes__label" for="how-contacted-checked-2"> | ||
Phone | ||
</label> | ||
</div> | ||
<div class="govuk-checkboxes__conditional" id="conditional-how-contacted-checked-2"> | ||
<label class="govuk-label" for="contact-phone">Phone number</label> | ||
<span id="contact-phone-error" class="govuk-error-message">Problem with input</span> | ||
<input class="govuk-input govuk-input--error govuk-!-width-one-third" name="contact-phone" type="text" id="contact-phone" aria-describedby="contact-phone-error"> | ||
</div> | ||
<div class="govuk-checkboxes__item"> | ||
<input class="govuk-checkboxes__input" id="how-contacted-checked-3" name="how-contacted-checked" type="checkbox" value="text" data-aria-controls="conditional-how-contacted-checked-3"> | ||
<label class="govuk-label govuk-checkboxes__label" for="how-contacted-checked-3"> | ||
Text message | ||
</label> | ||
</div> | ||
<div class="govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden" id="conditional-how-contacted-checked-3"> | ||
<label class="govuk-label" for="contact-text-message">Mobile phone number</label> | ||
<input class="govuk-input govuk-!-width-one-third" name="contact-text-message" type="text" id="contact-text-message"> | ||
</div> | ||
<p>test after</p> | ||
</div> | ||
</fieldset> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
...ontend/additional-fixtures/checkboxes-with-beforeInput-and-afterInput-text/component.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name" : "govukCheckboxes" | ||
} |
37 changes: 37 additions & 0 deletions
37
...k-frontend/additional-fixtures/checkboxes-with-beforeInput-and-afterInput-text/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name" : "how-contacted-checked", | ||
"idPrefix" : "how-contacted-checked", | ||
"formGroup" : { | ||
"beforeInputs": { "text": "test before"}, | ||
"afterInputs": { "text": "test after"}, | ||
"attributes" : { | ||
"some-data-attribute": "true", | ||
"some-other-data-attribute": "eleven" | ||
} | ||
}, | ||
"fieldset" : { | ||
"legend" : { | ||
"text" : "How do you want to be contacted?" | ||
} | ||
}, | ||
"items" : [ { | ||
"value" : "email", | ||
"text" : "Email", | ||
"conditional" : { | ||
"html" : "<label class=\"govuk-label\" for=\"context-email\">Email address</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n" | ||
} | ||
}, { | ||
"value" : "phone", | ||
"text" : "Phone", | ||
"checked" : true, | ||
"conditional" : { | ||
"html" : "<label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<span id=\"contact-phone-error\" class=\"govuk-error-message\">Problem with input</span>\n<input class=\"govuk-input govuk-input--error govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\" aria-describedby=\"contact-phone-error\">\n" | ||
} | ||
}, { | ||
"value" : "text", | ||
"text" : "Text message", | ||
"conditional" : { | ||
"html" : "<label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n" | ||
} | ||
} ] | ||
} |
Oops, something went wrong.