/*!
 * KoliBri - The accessible HTML-Standard
 */
import { h } from "@stencil/core";
import { KolTreeItemWcTag } from "../../core/component-names";
export class KolTreeItem {
    async focus(options) {
        var _a;
        return (_a = this.element) === null || _a === void 0 ? void 0 : _a.focus(options);
    }
    async expand() {
        var _a;
        return Promise.resolve((_a = this.element) === null || _a === void 0 ? void 0 : _a.expand());
    }
    async collapse() {
        var _a;
        return Promise.resolve((_a = this.element) === null || _a === void 0 ? void 0 : _a.collapse());
    }
    async isOpen() {
        var _a, _b;
        return (_b = (await ((_a = this.element) === null || _a === void 0 ? void 0 : _a.isOpen()))) !== null && _b !== void 0 ? _b : false;
    }
    render() {
        return (h(KolTreeItemWcTag, { key: '25b3875f49f3f7356796ff41376b5fffda1a0231', _active: this._active, _label: this._label, _open: this._open, _href: this._href, ref: (element) => (this.element = element) }, h("slot", { key: '00007ca55b586bdfa89bc54585c20f2c4d89ecec' })));
    }
    static get is() { return "kol-tree-item"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "default": ["./style.scss"]
        };
    }
    static get styleUrls() {
        return {
            "default": ["style.css"]
        };
    }
    static get properties() {
        return {
            "_active": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "OpenPropType",
                    "resolved": "boolean | undefined",
                    "references": {
                        "OpenPropType": {
                            "location": "import",
                            "path": "../../schema",
                            "id": "src/schema/index.ts::OpenPropType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If set (to true) the tree item is the active one."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "_active"
            },
            "_label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "LabelPropType",
                    "resolved": "string",
                    "references": {
                        "LabelPropType": {
                            "location": "import",
                            "path": "../../schema",
                            "id": "src/schema/index.ts::LabelPropType"
                        }
                    }
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.)."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "_label"
            },
            "_open": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "OpenPropType",
                    "resolved": "boolean | undefined",
                    "references": {
                        "OpenPropType": {
                            "location": "import",
                            "path": "../../schema",
                            "id": "src/schema/index.ts::OpenPropType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Opens/expands the element when truthy, closes/collapses when falsy."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "_open"
            },
            "_href": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "HrefPropType",
                    "resolved": "string",
                    "references": {
                        "HrefPropType": {
                            "location": "import",
                            "path": "../../schema",
                            "id": "src/schema/index.ts::HrefPropType"
                        }
                    }
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Defines the target URI of the link."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "_href"
            }
        };
    }
    static get methods() {
        return {
            "focus": {
                "complexType": {
                    "signature": "(options?: KolFocusOptions) => Promise<any>",
                    "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<any>"
                },
                "docs": {
                    "text": "Focuses the link element.",
                    "tags": []
                }
            },
            "expand": {
                "complexType": {
                    "signature": "() => Promise<void | undefined>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void | undefined>"
                },
                "docs": {
                    "text": "Expands the tree item.",
                    "tags": []
                }
            },
            "collapse": {
                "complexType": {
                    "signature": "() => Promise<void | undefined>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void | undefined>"
                },
                "docs": {
                    "text": "Collapses the tree item.",
                    "tags": []
                }
            },
            "isOpen": {
                "complexType": {
                    "signature": "() => Promise<boolean>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<boolean>"
                },
                "docs": {
                    "text": "Returns whether the tree item is expanded.",
                    "tags": []
                }
            }
        };
    }
}
//# sourceMappingURL=shadow.js.map
