Files
ueblueprint/js/element/DropdownElement.js
barsdeveloper 365732a99c WIP
2024-12-03 22:15:17 +02:00

38 lines
906 B
JavaScript
Executable File

import DropdownTemplate from "../template/pin/DropdownTemplate.js"
import IElement from "./IElement.js"
/** @extends {IElement<Object, DropdownTemplate>} */
export default class DropdownElement extends IElement {
static properties = {
...super.properties,
options: {
type: Object,
},
selectedOption: {
type: String,
},
}
constructor() {
super()
super.initialize({}, new DropdownTemplate())
this.options = /** @type {[String, String][]} */([])
this.selectedOption = ""
}
/** @param {[String, String][]} options */
static newObject(options) {
const result = new DropdownElement()
return result
}
initialize() {
// Initialized in the constructor, this method does nothing
}
getValue() {
return this.template.getSelectedValue()
}
}