/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { BaseComponentDelegate } from '../core/delegates/base-component-delegate';
import { LABEL_VALUE_CONSTANTS } from './label-value-constants';
export class LabelValueComponentDelegate extends BaseComponentDelegate {
    constructor(config) {
        super(config);
    }
    get labelElement() {
        return this._labelElement;
    }
    get valueElement() {
        return this._valueElement;
    }
    get labelText() {
        var _a;
        return (_a = this._labelElement.textContent) !== null && _a !== void 0 ? _a : '';
    }
    set labelText(value) {
        this._labelElement.textContent = value;
    }
    get valueText() {
        var _a;
        return (_a = this._valueElement.textContent) !== null && _a !== void 0 ? _a : '';
    }
    set valueText(value) {
        this._valueElement.textContent = value;
    }
    _build() {
        return document.createElement(LABEL_VALUE_CONSTANTS.elementName);
    }
    _configure() {
        var _a, _b, _c;
        if ((_a = this._config.options) === null || _a === void 0 ? void 0 : _a.labelText) {
            this._labelElement = this._createTextElement(this._config.options.labelText, 'label');
        }
        if ((_b = this._config.options) === null || _b === void 0 ? void 0 : _b.valueText) {
            this._valueElement = this._createTextElement(this._config.options.valueText, 'value');
        }
        if ((_c = this._config.options) === null || _c === void 0 ? void 0 : _c.iconElement) {
            this._element.appendChild(this._config.options.iconElement);
        }
    }
    _createTextElement(text, slot) {
        const span = document.createElement('span');
        span.textContent = text;
        span.slot = slot;
        this._element.appendChild(span);
        return span;
    }
}
