forked from MapComplete/MapComplete
More work on the custom theme generator, kindof works now
This commit is contained in:
parent
1fa6a8edfb
commit
ee9c9e201f
24 changed files with 1192 additions and 2265 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue