Skip to content
Permalink
Browse files

feat:发布版本0.6.1

  • Loading branch information...
uniquenaer committed Sep 9, 2019
2 parents 9495749 + 23eb5b7 commit 81cae3ab9d2ccecee25fae44fdc532e465066035
Showing with 2,720 additions and 2,595 deletions.
  1. +0 −1 .eslintignore
  2. +3 −18 README.md
  3. +0 −14 config/styles/_base.less
  4. +1 −1 dist/action-sheet/index.js
  5. +5 −4 dist/action-sheet/index.wxml
  6. +13 −23 dist/avatar/index.js
  7. +2 −2 dist/avatar/index.wxml
  8. +1 −1 dist/badge/index.js
  9. +3 −3 dist/badge/index.wxml
  10. +2 −1 dist/behaviors/computeOffset.js
  11. +3 −2 dist/behaviors/countdown.js
  12. +5 −4 dist/behaviors/rules.js
  13. +54 −0 dist/behaviors/scrollCenter.js
  14. +26 −0 dist/behaviors/wacthShow.js
  15. +2 −1 dist/behaviors/zIndex.js
  16. +0 −4 dist/button/index.js
  17. +18 −18 dist/checkbox-group/index.js
  18. +1 −1 dist/checkbox-group/index.wxml
  19. +3 −3 dist/checkbox/index.js
  20. +6 −4 dist/combined-tabs/index.js
  21. +4 −4 dist/combined-tabs/index.wxml
  22. +12 −13 dist/common/async-validator/util.js
  23. +5 −1 dist/countdown/index.js
  24. +1 −1 dist/countdown/index.wxml
  25. +17 −17 dist/custom-tab-bar/index.js
  26. +1 −0 dist/dialog/index.js
  27. +1 −1 dist/dialog/index.wxml
  28. +12 −12 dist/error-tip/index.js
  29. +1 −1 dist/error-tip/index.wxml
  30. +26 −26 dist/grid-item/index.js
  31. +1 −1 dist/grid-item/index.wxml
  32. +71 −71 dist/grid/index.js
  33. +1 −1 dist/grid/index.wxml
  34. +1 −1 dist/icon/index.js
  35. +1 −1 dist/icon/index.wxml
  36. +26 −31 dist/image-picker/index.js
  37. +1 −1 dist/image-picker/index.wxml
  38. +3 −3 dist/input/index.js
  39. +1 −1 dist/input/index.wxml
  40. +96 −76 dist/list/index.js
  41. +6 −6 dist/list/index.wxml
  42. +17 −12 dist/loading/index.js
  43. +4 −2 dist/loading/index.wxml
  44. +1 −1 dist/loading/index.wxss
  45. +1 −1 dist/mask/index.js
  46. +2 −2 dist/mask/index.wxml
  47. +12 −18 dist/message/index.js
  48. +1 −1 dist/message/index.wxml
  49. +1 −3 dist/radio-group/index.js
  50. +1 −1 dist/radio-group/index.wxml
  51. +5 −1 dist/radio/index.js
  52. +1 −1 dist/radio/index.wxml
  53. +1 −1 dist/radio/index.wxss
  54. +1 −1 dist/rate/index.js
  55. +4 −4 dist/rate/index.wxml
  56. +11 −6 dist/search-bar/index.js
  57. +5 −4 dist/search-bar/index.wxml
  58. +1 −1 dist/search-bar/index.wxss
  59. +8 −4 dist/segment-item/index.js
  60. +126 −146 dist/segment/index.js
  61. +10 −10 dist/segment/index.wxml
  62. +1 −1 dist/segment/index.wxss
  63. +37 −37 dist/slide-view/index.js
  64. +63 −53 dist/status-show/index.js
  65. +13 −7 dist/status-show/index.wxml
  66. +1 −1 dist/status-show/index.wxss
  67. +12 −10 dist/tabpanel/index.js
  68. +31 −46 dist/tabs/index.js
  69. +9 −10 dist/tabs/index.wxml
  70. +1 −1 dist/tag/index.js
  71. +2 −2 dist/tag/index.wxml
  72. +1 −1 dist/tag/index.wxss
  73. +2 −5 dist/textarea/index.js
  74. +1 −1 dist/textarea/index.wxml
  75. +9 −39 dist/toast/index.js
  76. +3 −3 dist/toast/index.wxml
  77. +1 −1 dist/toast/index.wxss
  78. +1 −1 examples/app.js
  79. +1 −1 examples/dist/action-sheet/index.js
  80. +5 −4 examples/dist/action-sheet/index.wxml
  81. +13 −23 examples/dist/avatar/index.js
  82. +2 −2 examples/dist/avatar/index.wxml
  83. +1 −1 examples/dist/badge/index.js
  84. +3 −3 examples/dist/badge/index.wxml
  85. +2 −1 examples/dist/behaviors/computeOffset.js
  86. +3 −2 examples/dist/behaviors/countdown.js
  87. +5 −4 examples/dist/behaviors/rules.js
  88. +54 −0 examples/dist/behaviors/scrollCenter.js
  89. +26 −0 examples/dist/behaviors/wacthShow.js
  90. +2 −1 examples/dist/behaviors/zIndex.js
  91. +0 −4 examples/dist/button/index.js
  92. +18 −18 examples/dist/checkbox-group/index.js
  93. +1 −1 examples/dist/checkbox-group/index.wxml
  94. +3 −3 examples/dist/checkbox/index.js
  95. +6 −4 examples/dist/combined-tabs/index.js
  96. +4 −4 examples/dist/combined-tabs/index.wxml
  97. +12 −13 examples/dist/common/async-validator/util.js
  98. +5 −1 examples/dist/countdown/index.js
  99. +1 −1 examples/dist/countdown/index.wxml
  100. +17 −17 examples/dist/custom-tab-bar/index.js
  101. +1 −0 examples/dist/dialog/index.js
  102. +1 −1 examples/dist/dialog/index.wxml
  103. +12 −12 examples/dist/error-tip/index.js
  104. +1 −1 examples/dist/error-tip/index.wxml
  105. +26 −26 examples/dist/grid-item/index.js
  106. +1 −1 examples/dist/grid-item/index.wxml
  107. +71 −71 examples/dist/grid/index.js
  108. +1 −1 examples/dist/grid/index.wxml
  109. +1 −1 examples/dist/icon/index.js
  110. +1 −1 examples/dist/icon/index.wxml
  111. +26 −31 examples/dist/image-picker/index.js
  112. +1 −1 examples/dist/image-picker/index.wxml
  113. +3 −3 examples/dist/input/index.js
  114. +1 −1 examples/dist/input/index.wxml
  115. +96 −76 examples/dist/list/index.js
  116. +6 −6 examples/dist/list/index.wxml
  117. +17 −12 examples/dist/loading/index.js
  118. +4 −2 examples/dist/loading/index.wxml
  119. +1 −1 examples/dist/loading/index.wxss
  120. +1 −1 examples/dist/mask/index.js
  121. +2 −2 examples/dist/mask/index.wxml
  122. +12 −18 examples/dist/message/index.js
  123. +1 −1 examples/dist/message/index.wxml
  124. +1 −3 examples/dist/radio-group/index.js
  125. +1 −1 examples/dist/radio-group/index.wxml
  126. +5 −1 examples/dist/radio/index.js
  127. +1 −1 examples/dist/radio/index.wxml
  128. +1 −1 examples/dist/radio/index.wxss
  129. +1 −1 examples/dist/rate/index.js
  130. +4 −4 examples/dist/rate/index.wxml
  131. +11 −6 examples/dist/search-bar/index.js
  132. +5 −4 examples/dist/search-bar/index.wxml
  133. +1 −1 examples/dist/search-bar/index.wxss
  134. +8 −4 examples/dist/segment-item/index.js
  135. +126 −146 examples/dist/segment/index.js
  136. +10 −10 examples/dist/segment/index.wxml
  137. +1 −1 examples/dist/segment/index.wxss
  138. +37 −37 examples/dist/slide-view/index.js
  139. +15 −5 examples/dist/status-show/index.js
  140. +13 −7 examples/dist/status-show/index.wxml
  141. +1 −1 examples/dist/status-show/index.wxss
  142. +12 −10 examples/dist/tabpanel/index.js
  143. +31 −46 examples/dist/tabs/index.js
  144. +9 −10 examples/dist/tabs/index.wxml
  145. +1 −1 examples/dist/tag/index.js
  146. +2 −2 examples/dist/tag/index.wxml
  147. +1 −1 examples/dist/tag/index.wxss
  148. +2 −5 examples/dist/textarea/index.js
  149. +1 −1 examples/dist/textarea/index.wxml
  150. +9 −39 examples/dist/toast/index.js
  151. +3 −3 examples/dist/toast/index.wxml
  152. +1 −1 examples/dist/toast/index.wxss
  153. +4 −1 examples/pages/about/index.wxml
  154. +74 −58 examples/pages/about/index.wxss
  155. +44 −45 examples/pages/components/basic/pages/icon/icons.js
  156. +7 −18 examples/pages/components/nav/pages/segment/index.wxml
  157. +1 −3 examples/pages/components/nav/pages/segment/index.wxss
  158. +5 −5 examples/pages/components/nav/pages/tabs/index.wxml
  159. +0 −2 examples/pages/components/response/pages/dialog/index.wxml
  160. +0 −13 examples/pages/components/response/pages/message/index.js
  161. +0 −4 examples/pages/components/response/pages/message/message-nav.js
  162. +15 −24 examples/pages/components/shopping/pages/search-bar/index.wxml
  163. +8 −16 examples/pages/components/shopping/pages/search-bar/index.wxss
  164. +83 −83 examples/pages/components/view/pages/loading/loading-nav.js
  165. +2 −2 examples/pages/components/view/pages/tag/tag-nav.js
  166. +2 −2 package.json
  167. +1 −1 src/action-sheet/index.js
  168. +5 −4 src/action-sheet/index.wxml
  169. +13 −23 src/avatar/index.js
  170. +2 −2 src/avatar/index.wxml
  171. +1 −1 src/badge/index.js
  172. +3 −3 src/badge/index.wxml
  173. +2 −1 src/behaviors/computeOffset.js
  174. +3 −2 src/behaviors/countdown.js
  175. +5 −4 src/behaviors/rules.js
  176. +54 −0 src/behaviors/scrollCenter.js
  177. +26 −0 src/behaviors/wacthShow.js
  178. +2 −1 src/behaviors/zIndex.js
  179. +0 −4 src/button/index.js
  180. +18 −18 src/checkbox-group/index.js
  181. +1 −1 src/checkbox-group/index.wxml
  182. +3 −3 src/checkbox/index.js
  183. +6 −4 src/combined-tabs/index.js
  184. +4 −4 src/combined-tabs/index.wxml
  185. +12 −13 src/common/async-validator/util.js
  186. +5 −1 src/countdown/index.js
  187. +1 −1 src/countdown/index.wxml
  188. +17 −17 src/custom-tab-bar/index.js
  189. +1 −0 src/dialog/index.js
  190. +1 −1 src/dialog/index.wxml
  191. +12 −12 src/error-tip/index.js
  192. +1 −1 src/error-tip/index.wxml
  193. +26 −26 src/grid-item/index.js
  194. +1 −1 src/grid-item/index.wxml
  195. +71 −71 src/grid/index.js
  196. +1 −1 src/grid/index.wxml
  197. +1 −1 src/icon/index.js
  198. +1 −1 src/icon/index.wxml
  199. +26 −31 src/image-picker/index.js
  200. +1 −1 src/image-picker/index.wxml
  201. +3 −3 src/input/index.js
  202. +1 −1 src/input/index.wxml
  203. +96 −76 src/list/index.js
  204. +6 −6 src/list/index.wxml
  205. +17 −12 src/loading/index.js
  206. +6 −11 src/loading/index.less
  207. +4 −2 src/loading/index.wxml
  208. +1 −1 src/mask/index.js
  209. +2 −2 src/mask/index.wxml
  210. +12 −18 src/message/index.js
  211. +1 −1 src/message/index.wxml
  212. +1 −3 src/radio-group/index.js
  213. +1 −1 src/radio-group/index.wxml
  214. +5 −1 src/radio/index.js
  215. +1 −0 src/radio/index.less
  216. +1 −1 src/radio/index.wxml
  217. +1 −1 src/rate/index.js
  218. +4 −4 src/rate/index.wxml
  219. +11 −6 src/search-bar/index.js
  220. +11 −8 src/search-bar/index.less
  221. +5 −4 src/search-bar/index.wxml
  222. +8 −4 src/segment-item/index.js
  223. +126 −146 src/segment/index.js
  224. +2 −1 src/segment/index.less
  225. +10 −10 src/segment/index.wxml
  226. +37 −37 src/slide-view/index.js
  227. +15 −5 src/status-show/index.js
  228. +23 −12 src/status-show/index.less
  229. +13 −7 src/status-show/index.wxml
  230. +12 −10 src/tabpanel/index.js
  231. +31 −46 src/tabs/index.js
  232. +9 −10 src/tabs/index.wxml
  233. +1 −1 src/tag/index.js
  234. +32 −11 src/tag/index.less
  235. +2 −2 src/tag/index.wxml
  236. +2 −5 src/textarea/index.js
  237. +1 −1 src/textarea/index.wxml
  238. +9 −39 src/toast/index.js
  239. +0 −8 src/toast/index.less
  240. +3 −3 src/toast/index.wxml

This file was deleted.

@@ -17,37 +17,22 @@
<div align="center">

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

</div>

<div align="center">

![](https://img.shields.io/badge/less-^2.7.3-00d508.svg)
![](https://img.shields.io/badge/eslint-^5.0.1-00d508.svg)
![](https://img.shields.io/badge/cli-0.0.1.alpha.1-3963bc.svg)
![](https://img.shields.io/badge/npm-v3.0.0+-00d508.svg)
![](https://img.shields.io/badge/gulp-v3.9.1-00d508.svg)
![](https://img.shields.io/badge/node-v8.11.0+-00d508.svg)
⚡️ 文档网站: http://doc.mini.7yue.pro/

</div>

# 简介

Lin UI 是基于 **微信小程序原生语法** 实现的组件库。遵循简洁,易用的设计规范。

## 最新版本

核心库:0.6.0

示例工程:0.0.1-alpha.2


## 文档地址

http://doc.mini.7yue.pro/

## 讨论交流
QQ群号:699501172 <br/>

@@ -89,17 +89,3 @@
@transition-time : .2s;
@ease-in-out : ease-in-out;

// Z-index
@zindex-spin : 8;
@zindex-affix : 10;
@zindex-back-top : 10;
@zindex-select : 900;
@zindex-modal : 1000;
@zindex-message : 1010;
@zindex-notification : 1010;
@zindex-tooltip : 1060;
@zindex-transfer : 1060;
@zindex-loading-bar : 2000;
@zindex-spin-fullscreen : 2010;


@@ -2,7 +2,7 @@ import zIndex from '../behaviors/zIndex';

Component({
behaviors: [zIndex],
externalClasses: ['l-class-title', 'l-class-item', 'l-class-cancel'],
externalClasses: ['l-class-title', 'l-class-item', 'l-class-cancel','l-title-class','l-item-class','l-cancel-class'],
properties: {
locked: Boolean,
showCancel: Boolean,
@@ -1,22 +1,23 @@
<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}}">
<view class="l-item-button l-class-title l-title-class" wx:if="{{title}}">
{{ title }}
</view>
<view class="" wx:for="{{ itemList }}" wx:key="{{ item.name }}">
<l-button bind:lintap="handleClickItem" data-index="{{ index }}" data-item="{{ item }}" open-type="{{ item.openType }}" icon="{{ item.icon }}" type="ghost" size="large" special="{{true}}" long>
<view style="{{ item.color ? 'color: ' + item.color : '' }}" class="l-item-button l-class-item {{item.image || item.icon ? 'l-image-button':''}}">
<view style="{{ item.color ? 'color: ' + item.color : '' }}" class="l-item-button l-class-item l-item-class {{item.image || item.icon ? 'l-image-button':''}}">
<image wx:if="{{item.image}}" class="l-button-image" src="{{item.image}}" style="{{item.imageStyle}}"/>
<l-icon
wx:elif="{{ item.icon }}"
name="{{ item.icon }}"
l-class="l-item-button"
color="{{item.color}}"></l-icon>
size="{{ item.iconSize }}"
color="{{item.iconColor?item.iconColor:item.color}}"></l-icon>
<text class="l-button-text">{{ item.name }}</text>
</view>
</l-button>
</view>
<view class="l-cancel l-class-cancel {{isIphoneX ? 'l-cancel-x':''}}" wx:if="{{ showCancel }}">
<view class="l-cancel l-class-cancel l-cancel-class {{isIphoneX ? 'l-cancel-x':''}}" wx:if="{{ showCancel }}">
<l-button type="ghost" size="large" long="true" bind:lintap="handleClickCancel" special="{{true}}">
<view class="l-item-button l-cancel-button">{{ cancelText }}</view>
</l-button>
@@ -1,12 +1,20 @@
Component({
externalClasses: ['l-class', 'l-class-text'],
externalClasses: [
'l-class',
'l-class-text',
'l-text-class'
],
properties: {
icon: String,
text: String,
iconStyle: {
iconColor: {
type: String,
value: '#3963BC'
},
iconSize: {
type: String,
observer: '_parseCSSText'
value: '28'
},
text: String,
src: String,
openData: {
type: Array,
@@ -40,25 +48,7 @@ Component({
this._isHaveUserAvatarUrl(openData);
this._isHaveUserNickName(openData);
},
_parseCSSText: function parseCSSText(cssText) {
var cssTxt = cssText.replace('/\/\*(.|\s)*?\*\//g', ' ').replace('/\s+/g', ' ');
var style = {};
var properties = cssTxt.split(';').map(function (o) {
return o.split(':').map(function (x) {
return x && x.trim();
});
});
properties.forEach(function (property) {
var key = property[0];
var value = property[1];
style[key] = value;
});

this.setData({
_iconSize: style.size || this.data.size * 0.6,
_iconColor: style.color || '#ffffff',
});
},

_isHaveUserAvatarUrl: function (openData) {
this.setData({
_isHaveUserAvatarUrl: openData.indexOf('userAvatarUrl') !== -1
@@ -2,10 +2,10 @@
<view class="l-avatar {{text||_isHaveUserNickName?'l-placement-'+placement:''}}" bindtap="tapAvatar">
<view class="l-avatar-image {{shape?'l-'+shape:''}} l-class" wx:if="{{_isHaveUserAvatarUrl||icon||src}}" style="width:{{size}}rpx;height:{{size}}rpx">
<open-data wx:if="{{_isHaveUserAvatarUrl}}" type="userAvatarUrl" />
<l-icon wx:elif="{{icon}}" size="{{_iconSize || size*0.6}}" color="{{_iconColor||'#ffffff'}}" name="{{icon}}" />
<l-icon wx:elif="{{icon}}" size="{{iconSize || size*0.6}}" color="{{iconColor||'#ffffff'}}" name="{{icon}}" />
<image wx:elif="{{src}}" src="{{src}}" mode="{{mode}}" style="width:{{size}}rpx;height:{{size}}rpx" />
</view>
<view class="l-avatar-text l-class-text" wx:if="{{text||_isHaveUserNickName}}">
<view class="l-avatar-text l-class-text l-text-class" wx:if="{{text||_isHaveUserNickName}}">
<open-data wx:if="{{_isHaveUserNickName}}" type="userNickName" />
<text wx:elif="{{text}}">{{text}}</text>
</view>
@@ -1,5 +1,5 @@
Component({
externalClasses: ['l-class', 'l-class-self'],
externalClasses: ['l-class', 'l-class-self','l-self-class'],
properties: {
// 红点模式
dot: {
@@ -1,8 +1,8 @@
<view class="l-badge" bindtap="handleTap">
<slot/>
<block wx:if="{{show}}">
<view class="l-badge-content l-class l-class-self" wx:if="{{finalCount}}">{{finalCount}}</view>
<view wx:if="{{content}}" class="l-badge-content l-class l-class-self">{{content}}</view>
<view wx:if="{{dot}}" class="l-badge-dot l-class l-class-self"></view>
<view class="l-badge-content l-class l-class-self l-self-class" wx:if="{{finalCount}}">{{finalCount}}</view>
<view wx:if="{{content}}" class="l-badge-content l-class l-class-self l-self-class">{{content}}</view>
<view wx:if="{{dot}}" class="l-badge-dot l-class l-class-self l-self-class"></view>
</block>
</view>
@@ -1,4 +1,5 @@
module.exports = Behavior({
// eslint-disable-next-line no-undef
export default Behavior({
behaviors: [],
properties: {},
data: {
@@ -1,4 +1,5 @@
module.exports = Behavior({
// eslint-disable-next-line no-undef
export default Behavior({
behaviors: [],
properties: {
time: {
@@ -13,7 +14,7 @@ module.exports = Behavior({
status: {
type: Boolean,
value: true,
observer: function (newVal, oldVal, changedPath) {
observer: function (newVal) {
if (newVal) {
this.init();
} else if (!newVal) {
@@ -2,7 +2,8 @@ import Schema from '../common/async-validator/index';
/**
* @param tipType String [toast , message , text]
*/
module.exports = Behavior({
// eslint-disable-next-line no-undef
export default Behavior({
behaviors: [],
properties: {
// 校验
@@ -55,7 +56,7 @@ module.exports = Behavior({
const validateValue = {
[this.data.name]: value
};
this.data.schema.validate(validateValue, (errors, fields) => {
this.data.schema.validate(validateValue, (errors) => {

this.triggerEvent('linvalidate', {
errors,
@@ -76,7 +77,7 @@ module.exports = Behavior({
wx.showToast({
icon: 'none',
title: `请在页面内引入${tipType}组件`
})
});
return;
}

@@ -95,4 +96,4 @@ module.exports = Behavior({

}
}
})
});
@@ -0,0 +1,54 @@
// eslint-disable-next-line no-undef
export default Behavior({
methods: {
getRect(selector, all = false) {
return new Promise((resolve, reject) => {
const query = wx.createSelectorQuery().in(this);
const type = all ? query.selectAll(selector) : query.select(selector);
type.boundingClientRect((res) => {
if (!res) return reject('找不到元素');
resolve(res);
}).exec();
});
},
queryScrollNode(res, currentIndex, type = 'width') {
const currentRect = res[currentIndex];

this.getRect('.l-tabsscroll').then(_ => {
const scrollWidth = _[type];

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

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

if (type === 'width') {
this.setData({
transformX: transformDistance,
transformY: 0
});
} else {
this.setData({
transformX: 0,
transformY: transformDistance
});
}
});
},
queryMultipleNodes() {
const {
placement,
currentIndex
} = this.data;
this.getRect('.l-tabs-item', true)
.then((res) => {
if (['top', 'bottom'].indexOf(placement) !== -1) {
this.queryScrollNode(res, currentIndex);
} else {
this.queryScrollNode(res, currentIndex, 'height');
}
});
}
}
});
@@ -0,0 +1,26 @@
// eslint-disable-next-line no-undef
export default Behavior({
observers: {
'show': function (show) {
show && this.changeStatus();
if (!show) this.setData({
status: show
});
}
},
methods: {
changeStatus() {
this.setData({
status: true
});
if (this.data.timer) clearTimeout(this.data.timer);
this.data.timer = setTimeout(() => {
this.setData({
status: false
});
if (this.data.success) this.data.success();
this.data.timer = null;
}, this.properties.duration);
}
}
});
@@ -1,4 +1,5 @@
module.exports = Behavior({
// eslint-disable-next-line no-undef
export default Behavior({
behaviors: [],
properties: {
zIndex:{
@@ -37,10 +37,6 @@ Component({
icon: String,
image: String,
bgColor: String,
iconStyle: {
type: String,
value: 'size:20;color:#3683D6'
},
iconColor: String,
iconSize: String,
openType: String,

0 comments on commit 81cae3a

Please sign in to comment.
You can’t perform that action at this time.