From 0ff1864e1101a60bf8964c30060319aa29e01f48 Mon Sep 17 00:00:00 2001 From: vthinkxie Date: Fri, 30 Nov 2018 17:43:44 +0800 Subject: [PATCH] refactor: merge next to master (#2563) * docs: update NG-ZORRO logo (#2425) * fix(module:collapse): can't fold up active panel with accordion (#2440) close #2437 * chore: update styles(ant-design 3.10.7) (#2432) * chore: update styles(ant-design 3.10.8) (#2475) * feat: Adds danish locale (#2486) close #2485 * fix(module:menu): fix dropdown menu item selected className (#2434) close #2433 * fix(module:list): fix invalid render empty style when unspecified data source (#2415) close #2385 * docs(module:modal): add missing nzClassName property (#2400) * docs: add faq in icons docs (#2459) * fix(module:menu): fix fold menu (#2454) close #2449 * refactor(module:all): use cdk keycodes instead of magic number (#2499) * release(1.8.1): release 1.8.1 (#2523) * chore: update styles(ant-design 3.10.9) (#2525) * fix(readme): fix misspelling (#2472) * refactor(module:all): support Angular 7.0 (#2372) * refactor(module:all): refactor component to support onPush & SSR * refactor(module:badge): refactor badge * refactor(module:button & card): refactor * test(module:button): fix test case * fix(module:avatar): fix avatar * fix(module:tree): fix tree tslint * fix(module:tree): fix tree module * fix(module:all): fix tslint config * refactor(module:all): upgrade to angular 7.0 * fix(module:all): fix typescript error * fix(module:build): fix build less options * fix(module:integration): fix webpack test * build: rm unused package * build: fix build & ci * test(module:spin): fix test error * docs: update readme * refactor(module:checkbox): support checkbox onPush (#2478) * docs: update NG-ZORRO logo (#2425) * fix(module:collapse): can't fold up active panel with accordion (#2440) close #2437 * chore: update styles(ant-design 3.10.7) (#2432) * refactor(module:checkbox): support checkbox onPush * refactor(module:collapse): support onPush in collapse (#2481) * refactor(module:divider): refactor divider (#2482) ref #2381 * refactor(module:form): refactor form (#2493) * refactor(module:grid): refactor grid module (#2498) * refactor(module:layout): refactor layout (#2500) * feat(module:progress): support custom strokeColor and strokeLinecap (#2404) close #2378 * feat(module:avatar): support custom size (#2416) close #2380 * fix(module:timeline): fix loading icon (#2386) close #2377 * feat(module:drawer): add input property in NzDrawerRef (#2464) close #2403 * refactor(module:radio): refactor radio to support OnPush (#2519) * refactor(module:spin): refactor spin (#2530) * refactor(module:alert & card): refactor card & refactor template outlet (#2532) * refactor(module:switch & checkbox): refactor switch & checkbox (#2533) * refactor(module:core): refactor input convert decorators (#2535) ref #2474 * refactor(module:mention): refactor mention (#2510) ref: #2381 * refactor(module:steps): refactor steps (#2512) ref #2381 * feat(module:modal): support clicking ESC to close modal (#2483) close #1999 * refactor(module:breadcrumb): refactor breadcrumb (#2513) ref #2381 * refactor(module:skeleton): refactor skeleton (#2514) ref #2381 * refactor(module:icon): refactor icon (#2517) ref #2381 * refactor(module:tree-select): refactor tree-select (#2528) ref: #2381 * build: bump webpack integration (#2524) build: bump webpack integration * refactor(module:timeline): refactor timeline (#2515) close #2379 * support alternate positions, alternate and right alternate * support reversing * refactor(module:autocomplete): refactor autocomplete (#2505) ref #2381, close #2420 * refactor(module:cascader): refactor cascader (#2516) * refactor(module:cascader): refactor cascader close #2935 ref #2198 * fix(module:cascader): fix isFocused access * refactor(module:avatar): refactor avatar (#2536) * fix(module:avatar): fix text style * refactor(module:avatar): refactor avatar ref: #2381 * refactor(module:upload): refactor upload (#2555) * refactor(module:upload): refactor upload - feat: add `nzOpenFileDialogOnClick` prop to allow setting whether to open the upload dialog when the component is clicked * chore: add encapsulation:ViewEncapsulation.None ref #2381 * refactor(module:list): refactor list (#2548) * refactor(module:list): refactor list * fix: import scrolling in share module * chore: add encapsulation:ViewEncapsulation.None ref #2381 * refactor(module:transfer): refactor transfer (#2553) * refactor(module:transfer): refactor transfer - feat: add nzDisabled property - need verify design details, https://github.com/ant-design/ant-design/issues/13330 * chore: search muse be disabled * chore: add encapsulation:ViewEncapsulation.None ref #2381 * refactor(module:back-top): refactor back-top (#2547) refactor(module:back-top): refactor back-top * refactor(module:anchor): refactor anchor (#2546) * refactor(module:anchor): refactor anchor - feat: the nzTarget support string value - fix: invalid id in demo * chore: add encapsulation:ViewEncapsulation.None * chore: add encapsulation:ViewEncapsulation.None * chore: fix display style in host * chore: remove :host ref #2381 * refactor(module:affix): refactor affix (#2544) * refactor(module:affix): refactor affix - the nzTarget support string value * fix: release * style: removed no-any in first line * fix: fix style * chore: fix test * chore: fix display style in host * chore: remove :host --- CHANGELOG.md | 18 ++++++++ README-zh_CN.md | 2 +- README.md | 2 +- components/carousel/nz-carousel.component.ts | 5 +- components/carousel/nz-carousel.spec.ts | 9 ++-- components/carousel/style/index.less | 8 ++++ components/checkbox/style/mixin.less | 2 +- components/dropdown/nz-dropdown.spec.ts | 11 ++++- components/i18n/languages/da_DK.ts | 44 ++++++++++++++++++ .../i18n/languages/date-picker/da_DK.ts | 19 ++++++++ .../i18n/languages/time-picker/da_DK.ts | 6 +++ components/icon/doc/index.en-US.md | 38 ++++++++++++++- components/icon/doc/index.zh-CN.md | 46 +++++++++++++++++-- .../input-number/nz-input-number.component.ts | 5 +- components/input/nz-input.spec.ts | 3 +- components/menu/nz-menu-item.directive.ts | 17 +++++-- components/menu/nz-submenu.component.html | 8 ++-- components/modal/doc/index.en-US.md | 1 + components/modal/doc/index.zh-CN.md | 1 + components/package.json | 2 +- components/rate/nz-rate.component.ts | 5 +- .../select/nz-option-container.component.ts | 9 ++-- components/select/nz-option-container.spec.ts | 31 +++++++------ .../select/nz-select-top-control.spec.ts | 5 +- components/select/nz-select.spec.ts | 10 ++-- components/style/themes/default.less | 1 + components/switch/nz-switch.spec.ts | 13 +++--- components/switch/style/index.less | 5 +- components/time-picker/style/index.less | 1 + components/upload/nz-upload-btn.component.ts | 3 +- docs/changelog.en-US.md | 18 ++++++++ docs/changelog.zh-CN.md | 18 ++++++++ scripts/site/_site/src/app/app.component.ts | 2 +- 33 files changed, 303 insertions(+), 65 deletions(-) create mode 100644 components/i18n/languages/da_DK.ts create mode 100644 components/i18n/languages/date-picker/da_DK.ts create mode 100644 components/i18n/languages/time-picker/da_DK.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 262ae5b0f22..3347019fbc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ + +## [1.8.1](https://github.com/NG-ZORRO/ng-zorro-antd/compare/1.8.0...1.8.1) (2018-11-24) + + +### Bug Fixes + +* **collapse:** can't fold up active panel with accordion ([#2440](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2440)) ([a17ea49](https://github.com/NG-ZORRO/ng-zorro-antd/commit/a17ea49)), closes [#2437](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2437) +* **list:** fix invalid render empty style when unspecified data source ([#2415](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2415)) ([7ae325f](https://github.com/NG-ZORRO/ng-zorro-antd/commit/7ae325f)), closes [#2385](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2385) +* **menu:** fix dropdown menu item selected className ([#2434](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2434)) ([e6e2369](https://github.com/NG-ZORRO/ng-zorro-antd/commit/e6e2369)), closes [#2433](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2433) +* **menu:** fix fold menu ([#2454](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2454)) ([e41640a](https://github.com/NG-ZORRO/ng-zorro-antd/commit/e41640a)), closes [#2449](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2449) + + +### Features + +* Adds danish locale ([#2486](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2486)) ([811a009](https://github.com/NG-ZORRO/ng-zorro-antd/commit/811a009)), closes [#2485](https://github.com/NG-ZORRO/ng-zorro-antd/issues/2485) + + + # [1.8.0](https://github.com/NG-ZORRO/ng-zorro-antd/compare/1.7.1...1.8.0) (2018-10-26) diff --git a/README-zh_CN.md b/README-zh_CN.md index 5cec495763e..7ba3eb34ad0 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -70,7 +70,7 @@ $ ng add ng-zorro-antd 在每一个需要使用组件的 module 中引入 `NgZorroAntdModule`。 ```ts -import { NgZorroAntModule } from 'ng-zorro-antd'; +import { NgZorroAntdModule } from 'ng-zorro-antd'; @NgModule({ imports: [ NgZorroAntdModule ] diff --git a/README.md b/README.md index 5e35a3cfeaf..736307f4949 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ $ npm install ng-zorro-antd Import the module into every module where you want to use the components. ```ts -import { NgZorroAntModule } from 'ng-zorro-antd'; +import { NgZorroAntdModule } from 'ng-zorro-antd'; @NgModule({ imports: [ NgZorroAntdModule ] diff --git a/components/carousel/nz-carousel.component.ts b/components/carousel/nz-carousel.component.ts index 8143b2c4a8f..cc6cfdb74ed 100755 --- a/components/carousel/nz-carousel.component.ts +++ b/components/carousel/nz-carousel.component.ts @@ -1,3 +1,4 @@ +import { LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes'; import { AfterContentInit, AfterViewInit, @@ -231,10 +232,10 @@ export class NzCarouselComponent implements AfterViewInit, OnDestroy, AfterConte } onKeyDown(e: KeyboardEvent): void { - if (e.keyCode === 37) { // Left + if (e.keyCode === LEFT_ARROW) { // Left this.pre(); e.preventDefault(); - } else if (e.keyCode === 39) { // Right + } else if (e.keyCode === RIGHT_ARROW) { // Right this.next(); e.preventDefault(); } diff --git a/components/carousel/nz-carousel.spec.ts b/components/carousel/nz-carousel.spec.ts index 5dd8cfe3940..06a69d971b0 100644 --- a/components/carousel/nz-carousel.spec.ts +++ b/components/carousel/nz-carousel.spec.ts @@ -1,3 +1,4 @@ +import { LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes'; import { Component, ViewChild } from '@angular/core'; import { fakeAsync, tick, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; @@ -73,16 +74,16 @@ describe('carousel', () => { fixture.detectChanges(); expect(carouselContents[ 0 ].nativeElement.classList).toContain('slick-active'); const list = carouselWrapper.nativeElement.querySelector('.slick-list'); - dispatchKeyboardEvent(list, 'keydown', 37); + dispatchKeyboardEvent(list, 'keydown', LEFT_ARROW); fixture.detectChanges(); expect(carouselContents[ 3 ].nativeElement.classList).toContain('slick-active'); - dispatchKeyboardEvent(list, 'keydown', 37); + dispatchKeyboardEvent(list, 'keydown', LEFT_ARROW); fixture.detectChanges(); expect(carouselContents[ 2 ].nativeElement.classList).toContain('slick-active'); - dispatchKeyboardEvent(list, 'keydown', 39); + dispatchKeyboardEvent(list, 'keydown', RIGHT_ARROW); fixture.detectChanges(); expect(carouselContents[ 3 ].nativeElement.classList).toContain('slick-active'); - dispatchKeyboardEvent(list, 'keydown', 39); + dispatchKeyboardEvent(list, 'keydown', RIGHT_ARROW); fixture.detectChanges(); expect(carouselContents[ 0 ].nativeElement.classList).toContain('slick-active'); }); diff --git a/components/carousel/style/index.less b/components/carousel/style/index.less index 613f42bcb3f..64d1267c712 100644 --- a/components/carousel/style/index.less +++ b/components/carousel/style/index.less @@ -27,6 +27,14 @@ &.dragging { cursor: pointer; } + + .slick-slide { + pointer-events: none; + + &.slick-active { + pointer-events: auto; + } + } } .slick-slider .slick-track, .slick-slider .slick-list { diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less index c95686aa88b..81fc57010ba 100644 --- a/components/checkbox/style/mixin.less +++ b/components/checkbox/style/mixin.less @@ -46,7 +46,7 @@ display: block; width: @checkbox-size; height: @checkbox-size; - border: @border-width-base @border-style-base @border-color-base; + border: @checkbox-border-width @border-style-base @border-color-base; border-radius: @border-radius-sm; background-color: @checkbox-check-color; transition: all .3s; diff --git a/components/dropdown/nz-dropdown.spec.ts b/components/dropdown/nz-dropdown.spec.ts index d8b4acb5d7d..e85604acfea 100644 --- a/components/dropdown/nz-dropdown.spec.ts +++ b/components/dropdown/nz-dropdown.spec.ts @@ -133,6 +133,14 @@ describe('dropdown', () => { expect(items[ 0 ].classList.contains('ant-dropdown-menu-item')).toBe(true); expect(items[ 0 ].classList.contains('ant-dropdown-menu-item-selected')).toBe(false); }); + it('should append the correct className', () => { + testComponent.visible = true; + testComponent.itemSelected = true; + fixture.detectChanges(); + const items = overlayContainerElement.querySelectorAll('.ant-dropdown-menu-item') as NodeListOf; + expect(items[ 0 ].classList.contains('.ant-menu-item-selected')).toBe(false); + expect(items[ 0 ].classList.contains('ant-dropdown-menu-item-selected')).toBe(true); + }); it('should backdrop work with click', () => { testComponent.trigger = 'click'; fixture.detectChanges(); @@ -390,7 +398,7 @@ describe('dropdown', () => { Hover me