kopia lustrzana https://github.com/shoelace-style/shoelace
Rename var for consistency
rodzic
2ee128a75d
commit
777d8e540d
src/components
|
@ -23,7 +23,7 @@ const toastStack = Object.assign(document.createElement('div'), { className: 'sl
|
|||
export class Alert {
|
||||
alert: HTMLElement;
|
||||
autoHideTimeout: any;
|
||||
isShowing = false;
|
||||
isVisible = false;
|
||||
|
||||
@Element() host: HTMLSlAlertElement;
|
||||
|
||||
|
@ -81,7 +81,7 @@ export class Alert {
|
|||
@Method()
|
||||
async show() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (this.isShowing) {
|
||||
if (this.isVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ export class Alert {
|
|||
|
||||
this.host.hidden = false;
|
||||
this.host.clientWidth; // force a reflow
|
||||
this.isShowing = true;
|
||||
this.isVisible = true;
|
||||
this.open = true;
|
||||
|
||||
if (this.duration < Infinity) {
|
||||
|
@ -105,7 +105,7 @@ export class Alert {
|
|||
@Method()
|
||||
async hide() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (!this.isShowing) {
|
||||
if (!this.isVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ export class Alert {
|
|||
}
|
||||
|
||||
clearTimeout(this.autoHideTimeout);
|
||||
this.isShowing = false;
|
||||
this.isVisible = false;
|
||||
this.open = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ export class Details {
|
|||
componentId = `details-${++id}`;
|
||||
details: HTMLElement;
|
||||
header: HTMLElement;
|
||||
isShowing = false;
|
||||
isVisible = false;
|
||||
|
||||
/** Indicates whether or not the details is open. You can use this in lieu of the show/hide methods. */
|
||||
@Prop({ mutable: true, reflect: true }) open = false;
|
||||
|
@ -78,7 +78,7 @@ export class Details {
|
|||
@Method()
|
||||
async show() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (this.isShowing) {
|
||||
if (this.isVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ export class Details {
|
|||
this.body.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
this.isShowing = true;
|
||||
this.isVisible = true;
|
||||
this.open = true;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ export class Details {
|
|||
@Method()
|
||||
async hide() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (!this.isShowing) {
|
||||
if (!this.isVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ export class Details {
|
|||
this.body.style.height = '0';
|
||||
});
|
||||
|
||||
this.isShowing = false;
|
||||
this.isVisible = false;
|
||||
this.open = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ let id = 0;
|
|||
})
|
||||
export class Dropdown {
|
||||
componentId = `dropdown-${++id}`;
|
||||
isShowing = false;
|
||||
isVisible = false;
|
||||
panel: HTMLElement;
|
||||
positioner: HTMLElement;
|
||||
popover: Popover;
|
||||
|
@ -145,7 +145,7 @@ export class Dropdown {
|
|||
@Method()
|
||||
async show() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (this.isShowing) {
|
||||
if (this.isVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ export class Dropdown {
|
|||
document.addEventListener('keydown', this.handleDocumentKeyDown);
|
||||
document.addEventListener('mousedown', this.handleDocumentMouseDown);
|
||||
|
||||
this.isShowing = true;
|
||||
this.isVisible = true;
|
||||
this.open = true;
|
||||
this.popover.show();
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ export class Dropdown {
|
|||
@Method()
|
||||
async hide() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (!this.isShowing) {
|
||||
if (!this.isVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ export class Dropdown {
|
|||
document.addEventListener('keydown', this.handleDocumentKeyDown);
|
||||
document.removeEventListener('mousedown', this.handleDocumentMouseDown);
|
||||
|
||||
this.isShowing = false;
|
||||
this.isVisible = false;
|
||||
this.open = false;
|
||||
this.popover.hide();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue