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