diff --git a/src/components/PricingView.tsx b/src/components/PricingView.tsx index d4c6572..0da3223 100644 --- a/src/components/PricingView.tsx +++ b/src/components/PricingView.tsx @@ -335,9 +335,15 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit, } // Column filters + // Column-specific name filter - Multi-word AND support if (nameColFilter) { - const s = nameColFilter.toLowerCase(); - result = result.filter(r => String(r.row[COLUMNS.ARTICLE_NAME] || '').toLowerCase().includes(s)); + const terms = nameColFilter.toLowerCase().split(/\s+/).filter(Boolean); + if (terms.length > 0) { + result = result.filter(r => { + const name = String(r.row[COLUMNS.ARTICLE_NAME] || '').toLowerCase(); + return terms.every(term => name.includes(term)); + }); + } } if (lineMultiFilter.length > 0) { result = result.filter(r => lineMultiFilter.includes(String(r.row[COLUMNS.LINE] || ''))); @@ -744,7 +750,7 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
{ setSearch(e.target.value); @@ -1611,12 +1617,15 @@ function TextFilterPopover({ value, onChange, onClose }: { onChange(e.target.value)} autoFocus className="w-full bg-slate-900 border border-slate-700 rounded p-1.5 pl-8 text-xs text-white focus:outline-none focus:border-blue-500" /> +
+ Use spaces to search multiple terms (AND logic) +