diff --git a/dist/actionsheet/index.js b/dist/actionsheet/index.js new file mode 100644 index 00000000..65d2d8b3 --- /dev/null +++ b/dist/actionsheet/index.js @@ -0,0 +1,38 @@ +'use strict'; + +Component({ + properties: { + show: Boolean, + title: String, + cancelText: String, + actions: { + type: Array, + value: [] + }, + overlay: { + type: Boolean, + value: true + }, + closeOnClickOverlay: { + type: Boolean, + value: true + } + }, + + methods: { + onSelect: function onSelect(event) { + var index = event.currentTarget.dataset.index; + + var item = this.data.actions[index]; + if (item && !item.disabled && !item.loading) { + this.triggerEvent('select', item); + } + }, + onCancel: function onCancel() { + this.triggerEvent('cancel'); + }, + onClose: function onClose() { + this.triggerEvent('close'); + } + } +}); \ No newline at end of file diff --git a/dist/actionsheet/index.json b/dist/actionsheet/index.json new file mode 100644 index 00000000..19bf9891 --- /dev/null +++ b/dist/actionsheet/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-popup": "../popup/index", + "van-loading": "../loading/index" + } +} diff --git a/dist/actionsheet/index.wxml b/dist/actionsheet/index.wxml new file mode 100644 index 00000000..a4dbfed8 --- /dev/null +++ b/dist/actionsheet/index.wxml @@ -0,0 +1,38 @@ + + + {{ title }} + + + + + + {{ item.name }} + {{ item.subname }} + + + + + + {{ cancelText }} + + + + + diff --git a/dist/actionsheet/index.wxss b/dist/actionsheet/index.wxss new file mode 100644 index 00000000..8a179935 --- /dev/null +++ b/dist/actionsheet/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-actionsheet{color:#333;max-height:90%;overflow-y:auto;-webkit-overflow-scrolling:touch;background-color:#f8f8f8}.van-actionsheet--withtitle{background-color:#fff}.van-actionsheet__cancel,.van-actionsheet__item{height:50px;line-height:50px;font-size:16px;text-align:center;background-color:#fff}.van-actionsheet__cancel:active,.van-actionsheet__item:active{background-color:#e8e8e8}.van-actionsheet__item--disabled{color:#c9c9c9}.van-actionsheet__item--disabled:active{background-color:#fff}.van-actionsheet__subname{font-size:12px;color:#666;margin-left:5px}.van-actionsheet__loading{display:inline-block}.van-actionsheet__cancel{margin-top:10px}.van-actionsheet__header{font-size:16px;line-height:44px;text-align:center}.van-actionsheet__close{top:0;right:0;padding:0 15px;font-size:18px;color:#999;position:absolute;line-height:inherit} \ No newline at end of file diff --git a/dist/badge-group/index.js b/dist/badge-group/index.js new file mode 100644 index 00000000..eafd75bc --- /dev/null +++ b/dist/badge-group/index.js @@ -0,0 +1,66 @@ +'use strict'; + +var _relations; + +var BADGE_PATH = '../badge/index'; + +Component({ + externalClasses: ['custom-class'], + + relations: (_relations = {}, _relations[BADGE_PATH] = { + type: 'descendant', + + linked: function linked(target) { + this.data.badges.push(target); + this.setActive(); + }, + unlinked: function unlinked(target) { + this.data.badges = this.data.badges.filter(function (item) { + return item !== target; + }); + this.setActive(); + } + }, _relations), + + properties: { + active: { + type: Number, + value: 0, + observer: function observer() { + this.setActive(); + } + } + }, + + data: { + badges: [] + }, + + attached: function attached() { + this.currentActive = -1; + }, + + + methods: { + setActive: function setActive(badge) { + var active = this.data.active; + + if (badge) { + active = this.data.badges.indexOf(badge); + } + + if (active === this.currentActive) { + return; + } + + if (this.currentActive !== -1) { + this.triggerEvent('change', active); + } + + this.currentActive = active; + this.data.badges.forEach(function (badge, index) { + badge.setActive(index === active); + }); + } + } +}); \ No newline at end of file diff --git a/dist/badge-group/index.json b/dist/badge-group/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/dist/badge-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/badge-group/index.wxml b/dist/badge-group/index.wxml new file mode 100644 index 00000000..04a0c8f3 --- /dev/null +++ b/dist/badge-group/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/dist/badge-group/index.wxss b/dist/badge-group/index.wxss new file mode 100644 index 00000000..d2575469 --- /dev/null +++ b/dist/badge-group/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-badge-group{width:85px} \ No newline at end of file diff --git a/dist/badge/index.js b/dist/badge/index.js new file mode 100644 index 00000000..173780da --- /dev/null +++ b/dist/badge/index.js @@ -0,0 +1,30 @@ +'use strict'; + +var _relations; + +var BADGE_GROUP_PATH = '../badge-group/index'; + +Component({ + externalClasses: ['custom-class'], + + relations: (_relations = {}, _relations[BADGE_GROUP_PATH] = { + type: 'ancestor' + }, _relations), + + properties: { + info: Number, + title: String + }, + + methods: { + onTap: function onTap() { + var group = this.getRelationNodes(BADGE_GROUP_PATH)[0]; + if (group) { + group.setActive(this); + } + }, + setActive: function setActive(active) { + this.setData({ active: active }); + } + } +}); \ No newline at end of file diff --git a/dist/badge/index.json b/dist/badge/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/dist/badge/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/badge/index.wxml b/dist/badge/index.wxml new file mode 100644 index 00000000..2630776c --- /dev/null +++ b/dist/badge/index.wxml @@ -0,0 +1,4 @@ + + {{ info }} + {{ title }} + diff --git a/dist/badge/index.wxss b/dist/badge/index.wxss new file mode 100644 index 00000000..843bb404 --- /dev/null +++ b/dist/badge/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-badge{display:block;overflow:hidden;font-size:14px;line-height:1.4;-webkit-user-select:none;user-select:none;color:#666;word-break:break-all;box-sizing:border-box;padding:20px 12px 20px 9px;background-color:#f8f8f8;border-left:3px solid transparent}.van-badge:active{background-color:#e8e8e8}.van-badge::after{border-bottom-width:1px}.van-badge--active{font-weight:700;color:#333;border-color:#f44}.van-badge--active::after{border-right-width:1px}.van-badge--active,.van-badge--active:active{background-color:#fff}.van-badge__info{position:absolute;top:2px;right:2px;color:#fff;font-size:10px;font-weight:400;-webkit-transform:scale(.8);transform:scale(.8);text-align:center;box-sizing:border-box;padding:0 6px;min-width:18px;line-height:18px;border-radius:9px;background-color:#f44} \ No newline at end of file diff --git a/dist/button/behaviors.js b/dist/button/behaviors.js new file mode 100644 index 00000000..903e7bf2 --- /dev/null +++ b/dist/button/behaviors.js @@ -0,0 +1,75 @@ +'use strict'; + +module.exports = Behavior({ + properties: { + loading: Boolean, + // 在自定义组件中,无法与外界的 form 组件联动,暂时不开放 + // formType: String, + openType: String, + appParameter: String, + // 暂时不开放,直接传入无法设置样式 + // hoverClass: { + // type: String, + // value: 'button-hover' + // }, + hoverStopPropagation: Boolean, + hoverStartTime: { + type: Number, + value: 20 + }, + hoverStayTime: { + type: Number, + value: 70 + }, + lang: { + type: String, + value: 'en' + }, + sessionFrom: { + type: String, + value: '' + }, + sendMessageTitle: String, + sendMessagePath: String, + sendMessageImg: String, + showMessageCard: String + }, + + methods: { + bindgetuserinfo: function bindgetuserinfo() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$detail = _ref.detail, + detail = _ref$detail === undefined ? {} : _ref$detail; + + this.triggerEvent('getuserinfo', detail); + }, + bindcontact: function bindcontact() { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref2$detail = _ref2.detail, + detail = _ref2$detail === undefined ? {} : _ref2$detail; + + this.triggerEvent('contact', detail); + }, + bindgetphonenumber: function bindgetphonenumber() { + var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref3$detail = _ref3.detail, + detail = _ref3$detail === undefined ? {} : _ref3$detail; + + this.triggerEvent('getphonenumber', detail); + }, + bindopensetting: function bindopensetting() { + var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref4$detail = _ref4.detail, + detail = _ref4$detail === undefined ? {} : _ref4$detail; + + this.triggerEvent('opensetting', detail); + }, + binderror: function binderror() { + var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref5$detail = _ref5.detail, + detail = _ref5$detail === undefined ? {} : _ref5$detail; + + this.triggerEvent('error', detail); + } + } +}); \ No newline at end of file diff --git a/dist/button/index.js b/dist/button/index.js new file mode 100644 index 00000000..eaae6602 --- /dev/null +++ b/dist/button/index.js @@ -0,0 +1,79 @@ +'use strict'; + +var nativeBehaviors = require('./behaviors'); +var classnames = require('../common/classnames'); + +var observer = function observer() { + this.setClasses(); +}; + +Component({ + externalClasses: ['custom-class', 'loading-class'], + + behaviors: [nativeBehaviors], + + properties: { + type: { + type: String, + value: 'default', + observer: observer + }, + size: { + type: String, + value: 'normal', + observer: observer + }, + plain: { + type: Boolean, + value: false, + observer: observer + }, + disabled: { + type: Boolean, + value: false, + observer: observer + }, + loading: { + type: Boolean, + value: false, + observer: observer + }, + block: { + type: Boolean, + value: false, + observer: observer + } + }, + + attached: function attached() { + this.setClasses(); + }, + + + methods: { + onTap: function onTap(event) { + if (!this.data.disabled && !this.data.loading) { + this.triggerEvent('tap', event); + } + }, + setClasses: function setClasses() { + var _data = this.data, + type = _data.type, + size = _data.size, + plain = _data.plain, + disabled = _data.disabled, + loading = _data.loading, + block = _data.block; + + this.setData({ + classes: classnames('van-button--' + type, 'van-button--' + size, { + 'van-button--block': block, + 'van-button--plain': plain, + 'van-button--loading': loading, + 'van-button--disabled': disabled, + 'van-button--untapable': disabled || loading + }) + }); + } + } +}); \ No newline at end of file diff --git a/dist/button/index.json b/dist/button/index.json new file mode 100644 index 00000000..cae21702 --- /dev/null +++ b/dist/button/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-loading": "../loading/index" + } +} \ No newline at end of file diff --git a/dist/button/index.wxml b/dist/button/index.wxml new file mode 100644 index 00000000..f49a8004 --- /dev/null +++ b/dist/button/index.wxml @@ -0,0 +1,30 @@ + diff --git a/dist/button/index.wxss b/dist/button/index.wxss new file mode 100644 index 00000000..b01d0e21 --- /dev/null +++ b/dist/button/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-button{position:relative;padding:0;display:inline-block;height:44px;line-height:42px;border-radius:3px;box-sizing:border-box;font-size:16px;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%}.van-button::after{content:" ";position:absolute;top:50%;left:50%;opacity:0;width:100%;height:100%;border:inherit;border-color:#000;background-color:#000;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-button:active::after{opacity:.3}.van-button--untapable::after{display:none}.van-button--default{color:#333;background-color:#fff;border:1px solid #e5e5e5}.van-button--primary{color:#fff;background-color:#4b0;border:1px solid #4b0}.van-button--danger{color:#fff;background-color:#f44;border:1px solid #f44}.van-button--warning{color:#fff;background-color:#f85;border:1px solid #f85}.van-button--plain{background-color:#fff}.van-button--plain.van-button--primary{color:#4b0}.van-button--plain.van-button--danger{color:#f44}.van-button--plain.van-button--warning{color:#f85}.van-button--large{width:100%;height:50px;line-height:48px}.van-button--normal{padding:0 15px;font-size:14px}.van-button--small{height:30px;padding:0 8px;min-width:60px;font-size:12px;line-height:28px}.van-button--loading .van-loading{display:inline-block}.van-button--loading .van-button__text{display:none}.van-button--mini{display:inline-block;width:50px;height:22px;line-height:20px;font-size:10px}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{width:100%;display:block}.van-button--disabled{color:#999;background-color:#e8e8e8;border:1px solid #e5e5e5} \ No newline at end of file diff --git a/dist/card/index.js b/dist/card/index.js new file mode 100644 index 00000000..432e131f --- /dev/null +++ b/dist/card/index.js @@ -0,0 +1,22 @@ +'use strict'; + +Component({ + options: { + multipleSlots: true + }, + + externalClasses: ['custom-class', 'thumb-class', 'title-class', 'price-class', 'desc-class', 'num-class'], + + properties: { + num: String, + desc: String, + thumb: String, + title: String, + price: String, + centered: Boolean, + currency: { + type: String, + default: '¥' + } + } +}); \ No newline at end of file diff --git a/dist/card/index.json b/dist/card/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/dist/card/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/card/index.wxml b/dist/card/index.wxml new file mode 100644 index 00000000..019c7f23 --- /dev/null +++ b/dist/card/index.wxml @@ -0,0 +1,22 @@ + + + + + + + + {{ title }} + {{ currency }} {{ price }} + + + + {{ desc }} + x {{ num }} + + + + + + + + diff --git a/dist/card/index.wxss b/dist/card/index.wxss new file mode 100644 index 00000000..33980063 --- /dev/null +++ b/dist/card/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-card{color:#333;height:100px;font-size:16px;background:#fafafa;position:relative;box-sizing:border-box;padding:5px 15px 5px 115px}.van-card--center,.van-card__thumb{-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.van-card__thumb{top:5px;left:15px;width:90px;height:90px;position:absolute}.van-card__img{border:none;max-width:100%;max-height:100%}.van-card,.van-card__row,.van-card__thumb{display:-webkit-box;display:flex}.van-card__content{width:100%}.van-card__content--center{height:90px;-webkit-box-align:center;align-items:center}.van-card__desc,.van-card__title{line-height:20px;word-break:break-all}.van-card__title{max-height:40px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-card__desc{color:#666;font-size:12px;max-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-card__num,.van-card__price{-webkit-box-flex:1;flex:1;min-width:80px;line-height:20px;text-align:right}.van-card__price{font-size:14px}.van-card__num{color:#666;font-size:12px}.van-card__footer{right:15px;bottom:5px;position:absolute}.van-card__footer .van-button{margin-left:5px} \ No newline at end of file diff --git a/dist/cell-group/index.js b/dist/cell-group/index.js new file mode 100644 index 00000000..d182271e --- /dev/null +++ b/dist/cell-group/index.js @@ -0,0 +1,12 @@ +'use strict'; + +Component({ + externalClasses: ['custom-class'], + + properties: { + border: { + type: Boolean, + value: true + } + } +}); \ No newline at end of file diff --git a/dist/cell-group/index.json b/dist/cell-group/index.json new file mode 100644 index 00000000..32640e0d --- /dev/null +++ b/dist/cell-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/dist/cell-group/index.wxml b/dist/cell-group/index.wxml new file mode 100644 index 00000000..4ed34ace --- /dev/null +++ b/dist/cell-group/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/dist/cell-group/index.wxss b/dist/cell-group/index.wxss new file mode 100644 index 00000000..3c9fa409 --- /dev/null +++ b/dist/cell-group/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease} \ No newline at end of file diff --git a/dist/cell/index.js b/dist/cell/index.js new file mode 100644 index 00000000..e4fdd313 --- /dev/null +++ b/dist/cell/index.js @@ -0,0 +1,42 @@ +'use strict'; + +Component({ + externalClasses: ['custom-class', 'title-class', 'label-class', 'value-class', 'left-icon-class', 'right-icon-class'], + + options: { + multipleSlots: true + }, + + properties: { + title: null, + value: null, + url: String, + icon: String, + label: String, + center: Boolean, + isLink: Boolean, + required: Boolean, + tapable: Boolean, + titleWidth: String, + customStyle: String, + arrowDirection: String, + linkType: { + type: String, + value: 'navigateTo' + }, + border: { + type: Boolean, + value: true + } + }, + + methods: { + onTap: function onTap() { + var url = this.data.url; + + if (url) { + wx[this.data.linkType]({ url: url }); + } + } + } +}); \ No newline at end of file diff --git a/dist/cell/index.json b/dist/cell/index.json new file mode 100644 index 00000000..a9ab393a --- /dev/null +++ b/dist/cell/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} \ No newline at end of file diff --git a/dist/cell/index.wxml b/dist/cell/index.wxml new file mode 100644 index 00000000..05dfa33f --- /dev/null +++ b/dist/cell/index.wxml @@ -0,0 +1,28 @@ + + + + + + {{ title }} + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/dist/cell/index.wxss b/dist/cell/index.wxss new file mode 100644 index 00000000..418b61c1 --- /dev/null +++ b/dist/cell/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease}.van-cell{width:100%;display:-webkit-box;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{left:15px;right:0;width:auto;-webkit-transform:scale(1,.5);transform:scale(1,.5);border-bottom-width:1px}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:1.2;color:#666}.van-cell__title,.van-cell__value{-webkit-box-flex:1;flex:1}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon{font-size:16px;line-height:24px;margin-right:5px;vertical-align:middle}.van-cell__right-icon{color:#999;font-size:12px;line-height:24px;margin-left:5px}.van-cell__right-icon--left::before{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-cell__right-icon--up::before{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-cell__right-icon--down::before{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-cell--tapable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-box-align:center;align-items:center} \ No newline at end of file diff --git a/dist/checkbox-group/index.js b/dist/checkbox-group/index.js new file mode 100644 index 00000000..09058960 --- /dev/null +++ b/dist/checkbox-group/index.js @@ -0,0 +1,29 @@ +'use strict'; + +var _relations; + +var CHECKBOX_PATH = '../checkbox/index'; + +Component({ + relations: (_relations = {}, _relations[CHECKBOX_PATH] = { + type: 'child', + linked: function linked() { + this.updateChildren(CHECKBOX_PATH); + } + }, _relations), + + data: { + elementUpdateTimeout: 0 + }, + + methods: { + updateChildren: function updateChildren(childPath) { + // 把checkbox标记为在group中,设置不同样式 + var elements = this.getRelationNodes(childPath); + + elements.forEach(function (checkbox, index) { + checkbox.updateData({ isInGroup: true }); + }); + } + } +}); \ No newline at end of file diff --git a/dist/checkbox-group/index.json b/dist/checkbox-group/index.json new file mode 100644 index 00000000..32640e0d --- /dev/null +++ b/dist/checkbox-group/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/dist/checkbox-group/index.wxml b/dist/checkbox-group/index.wxml new file mode 100644 index 00000000..a6ef51f8 --- /dev/null +++ b/dist/checkbox-group/index.wxml @@ -0,0 +1,3 @@ + + + diff --git a/dist/checkbox-group/index.wxss b/dist/checkbox-group/index.wxss new file mode 100644 index 00000000..418d8711 --- /dev/null +++ b/dist/checkbox-group/index.wxss @@ -0,0 +1 @@ +.checkbox-group{padding-bottom:10px;background-color:#fff}.checkbox-group .van-checkbox{margin-top:10px} \ No newline at end of file diff --git a/dist/checkbox/index.js b/dist/checkbox/index.js new file mode 100644 index 00000000..62160c07 --- /dev/null +++ b/dist/checkbox/index.js @@ -0,0 +1,44 @@ +'use strict'; + +var _relations; + +var CHECKBOX_GROUP_PATH = '../checkbox-group/index'; + +Component({ + externalClasses: ['checkbox-class'], + relations: (_relations = {}, _relations[CHECKBOX_GROUP_PATH] = { + type: 'parent' + }, _relations), + + properties: { + checked: Boolean, + disabled: Boolean, + isInGroup: Boolean, + labelDisabled: Boolean, + type: String + }, + + data: function data() { + return { + isInGroup: false, + isInCell: false + }; + }, + + + methods: { + handleClick: function handleClick() { + if (this.data.disabled) { + return; + } + + var checked = !this.data.checked; + + this.triggerEvent('change', checked); + this.setData({ checked: checked }); + }, + updateData: function updateData(data) { + this.setData(data); + } + } +}); \ No newline at end of file diff --git a/dist/checkbox/index.json b/dist/checkbox/index.json new file mode 100644 index 00000000..0a336c08 --- /dev/null +++ b/dist/checkbox/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/dist/checkbox/index.wxml b/dist/checkbox/index.wxml new file mode 100644 index 00000000..311ccbb9 --- /dev/null +++ b/dist/checkbox/index.wxml @@ -0,0 +1,13 @@ + + + + + + diff --git a/dist/checkbox/index.wxss b/dist/checkbox/index.wxss new file mode 100644 index 00000000..b56cf0a8 --- /dev/null +++ b/dist/checkbox/index.wxss @@ -0,0 +1 @@ +.van-checkbox{display:inline-block;padding:0 10px;font-size:14px}.van-checkbox__item{display:block;margin-top:10px}.van-checkbox__list-item{display:block;padding:10px 10px 10px 0;margin-left:10px;border-bottom:1px solid #e5e5e5}.van-checkbox__list-item .van-checkbox__icon{float:right}.van-checkbox__icon{display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;color:#aaa}.van-checkbox__icon.van-checkbox--checked{color:#06bf04}.van-checkbox__icon.van-checkbox--disabled{color:#e5e5e5}.van-checkbox__label{display:inline-block;margin-left:10px} \ No newline at end of file diff --git a/dist/col/index.js b/dist/col/index.js new file mode 100644 index 00000000..9df33fa9 --- /dev/null +++ b/dist/col/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var _relations; + +var ROW_PATH = '../row/index'; + +Component({ + externalClasses: ['custom-class'], + + relations: (_relations = {}, _relations[ROW_PATH] = { + type: 'ancestor' + }, _relations), + + properties: { + span: Number, + offset: Number + }, + + methods: { + setGutter: function setGutter(gutter) { + var padding = gutter / 2 + 'px'; + var style = gutter ? 'padding-left: ' + padding + '; padding-right: ' + padding + ';' : ''; + this.setData({ style: style }); + } + } +}); \ No newline at end of file diff --git a/dist/col/index.json b/dist/col/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/dist/col/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/col/index.wxml b/dist/col/index.wxml new file mode 100644 index 00000000..30baf92a --- /dev/null +++ b/dist/col/index.wxml @@ -0,0 +1,6 @@ + + + diff --git a/dist/col/index.wxss b/dist/col/index.wxss new file mode 100644 index 00000000..b33e9238 --- /dev/null +++ b/dist/col/index.wxss @@ -0,0 +1 @@ +.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16667%}.van-col--offset-1{margin-left:4.16667%}.van-col--2{width:8.33333%}.van-col--offset-2{margin-left:8.33333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66667%}.van-col--offset-4{margin-left:16.66667%}.van-col--5{width:20.83333%}.van-col--offset-5{margin-left:20.83333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16667%}.van-col--offset-7{margin-left:29.16667%}.van-col--8{width:33.33333%}.van-col--offset-8{margin-left:33.33333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66667%}.van-col--offset-10{margin-left:41.66667%}.van-col--11{width:45.83333%}.van-col--offset-11{margin-left:45.83333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16667%}.van-col--offset-13{margin-left:54.16667%}.van-col--14{width:58.33333%}.van-col--offset-14{margin-left:58.33333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66667%}.van-col--offset-16{margin-left:66.66667%}.van-col--17{width:70.83333%}.van-col--offset-17{margin-left:70.83333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16667%}.van-col--offset-19{margin-left:79.16667%}.van-col--20{width:83.33333%}.van-col--offset-20{margin-left:83.33333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66667%}.van-col--offset-22{margin-left:91.66667%}.van-col--23{width:95.83333%}.van-col--offset-23{margin-left:95.83333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} \ No newline at end of file diff --git a/dist/common/classnames.js b/dist/common/classnames.js new file mode 100644 index 00000000..44f930c5 --- /dev/null +++ b/dist/common/classnames.js @@ -0,0 +1,31 @@ +'use strict'; + +var hasOwn = {}.hasOwnProperty; + +module.exports = function classNames() { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg) && arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); +}; \ No newline at end of file diff --git a/dist/common/helper.js b/dist/common/helper.js new file mode 100644 index 00000000..e995325d --- /dev/null +++ b/dist/common/helper.js @@ -0,0 +1,102 @@ +'use strict'; + +// 从事件对象中解析得到 componentId +// 需要在元素上声明 data-component-id +function extractComponentId() { + var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var _ref = event.currentTarget || {}, + componentId = _ref.dataset.componentId; + + return componentId; +} + +/* + 注:默认合并所有生命周期函数 + 配置合并指定的生命周期 or 忽略指定字段 + const extend = extendCreator({ + life: ['onLoad', 'onPullDownRefresh'], + exclude: ['binder'] + }); + + Page(extend({}, { + onLoad() {}, + ... + })); +*/ + +var LIFE_CYCLE = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll']; + +var extendCreator = function extendCreator() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var _config$life = config.life, + life = _config$life === undefined ? LIFE_CYCLE : _config$life, + _config$exclude = config.exclude, + exclude = _config$exclude === undefined ? [] : _config$exclude; + + + var excludeList = exclude.concat(LIFE_CYCLE.map(getFuncArrayName)); + + if (!Array.isArray(life) || !Array.isArray(exclude)) throw new Error('Invalid Extend Config'); + var lifeCycleList = life.filter(function (item) { + return LIFE_CYCLE.indexOf(item) >= 0; + }); + return function extend(target) { + for (var _len = arguments.length, objList = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + objList[_key - 1] = arguments[_key]; + } + + objList.forEach(function (source) { + if (source) { + var keys = Object.keys(source); + keys.forEach(function (key) { + var value = source[key]; + if (excludeList.indexOf(key) >= 0) return; + if (lifeCycleList.indexOf(key) >= 0 && typeof value === 'function') { + var funcArrayName = getFuncArrayName(key); + if (!target[funcArrayName]) { + target[funcArrayName] = []; + if (target[key]) { + target[funcArrayName].push(target[key]); + } + target[key] = function () { + var _this = this; + + for (var _len2 = arguments.length, rest = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + rest[_key2] = arguments[_key2]; + } + + target[funcArrayName].forEach(function (func) { + return func.apply(_this, rest); + }); + }; + } + + if (source[funcArrayName]) { + var _target$funcArrayName; + + // 经过生命周期合并的组件直接整合函数列表 + (_target$funcArrayName = target[funcArrayName]).push.apply(_target$funcArrayName, source[funcArrayName]); + } else { + // 添加生命周期函数进入函数列表 + target[funcArrayName].push(value); + } + } else { + target[key] = value; + } + }); + } + }); + return target; + }; +}; + +var getFuncArrayName = function getFuncArrayName(name) { + return '__$' + name; +}; + +module.exports = { + extractComponentId: extractComponentId, + extend: Object.assign, + extendCreator: extendCreator +}; \ No newline at end of file diff --git a/dist/common/index.wxss b/dist/common/index.wxss new file mode 100644 index 00000000..3c9fa409 --- /dev/null +++ b/dist/common/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease} \ No newline at end of file diff --git a/dist/common/pop-manager/index.js b/dist/common/pop-manager/index.js new file mode 100644 index 00000000..365a532c --- /dev/null +++ b/dist/common/pop-manager/index.js @@ -0,0 +1,31 @@ +'use strict'; + +Component({ + properties: { + show: { + type: Boolean, + value: false + }, + // 是否有遮罩层 + overlay: { + type: Boolean, + value: true + }, + // 遮罩层是否会显示 + showOverlay: { + type: Boolean, + value: true + }, + // 内容从哪个方向出,可选 center top bottom left right + type: { + type: String, + value: 'center' + } + }, + + methods: { + handleMaskClick: function handleMaskClick() { + this.triggerEvent('clickmask', {}); + } + } +}); \ No newline at end of file diff --git a/dist/common/pop-manager/index.json b/dist/common/pop-manager/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/dist/common/pop-manager/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/dist/common/pop-manager/index.wxml b/dist/common/pop-manager/index.wxml new file mode 100644 index 00000000..6bb47ef1 --- /dev/null +++ b/dist/common/pop-manager/index.wxml @@ -0,0 +1,12 @@ + + + + + + diff --git a/dist/common/pop-manager/index.wxss b/dist/common/pop-manager/index.wxss new file mode 100644 index 00000000..3f22a03f --- /dev/null +++ b/dist/common/pop-manager/index.wxss @@ -0,0 +1 @@ +.pop{visibility:hidden}.pop--show{visibility:visible}.pop__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.pop__mask--hide{background:0 0}.pop__container{position:fixed;left:50%;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);-webkit-transform-origin:center;transform-origin:center;-webkit-transition:all .4s ease;transition:all .4s ease;z-index:11;opacity:0}.pop--show .pop__container{opacity:1}.pop--show .pop__mask{display:block}.pop--left .pop__container{left:0;top:50%;-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}.pop--show.pop--left .pop__container{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.pop--right .pop__container{right:0;top:50%;left:auto;-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}.pop--show.pop--right .pop__container{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.pop--bottom .pop__container{top:auto;left:50%;bottom:0;-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0)}.pop--show.pop--bottom .pop__container{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.pop--top .pop__container{top:0;left:50%;-webkit-transform:translate3d(-50%,-100%,0);transform:translate3d(-50%,-100%,0)}.pop--show.pop--top .pop__container{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)} \ No newline at end of file diff --git a/dist/common/style/animation.wxss b/dist/common/style/animation.wxss new file mode 100644 index 00000000..184d83f3 --- /dev/null +++ b/dist/common/style/animation.wxss @@ -0,0 +1 @@ +@-webkit-keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-bottom-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-in{from{opacity:0}to{opacity:1}}@keyframes van-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-out{from{opacity:1}to{opacity:0}}@keyframes van-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.van-fade-enter-active{-webkit-animation:.3s van-fade-in;animation:.3s van-fade-in}.van-fade-leave-active{-webkit-animation:.3s van-fade-out;animation:.3s van-fade-out}.van-slide-bottom-enter-active{-webkit-animation:van-slide-bottom-enter .3s both ease;animation:van-slide-bottom-enter .3s both ease}.van-slide-bottom-leave-active{-webkit-animation:van-slide-bottom-leave .3s both ease;animation:van-slide-bottom-leave .3s both ease} \ No newline at end of file diff --git a/dist/common/style/clearfix.wxss b/dist/common/style/clearfix.wxss new file mode 100644 index 00000000..df65a0a4 --- /dev/null +++ b/dist/common/style/clearfix.wxss @@ -0,0 +1 @@ +.van-clearfix::after{content:'';display:table;clear:both} \ No newline at end of file diff --git a/dist/common/style/ellipsis.wxss b/dist/common/style/ellipsis.wxss new file mode 100644 index 00000000..79dd7869 --- /dev/null +++ b/dist/common/style/ellipsis.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis} \ No newline at end of file diff --git a/dist/common/style/hairline.wxss b/dist/common/style/hairline.wxss new file mode 100644 index 00000000..9f445b65 --- /dev/null +++ b/dist/common/style/hairline.wxss @@ -0,0 +1 @@ +.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px} \ No newline at end of file diff --git a/dist/common/style/mixins/border-retina.wxss b/dist/common/style/mixins/border-retina.wxss new file mode 100644 index 00000000..e69de29b diff --git a/dist/common/style/mixins/clearfix.wxss b/dist/common/style/mixins/clearfix.wxss new file mode 100644 index 00000000..e69de29b diff --git a/dist/common/style/mixins/ellipsis.wxss b/dist/common/style/mixins/ellipsis.wxss new file mode 100644 index 00000000..e69de29b diff --git a/dist/common/style/var.wxss b/dist/common/style/var.wxss new file mode 100644 index 00000000..e69de29b diff --git a/dist/datetime-picker/date-picker-view.wxml b/dist/datetime-picker/date-picker-view.wxml new file mode 100644 index 00000000..0a69f841 --- /dev/null +++ b/dist/datetime-picker/date-picker-view.wxml @@ -0,0 +1,35 @@ + + +