import { h } from "@stencil/core";
/**
 * Displays a label and a set of buttons, also allowing a default selection of a button.
 *
 * ```ts
 * <verdocs-toggle options={[...options]} theme="light"></verdocs-toggle>
 * ```
 */
export class VerdocsToggle {
    constructor() {
        this.selectedOption = 0;
    }
    componentWillLoad() {
        var _a;
        console.log('verdocs-toggle componentWillLoad', this.options);
        this.selectedOption = ((_a = this.options) === null || _a === void 0 ? void 0 : _a.defaultSelection) || 0;
    }
    render() {
        return (h("div", { key: '31aac06c36d64cec8c297593fbf81cbf53dba179', class: "container" }, h("span", { key: 'b289e9a9d8081c64542bdf8c1c98c315cef22a9a', class: "label" }, `${this.options.label}:`), h("div", { key: '5b6de07895d3c2f871d254dbfd6f7d2034128b77', class: "buttons" }, this.options.buttons.map((button, index) => (h("button", { id: button.id, key: button.id, innerHTML: button.icon, class: index === this.selectedOption ? 'selected' : '', onClick: () => {
                console.log('clicked', index);
                this.selectedOption = index;
            } }))))));
    }
    static get is() { return "verdocs-toggle"; }
    static get originalStyleUrls() {
        return {
            "$": ["verdocs-toggle.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["verdocs-toggle.css"]
        };
    }
    static get properties() {
        return {
            "options": {
                "type": "unknown",
                "attribute": "options",
                "mutable": false,
                "complexType": {
                    "original": "IToggleIconButtons",
                    "resolved": "IToggleIconButtons",
                    "references": {
                        "IToggleIconButtons": {
                            "location": "local",
                            "path": "/Users/chad/projects/verdocs/web-sdk/verdocs-web-sdk/src/components/controls/verdocs-toggle/verdocs-toggle.tsx",
                            "id": "src/components/controls/verdocs-toggle/verdocs-toggle.tsx::IToggleIconButtons"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The tags to display"
                },
                "getter": false,
                "setter": false
            },
            "theme": {
                "type": "string",
                "attribute": "theme",
                "mutable": false,
                "complexType": {
                    "original": "'light' | 'dark'",
                    "resolved": "\"dark\" | \"light\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The \"theme\" to be used"
                },
                "getter": false,
                "setter": false,
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "selectedOption": {}
        };
    }
}
//# sourceMappingURL=verdocs-toggle.js.map
