template updating added and item text field fixes

This commit is contained in:
2026-03-13 14:12:13 -05:00
parent a07b145c76
commit c090c18734
7 changed files with 289 additions and 66 deletions
+11 -12
View File
@@ -1,6 +1,7 @@
import type { Component } from 'solid-js';
import { For, createMemo, Show, createSignal } from 'solid-js';
import { Trash2, Plus, Settings2, Percent, DollarSign, ChevronDown, FileText, ClipboardList, FileBox } from 'lucide-solid';
import NumericInput from './ui/NumericInput';
import type { EstimateItem, Scope, SubScope, PricingType } from '../types';
import ItemRow from './ItemRow';
import SubScopeCard from './SubScopeCard';
@@ -162,10 +163,10 @@ const ScopeCard: Component<ScopeCardProps> = (props) => {
<span class="text-sm font-semibold text-primary">Bulk Adjust Scope:</span>
<div class="flex items-center gap-2">
<label class="text-xs text-primary/70">Markup %:</label>
<input
type="number"
<NumericInput
class="w-16 px-2 py-1 border border-primary/20 bg-background rounded text-sm focus:ring-2 focus:ring-primary outline-none"
onInput={(e) => setBulkMarkup(parseFloat(e.currentTarget.value) || 0)}
value={bulkMarkup()}
onUpdate={(val) => setBulkMarkup(val)}
/>
<button
onClick={() => props.onBulkUpdate(props.scope.id, undefined, { markup: bulkMarkup(), markupType: 'percent' })}
@@ -176,10 +177,10 @@ const ScopeCard: Component<ScopeCardProps> = (props) => {
</div>
<div class="flex items-center gap-2 border-l border-primary/20 pl-4">
<label class="text-xs text-primary/70">Contingency %:</label>
<input
type="number"
<NumericInput
class="w-16 px-2 py-1 border border-primary/20 bg-background rounded text-sm focus:ring-2 focus:ring-primary outline-none"
onInput={(e) => setBulkContingency(parseFloat(e.currentTarget.value) || 0)}
value={bulkContingency()}
onUpdate={(val) => setBulkContingency(val)}
/>
<button
onClick={() => props.onBulkUpdate(props.scope.id, undefined, { contingency: bulkContingency(), contingencyType: 'percent' })}
@@ -299,10 +300,9 @@ const ScopeCard: Component<ScopeCardProps> = (props) => {
</div>
</div>
<div class="flex items-center gap-4">
<input
type="number"
<NumericInput
value={props.scope.managementFee}
onInput={(e) => props.onUpdateScope(props.scope.id, { managementFee: parseFloat(e.currentTarget.value) || 0 })}
onUpdate={(val) => props.onUpdateScope(props.scope.id, { managementFee: val })}
class="w-20 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
/>
<span class="w-28 text-right text-foreground font-medium">${formatNumber(totals().mgmtTotal)}</span>
@@ -329,10 +329,9 @@ const ScopeCard: Component<ScopeCardProps> = (props) => {
</div>
</div>
<div class="flex items-center gap-4">
<input
type="number"
<NumericInput
value={props.scope.deliveryFee}
onInput={(e) => props.onUpdateScope(props.scope.id, { deliveryFee: parseFloat(e.currentTarget.value) || 0 })}
onUpdate={(val) => props.onUpdateScope(props.scope.id, { deliveryFee: val })}
class="w-20 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
/>
<span class="w-28 text-right text-foreground font-medium">${formatNumber(totals().deliveryTotal)}</span>