MCPcopy Create free account
hub / github.com/react-component/input / getSuffix

Function getSuffix

src/Input.tsx:255–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253 };
254
255 const getSuffix = () => {
256 // Max length value
257 const hasMaxLength = Number(mergedMax) > 0;
258
259 if (suffix || countConfig.show) {
260 const dataCount = countConfig.showFormatter
261 ? countConfig.showFormatter({
262 value: formatValue,
263 count: valueLength,
264 maxLength: mergedMax,
265 })
266 : `${valueLength}${hasMaxLength ? ` / ${mergedMax}` : ''}`;
267
268 return (
269 <>
270 {countConfig.show && (
271 <span
272 className={clsx(
273 `${prefixCls}-show-count-suffix`,
274 {
275 [`${prefixCls}-show-count-has-suffix`]: !!suffix,
276 },
277 classNames?.count,
278 )}
279 style={{
280 ...styles?.count,
281 }}
282 >
283 {dataCount}
284 </span>
285 )}
286 {suffix}
287 </>
288 );
289 }
290 return null;
291 };
292
293 // ====================== Render ======================
294 return (

Callers 1

Input.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…