Skip to content

feat(module:input): input-wrapper supports custom count logic#9645

Open
iaosee wants to merge 8 commits intoNG-ZORRO:masterfrom
iaosee:feat/input-count
Open

feat(module:input): input-wrapper supports custom count logic#9645
iaosee wants to merge 8 commits intoNG-ZORRO:masterfrom
iaosee:feat/input-count

Conversation

@iaosee
Copy link
Contributor

@iaosee iaosee commented Jan 12, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

input-wrapper supports custom count logic.
implements feature AntD input custom count logic.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@iaosee iaosee requested a review from vthinkxie as a code owner January 12, 2026 08:15
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.08%. Comparing base (d7fbc90) to head (3e0998b).
⚠️ Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
components/input/input-wrapper.component.ts 83.33% 0 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9645      +/-   ##
==========================================
- Coverage   90.20%   90.08%   -0.13%     
==========================================
  Files         573      574       +1     
  Lines       23701    23754      +53     
  Branches     4787     4833      +46     
==========================================
+ Hits        21380    21398      +18     
- Misses       1503     1523      +20     
- Partials      818      833      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds custom count logic support to the nz-input-wrapper component, implementing the AntD input custom count logic feature. The feature allows developers to display character counts with customizable counting strategies, maximum limits, and automatic value formatting when limits are exceeded.

Changes:

  • Added four new inputs to nz-input-wrapper: nzShowCount, nzCountMax, nzCountStrategy, and nzExceedFormatter for flexible character counting
  • Implemented reactive count display with out-of-range visual feedback using signals and effects
  • Added comprehensive test coverage for various count scenarios including emoji handling and custom formatting

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
components/input/input-wrapper.component.ts Core implementation: added count-related inputs, signals for reactive state, effect for count updates, and template integration for count display
components/input/style/index.less Added CSS styling for out-of-range state (.ant-input-out-of-range) that applies error color to input and count suffix
components/input/input-wrapper.component.spec.ts Added comprehensive test suite covering show/hide count, basic counting, max limit enforcement, and custom strategy/formatter scenarios
components/input/doc/index.en-US.md Updated English API documentation with the four new input properties and their descriptions
components/input/doc/index.zh-CN.md Updated Chinese API documentation with the four new input properties and their descriptions
components/input/demo/advance-count.ts New demo component showcasing various count configurations including emoji handling, exceed formatting, and integration with password/search inputs
components/input/demo/advance-count.md Documentation for the new demo explaining the custom count feature and its use cases

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

@HyperLife1119 HyperLife1119 requested review from greengerong and removed request for greengerong January 29, 2026 09:00
@HyperLife1119
Copy link
Collaborator

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature for custom input counting in nz-input-wrapper. The implementation is well-structured, including documentation and a demonstration. However, I've identified a few areas for improvement in the core logic that could prevent potential runtime errors and improve code consistency. Additionally, there's an opportunity to streamline the test suite by removing a redundant test case. My feedback includes specific suggestions to address these points.

Copy link
Collaborator

@HyperLife1119 HyperLife1119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants