"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.ModelessDialogManager = exports.ModelessDialogRenderer = void 0;
const React = require("react");
const DialogManagerBase_1 = require("./DialogManagerBase");
const InternalModelessDialogManager_1 = require("./InternalModelessDialogManager");
// cSpell:ignore ZINDEX modeless
/** ModelessDialogRenderer React component renders modeless dialogs.
 * @public
 */
class ModelessDialogRenderer extends React.PureComponent {
    constructor(props) {
        super(props);
    }
    render() {
        return (React.createElement(DialogManagerBase_1.DialogRendererBase, { ...this.props, dialogManager: InternalModelessDialogManager_1.InternalModelessDialogManager.dialogManager }));
    }
}
exports.ModelessDialogRenderer = ModelessDialogRenderer;
/** Modeless Dialog Manager class displays and manages multiple modeless dialogs
 * @public
 * @deprecated in 3.7. Use `UiFramework.dialogs.modeless` property.
 */
class ModelessDialogManager {
    /** Initialize the modeless dialog manager
     * @deprecated in 3.7. This is called internally.
    */
    static initialize() {
        InternalModelessDialogManager_1.InternalModelessDialogManager.initialize();
    }
    /** Modeless Dialog Changed Event */
    static get onModelessDialogChangedEvent() { return InternalModelessDialogManager_1.InternalModelessDialogManager.onModelessDialogChangedEvent; }
    /** @internal */
    static get dialogManager() { return InternalModelessDialogManager_1.InternalModelessDialogManager.dialogManager; }
    /** Get the array of modeless dialogs */
    static get dialogs() { return InternalModelessDialogManager_1.InternalModelessDialogManager.dialogs; }
    /** Open a modeless dialog
       * @param dialog The Dialog to open
       * @param id The id of the Dialog to open
       */
    static openDialog(dialog, id, parentDocument = document) {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.open(dialog, id, parentDocument);
    }
    /** Close a modeless dialog
       * @param id The id of the Dialog to close.
       */
    static closeDialog(id) {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.close(id);
    }
    /** @internal */
    static closeAll() {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.closeAll();
    }
    /** Update the dialogs */
    static update() {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.update();
    }
    /** Get the active modeless dialog */
    static get activeDialog() {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.active;
    }
    /** Get the count of modeless dialogs */
    static get dialogCount() {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.count;
    }
    /** Handle a pointer down event on a modeless dialog */
    static handlePointerDownEvent(_event, id, updateFunc) {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.handlePointerDownEvent(_event, id, updateFunc);
    }
    /** Get the z-index for a modeless dialog */
    static getDialogZIndex(id) {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.getZIndex(id);
    }
    static getDialogInfo(id) {
        return InternalModelessDialogManager_1.InternalModelessDialogManager.getInfo(id);
    }
}
exports.ModelessDialogManager = ModelessDialogManager;
//# sourceMappingURL=ModelessDialogManager.js.map