@pap-it/system-react
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -1,1 +0,1 @@ | ||
"use strict";import{jsx as l}from"react/jsx-runtime";import r from"react";export function papHOC(c){const s=r.forwardRef((t,u)=>{const n=r.useRef(null),i=r.useRef(new Set),[d,o]=r.useState(!1);r.useEffect(()=>{typeof u=="function"?u(n.current):u&&(u.current=n.current),n.current&&o(!0)},[n.current]);const a={class:t.className};if(n.current)for(let e in t)if(typeof t[e]=="function"){if(e.startsWith("on")){if(i.current.has(e))continue;const f=m(e);if(f){n.current.addEventListener(f,t[e]),i.current.add(e);continue}}n.current[e]=t[e]}else typeof t[e]=="object"?n.current[e]=t[e]:a[e]=t[e];return l(c,{ref:n,...a,children:t.children})});return r.memo(s)}function m(c){return c.startsWith("on")?c.replace(/^on/,"").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():null} | ||
"use strict";import{jsx as l}from"react/jsx-runtime";import r from"react";export function papHOC(c){const o=r.forwardRef((t,u)=>{const n=r.useRef(null),i=r.useRef(new Set),[d,s]=r.useState(!1);r.useEffect(()=>{typeof u=="function"?u(n.current):u&&(u.current=n.current),n.current&&s(!0)},[n.current]);const f={class:t.className};if(n.current){for(let e in t)if(e!=="children")if(typeof t[e]=="function"){if(e.startsWith("on")){if(i.current.has(e))continue;const a=m(e);if(a){n.current.addEventListener(a,t[e]),i.current.add(e);continue}}n.current[e]=t[e]}else typeof t[e]=="object"?n.current[e]=t[e]:f[e]=t[e]}return l(c,{ref:n,...f,children:t.children})});return r.memo(o)}function m(c){return c.startsWith("on")?c.replace(/^on/,"").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():null} |
{ | ||
"name": "@pap-it/system-react", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "test": ".scripts/test.sh", |
@@ -5,6 +5,7 @@ # ReactSystem | ||
Version: Version: Version: 0.0.6 | ||
Version: Version: Version: 0.0.7 | ||
## Development | ||
@@ -11,0 +12,0 @@ |
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
2607
15