-
Notifications
You must be signed in to change notification settings - Fork 4k
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: modal): support nzMask
and nzMaskClosable
global config
#3033
feat(module: modal): support nzMask
and nzMaskClosable
global config
#3033
Conversation
support global config `nzMask` and `nzMaskClosable`
(NG-ZORRO#1594) support global config `nzMask` and `nzMaskClosable`
Modal support `nzMask` and `nzMaskClosable` global configuration
nzMask
and nzMaskClosable
global config (#1594)
Deploy preview for ng-zorro-master ready! Built with commit 86858f1 |
Codecov Report
@@ Coverage Diff @@
## master #3033 +/- ##
==========================================
+ Coverage 97.37% 97.37% +<.01%
==========================================
Files 559 559
Lines 11627 11630 +3
Branches 835 837 +2
==========================================
+ Hits 11322 11325 +3
Misses 193 193
Partials 112 112
Continue to review full report at Codecov.
|
@@ -80,6 +80,38 @@ export class NzModalComponent<T = any, R = any> extends NzModalRef<T, R> impleme | |||
@Input() nzIconType: string = 'question-circle'; // Confirm Modal ONLY | |||
@Input() nzModalType: ModalType = 'default'; | |||
|
|||
@Input() @InputBoolean() | |||
get nzMask(): 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.
三个层级配置,就用三个不同变量对应,最后在用第四个变量来表示最终值,如:
get finalMask() {
if (this.nzMask != null) {
return this.nzMask;
} else if (this.modalConfig.nzMask) {
return this.modalConfig.nzMask
} else ...
}
nzMask
and nzMaskClosable
global config (#1594)nzMask
and nzMaskClosable
global config
nzMask
and nzMaskClosable
global confignzMask
and nzMaskClosable
global config
@@ -113,6 +132,34 @@ export class NzModalComponent<T = any, R = any> extends NzModalRef<T, R> | |||
return !this.nzVisible && !this.animationState; | |||
} // Indicate whether this dialog should hidden | |||
|
|||
/** the calculated highest weight of mask value |
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.
注释的格式,以及大小写,需要规范调整下
} | ||
|
||
set nzMask(value: boolean) { | ||
this._nzMask = value; |
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.
这个_nzMask
是干嘛用的?
…z/ng-zorro-antd into feat/modal-support-global-config
@@ -125,6 +160,7 @@ export class NzModalComponent<T = any, R = any> extends NzModalRef<T, R> | |||
private previouslyFocusedElement: HTMLElement; | |||
private focusTrap: FocusTrap; | |||
private scrollStrategy: BlockScrollStrategy; | |||
private nzModalGlobalConfig: NzModalConfig; |
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处即可,Optional() @Inject(NZ_MODAL_CONFIG) private nzModalGlobalConfig: NzModalConfig
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: #1594
What is the new behavior?
Modal Module support global configuration which cover the default value of component
Does this PR introduce a breaking change?
Other information