/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { LABEL_VALUE_CONSTANTS } from './label-value-constants';
export class LabelValueFoundation {
    constructor(_adapter) {
        this._adapter = _adapter;
        this._empty = false;
        this._ellipsis = false;
        this._density = 'default';
        this._align = 'left';
    }
    initialize() {
        this._adapter.setEmpty(this._empty);
        this._adapter.setEllipsis(this._ellipsis);
        this._applyDensity();
        this._adapter.setAlignment(this._align);
    }
    _applyDensity() {
        this._adapter.setRoomy(this._density === 'roomy');
        this._adapter.setDense(this._density === 'dense');
    }
    get empty() {
        return this._empty;
    }
    set empty(value) {
        if (this._empty !== value) {
            this._empty = value;
            this._adapter.setEmpty(this._empty);
            if (this._empty) {
                this._adapter.setHostAttribute(LABEL_VALUE_CONSTANTS.attributes.EMPTY, '');
            }
            else {
                this._adapter.removeHostAttribute(LABEL_VALUE_CONSTANTS.attributes.EMPTY);
            }
        }
    }
    get ellipsis() {
        return this._ellipsis;
    }
    set ellipsis(value) {
        if (this._ellipsis !== value) {
            this._ellipsis = value;
            this._adapter.setEllipsis(this._ellipsis);
            if (this._ellipsis) {
                this._adapter.setHostAttribute(LABEL_VALUE_CONSTANTS.attributes.ELLIPSIS, '');
            }
            else {
                this._adapter.removeHostAttribute(LABEL_VALUE_CONSTANTS.attributes.ELLIPSIS);
            }
        }
    }
    get density() {
        return this._density;
    }
    set density(value) {
        if (this._density !== value) {
            this._density = value;
            this._applyDensity();
            this._adapter.setHostAttribute(LABEL_VALUE_CONSTANTS.attributes.DENSITY, this._density.toString());
        }
    }
    get align() {
        return this._align;
    }
    set align(value) {
        if (this._align !== value) {
            this._align = value;
            this._adapter.setAlignment(this._align);
            if (this._align) {
                this._adapter.setHostAttribute(LABEL_VALUE_CONSTANTS.attributes.ALIGN, this._align);
            }
            else {
                this._adapter.removeHostAttribute(LABEL_VALUE_CONSTANTS.attributes.ALIGN);
            }
        }
    }
}
