@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
96 lines (92 loc) • 3.54 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { B as BaseWebComponent } from './variant-quote.js';
import { T as TooltipFC } from './component.js';
import { T as TooltipController } from './controller.js';
const KolTooltipWc$1 = proxyCustomElement(class KolTooltipWc extends HTMLElement {
constructor(registerHost) {
super();
if (registerHost !== false) {
this.__registerHost();
}
this.controller = new TooltipController(BaseWebComponent.stateLess);
this._align = 'top';
}
validateAlign(value) {
var _a;
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.watchAlign(value);
}
validateId(value) {
var _a;
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.watchId(value);
}
validateLabel(value) {
var _a;
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.watchLabel(value);
}
hideTooltip() {
var _a;
return Promise.resolve((_a = this.controller) === null || _a === void 0 ? void 0 : _a.hideTooltip());
}
componentWillLoad() {
this.controller.componentWillLoad({
label: this._label,
align: this._align,
badgeText: this._badgeText,
id: this._id,
});
}
connectedCallback() {
var _a, _b, _c;
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.initContext(((_c = (_b = this.host) === null || _b === void 0 ? void 0 : _b.previousElementSibling) !== null && _c !== void 0 ? _c : undefined));
}
componentDidRender() {
var _a;
if (this.host) {
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.handleEventListeners(this.host);
}
}
disconnectedCallback() {
var _a;
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.destroy();
}
render() {
return (h(Host, { key: 'f677d58b886cdb9f1aab620608155ee412e0ef7d', class: "kol-tooltip" }, h(TooltipFC, { key: 'd86d1adc81a94fbb1116532e9f2529d96362834d', label: this.controller.getRenderProp('label'), badgeText: this._badgeText, id: this.controller.getRenderProp('id'), refFloating: (el) => { var _a; return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setTooltipElementRef(el); } })));
}
get host() { return this; }
static get watchers() { return {
"_align": ["validateAlign"],
"_id": ["validateId"],
"_label": ["validateLabel"]
}; }
}, [256, "kol-tooltip-wc", {
"_badgeText": [1, "_badge-text"],
"_align": [1],
"_id": [1],
"_label": [1],
"hideTooltip": [64]
}, undefined, {
"_align": ["validateAlign"],
"_id": ["validateId"],
"_label": ["validateLabel"]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["kol-tooltip-wc"];
components.forEach(tagName => { switch (tagName) {
case "kol-tooltip-wc":
if (!customElements.get(tagName)) {
customElements.define(tagName, KolTooltipWc$1);
}
break;
} });
}
const KolTooltipWc = KolTooltipWc$1;
const defineCustomElement = defineCustomElement$1;
export { KolTooltipWc, defineCustomElement };
//# sourceMappingURL=kol-tooltip-wc.js.map
//# sourceMappingURL=kol-tooltip-wc.js.map