More work on the custom theme generator, kindof works now

This commit is contained in:
Pieter Vander Vennet 2020-09-03 00:00:37 +02:00
parent 1fa6a8edfb
commit ee9c9e201f
24 changed files with 1192 additions and 2265 deletions

View file

@ -65,13 +65,17 @@ export class TextField<T> extends InputElement<T> {
});
}
public static KeyInput(): TextField<string>{
public static KeyInput(allowEmpty : boolean = false): TextField<string>{
return new TextField<string>({
placeholder: "key",
fromString: str => {
if (str?.match(/^[a-zA-Z][a-zA-Z0-9:_-]*$/)) {
return str;
}
if(str === "" && allowEmpty){
return "";
}
return undefined
},
toString: str => str