"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/* eslint-disable deprecation/deprecation */
/** @packageDocumentation
 * @module Zone
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZoneDef = exports.ZoneState = void 0;
const WidgetHost_1 = require("../widgets/WidgetHost");
const Zone_1 = require("./Zone");
/** Zone State enum.
 * @public @deprecated in 3.0. UI 1.0 will be removed in AppUi 4.0.
 */
var ZoneState;
(function (ZoneState) {
    ZoneState[ZoneState["Off"] = 0] = "Off";
    ZoneState[ZoneState["Minimized"] = 1] = "Minimized";
    ZoneState[ZoneState["Open"] = 2] = "Open";
    ZoneState[ZoneState["Popup"] = 3] = "Popup";
    ZoneState[ZoneState["Floating"] = 4] = "Floating";
})(ZoneState = exports.ZoneState || (exports.ZoneState = {}));
/**
 * A ZoneDef represents each zone within a Frontstage.
 * @deprecated in 3.6. Use [[StagePanelDef]] or [[WidgetDef]] instead.
 * @public
 */
class ZoneDef extends WidgetHost_1.WidgetHost {
    /** Constructor for ZoneDef.
     */
    constructor() {
        super();
        this._initialWidth = undefined;
        this._zoneState = ZoneState.Open;
        this._allowsMerging = false;
        this._zoneLocation = Zone_1.ZoneLocation.TopLeft;
    }
    /** Zone state.  Defaults to ZoneState.Open. @deprecated in 3.0.  UI 1.0 will be removed in AppUi 4.0.*/
    get zoneState() { return this._zoneState; }
    /** Indicates if other Zones may be merged with this Zone. Defaults to false. @deprecated in 3.0.  UI 1.0 will be removed in AppUi 4.0.*/
    get allowsMerging() { return this._allowsMerging; }
    /** Any application data to attach to this Zone. */
    get applicationData() { return this._applicationData; }
    /** Indicates with which other zone to merge. @deprecated in 3.0.  UI 1.0 will be removed in AppUi 4.0.*/
    get mergeWithZone() { return this._mergeWithZone; }
    /** The Zone's location.
     * @internal
     */
    get zoneLocation() { return this._zoneLocation; }
    set zoneLocation(zoneLocation) { this._zoneLocation = zoneLocation; }
    /** Initial zone width. */
    get initialWidth() {
        return this._initialWidth;
    }
    /** Determines if this Zone is for Tool Settings. */
    get isToolSettings() {
        const singleWidgetDef = this.getSingleWidgetDef();
        if (singleWidgetDef)
            return singleWidgetDef.isToolSettings;
        return false;
    }
    /** Determines if this Zone is for the Status Bar. */
    get isStatusBar() {
        const singleWidgetDef = this.getSingleWidgetDef();
        if (singleWidgetDef)
            return singleWidgetDef.isStatusBar;
        return false;
    }
    /** Determines if the Zone should fill the available space. */
    get shouldFillZone() {
        return this.widgetDefs.some((widgetDef) => widgetDef.fillZone);
    }
    /** @internal */
    setInitialWidth(width) {
        this._initialWidth = width;
    }
    /** @internal */
    initializeFromProps(props) {
        if (props.defaultState)
            this._zoneState = props.defaultState;
        if (props.allowsMerging !== undefined)
            this._allowsMerging = props.allowsMerging;
        this._applicationData = props.applicationData;
        if (props.mergeWithZone !== undefined)
            this._mergeWithZone = props.mergeWithZone;
        this.setInitialWidth(props.initialWidth);
    }
}
exports.ZoneDef = ZoneDef;
//# sourceMappingURL=ZoneDef.js.map