From 2464f6b443010ad4c75b9e4237b23fb6fd352f93 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 16 Sep 2026 15:15:30 +0900 Subject: [PATCH 1/2] =?UTF-8?q?260916=5F01=5FENH:=20SID=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=EC=8B=9C=20=EB=AC=B8=EC=9E=90=20SID=20=ED=97=88?= =?UTF-8?q?=EC=9A=A9=20(=ED=8B=B8=EB=93=9C=20=EB=B2=94=EC=9C=84=EB=8A=94?= =?UTF-8?q?=20=EC=88=AB=EC=9E=90=EB=A7=8C=20=EC=9C=A0=EC=A7=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/list/ListSearchTable.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/list/ListSearchTable.tsx b/src/components/list/ListSearchTable.tsx index acadb83..26d0a00 100644 --- a/src/components/list/ListSearchTable.tsx +++ b/src/components/list/ListSearchTable.tsx @@ -83,7 +83,7 @@ const deduplicateSidInput = (value: string) => [...new Set(toSidSet(value))].joi const sanitizeSidInput = (value: string) => { let result = '' - let lastChar: 'digit' | 'comma' | 'tilde' | null = null + let lastChar: 'digit' | 'char' | 'comma' | 'tilde' | null = null let segmentHasTilde = false for (const ch of value) { @@ -93,7 +93,15 @@ const sanitizeSidInput = (value: string) => { continue } - if (ch === ',' && lastChar === 'digit') { + if (/[a-zA-Z_-]/.test(ch)) { + // 틸드 범위 검색은 숫자끼리만 허용되므로, 틸드 바로 뒤에는 문자를 붙이지 않는다. + if (lastChar === 'tilde') continue + result += ch + lastChar = 'char' + continue + } + + if (ch === ',' && (lastChar === 'digit' || lastChar === 'char')) { result += ch lastChar = 'comma' segmentHasTilde = false From 38672c262dbea6ce6e0caa33f3e4ca7d6b8ac403 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 16 Sep 2026 17:06:40 +0900 Subject: [PATCH 2/2] =?UTF-8?q?260916=5F02=5FENH:=20=ED=95=9C=EA=B8=80=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=EC=8B=9C=20=ED=88=B4=ED=8C=81=20=EB=85=B8?= =?UTF-8?q?=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/list/ListSearchTable.tsx | 55 +++++++++++++++++++++---- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/src/components/list/ListSearchTable.tsx b/src/components/list/ListSearchTable.tsx index 26d0a00..57b5afe 100644 --- a/src/components/list/ListSearchTable.tsx +++ b/src/components/list/ListSearchTable.tsx @@ -5,6 +5,7 @@ import type { PaginationState, SortingState } from '@tanstack/react-table' import { Funnel, PencilLine } from 'lucide-react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' +import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover' import { DataTable } from '@/components/data-table/DataTable' import type { DataTableColumn, SelectMode } from '@/components/data-table/DataTable.type' import { KriMultiSelect } from '@/components/common/KriAutoComplete' @@ -81,6 +82,10 @@ const toSidSet = (value: string) => const deduplicateSidInput = (value: string) => [...new Set(toSidSet(value))].join(',') +const HANGUL_PATTERN = /[ㄱ-ㆎ가-힣]/ +const hasHangul = (value: string) => HANGUL_PATTERN.test(value) +const SID_HANGUL_HINT_DURATION_MS = 2000 + const sanitizeSidInput = (value: string) => { let result = '' let lastChar: 'digit' | 'char' | 'comma' | 'tilde' | null = null @@ -195,6 +200,7 @@ export function ListSearchTable({ }: ListSearchTableProps) { const { showDialog } = useDialog() const [searchText, setSearchText] = useState(initialSearchState?.searchText ?? '') + const [showSidHangulHint, setShowSidHangulHint] = useState(false) const [searchContactResult, setSearchContactResult] = useState(initialSearchState?.searchContactResult ?? []) const [searchContactDateRange, setSearchContactDateRange] = useState( initialSearchState?.searchContactDateRange ?? { from: '', to: '' }, @@ -210,6 +216,7 @@ export function ListSearchTable({ const [selectedRows, setSelectedRows] = useState([]) const handledRefreshKeyRef = useRef(refreshKey) const previousExternalAssignFilterRef = useRef(externalAssignFilter) + const sidHangulHintTimeoutRef = useRef | null>(null) const selectedSids = useMemo( () => selectedRows.map((row) => String(row.sid ?? '')).filter((sid) => sid.length > 0), [selectedRows], @@ -547,8 +554,22 @@ export function ListSearchTable({ setPagination((prev) => (prev.pageIndex === 0 ? prev : { ...prev, pageIndex: 0 })) } + const triggerSidHangulHint = (value: string) => { + if (!hasHangul(value)) { + setShowSidHangulHint(false) + return + } + setShowSidHangulHint(true) + if (sidHangulHintTimeoutRef.current) clearTimeout(sidHangulHintTimeoutRef.current) + sidHangulHintTimeoutRef.current = setTimeout(() => { + setShowSidHangulHint(false) + sidHangulHintTimeoutRef.current = null + }, SID_HANGUL_HINT_DURATION_MS) + } + const handleSearchTextChange = (value: string) => { setSearchText(sanitizeSidInput(value)) + triggerSidHangulHint(value) resetToFirstPage() } @@ -576,6 +597,7 @@ export function ListSearchTable({ const selectionEnd = e.currentTarget.selectionEnd ?? selectionStart const nextValue = `${searchText.slice(0, selectionStart)}${normalizedText}${searchText.slice(selectionEnd)}` setSearchText(deduplicateSidInput(sanitizeSidInput(nextValue))) + triggerSidHangulHint(nextValue) resetToFirstPage() } @@ -605,6 +627,12 @@ export function ListSearchTable({ await listSearchQuery.refetch() } + useEffect(() => { + return () => { + if (sidHangulHintTimeoutRef.current) clearTimeout(sidHangulHintTimeoutRef.current) + } + }, []) + useEffect(() => { onCurrentFilterChange?.(listSearchRequest.listFilter) }, [listSearchRequest.listFilter, onCurrentFilterChange]) @@ -670,13 +698,26 @@ export function ListSearchTable({
- handleSearchTextChange(e.target.value)} - onPaste={handleSidPaste} - /> +
+ + + handleSearchTextChange(e.target.value)} + onPaste={handleSidPaste} + /> + + e.preventDefault()} + > + 한글은 입력할 수 없습니다. 한/영 전환 후 영문·숫자로 입력해 주세요. + + +
item.resultCdTy === ResultCodeType.CONTACT)}