~repos /atoms-element

#js

git clone https://pyrossh.dev/repos/atoms-element.git

A simple web component library for defining your custom elements. It works on both client and server.


4936b722 Peter John

4 years ago
v2.2.1
Files changed (4) hide show
  1. element.d.ts +4 -4
  2. element.js +4 -4
  3. package-lock.json +2 -2
  4. package.json +1 -1
element.d.ts CHANGED
@@ -31,10 +31,10 @@ export const getLocation = () => Location;
31
31
 
32
32
  export type CreateElementProps = {
33
33
  name: () => string;
34
- attrTypes: () => {[key: string]: any};
34
+ attrTypes?: () => {[key: string]: any};
35
- stateTypes: () => {[key: string]: any};
35
+ stateTypes?: () => {[key: string]: any};
36
- computedTypes: () => {[key: string]: any};
36
+ computedTypes?: () => {[key: string]: any};
37
- styles: {[key: string]: any};
37
+ styles?: {[key: string]: any};
38
38
  render: () => any
39
39
  }
40
40
 
element.js CHANGED
@@ -429,13 +429,13 @@ export const createElement = ({ name, attrTypes, stateTypes, computedTypes, styl
429
429
  const Element = class extends AtomsElement {
430
430
  static name = name();
431
431
 
432
- static attrTypes = attrTypes();
432
+ static attrTypes = attrTypes ? attrTypes() : {};
433
433
 
434
- static stateTypes = stateTypes();
434
+ static stateTypes = stateTypes ? stateTypes() : {};
435
435
 
436
- static computedTypes = computedTypes();
436
+ static computedTypes = computedTypes ? computedTypes() : {};
437
437
 
438
- static styles = styles;
438
+ static styles = styles ? styles : css({});
439
439
 
440
440
  constructor(ssrAttributes) {
441
441
  super(ssrAttributes);
package-lock.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "atoms-element",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
- "version": "2.1.0",
8
+ "version": "2.2.1",
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
11
  "parse5": "^6.0.1"
package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atoms-element",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "A simple web component library for defining your custom elements. It works on both client and server. It supports hooks and follows the same principles of react.",
5
5
  "keywords": [
6
6
  "pyros.sh",