eatopia-ds 0.0.944 → 0.0.945

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.
package/build/index6.js CHANGED
@@ -1,20 +1,20 @@
1
- import { j as o } from "./index20.js";
2
- import A, { useState as H, useEffect as M } from "react";
3
- function L({
4
- valor: n,
5
- onChange: g,
6
- min: c = 0,
1
+ import { j as n } from "./index20.js";
2
+ import H, { useState as M, useCallback as S, useEffect as E } from "react";
3
+ function I({
4
+ valor: o,
5
+ onChange: d,
6
+ min: y = 0,
7
7
  max: u,
8
8
  disabled: i = !1,
9
- className: S = "",
10
- atalhos: m = [5, 10, 25, 100],
11
- mostrarAtalhos: C = !0,
12
- selectedUnit: y,
13
- addStockItem: f,
14
- unitMultiplier: x,
15
- defaultUnit: k
9
+ className: W = "",
10
+ atalhos: C = [5, 10, 25, 100],
11
+ mostrarAtalhos: v = !0,
12
+ selectedUnit: g,
13
+ addStockItem: x,
14
+ unitMultiplier: k,
15
+ defaultUnit: m
16
16
  }) {
17
- A.useEffect(() => {
17
+ H.useEffect(() => {
18
18
  const t = document.createElement("style");
19
19
  return t.textContent = `
20
20
  .quantidade-input::placeholder {
@@ -24,55 +24,63 @@ function L({
24
24
  document.head.removeChild(t);
25
25
  };
26
26
  }, []);
27
- const [p, l] = H(
28
- n === null ? "" : n.toString()
27
+ const [p, s] = M(
28
+ o === null ? "" : o.toString()
29
+ ), b = S(
30
+ (t) => {
31
+ if (Number.isInteger(t))
32
+ return t.toString();
33
+ const a = (g == null ? void 0 : g.toLowerCase()) === "kg" ? 3 : 2;
34
+ return t.toFixed(a).replace(".", ",");
35
+ },
36
+ [g]
29
37
  );
30
- M(() => {
31
- l(n === null ? "" : n.toFixed(3).replace(".", ","));
32
- }, [n]);
33
- const b = (t) => {
38
+ E(() => {
39
+ s(o === null ? "" : b(o));
40
+ }, [o, b]);
41
+ const h = (t) => {
34
42
  if (t === null) {
35
- g(null), l("");
43
+ d(null), s("");
36
44
  return;
37
45
  }
38
46
  console.log("novoValor", t);
39
- let r = Math.max(c, t);
40
- u !== void 0 && (r = Math.min(u, r)), console.log("novoValor", t), g(r), l(r.toFixed(3).replace(".", ","));
41
- }, F = (t) => /^$|^\d*([.,]\d*)?$/.test(t), v = (t) => {
47
+ let r = Math.max(y, t);
48
+ u !== void 0 && (r = Math.min(u, r)), console.log("novoValor", t), d(r), s(b(r));
49
+ }, F = (t) => /^$|^\d*([.,]\d*)?$/.test(t), j = (t) => {
42
50
  let r = t.trim();
43
51
  return r === "" || r === "." || r === "," ? "" : (r = r.replace(",", "."), r.startsWith("0") && r.length > 1 && r[1] !== "." && (r = r.replace(/^0+/, ""), (r === "" || r.startsWith(".")) && (r = "0" + r)), r.startsWith(".") && (r = "0" + r), r);
44
- }, j = (t) => {
52
+ }, B = (t) => {
45
53
  const r = t.target.value;
46
54
  if (r === "") {
47
- l("");
55
+ s("");
48
56
  return;
49
57
  }
50
58
  if (!F(r)) return;
51
59
  const a = r.replace(".", ",");
52
- l(a);
53
- }, B = (t) => {
60
+ s(a);
61
+ }, T = (t) => {
54
62
  if (t.target.style.outline = "", t.target.style.borderColor = e.input.border, p === "" || p === "." || p === ",") {
55
- l(""), g(null);
63
+ s(""), d(null);
56
64
  return;
57
65
  }
58
- const r = v(p);
66
+ const r = j(p);
59
67
  if (r === "") {
60
- l(""), g(null);
68
+ s(""), d(null);
61
69
  return;
62
70
  }
63
71
  const a = parseFloat(r);
64
72
  if (!isNaN(a) && isFinite(a)) {
65
- const d = Math.max(c, a), h = d.toFixed(3).replace(".", ",");
66
- l(h), g(d);
73
+ const c = Math.max(y, a), f = b(c);
74
+ s(f), d(c);
67
75
  } else
68
- l(""), g(null);
69
- }, T = (t) => {
70
- t.key === "Enter" && t.currentTarget.blur();
76
+ s(""), d(null);
71
77
  }, w = (t) => {
72
- const r = (n ?? 0) + t;
73
- b(r);
78
+ t.key === "Enter" && t.currentTarget.blur();
79
+ }, A = (t) => {
80
+ const r = (o ?? 0) + t;
81
+ h(r);
74
82
  }, D = () => {
75
- !f || n === null || (f(n * (x || 1)), b(null));
83
+ !x || o === null || (x(o * (k || 1)), h(null));
76
84
  }, e = {
77
85
  container: {
78
86
  display: "flex",
@@ -249,45 +257,47 @@ function L({
249
257
  cursor: "not-allowed"
250
258
  }
251
259
  };
252
- return /* @__PURE__ */ o.jsxs(
260
+ return /* @__PURE__ */ n.jsxs(
253
261
  "div",
254
262
  {
255
263
  style: {
256
264
  ...e.container
257
265
  },
258
266
  children: [
259
- /* @__PURE__ */ o.jsx("div", { style: e.calculatorContainer, children: /* @__PURE__ */ o.jsx("div", { style: e.calculator, children: /* @__PURE__ */ o.jsxs("div", { style: e.calculatorContent, children: [
260
- /* @__PURE__ */ o.jsx(
267
+ /* @__PURE__ */ n.jsx("div", { style: e.calculatorContainer, children: /* @__PURE__ */ n.jsx("div", { style: e.calculator, children: /* @__PURE__ */ n.jsxs("div", { style: e.calculatorContent, children: [
268
+ /* @__PURE__ */ n.jsx(
261
269
  "button",
262
270
  {
263
271
  type: "button",
264
272
  style: {
265
273
  ...e.button,
266
- ...i || n === null || n <= c ? e.buttonDisabled : {}
274
+ ...i || (o ?? 0) === 0 ? e.buttonDisabled : {}
267
275
  },
268
276
  onMouseEnter: (t) => {
269
- !i && n !== null && n > c && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
277
+ !i && (o ?? 0) > 0 && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
270
278
  },
271
279
  onMouseLeave: (t) => {
272
280
  t.currentTarget.style.background = e.button.background, t.currentTarget.style.transform = "";
273
281
  },
274
282
  onMouseDown: (t) => {
275
- !i && n !== null && n > c && (t.currentTarget.style.background = e.buttonActive.background, t.currentTarget.style.transform = e.buttonActive.transform);
283
+ !i && (o ?? 0) > 0 && (t.currentTarget.style.background = e.buttonActive.background, t.currentTarget.style.transform = e.buttonActive.transform);
276
284
  },
277
285
  onMouseUp: (t) => {
278
- !i && n !== null && n > c && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
286
+ !i && (o ?? 0) > 0 && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
279
287
  },
280
- onClick: () => b(n === null ? null : n - 1),
281
- disabled: i || n === null || n <= c,
288
+ onClick: () => {
289
+ h((o === null ? 0 : o) - 1);
290
+ },
291
+ disabled: i || (o ?? 0) === 0,
282
292
  "aria-label": "Diminuir quantidade",
283
- children: /* @__PURE__ */ o.jsx(
293
+ children: /* @__PURE__ */ n.jsx(
284
294
  "svg",
285
295
  {
286
296
  style: { width: "24px", height: "24px" },
287
297
  fill: "none",
288
298
  viewBox: "0 0 24 24",
289
299
  stroke: "#000",
290
- children: /* @__PURE__ */ o.jsx(
300
+ children: /* @__PURE__ */ n.jsx(
291
301
  "path",
292
302
  {
293
303
  strokeLinecap: "round",
@@ -300,13 +310,13 @@ function L({
300
310
  )
301
311
  }
302
312
  ),
303
- /* @__PURE__ */ o.jsx("div", { style: e.inputContainer, children: /* @__PURE__ */ o.jsxs("div", { style: e.inputWrapper, children: [
304
- /* @__PURE__ */ o.jsx(
313
+ /* @__PURE__ */ n.jsx("div", { style: e.inputContainer, children: /* @__PURE__ */ n.jsxs("div", { style: e.inputWrapper, children: [
314
+ /* @__PURE__ */ n.jsx(
305
315
  "input",
306
316
  {
307
317
  type: "text",
308
318
  value: p.replace(".", ","),
309
- onChange: j,
319
+ onChange: B,
310
320
  min: 0,
311
321
  max: u,
312
322
  disabled: i,
@@ -319,45 +329,47 @@ function L({
319
329
  onFocus: (t) => {
320
330
  i || (t.target.style.outline = e.inputFocus.outline, t.target.style.borderColor = e.inputFocus.borderColor);
321
331
  },
322
- onBlur: B,
323
- onKeyDown: T,
332
+ onBlur: T,
333
+ onKeyDown: w,
324
334
  "aria-label": "Quantidade",
325
- placeholder: "0.000"
335
+ placeholder: "0"
326
336
  }
327
337
  ),
328
- y && /* @__PURE__ */ o.jsx("div", { style: e.unitLabel, children: y })
338
+ g && /* @__PURE__ */ n.jsx("div", { style: e.unitLabel, children: g })
329
339
  ] }) }),
330
- /* @__PURE__ */ o.jsx(
340
+ /* @__PURE__ */ n.jsx(
331
341
  "button",
332
342
  {
333
343
  type: "button",
334
344
  style: {
335
345
  ...e.button,
336
- ...i || n === null || u !== void 0 && n >= u ? e.buttonDisabled : {}
346
+ ...i || u !== void 0 && (o ?? 0) >= u ? e.buttonDisabled : {}
337
347
  },
338
348
  onMouseEnter: (t) => {
339
- !i && n !== null && (u === void 0 || n < u) && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
349
+ !i && (u === void 0 || (o ?? 0) < u) && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
340
350
  },
341
351
  onMouseLeave: (t) => {
342
352
  t.currentTarget.style.background = e.button.background, t.currentTarget.style.transform = "";
343
353
  },
344
354
  onMouseDown: (t) => {
345
- !i && n !== null && (u === void 0 || n < u) && (t.currentTarget.style.background = e.buttonActive.background, t.currentTarget.style.transform = e.buttonActive.transform);
355
+ !i && (u === void 0 || (o ?? 0) < u) && (t.currentTarget.style.background = e.buttonActive.background, t.currentTarget.style.transform = e.buttonActive.transform);
346
356
  },
347
357
  onMouseUp: (t) => {
348
- !i && n !== null && (u === void 0 || n < u) && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
358
+ !i && (u === void 0 || (o ?? 0) < u) && (t.currentTarget.style.background = e.buttonHover.background, t.currentTarget.style.transform = e.buttonHover.transform);
359
+ },
360
+ onClick: () => {
361
+ h((o === null ? 0 : o) + 1);
349
362
  },
350
- onClick: () => b(n === null ? 1 : n + 1),
351
- disabled: i || n === null || u !== void 0 && n >= u,
363
+ disabled: i || u !== void 0 && (o ?? 0) >= u,
352
364
  "aria-label": "Aumentar quantidade",
353
- children: /* @__PURE__ */ o.jsx(
365
+ children: /* @__PURE__ */ n.jsx(
354
366
  "svg",
355
367
  {
356
368
  style: { width: "24px", height: "24px" },
357
369
  fill: "none",
358
370
  viewBox: "0 0 24 24",
359
371
  stroke: "#FF4E00",
360
- children: /* @__PURE__ */ o.jsx(
372
+ children: /* @__PURE__ */ n.jsx(
361
373
  "path",
362
374
  {
363
375
  strokeLinecap: "round",
@@ -371,69 +383,69 @@ function L({
371
383
  }
372
384
  )
373
385
  ] }) }) }),
374
- C && /* @__PURE__ */ o.jsx("div", { style: e.shortcutsContainer, children: /* @__PURE__ */ o.jsx("div", { style: e.shortcutsGrid, children: m.slice().sort((t, r) => t - r).map((t, r) => {
375
- const a = t > 0, d = n === null || !a && (n ?? 0) + t < c, h = {
386
+ v && /* @__PURE__ */ n.jsx("div", { style: e.shortcutsContainer, children: /* @__PURE__ */ n.jsx("div", { style: e.shortcutsGrid, children: C.slice().sort((t, r) => t - r).map((t, r) => {
387
+ const a = t > 0, c = !a && (o ?? 0) + t < y, f = {
376
388
  ...e.shortcutButton,
377
- ...d ? e.shortcutButtonDisabled : {},
389
+ ...c ? e.shortcutButtonDisabled : {},
378
390
  ...a ? e.positiveShortcut : e.negativeShortcut
379
391
  };
380
- return /* @__PURE__ */ o.jsx(
392
+ return /* @__PURE__ */ n.jsx(
381
393
  "button",
382
394
  {
383
395
  type: "button",
384
- style: h,
385
- onMouseEnter: (s) => {
386
- d || (s.currentTarget.style.background = a ? e.positiveShortcutHover.background : e.negativeShortcutHover.background);
396
+ style: f,
397
+ onMouseEnter: (l) => {
398
+ c || (l.currentTarget.style.background = a ? e.positiveShortcutHover.background : e.negativeShortcutHover.background);
387
399
  },
388
- onMouseLeave: (s) => {
389
- s.currentTarget.style.background = h.background, s.currentTarget.style.transform = "";
400
+ onMouseLeave: (l) => {
401
+ l.currentTarget.style.background = f.background, l.currentTarget.style.transform = "";
390
402
  },
391
- onMouseDown: (s) => {
392
- d || (s.currentTarget.style.background = a ? e.positiveShortcutActive.background : e.negativeShortcutActive.background, s.currentTarget.style.transform = e.shortcutButtonActive.transform);
403
+ onMouseDown: (l) => {
404
+ c || (l.currentTarget.style.background = a ? e.positiveShortcutActive.background : e.negativeShortcutActive.background, l.currentTarget.style.transform = e.shortcutButtonActive.transform);
393
405
  },
394
- onMouseUp: (s) => {
395
- d || (s.currentTarget.style.background = a ? e.positiveShortcutHover.background : e.negativeShortcutHover.background, s.currentTarget.style.transform = "");
406
+ onMouseUp: (l) => {
407
+ c || (l.currentTarget.style.background = a ? e.positiveShortcutHover.background : e.negativeShortcutHover.background, l.currentTarget.style.transform = "");
396
408
  },
397
- onClick: () => w(t),
398
- disabled: d,
409
+ onClick: () => A(t),
410
+ disabled: c,
399
411
  "aria-label": `Adicionar ${t} ao contador`,
400
412
  children: t > 0 ? `+${t}` : t
401
413
  },
402
414
  r
403
415
  );
404
416
  }) }) }),
405
- f && /* @__PURE__ */ o.jsx("div", { style: e.addButtonContainer, children: /* @__PURE__ */ o.jsxs(
417
+ x && /* @__PURE__ */ n.jsx("div", { style: e.addButtonContainer, children: /* @__PURE__ */ n.jsxs(
406
418
  "button",
407
419
  {
408
420
  type: "button",
409
421
  onClick: D,
410
- disabled: i || n === null,
422
+ disabled: i || o === null,
411
423
  style: {
412
424
  ...e.addButton,
413
- ...i || n === null ? e.addButtonDisabled : {}
425
+ ...i || o === null ? e.addButtonDisabled : {}
414
426
  },
415
427
  onMouseEnter: (t) => {
416
- !i && n !== null && (t.currentTarget.style.backgroundColor = e.addButtonHover.backgroundColor);
428
+ !i && o !== null && (t.currentTarget.style.backgroundColor = e.addButtonHover.backgroundColor);
417
429
  },
418
430
  onMouseLeave: (t) => {
419
431
  t.currentTarget.style.backgroundColor = e.addButton.backgroundColor;
420
432
  },
421
433
  onMouseDown: (t) => {
422
- !i && n !== null && (t.currentTarget.style.backgroundColor = e.addButtonActive.backgroundColor);
434
+ !i && o !== null && (t.currentTarget.style.backgroundColor = e.addButtonActive.backgroundColor);
423
435
  },
424
436
  onMouseUp: (t) => {
425
- !i && n !== null && (t.currentTarget.style.backgroundColor = e.addButtonHover.backgroundColor);
437
+ !i && o !== null && (t.currentTarget.style.backgroundColor = e.addButtonHover.backgroundColor);
426
438
  },
427
439
  "aria-label": "Atualizar contagem",
428
440
  children: [
429
- /* @__PURE__ */ o.jsx(
441
+ /* @__PURE__ */ n.jsx(
430
442
  "svg",
431
443
  {
432
444
  style: { width: "24px", height: "24px" },
433
445
  fill: "none",
434
446
  viewBox: "0 0 24 24",
435
447
  stroke: "currentColor",
436
- children: /* @__PURE__ */ o.jsx(
448
+ children: /* @__PURE__ */ n.jsx(
437
449
  "path",
438
450
  {
439
451
  strokeLinecap: "round",
@@ -446,8 +458,8 @@ function L({
446
458
  ),
447
459
  "Adicionar contagem",
448
460
  " ",
449
- n !== null ? (n * (x || 1)).toFixed(3) : "0.000",
450
- k && ` ${k}`
461
+ o !== null ? b(o * (k || 1)) : "0",
462
+ m && ` ${m}`
451
463
  ]
452
464
  }
453
465
  ) })
@@ -456,6 +468,6 @@ function L({
456
468
  );
457
469
  }
458
470
  export {
459
- L as QuantidadeInput
471
+ I as QuantidadeInput
460
472
  };
461
473
  //# sourceMappingURL=index6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index6.js","sources":["../src/components/QuantidadeInput/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nexport interface QuantidadeInputProps {\n valor: number | null;\n onChange: (novoValor: number | null) => void;\n min?: number;\n max?: number;\n disabled?: boolean;\n className?: string;\n atalhos?: number[];\n mostrarAtalhos?: boolean;\n addStockItem?: (valor: number) => void;\n selectedUnit?: string;\n defaultUnit?: string;\n unitMultiplier?: number;\n}\n\nexport function QuantidadeInput({\n valor,\n onChange,\n min = 0.0,\n max,\n disabled = false,\n className = \"\",\n atalhos = [5, 10, 25, 100],\n mostrarAtalhos = true,\n selectedUnit,\n addStockItem,\n unitMultiplier,\n defaultUnit,\n}: QuantidadeInputProps) {\n // Adiciona estilo CSS para o placeholder\n React.useEffect(() => {\n const style = document.createElement(\"style\");\n style.textContent = `\n .quantidade-input::placeholder {\n color: #999 !important;\n }\n `;\n document.head.appendChild(style);\n\n return () => {\n document.head.removeChild(style);\n };\n }, []);\n const [inputValue, setInputValue] = useState(\n valor === null ? \"\" : valor.toString()\n );\n\n // Atualiza o inputValue quando o valor prop muda externamente\n useEffect(() => {\n if (valor === null) {\n setInputValue(\"\");\n } else {\n // Formata com vírgula para exibição\n setInputValue(valor.toFixed(3).replace(\".\", \",\"));\n }\n }, [valor]);\n\n const handleChange = (novoValor: number | null) => {\n if (novoValor === null) {\n onChange(null);\n setInputValue(\"\");\n return;\n }\n console.log(\"novoValor\", novoValor);\n let valorFinal = Math.max(min, novoValor);\n if (max !== undefined) {\n valorFinal = Math.min(max, valorFinal);\n }\n\n console.log(\"novoValor\", novoValor);\n onChange(valorFinal);\n // Formata com vírgula para exibição\n setInputValue(valorFinal.toFixed(3).replace(\".\", \",\"));\n };\n\n const isValidNumber = (value: string): boolean => {\n // Permite números vazios, números inteiros e decimais (com , ou .)\n // Permite múltiplos zeros à esquerda durante a digitação\n return /^$|^\\d*([.,]\\d*)?$/.test(value);\n };\n\n const normalizeInput = (value: string): string => {\n // Remove espaços\n let normalized = value.trim();\n\n // Se estiver vazio, retorna vazio\n if (normalized === \"\" || normalized === \".\" || normalized === \",\") {\n return \"\";\n }\n\n // Normaliza o separador decimal: converte . para , (para exibição)\n // Mas mantém a lógica interna com .\n normalized = normalized.replace(\",\", \".\");\n\n // Remove zeros à esquerda desnecessários (mas mantém se for \"0.xxx\")\n // Ex: \"00.234\" -> \"0.234\", \"000\" -> \"0\"\n if (\n normalized.startsWith(\"0\") &&\n normalized.length > 1 &&\n normalized[1] !== \".\"\n ) {\n // Remove zeros à esquerda até encontrar um ponto ou um dígito diferente de zero\n normalized = normalized.replace(/^0+/, \"\");\n // Se ficou vazio ou começa com ponto, adiciona 0\n if (normalized === \"\" || normalized.startsWith(\".\")) {\n normalized = \"0\" + normalized;\n }\n }\n\n // Se começa com ponto, adiciona 0 antes\n // Ex: \".234\" -> \"0.234\"\n if (normalized.startsWith(\".\")) {\n normalized = \"0\" + normalized;\n }\n\n return normalized;\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawValue = e.target.value;\n\n // Permite valores vazios durante a digitação\n if (rawValue === \"\") {\n setInputValue(\"\");\n return;\n }\n\n // Valida o formato (permite . ou ,)\n if (!isValidNumber(rawValue)) return;\n\n // Durante a digitação, mantém o valor como o usuário digitou\n // Mas normaliza para exibição (converte . para ,)\n const displayValue = rawValue.replace(\".\", \",\");\n setInputValue(displayValue);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n // Resetar estilos do input\n e.target.style.outline = \"\";\n e.target.style.borderColor = styles.input.border!;\n\n // Se o valor estiver vazio, define como null\n if (inputValue === \"\" || inputValue === \".\" || inputValue === \",\") {\n setInputValue(\"\");\n onChange(null);\n return;\n }\n\n // Normaliza o valor (remove zeros à esquerda, adiciona 0 antes de . se necessário)\n const normalizedValue = normalizeInput(inputValue);\n\n if (normalizedValue === \"\") {\n setInputValue(\"\");\n onChange(null);\n return;\n }\n\n // Converte para número\n const numeroConvertido = parseFloat(normalizedValue);\n\n if (!isNaN(numeroConvertido) && isFinite(numeroConvertido)) {\n // Garante que o valor seja pelo menos o mínimo\n const valorFinal = Math.max(min, numeroConvertido);\n\n // Formata com 3 casas decimais e converte . para , para exibição\n const valorFormatado = valorFinal.toFixed(3).replace(\".\", \",\");\n setInputValue(valorFormatado);\n\n // Chama onChange com o valor numérico\n onChange(valorFinal);\n } else {\n setInputValue(\"\");\n onChange(null);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n // Permite que o usuário pressione Enter para confirmar o valor\n if (e.key === \"Enter\") {\n e.currentTarget.blur(); // Isso dispara o handleBlur\n }\n };\n\n const handleAtalhoClick = (v: number) => {\n const novoValor = (valor ?? 0) + v;\n handleChange(novoValor);\n };\n\n const handleAtualizarContagem = () => {\n if (!addStockItem || valor === null) return;\n addStockItem(valor * (unitMultiplier || 1));\n handleChange(null);\n };\n\n // Estilos inline para substituir Tailwind\n const styles = {\n container: {\n display: \"flex\",\n flexDirection: \"column\" as const,\n gap: \"16px\",\n width: \"100%\",\n },\n calculatorContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n width: \"100%\",\n },\n calculator: {\n position: \"relative\" as const,\n backgroundColor: \"#f5f5f5\", // Fundo cinza claro\n borderRadius: \"16px\",\n padding: \"16px\",\n width: \"100%\",\n maxWidth: \"384px\",\n },\n calculatorContent: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"16px\",\n },\n button: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"64px\",\n height: \"64px\",\n borderRadius: \"16px\",\n background: \"white\",\n color: \"#333\",\n border: \"1px solid rgb(240, 240, 240)\",\n cursor: \"pointer\",\n transition: \"all 0.2s\",\n },\n buttonHover: {\n background: \"#f8f8f8\",\n transform: \"scale(1.02)\",\n },\n buttonActive: {\n background: \"#f0f0f0\",\n transform: \"scale(0.98)\",\n },\n buttonDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n inputContainer: {\n display: \"flex\",\n flexDirection: \"column\" as const,\n alignItems: \"center\",\n flex: 1,\n maxWidth: \"192px\",\n },\n inputWrapper: {\n position: \"relative\" as const,\n width: \"100%\",\n flex: 1,\n flexDirection: \"column\" as const,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n input: {\n width: \"100%\",\n height: \"40px\",\n textAlign: \"center\" as const,\n fontSize: \"34px\",\n fontWeight: \"bold\",\n borderRadius: \"24px\",\n color: \"#000\",\n appearance: \"textfield\" as const,\n background: \"transparent\",\n border: \"none\",\n },\n inputFocus: {\n outline: \"none\",\n borderColor: \"#FF4E00\",\n },\n inputDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n unitLabel: {\n pointerEvents: \"none\" as const,\n fontSize: \"16px\",\n color: \"#000\",\n fontWeight: \"500\",\n marginTop: \"4px\",\n textAlign: \"center\" as const,\n },\n shortcutsContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n shortcutsGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(auto-fit, minmax(80px, 1fr))\",\n gap: \"12px\",\n width: \"100%\",\n maxWidth: \"384px\",\n },\n shortcutButton: {\n height: \"56px\",\n borderRadius: \"16px\",\n fontWeight: \"600\",\n fontSize: \"24px\",\n transition: \"all 0.2s\",\n border: \"none\",\n cursor: \"pointer\",\n },\n shortcutButtonDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n shortcutButtonActive: {\n transform: \"scale(0.95)\",\n },\n positiveShortcut: {\n background: \"linear-gradient(to bottom right, #FFE6D9, #FFD4C2)\",\n color: \"#FF4E00\",\n border: \"1px solid #FFB366\",\n },\n positiveShortcutHover: {\n background: \"linear-gradient(to bottom right, #FFD4C2, #FFB366)\",\n },\n positiveShortcutActive: {\n background: \"linear-gradient(to bottom right, #FFB366, #FF8C1A)\",\n },\n negativeShortcut: {\n background: \"linear-gradient(to bottom right, #FFE6D9, #FFD4C2)\",\n color: \"#CC3300\",\n border: \"1px solid #FFB366\",\n },\n negativeShortcutHover: {\n background: \"linear-gradient(to bottom right, #FFD4C2, #FFB366)\",\n },\n negativeShortcutActive: {\n background: \"linear-gradient(to bottom right, #FFB366, #FF8C1A)\",\n },\n addButtonContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n addButton: {\n width: \"100%\",\n maxWidth: \"384px\",\n height: \"56px\",\n borderRadius: \"12px\",\n backgroundColor: \"#FF4E00\",\n color: \"white\",\n border: \"none\",\n cursor: \"pointer\",\n transition: \"all 0.2s\",\n fontWeight: \"600\",\n fontSize: \"18px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"8px\",\n },\n addButtonHover: {\n backgroundColor: \"#FF6B1A\",\n },\n addButtonActive: {\n backgroundColor: \"#E63900\",\n },\n addButtonDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n };\n\n return (\n <div\n style={{\n ...styles.container,\n }}\n >\n {/* Display da Calculadora */}\n <div style={styles.calculatorContainer}>\n <div style={styles.calculator}>\n <div style={styles.calculatorContent}>\n {/* Botão Diminuir */}\n <button\n type=\"button\"\n style={{\n ...styles.button,\n ...(disabled || valor === null || valor <= min\n ? styles.buttonDisabled\n : {}),\n }}\n onMouseEnter={(e) => {\n if (!disabled && valor !== null && valor > min) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = styles.button.background!;\n\n e.currentTarget.style.transform = \"\";\n }}\n onMouseDown={(e) => {\n if (!disabled && valor !== null && valor > min) {\n e.currentTarget.style.background =\n styles.buttonActive.background!;\n e.currentTarget.style.transform =\n styles.buttonActive.transform!;\n }\n }}\n onMouseUp={(e) => {\n if (!disabled && valor !== null && valor > min) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onClick={() => handleChange(valor === null ? null : valor - 1)}\n disabled={disabled || valor === null || valor <= min}\n aria-label=\"Diminuir quantidade\"\n >\n <svg\n style={{ width: \"24px\", height: \"24px\" }}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"#000\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n d=\"M20 12H4\"\n />\n </svg>\n </button>\n\n {/* Input do Valor */}\n <div style={styles.inputContainer}>\n <div style={styles.inputWrapper}>\n <input\n type=\"text\"\n value={inputValue.replace(\".\", \",\")}\n onChange={handleInputChange}\n min={0.0}\n max={max}\n disabled={disabled}\n className=\"quantidade-input\"\n style={{\n ...styles.input,\n ...(disabled ? styles.inputDisabled : {}),\n border: \"none\",\n }}\n onFocus={(e) => {\n if (!disabled) {\n e.target.style.outline = styles.inputFocus.outline!;\n e.target.style.borderColor =\n styles.inputFocus.borderColor!;\n }\n }}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n aria-label=\"Quantidade\"\n placeholder=\"0.000\"\n />\n {selectedUnit && (\n <div style={styles.unitLabel}>{selectedUnit}</div>\n )}\n </div>\n </div>\n\n {/* Botão Aumentar */}\n <button\n type=\"button\"\n style={{\n ...styles.button,\n ...(disabled ||\n valor === null ||\n (max !== undefined && valor >= max)\n ? styles.buttonDisabled\n : {}),\n }}\n onMouseEnter={(e) => {\n if (\n !disabled &&\n valor !== null &&\n (max === undefined || valor < max)\n ) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = styles.button.background!;\n e.currentTarget.style.transform = \"\";\n }}\n onMouseDown={(e) => {\n if (\n !disabled &&\n valor !== null &&\n (max === undefined || valor < max)\n ) {\n e.currentTarget.style.background =\n styles.buttonActive.background!;\n e.currentTarget.style.transform =\n styles.buttonActive.transform!;\n }\n }}\n onMouseUp={(e) => {\n if (\n !disabled &&\n valor !== null &&\n (max === undefined || valor < max)\n ) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onClick={() => handleChange(valor === null ? 1 : valor + 1)}\n disabled={\n disabled ||\n valor === null ||\n (max !== undefined && valor >= max)\n }\n aria-label=\"Aumentar quantidade\"\n >\n <svg\n style={{ width: \"24px\", height: \"24px\" }}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"#FF4E00\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n d=\"M12 4v16m8-8H4\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n\n {/* Teclado de Atalhos */}\n {mostrarAtalhos && (\n <div style={styles.shortcutsContainer}>\n <div style={styles.shortcutsGrid}>\n {atalhos\n .slice()\n .sort((a, b) => a - b)\n\n .map((v, i) => {\n const isPositive = v > 0;\n const disabled =\n valor === null || (!isPositive && (valor ?? 0) + v < min);\n const baseStyle = {\n ...styles.shortcutButton,\n ...(disabled ? styles.shortcutButtonDisabled : {}),\n ...(isPositive\n ? styles.positiveShortcut\n : styles.negativeShortcut),\n };\n\n return (\n <button\n key={i}\n type=\"button\"\n style={baseStyle}\n onMouseEnter={(e) => {\n if (!disabled) {\n e.currentTarget.style.background = isPositive\n ? styles.positiveShortcutHover.background!\n : styles.negativeShortcutHover.background!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = baseStyle.background!;\n e.currentTarget.style.transform = \"\";\n }}\n onMouseDown={(e) => {\n if (!disabled) {\n e.currentTarget.style.background = isPositive\n ? styles.positiveShortcutActive.background!\n : styles.negativeShortcutActive.background!;\n e.currentTarget.style.transform =\n styles.shortcutButtonActive.transform!;\n }\n }}\n onMouseUp={(e) => {\n if (!disabled) {\n e.currentTarget.style.background = isPositive\n ? styles.positiveShortcutHover.background!\n : styles.negativeShortcutHover.background!;\n e.currentTarget.style.transform = \"\";\n }\n }}\n onClick={() => handleAtalhoClick(v)}\n disabled={disabled}\n aria-label={`Adicionar ${v} ao contador`}\n >\n {v > 0 ? `+${v}` : v}\n </button>\n );\n })}\n </div>\n </div>\n )}\n\n {/* Botão Atualizar */}\n {addStockItem && (\n <div style={styles.addButtonContainer}>\n <button\n type=\"button\"\n onClick={handleAtualizarContagem}\n disabled={disabled || valor === null}\n style={{\n ...styles.addButton,\n ...(disabled || valor === null ? styles.addButtonDisabled : {}),\n }}\n onMouseEnter={(e) => {\n if (!disabled && valor !== null) {\n e.currentTarget.style.backgroundColor =\n styles.addButtonHover.backgroundColor!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor =\n styles.addButton.backgroundColor!;\n }}\n onMouseDown={(e) => {\n if (!disabled && valor !== null) {\n e.currentTarget.style.backgroundColor =\n styles.addButtonActive.backgroundColor!;\n }\n }}\n onMouseUp={(e) => {\n if (!disabled && valor !== null) {\n e.currentTarget.style.backgroundColor =\n styles.addButtonHover.backgroundColor!;\n }\n }}\n aria-label=\"Atualizar contagem\"\n >\n <svg\n style={{ width: \"24px\", height: \"24px\" }}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 4v16m8-8H4\"\n />\n </svg>\n Adicionar contagem{\" \"}\n {valor !== null\n ? (valor * (unitMultiplier || 1)).toFixed(3)\n : \"0.000\"}\n {defaultUnit && ` ${defaultUnit}`}\n </button>\n </div>\n )}\n </div>\n );\n}\n"],"names":["QuantidadeInput","valor","onChange","min","max","disabled","className","atalhos","mostrarAtalhos","selectedUnit","addStockItem","unitMultiplier","defaultUnit","React","style","inputValue","setInputValue","useState","useEffect","handleChange","novoValor","valorFinal","isValidNumber","value","normalizeInput","normalized","handleInputChange","e","rawValue","displayValue","handleBlur","styles","normalizedValue","numeroConvertido","valorFormatado","handleKeyDown","handleAtalhoClick","v","handleAtualizarContagem","jsxs","jsx","a","b","i","isPositive","baseStyle"],"mappings":";;AAiBO,SAASA,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,KAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,CAAC,GAAG,IAAI,IAAI,GAAG;AAAA,EACzB,gBAAAC,IAAiB;AAAA,EACjB,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AACF,GAAyB;AAEvBC,EAAAA,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAQ,SAAS,cAAc,OAAO;AAC5C,WAAAA,EAAM,cAAc;AAAA;AAAA;AAAA;AAAA,OAKpB,SAAS,KAAK,YAAYA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,EAAO,oBAAoB,CAAA;AAAA,YAAC;AAAA,YAE/D,cAAc,CAACJ,MAAM;AACnB,cAAI,CAACtB,KAAYJ,MAAU,SACzB0B,EAAE,cAAc,MAAM,kBACpBI,EAAO,eAAe;AAAA,YAE5B;AAAA,YACA,cAAc,CAACJ,MAAM;AACnB,cAAAA,EAAE,cAAc,MAAM,kBACpBI,EAAO,UAAU;AAAA,YACrB;AAAA,YACA,aAAa,CAACJ,MAAM;AAClB,cAAI,CAACtB,KAAYJ,MAAU,SACzB0B,EAAE,cAAc,MAAM,kBACpBI,EAAO,gBAAgB;AAAA,YAE7B;AAAA,YACA,WAAW,CAACJ,MAAM;AAChB,cAAI,CAACtB,KAAYJ,MAAU,SACzB0B,EAAE,cAAc,MAAM,kBACpBI,EAAO,eAAe;AAAA,YAE5B;AAAA,YACA,cAAW;AAAA,YAEX,UAAA;AAAA,cAAAS,gBAAAA,EAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA;AAAA,kBAChC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,QAAO;AAAA,kBAEP,UAAAA,gBAAAA,EAAAA;AAAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,eAAc;AAAA,sBACd,gBAAe;AAAA,sBACf,aAAa;AAAA,sBACb,GAAE;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACJ;AAAA,cAAA;AAAA,cACI;AAAA,cACa;AAAA,cAClBvC,MAAU,QACNA,KAASU,KAAkB,IAAI,QAAQ,CAAC,IACzC;AAAA,cACHC,KAAe,IAAIA,CAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,EACjC,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"index6.js","sources":["../src/components/QuantidadeInput/index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\n\nexport interface QuantidadeInputProps {\n valor: number | null;\n onChange: (novoValor: number | null) => void;\n min?: number;\n max?: number;\n disabled?: boolean;\n className?: string;\n atalhos?: number[];\n mostrarAtalhos?: boolean;\n addStockItem?: (valor: number) => void;\n selectedUnit?: string;\n defaultUnit?: string;\n unitMultiplier?: number;\n}\n\nexport function QuantidadeInput({\n valor,\n onChange,\n min = 0.0,\n max,\n disabled = false,\n className = \"\",\n atalhos = [5, 10, 25, 100],\n mostrarAtalhos = true,\n selectedUnit,\n addStockItem,\n unitMultiplier,\n defaultUnit,\n}: QuantidadeInputProps) {\n // Adiciona estilo CSS para o placeholder\n React.useEffect(() => {\n const style = document.createElement(\"style\");\n style.textContent = `\n .quantidade-input::placeholder {\n color: #999 !important;\n }\n `;\n document.head.appendChild(style);\n\n return () => {\n document.head.removeChild(style);\n };\n }, []);\n const [inputValue, setInputValue] = useState(\n valor === null ? \"\" : valor.toString()\n );\n\n // Função auxiliar para formatar valores\n const formatValue = useCallback(\n (value: number): string => {\n // Se for um valor inteiro, não mostrar casas decimais\n if (Number.isInteger(value)) {\n return value.toString();\n }\n\n // Determina o número de casas decimais baseado na unidade\n const isKg = selectedUnit?.toLowerCase() === \"kg\";\n const decimalPlaces = isKg ? 3 : 2;\n\n return value.toFixed(decimalPlaces).replace(\".\", \",\");\n },\n [selectedUnit]\n );\n\n // Atualiza o inputValue quando o valor prop muda externamente\n useEffect(() => {\n if (valor === null) {\n setInputValue(\"\");\n } else {\n // Formata com vírgula para exibição\n setInputValue(formatValue(valor));\n }\n }, [valor, formatValue]);\n\n const handleChange = (novoValor: number | null) => {\n if (novoValor === null) {\n onChange(null);\n setInputValue(\"\");\n return;\n }\n console.log(\"novoValor\", novoValor);\n let valorFinal = Math.max(min, novoValor);\n if (max !== undefined) {\n valorFinal = Math.min(max, valorFinal);\n }\n\n console.log(\"novoValor\", novoValor);\n onChange(valorFinal);\n // Formata com vírgula para exibição\n setInputValue(formatValue(valorFinal));\n };\n\n const isValidNumber = (value: string): boolean => {\n // Permite números vazios, números inteiros e decimais (com , ou .)\n // Permite múltiplos zeros à esquerda durante a digitação\n return /^$|^\\d*([.,]\\d*)?$/.test(value);\n };\n\n const normalizeInput = (value: string): string => {\n // Remove espaços\n let normalized = value.trim();\n\n // Se estiver vazio, retorna vazio\n if (normalized === \"\" || normalized === \".\" || normalized === \",\") {\n return \"\";\n }\n\n // Normaliza o separador decimal: converte . para , (para exibição)\n // Mas mantém a lógica interna com .\n normalized = normalized.replace(\",\", \".\");\n\n // Remove zeros à esquerda desnecessários (mas mantém se for \"0.xxx\")\n // Ex: \"00.234\" -> \"0.234\", \"000\" -> \"0\"\n if (\n normalized.startsWith(\"0\") &&\n normalized.length > 1 &&\n normalized[1] !== \".\"\n ) {\n // Remove zeros à esquerda até encontrar um ponto ou um dígito diferente de zero\n normalized = normalized.replace(/^0+/, \"\");\n // Se ficou vazio ou começa com ponto, adiciona 0\n if (normalized === \"\" || normalized.startsWith(\".\")) {\n normalized = \"0\" + normalized;\n }\n }\n\n // Se começa com ponto, adiciona 0 antes\n // Ex: \".234\" -> \"0.234\"\n if (normalized.startsWith(\".\")) {\n normalized = \"0\" + normalized;\n }\n\n return normalized;\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawValue = e.target.value;\n\n // Permite valores vazios durante a digitação\n if (rawValue === \"\") {\n setInputValue(\"\");\n return;\n }\n\n // Valida o formato (permite . ou ,)\n if (!isValidNumber(rawValue)) return;\n\n // Durante a digitação, mantém o valor como o usuário digitou\n // Mas normaliza para exibição (converte . para ,)\n const displayValue = rawValue.replace(\".\", \",\");\n setInputValue(displayValue);\n };\n\n const handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n // Resetar estilos do input\n e.target.style.outline = \"\";\n e.target.style.borderColor = styles.input.border!;\n\n // Se o valor estiver vazio, define como null\n if (inputValue === \"\" || inputValue === \".\" || inputValue === \",\") {\n setInputValue(\"\");\n onChange(null);\n return;\n }\n\n // Normaliza o valor (remove zeros à esquerda, adiciona 0 antes de . se necessário)\n const normalizedValue = normalizeInput(inputValue);\n\n if (normalizedValue === \"\") {\n setInputValue(\"\");\n onChange(null);\n return;\n }\n\n // Converte para número\n const numeroConvertido = parseFloat(normalizedValue);\n\n if (!isNaN(numeroConvertido) && isFinite(numeroConvertido)) {\n // Garante que o valor seja pelo menos o mínimo\n const valorFinal = Math.max(min, numeroConvertido);\n\n // Formata o valor e converte . para , para exibição\n const valorFormatado = formatValue(valorFinal);\n setInputValue(valorFormatado);\n\n // Chama onChange com o valor numérico\n onChange(valorFinal);\n } else {\n setInputValue(\"\");\n onChange(null);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n // Permite que o usuário pressione Enter para confirmar o valor\n if (e.key === \"Enter\") {\n e.currentTarget.blur(); // Isso dispara o handleBlur\n }\n };\n\n const handleAtalhoClick = (v: number) => {\n const novoValor = (valor ?? 0) + v;\n handleChange(novoValor);\n };\n\n const handleAtualizarContagem = () => {\n if (!addStockItem || valor === null) return;\n addStockItem(valor * (unitMultiplier || 1));\n handleChange(null);\n };\n\n // Estilos inline para substituir Tailwind\n const styles = {\n container: {\n display: \"flex\",\n flexDirection: \"column\" as const,\n gap: \"16px\",\n width: \"100%\",\n },\n calculatorContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n width: \"100%\",\n },\n calculator: {\n position: \"relative\" as const,\n backgroundColor: \"#f5f5f5\", // Fundo cinza claro\n borderRadius: \"16px\",\n padding: \"16px\",\n width: \"100%\",\n maxWidth: \"384px\",\n },\n calculatorContent: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"16px\",\n },\n button: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"64px\",\n height: \"64px\",\n borderRadius: \"16px\",\n background: \"white\",\n color: \"#333\",\n border: \"1px solid rgb(240, 240, 240)\",\n cursor: \"pointer\",\n transition: \"all 0.2s\",\n },\n buttonHover: {\n background: \"#f8f8f8\",\n transform: \"scale(1.02)\",\n },\n buttonActive: {\n background: \"#f0f0f0\",\n transform: \"scale(0.98)\",\n },\n buttonDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n inputContainer: {\n display: \"flex\",\n flexDirection: \"column\" as const,\n alignItems: \"center\",\n flex: 1,\n maxWidth: \"192px\",\n },\n inputWrapper: {\n position: \"relative\" as const,\n width: \"100%\",\n flex: 1,\n flexDirection: \"column\" as const,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n input: {\n width: \"100%\",\n height: \"40px\",\n textAlign: \"center\" as const,\n fontSize: \"34px\",\n fontWeight: \"bold\",\n borderRadius: \"24px\",\n color: \"#000\",\n appearance: \"textfield\" as const,\n background: \"transparent\",\n border: \"none\",\n },\n inputFocus: {\n outline: \"none\",\n borderColor: \"#FF4E00\",\n },\n inputDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n unitLabel: {\n pointerEvents: \"none\" as const,\n fontSize: \"16px\",\n color: \"#000\",\n fontWeight: \"500\",\n marginTop: \"4px\",\n textAlign: \"center\" as const,\n },\n shortcutsContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n shortcutsGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(auto-fit, minmax(80px, 1fr))\",\n gap: \"12px\",\n width: \"100%\",\n maxWidth: \"384px\",\n },\n shortcutButton: {\n height: \"56px\",\n borderRadius: \"16px\",\n fontWeight: \"600\",\n fontSize: \"24px\",\n transition: \"all 0.2s\",\n border: \"none\",\n cursor: \"pointer\",\n },\n shortcutButtonDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n shortcutButtonActive: {\n transform: \"scale(0.95)\",\n },\n positiveShortcut: {\n background: \"linear-gradient(to bottom right, #FFE6D9, #FFD4C2)\",\n color: \"#FF4E00\",\n border: \"1px solid #FFB366\",\n },\n positiveShortcutHover: {\n background: \"linear-gradient(to bottom right, #FFD4C2, #FFB366)\",\n },\n positiveShortcutActive: {\n background: \"linear-gradient(to bottom right, #FFB366, #FF8C1A)\",\n },\n negativeShortcut: {\n background: \"linear-gradient(to bottom right, #FFE6D9, #FFD4C2)\",\n color: \"#CC3300\",\n border: \"1px solid #FFB366\",\n },\n negativeShortcutHover: {\n background: \"linear-gradient(to bottom right, #FFD4C2, #FFB366)\",\n },\n negativeShortcutActive: {\n background: \"linear-gradient(to bottom right, #FFB366, #FF8C1A)\",\n },\n addButtonContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n addButton: {\n width: \"100%\",\n maxWidth: \"384px\",\n height: \"56px\",\n borderRadius: \"12px\",\n backgroundColor: \"#FF4E00\",\n color: \"white\",\n border: \"none\",\n cursor: \"pointer\",\n transition: \"all 0.2s\",\n fontWeight: \"600\",\n fontSize: \"18px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"8px\",\n },\n addButtonHover: {\n backgroundColor: \"#FF6B1A\",\n },\n addButtonActive: {\n backgroundColor: \"#E63900\",\n },\n addButtonDisabled: {\n opacity: 0.4,\n cursor: \"not-allowed\",\n },\n };\n\n return (\n <div\n style={{\n ...styles.container,\n }}\n >\n {/* Display da Calculadora */}\n <div style={styles.calculatorContainer}>\n <div style={styles.calculator}>\n <div style={styles.calculatorContent}>\n {/* Botão Diminuir */}\n <button\n type=\"button\"\n style={{\n ...styles.button,\n ...(disabled || (valor ?? 0) === 0\n ? styles.buttonDisabled\n : {}),\n }}\n onMouseEnter={(e) => {\n if (!disabled && (valor ?? 0) > 0) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = styles.button.background!;\n\n e.currentTarget.style.transform = \"\";\n }}\n onMouseDown={(e) => {\n if (!disabled && (valor ?? 0) > 0) {\n e.currentTarget.style.background =\n styles.buttonActive.background!;\n e.currentTarget.style.transform =\n styles.buttonActive.transform!;\n }\n }}\n onMouseUp={(e) => {\n if (!disabled && (valor ?? 0) > 0) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onClick={() => {\n const valorAtual = valor === null ? 0 : valor;\n handleChange(valorAtual - 1);\n }}\n disabled={disabled || (valor ?? 0) === 0}\n aria-label=\"Diminuir quantidade\"\n >\n <svg\n style={{ width: \"24px\", height: \"24px\" }}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"#000\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n d=\"M20 12H4\"\n />\n </svg>\n </button>\n\n {/* Input do Valor */}\n <div style={styles.inputContainer}>\n <div style={styles.inputWrapper}>\n <input\n type=\"text\"\n value={inputValue.replace(\".\", \",\")}\n onChange={handleInputChange}\n min={0.0}\n max={max}\n disabled={disabled}\n className=\"quantidade-input\"\n style={{\n ...styles.input,\n ...(disabled ? styles.inputDisabled : {}),\n border: \"none\",\n }}\n onFocus={(e) => {\n if (!disabled) {\n e.target.style.outline = styles.inputFocus.outline!;\n e.target.style.borderColor =\n styles.inputFocus.borderColor!;\n }\n }}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n aria-label=\"Quantidade\"\n placeholder=\"0\"\n />\n {selectedUnit && (\n <div style={styles.unitLabel}>{selectedUnit}</div>\n )}\n </div>\n </div>\n\n {/* Botão Aumentar */}\n <button\n type=\"button\"\n style={{\n ...styles.button,\n ...(disabled || (max !== undefined && (valor ?? 0) >= max)\n ? styles.buttonDisabled\n : {}),\n }}\n onMouseEnter={(e) => {\n if (!disabled && (max === undefined || (valor ?? 0) < max)) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = styles.button.background!;\n e.currentTarget.style.transform = \"\";\n }}\n onMouseDown={(e) => {\n if (!disabled && (max === undefined || (valor ?? 0) < max)) {\n e.currentTarget.style.background =\n styles.buttonActive.background!;\n e.currentTarget.style.transform =\n styles.buttonActive.transform!;\n }\n }}\n onMouseUp={(e) => {\n if (!disabled && (max === undefined || (valor ?? 0) < max)) {\n e.currentTarget.style.background =\n styles.buttonHover.background!;\n e.currentTarget.style.transform =\n styles.buttonHover.transform!;\n }\n }}\n onClick={() => {\n const valorAtual = valor === null ? 0 : valor;\n handleChange(valorAtual + 1);\n }}\n disabled={disabled || (max !== undefined && (valor ?? 0) >= max)}\n aria-label=\"Aumentar quantidade\"\n >\n <svg\n style={{ width: \"24px\", height: \"24px\" }}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"#FF4E00\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n d=\"M12 4v16m8-8H4\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n\n {/* Teclado de Atalhos */}\n {mostrarAtalhos && (\n <div style={styles.shortcutsContainer}>\n <div style={styles.shortcutsGrid}>\n {atalhos\n .slice()\n .sort((a, b) => a - b)\n\n .map((v, i) => {\n const isPositive = v > 0;\n const disabled = !isPositive && (valor ?? 0) + v < min;\n const baseStyle = {\n ...styles.shortcutButton,\n ...(disabled ? styles.shortcutButtonDisabled : {}),\n ...(isPositive\n ? styles.positiveShortcut\n : styles.negativeShortcut),\n };\n\n return (\n <button\n key={i}\n type=\"button\"\n style={baseStyle}\n onMouseEnter={(e) => {\n if (!disabled) {\n e.currentTarget.style.background = isPositive\n ? styles.positiveShortcutHover.background!\n : styles.negativeShortcutHover.background!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = baseStyle.background!;\n e.currentTarget.style.transform = \"\";\n }}\n onMouseDown={(e) => {\n if (!disabled) {\n e.currentTarget.style.background = isPositive\n ? styles.positiveShortcutActive.background!\n : styles.negativeShortcutActive.background!;\n e.currentTarget.style.transform =\n styles.shortcutButtonActive.transform!;\n }\n }}\n onMouseUp={(e) => {\n if (!disabled) {\n e.currentTarget.style.background = isPositive\n ? styles.positiveShortcutHover.background!\n : styles.negativeShortcutHover.background!;\n e.currentTarget.style.transform = \"\";\n }\n }}\n onClick={() => handleAtalhoClick(v)}\n disabled={disabled}\n aria-label={`Adicionar ${v} ao contador`}\n >\n {v > 0 ? `+${v}` : v}\n </button>\n );\n })}\n </div>\n </div>\n )}\n\n {/* Botão Atualizar */}\n {addStockItem && (\n <div style={styles.addButtonContainer}>\n <button\n type=\"button\"\n onClick={handleAtualizarContagem}\n disabled={disabled || valor === null}\n style={{\n ...styles.addButton,\n ...(disabled || valor === null ? styles.addButtonDisabled : {}),\n }}\n onMouseEnter={(e) => {\n if (!disabled && valor !== null) {\n e.currentTarget.style.backgroundColor =\n styles.addButtonHover.backgroundColor!;\n }\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor =\n styles.addButton.backgroundColor!;\n }}\n onMouseDown={(e) => {\n if (!disabled && valor !== null) {\n e.currentTarget.style.backgroundColor =\n styles.addButtonActive.backgroundColor!;\n }\n }}\n onMouseUp={(e) => {\n if (!disabled && valor !== null) {\n e.currentTarget.style.backgroundColor =\n styles.addButtonHover.backgroundColor!;\n }\n }}\n aria-label=\"Atualizar contagem\"\n >\n <svg\n style={{ width: \"24px\", height: \"24px\" }}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 4v16m8-8H4\"\n />\n </svg>\n Adicionar contagem{\" \"}\n {valor !== null ? formatValue(valor * (unitMultiplier || 1)) : \"0\"}\n {defaultUnit && ` ${defaultUnit}`}\n </button>\n </div>\n )}\n </div>\n );\n}\n"],"names":["QuantidadeInput","valor","onChange","min","max","disabled","className","atalhos","mostrarAtalhos","selectedUnit","addStockItem","unitMultiplier","defaultUnit","React","style","inputValue","setInputValue","useState","formatValue","useCallback","value","decimalPlaces","useEffect","handleChange","novoValor","valorFinal","isValidNumber","normalizeInput","normalized","handleInputChange","e","rawValue","displayValue","handleBlur","styles","normalizedValue","numeroConvertido","valorFormatado","handleKeyDown","handleAtalhoClick","v","handleAtualizarContagem","jsxs","jsx","a","b","i","isPositive","baseStyle"],"mappings":";;AAiBO,SAASA,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,KAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,CAAC,GAAG,IAAI,IAAI,GAAG;AAAA,EACzB,gBAAAC,IAAiB;AAAA,EACjB,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AACF,GAAyB;AAEvBC,EAAAA,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAQ,SAAS,cAAc,OAAO;AAC5C,WAAAA,EAAM,cAAc;AAAA;AAAA;AAAA;AAAA,OAKpB,SAAS,KAAK,YAAYA,CAAK,GAExB,MAAM;AACX,eAAS,KAAK,YAAYA,CAAK;AAAA,IACjC;AAAA,EACF,GAAG,CAAA,CAAE;AACL,QAAM,CAACC,GAAYC,CAAa,IAAIC;AAAA,IAClChB,MAAU,OAAO,KAAKA,EAAM,SAAA;AAAA,EAAS,GAIjCiB,IAAcC;AAAA,IAClB,CAACC,MAA0B;AAEzB,UAAI,OAAO,UAAUA,CAAK;AACxB,eAAOA,EAAM,SAAA;AAKf,YAAMC,KADOZ,KAAA,gBAAAA,EAAc,mBAAkB,OAChB,IAAI;AAEjC,aAAOW,EAAM,QAAQC,CAAa,EAAE,QAAQ,KAAK,GAAG;AAAA,IACtD;AAAA,IACA,CAACZ,CAAY;AAAA,EAAA;AAIf,EAAAa,EAAU,MAAM;AACd,IACEN,EADEf,MAAU,OACE,KAGAiB,EAAYjB,CAAK,CAHf;AAAA,EAKpB,GAAG,CAACA,GAAOiB,CAAW,CAAC;AAEvB,QAAMK,IAAe,CAACC,MAA6B;AACjD,QAAIA,MAAc,MAAM;AACtB,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Ae;AAAA,YAE5B;AAAA,YACA,cAAW;AAAA,YAEX,UAAA;AAAA,cAAAS,gBAAAA,EAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA;AAAA,kBAChC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,QAAO;AAAA,kBAEP,UAAAA,gBAAAA,EAAAA;AAAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,eAAc;AAAA,sBACd,gBAAe;AAAA,sBACf,aAAa;AAAA,sBACb,GAAE;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACJ;AAAA,cAAA;AAAA,cACI;AAAA,cACa;AAAA,cAClB1C,MAAU,OAAOiB,EAAYjB,KAASU,KAAkB,EAAE,IAAI;AAAA,cAC9DC,KAAe,IAAIA,CAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,EACjC,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eatopia-ds",
3
3
  "private": false,
4
- "version": "0.0.944",
4
+ "version": "0.0.945",
5
5
  "type": "module",
6
6
  "types": "./build/types/index.d.ts",
7
7
  "main": "./build/index.js",