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: modal): support nzMask and nzMaskClosable global config #3033

Merged
merged 14 commits into from
Apr 18, 2019

Conversation

kekehaoz
Copy link
Contributor

@kekehaoz kekehaoz commented Mar 6, 2019

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: #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?

[ ] Yes
[x] No

Other information

@kekehaoz kekehaoz changed the title Feat/modal support global config feat(module: modal) support nzMask and nzMaskClosable global config (#1594) Mar 6, 2019
@kekehaoz kekehaoz requested a review from wilsoncook March 6, 2019 12:03
@netlify
Copy link

netlify bot commented Mar 6, 2019

Deploy preview for ng-zorro-master ready!

Built with commit 86858f1

https://deploy-preview-3033--ng-zorro-master.netlify.com

@codecov
Copy link

codecov bot commented Mar 6, 2019

Codecov Report

Merging #3033 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
components/modal/nz-modal.component.ts 99.04% <100%> (+0.02%) ⬆️
components/modal/nz-modal-config.ts 100% <100%> (ø) ⬆️

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 51c0d53...86858f1. Read the comment docs.

@@ -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 {
Copy link
Member

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 ...
  }

@kekehaoz kekehaoz changed the title feat(module: modal) support nzMask and nzMaskClosable global config (#1594) feat(module: modal) support nzMask and nzMaskClosable global config Mar 27, 2019
@kekehaoz kekehaoz changed the title feat(module: modal) support nzMask and nzMaskClosable global config feat(module: modal): support nzMask and nzMaskClosable global config Mar 27, 2019
@@ -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
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

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

这个_nzMask是干嘛用的?

@@ -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;
Copy link
Member

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

hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants