Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(module:form): nz-form-label support nzFormTooltip #5957

Merged
merged 1 commit into from
Oct 25, 2020
Merged

feat(module:form): nz-form-label support nzFormTooltip #5957

merged 1 commit into from
Oct 25, 2020

Conversation

danranVm
Copy link
Member

close #5905

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] 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?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@zorro-bot
Copy link

zorro-bot bot commented Oct 22, 2020

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #5957 into master will increase coverage by 0.05%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5957      +/-   ##
==========================================
+ Coverage   89.92%   89.98%   +0.05%     
==========================================
  Files         463      465       +2     
  Lines       13965    14045      +80     
  Branches     2289     2309      +20     
==========================================
+ Hits        12558    12638      +80     
+ Misses        867      859       -8     
- Partials      540      548       +8     
Impacted Files Coverage Δ
components/core/config/config.ts 100.00% <ø> (ø)
components/form/form.module.ts 100.00% <ø> (ø)
components/form/form-label.component.ts 86.66% <75.00%> (-8.08%) ⬇️
components/form/form.directive.ts 100.00% <100.00%> (ø)
components/typography/text-copy.component.ts 94.73% <0.00%> (-5.27%) ⬇️
components/table/src/table-style.service.ts 94.82% <0.00%> (-1.73%) ⬇️
components/tabs/tab-nav-bar.component.ts 81.62% <0.00%> (-0.71%) ⬇️
components/tooltip/base.ts 91.50% <0.00%> (-0.46%) ⬇️
components/tooltip/tooltip.ts 100.00% <0.00%> (ø)
components/tag/tag.component.ts 100.00% <0.00%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa4ac2b...827774e. Read the comment docs.

Copy link
Member

@hsuanxyz hsuanxyz left a comment

Choose a reason for hiding this comment

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

非 string 时,是不是结构化指令更灵活一些?

<nz-form-label>
  Label
  <i *nzFormTooltip nz-icon nz-tooltip></i>
</nz-form-label>

@danranVm
Copy link
Member Author

@hsuanxyz 这样的话,nzFormTooltip 只是加一个 class 吗?那好像意义也不是很大?不使用这个 API 代码量也差不多。

我认为可能更多的使用方式还是这种更好些?

<nz-form-label [nzFormTooltip]="{ title: 'title', icon: 'info-circle'}">
  Label
</nz-form-label>

@danranVm
Copy link
Member Author

如果还有更复杂的需求的话,用户就不用这个 API ,完全自己手写好了。:eyes:

@hsuanxyz
Copy link
Member

@danranVm 现在看是只有一个 class,不过用对象的话 icon 本部分就没办法全局配置了,要不两个 @input

@danranVm
Copy link
Member Author

@hsuanxyz 好、那就在全局配置里加一个 tooltipIcon: string | { type: string, theme: sting } ?

👀, 是我 vue 写多了嘛?怎么老搞这种联合类型出来。

@hsuanxyz
Copy link
Member

@danranVm 😂 一个也行,只是 merge 的时候要多判断一下

@danranVm danranVm requested a review from wzhudev as a code owner October 24, 2020 08:57
@hsuanxyz hsuanxyz merged commit 4a00b69 into NG-ZORRO:master Oct 25, 2020
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.

[Form] item support tooltip
2 participants