eatopia-ds 0.0.951 → 0.0.953
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/index10.js +127 -122
- package/build/index10.js.map +1 -1
- package/build/index11.js +11 -10
- package/build/index11.js.map +1 -1
- package/build/index18.js +663 -580
- package/build/index18.js.map +1 -1
- package/build/index46.js +1 -1
- package/build/index49.js +1 -1
- package/package.json +1 -1
package/build/index10.js
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import { j as t } from "./index24.js";
|
|
2
|
-
import
|
|
3
|
-
import { StockLeadTime as
|
|
4
|
-
import { calculateConsumptionForecast as
|
|
5
|
-
import { AlertIcon as
|
|
6
|
-
const he = [1, 2, 3, 7, 10, 15, 30, 60, 90], v = (n) => {
|
|
7
|
-
const
|
|
8
|
-
return `${
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
},
|
|
2
|
+
import He, { useState as k, useEffect as Y, useMemo as D } from "react";
|
|
3
|
+
import { StockLeadTime as Ne } from "./index18.js";
|
|
4
|
+
import { calculateConsumptionForecast as be, calculateTotalConsumptionForRange as _e } from "./index21.js";
|
|
5
|
+
import { AlertIcon as Ue } from "./index23.js";
|
|
6
|
+
const he = [1, 2, 3, 7, 10, 15, 30, 60, 90], Ve = 60, v = (n) => {
|
|
7
|
+
const g = n.getFullYear(), q = String(n.getMonth() + 1).padStart(2, "0"), d = String(n.getDate()).padStart(2, "0");
|
|
8
|
+
return `${g}-${q}-${d}`;
|
|
9
|
+
}, S = (n) => {
|
|
10
|
+
const g = n.split("-").map(Number);
|
|
11
|
+
return g.length !== 3 || g.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(g[0], g[1] - 1, g[2]);
|
|
12
|
+
}, Ye = () => {
|
|
13
13
|
const n = /* @__PURE__ */ new Date();
|
|
14
14
|
return n.setDate(n.getDate() + 1), n.setHours(0, 0, 0, 0), v(n);
|
|
15
15
|
}, A = () => {
|
|
16
16
|
const n = /* @__PURE__ */ new Date();
|
|
17
17
|
return n.setDate(n.getDate() + 1), n.setHours(0, 0, 0, 0), n;
|
|
18
|
-
},
|
|
19
|
-
(
|
|
20
|
-
),
|
|
18
|
+
}, ve = (n) => n <= 0 ? 7 : he.reduce(
|
|
19
|
+
(g, q) => Math.abs(q - n) < Math.abs(g - n) ? q : g
|
|
20
|
+
), P = (n) => {
|
|
21
|
+
const g = ve(n);
|
|
22
|
+
return Math.max(g, Ve);
|
|
23
|
+
}, Ae = 42, je = {
|
|
21
24
|
position: "relative",
|
|
22
|
-
height: `${
|
|
25
|
+
height: `${Ae}px`,
|
|
23
26
|
border: "1.5px solid #e2e8f0",
|
|
24
27
|
borderRadius: "10px",
|
|
25
28
|
backgroundColor: "#f8fafc",
|
|
26
29
|
display: "flex",
|
|
27
30
|
alignItems: "center",
|
|
28
31
|
boxSizing: "border-box"
|
|
29
|
-
},
|
|
32
|
+
}, ke = {
|
|
30
33
|
position: "absolute",
|
|
31
34
|
inset: 0,
|
|
32
35
|
width: "100%",
|
|
@@ -42,14 +45,14 @@ const he = [1, 2, 3, 7, 10, 15, 30, 60, 90], v = (n) => {
|
|
|
42
45
|
boxSizing: "border-box"
|
|
43
46
|
}, W = ({
|
|
44
47
|
children: n,
|
|
45
|
-
...
|
|
46
|
-
}) => /* @__PURE__ */ t.jsxs("div", { style:
|
|
48
|
+
...g
|
|
49
|
+
}) => /* @__PURE__ */ t.jsxs("div", { style: je, children: [
|
|
47
50
|
/* @__PURE__ */ t.jsx(
|
|
48
51
|
"select",
|
|
49
52
|
{
|
|
50
|
-
...
|
|
53
|
+
...g,
|
|
51
54
|
style: {
|
|
52
|
-
...
|
|
55
|
+
...ke,
|
|
53
56
|
padding: "0 36px 0 14px",
|
|
54
57
|
appearance: "none",
|
|
55
58
|
WebkitAppearance: "none"
|
|
@@ -87,29 +90,30 @@ const he = [1, 2, 3, 7, 10, 15, 30, 60, 90], v = (n) => {
|
|
|
87
90
|
)
|
|
88
91
|
}
|
|
89
92
|
)
|
|
90
|
-
] }),
|
|
93
|
+
] }), Oe = (n) => /* @__PURE__ */ t.jsx("div", { style: je, children: /* @__PURE__ */ t.jsx(
|
|
91
94
|
"input",
|
|
92
95
|
{
|
|
93
96
|
type: "date",
|
|
94
97
|
...n,
|
|
95
|
-
style: { ...
|
|
98
|
+
style: { ...ke, padding: "0 14px" }
|
|
96
99
|
}
|
|
97
100
|
) });
|
|
98
|
-
function
|
|
101
|
+
function nt({
|
|
99
102
|
data: n,
|
|
100
|
-
onSubmit:
|
|
103
|
+
onSubmit: g,
|
|
101
104
|
onCancel: q,
|
|
102
105
|
timelineData: d,
|
|
103
|
-
fornecedoresOptions:
|
|
104
|
-
marcasOptions:
|
|
105
|
-
embalagensOptions:
|
|
106
|
+
fornecedoresOptions: $e,
|
|
107
|
+
marcasOptions: Qe,
|
|
108
|
+
embalagensOptions: Ge,
|
|
106
109
|
dailyConsumptionAverages: x,
|
|
107
|
-
showSuggestionBar:
|
|
108
|
-
showLegendTimeline:
|
|
109
|
-
initialQtdDays: j
|
|
110
|
+
showSuggestionBar: qe = !0,
|
|
111
|
+
showLegendTimeline: Ce = !1,
|
|
112
|
+
initialQtdDays: j,
|
|
113
|
+
stockLeadTimeZoomOnly: we = !1
|
|
110
114
|
}) {
|
|
111
115
|
var ee, te, ne, oe, re, se, ie, ae, le, ce, de, ue, fe, ge, pe, me;
|
|
112
|
-
|
|
116
|
+
He.useEffect(() => {
|
|
113
117
|
const e = document.createElement("style");
|
|
114
118
|
return e.textContent = `
|
|
115
119
|
.order-form-quantity-input::-webkit-outer-spin-button,
|
|
@@ -124,10 +128,10 @@ function Ze({
|
|
|
124
128
|
document.head.removeChild(e);
|
|
125
129
|
};
|
|
126
130
|
}, []);
|
|
127
|
-
const [C,
|
|
131
|
+
const [C, Fe] = k(!1);
|
|
128
132
|
Y(() => {
|
|
129
133
|
const e = () => {
|
|
130
|
-
|
|
134
|
+
Fe(window.innerWidth <= 768);
|
|
131
135
|
};
|
|
132
136
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
133
137
|
}, []);
|
|
@@ -137,13 +141,13 @@ function Ze({
|
|
|
137
141
|
if (!e || !s) return 0;
|
|
138
142
|
const r = new Date(e), l = new Date(s).getTime() - r.getTime(), c = Math.ceil(l / (1e3 * 60 * 60 * 24));
|
|
139
143
|
return c > 0 ? c : 0;
|
|
140
|
-
},
|
|
144
|
+
}, Te = () => {
|
|
141
145
|
var i;
|
|
142
146
|
const e = A(), s = (i = d == null ? void 0 : d.timeline) == null ? void 0 : i.stockEndDate;
|
|
143
147
|
if (!s) return v(e);
|
|
144
|
-
const r =
|
|
148
|
+
const r = S(s);
|
|
145
149
|
return isNaN(r.getTime()) || r < e ? v(e) : v(r);
|
|
146
|
-
},
|
|
150
|
+
}, Ie = () => ve(O()), Se = () => j != null && j > 0 ? P(j) : P(Ie()), p = (() => {
|
|
147
151
|
var i, l, c;
|
|
148
152
|
const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
|
|
149
153
|
if (!e) return null;
|
|
@@ -160,23 +164,23 @@ function Ze({
|
|
|
160
164
|
let r = null;
|
|
161
165
|
for (const u of e.marcas || [])
|
|
162
166
|
for (const f of u.embalagens || []) {
|
|
163
|
-
const
|
|
164
|
-
if (!(
|
|
167
|
+
const m = f.quantidade_fornecedor;
|
|
168
|
+
if (!(m <= 0))
|
|
165
169
|
for (let h = 1; h <= 100; h++) {
|
|
166
|
-
const xe = h *
|
|
170
|
+
const xe = h * m, U = be({
|
|
167
171
|
dailyAverages: x,
|
|
168
172
|
startDate: /* @__PURE__ */ new Date(),
|
|
169
173
|
totalQuantity: xe
|
|
170
174
|
});
|
|
171
175
|
if (U.totalDays >= s) {
|
|
172
|
-
const
|
|
173
|
-
(!r || V < r.daysDifference || V === r.daysDifference &&
|
|
176
|
+
const ye = h * f.valor_unitario * m, V = U.totalDays - s;
|
|
177
|
+
(!r || V < r.daysDifference || V === r.daysDifference && ye < r.totalValue) && (r = {
|
|
174
178
|
marca: u.nome,
|
|
175
179
|
embalagem: f.label,
|
|
176
180
|
quantidade: h,
|
|
177
181
|
valorUnitario: f.valor_unitario,
|
|
178
182
|
totalKg: xe,
|
|
179
|
-
totalValue:
|
|
183
|
+
totalValue: ye,
|
|
180
184
|
days: U.totalDays,
|
|
181
185
|
daysDifference: V
|
|
182
186
|
});
|
|
@@ -189,48 +193,48 @@ function Ze({
|
|
|
189
193
|
quantidade: r.quantidade,
|
|
190
194
|
valorUnitario: r.valorUnitario
|
|
191
195
|
} : null;
|
|
192
|
-
})(),
|
|
196
|
+
})(), Ee = () => {
|
|
193
197
|
var i, l, c;
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
198
|
+
if (p)
|
|
199
|
+
return p.valorUnitario;
|
|
196
200
|
const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
|
|
197
201
|
if (!e) return 0;
|
|
198
202
|
const s = (l = e.marcas) == null ? void 0 : l[0];
|
|
199
203
|
if (!s) return 0;
|
|
200
204
|
const r = (c = s.embalagens) == null ? void 0 : c[0];
|
|
201
205
|
return (r == null ? void 0 : r.valor_unitario) ?? 0;
|
|
202
|
-
},
|
|
206
|
+
}, L = n.unidade_medida ?? "kg", Be = ((ee = n.ultima_compra) == null ? void 0 : ee.unidade) ?? n.unidade_medida ?? "kg", [a, $] = k({
|
|
203
207
|
...n,
|
|
204
|
-
qtdPedido: (
|
|
205
|
-
valorTotal: (n == null ? void 0 : n.valorTotal) ?? ((
|
|
206
|
-
}), [
|
|
208
|
+
qtdPedido: (p == null ? void 0 : p.quantidade) ?? (n == null ? void 0 : n.qtdPedido) ?? 0,
|
|
209
|
+
valorTotal: (n == null ? void 0 : n.valorTotal) ?? ((p == null ? void 0 : p.quantidade) ?? (n == null ? void 0 : n.qtdPedido) ?? 0) * Ee()
|
|
210
|
+
}), [Me, Q] = k(
|
|
207
211
|
((ne = (te = n == null ? void 0 : n.fornecedores) == null ? void 0 : te[0]) == null ? void 0 : ne.nome) ?? ""
|
|
208
212
|
), [w, E] = k(
|
|
209
|
-
(
|
|
213
|
+
(p == null ? void 0 : p.marca) ?? ((ie = (se = (re = (oe = n == null ? void 0 : n.fornecedores) == null ? void 0 : oe[0]) == null ? void 0 : re.marcas) == null ? void 0 : se[0]) == null ? void 0 : ie.nome) ?? ""
|
|
210
214
|
), [T, B] = k(
|
|
211
|
-
(
|
|
212
|
-
), [
|
|
213
|
-
|
|
214
|
-
), [z, K] = k(
|
|
215
|
+
(p == null ? void 0 : p.embalagem) ?? ((fe = (ue = (de = (ce = (le = (ae = n == null ? void 0 : n.fornecedores) == null ? void 0 : ae[0]) == null ? void 0 : le.marcas) == null ? void 0 : ce[0]) == null ? void 0 : de.embalagens) == null ? void 0 : ue[0]) == null ? void 0 : fe.label) ?? ""
|
|
216
|
+
), [R, G] = k(
|
|
217
|
+
Te
|
|
218
|
+
), [z, K] = k(Se);
|
|
215
219
|
Y(() => {
|
|
216
220
|
var c, u, f;
|
|
217
221
|
const e = A(), s = (c = d == null ? void 0 : d.timeline) == null ? void 0 : c.stockEndDate;
|
|
218
222
|
let r;
|
|
219
223
|
if (s) {
|
|
220
|
-
const
|
|
221
|
-
r = isNaN(
|
|
224
|
+
const m = S(s);
|
|
225
|
+
r = isNaN(m.getTime()) || m < e ? v(e) : v(m);
|
|
222
226
|
} else
|
|
223
227
|
r = v(e);
|
|
224
228
|
let i = 0;
|
|
225
229
|
if ((u = d == null ? void 0 : d.timeline) != null && u.restockSuggestionStart && ((f = d == null ? void 0 : d.timeline) != null && f.restockSuggestionEnd)) {
|
|
226
|
-
const
|
|
227
|
-
!isNaN(
|
|
230
|
+
const m = S(d.timeline.restockSuggestionStart), h = S(d.timeline.restockSuggestionEnd);
|
|
231
|
+
!isNaN(m.getTime()) && !isNaN(h.getTime()) && (i = Math.ceil((h.getTime() - m.getTime()) / (1e3 * 60 * 60 * 24)) || 0);
|
|
228
232
|
}
|
|
229
233
|
const l = j != null && j > 0 ? P(j) : P(i);
|
|
230
234
|
G(r), K(l);
|
|
231
235
|
}, [d, n, j]), Y(() => {
|
|
232
236
|
var s, r, i;
|
|
233
|
-
if (
|
|
237
|
+
if (p) return;
|
|
234
238
|
const e = (s = n == null ? void 0 : n.fornecedores) == null ? void 0 : s[0];
|
|
235
239
|
if (e) {
|
|
236
240
|
Q(e.nome);
|
|
@@ -241,7 +245,7 @@ function Ze({
|
|
|
241
245
|
c && B(c.label);
|
|
242
246
|
}
|
|
243
247
|
}
|
|
244
|
-
}, [n,
|
|
248
|
+
}, [n, p]);
|
|
245
249
|
const M = D(() => {
|
|
246
250
|
var l, c, u;
|
|
247
251
|
const e = (l = a.fornecedores) == null ? void 0 : l[0];
|
|
@@ -257,21 +261,21 @@ function Ze({
|
|
|
257
261
|
a.fornecedores,
|
|
258
262
|
w,
|
|
259
263
|
T
|
|
260
|
-
]), H = D(() => !x || M <= 0 ? null :
|
|
264
|
+
]), H = D(() => !x || M <= 0 ? null : be({
|
|
261
265
|
dailyAverages: x,
|
|
262
266
|
startDate: /* @__PURE__ */ new Date(),
|
|
263
267
|
totalQuantity: M
|
|
264
|
-
}), [x, M]), F = (H == null ? void 0 : H.totalDays) ?? 0,
|
|
268
|
+
}), [x, M]), F = (H == null ? void 0 : H.totalDays) ?? 0, y = D(() => {
|
|
265
269
|
if (!x) return 0;
|
|
266
|
-
const e = A(), s =
|
|
270
|
+
const e = A(), s = S(R);
|
|
267
271
|
if (isNaN(s.getTime())) return 0;
|
|
268
272
|
const r = s < e ? e : s;
|
|
269
|
-
return
|
|
273
|
+
return _e(
|
|
270
274
|
x,
|
|
271
275
|
r,
|
|
272
276
|
z
|
|
273
277
|
);
|
|
274
|
-
}, [x,
|
|
278
|
+
}, [x, R, z]), Z = D(() => {
|
|
275
279
|
if (d)
|
|
276
280
|
return {
|
|
277
281
|
...d,
|
|
@@ -283,7 +287,7 @@ function Ze({
|
|
|
283
287
|
}, [d, x]);
|
|
284
288
|
if (!n)
|
|
285
289
|
return null;
|
|
286
|
-
const
|
|
290
|
+
const J = () => {
|
|
287
291
|
var r, i, l;
|
|
288
292
|
const e = (r = a.fornecedores) == null ? void 0 : r[0];
|
|
289
293
|
if (!e) return null;
|
|
@@ -291,17 +295,17 @@ function Ze({
|
|
|
291
295
|
return s ? ((l = s.embalagens) == null ? void 0 : l.find((c) => c.label === T)) ?? null : null;
|
|
292
296
|
}, N = () => {
|
|
293
297
|
var e;
|
|
294
|
-
return ((e =
|
|
295
|
-
},
|
|
298
|
+
return ((e = J()) == null ? void 0 : e.valor_unitario) ?? 0;
|
|
299
|
+
}, X = (e) => {
|
|
296
300
|
const s = Number(e).toFixed(2), [r, i] = s.split(".");
|
|
297
301
|
return `R$ ${r.replace(
|
|
298
302
|
/\B(?=(\d{3})+(?!\d))/g,
|
|
299
303
|
"."
|
|
300
304
|
)},${i}`;
|
|
301
|
-
},
|
|
305
|
+
}, b = () => {
|
|
302
306
|
var e;
|
|
303
|
-
return ((e =
|
|
304
|
-
},
|
|
307
|
+
return ((e = J()) == null ? void 0 : e.quantidade_fornecedor) ?? 0;
|
|
308
|
+
}, I = (e) => {
|
|
305
309
|
const s = N(), r = e * s;
|
|
306
310
|
$((i) => ({
|
|
307
311
|
...i,
|
|
@@ -313,26 +317,26 @@ function Ze({
|
|
|
313
317
|
B(e);
|
|
314
318
|
const s = (c = a.fornecedores) == null ? void 0 : c[0];
|
|
315
319
|
if (!s) return;
|
|
316
|
-
const r = (u = s.marcas) == null ? void 0 : u.find((
|
|
320
|
+
const r = (u = s.marcas) == null ? void 0 : u.find((m) => m.nome === w);
|
|
317
321
|
if (!r) return;
|
|
318
|
-
const i = (f = r.embalagens) == null ? void 0 : f.find((
|
|
322
|
+
const i = (f = r.embalagens) == null ? void 0 : f.find((m) => m.label === e);
|
|
319
323
|
if (!i) return;
|
|
320
324
|
const l = a.qtdPedido * (i.valor_unitario ?? 0);
|
|
321
|
-
$((
|
|
322
|
-
...
|
|
325
|
+
$((m) => ({
|
|
326
|
+
...m,
|
|
323
327
|
valorTotal: l
|
|
324
328
|
}));
|
|
325
|
-
},
|
|
329
|
+
}, De = () => {
|
|
326
330
|
var s;
|
|
327
331
|
const e = (s = a.fornecedores) == null ? void 0 : s[0];
|
|
328
332
|
return e ? e.marcas || [] : [];
|
|
329
|
-
},
|
|
333
|
+
}, Pe = () => {
|
|
330
334
|
var r, i;
|
|
331
335
|
const e = (r = a.fornecedores) == null ? void 0 : r[0];
|
|
332
336
|
if (!e) return [];
|
|
333
337
|
const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome === w);
|
|
334
338
|
return s ? s.embalagens || [] : [];
|
|
335
|
-
},
|
|
339
|
+
}, We = (e) => {
|
|
336
340
|
var l, c;
|
|
337
341
|
E(e);
|
|
338
342
|
const s = (l = a.fornecedores) == null ? void 0 : l[0];
|
|
@@ -341,7 +345,7 @@ function Ze({
|
|
|
341
345
|
if (!r || !r.embalagens || r.embalagens.length === 0) return;
|
|
342
346
|
const i = r.embalagens[0];
|
|
343
347
|
_(i.label);
|
|
344
|
-
},
|
|
348
|
+
}, Le = (e) => {
|
|
345
349
|
var l, c, u;
|
|
346
350
|
Q(e);
|
|
347
351
|
const s = (l = a.fornecedores) == null ? void 0 : l.find(
|
|
@@ -356,13 +360,13 @@ function Ze({
|
|
|
356
360
|
E(r.nome);
|
|
357
361
|
const i = (u = r.embalagens) == null ? void 0 : u[0];
|
|
358
362
|
i ? _(i.label) : B("");
|
|
359
|
-
},
|
|
360
|
-
e.preventDefault(),
|
|
361
|
-
},
|
|
362
|
-
const e =
|
|
363
|
-
if (e <= 0 ||
|
|
364
|
-
const s = Math.ceil(
|
|
365
|
-
|
|
363
|
+
}, Re = (e) => {
|
|
364
|
+
e.preventDefault(), g(a);
|
|
365
|
+
}, ze = () => {
|
|
366
|
+
const e = b();
|
|
367
|
+
if (e <= 0 || y <= 0) return;
|
|
368
|
+
const s = Math.ceil(y / e);
|
|
369
|
+
I(s);
|
|
366
370
|
}, o = {
|
|
367
371
|
container: {
|
|
368
372
|
display: "flex",
|
|
@@ -572,7 +576,7 @@ function Ze({
|
|
|
572
576
|
backgroundColor: "#DC2626"
|
|
573
577
|
}
|
|
574
578
|
};
|
|
575
|
-
return /* @__PURE__ */ t.jsxs("form", { onSubmit:
|
|
579
|
+
return /* @__PURE__ */ t.jsxs("form", { onSubmit: Re, style: o.container, children: [
|
|
576
580
|
/* @__PURE__ */ t.jsxs("div", { style: o.header, children: [
|
|
577
581
|
/* @__PURE__ */ t.jsx("h2", { style: o.itemTitle, children: a.nome }),
|
|
578
582
|
/* @__PURE__ */ t.jsx("div", { style: o.valorUnitario, children: /* @__PURE__ */ t.jsx(
|
|
@@ -586,7 +590,7 @@ function Ze({
|
|
|
586
590
|
backgroundColor: "#FF4E00",
|
|
587
591
|
fontWeight: "600"
|
|
588
592
|
},
|
|
589
|
-
children:
|
|
593
|
+
children: X(N())
|
|
590
594
|
}
|
|
591
595
|
) })
|
|
592
596
|
] }),
|
|
@@ -602,14 +606,14 @@ function Ze({
|
|
|
602
606
|
children: [
|
|
603
607
|
/* @__PURE__ */ t.jsxs("div", { style: o.infoRow, children: [
|
|
604
608
|
/* @__PURE__ */ t.jsxs("div", { style: o.infoText, children: [
|
|
605
|
-
/* @__PURE__ */ t.jsx(
|
|
609
|
+
/* @__PURE__ */ t.jsx(Ue, { width: 20, height: 20 }),
|
|
606
610
|
"Última compra ",
|
|
607
611
|
(ge = a.ultima_compra) == null ? void 0 : ge.data
|
|
608
612
|
] }),
|
|
609
613
|
/* @__PURE__ */ t.jsxs("div", { style: o.infoValue, children: [
|
|
610
614
|
Number(((pe = a.ultima_compra) == null ? void 0 : pe.quantidade) ?? 0).toFixed(2),
|
|
611
615
|
" ",
|
|
612
|
-
|
|
616
|
+
Be.toUpperCase()
|
|
613
617
|
] })
|
|
614
618
|
] }),
|
|
615
619
|
/* @__PURE__ */ t.jsxs("div", { style: o.formGrid, children: [
|
|
@@ -618,8 +622,8 @@ function Ze({
|
|
|
618
622
|
/* @__PURE__ */ t.jsx(
|
|
619
623
|
W,
|
|
620
624
|
{
|
|
621
|
-
value:
|
|
622
|
-
onChange: (e) =>
|
|
625
|
+
value: Me,
|
|
626
|
+
onChange: (e) => Le(e.target.value),
|
|
623
627
|
children: (me = a.fornecedores) == null ? void 0 : me.map((e) => /* @__PURE__ */ t.jsx("option", { value: e.nome, children: e.nome }, e.nome))
|
|
624
628
|
}
|
|
625
629
|
)
|
|
@@ -630,8 +634,8 @@ function Ze({
|
|
|
630
634
|
W,
|
|
631
635
|
{
|
|
632
636
|
value: w,
|
|
633
|
-
onChange: (e) =>
|
|
634
|
-
children:
|
|
637
|
+
onChange: (e) => We(e.target.value),
|
|
638
|
+
children: De().map((e) => /* @__PURE__ */ t.jsx("option", { value: e.nome, children: e.nome }, e.nome))
|
|
635
639
|
}
|
|
636
640
|
)
|
|
637
641
|
] }),
|
|
@@ -642,21 +646,22 @@ function Ze({
|
|
|
642
646
|
{
|
|
643
647
|
value: T,
|
|
644
648
|
onChange: (e) => _(e.target.value),
|
|
645
|
-
children:
|
|
649
|
+
children: Pe().map((e) => /* @__PURE__ */ t.jsx("option", { value: e.label, children: e.label }, e.label))
|
|
646
650
|
}
|
|
647
651
|
)
|
|
648
652
|
] })
|
|
649
653
|
] }),
|
|
650
|
-
|
|
651
|
-
|
|
654
|
+
Z && /* @__PURE__ */ t.jsx("div", { style: { marginTop: "8px", marginBottom: "8px" }, children: /* @__PURE__ */ t.jsx(
|
|
655
|
+
Ne,
|
|
652
656
|
{
|
|
653
|
-
data:
|
|
657
|
+
data: Z,
|
|
654
658
|
controls: !0,
|
|
655
|
-
|
|
659
|
+
controlsZoomOnly: we,
|
|
660
|
+
showLegend: Ce,
|
|
656
661
|
size: "sm",
|
|
657
|
-
showSuggestionBar:
|
|
658
|
-
unitLabel:
|
|
659
|
-
onAddSuggestedWeight: (e) =>
|
|
662
|
+
showSuggestionBar: qe,
|
|
663
|
+
unitLabel: L,
|
|
664
|
+
onAddSuggestedWeight: (e) => I(e),
|
|
660
665
|
selectedQty: M,
|
|
661
666
|
selectedQtyDays: F
|
|
662
667
|
}
|
|
@@ -675,10 +680,10 @@ function Ze({
|
|
|
675
680
|
/* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
|
|
676
681
|
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Data inicial" }),
|
|
677
682
|
/* @__PURE__ */ t.jsx(
|
|
678
|
-
|
|
683
|
+
Oe,
|
|
679
684
|
{
|
|
680
|
-
value:
|
|
681
|
-
min:
|
|
685
|
+
value: R,
|
|
686
|
+
min: Ye(),
|
|
682
687
|
onChange: (e) => G(e.target.value),
|
|
683
688
|
"aria-label": "Data inicial"
|
|
684
689
|
}
|
|
@@ -730,7 +735,7 @@ function Ze({
|
|
|
730
735
|
letterSpacing: "-0.3px"
|
|
731
736
|
},
|
|
732
737
|
children: [
|
|
733
|
-
|
|
738
|
+
y.toFixed(2),
|
|
734
739
|
" ",
|
|
735
740
|
/* @__PURE__ */ t.jsx(
|
|
736
741
|
"span",
|
|
@@ -740,7 +745,7 @@ function Ze({
|
|
|
740
745
|
fontWeight: "500",
|
|
741
746
|
color: "#64748b"
|
|
742
747
|
},
|
|
743
|
-
children:
|
|
748
|
+
children: L
|
|
744
749
|
}
|
|
745
750
|
)
|
|
746
751
|
]
|
|
@@ -750,8 +755,8 @@ function Ze({
|
|
|
750
755
|
"button",
|
|
751
756
|
{
|
|
752
757
|
type: "button",
|
|
753
|
-
onClick:
|
|
754
|
-
disabled:
|
|
758
|
+
onClick: ze,
|
|
759
|
+
disabled: y <= 0 || b() <= 0,
|
|
755
760
|
style: {
|
|
756
761
|
display: "flex",
|
|
757
762
|
alignItems: "center",
|
|
@@ -761,19 +766,19 @@ function Ze({
|
|
|
761
766
|
minWidth: "30px",
|
|
762
767
|
borderRadius: "8px",
|
|
763
768
|
border: "none",
|
|
764
|
-
backgroundColor:
|
|
765
|
-
color:
|
|
769
|
+
backgroundColor: y > 0 && b() > 0 ? "#FF4E00" : "#e5e7eb",
|
|
770
|
+
color: y > 0 && b() > 0 ? "white" : "#9ca3af",
|
|
766
771
|
fontSize: "16px",
|
|
767
|
-
cursor:
|
|
768
|
-
opacity:
|
|
772
|
+
cursor: y > 0 && b() > 0 ? "pointer" : "not-allowed",
|
|
773
|
+
opacity: y <= 0 || b() <= 0 ? 0.5 : 1,
|
|
769
774
|
transition: "all 0.2s",
|
|
770
775
|
fontFamily: "Inter, sans-serif"
|
|
771
776
|
},
|
|
772
777
|
onMouseEnter: (e) => {
|
|
773
|
-
|
|
778
|
+
y > 0 && b() > 0 && (e.currentTarget.style.backgroundColor = "#e04400");
|
|
774
779
|
},
|
|
775
780
|
onMouseLeave: (e) => {
|
|
776
|
-
|
|
781
|
+
y > 0 && b() > 0 && (e.currentTarget.style.backgroundColor = "#FF4E00");
|
|
777
782
|
},
|
|
778
783
|
"aria-label": "Definir quantidade pelo consumo previsto",
|
|
779
784
|
children: "↻"
|
|
@@ -798,7 +803,7 @@ function Ze({
|
|
|
798
803
|
...o.quantityButton,
|
|
799
804
|
...a.qtdPedido <= 0 ? o.quantityButtonDisabled : {}
|
|
800
805
|
},
|
|
801
|
-
onClick: () =>
|
|
806
|
+
onClick: () => I(Math.max(0, a.qtdPedido - 1)),
|
|
802
807
|
onMouseEnter: (e) => {
|
|
803
808
|
a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform);
|
|
804
809
|
},
|
|
@@ -839,7 +844,7 @@ function Ze({
|
|
|
839
844
|
{
|
|
840
845
|
type: "number",
|
|
841
846
|
value: a.qtdPedido,
|
|
842
|
-
onChange: (e) =>
|
|
847
|
+
onChange: (e) => I(
|
|
843
848
|
Math.max(0, parseInt(e.target.value) || 0)
|
|
844
849
|
),
|
|
845
850
|
style: o.quantityInput,
|
|
@@ -855,7 +860,7 @@ function Ze({
|
|
|
855
860
|
{
|
|
856
861
|
type: "button",
|
|
857
862
|
style: o.quantityButton,
|
|
858
|
-
onClick: () =>
|
|
863
|
+
onClick: () => I(a.qtdPedido + 1),
|
|
859
864
|
onMouseEnter: (e) => {
|
|
860
865
|
e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform;
|
|
861
866
|
},
|
|
@@ -912,9 +917,9 @@ function Ze({
|
|
|
912
917
|
children: [
|
|
913
918
|
/* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Total:" }),
|
|
914
919
|
/* @__PURE__ */ t.jsxs("span", { style: o.totalValue, children: [
|
|
915
|
-
(a.qtdPedido *
|
|
920
|
+
(a.qtdPedido * b()).toFixed(2),
|
|
916
921
|
" ",
|
|
917
|
-
|
|
922
|
+
L
|
|
918
923
|
] })
|
|
919
924
|
]
|
|
920
925
|
}
|
|
@@ -928,7 +933,7 @@ function Ze({
|
|
|
928
933
|
},
|
|
929
934
|
children: [
|
|
930
935
|
/* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Valor:" }),
|
|
931
|
-
/* @__PURE__ */ t.jsx("span", { style: o.totalValueHighlight, children:
|
|
936
|
+
/* @__PURE__ */ t.jsx("span", { style: o.totalValueHighlight, children: X(a.qtdPedido * N()) })
|
|
932
937
|
]
|
|
933
938
|
}
|
|
934
939
|
),
|
|
@@ -995,6 +1000,6 @@ function Ze({
|
|
|
995
1000
|
] });
|
|
996
1001
|
}
|
|
997
1002
|
export {
|
|
998
|
-
|
|
1003
|
+
nt as OrderForm
|
|
999
1004
|
};
|
|
1000
1005
|
//# sourceMappingURL=index10.js.map
|