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: all): global config for backdrop #6380

Merged
merged 3 commits into from Mar 22, 2021

Conversation

tirelyl
Copy link
Contributor

@tirelyl tirelyl commented Jan 26, 2021

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 Jan 26, 2021

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jan 26, 2021

Codecov Report

Merging #6380 (dabe04c) into master (85ea273) will increase coverage by 0.10%.
The diff coverage is 95.77%.

❗ Current head dabe04c differs from pull request most recent head 78a229d. Consider uploading reports for the commit 78a229d to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6380      +/-   ##
==========================================
+ Coverage   89.82%   89.92%   +0.10%     
==========================================
  Files         478      479       +1     
  Lines       15314    15360      +46     
  Branches     2475     2339     -136     
==========================================
+ Hits        13756    13813      +57     
+ Misses        940      928      -12     
- Partials      618      619       +1     
Impacted Files Coverage Δ
components/core/config/config.ts 100.00% <ø> (ø)
components/core/time/candy-date.ts 86.57% <ø> (+2.26%) ⬆️
components/descriptions/descriptions.component.ts 100.00% <ø> (ø)
components/i18n/date-helper.service.ts 90.90% <ø> (ø)
components/pagination/pagination-item.component.ts 100.00% <ø> (ø)
components/rate/rate.component.ts 96.03% <ø> (ø)
components/space/space.module.ts 100.00% <ø> (ø)
components/select/select.component.ts 87.09% <50.00%> (-0.49%) ⬇️
components/dropdown/dropdown.directive.ts 88.57% <85.71%> (-0.21%) ⬇️
...ts/auto-complete/autocomplete-trigger.directive.ts 95.83% <100.00%> (+0.15%) ⬆️
... and 21 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 85ea273...78a229d. Read the comment docs.

@@ -54,6 +59,7 @@ export class NzPopconfirmDirective extends NzTooltipBaseDirective {
@Input('nzPopconfirmOverlayClassName') overlayClassName?: string;
@Input('nzPopconfirmOverlayStyle') overlayStyle?: NgStyleInterface;
@Input('nzPopconfirmVisible') visible?: boolean;
@Input('nzPopconfirmBackDrop') hasBackdrop?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@Input('nzPopconfirmBackDrop') hasBackdrop?: boolean;
@Input() @WithConfig() nzPopconfirmBackdrop?: boolean;

Copy link
Member

Choose a reason for hiding this comment

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

constructor 需要传 NzConfigService

Comment on lines 91 to 99
protected updateConfig(): void {
this.config = {
...NZ_POPCONFIRM_DEFAULT_CONFIG,
...this.nzConfigService?.getConfigForComponent('popconfirm')
};
const { nzPopconfirmBackdrop } = this.config;
this.hasBackdrop = this.hasBackdrop === undefined ? nzPopconfirmBackdrop : false;
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
protected updateConfig(): void {
this.config = {
...NZ_POPCONFIRM_DEFAULT_CONFIG,
...this.nzConfigService?.getConfigForComponent('popconfirm')
};
const { nzPopconfirmBackdrop } = this.config;
this.hasBackdrop = this.hasBackdrop === undefined ? nzPopconfirmBackdrop : false;
}

@@ -82,6 +88,15 @@ export class NzPopconfirmDirective extends NzTooltipBaseDirective {
};
Copy link
Member

Choose a reason for hiding this comment

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

getProxyPropertyMap(): PropertyMapping {
  return {
    ...
    hasBackdrop: ['nzBackdrop', () => this.nzPopconfirmBackdrop]
  };
}

Copy link
Member

@wenqi73 wenqi73 left a comment

Choose a reason for hiding this comment

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

time-picker 也加一下

@tirelyl tirelyl changed the title feat: backdrop global config feat(module: all): global config for backdrop Jan 31, 2021
@tirelyl tirelyl force-pushed the feat/backdrop-global-config branch from 6ee51a7 to ccd9ea8 Compare March 3, 2021 07:13
@tirelyl tirelyl force-pushed the feat/backdrop-global-config branch from ccd9ea8 to 9186f6e Compare March 4, 2021 01:53
@@ -38,6 +38,8 @@ import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';
| `[nzPopconfirmMouseLeaveDelay]` | 鼠标移出后延时多少才隐藏确认框,单位:秒 | `number` | `0.1` |
| `[nzPopconfirmOverlayClassName]` | 卡片类名 | `string` | - |
| `[nzPopconfirmOverlayStyle]` | 卡片样式 | `object` | - |
| `[nzPopconfirmBackdrop]` | 浮层是否应带有背景板 | `boolean` | `false` |
| `[nzPopconfirmBackdrop]` | whether or not the overlay should attach a backdrop | `boolean` | `false` |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| `[nzPopconfirmBackdrop]` | whether or not the overlay should attach a backdrop | `boolean` | `false` |

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.

None yet

3 participants