html-element-property-mixins
Advanced tools
Comparing version 0.10.12 to 0.11.0-beta.0
{ | ||
"name": "html-element-property-mixins", | ||
"version": "0.10.12", | ||
"version": "0.11.0-beta.0", | ||
"description": "A collection of mixins extending HTMLElement with properties.", | ||
@@ -10,3 +10,3 @@ "main": "src/index.js", | ||
"lint": "eslint --ext .js . --ignore-path .gitignore", | ||
"format": "eslint --ext .js . --fix --ignore-path .gitignore", | ||
"format": "eslint --ext .js src/ --fix --ignore-path .gitignore", | ||
"release": "release-it" | ||
@@ -21,8 +21,8 @@ }, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"es-dev-server": "^1.40.0", | ||
"eslint": "^6.8.0", | ||
"husky": "^3.0.9", | ||
"mocha": "^7.1.0", | ||
"release-it": "^13.1.1" | ||
"chai": "^4.3.4", | ||
"es-dev-server": "^2.1.0", | ||
"eslint": "^7.26.0", | ||
"husky": "^6.0.0", | ||
"mocha": "^8.4.0", | ||
"release-it": "^14.6.2" | ||
}, | ||
@@ -29,0 +29,0 @@ "husky": { |
@@ -11,3 +11,3 @@ export const PropertiesChangedCallback = (SuperClass) => class extends SuperClass { | ||
if(!this.__changedProperties.has(propName)) this.__changedProperties.set(propName, oldValue); | ||
window.requestAnimationFrame(this.constructor.__invokeCallback.bind(this)); | ||
window.setTimeout(this.constructor.__invokeCallback.bind(this)); | ||
} | ||
@@ -14,0 +14,0 @@ |
@@ -55,3 +55,2 @@ export const ObservedProperties = (SuperClass) => class extends SuperClass { | ||
if(oldValue === newValue) return; | ||
try { if(JSON.stringify(oldValue) === JSON.stringify(newValue)) return; } catch(e) {}; | ||
this.propertyChangedCallback && this.propertyChangedCallback(propName, oldValue, newValue); | ||
@@ -62,5 +61,7 @@ } | ||
if(!obj) return; | ||
return Object.getOwnPropertyDescriptor(obj, key) || this.__getPropertyDescriptor(Object.getPrototypeOf(obj), key) | ||
const item = Object.getOwnPropertyDescriptor(obj, key); | ||
if(item && !item.value) return item; | ||
return this.__getPropertyDescriptor(Object.getPrototypeOf(obj), key); | ||
} | ||
}; |
export const ReflectedProperties = (SuperClass) => class extends SuperClass { | ||
connectedCallback() { | ||
super.connectedCallback(); | ||
for(var i in this.constructor.reflectedProperties) { | ||
@@ -10,2 +9,3 @@ const propName = this.constructor.reflectedProperties[i]; | ||
} | ||
super.connectedCallback(); | ||
} | ||
@@ -28,3 +28,3 @@ | ||
const converter = converters[propName]; | ||
if(converter) value = converter.call(this, value) | ||
if(converter) value = converter.call(this, value); | ||
if(value === null || value === undefined) return this.removeAttribute(attrName); | ||
@@ -31,0 +31,0 @@ this.setAttribute(attrName, value); |
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
245
38080