diff --git a/readme.md b/readme.md index 7212935..9c17427 100644 --- a/readme.md +++ b/readme.md @@ -5,17 +5,26 @@ ## Slots -* `placeholder`: Only shown when nothing is selected (replaces attribute placeholder if present) +* `clear`: Overrides the default "x" clear button * `loading`: Hidden by default, shown instead of items while `populate()` runs +* `placeholder`: Only shown when nothing is selected (replaces attribute placeholder if present) + +* `top`: Insert content at the top of the drop-down +* `below-search`: Insert content beltween the search box and item list +* `bottom`: Insert content at the bottom of the drop-down ## Parts -* `display`: The outer display box that is always shown +* `clear`: The slot containing the clear button * `display-text`: The text representing the currently selected value +* `display`: The outer display box that is always shown * `drop-down`: The dialog element that pops up when the list is opened -* `search`: The search input box -* `list`: The wrapper containing the items * `item`: The individual selectable list items + * `item disabled`: Any item corresponding to a disabled option + * `item enabled`: Any item correesponding to a not disabled option +* `list`: The wrapper containing the items +* `placeholder`: The slot containing the placeholder text +* `search`: The search input box ## Hooks diff --git a/src/better-select.d.ts b/src/better-select.d.ts index 4623657..b996acd 100644 --- a/src/better-select.d.ts +++ b/src/better-select.d.ts @@ -45,7 +45,8 @@ export class BetterSelect extends HTMLElement { * @param {string} state */ setValue(value: string, state?: string): void; - set value(arg: any); + updateClearButton(): void; + set value(value: any); get value(): any; get valueText(): any; setOptions(): void; @@ -60,7 +61,7 @@ export class BetterSelect extends HTMLElement { /** * @param {String} name */ - set name(arg: string); + set name(name: string); /** * @return {String} */ @@ -70,7 +71,7 @@ export class BetterSelect extends HTMLElement { /** * @param {Boolean} disabled */ - set disabled(arg: boolean); + set disabled(disabled: boolean); get disabled(): boolean; /** * @param {ValidityConstraint} _constraint @@ -84,7 +85,7 @@ export class BetterSelect extends HTMLElement { /** * @param {Boolean} required */ - set required(arg: boolean); + set required(required: boolean); get required(): boolean; reportValidity(): boolean; requiredChanged(): void; diff --git a/src/better-select.js b/src/better-select.js index 4169ebd..08679d1 100644 --- a/src/better-select.js +++ b/src/better-select.js @@ -239,8 +239,8 @@ export class BetterSelect extends HTMLElement { this.attachShadow({mode: "open"}).innerHTML = `
-