@prof-dev/improved-select
Advanced tools
Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "@prof-dev/improved-select", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Helper for live clicks events management", | ||
@@ -5,0 +5,0 @@ "main": "lib/ImprovedSelect.js", |
@@ -22,3 +22,3 @@ import { EventEmitter } from "@prof-dev/event-emitter"; | ||
class Select extends EventEmitter<SelectEventType, ImprovedSelect> { } | ||
class Select extends EventEmitter<SelectEventType, ImprovedSelect> {} | ||
@@ -188,4 +188,4 @@ export class ImprovedSelect extends Select { | ||
? selectedOptions | ||
.map((option) => this.linkedOptions[option.index]?.innerHTML) | ||
.join(", ") | ||
.map((option) => this.linkedOptions[option.index]?.innerHTML) | ||
.join(", ") | ||
: selectedOptions.map((option) => option.innerHTML).join(", ") | ||
@@ -252,4 +252,4 @@ : this.selectLabel ?? ""; | ||
searchValue.length > 0 && | ||
valueMatch !== true && | ||
textMatch !== true, | ||
valueMatch !== true && | ||
textMatch !== true, | ||
); | ||
@@ -276,3 +276,3 @@ } | ||
info(): ImprovedSelectInfo { | ||
public info(): ImprovedSelectInfo { | ||
return { | ||
@@ -305,3 +305,3 @@ isActive: this.isActive, | ||
toggle(force?: boolean) { | ||
public toggle(force?: boolean) { | ||
this.cleanup?.(); | ||
@@ -325,3 +325,3 @@ this.isActive = this.element.classList.toggle("is-active", force); | ||
open() { | ||
public open() { | ||
if (this.isActive === false) { | ||
@@ -333,3 +333,3 @@ this.toggle(true); | ||
close() { | ||
public close() { | ||
if (this.isActive === true) { | ||
@@ -341,3 +341,3 @@ this.toggle(false); | ||
updateDisabledOptions() { | ||
public updateDisabledOptions() { | ||
if (this.select) { | ||
@@ -356,3 +356,3 @@ const options = Array.from(this.select.options); | ||
reset = () => { | ||
public reset = () => { | ||
if (this.select) { | ||
@@ -379,3 +379,3 @@ Array.from(this.select.options).forEach((option) => { | ||
clear() { | ||
public clear() { | ||
if (this.select) { | ||
@@ -394,2 +394,6 @@ Array.from(this.select.options).forEach((option) => { | ||
public getSelectedOptions(): HTMLOptionElement[] { | ||
return Array.from(this.select?.selectedOptions ?? []); | ||
} | ||
static create(element: HTMLElement): ImprovedSelect { | ||
@@ -396,0 +400,0 @@ const instance = improvedSelectElementsMap.get(element); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82535
1446