Skip to content

Commit

Permalink
feat:v0.5.12=>v0.5.13 (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
7insummer authored Aug 4, 2019
2 parents 6463b49 + c0845c3 commit a6ffb9e
Show file tree
Hide file tree
Showing 99 changed files with 1,425 additions and 1,138 deletions.
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.12-3963bc.svg)
![](https://img.shields.io/badge/version-0.5.13-3963bc.svg)
![](https://img.shields.io/badge/license-MIT-3963bc.svg)

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

## 最新版本

核心库:0.5.12
核心库:0.5.13

示例工程:0.0.1-alpha.2

Expand Down
1 change: 0 additions & 1 deletion build/build-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ gulp.task('dispose-js', () => {
.pipe(gulp.dest('../dist/'));
});


gulp.task('dispose-wxss', () => {
const path = isCustom ? `../src/${result}/*.less` : '../src/**/*.less',
remainPath = isCustom ? `!../src/${result}/_*.less` : '!../src/**/_*.less';
Expand Down
4 changes: 1 addition & 3 deletions config/component.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"components": [

]
"components": []
}
4 changes: 2 additions & 2 deletions dist/action-sheet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Component({
success
} = this.data;
success && success({ ...e.currentTarget.dataset });
this.triggerEvent('linitemtap', { ...e.currentTarget.dataset });
this.triggerEvent('linitemtap', { ...e.currentTarget.dataset },{ bubbles: true, composed: true });
this._hideActionSheet();
},

Expand All @@ -112,7 +112,7 @@ Component({
});
this.triggerEvent('lincancel', {
errMsg: 'showactionsheet:fail cancel'
});
},{ bubbles: true, composed: true });
this._hideActionSheet();
},

Expand Down
48 changes: 25 additions & 23 deletions dist/badge/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Component({
externalClasses: ['l-class','l-class-self'],
externalClasses: ['l-class', 'l-class-self'],
properties: {
// 红点模式
dot: {
Expand Down Expand Up @@ -32,32 +32,34 @@ Component({
// 最终数字
finalCount() {
switch (this.data.countType) {
case 'overflow':
this.setData({
finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
});
break;
case 'ellipsis':
this.setData({
finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
});
break;
case 'limit':
this.setData({
finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
})
break;
default:
this.setData({
finalCount: parseInt(this.data.count)
})
break;
case 'overflow':
this.setData({
finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `${this.data.maxCount}+` : this.data.count
});
break;
case 'ellipsis':
this.setData({
finalCount: parseInt(this.data.count) >= parseInt(this.data.maxCount) ? `...` : this.data.count
});
break;
case 'limit':
this.setData({
finalCount: parseInt(this.data.count) >= 999 ? (parseInt(this.data.count) >= 9999 ? Math.floor(this.data.count / 10000 * 100) / 100 + `w` : Math.floor(this.data.count / 1000 * 100) / 100 + `k`) : this.data.count
});
break;
default:
this.setData({
finalCount: parseInt(this.data.count)
});
break;
}
},
// 点击事件
handleTap() {
this.triggerEvent('lintap');
this.triggerEvent('lintapcatch', {}, { bubbles: true });
this.triggerEvent('lintap', {}, {
bubbles: true,
composed: true
});
},
}
});
11 changes: 7 additions & 4 deletions dist/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ Component({
value: false,
},
// 微信原生接口
width:Number,
height:Number,
width: Number,
height: Number,
icon: String,
image: String,
bgColor: String,
iconStyle: {
type: String,
value: 'size:20;color:#3683D6'
Expand Down Expand Up @@ -68,8 +69,10 @@ Component({
// button点击事件
handleTap() {
if (this.data.disabled) return false;
this.triggerEvent('lintap');
this.triggerEvent('lintapcatch',{},{ bubbles: true });
this.triggerEvent('lintap', {}, {
bubbles: true,
composed: true
});
},
// 开放能力事件回调
openTypeEvent(data) {
Expand Down
2 changes: 1 addition & 1 deletion dist/button/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
hover-stop-propagation="{{hoverStopPropagation}}"
hover-start-time="{{hoverStartTime}}"
hover-stay-time="{{hoverStayTime}}"
style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0':''}}">
style="{{width?'min-width:'+width+'rpx;':''}} {{height?'height:'+height+'rpx;'+'line-height:'+height+'rpx;':''}} {{size=='long'?'border-radius:0;':''}} {{'background-color:'+bgColor}}">
<view wx:if="{{loading}}" class="l-btn-loading {{'margin-' + size}} {{ plain ?'l-btn-loading-' + type : '' }}"></view>
<l-icon class="{{'margin-' + size}}" wx:if="{{icon}}" name="{{icon}}" color="{{iconColor}}" size="{{iconSize}}" />
<slot/>
Expand Down
2 changes: 1 addition & 1 deletion dist/card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Component({
methods: {

}
})
});
53 changes: 31 additions & 22 deletions dist/count-selector/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Component({
externalClasses: [
'l-class',
'l-symbol-class',
'l-class',
'l-symbol-class',
'l-count-class',
'l-disabled-class'
],
Expand Down Expand Up @@ -41,67 +41,76 @@ Component({
onBlur(e) {
let {
value
} = e.detail
} = e.detail;
setTimeout(() => {
this.blurCount(value)
}, 50)
this.blurCount(value);
}, 50);
},

blurCount(value) {
if (value) {
if (value > this.properties.max) this.setData({
count: this.properties.max
})
});
else if (value < this.properties.min) this.setData({
count: this.properties.min
})
});
else this.setData({
count: value
})
});
} else {
this.setData({
count: this.properties.count
})
});
}
let detail = {
count: this.data.count,
type: 'blur'
}
this.triggerEvent('lintap', detail)
};
this.triggerEvent('lintap', detail, {
bubbles: true,
composed: true
});
},

reduceTap() {
let distance = this.data.count - this.properties.step
let distance = this.data.count - this.properties.step;
if (distance <= this.properties.min) {
this.data.count = this.properties.min
this.data.count = this.properties.min;
} else {
this.data.count -= this.properties.step
this.data.count -= this.properties.step;
}
this.setData({
count: this.data.count
})
});
let detail = {
count: this.data.count,
type: 'reduce'
}
this.triggerEvent('lintap', detail)
};
this.triggerEvent('lintap', detail, {
bubbles: true,
composed: true
});
},

addTap() {
let distance = this.data.count + this.properties.step;
if (distance >= this.properties.max) {
this.data.count = this.properties.max
this.data.count = this.properties.max;
} else {
this.data.count += this.properties.step;
}
this.setData({
count: this.data.count
})
});
let detail = {
count: this.data.count,
type: 'add'
}
this.triggerEvent('lintap', detail)
};
this.triggerEvent('lintap', detail, {
bubbles: true,
composed: true
});
},
}
})
});
2 changes: 1 addition & 1 deletion dist/custom-tab-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Component({
idx,
path:this.route
};
let option = {};
let option = { bubbles: true, composed: true };
this.triggerEvent('lintap', detail, option);
},
showRedDot(idx) {
Expand Down
4 changes: 2 additions & 2 deletions dist/dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Component({
onCancelTap(e) {

let detail = 'cancel';
let option = {};
let option = { bubbles: true, composed: true };

const {
success
Expand All @@ -175,7 +175,7 @@ Component({
// 背景点击事件
onDialogTap(e) {
let detail = true;
let option = {};
let option = { bubbles: true, composed: true };

if (this.data.locked !== true) {
this.setData({
Expand Down
4 changes: 1 addition & 3 deletions dist/grid-item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ Component({
tapGridItem(e) {
this.triggerEvent('lintap', {
...e
}, {
composed: true
})
}, { bubbles: true, composed: true })
},
}
});
2 changes: 1 addition & 1 deletion dist/grid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Component({
tapGrid(e) {
this.triggerEvent('lintap', {
index:this.data.currentIndex
})
},{ bubbles: true, composed: true })
}
}
});
2 changes: 1 addition & 1 deletion dist/list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Component({
}
this.triggerEvent('lintap', {
e
}, {})
}, { bubbles: true, composed: true })
}
}
});
34 changes: 32 additions & 2 deletions dist/loading/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Component({
externalClasses: ['l-container-class','l-class'],
externalClasses: ['l-container-class', 'l-class'],
properties: {
// 显示与隐藏
show: {
Expand Down Expand Up @@ -32,9 +32,39 @@ Component({
value: false,
}
},

attached() {
this._init();
},

methods: {
_init() {
wx.lin = wx.lin || {};
wx.lin.showLoading = (options) => {
const {
custom = false,
fullScreen = false,
color = '',
type = 'rotate',
size = 'default'
} = { ...options };
this.setData({
custom,
fullScreen,
color,
type,
size,
show: true
});
};
wx.lin.hideLoading = () => {
this.setData({
show: false
});
};
},
// 阻止滑动
doNothingMove(e) {
doNothingMove() {
// do nothing……
},
}
Expand Down
Loading

0 comments on commit a6ffb9e

Please sign in to comment.