nude-element
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "nude-element", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Composable web component helpers", | ||
@@ -10,2 +10,4 @@ "main": "index.js", | ||
"eslint:fix": "npx eslint . --fix", | ||
"build:apidocs": "npx typedoc", | ||
"watch:apidocs": "npx typedoc --watch --preserveWatchOutput", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -30,4 +32,6 @@ }, | ||
"globals": "latest", | ||
"release-it": "^17.2.1" | ||
"release-it": "^17.2.1", | ||
"typedoc": "latest", | ||
"typedoc-plugin-rename-defaults": "latest" | ||
} | ||
} |
@@ -8,2 +8,3 @@ | ||
let propsSymbol = Symbol("propsSymbol"); | ||
@@ -14,3 +15,3 @@ function init () { | ||
export default function defineProps (Class, props = Class.props) { | ||
export default function defineProps (Class, props = Class[propsSymbol] ?? Class.props) { | ||
if (props instanceof Props && props.Class === Class) { | ||
@@ -27,2 +28,3 @@ // Already defined | ||
Class[propsSymbol] = Class.props; | ||
props = Class.props = new Props(Class, props); | ||
@@ -29,0 +31,0 @@ |
@@ -140,3 +140,4 @@ import { | ||
else { | ||
return resolveValue(this.default, [element, element]); | ||
value = resolveValue(this.default, [element, element]); | ||
return this.parse?.(value) ?? value; | ||
} | ||
@@ -143,0 +144,0 @@ } |
@@ -29,3 +29,4 @@ import { | ||
get observedAttributes () { | ||
return [...this.values()].map(spec => spec.fromAttribute).filter(Boolean); | ||
let attributes = [...this.values()].map(spec => spec.fromAttribute).filter(Boolean); | ||
return [...new Set(attributes)]; | ||
} | ||
@@ -32,0 +33,0 @@ |
48796
21
1138
6