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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user