ta-dom-components
Advanced tools
Comparing version 0.0.1 to 0.0.4
@@ -54,3 +54,3 @@ import TaDom from './ta-dom-element.js'; | ||
this.setState({time:this.time}); | ||
}, 1000); | ||
}, 500); | ||
} | ||
@@ -57,0 +57,0 @@ |
{ | ||
"name": "ta-dom-components", | ||
"version": "0.0.1", | ||
"version": "0.0.4", | ||
"description": "another web-component library", | ||
@@ -9,2 +9,6 @@ "main": "index.js", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jrobinson01/ta-dom-components.git" | ||
}, | ||
"author": "jrobinsonmedia@gmail.com", | ||
@@ -11,0 +15,0 @@ "license": "MIT", |
@@ -6,3 +6,3 @@ ## Ta-Dom! 🎉 Components ## | ||
### What is it? ### | ||
Ta-Dom! Components is a small library that combines some of the best features of the React and Polymer libraries to make writing web components fast, fun, and easy. | ||
Ta-Dom! Components is a small library that combines some of the best features of the [React](https://github.com/facebook/react) and [Polymer](https://github.com/Polymer/polymer) libraries to make writing web components fast, fun, and easy. | ||
@@ -14,6 +14,6 @@ #### How it Works #### | ||
Unlike React's virtual DOM, in Ta-Dom! you're always dealing with real DOM elements. It's encouraged to use the Ta-Dom! DOM creation library because it's awesome, but you're free to construct your DOM however you see fit. All of the native DOM api's available. | ||
Unlike React's virtual DOM, in Ta-Dom! you're always dealing with real DOM elements. It's encouraged to use the [Ta-Dom! DOM creation library](https://github.com/jrobinson01/ta-dom) because it's awesome, but you're free to construct your DOM however you see fit. All of the native DOM api's are available. | ||
#### Getting Started #### | ||
`npm install --save jrobinson01/ta-dom-components` | ||
`npm install --save ta-dom-components` | ||
@@ -86,3 +86,1 @@ #### A Simple Ta-Dom Component #### | ||
``` | ||
##### Contributing ##### |
@@ -1,3 +0,3 @@ | ||
import TaDom from './node_modules/ta-dom/index.js'; | ||
import morphdom from './node_modules/morphdom/dist/morphdom-esm.js'; | ||
import TaDom from '/node_modules/ta-dom/index.js'; | ||
import morphdom from '/node_modules/morphdom/dist/morphdom-esm.js'; | ||
@@ -45,3 +45,3 @@ // generate getter/setter pair for prop | ||
// TODO: do we have to remove event listeners from discarded nodes? | ||
// console.log('node discarded', node); | ||
console.log('node discarded', node); | ||
} | ||
@@ -107,2 +107,20 @@ }); | ||
// override dispatchEvent | ||
dispatchEvent(name, detail) { | ||
// pass-thru if first param is an event | ||
if(name instanceof Event) { | ||
return super.dispatchEvent(name); | ||
} | ||
// default events to composed, bubbles | ||
return super.dispatchEvent(new CustomEvent(name, { | ||
bubbles: true, | ||
composed: true, | ||
detail | ||
})); | ||
} | ||
// replaces the entire style sheet | ||
// TODO: fix that? | ||
// Keep a virtual copy of the style as an object | ||
// provide updates via js object? | ||
updateStyles(newStyle) { | ||
@@ -161,8 +179,8 @@ if (!this.styles) { | ||
// wrapper for generate() and customElements.define() | ||
// used to define ta-dom functions for custom elements. | ||
const customElement = function(fnName, tag, klass) { | ||
TaDom.generate(fnName); | ||
return customElements.define(tag, klass); | ||
// returns the ta-dom function to generate the custom element | ||
const customElement = function(tag, klass) { | ||
customElements.define(tag, klass); | ||
return TaDom.generate(tag); | ||
}; | ||
export default {customElement, TaDomElement}; |
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
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
10840
247
0
84