From 1dc24d48e52f2e490f5603ceb02842586ecae533 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 24 Jul 2025 11:06:32 +0000 Subject: (대표님) 정기평가 피드백 반영, 설계 피드백 반영, (최겸) 기술영업 피드백 반영 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-table/data-table-advanced-toolbar.tsx | 50 ++++++++++++---------- 1 file changed, 27 insertions(+), 23 deletions(-) (limited to 'components/data-table/data-table-advanced-toolbar.tsx') diff --git a/components/data-table/data-table-advanced-toolbar.tsx b/components/data-table/data-table-advanced-toolbar.tsx index 256dc125..7ae331bc 100644 --- a/components/data-table/data-table-advanced-toolbar.tsx +++ b/components/data-table/data-table-advanced-toolbar.tsx @@ -7,7 +7,7 @@ import { LayoutGrid, TableIcon } from "lucide-react" import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils" -import { DataTableFilterList } from "@/components/data-table/data-table-filter-list" +import { DataTableFilterList } from "@/components/data-table/data-table-filter-list" // ✅ 확장된 버전 사용 import { DataTableSortList } from "@/components/data-table/data-table-sort-list" import { DataTableViewOptions } from "@/components/data-table/data-table-view-options" import { DataTablePinList } from "./data-table-pin" @@ -57,24 +57,6 @@ interface DataTableAdvancedToolbarProps /** * An array of filter field configurations for the data table. * @type DataTableAdvancedFilterField[] - * @example - * const filterFields = [ - * { - * id: 'name', - * label: 'Name', - * type: 'text', - * placeholder: 'Filter by name...' - * }, - * { - * id: 'status', - * label: 'Status', - * type: 'select', - * options: [ - * { label: 'Active', value: 'active', count: 10 }, - * { label: 'Inactive', value: 'inactive', count: 5 } - * ] - * } - * ] */ filterFields: DataTableAdvancedFilterField[] @@ -113,6 +95,22 @@ interface DataTableAdvancedToolbarProps * @default "dataTableCompact" */ compactStorageKey?: string + + // ✅ 외부 필터 지원을 위한 새로운 props + /** + * 외부에서 전달받은 필터 (예: 폼에서 생성된 필터) + */ + externalFilters?: any[] + + /** + * 외부에서 전달받은 조인 연산자 + */ + externalJoinOperator?: "and" | "or" + + /** + * 필터 변경 시 호출될 콜백 + */ + onFiltersChange?: (filters: any[], joinOperator: "and" | "or") => void } export function DataTableAdvancedToolbar({ @@ -124,6 +122,9 @@ export function DataTableAdvancedToolbar({ initialCompact = false, onCompactChange, compactStorageKey = "dataTableCompact", + externalFilters, + externalJoinOperator, + onFiltersChange, children, className, ...props @@ -153,7 +154,7 @@ export function DataTableAdvancedToolbar({ {...props} >
- {enableCompactToggle && ( + {enableCompactToggle && ( )} + + {/* ✅ 확장된 DataTableFilterList 사용 */} + ({
- {/* 컴팩트 모드 토글 버튼 */} - {children}
-- cgit v1.2.3