Skip to content

Commit

Permalink
release(0.7.0): release 0.7.0 (NG-ZORRO#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
vthinkxie authored May 15, 2018
1 parent f8b4dee commit 62ec1f0
Show file tree
Hide file tree
Showing 16 changed files with 310 additions and 285 deletions.
67 changes: 67 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
MIT LICENSE

Copyright (c) 2017 Alibaba.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT LICENSE

Copyright (c) 2015-present Alipay.com, https://www.alipay.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The MIT License

Copyright (c) 2017 Google, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
14 changes: 9 additions & 5 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Travis branch](https://img.shields.io/travis/NG-ZORRO/ng-zorro-antd/master.svg?style=flat-square)](https://travis-ci.org/NG-ZORRO/ng-zorro-antd)
[![Codecov](https://img.shields.io/codecov/c/github/NG-ZORRO/ng-zorro-antd/master.svg?style=flat-square)](https://codecov.io/gh/NG-ZORRO/ng-zorro-antd)
[![Gemnasium](https://img.shields.io/gemnasium/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://gemnasium.com/github.com/NG-ZORRO/ng-zorro-antd)
[![npm package](https://img.shields.io/npm/v/ng-zorro-antd/next.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)
[![npm package](https://img.shields.io/npm/v/ng-zorro-antd.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)
[![GitHub Release Date](https://img.shields.io/github/release-date/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/releases)
[![Issue Stats](https://img.shields.io/issuestats/i/github/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/issues)
[![NPM downloads](http://img.shields.io/npm/dm/ng-zorro-antd.svg?style=flat-square)](https://npmjs.org/package/ng-zorro-antd)
Expand All @@ -18,6 +18,14 @@

[README in English](README.md)

## 版本

- [![npm package](https://img.shields.io/npm/v/ng-zorro-antd.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)

- 1.x (支持 Angular 6.x & Ant Design 3.x) 即将放出
- 0.7.x (support Angular 5.x & Ant Design 3.x) 目前推荐版本
- 0.6.x (support Angular 5.x & Ant Design 2.x) **不再维护**

## 特性

- 提炼自企业级中后台产品的交互语言和视觉风格。
Expand All @@ -28,10 +36,6 @@

* 现代浏览器和 IE9 及以上(需要 [polyfills](https://angular.io/guide/browser-support))。

## 版本

- [![npm package](https://img.shields.io/npm/v/ng-zorro-antd/next.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)


## 安装

Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Travis branch](https://img.shields.io/travis/NG-ZORRO/ng-zorro-antd/master.svg?style=flat-square)](https://travis-ci.org/NG-ZORRO/ng-zorro-antd)
[![Codecov](https://img.shields.io/codecov/c/github/NG-ZORRO/ng-zorro-antd/master.svg?style=flat-square)](https://codecov.io/gh/NG-ZORRO/ng-zorro-antd)
[![Gemnasium](https://img.shields.io/gemnasium/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://gemnasium.com/github.com/NG-ZORRO/ng-zorro-antd)
[![npm package](https://img.shields.io/npm/v/ng-zorro-antd/next.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)
[![npm package](https://img.shields.io/npm/v/ng-zorro-antd.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)
[![GitHub Release Date](https://img.shields.io/github/release-date/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/releases)
[![Issue Stats](https://img.shields.io/issuestats/i/github/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/issues)
[![NPM downloads](http://img.shields.io/npm/dm/ng-zorro-antd.svg?style=flat-square)](https://npmjs.org/package/ng-zorro-antd)
Expand All @@ -18,6 +18,14 @@ An enterprise-class UI components based on Ant Design and Angular.

[中文 README](README-zh_CN.md)

## Version

[![npm package](https://img.shields.io/npm/v/ng-zorro-antd.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)

- 1.x (support Angular 6.x & Ant Design 3.x) will release soon
- 0.7.x (support Angular 5.x & Ant Design 3.x) current version
- 0.6.x (support Angular 5.x & Ant Design 2.x) **Not Under Maintenance**


## Features

Expand All @@ -29,9 +37,6 @@ An enterprise-class UI components based on Ant Design and Angular.

* Modern browsers and Internet Explorer 9+ (with [polyfills](https://angular.io/guide/browser-support))

## Version

- [![npm package](https://img.shields.io/npm/v/ng-zorro-antd/next.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)

## Installation

Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ rm publish/src/index.d.ts publish/src/index.metadata.json
echo 'Copying package.json'
cp package.json publish/package.json

echo 'Copying README.md'
cp README.md publish/README.md

node ./build_scripts/generate-less.js
32 changes: 16 additions & 16 deletions components/date-picker/date-picker.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('NzDatePickerComponent', () => {
tick(500);
fixture.detectChanges();
expect(fixtureInstance.nzValue).toBe(initial);
expect(debugElement.query(clearBtnSelector)).toBeTruthy();
expect(debugElement.query(clearBtnSelector)).toBeDefined();

const nzOnChange = spyOn(fixtureInstance, 'nzOnChange');
debugElement.query(clearBtnSelector).nativeElement.click();
Expand All @@ -102,14 +102,14 @@ describe('NzDatePickerComponent', () => {
fixture.detectChanges();
flush();
fixture.detectChanges();
expect(!!debugElement.query(By.css('nz-picker .ant-input-disabled'))).toBeTruthy();
expect(!!debugElement.query(By.css('nz-picker i.ant-calendar-picker-clear'))).toBeFalsy();
expect(debugElement.query(By.css('nz-picker .ant-input-disabled'))).toBeDefined();
expect(debugElement.query(By.css('nz-picker i.ant-calendar-picker-clear'))).toBeNull();

fixtureInstance.nzDisabled = false;
tick(500);
fixture.detectChanges();
expect(!!debugElement.query(By.css('nz-picker .ant-input-disabled'))).toBeFalsy();
expect(!!debugElement.query(By.css('nz-picker i.ant-calendar-picker-clear'))).toBeTruthy();
expect(debugElement.query(By.css('nz-picker .ant-input-disabled'))).toBeNull();
expect(debugElement.query(By.css('nz-picker i.ant-calendar-picker-clear'))).toBeDefined();
}));

it('should support nzOpen if assigned', fakeAsync(() => {
Expand Down Expand Up @@ -304,7 +304,7 @@ describe('NzDatePickerComponent', () => {
fixture.detectChanges();
tick(500);
fixture.detectChanges();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-month-panel')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-month-panel')).toBeDefined();
expect(queryFromOverlay('.ant-calendar-month-panel-year-select-content').textContent.indexOf('2018') > -1).toBeTruthy();
// Goto previous year
dispatchMouseEvent(queryFromOverlay('.ant-calendar-month-panel-prev-year-btn'), 'click');
Expand Down Expand Up @@ -341,7 +341,7 @@ describe('NzDatePickerComponent', () => {
fixture.detectChanges();
tick(500);
fixture.detectChanges();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-year-panel')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-year-panel')).toBeDefined();
expect(queryFromOverlay('.ant-calendar-year-panel-decade-select-content').textContent.indexOf('2010') > -1).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-year-panel-decade-select-content').textContent.indexOf('2019') > -1).toBeTruthy();
// Coverage for last/next cell
Expand Down Expand Up @@ -394,7 +394,7 @@ describe('NzDatePickerComponent', () => {
fixture.detectChanges();
tick(500);
fixture.detectChanges();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-decade-panel')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-decade-panel')).toBeDefined();
// Coverage for last/next cell
dispatchMouseEvent(queryFromOverlay('.ant-calendar-decade-panel-next-century-cell'), 'click');
fixture.detectChanges();
Expand Down Expand Up @@ -427,7 +427,7 @@ describe('NzDatePickerComponent', () => {
fixture.detectChanges();
tick(500);
fixture.detectChanges();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-year-panel')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-header .ant-calendar-year-panel')).toBeDefined();
}));

}); // /panel switch and move forward/afterward
Expand Down Expand Up @@ -462,8 +462,8 @@ describe('NzDatePickerComponent', () => {
fixtureInstance.nzShowTime = true;
fixture.detectChanges();
openPickerByClickTrigger();
expect(queryFromOverlay('.ant-calendar-time-picker-btn')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-ok-btn')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-time-picker-btn')).toBeDefined();
expect(queryFromOverlay('.ant-calendar-ok-btn')).toBeDefined();

// Open time picker panel
dispatchMouseEvent(queryFromOverlay('.ant-calendar-time-picker-btn'), 'click');
Expand All @@ -472,7 +472,7 @@ describe('NzDatePickerComponent', () => {
fixture.detectChanges();
tick(500);
fixture.detectChanges();
expect(queryFromOverlay('.ant-calendar-time-picker-inner.ant-calendar-time-picker-column-3')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-time-picker-inner.ant-calendar-time-picker-column-3')).toBeDefined();
expect(queryFromOverlay('.ant-calendar-time-picker-select:first-child li.ant-calendar-time-picker-select-option-selected').textContent.trim()).toBe('11');

// Click to choose a hour
Expand All @@ -493,7 +493,7 @@ describe('NzDatePickerComponent', () => {
fixture.detectChanges();
tick(500);
fixture.detectChanges();
expect(queryFromOverlay('.ant-calendar-time-picker-inner.ant-calendar-time-picker-column-2')).toBeTruthy();
expect(queryFromOverlay('.ant-calendar-time-picker-inner.ant-calendar-time-picker-column-2')).toBeDefined();
}));

it('should support nzDisabledTime and nzShowTime.nzHideDisabledOptions', fakeAsync(() => {
Expand Down Expand Up @@ -540,11 +540,11 @@ describe('NzDatePickerComponent', () => {
it('should support nzShowToday', fakeAsync(() => {
fixture.detectChanges();
openPickerByClickTrigger();
expect(overlayContainerElement.querySelector('.ant-calendar-footer')).toBeFalsy();
expect(overlayContainerElement.querySelector('.ant-calendar-footer')).toBeDefined();

fixtureInstance.nzShowToday = true;
fixture.detectChanges();
expect(overlayContainerElement.querySelector('.ant-calendar-today-btn ')).toBeTruthy();
expect(overlayContainerElement.querySelector('.ant-calendar-today-btn ')).toBeDefined();

// Click today button
const nzOnChange = spyOn(fixtureInstance, 'nzOnChange');
Expand All @@ -561,7 +561,7 @@ describe('NzDatePickerComponent', () => {
fixtureInstance.nzMode = 'month';
fixture.detectChanges();
openPickerByClickTrigger();
expect(overlayContainerElement.querySelector('.ant-calendar-header .ant-calendar-month-panel')).toBeTruthy();
expect(overlayContainerElement.querySelector('.ant-calendar-header .ant-calendar-month-panel')).toBeDefined();
}));

it('should support nzOnPanelChange', fakeAsync(() => {
Expand Down
33 changes: 21 additions & 12 deletions components/date-picker/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,35 @@ By clicking the input box, you can select a date from a popup calendar.

## API

**Note:** Some of nz-date-picker's locale are coming from [Angular i18n](https://angular.io/guide/i18n), that should be provided in the file of `main.ts`.

For example:
```typescript
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
registerLocaleData(zh);
```

There are four kinds of picker:

- DatePicker
- MonthPicker
- RangePicker
- WeekPicker
- nz-date-picker
- nz-month-picker
- nz-range-picker
- nz-week-picker

**Note: ** All input and output date objects are [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), you can manpulate it with [date-fns](https://date-fns.org/).

### Common API

The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicker.
The following APIs are shared by nz-date-picker, nz-month-picker, nz-range-picker, nz-week-picker.

| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| nzAllowClear | Whether to show clear button | boolean | true |
| nzAutoFocus | get focus when component mounted | boolean | false |
| nzClassName | picker className | string | '' |
| nzDateRender | custom rendering function for date cells (Not support by MonthPicker) | TemplateRef<Date> / string or (d: Date) => TemplateRef<Date> / string | - |
| nzDisabled | determine whether the DatePicker is disabled | boolean | false |
| nzDateRender | custom rendering function for date cells (Not support by nz-month-picker) | TemplateRef<Date> / string or (d: Date) => TemplateRef<Date> / string | - |
| nzDisabled | determine whether the nz-date-picker is disabled | boolean | false |
| nzDisabledDate | specify the date that cannot be selected | (current: Date) => boolean | - |
| nzLocale | localization configuration | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
| nzOpen | open state of picker | boolean | - |
Expand All @@ -42,7 +51,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
| nzStyle | to customize the style of the input box | object | {} |
| nzOnOpenChange | a callback emitter, can be executed whether the popup calendar is popped up or closed | EventEmitter<boolean> | - |

### DatePicker
### nz-date-picker

| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
Expand All @@ -55,7 +64,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
| nzShowToday | whether to show "Today" button | boolean | true |
| nzOnOk | callback when click ok button | EventEmitter<Date> | - |

### MonthPicker
### nz-month-picker

| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
Expand All @@ -64,15 +73,15 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
| nzFormat | to set the date format, refer to [DatePipe](https://angular.io/api/common/DatePipe) | string | "yyyy-MM" |
| nzRenderExtraFooter | render extra footer in panel | TemplateRef / string or () => TemplateRef / string | - |

### WeekPicker
### nz-week-picker

| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| ngModel | Date | Date | - |
| ngModelChange | Date change callback | `(ngModel:Date)=>{}` | - |
| nzFormat | to set the date format, refer to [DatePipe](https://angular.io/api/common/DatePipe) | string | "yyyy-ww" |

### RangePicker
### nz-range-picker

| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
Expand All @@ -85,4 +94,4 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
| nzShowTime | to provide an additional time selection | object / boolean | [TimePicker Options](/components/time-picker/en#api) |
| nzValue | to set date | Date[] | - |

> Currently supported `TimePicker` parameters in `NzShowTime` are: `nzFormat`, `nzHourStep`, `nzMinuteStep`, `nzSecondStep`, `nzDisabledHours`, `nzDisabledMinutes`, `nzDisabledSeconds`, `nzHideDisabledOptions`, `nzDefaultOpenValue`, `nzAddOn`
> Currently supported `nz-time-picker` parameters in `NzShowTime` are: `nzFormat`, `nzHourStep`, `nzMinuteStep`, `nzSecondStep`, `nzDisabledHours`, `nzDisabledMinutes`, `nzDisabledSeconds`, `nzHideDisabledOptions`, `nzDefaultOpenValue`, `nzAddOn`
Loading

0 comments on commit 62ec1f0

Please sign in to comment.