mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
31 lines
693 B
TypeScript
31 lines
693 B
TypeScript
export function getTemplateHTML() {
|
|
return /* html */ `
|
|
<style>
|
|
:host {
|
|
display: block;
|
|
}
|
|
|
|
media-container {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
</style>
|
|
<slot></slot>
|
|
`;
|
|
}
|
|
|
|
export class MediaSkinElement extends HTMLElement {
|
|
static shadowRootOptions = { mode: 'open' as ShadowRootMode };
|
|
static getTemplateHTML: () => string = getTemplateHTML;
|
|
|
|
constructor() {
|
|
super();
|
|
|
|
if (!this.shadowRoot) {
|
|
this.attachShadow((this.constructor as typeof MediaSkinElement).shadowRootOptions);
|
|
this.shadowRoot!.innerHTML = (this.constructor as typeof MediaSkinElement).getTemplateHTML();
|
|
}
|
|
}
|
|
}
|