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