lit-element
Advanced tools
Comparing version 0.4.10 to 0.4.11
@@ -24,3 +24,3 @@ import { svg, TemplateResult } from '../lit-html/lit-html.js'; | ||
__propertiesChanged(prop: string, newVal: any): void; | ||
setProperty(prop: string, newVal: any): void; | ||
setProperty(prop: string, newVal?: any): void; | ||
attributeChangedCallback(attr: string, old: any, val: any): void; | ||
@@ -27,0 +27,0 @@ postponedRender(): void; |
@@ -23,3 +23,3 @@ import { html, svg, TemplateResult } from '../lit-html/lit-html.js'; | ||
__propertiesChanged(prop: string, newVal: any): void; | ||
setProperty(prop: string, newVal: any): void; | ||
setProperty(prop: string, newVal?: any): void; | ||
attributeChangedCallback(attr: string, old: any, val: any): void; | ||
@@ -26,0 +26,0 @@ postponedRender(): void; |
@@ -65,3 +65,3 @@ import { TemplateResult, TemplateFactory } from '../lit-html/lit-html.js'; | ||
__propertiesChanged(prop: string, newVal: any): void; | ||
setProperty(prop: string, newVal: any): void; | ||
setProperty(prop: string, newVal?: any): void; | ||
attributeChangedCallback(attr: string, old: any, val: any): void; | ||
@@ -68,0 +68,0 @@ postponedRender(): void; |
@@ -148,3 +148,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
/** | ||
* Set the prop to a new value, or signal that it changed | ||
* | ||
* @param {string} prop | ||
* @param {*} [newVal] | ||
*/ | ||
setProperty(prop, newVal) { | ||
if (arguments.length < 2) | ||
newVal = this[prop]; | ||
const info = this.constructor.properties[prop]; | ||
@@ -151,0 +159,0 @@ const attr = this.__propAttr.get(prop); |
@@ -6,3 +6,3 @@ { | ||
"name": "lit-element", | ||
"version": "0.4.10", | ||
"version": "0.4.11", | ||
"description": "Implements lit-html via a LitElement class. Made for custom Elements.", | ||
@@ -9,0 +9,0 @@ "main": "lit-element.js", |
@@ -147,3 +147,3 @@ import { TemplateResult, TemplateFactory } from '../node_modules/lit-html/lit-html.js'; | ||
if(this.connected) | ||
if (this.connected) | ||
this.connected.call(this); | ||
@@ -158,3 +158,3 @@ | ||
disconnectedCallback() { | ||
if(this.disconnected) | ||
if (this.disconnected) | ||
this.disconnected.call(this); | ||
@@ -196,4 +196,11 @@ } | ||
} | ||
setProperty(prop: string, newVal: any) { | ||
/** | ||
* Set the prop to a new value, or signal that it changed | ||
* | ||
* @param {string} prop | ||
* @param {*} [newVal] | ||
*/ | ||
setProperty(prop: string, newVal?: any) { | ||
if (arguments.length < 2) | ||
newVal = this[prop]; | ||
const info = (this.constructor as any).properties[prop]; | ||
@@ -208,3 +215,2 @@ const attr = this.__propAttr.get(prop); | ||
this.setAttribute(attr!, newVal); | ||
} else { | ||
@@ -289,3 +295,3 @@ /* Set the property directly and trigger | ||
postponedRender() { | ||
renderFunction(this.render({...this.__data}), this.shadowRoot) | ||
renderFunction(this.render({ ...this.__data }), this.shadowRoot) | ||
@@ -292,0 +298,0 @@ for (let callback of this.__renderCallbacks) { |
Sorry, the diff of this file is not supported yet
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
144764
1685