/*!
 * KoliBri - The accessible HTML-Standard
 */
'use strict';

var index = require('./index-DBbl8tEq.js');
var tslib_es6 = require('./tslib.es6-Cm0ytgPY.js');
var variantQuote = require('./variant-quote-DUWZtljE.js');
var component = require('./component-EJOcQRXl.js');
require('./common-DAAt5YQ7.js');
var label = require('./label-CrUhy8f0.js');
var baseController = require('./base-controller-DAzsTqX9.js');
var elementInteraction = require('./element-interaction-CmOQWzhR.js');
require('./normalizers-R90MJyQR.js');
require('./_Uint8Array-BAQUGozM.js');
require('./isArray-BOIOdEQh.js');
require('./bem-registry-D9uDM1GJ.js');
require('./element-focus-B4BhAkh_.js');

const clickButtonPropsConfig = {
    required: [label.labelProp],
};

class ClickButtonController extends baseController.BaseController {
    constructor(stateAccess) {
        super(stateAccess, clickButtonPropsConfig);
        this.handleClick = () => {
            console.log(this, 'button clicked');
        };
    }
    componentWillLoad(props) {
        const { label } = props;
        this.watchLabel(label);
    }
    watchLabel(value) {
        label.labelProp.apply(value, (v) => {
            this.setRenderProp('label', v);
        });
    }
}

const KolClickButton = class extends variantQuote.BaseWebComponent {
    constructor(hostRef) {
        super();
        index.registerInstance(this, hostRef);
        this.ctrl = new ClickButtonController(this.stateAccess);
        this.buttonRef = elementInteraction.createCtaRef();
    }
    watchLabel(value) {
        this.ctrl.watchLabel(value);
    }
    async focus(options) { }
    componentWillLoad() {
        this.ctrl.componentWillLoad({
            label: this._label,
        });
    }
    render() {
        return (index.h(index.Host, { key: '922d574d34d7ff5632a9b5489bbf4b205f64f3bd' }, index.h(component.ClickButtonFC, { key: '3546de6fd6b08ff2c01efc46943cf26ce50252c4', label: this.ctrl.getRenderProp('label'), refButton: this.buttonRef, handleClick: this.ctrl.handleClick })));
    }
    static get watchers() { return {
        "_label": ["watchLabel"]
    }; }
};
tslib_es6.__decorate([
    elementInteraction.delegateFocus('buttonRef')
], KolClickButton.prototype, "focus", null);

exports.kol_click_button = KolClickButton;
//# sourceMappingURL=kol-click-button.entry.cjs.js.map
