@boulevard/cdk
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
{ | ||
"name": "@boulevard/cdk", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"description": "Component development kit.", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
@@ -0,11 +1,10 @@ | ||
import { render } from 'lit-html'; | ||
import { customElement, LitElement, PropertyValues } from 'lit-element'; | ||
export namespace Shadowless { | ||
export interface ITemplate extends HTMLElement { | ||
contentFor?: string; | ||
} | ||
export type Template = HTMLTemplateElement | TemplateLike; | ||
export interface ITemplate extends HTMLElement { | ||
contentFor?: string; | ||
} | ||
export type Template = HTMLTemplateElement | TemplateLike; | ||
// The native template element is incompatible with Angular. If you do not use | ||
@@ -15,3 +14,3 @@ // a framework that precompiles your templates you can use the native template | ||
@customElement('template-like') | ||
export class TemplateLike extends HTMLElement implements Shadowless.ITemplate { | ||
export class TemplateLike extends HTMLElement implements ITemplate { | ||
contentFor?: string; | ||
@@ -21,4 +20,6 @@ } | ||
export const Shadowless = (Base: typeof LitElement) => class extends Base { | ||
protected templateMap = new Map<string, DocumentFragment | Shadowless.Template>(); | ||
static render = render; | ||
protected templateMap = new Map<string, DocumentFragment | Template>(); | ||
protected createRenderRoot() { | ||
@@ -28,3 +29,3 @@ return this; | ||
protected getSlotForTemplate(template: Shadowless.ITemplate): string { | ||
protected getSlotForTemplate(template: ITemplate): string { | ||
return template.contentFor || template.getAttribute('content-for') || ''; | ||
@@ -31,0 +32,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3616