@fayz-ai/pos 0.21.16 → 0.21.17
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/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/screen/DispatchRail.d.ts +5 -2
- package/dist/screen/DispatchRail.d.ts.map +1 -1
- package/dist/screen/MarketplaceCancelSheet.d.ts +1 -1
- package/dist/screen/MarketplaceCancelSheet.d.ts.map +1 -1
- package/dist/screen/PosScreen.d.ts +3 -1
- package/dist/screen/PosScreen.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4997,7 +4997,8 @@ function DispatchRail({
|
|
|
4997
4997
|
onCancel,
|
|
4998
4998
|
now,
|
|
4999
4999
|
open,
|
|
5000
|
-
containerRef
|
|
5000
|
+
containerRef,
|
|
5001
|
+
extra
|
|
5001
5002
|
}) {
|
|
5002
5003
|
const status = order.dispatch ?? "received";
|
|
5003
5004
|
const next = nextDispatch(status);
|
|
@@ -5076,6 +5077,7 @@ function DispatchRail({
|
|
|
5076
5077
|
/* @__PURE__ */ jsx("span", { className: "pos-num", children: formatCents(Math.max(0, totals.totalCents - (order.paidCents ?? 0))) })
|
|
5077
5078
|
] })
|
|
5078
5079
|
] }),
|
|
5080
|
+
extra,
|
|
5079
5081
|
/* @__PURE__ */ jsxs("div", { className: "pos-cta", style: { display: "grid", gap: "var(--pos-2x)" }, children: [
|
|
5080
5082
|
next ? /* @__PURE__ */ jsx(PosButton, { className: "pos-btn", onClick: () => onAdvance(next), children: ADVANCE_LABEL[next] }) : /* @__PURE__ */ jsx(PosButton, { className: "pos-btn", disabled: true, children: "Entregue" }),
|
|
5081
5083
|
/* @__PURE__ */ jsx(PosButton, { className: "pos-btn pos-btn--ghost", style: { width: "100%" }, onClick: onCancel, children: "Cancelar pedido" })
|
|
@@ -7474,6 +7476,7 @@ function PosScreen({
|
|
|
7474
7476
|
onFire,
|
|
7475
7477
|
onCloseBill,
|
|
7476
7478
|
onDispatch,
|
|
7479
|
+
renderDispatchExtra,
|
|
7477
7480
|
verifyPin,
|
|
7478
7481
|
onAuthorised,
|
|
7479
7482
|
actionGate,
|
|
@@ -8943,7 +8946,8 @@ function PosScreen({
|
|
|
8943
8946
|
setDispatched((prev) => ({ ...prev, [activePosition.id]: to }));
|
|
8944
8947
|
void onDispatch?.(activePosition.id, to);
|
|
8945
8948
|
},
|
|
8946
|
-
onCancel: () => handleAction("cancel_order")
|
|
8949
|
+
onCancel: () => handleAction("cancel_order"),
|
|
8950
|
+
extra: renderDispatchExtra?.(activePosition, ticket)
|
|
8947
8951
|
}
|
|
8948
8952
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8949
8953
|
railOpen && /* @__PURE__ */ jsx(
|
|
@@ -10180,17 +10184,17 @@ function MarketplaceCancelSheet({ provider, orderLabel, loadReasons, onConfirm,
|
|
|
10180
10184
|
const [chosen, setChosen] = useState(null);
|
|
10181
10185
|
const [sending, setSending] = useState(false);
|
|
10182
10186
|
useEffect(() => {
|
|
10183
|
-
let
|
|
10187
|
+
let alive = true;
|
|
10184
10188
|
loadReasons().then((r) => {
|
|
10185
|
-
if (
|
|
10189
|
+
if (alive) setReasons(r);
|
|
10186
10190
|
}).catch(() => {
|
|
10187
|
-
if (
|
|
10191
|
+
if (alive) setFailed(true);
|
|
10188
10192
|
});
|
|
10189
10193
|
return () => {
|
|
10190
|
-
|
|
10194
|
+
alive = false;
|
|
10191
10195
|
};
|
|
10192
10196
|
}, [loadReasons]);
|
|
10193
|
-
const
|
|
10197
|
+
const reason = reasons?.find((r) => r.code === chosen);
|
|
10194
10198
|
return /* @__PURE__ */ jsxs(PosSheet, { label: "Cancelar pedido", onDismiss: onCancel, children: [
|
|
10195
10199
|
/* @__PURE__ */ jsxs("div", { className: "pos-sheet__head", children: [
|
|
10196
10200
|
/* @__PURE__ */ jsxs("h2", { className: "pos-sheet__title", children: [
|
|
@@ -10235,12 +10239,12 @@ function MarketplaceCancelSheet({ provider, orderLabel, loadReasons, onConfirm,
|
|
|
10235
10239
|
PosButton,
|
|
10236
10240
|
{
|
|
10237
10241
|
className: "pos-btn",
|
|
10238
|
-
disabled: !
|
|
10242
|
+
disabled: !reason || sending,
|
|
10239
10243
|
onClick: async () => {
|
|
10240
|
-
if (!
|
|
10244
|
+
if (!reason) return;
|
|
10241
10245
|
setSending(true);
|
|
10242
10246
|
try {
|
|
10243
|
-
await onConfirm(
|
|
10247
|
+
await onConfirm(reason);
|
|
10244
10248
|
} finally {
|
|
10245
10249
|
setSending(false);
|
|
10246
10250
|
}
|