/*!
 * KoliBri - The accessible HTML-Standard
 */
import { __decorate } from "tslib";
import { h, Host } from "@stencil/core";
import { BaseWebComponent } from "../../../../internal/functional-components/base-web-component";
import { ClickButtonFC } from "../../../../internal/functional-components/click-button/component";
import { ClickButtonController } from "../../../../internal/functional-components/click-button/controller";
import { createCtaRef, delegateFocus } from "../../../../utils/element-interaction";
export class KolClickButton extends BaseWebComponent {
    constructor() {
        this.ctrl = new ClickButtonController(this.stateAccess);
        this.buttonRef = createCtaRef();
        super();
    }
    watchLabel(value) {
        this.ctrl.watchLabel(value);
    }
    async focus(options) { }
    componentWillLoad() {
        this.ctrl.componentWillLoad({
            label: this._label,
        });
    }
    render() {
        return (h(Host, { key: '922d574d34d7ff5632a9b5489bbf4b205f64f3bd' }, h(ClickButtonFC, { key: '3546de6fd6b08ff2c01efc46943cf26ce50252c4', label: this.ctrl.getRenderProp('label'), refButton: this.buttonRef, handleClick: this.ctrl.handleClick })));
    }
    static get is() { return "kol-click-button"; }
    static get encapsulation() { return "shadow"; }
    static get properties() {
        return {
            "_label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Sets the label of the click button component."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "_label"
            }
        };
    }
    static get methods() {
        return {
            "focus": {
                "complexType": {
                    "signature": "(options?: KolFocusOptions) => Promise<void>",
                    "parameters": [{
                            "name": "options",
                            "type": "KolFocusOptions | undefined",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "KolFocusOptions": {
                            "location": "import",
                            "path": "../../../../schema",
                            "id": "src/schema/index.ts::KolFocusOptions"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Focuses the interactive element of the component.",
                    "tags": []
                }
            }
        };
    }
    static get watchers() {
        return [{
                "propName": "_label",
                "methodName": "watchLabel"
            }];
    }
}
__decorate([
    delegateFocus('buttonRef')
], KolClickButton.prototype, "focus", null);
//# sourceMappingURL=component.js.map
