start grid

This commit is contained in:
2023-04-02 23:54:41 +08:00
parent 4e230ed7e7
commit c44aaf5177
8 changed files with 649 additions and 25 deletions

View File

@ -97,8 +97,7 @@ class Dropdown {
onselected;
onexpanded;
constructor(options) {
options ??= {};
constructor(options = {}) {
options.searchplaceholder ??= r('searchHolder', 'Search...');
options.textkey ??= 'text';
options.valuekey ??= 'value';
@ -287,8 +286,7 @@ class Dropdown {
get #expanded() { return this.#container?.style.visibility === 'visible' }
#dropdown(flag) {
flag ??= true;
#dropdown(flag = true) {
const options = this.#options;
const textkey = options.textkey;
let panel = this.#container;
@ -472,8 +470,7 @@ class Dropdown {
}
}
static resolve(dom) {
dom ??= document.body;
static resolve(dom = document.body) {
const selects = dom.querySelectorAll('select');
for (let sel of selects) {
const source = [...sel.children].map(it => {