Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Adding validation interface for form component
Browse files Browse the repository at this point in the history
  • Loading branch information
Javiani committed Jan 7, 2021
1 parent 94dd079 commit b4d2134
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion form/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ export default function form ({ main, elm:form, emit, msg, injection, update })
const { validators } = injection

main( _ => [
events
events,
exposing
])

const events = ({ on }) => {
on('keyup', INPUT, debounce(onchange, 250))
on('blur', INPUT, onblur)
on('change', SELECTABLE, onblur)
on('submit', onsubmit)
on(':validate', validate)
}

const exposing = ({ expose }) => {
expose({ validate })
}

const validate = () => {
checkValid()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jails.packages",
"version": "1.9.1",
"version": "1.9.2",
"description": "Index of all Jails official Packages",
"main": "",
"scripts": {
Expand Down

0 comments on commit b4d2134

Please sign in to comment.