Modal Handler
Base Modal Handler
export class ModalHandler {
protected options: ModalOptions;
requester: Requester;
static label: string;
private readonly _modalCallbacks: ModalCallbacks[];
private readonly _internalCallbacks: ModalCallbacks;
$modal: JQuery = null;
retry: () => void = () => {};
constructor(requester: Requester, options: ModalOptions) {
// Constructor details
}
// Methods to show and close the modal
show(): void {}
close(): void {}
modalIsShowed(): boolean {
return false;
}
// Other protected methods for building modal types
protected build() {}
// More protected methods for building specific modal types
protected buildLoadingModal(_options: ModalLoadingOptions) {}
protected buildProgressModal(_options: ModalProgressOptions) {}
protected buildMessageModal(_options: ModalMessageOptions) {}
protected buildConfirmationModal(_options: ModalConfirmationOptions) {}
protected buildDataNeededModal(_options: ModalDataNeededOptions) {}
// Additional protected methods
protected buildIcon(): string {}
// Callbacks to customize modal behavior
get modalCallbacks(): ModalCallbacks {
return this._internalCallbacks;
}
set modalCallbacks(value: ModalCallbacks) {
this._modalCallbacks.push(value);
}
}Custom Modal Handler Example
Last updated
Was this helpful?