refactor: remove minimum value constraint from RupiahInput and NumberInput components across various forms
This commit is contained in:
parent
d91ec8869e
commit
266abb81e7
@ -244,7 +244,7 @@ export default function CashAccountIndex({
|
|||||||
Jumlah{' '}
|
Jumlah{' '}
|
||||||
<span className="text-destructive">*</span>
|
<span className="text-destructive">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<RupiahInput name="amount" min={1} />
|
<RupiahInput name="amount" />
|
||||||
<InputError message={errors.amount} />
|
<InputError message={errors.amount} />
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
@ -321,7 +321,7 @@ export default function CashAccountIndex({
|
|||||||
Jumlah{' '}
|
Jumlah{' '}
|
||||||
<span className="text-destructive">*</span>
|
<span className="text-destructive">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<RupiahInput name="amount" min={1} />
|
<RupiahInput name="amount" />
|
||||||
<InputError message={errors.amount} />
|
<InputError message={errors.amount} />
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
@ -401,7 +401,6 @@ export default function CashAccountIndex({
|
|||||||
<RupiahInput
|
<RupiahInput
|
||||||
name="amount"
|
name="amount"
|
||||||
defaultValue={editing.amount}
|
defaultValue={editing.amount}
|
||||||
min={1}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.amount} />
|
<InputError message={errors.amount} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -156,7 +156,7 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
|
|||||||
Jumlah{' '}
|
Jumlah{' '}
|
||||||
<span className="text-destructive">*</span>
|
<span className="text-destructive">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<RupiahInput name="amount" min={1} />
|
<RupiahInput name="amount" />
|
||||||
<InputError message={errors.amount} />
|
<InputError message={errors.amount} />
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
@ -191,7 +191,6 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
|
|||||||
value={dueDate}
|
value={dueDate}
|
||||||
onChange={setDueDate}
|
onChange={setDueDate}
|
||||||
placeholder="Pilih jatuh tempo"
|
placeholder="Pilih jatuh tempo"
|
||||||
min={new Date()}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.due_date} />
|
<InputError message={errors.due_date} />
|
||||||
</div>
|
</div>
|
||||||
@ -241,7 +240,6 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
|
|||||||
<RupiahInput
|
<RupiahInput
|
||||||
name="amount"
|
name="amount"
|
||||||
defaultValue={editing.amount}
|
defaultValue={editing.amount}
|
||||||
min={1}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.amount} />
|
<InputError message={errors.amount} />
|
||||||
</div>
|
</div>
|
||||||
@ -282,7 +280,6 @@ export default function EmployeeAdvanceIndex({ employeeAdvances }: Props) {
|
|||||||
value={editingDueDate}
|
value={editingDueDate}
|
||||||
onChange={setEditingDueDate}
|
onChange={setEditingDueDate}
|
||||||
placeholder="Pilih jatuh tempo"
|
placeholder="Pilih jatuh tempo"
|
||||||
min={new Date()}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.due_date} />
|
<InputError message={errors.due_date} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -134,7 +134,7 @@ export default function ExpenseIndex({ expenses }: Props) {
|
|||||||
Jumlah{' '}
|
Jumlah{' '}
|
||||||
<span className="text-destructive">*</span>
|
<span className="text-destructive">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<RupiahInput name="amount" min={1} />
|
<RupiahInput name="amount" />
|
||||||
<InputError message={errors.amount} />
|
<InputError message={errors.amount} />
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
@ -215,7 +215,6 @@ export default function ExpenseIndex({ expenses }: Props) {
|
|||||||
<RupiahInput
|
<RupiahInput
|
||||||
name="amount"
|
name="amount"
|
||||||
defaultValue={editing.amount}
|
defaultValue={editing.amount}
|
||||||
min={1}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.amount} />
|
<InputError message={errors.amount} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -274,7 +274,6 @@ export default function PayrollPeriodShow({ payrollPeriod }: Props) {
|
|||||||
</Label>
|
</Label>
|
||||||
<RupiahInput
|
<RupiahInput
|
||||||
name="amount"
|
name="amount"
|
||||||
min={1}
|
|
||||||
/>
|
/>
|
||||||
<InputError
|
<InputError
|
||||||
message={errors.amount}
|
message={errors.amount}
|
||||||
|
|||||||
@ -272,7 +272,6 @@ export default function EmployeeCreate() {
|
|||||||
</Label>
|
</Label>
|
||||||
<RupiahInput
|
<RupiahInput
|
||||||
name="base_salary"
|
name="base_salary"
|
||||||
min={1}
|
|
||||||
/>
|
/>
|
||||||
<InputError
|
<InputError
|
||||||
message={errors.base_salary}
|
message={errors.base_salary}
|
||||||
|
|||||||
@ -320,7 +320,6 @@ export default function EmployeeEdit({ employee }: Props) {
|
|||||||
</Label>
|
</Label>
|
||||||
<RupiahInput
|
<RupiahInput
|
||||||
name="base_salary"
|
name="base_salary"
|
||||||
min={1}
|
|
||||||
/>
|
/>
|
||||||
<InputError
|
<InputError
|
||||||
message={errors.base_salary}
|
message={errors.base_salary}
|
||||||
|
|||||||
@ -221,7 +221,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
|
|||||||
value={startDate}
|
value={startDate}
|
||||||
onChange={setStartDate}
|
onChange={setStartDate}
|
||||||
placeholder="Pilih tanggal mulai"
|
placeholder="Pilih tanggal mulai"
|
||||||
min={new Date()}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.start_date} />
|
<InputError message={errors.start_date} />
|
||||||
</div>
|
</div>
|
||||||
@ -245,7 +244,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
|
|||||||
value={endDate}
|
value={endDate}
|
||||||
onChange={setEndDate}
|
onChange={setEndDate}
|
||||||
placeholder="Pilih tanggal selesai"
|
placeholder="Pilih tanggal selesai"
|
||||||
min={startDate}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.end_date} />
|
<InputError message={errors.end_date} />
|
||||||
</div>
|
</div>
|
||||||
@ -310,7 +308,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
|
|||||||
value={editingStartDate}
|
value={editingStartDate}
|
||||||
onChange={setEditingStartDate}
|
onChange={setEditingStartDate}
|
||||||
placeholder="Pilih tanggal mulai"
|
placeholder="Pilih tanggal mulai"
|
||||||
min={new Date()}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.start_date} />
|
<InputError message={errors.start_date} />
|
||||||
</div>
|
</div>
|
||||||
@ -336,7 +333,6 @@ export default function LeaveRequestIndex({ leaveRequests, filters }: Props) {
|
|||||||
value={editingEndDate}
|
value={editingEndDate}
|
||||||
onChange={setEditingEndDate}
|
onChange={setEditingEndDate}
|
||||||
placeholder="Pilih tanggal selesai"
|
placeholder="Pilih tanggal selesai"
|
||||||
min={editingStartDate}
|
|
||||||
/>
|
/>
|
||||||
<InputError message={errors.end_date} />
|
<InputError message={errors.end_date} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -690,7 +690,6 @@ export default function PurchaseCreate({ data }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.stock
|
variant.stock
|
||||||
}
|
}
|
||||||
@ -930,9 +929,6 @@ export default function PurchaseCreate({ data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={
|
|
||||||
0
|
|
||||||
}
|
|
||||||
className="w-24 text-center"
|
className="w-24 text-center"
|
||||||
value={
|
value={
|
||||||
quantities[
|
quantities[
|
||||||
@ -1236,7 +1232,6 @@ export default function PurchaseCreate({ data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
className="w-20 text-center"
|
className="w-20 text-center"
|
||||||
value={item.quantity}
|
value={item.quantity}
|
||||||
onValueChange={item.onSet}
|
onValueChange={item.onSet}
|
||||||
|
|||||||
@ -591,7 +591,6 @@ export default function PurchaseEdit({ purchase, data }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.stock
|
variant.stock
|
||||||
}
|
}
|
||||||
@ -831,9 +830,6 @@ export default function PurchaseEdit({ purchase, data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={
|
|
||||||
0
|
|
||||||
}
|
|
||||||
className="w-24 text-center"
|
className="w-24 text-center"
|
||||||
value={
|
value={
|
||||||
quantities[
|
quantities[
|
||||||
@ -1137,7 +1133,6 @@ export default function PurchaseEdit({ purchase, data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
className="w-20 text-center"
|
className="w-20 text-center"
|
||||||
value={item.quantity}
|
value={item.quantity}
|
||||||
onValueChange={item.onSet}
|
onValueChange={item.onSet}
|
||||||
|
|||||||
@ -356,7 +356,6 @@ export default function RestockCreate({ data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
className="w-24 text-center"
|
className="w-24 text-center"
|
||||||
value={
|
value={
|
||||||
quantities[
|
quantities[
|
||||||
@ -622,7 +621,6 @@ export default function RestockCreate({ data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
className="w-20 text-center"
|
className="w-20 text-center"
|
||||||
value={item.quantity}
|
value={item.quantity}
|
||||||
onValueChange={item.onSet}
|
onValueChange={item.onSet}
|
||||||
|
|||||||
@ -284,7 +284,6 @@ export default function RestockEdit({ restock, data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
className="w-24 text-center"
|
className="w-24 text-center"
|
||||||
value={
|
value={
|
||||||
quantities[
|
quantities[
|
||||||
@ -554,7 +553,6 @@ export default function RestockEdit({ restock, data }: Props) {
|
|||||||
<Minus className="h-4 w-4" />
|
<Minus className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
className="w-20 text-center"
|
className="w-20 text-center"
|
||||||
value={item.quantity}
|
value={item.quantity}
|
||||||
onValueChange={item.onSet}
|
onValueChange={item.onSet}
|
||||||
|
|||||||
@ -658,7 +658,6 @@ export default function ProductCreate({ categories }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.stock
|
variant.stock
|
||||||
}
|
}
|
||||||
@ -688,7 +687,6 @@ export default function ProductCreate({ categories }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.reject_stock
|
variant.reject_stock
|
||||||
}
|
}
|
||||||
@ -718,7 +716,6 @@ export default function ProductCreate({ categories }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.retail_stock
|
variant.retail_stock
|
||||||
}
|
}
|
||||||
|
|||||||
@ -708,7 +708,6 @@ export default function ProductEdit({ product, categories }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.stock
|
variant.stock
|
||||||
}
|
}
|
||||||
@ -738,7 +737,6 @@ export default function ProductEdit({ product, categories }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.reject_stock
|
variant.reject_stock
|
||||||
}
|
}
|
||||||
@ -768,7 +766,6 @@ export default function ProductEdit({ product, categories }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.retail_stock
|
variant.retail_stock
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,7 +131,6 @@ export default function ProductVariantEdit({ variant }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={stock}
|
value={stock}
|
||||||
onValueChange={setStock}
|
onValueChange={setStock}
|
||||||
/>
|
/>
|
||||||
@ -147,7 +146,6 @@ export default function ProductVariantEdit({ variant }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={rejectStock}
|
value={rejectStock}
|
||||||
onValueChange={setRejectStock}
|
onValueChange={setRejectStock}
|
||||||
/>
|
/>
|
||||||
@ -163,7 +161,6 @@ export default function ProductVariantEdit({ variant }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={retailStock}
|
value={retailStock}
|
||||||
onValueChange={setRetailStock}
|
onValueChange={setRetailStock}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -419,7 +419,6 @@ export default function RawMaterialCreate() {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
variant.stock
|
variant.stock
|
||||||
}
|
}
|
||||||
|
|||||||
@ -435,7 +435,6 @@ export default function RawMaterialEdit({ rawMaterial }: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={
|
value={
|
||||||
Number(
|
Number(
|
||||||
variant.stock,
|
variant.stock,
|
||||||
|
|||||||
@ -98,7 +98,6 @@ export default function RawMaterialVariantEdit({ variant }: Props) {
|
|||||||
Stok <span className="text-destructive">*</span>
|
Stok <span className="text-destructive">*</span>
|
||||||
</Label>
|
</Label>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
min={0}
|
|
||||||
value={stock}
|
value={stock}
|
||||||
onValueChange={setStock}
|
onValueChange={setStock}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user