1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-12-22 11:34:21 +00:00
This commit is contained in:
Steffo 2020-06-23 22:33:49 +02:00
parent 308a8b00c4
commit 6c5023e2c8
Signed by: steffo
GPG key ID: 896A80F55F7C97F0
5 changed files with 38 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{
"private": false,
"name": "bluelib",
"version": "0.12.2",
"version": "0.12.3",
"license": "AGPL-3.0-or-later",
"source": "src/index.js",
"main": "dist/index.js",

View file

@ -1,12 +1,22 @@
import style from './HButton.less';
import {concatClass} from "../../index";
export default function (props) {
let validityClass = null;
if(props.validity === true) {
validityClass = style.valid;
}
else if(props.validity === false) {
validityClass = style.invalid;
}
return (
<label className={style.label}>
<div className={style.text}>{props.label}</div>
<button
onClick={props.disabled ? null : props.onClick}
className={style.button}
className={concatClass(style.button, validityClass)}
disabled={props.disabled}
>
{props.children}

View file

@ -19,3 +19,11 @@
margin-left: 4px;
flex-grow: 2;
}
.valid {
border: 1px solid @lime !important;
}
.invalid {
border: 1px solid @red !important;
}

View file

@ -1,10 +1,19 @@
import style from './HInput.less';
import {concatClass} from "../../index";
export default function (props) {
let validityClass = null;
if(props.validity === true) {
validityClass = style.valid;
}
else if(props.validity === false) {
validityClass = style.invalid;
}
return (
<label className={style.label}>
<div className={style.text}>{props.label}</div>
<input className={style.input} type={props.type} value={props.value}
<input className={concatClass(style.input, validityClass)} type={props.type} value={props.value}
onChange={props.onChange} disabled={props.disabled} name={props.name}/>
</label>
);

View file

@ -19,3 +19,11 @@
margin-left: 4px;
flex-grow: 2;
}
.valid {
border: 1px solid @lime !important;
}
.invalid {
border: 1px solid @red !important;
}