Compare commits
2 commits
8499177fde
...
35490ff0e3
Author | SHA1 | Date | |
---|---|---|---|
35490ff0e3 | |||
078abf35ac |
2 changed files with 23 additions and 3 deletions
|
@ -3,6 +3,6 @@
|
|||
"browser": "src/BetterSelect.js",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"url": "https://darkwiiplayer.github.io/BetterSelect/"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
|
||||
/**
|
||||
* @param {function} fn
|
||||
*/
|
||||
const template = fn => {
|
||||
/**
|
||||
* @param {TemplateStringsArray|String} arr
|
||||
* @param {string[]} params
|
||||
*/
|
||||
return (arr, ...params) => {
|
||||
if (arr instanceof Array) {
|
||||
const buffer = []
|
||||
|
@ -410,6 +416,21 @@ export class BetterSelect extends HTMLElement {
|
|||
this.input.placeholder = text
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {String}
|
||||
*/
|
||||
get name() { return this.getAttribute("name") }
|
||||
|
||||
/**
|
||||
* @param {String} name
|
||||
*/
|
||||
set name(name) { this.setAttribute("name", String(name)) }
|
||||
|
||||
/**
|
||||
* @return {HTMLFormElement}
|
||||
*/
|
||||
get form() { return this.#internals.form }
|
||||
|
||||
clear() {
|
||||
this.setValue(undefined, "")
|
||||
}
|
||||
|
@ -424,4 +445,3 @@ export class BetterSelect extends HTMLElement {
|
|||
if (methodName in this) this[methodName](after, before)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue