mirror of
https://github.com/flarum/core.git
synced 2025-08-11 19:04:29 +02:00
Bundled output for commit 7db2d0f697
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
This commit is contained in:
@@ -1,19 +1,39 @@
|
||||
import Modal from '../components/Modal';
|
||||
/**
|
||||
* Class used to manage modal state.
|
||||
*
|
||||
* Accessible on the `app` object via `app.modal` property.
|
||||
*/
|
||||
export default class ModalManagerState {
|
||||
modal: {
|
||||
componentClass: any;
|
||||
attrs: any;
|
||||
} | null;
|
||||
/**
|
||||
* Show a modal dialog.
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
*/
|
||||
public show(componentClass: any, attrs: any): void;
|
||||
modal: null | {
|
||||
componentClass: typeof Modal;
|
||||
attrs?: Record<string, unknown>;
|
||||
};
|
||||
private closeTimeout?;
|
||||
/**
|
||||
* Close the modal dialog.
|
||||
* Shows a modal dialog.
|
||||
*
|
||||
* @public
|
||||
* If a modal is already open, the existing one will close and the new modal will replace it.
|
||||
*
|
||||
* @example <caption>Show a modal</caption>
|
||||
* app.modal.show(MyCoolModal, { attr: 'value' });
|
||||
*
|
||||
* @example <caption>Show a modal from a lifecycle method (`oncreate`, `view`, etc.)</caption>
|
||||
* // This "hack" is needed due to quirks with nested redraws in Mithril.
|
||||
* setTimeout(() => app.modal.show(MyCoolModal, { attr: 'value' }), 0);
|
||||
*/
|
||||
public close(): void;
|
||||
closeTimeout: number | undefined;
|
||||
show(componentClass: typeof Modal, attrs?: Record<string, unknown>): void;
|
||||
/**
|
||||
* Closes the currently open dialog, if one is open.
|
||||
*/
|
||||
close(): void;
|
||||
/**
|
||||
* Checks if a modal is currently open.
|
||||
*
|
||||
* @returns `true` if a modal dialog is currently open, otherwise `false`.
|
||||
*/
|
||||
isModalOpen(): boolean;
|
||||
}
|
||||
|
Reference in New Issue
Block a user