/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { getShadowElement, removeClass, toggleClass } from '@tylertech/forge-core';
import { BaseAdapter } from '../core/base/base-adapter';
import { LABEL_VALUE_CONSTANTS } from './label-value-constants';
export class LabelValueAdapter extends BaseAdapter {
    constructor(component) {
        super(component);
        this._rootElement = getShadowElement(component, LABEL_VALUE_CONSTANTS.selectors.ROOT);
    }
    setEmpty(isEmpty) {
        if (isEmpty) {
            this._rootElement.classList.add(LABEL_VALUE_CONSTANTS.classes.EMPTY);
        }
        else {
            this._rootElement.classList.remove(LABEL_VALUE_CONSTANTS.classes.EMPTY);
        }
    }
    setEllipsis(ellipsis) {
        if (ellipsis) {
            this._rootElement.classList.add(LABEL_VALUE_CONSTANTS.classes.ELLIPSIS);
        }
        else {
            this._rootElement.classList.remove(LABEL_VALUE_CONSTANTS.classes.ELLIPSIS);
        }
    }
    setRoomy(isRoomy) {
        toggleClass(this._rootElement, isRoomy, LABEL_VALUE_CONSTANTS.classes.ROOMY);
    }
    setDense(isDense) {
        toggleClass(this._rootElement, isDense, LABEL_VALUE_CONSTANTS.classes.DENSE);
    }
    setAlignment(value) {
        removeClass([LABEL_VALUE_CONSTANTS.classes.ALIGN_CENTER, LABEL_VALUE_CONSTANTS.classes.ALIGN_RIGHT], this._rootElement);
        switch (value) {
            case 'center':
                this._rootElement.classList.add(LABEL_VALUE_CONSTANTS.classes.ALIGN_CENTER);
                break;
            case 'right':
                this._rootElement.classList.add(LABEL_VALUE_CONSTANTS.classes.ALIGN_RIGHT);
                break;
        }
    }
}
