mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-22 06:13:23 +08:00
Make elements default constructible, testing wip
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import { css, html } from "lit"
|
||||
import { html } from "lit"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IElement").default} IElement
|
||||
* @typedef {import("../input/IInput").default} IInput
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
/** @template {IElement} T */
|
||||
export default class ITemplate {
|
||||
|
||||
static styles = css``
|
||||
|
||||
/** @type {T} */
|
||||
element
|
||||
|
||||
@@ -20,23 +19,26 @@ export default class ITemplate {
|
||||
}
|
||||
|
||||
/** @param {T} element */
|
||||
constructed(element) {
|
||||
initialize(element) {
|
||||
this.element = element
|
||||
}
|
||||
|
||||
/** @returns {IInput[]} */
|
||||
createInputObjects() {
|
||||
return []
|
||||
return /** @type {IInput[]} */([])
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
setup() {
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
cleanup() {
|
||||
this.#inputObjects.forEach(v => v.unlistenDOMElement())
|
||||
}
|
||||
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
willUpdate(changedProperties) {
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
update(changedProperties) {
|
||||
}
|
||||
|
||||
@@ -44,19 +46,15 @@ export default class ITemplate {
|
||||
return html``
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
}
|
||||
|
||||
/** @param {Map} changedProperties */
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
updated(changedProperties) {
|
||||
}
|
||||
|
||||
inputSetup() {
|
||||
this.#inputObjects = this.createInputObjects()
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
this.#inputObjects.forEach(v => v.unlistenDOMElement())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user