diff --git a/src/components/dialog/ListFilterDialog.tsx b/src/components/dialog/ListFilterDialog.tsx index 00a8816..4099638 100644 --- a/src/components/dialog/ListFilterDialog.tsx +++ b/src/components/dialog/ListFilterDialog.tsx @@ -1,6 +1,7 @@ 'use client' import { useEffect, useMemo, useState } from 'react' +import { RotateCcw } from 'lucide-react' import { KriDialog } from '@/components/common/KriDialog' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' @@ -107,6 +108,18 @@ const ListFilterDialog = ({ [rows, headerOptions], ) + // 잠긴 헤더는 조회 조건에 쓰이지 않으므로 초기화 필요 여부 판단에서 제외한다. + const isResettable = rows.some((row) => { + if (isDisabledHeader(row.headerId)) return false + const defaultOperator = getHeaderOption(row.headerId)?.defaultOperator ?? 'eq' + return row.operator !== defaultOperator || row.textValue !== '' || row.multiValues.length > 0 + }) + + // 다이얼로그 내 입력만 기본값으로 되돌린다. 실제 반영은 "적용"을 눌러야 이뤄진다. + const handleReset = () => { + setRows(headerOptions.map((option) => createFilterRow(option.id, headerOptions))) + } + const handleConfirm = async () => { setSubmitting(true) try { @@ -138,7 +151,20 @@ const ListFilterDialog = ({
헤더 비교 연산자 - 값 +
+ 값 + +