Skip to content

Commit

Permalink
feat:发布0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
7insummer committed Aug 28, 2019
2 parents 55c90f0 + 51f0834 commit 9495749
Show file tree
Hide file tree
Showing 181 changed files with 2,450 additions and 5,548 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/behaviors/*.js
7 changes: 4 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ module.exports = {
1,
2
],
"linebreak-style": [ // 强制执行一致的换行样式('unix')
1,
"unix"
"linebreak-style": [
0,
"error",
"windows"
],
"quotes": [ // 强制一致使用反引号,双引号或单引号(反引号或单引号)
1,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div align="center">

![](https://img.shields.io/badge/build-passing-00d508.svg)
![](https://img.shields.io/badge/version-0.5.15-3963bc.svg)
![](https://img.shields.io/badge/version-0.6.0-3963bc.svg)
![](https://img.shields.io/badge/license-MIT-3963bc.svg)

</div>
Expand All @@ -39,7 +39,7 @@ Lin UI 是基于 **微信小程序原生语法** 实现的组件库。遵循简

## 最新版本

核心库:0.5.15
核心库:0.6.0

示例工程:0.0.1-alpha.2

Expand Down
51 changes: 0 additions & 51 deletions build/build-dev.js

This file was deleted.

63 changes: 0 additions & 63 deletions build/build-prod.js

This file was deleted.

43 changes: 43 additions & 0 deletions build/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const {
src,
dest,
parallel
} = require('gulp');
const less = require('gulp-less');
const cssmin = require('gulp-clean-css');
const rename = require('gulp-rename');
const del = require('del');

const buildWxss = (srcPath, remainPath, distPath) => () =>
src([srcPath, remainPath])
.pipe(less())
.pipe(cssmin())
.pipe(rename(srcPath => {
srcPath.extname = '.wxss';
}))
.pipe(dest(distPath));

const copy = (srcPath, distPath, ext) => () =>
src(`${srcPath}/*.${ext}`)
.pipe(dest(distPath));

const copyStatic = (srcPath, distPath) =>
parallel(
copy(srcPath, distPath, 'wxml'),
copy(srcPath, distPath, 'wxs'),
copy(srcPath, distPath, 'json'),
copy(srcPath, distPath, 'js'),
copy(srcPath, distPath, 'png')
);

const clean = (cleanPath) => () =>
del([cleanPath], {
force: true
});

module.exports = {
buildWxss,
copyStatic,
clean,
copy
};
62 changes: 62 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const {
buildWxss,
copyStatic,
clean,
copy
} = require('./build');
const {
series,
parallel,
watch
} = require('gulp');
const path = require('path');

const componentData = require('./until');
const result = `{common,behaviors,untils,${componentData()}}`;
const isCustom = (result !== `{common,behaviors,untils,}`);

const distPath = path.resolve(__dirname, '../dist');
const examplePath = path.resolve(__dirname, '../examples/dist');
const srcPrefix = path.resolve(__dirname, '../src');
const srcDevPath = `${srcPrefix}/**`;
const srcProPath = isCustom ? `${srcPrefix}/${result}` : srcDevPath;

module.exports = {
build: series(
clean(`${distPath}/**/*`),
parallel(
buildWxss(
`${srcProPath}/*.less`,
`!${srcProPath}/_*.less`,
distPath
),
copyStatic(
srcProPath,
distPath
)
)
),
dev: series(
clean(`${examplePath}/**/*`),
parallel(
buildWxss(
`${srcDevPath}/*.less`,
`!${srcDevPath}/_*.less`,
examplePath
),
copyStatic(
srcDevPath,
examplePath
)
)
),
watch: parallel(
() => {
watch(`${srcDevPath}/*.less`, buildWxss(`${srcDevPath}/*.less`, `!${srcDevPath}/_*.less`, examplePath));
watch(`${srcDevPath}/*.wxml`, copy(srcDevPath, examplePath, 'wxml'));
watch(`${srcDevPath}/*.wxs`, copy(srcDevPath, examplePath, 'wxs'));
watch(`${srcDevPath}/*.json`, copy(srcDevPath, examplePath, 'json'));
watch(`${srcDevPath}/*.js`, copy(srcDevPath, examplePath, 'js'));
}
)
};
File renamed without changes.
30 changes: 14 additions & 16 deletions dist/action-sheet/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import zIndex from '../behaviors/zIndex';

Component({
behaviors: [zIndex],
externalClasses: ['l-class-title', 'l-class-item', 'l-class-cancel'],
properties: {
locked: Boolean,
Expand All @@ -10,6 +13,10 @@ Component({
value: '取消'
},
title: String,
zIndex:{
type:Number,
value: 777
},
openApi: {
type: Boolean,
value: true,
Expand Down Expand Up @@ -49,25 +56,16 @@ Component({
});
},
initActionSheet() {
const config = {
itemList: [],
success: null,
fail: null,
title: '',
locked: false,
cancelText: '取消',
showCancel: false
};
wx.lin = wx.lin || {};
wx.lin.showActionSheet = (options={}) => {
const {
itemList = config.itemList,
success = config.success,
fail = config.fail,
title = config.title,
locked = config.locked,
cancelText = config.cancelText,
showCancel = config.showCancel,
itemList = [],
success = null,
fail = null,
title = '',
locked = false,
cancelText = '取消',
showCancel = false,
} = options;
this.setData({
itemList: itemList.slice(0, 10),
Expand Down
2 changes: 1 addition & 1 deletion dist/action-sheet/index.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<l-popup show="{{show}}" showMask="{{true}}" contentAlign="bottom" locked="{{locked}}" bind:lintap="handleClickPopUp">
<l-popup show="{{show}}" showMask="{{true}}" contentAlign="bottom" locked="{{locked}}" bind:lintap="handleClickPopUp" z-index="{{zIndex}}">
<view class='l-action-sheet'>
<view class="l-item-button l-class-title" wx:if="{{title}}">
{{ title }}
Expand Down
18 changes: 18 additions & 0 deletions dist/behaviors/computeOffset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = Behavior({
behaviors: [],
properties: {},
data: {
distance: 0
},
attached(){
this.offsetMargin();
},
methods: {
offsetMargin() {
const { windowHeight, screenHeight } = wx.getSystemInfoSync();
this.setData({
distance: (screenHeight-windowHeight )
});
}
}
});
Loading

0 comments on commit 9495749

Please sign in to comment.