parent
0602a35e5a
commit
73338c4e93
@ -1 +0,0 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}
|
File diff suppressed because one or more lines are too long
@ -1,29 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Demo | Tiny Validator</title>
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||
<link href="styles.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<form class="form" novalidate>
|
||||
<div class="field">
|
||||
<label>
|
||||
email
|
||||
<input type="email" name="email" />
|
||||
</label>
|
||||
<field-error name="email"></field-error>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>
|
||||
password
|
||||
<input type="password" name="password" />
|
||||
</label>
|
||||
<field-error name="password"></field-error>
|
||||
</div>
|
||||
<button type="submit">Send</button>
|
||||
</form>
|
||||
<script type="text/javascript" src="demo.js"></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Tiny Components | Validator</title>
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||
<link href="demo.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
<div class="bar">
|
||||
<div class="bar__start">
|
||||
<h1 class="m-top-4 m-bottom-4 h4">
|
||||
@tiny-components/validator
|
||||
</h1>
|
||||
</div>
|
||||
<div class="bar__main justify-end">
|
||||
<a class="button button--small m-left-sm-3 m-bottom-0" href="https://gitea.node001.net/tiny-components/validator" rel="noopener" target="_blank">
|
||||
Gitea
|
||||
<svg class="m-left-3 icon fill-text" aria-hidden="true">
|
||||
<use xlink:href="symbol-defs.svg#icon-gitea"></use>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="container">
|
||||
<div class="grid">
|
||||
<div class="col-12">
|
||||
<form class="form" novalidate method="post">
|
||||
<div class="field-group">
|
||||
<label class="field-label">
|
||||
email
|
||||
<input type="email" class="field-text" name="email" />
|
||||
</label>
|
||||
<field-error name="email"></field-error>
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label">
|
||||
password
|
||||
<input type="password" class="field-text" name="password" />
|
||||
</label>
|
||||
<field-error name="password"></field-error>
|
||||
</div>
|
||||
<button class="button" type="submit">
|
||||
Send
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div id="result" class="panel color-text-contrast background-color-success hidden">
|
||||
<div class="panel__body">
|
||||
<div class="content m-bottom-last-child-0">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="demo.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"/demo/demo.js": "/demo/demo.js",
|
||||
"/demo/demo.css": "/demo/demo.css"
|
||||
"/dist/demo.js": "/dist/demo.js",
|
||||
"/dist/demo.css": "/dist/demo.css"
|
||||
}
|
||||
|
@ -1,25 +1,25 @@
|
||||
{
|
||||
"name": "@tentakelfabrik/tiny-validator",
|
||||
"version": "2.0.0",
|
||||
"description": "Form Validator with validator.js for riotjs",
|
||||
"name": "@tiny-components/validator",
|
||||
"version": "0.1.0",
|
||||
"description": "Form Validation with Riotjs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:tentakelfabrik/tiny-validator.git"
|
||||
"url": "git@gitea.node001.net:tiny-components/validator.git"
|
||||
},
|
||||
"author": "Björn Hase",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tentakelfabrik/plain-ui": "^0.3.0",
|
||||
"form-serialize": "^0.7.2",
|
||||
"riot": "^5.1.2",
|
||||
"riot": "^6.1.2",
|
||||
"validate.js": "^0.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@riotjs/compiler": "^5.1.3",
|
||||
"@riotjs/webpack-loader": "^5.0.0",
|
||||
"@riotjs/compiler": "^6.1.3",
|
||||
"@riotjs/webpack-loader": "^6.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"laravel-mix": "^6.0.5",
|
||||
"postcss": "^8.2.1",
|
||||
"sass": "^1.32.0",
|
||||
"sass-loader": "^8.0.2"
|
||||
"sass-loader": "^12.4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
import * as riot from 'riot'
|
||||
|
||||
import FormValidator from './FormValidator'
|
||||
import FieldError from './fieldError.riot'
|
||||
|
||||
// register & mount riot component
|
||||
riot.register('field-error', FieldError)
|
||||
riot.mount('field-error')
|
||||
|
||||
// creating formValidation
|
||||
const formValidation = new FormValidator('form', {
|
||||
'email': {
|
||||
'presence': true,
|
||||
'email': true
|
||||
},
|
||||
'password': {
|
||||
'presence': true
|
||||
}
|
||||
}, (event, data) => {
|
||||
event.preventDefault()
|
||||
|
||||
// show message and content of data from form
|
||||
document.querySelector('#result .content').innerHTML = '<p>' + JSON.stringify(data) + '</p>'
|
||||
document.querySelector('#result').classList.remove('hidden')
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
@import
|
||||
'../node_modules/@tentakelfabrik/plain-ui/src/scss/plain-ui';
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import * as riot from 'riot'
|
||||
|
||||
import FormValidator from './../FormValidator'
|
||||
import FieldError from './../field-error.riot'
|
||||
|
||||
riot.register('field-error', FieldError)
|
||||
riot.mount('field-error')
|
||||
|
||||
const formValidation = new FormValidator('form', {
|
||||
'email': {
|
||||
'presence': true,
|
||||
'email': true
|
||||
},
|
||||
'password': {
|
||||
'presence': true
|
||||
}
|
||||
})
|
@ -1,6 +0,0 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
|
||||
/*# sourceMappingURL=normalize.min.css.map */
|
||||
|
||||
body {
|
||||
|
||||
}
|
Loading…
Reference in new issue