eatopia-ds 0.0.952 → 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 +120 -117
- package/build/index10.js.map +1 -1
- package/build/index18.js +678 -600
- package/build/index18.js.map +1 -1
- package/build/index31.js +2 -2
- package/build/index32.js +1 -1
- package/build/index34.js +2 -2
- package/build/index35.js +1 -1
- package/build/index46.js.map +1 -1
- package/build/index47.js +52 -66
- package/build/index47.js.map +1 -1
- package/build/index48.js +22 -26
- package/build/index48.js.map +1 -1
- package/build/index49.js.map +1 -1
- package/build/index50.js +66 -52
- package/build/index50.js.map +1 -1
- package/build/index51.js +26 -22
- package/build/index51.js.map +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,30 +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:
|
|
110
|
+
showSuggestionBar: qe = !0,
|
|
111
|
+
showLegendTimeline: Ce = !1,
|
|
109
112
|
initialQtdDays: j,
|
|
110
|
-
stockLeadTimeZoomOnly:
|
|
113
|
+
stockLeadTimeZoomOnly: we = !1
|
|
111
114
|
}) {
|
|
112
115
|
var ee, te, ne, oe, re, se, ie, ae, le, ce, de, ue, fe, ge, pe, me;
|
|
113
|
-
|
|
116
|
+
He.useEffect(() => {
|
|
114
117
|
const e = document.createElement("style");
|
|
115
118
|
return e.textContent = `
|
|
116
119
|
.order-form-quantity-input::-webkit-outer-spin-button,
|
|
@@ -125,30 +128,30 @@ function et({
|
|
|
125
128
|
document.head.removeChild(e);
|
|
126
129
|
};
|
|
127
130
|
}, []);
|
|
128
|
-
const [C,
|
|
131
|
+
const [C, Fe] = k(!1);
|
|
129
132
|
Y(() => {
|
|
130
133
|
const e = () => {
|
|
131
|
-
|
|
134
|
+
Fe(window.innerWidth <= 768);
|
|
132
135
|
};
|
|
133
136
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
134
137
|
}, []);
|
|
135
|
-
const
|
|
138
|
+
const O = () => {
|
|
136
139
|
if (!(d != null && d.timeline)) return 0;
|
|
137
140
|
const { restockSuggestionStart: e, restockSuggestionEnd: s } = d.timeline;
|
|
138
141
|
if (!e || !s) return 0;
|
|
139
142
|
const r = new Date(e), l = new Date(s).getTime() - r.getTime(), c = Math.ceil(l / (1e3 * 60 * 60 * 24));
|
|
140
143
|
return c > 0 ? c : 0;
|
|
141
|
-
},
|
|
144
|
+
}, Te = () => {
|
|
142
145
|
var i;
|
|
143
|
-
const e =
|
|
146
|
+
const e = A(), s = (i = d == null ? void 0 : d.timeline) == null ? void 0 : i.stockEndDate;
|
|
144
147
|
if (!s) return v(e);
|
|
145
|
-
const r =
|
|
148
|
+
const r = S(s);
|
|
146
149
|
return isNaN(r.getTime()) || r < e ? v(e) : v(r);
|
|
147
|
-
},
|
|
150
|
+
}, Ie = () => ve(O()), Se = () => j != null && j > 0 ? P(j) : P(Ie()), p = (() => {
|
|
148
151
|
var i, l, c;
|
|
149
152
|
const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
|
|
150
153
|
if (!e) return null;
|
|
151
|
-
const s =
|
|
154
|
+
const s = O();
|
|
152
155
|
if (!x || s <= 0) {
|
|
153
156
|
const u = (l = e.marcas) == null ? void 0 : l[0], f = (c = u == null ? void 0 : u.embalagens) == null ? void 0 : c[0];
|
|
154
157
|
return u && f ? {
|
|
@@ -161,23 +164,23 @@ function et({
|
|
|
161
164
|
let r = null;
|
|
162
165
|
for (const u of e.marcas || [])
|
|
163
166
|
for (const f of u.embalagens || []) {
|
|
164
|
-
const
|
|
165
|
-
if (!(
|
|
167
|
+
const m = f.quantidade_fornecedor;
|
|
168
|
+
if (!(m <= 0))
|
|
166
169
|
for (let h = 1; h <= 100; h++) {
|
|
167
|
-
const xe = h *
|
|
170
|
+
const xe = h * m, U = be({
|
|
168
171
|
dailyAverages: x,
|
|
169
172
|
startDate: /* @__PURE__ */ new Date(),
|
|
170
173
|
totalQuantity: xe
|
|
171
174
|
});
|
|
172
175
|
if (U.totalDays >= s) {
|
|
173
|
-
const
|
|
174
|
-
(!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 = {
|
|
175
178
|
marca: u.nome,
|
|
176
179
|
embalagem: f.label,
|
|
177
180
|
quantidade: h,
|
|
178
181
|
valorUnitario: f.valor_unitario,
|
|
179
182
|
totalKg: xe,
|
|
180
|
-
totalValue:
|
|
183
|
+
totalValue: ye,
|
|
181
184
|
days: U.totalDays,
|
|
182
185
|
daysDifference: V
|
|
183
186
|
});
|
|
@@ -190,48 +193,48 @@ function et({
|
|
|
190
193
|
quantidade: r.quantidade,
|
|
191
194
|
valorUnitario: r.valorUnitario
|
|
192
195
|
} : null;
|
|
193
|
-
})(),
|
|
196
|
+
})(), Ee = () => {
|
|
194
197
|
var i, l, c;
|
|
195
|
-
if (
|
|
196
|
-
return
|
|
198
|
+
if (p)
|
|
199
|
+
return p.valorUnitario;
|
|
197
200
|
const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
|
|
198
201
|
if (!e) return 0;
|
|
199
202
|
const s = (l = e.marcas) == null ? void 0 : l[0];
|
|
200
203
|
if (!s) return 0;
|
|
201
204
|
const r = (c = s.embalagens) == null ? void 0 : c[0];
|
|
202
205
|
return (r == null ? void 0 : r.valor_unitario) ?? 0;
|
|
203
|
-
},
|
|
206
|
+
}, L = n.unidade_medida ?? "kg", Be = ((ee = n.ultima_compra) == null ? void 0 : ee.unidade) ?? n.unidade_medida ?? "kg", [a, $] = k({
|
|
204
207
|
...n,
|
|
205
|
-
qtdPedido: (
|
|
206
|
-
valorTotal: (n == null ? void 0 : n.valorTotal) ?? ((
|
|
207
|
-
}), [
|
|
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(
|
|
208
211
|
((ne = (te = n == null ? void 0 : n.fornecedores) == null ? void 0 : te[0]) == null ? void 0 : ne.nome) ?? ""
|
|
209
212
|
), [w, E] = k(
|
|
210
|
-
(
|
|
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) ?? ""
|
|
211
214
|
), [T, B] = k(
|
|
212
|
-
(
|
|
213
|
-
), [
|
|
214
|
-
|
|
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
|
|
215
218
|
), [z, K] = k(Se);
|
|
216
219
|
Y(() => {
|
|
217
220
|
var c, u, f;
|
|
218
|
-
const e =
|
|
221
|
+
const e = A(), s = (c = d == null ? void 0 : d.timeline) == null ? void 0 : c.stockEndDate;
|
|
219
222
|
let r;
|
|
220
223
|
if (s) {
|
|
221
|
-
const
|
|
222
|
-
r = isNaN(
|
|
224
|
+
const m = S(s);
|
|
225
|
+
r = isNaN(m.getTime()) || m < e ? v(e) : v(m);
|
|
223
226
|
} else
|
|
224
227
|
r = v(e);
|
|
225
228
|
let i = 0;
|
|
226
229
|
if ((u = d == null ? void 0 : d.timeline) != null && u.restockSuggestionStart && ((f = d == null ? void 0 : d.timeline) != null && f.restockSuggestionEnd)) {
|
|
227
|
-
const
|
|
228
|
-
!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);
|
|
229
232
|
}
|
|
230
233
|
const l = j != null && j > 0 ? P(j) : P(i);
|
|
231
234
|
G(r), K(l);
|
|
232
235
|
}, [d, n, j]), Y(() => {
|
|
233
236
|
var s, r, i;
|
|
234
|
-
if (
|
|
237
|
+
if (p) return;
|
|
235
238
|
const e = (s = n == null ? void 0 : n.fornecedores) == null ? void 0 : s[0];
|
|
236
239
|
if (e) {
|
|
237
240
|
Q(e.nome);
|
|
@@ -242,7 +245,7 @@ function et({
|
|
|
242
245
|
c && B(c.label);
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
|
-
}, [n,
|
|
248
|
+
}, [n, p]);
|
|
246
249
|
const M = D(() => {
|
|
247
250
|
var l, c, u;
|
|
248
251
|
const e = (l = a.fornecedores) == null ? void 0 : l[0];
|
|
@@ -258,21 +261,21 @@ function et({
|
|
|
258
261
|
a.fornecedores,
|
|
259
262
|
w,
|
|
260
263
|
T
|
|
261
|
-
]), H = D(() => !x || M <= 0 ? null :
|
|
264
|
+
]), H = D(() => !x || M <= 0 ? null : be({
|
|
262
265
|
dailyAverages: x,
|
|
263
266
|
startDate: /* @__PURE__ */ new Date(),
|
|
264
267
|
totalQuantity: M
|
|
265
|
-
}), [x, M]), F = (H == null ? void 0 : H.totalDays) ?? 0,
|
|
268
|
+
}), [x, M]), F = (H == null ? void 0 : H.totalDays) ?? 0, y = D(() => {
|
|
266
269
|
if (!x) return 0;
|
|
267
|
-
const e =
|
|
270
|
+
const e = A(), s = S(R);
|
|
268
271
|
if (isNaN(s.getTime())) return 0;
|
|
269
272
|
const r = s < e ? e : s;
|
|
270
|
-
return
|
|
273
|
+
return _e(
|
|
271
274
|
x,
|
|
272
275
|
r,
|
|
273
276
|
z
|
|
274
277
|
);
|
|
275
|
-
}, [x,
|
|
278
|
+
}, [x, R, z]), Z = D(() => {
|
|
276
279
|
if (d)
|
|
277
280
|
return {
|
|
278
281
|
...d,
|
|
@@ -299,10 +302,10 @@ function et({
|
|
|
299
302
|
/\B(?=(\d{3})+(?!\d))/g,
|
|
300
303
|
"."
|
|
301
304
|
)},${i}`;
|
|
302
|
-
},
|
|
305
|
+
}, b = () => {
|
|
303
306
|
var e;
|
|
304
307
|
return ((e = J()) == null ? void 0 : e.quantidade_fornecedor) ?? 0;
|
|
305
|
-
},
|
|
308
|
+
}, I = (e) => {
|
|
306
309
|
const s = N(), r = e * s;
|
|
307
310
|
$((i) => ({
|
|
308
311
|
...i,
|
|
@@ -314,26 +317,26 @@ function et({
|
|
|
314
317
|
B(e);
|
|
315
318
|
const s = (c = a.fornecedores) == null ? void 0 : c[0];
|
|
316
319
|
if (!s) return;
|
|
317
|
-
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);
|
|
318
321
|
if (!r) return;
|
|
319
|
-
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);
|
|
320
323
|
if (!i) return;
|
|
321
324
|
const l = a.qtdPedido * (i.valor_unitario ?? 0);
|
|
322
|
-
$((
|
|
323
|
-
...
|
|
325
|
+
$((m) => ({
|
|
326
|
+
...m,
|
|
324
327
|
valorTotal: l
|
|
325
328
|
}));
|
|
326
|
-
},
|
|
329
|
+
}, De = () => {
|
|
327
330
|
var s;
|
|
328
331
|
const e = (s = a.fornecedores) == null ? void 0 : s[0];
|
|
329
332
|
return e ? e.marcas || [] : [];
|
|
330
|
-
},
|
|
333
|
+
}, Pe = () => {
|
|
331
334
|
var r, i;
|
|
332
335
|
const e = (r = a.fornecedores) == null ? void 0 : r[0];
|
|
333
336
|
if (!e) return [];
|
|
334
337
|
const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome === w);
|
|
335
338
|
return s ? s.embalagens || [] : [];
|
|
336
|
-
},
|
|
339
|
+
}, We = (e) => {
|
|
337
340
|
var l, c;
|
|
338
341
|
E(e);
|
|
339
342
|
const s = (l = a.fornecedores) == null ? void 0 : l[0];
|
|
@@ -342,7 +345,7 @@ function et({
|
|
|
342
345
|
if (!r || !r.embalagens || r.embalagens.length === 0) return;
|
|
343
346
|
const i = r.embalagens[0];
|
|
344
347
|
_(i.label);
|
|
345
|
-
},
|
|
348
|
+
}, Le = (e) => {
|
|
346
349
|
var l, c, u;
|
|
347
350
|
Q(e);
|
|
348
351
|
const s = (l = a.fornecedores) == null ? void 0 : l.find(
|
|
@@ -358,12 +361,12 @@ function et({
|
|
|
358
361
|
const i = (u = r.embalagens) == null ? void 0 : u[0];
|
|
359
362
|
i ? _(i.label) : B("");
|
|
360
363
|
}, Re = (e) => {
|
|
361
|
-
e.preventDefault(),
|
|
362
|
-
},
|
|
363
|
-
const e =
|
|
364
|
-
if (e <= 0 ||
|
|
365
|
-
const s = Math.ceil(
|
|
366
|
-
|
|
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);
|
|
367
370
|
}, o = {
|
|
368
371
|
container: {
|
|
369
372
|
display: "flex",
|
|
@@ -603,14 +606,14 @@ function et({
|
|
|
603
606
|
children: [
|
|
604
607
|
/* @__PURE__ */ t.jsxs("div", { style: o.infoRow, children: [
|
|
605
608
|
/* @__PURE__ */ t.jsxs("div", { style: o.infoText, children: [
|
|
606
|
-
/* @__PURE__ */ t.jsx(
|
|
609
|
+
/* @__PURE__ */ t.jsx(Ue, { width: 20, height: 20 }),
|
|
607
610
|
"Última compra ",
|
|
608
611
|
(ge = a.ultima_compra) == null ? void 0 : ge.data
|
|
609
612
|
] }),
|
|
610
613
|
/* @__PURE__ */ t.jsxs("div", { style: o.infoValue, children: [
|
|
611
614
|
Number(((pe = a.ultima_compra) == null ? void 0 : pe.quantidade) ?? 0).toFixed(2),
|
|
612
615
|
" ",
|
|
613
|
-
|
|
616
|
+
Be.toUpperCase()
|
|
614
617
|
] })
|
|
615
618
|
] }),
|
|
616
619
|
/* @__PURE__ */ t.jsxs("div", { style: o.formGrid, children: [
|
|
@@ -619,8 +622,8 @@ function et({
|
|
|
619
622
|
/* @__PURE__ */ t.jsx(
|
|
620
623
|
W,
|
|
621
624
|
{
|
|
622
|
-
value:
|
|
623
|
-
onChange: (e) =>
|
|
625
|
+
value: Me,
|
|
626
|
+
onChange: (e) => Le(e.target.value),
|
|
624
627
|
children: (me = a.fornecedores) == null ? void 0 : me.map((e) => /* @__PURE__ */ t.jsx("option", { value: e.nome, children: e.nome }, e.nome))
|
|
625
628
|
}
|
|
626
629
|
)
|
|
@@ -631,8 +634,8 @@ function et({
|
|
|
631
634
|
W,
|
|
632
635
|
{
|
|
633
636
|
value: w,
|
|
634
|
-
onChange: (e) =>
|
|
635
|
-
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))
|
|
636
639
|
}
|
|
637
640
|
)
|
|
638
641
|
] }),
|
|
@@ -643,22 +646,22 @@ function et({
|
|
|
643
646
|
{
|
|
644
647
|
value: T,
|
|
645
648
|
onChange: (e) => _(e.target.value),
|
|
646
|
-
children:
|
|
649
|
+
children: Pe().map((e) => /* @__PURE__ */ t.jsx("option", { value: e.label, children: e.label }, e.label))
|
|
647
650
|
}
|
|
648
651
|
)
|
|
649
652
|
] })
|
|
650
653
|
] }),
|
|
651
654
|
Z && /* @__PURE__ */ t.jsx("div", { style: { marginTop: "8px", marginBottom: "8px" }, children: /* @__PURE__ */ t.jsx(
|
|
652
|
-
|
|
655
|
+
Ne,
|
|
653
656
|
{
|
|
654
657
|
data: Z,
|
|
655
658
|
controls: !0,
|
|
656
|
-
controlsZoomOnly:
|
|
657
|
-
showLegend:
|
|
659
|
+
controlsZoomOnly: we,
|
|
660
|
+
showLegend: Ce,
|
|
658
661
|
size: "sm",
|
|
659
|
-
showSuggestionBar:
|
|
660
|
-
unitLabel:
|
|
661
|
-
onAddSuggestedWeight: (e) =>
|
|
662
|
+
showSuggestionBar: qe,
|
|
663
|
+
unitLabel: L,
|
|
664
|
+
onAddSuggestedWeight: (e) => I(e),
|
|
662
665
|
selectedQty: M,
|
|
663
666
|
selectedQtyDays: F
|
|
664
667
|
}
|
|
@@ -677,10 +680,10 @@ function et({
|
|
|
677
680
|
/* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
|
|
678
681
|
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Data inicial" }),
|
|
679
682
|
/* @__PURE__ */ t.jsx(
|
|
680
|
-
|
|
683
|
+
Oe,
|
|
681
684
|
{
|
|
682
|
-
value:
|
|
683
|
-
min:
|
|
685
|
+
value: R,
|
|
686
|
+
min: Ye(),
|
|
684
687
|
onChange: (e) => G(e.target.value),
|
|
685
688
|
"aria-label": "Data inicial"
|
|
686
689
|
}
|
|
@@ -732,7 +735,7 @@ function et({
|
|
|
732
735
|
letterSpacing: "-0.3px"
|
|
733
736
|
},
|
|
734
737
|
children: [
|
|
735
|
-
|
|
738
|
+
y.toFixed(2),
|
|
736
739
|
" ",
|
|
737
740
|
/* @__PURE__ */ t.jsx(
|
|
738
741
|
"span",
|
|
@@ -742,7 +745,7 @@ function et({
|
|
|
742
745
|
fontWeight: "500",
|
|
743
746
|
color: "#64748b"
|
|
744
747
|
},
|
|
745
|
-
children:
|
|
748
|
+
children: L
|
|
746
749
|
}
|
|
747
750
|
)
|
|
748
751
|
]
|
|
@@ -752,8 +755,8 @@ function et({
|
|
|
752
755
|
"button",
|
|
753
756
|
{
|
|
754
757
|
type: "button",
|
|
755
|
-
onClick:
|
|
756
|
-
disabled:
|
|
758
|
+
onClick: ze,
|
|
759
|
+
disabled: y <= 0 || b() <= 0,
|
|
757
760
|
style: {
|
|
758
761
|
display: "flex",
|
|
759
762
|
alignItems: "center",
|
|
@@ -763,19 +766,19 @@ function et({
|
|
|
763
766
|
minWidth: "30px",
|
|
764
767
|
borderRadius: "8px",
|
|
765
768
|
border: "none",
|
|
766
|
-
backgroundColor:
|
|
767
|
-
color:
|
|
769
|
+
backgroundColor: y > 0 && b() > 0 ? "#FF4E00" : "#e5e7eb",
|
|
770
|
+
color: y > 0 && b() > 0 ? "white" : "#9ca3af",
|
|
768
771
|
fontSize: "16px",
|
|
769
|
-
cursor:
|
|
770
|
-
opacity:
|
|
772
|
+
cursor: y > 0 && b() > 0 ? "pointer" : "not-allowed",
|
|
773
|
+
opacity: y <= 0 || b() <= 0 ? 0.5 : 1,
|
|
771
774
|
transition: "all 0.2s",
|
|
772
775
|
fontFamily: "Inter, sans-serif"
|
|
773
776
|
},
|
|
774
777
|
onMouseEnter: (e) => {
|
|
775
|
-
|
|
778
|
+
y > 0 && b() > 0 && (e.currentTarget.style.backgroundColor = "#e04400");
|
|
776
779
|
},
|
|
777
780
|
onMouseLeave: (e) => {
|
|
778
|
-
|
|
781
|
+
y > 0 && b() > 0 && (e.currentTarget.style.backgroundColor = "#FF4E00");
|
|
779
782
|
},
|
|
780
783
|
"aria-label": "Definir quantidade pelo consumo previsto",
|
|
781
784
|
children: "↻"
|
|
@@ -800,7 +803,7 @@ function et({
|
|
|
800
803
|
...o.quantityButton,
|
|
801
804
|
...a.qtdPedido <= 0 ? o.quantityButtonDisabled : {}
|
|
802
805
|
},
|
|
803
|
-
onClick: () =>
|
|
806
|
+
onClick: () => I(Math.max(0, a.qtdPedido - 1)),
|
|
804
807
|
onMouseEnter: (e) => {
|
|
805
808
|
a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform);
|
|
806
809
|
},
|
|
@@ -841,7 +844,7 @@ function et({
|
|
|
841
844
|
{
|
|
842
845
|
type: "number",
|
|
843
846
|
value: a.qtdPedido,
|
|
844
|
-
onChange: (e) =>
|
|
847
|
+
onChange: (e) => I(
|
|
845
848
|
Math.max(0, parseInt(e.target.value) || 0)
|
|
846
849
|
),
|
|
847
850
|
style: o.quantityInput,
|
|
@@ -857,7 +860,7 @@ function et({
|
|
|
857
860
|
{
|
|
858
861
|
type: "button",
|
|
859
862
|
style: o.quantityButton,
|
|
860
|
-
onClick: () =>
|
|
863
|
+
onClick: () => I(a.qtdPedido + 1),
|
|
861
864
|
onMouseEnter: (e) => {
|
|
862
865
|
e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform;
|
|
863
866
|
},
|
|
@@ -914,9 +917,9 @@ function et({
|
|
|
914
917
|
children: [
|
|
915
918
|
/* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Total:" }),
|
|
916
919
|
/* @__PURE__ */ t.jsxs("span", { style: o.totalValue, children: [
|
|
917
|
-
(a.qtdPedido *
|
|
920
|
+
(a.qtdPedido * b()).toFixed(2),
|
|
918
921
|
" ",
|
|
919
|
-
|
|
922
|
+
L
|
|
920
923
|
] })
|
|
921
924
|
]
|
|
922
925
|
}
|
|
@@ -997,6 +1000,6 @@ function et({
|
|
|
997
1000
|
] });
|
|
998
1001
|
}
|
|
999
1002
|
export {
|
|
1000
|
-
|
|
1003
|
+
nt as OrderForm
|
|
1001
1004
|
};
|
|
1002
1005
|
//# sourceMappingURL=index10.js.map
|