Skip to content

Commit

Permalink
feat(src): 发布0.7.5版本
Browse files Browse the repository at this point in the history
-  修复gulp watch无法监听文件改变的问题 (#714)
- 修改rules组件不能正确校验的bug(#716)
-  修复segment组件滚动时获取属性报错问题 (#719)
  • Loading branch information
二一 authored Mar 23, 2020
2 parents c8711d4 + 3d78757 commit f4e058e
Show file tree
Hide file tree
Showing 22 changed files with 69 additions and 47 deletions.
10 changes: 5 additions & 5 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ module.exports = {
),
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'));
watch("../src/**/*.less", buildWxss(`${srcDevPath}/*.less`, `!${srcDevPath}/_*.less`, examplePath));
watch("../src/**/*.wxml", copy(srcDevPath, examplePath, 'wxml'));
watch("../src/**/*.wxs", copy(srcDevPath, examplePath, 'wxs'));
watch("../src/**/*.json", copy(srcDevPath, examplePath, 'json'));
watch("../src/**/*.js", copy(srcDevPath, examplePath, 'js'));
}
)
};
2 changes: 1 addition & 1 deletion dist/behaviors/scrollCenter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/checkbox-group/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/input/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/radio-group/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions dist/sticky-item/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"component": true,
"usingComponents": {}
}
{"component":true,"usingComponents":{}}
2 changes: 1 addition & 1 deletion dist/sticky-item/index.wxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<view class="l-sticky-item l-class">

<view class="l-sticky-item-header-wrapper l-header-wrapper-class" style="height:{{isFixedTop&&stickyItemWrapperHeight?stickyItemWrapperHeight+'px':'auto'}}"></view>
<view style="{{mode==='js'?(isFixedTop?'position:fixed;':''):''}} top:{{top}}rpx" class="l-sticky-item-header l-sticky-item-header{{mode==='js'?(isFixedTop?'-fixed l-header-sticky-class':''):(mode==='css'?'-sticky l-header-sticky-class':'')}} l-header-class">
<slot name="header"></slot>
Expand Down
5 changes: 1 addition & 4 deletions dist/sticky/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"component": true,
"usingComponents": {}
}
{"component":true,"usingComponents":{}}
2 changes: 1 addition & 1 deletion dist/textarea/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions examples/dist/behaviors/scrollCenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ export default Behavior({
});
},
queryScrollNode(res, currentIndex, type = 'width') {
if(currentIndex<0) return;
const currentRect = res[currentIndex];

this.getRect('.l-tabsscroll').then(_ => {
if(!_) return console.error('找不到元素');
const scrollWidth = _[type];

let transformDistance = res
.slice(0, currentIndex)
.reduce((prev, curr) => prev + curr[type], 0);

transformDistance += (currentRect[type] - scrollWidth) / 2;

if (type === 'width') {
Expand Down
8 changes: 7 additions & 1 deletion examples/dist/checkbox-group/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import eventBus from '../utils/eventBus';
import rules from '../behaviors/rules';


Component({
behaviors: ['wx://form-field'],
behaviors: ['wx://form-field',rules],
externalClasses: ['l-class', 'l-error-text', 'l-error-text-class'],
relations: {
'../checkbox/index': {
Expand Down Expand Up @@ -78,6 +80,10 @@ Component({
onEmitEventHandle(currentItem) {
currentItem.checked ? this.addSelect (currentItem):this.removeSelect(currentItem.key);

this.validatorData({
[this.data.name]: Object.values(this._selected)
});

this.triggerEvent('linchange', currentItem, {
bubbles: true,
composed: true
Expand Down
9 changes: 5 additions & 4 deletions examples/dist/input/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// input/input.js
import eventBus from '../utils/eventBus.js';
import validator from '../behaviors/validator';
import rules from '../behaviors/rules';
Component({
/**
* 组件的属性列表
*/
options: {
multipleSlots: true,
},
behaviors: ['wx://form-field', validator],
behaviors: ['wx://form-field', validator, rules],
externalClasses: ['l-class', 'l-label-class', 'l-error-text', 'l-error-text-class'],
properties: {
// 表单标题(label)的文本
Expand Down Expand Up @@ -101,9 +102,9 @@ Component({
},

handleInputBlur(event) {
// this.validatorData({
// value: event.detail.value
// });
this.validatorData({
[this.data.name]: event.detail.value
});
eventBus.emit(`lin-form-blur-${this.id}`, this.id);
this.triggerEvent('linblur', event.detail);
},
Expand Down
7 changes: 6 additions & 1 deletion examples/dist/radio-group/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import eventBus from '../utils/eventBus';
import rules from '../behaviors/rules';


Component({
externalClasses: ['l-class', 'l-error-text', 'l-error-text-class'],
behaviors: ['wx://form-field'],
behaviors: ['wx://form-field',rules],
relations: {
'../radio/index': {
type: 'child',
Expand Down Expand Up @@ -89,6 +91,9 @@ Component({
Object.assign(currentItem, {
currentKey: this.properties.current
});
this.validatorData({
[this.data.name]: this.data.current
});
this.triggerEvent('linchange', currentItem, {
bubbles: true,
composed: true
Expand Down
6 changes: 3 additions & 3 deletions examples/dist/textarea/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ Component({
},

handleInputBlur(event) {
// this.validatorData({
// value: event.detail.value
// });
this.validatorData({
[this.data.name]: event.detail.value
});
eventBus.emit(`lin-form-blur-${this.id}`,this.id);
this.triggerEvent('linblur', event.detail);
},
Expand Down
8 changes: 7 additions & 1 deletion examples/pages/components/form/pages/rules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ Component({
required: true
},
sexRules: {
type: 'string',
required: true,
message: '请选择性别'
},
habbitRules: {
type: 'array',
required: true
required: true,
message: '至少选择一个兴趣爱好'
},
phoneRules: [{
type: "string",
Expand Down
4 changes: 2 additions & 2 deletions examples/pages/components/form/pages/rules/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<l-input label="邮箱" placeholder="请输入邮箱" label-width="170" name="email" rules="{{emailRules}}" tipType="message" bind:linvalidate="linvalidate"/>
<l-input label="用户名" placeholder="长度需要在12个字以内" label-width="170" name="user" rules="{{userRules}}" tipType="text" clear="{{true}}" l-error-text="error-text"/>
<l-input label="密码" label-width="170" placeholder="请输入密码" name="password" rules="{{passwordRules}}" tipType="toast"/>
<l-input label="手机号" label-width="170" placeholder="请输入密码" name="phone" rules="{{phoneRules}}" tipType="toast"/>
<l-input label="手机号" label-width="170" placeholder="请输入手机号" name="phone" rules="{{phoneRules}}" tipType="toast"/>
<view class="group-label">
<text>爱好</text>
<l-checkbox-group l-class="l-radio-group" rules="{{sexRules}}" name="habbit" tipType="text" bind:linchange="changeCheckbox">
<l-checkbox-group l-class="l-radio-group" rules="{{habbitRules}}" name="habbit" tipType="text" bind:linchange="changeCheckbox">
<l-checkbox l-class="l-radio" l-title-class="l-title-class" placement="left" key="读书" checked="{{util.isChecked('读书',likes)}}">读书</l-checkbox>
<l-checkbox l-class="l-radio" l-title-class="l-title-class" placement="left" key="写字" checked="{{util.isChecked('写字',likes)}}">写字</l-checkbox>
<l-checkbox l-class="l-radio" l-title-class="l-title-class" placement="left" key="摄影" checked="{{util.isChecked('摄影',likes)}}">摄影</l-checkbox>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lin-ui",
"version": "0.7.4",
"version": "0.7.5",
"description": "A high quality UI components library with MiniProgram",
"main": "app.js",
"directories": {
Expand Down
Loading

0 comments on commit f4e058e

Please sign in to comment.