Merge branch 'master' of gitlab.qima-inc.com:fe/oxygen

This commit is contained in:
niunai 2017-02-24 18:08:17 +08:00
commit bdf8db4212
37 changed files with 179 additions and 40 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ lib/*
!lib/style.css
node_modules
example/dist
dist

View File

@ -8,8 +8,6 @@ var OUTPUT_PATH = path.join(__dirname, '../../src/index.js');
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
var ISNTALL_COMPONENT_TEMPLATE = ' Vue.component({{name}}.name, {{name}});';
var MAIN_TEMPLATE = `{{include}}
// zanui
import '../packages/zanui-css/src/index.pcss';
const install = function(Vue) {
if (install.installed) return;

View File

@ -6,7 +6,7 @@ config.entry = {
config.output = {
filename: './dist/[name].js',
library: 'Oxygen',
library: 'zanui',
libraryTarget: 'umd'
}

View File

@ -57,10 +57,6 @@ module.exports = {
},
{
test: /\.css$/,
loader: 'style-loader!css-loader?root=./docs/'
},
{
test: /\.pcss$/,
loader: 'style-loader!css-loader!postcss-loader'
},
{

View File

@ -9,5 +9,6 @@
"popup": "./packages/popup/index.js",
"dialog": "./packages/dialog/index.js",
"picker": "./packages/picker/index.js",
"radio-group": "./packages/radio-group/index.js"
"radio-group": "./packages/radio-group/index.js",
"loading": "./packages/loading/index.js"
}

View File

@ -21,6 +21,8 @@ export default {
</script>
<style lang="css">
@import './assets/docs.css';
.page-container {
width: 1140px;
padding: 0 30px;

View File

@ -1,4 +1,3 @@
import './assets/docs.css';
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
@ -7,6 +6,8 @@ import demoBlock from './components/demo-block';
import SideNav from './components/side-nav';
import Oxygen from '../src/index';
import 'packages/zanui-css/src/index.css';
Vue.use(Oxygen);
Vue.use(VueRouter);
Vue.component('demo-block', demoBlock);

View File

@ -25,6 +25,10 @@
{
"path": "/card",
"title": "Card"
},
{
"path": "/loading",
"title": "Loading"
}
]
},

View File

@ -11,9 +11,10 @@
],
"scripts": {
"bootstrap": "npm i --registry=http://registry.npm.qima-inc.com",
"build:file": "node build/bin/build-entry.js",
"build": "npm run clean && npm run lint && npm run build:file && npm run concat:dev && npm run concat:prod",
"dev": "npm run bootstrap && npm run build:file",
"build:file": "node build/bin/build-entry.js",
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js",
"build": "npm run clean && npm run lint && npm run build:file && webpack --progress --hide-modules --config build/webpack.build.min.js && webpack --progress --hide-modules --config build/webpack.build.js",
"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",

View File

@ -5,8 +5,8 @@
<i v-if="icon" class="zui-icon" :class="'zui-icon-' + icon"></i>
</slot>
<slot name="title">
<span class="z-cell-text" v-text="title"></span>
<span class="z-cell__abel" v-if="label" v-text="label"></span>
<span class="z-cell__text" v-text="title"></span>
<span class="z-cell__label" v-if="label" v-text="label"></span>
</slot>
</div>
<div class="z-cell__value" :class="{ 'is-link' : isLink }">

View File

@ -18,7 +18,7 @@
</template>
<script>
import Popup from 'packages/popup';
import Popup from 'src/mixins/popup';
const CANCEL_TEXT = '取消';
const CONFIRM_TEXT = '确认';

View File

@ -0,0 +1,8 @@
## 0.0.2 (2017-01-20)
* 改了bug A
* 加了功能B
## 0.0.1 (2017-01-10)
* 第一版

View File

@ -0,0 +1,26 @@
# @youzan/<%= name %>
!!! 请在此处填写你的文档最简单描述 !!!
[![version][version-image]][download-url]
[![download][download-image]][download-url]
[version-image]: http://npm.qima-inc.com/badge/v/@youzan/<%= name %>.svg?style=flat-square
[download-image]: http://npm.qima-inc.com/badge/d/@youzan/<%= name %>.svg?style=flat-square
[download-url]: http://npm.qima-inc.com/package/@youzan/<%= name %>
## Demo
## Usage
## API
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
| className | 自定义额外类名 | string | '' | '' |
## License
[MIT](https://opensource.org/licenses/MIT)

View File

@ -0,0 +1,3 @@
import Loading from './src/loading';
export default Loading;

View File

@ -0,0 +1,10 @@
{
"name": "@youzan/z-loading",
"version": "0.0.1",
"description": "loading component",
"main": "./lib/index.js",
"author": "jiangruowei",
"license": "MIT",
"devDependencies": {},
"dependencies": {}
}

View File

@ -0,0 +1,9 @@
<template>
<div class="z-loading"></div>
</template>
<script>
export default {
name: 'z-loading'
};
</script>

View File

@ -154,7 +154,9 @@ export default {
var el = this.$refs.wrapper;
var dragState = {};
var velocityTranslate, prevTranslate, pickerItems;
var velocityTranslate;
var prevTranslate;
var pickerItems; // eslint-disable-line
draggable(el, {
start: (event) => {
@ -166,7 +168,7 @@ export default {
startTop: event.pageY,
startTranslateTop: translateUtil.getElementTranslate(el).top
};
pickerItems = el.querySelectorAll('.z-picker-item');
pickerItems = el.querySelectorAll('.z-picker-item'); // eslint-disable-line
},
drag: (event) => {

View File

@ -98,7 +98,6 @@ export default {
*/
getColumnValue(index) {
let column = this.getColumn(index);
console.log(column)
return column && column.values[column.valueIndex];
},

View File

@ -0,0 +1 @@
# zanui-css

View File

@ -0,0 +1,13 @@
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var cssmin = require('gulp-cssmin');
var salad = require('postcss-salad')(require('./salad.config.json'));
gulp.task('compile', function() {
return gulp.src('./src/*.css')
.pipe(postcss([salad]))
.pipe(cssmin())
.pipe(gulp.dest('./lib'));
});
gulp.task('build', ['compile']);

View File

@ -1,10 +1,22 @@
{
"name": "@youzan/zenui",
"name": "@youzan/zanui-css",
"version": "0.0.1",
"description": "wap component style",
"main": "./lib/index.js",
"author": "niunai",
"description": "zanui css.",
"main": "lib/index.css",
"style": "lib/index.css",
"files": [
"lib",
"src"
],
"scripts": {
"build": "gulp build"
},
"license": "MIT",
"devDependencies": {},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-cssmin": "^0.1.7",
"gulp-postcss": "^6.1.1",
"postcss-salad": "^1.0.5"
},
"dependencies": {}
}

View File

@ -0,0 +1,16 @@
{
"browsers": ["ie > 8", "last 2 versions"],
"features": {
"bem": {
"shortcuts": {
"component": "b",
"modifier": "m",
"descendent": "e"
},
"separators": {
"descendent": "__",
"modifier": "--"
}
}
}
}

View File

@ -33,7 +33,7 @@
}
}
@empty-cells: show title {
@e title {
float: left;
overflow: hidden;
}

View File

@ -0,0 +1,14 @@
/**
css组件库入口组装成css组件库
*/
@import './button.css';
@import './button_group.css';
@import './cell.css';
@import './dialog.css';
@import './field.css';
@import './icon.css';
@import './loading.css';
@import './picker.css';
@import './popup.css';
@import './radio.css';
@import './switch.css';

View File

@ -1,12 +0,0 @@
/**
css组件库入口组装成css组件库
*/
@import './button.pcss';
@import './button_group.pcss';
@import './cell.pcss';
@import './dialog.pcss';
@import './field.pcss';
@import './icon.pcss';
@import './popup.pcss';
@import './picker.pcss';
@import './switch.pcss';

View File

@ -0,0 +1,33 @@
@-webkit-keyframes loading {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loading {
from {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@component-namespace z {
@b loading {
height: 30px;
width: 30px;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAADitJREFUaAXNmmuMVVcVx++9M8PMMAwMj5GCpJjGtKVIfQxIpcGGtwylwQ+iND4iJI1GTU2jjZqmYvzQVNLY1JiaftPU1mjSftBAeA4FQagQSCoYq0EUeU55zTCvO/fh77/uWZtzh7kzd17ATvZde6+99t7rv9baj3POTSbGKB08eLC2o6OjKZ/PfyyZTN7HNPdRboTWU6+DJnO5XGcqlbpBuZX8b/IpZN6bMGHCu4sWLeqiPuopOZoj7tq1ayrjPY7SK6GfIFcBCnzJhP3AoC0FUdLcSQDDyifjfHi9tB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J12CNZeAZQ7RpDVMBF1c7aNsAYSTu7duBTPOoNuBMjUzKNCLCPynXwAYDplelD6GreRnn3sIAbgMgovqZLAgasMBtgQAvzB6zdU9yPr/mcw6WjAtgnP3To0ER28yYUnkdIfhh+Up4WABlAgLWmVYdvgCibR70dw4mvW9Ul2s6xWf+vnL/2uw6D0VEFHJ9M/6bnce0jeGcmik8lN9A+HsCaU99yBUzrtpOQ74CvnfY6ZXmzFW/GLyfxoUdU/j+IDynLAWtddgAAAABJRU5ErkJggg==') no-repeat center;
background-size: contain;
-webkit-animation: loading 0.8s linear;
-webkit-animation-iteration-count: infinite;
animation: loading 0.8s linear;
animation-iteration-count: infinite;
}
}

View File

@ -9,8 +9,7 @@ import Popup from '../packages/popup/index.js';
import Dialog from '../packages/dialog/index.js';
import Picker from '../packages/picker/index.js';
import RadioGroup from '../packages/radio-group/index.js';
// zanui
import '../packages/zanui-css/src/index.pcss';
import Loading from '../packages/loading/index.js';
const install = function(Vue) {
if (install.installed) return;
@ -25,6 +24,7 @@ const install = function(Vue) {
Vue.component(Popup.name, Popup);
Vue.component(Picker.name, Picker);
Vue.component(RadioGroup.name, RadioGroup);
Vue.component(Loading.name, Loading);
};
// auto install
@ -45,5 +45,6 @@ module.exports = {
Popup,
Dialog,
Picker,
RadioGroup
RadioGroup,
Loading
};

View File

@ -7,7 +7,7 @@ if (!Vue.prototype.$isServer) {
var engine;
var translate3d = false;
if (window.opera && Object.prototype.toString.call(opera) === '[object Opera]') {
if (window.opera && Object.prototype.toString.call(window.opera) === '[object Opera]') {
engine = 'presto';
} else if ('MozAppearance' in docStyle) {
engine = 'gecko';
@ -77,7 +77,7 @@ if (!Vue.prototype.$isServer) {
if (element === null || element.style === null) return;
var transformValue = element.style[transformProperty];
if (transformValue) {
transformValue = transformValue.replace(/translate\(\s*(-?\d+(\.?\d+?)?)px,\s*(-?\d+(\.\d+)?)px\)\s*translateZ\(0px\)/g, '');
element.style[transformProperty] = transformValue;