@limetech/lime-elements
Version:
64 lines (63 loc) • 1.55 kB
JavaScript
import { h } from '@stencil/core';
/**
* @slot - Content to put inside the surface
* @private
*/
export class PopoverSurface {
constructor() {
this.contentCollection = undefined;
}
componentDidLoad() {
this.appendElement();
}
render() {
return h("div", { class: "limel-popover-surface", tabindex: "0" });
}
appendElement() {
const portalContainer = this.host.shadowRoot.querySelector('.limel-popover-surface');
const childElementsCopy = [...this.contentCollection];
for (const child of childElementsCopy) {
if (child.slot === 'trigger') {
continue;
}
portalContainer.append(child);
}
}
static get is() { return "limel-popover-surface"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() {
return {
"$": ["popover-surface.scss"]
};
}
static get styleUrls() {
return {
"$": ["popover-surface.css"]
};
}
static get properties() {
return {
"contentCollection": {
"type": "unknown",
"mutable": false,
"complexType": {
"original": "HTMLCollection",
"resolved": "HTMLCollection",
"references": {
"HTMLCollection": {
"location": "global"
}
}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Content to render"
}
}
};
}
static get elementRef() { return "host"; }
}
//# sourceMappingURL=popover-surface.js.map