eatopia-ds 0.0.950 → 0.0.952
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 +326 -284
- package/build/index10.js.map +1 -1
- package/build/index11.js +34 -31
- package/build/index11.js.map +1 -1
- package/build/index18.js +490 -485
- package/build/index18.js.map +1 -1
- package/package.json +1 -1
package/build/index10.js
CHANGED
|
@@ -1,37 +1,116 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { StockLeadTime as
|
|
4
|
-
import { calculateConsumptionForecast as
|
|
5
|
-
import { AlertIcon as
|
|
6
|
-
const
|
|
7
|
-
const m =
|
|
8
|
-
return `${m}-${
|
|
9
|
-
},
|
|
10
|
-
const m =
|
|
1
|
+
import { j as t } from "./index24.js";
|
|
2
|
+
import ze, { useState as k, useEffect as Y, useMemo as D } from "react";
|
|
3
|
+
import { StockLeadTime as He } from "./index18.js";
|
|
4
|
+
import { calculateConsumptionForecast as ye, calculateTotalConsumptionForRange as Ne } from "./index21.js";
|
|
5
|
+
import { AlertIcon as _e } from "./index23.js";
|
|
6
|
+
const he = [1, 2, 3, 7, 10, 15, 30, 60, 90], v = (n) => {
|
|
7
|
+
const m = n.getFullYear(), q = String(n.getMonth() + 1).padStart(2, "0"), d = String(n.getDate()).padStart(2, "0");
|
|
8
|
+
return `${m}-${q}-${d}`;
|
|
9
|
+
}, I = (n) => {
|
|
10
|
+
const m = n.split("-").map(Number);
|
|
11
11
|
return m.length !== 3 || m.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(m[0], m[1] - 1, m[2]);
|
|
12
|
-
},
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
},
|
|
19
|
-
(m,
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
}, Ue = () => {
|
|
13
|
+
const n = /* @__PURE__ */ new Date();
|
|
14
|
+
return n.setDate(n.getDate() + 1), n.setHours(0, 0, 0, 0), v(n);
|
|
15
|
+
}, O = () => {
|
|
16
|
+
const n = /* @__PURE__ */ new Date();
|
|
17
|
+
return n.setDate(n.getDate() + 1), n.setHours(0, 0, 0, 0), n;
|
|
18
|
+
}, P = (n) => n <= 0 ? 7 : he.reduce(
|
|
19
|
+
(m, q) => Math.abs(q - n) < Math.abs(m - n) ? q : m
|
|
20
|
+
), Ve = 42, ve = {
|
|
21
|
+
position: "relative",
|
|
22
|
+
height: `${Ve}px`,
|
|
23
|
+
border: "1.5px solid #e2e8f0",
|
|
24
|
+
borderRadius: "10px",
|
|
25
|
+
backgroundColor: "#f8fafc",
|
|
26
|
+
display: "flex",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
boxSizing: "border-box"
|
|
29
|
+
}, je = {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
inset: 0,
|
|
32
|
+
width: "100%",
|
|
33
|
+
height: "100%",
|
|
34
|
+
border: "none",
|
|
35
|
+
background: "transparent",
|
|
36
|
+
outline: "none",
|
|
37
|
+
fontSize: "14px",
|
|
38
|
+
fontWeight: "500",
|
|
39
|
+
color: "#0f172a",
|
|
40
|
+
fontFamily: "Inter, sans-serif",
|
|
41
|
+
cursor: "pointer",
|
|
42
|
+
boxSizing: "border-box"
|
|
43
|
+
}, W = ({
|
|
44
|
+
children: n,
|
|
45
|
+
...m
|
|
46
|
+
}) => /* @__PURE__ */ t.jsxs("div", { style: ve, children: [
|
|
47
|
+
/* @__PURE__ */ t.jsx(
|
|
48
|
+
"select",
|
|
49
|
+
{
|
|
50
|
+
...m,
|
|
51
|
+
style: {
|
|
52
|
+
...je,
|
|
53
|
+
padding: "0 36px 0 14px",
|
|
54
|
+
appearance: "none",
|
|
55
|
+
WebkitAppearance: "none"
|
|
56
|
+
},
|
|
57
|
+
children: n
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ t.jsx(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
"aria-hidden": !0,
|
|
64
|
+
style: {
|
|
65
|
+
position: "absolute",
|
|
66
|
+
right: "12px",
|
|
67
|
+
top: "50%",
|
|
68
|
+
transform: "translateY(-50%)",
|
|
69
|
+
pointerEvents: "none",
|
|
70
|
+
color: "#64748b",
|
|
71
|
+
display: "flex",
|
|
72
|
+
alignItems: "center"
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ t.jsx(
|
|
75
|
+
"svg",
|
|
76
|
+
{
|
|
77
|
+
width: "14",
|
|
78
|
+
height: "14",
|
|
79
|
+
viewBox: "0 0 24 24",
|
|
80
|
+
fill: "none",
|
|
81
|
+
stroke: "currentColor",
|
|
82
|
+
strokeWidth: "2.5",
|
|
83
|
+
strokeLinecap: "round",
|
|
84
|
+
strokeLinejoin: "round",
|
|
85
|
+
children: /* @__PURE__ */ t.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }), Ye = (n) => /* @__PURE__ */ t.jsx("div", { style: ve, children: /* @__PURE__ */ t.jsx(
|
|
91
|
+
"input",
|
|
92
|
+
{
|
|
93
|
+
type: "date",
|
|
94
|
+
...n,
|
|
95
|
+
style: { ...je, padding: "0 14px" }
|
|
96
|
+
}
|
|
97
|
+
) });
|
|
98
|
+
function et({
|
|
99
|
+
data: n,
|
|
23
100
|
onSubmit: m,
|
|
24
|
-
onCancel:
|
|
101
|
+
onCancel: q,
|
|
25
102
|
timelineData: d,
|
|
26
|
-
fornecedoresOptions:
|
|
27
|
-
marcasOptions:
|
|
28
|
-
embalagensOptions:
|
|
103
|
+
fornecedoresOptions: Oe,
|
|
104
|
+
marcasOptions: Ae,
|
|
105
|
+
embalagensOptions: $e,
|
|
29
106
|
dailyConsumptionAverages: x,
|
|
30
|
-
showSuggestionBar:
|
|
31
|
-
showLegendTimeline:
|
|
107
|
+
showSuggestionBar: ke = !0,
|
|
108
|
+
showLegendTimeline: qe = !1,
|
|
109
|
+
initialQtdDays: j,
|
|
110
|
+
stockLeadTimeZoomOnly: Ce = !1
|
|
32
111
|
}) {
|
|
33
|
-
var
|
|
34
|
-
|
|
112
|
+
var ee, te, ne, oe, re, se, ie, ae, le, ce, de, ue, fe, ge, pe, me;
|
|
113
|
+
ze.useEffect(() => {
|
|
35
114
|
const e = document.createElement("style");
|
|
36
115
|
return e.textContent = `
|
|
37
116
|
.order-form-quantity-input::-webkit-outer-spin-button,
|
|
@@ -46,36 +125,36 @@ function Oe({
|
|
|
46
125
|
document.head.removeChild(e);
|
|
47
126
|
};
|
|
48
127
|
}, []);
|
|
49
|
-
const [
|
|
50
|
-
|
|
128
|
+
const [C, we] = k(!1);
|
|
129
|
+
Y(() => {
|
|
51
130
|
const e = () => {
|
|
52
|
-
|
|
131
|
+
we(window.innerWidth <= 768);
|
|
53
132
|
};
|
|
54
133
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
55
134
|
}, []);
|
|
56
|
-
const
|
|
135
|
+
const A = () => {
|
|
57
136
|
if (!(d != null && d.timeline)) return 0;
|
|
58
137
|
const { restockSuggestionStart: e, restockSuggestionEnd: s } = d.timeline;
|
|
59
138
|
if (!e || !s) return 0;
|
|
60
139
|
const r = new Date(e), l = new Date(s).getTime() - r.getTime(), c = Math.ceil(l / (1e3 * 60 * 60 * 24));
|
|
61
140
|
return c > 0 ? c : 0;
|
|
62
|
-
},
|
|
141
|
+
}, Fe = () => {
|
|
63
142
|
var i;
|
|
64
|
-
const e =
|
|
143
|
+
const e = O(), s = (i = d == null ? void 0 : d.timeline) == null ? void 0 : i.stockEndDate;
|
|
65
144
|
if (!s) return v(e);
|
|
66
|
-
const r =
|
|
145
|
+
const r = I(s);
|
|
67
146
|
return isNaN(r.getTime()) || r < e ? v(e) : v(r);
|
|
68
|
-
},
|
|
147
|
+
}, Te = () => P(A()), Se = () => j != null && j > 0 ? P(j) : Te(), g = (() => {
|
|
69
148
|
var i, l, c;
|
|
70
|
-
const e = (i =
|
|
149
|
+
const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
|
|
71
150
|
if (!e) return null;
|
|
72
|
-
const s =
|
|
151
|
+
const s = A();
|
|
73
152
|
if (!x || s <= 0) {
|
|
74
153
|
const u = (l = e.marcas) == null ? void 0 : l[0], f = (c = u == null ? void 0 : u.embalagens) == null ? void 0 : c[0];
|
|
75
154
|
return u && f ? {
|
|
76
155
|
marca: u.nome,
|
|
77
156
|
embalagem: f.label,
|
|
78
|
-
quantidade: (
|
|
157
|
+
quantidade: (n == null ? void 0 : n.qtdPedido) > 0 ? n.qtdPedido : 0,
|
|
79
158
|
valorUnitario: f.valor_unitario
|
|
80
159
|
} : null;
|
|
81
160
|
}
|
|
@@ -85,22 +164,22 @@ function Oe({
|
|
|
85
164
|
const p = f.quantidade_fornecedor;
|
|
86
165
|
if (!(p <= 0))
|
|
87
166
|
for (let h = 1; h <= 100; h++) {
|
|
88
|
-
const
|
|
167
|
+
const xe = h * p, U = ye({
|
|
89
168
|
dailyAverages: x,
|
|
90
169
|
startDate: /* @__PURE__ */ new Date(),
|
|
91
|
-
totalQuantity:
|
|
170
|
+
totalQuantity: xe
|
|
92
171
|
});
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
(!r ||
|
|
172
|
+
if (U.totalDays >= s) {
|
|
173
|
+
const be = h * f.valor_unitario * p, V = U.totalDays - s;
|
|
174
|
+
(!r || V < r.daysDifference || V === r.daysDifference && be < r.totalValue) && (r = {
|
|
96
175
|
marca: u.nome,
|
|
97
176
|
embalagem: f.label,
|
|
98
177
|
quantidade: h,
|
|
99
178
|
valorUnitario: f.valor_unitario,
|
|
100
|
-
totalKg:
|
|
101
|
-
totalValue:
|
|
102
|
-
days:
|
|
103
|
-
daysDifference:
|
|
179
|
+
totalKg: xe,
|
|
180
|
+
totalValue: be,
|
|
181
|
+
days: U.totalDays,
|
|
182
|
+
daysDifference: V
|
|
104
183
|
});
|
|
105
184
|
}
|
|
106
185
|
}
|
|
@@ -111,89 +190,89 @@ function Oe({
|
|
|
111
190
|
quantidade: r.quantidade,
|
|
112
191
|
valorUnitario: r.valorUnitario
|
|
113
192
|
} : null;
|
|
114
|
-
})(),
|
|
193
|
+
})(), Ie = () => {
|
|
115
194
|
var i, l, c;
|
|
116
195
|
if (g)
|
|
117
196
|
return g.valorUnitario;
|
|
118
|
-
const e = (i =
|
|
197
|
+
const e = (i = n == null ? void 0 : n.fornecedores) == null ? void 0 : i[0];
|
|
119
198
|
if (!e) return 0;
|
|
120
199
|
const s = (l = e.marcas) == null ? void 0 : l[0];
|
|
121
200
|
if (!s) return 0;
|
|
122
201
|
const r = (c = s.embalagens) == null ? void 0 : c[0];
|
|
123
202
|
return (r == null ? void 0 : r.valor_unitario) ?? 0;
|
|
124
|
-
},
|
|
125
|
-
...
|
|
126
|
-
qtdPedido: (g == null ? void 0 : g.quantidade) ?? (
|
|
127
|
-
valorTotal: (
|
|
128
|
-
}), [
|
|
129
|
-
((
|
|
130
|
-
), [
|
|
131
|
-
(g == null ? void 0 : g.marca) ?? ((
|
|
132
|
-
), [
|
|
133
|
-
(g == null ? void 0 : g.embalagem) ?? ((
|
|
134
|
-
), [
|
|
135
|
-
|
|
136
|
-
), [
|
|
137
|
-
|
|
203
|
+
}, R = n.unidade_medida ?? "kg", Ee = ((ee = n.ultima_compra) == null ? void 0 : ee.unidade) ?? n.unidade_medida ?? "kg", [a, $] = k({
|
|
204
|
+
...n,
|
|
205
|
+
qtdPedido: (g == null ? void 0 : g.quantidade) ?? (n == null ? void 0 : n.qtdPedido) ?? 0,
|
|
206
|
+
valorTotal: (n == null ? void 0 : n.valorTotal) ?? ((g == null ? void 0 : g.quantidade) ?? (n == null ? void 0 : n.qtdPedido) ?? 0) * Ie()
|
|
207
|
+
}), [Be, Q] = k(
|
|
208
|
+
((ne = (te = n == null ? void 0 : n.fornecedores) == null ? void 0 : te[0]) == null ? void 0 : ne.nome) ?? ""
|
|
209
|
+
), [w, E] = k(
|
|
210
|
+
(g == null ? void 0 : g.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
|
+
), [T, B] = k(
|
|
212
|
+
(g == null ? void 0 : g.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) ?? ""
|
|
213
|
+
), [L, G] = k(
|
|
214
|
+
Fe
|
|
215
|
+
), [z, K] = k(Se);
|
|
216
|
+
Y(() => {
|
|
138
217
|
var c, u, f;
|
|
139
|
-
const e =
|
|
218
|
+
const e = O(), s = (c = d == null ? void 0 : d.timeline) == null ? void 0 : c.stockEndDate;
|
|
140
219
|
let r;
|
|
141
220
|
if (s) {
|
|
142
|
-
const p =
|
|
221
|
+
const p = I(s);
|
|
143
222
|
r = isNaN(p.getTime()) || p < e ? v(e) : v(p);
|
|
144
223
|
} else
|
|
145
224
|
r = v(e);
|
|
146
225
|
let i = 0;
|
|
147
226
|
if ((u = d == null ? void 0 : d.timeline) != null && u.restockSuggestionStart && ((f = d == null ? void 0 : d.timeline) != null && f.restockSuggestionEnd)) {
|
|
148
|
-
const p =
|
|
227
|
+
const p = I(d.timeline.restockSuggestionStart), h = I(d.timeline.restockSuggestionEnd);
|
|
149
228
|
!isNaN(p.getTime()) && !isNaN(h.getTime()) && (i = Math.ceil((h.getTime() - p.getTime()) / (1e3 * 60 * 60 * 24)) || 0);
|
|
150
229
|
}
|
|
151
|
-
const l =
|
|
152
|
-
|
|
153
|
-
}, [d,
|
|
230
|
+
const l = j != null && j > 0 ? P(j) : P(i);
|
|
231
|
+
G(r), K(l);
|
|
232
|
+
}, [d, n, j]), Y(() => {
|
|
154
233
|
var s, r, i;
|
|
155
234
|
if (g) return;
|
|
156
|
-
const e = (s =
|
|
235
|
+
const e = (s = n == null ? void 0 : n.fornecedores) == null ? void 0 : s[0];
|
|
157
236
|
if (e) {
|
|
158
|
-
|
|
237
|
+
Q(e.nome);
|
|
159
238
|
const l = (r = e.marcas) == null ? void 0 : r[0];
|
|
160
239
|
if (l) {
|
|
161
|
-
|
|
240
|
+
E(l.nome);
|
|
162
241
|
const c = (i = l.embalagens) == null ? void 0 : i[0];
|
|
163
242
|
c && B(c.label);
|
|
164
243
|
}
|
|
165
244
|
}
|
|
166
|
-
}, [
|
|
167
|
-
const
|
|
245
|
+
}, [n, g]);
|
|
246
|
+
const M = D(() => {
|
|
168
247
|
var l, c, u;
|
|
169
248
|
const e = (l = a.fornecedores) == null ? void 0 : l[0];
|
|
170
249
|
if (!e) return 0;
|
|
171
|
-
const s = (c = e.marcas) == null ? void 0 : c.find((f) => f.nome ===
|
|
250
|
+
const s = (c = e.marcas) == null ? void 0 : c.find((f) => f.nome === w);
|
|
172
251
|
if (!s) return 0;
|
|
173
252
|
const r = (u = s.embalagens) == null ? void 0 : u.find(
|
|
174
|
-
(f) => f.label ===
|
|
253
|
+
(f) => f.label === T
|
|
175
254
|
), i = (r == null ? void 0 : r.quantidade_fornecedor) ?? 0;
|
|
176
255
|
return a.qtdPedido * i;
|
|
177
256
|
}, [
|
|
178
257
|
a.qtdPedido,
|
|
179
258
|
a.fornecedores,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
]),
|
|
259
|
+
w,
|
|
260
|
+
T
|
|
261
|
+
]), H = D(() => !x || M <= 0 ? null : ye({
|
|
183
262
|
dailyAverages: x,
|
|
184
263
|
startDate: /* @__PURE__ */ new Date(),
|
|
185
|
-
totalQuantity:
|
|
186
|
-
}), [x,
|
|
264
|
+
totalQuantity: M
|
|
265
|
+
}), [x, M]), F = (H == null ? void 0 : H.totalDays) ?? 0, b = D(() => {
|
|
187
266
|
if (!x) return 0;
|
|
188
|
-
const e =
|
|
267
|
+
const e = O(), s = I(L);
|
|
189
268
|
if (isNaN(s.getTime())) return 0;
|
|
190
269
|
const r = s < e ? e : s;
|
|
191
|
-
return
|
|
270
|
+
return Ne(
|
|
192
271
|
x,
|
|
193
272
|
r,
|
|
194
|
-
|
|
273
|
+
z
|
|
195
274
|
);
|
|
196
|
-
}, [x,
|
|
275
|
+
}, [x, L, z]), Z = D(() => {
|
|
197
276
|
if (d)
|
|
198
277
|
return {
|
|
199
278
|
...d,
|
|
@@ -203,18 +282,18 @@ function Oe({
|
|
|
203
282
|
}
|
|
204
283
|
};
|
|
205
284
|
}, [d, x]);
|
|
206
|
-
if (!
|
|
285
|
+
if (!n)
|
|
207
286
|
return null;
|
|
208
|
-
const
|
|
287
|
+
const J = () => {
|
|
209
288
|
var r, i, l;
|
|
210
289
|
const e = (r = a.fornecedores) == null ? void 0 : r[0];
|
|
211
290
|
if (!e) return null;
|
|
212
|
-
const s = (i = e.marcas) == null ? void 0 : i.find((c) => c.nome ===
|
|
213
|
-
return s ? ((l = s.embalagens) == null ? void 0 : l.find((c) => c.label ===
|
|
214
|
-
},
|
|
291
|
+
const s = (i = e.marcas) == null ? void 0 : i.find((c) => c.nome === w);
|
|
292
|
+
return s ? ((l = s.embalagens) == null ? void 0 : l.find((c) => c.label === T)) ?? null : null;
|
|
293
|
+
}, N = () => {
|
|
215
294
|
var e;
|
|
216
|
-
return ((e =
|
|
217
|
-
},
|
|
295
|
+
return ((e = J()) == null ? void 0 : e.valor_unitario) ?? 0;
|
|
296
|
+
}, X = (e) => {
|
|
218
297
|
const s = Number(e).toFixed(2), [r, i] = s.split(".");
|
|
219
298
|
return `R$ ${r.replace(
|
|
220
299
|
/\B(?=(\d{3})+(?!\d))/g,
|
|
@@ -222,70 +301,70 @@ function Oe({
|
|
|
222
301
|
)},${i}`;
|
|
223
302
|
}, y = () => {
|
|
224
303
|
var e;
|
|
225
|
-
return ((e =
|
|
226
|
-
},
|
|
227
|
-
const s =
|
|
228
|
-
|
|
304
|
+
return ((e = J()) == null ? void 0 : e.quantidade_fornecedor) ?? 0;
|
|
305
|
+
}, S = (e) => {
|
|
306
|
+
const s = N(), r = e * s;
|
|
307
|
+
$((i) => ({
|
|
229
308
|
...i,
|
|
230
309
|
qtdPedido: e,
|
|
231
310
|
valorTotal: r
|
|
232
311
|
}));
|
|
233
|
-
},
|
|
312
|
+
}, _ = (e) => {
|
|
234
313
|
var c, u, f;
|
|
235
314
|
B(e);
|
|
236
315
|
const s = (c = a.fornecedores) == null ? void 0 : c[0];
|
|
237
316
|
if (!s) return;
|
|
238
|
-
const r = (u = s.marcas) == null ? void 0 : u.find((p) => p.nome ===
|
|
317
|
+
const r = (u = s.marcas) == null ? void 0 : u.find((p) => p.nome === w);
|
|
239
318
|
if (!r) return;
|
|
240
319
|
const i = (f = r.embalagens) == null ? void 0 : f.find((p) => p.label === e);
|
|
241
320
|
if (!i) return;
|
|
242
321
|
const l = a.qtdPedido * (i.valor_unitario ?? 0);
|
|
243
|
-
|
|
322
|
+
$((p) => ({
|
|
244
323
|
...p,
|
|
245
324
|
valorTotal: l
|
|
246
325
|
}));
|
|
247
|
-
},
|
|
326
|
+
}, Me = () => {
|
|
248
327
|
var s;
|
|
249
328
|
const e = (s = a.fornecedores) == null ? void 0 : s[0];
|
|
250
329
|
return e ? e.marcas || [] : [];
|
|
251
|
-
},
|
|
330
|
+
}, De = () => {
|
|
252
331
|
var r, i;
|
|
253
332
|
const e = (r = a.fornecedores) == null ? void 0 : r[0];
|
|
254
333
|
if (!e) return [];
|
|
255
|
-
const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome ===
|
|
334
|
+
const s = (i = e.marcas) == null ? void 0 : i.find((l) => l.nome === w);
|
|
256
335
|
return s ? s.embalagens || [] : [];
|
|
257
|
-
},
|
|
336
|
+
}, Pe = (e) => {
|
|
258
337
|
var l, c;
|
|
259
|
-
|
|
338
|
+
E(e);
|
|
260
339
|
const s = (l = a.fornecedores) == null ? void 0 : l[0];
|
|
261
340
|
if (!s) return;
|
|
262
341
|
const r = (c = s.marcas) == null ? void 0 : c.find((u) => u.nome === e);
|
|
263
342
|
if (!r || !r.embalagens || r.embalagens.length === 0) return;
|
|
264
343
|
const i = r.embalagens[0];
|
|
265
|
-
|
|
266
|
-
},
|
|
344
|
+
_(i.label);
|
|
345
|
+
}, We = (e) => {
|
|
267
346
|
var l, c, u;
|
|
268
|
-
|
|
347
|
+
Q(e);
|
|
269
348
|
const s = (l = a.fornecedores) == null ? void 0 : l.find(
|
|
270
349
|
(f) => f.nome === e
|
|
271
350
|
);
|
|
272
351
|
if (!s) return;
|
|
273
352
|
const r = (c = s.marcas) == null ? void 0 : c[0];
|
|
274
353
|
if (!r) {
|
|
275
|
-
|
|
354
|
+
E(""), B("");
|
|
276
355
|
return;
|
|
277
356
|
}
|
|
278
|
-
|
|
357
|
+
E(r.nome);
|
|
279
358
|
const i = (u = r.embalagens) == null ? void 0 : u[0];
|
|
280
|
-
i ?
|
|
281
|
-
},
|
|
359
|
+
i ? _(i.label) : B("");
|
|
360
|
+
}, Re = (e) => {
|
|
282
361
|
e.preventDefault(), m(a);
|
|
283
|
-
},
|
|
362
|
+
}, Le = () => {
|
|
284
363
|
const e = y();
|
|
285
364
|
if (e <= 0 || b <= 0) return;
|
|
286
365
|
const s = Math.ceil(b / e);
|
|
287
|
-
|
|
288
|
-
},
|
|
366
|
+
S(s);
|
|
367
|
+
}, o = {
|
|
289
368
|
container: {
|
|
290
369
|
display: "flex",
|
|
291
370
|
flexDirection: "column",
|
|
@@ -360,38 +439,6 @@ function Oe({
|
|
|
360
439
|
color: "#111827",
|
|
361
440
|
fontFamily: "Inter, sans-serif"
|
|
362
441
|
},
|
|
363
|
-
select: {
|
|
364
|
-
height: "42px",
|
|
365
|
-
padding: "0 14px",
|
|
366
|
-
border: "1.5px solid #e2e8f0",
|
|
367
|
-
borderRadius: "10px",
|
|
368
|
-
fontSize: "14px",
|
|
369
|
-
fontWeight: "500",
|
|
370
|
-
backgroundColor: "#f8fafc",
|
|
371
|
-
color: "#0f172a",
|
|
372
|
-
cursor: "pointer",
|
|
373
|
-
outline: "none",
|
|
374
|
-
fontFamily: "Inter, sans-serif",
|
|
375
|
-
boxSizing: "border-box",
|
|
376
|
-
lineHeight: "1",
|
|
377
|
-
transition: "border-color 0.15s, box-shadow 0.15s"
|
|
378
|
-
},
|
|
379
|
-
dateInput: {
|
|
380
|
-
height: "42px",
|
|
381
|
-
padding: "0 14px",
|
|
382
|
-
border: "1.5px solid #e2e8f0",
|
|
383
|
-
borderRadius: "10px",
|
|
384
|
-
fontSize: "14px",
|
|
385
|
-
fontWeight: "500",
|
|
386
|
-
backgroundColor: "#f8fafc",
|
|
387
|
-
color: "#0f172a",
|
|
388
|
-
outline: "none",
|
|
389
|
-
fontFamily: "Inter, sans-serif",
|
|
390
|
-
boxSizing: "border-box",
|
|
391
|
-
lineHeight: "1",
|
|
392
|
-
transition: "border-color 0.15s, box-shadow 0.15s",
|
|
393
|
-
width: "100%"
|
|
394
|
-
},
|
|
395
442
|
// Estilos da seção de pedido (estilo calculadora)
|
|
396
443
|
orderSectionContainer: {
|
|
397
444
|
backgroundColor: "#f5f5f5",
|
|
@@ -526,10 +573,10 @@ function Oe({
|
|
|
526
573
|
backgroundColor: "#DC2626"
|
|
527
574
|
}
|
|
528
575
|
};
|
|
529
|
-
return /* @__PURE__ */
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ t.jsxs("form", { onSubmit: Re, style: o.container, children: [
|
|
577
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.header, children: [
|
|
578
|
+
/* @__PURE__ */ t.jsx("h2", { style: o.itemTitle, children: a.nome }),
|
|
579
|
+
/* @__PURE__ */ t.jsx("div", { style: o.valorUnitario, children: /* @__PURE__ */ t.jsx(
|
|
533
580
|
"div",
|
|
534
581
|
{
|
|
535
582
|
style: {
|
|
@@ -540,11 +587,11 @@ function Oe({
|
|
|
540
587
|
backgroundColor: "#FF4E00",
|
|
541
588
|
fontWeight: "600"
|
|
542
589
|
},
|
|
543
|
-
children:
|
|
590
|
+
children: X(N())
|
|
544
591
|
}
|
|
545
592
|
) })
|
|
546
593
|
] }),
|
|
547
|
-
/* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ t.jsxs(
|
|
548
595
|
"div",
|
|
549
596
|
{
|
|
550
597
|
style: {
|
|
@@ -554,118 +601,113 @@ function Oe({
|
|
|
554
601
|
flexDirection: "column"
|
|
555
602
|
},
|
|
556
603
|
children: [
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.infoRow, children: [
|
|
605
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.infoText, children: [
|
|
606
|
+
/* @__PURE__ */ t.jsx(_e, { width: 20, height: 20 }),
|
|
560
607
|
"Última compra ",
|
|
561
|
-
(
|
|
608
|
+
(ge = a.ultima_compra) == null ? void 0 : ge.data
|
|
562
609
|
] }),
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
Number(((
|
|
610
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.infoValue, children: [
|
|
611
|
+
Number(((pe = a.ultima_compra) == null ? void 0 : pe.quantidade) ?? 0).toFixed(2),
|
|
565
612
|
" ",
|
|
566
|
-
|
|
613
|
+
Ee.toUpperCase()
|
|
567
614
|
] })
|
|
568
615
|
] }),
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
|
|
616
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.formGrid, children: [
|
|
617
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
|
|
618
|
+
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Fornecedores:" }),
|
|
619
|
+
/* @__PURE__ */ t.jsx(
|
|
620
|
+
W,
|
|
574
621
|
{
|
|
575
|
-
value:
|
|
576
|
-
onChange: (e) =>
|
|
577
|
-
|
|
578
|
-
children: (fe = a.fornecedores) == null ? void 0 : fe.map((e) => /* @__PURE__ */ n.jsx("option", { value: e.nome, children: e.nome }, e.nome))
|
|
622
|
+
value: Be,
|
|
623
|
+
onChange: (e) => We(e.target.value),
|
|
624
|
+
children: (me = a.fornecedores) == null ? void 0 : me.map((e) => /* @__PURE__ */ t.jsx("option", { value: e.nome, children: e.nome }, e.nome))
|
|
579
625
|
}
|
|
580
626
|
)
|
|
581
627
|
] }),
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
|
|
628
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
|
|
629
|
+
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Marcas:" }),
|
|
630
|
+
/* @__PURE__ */ t.jsx(
|
|
631
|
+
W,
|
|
586
632
|
{
|
|
587
|
-
value:
|
|
588
|
-
onChange: (e) =>
|
|
589
|
-
|
|
590
|
-
children: Fe().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.nome, children: e.nome }, e.nome))
|
|
633
|
+
value: w,
|
|
634
|
+
onChange: (e) => Pe(e.target.value),
|
|
635
|
+
children: Me().map((e) => /* @__PURE__ */ t.jsx("option", { value: e.nome, children: e.nome }, e.nome))
|
|
591
636
|
}
|
|
592
637
|
)
|
|
593
638
|
] }),
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
|
|
639
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
|
|
640
|
+
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Embalagem:" }),
|
|
641
|
+
/* @__PURE__ */ t.jsx(
|
|
642
|
+
W,
|
|
598
643
|
{
|
|
599
|
-
value:
|
|
600
|
-
onChange: (e) =>
|
|
601
|
-
|
|
602
|
-
children: Te().map((e) => /* @__PURE__ */ n.jsx("option", { value: e.label, children: e.label }, e.label))
|
|
644
|
+
value: T,
|
|
645
|
+
onChange: (e) => _(e.target.value),
|
|
646
|
+
children: De().map((e) => /* @__PURE__ */ t.jsx("option", { value: e.label, children: e.label }, e.label))
|
|
603
647
|
}
|
|
604
648
|
)
|
|
605
649
|
] })
|
|
606
650
|
] }),
|
|
607
|
-
|
|
608
|
-
|
|
651
|
+
Z && /* @__PURE__ */ t.jsx("div", { style: { marginTop: "8px", marginBottom: "8px" }, children: /* @__PURE__ */ t.jsx(
|
|
652
|
+
He,
|
|
609
653
|
{
|
|
610
|
-
data:
|
|
654
|
+
data: Z,
|
|
611
655
|
controls: !0,
|
|
612
|
-
|
|
656
|
+
controlsZoomOnly: Ce,
|
|
657
|
+
showLegend: qe,
|
|
613
658
|
size: "sm",
|
|
614
|
-
showSuggestionBar:
|
|
615
|
-
unitLabel:
|
|
616
|
-
onAddSuggestedWeight: (e) =>
|
|
617
|
-
selectedQty:
|
|
618
|
-
selectedQtyDays:
|
|
659
|
+
showSuggestionBar: ke,
|
|
660
|
+
unitLabel: R,
|
|
661
|
+
onAddSuggestedWeight: (e) => S(e),
|
|
662
|
+
selectedQty: M,
|
|
663
|
+
selectedQtyDays: F
|
|
619
664
|
}
|
|
620
665
|
) }),
|
|
621
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ t.jsxs(
|
|
622
667
|
"div",
|
|
623
668
|
{
|
|
624
669
|
style: {
|
|
625
670
|
display: "grid",
|
|
626
|
-
gridTemplateColumns:
|
|
671
|
+
gridTemplateColumns: C ? "1fr 1fr" : "1fr 1fr 1fr",
|
|
627
672
|
gap: "16px",
|
|
628
673
|
marginTop: "8px",
|
|
629
674
|
alignItems: "flex-start"
|
|
630
675
|
},
|
|
631
676
|
children: [
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
|
|
677
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
|
|
678
|
+
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Data inicial" }),
|
|
679
|
+
/* @__PURE__ */ t.jsx(
|
|
680
|
+
Ye,
|
|
636
681
|
{
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
onChange: (e) => O(e.target.value),
|
|
641
|
-
style: t.dateInput,
|
|
682
|
+
value: L,
|
|
683
|
+
min: Ue(),
|
|
684
|
+
onChange: (e) => G(e.target.value),
|
|
642
685
|
"aria-label": "Data inicial"
|
|
643
686
|
}
|
|
644
687
|
)
|
|
645
688
|
] }),
|
|
646
|
-
/* @__PURE__ */
|
|
647
|
-
/* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
-
|
|
689
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.formField, children: [
|
|
690
|
+
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Quantos dias?" }),
|
|
691
|
+
/* @__PURE__ */ t.jsx(
|
|
692
|
+
W,
|
|
650
693
|
{
|
|
651
|
-
value:
|
|
652
|
-
onChange: (e) =>
|
|
653
|
-
style: t.select,
|
|
694
|
+
value: z,
|
|
695
|
+
onChange: (e) => K(Number(e.target.value)),
|
|
654
696
|
"aria-label": "Quantos dias?",
|
|
655
|
-
children:
|
|
697
|
+
children: he.map((e) => /* @__PURE__ */ t.jsx("option", { value: e, children: e }, e))
|
|
656
698
|
}
|
|
657
699
|
)
|
|
658
700
|
] }),
|
|
659
|
-
/* @__PURE__ */
|
|
701
|
+
/* @__PURE__ */ t.jsxs(
|
|
660
702
|
"div",
|
|
661
703
|
{
|
|
662
704
|
style: {
|
|
663
|
-
...
|
|
664
|
-
...
|
|
705
|
+
...o.formField,
|
|
706
|
+
...C ? { gridColumn: "1 / -1" } : {}
|
|
665
707
|
},
|
|
666
708
|
children: [
|
|
667
|
-
/* @__PURE__ */
|
|
668
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ t.jsx("label", { style: o.label, children: "Consumo previsto" }),
|
|
710
|
+
/* @__PURE__ */ t.jsxs(
|
|
669
711
|
"div",
|
|
670
712
|
{
|
|
671
713
|
style: {
|
|
@@ -679,7 +721,7 @@ function Oe({
|
|
|
679
721
|
height: "42px"
|
|
680
722
|
},
|
|
681
723
|
children: [
|
|
682
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ t.jsxs(
|
|
683
725
|
"span",
|
|
684
726
|
{
|
|
685
727
|
style: {
|
|
@@ -692,7 +734,7 @@ function Oe({
|
|
|
692
734
|
children: [
|
|
693
735
|
b.toFixed(2),
|
|
694
736
|
" ",
|
|
695
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ t.jsx(
|
|
696
738
|
"span",
|
|
697
739
|
{
|
|
698
740
|
style: {
|
|
@@ -700,17 +742,17 @@ function Oe({
|
|
|
700
742
|
fontWeight: "500",
|
|
701
743
|
color: "#64748b"
|
|
702
744
|
},
|
|
703
|
-
children:
|
|
745
|
+
children: R
|
|
704
746
|
}
|
|
705
747
|
)
|
|
706
748
|
]
|
|
707
749
|
}
|
|
708
750
|
),
|
|
709
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ t.jsx(
|
|
710
752
|
"button",
|
|
711
753
|
{
|
|
712
754
|
type: "button",
|
|
713
|
-
onClick:
|
|
755
|
+
onClick: Le,
|
|
714
756
|
disabled: b <= 0 || y() <= 0,
|
|
715
757
|
style: {
|
|
716
758
|
display: "flex",
|
|
@@ -748,39 +790,39 @@ function Oe({
|
|
|
748
790
|
]
|
|
749
791
|
}
|
|
750
792
|
),
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.orderSectionContainer, children: [
|
|
794
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.quantityRow, children: [
|
|
795
|
+
/* @__PURE__ */ t.jsx(
|
|
754
796
|
"button",
|
|
755
797
|
{
|
|
756
798
|
type: "button",
|
|
757
799
|
style: {
|
|
758
|
-
...
|
|
759
|
-
...a.qtdPedido <= 0 ?
|
|
800
|
+
...o.quantityButton,
|
|
801
|
+
...a.qtdPedido <= 0 ? o.quantityButtonDisabled : {}
|
|
760
802
|
},
|
|
761
|
-
onClick: () =>
|
|
803
|
+
onClick: () => S(Math.max(0, a.qtdPedido - 1)),
|
|
762
804
|
onMouseEnter: (e) => {
|
|
763
|
-
a.qtdPedido > 0 && (e.currentTarget.style.background =
|
|
805
|
+
a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform);
|
|
764
806
|
},
|
|
765
807
|
onMouseLeave: (e) => {
|
|
766
|
-
e.currentTarget.style.background =
|
|
808
|
+
e.currentTarget.style.background = o.quantityButton.background, e.currentTarget.style.transform = "";
|
|
767
809
|
},
|
|
768
810
|
onMouseDown: (e) => {
|
|
769
|
-
a.qtdPedido > 0 && (e.currentTarget.style.background =
|
|
811
|
+
a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonActive.background, e.currentTarget.style.transform = o.quantityButtonActive.transform);
|
|
770
812
|
},
|
|
771
813
|
onMouseUp: (e) => {
|
|
772
|
-
a.qtdPedido > 0 && (e.currentTarget.style.background =
|
|
814
|
+
a.qtdPedido > 0 && (e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform);
|
|
773
815
|
},
|
|
774
816
|
disabled: a.qtdPedido <= 0,
|
|
775
817
|
"aria-label": "Diminuir quantidade",
|
|
776
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */ t.jsx(
|
|
777
819
|
"svg",
|
|
778
820
|
{
|
|
779
821
|
style: { width: "24px", height: "24px" },
|
|
780
822
|
fill: "none",
|
|
781
823
|
viewBox: "0 0 24 24",
|
|
782
824
|
stroke: "#000",
|
|
783
|
-
children: /* @__PURE__ */
|
|
825
|
+
children: /* @__PURE__ */ t.jsx(
|
|
784
826
|
"path",
|
|
785
827
|
{
|
|
786
828
|
strokeLinecap: "round",
|
|
@@ -793,50 +835,50 @@ function Oe({
|
|
|
793
835
|
)
|
|
794
836
|
}
|
|
795
837
|
),
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.quantityInputContainer, children: [
|
|
839
|
+
/* @__PURE__ */ t.jsx(
|
|
798
840
|
"input",
|
|
799
841
|
{
|
|
800
842
|
type: "number",
|
|
801
843
|
value: a.qtdPedido,
|
|
802
|
-
onChange: (e) =>
|
|
844
|
+
onChange: (e) => S(
|
|
803
845
|
Math.max(0, parseInt(e.target.value) || 0)
|
|
804
846
|
),
|
|
805
|
-
style:
|
|
847
|
+
style: o.quantityInput,
|
|
806
848
|
className: "order-form-quantity-input",
|
|
807
849
|
min: "0",
|
|
808
850
|
"aria-label": "Quantidade"
|
|
809
851
|
}
|
|
810
852
|
),
|
|
811
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ t.jsx("span", { style: o.quantityLabel, children: T || "unidades" })
|
|
812
854
|
] }),
|
|
813
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ t.jsx(
|
|
814
856
|
"button",
|
|
815
857
|
{
|
|
816
858
|
type: "button",
|
|
817
|
-
style:
|
|
818
|
-
onClick: () =>
|
|
859
|
+
style: o.quantityButton,
|
|
860
|
+
onClick: () => S(a.qtdPedido + 1),
|
|
819
861
|
onMouseEnter: (e) => {
|
|
820
|
-
e.currentTarget.style.background =
|
|
862
|
+
e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform;
|
|
821
863
|
},
|
|
822
864
|
onMouseLeave: (e) => {
|
|
823
|
-
e.currentTarget.style.background =
|
|
865
|
+
e.currentTarget.style.background = o.quantityButton.background, e.currentTarget.style.transform = "";
|
|
824
866
|
},
|
|
825
867
|
onMouseDown: (e) => {
|
|
826
|
-
e.currentTarget.style.background =
|
|
868
|
+
e.currentTarget.style.background = o.quantityButtonActive.background, e.currentTarget.style.transform = o.quantityButtonActive.transform;
|
|
827
869
|
},
|
|
828
870
|
onMouseUp: (e) => {
|
|
829
|
-
e.currentTarget.style.background =
|
|
871
|
+
e.currentTarget.style.background = o.quantityButtonHover.background, e.currentTarget.style.transform = o.quantityButtonHover.transform;
|
|
830
872
|
},
|
|
831
873
|
"aria-label": "Aumentar quantidade",
|
|
832
|
-
children: /* @__PURE__ */
|
|
874
|
+
children: /* @__PURE__ */ t.jsx(
|
|
833
875
|
"svg",
|
|
834
876
|
{
|
|
835
877
|
style: { width: "24px", height: "24px" },
|
|
836
878
|
fill: "none",
|
|
837
879
|
viewBox: "0 0 24 24",
|
|
838
880
|
stroke: "#FF4E00",
|
|
839
|
-
children: /* @__PURE__ */
|
|
881
|
+
children: /* @__PURE__ */ t.jsx(
|
|
840
882
|
"path",
|
|
841
883
|
{
|
|
842
884
|
strokeLinecap: "round",
|
|
@@ -850,61 +892,61 @@ function Oe({
|
|
|
850
892
|
}
|
|
851
893
|
)
|
|
852
894
|
] }),
|
|
853
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ t.jsxs(
|
|
854
896
|
"div",
|
|
855
897
|
{
|
|
856
898
|
style: {
|
|
857
|
-
...
|
|
858
|
-
...
|
|
899
|
+
...o.totalsRow,
|
|
900
|
+
...C ? {
|
|
859
901
|
flexDirection: "column",
|
|
860
902
|
gap: "12px",
|
|
861
903
|
alignItems: "stretch"
|
|
862
904
|
} : {}
|
|
863
905
|
},
|
|
864
906
|
children: [
|
|
865
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ t.jsxs(
|
|
866
908
|
"div",
|
|
867
909
|
{
|
|
868
910
|
style: {
|
|
869
|
-
...
|
|
870
|
-
...
|
|
911
|
+
...o.totalItem,
|
|
912
|
+
...C ? { justifyContent: "space-between", width: "100%" } : {}
|
|
871
913
|
},
|
|
872
914
|
children: [
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Total:" }),
|
|
916
|
+
/* @__PURE__ */ t.jsxs("span", { style: o.totalValue, children: [
|
|
875
917
|
(a.qtdPedido * y()).toFixed(2),
|
|
876
918
|
" ",
|
|
877
|
-
|
|
919
|
+
R
|
|
878
920
|
] })
|
|
879
921
|
]
|
|
880
922
|
}
|
|
881
923
|
),
|
|
882
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ t.jsxs(
|
|
883
925
|
"div",
|
|
884
926
|
{
|
|
885
927
|
style: {
|
|
886
|
-
...
|
|
887
|
-
...
|
|
928
|
+
...o.totalItem,
|
|
929
|
+
...C ? { justifyContent: "space-between", width: "100%" } : {}
|
|
888
930
|
},
|
|
889
931
|
children: [
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
932
|
+
/* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Valor:" }),
|
|
933
|
+
/* @__PURE__ */ t.jsx("span", { style: o.totalValueHighlight, children: X(a.qtdPedido * N()) })
|
|
892
934
|
]
|
|
893
935
|
}
|
|
894
936
|
),
|
|
895
|
-
|
|
937
|
+
F > 0 && /* @__PURE__ */ t.jsxs(
|
|
896
938
|
"div",
|
|
897
939
|
{
|
|
898
940
|
style: {
|
|
899
|
-
...
|
|
900
|
-
...
|
|
941
|
+
...o.totalItem,
|
|
942
|
+
...C ? { justifyContent: "space-between", width: "100%" } : {}
|
|
901
943
|
},
|
|
902
944
|
children: [
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
|
|
945
|
+
/* @__PURE__ */ t.jsx("span", { style: o.totalLabel, children: "Duração:" }),
|
|
946
|
+
/* @__PURE__ */ t.jsxs("span", { style: o.totalValue, children: [
|
|
947
|
+
F % 1 === 0 ? F.toString() : F.toFixed(1),
|
|
906
948
|
" ",
|
|
907
|
-
|
|
949
|
+
F === 1 ? "dia" : "dias"
|
|
908
950
|
] })
|
|
909
951
|
]
|
|
910
952
|
}
|
|
@@ -913,37 +955,37 @@ function Oe({
|
|
|
913
955
|
}
|
|
914
956
|
)
|
|
915
957
|
] }),
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ t.jsxs("div", { style: o.buttons, children: [
|
|
959
|
+
/* @__PURE__ */ t.jsx(
|
|
918
960
|
"button",
|
|
919
961
|
{
|
|
920
962
|
type: "submit",
|
|
921
963
|
disabled: a.qtdPedido <= 0,
|
|
922
964
|
style: {
|
|
923
|
-
...
|
|
924
|
-
...
|
|
925
|
-
...a.qtdPedido <= 0 ?
|
|
965
|
+
...o.button,
|
|
966
|
+
...o.addButton,
|
|
967
|
+
...a.qtdPedido <= 0 ? o.addButtonDisabled : {}
|
|
926
968
|
},
|
|
927
969
|
onMouseEnter: (e) => {
|
|
928
|
-
a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor =
|
|
970
|
+
a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor = o.addButtonHover.backgroundColor);
|
|
929
971
|
},
|
|
930
972
|
onMouseLeave: (e) => {
|
|
931
|
-
a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor =
|
|
973
|
+
a.qtdPedido > 0 && (e.currentTarget.style.backgroundColor = o.addButton.backgroundColor);
|
|
932
974
|
},
|
|
933
975
|
children: "Adicionar"
|
|
934
976
|
}
|
|
935
977
|
),
|
|
936
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ t.jsx(
|
|
937
979
|
"button",
|
|
938
980
|
{
|
|
939
981
|
type: "button",
|
|
940
|
-
style: { ...
|
|
941
|
-
onClick:
|
|
982
|
+
style: { ...o.button, ...o.cancelButton },
|
|
983
|
+
onClick: q,
|
|
942
984
|
onMouseEnter: (e) => {
|
|
943
|
-
e.currentTarget.style.backgroundColor =
|
|
985
|
+
e.currentTarget.style.backgroundColor = o.cancelButtonHover.backgroundColor;
|
|
944
986
|
},
|
|
945
987
|
onMouseLeave: (e) => {
|
|
946
|
-
e.currentTarget.style.backgroundColor =
|
|
988
|
+
e.currentTarget.style.backgroundColor = o.cancelButton.backgroundColor;
|
|
947
989
|
},
|
|
948
990
|
children: "Cancelar"
|
|
949
991
|
}
|
|
@@ -955,6 +997,6 @@ function Oe({
|
|
|
955
997
|
] });
|
|
956
998
|
}
|
|
957
999
|
export {
|
|
958
|
-
|
|
1000
|
+
et as OrderForm
|
|
959
1001
|
};
|
|
960
1002
|
//# sourceMappingURL=index10.js.map
|