/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { BaseButtonFoundation } from './base/base-button-foundation';
import { BUTTON_CONSTANTS } from './button-constants';
export class ButtonFoundation extends BaseButtonFoundation {
    constructor(adapter) {
        super(adapter);
        this._variant = 'text';
        this._pill = false;
        this._theme = 'primary';
        this._fullWidth = false;
    }
    initialize() {
        super.initialize();
        this._adapter.tryApplyGlobalConfiguration(['variant', 'dense']);
    }
    get variant() {
        return this._variant;
    }
    set variant(value) {
        if (this._variant !== value) {
            const previousVariant = this._variant;
            this._variant = value;
            if (this._variant === 'link') {
                this._adapter.toggleStateLayer(false);
            }
            else if (previousVariant === 'link') {
                this._adapter.toggleStateLayer(true);
            }
            this._adapter.setHostAttribute(BUTTON_CONSTANTS.attributes.VARIANT, this._variant);
        }
    }
    get pill() {
        return this._pill;
    }
    set pill(value) {
        if (this._pill !== value) {
            this._pill = value;
            this._adapter.toggleHostAttribute(BUTTON_CONSTANTS.attributes.PILL, this._pill);
        }
    }
    get theme() {
        return this._theme;
    }
    set theme(value) {
        if (this._theme !== value) {
            this._theme = value;
            this._adapter.setHostAttribute(BUTTON_CONSTANTS.attributes.THEME, this._theme);
        }
    }
    get fullWidth() {
        return this._fullWidth;
    }
    set fullWidth(value) {
        if (this._fullWidth !== value) {
            this._fullWidth = value;
            this._adapter.toggleHostAttribute(BUTTON_CONSTANTS.attributes.FULL_WIDTH, this._fullWidth);
        }
    }
}
