@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
216 lines (215 loc) • 7.73 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { h } from "@stencil/core";
import { KolTreeItemWcTag } from "../../core/component-names";
export class KolTreeItem {
async focus() {
var _a;
return Promise.resolve((_a = this.element) === null || _a === void 0 ? void 0 : _a.focus());
}
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: '6b16bce6aa837018f8b321f84134e7f7c9e8262b', _active: this._active, _label: this._label, _open: this._open, _href: this._href, ref: (element) => (this.element = element) }, h("slot", { key: '93f4a2498abbbb3c2ab1494314de3200cea827d4' })));
}
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": "() => Promise<any>",
"parameters": [],
"references": {
"Promise": {
"location": "global",
"id": "global::Promise"
}
},
"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