Comparing version 0.0.19 to 0.0.20
@@ -6,5 +6,4 @@ import { html } from 'lit-html/lib/lit-extended'; | ||
export declare class LithiumComponent extends HTMLElement { | ||
html: (strings: TemplateStringsArray, ...values: any[]) => TemplateResult; | ||
props: {}; | ||
private _props; | ||
static readonly tagName: string; | ||
constructor(); | ||
@@ -14,9 +13,9 @@ connectedCallback(): void; | ||
attributeChangedCallback(attrName: any, oldVal: any, newVal: any): void; | ||
emit(event: string, value: any): void; | ||
emit(event: string, value: any, options?: {}): void; | ||
render(): TemplateResult; | ||
onInit(): void; | ||
onDestroy(): void; | ||
onChange(attrName: string, oldVal: any, newVal: any): void; | ||
private _render(); | ||
onChange(attrName: string, oldVal: any, newVal: any, attr: boolean): void; | ||
protected _render(): void; | ||
private makeGetterSetters(); | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const lit_extended_1=require("lit-html/lib/lit-extended");exports.html=lit_extended_1.html;const repeat_1=require("lit-html/lib/repeat");exports.repeat=repeat_1.repeat;const lit_html_1=require("lit-html");exports.TemplateResult=lit_html_1.TemplateResult;class LithiumComponent extends HTMLElement{constructor(){super(),this.props={},this._props={},this.attachShadow({mode:"open"})}static get tagName(){throw new Error("Element must have tag name")}connectedCallback(){this._render(),this.onInit(),this.makeGetterSetters()}disconnectedCallback(){this.onDestroy()}attributeChangedCallback(a,b,c){const d=a.replace(/-([a-z])/g,(a)=>a[1].toUpperCase());this.props[d]=c,this.onChange(d,b,c)}emit(a,b){this.dispatchEvent(new CustomEvent(a,{detail:b}))}render(){return lit_extended_1.html`Render Function not defined`}onInit(){}onDestroy(){}onChange(){}_render(){lit_extended_1.render(this.render(),this.shadowRoot)}makeGetterSetters(){for(const a in this.props)this._props[a]=this.props[a],Object.defineProperty(this.props,a,{set:(b)=>{this._props[a]!==b&&(this._props[a]=b,this._render())},get:()=>this._props[a],enumerable:!0,configurable:!0})}}exports.LithiumComponent=LithiumComponent; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const lit_extended_1=require("lit-html/lib/lit-extended");exports.html=lit_extended_1.html;const repeat_1=require("lit-html/lib/repeat");exports.repeat=repeat_1.repeat;const lit_html_1=require("lit-html");exports.TemplateResult=lit_html_1.TemplateResult;class LithiumComponent extends HTMLElement{constructor(){super(),this.props={},this.attachShadow({mode:"open"}),this.html=lit_extended_1.html.bind(this);const a=new MutationObserver((a)=>{a.forEach((a)=>{const b=a.attributeName.replace(/-([a-z])/g,(a)=>a[1].toUpperCase());"attributes"===a.type&&this.props.hasOwnProperty(b)&&(this[b]=parseAttributeValue(this.attributes[b].value))})});a.observe(this,{attributes:!0,attributeOldValue:!0})}connectedCallback(){this.makeGetterSetters(),this.onInit(),this._render()}disconnectedCallback(){this.onDestroy()}attributeChangedCallback(a,b,c){this.onChange(a,b,c,!0)}emit(a,b,c={}){this.dispatchEvent(new CustomEvent(a,Object.assign({detail:b},c)))}render(){return lit_extended_1.html`Render Function not defined`}onInit(){}onDestroy(){}onChange(){}_render(){lit_extended_1.render(this.render(),this.shadowRoot)}makeGetterSetters(){for(const a of Object.keys(this.props))Object.defineProperty(this,a,{set:(b)=>{this.props[a]!==b&&(this.onChange(a,this.props[a],b,!1),this.props[a]=b,this._render())},get:()=>this.props[a],enumerable:!0,configurable:!0})}}exports.LithiumComponent=LithiumComponent;function parseAttributeValue(a){return"false"!==a&&(!("true"!==a)||(isNaN(a)?a:a))} |
{ | ||
"name": "lithiumjs", | ||
"version": "0.0.19", | ||
"description": "", | ||
"version": "0.0.20", | ||
"description": "Lightweight Web Component Library", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/coryrylan/lithiumjs.git" | ||
}, | ||
"main": "./dist/index.js", | ||
@@ -15,3 +19,3 @@ "types": "./dist/index.d.ts", | ||
"dependencies": { | ||
"lit-html": "0.7.1" | ||
"lit-html": "0.8.0" | ||
}, | ||
@@ -21,7 +25,4 @@ "devDependencies": { | ||
"babel-minify": "^0.2.0", | ||
"reflect-metadata": "0.1.10", | ||
"typescript": "2.6.2", | ||
"webpack": "3.10.0", | ||
"webpack-dev-server": "2.9.7" | ||
"typescript": "2.6.2" | ||
} | ||
} |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3
0
3117
4
29
+ Addedlit-html@0.8.0(transitive)
- Removedlit-html@0.7.1(transitive)
Updatedlit-html@0.8.0