forked from MapComplete/MapComplete
Add binoculars theme, auto reformat everything
This commit is contained in:
parent
38dea806c5
commit
78d6482c88
586 changed files with 115573 additions and 111842 deletions
|
@ -3,41 +3,41 @@ import {UIEventSource} from "../../Logic/UIEventSource";
|
|||
|
||||
export default class ColorPicker extends InputElement<string> {
|
||||
|
||||
IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false);
|
||||
private readonly value: UIEventSource<string>
|
||||
private readonly _element : HTMLElement
|
||||
private readonly _element: HTMLElement
|
||||
|
||||
constructor(
|
||||
value: UIEventSource<string> = new UIEventSource<string>(undefined)
|
||||
) {
|
||||
super();
|
||||
this.value = value ;
|
||||
|
||||
this.value = value;
|
||||
|
||||
const el = document.createElement("input")
|
||||
this._element = el;
|
||||
|
||||
|
||||
el.type = "color"
|
||||
|
||||
|
||||
this.value.addCallbackAndRunD(v => {
|
||||
el.value =v
|
||||
el.value = v
|
||||
});
|
||||
|
||||
|
||||
el.oninput = () => {
|
||||
const hex = el.value;
|
||||
value.setData(hex);
|
||||
}
|
||||
}
|
||||
|
||||
protected InnerConstructElement(): HTMLElement {
|
||||
return this._element;
|
||||
}
|
||||
|
||||
GetValue(): UIEventSource<string> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false);
|
||||
|
||||
IsValid(t: string): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected InnerConstructElement(): HTMLElement {
|
||||
return this._element;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue