@zydon/common 2.2.56 → 2.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,6 @@ import A from '@mui/material/IconButton';
6
6
  import C from '@mui/material/InputAdornment';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
 
9
- var M=forwardRef(({name:R,increment:r=1,updadteForMultiple:D,allowNegative:u=!1,value:I,onChange:f$1,minValue:n,maxValue:e,decimalScale:p,disabled:m,tabIndex:T,labelIncrementer:w,labelDecrementer:B,placeholder:O,...v},z)=>{let[E,L]=useState(`incrementer-input-${Date.now()}`),i=useRef(null),s=Number(I||0),b=()=>{i.current&&(clearTimeout(i.current),i.current=null);},N=useMemo(()=>{let o=s-r;return typeof n=="number"&&o<n?!0:m||!u&&o<0},[m,s,r,n,u]),_=useMemo(()=>{let o=s+r;return typeof e=="number"&&o>e?!0:m},[m,s,r,e]),$=useCallback(()=>{if(b(),!u&&s-r<0)return;let o=s-r,t=n!==void 0&&o<n?n:f(o,p);f$1(t);},[s,r,n,p,f$1,u]),G=useCallback(()=>{b();let o=s+r,t=e!==void 0&&o>e?e:f(o,p);f$1(t);},[s,r,e,p,f$1]),H=useCallback(o=>{b();let t=Number(o.target.value||0);(r!==1||D)&&(t=t+r/2,t-=t%r),!u&&t<0&&(t=0),typeof n=="number"&&t<n&&(t=n),typeof e=="number"&&t>e&&(t=e),t=f(t,p),t===I&&(i.current=setTimeout(()=>{L(`incrementer-input-${Date.now()}`);},600)),f$1(t);},[I,r,n,e,p,f$1,D,u]);return jsx(a,{ref:z,name:R,value:I,minValue:n,maxValue:e,allowNegative:u,decimalScale:p,InputProps:{startAdornment:jsx(C,{position:"start",children:jsx(A,{size:"medium",onClick:$,disabled:N,"aria-label":B||"Decrementa",children:jsx(a$1,{icon:"MINUS_SIGN",width:14,height:14,color:"primary.main"})})}),endAdornment:jsx(C,{position:"end",children:jsx(A,{size:"medium",onClick:G,disabled:_,"aria-label":w||"Incrementa",children:jsx(a$1,{icon:"SIMPLE_ADD",width:14,height:14,color:"primary.main"})})}),inputProps:{style:{textAlign:"center"}}},inputProps:{tabIndex:T},onChange:H,disabled:m,placeholder:O,...v},E)});M.displayName="Incrementer";var j=M;
9
+ var M=forwardRef(({name:R,increment:r=1,updadteForMultiple:D,allowNegative:u=!1,value:I,onChange:f$1,minValue:n,maxValue:e,decimalScale:p,disabled:m,tabIndex:T,labelIncrementer:w,labelDecrementer:B,placeholder:O,...v},z)=>{let[E,L]=useState(`incrementer-input-${Date.now()}`),i=useRef(null),s=Number(I||0),b=()=>{i.current&&(clearTimeout(i.current),i.current=null);},N=useMemo(()=>{let o=s-r;return typeof n=="number"&&o<n?!0:m||!u&&o<0},[m,s,r,n,u]),_=useMemo(()=>{let o=s+r;return typeof e=="number"&&o>e?!0:m},[m,s,r,e]),$=useCallback(()=>{if(b(),!u&&s-r<0)return;let o=s-r,t=n!==void 0&&o<n?n:f(o,p);f$1(t);},[s,r,n,p,f$1,u]),G=useCallback(()=>{b();let o=s+r,t=e!==void 0&&o>e?e:f(o,p);f$1(t);},[s,r,e,p,f$1]),H=useCallback(o=>{b();let t=Number(o.target.value||0);(r!==1||D)&&(t=t+r/2,t-=t%r),!u&&t<0&&(t=0),typeof n=="number"&&t<n&&(t=n),typeof e=="number"&&t>e&&(t=e),t=f(t,p),(!t||t===I)&&(i.current=setTimeout(()=>{L(`incrementer-input-${Date.now()}`);},600)),f$1(t);},[I,r,n,e,p,f$1,D,u]);return jsx(a,{ref:z,name:R,value:I,minValue:n,maxValue:e,allowNegative:u,decimalScale:p,InputProps:{startAdornment:jsx(C,{position:"start",children:jsx(A,{size:"medium",onClick:$,disabled:N,"aria-label":B||"Decrementa",children:jsx(a$1,{icon:"MINUS_SIGN",width:14,height:14,color:"primary.main"})})}),endAdornment:jsx(C,{position:"end",children:jsx(A,{size:"medium",onClick:G,disabled:_,"aria-label":w||"Incrementa",children:jsx(a$1,{icon:"SIMPLE_ADD",width:14,height:14,color:"primary.main"})})}),inputProps:{style:{textAlign:"center"}}},inputProps:{tabIndex:T},onChange:H,disabled:m,placeholder:O,...v},E)});M.displayName="Incrementer";var j=M;
10
10
 
11
11
  export { j as a };
@@ -1,4 +1,4 @@
1
- export { a as default } from '../../chunk-VLEKZG4Z.js';
1
+ export { a as default } from '../../chunk-KSHE7G62.js';
2
2
  import '../../chunk-ANAHA3L6.js';
3
3
  import '../../chunk-7KZ2UT76.js';
4
4
  import '../../chunk-M6UXUQUU.js';
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-VLEKZG4Z.js';
1
+ import { a } from '../../../chunk-KSHE7G62.js';
2
2
  import '../../../chunk-ANAHA3L6.js';
3
3
  import '../../../chunk-7KZ2UT76.js';
4
4
  import '../../../chunk-M6UXUQUU.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.2.56",
3
+ "version": "2.2.57",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",