/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { BaseComponentDelegate } from '../core/delegates/base-component-delegate';
import { FLOATING_ACTION_BUTTON_CONSTANTS } from './floating-action-button-constants';
export class FloatingActionButtonComponentDelegate extends BaseComponentDelegate {
    constructor(config) {
        super(config);
    }
    destroy() {
        this._buttonElement = undefined;
    }
    _build() {
        var _a, _b;
        const component = document.createElement(FLOATING_ACTION_BUTTON_CONSTANTS.elementName);
        this._buttonElement = document.createElement('button');
        this._buttonElement.type = 'button';
        this._buttonElement.textContent = (_b = (_a = this._config.options) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '';
        component.appendChild(this._buttonElement);
        return component;
    }
    onClick(listener) {
        var _a;
        (_a = this._buttonElement) === null || _a === void 0 ? void 0 : _a.addEventListener('click', listener);
    }
    onFocus(listener) {
        var _a;
        (_a = this._buttonElement) === null || _a === void 0 ? void 0 : _a.addEventListener('focus', evt => listener(evt));
    }
    onBlur(listener) {
        var _a;
        (_a = this._buttonElement) === null || _a === void 0 ? void 0 : _a.addEventListener('blur', evt => listener(evt));
    }
}
