Skip to content

feat: redesign the input-number#8901

Merged
Laffery merged 6 commits into
NG-ZORRO:masterfrom
HyperLife1119:feat/input-number
Dec 3, 2024
Merged

feat: redesign the input-number#8901
Laffery merged 6 commits into
NG-ZORRO:masterfrom
HyperLife1119:feat/input-number

Conversation

@HyperLife1119

@HyperLife1119 HyperLife1119 commented Nov 30, 2024

Copy link
Copy Markdown
Collaborator

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

旧版组件的开发体验不佳,与 antd 标准实现差异大。

What is the new behavior?

QQ_1733194148910

  1. 将旧版组件的导出点整体移动到 ng-zorro-antd/input-number-legacy(样式文件除外)
  2. 为了兼容新旧组件同时使用:
    • 将旧版组件选择器修改为 nz-input-number-legacy
    • NzInputNumberComponent 重命名为 NzInputNumberLegacyComponent
    • NzInputNumberModule 重命名为 NzInputNumberLegacyModule
  3. 弃用 NzInputNumberLegacyModule 及其包含的所有组件与指令
  4. input 模块新增如下指令:
    • NzInputPrefixDirective
    • NzInputSuffixDirective
    • NzInputAddonBeforeDirective
    • NzInputAddonAfterDirective
      由于未来 input 模块也需要用到这些指令,并且 input-number 隶属于 input,所以 input-number 也将从 input 模块中复用这些指令。
  5. 新版组件在使用 affixes 与 addons 时:
    • 不再需要 <nz-input-number-group>
    • 不再需要编写繁琐的 <ng-template>
<!-- Basic -->
<nz-input-number />

<!-- Custom handler icons -->
<nz-input-number>
  <nz-icon nzInputNumberUpIcon />
  <nz-icon nzInputNumberDownIcon />
</nz-input-number>

<!-- With affixes -->
<nz-input-number>
  <span nzInputPrefix>Prefix</span>
  <span nzInputSuffix>Suffix</span>
</nz-input-number>

<!-- With addons -->
<nz-input-number>
  <span nzInputAddonBefore>Before</span>
  <span nzInputAddonAfter>After</span>
</nz-input-number>

<!-- Mix -->
<nz-input-number>
  <span nzInputPrefix>Prefix</span>
  <span nzInputSuffix>Suffix</span>
  <span nzInputAddonBefore>Before</span>
  <span nzInputAddonAfter>After</span>
</nz-input-number>

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@zorro-bot

zorro-bot Bot commented Nov 30, 2024

Copy link
Copy Markdown

This preview will be available after the AzureCI is passed.

@HyperLife1119 HyperLife1119 added 💔 Breaking Change This PR or the solution to this issue would introduce breaking changes Component: InputNumber PR: unreviewed PR: draft PR: target-major labels Nov 30, 2024
@zorro-bot zorro-bot Bot requested a review from vthinkxie November 30, 2024 10:17
@codecov

codecov Bot commented Nov 30, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 98.64865% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.88%. Comparing base (c3ab3ba) to head (93791a6).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
components/input-number/input-number.component.ts 97.02% 4 Missing and 1 partial ⚠️
...ents/input-number-legacy/input-number.component.ts 99.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8901      +/-   ##
==========================================
+ Coverage   91.84%   91.88%   +0.04%     
==========================================
  Files         548      552       +4     
  Lines       19305    19491     +186     
  Branches     2862     2893      +31     
==========================================
+ Hits        17730    17909     +179     
- Misses       1260     1265       +5     
- Partials      315      317       +2     

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

@Laffery Laffery mentioned this pull request Dec 2, 2024
@Laffery Laffery added this to the v19 milestone Dec 2, 2024
@HyperLife1119 HyperLife1119 force-pushed the feat/input-number branch 2 times, most recently from 6f344f5 to fa226ea Compare December 2, 2024 13:27
@HyperLife1119 HyperLife1119 force-pushed the feat/input-number branch 2 times, most recently from 925ec6f to 973edb0 Compare December 3, 2024 02:48
@HyperLife1119 HyperLife1119 marked this pull request as ready for review December 3, 2024 03:06
@HyperLife1119 HyperLife1119 requested a review from Laffery December 3, 2024 03:06
@HyperLife1119 HyperLife1119 force-pushed the feat/input-number branch 5 times, most recently from 349886a to e632e8e Compare December 3, 2024 06:54

@Laffery Laffery left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Laffery Laffery merged commit df55d88 into NG-ZORRO:master Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💔 Breaking Change This PR or the solution to this issue would introduce breaking changes Component: InputNumber PR: reviewed-approved PR: target-major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants