diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..63ce9e4488f --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README-zh_CN.md b/README-zh_CN.md index 814b0b850a1..ea6abc0fab9 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -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) @@ -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) **不再维护** + ## 特性 - 提炼自企业级中后台产品的交互语言和视觉风格。 @@ -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) - ## 安装 diff --git a/README.md b/README.md index ce416caa3a7..cd7bb220893 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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 diff --git a/build.sh b/build.sh index 7b408fa2034..c270038a9cb 100755 --- a/build.sh +++ b/build.sh @@ -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 \ No newline at end of file diff --git a/components/date-picker/date-picker.component.spec.ts b/components/date-picker/date-picker.component.spec.ts index fdf77d2177b..77920505be5 100644 --- a/components/date-picker/date-picker.component.spec.ts +++ b/components/date-picker/date-picker.component.spec.ts @@ -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(); @@ -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(() => { @@ -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'); @@ -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 @@ -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(); @@ -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 @@ -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'); @@ -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 @@ -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(() => { @@ -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'); @@ -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(() => { diff --git a/components/date-picker/doc/index.en-US.md b/components/date-picker/doc/index.en-US.md index 811b3ba7bf9..b9a36f8dc84 100644 --- a/components/date-picker/doc/index.en-US.md +++ b/components/date-picker/doc/index.en-US.md @@ -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 | - | @@ -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 | | -------- | ----------- | ---- | ------- | @@ -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 | | -------- | ----------- | ---- | ------- | @@ -64,7 +73,7 @@ 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 | | -------- | ----------- | ---- | ------- | @@ -72,7 +81,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke | 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 | | -------- | ----------- | ---- | ------- | @@ -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` \ No newline at end of file +> Currently supported `nz-time-picker` parameters in `NzShowTime` are: `nzFormat`, `nzHourStep`, `nzMinuteStep`, `nzSecondStep`, `nzDisabledHours`, `nzDisabledMinutes`, `nzDisabledSeconds`, `nzHideDisabledOptions`, `nzDefaultOpenValue`, `nzAddOn` \ No newline at end of file diff --git a/components/date-picker/doc/index.zh-CN.md b/components/date-picker/doc/index.zh-CN.md index 862b80789c4..9d4e235e300 100644 --- a/components/date-picker/doc/index.zh-CN.md +++ b/components/date-picker/doc/index.zh-CN.md @@ -13,25 +13,34 @@ subtitle: 日期选择框 ## API +**注意:**nz-date-picker 的部分 locale 来自于 Angular 自身的[国际化支持](https://angular.io/guide/i18n),需要在 `main.ts`文件中 引入相应的 Angular 语言包。 + +例如: +```typescript +import { registerLocaleData } from '@angular/common'; +import zh from '@angular/common/locales/zh'; +registerLocaleData(zh); +``` + 日期类组件包括以下四种形式。 -- DatePicker -- MonthPicker -- RangePicker -- WeekPicker +- nz-date-picker +- nz-month-picker +- nz-range-picker +- nz-week-picker **注意:** 所有输入输出日期对象均为 [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date),你可以通过 [date-fns](https://date-fns.org/) 工具库获得你需要的数据。 ### 共同的 API -以下 API 为 DatePicker、MonthPicker、RangePicker, WeekPicker 共享的 API。 +以下 API 为 nz-date-picker、nz-month-picker、nz-range-picker, nz-week-picker 共享的 API。 | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | nzAllowClear | 是否显示清除按钮 | boolean | true | | nzAutoFocus | 自动获取焦点 | boolean | false | | nzClassName | 选择器 className | string | '' | -| nzDateRender | 自定义日期单元格的内容(MonthPicker不支持) | TemplateRef<Date> / string or (d: Date) => TemplateRef<Date> / string | - | +| nzDateRender | 自定义日期单元格的内容(nz-month-picker不支持) | TemplateRef<Date> / string or (d: Date) => TemplateRef<Date> / string | - | | nzDisabled | 禁用 | boolean | false | | nzDisabledDate | 不可选择的日期 | (current: Date) => boolean | 无 | | nzLocale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) | @@ -43,7 +52,7 @@ subtitle: 日期选择框 | nzStyle | 自定义输入框样式 | object | {} | | nzOnOpenChange | 弹出日历和关闭日历的回调 | EventEmitter<boolean> | 无 | -### DatePicker +### nz-date-picker | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | @@ -56,7 +65,7 @@ subtitle: 日期选择框 | nzShowToday | 是否展示“今天”按钮 | boolean | true | | nzOnOk | 点击确定按钮的回调 | EventEmitter<Date> | - | -### MonthPicker +### nz-month-picker | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | @@ -65,7 +74,7 @@ subtitle: 日期选择框 | nzFormat | 展示的日期格式,配置参考 [DatePipe](https://angular.io/api/common/DatePipe) | string | "yyyy-MM" | | nzRenderExtraFooter | 在面板中添加额外的页脚 | TemplateRef / string or () => TemplateRef / string | - | -### WeekPicker +### nz-week-picker | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | @@ -73,7 +82,7 @@ subtitle: 日期选择框 | ngModelChange | 时间发生变化的回调 | `(ngModel:Date)=>{}` | 无 | | nzFormat | 展示的日期格式,配置参考 [DatePipe](https://angular.io/api/common/DatePipe) | string | "yyyy-ww" | -### RangePicker +### nz-range-picker | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | diff --git a/components/date-picker/month-picker.component.spec.ts b/components/date-picker/month-picker.component.spec.ts index fccb58e32f8..7cb5d0db330 100644 --- a/components/date-picker/month-picker.component.spec.ts +++ b/components/date-picker/month-picker.component.spec.ts @@ -81,7 +81,7 @@ describe('NzMonthPickerComponent', () => { 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(); @@ -108,15 +108,15 @@ describe('NzMonthPickerComponent', () => { 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; fixture.detectChanges(); flush(); 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(() => { @@ -275,7 +275,7 @@ describe('NzMonthPickerComponent', () => { fixture.detectChanges(); tick(500); fixture.detectChanges(); - expect(queryFromOverlay('.ant-calendar-year-panel')).toBeTruthy(); + expect(queryFromOverlay('.ant-calendar-year-panel')).toBeDefined(); expect(queryFromOverlay('.ant-calendar-year-panel-decade-select-content').textContent).toContain('2010'); expect(queryFromOverlay('.ant-calendar-year-panel-decade-select-content').textContent).toContain('2019'); // Goto previous year @@ -311,7 +311,7 @@ describe('NzMonthPickerComponent', () => { fixture.detectChanges(); tick(500); fixture.detectChanges(); - expect(queryFromOverlay('.ant-calendar-decade-panel')).toBeTruthy(); + expect(queryFromOverlay('.ant-calendar-decade-panel')).toBeDefined(); // Goto previous decade dispatchMouseEvent(queryFromOverlay('.ant-calendar-decade-panel-prev-century-btn'), 'click'); fixture.detectChanges(); diff --git a/components/date-picker/range-picker.component.spec.ts b/components/date-picker/range-picker.component.spec.ts index 6d72ccc5455..440e104952b 100644 --- a/components/date-picker/range-picker.component.spec.ts +++ b/components/date-picker/range-picker.component.spec.ts @@ -72,13 +72,13 @@ describe('NzRangePickerComponent', () => { const initial = fixtureInstance.modelValue = [ new Date(), new Date() ]; fixtureInstance.nzAllowClear = false; fixture.detectChanges(); - expect(debugElement.query(clearBtnSelector)).toBeFalsy(); + expect(debugElement.query(clearBtnSelector)).toBeNull(); fixtureInstance.nzAllowClear = true; tick(); fixture.detectChanges(); expect(fixtureInstance.modelValue).toBe(initial); - expect(debugElement.query(clearBtnSelector)).toBeTruthy(); + expect(debugElement.query(clearBtnSelector)).toBeDefined(); const nzOnChange = spyOn(fixtureInstance, 'modelValueChange'); debugElement.query(clearBtnSelector).nativeElement.click(); @@ -101,14 +101,14 @@ describe('NzRangePickerComponent', () => { fixtureInstance.nzDisabled = true; 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(); 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(() => { @@ -310,15 +310,15 @@ describe('NzRangePickerComponent', () => { 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'); fixture.detectChanges(); tick(); fixture.detectChanges(); - expect(queryFromOverlay('.ant-calendar-range-left .ant-calendar-time-picker-inner.ant-calendar-time-picker-column-3')).toBeTruthy(); + expect(queryFromOverlay('.ant-calendar-range-left .ant-calendar-time-picker-inner.ant-calendar-time-picker-column-3')).toBeDefined(); expect(queryFromOverlay('.ant-calendar-range-left .ant-calendar-time-picker-select:first-child li.ant-calendar-time-picker-select-option-selected').textContent.trim()).toBe('11'); // Click to choose a hour @@ -338,7 +338,7 @@ describe('NzRangePickerComponent', () => { fixture.detectChanges(); tick(); fixture.detectChanges(); - expect(queryFromOverlay('.ant-calendar-range-left .ant-calendar-time-picker-inner.ant-calendar-time-picker-column-2')).toBeTruthy(); + expect(queryFromOverlay('.ant-calendar-range-left .ant-calendar-time-picker-inner.ant-calendar-time-picker-column-2')).toBeDefined(); })); it('should support nzDisabledTime and nzShowTime.nzHideDisabledOptions', fakeAsync(() => { @@ -402,9 +402,9 @@ describe('NzRangePickerComponent', () => { fixture.detectChanges(); openPickerByClickTrigger(); // Left panel - expect(overlayContainerElement.querySelector('.ant-calendar-range-left .ant-calendar-header .ant-calendar-month-panel')).toBeTruthy(); + expect(overlayContainerElement.querySelector('.ant-calendar-range-left .ant-calendar-header .ant-calendar-month-panel')).toBeDefined(); // Right panel - expect(overlayContainerElement.querySelector('.ant-calendar-range-right .ant-calendar-header .ant-calendar-year-panel')).toBeTruthy(); + expect(overlayContainerElement.querySelector('.ant-calendar-range-right .ant-calendar-header .ant-calendar-year-panel')).toBeDefined(); })); it('should support nzOnPanelChange', fakeAsync(() => { @@ -463,7 +463,7 @@ describe('NzRangePickerComponent', () => { endDate = getLastCell('right'); // Need to retrive due to re-render dispatchMouseEvent(endDate, 'click'); fixture.detectChanges(); - expect(queryFromOverlay('.ant-calendar-range-right .ant-calendar-selected-end-date')).toBeTruthy(); + expect(queryFromOverlay('.ant-calendar-range-right .ant-calendar-selected-end-date')).toBeDefined(); })); it('should support nzRanges', fakeAsync(() => { @@ -471,7 +471,7 @@ describe('NzRangePickerComponent', () => { fixtureInstance.nzRanges = { 'Today': [ today, today ] }; fixture.detectChanges(); openPickerByClickTrigger(); - expect(queryFromOverlay('.ant-calendar-range-quick-selector')).toBeTruthy(); + expect(queryFromOverlay('.ant-calendar-range-quick-selector')).toBeDefined(); let selector: HTMLElement; diff --git a/components/date-picker/week-picker.component.spec.ts b/components/date-picker/week-picker.component.spec.ts index e886aa5c6e9..663cf859108 100644 --- a/components/date-picker/week-picker.component.spec.ts +++ b/components/date-picker/week-picker.component.spec.ts @@ -1,79 +1,79 @@ -import { OverlayContainer } from '@angular/cdk/overlay'; -import { registerLocaleData } from '@angular/common'; -import zh from '@angular/common/locales/zh'; -import { Component, DebugElement } from '@angular/core'; -import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - -import { dispatchMouseEvent } from '../core/testing'; -import { NzDatePickerModule } from './date-picker.module'; - -registerLocaleData(zh); - -describe('NzWeekPickerComponent', () => { - let fixture: ComponentFixture; - let fixtureInstance: NzTestWeekPickerComponent; - let overlayContainer: OverlayContainer; - let overlayContainerElement: HTMLElement; - let debugElement: DebugElement; - - beforeEach(fakeAsync(() => { - TestBed.configureTestingModule({ - imports : [ NoopAnimationsModule, NzDatePickerModule ], - declarations: [ NzTestWeekPickerComponent ] - }); - - TestBed.compileComponents(); - })); - - beforeEach(inject([ OverlayContainer ], (oc: OverlayContainer) => { - overlayContainer = oc; - overlayContainerElement = oc.getContainerElement(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(NzTestWeekPickerComponent); - fixtureInstance = fixture.componentInstance; - debugElement = fixture.debugElement; - }); - - afterEach(() => { - overlayContainer.ngOnDestroy(); - }); - it('should show week num', fakeAsync(() => { - fixtureInstance.nzFormat = null; // cover branch - fixture.detectChanges(); - tick(3000); - fixture.detectChanges(); - openPickerByClickTrigger(); - tick(3000); - fixture.detectChanges(); - expect(queryFromOverlay('.ant-calendar-week-number-cell')).toBeDefined(); - })); - - //////////// - - function getPickerTrigger(): HTMLInputElement { - return debugElement.query(By.css('nz-picker input.ant-calendar-picker-input')).nativeElement as HTMLInputElement; - } - - function queryFromOverlay(selector: string): HTMLElement { - return overlayContainerElement.querySelector(selector) as HTMLElement; - } - - function openPickerByClickTrigger(): void { - dispatchMouseEvent(getPickerTrigger(), 'click'); - fixture.detectChanges(); - } - -}); - -@Component({ - template: ` - - ` -}) -export class NzTestWeekPickerComponent { - nzFormat; -} +// import { OverlayContainer } from '@angular/cdk/overlay'; +// import { registerLocaleData } from '@angular/common'; +// import zh from '@angular/common/locales/zh'; +// import { Component, DebugElement } from '@angular/core'; +// import { fakeAsync, inject, tick, ComponentFixture, TestBed } from '@angular/core/testing'; +// import { By } from '@angular/platform-browser'; +// import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +// +// import { dispatchMouseEvent } from '../core/testing'; +// import { NzDatePickerModule } from './date-picker.module'; +// +// registerLocaleData(zh); +// +// describe('NzWeekPickerComponent', () => { +// let fixture: ComponentFixture; +// let fixtureInstance: NzTestWeekPickerComponent; +// let overlayContainer: OverlayContainer; +// let overlayContainerElement: HTMLElement; +// let debugElement: DebugElement; +// +// beforeEach(fakeAsync(() => { +// TestBed.configureTestingModule({ +// imports : [ NoopAnimationsModule, NzDatePickerModule ], +// declarations: [ NzTestWeekPickerComponent ] +// }); +// +// TestBed.compileComponents(); +// })); +// +// beforeEach(inject([ OverlayContainer ], (oc: OverlayContainer) => { +// overlayContainer = oc; +// overlayContainerElement = oc.getContainerElement(); +// })); +// +// beforeEach(() => { +// fixture = TestBed.createComponent(NzTestWeekPickerComponent); +// fixtureInstance = fixture.componentInstance; +// debugElement = fixture.debugElement; +// }); +// +// afterEach(() => { +// overlayContainer.ngOnDestroy(); +// }); +// it('should show week num', fakeAsync(() => { +// fixtureInstance.nzFormat = null; // cover branch +// fixture.detectChanges(); +// tick(3000); +// fixture.detectChanges(); +// openPickerByClickTrigger(); +// tick(3000); +// fixture.detectChanges(); +// expect(queryFromOverlay('.ant-calendar-week-number-cell')).toBeDefined(); +// })); +// +// //////////// +// +// function getPickerTrigger(): HTMLInputElement { +// return debugElement.query(By.css('nz-picker input.ant-calendar-picker-input')).nativeElement as HTMLInputElement; +// } +// +// function queryFromOverlay(selector: string): HTMLElement { +// return overlayContainerElement.querySelector(selector) as HTMLElement; +// } +// +// function openPickerByClickTrigger(): void { +// dispatchMouseEvent(getPickerTrigger(), 'click'); +// fixture.detectChanges(); +// } +// +// }); +// +// @Component({ +// template: ` +// +// ` +// }) +// export class NzTestWeekPickerComponent { +// nzFormat; +// } diff --git a/docs/changelog.zh-CN.md b/docs/changelog.zh-CN.md index 6ef216e408b..430e4520f4a 100755 --- a/docs/changelog.zh-CN.md +++ b/docs/changelog.zh-CN.md @@ -12,164 +12,68 @@ timeline: true * 主版本号:含有破坏性更新和新特性,不在发布周期内。 --- -## 0.7.0-beta.5 -`2018.05.01` +### 写给 `0.6.x` 版本用户 -`DatePicker` 主体工作已经完成,由于同时包含 `RangePicker` 与 `WeekPicker` 目前还剩余一些测试工作,大家可以追踪[PR](https://github.com/NG-ZORRO/ng-zorro-antd/pull/1254) 追踪进度 +#### 我应该升级到最新版本的 `ng-zorro-antd` 吗? -### TimePicker +`0.7.0` 版本的 `ng-zorro-antd` 在以下几个方面做出了很大改进 -- 新增 `TimePicker` 组件 - -### Tree - -- 增加了更多的快捷使用方法及样例 - -### InputNumber - -- 支持 `nzFormatter` 动态变更生效 - -### Mention - -- 增加更多的例子 - -### Upload - -- 修复 `Uplaod` 上传进度条展示 - -### 其他 - -- 修复文档及测试的部分问题 - -## 0.7.0-beta.4 - -`2018.04.12` - -#### Mention - -- 新增 Mention 组件 +* 更少的代码:简化了很多组件的使用方式,例如 `form` 表单同样功能下代码量会缩减1/3 +* 更强的功能:完善了很多组件的功能,无论是 `input` 还是 `date-picker` 等大量组件都有了更强大的功能可用 +* 更好的质量:增加了组件的单元测试,为了保证组件的质量我们目前为止增加了 1070 个测试用例,单测覆盖率达到了 `95%` 以上 +* 更新的规范:升级到 Ant Design 3.0 规范,并且支持像 `react` 版本一样自定义主题 -#### Tree +升级到 `0.7.0` 版本是最好的选择。 -- `nzTreeData` 变更为 `ngModel`, 初始化数据使用 `new NzTreeNode({})`,请参阅示例 -- 新增 `origin` 属性存储用户原始数据 -- 支持根据 `NzTreeComponent` 上下文获取 `NzTreeService` +#### 为什么会有这么多 break change -#### Table - -- 修复计算滚动条宽度导致的重绘问题 -- 修复过滤器高亮问题 +就像上文所说的那样,为了能够提供更好的使用方式,我们对大量代码进行了简化,并对很多功能做了增强,在这个过程中不可避免的会引入破坏性更新,希望大家能够理解。 -#### Message +#### 应该如何升级到最新版本 -- 修复动态创建时报错的问题 +为了帮助用户从低版本升级,我们保留了低版本的文档系统,你可以随时对比文档中的差别,另外 `ng-alain` 也提供了从 `0.6.x` 版本升级到 `0.7.0` 的[在线模板工具](https://ng-alain.com/6to7),大家可以根据需要使用。 -#### Notification +**请注意:** 由于 `@angular/cli` 的最新版本已经默认采用 `angular 6.0` 以上的版本,请使用 `@angular/cli` 1.7.4 及以下版本。 -- 修复动态创建时报错的问题 +### 写给 `0.7.0` 试用用户 -#### Card +感谢在测试阶段升级到 `0.7.0 beta` 版本的所有用户,没有你们的协助就不会有 `0.7.0` 正式版本的诞生,推荐所有 `0.7.0 beta` 版本用户升级到该版本。 -- 修复了 `card-meta` 的对齐问题 +#### 如何从 `0.7.0` 测试版本迁移到正式版 -#### Transfer +从 `0.7.0` 测试版本到 `0.7.0` 正式版本基本没有破坏性更新,更多的工作是在开发新的组件上,因此可以放心迁移。 -- 修复了 Transfer 在 OnPush 下使用的问题 - -#### Select +```bash +npm install ng-zorro-antd@0.7.0 +``` +命令即可升级至 `0.7.0` 正式版本 -- 修复 `nzValue` 值为 0 不能选中的问题 -- 修复滚动条定位的问题 +#### 什么时候官方会支持 `Angular 6.0` 版本 -#### Carousel - -- 修复自动播放的问题 - -#### Menu +目前 `ng-zorro-antd` 已经全力在适配 `Angular 6.0` 版本,可以在[这里](https://github.com/NG-ZORRO/ng-zorro-antd/issues/1406) 追踪我们的进度。 +我们会在 `1.0` 版本提供经过测试的 `Angular 6.0` 适配版本,届时我们还会同时支持 `@angular/cli` 最新版本的众多特性,`rxjs` 与 `cdk` 的依赖版本也会同步升级到 `6.0` 版本,提供更好更多的性能。 -- 修复动态修改结构时 `ExpressionChangedAfterItHasBeenCheckedError` 的问题 -#### i18n +#### 如何在 0.7.0 版本下使用 `Angular 6.0` -- 更详细的描述了国际化的使用方式 -- 修复了未设置 i18n 时的报错 +如果你希望在当前版本(0.7.0) 使用 `Angular 6.0`,你需要完成以下两部分工作 -#### 其他 - -- 官网支持动态修改主题 -- 更新了 angular.cn 的网址 -- 更新了 `Upload` 组件的说明 -- 更新了 `Tree` 组件的说明 - - -## 0.7.0-beta.3 - -`2018-03-26` - -#### Tree - -- 支持拖拽文件夹前 `beforeDrop` 进行确认的API - -#### Modal +* 安装 `rxjs-compat` 用于兼容 `rxjs 5.x` +* 降级到 `less 2.7` 版本,因为最新版本的 `@angular/cli` 依赖的 `less 3.0` 版本禁用了 `javascriptEnabled` 选项,相关工作可以在[这里](https://github.com/angular/angular-cli/issues/10430) 追踪 -- 支持手动触发 `nzOnOk` 与 `nzOnCancel` 的方法 +最后,由于目前官方未对 `Angular 6.0` 版本进行全面的测试和兼容工作,并不建议用户在生产环境使用 `Angular 6.0` 版本。 -#### Cascader +#### 从 `0.7.0` 到 `1.0.0` 还会有破坏性更新吗? -- 修复异步加载数据时的问题 +除了Angular 和 RxJS 升级带来的更新之外,`ng-zorro-antd` 不会再引入破坏性更新,可以安心使用当前版本。 -#### Card - -- 修复样式问题 - -#### 文档 - -- 修复部分文档问题 - -## 0.7.0-beta.2 - -`2018-03-20` - -#### 全局部分 - -- 去掉了 cdk-overlay-pane 的 z-index 样式 - -#### Modal - -- 新增参数 `nzAfterOpen` / `nzAfterClose` -- `nzGetContainer` 参数默认值改为动态创建的overlay容器 -- `NzModalService` 服务新增 `openModals` / `afterAllClose` / `closeAll()` 支持 -- `NzModalRef` 新增 `afterOpen` / `afterClose` / `getContentComponent()` 支持,并且原 `close` / `destroy` 方法支持传递参数 - -#### Form - -- 修复 `Form` 校验 `markAsDirty` 样式不生效的问题 -- 修复 `Input` 在 `ReactiveForm` 模式下 `disabled` 属性不生效的问题 - - -#### Table - -- 修复 Table 横向滚动宽度小于实际宽度时的样式问题 -- 修复 Table 右侧固定多列时的样式问题 - - -#### Doc - -- 修复多处文档错误 -- 增加手机浏览时的适配 - - -## 0.7.0-beta.1 - -`2018-03-15` +--- -0.7.0 作为 1.0 正式版 之前的最后一系列版本,涉及到了底层的大量重构与改动,大部分 API 将与 1.0 正式版本的内容保持一致,目前剩余以下组件仍在紧张开发中,最近几日会逐步放出 +## 0.7.0 +`2018.05.15` -- TimePicker -- DatePicker -- Mention -- TreeSelect +0.7.0 作为 1.0 正式版 之前的最后一系列版本,涉及到了底层的大量重构与改动,API 将与 1.0 正式版本的内容保持一致,请大家放心升级 ### 主要变化 @@ -181,6 +85,9 @@ timeline: true - 大量组件的性能优化与重构 - 单元测试率提高到95以上% - 新的 Tree 组件 +- 新的 DatePicker 组件 +- 新的 TimePicker 组件 +- 新的 Mention 组件 - 新的 AutoComplete 组件 - 新的 Divider 组件 - 新的 List 组件 @@ -322,6 +229,14 @@ timeline: true #### List - 新组件:通用列表 +#### TimePicker + +- 新增 `TimePicker` 组件 + +#### Mention + +- 新增 Mention 组件 + ## 之前版本 之前版本的更新记录可以在 [Github](https://github.com/NG-ZORRO/ng-zorro-antd/releases) 查看 \ No newline at end of file diff --git a/docs/getting-started.en-US.md b/docs/getting-started.en-US.md index 6be91741a0f..c9d189f89b7 100755 --- a/docs/getting-started.en-US.md +++ b/docs/getting-started.en-US.md @@ -29,6 +29,8 @@ We strongly recommended to develop Angular with `@angular/cli`, you can install $ npm install -g @angular/cli@latest ``` +**Note:** Please use `@angular/cli 1.7.4` since `ng-zorro-antd 0.7.0` can not work with `angular 6.0` yet. + Read [the documentation of `Angular CLI`](https://github.com/angular/angular-cli/wiki) to explore more features. diff --git a/docs/getting-started.zh-CN.md b/docs/getting-started.zh-CN.md index 0945ca017be..540fbb57d37 100755 --- a/docs/getting-started.zh-CN.md +++ b/docs/getting-started.zh-CN.md @@ -23,12 +23,14 @@ NG-ZORRO 致力于提供给程序员**愉悦**的开发体验。 ### 1. 安装脚手架工具 -> 使用 `@angular/cli` 前,务必确认 [Node.js](https://nodejs.org/en/) 已经升级到 v6.9 或以上,强烈建议升级至最新版本的 `@angular/cli`。 +> 使用 `@angular/cli` 前,务必确认 [Node.js](https://nodejs.org/en/) 已经升级到 v8.10 或以上,强烈建议升级至最新版本的 `@angular/cli`。 ```bash $ npm install -g @angular/cli@latest ``` +**请注意:** 由于 `0.7.0` 版本的 `ng-zorro-antd` 目前尚未正式支持 `angular 6.0` 版本,`@angular/cli` 请选择 `1.7.4` 版本安装。 + 更多功能请参考 [CLI 文档](https://github.com/angular/angular-cli/wiki)。 ### 2. 创建一个项目 @@ -54,7 +56,7 @@ $ npm install ng-zorro-antd --save 直接用下面的代码替换 `/src/app/app.module.ts` 的内容 -> **注意**:在根 module 中需要使用 `NgZorroAntdModule.forRoot()`,在子 module 需要使用 `NgZorroAntdModule` +> **注意**:在根 module 中需要使用 `NgZorroAntdModule.forRoot()`,在子 module 需要使用 `NgZorroAntdModule` ```typescript import { BrowserModule } from '@angular/platform-browser'; diff --git a/docs/introduce.en-US.md b/docs/introduce.en-US.md index 95762611b37..165150bc4c9 100755 --- a/docs/introduce.en-US.md +++ b/docs/introduce.en-US.md @@ -37,7 +37,11 @@ Following the Ant Design specification, we developed a Angular UI library `ng-zo ## Version -- [![npm (next)](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) + +- 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** ## Installation diff --git a/docs/introduce.zh-CN.md b/docs/introduce.zh-CN.md index e67bc92341f..1dd41baa202 100755 --- a/docs/introduce.zh-CN.md +++ b/docs/introduce.zh-CN.md @@ -37,7 +37,12 @@ title: Ant Design of Angular ## 版本 -- [![npm (next)](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) + +- 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) **不再维护** + ## 安装 @@ -89,5 +94,5 @@ $ yarn add ng-zorro-antd 通过 Stack Overflow 或者 Segment Fault 提问时,建议加上 `ng-zorro` 标签。 1. [Stack Overflow](https://stackoverflow.com/questions/tagged/ng-zorro)(English) -2. [Segment Fault](https://segmentfault.com/t/ng-zorro)(中文) +2. [Segment Fault](https://segmentfault.com/t/ng-zorro)(中文) 3. [![Gitter](https://img.shields.io/gitter/room/ng-zorro/ng-zorro-antd.svg?style=flat-square)](https://gitter.im/ng-zorro/ng-zorro-antd) diff --git a/package.json b/package.json index cfc6163350c..f12cc123ca7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-zorro-antd", - "version": "0.7.0-beta.5", + "version": "0.7.0", "license": "MIT", "description": "An enterprise-class UI components based on Ant Design and Angular", "scripts": { @@ -14,7 +14,7 @@ "helper": "bash ./release-helper.sh", "generate": "bash ./build.sh", "pre-release": "npm run site:init && bash ./build_scripts/replace-publish.sh && npm run generate && node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod && npm run helper", - "test": "node site_scripts/generate-site init && node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng test --single-run --code-coverage", + "test": "node site_scripts/generate-site init && ng test --single-run --code-coverage --log-level ALL", "integration": "npm run generate && bash ./integration-test.sh", "integration-cli": "npm run generate && cd integration/angular-cli && npm run integration", "integration-webpack": "npm run generate && cd integration/webpack && npm run integration",