forked from MapComplete/MapComplete
Reformat all files with prettier
This commit is contained in:
parent
e22d189376
commit
b541d3eab4
382 changed files with 50893 additions and 35566 deletions
|
@ -1,43 +1,39 @@
|
|||
import {InputElement} from "./InputElement";
|
||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||
import { InputElement } from "./InputElement"
|
||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
||||
|
||||
export default class ColorPicker extends InputElement<string> {
|
||||
|
||||
IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false);
|
||||
IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false)
|
||||
private readonly value: UIEventSource<string>
|
||||
private readonly _element: HTMLElement
|
||||
|
||||
constructor(
|
||||
value: UIEventSource<string> = new UIEventSource<string>(undefined)
|
||||
) {
|
||||
super();
|
||||
this.value = value;
|
||||
constructor(value: UIEventSource<string> = new UIEventSource<string>(undefined)) {
|
||||
super()
|
||||
this.value = value
|
||||
|
||||
const el = document.createElement("input")
|
||||
this._element = el;
|
||||
this._element = el
|
||||
|
||||
el.type = "color"
|
||||
|
||||
this.value.addCallbackAndRunD(v => {
|
||||
this.value.addCallbackAndRunD((v) => {
|
||||
el.value = v
|
||||
});
|
||||
})
|
||||
|
||||
el.oninput = () => {
|
||||
const hex = el.value;
|
||||
value.setData(hex);
|
||||
const hex = el.value
|
||||
value.setData(hex)
|
||||
}
|
||||
}
|
||||
|
||||
GetValue(): UIEventSource<string> {
|
||||
return this.value;
|
||||
return this.value
|
||||
}
|
||||
|
||||
IsValid(t: string): boolean {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
protected InnerConstructElement(): HTMLElement {
|
||||
return this._element;
|
||||
return this._element
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue