/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { addClass, calcSizeUnattached, removeClass } from '@tylertech/forge-core';
export class FloatingLabelAdapter {
    constructor(_labelElement) {
        this._labelElement = _labelElement;
    }
    addLabelClass(className) {
        addClass(className, this._labelElement);
    }
    removeLabelClass(className) {
        removeClass(className, this._labelElement);
    }
    hasLabelClass(className) {
        return this._labelElement.classList.contains(className);
    }
    getWidth() {
        if (this._labelElement.offsetParent != null) {
            return this._labelElement.scrollWidth;
        }
        return calcSizeUnattached(this._labelElement).width;
    }
    addLabelListener(type, listener) {
        this._labelElement.addEventListener(type, listener);
    }
    removeLabelListener(type, listener) {
        this._labelElement.removeEventListener(type, listener);
    }
}
