diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 87b26dd49..000000000 --- a/.eslintrc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "airbnb", - "parser": "babel-eslint", - "rules": { - "semi": 0, - "max-len": 0, - "react/prefer-stateless-function": 0, - "comma-dangle": 0, - "func-names": 0, - "prefer-const": 0, - "arrow-body-style": 0, - "react/sort-comp": 0, - "react/no-multi-comp": 0, - "react/prop-types": 0, - "react/prefer-es6-class": 0, - "react/jsx-closing-bracket-location": 0, - "react/jsx-no-bind": 0, - "no-param-reassign": 0, - "no-return-assign": 0, - "consistent-return": 0, - "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], - "no-use-before-define": ["error", { "functions": false }], - "no-underscore-dangle": 0 - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..e6a7cffbb --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,34 @@ +module.exports = { + root: true, + parser: 'babel-eslint', + parserOptions: { + sourceType: 'module' + }, + // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style + extends: 'standard', + // required to lint *.vue files + plugins: [ + 'html' + ], + // add your custom rules here + 'rules': { + // allow paren-less arrow functions + 'arrow-parens': 0, + // allow async-await + 'generator-star-spacing': 0, + // allow debugger during development + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'semi': ['error', 'always'], + 'space-before-function-paren': ['error', 'never'], + 'no-useless-escape': 0, + 'no-extra-boolean-cast': 0, + 'no-new': 0 + }, + "globals": { + "oxygen": true, + "location": true, + "Swiper": true, + "wysihtml5": true, + "wysihtml5ParserRules": true + } +} diff --git a/build/bin/build-entry.js b/build/bin/build-entry.js index d46f914b1..fe5cefea3 100644 --- a/build/bin/build-entry.js +++ b/build/bin/build-entry.js @@ -13,7 +13,6 @@ const install = function(Vue) { if (install.installed) return; {{install}} - }; // auto install diff --git a/build/config.js b/build/config.js deleted file mode 100644 index 9133a90ae..000000000 --- a/build/config.js +++ /dev/null @@ -1,30 +0,0 @@ -var Components = require('../components.json'); -var path = require('path'); -var dependencies = require('../package.json').dependencies; -var externals = {}; - -Object.keys(Components).forEach(function(key) { - externals[`oxygen/packages/${key}/index.js`] = `oxygen/lib/${key}`; - externals[`oxygen/packages/${key}/style.css`] = `oxygen/lib/${key}/style.css`; -}); -Object.keys(dependencies).forEach(function(key) { - externals[key] = key; -}); -exports.externals = Object.assign({ - vue: { - root: 'Vue', - commonjs: 'vue', - commonjs2: 'vue', - amd: 'vue' - } -}, externals); - -exports.alias = { - 'oxygen': path.join(__dirname, '..'), - 'src': path.join(__dirname, '../src') -}; - -exports.jsexclude = /node_modules|lib/; - -exports.extends = ['vue2', 'buble']; - diff --git a/build/release.sh b/build/release.sh deleted file mode 100644 index ca8499955..000000000 --- a/build/release.sh +++ /dev/null @@ -1,23 +0,0 @@ -set -e -echo "[Mint UI for Vue 2.0]Enter release version: " -read VERSION - -read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r -echo # (optional) move to a new line -if [[ $REPLY =~ ^[Yy]$ ]] -then - echo "Releasing $VERSION ..." - - # build - VERSION=$VERSION npm run dist - - # commit - git add -A - git commit -m "[build] $VERSION" - npm version $VERSION --message "[release] $VERSION" - - # publish - git push eleme refs/tags/v$VERSION - git push eleme master - npm publish -fi diff --git a/build/strip-tags.js b/build/strip-tags.js new file mode 100644 index 000000000..bbb719c19 --- /dev/null +++ b/build/strip-tags.js @@ -0,0 +1,34 @@ +/*! + * strip-tags + * + * Copyright (c) 2015 Jon Schlinkert, contributors. + * Licensed under the MIT license. + */ + +'use strict'; + +var cheerio = require('cheerio'); + +exports.strip = function(str, tags) { + var $ = cheerio.load(str, {decodeEntities: false}); + + if (!tags || tags.length === 0) { + return str; + } + + tags = !Array.isArray(tags) ? [tags] : tags; + var len = tags.length; + + while (len--) { + $(tags[len]).remove(); + } + + return $.html(); +}; + +exports.fetch = function(str, tag) { + var $ = cheerio.load(str, {decodeEntities: false}); + if (!tag) return str; + + return $(tag).html(); +}; diff --git a/build/webpack.build.js b/build/webpack.build.js new file mode 100644 index 000000000..4222eae61 --- /dev/null +++ b/build/webpack.build.js @@ -0,0 +1,13 @@ +var config = require('./webpack.config.js') + +config.entry = { + 'oxygen': './src/index.js' +} + +config.output = { + filename: './dist/[name].js', + library: 'Oxygen', + libraryTarget: 'umd' +} + +module.exports = config diff --git a/build/webpack.build.min.js b/build/webpack.build.min.js new file mode 100644 index 000000000..d8a978bc0 --- /dev/null +++ b/build/webpack.build.min.js @@ -0,0 +1,19 @@ +var config = require('./webpack.build.js') +var webpack = require('webpack') + + +config.output.filename = config.output.filename.replace(/\.js$/, '.min.js') + +delete config.devtool + +config.plugins = [ + new webpack.optimize.UglifyJsPlugin({ + sourceMap: false, + drop_console: true, + compress: { + warnings: false + } + }) +] + +module.exports = config diff --git a/build/webpack.config.js b/build/webpack.config.js new file mode 100644 index 000000000..cf051eb1a --- /dev/null +++ b/build/webpack.config.js @@ -0,0 +1,151 @@ +var webpack = require('webpack') +var path = require('path') +var slugify = require('transliteration').slugify +var md = require('markdown-it')() +var striptags = require('./strip-tags') + +function convert(str) { + str = str.replace(/(&#x)(\w{4});/gi, function($0) { + return String.fromCharCode(parseInt(encodeURIComponent($0).replace(/(%26%23x)(\w{4})(%3B)/g, '$2'), 16)); + }); + return str; +} + +function wrap(render) { + return function() { + return render.apply(this, arguments) + .replace('', ''); + }; +}; + +module.exports = { + entry: { + 'build-docs': './docs/index.js' + }, + output: { + path: './docs/build', + publicPath: 'docs/build', + filename: '[name].js' + }, + resolve: { + root: path.resolve('./'), + extensions: ['', '.js', '.vue'], + fallback: [path.join(__dirname, '../node_modules')] + }, + module: { + preLoaders: [ + { + test: /\.vue$/, + loader: 'eslint', + exclude: /node_modules/ + }, + { + test: /\.js$/, + loader: 'eslint', + exclude: /node_modules/ + } + ], + loaders: [ + { + test: /\.vue$/, + loader: 'vue' + }, + { + test: /\.js$/, + exclude: /node_modules|vue\/src|vue-router\/|vue-loader\/|vue-hot-reload-api\//, + loader: 'babel' + }, + { + test: /\.css$/, + loader: 'style-loader!css-loader?root=./docs/' + }, + { + test: /\.scss$/, + loader: 'style!css!sass' + }, + { + test: /\.less$/, + loader: 'style-loader!css-loader!less-loader' + }, + { + test: /\.md/, + loader: 'vue-markdown-loader' + }, + { + test: /\.json$/, + loader: 'json' + }, + { + test: /\.(woff2?|eot|ttf|otf|svg)(\?.*)?$/, + loader: 'url' + } + ] + }, + babel: { + presets: ['es2015'], + plugins: ['transform-runtime'] + }, + eslint: { + formatter: require('eslint-friendly-formatter') + }, + vueMarkdown: { + use: [ + [require('markdown-it-anchor'), { + level: 2, + slugify: slugify, + permalink: true, + permalinkBefore: true + }], + [require('markdown-it-container'), 'demo', { + validate: function(params) { + return params.trim().match(/^demo\s*(.*)$/); + }, + + render: function(tokens, idx) { + var m = tokens[idx].info.trim().match(/^demo\s*(.*)$/); + if (tokens[idx].nesting === 1) { + var description = (m && m.length > 1) ? m[1] : ''; + var content = tokens[idx + 1].content; + var html = convert(striptags.strip(content, ['script', 'style'])); + var script = striptags.fetch(content, 'script'); + var style = striptags.fetch(content, 'style'); + var descriptionHTML = description + ? md.render(description) + : ''; + + return ` +
${html}
+ ${descriptionHTML} +
`; + } + return '
\n'; + } + }] + ], + preprocess: function(MarkdownIt, source) { + MarkdownIt.renderer.rules.table_open = function() { + return ''; + }; + MarkdownIt.renderer.rules.fence = wrap(MarkdownIt.renderer.rules.fence); + return source; + } + }, + devtool: 'source-map' +}; + +if (process.env.NODE_ENV === 'production') { + delete module.exports.devtool; + module.exports.plugins = [ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: '"production"' + } + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + } + }) + ]; +} \ No newline at end of file diff --git a/docs/App.vue b/docs/App.vue new file mode 100644 index 000000000..93fd41e5c --- /dev/null +++ b/docs/App.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/docs/assets/docs.less b/docs/assets/docs.less new file mode 100644 index 000000000..16cbf50c1 --- /dev/null +++ b/docs/assets/docs.less @@ -0,0 +1,70 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + vertical-align: baseline; +} + +body { + font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif; + overflow: auto; + font-weight: 400; + -webkit-font-smoothing: antialiased; +} + +a { + color: #4078c0; + text-decoration: none; +} + +button, input, select, textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; + color: inherit; +} + +ul { + list-style: none; +} + +.hljs { + line-height: 1.8; + font-family: Menlo, Monaco, Consolas, Courier, monospace; + font-size: 12px; + padding: 18px 24px; + background-color: #f9fafc; + border: solid 1px #eaeefb; + margin-bottom: 25px; + border-radius: 4px; + -webkit-font-smoothing: auto; +} + +// 操作类图标 - 导出 +@font-face { + font-family: "handle"; + src: url("./fonts/iconfont.eot"); /* IE9*/ + src: url("./fonts/iconfont.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("./fonts/iconfont.woff") format("woff"), /* chrome、firefox */ + url("./fonts/iconfont.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ + url("./fonts/iconfont.svg#iconfont") format("svg"); /* iOS 4.1- */ +} + +.iconhandle { + font-family: "handle"; + font-size: 16px; + font-style: normal; +} diff --git a/docs/assets/fonts/iconfont.eot b/docs/assets/fonts/iconfont.eot new file mode 100644 index 000000000..d7067e210 Binary files /dev/null and b/docs/assets/fonts/iconfont.eot differ diff --git a/docs/assets/fonts/iconfont.svg b/docs/assets/fonts/iconfont.svg new file mode 100644 index 000000000..97301945b --- /dev/null +++ b/docs/assets/fonts/iconfont.svg @@ -0,0 +1,326 @@ + + + + +Created by FontForge 20120731 at Fri Sep 23 11:54:25 2016 + By admin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/assets/fonts/iconfont.ttf b/docs/assets/fonts/iconfont.ttf new file mode 100644 index 000000000..6519546fb Binary files /dev/null and b/docs/assets/fonts/iconfont.ttf differ diff --git a/docs/assets/fonts/iconfont.woff b/docs/assets/fonts/iconfont.woff new file mode 100644 index 000000000..763033714 Binary files /dev/null and b/docs/assets/fonts/iconfont.woff differ diff --git a/docs/build/1.1.js b/docs/build/1.1.js new file mode 100644 index 000000000..ffb3ffc98 --- /dev/null +++ b/docs/build/1.1.js @@ -0,0 +1,241 @@ +webpackJsonp([1],{ + +/***/ 22: +/***/ function(module, exports, __webpack_require__) { + + var map = { + "./examples/sample.md": 23 + }; + function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); + }; + function webpackContextResolve(req) { + return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); + }; + webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); + }; + webpackContext.resolve = webpackContextResolve; + module.exports = webpackContext; + webpackContext.id = 22; + + +/***/ }, + +/***/ 23: +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(24); + +/***/ }, + +/***/ 24: +/***/ function(module, exports, __webpack_require__) { + + var __vue_exports__, __vue_options__ + var __vue_styles__ = {} + + /* script */ + __vue_exports__ = __webpack_require__(25) + + /* template */ + var __vue_template__ = __webpack_require__(26) + __vue_options__ = __vue_exports__ = __vue_exports__ || {} + if ( + typeof __vue_exports__.default === "object" || + typeof __vue_exports__.default === "function" + ) { + if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")} + __vue_options__ = __vue_exports__ = __vue_exports__.default + } + if (typeof __vue_options__ === "function") { + __vue_options__ = __vue_options__.options + } + __vue_options__.__file = "/Users/fenglai/project/oxygen/node_modules/vue-markdown-loader/.cache/sample-1.vue" + __vue_options__.render = __vue_template__.render + __vue_options__.staticRenderFns = __vue_template__.staticRenderFns + + /* hot reload */ + if (false) {(function () { + var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-94b78d06", __vue_options__) + } else { + hotAPI.reload("data-v-94b78d06", __vue_options__) + } + })()} + if (__vue_options__.functional) {console.error("[vue-loader] sample-1.vue: functional components are not supported and should be defined in plain js files using render functions.")} + + module.exports = __vue_exports__ + + +/***/ }, + +/***/ 25: +/***/ function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + + exports.default = { + data: function data() { + return { + author: 'test' + }; + } + }; + +/***/ }, + +/***/ 26: +/***/ function(module, exports, __webpack_require__) { + + module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('section', [_vm._m(0), _vm._v(" "), _vm._m(1), _vm._v(" "), _c('p', [_vm._v("基础的按钮用法。")]), _vm._v(" "), _c('demo-block', { + staticClass: "demo-box" + }, [_c('div', { + staticClass: "source", + slot: "source" + }, [_c('sample', { + attrs: { + "author": _vm.author + } + })], 1), _vm._v(" "), _c('p', [_vm._v("样例代码")]), _vm._v(" "), _c('div', { + staticClass: "highlight", + slot: "highlight" + }, [_c('pre', [_c('code', { + staticClass: "hljs language-html" + }, [_c('span', { + staticClass: "hljs-tag" + }, [_vm._v("<"), _c('span', { + staticClass: "hljs-name" + }, [_vm._v("sample")]), _vm._v(" "), _c('span', { + staticClass: "hljs-attr" + }, [_vm._v(":author")]), _vm._v("="), _c('span', { + staticClass: "hljs-string" + }, [_vm._v("\"author\"")]), _vm._v(">")]), _c('span', { + staticClass: "hljs-tag" + }, [_vm._v("")]), _vm._v("\n")])])])]), _vm._v(" "), _vm._m(2), _vm._v(" "), _vm._m(3)], 1) + },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('h2', { + attrs: { + "id": "sample-zu-jian" + } + }, [_c('a', { + staticClass: "header-anchor", + attrs: { + "href": "#sample-zu-jian", + "aria-hidden": "true" + } + }, [_vm._v("¶")]), _vm._v(" sample组件")]) + },function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('h3', { + attrs: { + "id": "ji-chu-yong-fa" + } + }, [_c('a', { + staticClass: "header-anchor", + attrs: { + "href": "#ji-chu-yong-fa", + "aria-hidden": "true" + } + }, [_vm._v("¶")]), _vm._v(" 基础用法")]) + },function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('h3', { + attrs: { + "id": "attributes" + } + }, [_c('a', { + staticClass: "header-anchor", + attrs: { + "href": "#attributes", + "aria-hidden": "true" + } + }, [_vm._v("¶")]), _vm._v(" Attributes")]) + },function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; + return _c('table', { + staticClass: "table" + }, [_c('thead', [_c('tr', [_c('th', [_vm._v("参数")]), _vm._v(" "), _c('th', [_vm._v("说明")]), _vm._v(" "), _c('th', [_vm._v("类型")]), _vm._v(" "), _c('th', [_vm._v("可选值")]), _vm._v(" "), _c('th', [_vm._v("默认值")])])]), _vm._v(" "), _c('tbody', [_c('tr', [_c('td', [_vm._v("size")]), _vm._v(" "), _c('td', [_vm._v("尺寸")]), _vm._v(" "), _c('td', [_vm._v("string")]), _vm._v(" "), _c('td', [_vm._v("large")]), _vm._v(" "), _c('td', [_vm._v("—")])]), _vm._v(" "), _c('tr', [_c('td', [_vm._v("type")]), _vm._v(" "), _c('td', [_vm._v("类型")]), _vm._v(" "), _c('td', [_vm._v("string")]), _vm._v(" "), _c('td', [_vm._v("primary,warning,text")]), _vm._v(" "), _c('td', [_vm._v("—")])]), _vm._v(" "), _c('tr', [_c('td', [_vm._v("disabled")]), _vm._v(" "), _c('td', [_vm._v("禁用")]), _vm._v(" "), _c('td', [_vm._v("boolean")]), _vm._v(" "), _c('td', [_vm._v("true, false")]), _vm._v(" "), _c('td', [_vm._v("false")])]), _vm._v(" "), _c('tr', [_c('td', [_vm._v("icon")]), _vm._v(" "), _c('td', [_vm._v("图标,已有的图标库中的图标名")]), _vm._v(" "), _c('td', [_vm._v("string")]), _vm._v(" "), _c('td', [_vm._v("—")]), _vm._v(" "), _c('td', [_vm._v("—")])]), _vm._v(" "), _c('tr', [_c('td', [_vm._v("to")]), _vm._v(" "), _c('td', [_vm._v("路由跳转路径")]), _vm._v(" "), _c('td', [_vm._v("Object")]), _vm._v(" "), _c('td', [_vm._v("—")]), _vm._v(" "), _c('td', [_vm._v("—")])])])]) + }]} + module.exports.render._withStripped = true + if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-loader/node_modules/vue-hot-reload-api").rerender("data-v-94b78d06", module.exports) + } + } + +/***/ } + +}); +//# sourceMappingURL=1.1.js.map \ No newline at end of file diff --git a/docs/build/1.1.js.map b/docs/build/1.1.js.map new file mode 100644 index 000000000..2d11e7af3 --- /dev/null +++ b/docs/build/1.1.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./docs ^\\.\\/examples.*\\.md$","webpack:///./docs/examples/sample.md","webpack:///./~/vue-markdown-loader/.cache/sample-1.vue","webpack:///sample-1.vue","webpack:///./~/vue-markdown-loader/.cache/sample-1.vue?5260"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,uDAAuD;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACdA,0C;;;;;;;ACAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAsD,mDAAmD,IAAI;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,EAAC;AACD,kCAAiC;;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0BA;;;yBAEA;;eAGA;AAFA;AAGA;AALA,G;;;;;;;AChEA,iBAAgB,mBAAmB,aAAa,0BAA0B;AAC1E;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA,IAAG;AACH,EAAC,+BAA+B,aAAa,0BAA0B;AACvE;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC,aAAa,aAAa,0BAA0B;AACrD;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC,aAAa,aAAa,0BAA0B;AACrD;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC,aAAa,aAAa,0BAA0B;AACrD;AACA;AACA,IAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,E","file":"1.1.js","sourcesContent":["var map = {\n\t\"./examples/sample.md\": 23\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\treturn map[req] || (function() { throw new Error(\"Cannot find module '\" + req + \"'.\") }());\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 22;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./docs ^\\.\\/examples.*\\.md$\n// module id = 22\n// module chunks = 1","module.exports = require(\"!!vue-loader!./../../node_modules/vue-markdown-loader/.cache/sample-1.vue\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./docs/examples/sample.md\n// module id = 23\n// module chunks = 1","var __vue_exports__, __vue_options__\nvar __vue_styles__ = {}\n\n/* script */\n__vue_exports__ = require(\"!!babel-loader!vue-loader/lib/selector?type=script&index=0!./sample-1.vue\")\n\n/* template */\nvar __vue_template__ = require(\"!!vue-loader/lib/template-compiler?id=data-v-94b78d06!vue-loader/lib/selector?type=template&index=0!./sample-1.vue\")\n__vue_options__ = __vue_exports__ = __vue_exports__ || {}\nif (\n typeof __vue_exports__.default === \"object\" ||\n typeof __vue_exports__.default === \"function\"\n) {\nif (Object.keys(__vue_exports__).some(function (key) { return key !== \"default\" && key !== \"__esModule\" })) {console.error(\"named exports are not supported in *.vue files.\")}\n__vue_options__ = __vue_exports__ = __vue_exports__.default\n}\nif (typeof __vue_options__ === \"function\") {\n __vue_options__ = __vue_options__.options\n}\n__vue_options__.__file = \"/Users/fenglai/project/oxygen/node_modules/vue-markdown-loader/.cache/sample-1.vue\"\n__vue_options__.render = __vue_template__.render\n__vue_options__.staticRenderFns = __vue_template__.staticRenderFns\n\n/* hot reload */\nif (module.hot) {(function () {\n var hotAPI = require(\"vue-loader/node_modules/vue-hot-reload-api\")\n hotAPI.install(require(\"vue\"), false)\n if (!hotAPI.compatible) return\n module.hot.accept()\n if (!module.hot.data) {\n hotAPI.createRecord(\"data-v-94b78d06\", __vue_options__)\n } else {\n hotAPI.reload(\"data-v-94b78d06\", __vue_options__)\n }\n})()}\nif (__vue_options__.functional) {console.error(\"[vue-loader] sample-1.vue: functional components are not supported and should be defined in plain js files using render functions.\")}\n\nmodule.exports = __vue_exports__\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader!./~/vue-markdown-loader/.cache/sample-1.vue\n// module id = 24\n// module chunks = 1","\n\n\n\n\n// WEBPACK FOOTER //\n// sample-1.vue?ce011e08","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('section', [_vm._m(0), _vm._v(\" \"), _vm._m(1), _vm._v(\" \"), _c('p', [_vm._v(\"基础的按钮用法。\")]), _vm._v(\" \"), _c('demo-block', {\n staticClass: \"demo-box\"\n }, [_c('div', {\n staticClass: \"source\",\n slot: \"source\"\n }, [_c('sample', {\n attrs: {\n \"author\": _vm.author\n }\n })], 1), _vm._v(\" \"), _c('p', [_vm._v(\"样例代码\")]), _vm._v(\" \"), _c('div', {\n staticClass: \"highlight\",\n slot: \"highlight\"\n }, [_c('pre', [_c('code', {\n staticClass: \"hljs language-html\"\n }, [_c('span', {\n staticClass: \"hljs-tag\"\n }, [_vm._v(\"<\"), _c('span', {\n staticClass: \"hljs-name\"\n }, [_vm._v(\"sample\")]), _vm._v(\" \"), _c('span', {\n staticClass: \"hljs-attr\"\n }, [_vm._v(\":author\")]), _vm._v(\"=\"), _c('span', {\n staticClass: \"hljs-string\"\n }, [_vm._v(\"\\\"author\\\"\")]), _vm._v(\">\")]), _c('span', {\n staticClass: \"hljs-tag\"\n }, [_vm._v(\"\")]), _vm._v(\"\\n\")])])])]), _vm._v(\" \"), _vm._m(2), _vm._v(\" \"), _vm._m(3)], 1)\n},staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('h2', {\n attrs: {\n \"id\": \"sample-zu-jian\"\n }\n }, [_c('a', {\n staticClass: \"header-anchor\",\n attrs: {\n \"href\": \"#sample-zu-jian\",\n \"aria-hidden\": \"true\"\n }\n }, [_vm._v(\"¶\")]), _vm._v(\" sample组件\")])\n},function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('h3', {\n attrs: {\n \"id\": \"ji-chu-yong-fa\"\n }\n }, [_c('a', {\n staticClass: \"header-anchor\",\n attrs: {\n \"href\": \"#ji-chu-yong-fa\",\n \"aria-hidden\": \"true\"\n }\n }, [_vm._v(\"¶\")]), _vm._v(\" 基础用法\")])\n},function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('h3', {\n attrs: {\n \"id\": \"attributes\"\n }\n }, [_c('a', {\n staticClass: \"header-anchor\",\n attrs: {\n \"href\": \"#attributes\",\n \"aria-hidden\": \"true\"\n }\n }, [_vm._v(\"¶\")]), _vm._v(\" Attributes\")])\n},function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('table', {\n staticClass: \"table\"\n }, [_c('thead', [_c('tr', [_c('th', [_vm._v(\"参数\")]), _vm._v(\" \"), _c('th', [_vm._v(\"说明\")]), _vm._v(\" \"), _c('th', [_vm._v(\"类型\")]), _vm._v(\" \"), _c('th', [_vm._v(\"可选值\")]), _vm._v(\" \"), _c('th', [_vm._v(\"默认值\")])])]), _vm._v(\" \"), _c('tbody', [_c('tr', [_c('td', [_vm._v(\"size\")]), _vm._v(\" \"), _c('td', [_vm._v(\"尺寸\")]), _vm._v(\" \"), _c('td', [_vm._v(\"string\")]), _vm._v(\" \"), _c('td', [_vm._v(\"large\")]), _vm._v(\" \"), _c('td', [_vm._v(\"—\")])]), _vm._v(\" \"), _c('tr', [_c('td', [_vm._v(\"type\")]), _vm._v(\" \"), _c('td', [_vm._v(\"类型\")]), _vm._v(\" \"), _c('td', [_vm._v(\"string\")]), _vm._v(\" \"), _c('td', [_vm._v(\"primary,warning,text\")]), _vm._v(\" \"), _c('td', [_vm._v(\"—\")])]), _vm._v(\" \"), _c('tr', [_c('td', [_vm._v(\"disabled\")]), _vm._v(\" \"), _c('td', [_vm._v(\"禁用\")]), _vm._v(\" \"), _c('td', [_vm._v(\"boolean\")]), _vm._v(\" \"), _c('td', [_vm._v(\"true, false\")]), _vm._v(\" \"), _c('td', [_vm._v(\"false\")])]), _vm._v(\" \"), _c('tr', [_c('td', [_vm._v(\"icon\")]), _vm._v(\" \"), _c('td', [_vm._v(\"图标,已有的图标库中的图标名\")]), _vm._v(\" \"), _c('td', [_vm._v(\"string\")]), _vm._v(\" \"), _c('td', [_vm._v(\"—\")]), _vm._v(\" \"), _c('td', [_vm._v(\"—\")])]), _vm._v(\" \"), _c('tr', [_c('td', [_vm._v(\"to\")]), _vm._v(\" \"), _c('td', [_vm._v(\"路由跳转路径\")]), _vm._v(\" \"), _c('td', [_vm._v(\"Object\")]), _vm._v(\" \"), _c('td', [_vm._v(\"—\")]), _vm._v(\" \"), _c('td', [_vm._v(\"—\")])])])])\n}]}\nmodule.exports.render._withStripped = true\nif (module.hot) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-loader/node_modules/vue-hot-reload-api\").rerender(\"data-v-94b78d06\", module.exports)\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler.js?id=data-v-94b78d06!./~/vue-loader/lib/selector.js?type=template&index=0!./~/vue-markdown-loader/.cache/sample-1.vue\n// module id = 26\n// module chunks = 1"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/build/build-docs.js b/docs/build/build-docs.js new file mode 100644 index 000000000..fdcfee4c4 --- /dev/null +++ b/docs/build/build-docs.js @@ -0,0 +1,9975 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // install a JSONP callback for chunk loading +/******/ var parentJsonpFunction = window["webpackJsonp"]; +/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) { +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0, callbacks = []; +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(installedChunks[chunkId]) +/******/ callbacks.push.apply(callbacks, installedChunks[chunkId]); +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ for(moduleId in moreModules) { +/******/ modules[moduleId] = moreModules[moduleId]; +/******/ } +/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules); +/******/ while(callbacks.length) +/******/ callbacks.shift().call(null, __webpack_require__); +/******/ +/******/ }; +/******/ +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // object to store loaded and loading chunks +/******/ // "0" means "already loaded" +/******/ // Array means "loading", array contains callbacks +/******/ var installedChunks = { +/******/ 0:0 +/******/ }; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = function requireEnsure(chunkId, callback) { +/******/ // "0" is the signal for "already loaded" +/******/ if(installedChunks[chunkId] === 0) +/******/ return callback.call(null, __webpack_require__); +/******/ +/******/ // an array means "currently loading". +/******/ if(installedChunks[chunkId] !== undefined) { +/******/ installedChunks[chunkId].push(callback); +/******/ } else { +/******/ // start chunk loading +/******/ installedChunks[chunkId] = [callback]; +/******/ var head = document.getElementsByTagName('head')[0]; +/******/ var script = document.createElement('script'); +/******/ script.type = 'text/javascript'; +/******/ script.charset = 'utf-8'; +/******/ script.async = true; +/******/ +/******/ script.src = __webpack_require__.p + "" + chunkId + "." + ({}[chunkId]||chunkId) + ".js"; +/******/ head.appendChild(script); +/******/ } +/******/ }; +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "docs/build"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + __webpack_require__(1); + + var _vue = __webpack_require__(9); + + var _vue2 = _interopRequireDefault(_vue); + + var _vueRouter = __webpack_require__(11); + + var _vueRouter2 = _interopRequireDefault(_vueRouter); + + var _App = __webpack_require__(12); + + var _App2 = _interopRequireDefault(_App); + + var _router = __webpack_require__(21); + + var _router2 = _interopRequireDefault(_router); + + var _demoBlock = __webpack_require__(27); + + var _demoBlock2 = _interopRequireDefault(_demoBlock); + + var _sideNav = __webpack_require__(32); + + var _sideNav2 = _interopRequireDefault(_sideNav); + + var _index = __webpack_require__(37); + + var _index2 = _interopRequireDefault(_index); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + _vue2.default.use(_index2.default); + _vue2.default.use(_vueRouter2.default); + _vue2.default.component('demo-block', _demoBlock2.default); + _vue2.default.component('side-nav', _sideNav2.default); + + // init components + // for (let i in Oxygen) { + // let module = Oxygen[i]; + // if (!module.ignoreInit) { + // Vue.component(module.name, module); + // } + // } + + var AppContainer = _vue2.default.extend(_App2.default); + var router = new _vueRouter2.default(); + + router.map(_router2.default); + + router.redirect({ + '*': '/component/sample' + }); + + router.beforeEach(function (transition) { + window.scrollTo(0, 0); + transition.next(); + }); + + router.start(AppContainer, '#app-container'); + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + // style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// App.vue?d9d50a12","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// demo-block.vue?7c355e7f","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"demo-block\",\n class: [_vm.blockClass, {\n 'hover': _vm.hovering\n }],\n on: {\n \"mouseenter\": function($event) {\n _vm.hovering = true\n },\n \"mouseleave\": function($event) {\n _vm.hovering = false\n }\n }\n }, [_vm._t(\"source\"), _vm._v(\" \"), _c('div', {\n staticClass: \"meta\"\n }, [_c('div', {\n staticClass: \"description\"\n }, [_vm._t(\"default\")], 2), _vm._v(\" \"), _vm._t(\"highlight\")], 2), _vm._v(\" \"), _c('div', {\n staticClass: \"demo-block-control\",\n on: {\n \"click\": function($event) {\n _vm.isExpanded = !_vm.isExpanded\n }\n }\n }, [_c('span', {\n directives: [{\n name: \"show\",\n rawName: \"v-show\",\n value: (_vm.hovering),\n expression: \"hovering\"\n }]\n }, [_vm._v(_vm._s(_vm.controlText))])])], 2)\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (module.hot) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-loader/node_modules/vue-hot-reload-api\").rerender(\"data-v-59e535e6\", module.exports)\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler.js?id=data-v-59e535e6!./~/vue-loader/lib/selector.js?type=template&index=0!./docs/components/demo-block.vue\n// module id = 31\n// module chunks = 0","var __vue_exports__, __vue_options__\nvar __vue_styles__ = {}\n\n/* styles */\nrequire(\"!!vue-style-loader!css-loader?sourceMap!vue-loader/lib/style-rewriter?id=data-v-fec531a0!less-loader!vue-loader/lib/selector?type=styles&index=0!./side-nav.vue\")\n\n/* script */\n__vue_exports__ = require(\"!!babel-loader!vue-loader/lib/selector?type=script&index=0!./side-nav.vue\")\n\n/* template */\nvar __vue_template__ = require(\"!!vue-loader/lib/template-compiler?id=data-v-fec531a0!vue-loader/lib/selector?type=template&index=0!./side-nav.vue\")\n__vue_options__ = __vue_exports__ = __vue_exports__ || {}\nif (\n typeof __vue_exports__.default === \"object\" ||\n typeof __vue_exports__.default === \"function\"\n) {\nif (Object.keys(__vue_exports__).some(function (key) { return key !== \"default\" && key !== \"__esModule\" })) {console.error(\"named exports are not supported in *.vue files.\")}\n__vue_options__ = __vue_exports__ = __vue_exports__.default\n}\nif (typeof __vue_options__ === \"function\") {\n __vue_options__ = __vue_options__.options\n}\n__vue_options__.__file = \"/Users/fenglai/project/oxygen/docs/components/side-nav.vue\"\n__vue_options__.render = __vue_template__.render\n__vue_options__.staticRenderFns = __vue_template__.staticRenderFns\n\n/* hot reload */\nif (module.hot) {(function () {\n var hotAPI = require(\"vue-loader/node_modules/vue-hot-reload-api\")\n hotAPI.install(require(\"vue\"), false)\n if (!hotAPI.compatible) return\n module.hot.accept()\n if (!module.hot.data) {\n hotAPI.createRecord(\"data-v-fec531a0\", __vue_options__)\n } else {\n hotAPI.reload(\"data-v-fec531a0\", __vue_options__)\n }\n})()}\nif (__vue_options__.functional) {console.error(\"[vue-loader] side-nav.vue: functional components are not supported and should be defined in plain js files using render functions.\")}\n\nmodule.exports = __vue_exports__\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./docs/components/side-nav.vue\n// module id = 32\n// module chunks = 0","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// side-nav.vue?3d55089e","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"side-nav\"\n }, [_c('ul', _vm._l((_vm.data), function(item) {\n return _c('li', {\n staticClass: \"nav-item\"\n }, [(!item.path) ? _c('a', [_vm._v(_vm._s(item.name))]) : _c('a', {\n directives: [{\n name: \"link\",\n rawName: \"v-link\",\n value: ({\n path: _vm.base + item.path,\n activeClass: 'active',\n exact: true\n }),\n expression: \"{ path: base + item.path, activeClass: 'active', exact: true}\"\n }]\n }, [_vm._v(_vm._s(item.title || item.name))]), _vm._v(\" \"), (item.children) ? _c('ul', {\n staticClass: \"pure-menu-list sub-nav\"\n }, _vm._l((item.children), function(navItem) {\n return _c('li', {\n staticClass: \"nav-item\"\n }, [_c('a', {\n directives: [{\n name: \"link\",\n rawName: \"v-link\",\n value: ({\n path: _vm.base + navItem.path,\n activeClass: 'active',\n exact: true\n }),\n expression: \"{ path: base + navItem.path, activeClass: 'active', exact: true}\"\n }]\n }, [_vm._v(_vm._s(navItem.title || navItem.name))])])\n })) : _vm._e(), _vm._v(\" \"), (item.groups) ? _vm._l((item.groups), function(group) {\n return _c('div', {\n staticClass: \"nav-group\"\n }, [_c('div', {\n staticClass: \"nav-group__title\"\n }, [_vm._v(_vm._s(group.groupName))]), _vm._v(\" \"), _c('ul', {\n staticClass: \"pure-menu-list\"\n }, [_vm._l((group.list), function(navItem) {\n return [(!navItem.disabled) ? _c('li', {\n staticClass: \"nav-item\"\n }, [_c('a', {\n directives: [{\n name: \"link\",\n rawName: \"v-link\",\n value: ({\n path: _vm.base + navItem.path,\n activeClass: 'active',\n exact: true\n }),\n expression: \"{ path: base + navItem.path, activeClass: 'active', exact: true}\"\n }]\n }, [_vm._v(_vm._s(navItem.title))])]) : _vm._e()]\n })], 2)])\n }) : _vm._e()], 2)\n }))])\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (module.hot) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-loader/node_modules/vue-hot-reload-api\").rerender(\"data-v-fec531a0\", module.exports)\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler.js?id=data-v-fec531a0!./~/vue-loader/lib/selector.js?type=template&index=0!./docs/components/side-nav.vue\n// module id = 36\n// module chunks = 0","import Sample from '../packages/sample/index.js';\n\nconst install = function(Vue) {\n if (install.installed) return;\n\n Vue.component(Sample.name, Sample);\n};\n\n// auto install\nif (typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n};\n\nmodule.exports = {\n install,\n version: '0.0.1',\n Sample\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import SampleComponent from './src/main';\n\nexport default SampleComponent;\n\n\n\n// WEBPACK FOOTER //\n// ./packages/sample/index.js","var __vue_exports__, __vue_options__\nvar __vue_styles__ = {}\n\n/* script */\n__vue_exports__ = require(\"!!babel-loader!vue-loader/lib/selector?type=script&index=0!./main.vue\")\n\n/* template */\nvar __vue_template__ = require(\"!!vue-loader/lib/template-compiler?id=data-v-58aa66b6!vue-loader/lib/selector?type=template&index=0!./main.vue\")\n__vue_options__ = __vue_exports__ = __vue_exports__ || {}\nif (\n typeof __vue_exports__.default === \"object\" ||\n typeof __vue_exports__.default === \"function\"\n) {\nif (Object.keys(__vue_exports__).some(function (key) { return key !== \"default\" && key !== \"__esModule\" })) {console.error(\"named exports are not supported in *.vue files.\")}\n__vue_options__ = __vue_exports__ = __vue_exports__.default\n}\nif (typeof __vue_options__ === \"function\") {\n __vue_options__ = __vue_options__.options\n}\n__vue_options__.__file = \"/Users/fenglai/project/oxygen/packages/sample/src/main.vue\"\n__vue_options__.render = __vue_template__.render\n__vue_options__.staticRenderFns = __vue_template__.staticRenderFns\n\n/* hot reload */\nif (module.hot) {(function () {\n var hotAPI = require(\"vue-loader/node_modules/vue-hot-reload-api\")\n hotAPI.install(require(\"vue\"), false)\n if (!hotAPI.compatible) return\n module.hot.accept()\n if (!module.hot.data) {\n hotAPI.createRecord(\"data-v-58aa66b6\", __vue_options__)\n } else {\n hotAPI.reload(\"data-v-58aa66b6\", __vue_options__)\n }\n})()}\nif (__vue_options__.functional) {console.error(\"[vue-loader] main.vue: functional components are not supported and should be defined in plain js files using render functions.\")}\n\nmodule.exports = __vue_exports__\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./packages/sample/src/main.vue\n// module id = 39\n// module chunks = 0","\n\n\n\n\n\n// WEBPACK FOOTER //\n// main.vue?0a81fd42","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', [_c('h2', [_vm._v(\"author: \" + _vm._s(_vm.author))]), _vm._v(\" \"), _c('div', [_vm._v(\"Hello \" + _vm._s(_vm.name))])])\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (module.hot) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-loader/node_modules/vue-hot-reload-api\").rerender(\"data-v-58aa66b6\", module.exports)\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler.js?id=data-v-58aa66b6!./~/vue-loader/lib/selector.js?type=template&index=0!./packages/sample/src/main.vue\n// module id = 41\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/components/demo-block.vue b/docs/components/demo-block.vue new file mode 100644 index 000000000..17f06f8cc --- /dev/null +++ b/docs/components/demo-block.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/docs/components/side-nav.vue b/docs/components/side-nav.vue new file mode 100644 index 000000000..9476f1b39 --- /dev/null +++ b/docs/components/side-nav.vue @@ -0,0 +1,119 @@ + + + + + diff --git a/docs/examples/sample.md b/docs/examples/sample.md new file mode 100644 index 000000000..bd58a81f1 --- /dev/null +++ b/docs/examples/sample.md @@ -0,0 +1,28 @@ + + +## sample组件 + +### 基础用法 + +author设置为test + +:::demo 样例代码 +```html + +``` +::: + + +### API + +| 参数 | 说明 | 类型 | 默认值 | 可选值 | +|-----------|-----------|-----------|-------------|-------------| +| className | 自定义额外类名 | string | '' | '' | diff --git a/docs/index.js b/docs/index.js new file mode 100644 index 000000000..82477ced0 --- /dev/null +++ b/docs/index.js @@ -0,0 +1,37 @@ +import './assets/docs.less'; +import Vue from 'vue'; +import VueRouter from 'vue-router'; +import App from './App'; +import routes from './router.config'; +import demoBlock from './components/demo-block'; +import SideNav from './components/side-nav'; +import Oxygen from '../src/index'; + +Vue.use(Oxygen); +Vue.use(VueRouter); +Vue.component('demo-block', demoBlock); +Vue.component('side-nav', SideNav); + +// init components +// for (let i in Oxygen) { +// let module = Oxygen[i]; +// if (!module.ignoreInit) { +// Vue.component(module.name, module); +// } +// } + +const router = new VueRouter({ + mode: 'hash', + base: __dirname, + routes +}); + +// router.beforeEach(function(transition) { +// window.scrollTo(0, 0); +// transition.next(); +// }); + +new Vue({ // eslint-disable-line + render: h => h(App), + router +}).$mount('#app-container'); diff --git a/docs/nav.config.json b/docs/nav.config.json new file mode 100644 index 000000000..aab254d90 --- /dev/null +++ b/docs/nav.config.json @@ -0,0 +1,18 @@ +{ + "zh-CN": [ + { + "name": "基础组件", + "groups": [ + { + "groupName": "Basic", + "list": [ + { + "path": "/sample", + "title": "Sample组件" + } + ] + } + ] + } + ] +} diff --git a/docs/router.config.js b/docs/router.config.js new file mode 100644 index 000000000..3aaeb1002 --- /dev/null +++ b/docs/router.config.js @@ -0,0 +1,36 @@ +import navConfig from './nav.config.json'; + +const registerRoute = (navConfig) => { + let route = []; + let navs = navConfig['zh-CN']; + navs.forEach(nav => { + if (nav.groups) { + nav.groups.forEach(group => { + group.list.forEach(nav => { + addRoute(nav); + }); + }); + } else if (nav.children) { + nav.children.forEach(nav => { + addRoute(nav); + }); + } else { + addRoute(nav); + } + }); + + function addRoute(page) { + route.push({ + path: '/component' + page.path, + component: function(resolve) { + require([`./examples${page.path}.md`], resolve); + } + }); + } + + return route; +}; + +let route = registerRoute(navConfig); + +export default route; diff --git a/index.html b/index.html new file mode 100644 index 000000000..2a1d2e4be --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + Oxygen + + + +
+ +
+ + + + diff --git a/package.json b/package.json index b87b988d1..ac21b9580 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "bootstrap": "npm i --registry=http://registry.npm.qima-inc.com", "build:file": "node build/bin/build-entry.js", "dev": "npm run bootstrap && npm run build:file", + "builddocs": "webpack --progress --hide-modules --config build/webpack.config.js && set NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.js", + "docs": "npm run dev && webpack-dev-server --inline --hot --config build/webpack.config.js", "clean": "rimraf lib && rimraf packages/*/lib" }, "repository": { @@ -32,13 +34,23 @@ }, "devDependencies": { "babel-cli": "^6.14.0", - "babel-core": "^6.14.0", + "babel-core": "^6.17.0", + "babel-eslint": "^6.1.2", "babel-loader": "^6.2.5", "babel-plugin-module-resolver": "^2.2.0", "babel-plugin-syntax-jsx": "^6.8.0", + "babel-plugin-transform-runtime": "^6.15.0", "babel-plugin-transform-vue-jsx": "^3.3.0", - "babel-preset-es2015": "^6.14.0", + "babel-preset-es2015": "^6.16.0", + "babel-runtime": "^6.11.0", "copy-webpack-plugin": "^4.0.1", + "eslint": "^2.10.2", + "eslint-config-standard": "^5.1.0", + "eslint-friendly-formatter": "^2.0.5", + "eslint-loader": "^1.3.0", + "eslint-plugin-html": "^1.3.0", + "eslint-plugin-promise": "^1.0.8", + "eslint-plugin-standard": "^1.3.2", "run-sequence": "^1.2.2", "cp-cli": "^1.0.2", "cross-env": "^3.1.3", @@ -52,7 +64,7 @@ "gulp": "^3.9.1", "gulp-cssmin": "^0.1.7", "gulp-postcss": "^6.1.1", - "highlight.js": "^9.3.0", + "highlight.js": "^9.8.0", "html-loader": "^0.4.3", "html-webpack-plugin": "^2.22.0", "inject-loader": "^3.0.0-beta2", @@ -61,26 +73,34 @@ "json-templater": "^1.0.4", "lerna": "2.0.0-beta.31", "lolex": "^1.5.1", + "less": "^2.7.0", + "less-loader": "^2.2.3", "markdown-it": "^6.1.1", "markdown-it-anchor": "^2.5.0", "markdown-it-container": "^2.0.0", + "node-sass": "^3.10.1", + "prismjs": "^1.5.1", "postcss": "^5.1.2", "postcss-loader": "^0.11.1", "postcss-salad": "^1.0.5", "rimraf": "^2.5.4", + "sass-loader": "^3.2.3", "style-loader": "^0.13.1", "theaterjs": "^3.0.0", "transliteration": "^1.1.11", "uppercamelcase": "^1.1.0", "url-loader": "^0.5.7", "vue": "^2.1.8", + "vue-hot-reload-api": "^1.3.3", + "vue-html-loader": "^1.2.3", "vue-loader": "^10.0.2", - "vue-markdown-loader": "^0.5.1", + "vue-markdown-loader": "^0.6.1", "vue-router": "^2.0.0", + "vue-style-loader": "^1.0.0", "vue-template-compiler": "^2.1.8", "vue-template-es2015-compiler": "^1.4.2", "webpack": "^1.13.2", - "webpack-dev-server": "^1.15.1", + "webpack-dev-server": "^1.16.0", "webpack-node-externals": "^1.5.4" } } diff --git a/packages/sample/src/main.vue b/packages/sample/src/main.vue index 9a9b4a3b0..0d2c38ebd 100644 --- a/packages/sample/src/main.vue +++ b/packages/sample/src/main.vue @@ -1,14 +1,18 @@ diff --git a/src/index.js b/src/index.js index 42dc4cdff..df28366a7 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,6 @@ const install = function(Vue) { if (install.installed) return; Vue.component(Sample.name, Sample); - }; // auto install diff --git a/src/style/empty.css b/src/style/empty.css deleted file mode 100644 index 8b1378917..000000000 --- a/src/style/empty.css +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/style/var.css b/src/style/var.css deleted file mode 100644 index bd285c933..000000000 --- a/src/style/var.css +++ /dev/null @@ -1,10 +0,0 @@ -/* UI标准色 */ -$o2-c-orange: #f60; -$o2-c-green: #06bf04; -$o2-c-red: #ed5050; -$o2-c-black: #333; -$o2-c-gray-darker: #666; -$o2-c-gray-dark: #999; -$o2-c-gray: #c9c9c9; -$o2-c-gray-light: #e5e5e5; -$o2-c-background: #f8f8f8;