Skip to content

Commit

Permalink
docs: update 8.0 docs (#3671)
Browse files Browse the repository at this point in the history
* docs: update 8.0 docs

* docs: add 7.5.x docs
  • Loading branch information
vthinkxie committed Jun 29, 2019
1 parent c2c28a4 commit 7c135e0
Show file tree
Hide file tree
Showing 24 changed files with 358 additions and 712 deletions.
8 changes: 4 additions & 4 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Ant Design 的 Angular 实现,开发和服务于企业级后台产品。
## ✨ 特性

- 提炼自企业级中后台产品的交互语言和视觉风格。
- 开箱即用的高质量 Angular 组件。
- 开箱即用的高质量 Angular 组件,与 Angular 保持同步升级
- 使用 TypeScript 构建,提供完整的类型定义文件。
- 全链路开发和设计工具体系
- 支持 OnPush 模式,性能卓越

## 🖥 支持环境

- Angular `^7.0.0`
- Angular `^8.0.0`
- 支持服务端渲染
- 现代浏览器,以及 Internet Explorer 11+ (使用 [polyfills](https://angular.io/guide/browser-support)
- [Electron](http://electron.atom.io/)
Expand Down Expand Up @@ -158,7 +158,7 @@ $ npm run site:start
- [Process Automation Group](http://pag.company/)
- [Southern Institute of Technology](https://www.sit.ac.nz/)

> 如果你的公司和产品使用了 NG-ZORRO,欢迎到 [这里](https://github.com/NG-ZORRO/ng-zorro-antd/issues/1142) 留言。
> 我们在这里列出了部分使用者,如果你的公司和产品使用了 NG-ZORRO,欢迎到 [这里](https://github.com/NG-ZORRO/ng-zorro-antd/issues/1142) 留言。
## ☀️ 授权协议

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ English | [简体中文](README-zh_CN.md)
- A set of high-quality Angular components out of the box.
- Written in TypeScript with predictable static types.
- The whole package of development and design resources and tools.
- Support OnPush mode, high performance.

## 🖥 Environment Support

* Angular `^7.0.0`
* Angular `^8.0.0`
* Server-side Rendering
* Modern browsers and Internet Explorer 11+ (with [polyfills](https://angular.io/guide/browser-support))
* [Electron](http://electron.atom.io/)
Expand Down Expand Up @@ -160,7 +161,7 @@ As always, we encourage experienced users to help those who are not familiar wit
- [Qingflow](https://qingflow.com/)
- [Southern Institute of Technology](https://www.sit.ac.nz/)

> If your company or product uses NG-ZORRO, let us know [here](https://github.com/NG-ZORRO/ng-zorro-antd/issues/1142)!
> We list some users here, if your company or product uses NG-ZORRO, let us know [here](https://github.com/NG-ZORRO/ng-zorro-antd/issues/1142)!
## ☀️ License

Expand Down
10 changes: 4 additions & 6 deletions components/icon/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
| `[nzSpin]` | Rotate icon with animation | `boolean` | `false` |
| `[nzTwotoneColor]` | Only support the two-tone icon. Specific the primary color. | `string (hex color)` | - |
| `[nzIconfont]` | Type of the icon from iconfont | `string` | - |
| `[nzRotate]` | Rotate degrees (since 7.0.0) | `number` | - |
| `[nzRotate]` | Rotate degrees | `number` | - |

<blockquote style="border-color: red;"><p><strong>API that is not started with nz and old API that is based on icon class names would be deprecated in 8.0.0. Please migrate.</strong></p></blockquote>

Expand All @@ -55,7 +55,7 @@ import { NzIconModule } from 'ng-zorro-antd/icon';

### SVG icons

After `1.7.0` version,we synced to Ant Design `3.9.x` and replaced font icons with svg icons which bring benefits below:
We synced to Ant Design and replaced font icons with svg icons which bring benefits below:

- Complete offline usage of icon, no dependency of alipay cdn font icon file and no more empty square during downloading.
- Much more display accuracy in lower-level screens.
Expand All @@ -64,7 +64,7 @@ After `1.7.0` version,we synced to Ant Design `3.9.x` and replaced font icons

You can join in [this dicussion of Ant Design](https://github.com/ant-design/ant-design/issues/10353).

NG-ZORRO hadn't provided an icon component. Instead, icon based on font files was provided. In `1.7.0`, we make this new directive compatible to old API. If you make no changes to your existing code, old icons would be dynamically loaded as `outline` icons. But the best pratice is always to use `nz-icon` directive and specify the `theme` prop.
NG-ZORRO hadn't provided an icon component. Instead, icon based on font files was provided. We make this new directive compatible to old API. If you make no changes to your existing code, old icons would be dynamically loaded as `outline` icons. But the best pratice is always to use `nz-icon` directive and specify the `theme` prop.

```html
<i nz-icon [nzType]="'star'" [theme]="'fill'"></i>
Expand Down Expand Up @@ -134,8 +134,6 @@ Dynamic importing. This way would not increase your bundle's size. When NG-ZORRO
}
```

We provide a schematic to fix this. Just simply run `ng g ng-zorro-antd:fix-icon` and we would add this config above for you!

You can call `changeAssetsSource()` of `NzIconService` to change the location of your icon assets, so that you can deploy these icon assets to cdn. The parameter you passed would be add in front of `assets/`.

Let's assume that you deploy static assets under `https://mycdn.somecdn.com/icons/assets`. You can call `changeAssetsSource('https://mycdn.somecdn.com/icons')` to tell NG-ZORRO that all your resources are located there.
Expand Down Expand Up @@ -176,7 +174,7 @@ See [iconfont.cn](http://iconfont.cn/help/detail?spm=a313x.7781069.1998910419.15

### Namespace

After `7.0.0-rc.4`, we introduced namespace so you could add your own icons in a convenient way. When you wan to render an icon, you could assign `type` `namespace:name`. Dynamic importing and static importing are both supported.
We introduced namespace so you could add your own icons in a convenient way. When you wan to render an icon, you could assign `type` `namespace:name`. Dynamic importing and static importing are both supported.

Static importing. Invoke `addIconLiteral` of `NzIconService`.

Expand Down
10 changes: 4 additions & 6 deletions components/icon/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
| `[nzSpin]` | 是否有旋转动画 | `boolean` | `false` |
| `[nzTwotoneColor]` | 仅适用双色图标,设置双色图标的主要颜色,仅对当前 icon 生效 | `string (十六进制颜色)` | - |
| `[nzIconfont]` | 指定来自 IconFont 的图标类型 | string | - |
| `[nzRotate]` | 图标旋转角度(7.0.0 开始支持) | `number` | - |
| `[nzRotate]` | 图标旋转角度 | `number` | - |

<blockquote style="border-color: red;"><p><strong>不加上 nz 前缀的 API,以及原使用 icon 类名的 API 将会在 8.0.0 及之后不被支持,请及时迁移。</strong></p></blockquote>

Expand All @@ -57,7 +57,7 @@ import { NzIconModule } from 'ng-zorro-antd/icon';

### SVG 图标

`1.7.0` 版本开始,我们与 Ant Design `3.9.x` 同步,使用了 svg 图标替换了原先的 font 图标,从而带来了以下优势:
我们与 Ant Design 同步,使用了 svg 图标替换了原先的 font 图标,从而带来了以下优势:

- 完全离线化使用,不需要从支付宝 cdn 下载字体文件,图标不会因为网络问题呈现方块,同时还支持本地部署。
- 在低端设备上 SVG 有更好的清晰度。
Expand Down Expand Up @@ -136,8 +136,6 @@ export class AppModule {
}
```

我们为你提供了一条指令,升级到 1.7.0 之后,执行 `ng g ng-zorro-antd:fix-icon` 命令,就会自动添加以上配置。

你可以通过 `NzIconService``changeAssetsSource()` 方法来修改图标资源的位置,这样你就可以部署这些资源到 cdn 上。你的参数会被直接添加到 `assets/` 的前面。

例如,你在 `https://mycdn.somecdn.com/icons/assets` 目录下部署了静态资源文件,那么你就可以通过调用 `changeAssetsSource('https://mycdn.somecdn.com/icons')`,来告诉 NG-ZORRO 从这个位置动态加载图标资源。
Expand All @@ -152,7 +150,7 @@ export class AppModule {

### 自定义 font 图标

`1.7.0` 版本开始,我们提供了一个 `fetchFromIconfont` 方法,方便开发者调用在 iconfont.cn 上自行管理的图标。
我们提供了一个 `fetchFromIconfont` 方法,方便开发者调用在 iconfont.cn 上自行管理的图标。

```ts
this._iconService.fetchFromIconfont({
Expand All @@ -178,7 +176,7 @@ this._iconService.fetchFromIconfont({

### 命名空间

`7.0.0-rc.4` 版本开始提供命名空间功能,用户可以使用该功能方便地添加自己的 icon。在渲染一个自定义 icon 时,只需要将 `type` 指定为 `namespace:name` 的形式,icon 组件就会在用户自行添加的图标中进行检索并渲染。同时支持静态和动态引入。
用户可以使用该功能方便地添加自己的 icon。在渲染一个自定义 icon 时,只需要将 `type` 指定为 `namespace:name` 的形式,icon 组件就会在用户自行添加的图标中进行检索并渲染。同时支持静态和动态引入。

静态引入,只需要调用 `NzIconService``addIconLiteral` 方法即可。

Expand Down
6 changes: 3 additions & 3 deletions components/menu/nz-submenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ import { NzSubmenuService } from './nz-submenu.service';
templateUrl: './nz-submenu.component.html',
styles: [
`
.ant-menu-submenu-placement-bottomLeft {
:root .ant-menu-submenu.ant-menu-submenu-placement-bottomLeft {
top: 6px;
position: relative;
}
.ant-menu-submenu-placement-rightTop {
:root .ant-menu-submenu.ant-menu-submenu-placement-rightTop {
left: 4px;
position: relative;
}
.ant-menu-submenu-placement-leftTop {
:root .ant-menu-submenu.ant-menu-submenu-placement-leftTop {
right: 4px;
position: relative;
}
Expand Down
4 changes: 2 additions & 2 deletions components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"url": "https://github.com/NG-ZORRO/ng-zorro-antd/issues"
},
"dependencies": {
"date-fns": "^1.29.0",
"date-fns": "^1.30.1",
"@angular/cdk": "~8.0.0",
"@ant-design/icons-angular": "~8.0.0-beta.0"
"@ant-design/icons-angular": "^8.0.0"
},
"peerDependencies": {
"@angular/animations": "~8.0.0",
Expand Down
Loading

0 comments on commit 7c135e0

Please sign in to comment.