2
0
mirror of https://github.com/esiur/iui.git synced 2026-04-04 23:18:21 +00:00
This commit is contained in:
2021-10-21 14:15:22 +03:00
parent fab9e186c9
commit 1e8ae99d39
15 changed files with 339 additions and 84 deletions

View File

@@ -32,6 +32,15 @@ export default IUI.module(class Input extends IUIElement {
return true;
}
get caption(){
return this.getAttribute("caption");// this._span.innerHTML;
}
set caption(value){
this.setAttribute("caption", value);
this._span.innerHTML = value;
}
create() {
this.isAuto = this.hasAttribute("auto");
@@ -44,7 +53,12 @@ export default IUI.module(class Input extends IUIElement {
this.setAttribute("async:revert", `d['${this.field}'] = await this.getData()`);
}
this._span = document.createElement("span");
this._span.innerHTML = this.getAttribute("caption");
this._input = document.createElement("input");
this._input.placeholder = " ";
let self = this;
this._input.addEventListener("input", () => {
@@ -62,6 +76,7 @@ export default IUI.module(class Input extends IUIElement {
this.accept = this.getAttribute("accept");
this.appendChild(this._input);
this.appendChild(this._span);
if (this.type == "password")
{