Skip to content

Commit

Permalink
feat(module:select): rebase master and resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-yangy committed Mar 28, 2019
2 parents c5f53d5 + b6cf8fe commit 6f583b1
Show file tree
Hide file tree
Showing 861 changed files with 19,494 additions and 15,078 deletions.
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/*.md
**/*.svg
**/*.html
**/test.ts
**/*.less
coverage/
publish/
site/
package.json
**/template/*
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
]
}
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
# [7.2.0](https://github.com/NG-ZORRO/ng-zorro-antd/compare/7.1.0...7.2.0) (2019-03-27)


### Bug Fixes

* **affix:** set correct style of Affix after trigger resize ([#3089](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3089)) ([ff482e0](https://github.com/NG-ZORRO/ng-zorro-antd/commit/ff482e0)), closes [#3040](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3040)
* fix type of some API ([#3166](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3166)) ([c685836](https://github.com/NG-ZORRO/ng-zorro-antd/commit/c685836))
* **breadcrumb:** fix auto generate not working in lazy modules ([#3174](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3174)) ([4260a40](https://github.com/NG-ZORRO/ng-zorro-antd/commit/4260a40)), closes [#2538](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2538)
* **dropdown:** fix the style of CDK conflicts ([#3133](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3133)) ([a9cd84d](https://github.com/NG-ZORRO/ng-zorro-antd/commit/a9cd84d)), closes [#3075](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3075)
* **progress:** should not set success when success percent is … ([#3135](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3135)) ([f85c766](https://github.com/NG-ZORRO/ng-zorro-antd/commit/f85c766))
* **transfer:** fix invalid trigger checked event in blank area ([#3161](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3161)) ([92097b2](https://github.com/NG-ZORRO/ng-zorro-antd/commit/92097b2)), closes [#3160](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3160) [#3159](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3159)
* **upload:** fix missing remove event when type is drag ([#3114](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3114)) ([2b1fdd9](https://github.com/NG-ZORRO/ng-zorro-antd/commit/2b1fdd9)), closes [#3034](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3034) [#3139](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3139) [#3171](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3171)


### Features

* **collapse:** support `nzExtra` ([#3177](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3177)) ([fbfb4da](https://github.com/NG-ZORRO/ng-zorro-antd/commit/fbfb4da))
* **menu:** support `nzMenuClassName` for the submenu ([#3176](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3176)) ([15b6724](https://github.com/NG-ZORRO/ng-zorro-antd/commit/15b6724))
* **page-header:** add page-header component ([#2732](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2732)) ([cf51c1f](https://github.com/NG-ZORRO/ng-zorro-antd/commit/cf51c1f)), closes [#2710](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2710)
* **schematics:** do not set boot page when the target file is modified ([#3178](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3178)) ([0a3f62c](https://github.com/NG-ZORRO/ng-zorro-antd/commit/0a3f62c))



# [7.1.0](https://github.com/NG-ZORRO/ng-zorro-antd/compare/7.0.3...7.1.0) (2019-03-21)


### Bug Fixes

* **tree:** fix nzMultiple and rollback code ([#3060](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3060)) ([c917938](https://github.com/NG-ZORRO/ng-zorro-antd/commit/c917938)), closes [#3076](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3076)
* **cascader:** fix columns not dropped ([#3037](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3037)) ([72a9e67](https://github.com/NG-ZORRO/ng-zorro-antd/commit/72a9e67)), closes [#3034](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3034)
* **date-picker:** export `year-picker` component ([#3125](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3125)) ([c5b0af9](https://github.com/NG-ZORRO/ng-zorro-antd/commit/c5b0af9))
* **modal:** integrate with tabs and autosize ([#3065](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3065)) ([4cab26f](https://github.com/NG-ZORRO/ng-zorro-antd/commit/4cab26f)), closes [#2286](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2286) [#2713](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2713)
* **modal:** simple confirm should not have cancel button ([#3115](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3115)) ([f0a2b51](https://github.com/NG-ZORRO/ng-zorro-antd/commit/f0a2b51)), closes [#3107](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3107)
* **tooltip:** fix tooltip not render after set ([#3091](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3091)) ([2841a2f](https://github.com/NG-ZORRO/ng-zorro-antd/commit/2841a2f))


### Features

* **message:** support `nzTop` ([#3047](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3047)) ([351135b](https://github.com/NG-ZORRO/ng-zorro-antd/commit/351135b)), closes [#3041](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3041)
* **message:** support template ([#3102](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3102)) ([d3f6655](https://github.com/NG-ZORRO/ng-zorro-antd/commit/d3f6655)), closes [#3081](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3081)



## [7.0.3](https://github.com/NG-ZORRO/ng-zorro-antd/compare/7.0.2...7.0.3) (2019-03-14)


### Bug Fixes

* **select:** fix select init touched state error when disabled ([#3084](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3084)) ([ba9d454](https://github.com/NG-ZORRO/ng-zorro-antd/commit/ba9d454)), closes [#3059](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3059)

### Build

* **build:** add strictNullCheck config ([#2126](https://github.com/NG-ZORRO/ng-zorro-antd/pull/2977))
* **build:** upgrade icon to 2.0.2 ([#3085](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3085)) ([fc72d7d](https://github.com/NG-ZORRO/ng-zorro-antd/commit/fc72d7d))


## [7.0.2](https://github.com/NG-ZORRO/ng-zorro-antd/compare/7.0.1...7.0.2) (2019-03-11)


### Bug Fixes

* **pagination:** fix pagination bug ([#3067](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3067)) ([f4948d7](https://github.com/NG-ZORRO/ng-zorro-antd/commit/f4948d7)), closes [#3049](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3049)
* **steps:** fix steps state change error under onpus strategy ([#3061](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3061)) ([97adb2c](https://github.com/NG-ZORRO/ng-zorro-antd/commit/97adb2c))
* **table:** fix table small size virtual scroll style ([#3063](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3063)) ([4fa16de](https://github.com/NG-ZORRO/ng-zorro-antd/commit/4fa16de)), closes [#3050](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3050)
* **table:** fix th check not trigger bug ([#3064](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3064)) ([dbc33ae](https://github.com/NG-ZORRO/ng-zorro-antd/commit/dbc33ae)), closes [#3028](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3028) [#3056](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3056) [#3058](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3058)
* **transfer:** fix click checkbox can't trigger selection ([#3030](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3030)) ([f077294](https://github.com/NG-ZORRO/ng-zorro-antd/commit/f077294)), closes [#3026](https://github.com/NG-ZORRO/ng-zorro-antd/issues/3026)



## [7.0.1](https://github.com/NG-ZORRO/ng-zorro-antd/compare/7.0.0...7.0.1) (2019-03-04)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class AppModule {
}
```

> `@angular/cli` users won't have to worried about things below but it's good to know.
> `@angular/cli` users won't have to worry about the things below but it's good to know.
And import style and SVG icon assets file link in `angular.json`.

Expand Down
61 changes: 26 additions & 35 deletions components/affix/affix.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { Component, DebugElement, ViewChild } from '@angular/core';
import {
discardPeriodicTasks,
fakeAsync,
tick,
ComponentFixture,
TestBed
} from '@angular/core/testing';
import { discardPeriodicTasks, fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { NzScrollService } from '../core/scroll/nz-scroll.service';
Expand Down Expand Up @@ -241,7 +235,7 @@ describe('affix', () => {
setupInitialState();
emitScroll(target, 5000);
const wrapEl = componentObject.wrap();
expect(+wrapEl.style.bottom.replace('px', '')).toBe(0);
expect(+wrapEl.style.bottom!.replace('px', '')).toBe(0);

discardPeriodicTasks();
}));
Expand All @@ -259,7 +253,7 @@ describe('affix', () => {
setupInitialState();
emitScroll(target, 0);
const wrapEl = componentObject.wrap();
expect(+wrapEl.style.bottom.replace('px', '')).toBeGreaterThan(0);
expect(+wrapEl.style.bottom!.replace('px', '')).toBeGreaterThan(0);

discardPeriodicTasks();
}));
Expand All @@ -270,7 +264,7 @@ describe('affix', () => {
setupInitialState();
emitScroll(target, 5000);
const wrapEl = componentObject.wrap();
expect(+wrapEl.style.bottom.replace('px', '')).toBe(0);
expect(+wrapEl.style.bottom!.replace('px', '')).toBe(0);

discardPeriodicTasks();
}));
Expand Down Expand Up @@ -339,9 +333,9 @@ describe('affix', () => {
});

describe('(nzChange)', () => {
let changeValue;
let changeValue: boolean;
beforeEach(() => {
component.nzChange.subscribe((returnValue) => {
component.nzChange.subscribe((returnValue: boolean) => {
changeValue = returnValue;
});
});
Expand Down Expand Up @@ -373,8 +367,8 @@ describe('affix', () => {
constructor() {
spyOn(component, 'getOffset').and.callFake(this.getOffset.bind(this));
spyOn(scrollService, 'getScroll').and.callFake(this.getScroll.bind(this));
this.offsets = { 'undefined': { top: 10, left: 0, height: 0, width: 0 } };
this.scrolls = { 'undefined': { top: 10, left: 0 } };
this.offsets = { undefined: { top: 10, left: 0, height: 0, width: 0 } };
this.scrolls = { undefined: { top: 10, left: 0 } };
}

getScroll(el?: Element | Window, top: boolean = true): number {
Expand All @@ -392,7 +386,7 @@ describe('affix', () => {

emitScroll(el: Element | Window, top: number, left: number = 0): void {
this.scrolls[this.getKey(el)] = { top, left };
this.emitEvent((el || window), scrollEvent);
this.emitEvent(el || window, scrollEvent);
}

offsetTo(el: Element, offset: Offset): void {
Expand All @@ -405,15 +399,12 @@ describe('affix', () => {
}

offsetYTo(el: Element, offsetTop: number): void {
this.offsetTo(
el,
{
top: offsetTop,
left: 0,
height,
width
}
);
this.offsetTo(el, {
top: offsetTop,
left: 0,
height,
width
});
}

content(): HTMLElement {
Expand All @@ -432,7 +423,7 @@ describe('affix', () => {
return debugElement.query(By.css('#target')).nativeElement;
}

private getKey(el: Element | Window): string {
private getKey(el?: Element | Window): string {
let key: string;
if (el instanceof Window) {
key = 'window';
Expand Down Expand Up @@ -476,7 +467,10 @@ describe('affix-extra', () => {
dl = fixture.debugElement;
});
it('#getOffset', () => {
const ret = fixture.componentInstance.nzAffixComponent.getOffset(fixture.debugElement.query(By.css('#affix')).nativeElement, window);
const ret = fixture.componentInstance.nzAffixComponent.getOffset(
fixture.debugElement.query(By.css('#affix')).nativeElement,
window
);
expect(ret).not.toBeUndefined();
});
it('with window when scrolled below the bottom offset', fakeAsync(() => {
Expand All @@ -497,26 +491,23 @@ describe('affix-extra', () => {
window.dispatchEvent(new Event('scroll'));
tick(30);
fixture.detectChanges();
const ret = +(el.querySelector('.ant-affix') as HTMLElement).style.bottom.replace('px', '');
const ret = +(el.querySelector('.ant-affix') as HTMLElement).style.bottom!.replace('px', '');
expect(ret).toBe(value);
}));
});

@Component({
template: `
<nz-affix id="affix"
[nzTarget]="fakeTarget"
[nzOffsetTop]="newOffset"
[nzOffsetBottom]="newOffsetBottom">
<button id="content">Affix Button</button>
</nz-affix>
<div id="target"></div>
<nz-affix id="affix" [nzTarget]="fakeTarget" [nzOffsetTop]="newOffset" [nzOffsetBottom]="newOffsetBottom">
<button id="content">Affix Button</button>
</nz-affix>
<div id="target"></div>
`
})
class TestAffixComponent {
@ViewChild(NzAffixComponent)
nzAffixComponent: NzAffixComponent;
fakeTarget: string | Element | Window = null;
fakeTarget: string | Element | Window | null = null;
newOffset: {};
newOffsetBottom: {};
}
29 changes: 14 additions & 15 deletions components/affix/demo/basic.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { Component } from '@angular/core';

@Component({
selector : 'nz-demo-affix-basic',
template : `
<nz-affix>
<button nz-button [nzType]="'primary'">
<span>Affix top</span>
</button>
</nz-affix>
<br>
<nz-affix nzOffsetBottom="0">
<button nz-button [nzType]="'primary'">
<span>Affix bottom</span>
</button>
</nz-affix>
selector: 'nz-demo-affix-basic',
template: `
<nz-affix>
<button nz-button [nzType]="'primary'">
<span>Affix top</span>
</button>
</nz-affix>
<br />
<nz-affix nzOffsetBottom="0">
<button nz-button [nzType]="'primary'">
<span>Affix bottom</span>
</button>
</nz-affix>
`
})
export class NzDemoAffixBasicComponent {
}
export class NzDemoAffixBasicComponent {}
8 changes: 4 additions & 4 deletions components/affix/demo/on-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Component } from '@angular/core';
@Component({
selector: 'nz-demo-affix-on-change',
template: `
<nz-affix [nzOffsetTop]="120" (nzChange)="onChange($event)">
<button nz-button>
<nz-affix [nzOffsetTop]="120" (nzChange)="onChange($event)">
<button nz-button>
<span>120px to affix top</span>
</button>
</nz-affix>
</button>
</nz-affix>
`
})
export class NzDemoAffixOnChangeComponent {
Expand Down
40 changes: 21 additions & 19 deletions components/affix/demo/target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@ import { Component } from '@angular/core';
@Component({
selector: 'nz-demo-affix-target',
template: `
<div class="scrollable-container" #target>
<div class="background">
<nz-affix [nzTarget]="target" id="affix-container-target">
<button nz-button [nzType]="'primary'">
<div class="scrollable-container" #target>
<div class="background">
<nz-affix [nzTarget]="target" id="affix-container-target">
<button nz-button [nzType]="'primary'">
<span>Fixed at the top of container</span>
</button>
</nz-affix>
</button>
</nz-affix>
</div>
</div>
</div>
`,
styles: [`
.scrollable-container {
height: 100px;
overflow-y: scroll;
}
styles: [
`
.scrollable-container {
height: 100px;
overflow-y: scroll;
}
.background {
padding-top: 60px;
height: 300px;
background-image: url(//zos.alipayobjects.com/rmsportal/RmjwQiJorKyobvI.jpg);
}
`]
.background {
padding-top: 60px;
height: 300px;
background-image: url(//zos.alipayobjects.com/rmsportal/RmjwQiJorKyobvI.jpg);
}
`
]
})
export class NzDemoAffixTargetComponent { }
export class NzDemoAffixTargetComponent {}
Loading

0 comments on commit 6f583b1

Please sign in to comment.