/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { FloatingLabelAdapter } from './floating-label-adapter';
import { FloatingLabelFoundation } from './floating-label-foundation';
export class FloatingLabel {
    constructor(_labelElement) {
        this._labelElement = _labelElement;
        this._foundation = new FloatingLabelFoundation(new FloatingLabelAdapter(this._labelElement));
        this._foundation.initialize();
    }
    /** Returns the current label floating state. */
    get isFloating() {
        return this._foundation.isFloating;
    }
    destroy({ cancelFloat = false } = {}) {
        this._foundation.disconnect({ cancelFloat });
        this._labelElement = undefined;
    }
    /**
     * Sets the floating state of the label element.
     * @param shouldFloat If true, sets the label to float, otherwise un-float.
     * @param alwaysFloat If true, sets the label to always float, defaults to: `false`.
     */
    float(shouldFloat, alwaysFloat = false) {
        this._foundation.float(shouldFloat, alwaysFloat);
    }
    /** Returns the scroll width of the label element. */
    getWidth() {
        return this._foundation.getWidth();
    }
}
