UNPKG

uswds

Version:

Open source UI components and visual style guide for U.S. government websites

25 lines (20 loc) 476 B
const assign = require('object-assign'); const behavior = require('../utils/behavior'); const validate = require('../utils/validate-input'); function change() { validate(this); } const validator = behavior({ 'keyup change': { 'input[data-validation-element]': change, }, }); /** * TODO for 2.0, remove this statement and export `navigation` directly: * * module.exports = behavior({...}); */ module.exports = assign( el => validator.on(el), validator );