"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.ContentDialog = void 0;
const React = require("react");
const core_react_1 = require("@itwin/core-react");
const UiFramework_1 = require("../UiFramework");
/** Content Dialog React component uses the Dialog component with a modal={false} prop.
 * It controls the z-index to keep the focused dialog above content but below widgets.
 * @public
 * @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/dialog iTwinUI Dialog} instead.
 */
function ContentDialog(props) {
    const { className, children, dialogId, style, modal, modelessId, onModelessPointerDown, ...otherProps } = props;
    const [zIndex, setZIndex] = React.useState(UiFramework_1.UiFramework.content.dialogs.getZIndex(dialogId));
    const updateZIndex = React.useCallback(() => {
        const newZ = UiFramework_1.UiFramework.content.dialogs.getZIndex(dialogId);
        if (newZ !== zIndex) {
            setZIndex(newZ);
        }
    }, [dialogId, zIndex]);
    return (React.createElement(core_react_1.Dialog, { className: className, "data-item-type": "content-dialog", "data-item-id": dialogId, resizable: true, movable: true, trapFocus: false, modal: false, ...otherProps, modelessId: dialogId, onModelessPointerDown: (event) => UiFramework_1.UiFramework.content.dialogs.handlePointerDownEvent(event, dialogId, updateZIndex), style: { zIndex, ...style } }, children));
}
exports.ContentDialog = ContentDialog;
//# sourceMappingURL=ContentDialog.js.map