`;
}
private _openDrawer() {
this.open = true;
}
private _closeDrawer(e: Event, returnValue: string) {
if (
!this.beforeClose ||
(this.beforeClose && this.beforeClose(returnValue))
) {
this.open = false;
this._dialog.returnValue = returnValue;
this._emitCloseEvent(e);
}
}
private _emitCloseEvent(e: Event) {
const event = new CustomEvent('on-close', {
detail: {
returnValue: this._dialog.returnValue,
origEvent: e,
},
});
this.dispatchEvent(event);
}
override updated(changedProps: any) {
if (changedProps.has('open')) {
if (this.open) {
this._dialog.showModal();
} else {
this._dialog.close();
}
}
}
}
declare global {
interface HTMLElementTagNameMap {
'kyn-side-drawer': SideDrawer;
}
}