"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.ModelessDialog = void 0;
const React = require("react");
const core_react_1 = require("@itwin/core-react");
const UiFramework_1 = require("../UiFramework");
/** Modeless Dialog React component uses the Dialog component with a modal={false} prop.
 * It controls the z-index to keep the focused dialog above others.
 * @public
 */
class ModelessDialog extends React.Component {
    constructor(props) {
        super(props);
        this._updateDialog = () => {
            this.forceUpdate();
        };
    }
    render() {
        const { dialogId, style, modal, modelessId, onModelessPointerDown, ...props } = this.props;
        return (React.createElement(core_react_1.Dialog, { ...props, modal: false, modelessId: dialogId, onModelessPointerDown: (event) => UiFramework_1.UiFramework.dialogs.modeless.handlePointerDownEvent(event, dialogId, this._updateDialog), style: {
                zIndex: UiFramework_1.UiFramework.dialogs.modeless.getZIndex(dialogId),
                ...style,
            } }, this.props.children));
    }
}
exports.ModelessDialog = ModelessDialog;
//# sourceMappingURL=ModelessDialog.js.map