@solid-primitives/props
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -0,3 +1,3 @@ | ||
import { JSX, MergeProps } from 'solid-js'; | ||
import { AnyObject } from '@solid-primitives/utils'; | ||
import { JSX, MergeProps } from 'solid-js'; | ||
@@ -4,0 +4,0 @@ declare const propTraps: ProxyHandler<{ |
@@ -128,30 +128,39 @@ import { $PROXY, createMemo, mergeProps } from 'solid-js'; | ||
} | ||
return new Proxy(merge, { | ||
get(target, key) { | ||
if (typeof key !== "string") | ||
return Reflect.get(target, key); | ||
if (key === "style") | ||
return reduce("style", combineStyle); | ||
if (key === "ref") { | ||
const callbacks = []; | ||
for (const props of sources) { | ||
const cb = props[key]; | ||
if (typeof cb === "function") | ||
callbacks.push(cb); | ||
return new Proxy( | ||
{ | ||
get(key) { | ||
if (typeof key !== "string") | ||
return Reflect.get(merge, key); | ||
if (key === "style") | ||
return reduce("style", combineStyle); | ||
if (key === "ref") { | ||
const callbacks = []; | ||
for (const props of sources) { | ||
const cb = props[key]; | ||
if (typeof cb === "function") | ||
callbacks.push(cb); | ||
} | ||
return chain(callbacks); | ||
} | ||
return chain(callbacks); | ||
if (isEventListenerKey(key)) { | ||
const callbacks = listeners[key.toLowerCase()]; | ||
return Array.isArray(callbacks) ? chain(callbacks) : Reflect.get(merge, key); | ||
} | ||
if (key === "class" || key === "className") | ||
return reduce(key, (a, b) => `${a} ${b}`); | ||
if (key === "classList") | ||
return reduce(key, (a, b) => ({ ...a, ...b })); | ||
return Reflect.get(merge, key); | ||
}, | ||
has(key) { | ||
return Reflect.has(merge, key); | ||
}, | ||
keys() { | ||
return Object.keys(merge); | ||
} | ||
if (isEventListenerKey(key)) { | ||
const callbacks = listeners[key.toLowerCase()]; | ||
return Array.isArray(callbacks) ? chain(callbacks) : Reflect.get(target, key); | ||
} | ||
if (key === "class" || key === "className") | ||
return reduce(key, (a, b) => `${a} ${b}`); | ||
if (key === "classList") | ||
return reduce(key, (a, b) => ({ ...a, ...b })); | ||
return Reflect.get(target, key); | ||
} | ||
}); | ||
}, | ||
propTraps | ||
); | ||
} | ||
export { combineProps, combineStyle, createPropsPredicate, filterProps, propTraps, stringStyleToObject }; |
@@ -128,30 +128,39 @@ import { $PROXY, createMemo, mergeProps } from 'solid-js'; | ||
} | ||
return new Proxy(merge, { | ||
get(target, key) { | ||
if (typeof key !== "string") | ||
return Reflect.get(target, key); | ||
if (key === "style") | ||
return reduce("style", combineStyle); | ||
if (key === "ref") { | ||
const callbacks = []; | ||
for (const props of sources) { | ||
const cb = props[key]; | ||
if (typeof cb === "function") | ||
callbacks.push(cb); | ||
return new Proxy( | ||
{ | ||
get(key) { | ||
if (typeof key !== "string") | ||
return Reflect.get(merge, key); | ||
if (key === "style") | ||
return reduce("style", combineStyle); | ||
if (key === "ref") { | ||
const callbacks = []; | ||
for (const props of sources) { | ||
const cb = props[key]; | ||
if (typeof cb === "function") | ||
callbacks.push(cb); | ||
} | ||
return chain(callbacks); | ||
} | ||
return chain(callbacks); | ||
if (isEventListenerKey(key)) { | ||
const callbacks = listeners[key.toLowerCase()]; | ||
return Array.isArray(callbacks) ? chain(callbacks) : Reflect.get(merge, key); | ||
} | ||
if (key === "class" || key === "className") | ||
return reduce(key, (a, b) => `${a} ${b}`); | ||
if (key === "classList") | ||
return reduce(key, (a, b) => ({ ...a, ...b })); | ||
return Reflect.get(merge, key); | ||
}, | ||
has(key) { | ||
return Reflect.has(merge, key); | ||
}, | ||
keys() { | ||
return Object.keys(merge); | ||
} | ||
if (isEventListenerKey(key)) { | ||
const callbacks = listeners[key.toLowerCase()]; | ||
return Array.isArray(callbacks) ? chain(callbacks) : Reflect.get(target, key); | ||
} | ||
if (key === "class" || key === "className") | ||
return reduce(key, (a, b) => `${a} ${b}`); | ||
if (key === "classList") | ||
return reduce(key, (a, b) => ({ ...a, ...b })); | ||
return Reflect.get(target, key); | ||
} | ||
}); | ||
}, | ||
propTraps | ||
); | ||
} | ||
export { combineProps, combineStyle, createPropsPredicate, filterProps, propTraps, stringStyleToObject }; |
{ | ||
"name": "@solid-primitives/props", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Library of primitives focused around component props.", | ||
@@ -61,13 +61,13 @@ "author": "Damian Tarnawski <gthetarnav@gmail.com>", | ||
"dependencies": { | ||
"@solid-primitives/utils": "^3.1.0" | ||
"@solid-primitives/utils": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"nanospy": "^0.5.0", | ||
"solid-js": "^1.5.0" | ||
"solid-js": "^1.6.0" | ||
}, | ||
"peerDependencies": { | ||
"solid-js": "^1.5.0" | ||
"solid-js": "^1.6.0" | ||
}, | ||
"scripts": { | ||
"dev": "npm run start", | ||
"dev": "vite serve dev", | ||
"build": "jiti ../../scripts/build.ts --ssr", | ||
@@ -74,0 +74,0 @@ "test": "vitest -c ../../configs/vitest.config.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30524
754
0
+ Added@solid-primitives/utils@4.0.1(transitive)
- Removed@solid-primitives/utils@3.1.0(transitive)