"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Dialog
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModalDialogManager = exports.ModalDialogRenderer = void 0;
const React = require("react");
const DialogManagerBase_1 = require("./DialogManagerBase");
const InternalModalDialogManager_1 = require("./InternalModalDialogManager");
/** ModalDialogRenderer React component renders modal dialogs
 * @public
 */
class ModalDialogRenderer extends React.PureComponent {
    constructor(props) {
        super(props);
    }
    render() {
        return (React.createElement(DialogManagerBase_1.DialogRendererBase, { ...this.props, dialogManager: InternalModalDialogManager_1.InternalModalDialogManager.dialogManager }));
    }
}
exports.ModalDialogRenderer = ModalDialogRenderer;
/** Modal Dialog Manager class displays and manages multiple modal dialogs
 * @public
 * @deprecated in 3.7. Use `UiFramework.dialogs.modal` property.
 */
class ModalDialogManager {
    /** Modal Dialog Changed Event */
    static get onModalDialogChangedEvent() { return InternalModalDialogManager_1.InternalModalDialogManager.onModalDialogChangedEvent; }
    /** @internal */
    static get dialogManager() { return InternalModalDialogManager_1.InternalModalDialogManager.dialogManager; }
    /** Get the array of modal dialogs */
    static get dialogs() { return InternalModalDialogManager_1.InternalModalDialogManager.dialogs; }
    /** Open a modal dialog
     * @param dialog The Dialog to open
     * @param id The id of the Dialog. If one is not provided, an id is generated.
     * @param parentDocument The Document used to determine the owning window.
     */
    static openDialog(dialog, id, parentDocument = document) {
        InternalModalDialogManager_1.InternalModalDialogManager.open(dialog, id, parentDocument);
    }
    /** Close a modal dialog
     * @param dialog The Dialog to open. If one is not specified, the active dialog will be closed.
     */
    static closeDialog(dialog) {
        InternalModalDialogManager_1.InternalModalDialogManager.close(dialog);
    }
    /** @internal */
    static closeAll() {
        InternalModalDialogManager_1.InternalModalDialogManager.closeAll();
    }
    /** Update the dialogs */
    static update() {
        InternalModalDialogManager_1.InternalModalDialogManager.update();
    }
    /** Get the active modal dialog */
    static get activeDialog() {
        return InternalModalDialogManager_1.InternalModalDialogManager.active;
    }
    /** Get the count of modal dialogs */
    static get dialogCount() {
        return InternalModalDialogManager_1.InternalModalDialogManager.count;
    }
}
exports.ModalDialogManager = ModalDialogManager;
//# sourceMappingURL=ModalDialogManager.js.map