diff --git a/.angular-cli.json b/.angular-cli.json new file mode 100644 index 00000000000..549dd80bace --- /dev/null +++ b/.angular-cli.json @@ -0,0 +1,59 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "ng-zorro-antd" + }, + "apps": [ + { + "root": "src", + "outDir": "doc", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "nz", + "styles": [ + ], + "scripts": [], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "lint": [ + { + "project": "src/tsconfig.app.json", + "exclude": "**/node_modules/**" + }, + { + "project": "src/tsconfig.spec.json", + "exclude": "**/node_modules/**" + }, + { + "project": "e2e/tsconfig.e2e.json", + "exclude": "**/node_modules/**" + } + ], + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "less", + "component": {} + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..6e87a003da8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000000..1dc1b0e3330 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,56 @@ + + +## I'm submitting a... + +
+[ ] Bug report
+[ ] Feature request
+[ ] Documentation issue or request
+[ ] Regression (a behavior that used to work and stopped working in a new release)
+[ ] Support request => Please do not submit support request here
+
+
+## Current behavior
+
+
+
+## Expected behavior
+
+
+
+## Minimal reproduction of the problem with instructions
+
+
+## What is the motivation / use case for changing the behavior?
+
+
+
+## Environment
+
+
+Angular version: X.Y.Z
+
+ng-zorro-antd version: X.Y.Z
+
+Browser:
+- [ ] Chrome (desktop) version XX
+- [ ] Firefox version XX
+- [ ] Safari (desktop) version XX
+- [ ] IE version XX
+
+For Tooling issues:
+- Node version: XX
+- Platform:
+
+Others:
+
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..9da9dabe526
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,47 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+
+# compiled output
+/dist
+/doc
+/tmp
+/out-tsc
+
+
+
+/src/release
+# dependencies
+/node_modules
+
+# IDEs and editors
+/.idea
+.project
+.classpath
+.c9/
+*.launch
+.settings/
+*.sublime-workspace
+
+# IDE - VSCode
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+
+# misc
+/.sass-cache
+/connect.lock
+/coverage
+/libpeerconnection.log
+npm-debug.log
+testem.log
+/typings
+yarn-error.log
+
+# e2e
+/e2e/*.js
+/e2e/*.map
+
+# System Files
+.DS_Store
+Thumbs.db
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 00000000000..d2e8955c7c3
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,45 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+
+# compiled output
+/dist
+/tmp
+/out-tsc
+
+
+.github
+# dependencies
+/node_modules
+
+# IDEs and editors
+/.idea
+.project
+.classpath
+.c9/
+*.launch
+.settings/
+*.sublime-workspace
+
+# IDE - VSCode
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+
+# misc
+/.sass-cache
+/connect.lock
+/coverage
+/libpeerconnection.log
+npm-debug.log
+testem.log
+/typings
+yarn-error.log
+
+# e2e
+/e2e/*.js
+/e2e/*.map
+
+# System Files
+.DS_Store
+Thumbs.db
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000000..94f31783748
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,31 @@
+sudo: required
+dist: trusty
+language: node_js
+node_js:
+ - '6.10'
+branches:
+ only:
+ - master
+
+addons:
+apt:
+ sources:
+ - google-chrome
+ packages:
+ - google-chrome-stable
+ - google-chrome-beta
+
+before_install:
+ - export CHROME_BIN=chromium-browser
+ - export DISPLAY=:99.0
+ - sh -e /etc/init.d/xvfb start
+
+before_script:
+- npm install -g @angular/cli
+- npm install -g karma
+- npm install
+- ng build
+
+script:
+- npm run test
+- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
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
new file mode 100644
index 00000000000..55938ce1170
--- /dev/null
+++ b/README-zh_CN.md
@@ -0,0 +1,62 @@
++ + + +
+ +# NG-ZORRO +[![Build Status](https://travis-ci.org/NG-ZORRO/ng-zorro-antd.svg?branch=master)](https://travis-ci.org/NG-ZORRO/ng-zorro-antd) +[![Gitter](https://badges.gitter.im/ng-zorro/ng-zorro-antd.svg)](https://gitter.im/ng-zorro/ng-zorro-antd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +这里是 Ant Design 的 Angular 4.0 实现,开发和服务于企业级后台产品。 + +[README in English](README.md) + +## 特性 + +- 提炼自企业级中后台产品的交互语言和视觉风格,定期与Ant Design React版本保持更新一致。 +- 开箱即用的高质量 Angular 组件。 +- 使用 TypeScript 构建,提供完整的类型定义文件。 + +## 支持环境 + +* 现代浏览器和 IE9 以上(需要 [polyfills](https://angular.cn/guide/browser-support))。 + +## 兼容版本 + +当前支持Angular`^4.0.0`版本 + + +## 安装 + +**我们推荐使用 npm 方式进行开发**,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。 + +```bash +$ npm install ng-zorro-antd --save +``` + +如果你的网络环境不佳,推荐使用 [cnpm](https://github.com/cnpm/cnpm)。 + +## 标准开发 + +实际项目开发中,你会需要对 TypeScript 代码的构建、调试、代理、打包部署等一系列工程化的需求。 +我们推荐官方的 `@angular/cli` 工具链辅助进行开发 + +如果你想了解更多CLI工具链的功能和命令,建议访问[Angular CLI](https://github.com/angular/angular-cli)了解更多 + + + +## 链接 + +- [首页](http://ng.ant.design) +- [Angular官方文档](https://angular.cn/) +- [开发脚手架](https://cli.angular.io/) +- [TypeScript](https://www.typescriptlang.org/) +- [RxJS 5](https://github.com/ReactiveX/rxjs) + + +## 如何贡献 + +如果你希望参与贡献,欢迎 [Pull Request](https://github.com/NG-ZORRO/ng-zorro-antd/pulls),或给我们 [报告 Bug](https://github.com/NG-ZORRO/ng-zorro-antd/issues)。 + +> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。 diff --git a/README.md b/README.md new file mode 100644 index 00000000000..09d8139ada8 --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ ++ + + +
+ +# NG-ZORRO +[![Build Status](https://travis-ci.org/NG-ZORRO/ng-zorro-antd.svg?branch=master)](https://travis-ci.org/NG-ZORRO/ng-zorro-antd) +[![Gitter](https://badges.gitter.im/ng-zorro/ng-zorro-antd.svg)](https://gitter.im/ng-zorro/ng-zorro-antd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +An enterprise-class UI components based on Ant Design and Angular. + +[中文 README](README-zh_CN.md) + + +## Features + +- An enterprise-class UI design language for web applications. +- A set of high-quality Angular components out of the box. +- Written in TypeScript with complete define types. + +## Environment Support + +* Modern browsers and Internet Explorer 9+(with [polyfills](https://angular.cn/guide/browser-support))。 + +## Angular Version Support + +* Angular`^4.0.0` + + +## Install + +```bash +$ npm install ng-zorro-antd --save +``` + +## Development + +```bash +$ git clone git@github.com:NG-ZORRO/ng-zorro-antd.git +$ npm install +$ npm start +``` + + +## Links + +- [Home page](http://ng.ant.design) +- [Angular](https://angular.io/) +- [Angular CLI](https://cli.angular.io/) +- [TypeScript](https://www.typescriptlang.org/) +- [RxJS 5](https://github.com/ReactiveX/rxjs) + + +## Contributing + +You can submit any ideas as [pull request](https://github.com/NG-ZORRO/ng-zorro-antd/pulls),or as [GitHub issues](https://github.com/NG-ZORRO/ng-zorro-antd/issues)。 diff --git a/build.sh b/build.sh new file mode 100755 index 00000000000..f02f706939a --- /dev/null +++ b/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +readonly currentDir=$(cd $(dirname $0); pwd) +cd ${currentDir} +rm -rf src/release +cp -r src/components src/__gen_components +node ./less.convert.js +cd src/__gen_components && ../../node_modules/@angular/compiler-cli/src/main.js +cd .. && rm -rf __gen_components diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts new file mode 100644 index 00000000000..297f0237cc0 --- /dev/null +++ b/e2e/app.e2e-spec.ts @@ -0,0 +1,14 @@ +import { AppPage } from './app.po'; + +describe('ng-zorro-antd App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getParagraphText()).toEqual('Welcome to app!'); + }); +}); diff --git a/e2e/app.po.ts b/e2e/app.po.ts new file mode 100644 index 00000000000..82ea75ba504 --- /dev/null +++ b/e2e/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo() { + return browser.get('/'); + } + + getParagraphText() { + return element(by.css('app-root h1')).getText(); + } +} diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json new file mode 100644 index 00000000000..1d9e5edf096 --- /dev/null +++ b/e2e/tsconfig.e2e.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "baseUrl": "./", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 00000000000..5daf4eba658 Binary files /dev/null and b/favicon.ico differ diff --git a/index.showcase.ts b/index.showcase.ts new file mode 100644 index 00000000000..7f810cb6881 --- /dev/null +++ b/index.showcase.ts @@ -0,0 +1,2 @@ +// [NOTE] Temporary solution for local developing (ONLY used by "showcase/*") +export * from './src/components/ng-zorro-antd.module'; diff --git a/index.ts b/index.ts new file mode 100644 index 00000000000..7e3898fb320 --- /dev/null +++ b/index.ts @@ -0,0 +1 @@ +export * from './src/release/ng-zorro-antd.module'; diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 00000000000..af139fada36 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,33 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular/cli'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular/cli/plugins/karma') + ], + client:{ + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + reports: [ 'html', 'lcovonly' ], + fixWebpackSourcePaths: true + }, + angularCli: { + environment: 'dev' + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; diff --git a/less.convert.js b/less.convert.js new file mode 100644 index 00000000000..7bd88420642 --- /dev/null +++ b/less.convert.js @@ -0,0 +1,115 @@ +"use strict"; + +let fs = require('fs'); +let pathUtil = require('path'); +let less = require("less"); + +let genDistPath = pathUtil.join(__dirname, 'src', '__gen_components', 'release'); +let genPath = pathUtil.join(__dirname, 'src', '__gen_components'); +let lessFilePool = []; +let handledLessFileCount = 0; + +let tsFileTester = /\.ts$/; +let stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g; +let stringRegex = /(['"])((?:[^\\]\\\1|.)*?)\1/g; +let lessNumRegex = /style_(\d+)_less/g; + +function getTsFile(path, parse) { + try { + if (fs.statSync(path).isFile() && tsFileTester.test(path)) { + parse(path) + } else if (fs.statSync(path).isDirectory() && path.indexOf(genDistPath) < 0) { + // 单是一个文件夹且不是dist文件夹的情况下 + let paths = fs.readdirSync(path); + paths.forEach(function (p) { + getTsFile(pathUtil.join(path, p), parse); + }) + } + } catch (err) { + throw err; + } +} + +function transformStyleUrls(path) { + let content = fs.readFileSync(path); + if (stylesRegex.test(content)) { + let contentTemp = content.toString().replace(stylesRegex, function (match, urls) { + return "styles:" + urls.replace(stringRegex, function (match, quote, url) { + lessFilePool.push(pathUtil.resolve(pathUtil.dirname(path), url)) + let result = 'style_' + handledLessFileCount + '_less'; + handledLessFileCount += 1; + return result; + }) + }) + fs.writeFileSync(path, contentTemp); + } +} + +function doneOne() { + handledLessFileCount += 1; + // 说明所有处理完成。 + if (handledLessFileCount === lessFilePool.length) { + writeBack(); + } +} + +function writeBack() { + console.log("start to write back"); + getTsFile(genPath, writeBackCss); + console.log('Done'); +} + +function writeBackCss(path) { + let content = fs.readFileSync(path); + if (lessNumRegex.test(content)) { + let contentTemp = content.toString().replace(lessNumRegex, function (match, index) { + return '`' + lessFilePool[index] + '`'; + }); + fs.writeFileSync(path, contentTemp); + } +} + +function processLess() { + let index = 0; + while (index < lessFilePool.length) { + (function (index) { + // debugger + fs.readFile(lessFilePool[index], function (e, data) { + less.render(data.toString(), { + filename: lessFilePool[index] + }, function (e, output) { + lessFilePool[index] = output.css.replace(/\\e/g, function (match, e) { + // 对content中的类似'\e630'中的\e进行处理 + return '\\\\e'; + }).replace(/\\E/g, function (match, e) { + // 对content中的类似'\E630'中的\E进行处理 + return '\\\\E'; + }).replace(/\\20/g, function (match, e) { + // 对content中的类似'\20'中的\20进行处理 + return '\\\\20'; + }).replace(/`/g, function (match, e) { + // 处理css中`符号 + return "'"; + }); + doneOne(); + }) + }) + })(index); + index += 1 + } +} + +function process() { + // 把所有ts文件,引入的less文件的完整路径放到全局list里面, 并且对源文件进行占坑 + getTsFile(genPath, transformStyleUrls); + // 重置文件处理进度的计数器 + handledLessFileCount = 0; + // 对list里面的每一个less文件进行翻译并触发css回写 + console.log("start to translate from less 2 css"); + processLess(); +} + +console.log('prepare...'); +// 转换操作 +process(); + diff --git a/package.json b/package.json new file mode 100644 index 00000000000..c2d38879e89 --- /dev/null +++ b/package.json @@ -0,0 +1,83 @@ +{ + "name": "ng-zorro-antd", + "version": "0.5.0-rc.0", + "license": "MIT", + "description": "An enterprise-class UI components based on Ant Design and Angular", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build --prod", + "doc": "ng build --prod", + "release": "./build.sh && ng build --prod", + "test": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng test --single-run --code-coverage", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "main": "./index.ts", + "keywords": [ + "ant", + "design", + "angular", + "ui", + "framework", + "frontend" + ], + "homepage": "https://ng.ant.design", + "repository": { + "type": "git", + "url": "https://github.com/NG-ZORRO/ng-zorro-antd" + }, + "bugs": { + "url": "https://github.com/NG-ZORRO/ng-zorro-antd/issues" + }, + "dependencies": { + "moment": "^2.18.1", + "@angular/cdk": "^2.0.0-beta.8", + "@angular/animations": "^4.0.0", + "@angular/common": "^4.0.0", + "@angular/core": "^4.0.0", + "@angular/forms": "^4.0.0", + "@angular/platform-browser": "^4.0.0", + "rxjs": "^5.0.1", + "zone.js": "^0.8.14" + }, + "devDependencies": { + "@angular/cli": "1.3.0", + "@angular/compiler": "^4.0.0", + "@angular/compiler-cli": "^4.0.0", + "@angular/http": "^4.0.0", + "@angular/language-service": "^4.0.0", + "@angular/platform-browser-dynamic": "^4.0.0", + "@angular/router": "^4.0.0", + "@types/jasmine": "~2.5.53", + "@types/jasminewd2": "~2.0.2", + "@types/node": "~6.0.60", + "classlist.js": "^1.1.20150312", + "codelyzer": "~3.1.1", + "core-js": "^2.4.1", + "coveralls": "^2.13.1", + "highlight.js": "^9.12.0", + "intl": "^1.2.5", + "jasmine-core": "~2.6.2", + "jasmine-spec-reporter": "~4.1.0", + "karma": "~1.7.0", + "karma-chrome-launcher": "~2.1.1", + "karma-cli": "~1.0.1", + "karma-coverage-istanbul-reporter": "^1.2.1", + "karma-jasmine": "~1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "marked": "^0.3.6", + "protractor": "~5.1.2", + "ts-node": "~3.2.0", + "tslint": "~5.3.2", + "typescript": "~2.3.3", + "web-animations-js": "^2.3.1" + }, + "peerDependencies": { + "moment": "^2.18.1", + "@angular/cdk": "^2.0.0-beta.8", + "@angular/core": "^4.0.0", + "@angular/common": "^4.0.0", + "@angular/forms": "^4.0.0" + } +} diff --git a/protractor.conf.js b/protractor.conf.js new file mode 100644 index 00000000000..7ee3b5ee863 --- /dev/null +++ b/protractor.conf.js @@ -0,0 +1,28 @@ +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter } = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './e2e/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: 'e2e/tsconfig.e2e.json' + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; diff --git a/source.ts b/source.ts new file mode 100644 index 00000000000..85d35b27170 --- /dev/null +++ b/source.ts @@ -0,0 +1,2 @@ +// export source file +export * from './src/components/ng-zorro-antd.module'; diff --git a/src/assets/download/fonts.zip b/src/assets/download/fonts.zip new file mode 100644 index 00000000000..62913b204c6 Binary files /dev/null and b/src/assets/download/fonts.zip differ diff --git a/src/assets/fonts/Lato/Lato-Black.ttf b/src/assets/fonts/Lato/Lato-Black.ttf new file mode 100644 index 00000000000..f839e5c7ca7 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Black.ttf differ diff --git a/src/assets/fonts/Lato/Lato-Black.woff b/src/assets/fonts/Lato/Lato-Black.woff new file mode 100644 index 00000000000..d68dc376d00 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Black.woff differ diff --git a/src/assets/fonts/Lato/Lato-Black.woff2 b/src/assets/fonts/Lato/Lato-Black.woff2 new file mode 100644 index 00000000000..0cd657290a5 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Black.woff2 differ diff --git a/src/assets/fonts/Lato/Lato-Light.ttf b/src/assets/fonts/Lato/Lato-Light.ttf new file mode 100644 index 00000000000..13fdee5a1e5 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Light.ttf differ diff --git a/src/assets/fonts/Lato/Lato-Light.woff b/src/assets/fonts/Lato/Lato-Light.woff new file mode 100644 index 00000000000..d645e0e97e3 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Light.woff differ diff --git a/src/assets/fonts/Lato/Lato-Light.woff2 b/src/assets/fonts/Lato/Lato-Light.woff2 new file mode 100644 index 00000000000..f0611d5c9af Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Light.woff2 differ diff --git a/src/assets/fonts/Lato/Lato-Regular.eot b/src/assets/fonts/Lato/Lato-Regular.eot new file mode 100644 index 00000000000..0dd6542b0e9 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Regular.eot differ diff --git a/src/assets/fonts/Lato/Lato-Regular.svg b/src/assets/fonts/Lato/Lato-Regular.svg new file mode 100644 index 00000000000..55b43fb86a0 --- /dev/null +++ b/src/assets/fonts/Lato/Lato-Regular.svg @@ -0,0 +1,435 @@ + + + diff --git a/src/assets/fonts/Lato/Lato-Regular.ttf b/src/assets/fonts/Lato/Lato-Regular.ttf new file mode 100644 index 00000000000..acc89d61194 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Regular.ttf differ diff --git a/src/assets/fonts/Lato/Lato-Regular.woff b/src/assets/fonts/Lato/Lato-Regular.woff new file mode 100644 index 00000000000..cffe912751b Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Regular.woff differ diff --git a/src/assets/fonts/Lato/Lato-Regular.woff2 b/src/assets/fonts/Lato/Lato-Regular.woff2 new file mode 100644 index 00000000000..63ea29229a6 Binary files /dev/null and b/src/assets/fonts/Lato/Lato-Regular.woff2 differ diff --git a/src/assets/fonts/Raleway/OFL.txt b/src/assets/fonts/Raleway/OFL.txt new file mode 100755 index 00000000000..1c9779ddcd0 --- /dev/null +++ b/src/assets/fonts/Raleway/OFL.txt @@ -0,0 +1,94 @@ +Copyright (c) 2010, Matt McInerney (matt@pixelspread.com), +Copyright (c) 2011, Pablo Impallari (www.impallari.com|impallari@gmail.com), +Copyright (c) 2011, Rodrigo Fuenzalida (www.rfuenzalida.com|hello@rfuenzalida.com), with Reserved Font Name Raleway +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/src/assets/fonts/Raleway/Raleway-Black.ttf b/src/assets/fonts/Raleway/Raleway-Black.ttf new file mode 100755 index 00000000000..c5fe5ebe253 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Black.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Black.woff b/src/assets/fonts/Raleway/Raleway-Black.woff new file mode 100644 index 00000000000..9c98fb46c0b Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Black.woff differ diff --git a/src/assets/fonts/Raleway/Raleway-Black.woff2 b/src/assets/fonts/Raleway/Raleway-Black.woff2 new file mode 100644 index 00000000000..ee07085f5e9 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Black.woff2 differ diff --git a/src/assets/fonts/Raleway/Raleway-BlackItalic.ttf b/src/assets/fonts/Raleway/Raleway-BlackItalic.ttf new file mode 100755 index 00000000000..2b2e65c004f Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-BlackItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Bold.ttf b/src/assets/fonts/Raleway/Raleway-Bold.ttf new file mode 100755 index 00000000000..38c099cc857 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Bold.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-BoldItalic.ttf b/src/assets/fonts/Raleway/Raleway-BoldItalic.ttf new file mode 100755 index 00000000000..eac54e782bc Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-BoldItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-ExtraBold.ttf b/src/assets/fonts/Raleway/Raleway-ExtraBold.ttf new file mode 100755 index 00000000000..502ff863817 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-ExtraBold.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-ExtraBoldItalic.ttf b/src/assets/fonts/Raleway/Raleway-ExtraBoldItalic.ttf new file mode 100755 index 00000000000..09e0243fee7 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-ExtraBoldItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-ExtraLight.ttf b/src/assets/fonts/Raleway/Raleway-ExtraLight.ttf new file mode 100755 index 00000000000..7611e96c328 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-ExtraLight.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-ExtraLightItalic.ttf b/src/assets/fonts/Raleway/Raleway-ExtraLightItalic.ttf new file mode 100755 index 00000000000..3d07c1e7a8c Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-ExtraLightItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Italic.ttf b/src/assets/fonts/Raleway/Raleway-Italic.ttf new file mode 100755 index 00000000000..237d88d9011 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Italic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Light.ttf b/src/assets/fonts/Raleway/Raleway-Light.ttf new file mode 100755 index 00000000000..e6c9a8d8b02 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Light.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Light.woff b/src/assets/fonts/Raleway/Raleway-Light.woff new file mode 100644 index 00000000000..956f619a3f6 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Light.woff differ diff --git a/src/assets/fonts/Raleway/Raleway-Light.woff2 b/src/assets/fonts/Raleway/Raleway-Light.woff2 new file mode 100644 index 00000000000..cb25b8db376 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Light.woff2 differ diff --git a/src/assets/fonts/Raleway/Raleway-LightItalic.ttf b/src/assets/fonts/Raleway/Raleway-LightItalic.ttf new file mode 100755 index 00000000000..7ba0de815bf Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-LightItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Medium.ttf b/src/assets/fonts/Raleway/Raleway-Medium.ttf new file mode 100755 index 00000000000..7a71a6ff031 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Medium.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-MediumItalic.ttf b/src/assets/fonts/Raleway/Raleway-MediumItalic.ttf new file mode 100755 index 00000000000..43ed49a19b4 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-MediumItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Regular.ttf b/src/assets/fonts/Raleway/Raleway-Regular.ttf new file mode 100755 index 00000000000..e570a2d5c39 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Regular.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-SemiBold.ttf b/src/assets/fonts/Raleway/Raleway-SemiBold.ttf new file mode 100755 index 00000000000..a2f980b6b98 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-SemiBold.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-SemiBold.woff b/src/assets/fonts/Raleway/Raleway-SemiBold.woff new file mode 100644 index 00000000000..dabd35c73b2 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-SemiBold.woff differ diff --git a/src/assets/fonts/Raleway/Raleway-SemiBold.woff2 b/src/assets/fonts/Raleway/Raleway-SemiBold.woff2 new file mode 100644 index 00000000000..80748034a73 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-SemiBold.woff2 differ diff --git a/src/assets/fonts/Raleway/Raleway-SemiBoldItalic.ttf b/src/assets/fonts/Raleway/Raleway-SemiBoldItalic.ttf new file mode 100755 index 00000000000..36b79515419 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-SemiBoldItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-Thin.ttf b/src/assets/fonts/Raleway/Raleway-Thin.ttf new file mode 100755 index 00000000000..a497b98a868 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-Thin.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway-ThinItalic.ttf b/src/assets/fonts/Raleway/Raleway-ThinItalic.ttf new file mode 100755 index 00000000000..38008b9af58 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway-ThinItalic.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway.eot b/src/assets/fonts/Raleway/Raleway.eot new file mode 100644 index 00000000000..1c45e815484 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway.eot differ diff --git a/src/assets/fonts/Raleway/Raleway.svg b/src/assets/fonts/Raleway/Raleway.svg new file mode 100644 index 00000000000..35870707df8 --- /dev/null +++ b/src/assets/fonts/Raleway/Raleway.svg @@ -0,0 +1,347 @@ + + + diff --git a/src/assets/fonts/Raleway/Raleway.ttf b/src/assets/fonts/Raleway/Raleway.ttf new file mode 100644 index 00000000000..71477085ca6 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway.ttf differ diff --git a/src/assets/fonts/Raleway/Raleway.woff b/src/assets/fonts/Raleway/Raleway.woff new file mode 100644 index 00000000000..84e4bc50113 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway.woff differ diff --git a/src/assets/fonts/Raleway/Raleway.woff2 b/src/assets/fonts/Raleway/Raleway.woff2 new file mode 100644 index 00000000000..7cb70315ff1 Binary files /dev/null and b/src/assets/fonts/Raleway/Raleway.woff2 differ diff --git a/src/assets/fonts/iconfont.eot b/src/assets/fonts/iconfont.eot new file mode 100644 index 00000000000..d918a5477d2 Binary files /dev/null and b/src/assets/fonts/iconfont.eot differ diff --git a/src/assets/fonts/iconfont.svg b/src/assets/fonts/iconfont.svg new file mode 100644 index 00000000000..a9583b24e06 --- /dev/null +++ b/src/assets/fonts/iconfont.svg @@ -0,0 +1,923 @@ + + + diff --git a/src/assets/fonts/iconfont.ttf b/src/assets/fonts/iconfont.ttf new file mode 100644 index 00000000000..0ebc42fb7be Binary files /dev/null and b/src/assets/fonts/iconfont.ttf differ diff --git a/src/assets/fonts/iconfont.woff b/src/assets/fonts/iconfont.woff new file mode 100644 index 00000000000..4241815a760 Binary files /dev/null and b/src/assets/fonts/iconfont.woff differ diff --git a/src/assets/img/angular.svg b/src/assets/img/angular.svg new file mode 100644 index 00000000000..bf081acb129 --- /dev/null +++ b/src/assets/img/angular.svg @@ -0,0 +1,16 @@ + + + diff --git a/src/assets/img/antd.svg b/src/assets/img/antd.svg new file mode 100644 index 00000000000..c03bd4ae9b8 --- /dev/null +++ b/src/assets/img/antd.svg @@ -0,0 +1,32 @@ + + diff --git a/src/assets/img/zorro.png b/src/assets/img/zorro.png new file mode 100644 index 00000000000..241fd70249a Binary files /dev/null and b/src/assets/img/zorro.png differ diff --git a/src/assets/img/zorro.svg b/src/assets/img/zorro.svg new file mode 100644 index 00000000000..efe4edd1dc6 --- /dev/null +++ b/src/assets/img/zorro.svg @@ -0,0 +1,36 @@ + + + diff --git a/src/components/alert/nz-alert.component.ts b/src/components/alert/nz-alert.component.ts new file mode 100644 index 00000000000..138fcd20622 --- /dev/null +++ b/src/components/alert/nz-alert.component.ts @@ -0,0 +1,89 @@ +/** + * @author MoXun + */ +import { + Component, + ViewEncapsulation, + Input, + Output, + EventEmitter +} from '@angular/core'; +import { FadeAnimation } from '../core/animation/fade-animations'; + +@Component({ + selector : 'nz-alert', + encapsulation: ViewEncapsulation.None, + animations : [ FadeAnimation ], + template : ` + + `, + styleUrls : [ + './style/index.less', + './style/patch.less' + ] +}) + +export class NzAlertComponent { + _display = true; + @Input() nzType = 'info'; + @Input() nzBanner = false; + @Input() nzCloseable = false; + @Input() nzDescription: string; + @Input() nzShowIcon = false; + @Input() nzCloseText: string; + @Input() nzMessage: string; + @Output() nzOnClose: EventEmitter{{p}}
+ {{_min}} + | +|
---|---|
+
+
+ {{day.number}}
+
+
+ |
+
+ {{day.number}}
+ |
+
+
+
+ {{month.name}}
+
+
+ |
+
+
+ {{month.name}}
+
+ |
+
+ +
++ +
++ +
++ +
++ {{_startDecade - 1}} + | ++ {{_startDecade + td}} + | ++ {{_startDecade + 1}} + | +