diff --git a/README.md b/README.md index 146094052..1f7abe7cd 100644 --- a/README.md +++ b/README.md @@ -1,156 +1,9 @@ -# naive-ui -TuSimple Vue-Based Frontend Component Library +

+ +

+ +

Naive UI

+

A style first Vue-based component library.

+ ## Documentation -[http://***REMOVED***/#/start](http://***REMOVED***/#/start) -## Repository -[https://***REMOVED***/naive-ui/tree/develop](https://***REMOVED***/naive-ui/tree/develop) -## Develop Guidelines -### Git Commit Message Style -You **MUST** follow [Angular Commit Format](https://gist.github.com/brianclements/841ea7bffdb01346392c). - -If you want see some example, see [Angular Commits on Github](https://github.com/angular/angular/commits/master). -### Code Styles -#### Javascript Style -You **MUST** follow [Standard JS](https://standardjs.com/). -#### SCSS Style -Run `npm run lint-style` to check styles. -#### Check Both -Run `npm run lint` -You **MUST** fix all lint warnings and errors before you push your branch. -### Unit test -If you create a component, you **MUST** add unit test for it. - -Run `npm run test` to test all components. -Run `npm run test-cov` to test all components and see detailed test coverage report. - -## Want to see how component works -1. Run `npm run dev` -2. Open `http://localhost:8086/` in browser. - -## Want to add your own component -There is no guideline for now. If you want to know how to do it, you can explore by yourself or ask `lecong.zhang@tusimple.ai`. - -## Publish a new version -1. You **MUST** change your version according to [semver](https://semver.org/) -2. `npm run release` -3. You **MAY** publish documentation by running `npm run release-doc` - -## Installation & Usage -First install it. - -```bash -npm install --save-dev naive-ui -``` -Then add the following lines in you entry point js file. -```js -import naiveUi from 'naive-ui' -import 'naive-ui/dist/lib/index.css' - -Vue.use(naiveUi) -``` -## Component Develop Status -|Component|Develop status|Unit Test|Note| -|--|:--:|:--:|--| -|Alert|😍|❌|| -|Button|😍|🆗|| -|Checkbox|😍|🆗|| -|DatePicker|😍|❌|| -|TimePicker|😍|❌|| -|GradientText|😍|🆗|| -|Icon|😍|🆗|| -|Input|😍|🆗|| -|Message|😍|❌|Code clean in need| -|Modal|😍|❌|Code clean in need| -|Notification|😍|❌|Code clean in need| -|Pagination|😍|🆗|Unit test is not enough| -|Select|😍|🆗|Multiple search is not done| -|Switch|😍|❌|| -|Tooltip|😍|❌|| -|Popover|😍|❌|| -|InputNumber|😍|❌|| -|Radio|😍||| -|Tab|😍||| -|Badge|😍||| -|Steps|😍||| -|Tag|😍||| -|Divider|😍||| -|Popconfirm|😍||| -|BackTop|😍||| -|Progress|😍||Multiple Value| -|Timeline|😍||| -|Collapse|😍||| -|Cascader|😍||| -|Dropdown|😍||| -|Transfer|😍||| -|Spin|😍||| -|Drawer|🤔||| -|FormItem|🤔|❌|| -|Form|🤔|❌|| -|Table|🤔|❌|Function is not fulfilled| -|Slider|🤔||| -|LoadingBar|😍||| -|AutoComplete|🚧||| -|Tree|🤔||| -|TreeSelect|🚧||| -|Upload|🚧||| -|Time|🚧||| -|Anchor|🚧||| -|Statistic|🚧||| -|Breadcrumb|🚧||| -|Card|🚧||| -|Empty|🚧||| -|Grid|🚧||| -|Layout|🚧||| -|Affix|🚧||| -|Rating|🚧||| -|Avator|🚧||| -|Result|🚧||| -|Menu|✋||Not Planned| -|Typography|✋||Not Planned| -|Mentions|✋||Not Planned| -|Calendar|✋||Not Planned| -|Carousel|✋||Not Planned| - -1. Z-index management on `Select` & `Tooltip` & `Modal`(Low Priority) -2. Full featured table component(Medium Priority) -3. Form component(Medium Priority) -4. FormItem component(High Priority) -5. Complete unit test for all existing components(High Priority) -6. Create a Markdown webpack loader to convert documentation(Low Priority) -7. Refactor documentation page(for code clairity) -8. Code refactor for some 😢 messy code(which is my bad...) -9. Refactor CSS use mixins(which means I should learn SCSS hard...) - -## RoadMap -v0.3 cascader - -v0.4 refactor popover - -v0.5 finish all planned components - -v0.6 add keyboard event on planned components - -v0.7 refactor form component - -v0.8 refactor table component - -v0.9 fulfill props for all components - -v0.10 split icons for components - -v0.11 refactor css - -v0.12 import on demand - -v0.13 i18n - -v0.14 unit test - -v0.15 light theme - -v0.16 refactor using proper html tags - -v0.17 document formation - -v0.18 refactor document page - +[www.naiveui.com](www.naiveui.com) diff --git a/build/webpack.dev.js b/build/webpack.dev.js index f3287f973..778b2c0b8 100644 --- a/build/webpack.dev.js +++ b/build/webpack.dev.js @@ -41,7 +41,7 @@ const webpackConfig = { new webpack.HotModuleReplacementPlugin(), new HtmlWebpackPlugin({ template: './demo/index.tpl', - filename: './index.html' + favicon: './demo/assets/images/naivelogo.png' }), new VueLoaderPlugin(), new webpack.LoaderOptionsPlugin({ diff --git a/build/webpack.doc.js b/build/webpack.doc.js index e6ba7fbfa..2f294ec0a 100644 --- a/build/webpack.doc.js +++ b/build/webpack.doc.js @@ -34,7 +34,7 @@ const webpackConfig = { plugins: [ new HtmlWebpackPlugin({ template: './demo/index.tpl', - filename: './index.html' + favicon: './demo/assets/images/naivelogo.png' }), new VueLoaderPlugin(), new webpack.LoaderOptionsPlugin({ diff --git a/build/webpack.private-doc.js b/build/webpack.private-doc.js index c21ae1f05..320278335 100644 --- a/build/webpack.private-doc.js +++ b/build/webpack.private-doc.js @@ -7,9 +7,10 @@ const config = require('./config') const HtmlWebpackPlugin = require('html-webpack-plugin') const VueLoaderPlugin = require('vue-loader/lib/plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin') +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin const webpackConfig = { - mode: 'development', + mode: 'production', entry: './demo/privateIndex.js', output: { path: path.resolve(__dirname, '..', 'doc', 'dist'), @@ -34,7 +35,7 @@ const webpackConfig = { plugins: [ new HtmlWebpackPlugin({ template: './demo/index.tpl', - filename: './index.html' + favicon: './demo/assets/images/naivelogo.png' }), new VueLoaderPlugin(), new webpack.LoaderOptionsPlugin({ @@ -44,7 +45,8 @@ const webpackConfig = { } } }), - new ExtractTextPlugin('[name].[hash:7].css') + new ExtractTextPlugin('[name].[hash:7].css'), + new BundleAnalyzerPlugin() ] } diff --git a/build/webpack.release.js b/build/webpack.release.js index 24638048f..6875227a8 100644 --- a/build/webpack.release.js +++ b/build/webpack.release.js @@ -63,10 +63,9 @@ const webpackConfig = { ] }, plugins: [ - new webpack.HotModuleReplacementPlugin(), new HtmlWebpackPlugin({ template: './demo/index.tpl', - filename: './index.html' + favicon: './demo/assets/images/naivelogo.png' }), new VueLoaderPlugin(), new webpack.LoaderOptionsPlugin({ diff --git a/demo/SourceBlock.vue b/demo/SourceBlock.vue index 75207405a..8183098ee 100644 --- a/demo/SourceBlock.vue +++ b/demo/SourceBlock.vue @@ -1,14 +1,13 @@ diff --git a/demo/assets/images/naivelogo.png b/demo/assets/images/naivelogo.png new file mode 100644 index 000000000..735ecfcc4 Binary files /dev/null and b/demo/assets/images/naivelogo.png differ diff --git a/demo/demo.vue b/demo/demo.vue index bcf8b4166..cff7b81e0 100644 --- a/demo/demo.vue +++ b/demo/demo.vue @@ -233,10 +233,6 @@ export default { name: 'Tabs', path: `/${this.lang}/${this.theme}` + '/n-tabs' }, - { - name: 'Table', - path: `/${this.lang}/${this.theme}` + '/n-table' - }, { name: 'Tag', path: `/${this.lang}/${this.theme}` + '/n-tag' @@ -371,18 +367,6 @@ body { -webkit-text-size-adjust: 100%; } -.CodeMirror { - border: 2px solid #5c657eff; - height: auto !important; - z-index: 0; - border-radius: 8px; - padding: 8px; - margin-bottom: 18px; -} -.CodeMirror-scroll { - overflow-y: hidden !important; - overflow-x: auto !important; -} .n-doc { width: 720px; margin: 0 auto; diff --git a/demo/documentation/components/datePicker/enUS/datetime.md b/demo/documentation/components/datePicker/enUS/datetime.md index 2e53de563..fc9f814a5 100644 --- a/demo/documentation/components/datePicker/enUS/datetime.md +++ b/demo/documentation/components/datePicker/enUS/datetime.md @@ -1,4 +1,4 @@ -# Date +# Datetime ```html + active + + + 777 + +``` +```js +export default { + data () { + return { + active: false + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/drawer/enUS/index.md b/demo/documentation/components/drawer/enUS/index.md new file mode 100644 index 000000000..e716ae1f2 --- /dev/null +++ b/demo/documentation/components/drawer/enUS/index.md @@ -0,0 +1,4 @@ +# Drawer +```demo +basic +``` \ No newline at end of file diff --git a/demo/documentation/components/drawer/index.entry b/demo/documentation/components/drawer/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/drawer/zhCN/index.md b/demo/documentation/components/drawer/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/drawerDemo/index.vue b/demo/documentation/components/drawerDemo/index.vue deleted file mode 100644 index aeb426a9f..000000000 --- a/demo/documentation/components/drawerDemo/index.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/demo/documentation/components/drawerDemo/scaffold.demo.vue b/demo/documentation/components/drawerDemo/scaffold.demo.vue deleted file mode 100644 index 84493d483..000000000 --- a/demo/documentation/components/drawerDemo/scaffold.demo.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/demo/documentation/components/dropdown/enUS/basic.md b/demo/documentation/components/dropdown/enUS/basic.md new file mode 100644 index 000000000..53ae9aa07 --- /dev/null +++ b/demo/documentation/components/dropdown/enUS/basic.md @@ -0,0 +1,29 @@ +# Basic +```html + + + + {{ item }} + + +``` +```js +export default { + data () { + return { + items: ['item1longlonglong', 'item2longlonglong', 'item3longlonglong', 'item4longlonglong'] + } + }, + methods: { + handleClick (item) { + this.$NMessage.info(item) + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/dropdown/enUS/cascade.md b/demo/documentation/components/dropdown/enUS/cascade.md new file mode 100644 index 000000000..2dcb16b21 --- /dev/null +++ b/demo/documentation/components/dropdown/enUS/cascade.md @@ -0,0 +1,50 @@ +# Cascade +```html + + + + item1 + + + item2 + + + item3 + + + + + item4 + + + item5 + + + + + item6 + + + item7 + + + + +``` \ No newline at end of file diff --git a/demo/documentation/components/dropdown/enUS/index.md b/demo/documentation/components/dropdown/enUS/index.md new file mode 100644 index 000000000..01e5e17af --- /dev/null +++ b/demo/documentation/components/dropdown/enUS/index.md @@ -0,0 +1,7 @@ +# Dropdown +```demo +basic +trigger +placement +cascade +``` \ No newline at end of file diff --git a/demo/documentation/components/dropdown/enUS/placement.md b/demo/documentation/components/dropdown/enUS/placement.md new file mode 100644 index 000000000..b9cd21122 --- /dev/null +++ b/demo/documentation/components/dropdown/enUS/placement.md @@ -0,0 +1,29 @@ +# Placement +```html + + + + {{ item }} + + +``` +```js +export default { + data () { + return { + items: ['item1longlonglong', 'item2longlonglong', 'item3longlonglong', 'item4longlonglong'] + } + }, + methods: { + handleClick (item) { + this.$NMessage.info(item) + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/dropdown/enUS/trigger.md b/demo/documentation/components/dropdown/enUS/trigger.md new file mode 100644 index 000000000..29f6a2668 --- /dev/null +++ b/demo/documentation/components/dropdown/enUS/trigger.md @@ -0,0 +1,44 @@ +# Trigger +```html + + + + {{ item }} + + + + + + {{ item }} + + +``` +```js +export default { + data () { + return { + items: ['item1longlonglong', 'item2longlonglong', 'item3longlonglong', 'item4longlonglong'] + } + }, + methods: { + handleClick (item) { + this.$NMessage.info(item) + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/dropdown/index.entry b/demo/documentation/components/dropdown/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/dropdown/zhCN/index.md b/demo/documentation/components/dropdown/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/dropdownDemo/basicUsage.demo.vue b/demo/documentation/components/dropdownDemo/basicUsage.demo.vue deleted file mode 100644 index 03d03b9c1..000000000 --- a/demo/documentation/components/dropdownDemo/basicUsage.demo.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/demo/documentation/components/dropdownDemo/cascade.demo.vue b/demo/documentation/components/dropdownDemo/cascade.demo.vue deleted file mode 100644 index 8211daa76..000000000 --- a/demo/documentation/components/dropdownDemo/cascade.demo.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/demo/documentation/components/dropdownDemo/index.vue b/demo/documentation/components/dropdownDemo/index.vue deleted file mode 100644 index a5d3d2623..000000000 --- a/demo/documentation/components/dropdownDemo/index.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/demo/documentation/components/dropdownDemo/placement.demo.vue b/demo/documentation/components/dropdownDemo/placement.demo.vue deleted file mode 100644 index fcde54b29..000000000 --- a/demo/documentation/components/dropdownDemo/placement.demo.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/demo/documentation/components/dropdownDemo/trigger.demo.vue b/demo/documentation/components/dropdownDemo/trigger.demo.vue deleted file mode 100644 index 776f96079..000000000 --- a/demo/documentation/components/dropdownDemo/trigger.demo.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/demo/documentation/components/inputNumber/enUS/basic.md b/demo/documentation/components/inputNumber/enUS/basic.md new file mode 100644 index 000000000..af6f42801 --- /dev/null +++ b/demo/documentation/components/inputNumber/enUS/basic.md @@ -0,0 +1,15 @@ +# Basic +```html + +``` +```js +export default { + data () { + return { + value: 0 + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/inputNumber/enUS/disabled.md b/demo/documentation/components/inputNumber/enUS/disabled.md new file mode 100644 index 000000000..163165e6b --- /dev/null +++ b/demo/documentation/components/inputNumber/enUS/disabled.md @@ -0,0 +1,16 @@ +# Disabled +```html + +``` +```js +export default { + data () { + return { + value: 0 + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/inputNumber/enUS/event.md b/demo/documentation/components/inputNumber/enUS/event.md new file mode 100644 index 000000000..3c4b367c8 --- /dev/null +++ b/demo/documentation/components/inputNumber/enUS/event.md @@ -0,0 +1,21 @@ +# Event +```html + +``` +```js +export default { + data () { + return { + value: 0 + } + }, + methods: { + handleChange (newValue) { + this.$NMessage.info(`value: ${newValue}`) + } + } +} +``` diff --git a/demo/documentation/components/inputNumber/enUS/index.md b/demo/documentation/components/inputNumber/enUS/index.md new file mode 100644 index 000000000..8364055c9 --- /dev/null +++ b/demo/documentation/components/inputNumber/enUS/index.md @@ -0,0 +1,9 @@ +# Input Number +```demo +basic +disabled +event +min-max +size +step +``` \ No newline at end of file diff --git a/demo/documentation/components/inputNumber/enUS/minMax.md b/demo/documentation/components/inputNumber/enUS/minMax.md new file mode 100644 index 000000000..d638ec69d --- /dev/null +++ b/demo/documentation/components/inputNumber/enUS/minMax.md @@ -0,0 +1,22 @@ +# Min and Max +```html + + +``` +```js +export default { + data () { + return { + value: 0 + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/inputNumber/enUS/size.md b/demo/documentation/components/inputNumber/enUS/size.md new file mode 100644 index 000000000..b2923658f --- /dev/null +++ b/demo/documentation/components/inputNumber/enUS/size.md @@ -0,0 +1,24 @@ +# Size +```html + + + +``` +```js +export default { + data () { + return { + value: 0 + } + } +} +``` diff --git a/demo/documentation/components/inputNumber/enUS/step.md b/demo/documentation/components/inputNumber/enUS/step.md new file mode 100644 index 000000000..d79835d9d --- /dev/null +++ b/demo/documentation/components/inputNumber/enUS/step.md @@ -0,0 +1,16 @@ +# Step +```html + +``` +```js +export default { + data () { + return { + value: 0 + } + } +} +``` diff --git a/demo/documentation/components/inputNumber/index.entry b/demo/documentation/components/inputNumber/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/inputNumber/zhCN/index.md b/demo/documentation/components/inputNumber/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/inputNumberDemo/basicUsage.demo.vue b/demo/documentation/components/inputNumberDemo/basicUsage.demo.vue deleted file mode 100644 index 1ba7097ef..000000000 --- a/demo/documentation/components/inputNumberDemo/basicUsage.demo.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/demo/documentation/components/inputNumberDemo/disabled.demo.vue b/demo/documentation/components/inputNumberDemo/disabled.demo.vue deleted file mode 100644 index 339a4c475..000000000 --- a/demo/documentation/components/inputNumberDemo/disabled.demo.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/demo/documentation/components/inputNumberDemo/event.demo.vue b/demo/documentation/components/inputNumberDemo/event.demo.vue deleted file mode 100644 index 2449afa00..000000000 --- a/demo/documentation/components/inputNumberDemo/event.demo.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - diff --git a/demo/documentation/components/inputNumberDemo/index.vue b/demo/documentation/components/inputNumberDemo/index.vue deleted file mode 100644 index cb38e32b9..000000000 --- a/demo/documentation/components/inputNumberDemo/index.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/demo/documentation/components/inputNumberDemo/minAndMax.demo.vue b/demo/documentation/components/inputNumberDemo/minAndMax.demo.vue deleted file mode 100644 index b54b84d75..000000000 --- a/demo/documentation/components/inputNumberDemo/minAndMax.demo.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - diff --git a/demo/documentation/components/inputNumberDemo/size.demo.vue b/demo/documentation/components/inputNumberDemo/size.demo.vue deleted file mode 100644 index e8bb3a29a..000000000 --- a/demo/documentation/components/inputNumberDemo/size.demo.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/demo/documentation/components/inputNumberDemo/step.demo.vue b/demo/documentation/components/inputNumberDemo/step.demo.vue deleted file mode 100644 index 83189184b..000000000 --- a/demo/documentation/components/inputNumberDemo/step.demo.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/demo/documentation/components/popconfirm/enUS/basic.md b/demo/documentation/components/popconfirm/enUS/basic.md new file mode 100644 index 000000000..fa586ba93 --- /dev/null +++ b/demo/documentation/components/popconfirm/enUS/basic.md @@ -0,0 +1,12 @@ +# Basic +```html + + + Are you sure to quit this game? + +``` \ No newline at end of file diff --git a/demo/documentation/components/popconfirm/enUS/customAction.md b/demo/documentation/components/popconfirm/enUS/customAction.md new file mode 100644 index 000000000..5c914a2ce --- /dev/null +++ b/demo/documentation/components/popconfirm/enUS/customAction.md @@ -0,0 +1,17 @@ +# Custom Action +```html + + + Are you sure to quit this game? + + +``` \ No newline at end of file diff --git a/demo/documentation/components/popconfirm/enUS/customIcon.md b/demo/documentation/components/popconfirm/enUS/customIcon.md new file mode 100644 index 000000000..5e4265ed2 --- /dev/null +++ b/demo/documentation/components/popconfirm/enUS/customIcon.md @@ -0,0 +1,18 @@ +# Custom Icon +```html + + + + Are you sure to quit this game? + +``` \ No newline at end of file diff --git a/demo/documentation/components/popconfirm/enUS/event.md b/demo/documentation/components/popconfirm/enUS/event.md new file mode 100644 index 000000000..31bc5c9a9 --- /dev/null +++ b/demo/documentation/components/popconfirm/enUS/event.md @@ -0,0 +1,24 @@ +# Event +```html + + + Are you sure to quit this game? + +``` +```js +export default { + methods: { + handlePositiveClick () { + this.$NMessage.info('positive click') + }, + handleNegativeClick () { + this.$NMessage.info('negative click') + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/popconfirm/enUS/index.md b/demo/documentation/components/popconfirm/enUS/index.md new file mode 100644 index 000000000..0428fea32 --- /dev/null +++ b/demo/documentation/components/popconfirm/enUS/index.md @@ -0,0 +1,8 @@ +# Popconfirm +```demo +basic +custom-action +custom-icon +event +no-icon +``` \ No newline at end of file diff --git a/demo/documentation/components/popconfirm/enUS/noIcon.md b/demo/documentation/components/popconfirm/enUS/noIcon.md new file mode 100644 index 000000000..932fbeadd --- /dev/null +++ b/demo/documentation/components/popconfirm/enUS/noIcon.md @@ -0,0 +1,9 @@ +# No Icon +```html + + + Are you sure to quit this game? + +``` \ No newline at end of file diff --git a/demo/documentation/components/popconfirm/index.entry b/demo/documentation/components/popconfirm/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/popconfirm/zhCN/index.md b/demo/documentation/components/popconfirm/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/popconfirmDemo/basicUsage.demo.vue b/demo/documentation/components/popconfirmDemo/basicUsage.demo.vue deleted file mode 100644 index 9dd38714a..000000000 --- a/demo/documentation/components/popconfirmDemo/basicUsage.demo.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/demo/documentation/components/popconfirmDemo/customAction.demo.vue b/demo/documentation/components/popconfirmDemo/customAction.demo.vue deleted file mode 100644 index f04e817e9..000000000 --- a/demo/documentation/components/popconfirmDemo/customAction.demo.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/demo/documentation/components/popconfirmDemo/customIcon.demo.vue b/demo/documentation/components/popconfirmDemo/customIcon.demo.vue deleted file mode 100644 index db44cae09..000000000 --- a/demo/documentation/components/popconfirmDemo/customIcon.demo.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/demo/documentation/components/popconfirmDemo/event.demo.vue b/demo/documentation/components/popconfirmDemo/event.demo.vue deleted file mode 100644 index 5af264693..000000000 --- a/demo/documentation/components/popconfirmDemo/event.demo.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/demo/documentation/components/popconfirmDemo/index.vue b/demo/documentation/components/popconfirmDemo/index.vue deleted file mode 100644 index 048b687a0..000000000 --- a/demo/documentation/components/popconfirmDemo/index.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/demo/documentation/components/popconfirmDemo/noIcon.demo.vue b/demo/documentation/components/popconfirmDemo/noIcon.demo.vue deleted file mode 100644 index 1a4da4897..000000000 --- a/demo/documentation/components/popconfirmDemo/noIcon.demo.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/demo/documentation/components/radio/enUS/basic.md b/demo/documentation/components/radio/enUS/basic.md new file mode 100644 index 000000000..e5c9735aa --- /dev/null +++ b/demo/documentation/components/radio/enUS/basic.md @@ -0,0 +1,31 @@ +# Basic +```html + + Definitely Maybe + + + Be Here Now + + + Be Here Now + +``` +```js +export default { + data () { + return { + value: null + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/radio/enUS/buttonGroup.md b/demo/documentation/components/radio/enUS/buttonGroup.md new file mode 100644 index 000000000..df822cf2b --- /dev/null +++ b/demo/documentation/components/radio/enUS/buttonGroup.md @@ -0,0 +1,61 @@ +# Button Group +```html + + + {{ song.label }} + + + + + disable Shakemaker + + + disable Live Forever + +``` +```js +export default { + data () { + return { + value: null, + disabled2: false, + disabled1: false, + songs: [ + { + value: 'Rock\'n\'Roll Star', + label: 'Rock\'n\'Roll Star' + }, + { + value: 'Shakermaker', + label: 'Shakermaker' + }, + { + value: 'Live Forever', + label: 'Live Forever' + }, + { + value: 'Up in the Sky', + label: 'Up in the Sky' + }, + { + value: '...', + label: '...' + } + ].map(s => { + s.value = s.value.toLowerCase() + return s + }) + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/radio/enUS/group.md b/demo/documentation/components/radio/enUS/group.md new file mode 100644 index 000000000..8a2aa9422 --- /dev/null +++ b/demo/documentation/components/radio/enUS/group.md @@ -0,0 +1,46 @@ +# Group +```html + + + {{ song.label }} + + +``` +```js +export default { + data () { + return { + value: null, + songs: [ + { + value: 'Rock\'n\'Roll Star', + label: 'Rock\'n\'Roll Star' + }, + { + value: 'Shakermaker', + label: 'Shakermaker' + }, + { + value: 'Live Forever', + label: 'Live Forever' + }, + { + value: 'Up in the Sky', + label: 'Up in the Sky' + }, + { + value: '...', + label: '...' + } + ].map(s => { + s.value = s.value.toLowerCase() + return s + }) + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/radio/enUS/index.md b/demo/documentation/components/radio/enUS/index.md new file mode 100644 index 000000000..d29ad7edb --- /dev/null +++ b/demo/documentation/components/radio/enUS/index.md @@ -0,0 +1,7 @@ +# Radio + +```demo +basic +group +button-group +``` \ No newline at end of file diff --git a/demo/documentation/components/radio/index.entry b/demo/documentation/components/radio/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/radio/zhCN/index.md b/demo/documentation/components/radio/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/radioDemo.vue b/demo/documentation/components/radioDemo.vue deleted file mode 100644 index 13955bdd2..000000000 --- a/demo/documentation/components/radioDemo.vue +++ /dev/null @@ -1,258 +0,0 @@ - - - diff --git a/demo/documentation/components/scaffoldDemo/index.vue b/demo/documentation/components/scaffoldDemo/index.vue deleted file mode 100644 index 6a8482475..000000000 --- a/demo/documentation/components/scaffoldDemo/index.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/demo/documentation/components/scaffoldDemo/scaffold.demo.vue b/demo/documentation/components/scaffoldDemo/scaffold.demo.vue deleted file mode 100644 index 691ddb5f8..000000000 --- a/demo/documentation/components/scaffoldDemo/scaffold.demo.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/demo/documentation/components/select/enUS/remote.md b/demo/documentation/components/select/enUS/remote.md index 90353fcbd..f47e9832b 100644 --- a/demo/documentation/components/select/enUS/remote.md +++ b/demo/documentation/components/select/enUS/remote.md @@ -6,6 +6,7 @@ placeholder="Search Songs" :options="options" :on-search="handleSearch" + clearable remote :no-data-content="noDataContent" :loading="loading" diff --git a/demo/documentation/components/select/enUS/remoteMultiple.md b/demo/documentation/components/select/enUS/remoteMultiple.md index 947e47c7b..783f68910 100644 --- a/demo/documentation/components/select/enUS/remoteMultiple.md +++ b/demo/documentation/components/select/enUS/remoteMultiple.md @@ -7,6 +7,7 @@ placeholder="Search Songs" :options="options" :on-search="handleSearch" + clearable remote :no-data-content="noDataContent" :loading="loading" diff --git a/demo/documentation/components/slider/enUS/basic.md b/demo/documentation/components/slider/enUS/basic.md new file mode 100644 index 000000000..3620b548f --- /dev/null +++ b/demo/documentation/components/slider/enUS/basic.md @@ -0,0 +1,19 @@ +# Basic +```html + + +``` +```js +export default { + data () { + return { + value: 50 + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/slider/enUS/index.md b/demo/documentation/components/slider/enUS/index.md new file mode 100644 index 000000000..562c2bd61 --- /dev/null +++ b/demo/documentation/components/slider/enUS/index.md @@ -0,0 +1,6 @@ +# Slider +```demo +basic +range +mark +```` \ No newline at end of file diff --git a/demo/documentation/components/slider/enUS/mark.md b/demo/documentation/components/slider/enUS/mark.md new file mode 100644 index 000000000..23419338d --- /dev/null +++ b/demo/documentation/components/slider/enUS/mark.md @@ -0,0 +1,28 @@ +# Mark +```html + + + +``` +```js +export default { + data () { + return { + value: [50, 70], + marks: { + 34: 'Amazing', + 75: 'Good' + } + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/slider/enUS/range.md b/demo/documentation/components/slider/enUS/range.md new file mode 100644 index 000000000..7ab4e6ef5 --- /dev/null +++ b/demo/documentation/components/slider/enUS/range.md @@ -0,0 +1,23 @@ +# Range +```html + + + +``` +```js +export default { + data () { + return { + value: [50, 70] + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/slider/index.entry b/demo/documentation/components/slider/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/slider/zhCN/index.md b/demo/documentation/components/slider/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/sliderDemo/index.vue b/demo/documentation/components/sliderDemo/index.vue deleted file mode 100644 index 24fe9f460..000000000 --- a/demo/documentation/components/sliderDemo/index.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - diff --git a/demo/documentation/components/sliderDemo/mark.demo.vue b/demo/documentation/components/sliderDemo/mark.demo.vue deleted file mode 100644 index 00cdae0e1..000000000 --- a/demo/documentation/components/sliderDemo/mark.demo.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - diff --git a/demo/documentation/components/sliderDemo/range.demo.vue b/demo/documentation/components/sliderDemo/range.demo.vue deleted file mode 100644 index 6323aa678..000000000 --- a/demo/documentation/components/sliderDemo/range.demo.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/demo/documentation/components/sliderDemo/scaffold.demo.vue b/demo/documentation/components/sliderDemo/scaffold.demo.vue deleted file mode 100644 index bdf74714c..000000000 --- a/demo/documentation/components/sliderDemo/scaffold.demo.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/demo/documentation/components/steps/enUS/basic.md b/demo/documentation/components/steps/enUS/basic.md new file mode 100644 index 000000000..1c29aa25c --- /dev/null +++ b/demo/documentation/components/steps/enUS/basic.md @@ -0,0 +1,64 @@ +# Basic +```html + + + + + + +
+ + + current-status: error + + + current-status: process + +
+``` + +```js +export default { + data () { + return { + current: null, + currentStatus: 'error' + } + }, + methods: { + next () { + if (this.current === null) this.current = 1 + else if (this.current >= 4) this.current = null + else this.current++ + }, + prev () { + if (this.current === 0) this.current = null + else if (this.current === null) this.current = 4 + else this.current-- + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/steps/enUS/index.md b/demo/documentation/components/steps/enUS/index.md new file mode 100644 index 000000000..0daddba89 --- /dev/null +++ b/demo/documentation/components/steps/enUS/index.md @@ -0,0 +1,5 @@ +# Step + +```demo +basic +``` \ No newline at end of file diff --git a/demo/documentation/components/steps/index.entry b/demo/documentation/components/steps/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/steps/zhCN/index.md b/demo/documentation/components/steps/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/stepsDemo/index.vue b/demo/documentation/components/stepsDemo/index.vue deleted file mode 100644 index a7b21681b..000000000 --- a/demo/documentation/components/stepsDemo/index.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/demo/documentation/components/stepsDemo/scaffold.demo.vue b/demo/documentation/components/stepsDemo/scaffold.demo.vue deleted file mode 100644 index 67718b656..000000000 --- a/demo/documentation/components/stepsDemo/scaffold.demo.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - diff --git a/demo/documentation/components/tableDemo.vue b/demo/documentation/components/tableDemo.vue deleted file mode 100644 index 03a6838f6..000000000 --- a/demo/documentation/components/tableDemo.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - diff --git a/demo/documentation/components/tabs/enUS/basic.md b/demo/documentation/components/tabs/enUS/basic.md new file mode 100644 index 000000000..68b5a7f1b --- /dev/null +++ b/demo/documentation/components/tabs/enUS/basic.md @@ -0,0 +1,101 @@ +# Basic +```html + + + Name: a.
+
+ + Name: b.
+ We can control the element display by setting the tab's name attribute.
+ Also we can use tab-panel's active attribute to init the display. + And tab-panels's active attribute is the first priority. +
+ + Name: a.
+
+ + Name: b.
+ We can control the element display by setting the tab's name attribute.
+ Also we can use tab-panel's active attribute to init the display. + And tab-panels's active attribute is the first priority. +
+ + Name: a.
+
+ + Name: b.
+ We can control the element display by setting the tab's name attribute.
+ Also we can use tab-panel's active attribute to init the display. + And tab-panels's active attribute is the first priority. +
+ + Name: a.
+
+ + Name: b.
+ We can control the element display by setting the tab's name attribute.
+ Also we can use tab-panel's active attribute to init the display. + And tab-panels's active attribute is the first priority. +
+ + Name: a.
+
+ + Name: b.
+ We can control the element display by setting the tab's name attribute.
+ Also we can use tab-panel's active attribute to init the display. + And tab-panels's active attribute is the first priority. +
+ +
+``` +```js +export default { + data () { + return { + name: 'b' + } + }, + methods: { + updateName () { + this.name = this.name === 'a' ? 'b' : 'a' + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/tabs/enUS/card.md b/demo/documentation/components/tabs/enUS/card.md new file mode 100644 index 000000000..f32949d46 --- /dev/null +++ b/demo/documentation/components/tabs/enUS/card.md @@ -0,0 +1,37 @@ +# Card +```html + + + {{ panel }} + + +``` +```js +export default { + data () { + return { + panels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], + name: '1' + } + }, + methods: { + handleClose (name) { + this.$NMessage.info('Close ' + name) + const index = this.panels.findIndex(v => name === v.toString()) + if (~index) { + this.panels.splice(index, 1) + } + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/tabs/enUS/index.md b/demo/documentation/components/tabs/enUS/index.md new file mode 100644 index 000000000..188726f01 --- /dev/null +++ b/demo/documentation/components/tabs/enUS/index.md @@ -0,0 +1,5 @@ +# Tabs +```demo +basic +card +``` \ No newline at end of file diff --git a/demo/documentation/components/tabs/index.entry b/demo/documentation/components/tabs/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/tabs/zhCN/index.md b/demo/documentation/components/tabs/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/tabsDemo/basic.demo.vue b/demo/documentation/components/tabsDemo/basic.demo.vue deleted file mode 100644 index c26c8d1ec..000000000 --- a/demo/documentation/components/tabsDemo/basic.demo.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - diff --git a/demo/documentation/components/tabsDemo/card.demo.vue b/demo/documentation/components/tabsDemo/card.demo.vue deleted file mode 100644 index a1a165c78..000000000 --- a/demo/documentation/components/tabsDemo/card.demo.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/demo/documentation/components/tabsDemo/index.vue b/demo/documentation/components/tabsDemo/index.vue deleted file mode 100644 index 9e5162635..000000000 --- a/demo/documentation/components/tabsDemo/index.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/demo/documentation/components/time/enUS/basic.md b/demo/documentation/components/time/enUS/basic.md new file mode 100644 index 000000000..585d0f63e --- /dev/null +++ b/demo/documentation/components/time/enUS/basic.md @@ -0,0 +1,15 @@ +# Basic +```html + +
+ +``` +```js +export default { + data () { + return { + time: new Date(0) + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/time/enUS/format.md b/demo/documentation/components/time/enUS/format.md new file mode 100644 index 000000000..692f70f55 --- /dev/null +++ b/demo/documentation/components/time/enUS/format.md @@ -0,0 +1,8 @@ +# Format +```html + +
+ +
+ +``` \ No newline at end of file diff --git a/demo/documentation/components/time/enUS/index.md b/demo/documentation/components/time/enUS/index.md new file mode 100644 index 000000000..9d0db60a0 --- /dev/null +++ b/demo/documentation/components/time/enUS/index.md @@ -0,0 +1,7 @@ +# Time +```demo +basic +type +format +relative +``` \ No newline at end of file diff --git a/demo/documentation/components/time/enUS/relative.md b/demo/documentation/components/time/enUS/relative.md new file mode 100644 index 000000000..0be90a4db --- /dev/null +++ b/demo/documentation/components/time/enUS/relative.md @@ -0,0 +1,8 @@ +# Relative +```html + +
+ +
+ +``` \ No newline at end of file diff --git a/demo/documentation/components/time/enUS/type.md b/demo/documentation/components/time/enUS/type.md new file mode 100644 index 000000000..dc1ffecb5 --- /dev/null +++ b/demo/documentation/components/time/enUS/type.md @@ -0,0 +1,15 @@ +# Type +```html + +
+ +``` +```js +export default { + data () { + return { + time: new Date(0) + } + } +} +``` \ No newline at end of file diff --git a/demo/documentation/components/time/index.entry b/demo/documentation/components/time/index.entry new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/time/zhCN/index.md b/demo/documentation/components/time/zhCN/index.md new file mode 100644 index 000000000..e69de29bb diff --git a/demo/documentation/components/timeDemo/index.vue b/demo/documentation/components/timeDemo/index.vue deleted file mode 100644 index 6a8482475..000000000 --- a/demo/documentation/components/timeDemo/index.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/demo/documentation/components/timeDemo/scaffold.demo.vue b/demo/documentation/components/timeDemo/scaffold.demo.vue deleted file mode 100644 index 691ddb5f8..000000000 --- a/demo/documentation/components/timeDemo/scaffold.demo.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/demo/documentation/intro/privateStart.vue.md b/demo/documentation/intro/privateStart.vue.md new file mode 100644 index 000000000..2c4fe0be7 --- /dev/null +++ b/demo/documentation/intro/privateStart.vue.md @@ -0,0 +1,18 @@ +# Getting Started + +## Installation +First install it. + +```bash +npm install --save git+https://github.com/07akioni/naive-ui.git +``` + +## Usage +Add the following lines in you entry point js file. + +```js +import naive from 'naive-ui' +import 'naive-ui/styles/index.scss' + +Vue.use(naive) +``` \ No newline at end of file diff --git a/demo/documentation/intro/start.vue b/demo/documentation/intro/start.vue index 4310f0aa5..533423063 100644 --- a/demo/documentation/intro/start.vue +++ b/demo/documentation/intro/start.vue @@ -3,22 +3,29 @@ ref="doc" class="readme" > - + + diff --git a/demo/header.vue b/demo/header.vue index e1697fe7d..392392dcd 100644 --- a/demo/header.vue +++ b/demo/header.vue @@ -14,6 +14,7 @@