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
Conversation
This preview will be available after the AzureCI is passed. |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
868e7c6
to
066f1cb
Compare
components/popconfirm/popconfirm.ts
Outdated
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Input('nzPopconfirmBackDrop') hasBackdrop?: boolean; | |
@Input() @WithConfig() nzPopconfirmBackdrop?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor 需要传 NzConfigService
components/popconfirm/popconfirm.ts
Outdated
protected updateConfig(): void { | ||
this.config = { | ||
...NZ_POPCONFIRM_DEFAULT_CONFIG, | ||
...this.nzConfigService?.getConfigForComponent('popconfirm') | ||
}; | ||
const { nzPopconfirmBackdrop } = this.config; | ||
this.hasBackdrop = this.hasBackdrop === undefined ? nzPopconfirmBackdrop : false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 { | |||
}; |
There was a problem hiding this comment.
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]
};
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time-picker 也加一下
066f1cb
to
ce7d35b
Compare
ce7d35b
to
57da6f0
Compare
6ee51a7
to
ccd9ea8
Compare
ccd9ea8
to
9186f6e
Compare
@@ -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` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `[nzPopconfirmBackdrop]` | whether or not the overlay should attach a backdrop | `boolean` | `false` | |
9186f6e
to
78a229d
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information