From 7b8d4f8ed19dd603ac1cc1ed0df19c7a1e14ba29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=8E=89=E9=91=AB?= Date: Fri, 11 Sep 2026 17:57:01 +0800 Subject: [PATCH] feat: add exact match indicator support to search input Add renderExactMatch method to support custom ExactMatchIndicator component, allowing both element and function component types to be passed via components prop. --- src/DTableSearchInput/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/DTableSearchInput/index.js b/src/DTableSearchInput/index.js index dbc30f40..2fcdc65f 100644 --- a/src/DTableSearchInput/index.js +++ b/src/DTableSearchInput/index.js @@ -85,6 +85,17 @@ class DtableSearchInput extends Component { ); }; + renderExactMatch = () => { + const { components = {} } = this.props; + const { ExactMatchIndicator } = components; + if (React.isValidElement(ExactMatchIndicator)) { + return ExactMatchIndicator; + } else if (isFunction(ExactMatchIndicator)) { + return ; + } + return null; + }; + render() { const { placeholder, autoFocus, className, onKeyDown, disabled, style } = this.props; const { searchValue } = this.state; @@ -106,6 +117,7 @@ class DtableSearchInput extends Component { style={style} /> {this.renderClear()} + {this.renderExactMatch()} ); }