Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add character count component #959

Merged
merged 25 commits into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
09809a4
Add character count component
alex-ju Jun 27, 2018
8d92e1a
Add character count javascript
alex-ju Jun 27, 2018
768c735
Import component
alex-ju Jun 27, 2018
5a3f4ea
Integrate govuk-texarea markup to character count
hannalaakso Aug 14, 2018
e52c3ff
Adjust CSS to use govuk-textarea with character count
hannalaakso Aug 14, 2018
c5b6cd4
Adjust JS to use govuk-textarea with character count
hannalaakso Aug 14, 2018
1d0c691
Fix tests for character count with govuk-textarea
hannalaakso Aug 14, 2018
97cdc32
Add regenerated README for character count
hannalaakso Aug 14, 2018
471d918
Remove highlight and validation border
alex-ju Aug 16, 2018
ef4eb71
Allow hint and error messages to be passed to textarea
alex-ju Aug 16, 2018
9294d6f
Update readme
alex-ju Aug 16, 2018
e6392fb
Disable options via init
alex-ju Aug 24, 2018
f4d6b5c
Remove example file
alex-ju Aug 30, 2018
b2702a7
Allow threshold percentange via Nunjucks
alex-ju Sep 13, 2018
2c3a5f0
Fix double-firing updateMessage
alex-ju Oct 2, 2018
7b534bf
Add default message
alex-ju Oct 2, 2018
415edd9
Move table of arguments in readme.njk and redefine it in a yaml file
alex-ju Oct 5, 2018
e5006dd
Set responsive margin-bottom
alex-ju Oct 5, 2018
187257c
Fix check for limit attribute and remove hard limit
alex-ju Oct 5, 2018
ef9051f
Handle whitespace
alex-ju Oct 5, 2018
f7a3224
Refector conditional statements
alex-ju Oct 9, 2018
fa50392
Update readme
alex-ju Oct 9, 2018
01b029b
Add classList polyfill
alex-ju Oct 10, 2018
3f99356
Set default message as aria-describedBy
alex-ju Oct 10, 2018
980be67
Update changelog
alex-ju Oct 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/all.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { nodeListForEach } from './common'
import Button from './components/button/button'
import Details from './components/details/details'
import CharacterCount from './components/character-count/character-count'
import Checkboxes from './components/checkboxes/checkboxes'
import ErrorSummary from './components/error-summary/error-summary'
import Header from './components/header/header'
Expand All @@ -17,6 +18,11 @@ function initAll () {
new Details($detail).init()
})

var $characterCount = document.querySelectorAll('[data-module="character-count"]')
nodeListForEach($characterCount, function ($characterCount) {
new CharacterCount($characterCount).init()
})

var $checkboxes = document.querySelectorAll('[data-module="checkboxes"]')
nodeListForEach($checkboxes, function ($checkbox) {
new Checkboxes($checkbox).init()
Expand Down Expand Up @@ -45,6 +51,7 @@ export {
initAll,
Button,
Details,
CharacterCount,
Checkboxes,
ErrorSummary,
Header,
Expand Down
1 change: 1 addition & 0 deletions src/all.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('GOV.UK Frontend', () => {
expect(components).toEqual([
'Button',
'Details',
'CharacterCount',
'Checkboxes',
'ErrorSummary',
'Header',
Expand Down
1 change: 1 addition & 0 deletions src/components/_all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import "breadcrumbs/breadcrumbs";
@import "button/button";
@import "checkboxes/checkboxes";
@import "character-count/character-count";
@import "date-input/date-input";
@import "details/details";
@import "error-message/error-message";
Expand Down
Loading