import { h } from "@stencil/core";
import { resolveJson } from "../../utils/utils";
export class PwcDynamicFormButtons {
    onConfigChanged(items) {
        this.resolvedItems = resolveJson(items);
    }
    componentWillLoad() {
        this.onConfigChanged(this.items);
    }
    constructButton(button) {
        return h("input", Object.assign({}, button));
    }
    render() {
        return (h("div", null, this.resolvedItems
            ? this.resolvedItems.map(button => this.constructButton(button))
            : ""));
    }
    static get is() { return "pwc-dynamic-form-buttons"; }
    static get originalStyleUrls() { return {
        "$": ["pwc-dynamic-form-buttons.css"]
    }; }
    static get styleUrls() { return {
        "$": ["pwc-dynamic-form-buttons.css"]
    }; }
    static get properties() { return {
        "items": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string | ButtonItemConfig[]",
                "resolved": "ButtonItemConfig[] | string",
                "references": {
                    "ButtonItemConfig": {
                        "location": "import",
                        "path": "./ButtonItemConfig"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "items",
            "reflect": false
        }
    }; }
    static get watchers() { return [{
            "propName": "items",
            "methodName": "onConfigChanged"
        }]; }
}
