Input system cleanup

This commit is contained in:
barsdeveloper
2022-11-10 22:43:47 +01:00
parent 101071f137
commit 18bf858db3
16 changed files with 183 additions and 170 deletions

View File

@@ -5,6 +5,7 @@ import { LitElement } from "lit"
* @typedef {import("../entity/IEntity").default} IEntity
* @typedef {import("../input/IInput").default} IInput
* @typedef {import("../template/ITemplate").default} ITemplate
* @typedef {import("lit").PropertyDeclarations} PropertyDeclarations
*/
/**
@@ -13,7 +14,7 @@ import { LitElement } from "lit"
*/
export default class IElement extends LitElement {
/** @type {import("lit").PropertyDeclarations} */
/** @type {PropertyDeclarations} */
static properties = {
}

View File

@@ -1,9 +1,28 @@
import InputTemplate from "../template/InputTemplate"
import Utility from "../Utility"
import IElement from "./IElement"
export default class InputElement extends IElement {
static properties = {
...super.properties,
singleLine: {
type: Boolean,
attribute: "data-single-line",
converter: Utility.booleanConverter,
reflect: true,
},
blurOnEnter: {
type: Boolean,
attribute: "data-blur-enter",
converter: Utility.booleanConverter,
reflect: true,
},
}
constructor() {
super({}, new InputTemplate())
this.singleLine = false
this.blurOnEnter = true
}
}