refactor: remove minimum value constraint from RupiahInput and NumberInput components across various forms

This commit is contained in:
Yoga Pangestu 2026-08-02 23:42:52 +07:00
parent d91ec8869e
commit 266abb81e7
17 changed files with 4 additions and 42 deletions

View File

@ -244,7 +244,7 @@ export default function CashAccountIndex({
Jumlah{' '}
<span className="text-destructive">*</span>
</Label>
<RupiahInput name="amount" min={1} />
<RupiahInput name="amount" />
<InputError message={errors.amount} />
</div>
<div className="grid gap-2">
@ -321,7 +321,7 @@ export default function CashAccountIndex({
Jumlah{' '}
<span className="text-destructive">*</span>
</Label>
<RupiahInput name="amount" min={1} />
<RupiahInput name="amount" />
<InputError message={errors.amount} />
</div>
<div className="grid gap-2">
@ -401,7 +401,6 @@ export default function CashAccountIndex({
<RupiahInput
name="amount"
defaultValue={editing.amount}
min={1}
/>
<InputError message={errors.amount} />
</div>

View File

@ -156,7 +156,7 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
Jumlah{' '}
<span className="text-destructive">*</span>
</Label>
<RupiahInput name="amount" min={1} />
<RupiahInput name="amount" />
<InputError message={errors.amount} />
</div>
<div className="grid gap-2">
@ -191,7 +191,6 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
value={dueDate}
onChange={setDueDate}
placeholder="Pilih jatuh tempo"
min={new Date()}
/>
<InputError message={errors.due_date} />
</div>
@ -241,7 +240,6 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
<RupiahInput
name="amount"
defaultValue={editing.amount}
min={1}
/>
<InputError message={errors.amount} />
</div>
@ -282,7 +280,6 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
value={editingDueDate}
onChange={setEditingDueDate}
placeholder="Pilih jatuh tempo"
min={new Date()}
/>
<InputError message={errors.due_date} />
</div>

View File

@ -134,7 +134,7 @@ export default function ExpenseIndex({ expenses }: Props) {
Jumlah{' '}
<span className="text-destructive">*</span>
</Label>
<RupiahInput name="amount" min={1} />
<RupiahInput name="amount" />
<InputError message={errors.amount} />
</div>
<div className="grid gap-2">
@ -215,7 +215,6 @@ export default function ExpenseIndex({ expenses }: Props) {
<RupiahInput
name="amount"
defaultValue={editing.amount}
min={1}
/>
<InputError message={errors.amount} />
</div>

View File

@ -274,7 +274,6 @@ export default function PayrollPeriodShow({ payrollPeriod }: Props) {
</Label>
<RupiahInput
name="amount"
min={1}
/>
<InputError
message={errors.amount}

View File

@ -272,7 +272,6 @@ export default function EmployeeCreate() {
</Label>
<RupiahInput
name="base_salary"
min={1}
/>
<InputError
message={errors.base_salary}

View File

@ -320,7 +320,6 @@ export default function EmployeeEdit({ employee }: Props) {
</Label>
<RupiahInput
name="base_salary"
min={1}
/>
<InputError
message={errors.base_salary}

View File

@ -221,7 +221,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
value={startDate}
onChange={setStartDate}
placeholder="Pilih tanggal mulai"
min={new Date()}
/>
<InputError message={errors.start_date} />
</div>
@ -245,7 +244,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
value={endDate}
onChange={setEndDate}
placeholder="Pilih tanggal selesai"
min={startDate}
/>
<InputError message={errors.end_date} />
</div>
@ -310,7 +308,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
value={editingStartDate}
onChange={setEditingStartDate}
placeholder="Pilih tanggal mulai"
min={new Date()}
/>
<InputError message={errors.start_date} />
</div>
@ -336,7 +333,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
value={editingEndDate}
onChange={setEditingEndDate}
placeholder="Pilih tanggal selesai"
min={editingStartDate}
/>
<InputError message={errors.end_date} />
</div>

View File

@ -690,7 +690,6 @@ export default function PurchaseCreate({ data }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.stock
}
@ -930,9 +929,6 @@ export default function PurchaseCreate({ data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={
0
}
className="w-24 text-center"
value={
quantities[
@ -1236,7 +1232,6 @@ export default function PurchaseCreate({ data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={0}
className="w-20 text-center"
value={item.quantity}
onValueChange={item.onSet}

View File

@ -591,7 +591,6 @@ export default function PurchaseEdit({ purchase, data }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.stock
}
@ -831,9 +830,6 @@ export default function PurchaseEdit({ purchase, data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={
0
}
className="w-24 text-center"
value={
quantities[
@ -1137,7 +1133,6 @@ export default function PurchaseEdit({ purchase, data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={0}
className="w-20 text-center"
value={item.quantity}
onValueChange={item.onSet}

View File

@ -356,7 +356,6 @@ export default function RestockCreate({ data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={0}
className="w-24 text-center"
value={
quantities[
@ -622,7 +621,6 @@ export default function RestockCreate({ data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={0}
className="w-20 text-center"
value={item.quantity}
onValueChange={item.onSet}

View File

@ -284,7 +284,6 @@ export default function RestockEdit({ restock, data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={0}
className="w-24 text-center"
value={
quantities[
@ -554,7 +553,6 @@ export default function RestockEdit({ restock, data }: Props) {
<Minus className="h-4 w-4" />
</Button>
<NumberInput
min={0}
className="w-20 text-center"
value={item.quantity}
onValueChange={item.onSet}

View File

@ -658,7 +658,6 @@ export default function ProductCreate({ categories }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.stock
}
@ -688,7 +687,6 @@ export default function ProductCreate({ categories }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.reject_stock
}
@ -718,7 +716,6 @@ export default function ProductCreate({ categories }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.retail_stock
}

View File

@ -708,7 +708,6 @@ export default function ProductEdit({ product, categories }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.stock
}
@ -738,7 +737,6 @@ export default function ProductEdit({ product, categories }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.reject_stock
}
@ -768,7 +766,6 @@ export default function ProductEdit({ product, categories }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
variant.retail_stock
}

View File

@ -131,7 +131,6 @@ export default function ProductVariantEdit({ variant }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={stock}
onValueChange={setStock}
/>
@ -147,7 +146,6 @@ export default function ProductVariantEdit({ variant }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={rejectStock}
onValueChange={setRejectStock}
/>
@ -163,7 +161,6 @@ export default function ProductVariantEdit({ variant }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={retailStock}
onValueChange={setRetailStock}
/>

View File

@ -419,7 +419,6 @@ export default function RawMaterialCreate() {
</span>
</Label>
<NumberInput
min={0}
value={
variant.stock
}

View File

@ -435,7 +435,6 @@ export default function RawMaterialEdit({ rawMaterial }: Props) {
</span>
</Label>
<NumberInput
min={0}
value={
Number(
variant.stock,

View File

@ -98,7 +98,6 @@ export default function RawMaterialVariantEdit({ variant }: Props) {
Stok <span className="text-destructive">*</span>
</Label>
<NumberInput
min={0}
value={stock}
onValueChange={setStock}
/>