@zydon/common 2.1.5 → 2.1.7

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.
@@ -1,6 +1,6 @@
1
1
  import { a } from './chunk-TLENQZN5.js';
2
2
  import { f } from './chunk-SKUW6ZCP.js';
3
- import { a as a$1 } from './chunk-6UCKQDJR.js';
3
+ import { a as a$1 } from './chunk-PV522B4W.js';
4
4
  import { a as a$2 } from './chunk-W3IZQQL6.js';
5
5
  import { forwardRef } from 'react';
6
6
  import P from '@mui/material/IconButton';
@@ -0,0 +1,8 @@
1
+ import { forwardRef, useState, useRef, useEffect } from 'react';
2
+ import { NumericFormat } from 'react-number-format';
3
+ import M from '@mui/material/TextField';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var p=forwardRef(({decimalScale:f=0,fixedDecimalScale:m=!0,prefix:c,allowNegative:s,minValue:t,maxValue:n=1/0,maxLength:d,value:I,inputProps:b,InputProps:N,size:S,disabled:T,name:u,helperText:g,error:y,fullWidth:h,label:v,required:w,onChange:r,tabIndex:x,placeholder:D,margin:F},P)=>{let[R,k]=useState(Date.now()),e=useRef(null),l=()=>k(Date.now()),E=(L,o)=>{r&&(e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{let{floatValue:a}=L,i=a||0;if(t!==void 0&&t>i){r({target:{name:u,value:t},event:o}),l();return}if(a!==void 0&&n<i){r({target:{name:u,value:n},event:o}),l();return}r({target:{name:u,value:a},event:o});},500));};return useEffect(()=>()=>{e.current&&clearTimeout(e.current);},[]),jsx(NumericFormat,{getInputRef:P,value:I,prefix:c,decimalSeparator:",",thousandSeparator:".",decimalScale:f,fixedDecimalScale:m,autoComplete:"off",allowNegative:s,maxLength:d,onValueChange:E,customInput:M,InputProps:{...N},inputProps:{...b,tabIndex:x},disabled:T,size:S,helperText:g,error:y,fullWidth:h,label:v,required:w,placeholder:D,margin:F},R)});p.displayName="NumberInput";var O=p;
7
+
8
+ export { O as a };
@@ -1,6 +1,6 @@
1
- export { a as default } from '../../chunk-WW3KREAN.js';
1
+ export { a as default } from '../../chunk-7TXZCGAH.js';
2
2
  import '../../chunk-TLENQZN5.js';
3
3
  import '../../chunk-SKUW6ZCP.js';
4
- import '../../chunk-6UCKQDJR.js';
4
+ import '../../chunk-PV522B4W.js';
5
5
  import '../../chunk-W3IZQQL6.js';
6
6
  import '../../chunk-B7TRCCLA.js';
@@ -1 +1 @@
1
- export { a as default } from '../../chunk-6UCKQDJR.js';
1
+ export { a as default } from '../../chunk-PV522B4W.js';
@@ -1,7 +1,7 @@
1
- import { a } from '../../../chunk-WW3KREAN.js';
1
+ import { a } from '../../../chunk-7TXZCGAH.js';
2
2
  import '../../../chunk-TLENQZN5.js';
3
3
  import '../../../chunk-SKUW6ZCP.js';
4
- import '../../../chunk-6UCKQDJR.js';
4
+ import '../../../chunk-PV522B4W.js';
5
5
  import '../../../chunk-W3IZQQL6.js';
6
6
  import '../../../chunk-B7TRCCLA.js';
7
7
  import { useFormContext, Controller } from 'react-hook-form';
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-6UCKQDJR.js';
1
+ import { a } from '../../../chunk-PV522B4W.js';
2
2
  import { useFormContext, Controller } from 'react-hook-form';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -1,5 +1,5 @@
1
- import { useRef } from 'react';
1
+ import { useRef, useEffect } from 'react';
2
2
 
3
- var e=()=>{let r=useRef(!0);return r.current?(r.current=!1,!0):r.current},n=e;
3
+ var u=()=>{let e=useRef(!0);return useEffect(()=>{e.current=!1;},[]),e.current},s=u;
4
4
 
5
- export { n as default };
5
+ export { s as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -1,8 +0,0 @@
1
- import { forwardRef, useState, useRef, useEffect } from 'react';
2
- import { NumericFormat } from 'react-number-format';
3
- import H from '@mui/material/TextField';
4
- import { jsx } from 'react/jsx-runtime';
5
-
6
- var f=forwardRef(({decimalScale:p=0,fixedDecimalScale:m=!0,prefix:c,allowNegative:s,minValue:t,maxValue:a=1/0,maxLength:d,value:I,inputProps:b,InputProps:N,size:S,disabled:T,name:u,helperText:y,error:g,fullWidth:h,label:v,required:w,onChange:r,tabIndex:x},D)=>{let[F,P]=useState(Date.now()),e=useRef(null),l=()=>P(Date.now()),R=(k,o)=>{r&&(e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{let{floatValue:n}=k,i=n||0;if(t!==void 0&&t>i){r({target:{name:u,value:t},event:o}),l();return}if(n!==void 0&&a<i){r({target:{name:u,value:a},event:o}),l();return}r({target:{name:u,value:n},event:o});},500));};return useEffect(()=>()=>{e.current&&clearTimeout(e.current);},[]),jsx(NumericFormat,{getInputRef:D,value:I,prefix:c,decimalSeparator:",",thousandSeparator:".",decimalScale:p,fixedDecimalScale:m,autoComplete:"off",allowNegative:s,maxLength:d,onValueChange:R,customInput:H,InputProps:{...N},inputProps:{...b,tabIndex:x},disabled:T,size:S,helperText:y,error:g,fullWidth:h,label:v,required:w},F)});f.displayName="NumberInput";var G=f;
7
-
8
- export { G as a };