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

refactor(module:date-picker): move class control to host #4207

Closed
wants to merge 3 commits into from

Conversation

wenqi73
Copy link
Member

@wenqi73 wenqi73 commented Sep 24, 2019

Close #1614

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] 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
[x] No

Other information

新增:

  • [nzStyle] 传递到内部 input,而不只是在外部 div。

@pr-triage pr-triage bot added the PR: draft label Sep 24, 2019
@auto-assign auto-assign bot requested a review from cipchk September 24, 2019 09:25
@netlify
Copy link

netlify bot commented Sep 24, 2019

Deploy preview for ng-zorro-master ready!

Built with commit a5b60ff

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

@wenqi73 wenqi73 force-pushed the date-picker-style1 branch from cf84758 to a95ece5 Compare October 12, 2019 08:14
@wenqi73 wenqi73 marked this pull request as ready for review October 12, 2019 08:19
@auto-assign auto-assign bot requested a review from wzhudev October 12, 2019 08:19
@wenqi73 wenqi73 requested review from hsuanxyz and removed request for cipchk and wzhudev October 12, 2019 08:19
@wenqi73 wenqi73 assigned hsuanxyz and unassigned cipchk Oct 12, 2019
@codecov
Copy link

codecov bot commented Oct 12, 2019

Codecov Report

Merging #4207 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4207      +/-   ##
=========================================
- Coverage   92.22%   92.2%   -0.02%     
=========================================
  Files         522     521       -1     
  Lines       11107   11018      -89     
  Branches     2018    1997      -21     
=========================================
- Hits        10243   10159      -84     
+ Misses        436     429       -7     
- Partials      428     430       +2
Impacted Files Coverage Δ
...omponents/date-picker/nz-month-picker.component.ts 100% <100%> (ø) ⬆️
components/date-picker/picker.component.ts 97.22% <100%> (-0.15%) ⬇️
components/date-picker/header-picker.component.ts 95.65% <100%> (ø) ⬆️
...omponents/date-picker/nz-range-picker.component.ts 100% <100%> (ø) ⬆️
components/date-picker/test-util.ts 100% <100%> (ø)
...ponents/date-picker/date-range-picker.component.ts 81.63% <100%> (ø) ⬆️
components/date-picker/nz-week-picker.component.ts 100% <100%> (ø) ⬆️
components/date-picker/nz-year-picker.component.ts 100% <100%> (ø) ⬆️
components/date-picker/nz-date-picker.component.ts 100% <100%> (ø) ⬆️
...omponents/date-picker/abstract-picker.component.ts 100% <100%> (ø) ⬆️
... and 70 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 3fed076...a5b60ff. Read the comment docs.

Comment on lines +1 to +28
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { DebugElement } from '@angular/core';
import { By } from '@angular/platform-browser';
import { NzPickerComponent } from './picker.component';

export function getPickerAbstract<T = HTMLElement>(debugElement: DebugElement): T {
return debugElement.query(By.css('.ant-calendar-picker')).nativeElement;
}

export function getPickerTrigger(debugElement: DebugElement): HTMLElement {
return debugElement.query(By.directive(NzPickerComponent)).nativeElement;
}

export function getPickerInput(debugElement: DebugElement): HTMLInputElement {
return debugElement.query(By.css('div .ant-calendar-picker-input')).nativeElement as HTMLInputElement;
}

export function getRangePickerLeftInput(debugElement: DebugElement): HTMLInputElement {
return debugElement.queryAll(By.css('div input.ant-calendar-range-picker-input'))[0]
.nativeElement as HTMLInputElement;
}
Copy link
Member

Choose a reason for hiding this comment

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

这个文件可以放到一个 testing 目录底下

@@ -168,6 +193,8 @@ export abstract class AbstractPickerComponent implements OnInit, OnChanges, OnDe
this.cdr.markForCheck();
}

updateHostClass(): void {}
Copy link
Member

Choose a reason for hiding this comment

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

空方法删掉?

Comment on lines +11 to +13
[ngClass]="nzClassName"
[style]="nzStyle"
[ngStyle]="pickerStyle"
Copy link
Member

Choose a reason for hiding this comment

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

者几个属性应该是在 host 上生效的,再确认一下 react 那边

Copy link
Member

Choose a reason for hiding this comment

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

可以考虑废弃掉,让用户直接使用 ngClassngStyle 或者原生属性。 不过可能会有 break change

Copy link
Member Author

Choose a reason for hiding this comment

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

是在 host 上生效的。

@wenqi73
Copy link
Member Author

wenqi73 commented Oct 21, 2019

@wendzhue @hsuanxyz 要不 9.0.0 合?DOM 结构变了对用 css 的用户来说确实有 break change。

@wenqi73 wenqi73 deleted the date-picker-style1 branch March 6, 2020 10:24
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.

Cant change width of nz-date-picker
4 participants