diff --git a/README.md b/README.md index ecc8b4bd..9049dcf4 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@
![](https://img.shields.io/badge/build-passing-00d508.svg) -![](https://img.shields.io/badge/version-0.5.8-3963bc.svg) +![](https://img.shields.io/badge/version-0.5.9-3963bc.svg) ![](https://img.shields.io/badge/license-MIT-3963bc.svg)
@@ -39,7 +39,7 @@ Lin UI 是基于 **微信小程序原生语法** 实现的组件库。遵循简 ## 最新版本 -核心库:0.5.8 +核心库:0.5.9 示例工程:0.0.1-alpha.2 diff --git a/build/build-dev.js b/build/build-dev.js index 970f9b7a..95d45bd1 100644 --- a/build/build-dev.js +++ b/build/build-dev.js @@ -4,48 +4,48 @@ const cssmin = require('gulp-clean-css'); const rename = require('gulp-rename'); gulp.task('dispose-wxs', () => { - return gulp.src(['../src/**/*.wxs']) - .pipe(gulp.dest('../examples/dist/')); + return gulp.src(['../src/**/*.wxs']) + .pipe(gulp.dest('../examples/dist/')); }); gulp.task('dispose-css', () => { - return gulp.src(['../src/**/*.less', '!../src/**/_*.less']) - .pipe(less()) - .pipe(cssmin()) - .pipe(rename((path) => { - path.extname = '.wxss'; - })) - .pipe(gulp.dest('../examples/dist/')); + return gulp.src(['../src/**/*.less', '!../src/**/_*.less']) + .pipe(less()) + .pipe(cssmin()) + .pipe(rename((path) => { + path.extname = '.wxss'; + })) + .pipe(gulp.dest('../examples/dist/')); }); gulp.task('dispose-js', () => { - return gulp.src(['../src/**/*.js']) - .pipe(gulp.dest('../examples/dist/')); + return gulp.src(['../src/**/*.js']) + .pipe(gulp.dest('../examples/dist/')); }); gulp.task('dispose-json', () => { - return gulp.src(['../src/**/*.json']) - .pipe(gulp.dest('../examples/dist/')); + return gulp.src(['../src/**/*.json']) + .pipe(gulp.dest('../examples/dist/')); }); gulp.task('dispose-wxml', () => { - return gulp.src(['../src/**/*.wxml']) - .pipe(gulp.dest('../examples/dist/')); + return gulp.src(['../src/**/*.wxml']) + .pipe(gulp.dest('../examples/dist/')); }); // copy gulp.task('copy', () => { - return gulp.src('../src/**/image/**') - .pipe(gulp.dest('../examples/dist/')) - }); + return gulp.src('../src/**/image/**') + .pipe(gulp.dest('../examples/dist/')); +}); gulp.task('watch', () => { - gulp.watch('../src/**/*.less', gulp.series('dispose-css')); - gulp.watch('../src/**/*.js', gulp.series('dispose-js')); - gulp.watch('../src/**/*.wxs', gulp.series('dispose-wxs')); - gulp.watch('../src/**/*.json', gulp.series('dispose-json')); - gulp.watch('../src/**/*.wxml', gulp.series('dispose-wxml')); - gulp.watch('../src/**/image/*', gulp.series('copy')); + gulp.watch('../src/**/*.less', gulp.series('dispose-css')); + gulp.watch('../src/**/*.js', gulp.series('dispose-js')); + gulp.watch('../src/**/*.wxs', gulp.series('dispose-wxs')); + gulp.watch('../src/**/*.json', gulp.series('dispose-json')); + gulp.watch('../src/**/*.wxml', gulp.series('dispose-wxml')); + gulp.watch('../src/**/image/*', gulp.series('copy')); }); gulp.task('default',gulp.series('dispose-css', 'dispose-js', 'dispose-wxs','dispose-json', 'dispose-wxml', 'copy', 'watch')); \ No newline at end of file diff --git a/build/build-prod.js b/build/build-prod.js index aa6a11db..3be9d3dc 100644 --- a/build/build-prod.js +++ b/build/build-prod.js @@ -3,61 +3,61 @@ const less = require('gulp-less'); const cssmin = require('gulp-clean-css'); const rename = require('gulp-rename'); const componentData = require('./build-tool'); -const result = componentData(); +const result = `{common,behaviors,${componentData()}}`; // js => js gulp.task('dispose-js', () => { - const path = result ? `../src/{${ result }}/*.js` : '../src/**/*.js' - return gulp.src(path) - .pipe(gulp.dest('../dist/')); + const path = result ? `../src/${result}/*.js` : '../src/**/*.js'; + return gulp.src(path) + .pipe(gulp.dest('../dist/')); }); gulp.task('dispose-wxss', () => { - const path = result ? `../src/{${ result }}/*.less` : '../src/**/*.less', - remainPath = result ? `!../src/{${ result }}/_*.less` : '!../src/**/_*.less'; - return gulp.src([path, remainPath]) - .pipe(less()) - .pipe(cssmin()) - .pipe(rename((path) => { - path.extname = '.wxss'; - })) - .pipe(gulp.dest('../dist/')); + const path = result ? `../src/${result}/*.less` : '../src/**/*.less', + remainPath = result ? `!../src/${result}/_*.less` : '!../src/**/_*.less'; + return gulp.src([path, remainPath]) + .pipe(less()) + .pipe(cssmin()) + .pipe(rename((path) => { + path.extname = '.wxss'; + })) + .pipe(gulp.dest('../dist/')); }); // wxs => wxs gulp.task('dispose-wxs', () => { - const path = result ? `../src/{${ result }}/*.wxs` : '../src/**/*.wxs' - return gulp.src(path) - .pipe(gulp.dest('../dist/')); + const path = result ? `../src/${result}/*.wxs` : '../src/**/*.wxs'; + return gulp.src(path) + .pipe(gulp.dest('../dist/')); }); // json => json gulp.task('dispose-json', () => { - const path = result ? `../src/{${ result }}/*.json` : '../src/**/*.json' - return gulp.src(path) - .pipe(gulp.dest('../dist/')); + const path = result ? `../src/${result}/*.json` : '../src/**/*.json'; + return gulp.src(path) + .pipe(gulp.dest('../dist/')); }); // wxml => wxml gulp.task('dispose-wxml', () => { - const path = result ? `../src/{${ result }}/*.wxml` : '../src/**/*.wxml' - return gulp.src(path) - .pipe(gulp.dest('../dist/')); + const path = result ? `../src/${result}/*.wxml` : '../src/**/*.wxml'; + return gulp.src(path) + .pipe(gulp.dest('../dist/')); }); // copy gulp.task('dispose-copy', () => { - const path = result ? `../src/{${ result }}/image/**` : '../src/**/image/**' - return gulp.src(path) - .pipe(gulp.dest('../dist/')) + const path = result ? `../src/${result}/image/**` : '../src/**/image/**'; + return gulp.src(path) + .pipe(gulp.dest('../dist/')); }); -gulp.task('default', gulp.series( - 'dispose-js', - 'dispose-wxss', - 'dispose-wxml', - 'dispose-wxs', - 'dispose-copy', - 'dispose-json' +gulp.task('default', gulp.series( + 'dispose-js', + 'dispose-wxss', + 'dispose-wxml', + 'dispose-wxs', + 'dispose-copy', + 'dispose-json' )); \ No newline at end of file diff --git a/build/build-tool.js b/build/build-tool.js index a7eb4776..e224dc46 100755 --- a/build/build-tool.js +++ b/build/build-tool.js @@ -1,35 +1,35 @@ -const fs = require('fs') -let componentArr = [] +const fs = require('fs'); +let componentArr = []; -function componentData () { - let data = fs.readFileSync(`../config/component.json`, 'utf-8') - let params = JSON.parse(data).components - componentArr.push(...params) - forParams(params) - let result = [...new Set(componentArr)].join() - return result -}; +function componentData() { + let data = fs.readFileSync(`../config/component.json`, 'utf-8'); + let params = JSON.parse(data).components; + componentArr.push(...params); + forParams(params); + let result = [...new Set(componentArr)].join(); + return result; +} const forParams = (arr) => { - let finishArr = [] + let finishArr = []; arr.map(item => { - let data = fs.readFileSync(`../src/${item}/index.json`, 'utf-8') - const params = JSON.parse(data) - const { usingComponents } = params + let data = fs.readFileSync(`../src/${item}/index.json`, 'utf-8'); + const params = JSON.parse(data); + const { usingComponents } = params; if (usingComponents && !isEmptyObj(usingComponents)) { for (let key in usingComponents) { - let keyComponent = key.substring(2, key.length) - finishArr.push(keyComponent) + let keyComponent = key.substring(2, key.length); + finishArr.push(keyComponent); } - componentArr.push(...finishArr) - forParams(finishArr) + componentArr.push(...finishArr); + forParams(finishArr); } - }) -} + }); +}; const isEmptyObj = (obj) => { - let result = (JSON.stringify(obj) === "{}"); - return result -} + let result = (JSON.stringify(obj) === '{}'); + return result; +}; module.exports = componentData; \ No newline at end of file diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js deleted file mode 100644 index 52446edd..00000000 --- a/dist/action-sheet/index.js +++ /dev/null @@ -1,125 +0,0 @@ -Component({ - externalClasses: ['l-class-title', 'l-class-item', 'l-class-cancel'], - properties: { - locked: Boolean, - showCancel: Boolean, - show: Boolean, - itemList: Array, - cancelText: { - type: String, - value: '取消' - }, - title: String, - openApi: { - type: Boolean, - value: true, - } - }, - data: { - success: '', - fail: '', - isIphoneX: false - }, - attached() { - if (this.data.openApi) { - this.initActionSheet(); - } - this.initUIAdapter(); - }, - - lifetimes: { - show() { - if (this.data.openApi) { - this.initActionSheet(); - } - - }, - }, - methods: { - /** - * 区分UI尺寸 - */ - initUIAdapter() { - wx.getSystemInfo({ - success: (res) => { - this.setData({ - isIphoneX: res.model == 'iPhone X' ? true : false, - }); - } - }); - }, - initActionSheet() { - const config = { - itemList: [], - success: null, - fail: null, - title: '', - locked: true, - 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, - } = options; - this.setData({ - itemList: itemList.slice(0, 10), - success, - fail, - title, - locked, - cancelText, - showCancel, - show: true, - }); - return this; - }; - }, - handleClickItem(e) { - const { - success - } = this.data; - success && success({ ...e.currentTarget.dataset }); - this.triggerEvent('linitemtap', { ...e.currentTarget.dataset }); - this._hideActionSheet(); - }, - - _showActionSheet() { - this.setData({ - show: true - }); - }, - - _hideActionSheet() { - this.setData({ - show: false - }); - }, - - handleClickCancel() { - const { - fail - } = this.data; - fail && fail({ - errMsg: 'showactionsheet:fail cancel' - }); - this.triggerEvent('lincancel', { - errMsg: 'showactionsheet:fail cancel' - }); - this._hideActionSheet(); - }, - - handleClickPopUp() { - if (!this.data.locked) { - this.handleClickCancel(); - } - }, - } -}); \ No newline at end of file diff --git a/dist/action-sheet/index.json b/dist/action-sheet/index.json deleted file mode 100644 index 248ca904..00000000 --- a/dist/action-sheet/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon":"../icon/index", - "l-popup":"../popup/index", - "l-button":"../button/index" - } - } \ No newline at end of file diff --git a/dist/action-sheet/index.wxml b/dist/action-sheet/index.wxml deleted file mode 100644 index fa88a9c0..00000000 --- a/dist/action-sheet/index.wxml +++ /dev/null @@ -1,25 +0,0 @@ - - - - {{ title }} - - - - - - - {{ item.name }} - - - - - - {{ cancelText }} - - - - \ No newline at end of file diff --git a/dist/action-sheet/index.wxss b/dist/action-sheet/index.wxss deleted file mode 100644 index 5d2266cf..00000000 --- a/dist/action-sheet/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.l-action-sheet{background:#f7f7f7}.l-item-button{height:88rpx;line-height:88rpx;text-align:center;background:#fff;border-bottom:2rpx solid #f3f3f3;font-size:28rpx;color:#45526b;display:flex;align-items:center;justify-content:center;width:100%}.l-cancel{margin-top:12rpx}.l-cancel-x .l-item-button{padding-bottom:44rpx}.l-image-button>text{margin-left:20rpx} \ No newline at end of file diff --git a/dist/avatar/index.js b/dist/avatar/index.js deleted file mode 100644 index 629491aa..00000000 --- a/dist/avatar/index.js +++ /dev/null @@ -1,86 +0,0 @@ -Component({ - externalClasses: ['l-class', 'l-class-text'], - properties: { - icon: String, - text: String, - iconStyle: { - type: String, - observer: '_parseCSSText' - }, - src: String, - openData: { - type: Array, - observer: '_initOpenData' - }, - shape: { - type: String, - value: 'circle' - }, - mode: { - type: String, - value: 'scaleToFill' - }, - size: { - type: Number, - value: 120, - }, - placement: { - type: String, - value: 'right' - }, - }, - data: { - _isHaveUserNickName: false, - _isHaveUserAvatarUrl: false, - _iconSize: '', - _iconColor: '#ffffff' - }, - methods: { - _initOpenData: function (openData) { - 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 - }); - }, - - _isHaveUserNickName: function (openData) { - this.setData({ - _isHaveUserNickName: openData.indexOf('userNickName') !== -1 - }); - }, - tapAvatar: function (e) { - this.triggerEvent('lintap', { - e - }, { - bubbles: false - }); - this.triggerEvent('lintapcatch', { - e - }, { - bubbles: true - }); - }, - } -}); \ No newline at end of file diff --git a/dist/avatar/index.json b/dist/avatar/index.json deleted file mode 100644 index dd10af0a..00000000 --- a/dist/avatar/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon":"../icon/index" - } - } \ No newline at end of file diff --git a/dist/avatar/index.wxml b/dist/avatar/index.wxml deleted file mode 100644 index 4c135c7e..00000000 --- a/dist/avatar/index.wxml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - {{text}} - - \ No newline at end of file diff --git a/dist/avatar/index.wxss b/dist/avatar/index.wxss deleted file mode 100644 index 4efad93a..00000000 --- a/dist/avatar/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.l-avatar{display:inline-flex;justify-content:center;align-items:center}.l-avatar-image{flex:1;display:inline-flex;justify-content:center;align-items:center;background:#ccc;overflow:hidden}.l-avatar-text{display:inline-block;height:max-content;width:max-content;font-size:28rpx;color:#45526b;line-height:40px}open-data{width:100%;height:100%}.l-avatar-text open-data,.l-avatar-text text{font-size:inherit;color:inherit;line-height:inherit}.l-square{border-radius:8rpx}.l-circle{border-radius:50%}.l-placement-left,.l-placement-right{align-items:center;justify-content:center}.l-placement-left{margin-right:24rpx;flex-direction:row-reverse}.l-placement-left .l-avatar-text{margin-right:24rpx}.l-placement-right{flex-direction:row}.l-placement-right .l-avatar-text{margin-left:24rpx}.l-placement-top{flex-direction:column-reverse}.l-placement-top .l-avatar-text{margin-bottom:12rpx}.l-placement-bottom{flex-direction:column}.l-placement-bottom .l-avatar-text{margin-top:12rpx} \ No newline at end of file diff --git a/dist/badge/index.js b/dist/badge/index.js deleted file mode 100644 index a1275d86..00000000 --- a/dist/badge/index.js +++ /dev/null @@ -1,63 +0,0 @@ -Component({ - externalClasses: ['l-class','l-class-self'], - properties: { - // 红点模式 - dot: { - type: Boolean, - value: false - }, - // 数字 - count: { - type: Number, - value: 0, - observer: 'finalCount' - }, - // 数字最大值 - maxCount: { - type: Number, - value: 99 - }, - // 数字形式 - countType: { - type: String, - value: 'overflow' - }, - // 文字内容 - content: String - }, - data: { - finalCount: 0 - }, - methods: { - // 最终数字 - 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; - } - }, - // 点击事件 - handleTap() { - this.triggerEvent('lintap'); - this.triggerEvent('lintapcatch', {}, { bubbles: true }); - }, - } -}); \ No newline at end of file diff --git a/dist/badge/index.json b/dist/badge/index.json deleted file mode 100644 index e56592f8..00000000 --- a/dist/badge/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - - } -} \ No newline at end of file diff --git a/dist/badge/index.wxml b/dist/badge/index.wxml deleted file mode 100644 index d5e221fd..00000000 --- a/dist/badge/index.wxml +++ /dev/null @@ -1,6 +0,0 @@ - - - {{finalCount}} - {{content}} - - \ No newline at end of file diff --git a/dist/badge/index.wxss b/dist/badge/index.wxss deleted file mode 100644 index ce0e1774..00000000 --- a/dist/badge/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.l-badge{position:relative;display:inline-block;line-height:1;vertical-align:middle}.l-badge-content{height:28rpx;min-width:54rpx;max-width:650rpx;transform:translateX(50%);padding:0 8rpx;border-radius:14rpx 14rpx 14rpx 0rpx;background-color:#ff474b;color:#fff;position:absolute;top:-10rpx;right:-14rpx;font-size:20rpx;display:inline-block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:28rpx;text-align:center;box-sizing:border-box;z-index:10}.l-badge-dot{height:16rpx;width:16rpx;transform:translateX(50%);border-radius:50%;background-color:#ff474b;position:absolute;top:-4rpx;right:0rpx} \ No newline at end of file diff --git a/dist/button/index.js b/dist/button/index.js deleted file mode 100644 index dfb4f0e2..00000000 --- a/dist/button/index.js +++ /dev/null @@ -1,79 +0,0 @@ -Component({ - externalClasses: ['l-class', 'l-hover-class', 'l-img-class'], - properties: { - // button组建标识 - name: { - type: String, - value: 'lin' - }, - type: { - type: String, - value: 'default', - }, - plain: Boolean, - size: { - type: String, - value: 'medium', - }, - shape: { - type: String, - value: 'circle', - }, - disabled: { - type: Boolean, - value: false, - }, - special: { - type: Boolean, - value: false, - }, - loading: { - type: Boolean, - value: false, - }, - // 微信原生接口 - width:Number, - height:Number, - icon: String, - image: String, - iconStyle: { - type: String, - value: 'size:20;color:#3683D6' - }, - iconColor: String, - iconSize: String, - openType: String, - appParameter: String, - lang: String, - hoverStopPropagation: Boolean, - hoverStartTime: { - type: Number, - value: 20 - }, - hoverStayTime: { - type: Number, - value: 70 - }, - sessionFrom: { - type: String, - value: '' - }, - sendMessageTitle: String, - sendMessagePath: String, - sendMessageImg: String, - showMessageCard: Boolean, - formType: String - }, - methods: { - // button点击事件 - handleTap() { - if (this.data.disabled) return false; - this.triggerEvent('lintap'); - this.triggerEvent('lintapcatch',{},{ bubbles: true }); - }, - // 开放能力事件回调 - openTypeEvent(data) { - this.triggerEvent(data.type, data.detail, {}); - } - } -}); diff --git a/dist/button/index.json b/dist/button/index.json deleted file mode 100644 index c01e2d7e..00000000 --- a/dist/button/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon":"../icon/index" - } -} \ No newline at end of file diff --git a/dist/button/index.wxml b/dist/button/index.wxml deleted file mode 100644 index 2a915345..00000000 --- a/dist/button/index.wxml +++ /dev/null @@ -1,39 +0,0 @@ - - \ No newline at end of file diff --git a/dist/button/index.wxss b/dist/button/index.wxss deleted file mode 100644 index da04df64..00000000 --- a/dist/button/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.btn-hover{opacity:.8}.special-container{display:flex}.l-btn{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;font-size:28rpx;position:relative;color:#fff;padding:0 12rpx;box-sizing:border-box}.l-btn-img-mini{width:30rpx;height:30rpx}.l-btn-img-medium{width:36rpx;height:36rpx}.l-btn-img-large{height:44rpx;width:44rpx}.l-btn-long{border-radius:0;margin:0;height:88rpx;width:100%}.l-btn-medium{height:72rpx;min-width:180rpx}.l-btn-large{height:88rpx;min-width:710rpx}.l-btn-mini{height:60rpx;min-width:140rpx;font-size:24rpx}.l-btn-default{background-color:#3963bc}.l-btn-success{background-color:#34bfa3}.l-btn-warning{background-color:#ffe57f;color:#333}.l-btn-error{background-color:#f4516c}.l-btn-square{border-radius:0}.l-btn-semicircle{border-radius:40rpx}.l-btn-large.l-btn-semicircle{border-radius:48rpx}.l-btn-mini.l-btn-semicircle{border-radius:30rpx}.l-btn-circle{border-radius:8rpx}.l-btn-large.l-btn-circle{border-radius:9.6rpx}.l-btn-mini.l-btn-circle{border-radius:6rpx}.l-btn-plain{background-color:#fff;color:#3963bc;border:2rpx solid #3963bc}.l-btn-success.l-btn-plain{background-color:#fff;color:#34bfa3;border:2rpx solid #34bfa3}.l-btn-error.l-btn-plain{background-color:#fff;color:#f4516c;border:2rpx solid #f4516c}.l-btn-warning.l-btn-plain{background-color:#fff;color:#ffe57f;border:2rpx solid #ffe57f}.l-btn-loading{opacity:.6;display:inline-block;vertical-align:middle;width:24rpx;height:24rpx;background:0 0;border-radius:50%;border:4rpx solid #fff;border-color:#fff #fff #fff transparent;animation:btn-spin .6s linear;animation-iteration-count:infinite}.l-btn-loading-default{border:4rpx solid #3963bc;border-color:#3963bc #3963bc #3963bc transparent}.l-btn-loading-success{border:4rpx solid #34bfa3;border-color:#34bfa3 #34bfa3 #34bfa3 transparent}.l-btn-loading-error{border:4rpx solid #f4516c;border-color:#f4516c #f4516c #f4516c transparent}.l-btn-loading-warning{border:4rpx solid #ffe57f;border-color:#ffe57f #ffe57f #ffe57f transparent}.l-btn-disabled{opacity:.8;background-color:#dee2e6}.icon{display:flex!important}.margin-mini{margin-right:10rpx}.margin-medium{margin-right:18rpx}.margin-large{margin-right:24rpx}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/dist/card/index.js b/dist/card/index.js deleted file mode 100644 index 0f4226fe..00000000 --- a/dist/card/index.js +++ /dev/null @@ -1,38 +0,0 @@ -Component({ - /** - * 组件的属性列表 - */ - externalClasses: ['l-class', 'l-img-class','l-title-class'], - options: { - multipleSlots: true // 在组件定义时的选项中启用多slot支持 - }, - properties: { - image: String, - title: String, - describe: String, - plaintext: Boolean, - full: Boolean, - position:{ - type:String, - value:'left' - }, - type: { - type: String, - value: 'primary' - } - }, - - /** - * 组件的初始数据 - */ - data: { - - }, - - /** - * 组件的方法列表 - */ - methods: { - - } -}) \ No newline at end of file diff --git a/dist/card/index.json b/dist/card/index.json deleted file mode 100644 index e8cfaaf8..00000000 --- a/dist/card/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/dist/card/index.wxml b/dist/card/index.wxml deleted file mode 100644 index b774af0a..00000000 --- a/dist/card/index.wxml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {{title}} - - - - - - - - - {{title}} - {{describe}} - - - - - - - \ No newline at end of file diff --git a/dist/card/index.wxss b/dist/card/index.wxss deleted file mode 100644 index f4f948a6..00000000 --- a/dist/card/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.card-container{margin:0 auto;padding:30rpx;box-sizing:border-box;background:#fff;display:flex}.card-container-full{width:100%}.card-container-unfull{width:92%;box-shadow:0 4rpx 20rpx 0 rgba(212,217,223,.5);border-radius:4px}.card-container-primary-left{flex-direction:row}.card-container-primary-right{flex-direction:row-reverse}.card-container-avatar{flex-direction:column}.card-container-cover{flex-direction:column}.cover-img-full{width:100%;height:260rpx}.cover-img-unfull{width:100%;height:260rpx}.card-img-primary{height:240rpx;width:240rpx;overflow:hidden}.card-img-primary-left{margin-right:40rpx}.card-img-primary-right{margin-left:40rpx}.card-img-avatar{height:60rpx;width:60rpx;border-radius:50%;margin-right:30rpx}.card-img-avatar{height:60rpx;width:60rpx;border-radius:50%;margin-right:30rpx}.card-content{position:relative;display:flex;flex-direction:column;flex:1}.card-title{overflow:hidden;text-overflow:ellipsis;color:#333}.card-title-primary{font-size:32rpx;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.card-title-avatar{font-size:28rpx}.card-title-cover{font-size:30rpx;margin-top:10rpx}.card-title-avatar{font-size:28rpx}.card-avatar-top{display:flex;flex-direction:row;height:100rpx;align-items:center;justify-content:space-between}.card-avatar-left{display:flex;flex-direction:row;align-items:center}.card-avatar{display:flex;flex-direction:column}.describe{color:#666;font-size:24rpx} \ No newline at end of file diff --git a/dist/checkbox-group/index.js b/dist/checkbox-group/index.js deleted file mode 100644 index 9c3ae618..00000000 --- a/dist/checkbox-group/index.js +++ /dev/null @@ -1,97 +0,0 @@ -import rules from '../behaviors/rules'; - -Component({ - behaviors: ['wx://form-field', rules], - externalClasses: ['l-class', 'l-error-text'], - relations: { - '../checkbox/index': { - type: 'child', - // linked() { - // this.onChangeHandle(); - // }, - // linkChanged() { - // this.onChangeHandle(); - // }, - // unlinked() { - // this.onChangeHandle(); - // } - } - }, - properties: { - current: { - type: Array, - value: [], - observer: 'onChangeHandle' - }, - placement: { - type: String, - value: 'column', //column row - }, - }, - data: { - value: [], - list: [], - length: null - }, - attached() { - this.initRules() - }, - ready() { - const len = this.items().length - this.data.length = len - this.setData({ - length: len - }) - this.onChangeHandle(); - - }, - methods: { - items() { - let items = this.getRelationNodes('../checkbox/index'); - return items - }, - // checkbox change - onChangeHandle(val = this.data.current) { - let items = this.getRelationNodes('../checkbox/index'); - const len = items.length - if (len === this.data.length) { - items.forEach(item => { - let type = val.indexOf(item.data.value) !== -1 - item.onChangeHandle(type, 'init'); - }); - } - }, - currentChange(val) { - - // const index = this.data.current.indexOf(val.value) - this.data.list.push(val) - this.setData({ - value: this.data.list - }) - }, - - onEmitEventHandle(current) { - - const index = this.data.current.indexOf(current.value) - index === -1 ? this.data.current.push(current.value) : this.data.current.splice(index, 1); - index === -1 ? this.data.list.push(current) : this.data.list.splice(index, 1); - this.setData({ - current: this.data.current - }, () => { - this.validatorData({ - value: this.data.value - }) - }) - - const all = JSON.parse(JSON.stringify(this.data.list)) - for (let i = 0; i < all.length; i++) { - delete all[i].all - } - current.all = all - this.setData({ - value: all - }) - this.triggerEvent('linchange', current) - } - } -}); \ No newline at end of file diff --git a/dist/checkbox-group/index.json b/dist/checkbox-group/index.json deleted file mode 100644 index d64279c4..00000000 --- a/dist/checkbox-group/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-error-tip":"../error-tip/index" - } -} \ No newline at end of file diff --git a/dist/checkbox-group/index.wxml b/dist/checkbox-group/index.wxml deleted file mode 100644 index 271112fc..00000000 --- a/dist/checkbox-group/index.wxml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dist/checkbox-group/index.wxss b/dist/checkbox-group/index.wxss deleted file mode 100644 index 38e7c910..00000000 --- a/dist/checkbox-group/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.checkbox-group-row{display:flex;flex-direction:row}.checkbox-group-column{display:flex;flex-direction:column} \ No newline at end of file diff --git a/dist/checkbox/index.js b/dist/checkbox/index.js deleted file mode 100644 index f812d552..00000000 --- a/dist/checkbox/index.js +++ /dev/null @@ -1,99 +0,0 @@ -Component({ - behaviors: ['wx://form-field'], - externalClasses: ['l-class', 'l-title-class'], - relations: { - '../checkbox-group/index': { - type: 'parent' - } - }, - properties: { - value: { - type: String, - value: '' - }, - detail: { - type: Object, - value: {} - }, - // checkbox的形状 - shape: { - type: String, - value: 'right' - }, - type: { - type: String, - value: 'square' // square 方形 circle 圆形 - }, - // checkbox的大小 - size: { - type: [String, Number], - value: 36 - }, - // 是否选中 - checked: { - type: Boolean, - value: false - }, - // 不可选状态 - disabled: { - type: Boolean, - value: false - }, - // 选中后的颜色 - color: { - type: String, - value: '#3963BC' - }, - // 是否自定义内容 - custom: { - type: Boolean, - value: false - }, - // radio的布局 - placement: { - type: String, - value: 'left' - } - }, - data: { - right: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAAp1JREFUeAHtmD1IlVEYx80KLckSpIw2kxAcAoeGBiODGlpcJGgxRChBsMGpocWpqSUcXFxaIlBoaYikoaEhaAgaAtdIKsK+yL5uvweu8HI7PO+9571cOvf9P/DnvO95znPO+f+uvl8dHQoREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERaDaBSqXSg/Y2e97k5wPKIHqM/qDvaBntT95YMwwAYgS9RbWx1Iz5k54DIifRu1oy1fMvtJ1JGyyyecyPog9VGKFmm85yXo8wfgp9DFHJ9K0V+QGSrQXAabSVARE63KBzIFmTsRvH9Bj6HCKS6XvN8bHYNZKtw/Q4+poBETp8RefRZE3GbhzTF9C3EJFM30uOD8eukWwdpi8ie/jz4gXJ/mRNxm4c0xPIbtdePCfZF7tGS+vY6CF0Fp0oujBzTKKfyItnJA8WXasl9Wz0CspeJ+5z3huzOHWX0S/kxVOSB2Lmb3kNGx1GPwJu7NrQ0PMI46fQb+TFE5I9LTcauyCbve64sYe2oXrmZtwMyoPziDFpvamz4WvIi02Sox4k8rPIPld48ZBktzfPf5lj0wPoveeM3Cd0LmSA/vmcWks/QF2h+iT62PwZZBC8sFv2pawhzhe8gmpulTb9N3NM2CcI+3fywq4xcwaJ9oY3sJq7R7snCzXpY8wcR3Zhzov1vAHk76LdSQMJbR5TR5Dd4ovECsXt+0UQc72onr8Shv0Ty/TsCsFvqz5MdiF7om4k7jC4/eHs/NKY7URLdRK6vVNXuhZAN3Mg3SodlFrDALqKQq8Si7VjS3sOoPPIPo1avEHTpYXhGQfMPi+vnAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIQCME/gJuaIsjMhxDzAAAAABJRU5ErkJggg==', - circle: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAAjlJREFUeAHtmjFOw0AQRWOUApGSBqhNR8MZcgEKehcUXCMnAlHmFBTQQU1ooAtCAsn8j9aS5SRaR56xlc0f6cuOdz2z87wbe9cejWQiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0A+BrJ8wm6OUZXmI0nPoFDoLNd+wXUAvWZZ9h2P7swGUCVRAd9AS2mQsY50CmiRPCEmOoVtoAW1rPIfnjpMEhcRy6AnqavSRJwUJCU2hz65kaufT1zQJSEwE+qklZ7VLn7sNCQlwWFn2nCZc+nYdbm63eTScf6aP0IXzUHiG/0s8Dvx6xDnwcBp83mDrDYehGIOxXMylB6H38JnlFTpxafWq03ccytGLlqtF3Y549aBrNKsvOCTAWIxpbl6ArsxbGnfoEtN8iGF4cW71AR3FczKt8QVvx9ZzN48exIln33BImjEZ29Q8AFUzctOGtnRmHtsDEJcthjLz2B6AhoLjEtcDEBe6hjIutJmaByDzRm6RsfnF0W0+Qt+8B4XnkHkkrkfx3PoZiI00BxQyf/AgEPHpEtN8iDEJTVYjlzLMqmeRapbFsxDT0ue/L5ceRM+pLJiZE687BKSdX3Kt5+OyD0hatI+RDZAsF+/Tee1TwQvDTS8OKyDrtoCkV8/rwDSPAVT18cI99mMfL7BOwXOafvr47Xabb9t4JF59/sLFrmo9h5NOTnr38/OXtvBUTwREQAREQAREQAREQAREQAREQAREQAREQAREQAREICkCf2RxAMVsHYMpAAAAAElFTkSuQmCC', - checked: true - }, - methods: { - onChangeHandle(current, type) { - if (this.data.disabled) return - // 页面不调用,由父组件调用 改变选中状态 - this.setData({ - checked: current - }); - // 将值传递给父组件 - if (type === 'init' && current) { - const item = { - current: current, - value: this.data.value, - detail: this.data.detail - } - const parent = this.getRelationNodes('../checkbox-group/index')[0]; - parent ? parent.currentChange(item) : this.triggerEvent('linchange', item); - } - - }, - // 点击 checkbox - onCheckBoxChangeTap() { - if (this.data.disabled) return; - const item = { - current: !this.data.checked, - value: this.data.value, - detail: this.data.detail, - all: null - }; - const parent = this.getRelationNodes('../checkbox-group/index')[0]; - parent ? parent.onEmitEventHandle(item) : this.triggerEvent('linchange', item); - // parent ? console.log('') : this.onChangeHandle(true); - this.setData({ - checked: !this.data.checked - }) - } - } -}); \ No newline at end of file diff --git a/dist/checkbox/index.json b/dist/checkbox/index.json deleted file mode 100644 index e8cfaaf8..00000000 --- a/dist/checkbox/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "component": true, - "usingComponents": {} -} \ No newline at end of file diff --git a/dist/checkbox/index.wxml b/dist/checkbox/index.wxml deleted file mode 100644 index 58a80ab8..00000000 --- a/dist/checkbox/index.wxml +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/dist/checkbox/index.wxss b/dist/checkbox/index.wxss deleted file mode 100644 index bcd46838..00000000 --- a/dist/checkbox/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.label-left{display:flex;flex-direction:row;align-items:center;color:#333}.label-right{display:flex;flex-direction:row-reverse;align-items:center;color:#333}.checkbox{display:flex;flex-direction:row;align-items:center;justify-content:center;margin-right:20rpx}.checkbox-type-circle{border-radius:50%}.checkbox-type-square{border-radius:8rpx}.checkbox-right{width:100%;height:100%}.checkbox-circle{width:100%;height:100%}.checkbox-title{font-size:28rpx;flex:1}.checkbox-title-disabled{font-size:28rpx;flex:1;color:#ccc}.checkbox-unselected{border:1px solid #c4c9d2;box-sizing:border-box} \ No newline at end of file diff --git a/dist/combined-tabs/index.js b/dist/combined-tabs/index.js deleted file mode 100644 index 3c2075d3..00000000 --- a/dist/combined-tabs/index.js +++ /dev/null @@ -1,265 +0,0 @@ -// components/tabs/index.js -Component({ - externalClasses: ['l-class-header', 'l-class-active', 'l-class-inactive', 'l-class-line', 'l-class-tabimage'], - relations: { - '../tabpanel/index': { - type: 'child', - }, - linked(target) { - // 每次有子节点被插入时执行,target是该节点实例对象,触发在该节点attached生命周期之后 - this.initTabs(); - }, - unlinked(target) { - this.initTabs(); - } - }, - options: { - multipleSlots: true // 在组件定义时的选项中启用多slot支持 - }, - /** - * 组件的属性列表 - */ - properties: { - activeKey: { - type: String, - value: '', - observer: 'changeCurrent' - }, - placement: { - type: String, - value: 'top', - }, - aminmated: Boolean, - scrollable: Boolean, - swipeable: { - type: Boolean, - value: true, - }, - hasLine: { - type: Boolean, - value: true - }, - activeColor: { - type: String, - value: '#333333' - }, - inactiveColor: { - type: String, - value: '#bbbbbb' - }, - - }, - - data: { - tabList: [], - currentIndex: 0, - transformX: 0, - transformY: 0, - }, - - ready() { - this.initTabs(); - - }, - - - /** - * 组件的方法列表 - */ - methods: { - initTabs() { - this.initTabList(); - this.initActiveIndex(); - }, - initActiveIndex(val = this.data.activeKey) { - let activeKey = val, - currentIndex = this.data.currentIndex; - this.data.tabList.forEach((item, index) => { - activeKey = !val && index == 0 ? item.key : activeKey; - currentIndex = item.key === activeKey ? index : currentIndex; - }); - this.setData({ - activeKey, - currentIndex, - }, () => { - if (this.data.scrollable) { - this.queryMultipleNodes(); - } - }); - }, - - initTabList() { - let items = this.getRelationNodes('../tabpanel/index'); - if (items.length > 0) { - const tabList = []; - items.forEach((item, index) => { - const tabIndex = tabList.findIndex(tabItem => tabItem.tab === item.data.tab); - let tab = {}; - if (tabIndex === -1) { - tab = { - tab: item.data.tab, - key: item.data.key, - icon: item.data.icon, - iconStyle: item.data.iconStyle, - image: item.data.image, - subTabs: [], - }; - tabList.push(tab); - } - const targetTab = tabIndex === -1 ? tab : tabList[tabIndex]; - if (item.data.subTab) { - targetTab.subTabs = targetTab.subTabs || []; - const subTabItem = { - tab: item.data.subTab, - key: item.data.subKey, - }; - targetTab.subTabs.push(subTabItem); - targetTab.activeSubKey = this.data.subActiveKey || targetTab.subTabs[0].key; - targetTab.subCurrentIndex = 0; - } - }); - this.setData({ - tabList, - }); - } - }, - swiperChange(e) { - const { - source, - current - } = e.detail; - if (source == 'touch') { - const currentIndex = current; - const activeKey = this.data.tabList[current].key; - const subCurrentIndex = this.data.tabList[currentIndex].subCurrentIndex; - const activeSubKey = this.data.tabList[currentIndex].activeSubKey; - this._setChangeData({ - activeKey, - currentIndex, - subCurrentIndex, - activeSubKey, - }); - } - }, - subSwiperChange(e) { - const { - source, - current - } = e.detail; - if (source == 'touch') { - const { - currentIndex, - activeKey - } = this.data; - const subCurrentIndex = current; - const activeSubKey = this.data.tabList[currentIndex].subTabs[subCurrentIndex].key; - const tabs = this.data.tabList[currentIndex]; - tabs.activeSubKey = activeSubKey; - tabs.subCurrentIndex = subCurrentIndex; - - this.setData({ - [`tabList[${currentIndex}]`]: tabs - }); - - this._setChangeData({ - activeKey, - currentIndex, - activeSubKey, - subCurrentIndex - }); - } - }, - handleChange(e) { - const isSubHeader = e.currentTarget.dataset.headerType === 'subTab'; - const { - currentIndex, - activeKey - } = this.data; - - const clickIndex = e.currentTarget.dataset.index; - const subCurrentIndex = isSubHeader ? clickIndex : this.data.tabList[clickIndex].subCurrentIndex; - const activeSubKey = isSubHeader ? this.data.tabList[currentIndex].subTabs[subCurrentIndex].key : this.data.tabList[clickIndex].activeSubKey; - if (isSubHeader) { - const tabs = this.data.tabList[currentIndex]; - tabs.activeSubKey = activeSubKey; - tabs.subCurrentIndex = subCurrentIndex; - this.setData({ - [`tabList[${currentIndex}]`]: tabs - }); - this._setChangeData({ - activeKey, - currentIndex, - activeSubKey, - subCurrentIndex - }); - - } else { - const activeKey = e.currentTarget.dataset.key; - this._setChangeData({ - activeKey, - currentIndex: clickIndex, - subCurrentIndex, - activeSubKey - }); - } - }, - - _setChangeData({ - activeKey, - currentIndex, - activeSubKey = '', - subCurrentIndex = null, - }) { - this.setData({ - activeKey, - currentIndex - }, () => { - if (this.data.scrollable) { - this.queryMultipleNodes(); - } - }); - this.triggerEvent('linchange', { - activeKey, - currentIndex, - activeSubKey, - subCurrentIndex, - }); - }, - - queryMultipleNodes() { - const { - placement, - activeKey, - tabList - } = this.data; - this._getRect('#' + activeKey) - .then((res) => { - if (['top', 'bottom'].indexOf(placement) !== -1) { - this.setData({ - transformX: res.left - tabList.length / 2 * res.width, - transformY: 0 - }); - } else { - this._getRect('.l-tabs-header') - .then((navRect) => { - const transformY = res.top - navRect.top - navRect.height / 2; - this.setData({ - transformX: 0, - transformY: transformY - }); - }); - } - }); - }, - - _getRect(selector) { - return new Promise((resolve, reject) => { - const query = wx.createSelectorQuery().in(this); - query.select(selector).boundingClientRect((res) => { - if (!res) return reject('找不到元素'); - resolve(res); - }).exec(); - }); - } - } -}); \ No newline at end of file diff --git a/dist/combined-tabs/index.json b/dist/combined-tabs/index.json deleted file mode 100644 index 398bd031..00000000 --- a/dist/combined-tabs/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon":"../icon/index", - "l-badge":"../badge/index" - } -} \ No newline at end of file diff --git a/dist/combined-tabs/index.wxml b/dist/combined-tabs/index.wxml deleted file mode 100644 index 9386e53c..00000000 --- a/dist/combined-tabs/index.wxml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/combined-tabs/index.wxss b/dist/combined-tabs/index.wxss deleted file mode 100644 index b65855bf..00000000 --- a/dist/combined-tabs/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.l-tabs{display:flex;border-radius:8rpx;box-sizing:border-box;overflow:hidden;flex-direction:column;background:#fff;height:100%}.l-tabs .l-tabs-header{display:flex;width:100%;flex-direction:row;background:#fff;align-items:center}.l-tabs .l-tabs-header .l-tabs-item{flex:1;font-size:28rpx;text-align:center;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.l-tabs .l-tabs-header .l-icon-active,.l-tabs .l-tabs-header .l-tabs-active{color:#333;font-size:28rpx}.l-tabs .l-tabs-header .l-icon-inactive,.l-tabs .l-tabs-header .l-tabs-inactive{font-size:28rpx;color:#bbb}.l-tabs .l-tabs-header .l-tabsitems-row{flex-direction:row}.l-tabs .l-tabs-header .l-tabsitems-row .l-icon-active,.l-tabs .l-tabs-header .l-tabsitems-row .l-icon-inactive{margin-right:10rpx}.l-tabs .l-tabs-header .l-tabsitems-row-reverse{flex-direction:row-reverse}.l-tabs .l-tabs-header .l-tabsitems-row-reverse .l-icon-active,.l-tabs .l-tabs-header .l-tabsitems-row-reverse .l-icon-inactive{margin-left:10rpx}.l-placement-top .l-tabs-header{height:80rpx}.l-placement-top .l-tabs-header .l-tabs-item{min-height:100%}.l-sub-placement-left{flex-direction:row}.l-sub-placement-left .l-tabs-header{flex-direction:column;width:160rpx}.l-sub-placement-left .l-tabs-header>view{width:100%;height:80rpx;background:#f6f8fa}.l-sub-placement-left .l-tabs-header>.l-tabs-active{background:#fff}.l-tabpanel-content{display:flex}.l-sub-placement-left .l-tabs-main .l-tabpanel-content{width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;position:relative;will-change:transform;transition:transform .3s cubic-bezier(.645,.045,.355,1)}.l-placement-top .l-tabpanel-content{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row}.l-aminmated.l-placement-top .l-tabpanel-content{will-change:margin-left;-webkit-transition:margin-left .3s cubic-bezier(.645,.045,.355,1);transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.l-tabpanel{width:100%;height:100%;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-transition:opacity .45s;transition:opacity .45s;opacity:1;text-overflow:ellipsis}.l-tabpanel-inactive{opacity:0;height:0;padding:0!important;pointer-events:none}.l-tabs-scroll.l-tabs-horizontal .l-tabs-header{-webkit-overflow-scrolling:touch;white-space:nowrap}.l-tabs-scroll.l-tabs-horizontal .l-tabs-header .l-tabs-item{overflow:visible;min-width:160rpx}.l-tabs-vertical .l-tabsscroll{width:160rpx}.l-tabs-vertical .l-tabs-header{height:100%;min-height:80rpx;-webkit-overflow-scrolling:touch;white-space:nowrap}.l-tabs-vertical .l-tabs-header .l-tabs-item{overflow:visible;min-height:80rpx}.l-tabs-item{position:relative}.l-tab-line{position:absolute;bottom:0;left:0;right:0;width:0;background:#000}.l-tabs-horizontal .l-tab-line{height:4rpx;margin:0 auto}.l-tabs-horizontal .l-tabs-active .l-tab-line{width:100%;transition-delay:.1s}.l-placement-top .l-tab-line{bottom:0}.l-placement-top .l-tabs-header-line{border-bottom:1px solid #f3f3f3}.l-tabs-vertical .l-tabs-active .l-tab-line{width:6rpx!important;height:40rpx!important;border-radius:0 6rpx 6rpx 0;top:0;left:0;margin:auto 0;transition-delay:.1s}.l-sub-placement-left .l-tab-line{left:0;right:auto}.l-sub-placement-left .l-tabs-header-line{border-right:1px solid #f3f3f3}.l-tab-image{width:100rpx;height:100rpx}.l-tab-image-placement-top{flex-direction:column}.l-tab-image-placement-left{flex-direction:row}.l-tabs-main{width:100%;height:100%;display:flex;flex-direction:row}.l-combined-tabs-main{display:flex} \ No newline at end of file diff --git a/dist/common/async-validator/index.js b/dist/common/async-validator/index.js deleted file mode 100644 index dac8802f..00000000 --- a/dist/common/async-validator/index.js +++ /dev/null @@ -1,258 +0,0 @@ -import { format, complementError, asyncMap, warning, deepMerge } from './util.js'; -import validators from './validator/index.js'; -import { messages as defaultMessages, newMessages } from './messages.js'; - -/** - * Encapsulates a validation schema. - * - * @param descriptor An object declaring validation rules - * for this schema. - */ -function Schema(descriptor) { - this.rules = null; - this._messages = defaultMessages; - this.define(descriptor); -} - -Schema.prototype = { - messages(messages) { - if (messages) { - this._messages = deepMerge(newMessages(), messages); - } - return this._messages; - }, - define(rules) { - if (!rules) { - throw new Error( - 'Cannot configure a schema with no rules'); - } - if (typeof rules !== 'object' || Array.isArray(rules)) { - throw new Error('Rules must be an object'); - } - this.rules = {}; - let z; - let item; - for (z in rules) { - if (rules.hasOwnProperty(z)) { - item = rules[z]; - this.rules[z] = Array.isArray(item) ? item : [item]; - } - } - }, - validate(source_, o = {}, oc) { - let source = source_; - let options = o; - let callback = oc; - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (!this.rules || Object.keys(this.rules).length === 0) { - if (callback) { - callback(); - } - return; - } - function complete(results) { - let i; - let field; - let errors = []; - let fields = {}; - - function add(e) { - if (Array.isArray(e)) { - errors = errors.concat.apply(errors, e); - } else { - errors.push(e); - } - } - - for (i = 0; i < results.length; i++) { - add(results[i]); - } - if (!errors.length) { - errors = null; - fields = null; - } else { - for (i = 0; i < errors.length; i++) { - field = errors[i].field; - fields[field] = fields[field] || []; - fields[field].push(errors[i]); - } - } - callback(errors, fields); - } - - if (options.messages) { - let messages = this.messages(); - if (messages === defaultMessages) { - messages = newMessages(); - } - deepMerge(messages, options.messages); - options.messages = messages; - } else { - options.messages = this.messages(); - } - let arr; - let value; - const series = {}; - const keys = options.keys || Object.keys(this.rules); - keys.forEach((z) => { - arr = this.rules[z]; - value = source[z]; - arr.forEach((r) => { - let rule = r; - if (typeof (rule.transform) === 'function') { - if (source === source_) { - source = { ...source }; - } - value = source[z] = rule.transform(value); - } - if (typeof (rule) === 'function') { - rule = { - validator: rule, - }; - } else { - rule = { ...rule }; - } - rule.validator = this.getValidationMethod(rule); - rule.field = z; - rule.fullField = rule.fullField || z; - rule.type = this.getType(rule); - if (!rule.validator) { - return; - } - series[z] = series[z] || []; - series[z].push({ - rule, - value, - source, - field: z, - }); - }); - }); - const errorFields = {}; - asyncMap(series, options, (data, doIt) => { - const rule = data.rule; - let deep = (rule.type === 'object' || rule.type === 'array') && - (typeof (rule.fields) === 'object' || typeof (rule.defaultField) === 'object'); - deep = deep && (rule.required || (!rule.required && data.value)); - rule.field = data.field; - function addFullfield(key, schema) { - return { - ...schema, - fullField: `${rule.fullField}.${key}`, - }; - } - - function cb(e = []) { - let errors = e; - if (!Array.isArray(errors)) { - errors = [errors]; - } - if (errors.length) { - warning('async-validator:', errors); - } - if (errors.length && rule.message) { - errors = [].concat(rule.message); - } - - errors = errors.map(complementError(rule)); - - if (options.first && errors.length) { - errorFields[rule.field] = 1; - return doIt(errors); - } - if (!deep) { - doIt(errors); - } else { - // if rule is required but the target object - // does not exist fail at the rule level and don't - // go deeper - if (rule.required && !data.value) { - if (rule.message) { - errors = [].concat(rule.message).map(complementError(rule)); - } else if (options.error) { - errors = [options.error(rule, format(options.messages.required, rule.field))]; - } else { - errors = []; - } - return doIt(errors); - } - - let fieldsSchema = {}; - if (rule.defaultField) { - for (const k in data.value) { - if (data.value.hasOwnProperty(k)) { - fieldsSchema[k] = rule.defaultField; - } - } - } - fieldsSchema = { - ...fieldsSchema, - ...data.rule.fields, - }; - for (const f in fieldsSchema) { - if (fieldsSchema.hasOwnProperty(f)) { - const fieldSchema = Array.isArray(fieldsSchema[f]) ? - fieldsSchema[f] : [fieldsSchema[f]]; - fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f)); - } - } - const schema = new Schema(fieldsSchema); - schema.messages(options.messages); - if (data.rule.options) { - data.rule.options.messages = options.messages; - data.rule.options.error = options.error; - } - schema.validate(data.value, data.rule.options || options, (errs) => { - doIt(errs && errs.length ? errors.concat(errs) : errs); - }); - } - } - - const res = rule.validator( - rule, data.value, cb, data.source, options); - if (res && res.then) { - res.then(() => cb(), e => cb(e)); - } - }, (results) => { - complete(results); - }); - }, - getType(rule) { - if (rule.type === undefined && (rule.pattern instanceof RegExp)) { - rule.type = 'pattern'; - } - if (typeof (rule.validator) !== 'function' && - (rule.type && !validators.hasOwnProperty(rule.type))) { - throw new Error(format('Unknown rule type %s', rule.type)); - } - return rule.type || 'string'; - }, - getValidationMethod(rule) { - if (typeof rule.validator === 'function') { - return rule.validator; - } - const keys = Object.keys(rule); - const messageIndex = keys.indexOf('message'); - if (messageIndex !== -1) { - keys.splice(messageIndex, 1); - } - if (keys.length === 1 && keys[0] === 'required') { - return validators.required; - } - return validators[this.getType(rule)] || false; - }, -}; - -Schema.register = function register(type, validator) { - if (typeof validator !== 'function') { - throw new Error('Cannot register a validator by type, validator is not a function'); - } - validators[type] = validator; -}; - -Schema.messages = defaultMessages; - -export default Schema; diff --git a/dist/common/async-validator/messages.js b/dist/common/async-validator/messages.js deleted file mode 100644 index 5117ce43..00000000 --- a/dist/common/async-validator/messages.js +++ /dev/null @@ -1,56 +0,0 @@ -export function newMessages() { - return { - default: 'Validation error on field %s', - required: '%s is required', - enum: '%s must be one of %s', - whitespace: '%s cannot be empty', - date: { - format: '%s date %s is invalid for format %s', - parse: '%s date could not be parsed, %s is invalid ', - invalid: '%s date %s is invalid', - }, - types: { - string: '%s is not a %s', - method: '%s is not a %s (function)', - array: '%s is not an %s', - object: '%s is not an %s', - number: '%s is not a %s', - date: '%s is not a %s', - boolean: '%s is not a %s', - integer: '%s is not an %s', - float: '%s is not a %s', - regexp: '%s is not a valid %s', - email: '%s is not a valid %s', - url: '%s is not a valid %s', - hex: '%s is not a valid %s', - }, - string: { - len: '%s must be exactly %s characters', - min: '%s must be at least %s characters', - max: '%s cannot be longer than %s characters', - range: '%s must be between %s and %s characters', - }, - number: { - len: '%s must equal %s', - min: '%s cannot be less than %s', - max: '%s cannot be greater than %s', - range: '%s must be between %s and %s', - }, - array: { - len: '%s must be exactly %s in length', - min: '%s cannot be less than %s in length', - max: '%s cannot be greater than %s in length', - range: '%s must be between %s and %s in length', - }, - pattern: { - mismatch: '%s value %s does not match pattern %s', - }, - clone() { - const cloned = JSON.parse(JSON.stringify(this)); - cloned.clone = this.clone; - return cloned; - }, - }; -} - -export const messages = newMessages(); diff --git a/dist/common/async-validator/rule/enum.js b/dist/common/async-validator/rule/enum.js deleted file mode 100644 index 00f0e1ca..00000000 --- a/dist/common/async-validator/rule/enum.js +++ /dev/null @@ -1,22 +0,0 @@ -import * as util from '../util'; -const ENUM = 'enum'; - -/** - * Rule for validating a value exists in an enumerable list. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param source The source object being validated. - * @param errors An array of errors that this rule may add - * validation errors to. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function enumerable(rule, value, source, errors, options) { - rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : []; - if (rule[ENUM].indexOf(value) === -1) { - errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', '))); - } -} - -export default enumerable; diff --git a/dist/common/async-validator/rule/index.js b/dist/common/async-validator/rule/index.js deleted file mode 100644 index 05572e85..00000000 --- a/dist/common/async-validator/rule/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import required from './required.js'; -import whitespace from './whitespace.js'; -import type from './type.js'; -import range from './range.js'; -import enumRule from './enum.js'; -import pattern from './pattern.js'; - -export default { - required, - whitespace, - type, - range, - enum: enumRule, - pattern, -}; diff --git a/dist/common/async-validator/rule/pattern.js b/dist/common/async-validator/rule/pattern.js deleted file mode 100644 index 3dbe780f..00000000 --- a/dist/common/async-validator/rule/pattern.js +++ /dev/null @@ -1,36 +0,0 @@ -import * as util from '../util'; - -/** - * Rule for validating a regular expression pattern. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param source The source object being validated. - * @param errors An array of errors that this rule may add - * validation errors to. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function pattern(rule, value, source, errors, options) { - if (rule.pattern) { - if (rule.pattern instanceof RegExp) { - // if a RegExp instance is passed, reset `lastIndex` in case its `global` - // flag is accidentally set to `true`, which in a validation scenario - // is not necessary and the result might be misleading - rule.pattern.lastIndex = 0; - if (!rule.pattern.test(value)) { - errors.push(util.format(options.messages.pattern.mismatch, - rule.fullField, value, rule.pattern)); - } - } else if (typeof rule.pattern === 'string') { - - const _pattern = new RegExp(rule.pattern.replace(/^\/|\/$/g,'')); - if (!_pattern.test(value)) { - errors.push(util.format(options.messages.pattern.mismatch, - rule.fullField, value, rule.pattern)); - } - } - } -} - -export default pattern; diff --git a/dist/common/async-validator/rule/range.js b/dist/common/async-validator/rule/range.js deleted file mode 100644 index 2b50a402..00000000 --- a/dist/common/async-validator/rule/range.js +++ /dev/null @@ -1,59 +0,0 @@ -import * as util from '../util'; - -/** - * Rule for validating minimum and maximum allowed values. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param source The source object being validated. - * @param errors An array of errors that this rule may add - * validation errors to. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function range(rule, value, source, errors, options) { - const len = typeof rule.len === 'number'; - const min = typeof rule.min === 'number'; - const max = typeof rule.max === 'number'; - // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane) - const spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - let val = value; - let key = null; - const num = typeof (value) === 'number'; - const str = typeof (value) === 'string'; - const arr = Array.isArray(value); - if (num) { - key = 'number'; - } else if (str) { - key = 'string'; - } else if (arr) { - key = 'array'; - } - // if the value is not of a supported type for range validation - // the validation rule rule should use the - // type property to also test for a particular type - if (!key) { - return false; - } - if (arr) { - val = value.length; - } - if (str) { - // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3 - val = value.replace(spRegexp, '_').length; - } - if (len) { - if (val !== rule.len) { - errors.push(util.format(options.messages[key].len, rule.fullField, rule.len)); - } - } else if (min && !max && val < rule.min) { - errors.push(util.format(options.messages[key].min, rule.fullField, rule.min)); - } else if (max && !min && val > rule.max) { - errors.push(util.format(options.messages[key].max, rule.fullField, rule.max)); - } else if (min && max && (val < rule.min || val > rule.max)) { - errors.push(util.format(options.messages[key].range, - rule.fullField, rule.min, rule.max)); - } -} - -export default range; diff --git a/dist/common/async-validator/rule/required.js b/dist/common/async-validator/rule/required.js deleted file mode 100644 index 4d9b409b..00000000 --- a/dist/common/async-validator/rule/required.js +++ /dev/null @@ -1,21 +0,0 @@ -import * as util from '../util'; - -/** - * Rule for validating required fields. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param source The source object being validated. - * @param errors An array of errors that this rule may add - * validation errors to. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function required(rule, value, source, errors, options, type) { - if (rule.required && - (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) { - errors.push(util.format(options.messages.required, rule.fullField)); - } -} - -export default required; diff --git a/dist/common/async-validator/rule/type.js b/dist/common/async-validator/rule/type.js deleted file mode 100644 index d6a50d56..00000000 --- a/dist/common/async-validator/rule/type.js +++ /dev/null @@ -1,91 +0,0 @@ -import * as util from '../util'; -import required from './required'; - -/* eslint max-len:0 */ - -const pattern = { - // http://emailregex.com/ - email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, - url: new RegExp('^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', 'i'), - hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i, -}; - -const types = { - integer(value) { - return types.number(value) && parseInt(value, 10) === value; - }, - float(value) { - return types.number(value) && !types.integer(value); - }, - array(value) { - return Array.isArray(value); - }, - regexp(value) { - if (value instanceof RegExp) { - return true; - } - try { - return !!new RegExp(value); - } catch (e) { - return false; - } - }, - date(value) { - return typeof value.getTime === 'function' && - typeof value.getMonth === 'function' && - typeof value.getYear === 'function'; - }, - number(value) { - if (isNaN(value) || value === '') { - return false; - } - return true; - }, - object(value) { - return typeof (value) === 'object' && !types.array(value); - }, - method(value) { - return typeof (value) === 'function'; - }, - email(value) { - return typeof (value) === 'string' && !!value.match(pattern.email) && value.length < 255; - }, - url(value) { - return typeof (value) === 'string' && !!value.match(pattern.url); - }, - hex(value) { - return typeof (value) === 'string' && !!value.match(pattern.hex); - }, -}; - -/** - * Rule for validating the type of a value. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param source The source object being validated. - * @param errors An array of errors that this rule may add - * validation errors to. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function type(rule, value, source, errors, options) { - if (rule.required && value === undefined) { - required(rule, value, source, errors, options); - return; - } - const custom = ['integer', 'float', 'array', 'regexp', 'object', - 'method', 'email', 'number', 'date', 'url', 'hex' - ]; - const ruleType = rule.type; - if (custom.indexOf(ruleType) > -1) { - if (!types[ruleType](value)) { - errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type)); - } - // straight typeof check - } else if (ruleType && typeof (value) !== rule.type) { - errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type)); - } -} - -export default type; \ No newline at end of file diff --git a/dist/common/async-validator/rule/whitespace.js b/dist/common/async-validator/rule/whitespace.js deleted file mode 100644 index 0433723b..00000000 --- a/dist/common/async-validator/rule/whitespace.js +++ /dev/null @@ -1,20 +0,0 @@ -import * as util from '../util'; - -/** - * Rule for validating whitespace. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param source The source object being validated. - * @param errors An array of errors that this rule may add - * validation errors to. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function whitespace(rule, value, source, errors, options) { - if (/^\s+$/.test(value) || value === '') { - errors.push(util.format(options.messages.whitespace, rule.fullField)); - } -} - -export default whitespace; diff --git a/dist/common/async-validator/util.js b/dist/common/async-validator/util.js deleted file mode 100644 index adf25efe..00000000 --- a/dist/common/async-validator/util.js +++ /dev/null @@ -1,177 +0,0 @@ -const formatRegExp = /%[sdj%]/g; - -export let warning = () => { -}; - -export function format(...args) { - let i = 1; - const f = args[0]; - const len = args.length; - if (typeof f === 'function') { - return f.apply(null, args.slice(1)); - } - if (typeof f === 'string') { - let str = String(f).replace(formatRegExp, (x) => { - if (x === '%%') { - return '%'; - } - if (i >= len) { - return x; - } - switch (x) { - case '%s': - return String(args[i++]); - case '%d': - return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - break; - default: - return x; - } - }); - for (let arg = args[i]; i < len; arg = args[++i]) { - str += ` ${arg}`; - } - return str; - } - return f; -} - -function isNativeStringType(type) { - return type === 'string' || - type === 'url' || - type === 'hex' || - type === 'email' || - type === 'pattern'; -} - -export function isEmptyValue(value, type) { - if (value === undefined || value === null) { - return true; - } - if (type === 'array' && Array.isArray(value) && !value.length) { - return true; - } - if (isNativeStringType(type) && typeof value === 'string' && !value) { - return true; - } - return false; -} - -export function isEmptyObject(obj) { - return Object.keys(obj).length === 0; -} - -function asyncParallelArray(arr, func, callback) { - const results = []; - let total = 0; - const arrLength = arr.length; - - function count(errors) { - results.push.apply(results, errors); - total++; - if (total === arrLength) { - callback(results); - } - } - - arr.forEach((a) => { - func(a, count); - }); -} - -function asyncSerialArray(arr, func, callback) { - let index = 0; - const arrLength = arr.length; - - function next(errors) { - if (errors && errors.length) { - callback(errors); - return; - } - const original = index; - index = index + 1; - if (original < arrLength) { - func(arr[original], next); - } else { - callback([]); - } - } - - next([]); -} - -function flattenObjArr(objArr) { - const ret = []; - Object.keys(objArr).forEach((k) => { - ret.push.apply(ret, objArr[k]); - }); - return ret; -} - -export function asyncMap(objArr, option, func, callback) { - if (option.first) { - const flattenArr = flattenObjArr(objArr); - return asyncSerialArray(flattenArr, func, callback); - } - let firstFields = option.firstFields || []; - if (firstFields === true) { - firstFields = Object.keys(objArr); - } - const objArrKeys = Object.keys(objArr); - const objArrLength = objArrKeys.length; - let total = 0; - const results = []; - const next = (errors) => { - results.push.apply(results, errors); - total++; - if (total === objArrLength) { - callback(results); - } - }; - objArrKeys.forEach((key) => { - const arr = objArr[key]; - if (firstFields.indexOf(key) !== -1) { - asyncSerialArray(arr, func, next); - } else { - asyncParallelArray(arr, func, next); - } - }); -} - -export function complementError(rule) { - return (oe) => { - if (oe && oe.message) { - oe.field = oe.field || rule.fullField; - return oe; - } - return { - message: oe, - field: oe.field || rule.fullField, - }; - }; -} - -export function deepMerge(target, source) { - if (source) { - for (const s in source) { - if (source.hasOwnProperty(s)) { - const value = source[s]; - if (typeof value === 'object' && typeof target[s] === 'object') { - target[s] = { - ...target[s], - ...value, - }; - } else { - target[s] = value; - } - } - } - } - return target; -} diff --git a/dist/common/async-validator/validator/array.js b/dist/common/async-validator/validator/array.js deleted file mode 100644 index 57551242..00000000 --- a/dist/common/async-validator/validator/array.js +++ /dev/null @@ -1,29 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; -/** - * Validates an array. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function array(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value, 'array') && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options, 'array'); - if (!isEmptyValue(value, 'array')) { - rules.type(rule, value, source, errors, options); - rules.range(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default array; diff --git a/dist/common/async-validator/validator/boolean.js b/dist/common/async-validator/validator/boolean.js deleted file mode 100644 index 74daa786..00000000 --- a/dist/common/async-validator/validator/boolean.js +++ /dev/null @@ -1,29 +0,0 @@ -import { isEmptyValue } from '../util'; -import rules from '../rule/index.js'; - -/** - * Validates a boolean. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function boolean(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (value !== undefined) { - rules.type(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default boolean; diff --git a/dist/common/async-validator/validator/date.js b/dist/common/async-validator/validator/date.js deleted file mode 100644 index 9ac063a3..00000000 --- a/dist/common/async-validator/validator/date.js +++ /dev/null @@ -1,32 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -function date(rule, value, callback, source, options) { - // console.log('integer rule called %j', rule); - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - // console.log('validate on %s value', value); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (!isEmptyValue(value)) { - let dateObject; - - if (typeof value === 'number') { - dateObject = new Date(value); - } else { - dateObject = value; - } - - rules.type(rule, dateObject, source, errors, options); - if (dateObject) { - rules.range(rule, dateObject.getTime(), source, errors, options); - } - } - } - callback(errors); -} - -export default date; diff --git a/dist/common/async-validator/validator/enum.js b/dist/common/async-validator/validator/enum.js deleted file mode 100644 index 20e1a2c4..00000000 --- a/dist/common/async-validator/validator/enum.js +++ /dev/null @@ -1,30 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; -const ENUM = 'enum'; - -/** - * Validates an enumerable list. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function enumerable(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (value) { - rules[ENUM](rule, value, source, errors, options); - } - } - callback(errors); -} - -export default enumerable; diff --git a/dist/common/async-validator/validator/float.js b/dist/common/async-validator/validator/float.js deleted file mode 100644 index 13b4993e..00000000 --- a/dist/common/async-validator/validator/float.js +++ /dev/null @@ -1,30 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Validates a number is a floating point number. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function floatFn(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (value !== undefined) { - rules.type(rule, value, source, errors, options); - rules.range(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default floatFn; diff --git a/dist/common/async-validator/validator/index.js b/dist/common/async-validator/validator/index.js deleted file mode 100644 index 148bca51..00000000 --- a/dist/common/async-validator/validator/index.js +++ /dev/null @@ -1,33 +0,0 @@ -import string from './string'; -import method from './method'; -import number from './number'; -import boolean from './boolean'; -import regexp from './regexp'; -import integer from './integer'; -import float from './float'; -import array from './array'; -import object from './object'; -import enumValidator from './enum'; -import pattern from './pattern'; -import date from './date'; -import required from './required'; -import type from './type'; - -export default { - string, - method, - number, - boolean, - regexp, - integer, - float, - array, - object, - enum: enumValidator, - pattern, - date, - url: type, - hex: type, - email: type, - required, -}; diff --git a/dist/common/async-validator/validator/integer.js b/dist/common/async-validator/validator/integer.js deleted file mode 100644 index 5444e30f..00000000 --- a/dist/common/async-validator/validator/integer.js +++ /dev/null @@ -1,30 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Validates a number is an integer. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function integer(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (value !== undefined) { - rules.type(rule, value, source, errors, options); - rules.range(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default integer; diff --git a/dist/common/async-validator/validator/method.js b/dist/common/async-validator/validator/method.js deleted file mode 100644 index 9ef0cbe8..00000000 --- a/dist/common/async-validator/validator/method.js +++ /dev/null @@ -1,29 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Validates a function. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function method(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (value !== undefined) { - rules.type(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default method; diff --git a/dist/common/async-validator/validator/number.js b/dist/common/async-validator/validator/number.js deleted file mode 100644 index c7b2a190..00000000 --- a/dist/common/async-validator/validator/number.js +++ /dev/null @@ -1,30 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Validates a number. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function number(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (value !== undefined) { - rules.type(rule, value, source, errors, options); - rules.range(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default number; diff --git a/dist/common/async-validator/validator/object.js b/dist/common/async-validator/validator/object.js deleted file mode 100644 index 93afef56..00000000 --- a/dist/common/async-validator/validator/object.js +++ /dev/null @@ -1,29 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Validates an object. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function object(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (value !== undefined) { - rules.type(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default object; diff --git a/dist/common/async-validator/validator/pattern.js b/dist/common/async-validator/validator/pattern.js deleted file mode 100644 index f1b980cc..00000000 --- a/dist/common/async-validator/validator/pattern.js +++ /dev/null @@ -1,32 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Validates a regular expression pattern. - * - * Performs validation when a rule only contains - * a pattern property but is not declared as a string type. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function pattern(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value, 'string') && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (!isEmptyValue(value, 'string')) { - rules.pattern(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default pattern; diff --git a/dist/common/async-validator/validator/regexp.js b/dist/common/async-validator/validator/regexp.js deleted file mode 100644 index c68883b1..00000000 --- a/dist/common/async-validator/validator/regexp.js +++ /dev/null @@ -1,29 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Validates the regular expression type. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function regexp(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options); - if (!isEmptyValue(value)) { - rules.type(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default regexp; diff --git a/dist/common/async-validator/validator/required.js b/dist/common/async-validator/validator/required.js deleted file mode 100644 index 00e6d015..00000000 --- a/dist/common/async-validator/validator/required.js +++ /dev/null @@ -1,10 +0,0 @@ -import rules from '../rule/index.js'; - -function required(rule, value, callback, source, options) { - const errors = []; - const type = Array.isArray(value) ? 'array' : typeof value; - rules.required(rule, value, source, errors, options, type); - callback(errors); -} - -export default required; diff --git a/dist/common/async-validator/validator/string.js b/dist/common/async-validator/validator/string.js deleted file mode 100644 index 411fee79..00000000 --- a/dist/common/async-validator/validator/string.js +++ /dev/null @@ -1,34 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -/** - * Performs validation for string types. - * - * @param rule The validation rule. - * @param value The value of the field on the source object. - * @param callback The callback function. - * @param source The source object being validated. - * @param options The validation options. - * @param options.messages The validation messages. - */ -function string(rule, value, callback, source, options) { - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value, 'string') && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options, 'string'); - if (!isEmptyValue(value, 'string')) { - rules.type(rule, value, source, errors, options); - rules.range(rule, value, source, errors, options); - rules.pattern(rule, value, source, errors, options); - if (rule.whitespace === true) { - rules.whitespace(rule, value, source, errors, options); - } - } - } - callback(errors); -} - -export default string; diff --git a/dist/common/async-validator/validator/type.js b/dist/common/async-validator/validator/type.js deleted file mode 100644 index 79a05fad..00000000 --- a/dist/common/async-validator/validator/type.js +++ /dev/null @@ -1,20 +0,0 @@ -import rules from '../rule/index.js'; -import { isEmptyValue } from '../util'; - -function type(rule, value, callback, source, options) { - const ruleType = rule.type; - const errors = []; - const validate = rule.required || (!rule.required && source.hasOwnProperty(rule.field)); - if (validate) { - if (isEmptyValue(value, ruleType) && !rule.required) { - return callback(); - } - rules.required(rule, value, source, errors, options, ruleType); - if (!isEmptyValue(value, ruleType)) { - rules.type(rule, value, source, errors, options); - } - } - callback(errors); -} - -export default type; diff --git a/dist/count-selector/index.js b/dist/count-selector/index.js deleted file mode 100644 index f7dfe4ac..00000000 --- a/dist/count-selector/index.js +++ /dev/null @@ -1,107 +0,0 @@ -Component({ - externalClasses: [ - 'l-class', - 'l-symbol-class', - 'l-count-class', - 'l-disabled-class' - ], - properties: { - count: { - type: Number, - value: 1 - }, - max: { - type: Number, - value: 10000 - }, - min: { - type: Number, - value: 1 - }, - step: { - type: Number, - value: 1 - }, - disabled: Boolean - }, - - /** - * 组件的初始数据 - */ - data: { - - }, - - /** - * 组件的方法列表 - */ - methods: { - doNothing() { }, - - onBlur(e) { - let { - value - } = e.detail - setTimeout(() => { - 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) - }, - - reduceTap() { - let distance = this.data.count - this.properties.step - if (distance <= this.properties.min) { - this.data.count = this.properties.min - } else { - this.data.count -= this.properties.step - } - this.setData({ - count: this.data.count - }) - let detail = { - count: this.data.count, - type: 'reduce' - } - this.triggerEvent('lintap', detail) - }, - - addTap() { - let distance = this.data.count + this.properties.step; - if (distance >= 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) - }, - } -}) \ No newline at end of file diff --git a/dist/count-selector/index.json b/dist/count-selector/index.json deleted file mode 100644 index c01e2d7e..00000000 --- a/dist/count-selector/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon":"../icon/index" - } -} \ No newline at end of file diff --git a/dist/count-selector/index.wxml b/dist/count-selector/index.wxml deleted file mode 100644 index aa3ac934..00000000 --- a/dist/count-selector/index.wxml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - + - - \ No newline at end of file diff --git a/dist/count-selector/index.wxss b/dist/count-selector/index.wxss deleted file mode 100644 index 136bafc0..00000000 --- a/dist/count-selector/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center} \ No newline at end of file diff --git a/dist/countdown/index.js b/dist/countdown/index.js deleted file mode 100644 index 5b2182be..00000000 --- a/dist/countdown/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import countDownBehavios from '../behaviors/countdown'; -Component({ - externalClasses: ['l-class','l-class-time'], - behaviors:[countDownBehavios], - properties: { - doneText:{ - type:String, - value:'已结束' - } - }, - methods: { - - } -}); \ No newline at end of file diff --git a/dist/countdown/index.json b/dist/countdown/index.json deleted file mode 100644 index a32a1284..00000000 --- a/dist/countdown/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - - } - } \ No newline at end of file diff --git a/dist/countdown/index.wxml b/dist/countdown/index.wxml deleted file mode 100644 index 721a4c1d..00000000 --- a/dist/countdown/index.wxml +++ /dev/null @@ -1,3 +0,0 @@ - - {{item.value}}{{item.name}} - \ No newline at end of file diff --git a/dist/countdown/index.wxss b/dist/countdown/index.wxss deleted file mode 100644 index da502685..00000000 --- a/dist/countdown/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.l-countdown{font-size:28rpx;line-height:40px}.l-countdown-item{display:inline-block;color:inherit}.l-countdown-time{display:inline-flex;width:56rpx;height:56rpx;background:#45526b;border-radius:4rpx;color:#fff;align-items:center;justify-content:center;margin:0 16rpx} \ No newline at end of file diff --git a/dist/custom-tab-bar/index.js b/dist/custom-tab-bar/index.js deleted file mode 100644 index a3309a04..00000000 --- a/dist/custom-tab-bar/index.js +++ /dev/null @@ -1,121 +0,0 @@ -Component({ - properties: { - position: { - type: String, - value: 'bottom' - }, - show: { - type: Boolean, - value: true - }, - selected: { - type: Number, - value: 0 - }, - color: { - type: String, - value: '#707070' - }, - selectedColor: { - type: String, - value: '3963BC' - }, - borderStyle: { - type: String, - value: '#f6f6f6' - }, - backgroundColor: { - type: String, - value: '#fff' - }, - backgroundImg: { - type: String, - value: '' - }, - fontSize: { - type: Number, - value: 24 - }, - isRedirectToTab: { - type: Boolean, - value: true - }, - // 是否跳转 - isNav: { - type: Boolean, - value: true - }, - list: { - type: Array, - value: [] - } - }, - data: {}, - attached() {}, - - methods: { - switchTab(e) { - const data = e.currentTarget.dataset - const url = data.path - if (this.data.isNav) { - if (this.data.isRedirectToTab) { - wx.switchTab({ - url - }) - } else { - wx.switchTab({ - url - }) - } - } - - - this.showItem(data.index) - }, - show() { - this.setData({ - show: true - }) - }, - hide() { - this.setData({ - show: false - }) - }, - showItem(idx) { - this.setData({ - selected: idx - }) - let detail = { - idx, - path:this.route - }; - let option = {}; - this.triggerEvent('lintap', detail, option); - }, - showRedDot(idx) { - const redDot = `list[${idx}].redDot` - this.setData({ - [redDot]: true - }) - }, - hideRedDot(idx) { - const redDot = `list[${idx}].redDot` - this.setData({ - [redDot]: false - }) - }, - setTabBarBadge(idx, text) { - const badge = `list[${idx}].badge` - this.setData({ - [badge]: text - }) - }, - removeTabBarBadge(idx) { - const badge = `list[${idx}].badge` - this.setData({ - [badge]: '' - }) - } - } -}) \ No newline at end of file diff --git a/dist/custom-tab-bar/index.json b/dist/custom-tab-bar/index.json deleted file mode 100644 index 32640e0d..00000000 --- a/dist/custom-tab-bar/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} \ No newline at end of file diff --git a/dist/custom-tab-bar/index.wxml b/dist/custom-tab-bar/index.wxml deleted file mode 100644 index 48bf52b7..00000000 --- a/dist/custom-tab-bar/index.wxml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - {{item.text}} - - {{item.badge}} - - \ No newline at end of file diff --git a/dist/custom-tab-bar/index.wxss b/dist/custom-tab-bar/index.wxss deleted file mode 100644 index b12c5746..00000000 --- a/dist/custom-tab-bar/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.tab-bar{position:relative;height:110rpx;width:750rpx;background:#fff;display:flex;flex-direction:row;background-position:center center;background-size:100% 100%;padding-bottom:env(safe-area-inset-bottom)}.tab-bar-bottom{position:fixed!important;bottom:0;left:0;right:0}.tab-bar-border{position:absolute;left:0;top:0;width:100%;display:flex;flex-direction:row;height:1rpx;background:#f6f6f6;box-shadow:0 -1px 3px 1px #f6f6f6}.tab-bar-item{position:relative;flex:1;text-align:center;display:flex;justify-content:center;align-items:center;flex-direction:column}.item-circle{width:120rpx;height:60rpx;background-color:#fff;border-radius:200rpx 200rpx 0 0;border-bottom:none;background:#fff;position:absolute;top:-40rpx;box-shadow:0 -1px 1px 0 #f6f6f6}.tab-bar-item-image{width:64rpx;height:64rpx}.tab-bar-item view{font-size:24rpx}.reddot{height:20rpx;width:20rpx;background:red;border-radius:50%;position:absolute;top:15rpx;margin-left:25rpx}.badge{height:32rpx;line-height:32rpx;padding:0rpx 6rpx;background:red;border-radius:16rpx;position:absolute;font-size:18rpx;color:#fff;top:10rpx;margin-left:25rpx;box-sizing:border-box}.center-circle{height:100rpx;width:100rpx;border-radius:50%;position:absolute;top:-30rpx} \ No newline at end of file diff --git a/dist/dialog/index.js b/dist/dialog/index.js deleted file mode 100644 index 805c9426..00000000 --- a/dist/dialog/index.js +++ /dev/null @@ -1,189 +0,0 @@ -// dialog -Component({ - /** - * 组件的属性列表 - */ - externalClasses: ['l-class', 'l-class-title', 'l-class-content', 'l-class-confirm', 'l-class-cancel'], - properties: { - // 显示与隐藏 - show: { - type: Boolean, - value: false - }, - // 类型 【 alert: 提示框, confrim: 确认框 】 - type: { - type: String, - value: 'alert' - }, - // 标题文字 - title: { - type: String, - value: '提示' - }, - // 是否显示标题 - showTitle: { - type: Boolean, - value: true - }, - // 内容 - content: { - type: String, - value: '' - }, - // 锁定 - locked: { - type: Boolean, - value: true - }, - // 确定按钮的文本 - confirmText: { - type: String, - value: '确定' - }, - // 确定按钮的颜色 - confirmColor: { - type: String, - value: '#3683d6' - }, - // 取消按钮的文本 - cancelText: { - type: String, - value: '取消' - }, - cancelColor: { - type: String, - value: '#45526b' - }, - openApi: { - type: Boolean, - value: true - } - }, - data: { - success: null, - fail: null, - }, - /** - * 组件的初始数据 - */ - attached() { - if (this.data.openApi) { - this.initDialog(); - } - }, - - lifetimes: { - show() { - if (this.data.openApi) { - this.initDialog(); - } - }, - }, - - /** - * 组件的方法列表 - */ - methods: { - initDialog() { - const config = { - type: 'alert', - title: '提示', - showTitle: true, - content: '', - locked: true, - confirmText: '确定', - cancelColor: '#3683d6', - cancelText: '取消', - confirmColor: '#45526b', - success: null, - fail: null, - } - wx.lin = wx.lin || {}; - wx.lin.showDialog = (options) => { - const { - type = config.type, - title = config.title, - showTitle = config.showTitle, - content = config.content, - locked = config.locked, - confirmText = config.confirmText, - cancelColor = config.cancelColor, - cancelText = config.cancelText, - confirmColor = config.confirmColor, - success = config.success, - fail = config.fail, - } = options; - this.setData({ - type, - title, - showTitle, - content, - locked, - confirmText, - cancelColor, - cancelText, - confirmColor, - show: true, - fail, - success - }); - return this; - }; - }, - - // 确定按钮 - onConfirmTap(e) { - let detail = 'confirm'; - let option = {}; - - const { - success - } = this.data; - success && success({ - confirm: true, - cancel: false, - errMsg: 'showDialog: success' - }); - this.setData({ - show: !this.data.show - }) - this.triggerEvent('linconfirm', detail, option); - - }, - - // 取消按钮 - onCancelTap(e) { - - let detail = 'cancel'; - let option = {}; - - const { - success - } = this.data; - success && success({ - confirm: false, - cancel: true, - errMsg: 'showDialog: success' - }); - this.setData({ - show: !this.data.show - }) - - this.triggerEvent('lincancel', detail, option); - }, - - // 背景点击事件 - onDialogTap(e) { - let detail = true; - let option = {}; - - if (this.data.locked !== true) { - this.setData({ - show: !this.data.show - }) - } - - this.triggerEvent('lintap', detail, option); - } - } -}) \ No newline at end of file diff --git a/dist/dialog/index.json b/dist/dialog/index.json deleted file mode 100644 index e72f4f50..00000000 --- a/dist/dialog/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-popup": "../popup/index" - } -} \ No newline at end of file diff --git a/dist/dialog/index.wxml b/dist/dialog/index.wxml deleted file mode 100644 index 13fc29da..00000000 --- a/dist/dialog/index.wxml +++ /dev/null @@ -1,29 +0,0 @@ - - - - {{title}} - - - {{content}} - - - {{cancelText}} - {{confirmText}} - - - \ No newline at end of file diff --git a/dist/dialog/index.wxss b/dist/dialog/index.wxss deleted file mode 100644 index f9f558e6..00000000 --- a/dist/dialog/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.dialog-container{display:flex;flex-direction:column;align-items:center;width:520rpx;background:#fff;border-radius:12rpx}.dialog-title{font-size:32rpx;font-family:PingFangSC-Regular;color:#45526b;line-height:44rpx;margin-top:30rpx;padding:0 25rpx;text-align:center}.dialog-content{font-size:28rpx;font-family:PingFangSC-Regular;color:#596c8e;line-height:40rpx;margin-top:30rpx;margin-bottom:30rpx;display:flex;flex-direction:column;align-items:center;padding:0 25rpx}.dialog-btn-group{width:100%;height:80rpx;display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-top:2rpx solid #f3f3f3}.dialog-btn-cancel{font-size:28rpx;height:80rpx;width:259rpx;border-right:2rpx solid #f3f3f3;display:flex;flex-direction:row;align-items:center;justify-content:center}.dialog-btn-confirm{font-size:28rpx;flex:1;color:#3963bc;height:80rpx;display:flex;flex-direction:row;align-items:center;justify-content:center}.active{color:#3683d6}.leave{color:#45526b} \ No newline at end of file diff --git a/dist/error-tip/index.js b/dist/error-tip/index.js deleted file mode 100644 index 81e566a5..00000000 --- a/dist/error-tip/index.js +++ /dev/null @@ -1,24 +0,0 @@ -Component({ - /** - * 组件的属性列表 - */ - externalClasses: ['l-error-text'], - - properties: { - errorText:String - }, - - /** - * 组件的初始数据 - */ - data: { - - }, - - /** - * 组件的方法列表 - */ - methods: { - - } - }) \ No newline at end of file diff --git a/dist/error-tip/index.json b/dist/error-tip/index.json deleted file mode 100644 index a1d9113f..00000000 --- a/dist/error-tip/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - - } - } \ No newline at end of file diff --git a/dist/error-tip/index.wxml b/dist/error-tip/index.wxml deleted file mode 100644 index cf548380..00000000 --- a/dist/error-tip/index.wxml +++ /dev/null @@ -1 +0,0 @@ -{{errorText}} \ No newline at end of file diff --git a/dist/error-tip/index.wxss b/dist/error-tip/index.wxss deleted file mode 100644 index 38f29e36..00000000 --- a/dist/error-tip/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.error-text{font-size:22rpx;color:#f4516c;margin-right:20rpx;line-height:2} \ No newline at end of file diff --git a/dist/filter/array.wxs b/dist/filter/array.wxs deleted file mode 100644 index 745c6fdb..00000000 --- a/dist/filter/array.wxs +++ /dev/null @@ -1,174 +0,0 @@ -var is = require("./is.wxs"); - -function _isArray(targetArray, funName) { - if (!is.isArray(targetArray)) { - console.log('[WXS:Array]' + funName + ',targetArray must be array'); - return false; - }; - return true; -} - -/** - * concat 合并数组 - * @param {Array} targetArray 目标数组 - */ -function concat() { - var length = arguments.length; - var result = []; - var validatorArray = _isArray(arguments[0], 'concat'); - if (validatorArray) { - for (var i = 1; i < length; i++) { - result = arguments[0].concat(arguments[i]) - } - return result - } -} - -/** - * join 数组转成字符串 - * @param {Array} targetArray 目标数组 - * @param {String} spearator 连接符 - */ -function join(targetArray, spearator) { - var validatorArray = _isArray(arguments[0], 'concat'); - if (validatorArray) return targetArray.join(spearator); -} - -/** - * pop 移除最后一个数组元素,并返回移除后的数组和溢出的值 - * @param {Array} targetArray 目标数组 - */ -function pop(targetArray) { - var validatorArray = _isArray(arguments[0], 'pop'); - if (validatorArray) { - var result = targetArray.pop(); - return { - newArray: targetArray, - item: result - } - } -} - -/** - * shift 移除第一个数组元素,并返回移除后的数组和溢出的值 - * @param {Array} targetArray 目标数组 - */ -function shift(targetArray) { - var validatorArray = _isArray(arguments[0], 'shift'); - if (validatorArray) { - var result = targetArray.shift(); - return { - newArray: targetArray, - item: result - } - } -} - -/** - * push 从后追加数组元素,并返回新的数组 - * @param {Array} targetArray 目标数组 - */ -function push() { - var length = arguments.length; - var validatorArray = _isArray(arguments[0], 'push'); - if (validatorArray) { - for (var i = 1; i < length; i++) { - arguments[0].push(arguments[i]) - } - return arguments[0] - } -} - -/** - * unshift 从前追加数组元素,并返回新的数组 - * @param {Array} targetArray 目标数组 - */ -function unshift(targetArray) { - var length = arguments.length; - var validatorArray = _isArray(arguments[0], 'unshift'); - if (validatorArray) { - for (var i = length - 1; i > 0; i--) { - arguments[0].unshift(arguments[i]) - } - return arguments[0] - } -} -/** - * reverse 倒序 - * @param {Array} targetArray 目标数组 - */ -function reverse(targetArray) { - var validatorArray = _isArray(targetArray, 'reverse'); - if (validatorArray) return targetArray.reverse(); -} - -/** - * slice 截取数组 - * @param {Array} targetArray 目标数组 - * @param {Number} beginSlice 从该索引(以 0 为基数)处开始提取目标数组中的元素 - * @param {Number} endSlice 在该索引(以 0 为基数)处结束提取数组元素 - */ -function slice(targetArray, beginSlice, endSlice) { - var validatorArray = _isArray(targetArray, 'slice'); - if (validatorArray) return targetArray.slice(beginSlice, endSlice); -} - -/** - * splice 截取数组 - * @param {Array} targetArray 目标数组 - * @param {Number} start - * @param {Number} deleteCount - */ -function splice(targetArray, start, deleteCount) { - var validatorArray = _isArray(targetArray, 'splice'); - if (validatorArray) { - if (arguments.length < 4) { - targetArray.splice(start, deleteCount); - } else { - targetArray.splice(start, deleteCount, arguments[3]); - var length = arguments.length; - for (var i = 4; i < length; i++) { - arguments[i] && targetArray.splice(++start, 0, arguments[i]) - } - } - return targetArray - } -} - -/** - * indexOf 查找数组 - * @param {Array} targetArray 目标数组 - * @param {String} searchValue 被查找的值 - * @param {Number} fromIndex 开始查找的位置 - * - */ -function indexOf(targetArray, searchValue, fromIndex = 0) { - var validatorArray = _isArray(targetArray, 'indexOf'); - if (validatorArray) return targetArray.indexOf(searchValue, fromIndex); -} - -/** - * lastIndexOf 查找字符串最后出现的位置 - * @param {Array} targetArray 目标数组 - * @param {String} searchValue 被查找的值 - * @param {Number} fromIndex 开始查找的位置,str.length - * - */ -function lastIndexOf(targetArray, searchValue, fromIndex = 0) { - var validatorArray = _isArray(targetArray, 'lastIndexOf'); - if (validatorArray) return targetArray.lastIndexOf(searchValue, fromIndex || targetArray.length); -} - -module.exports = { - concat: concat, - join: join, - pop: pop, - shift: shift, - push: push, - unshift: unshift, - reverse: reverse, - slice: slice, - splice: splice, - indexOf:indexOf, - lastIndexOf:lastIndexOf -} \ No newline at end of file diff --git a/dist/filter/classnames.wxs b/dist/filter/classnames.wxs deleted file mode 100644 index a83cbe0e..00000000 --- a/dist/filter/classnames.wxs +++ /dev/null @@ -1,33 +0,0 @@ -var is = require('./is.wxs'); -var object = require('./object.wxs'); - -function apply(fun, args) { - return args.map(function (item) { - return fun(item) - }) -} - -function classnames() { - var classes = []; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - if (is.isString(arg) || is.isNumber(arg)) { - classes.push(arg); - } else if (is.isArray(arg) && arg.length) { - var inner = apply(classnames, arg); - if (inner) { - classes.push(inner); - } - } else if (is.isObject(arg)) { - object.keys(arg).forEach(function (key) { - if (arg[key]) { - classes.push(key); - } - }) - } - } - return classes.join(' '); -} - -module.exports = classnames; diff --git a/dist/filter/is.wxs b/dist/filter/is.wxs deleted file mode 100644 index 9841e592..00000000 --- a/dist/filter/is.wxs +++ /dev/null @@ -1,70 +0,0 @@ -var TYPE = { - NULL: 'null', - UNDEFINED: 'undefined', - NUMBER: 'Number', - STRING: 'String', - BOOLEAN: 'Boolean', - OBJECT: 'Object', - FUNCTION: 'Function', - ARRAY: 'Array', - DATE: 'Date', - REGEXP: 'RegExp', -} - -function isUndefined(val) { - return TYPE.UNDEFINED === typeof val; -} - -function isNull(val) { - return val === TYPE.NULL; -} - -function _jadgeFun(val, type) { - if (isUndefined(val) || isNull(val)) return false; - return TYPE[type] === val.constructor; -} - -function isNumber(val) { - return _jadgeFun(val, 'NUMBER'); -} - -function isString(val) { - return _jadgeFun(val, 'STRING'); -} - -function isBoolean(val) { - return _jadgeFun(val, 'BOOLEAN'); -} - -function isObject(val) { - return _jadgeFun(val, 'OBJECT'); -} - -function isFunction(val) { - return _jadgeFun(val, 'FUNCTION'); -} - -function isArray(val) { - return _jadgeFun(val, 'ARRAY'); -} - -function isDate(val) { - return _jadgeFun(val, 'DATE'); -} - -function isRegExp(val) { - return _jadgeFun(val, 'REGEXP'); -} - -module.exports = { - isNull: isNull, - isUndefined: isUndefined, - isNumber: isNumber, - isString: isString, - isBoolean: isBoolean, - isObject: isObject, - isFunction: isFunction, - isArray: isArray, - isDate: isDate, - isRegExp: isRegExp -} \ No newline at end of file diff --git a/dist/filter/object.wxs b/dist/filter/object.wxs deleted file mode 100644 index 244fe4fd..00000000 --- a/dist/filter/object.wxs +++ /dev/null @@ -1,12 +0,0 @@ -var REGEXP = getRegExp('{|}|"', 'g'); - -function keys(obj) { - return JSON.stringify(obj) - .replace(REGEXP, '') - .split(',') - .map(function(item) { - return item.split(':')[0]; - }); -} - -module.exports.keys = keys; \ No newline at end of file diff --git a/dist/filter/string.wxs b/dist/filter/string.wxs deleted file mode 100644 index e6ce0dcc..00000000 --- a/dist/filter/string.wxs +++ /dev/null @@ -1,178 +0,0 @@ -var is = require("./is.wxs"); - -function _isString(targetString, funName) { - if (!is.isString(targetString)) { - console.log('[WXS:String]' + funName + ',targetString must be string'); - return false; - }; - return true; -} -/** - * toString 返回指定对象的字符串形式 - * @param {String} targetString 目标字符串 - */ - -function toString(targetString) { - return targetString && targetString.toString(); -} - -/** - * valueOf 返回指定对象的value - * @param {String} targetString 目标字符串 - */ - -function valueOf(targetString) { - return targetString && targetString.valueOf(); -} - -/** - * charAt 一个字符串中返回指定的字符。 - * @param {String} targetString 目标字符串 - * @param {Number} index 返回指定字符的位置 - * - */ -function charAt(targetString, index = 0) { - var validatorString = _isString(targetString, 'charAt'); - if (validatorString) return targetString.charAt(index); -} - -/** - * charCodeAt 返回0到65535之间的整数,表示给定索引处的UTF-16代码单元 - * @param {String} targetString 目标字符串 - * @param {Number} index 返回指定字符的位置 - * - */ -function charCodeAt(targetString, index = 0) { - var validatorString = _isString(targetString, 'charCodeAt'); - if (validatorString) return targetString.charCodeAt(index); -} - -/** - * indexOf 查找字符串 - * @param {String} targetString 目标字符串 - * @param {String} searchValue 被查找的值 - * @param {Number} fromIndex 开始查找的位置 - * - */ -function indexOf(targetString, searchValue, fromIndex = 0) { - var validatorString = _isString(targetString, 'indexOf'); - if (validatorString) return targetString.indexOf(searchValue, fromIndex); -} - -/** - * lastIndexOf 查找字符串最后出现的位置 - * @param {String} targetString 目标字符串 - * @param {String} searchValue 被查找的值 - * @param {Number} fromIndex 开始查找的位置,str.length - * - */ -function lastIndexOf(targetString, searchValue, fromIndex = 0) { - var validatorString = _isString(targetString, 'lastIndexOf'); - if (validatorString) return targetString.lastIndexOf(searchValue, fromIndex || targetString.length); -} - -/** - * slice 取一个字符串的一部分,并返回一新的字符串 - * @param {String} targetString 目标字符串 - * @param {Number} beginSlice 从该索引(以 0 为基数)处开始提取原字符串中的字符 - * @param {Number} endSlice 在该索引(以 0 为基数)处结束提取字符 - * - */ -function slice(targetString, beginSlice, endSlice) { - var validatorString = _isString(targetString, 'slice'); - if (validatorString) return targetString.slice(beginSlice, endSlice || targetString.length); -} - -/** - * split 分割字符串 - * @param {String} targetString 目标字符串 - * @param {String} separator 从该索引(以 0 为基数)处开始提取原字符串中的字符 - * @param {Number} limit - * - */ -function split(targetString, separator, limit) { - var validatorString = _isString(targetString, 'split'); - if (validatorString) return targetString.split(separator, limit); -} - -/** - * substring 取一个字符串的一部分,并返回一新的字符串 - * @param {String} targetString 目标字符串 - * @param {Number} indexStart 需要截取的第一个字符的索引,该字符作为返回的字符串的首字母。 - * @param {Number} indexEnd 一个 0 到字符串长度之间的整数,以该数字为索引的字符不包含在截取的字符串内。 - * - */ -function substring(targetString, indexStart, indexEnd) { - var validatorString = _isString(targetString, 'substring'); - if (validatorString) return targetString.substring(indexStart, indexEnd); -} - -/** - * toLowerCase 字符串值转为小写形式 - * @param {String} targetString 目标字符串 - * - */ -function toLowerCase(targetString) { - var validatorString = _isString(targetString, 'toLowerCase'); - if (validatorString) return targetString.toLowerCase(); -} - -/** - * toLocaleLowerCase 字符串值转为小写形式 - * @param {String} targetString 目标字符串 - * - */ -function toLocaleLowerCase(targetString) { - var validatorString = _isString(targetString, 'toLocaleLowerCase'); - if (validatorString) return targetString.toLocaleLowerCase(); -} - -/** - * toUpperCase 字符串值转为大写形式 - * @param {String} targetString 目标字符串 - * - */ -function toUpperCase(targetString) { - var validatorString = _isString(targetString, 'toUpperCase'); - if (validatorString) return targetString.toUpperCase(); -} - -/** - * toLocaleUpperCase 根据任何特定于语言环境的案例映射,返回调用字符串值转换为大写的值。 - * @param {String} targetString 目标字符串 - * - */ -function toLocaleUpperCase(targetString) { - var validatorString = _isString(targetString, 'toLocaleUpperCase'); - if (validatorString) return targetString.toLocaleUpperCase(); -} - -/** - * trim 从一个字符串的两端删除空白字符 - * @param {String} targetString 目标字符串 - * - */ -function trim(targetString) { - var validatorString = _isString(targetString, 'trim'); - if (validatorString) return targetString.trim(); -} - - - - -module.exports = { - indexOf: indexOf, - charAt: charAt, - charCodeAt: charCodeAt, - toString: toString, - valueOf: valueOf, - lastIndexOf: lastIndexOf, - slice: slice, - split: split, - substring: substring, - toLowerCase: toLowerCase, - toLocaleLowerCase: toLocaleLowerCase, - toUpperCase: toUpperCase, - toLocaleUpperCase: toLocaleUpperCase, - trim: trim -} \ No newline at end of file diff --git a/dist/filter/zero-padding.wxs b/dist/filter/zero-padding.wxs deleted file mode 100644 index a6b4eb07..00000000 --- a/dist/filter/zero-padding.wxs +++ /dev/null @@ -1,8 +0,0 @@ -function zeroPadding(num, length = 2) { - if((num + "").length >= length) { - return num; - } - return zeroPadding("0" + num, length) -} - -module.exports = zeroPadding; \ No newline at end of file diff --git a/dist/grid-item/index.js b/dist/grid-item/index.js deleted file mode 100644 index ff43aec6..00000000 --- a/dist/grid-item/index.js +++ /dev/null @@ -1,30 +0,0 @@ -Component({ - relations: { - '../grid/index': { - type: 'parent' - }, - }, - externalClasses: ['l-grid-item'], - properties: { - key: String - }, - data: {}, - attached() { - - }, - - lifetimes: { - show() { - - }, - }, - methods: { - tapGridItem(e) { - this.triggerEvent('lintap', { - ...e - }, { - composed: true - }) - }, - } -}); \ No newline at end of file diff --git a/dist/grid-item/index.json b/dist/grid-item/index.json deleted file mode 100644 index 7a47d16b..00000000 --- a/dist/grid-item/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - - } -} \ No newline at end of file diff --git a/dist/grid-item/index.wxml b/dist/grid-item/index.wxml deleted file mode 100644 index 40eb25fd..00000000 --- a/dist/grid-item/index.wxml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/dist/grid-item/index.wxss b/dist/grid-item/index.wxss deleted file mode 100644 index f7b12733..00000000 --- a/dist/grid-item/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.grid-item{max-width:initial;max-height:initial;display:flex;justify-content:center;align-items:center;flex-direction:column} \ No newline at end of file diff --git a/dist/grid/index.js b/dist/grid/index.js deleted file mode 100644 index 7dd1f849..00000000 --- a/dist/grid/index.js +++ /dev/null @@ -1,76 +0,0 @@ -Component({ - options: { - multipleSlots: true // 在组件定义时的选项中启用多slot支持 - }, - relations: { - '../grid-item/index': { - type: 'child', - linked(target) { - this.initGrids(); - - }, - unlinked(target) { - this.initGrids(); - } - }, - - }, - externalClasses: ['l-class', 'l-class-grid'], - properties: { - rowNum: { - type: String, - value: 3, - }, - showBorder: Boolean, - showColBorder: Boolean, - showRowBorder: Boolean, - }, - data: { - gridItems: [], - childNum: 0, - currentIndex:null, - }, - ready() { - this.initGrids(); - }, - - lifetimes: { - show() { - - }, - }, - methods: { - initGrids() { - let items = this.getRelationNodes('../grid-item/index'); - if (this.data.childNum === items.length) return; - const gridItems = items.map((item) => { - return { - key: item.data.key - } - }); - this.setData({ - gridItems: gridItems, - childNum: items.length - }) - }, - - tapGridItem(e) { - const { - index - } = e.currentTarget.dataset; - this.setData({ - currentIndex:index - }); - let items = this.getRelationNodes('../grid-item/index'); - items[index].tapGridItem({ - index: index - }); - }, - - tapGrid(e) { - this.triggerEvent('lintap', { - index:this.data.currentIndex - }) - } - } -}); \ No newline at end of file diff --git a/dist/grid/index.json b/dist/grid/index.json deleted file mode 100644 index 93860eac..00000000 --- a/dist/grid/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-grid-item":"../grid-item/index" - } - } \ No newline at end of file diff --git a/dist/grid/index.wxml b/dist/grid/index.wxml deleted file mode 100644 index 37cf4520..00000000 --- a/dist/grid/index.wxml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/dist/grid/index.wxss b/dist/grid/index.wxss deleted file mode 100644 index a21aecd5..00000000 --- a/dist/grid/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.l-grid{display:flex;width:inherit;flex-wrap:wrap}.l-grid .l-grid-item{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;border-style:solid;border-color:#ededed;border-width:0}.l-grid .center-grid{border-bottom-width:2rpx}.l-grid .side-grid{border-right-width:2rpx} \ No newline at end of file diff --git a/dist/icon/index.js b/dist/icon/index.js deleted file mode 100644 index ba35df51..00000000 --- a/dist/icon/index.js +++ /dev/null @@ -1,35 +0,0 @@ -Component({ - externalClasses: ['l-class','l-class-self',], - options: { - addGlobalClass: true, - }, - properties: { - name: { - type: String, - value: '' - }, - color: { - type: String, - value: '', - }, - size: { - type: String, - value: '', - }, - }, - - data:{ - default:{ - size:40, - color:'#45526B', - }, - }, - - ready:function(){ - if(!this.data.name) { - console.error('请传入Icon组件的name属性'); - } - }, - methods: { - } -}); diff --git a/dist/icon/index.json b/dist/icon/index.json deleted file mode 100644 index 8bc8f183..00000000 --- a/dist/icon/index.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "component": true, - "usingComponents": { - - } - } \ No newline at end of file diff --git a/dist/icon/index.wxml b/dist/icon/index.wxml deleted file mode 100644 index d78e60c1..00000000 --- a/dist/icon/index.wxml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/dist/icon/index.wxss b/dist/icon/index.wxss deleted file mode 100644 index d6ee90a3..00000000 --- a/dist/icon/index.wxss +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:iconfont;src:url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABicAAsAAAAALSwAABhMAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCHbgrEILVkATYCJAOBPAtgAAQgBYRtB4M8G8gkRUaGjQNAIG1zEdWaLvv/ksCNoVINtb+E7URYlSBXILpVTQeLjoqbHJ+cOfYf4maEM/uA9haOGSSs3/uUE+JFWzyOOSQJTR74P/zdN/+aZUXRpGn7eBR1AprgbSqQwKM00IS2wPcfLvffrca8MadAkWwNPNBEIwqwwBqe3+b/ufdioHgvugYuIKwChZW6SdnMjJWJneiivzEXsIqnmIF7zxXq1m9+cYFj5Vy4uXzvLaAAAgLAoLoF7TUHO+qdzi0mQ+hQ0R75b3QMtQcIhPbO21YvGfltw+p7yErFZrZicq4HWJdvzgXaW9LeQrBdZ3z1iyoDlXt9m2Z/4dj776KkaHKW2/6rv2sCD6MNRowkJ5P/01m21l0QqutQISxqLLv5I2lX8+cbZ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Zqvd6fb6g+FoPJnO5ovlar3Z7vYHm9NKJfBwpQR2meUyhpQEqtM5xMstSHqutOViEBtiZcUYC+IFaRRivxY0c4lv7Utc1XiBbBVypYhNQoXBIZFN0ErlkCbhR1JX0iGHK8tIi3ce6Qpqf8YdYyECly13V5HNVbrgQ2OjTDEYcRtYEmQkEqQ2Tz2o3qqduIUFY6doq+Clr7VuqTUOQnOxieUVQWIZeuGGUWF2ZdBpDG3QEh58XWNkNYFTXpMzWvBs1DfGW0X2p7W7//SD3Kq9wkBlu7JqQR4eAAAA') format('woff2')}.l-icon{font-family:iconfont;font-size:40rpx;color:#3963bc;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.l-icon::before{display:inline-flex}.l-icon-finish:before{content:"\e63c"}.l-icon-mistake:before{content:"\e632"}.l-icon-video:before{content:"\e609"}.l-icon-address:before{content:"\e606"}.l-icon-backward:before{content:"\e607"}.l-icon-add:before{content:"\e608"}.l-icon-cart:before{content:"\e60a"}.l-icon-close:before{content:"\e60b"}.l-icon-checked:before{content:"\e60c"}.l-icon-comment:before,.l-icon-default:before{content:"\e60d"}.l-icon-down:before{content:"\e60e"}.l-icon-customer-service:before{content:"\e60f"}.l-icon-delete:before{content:"\e610"}.l-icon-edit:before{content:"\e611"}.l-icon-download:before{content:"\e612"}.l-icon-ellipsis:before{content:"\e613"}.l-icon-favor:before{content:"\e614"}.l-icon-forward:before{content:"\e615"}.l-icon-help:before{content:"\e616"}.l-icon-eye:before{content:"\e617"}.l-icon-history:before{content:"\e618"}.l-icon-left:before{content:"\e619"}.l-icon-like:before{content:"\e61a"}.l-icon-notification:before{content:"\e61b"}.l-icon-order:before{content:"\e61c"}.l-icon-loading:before{content:"\e61d"}.l-icon-password:before{content:"\e61e"}.l-icon-more:before{content:"\e61f"}.l-icon-picture:before{content:"\e620"}.l-icon-pull-down:before{content:"\e621"}.l-icon-right:before{content:"\e622"}.l-icon-research:before{content:"\e623"}.l-icon-phone:before{content:"\e624"}.l-icon-setting:before{content:"\e625"}.l-icon-scan:before{content:"\e626"}.l-icon-share:before{content:"\e627"}.l-icon-success:before{content:"\e628"}.l-icon-soud:before{content:"\e629"}.l-icon-time:before{content:"\e62a"}.l-icon-error:before{content:"\e62b"}.l-icon-to-top:before{content:"\e62c"}.l-icon-up:before{content:"\e62d"}.l-icon-WiFi:before{content:"\e62e"}.l-icon-user:before{content:"\e62f"}.l-icon-warning:before{content:"\e630"}.l-icon-favor-fill:before{content:"\e631"} \ No newline at end of file diff --git a/dist/image-picker/image/add.png b/dist/image-picker/image/add.png deleted file mode 100644 index 4253bd3e..00000000 Binary files a/dist/image-picker/image/add.png and /dev/null differ diff --git a/dist/image-picker/index.js b/dist/image-picker/index.js deleted file mode 100644 index cc486e28..00000000 --- a/dist/image-picker/index.js +++ /dev/null @@ -1,178 +0,0 @@ -// mask -Component({ - /** - * 组件的属性列表 - */ - externalClasses: ['l-class', 'l-item-class'], - behaviors: ['wx://form-field'], - properties: { - urls: { - type: Array, - value: [] - }, - // 最多可以选择的图片张数 - count: { - type: [String, Number], - value: 9 - }, - // 清除urls - clear: { - type: Boolean, - value: false, - observer: function (newVal, oldVal, changedPath) { - if (newVal) { - this.handleClear(); - } - } - }, - // 每行可显示的个数 - size: { - type: [String, Number], - value: 3 - }, - // 所选的图片的尺寸 ['original', 'compressed'] - sizeType: { - type: String, - value: 'original', - }, - // 选择图片的来源 - // sourceType: { - // type: String, - // value: '', - // }, - // 图片裁剪、缩放的模式 - mode: { - type: String, - value: 'aspectFit', // 参考微信小程序 image 组件的mode属性列表 - }, - // 设置是否传入slot - custom: { - type: Boolean, - value: false - }, - // 是否可以预览 - isPreview: { - type: Boolean, - value: true - } - }, - - /** - * 组件的初始数据 - */ - data: { - showBtn: true, - tempFilePath: '', - }, - - /** - * 组件的方法列表 - */ - methods: { - handleClear() { - this.setData({ - urls: [], - clear: false, - showBtn: true - }) - let detail = true; - let option = {}; - this.triggerEvent('linclear', detail, option); - }, - - // 预览 preview - onPreviewTap(e) { - const that = this - const index = e.currentTarget.dataset.index - const tempFilePath = this.data.urls[index] - let detail = { - index, // 下标 - current: tempFilePath, // 当前显示图片的http链接 - all: that.data.urls // 需要预览的图片http链接列表 - }; - let option = {}; - if (this.data.isPreview === true) { - wx.previewImage({ - current: tempFilePath, // 当前显示图片的http链接 - urls: that.data.urls // 需要预览的图片http链接列表 - }) - } - this.triggerEvent('linpreview', detail, option); - }, - - - // 增加 add - onAddTap(e) { - const that = this - const count = this.data.count - this.data.urls.length - if (count === 0 ) { - return - } - wx.chooseImage({ - count, - sizeType: this.data.sizeType, - sourceType: ['album', 'camera'], - success(res) { - // tempFilePath可以作为img标签的src属性显示图片 - const tempFilePath = res.tempFilePaths - const newtempFilePaths = that.data.urls.concat(tempFilePath) - // 判断是否还能继续添加图片 - if (newtempFilePaths.length === parseInt(that.data.count)) { - that.setData({ - showBtn: false - }) - } - that.setData({ - urls: newtempFilePaths, - value: newtempFilePaths, - tempFilePath - }) - let detail = { - current: tempFilePath, - all: newtempFilePaths - } - let option = {}; - - that.triggerEvent('linchange', detail, option); - } - }) - - }, - - // 删除 remove - onDelTap(e) { - const index = e.currentTarget.dataset.index - const urls = this.data.urls - const tempFilePath = urls[index] - const tempFilePaths = this.handleSplice(urls, tempFilePath) - // 判断是否还能继续添加图片 - if (tempFilePaths.length < parseInt(this.data.count)) { - this.setData({ - showBtn: true - }) - } - this.setData({ - tempFilePath, - urls: tempFilePaths, - value: tempFilePaths, - }) - let detail = { - index, - current: tempFilePath, - all: tempFilePaths - } - let option = {}; - - this.triggerEvent('linremove', detail, option); - - }, - handleSplice(arr, current) { - const newArr = arr.filter(item => item!== current) - return newArr - }, - - }, - - attached: function () { - }, -}) diff --git a/dist/image-picker/index.json b/dist/image-picker/index.json deleted file mode 100644 index af2d0be8..00000000 --- a/dist/image-picker/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon": "../icon/index", - "l-grid-item": "../grid-item/index", - "l-grid": "../grid/index" - } -} \ No newline at end of file diff --git a/dist/image-picker/index.wxml b/dist/image-picker/index.wxml deleted file mode 100644 index c7db0d14..00000000 --- a/dist/image-picker/index.wxml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dist/image-picker/index.wxss b/dist/image-picker/index.wxss deleted file mode 100644 index a4b4d8a2..00000000 --- a/dist/image-picker/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.item{position:relative}.close{position:absolute;right:10rpx;top:10rpx;height:40rpx;width:40rpx;border-radius:50%;background:rgba(0,0,0,.4);display:flex;flex-direction:row;align-items:center;justify-content:center;box-sizing:border-box;z-index:99}.add{height:220rpx;width:220rpx;border:1rpx solid #eee;border-radius:4rpx;display:flex;flex-direction:row;align-items:center;justify-content:center}.add-icon{height:100rpx;width:100rpx}.img{height:220rpx;width:220rpx;margin-bottom:10rpx;border:1rpx solid #eee;border-radius:4rpx;display:flex;flex-direction:row;align-items:center;justify-content:center}.min-img{height:160rpx;width:160rpx;margin-bottom:10rpx;border:1rpx solid #eee;border-radius:4rpx;display:flex;flex-direction:row;align-items:center;justify-content:center}.flex{border:1rpx solid #eee;border-radius:4rpx;display:flex;flex-direction:row;align-items:center;justify-content:center} \ No newline at end of file diff --git a/dist/input/index.js b/dist/input/index.js deleted file mode 100644 index 8f0e0040..00000000 --- a/dist/input/index.js +++ /dev/null @@ -1,156 +0,0 @@ -// input/input.js -import rules from '../behaviors/rules'; - -Component({ - /** - * 组件的属性列表 - */ - options: { - multipleSlots: true, - }, - behaviors: ['wx://form-field', rules], - externalClasses: ['l-class', 'l-label-class','l-error-text'], - properties: { - // 表单标题(label)的文本 - label: { - type: String, - value: '' - }, - // 是否自定义label部分 - labelCustom: { - type: Boolean, - value: false - }, - // 是否显示下划线 - showRow: { - type: Boolean, - value: true - }, - // 是否必选 - required: { - type: Boolean, - value: false - }, - // 占位文本 - placeholder: { - type: String, - value: '' - }, - // 输入框类型 - type: { - type: String, - value: 'text' - }, - // 输入框的值 - value: { - type: String, - value: '' - }, - // 是否需要冒号 - colon: { - type: Boolean, - value: false - }, - // 获取焦点 - focus: { - type: Boolean, - value: false - }, - // 是否显示清除按钮 - clear: { - type: Boolean, - value: false - }, - // 最大输入长度 - maxlength: { - type: Number, - value: 140 - }, - // 表单项的宽度,单位rpx - width: { - type: Number, - value: 750 - }, - // 表单项标题部分的宽度,单位rpx - labelWidth: { - type: Number, - value: 200 - }, - // label标题的显示位置 left top right - labelLayout: { - type: String, - value: 'left' - }, - // 是否禁用 - disabled: { - type: Boolean, - value: false - }, - // 占位文字的样式 - placeholderStyle: { - type: String, - value: '' - }, - }, - - /** - * 组件的初始数据 - */ - data: { - - }, - attached() { - this.initRules(); - }, - /** - * 组件的方法列表 - */ - methods: { - - handleInputChange(event) { - const { - detail = {} - } = event; - const { - value = '' - } = detail; - - this.setData({ - value - }); - - this.triggerEvent('linchange', event); - }, - - handleInputFocus(event) { - this.triggerEvent('linfocus', event); - }, - - handleInputBlur(event) { - this.validatorData({ - value: event.detail.value - }); - this.triggerEvent('linblur', event); - }, - handleInputConfirm(event) { - const { - detail = {} - } = event; - const { - value = '' - } = detail; - - this.setData({ - value - }); - - this.triggerEvent('linconfirm', event); - }, - onClearTap(event) { - this.setData({ - value: '' - }) - this.triggerEvent('linclear', event); - }, - } -}) \ No newline at end of file diff --git a/dist/input/index.json b/dist/input/index.json deleted file mode 100644 index fe1a1ffd..00000000 --- a/dist/input/index.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon": "../icon/index", - "l-error-tip":"../error-tip/index" - } -} \ No newline at end of file diff --git a/dist/input/index.wxml b/dist/input/index.wxml deleted file mode 100644 index a0c401a5..00000000 --- a/dist/input/index.wxml +++ /dev/null @@ -1,37 +0,0 @@ - - \ No newline at end of file diff --git a/dist/input/index.wxss b/dist/input/index.wxss deleted file mode 100644 index dcd24895..00000000 --- a/dist/input/index.wxss +++ /dev/null @@ -1 +0,0 @@ -.form-item{position:relative;font-size:28rpx;color:#333;width:750rpx;height:88rpx;display:flex;flex-direction:row;align-items:center;padding-right:25rpx;box-sizing:border-box}.row{position:absolute;bottom:0;right:0;height:2rpx;width:730rpx;background:#f3f3f3}.text-require{color:#e23;vertical-align:middle}.form-label{display:flex;flex-direction:row;align-items:center;height:88rpx;padding-left:25rpx;padding-right:15rpx;box-sizing:border-box}.disabled{color:#9a9a9a!important}.mask{position:absolute;z-index:999;height:100%;width:100%}.form-label-right{justify-content:flex-end}.form-label-left{justify-content:flex-start}.input{height:100%;line-height:100%;flex:1}.close{height:36rpx;width:36rpx;background:#ddd;display:flex;flex-direction:row;align-items:center;justify-content:center;border-radius:50%;margin-right:20rpx}.pls-class{color:#9a9a9a} \ No newline at end of file diff --git a/dist/list/index.js b/dist/list/index.js deleted file mode 100644 index 75728a45..00000000 --- a/dist/list/index.js +++ /dev/null @@ -1,83 +0,0 @@ -Component({ - relations: { - '../list/index': { - type: 'parent', // 关联的目标节点应为子节点 - linked(target) { - // 每次有custom-li被插入时执行,target是该节点实例对象,触发在该节点attached生命周期之后 - }, - linkChanged(target) { - // 每次有custom-li被移动后执行,target是该节点实例对象,触发在该节点moved生命周期之后 - }, - unlinked(target) { - // 每次有custom-li被移除时执行,target是该节点实例对象,触发在该节点detached生命周期之后 - } - } - }, - - options: { - multipleSlots: true - }, - externalClasses: ['l-class', 'l-class-icon', 'l-class-image','l-class-right','l-class-content','l-class-desc'], - properties: { - icon: String, - image: String, - title: String, - desc: String, - tagPosition: { - type: String, - value: 'left' - }, - tagContent: String, - tagShape: { - type: String, - value: 'square' - }, - tagColor: String, - tagPlain: Boolean, - badgePosition: { - type: String, - value: 'left' - }, - dotBadge: Boolean, - badgeCount: Number, - badgeMaxCount: { - type: Number, - value: 99 - }, - badgeCountType: { - type: String, - value: 'overflow' - }, - rightDesc: String, - gap: Number, - leftGap: Number, - rightGap: Number, - isLink: { - type: Boolean, - value: true, - }, - linkType: { - type: String, - value: 'navigateTo' - }, - url: String - - }, - - methods: { - tapcell: function (e) { - const { - linkType, - url - } = e.currentTarget.dataset; - if (url) { - wx[linkType]({ - url - }); - } - this.triggerEvent('lintap', { - e - }, {}) - } - } -}); \ No newline at end of file diff --git a/dist/list/index.json b/dist/list/index.json deleted file mode 100644 index 0dd8908d..00000000 --- a/dist/list/index.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "component": true, - "usingComponents": { - "l-icon":"../icon/index", - "l-badge":"../badge/index", - "l-tag":"../tag/index" - } - } \ No newline at end of file diff --git a/dist/list/index.wxml b/dist/list/index.wxml deleted file mode 100644 index 58293312..00000000 --- a/dist/list/index.wxml +++ /dev/null @@ -1,34 +0,0 @@ - - - -