"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 Item
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ItemDefBase = void 0;
const PropsHelper_1 = require("../utils/PropsHelper");
/** The base class for Items.
 * @public
 */
class ItemDefBase {
    get isActive() {
        return this._isActive;
    }
    set isActive(v) {
        this._isActive = v;
    }
    static initializeDef(me, itemProps) {
        me.isHidden = itemProps.isHidden;
        me.isDisabled = itemProps.isDisabled;
        me.isPressed =
            itemProps.isPressed !== undefined ? itemProps.isPressed : false;
        me.isActive = itemProps.isActive !== undefined ? itemProps.isActive : false;
        me.badgeType = itemProps.badgeType;
        if (itemProps.applicationData !== undefined)
            me.applicationData = itemProps.applicationData;
        if (itemProps.iconSpec)
            me.iconSpec = itemProps.iconSpec;
        if (itemProps.icon)
            me.iconSpec = itemProps.icon;
        me._label = PropsHelper_1.PropsHelper.getStringSpec(itemProps.label, itemProps.labelKey);
        me._tooltip = PropsHelper_1.PropsHelper.getStringSpec(itemProps.tooltip, itemProps.tooltipKey);
        me._description = PropsHelper_1.PropsHelper.getStringSpec(itemProps.description, itemProps.descriptionKey);
    }
    constructor(itemProps) {
        this._label = "";
        this._tooltip = "";
        this._description = "";
        this.isPressed = false;
        this._isActive = false;
        ItemDefBase.initializeDef(this, itemProps);
    }
    get trayId() {
        return undefined;
    }
    /** Get the label string */
    get rawLabel() {
        return this._label;
    }
    /** Get the label string */
    get label() {
        return PropsHelper_1.PropsHelper.getStringFromSpec(this._label);
    }
    /** Set the label.
     * @param v A string or a function to get the string.
     */
    setLabel(v) {
        this._label = v;
    }
    /** Get the tooltip string */
    get tooltip() {
        return PropsHelper_1.PropsHelper.getStringFromSpec(this._tooltip);
    }
    /** Set the tooltip.
     * @param v A string or a function to get the string.
     */
    setTooltip(v) {
        this._tooltip = v;
    }
    /** Get the description string */
    get description() {
        return PropsHelper_1.PropsHelper.getStringFromSpec(this._description);
    }
    /** Set the description.
     * @param v A string or a function to get the string.
     */
    setDescription(v) {
        this._description = v;
    }
}
exports.ItemDefBase = ItemDefBase;
//# sourceMappingURL=ItemDefBase.js.map