Skip to content

Commit

Permalink
fix(module:dropdown): fix dropdown change after checked bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vthinkxie authored and vthinkxie committed Jun 25, 2019
1 parent 9dfab45 commit 16d5c2d
Show file tree
Hide file tree
Showing 71 changed files with 76 additions and 151 deletions.
3 changes: 1 addition & 2 deletions components/avatar/demo/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const colorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae'];
<button nz-button [nzType]="'dashed'" (click)="change()" style="margin-left: 16px; vertical-align: middle;">
<span>Change</span>
</button>
`,
styles: []
`
})
export class NzDemoAvatarDynamicComponent {
text: string = userList[3];
Expand Down
3 changes: 1 addition & 2 deletions components/breadcrumb/demo/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Component } from '@angular/core';
An Application
</nz-breadcrumb-item>
</nz-breadcrumb>
`,
styles: []
`
})
export class NzDemoBreadcrumbBasicComponent {}
9 changes: 4 additions & 5 deletions components/breadcrumb/demo/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ import { Component } from '@angular/core';
</nz-breadcrumb>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item><a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">General</a></li>
<li nz-menu-item><a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">Layout</a></li>
<li nz-menu-item><a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">Navigation</a></li>
<li nz-menu-item>General</li>
<li nz-menu-item>Layout</li>
<li nz-menu-item>Navigation</li>
</ul>
</nz-dropdown-menu>
`,
styles: []
`
})
export class NzDemoBreadcrumbDropdownComponent {}
3 changes: 1 addition & 2 deletions components/breadcrumb/demo/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Component } from '@angular/core';
Breadcrumb
</nz-breadcrumb-item>
</nz-breadcrumb>
`,
styles: []
`
})
export class NzDemoBreadcrumbRouterComponent {}
3 changes: 1 addition & 2 deletions components/breadcrumb/demo/withIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Component } from '@angular/core';
Application
</nz-breadcrumb-item>
</nz-breadcrumb>
`,
styles: []
`
})
export class NzDemoBreadcrumbWithIconComponent {}
3 changes: 1 addition & 2 deletions components/collapse/demo/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { Component } from '@angular/core';
<p>{{ panel.name }} content</p>
</nz-collapse-panel>
</nz-collapse>
`,
styles: []
`
})
export class NzDemoCollapseAccordionComponent {
panels = [
Expand Down
3 changes: 1 addition & 2 deletions components/collapse/demo/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import { Component } from '@angular/core';
</p>
</nz-collapse-panel>
</nz-collapse>
`,
styles: []
`
})
export class NzDemoCollapseBasicComponent {
panels = [
Expand Down
3 changes: 1 addition & 2 deletions components/collapse/demo/borderless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { Component } from '@angular/core';
<p>{{ panel.name }} content</p>
</nz-collapse-panel>
</nz-collapse>
`,
styles: []
`
})
export class NzDemoCollapseBorderlessComponent {
panels = [
Expand Down
3 changes: 1 addition & 2 deletions components/collapse/demo/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import { Component } from '@angular/core';
</ng-template>
</nz-collapse-panel>
</nz-collapse>
`,
styles: []
`
})
export class NzDemoCollapseCustomComponent {
panels = [
Expand Down
3 changes: 1 addition & 2 deletions components/collapse/demo/extra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import { Component } from '@angular/core';
<ng-template #extraTpl>
<i nz-icon nzType="setting"></i>
</ng-template>
`,
styles: []
`
})
export class NzDemoCollapseExtraComponent {
panels = [
Expand Down
3 changes: 1 addition & 2 deletions components/collapse/demo/mix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import { Component } from '@angular/core';
</div>
</nz-collapse-panel>
</nz-collapse>
`,
styles: []
`
})
export class NzDemoCollapseMixComponent {
panels = [
Expand Down
3 changes: 1 addition & 2 deletions components/collapse/demo/noarrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { Component } from '@angular/core';
</p>
</nz-collapse-panel>
</nz-collapse>
`,
styles: []
`
})
export class NzDemoCollapseNoarrowComponent {
panels = [
Expand Down
3 changes: 1 addition & 2 deletions components/comment/demo/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import { distanceInWords } from 'date-fns';
</nz-form-item>
</nz-comment-content>
</nz-comment>
`,
styles: []
`
})
export class NzDemoCommentEditorComponent {
data: any[] = [];
Expand Down
3 changes: 1 addition & 2 deletions components/comment/demo/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import { addDays, distanceInWords } from 'date-fns';
</nz-comment>
</ng-template>
</nz-list>
`,
styles: []
`
})
export class NzDemoCommentListComponent {
data = [
Expand Down
3 changes: 1 addition & 2 deletions components/comment/demo/nested.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import { Component } from '@angular/core';
</ng-template>
<ng-template [ngTemplateOutlet]="commentTemplateRef" [ngTemplateOutletContext]="{ comment: data }"> </ng-template>
`,
styles: []
`
})
export class NzDemoCommentNestedComponent {
data = {
Expand Down
3 changes: 1 addition & 2 deletions components/drawer/nz-drawer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ describe('NzDrawerService', () => {
<p>Some contents...</p>
<p>Some contents...</p>
</nz-drawer>
`,
styles: []
`
})
class NzTestDrawerComponent {
visible = false;
Expand Down
3 changes: 1 addition & 2 deletions components/dropdown/demo/overlay-visible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import { Component } from '@angular/core';
<li nz-menu-item (click)="visible = false">Clicking me will close the menu</li>
</ul>
</nz-dropdown-menu>
`,
styles: []
`
})
export class NzDemoDropdownOverlayVisibleComponent {
visible = false;
Expand Down
3 changes: 1 addition & 2 deletions components/dropdown/demo/sub-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import { Component } from '@angular/core';
</li>
</ul>
</nz-dropdown-menu>
`,
styles: []
`
})
export class NzDemoDropdownSubMenuComponent {
change(value: boolean): void {
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/nz-dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ export class NzDropDownDirective implements AfterViewInit, OnDestroy, OnChanges
if (!this.dropdownOpen) {
const overlayRef = this.createOverlay();
const overlayConfig = overlayRef.getConfig();
this.nzDropdownMenu.setValue('open', true);
this.setPosition(overlayConfig.positionStrategy as FlexibleConnectedPositionStrategy);
overlayRef.attach(this.getPortal());
this.dropdownOpen = true;
this.nzDropdownMenu.setValue('open', true);
}
}

Expand Down
9 changes: 3 additions & 6 deletions components/dropdown/nz-dropdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ describe('dropdown-deprecated', () => {
</li>
</ul>
</nz-dropdown>
`,
styles: []
`
})
export class NzTestDropdownComponent {
@ViewChild(NzDropDownComponent, { static: false }) nzDropDownComponent: NzDropDownComponent;
Expand Down Expand Up @@ -498,8 +497,7 @@ export class NzTestDropdownComponent {
</ul>
</nz-dropdown-button>
<ng-template #iconTemp>Expand</ng-template>
`,
styles: []
`
})
export class NzTestDropdownButtonComponent {
@ViewChild(NzDropDownButtonComponent, { static: false }) nzDropDownButtonComponent: NzDropDownButtonComponent;
Expand Down Expand Up @@ -530,8 +528,7 @@ export class NzTestDropdownButtonComponent {
</li>
</ul>
</nz-dropdown>
`,
styles: []
`
})
export class NzTestDropdownWithButtonComponent {}

Expand Down
3 changes: 1 addition & 2 deletions components/empty/demo/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Component } from '@angular/core';
selector: 'nz-demo-empty-basic',
template: `
<nz-empty></nz-empty>
`,
styles: []
`
})
export class NzDemoEmptyBasicComponent {}
3 changes: 1 addition & 2 deletions components/empty/demo/customize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { Component } from '@angular/core';
<button nz-button nzType="primary" (click)="onClick()">Create Now</button>
</ng-template>
</nz-empty>
`,
styles: []
`
})
export class NzDemoEmptyCustomizeComponent {
onClick(): void {
Expand Down
1 change: 0 additions & 1 deletion components/form/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ The label of the form item, optional.
| `[nzRequired]`| add required style to current item | `boolean` | `false` |
| `[nzNoColon]`| whether to not display `:` after label text. | `boolean` | `false` |
| `[nzFor]`| The `for` property of `label` | `string` | - |
| `[nzColon]` | Used with `label`, whether to display `:` after label text. | `boolean` | `true` |

### nz-form-control
> Note:Due to the lack of partial Observable in [Angular Form](https://github.com/angular/angular/issues/10887), you have to notify `nz-form-control` to update its status with `updateValueAndValidity` when you update form status using methods like `markAsDirty`.
Expand Down
1 change: 0 additions & 1 deletion components/form/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ import { NzFormModule } from 'ng-zorro-antd/form';
| `[nzRequired]`| 当前项是否为必填,仅影响样式 | `boolean` | `false` |
| `[nzNoColon]`| 是否不显示 label 后面的冒号 | `boolean` | `false` |
| `[nzFor]`| label 标签的 for 属性 | `string` | - |
| `[nzColon]` | 配合 label 属性使用,表示是否显示 label 后面的冒号 | `boolean` | `true` |

### nz-form-control

Expand Down
3 changes: 1 addition & 2 deletions components/grid/demo/flex-align.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { Component } from '@angular/core';
<div nz-col nzSpan="4"><p class="height-80">col-4</p></div>
</div>
</div>
`,
styles: []
`
})
export class NzDemoGridFlexAlignComponent {}
3 changes: 1 addition & 2 deletions components/grid/demo/flex-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { Component, OnInit } from '@angular/core';
{{ i + 1 }} col-order-{{ order }}
</div>
</div>
`,
styles: []
`
})
export class NzDemoGridFlexOrderComponent implements OnInit {
orderList = [1, 2, 3, 4];
Expand Down
3 changes: 1 addition & 2 deletions components/grid/demo/offset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { Component } from '@angular/core';
col-12 col-offset-6
</div>
</div>
`,
styles: []
`
})
export class NzDemoGridOffsetComponent {}
3 changes: 1 addition & 2 deletions components/grid/demo/responsive-more.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Component } from '@angular/core';
Col
</div>
</div>
`,
styles: []
`
})
export class NzDemoGridResponsiveMoreComponent {}
3 changes: 1 addition & 2 deletions components/grid/demo/responsive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Component } from '@angular/core';
Col
</div>
</div>
`,
styles: []
`
})
export class NzDemoGridResponsiveComponent {}
3 changes: 1 addition & 2 deletions components/grid/demo/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Component } from '@angular/core';
col-6 col-pull-18
</div>
</div>
`,
styles: []
`
})
export class NzDemoGridSortComponent {}
4 changes: 1 addition & 3 deletions components/input/demo/textarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { Component } from '@angular/core';
selector: 'nz-demo-input-textarea',
template: `
<textarea rows="4" nz-input [(ngModel)]="inputValue"></textarea>
`,

styles: []
`
})
export class NzDemoInputTextareaComponent {
inputValue: string;
Expand Down
3 changes: 1 addition & 2 deletions components/menu/demo/recursive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ import { Component } from '@angular/core';
</ng-container>
</ng-template>
</ul>
`,
styles: []
`
})
export class NzDemoMenuRecursiveComponent {
mode = false;
Expand Down
3 changes: 1 addition & 2 deletions components/menu/demo/sider-current.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ import { Component } from '@angular/core';
</ul>
</li>
</ul>
`,
styles: []
`
})
export class NzDemoMenuSiderCurrentComponent {
openMap: { [name: string]: boolean } = {
Expand Down
6 changes: 2 additions & 4 deletions components/menu/nz-menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,7 @@ export class NzTestMenuHorizontalComponent {
</ul>
</li>
</ul>
`,
styles: []
`
})
export class NzTestMenuInlineComponent {
disabled = false;
Expand All @@ -592,8 +591,7 @@ export class NzTestMenuInlineComponent {
</ul>
</li>
</ul>
`,
styles: []
`
})
export class NzDemoMenuNgForComponent {
menus = [
Expand Down
3 changes: 1 addition & 2 deletions components/message/demo/close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { concatMap } from 'rxjs/operators';
selector: 'nz-demo-message-close',
template: `
<button nz-button [nzType]="'default'" (click)="startShowMessages()">Display a sequence of messages</button>
`,
styles: []
`
})
export class NzDemoMessageCloseComponent {
constructor(private message: NzMessageService) {}
Expand Down
3 changes: 1 addition & 2 deletions components/message/demo/duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { NzMessageService } from 'ng-zorro-antd';
selector: 'nz-demo-message-duration',
template: `
<button nz-button [nzType]="'default'" (click)="createBasicMessage()">Customized display duration</button>
`,
styles: []
`
})
export class NzDemoMessageDurationComponent {
createBasicMessage(): void {
Expand Down
3 changes: 1 addition & 2 deletions components/message/demo/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { NzMessageService } from 'ng-zorro-antd';
selector: 'nz-demo-message-info',
template: `
<button nz-button [nzType]="'primary'" (click)="createBasicMessage()">Display normal message</button>
`,
styles: []
`
})
export class NzDemoMessageInfoComponent {
constructor(private message: NzMessageService) {}
Expand Down
Loading

0 comments on commit 16d5c2d

Please sign in to comment.