feat(ui): grouped thousands separators for price/amount inputs

Price fields showed raw digits (1490000) while typing — hard to read for
Toman amounts. New shared MoneyInput groups as you type (1,490,000),
accepts Persian/Arabic digits, and reports a raw digit string so callers
keep parsing unchanged. Applied to menu item price, branch price override,
expense amount, and payment-correction replacement amount. Displays already
group via formatCurrency (incl. the QR guest-menu preview).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-15 15:46:25 +03:30
parent a855cf1d80
commit 4523c8861f
5 changed files with 75 additions and 21 deletions
@@ -32,6 +32,7 @@ import { PageHeader } from "@/components/layout/page-header";
import { MediaPairUpload } from "@/components/media/media-pair-upload";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { MoneyInput } from "@/components/ui/money-input";
import { LabeledField } from "@/components/ui/labeled-field";
import { Skeleton } from "@/components/ui/skeleton";
import { cn } from "@/lib/utils";
@@ -872,13 +873,10 @@ export function MenuAdminScreen() {
<div className="grid gap-3 sm:grid-cols-2">
<LabeledField label={t("price")} htmlFor="modal-item-price">
<Input
<MoneyInput
id="modal-item-price"
value={itemForm.price}
onChange={(e) => setItemForm((f) => ({ ...f, price: e.target.value }))}
inputMode="numeric"
dir="ltr"
className="text-end"
onValueChange={(raw) => setItemForm((f) => ({ ...f, price: raw }))}
/>
</LabeledField>
<LabeledField label={t("discountPercent")} htmlFor="modal-item-discount">