[feat] negodata: 견적·카드 검색/필터 서버사이드 전환 + 견적 상세 Sheet 리팩터
- 백엔드: quotation 목록 search 파라미터(name/number ILIKE) 추가; card 목록 is_wildcard 탭 필터 + total_nego/total_wild 탭 카운트 추가; status/type 코드 int 비교 보정 - 프론트: cards/quotation 검색·상태·유형 필터·페이지네이션을 useServerList 기반 서버사이드로 전환; 엔터 즉시검색 + 디바운스 500ms·최소 2글자; 죽은 client 필터 훅(useCardFilters/useQuotationFilters) 제거 - generated 파라미터/응답 타입 손보강(listCardsParams.is_wildcard, listQuotationsParams.search, resCardList.total_nego/total_wild) — orval 재생성 시 동일 - 견적 상세 Drawer→Sheet 분리, useOverlayParams→useOverlayRouter, CreateQuotationWizard→QuotationCreateModal Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c3d96fb7d3
commit
6fa024137f
36 files changed
+1172
-967
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useRef, DragEvent, ChangeEvent } from 'react';
|
||||
import React, { useState, useRef, useEffect, DragEvent, ChangeEvent } from 'react';
|
||||
import { Upload, Image as ImageIcon, X, AlertCircle, Link2, Loader2 } from 'lucide-react';
|
||||
|
||||
interface ImageDropzoneProps {
|
||||
@@ -31,6 +31,12 @@ export default function ImageDropzone({
|
||||
const [urlDraft, setUrlDraft] = useState('');
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
// 현재 값이 일반 URL 이면 입력칸에 그대로 노출(보기/수정/복사 가능).
|
||||
// base64 data URL(파일 업로드 폴백)은 거대 문자열이라 칸엔 넣지 않는다.
|
||||
useEffect(() => {
|
||||
setUrlDraft(value && /^https?:\/\//i.test(value) ? value : '');
|
||||
}, [value]);
|
||||
|
||||
const processFile = async (file: File) => {
|
||||
setError(null);
|
||||
|
||||
@@ -107,8 +113,7 @@ export default function ImageDropzone({
|
||||
const url = urlDraft.trim();
|
||||
if (!url) return;
|
||||
setError(null);
|
||||
onChange(url);
|
||||
setUrlDraft('');
|
||||
onChange(url); // value 변경 → 위 effect 가 입력칸을 적용된 URL 로 다시 채움
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -97,10 +97,7 @@ export function DataTable<T>({
|
||||
const detailCols = mobileCols.filter((c) => c !== primaryCol)
|
||||
|
||||
return (
|
||||
// 전환 기준은 뷰포트가 아니라 '표가 들어갈 실제 폭'(컨테이너). 사이드바가 폭을 먹어도
|
||||
// 어긋나지 않는다. 컨테이너 ≥ 48rem(@3xl)이면 표, 그 미만은 카드 리스트. (Tailwind v4 내장 @container)
|
||||
<div className={cn("@container border border-border rounded-lg bg-card overflow-hidden", className)}>
|
||||
{/* 넓을 때: 표 — 그래도 넘치면 Table 내부에서 가로 스크롤 */}
|
||||
<div className="hidden @3xl:block">
|
||||
<Table className="w-full text-xs">
|
||||
<TableHeader>
|
||||
@@ -184,7 +181,6 @@ export function DataTable<T>({
|
||||
</Table>
|
||||
</div>
|
||||
|
||||
{/* 좁을 때(컨테이너 < 48rem): 카드 리스트 — 행=카드, 컬럼=라벨:값 */}
|
||||
<div className="@3xl:hidden divide-y divide-border">
|
||||
{data.length > 0 ? (
|
||||
data.map((row) => {
|
||||
@@ -218,7 +214,6 @@ export function DataTable<T>({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 상세: 기본=라벨:값 한 줄(컴팩트) / mobileBlock=라벨 아래 풀폭 */}
|
||||
{detailCols.length > 0 && (
|
||||
<dl className="mt-2.5 space-y-1.5 border-t border-border/40 pt-2.5 text-[11px] leading-tight">
|
||||
{detailCols.map((c, i) =>
|
||||
|
||||
Reference in new issue
Block a user