fix(ts_web): resolve TypeScript nullability and event typing issues across web components
This commit is contained in:
@@ -85,7 +85,7 @@ export class DeesModal extends DeesElement {
|
||||
accessor heading = '';
|
||||
|
||||
@state({})
|
||||
accessor content: TemplateResult;
|
||||
accessor content!: TemplateResult;
|
||||
|
||||
@state({})
|
||||
accessor menuOptions: plugins.tsclass.website.IMenuItem<DeesModal>[] = [];
|
||||
@@ -94,10 +94,10 @@ export class DeesModal extends DeesElement {
|
||||
accessor width: 'small' | 'medium' | 'large' | 'fullscreen' | number = 'medium';
|
||||
|
||||
@property({ type: Number })
|
||||
accessor maxWidth: number;
|
||||
accessor maxWidth!: number;
|
||||
|
||||
@property({ type: Number })
|
||||
accessor minWidth: number;
|
||||
accessor minWidth!: number;
|
||||
|
||||
@property({ type: Boolean })
|
||||
accessor showCloseButton: boolean = true;
|
||||
@@ -106,7 +106,7 @@ export class DeesModal extends DeesElement {
|
||||
accessor showHelpButton: boolean = false;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor onHelp: () => void | Promise<void>;
|
||||
accessor onHelp!: () => void | Promise<void>;
|
||||
|
||||
@property({ type: Boolean })
|
||||
accessor mobileFullscreen: boolean = false;
|
||||
@@ -383,18 +383,18 @@ export class DeesModal extends DeesElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private windowLayer: DeesWindowLayer;
|
||||
private windowLayer!: DeesWindowLayer;
|
||||
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
|
||||
super.firstUpdated(_changedProperties);
|
||||
const domtools = await this.domtoolsPromise;
|
||||
await domtools.convenience.smartdelay.delayFor(30);
|
||||
const modal = this.shadowRoot.querySelector('.modal');
|
||||
modal.classList.add('show');
|
||||
const modal = this.shadowRoot!.querySelector('.modal');
|
||||
modal!.classList.add('show');
|
||||
}
|
||||
|
||||
public async handleOutsideClick(eventArg: MouseEvent) {
|
||||
eventArg.stopPropagation();
|
||||
const modalContainer = this.shadowRoot.querySelector('.modalContainer');
|
||||
const modalContainer = this.shadowRoot!.querySelector('.modalContainer');
|
||||
if (eventArg.target === modalContainer) {
|
||||
await this.destroy();
|
||||
}
|
||||
@@ -402,8 +402,8 @@ export class DeesModal extends DeesElement {
|
||||
|
||||
public async destroy() {
|
||||
const domtools = await this.domtoolsPromise;
|
||||
const modal = this.shadowRoot.querySelector('.modal');
|
||||
modal.classList.add('predestroy');
|
||||
const modal = this.shadowRoot!.querySelector('.modal');
|
||||
modal!.classList.add('predestroy');
|
||||
await domtools.convenience.smartdelay.delayFor(200);
|
||||
document.body.removeChild(this);
|
||||
await this.windowLayer.destroy();
|
||||
|
||||
Reference in New Issue
Block a user