mirror of
https://github.com/Steffo99/bluelib.git
synced 2024-12-22 11:34:21 +00:00
0.13.1
This commit is contained in:
parent
24e1718611
commit
e6ff4744cb
30 changed files with 65 additions and 48 deletions
File diff suppressed because one or more lines are too long
3
docs/bundle.69585.js
Normal file
3
docs/bundle.69585.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/bundle.69585.js.map
Normal file
1
docs/bundle.69585.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
/*! For license information please see bundle.e576f.esm.js.LICENSE.txt */
|
3
docs/bundle.fe0c4.esm.js
Normal file
3
docs/bundle.fe0c4.esm.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/bundle.fe0c4.esm.js.LICENSE.txt
Normal file
1
docs/bundle.fe0c4.esm.js.LICENSE.txt
Normal file
|
@ -0,0 +1 @@
|
|||
/*! For license information please see bundle.fe0c4.esm.js.LICENSE.txt */
|
|
@ -1 +1 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.e576f.esm.js","sourceRoot":""}
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"bundle.fe0c4.esm.js","sourceRoot":""}
|
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html lang="it"><head><meta charset="utf-8"><title>bluelib</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>body{background-color:#0d193b;color:#a0ccff}</style><link rel="manifest" href="/manifest.json"><link href="/bundle.3fcfd.css" rel="preload" as="style" onload="this.rel='stylesheet'"><noscript><link rel="stylesheet" href="/bundle.3fcfd.css"></noscript></head><body><script type="__PREACT_CLI_DATA__">{"preRenderData":{"url":"/"}}</script><script nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" src="/bundle.e576f.esm.js" type="module"></script><script nomodule="" src="/polyfills.ac517.js"></script><script nomodule="" defer="defer" src="/bundle.b78fb.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="it"><head><meta charset="utf-8"><title>bluelib</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>body{background-color:#0d193b;color:#a0ccff}</style><link rel="manifest" href="/manifest.json"><link href="/bundle.1f6e4.css" rel="preload" as="style" onload="this.rel='stylesheet'"><noscript><link rel="stylesheet" href="/bundle.1f6e4.css"></noscript></head><body><script type="__PREACT_CLI_DATA__">{"preRenderData":{"url":"/"}}</script><script nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" src="/bundle.fe0c4.esm.js" type="module"></script><script nomodule="" src="/polyfills.ac517.js"></script><script nomodule="" defer="defer" src="/bundle.69585.js"></script></body></html>
|
|
@ -1 +1 @@
|
|||
{"/":{"bundle.3fcfd.css":{"type":"style","weight":1},"bundle.e576f.esm.js":{"type":"script","weight":1}},"/Sample":{"bundle.3fcfd.css":{"type":"style","weight":1},"bundle.e576f.esm.js":{"type":"script","weight":1},"route-Sample.chunk.06577.esm.js":{"type":"script","weight":0.9},"route-Sample.chunk.6e286.css":{"type":"style","weight":0.9}}}
|
||||
{"/":{"bundle.1f6e4.css":{"type":"style","weight":1},"bundle.fe0c4.esm.js":{"type":"script","weight":1}},"/Sample":{"bundle.1f6e4.css":{"type":"style","weight":1},"bundle.fe0c4.esm.js":{"type":"script","weight":1},"route-Sample.chunk.f0674.esm.js":{"type":"script","weight":0.9},"route-Sample.chunk.6e286.css":{"type":"style","weight":0.9}}}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
docs/route-Sample.chunk.40588.js.map
Normal file
1
docs/route-Sample.chunk.40588.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"route-Sample.chunk.06577.esm.js","sourceRoot":""}
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"route-Sample.chunk.f0674.esm.js","sourceRoot":""}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"private": false,
|
||||
"name": "bluelib",
|
||||
"version": "0.13.0",
|
||||
"version": "0.13.1",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"source": "src/index.js",
|
||||
"main": "dist/index.js",
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
import ValidityStatus from "../Enums/ValidityStatus";
|
||||
import ValidityStatus from "../../enums/Validity";
|
||||
import FormRow from "./FormRow";
|
||||
import style from "./FormRow.less"
|
||||
import style from "./FormRow.less";
|
||||
import concatClass from "../../utils/concatClass";
|
||||
import theme from "../../styles/theme.less";
|
||||
|
||||
export default function (props) {
|
||||
return (
|
||||
<FormRow validity={props.validity} label={props.label} icon={props.icon}>
|
||||
<FormRow
|
||||
disabled={props.disabled}
|
||||
validity={props.validity}
|
||||
label={props.label}
|
||||
icon={props.icon}>
|
||||
<button
|
||||
class={style.contentschild}
|
||||
class={concatClass(style.contentschild, props.disabled ? theme.disabled : null)}
|
||||
onClick={(props.disabled && props.validity.validity === ValidityStatus.DISABLED) ? null : props.onClick}
|
||||
disabled={props.validity ? props.validity.validity === ValidityStatus.DISABLED : false}
|
||||
>
|
||||
disabled={props.validity ? props.validity.validity === ValidityStatus.DISABLED : false}>
|
||||
{props.children}
|
||||
</button>
|
||||
</FormRow>
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
import FormRow from "./FormRow";
|
||||
import ValidityStatus from "../Enums/ValidityStatus";
|
||||
import style from "./FormRow.less"
|
||||
|
||||
export default function (props) {
|
||||
return (
|
||||
<FormRow validity={props.validity} label={props.label} icon={props.icon}>
|
||||
<FormRow
|
||||
disabled={props.disabled}
|
||||
validity={props.validity}
|
||||
label={props.label}
|
||||
icon={props.icon}>
|
||||
<input
|
||||
class={style.contentschild}
|
||||
type={props.type}
|
||||
value={props.value}
|
||||
onChange={props.onChange}
|
||||
disabled={props.validity ? props.validity.validity === ValidityStatus.DISABLED : false}
|
||||
disabled={props.disabled}
|
||||
name={props.name}/>
|
||||
</FormRow>
|
||||
);
|
||||
|
|
|
@ -1,12 +1,20 @@
|
|||
import concatClass from "../../utils/concatClass";
|
||||
import style from "./FormRow.less";
|
||||
import theme from "../../styles/theme.less"
|
||||
import ValidityStatus from "../Enums/ValidityStatus";
|
||||
import ValidityStatus from "../../enums/Validity";
|
||||
|
||||
export default function (props) {
|
||||
let color = null;
|
||||
if(props.disabled) {
|
||||
color = theme.disabled;
|
||||
}
|
||||
else if(props.validity) {
|
||||
color = theme[props.validity.validity];
|
||||
}
|
||||
|
||||
return (
|
||||
<label
|
||||
className={concatClass(style.label, theme[props.validity ? props.validity.validity : ValidityStatus.NONE])}>
|
||||
className={concatClass(style.label, color)}>
|
||||
<div className={style.text}>{props.label}</div>
|
||||
<div className={style.icon}>{props.icon}</div>
|
||||
<div className={style.contents}>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
export default Object.freeze({
|
||||
NONE: "none",
|
||||
CHECKING: "checking",
|
||||
OK: "ok",
|
||||
WARNING: "warning",
|
||||
ERROR: "error",
|
|
@ -1,5 +1,5 @@
|
|||
import { useEffect, useState } from 'preact/hooks';
|
||||
import ValidityStatus from "../components/Enums/ValidityStatus";
|
||||
import ValidityStatus from "../enums/Validity";
|
||||
|
||||
export default function(value, validator) {
|
||||
const [status, setStatus] = useState({
|
||||
|
|
|
@ -2,7 +2,7 @@ import { useContext, useState } from 'preact/hooks';
|
|||
import RoyalnetInstanceUrl from '../contexts/RoyalnetInstanceUrl';
|
||||
import useFormValidator from "./useFormValidator";
|
||||
import {royalnetApiRequest} from '../utils/royalnetApiRequest';
|
||||
import ValidityStatus from "../components/Enums/ValidityStatus";
|
||||
import ValidityStatus from "../enums/Validity";
|
||||
|
||||
const instanceUrlRegex = /^https?:\/\/.*?[^/]$/;
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ import LatexRenderColor from "./contexts/LatexRenderColor";
|
|||
import RoyalnetInstanceUrl from "./contexts/RoyalnetInstanceUrl";
|
||||
import RoyalnetLoginStatus from "./contexts/RoyalnetLoginStatus";
|
||||
|
||||
import Validity from "./enums/Validity";
|
||||
|
||||
import useFormValidator from "./hooks/useFormValidator";
|
||||
import useLoginDataStorage from "./hooks/useLoginDataStorage";
|
||||
import useRoyalnetData from "./hooks/useRoyalnetData";
|
||||
|
@ -74,6 +76,8 @@ export {
|
|||
RoyalnetInstanceUrl,
|
||||
RoyalnetLoginStatus,
|
||||
|
||||
Validity,
|
||||
|
||||
useFormValidator,
|
||||
useLoginDataStorage,
|
||||
useRoyalnetData,
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
faRadiation,
|
||||
faSpinner
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import ValidityStatus from "../components/Enums/ValidityStatus";
|
||||
import Validity from "../enums/Validity";
|
||||
import style from "./Sample.less";
|
||||
|
||||
|
||||
|
@ -95,42 +95,40 @@ export default function (props) {
|
|||
<Panel title={"FormInputs"}>
|
||||
<FormInput type={"text"} name={"username"} label={"Username"}/>
|
||||
<FormInput type={"password"} label={"Password"}/>
|
||||
<FormInput type={"text"} label={"Caricamento"} icon={<FontAwesomeIcon icon={faSpinner} pulse={true}/>} validity={{
|
||||
validity: ValidityStatus.DISABLED,
|
||||
<FormInput type={"text"} label={"Caricamento"} icon={<FontAwesomeIcon icon={faSpinner} pulse={true}/>} disabled={true} validity={{
|
||||
message: [<FontAwesomeIcon icon={faAddressCard} className={style.flipping}/>, " Take your time..."]
|
||||
}}/>
|
||||
<FormInput type={"text"} label={"OK!"} icon={<FontAwesomeIcon icon={faCheck}/>} validity={{
|
||||
validity: ValidityStatus.OK,
|
||||
validity: Validity.OK,
|
||||
message: "",
|
||||
}}/>
|
||||
<FormInput type={"text"} label={"È un angelo!"} icon={<FontAwesomeIcon icon={faExclamationTriangle}/>} validity={{
|
||||
validity: ValidityStatus.WARNING,
|
||||
validity: Validity.WARNING,
|
||||
message: "",
|
||||
}}/>
|
||||
<FormInput type={"text"} label={"Spinning Jesus"} icon={<FontAwesomeIcon icon={faCross} spin={true}/>} validity={{
|
||||
validity: ValidityStatus.ERROR,
|
||||
validity: Validity.ERROR,
|
||||
message: "",
|
||||
}}/>
|
||||
<FormInput type={"text"} label={"Ur mom"} icon={<FontAwesomeIcon icon={faCircle}/>} validity={{
|
||||
validity: ValidityStatus.ERROR,
|
||||
validity: Validity.ERROR,
|
||||
message: "ERROR: she is too fat for this input",
|
||||
}}/>
|
||||
</Panel>
|
||||
<Panel title={"FormButtons"}>
|
||||
Ma quindi era tutto...
|
||||
<FormButton label={"...un bottone?"}>Lo è sempre stato.</FormButton>
|
||||
<FormButton label={"...disattivato?"} icon={<FontAwesomeIcon icon={faXbox}/>} validity={{
|
||||
validity: ValidityStatus.DISABLED,
|
||||
<FormButton label={"...disattivato?"} disabled={true} icon={<FontAwesomeIcon icon={faXbox}/>} validity={{
|
||||
message: "pls w8 a sec"
|
||||
}}>Sì.</FormButton>
|
||||
<FormButton label={"...una città?"} icon={<FontAwesomeIcon icon={faHouseUser}/>} validity={{
|
||||
validity: ValidityStatus.OK,
|
||||
validity: Validity.OK,
|
||||
}}>Lucianina?</FormButton>
|
||||
<FormButton label={"...miele?"} icon={<FontAwesomeIcon icon={faBug}/>} validity={{
|
||||
validity: ValidityStatus.WARNING,
|
||||
validity: Validity.WARNING,
|
||||
}}>Not the bees!</FormButton>
|
||||
<FormButton label={"...un Helios?"} icon={<FontAwesomeIcon icon={faRadiation}/>} validity={{
|
||||
validity: ValidityStatus.ERROR,
|
||||
validity: Validity.ERROR,
|
||||
message: "ERROR: è finito il metallo",
|
||||
}}>[AVVIA ANNICHILIMENTO]</FormButton>
|
||||
</Panel>
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.disabled {
|
||||
.disabled, :disabled {
|
||||
color: @disabledfg;
|
||||
cursor: not-allowed;
|
||||
|
||||
|
|
Loading…
Reference in a new issue