mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:17:41 +08:00
65 lines
1.2 KiB
JavaScript
65 lines
1.2 KiB
JavaScript
import { css, nothing } from "lit"
|
|
|
|
/**
|
|
* @typedef {import("../element/IElement").default} IElement
|
|
* @typedef {import("../input/IInput").default} IInput
|
|
* @typedef {import("lit").TemplateResult<1>} TemplateResult
|
|
*/
|
|
|
|
/** @template {IElement} T */
|
|
export default class ITemplate {
|
|
|
|
static styles = css``
|
|
|
|
/** @type {T} */
|
|
element
|
|
|
|
/** @type {IInput[]} */
|
|
#inputObjects = []
|
|
get inputObjects() {
|
|
return this.#inputObjects
|
|
}
|
|
|
|
/** @param {T} element */
|
|
constructed(element) {
|
|
this.element = element
|
|
}
|
|
|
|
/** @returns {IInput[]} */
|
|
createInputObjects() {
|
|
return []
|
|
}
|
|
|
|
connectedCallback() {
|
|
}
|
|
|
|
/** @param {Map} changedProperties */
|
|
willUpdate(changedProperties) {
|
|
}
|
|
|
|
/** @param {Map} changedProperties */
|
|
update(changedProperties) {
|
|
}
|
|
|
|
/** @returns {TemplateResult | symbol} */
|
|
render() {
|
|
return nothing
|
|
}
|
|
|
|
/** @param {Map} changedProperties */
|
|
firstUpdated(changedProperties) {
|
|
}
|
|
|
|
/** @param {Map} changedProperties */
|
|
updated(changedProperties) {
|
|
}
|
|
|
|
inputSetup() {
|
|
this.#inputObjects = this.createInputObjects()
|
|
}
|
|
|
|
cleanup() {
|
|
this.#inputObjects.forEach(v => v.unlistenDOMElement())
|
|
}
|
|
}
|