From 6255c23c1344060cb03d51d333c0d490fb97c6aa Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Fri, 18 Oct 2019 23:01:36 +0800 Subject: [PATCH 01/24] chore: rename to avoid case sentisitive related issue --- packages/common/Tree/src/TreeNodeSwitcher.vue | 2 +- .../{SwitcherIcon.vue => TreeSwitcherIcon.vue} | 0 packages/common/Tree/src/switcherIcon.vue | 17 ----------------- 3 files changed, 1 insertion(+), 18 deletions(-) rename packages/common/Tree/src/{SwitcherIcon.vue => TreeSwitcherIcon.vue} (100%) delete mode 100644 packages/common/Tree/src/switcherIcon.vue diff --git a/packages/common/Tree/src/TreeNodeSwitcher.vue b/packages/common/Tree/src/TreeNodeSwitcher.vue index c2a5b4910..e0896ae68 100644 --- a/packages/common/Tree/src/TreeNodeSwitcher.vue +++ b/packages/common/Tree/src/TreeNodeSwitcher.vue @@ -12,7 +12,7 @@ From e8d9fc24cf69d65271ee8323a7ae4bbded08123d Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Fri, 18 Oct 2019 23:45:23 +0800 Subject: [PATCH 02/24] pref: optimize bundle size of doc --- build/webpack.private-doc.js | 9 +++++++-- demo/documentation/intro/privateStart.vue.md | 18 ++++++++++++++++++ demo/documentation/intro/start.vue | 15 +++++++++++---- package.json | 3 +++ 4 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 demo/documentation/intro/privateStart.vue.md diff --git a/build/webpack.private-doc.js b/build/webpack.private-doc.js index c21ae1f05..5394f6fce 100644 --- a/build/webpack.private-doc.js +++ b/build/webpack.private-doc.js @@ -7,9 +7,12 @@ 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 UglifyJsPlugin = require('uglifyjs-webpack-plugin') +const CompressionPlugin = require('compression-webpack-plugin') const webpackConfig = { - mode: 'development', + mode: 'production', entry: './demo/privateIndex.js', output: { path: path.resolve(__dirname, '..', 'doc', 'dist'), @@ -44,7 +47,9 @@ const webpackConfig = { } } }), - new ExtractTextPlugin('[name].[hash:7].css') + new ExtractTextPlugin('[name].[hash:7].css'), + new CompressionPlugin() + // new BundleAnalyzerPlugin() ] } 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/package.json b/package.json index d5a8d1c62..32bd260fb 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "babel-preset-env": "^1.7.0", "chai": "^4.2.0", "codemirror": "^5.47.0", + "compression-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^5.0.3", "cross-env": "^5.2.0", "css-loader": "^2.1.1", @@ -81,6 +82,7 @@ "stylelint-config-recommended-scss": "^3.3.0", "stylelint-scss": "^3.8.0", "tinycolor2": "^1.4.1", + "uglifyjs-webpack-plugin": "^2.2.0", "url-loader": "^1.1.2", "vue": "^2.6.10", "vue-i18n": "^8.14.1", @@ -88,6 +90,7 @@ "vue-router": "^3.0.6", "vue-template-compiler": "^2.6.10", "webpack": "^4.30.0", + "webpack-bundle-analyzer": "^3.6.0", "webpack-cli": "^3.3.2", "webpack-dev-server": "^3.4.1" }, From 914ddccfaada949f5b62510678639f3c25e13c13 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Sat, 19 Oct 2019 19:52:47 +0800 Subject: [PATCH 03/24] refactor(date-picker): use date-fns rather than moment --- build/webpack.private-doc.js | 4 +- .../components/datePicker/enUS/datetime.md | 2 +- package.json | 9 +- packages/common/DatePicker/src/main.vue | 168 +++++++++------ .../src/panel/commonCalendarMixin.js | 2 - packages/common/DatePicker/src/panel/date.vue | 19 +- .../common/DatePicker/src/panel/daterange.vue | 28 +-- .../common/DatePicker/src/panel/datetime.vue | 21 +- .../DatePicker/src/panel/datetimerange.vue | 149 +++++++------- .../DatePicker/src/panel/dualCalendarMixin.js | 90 +++++--- .../DatePicker/src/panel/uniCalendarMixin.js | 194 +++++++++++------- packages/common/DatePicker/src/utils.js | 74 +++---- packages/common/Scrollbar/src/main.vue | 12 +- packages/common/TimePicker/src/main.vue | 11 - packages/mixins/detachable.js | 30 ++- styles/DatePicker.scss | 2 +- styles/Input.scss | 3 +- 17 files changed, 465 insertions(+), 353 deletions(-) diff --git a/build/webpack.private-doc.js b/build/webpack.private-doc.js index 5394f6fce..2151fadcf 100644 --- a/build/webpack.private-doc.js +++ b/build/webpack.private-doc.js @@ -48,8 +48,8 @@ const webpackConfig = { } }), new ExtractTextPlugin('[name].[hash:7].css'), - new CompressionPlugin() - // new BundleAnalyzerPlugin() + new CompressionPlugin(), + new BundleAnalyzerPlugin() ] } 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
@@ -18,7 +17,6 @@ diff --git a/demo/demo.vue b/demo/demo.vue index bcf8b4166..cace06171 100644 --- a/demo/demo.vue +++ b/demo/demo.vue @@ -371,18 +371,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/docCodeEditorMixin.js b/demo/documentation/components/docCodeEditorMixin.js index 6b7f8afda..1f5942319 100644 --- a/demo/documentation/components/docCodeEditorMixin.js +++ b/demo/documentation/components/docCodeEditorMixin.js @@ -1,7 +1,3 @@ -import CodeMirror from 'codemirror' -import 'codemirror/mode/htmlmixed/htmlmixed' -import 'codemirror/theme/vibrant-ink.css' - export default { mounted () { const textAreaNotToRender = new Set(this.$refs.doc.querySelectorAll('.not-code textarea')) @@ -9,11 +5,9 @@ export default { if (textAreaNotToRender.has(ta)) { return } - CodeMirror.fromTextArea(ta, { - lineNumbers: false, - mode: 'htmlmixed', - theme: 'vibrant-ink' - }) + const rows = ta.value.split('\n').length + ta.style.width = '100%' + ta.setAttribute('rows', rows) }) } } diff --git a/demo/init.js b/demo/init.js index f3aaa2ee1..e08bff2f8 100644 --- a/demo/init.js +++ b/demo/init.js @@ -1,7 +1,6 @@ import Vue from 'vue/dist/vue' import VueRouter from 'vue-router' import '../styles/index.scss' -import 'codemirror/lib/codemirror.css' import './styles/atom-one-dark-reasonable.scss' import './styles/atom-one-light.scss' import './styles/markdown.scss' diff --git a/doc/NaiveUIDemoLoader.js b/doc/NaiveUIDemoLoader.js index 64e8b97d1..34003cfff 100644 --- a/doc/NaiveUIDemoLoader.js +++ b/doc/NaiveUIDemoLoader.js @@ -1,6 +1,6 @@ // const { getOptions } = require('loader-utils') // const validateOptions = require('schema-utils') -const prettier = require('prettier') +// const prettier = require('prettier') module.exports = function (content) { const exampleReg = /([\s\S]*)?/ @@ -13,9 +13,9 @@ module.exports = function (content) { const script = content.match(scriptReg)[0] // console.log(styleExample) styleExample = styleExample === null ? '' : styleExample[1] - const example = prettier.format((sourceExample + '\n' + script + '\n' + styleExample), { - parser: 'html', - printWidth: 80 - }).trim() - return content.replace(sourceReg, ``) + // const example = prettier.format((sourceExample + '\n' + script + '\n' + styleExample), { + // parser: 'html', + // printWidth: 80 + // }).trim() + return content.replace(sourceReg, ``) } diff --git a/index.html b/index.html deleted file mode 100644 index 9ae4a75f9..000000000 --- a/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 2s design - - - -
- -
- - \ No newline at end of file diff --git a/package.json b/package.json index 45ee14851..bb1eee092 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "babel-plugin-transform-vue-jsx": "^3.7.0", "babel-preset-env": "^1.7.0", "chai": "^4.2.0", - "codemirror": "^5.47.0", "compression-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^5.0.3", "cross-env": "^5.2.0", @@ -56,7 +55,6 @@ "highlight.js": "^9.15.10", "html-webpack-plugin": "^3.2.0", "http-server": "^0.11.1", - "iview": "^3.4.2", "jsdom": "^15.1.1", "karma": "^4.1.0", "karma-chrome-launcher": "^2.2.0", @@ -71,7 +69,6 @@ "marked": "^0.7.0", "memory-fs": "^0.4.1", "mocha": "^6.1.4", - "prettier": "^1.18.2", "prettier-eslint": "^9.0.0", "progress-bar-webpack-plugin": "^1.12.1", "regenerator-runtime": "^0.13.2", @@ -82,7 +79,6 @@ "stylelint-config-recommended-scss": "^3.3.0", "stylelint-scss": "^3.8.0", "tinycolor2": "^1.4.1", - "uglifyjs-webpack-plugin": "^2.2.0", "url-loader": "^1.1.2", "vue": "^2.6.10", "vue-i18n": "^8.14.1", diff --git a/testColor.js b/playground/testColor.js similarity index 100% rename from testColor.js rename to playground/testColor.js From ac182ba07f59b0c8b312265a2cc9b00691a5ea61 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Mon, 21 Oct 2019 14:49:08 +0800 Subject: [PATCH 13/24] feat(radio): light-theme --- build/webpack.private-doc.js | 2 - build/webpack.release.js | 3 +- .../components/radio/enUS/basic.md | 31 ++ .../components/radio/enUS/buttonGroup.md | 61 ++++ .../components/radio/enUS/group.md | 46 +++ .../components/radio/enUS/index.md | 7 + .../components/radio/index.entry | 0 .../components/radio/zhCN/index.md | 0 demo/documentation/components/radioDemo.vue | 258 -------------- .../components/scaffoldDemo/index.vue | 32 -- .../components/scaffoldDemo/scaffold.demo.vue | 28 -- demo/init.js | 4 +- package.json | 1 - packages/common/Radio/src/RadioButton.vue | 40 ++- packages/common/Radio/src/RadioGroup.vue | 85 +++-- packages/common/Radio/src/main.vue | 33 +- styles/Radio.scss | 320 +++++++++--------- styles/themes/dark/components/Radio.scss | 29 ++ styles/themes/dark/index.scss | 2 + styles/themes/light/components/Radio.scss | 29 ++ styles/themes/light/index.scss | 2 + think.md | 2 + 22 files changed, 486 insertions(+), 529 deletions(-) create mode 100644 demo/documentation/components/radio/enUS/basic.md create mode 100644 demo/documentation/components/radio/enUS/buttonGroup.md create mode 100644 demo/documentation/components/radio/enUS/group.md create mode 100644 demo/documentation/components/radio/enUS/index.md create mode 100644 demo/documentation/components/radio/index.entry create mode 100644 demo/documentation/components/radio/zhCN/index.md delete mode 100644 demo/documentation/components/radioDemo.vue delete mode 100644 demo/documentation/components/scaffoldDemo/index.vue delete mode 100644 demo/documentation/components/scaffoldDemo/scaffold.demo.vue create mode 100644 styles/themes/dark/components/Radio.scss create mode 100644 styles/themes/light/components/Radio.scss diff --git a/build/webpack.private-doc.js b/build/webpack.private-doc.js index a8321b927..320278335 100644 --- a/build/webpack.private-doc.js +++ b/build/webpack.private-doc.js @@ -8,7 +8,6 @@ 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 CompressionPlugin = require('compression-webpack-plugin') const webpackConfig = { mode: 'production', @@ -47,7 +46,6 @@ const webpackConfig = { } }), new ExtractTextPlugin('[name].[hash:7].css'), - new CompressionPlugin(), 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/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/init.js b/demo/init.js index e08bff2f8..818abaa91 100644 --- a/demo/init.js +++ b/demo/init.js @@ -35,7 +35,7 @@ import alert from './documentation/components/alert' import datePicker from './documentation/components/datePicker' import inputNumberDemo from './documentation/components/inputNumberDemo' import nimbusIconDemo from './documentation/components/nimbusIconDemo' -import radioDemo from './documentation/components/radioDemo' +import radio from './documentation/components/radio' import formDemo from './documentation/components/formDemo' import tabsDemo from './documentation/components/tabsDemo' import timePicker from './documentation/components/timePicker' @@ -155,7 +155,7 @@ const routes = [ { path: '/n-date-picker', component: datePicker }, { path: '/n-input-number', component: inputNumberDemo }, { path: '/n-nimbus-icon', component: nimbusIconDemo }, - { path: '/n-radio', component: radioDemo }, + { path: '/n-radio', component: radio }, { path: '/n-form', component: formDemo }, { path: '/n-tabs', component: tabsDemo }, { path: '/n-time-picker', component: timePicker }, diff --git a/package.json b/package.json index bb1eee092..0bc85c76e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "babel-plugin-transform-vue-jsx": "^3.7.0", "babel-preset-env": "^1.7.0", "chai": "^4.2.0", - "compression-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^5.0.3", "cross-env": "^5.2.0", "css-loader": "^2.1.1", diff --git a/packages/common/Radio/src/RadioButton.vue b/packages/common/Radio/src/RadioButton.vue index 8086e9642..70a85a494 100644 --- a/packages/common/Radio/src/RadioButton.vue +++ b/packages/common/Radio/src/RadioButton.vue @@ -4,19 +4,14 @@ :class="{ 'n-radio-button--disabled': disabled, 'n-radio-button--checked': checked, - + 'simulate-hollow-out-text': shouldSimulateHollowOutText }" + :tabindex="disabled ? -1 : 0" + @keyup.enter="handleKeyUpEnter" @click="handleClick" >
-
- -
+
@@ -27,6 +22,11 @@ export default { prop: 'privateValue', event: 'input' }, + inject: { + NRadioGroup: { + default: null + } + }, props: { value: { type: [Boolean, String, Number], @@ -42,14 +42,34 @@ export default { } }, computed: { + shouldSimulateHollowOutText () { + return this.checked && (this.NRadioGroup.synthesizedTheme === 'dark') + }, checked () { - return this.privateValue === this.value + if (this.NRadioGroup) { + return this.NRadioGroup.value === this.value + } else { + return this.privateValue === this.value + } } }, methods: { + handleKeyUpEnter () { + this.toggle() + }, handleClick () { + this.toggle() + }, + toggle () { if (this.disabled) return if (this.privateValue !== this.value) { + this.emitValue(this.value) + } + }, + emitValue () { + if (this.NRadioGroup) { + this.NRadioGroup.$emit('input', this.value) + } else { this.$emit('input', this.value) } } diff --git a/packages/common/Radio/src/RadioGroup.vue b/packages/common/Radio/src/RadioGroup.vue index b6dea8e6c..42516eb7c 100644 --- a/packages/common/Radio/src/RadioGroup.vue +++ b/packages/common/Radio/src/RadioGroup.vue @@ -1,26 +1,27 @@ 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/init.js b/demo/init.js index 818abaa91..05d83cc6e 100644 --- a/demo/init.js +++ b/demo/init.js @@ -21,7 +21,6 @@ import iconDemo from './documentation/components/iconDemo' import checkbox from './documentation/components/checkbox' import button from './documentation/components/button' import switchDemo from './documentation/components/switch' -import tableDemo from './documentation/components/tableDemo' import input from './documentation/components/input' import select from './documentation/components/select' import cascaderDemo from './documentation/components/cascaderDemo' @@ -54,7 +53,7 @@ import tag from './documentation/components/tag' import timeline from './documentation/components/timeline' import progress from './documentation/components/progress' import divider from './documentation/components/divider' -import popconfirmDemo from './documentation/components/popconfirmDemo' +import popconfirm from './documentation/components/popconfirm' import anchor from './documentation/components/anchor' import popselect from './documentation/components/popselect' import app from './documentation/components/app' @@ -63,7 +62,7 @@ import transferDemo from './documentation/components/transferDemo' import spin from './documentation/components/spin' import drawerDemo from './documentation/components/drawerDemo' import loadingBar from './documentation/components/loadingBar' -import timeDemo from './documentation/components/timeDemo' +import time from './documentation/components/time' import sliderDemo from './documentation/components/sliderDemo' import treeDemo from './documentation/components/treeDemo' import affix from './documentation/components/affix' @@ -137,7 +136,7 @@ const routes = [ { path: '/n-checkbox', component: checkbox }, { path: '/n-button', component: button }, { path: '/n-switch', component: switchDemo }, - { path: '/n-table', component: tableDemo }, + // { path: '/n-table', component: tableDemo }, { path: '/n-advance-table', component: advancedTable }, { path: '/n-input', component: input }, { path: '/n-select', component: select }, @@ -173,7 +172,7 @@ const routes = [ { path: '/n-back-top', component: backTop }, { path: '/n-date-picker-debug', component: datePickerDebug }, { path: '/n-divider', component: divider }, - { path: '/n-popconfirm', component: popconfirmDemo }, + { path: '/n-popconfirm', component: popconfirm }, { path: '/n-anchor', component: anchor }, { path: '/n-dropdown', component: dropdownDemo }, { path: '/n-popselect', component: popselect }, @@ -183,7 +182,7 @@ const routes = [ { path: '/n-spin', component: spin }, { path: '/n-drawer', component: drawerDemo }, { path: '/n-loading-bar', component: loadingBar }, - { path: '/n-time', component: timeDemo }, + { path: '/n-time', component: time }, { path: '/n-slider', component: sliderDemo }, { path: '/n-tree', component: treeDemo }, { path: '/n-vertical-align-debug', component: verticalAlignDebug }, diff --git a/packages/common/Time/src/main.js b/packages/common/Time/src/main.js index 7c92cbc7f..351c7deeb 100644 --- a/packages/common/Time/src/main.js +++ b/packages/common/Time/src/main.js @@ -1,25 +1,26 @@ -// import moment from 'moment' +import { format, formatDistance, isValid } from 'date-fns' export default { name: 'NTime', props: { time: { - validator (time) { - if (time === null) return false - // return moment(time).isValid() + validator (value) { + return isValid(new Date(value)) }, default: null }, - raw: { - type: Boolean, - default: false - }, type: { - validator (type) { - return ['relative', 'date', 'datetime'].includes('type') + validator (value) { + return ['relative', 'date', 'datetime'].includes(value) }, default: 'relative' }, + to: { + validator (value) { + return isValid(new Date(value)) + }, + default: () => new Date() + }, format: { type: String, default: null @@ -27,7 +28,17 @@ export default { }, computed: { renderedTime () { - + if (this.format) { + return format(this.time, this.format) + } else if (this.type === 'date') { + return format(this.time, 'yyyy-MM-dd') + } else if (this.type === 'datetime') { + return format(this.time, 'yyyy-MM-dd hh:mm:ss') + } else { + return formatDistance(this.time, this.to, { + addSuffix: true + }) + } } }, data () { @@ -36,6 +47,6 @@ export default { } }, render (h) { - return 'time' + return h('span', this.renderedTime) } } From 875d301b8ae36584d4a4eacca276bdecf8ab7d84 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Mon, 21 Oct 2019 15:49:06 +0800 Subject: [PATCH 15/24] doc: refactor some docs --- .../popconfirmDemo/basicUsage.demo.vue | 35 ------- .../popconfirmDemo/customAction.demo.vue | 47 ---------- .../popconfirmDemo/customIcon.demo.vue | 41 --------- .../components/popconfirmDemo/event.demo.vue | 39 -------- .../components/popconfirmDemo/index.vue | 44 --------- .../components/popconfirmDemo/noIcon.demo.vue | 32 ------- .../components/steps/enUS/basic.md | 75 +++++++++++++++ .../components/steps/enUS/index.md | 5 + .../components/steps/index.entry | 0 .../components/steps/zhCN/index.md | 0 .../components/stepsDemo/index.vue | 32 ------- .../components/stepsDemo/scaffold.demo.vue | 92 ------------------- demo/init.js | 4 +- 13 files changed, 82 insertions(+), 364 deletions(-) delete mode 100644 demo/documentation/components/popconfirmDemo/basicUsage.demo.vue delete mode 100644 demo/documentation/components/popconfirmDemo/customAction.demo.vue delete mode 100644 demo/documentation/components/popconfirmDemo/customIcon.demo.vue delete mode 100644 demo/documentation/components/popconfirmDemo/event.demo.vue delete mode 100644 demo/documentation/components/popconfirmDemo/index.vue delete mode 100644 demo/documentation/components/popconfirmDemo/noIcon.demo.vue create mode 100644 demo/documentation/components/steps/enUS/basic.md create mode 100644 demo/documentation/components/steps/enUS/index.md create mode 100644 demo/documentation/components/steps/index.entry create mode 100644 demo/documentation/components/steps/zhCN/index.md delete mode 100644 demo/documentation/components/stepsDemo/index.vue delete mode 100644 demo/documentation/components/stepsDemo/scaffold.demo.vue 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/steps/enUS/basic.md b/demo/documentation/components/steps/enUS/basic.md new file mode 100644 index 000000000..5ef9e809e --- /dev/null +++ b/demo/documentation/components/steps/enUS/basic.md @@ -0,0 +1,75 @@ +# Basic +```html + + + + + + +
+ + + current-status: error + + + current-status: process + + + finish-status: error + + + finish-status: process + + + finish-status: success + +
+``` + +```js +export default { + data () { + return { + current: null, + finishStatus: 'success', + currentStatus: 'error' + } + }, + methods: { + next () { + if (this.current === null) this.current = 0 + else if (this.current >= 3) this.current = null + else this.current++ + }, + prev () { + if (this.current === 0) this.current = null + else if (this.current === null) this.current = 3 + 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/init.js b/demo/init.js index 05d83cc6e..3c3283d95 100644 --- a/demo/init.js +++ b/demo/init.js @@ -44,7 +44,7 @@ import dropdownDemo from './documentation/components/dropdownDemo' import scrollbarDebug from './debugComponents/scrollbarDebug' import scrollbarDebug2 from './debugComponents/scrollbarDebug2' import badge from './documentation/components/badge' -import stepsDemo from './documentation/components/stepsDemo' +import steps from './documentation/components/steps' import notification from './documentation/components/notification' import nimbusConfirmCardDemo from './documentation/components/nimbusConfirmCardDemo' import pagination from './documentation/components/pagination' @@ -163,7 +163,7 @@ const routes = [ { path: '/n-modal-debug', component: modalDebug }, { path: '/n-scrollbar-debug', component: scrollbarDebug }, { path: '/n-badge', component: badge }, - { path: '/n-steps', component: stepsDemo }, + { path: '/n-steps', component: steps }, { path: '/n-collapse', component: collapse }, { path: '/n-progress', component: progress }, { path: '/n-tag', component: tag }, From 39ec2d13c918192d3f8102e3aab0fdc8a92cfb8a Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Mon, 21 Oct 2019 19:16:31 +0800 Subject: [PATCH 16/24] feat(steps): refactor & light theme --- .../components/steps/enUS/basic.md | 19 +- packages/common/Steps/src/Step.vue | 81 +++--- packages/common/Steps/src/main.vue | 37 ++- styles/Steps.scss | 245 ++++++++---------- styles/themes/dark/components/Steps.scss | 38 +++ styles/themes/dark/index.scss | 2 + styles/themes/light/components/Steps.scss | 38 +++ styles/themes/light/index.scss | 2 + 8 files changed, 246 insertions(+), 216 deletions(-) create mode 100644 styles/themes/dark/components/Steps.scss create mode 100644 styles/themes/light/components/Steps.scss diff --git a/demo/documentation/components/steps/enUS/basic.md b/demo/documentation/components/steps/enUS/basic.md index 5ef9e809e..1c29aa25c 100644 --- a/demo/documentation/components/steps/enUS/basic.md +++ b/demo/documentation/components/steps/enUS/basic.md @@ -2,8 +2,7 @@ ```html current-status: process - - finish-status: error - - - finish-status: process - - - finish-status: success -
``` @@ -55,19 +45,18 @@ export default { data () { return { current: null, - finishStatus: 'success', currentStatus: 'error' } }, methods: { next () { - if (this.current === null) this.current = 0 - else if (this.current >= 3) this.current = null + 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 = 3 + else if (this.current === null) this.current = 4 else this.current-- } } diff --git a/packages/common/Steps/src/Step.vue b/packages/common/Steps/src/Step.vue index a0726f94a..ae2ca8852 100644 --- a/packages/common/Steps/src/Step.vue +++ b/packages/common/Steps/src/Step.vue @@ -2,34 +2,31 @@
-
{{ index }} @@ -37,10 +34,11 @@
-
-
+
+
{{ title }} -
+
+
this.current) { + return 'wait' } + return null } } } diff --git a/packages/common/Steps/src/main.vue b/packages/common/Steps/src/main.vue index d8442a415..c79ff8fa8 100644 --- a/packages/common/Steps/src/main.vue +++ b/packages/common/Steps/src/main.vue @@ -1,13 +1,12 @@ 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/init.js b/demo/init.js index 3c3283d95..923fc3ec8 100644 --- a/demo/init.js +++ b/demo/init.js @@ -60,7 +60,7 @@ import app from './documentation/components/app' import advancedTable from './documentation/components/advancedTable' import transferDemo from './documentation/components/transferDemo' import spin from './documentation/components/spin' -import drawerDemo from './documentation/components/drawerDemo' +import drawer from './documentation/components/drawer' import loadingBar from './documentation/components/loadingBar' import time from './documentation/components/time' import sliderDemo from './documentation/components/sliderDemo' @@ -180,7 +180,7 @@ const routes = [ { path: '/n-cancel-mark-debug', component: cancelMarkDebug }, { path: '/n-transfer', component: transferDemo }, { path: '/n-spin', component: spin }, - { path: '/n-drawer', component: drawerDemo }, + { path: '/n-drawer', component: drawer }, { path: '/n-loading-bar', component: loadingBar }, { path: '/n-time', component: time }, { path: '/n-slider', component: sliderDemo }, diff --git a/packages/base/Protal/index.js b/packages/base/Portal/index.js similarity index 100% rename from packages/base/Protal/index.js rename to packages/base/Portal/index.js diff --git a/packages/base/Protal/src/main.js b/packages/base/Portal/src/main.js similarity index 88% rename from packages/base/Protal/src/main.js rename to packages/base/Portal/src/main.js index 4480df0c8..20945aa71 100644 --- a/packages/base/Protal/src/main.js +++ b/packages/base/Portal/src/main.js @@ -29,11 +29,11 @@ export default { const childrenCount = defaultSlot && defaultSlot.length if (defaultSlot && childrenCount) { if (childrenCount !== 1) { - console.error(`NBaseProtal: default slot has more than one child`) + console.error(`NBasePortal: default slot has more than one child`) } return defaultSlot[0] } else { - console.error(`NBaseProtal: default slot is empty`) + console.error(`NBasePortal: default slot is empty`) return null } } diff --git a/packages/common/Drawer/src/main.vue b/packages/common/Drawer/src/main.vue index 773b18120..d2f78f4f0 100644 --- a/packages/common/Drawer/src/main.vue +++ b/packages/common/Drawer/src/main.vue @@ -1,5 +1,5 @@ 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/init.js b/demo/init.js index 84dd43e45..8b6cd6048 100644 --- a/demo/init.js +++ b/demo/init.js @@ -32,7 +32,7 @@ import tooltip from './documentation/components/tooltip' import popover from './documentation/components/popover' import alert from './documentation/components/alert' import datePicker from './documentation/components/datePicker' -import inputNumberDemo from './documentation/components/inputNumberDemo' +import inputNumber from './documentation/components/inputNumber' import nimbusIconDemo from './documentation/components/nimbusIconDemo' import radio from './documentation/components/radio' import formDemo from './documentation/components/formDemo' @@ -152,7 +152,7 @@ const routes = [ { path: '/n-pagination', component: pagination }, { path: '/n-alert', component: alert }, { path: '/n-date-picker', component: datePicker }, - { path: '/n-input-number', component: inputNumberDemo }, + { path: '/n-input-number', component: inputNumber }, { path: '/n-nimbus-icon', component: nimbusIconDemo }, { path: '/n-radio', component: radio }, { path: '/n-form', component: formDemo }, From 209f4d0db8b27d89e9d26f5b25408bc7f115ee61 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Tue, 22 Oct 2019 16:35:44 +0800 Subject: [PATCH 21/24] feat(input-number): light-theme --- .../inputNumberDemo/basicUsage.demo.vue | 31 --- .../inputNumberDemo/disabled.demo.vue | 32 --- .../components/inputNumberDemo/event.demo.vue | 37 --- .../components/inputNumberDemo/index.vue | 47 ---- .../inputNumberDemo/minAndMax.demo.vue | 38 --- .../components/inputNumberDemo/size.demo.vue | 40 ---- .../components/inputNumberDemo/step.demo.vue | 32 --- packages/common/InputNumber/src/main.vue | 21 +- styles/InputNumber.scss | 222 +++++++++--------- styles/themes/commonVars.scss | 2 + .../themes/dark/components/InputNumber.scss | 33 +++ styles/themes/dark/index.scss | 2 + .../themes/light/components/BasePicker.scss | 2 +- styles/themes/light/components/CheckBox.scss | 10 +- styles/themes/light/components/Input.scss | 2 +- .../themes/light/components/InputNumber.scss | 35 +++ .../light/components/NimbusServiceLayout.scss | 8 +- styles/themes/light/components/Table.scss | 2 +- styles/themes/light/components/Tag.scss | 16 +- styles/themes/light/components/Tooltip.scss | 2 +- styles/themes/light/index.scss | 20 +- styles/themes/light/lightColors.bak.scss | 20 +- styles/themes/light/lightColors.scss | 40 ++-- 23 files changed, 263 insertions(+), 431 deletions(-) delete mode 100644 demo/documentation/components/inputNumberDemo/basicUsage.demo.vue delete mode 100644 demo/documentation/components/inputNumberDemo/disabled.demo.vue delete mode 100644 demo/documentation/components/inputNumberDemo/event.demo.vue delete mode 100644 demo/documentation/components/inputNumberDemo/index.vue delete mode 100644 demo/documentation/components/inputNumberDemo/minAndMax.demo.vue delete mode 100644 demo/documentation/components/inputNumberDemo/size.demo.vue delete mode 100644 demo/documentation/components/inputNumberDemo/step.demo.vue create mode 100644 styles/themes/dark/components/InputNumber.scss create mode 100644 styles/themes/light/components/InputNumber.scss 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/packages/common/InputNumber/src/main.vue b/packages/common/InputNumber/src/main.vue index e26f055f1..5d82afb3b 100644 --- a/packages/common/InputNumber/src/main.vue +++ b/packages/common/InputNumber/src/main.vue @@ -3,15 +3,18 @@ class="n-input-number" :class="{ [`n-input-number--${size}-size`]: true, - 'n-input-number--disabled': disabled + 'n-input-number--disabled': disabled, + [`n-${synthesizedTheme}-theme`]: synthesizedTheme }" >