Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchaofan committed Apr 17, 2017
2 parents 85919d9 + 8e572e5 commit fbe1795
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 173 deletions.
20 changes: 11 additions & 9 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"presets": ["es2015", "stage-1"],
"plugins": [
["transform-replace-object-assign", "simple-assign"],
"add-module-exports",
"transform-runtime",
"transform-export-extensions"
],
"env": {
"dev": {
"presets": ["es2015", "stage-1"]
},
"test": {
"presets": ["es2015", "stage-1"],
"plugins": [
["istanbul", {
"exclude": [
Expand All @@ -16,9 +13,14 @@
}]
]
},
"release": {
"production": {
"presets": [
["es2015", {"modules": "umd"}],
"stage-1"
],
"plugins": [
"transform-runtime"
"external-helpers",
"external-helpers-insert-require"
]
}
},
Expand Down
22 changes: 16 additions & 6 deletions example/App.san
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@
<san-icon-button
on-click="toggleMenu($event)"
variants="info raised"
slot="appbarleft">
slot="left">
menu
</san-icon-button>

<san-icon-button
slot="right"
href="https://github.com/ecomfe/san-mui">
<svg style="fill: #fff;" width="24" height="24" version="1.1" viewBox="0 0 16 16" >
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
</svg>
</san-icon-button>

</san-appbar>

<div class="example-content {{openMenu ? '': 'hide-menu'}}">
Expand Down Expand Up @@ -162,18 +170,20 @@ export default {
color: #fff

.example-drawer-content
flex: 1
overflow: auto
-webkit-overflow-scrolling: touch

position: absolute
top: 64px
right: 0
bottom: 0
left: 0

.example-appbar
position: fixed
left: 300px
right: 0
top: 0
width: auto
transition: all .3s cubic-bezier(.23,1,.32,1)
transition: all .3s cubic-bezier(.4, 0, .2, 1)
background: $md-colors.blue500
color: #fff
z-index: 10
Expand All @@ -184,7 +194,7 @@ export default {
.example-content
padding-top: 64px
padding-left: 300px
transition: all .3s cubic-bezier(.23,1,.32,1)
transition: all .3s cubic-bezier(.4, 0, .2, 1)

&.hide-menu
padding-left: 0
Expand Down
47 changes: 41 additions & 6 deletions example/Table.san
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<div>
<h3>Table</h3>

<h3>Normal Table</h3>
<section class="demo-buttion-row">
<ui-table>
<ui-thead slot="header">
Expand All @@ -21,6 +20,27 @@
</ui-table>
</section>

<h3>Hoverable Table</h3>
<section class="demo-buttion-row">
<ui-table class="sm-table-hoverable">
<ui-thead slot="header">
<ui-tr>
<ui-th tooltip="名称">Name</ui-th>
<ui-th tooltip="城市">City</ui-th>
<ui-th tooltip="生日">Birthday</ui-th>
</ui-tr>
</ui-thead>
<ui-tbody>
<ui-tr san-for="item in persons">
<ui-td>{{item.name}}</ui-td>
<ui-td>{{item.city}}</ui-td>
<ui-td>{{item.birthday}}</ui-td>
</ui-tr>
</ui-tbody>
</ui-table>
</section>

<h3>Selectable Table - multi</h3>
<section class="demo-buttion-row">
<ui-table selectable="multi" on-select="multiTableSelect($event)">
<ui-thead slot="header">
Expand All @@ -43,6 +63,7 @@
<section class="demo-buttion-row">selected: {{multiTableSelected}}
</section>

<h3>Selectable Table - single</h3>
<section class="demo-buttion-row">
<ui-table selectable="single" on-select="singleTableSelect($event)">
<ui-thead slot="header">
Expand All @@ -65,10 +86,19 @@
<section class="demo-buttion-row">selected: {{singleTableSelected}}
</section>


<h3>Configurable Table</h3>
<section class="demo-buttion-row">
<ui-configurable-table data="{{persons}}" fields="{{fields}}" selectable="multi">
<ui-configurable-table
data="{{persons}}"
fields="{{fields}}"
selectable="multi"
on-select="multiCTableSelect($event)">
</ui-configurable-table>
</section>

<section class="demo-buttion-row">selected: {{multiCTableSelected}}
</section>
</div>
</template>

Expand Down Expand Up @@ -127,16 +157,17 @@ export default {
fields: [
{
title: '名字',
content: 'name'
prop: 'name'
},
{
title: '城市',
content: 'city'
prop: 'city'
},
{
title: '生日',
prop: 'birthday',
content: function (item) {
return item.birthday
return item.birthday.replace(/-/g, '/');
}
}
]
Expand All @@ -147,6 +178,10 @@ export default {
this.data.set('multiTableSelected', selected.join(', '));
},

multiCTableSelect(selected) {
this.data.set('multiCTableSelected', selected.join(', '));
},

singleTableSelect(selected) {
this.data.set('singleTableSelected', selected);
}
Expand Down
24 changes: 7 additions & 17 deletions gulpfile.babel.js → gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,17 @@
* @author ielgnaw(wuji0223@gmail.com)
*/

import path from 'path';
import webpack from 'webpack';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import gulp from 'gulp';
import clean from 'gulp-clean';
import sourcemaps from 'gulp-sourcemaps';
import gulpWebpack from 'gulp-webpack';
import merge from 'webpack-merge';
import config from './tool/config';
import {assetsPath, styleLoaders} from './tool/util';
import buildWebpackConfig from './tool/webpack.build.conf';

const env = config.build.env;

const EXAMPLE_ROOT = path.resolve(__dirname, './example');
const SRC_ROOT = path.resolve(__dirname, './src');
const gulp = require('gulp');
const babel = require('gulp-babel');
const clean = require('gulp-clean');
const babelHelpers = require('gulp-babel-external-helpers');
const sourcemaps = require('gulp-sourcemaps');

gulp.task('babel', () => {
return gulp.src('src/**/*.js')
.pipe(gulpWebpack(buildWebpackConfig))
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(babelHelpers('babelHelpers.js', 'umd'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('lib'));
});
Expand Down
Loading

0 comments on commit fbe1795

Please sign in to comment.