jclib-ui 1.0.3 → 1.0.5

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,12 +1,14 @@
1
1
  type Props = {
2
2
  valor: number;
3
+ time?: number;
3
4
  format?: boolean;
4
5
  currency?: boolean;
5
6
  };
6
- export declare function DynamicCounter({ valor, format, currency }: Props): any;
7
+ export declare function DynamicCounter({ valor, time, format, currency }: Props): string | number;
7
8
  export declare namespace DynamicCounter {
8
9
  var defaultProps: {
9
10
  valor: number;
11
+ time: number;
10
12
  format: boolean;
11
13
  currency: boolean;
12
14
  };
@@ -8903,15 +8903,15 @@ function LoadingReportView({ url, file: fileOrigin, fileTo, setLoading }) {
8903
8903
  }
8904
8904
  DynamicCounter.defaultProps = {
8905
8905
  valor: 0,
8906
+ time: 25,
8906
8907
  format: false,
8907
8908
  currency: false
8908
8909
  };
8909
- function DynamicCounter({ valor, format, currency }) {
8910
+ function DynamicCounter({ valor, time, format, currency }) {
8910
8911
  const [counter, setCounter] = useState(0);
8911
- let result = counter;
8912
8912
  useEffect(() => {
8913
8913
  const executeSalt = () => {
8914
- const salto = Math.ceil(valor / 15) + 1;
8914
+ const salto = Math.ceil(valor / 10) + 1;
8915
8915
  setCounter((prev) => {
8916
8916
  let newValue = prev + salto;
8917
8917
  if (newValue > valor) {
@@ -8923,13 +8923,13 @@ function DynamicCounter({ valor, format, currency }) {
8923
8923
  return newValue;
8924
8924
  });
8925
8925
  };
8926
- const timer2 = setInterval(executeSalt, 40);
8926
+ const timer2 = setInterval(executeSalt, time);
8927
8927
  return () => clearInterval(timer2);
8928
- }, [valor]);
8928
+ }, [valor, time]);
8929
8929
  if (format) {
8930
- result = formatValor(counter, currency ? 2 : 0, Boolean(currency));
8930
+ return formatValor(counter, currency ? 2 : 0, Boolean(currency));
8931
8931
  }
8932
- return result;
8932
+ return counter;
8933
8933
  }
8934
8934
  const inputPesquisa = "";
8935
8935
  function InputPesquisa({