提交 6ca07400 编写于 作者: 5 520MianXiangDuiXiang520

🎉 first push code

上级 e4325023
"# WeBlog"
# WeBlog
博客的微信小程序端
![junblog](./junblog.jpg)
### power
* [towxml](https://github.com/sbfkcel/towxml)
* [wux-weapp](https://github.com/wux-weapp/wux-weapp)
//app.js
const Towxml = require('/towxml/main');
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
}
}
})
},
towxml: new Towxml(),
globalData: {
userInfo: null
}
})
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/about/about",
"pages/friendlink/friendlink",
"pages/detail/detail",
"pages/tagarticle/tagarticle"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "JuneBao",
"navigationBarTextStyle": "black"
},
"sitemapLocation": "sitemap.json",
"tabBar": {
"backgroundColor": "#f0f4f6",
"selectedColor": "77c0f7",
"list": [
{
"color": "#09bb07",
"pagePath": "pages/index/index",
"text": "博客",
"iconPath": "static/image/icon/blog.png",
"selectedIconPath": "static/image/icon/blog_c.png"
},
{
"color": "#09bb07",
"pagePath": "pages/friendlink/friendlink",
"text": "标签",
"iconPath": "static/image/icon/tagso.png",
"selectedIconPath": "static/image/icon/tagso_c.png"
},
{
"pagePath": "pages/about/about",
"text": "关于",
"iconPath": "static/image/icon/About.png",
"selectedIconPath": "static/image/icon/About_c.png"
}
]
}
}
\ No newline at end of file
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(0,_baseComponent.default)({relations:{"../accordion/index":{type:"child",observer:function(){this.debounce(this.updated)}}},properties:{prefixCls:{type:String,value:"wux-accordion-group"},cellGroupPrefixCls:{type:String,value:"wux-cell-group"},defaultCurrent:{type:Array,value:[]},current:{type:Array,value:[],observer:function(t){this.data.controlled&&this.updated(t)}},controlled:{type:Boolean,value:!1},accordion:{type:Boolean,value:!1},title:{type:String,value:""},label:{type:String,value:""}},data:{activeKey:"",keys:[]},methods:{updated:function(t){var e=0<arguments.length&&void 0!==t?t:this.data.activeKey;this.data.activeKey!==e&&this.setData({activeKey:e}),this.changeCurrent(e)},changeCurrent:function(n){var i=this,t=this.getRelationNodes("../accordion/index");0<t.length&&t.forEach(function(t,e){var r=t.data.key||String(e),a=i.data.accordion?n[0]===r:-1!==n.indexOf(r);t.changeCurrent(a,r)}),this.data.keys.length!==t.length&&this.setData({keys:t.map(function(t){return t.data})})},emitEvent:function(t){this.triggerEvent("change",{key:t,keys:this.data.keys})},setActiveKey:function(t){this.data.controlled||this.updated(t),this.emitEvent(this.data.accordion?t[0]:t)},onClickItem:function(e){var t=_toConsumableArray(this.data.activeKey);t=this.data.accordion?t[0]===e?[]:[e]:-1!==t.indexOf(e)?t.filter(function(t){return t!==e}):[].concat(_toConsumableArray(t),[e]),this.setActiveKey(t)}},ready:function(){var t=this.data,e=t.defaultCurrent,r=t.current,a=t.controlled?r:e;this.updated(a)}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-cell-group": "../cell-group/index"
}
}
\ No newline at end of file
<wux-cell-group wux-class="{{ prefixCls }}" prefixCls="{{ cellGroupPrefixCls }}" title="{{ title }}" label="{{ label }}">
<slot></slot>
</wux-cell-group>
.wux-accordion-group{position:relative;border:none}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,_baseComponent.default)({relations:{"../accordion-group/index":{type:"parent"}},properties:{prefixCls:{type:String,value:"wux-accordion"},key:{type:String,value:""},thumb:{type:String,value:""},title:{type:String,value:""},content:{type:String,value:""},disabled:{type:Boolean,value:!1},showArrow:{type:Boolean,value:!0}},data:{current:!1,index:"0"},computed:{classes:["prefixCls, current, disabled",function(e,t,n){var r;return{wrap:(0,_classNames2.default)(e,(_defineProperty(r={},"".concat(e,"--current"),t),_defineProperty(r,"".concat(e,"--disabled"),n),r)),hd:"".concat(e,"__hd"),thumb:"".concat(e,"__thumb"),title:"".concat(e,"__title"),arrow:"".concat(e,"__arrow"),bd:"".concat(e,"__bd"),content:"".concat(e,"__content")}}]},methods:{changeCurrent:function(e,t){this.setData({current:e,index:t})},onTap:function(){var e=this.data,t=e.index,n=e.disabled,r=this.getRelationNodes("../accordion-group/index")[0];!n&&r&&r.onClickItem(t)}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ classes.wrap }}">
<view class="{{ classes.hd }}" bindtap="onTap">
<block wx:if="{{ thumb }}">
<image class="{{ classes.thumb }}" src="{{ thumb }}" />
</block>
<block wx:if="{{ title }}">
<view class="{{ classes.title }}">{{ title }}</view>
</block>
<block wx:else>
<slot name="header"></slot>
</block>
<view class="{{ classes.arrow }}" wx:if="{{ showArrow }}"></view>
</view>
<view class="{{ classes.bd }}">
<view class="{{ classes.content }}" wx:if="{{ content }}">{{ content }}</view>
<slot></slot>
</view>
</view>
.wux-accordion__hd{position:relative;padding:20rpx 30rpx;color:#000;background-color:#fff;box-sizing:border-box;padding-right:60rpx;width:auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.wux-accordion__hd::after{content:" ";position:absolute;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5);left:0}.wux-accordion__thumb{width:40rpx;height:40rpx;display:block;margin-right:10rpx}.wux-accordion__arrow{display:inline-block;width:30rpx;height:30rpx;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2216%22%20height%3D%2226%22%20viewBox%3D%220%200%2016%2026%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2%200L0%202l11.5%2011L0%2024l2%202%2014-13z%22%20fill%3D%22%23c7c7cc%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");background-size:contain;background-repeat:no-repeat;background-position:50% 50%;transform:rotate(90deg);transition:transform .2s ease;position:absolute;display:block;top:30rpx;right:30rpx}.wux-accordion--current>.wux-accordion__hd>.wux-accordion__arrow{transform:rotate(270deg)}.wux-accordion__bd{display:none;overflow:hidden;background:#fff;font-size:30rpx;color:rgba(0,0,0,.85);position:relative;padding:30rpx}.wux-accordion__bd::after{content:" ";position:absolute;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5);left:0}.wux-accordion--current>.wux-accordion__bd{display:block}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames7=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(n,!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var defaults={prefixCls:"wux-actionsheet",theme:"ios",className:"",titleText:"",buttons:[],buttonClicked:function(){},cancelText:"取消",cancel:function(){}};(0,_baseComponent.default)({useFunc:!0,data:defaults,computed:{classes:["prefixCls, theme, buttons, cancelText",function(n,e,t,r){var o,c=(0,_classNames7.default)(n),a="".concat(n,"__popup"),s=(0,_classNames7.default)("".concat(n,"__content"),(_defineProperty(o={},"".concat(n,"__content--theme-").concat(e),e),_defineProperty(o,"".concat(n,"__content--has-cancel"),r),o)),i=(0,_classNames7.default)("".concat(n,"__group"),_defineProperty({},"".concat(n,"__group--options"),!0)),u="".concat(n,"__title"),d=(0,_classNames7.default)("".concat(n,"__button"),_defineProperty({},"".concat(n,"__button--destructive"),!0));return{wrap:c,popup:a,content:s,options:i,title:u,button:t.map(function(e){var t;return{wrap:(0,_classNames7.default)("".concat(n,"__button"),(_defineProperty(t={},"".concat(n,"__button--option"),!0),_defineProperty(t,"".concat(n,"__button--disabled"),e.disabled),_defineProperty(t,"".concat(e.className),e.className),t)),hover:e.hoverClass&&"default"!==e.hoverClass?e.hoverClass:"".concat(n,"__button--hover")}}),icon:"".concat(n,"__icon"),text:"".concat(n,"__text"),destructive:d,group:(0,_classNames7.default)("".concat(n,"__group"),_defineProperty({},"".concat(n,"__group--cancel"),!0)),cancel:(0,_classNames7.default)("".concat(n,"__button"),_defineProperty({},"".concat(n,"__button--cancel"),!0)),hover:"".concat(n,"__button--hover")}}]},methods:{showSheet:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=this.$$mergeOptionsAndBindMethods(Object.assign({},defaults,t));return this.removed=!1,this.$$setData(_objectSpread({in:!0},n)),this.cancel.bind(this)},removeSheet:function(e){if(this.removed)return!1;this.removed=!0,this.$$setData({in:!1}),"function"==typeof e&&e(this.data.buttons)},buttonClicked:function(e){var t=e.currentTarget.dataset.index;!0===this.fns.buttonClicked(t,this.data.buttons[t])&&this.removeSheet()},destructiveButtonClicked:function(){!0===this.fns.destructiveButtonClicked()&&this.removeSheet()},cancel:function(){this.removeSheet(this.fns.cancel)},bindgetuserinfo:function(e){this.triggerEvent("getuserinfo",_objectSpread({},e.detail,{},e.currentTarget.dataset))},bindcontact:function(e){this.triggerEvent("contact",_objectSpread({},e.detail,{},e.currentTarget.dataset))},bindgetphonenumber:function(e){this.triggerEvent("getphonenumber",_objectSpread({},e.detail,{},e.currentTarget.dataset))},bindopensetting:function(e){this.triggerEvent("opensetting",_objectSpread({},e.detail,{},e.currentTarget.dataset))},onError:function(e){this.triggerEvent("error",_objectSpread({},e.detail,{},e.currentTarget.dataset))}}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-popup": "../popup/index"
}
}
<wux-popup wux-content-class="{{ theme === 'ios' ? classes.popup : '' }}" position="bottom" visible="{{ in }}" safeArea="bottom" bind:close="cancel">
<view class="wux-class {{ classes.wrap }}">
<view class="{{ classes.content }}">
<view class="{{ classes.options }}">
<view class="{{ classes.title }}" wx:if="{{ titleText }}">{{ titleText }}</view>
<block wx:for="{{ buttons }}" wx:for-item="button" wx:key="index">
<button
class="{{ classes.button[index].wrap }}"
data-index="{{ index }}"
disabled="{{ button.disabled }}"
open-type="{{ button.openType }}"
hover-class="{{ !button.disabled ? classes.button[index].hover : 'none' }}"
hover-stop-propagation="{{ button.hoverStopPropagation }}"
hover-start-time="{{ button.hoverStartTime }}"
hover-stay-time="{{ button.hoverStayTime }}"
lang="{{ button.lang }}"
bindgetuserinfo="bindgetuserinfo"
session-from="{{ button.sessionFrom }}"
send-message-title="{{ button.sendMessageTitle }}"
send-message-path="{{ button.sendMessagePath }}"
send-message-img="{{ button.sendMessageImg }}"
show-message-card="{{ button.showMessageCard }}"
bindcontact="bindcontact"
bindgetphonenumber="bindgetphonenumber"
app-parameter="{{ button.appParameter }}"
binderror="onError"
bindopensetting="bindopensetting"
catchtap="buttonClicked"
>
<image class="{{ classes.icon }}" src="{{ button.icon }}" wx:if="{{ button.icon }}" />
<text class="{{ classes.text }}">{{ button.text }}</text>
</button>
</block>
<button class="{{ classes.destructive }}" wx:if="{{ destructiveText }}" catchtap="destructiveButtonClicked">{{ destructiveText }}</button>
</view>
<view class="{{ classes.group }}" wx:if="{{ cancelText }}">
<button class="{{ classes.cancel }}" hover-class="{{ classes.hover }}" catchtap="cancel">{{ cancelText }}</button>
</view>
</view>
</view>
</wux-popup>
.wux-actionsheet__popup{background-color:transparent}.wux-actionsheet__content{margin-left:16rpx;margin-right:16rpx;width:auto;overflow:hidden}.wux-actionsheet__content--theme-wx{margin-left:0;margin-right:0;margin-bottom:0}.wux-actionsheet__content--theme-wx .wux-actionsheet__group{border-radius:0;margin-bottom:12rpx}.wux-actionsheet__content--theme-wx .wux-actionsheet__group--options{background-color:#fff}.wux-actionsheet__content--theme-wx .wux-actionsheet__group--cancel{margin-bottom:0}.wux-actionsheet__content--theme-wx .wux-actionsheet__button{font-size:36rpx;color:#000}.wux-actionsheet__content--theme-wx .wux-actionsheet__button--cancel{font-weight:400}.wux-actionsheet__content--theme-wx.wux-actionsheet__content--has-cancel{background-color:#efeff4}.wux-actionsheet__group{margin-bottom:16rpx;border-radius:8rpx;background-color:#fff;overflow:hidden}.wux-actionsheet__group--options{background-color:#f1f2f3}.wux-actionsheet__title{padding:32rpx;color:#8f8f8f;text-align:center;font-size:26rpx}.wux-actionsheet__button{position:relative;display:block;margin:0;padding:0;min-width:104rpx;min-height:96rpx;vertical-align:top;text-align:center;text-overflow:ellipsis;cursor:pointer;width:100%;border-radius:0;background-color:transparent;color:#007aff;font-size:42rpx;line-height:96rpx;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.wux-actionsheet__button--hover{box-shadow:none;border-color:#d1d3d6;color:#007aff;background:#e4e5e7}.wux-actionsheet__button--destructive{color:#ff3b30!important}.wux-actionsheet__button--cancel{font-weight:500}.wux-actionsheet__button--disabled{opacity:.3!important}.wux-actionsheet__group .wux-actionsheet__button{border-top:none}.wux-actionsheet__group .wux-actionsheet__button::after{transform:none;transform-origin:none;border:none;border-radius:0;content:" ";position:absolute;left:0;top:0;right:0;height:1PX;border-top:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 0;transform:scaleY(.5)}.wux-actionsheet__group .wux-actionsheet__button:first-child:last-child::after{border-width:0}.wux-actionsheet__icon{width:48rpx;height:48rpx;display:inline-block;margin-right:20rpx}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-alert"},classNames:{type:null,value:"wux-animate--fadeIn"},theme:{type:String,value:"balanced"},thumb:{type:String,value:""},title:{type:String,value:""},label:{type:String,value:""},closable:{type:Boolean,value:!1}},data:{visible:!0},computed:{classes:["prefixCls, theme",function(e,t){return{wrap:(0,_classNames2.default)(e,_defineProperty({},"".concat(e,"--").concat(t),t)),hd:"".concat(e,"__hd"),thumb:"".concat(e,"__thumb"),bd:"".concat(e,"__bd"),text:"".concat(e,"__text"),desc:"".concat(e,"__desc"),ft:"".concat(e,"__ft"),closable:"".concat(e,"__closable")}}]},methods:{onClose:function(){this.data.closable&&this.setData({visible:!1}),this.triggerEvent("click")},onClick:function(){this.triggerEvent("click")}}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-animation-group": "../animation-group/index"
}
}
\ No newline at end of file
<wux-animation-group in="{{ visible }}" classNames="{{ classNames }}">
<view class="wux-class {{ classes.wrap }}" bindtap="onClick">
<view class="{{ classes.hd }}">
<block wx:if="{{ thumb }}">
<image class="{{ classes.thumb }}" src="{{ thumb }}" />
</block>
<block wx:else>
<slot name="header"></slot>
</block>
</view>
<view class="{{ classes.bd }}">
<view wx:if="{{ title }}" class="{{ classes.text }}">{{ title }}</view>
<view wx:if="{{ label }}" class="{{ classes.desc }}">{{ label }}</view>
<slot></slot>
</view>
<view class="{{ classes.ft }}">
<block wx:if="{{ closable }}">
<view class="{{ classes.closable }}" catchtap="onClose">×</view>
</block>
<block wx:else>
<slot name="footer"></slot>
</block>
</view>
</view>
</wux-animation-group>
\ No newline at end of file
.wux-alert{padding:20rpx 30rpx;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:4rpx;font-size:28rpx}.wux-alert__thumb{width:40rpx;height:40rpx;display:block;margin-right:10rpx}.wux-alert__bd{-ms-flex:1;flex:1}.wux-alert__text{text-align:left}.wux-alert__desc{text-align:left;line-height:1.2;font-size:24rpx}.wux-alert--light{color:#fff;background-color:#ddd}.wux-alert--stable{color:#fff;background-color:#b2b2b2}.wux-alert--positive{color:#fff;background-color:#387ef5}.wux-alert--calm{color:#fff;background-color:#11c1f3}.wux-alert--assertive{color:#fff;background-color:#ef473a}.wux-alert--balanced{color:#fff;background-color:#33cd5f}.wux-alert--energized{color:#fff;background-color:#ffc900}.wux-alert--royal{color:#fff;background-color:#886aea}.wux-alert--dark{color:#fff;background-color:#444}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_styleToCssString=_interopRequireDefault(require("../helpers/styleToCssString"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var ENTER="enter",ENTERING="entering",ENTERED="entered",EXIT="exit",EXITING="exiting",EXITED="exited",UNMOUNTED="unmounted",TRANSITION="transition",ANIMATION="animation",TIMEOUT=1e3/60,defaultClassNames={enter:"",enterActive:"",enterDone:"",exit:"",exitActive:"",exitDone:""};(0,_baseComponent.default)({properties:{in:{type:Boolean,value:!1,observer:function(t){this.data.isMounting&&this.updated(t)}},classNames:{type:null,value:defaultClassNames},duration:{type:null,value:null},type:{type:String,value:TRANSITION},appear:{type:Boolean,value:!1},enter:{type:Boolean,value:!0},exit:{type:Boolean,value:!0},mountOnEnter:{type:Boolean,value:!0},unmountOnExit:{type:Boolean,value:!0},wrapCls:{type:String,value:""},wrapStyle:{type:[String,Object],value:"",observer:function(t){this.setData({extStyle:(0,_styleToCssString.default)(t)})}},disableScroll:{type:Boolean,value:!1}},data:{animateCss:"",animateStatus:EXITED,isMounting:!1,extStyle:""},methods:{addEventListener:function(){var t=this.data.animateStatus,e=this.getTimeouts(),a=e.enter,n=e.exit;t===ENTERING&&!a&&this.data.enter&&this.performEntered(),t===EXITING&&!n&&this.data.exit&&this.performExited()},onTransitionEnd:function(){this.data.type===TRANSITION&&this.addEventListener()},onAnimationEnd:function(){this.data.type===ANIMATION&&this.addEventListener()},updateStatus:function(t,e){var a=1<arguments.length&&void 0!==e&&e;null!==t&&(this.cancelNextCallback(),this.isAppearing=a,t===ENTERING?this.performEnter():this.performExit())},performEnter:function(){var t=this,e=this.getClassNames(ENTER),a=e.className,n=e.activeClassName,i=this.getTimeouts().enter,s={animateStatus:ENTER,animateCss:a},r={animateStatus:ENTERING,animateCss:"".concat(a," ").concat(n)};if(!this.isAppearing&&!this.data.enter)return this.performEntered();this.safeSetData(s,function(){t.triggerEvent("change",{animateStatus:ENTER}),t.triggerEvent(ENTER,{isAppearing:t.isAppearing}),t.delayHandler(TIMEOUT,function(){t.safeSetData(r,function(){t.triggerEvent("change",{animateStatus:ENTERING}),t.triggerEvent(ENTERING,{isAppearing:t.isAppearing}),i&&t.delayHandler(i,t.performEntered)})})})},performEntered:function(){var t=this,e=this.getClassNames(ENTER).doneClassName,a={animateStatus:ENTERED,animateCss:e};this.safeSetData(a,function(){t.triggerEvent("change",{animateStatus:ENTERED}),t.triggerEvent(ENTERED,{isAppearing:t.isAppearing})})},performExit:function(){var t=this,e=this.getClassNames(EXIT),a=e.className,n=e.activeClassName,i=this.getTimeouts().exit,s={animateStatus:EXIT,animateCss:a},r={animateStatus:EXITING,animateCss:"".concat(a," ").concat(n)};if(!this.data.exit)return this.performExited();this.safeSetData(s,function(){t.triggerEvent("change",{animateStatus:EXIT}),t.triggerEvent(EXIT),t.delayHandler(TIMEOUT,function(){t.safeSetData(r,function(){t.triggerEvent("change",{animateStatus:EXITING}),t.triggerEvent(EXITING),i&&t.delayHandler(i,t.performExited)})})})},performExited:function(){var t=this,e=this.getClassNames(EXIT).doneClassName,a={animateStatus:EXITED,animateCss:e};this.safeSetData(a,function(){t.triggerEvent("change",{animateStatus:EXITED}),t.triggerEvent(EXITED),t.data.unmountOnExit&&t.setData({animateStatus:UNMOUNTED},function(){t.triggerEvent("change",{animateStatus:UNMOUNTED})})})},getClassNames:function(t){var e=this.data.classNames;return{className:"string"!=typeof e?e[t]:"".concat(e,"-").concat(t),activeClassName:"string"!=typeof e?e["".concat(t,"Active")]:"".concat(e,"-").concat(t,"-active"),doneClassName:"string"!=typeof e?e["".concat(t,"Done")]:"".concat(e,"-").concat(t,"-done")}},getTimeouts:function(){var t=this.data.duration;return null!==t&&"object"===_typeof(t)?{enter:t.enter,exit:t.exit}:"number"==typeof t?{enter:t,exit:t}:{}},updated:function(t){var e=this,a=(this.pendingData||this.data).animateStatus,n=null;t?(a===UNMOUNTED&&(a=EXITED,this.setData({animateStatus:EXITED},function(){e.triggerEvent("change",{animateStatus:EXITED})})),a!==ENTER&&a!==ENTERING&&a!==ENTERED&&(n=ENTERING)):a!==ENTER&&a!==ENTERING&&a!==ENTERED||(n=EXITING),this.updateStatus(n)},delayHandler:function(t,e){t&&(this.setNextCallback(e),setTimeout(this.nextCallback,t))},onTap:function(){this.triggerEvent("click")},noop:function(){}},attached:function(){var t=this,e=null,a=null;this.data.in?this.data.appear?(e=EXITED,a=ENTERING):e=ENTERED:e=this.data.unmountOnExit||this.data.mountOnEnter?UNMOUNTED:EXITED,this.safeSetData({animateStatus:e,isMounting:!0},function(){t.triggerEvent("change",{animateStatus:e}),t.updateStatus(a,!0)})}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ wrapCls }} {{ animateCss }}" bindtap="onTap" catchtouchmove="{{ disableScroll ? 'noop' : '' }}" bindtransitionend="onTransitionEnd" bindanimationend="onAnimationEnd" wx:if="{{ animateStatus !== 'unmounted' }}" style="{{ extStyle }}">
<slot></slot>
</view>
.wux-animate--fadeIn-enter{transition:opacity .3s;opacity:0}.wux-animate--fadeIn-enter-active,.wux-animate--fadeIn-enter-done{opacity:1}.wux-animate--fadeIn-exit{transition:opacity .3s;opacity:1}.wux-animate--fadeIn-exit-active,.wux-animate--fadeIn-exit-done{opacity:0}.wux-animate--fadeInDown-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(0,-100%,0)}.wux-animate--fadeInDown-enter-active,.wux-animate--fadeInDown-enter-done{opacity:1;transform:none}.wux-animate--fadeInDown-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInDown-exit-active,.wux-animate--fadeInDown-exit-done{opacity:0;transform:translate3d(0,-100%,0)}.wux-animate--fadeInLeft-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(-100%,0,0)}.wux-animate--fadeInLeft-enter-active,.wux-animate--fadeInLeft-enter-done{opacity:1;transform:none}.wux-animate--fadeInLeft-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInLeft-exit-active,.wux-animate--fadeInLeft-exit-done{opacity:0;transform:translate3d(-100%,0,0)}.wux-animate--fadeInRight-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(100%,0,0)}.wux-animate--fadeInRight-enter-active,.wux-animate--fadeInRight-enter-done{opacity:1;transform:none}.wux-animate--fadeInRight-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInRight-exit-active,.wux-animate--fadeInRight-exit-done{opacity:0;transform:translate3d(100%,0,0)}.wux-animate--fadeInUp-enter{transition:opacity .3s,transform .3s;opacity:0;transform:translate3d(0,100%,0)}.wux-animate--fadeInUp-enter-active,.wux-animate--fadeInUp-enter-done{opacity:1;transform:none}.wux-animate--fadeInUp-exit{transition:opacity .3s,transform .3s;opacity:1;transform:none}.wux-animate--fadeInUp-exit-active,.wux-animate--fadeInUp-exit-done{opacity:0;transform:translate3d(0,100%,0)}.wux-animate--slideInUp-enter{transition:transform .3s;transform:translate3d(0,100%,0);visibility:visible}.wux-animate--slideInUp-enter-active,.wux-animate--slideInUp-enter-done{transform:translateZ(0)}.wux-animate--slideInUp-exit{transition:transform .3s;transform:translateZ(0)}.wux-animate--slideInUp-exit-active,.wux-animate--slideInUp-exit-done{transform:translate3d(0,100%,0);visibility:visible}.wux-animate--slideInDown-enter{transition:transform .3s;transform:translate3d(0,-100%,0);visibility:visible}.wux-animate--slideInDown-enter-active,.wux-animate--slideInDown-enter-done{transform:translateZ(0)}.wux-animate--slideInDown-exit{transition:transform .3s;transform:translateZ(0)}.wux-animate--slideInDown-exit-active,.wux-animate--slideInDown-exit-done{transform:translate3d(0,-100%,0);visibility:visible}.wux-animate--slideInLeft-enter{transition:transform .3s;transform:translate3d(-100%,0,0);visibility:visible}.wux-animate--slideInLeft-enter-active,.wux-animate--slideInLeft-enter-done{transform:translateZ(0)}.wux-animate--slideInLeft-exit{transition:transform .3s;transform:translateZ(0)}.wux-animate--slideInLeft-exit-active,.wux-animate--slideInLeft-exit-done{transform:translate3d(-100%,0,0);visibility:visible}.wux-animate--slideInRight-enter{transition:transform .3s;transform:translate3d(100%,0,0);visibility:visible}.wux-animate--slideInRight-enter-active,.wux-animate--slideInRight-enter-done{transform:none}.wux-animate--slideInRight-exit{transition:transform .3s;transform:none}.wux-animate--slideInRight-exit-active,.wux-animate--slideInRight-exit-done{transform:translate3d(100%,0,0);visibility:visible}.wux-animate--zoom-enter{transition:all .3s cubic-bezier(.215,.61,.355,1);opacity:.01;transform:scale(.75)}.wux-animate--zoom-enter-active,.wux-animate--zoom-enter-done{opacity:1;transform:none}.wux-animate--zoom-exit{transition:all .25s linear;transform:none}.wux-animate--zoom-exit-active,.wux-animate--zoom-exit-done{opacity:.01;transform:scale(.75)}.wux-animate--punch-enter{transition:all .3s cubic-bezier(.215,.61,.355,1);opacity:.01;transform:scale(1.35)}.wux-animate--punch-enter-active,.wux-animate--punch-enter-done{opacity:1;transform:none}.wux-animate--punch-exit{transition:all .25s linear;transform:none}.wux-animate--punch-exit-active,.wux-animate--punch-exit-done{opacity:.01;transform:scale(1.35)}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/styleToCssString"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(e,t){var r=[],n=!0,a=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(n=(l=o.next()).done)&&(r.push(l.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw i}}return r}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-avatar"},shape:{type:String,value:"circle"},size:{type:String,value:"default"},src:{type:String,value:""},bodyStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}},scale:{type:Boolean,value:!1}},data:{extStyle:"",childrenStyle:""},computed:{classes:["prefixCls, shape, size, src",function(e,t,r,n){var a;return{wrap:(0,_classNames2.default)(e,(_defineProperty(a={},"".concat(e,"--").concat(t),t),_defineProperty(a,"".concat(e,"--").concat(r),r),_defineProperty(a,"".concat(e,"--thumb"),n),a)),string:"".concat(e,"__string")}}]},methods:{setScale:function(){var l=this,e=this.data.prefixCls,t=wx.createSelectorQuery().in(this);t.select(".".concat(e)).boundingClientRect(),t.select(".".concat(e,"__string")).boundingClientRect(),t.exec(function(e){if(!e.filter(function(e){return!e}).length){var t=_slicedToArray(e,2),r=t[0],n=t[1],a=r.width-8<n.width?(r.width-8)/n.width:1,i=1!=a?"position: absolute; display: inline-block; transform: scale(".concat(a,"); left: calc(50% - ").concat(Math.round(n.width/2),"px)"):"";l.setData({childrenStyle:i})}})}},ready:function(){!this.data.src&&this.data.scale&&this.setScale()}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ classes.wrap }}" style="{{ extStyle }}">
<image src="{{ src }}" wx:if="{{ src }}" />
<text class="{{ classes.string }}" style="{{ childrenStyle }}" wx:else>
<slot></slot>
</text>
</view>
.wux-avatar{box-sizing:border-box;display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:64rpx;height:64rpx;line-height:64rpx;border-radius:32rpx;font-size:36rpx}.wux-avatar .wux-avatar__string{line-height:64rpx}.wux-avatar--small{width:48rpx;height:48rpx;line-height:48rpx;border-radius:24rpx;font-size:28rpx}.wux-avatar--small .wux-avatar__string{line-height:48rpx}.wux-avatar--large{width:80rpx;height:80rpx;line-height:80rpx;border-radius:40rpx;font-size:48rpx}.wux-avatar--large .wux-avatar__string{line-height:80rpx}.wux-avatar--square{border-radius:8rpx}.wux-avatar--thumb{background:0 0}.wux-avatar>image{width:100%;height:100%}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-backdrop"},transparent:{type:Boolean,value:!1},zIndex:{type:Number,value:1e3},classNames:{type:null,value:"wux-animate--fadeIn"}},computed:{classes:["prefixCls, transparent",function(e,t){return{wrap:t?"".concat(e,"--transparent"):e}}]},methods:{retain:function(){"number"==typeof this.backdropHolds&&this.backdropHolds||(this.backdropHolds=0),this.backdropHolds=this.backdropHolds+1,1===this.backdropHolds&&this.setData({in:!0})},release:function(){1===this.backdropHolds&&this.setData({in:!1}),this.backdropHolds=Math.max(0,this.backdropHolds-1)},onClick:function(){this.triggerEvent("click")}}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-animation-group": "../animation-group/index"
}
}
\ No newline at end of file
<wux-animation-group wux-class="{{ classes.wrap }}" in="{{ in }}" classNames="{{ classNames }}" bind:click="onClick" wrapStyle="{{ { zIndex } }}" disableScroll />
.wux-backdrop{background:rgba(0,0,0,.4)}.wux-backdrop,.wux-backdrop--transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.wux-backdrop--transparent{background:0 0}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}(0,_baseComponent.default)({externalClasses:["wux-class-badge"],properties:{prefixCls:{type:String,value:"wux-badge"},count:{type:Number,value:0,observer:"updated"},overflowCount:{type:Number,value:99},dot:{type:Boolean,value:!1},showZero:{type:Boolean,value:!1},status:{type:String,value:""},text:{type:String,value:""}},data:{finalCount:0},computed:{classes:["prefixCls, status",function(e,t){return{wrap:(0,_classNames2.default)(e),status:"".concat(e,"__status"),statusDot:(0,_classNames2.default)("".concat(e,"__status-dot"),_defineProperty({},"".concat(e,"__status-dot--").concat(t),t)),statusText:"".concat(e,"__status-text"),dot:"".concat(e,"__dot"),count:"".concat(e,"__count")}}]},methods:{updated:function(e){var t=0<arguments.length&&void 0!==e?e:this.data.count,a=this.data.overflowCount,s=a<=t?"".concat(a,"+"):t;this.setData({finalCount:s})}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ classes.wrap }}">
<slot></slot>
<view class="{{ classes.status }}" wx:if="{{ status }}">
<view class="{{ classes.statusDot }}"></view>
<view class="{{ classes.statusText }}" wx:if="{{ text }}">{{ text }}</view>
</view>
<view class="{{ classes.dot }}" wx:elif="{{ dot }}"></view>
<view class="{{ classes.count }} wux-class-badge" wx:elif="{{ showZero && count === 0 }}">{{ finalCount }}</view>
<view class="{{ classes.count }} wux-class-badge" wx:elif="{{ count !== 0 }}">{{ finalCount }}</view>
</view>
\ No newline at end of file
.wux-badge{position:relative;display:inline-block;line-height:1;vertical-align:middle}.wux-badge__count{position:absolute;transform:translateX(50%);top:-12rpx;right:0;height:36rpx;border-radius:18rpx;min-width:36rpx;background:#ed3f14;color:#fff;line-height:36rpx;text-align:center;padding:0 10rpx;font-size:24rpx;white-space:nowrap;transform-origin:-10% center;z-index:10;box-shadow:0 0 0 2rpx #fff;box-sizing:border-box;text-rendering:optimizeLegibility}.wux-badge__dot{width:16rpx;height:16rpx;position:absolute;transform:translateX(-50%);transform-origin:0 center;top:-8rpx;right:-16rpx;border-radius:100%;background:#ed3f14;z-index:10;box-shadow:0 0 0 2rpx #fff}.wux-badge__status{line-height:inherit;vertical-align:baseline}.wux-badge__status-dot{width:12rpx;height:12rpx;display:inline-block;border-radius:50%;vertical-align:middle;position:relative;top:-2rpx}.wux-badge__status-dot--success{background-color:#52c41a}.wux-badge__status-dot--processing{background-color:#1890ff;position:relative}.wux-badge__status-dot--processing::after{position:absolute;top:-2rpx;left:-2rpx;width:100%;height:100%;border-radius:50%;border:2rpx solid #1890ff;content:"";animation:statusProcessing 1.2s infinite ease-in-out}.wux-badge__status-dot--default{background-color:#d9d9d9}.wux-badge__status-dot--error{background-color:#f5222d}.wux-badge__status-dot--warning{background-color:#faad14}.wux-badge__status-text{display:inline-block;color:rgba(0,0,0,.65);font-size:28rpx;margin-left:16rpx}@keyframes statusProcessing{0%{transform:scale(.8);opacity:.5}to{transform:scale(2.4);opacity:0}}
\ No newline at end of file
"use strict";var EAN13,pluginName;pluginName=null,EAN13=function(){function t(t,i,e,s){var n;if(this.id=t,this.number=i,this.ctx=s,this.settings={width:200,height:100,number:!0,prefix:!0,color:"black",debug:!1,onValid:function(){},onInvalid:function(){},onSuccess:function(){},onError:function(){}},e)for(n in e)this.settings[n]=e[n];this._name=pluginName,this.init()}return t.prototype.settings={},t.prototype.init=function(){var t,i;return 12===this.number.length&&(t=this.generateCheckDigit(this.number),this.number+=t),13===this.number.length?(this.validate()?this.settings.onValid.call():this.settings.onInvalid.call(),i=this.getCode(),this.draw(i)):this.settings.onError.call()},t.prototype.getCode=function(){var t,i,e,s,n,r,h;for(n=["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],r=["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],h=["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],i="",t=["xxxxxx","xxyxyy","xxyyxy","xxyyyx","xyxxyy","xyyxxy","xyyyxx","xyxyxy","xyxyyx","xyyxyx"][parseInt(this.number.substr(0,1),10)].split(""),s=this.number.substr(1).split(""),e=0;e<6;)"x"===t[e]?i+=n[s[e]]:i+=r[s[e]],e++;for(e=6;e<12;)i+=h[s[e]],e++;return i},t.prototype.clear=function(t){return t.clearRect(0,0,this.settings.width,this.settings.height)},t.prototype.draw=function(t){var e,s,i,n,r,h,o,f,l,u,x,c,g,a;if(h={prefix_offset:.06,font_stretch:.073,border_line_height_number:.9,border_line_height:1,line_height:.9,font_size:.15,font_y:1.03,text_offset:4.5},x=this.settings.prefix?this.settings.width-this.settings.width*h.prefix_offset:this.settings.width,i=this.settings.number?(e=h.border_line_height_number*this.settings.height,h.line_height*e):e=h.border_line_height*this.settings.height,r=x/95,this.id){for(s=wx.createCanvasContext(this.id,this.ctx),this.clear(s),s.setFillStyle(this.settings.color),o=this.settings.number&&this.settings.prefix?this.settings.width*h.prefix_offset:0,f=t.split(""),s.fillRect(o,0,r,e),o+=2*r,s.fillRect(o,0,r,e),o+=r,n=0;n<42;)"1"===f[n]&&s.fillRect(o,0,Math.floor(r)+1,i),o+=r,n++;for(o+=r,s.fillRect(o,0,r,e),o+=2*r,s.fillRect(o,0,r,e),o+=2*r,n=42;n<84;)"1"===f[n]&&s.fillRect(o,0,Math.floor(r)+1,i),o+=r,n++;if(s.fillRect(o,0,r,e),o+=2*r,s.fillRect(o,0,r,e),this.settings.number&&(s.setFontSize(h.font_size*i+"px monospace"),u=this.number.substr(0,1),this.settings.prefix&&s.fillText(u,0,e*h.font_y),l=r*h.text_offset+(this.settings.prefix?h.prefix_offset*this.settings.width:0),this.number.substr(1,6).split("").forEach(function(t,i){return s.fillText(t,l,e*h.font_y),l+=h.font_stretch*x}),l=49*r+(this.settings.prefix?h.prefix_offset*this.settings.width:0)+h.text_offset,this.number.substr(7).split("").forEach(function(t,i){return s.fillText(t,l,e*h.font_y),l+=h.font_stretch*x})),this.settings.debug)for(c=g=0,a=2*r;0<a?g<=x:x<=g;c=g+=a)s.beginPath(),s.rect(c,.4*i,r,.1*i),s.setFillStyle("red"),s.fill();return s.draw(),this.settings.onSuccess.call()}return this.settings.onError.call()},t.prototype.generateCheckDigit=function(t){var e;return e=0,t.split("").forEach(function(t,i){return e+=i%2==0?parseInt(t,10):3*parseInt(t,10)}),10-e%10%10},t.prototype.validate=function(){return parseInt(this.number.slice(-1),10)===this.generateCheckDigit(this.number.slice(0,-1))},t}(),"undefined"!=typeof module&&void 0!==module.exports&&(module.exports=EAN13);
\ No newline at end of file
"use strict";var _barcode=_interopRequireDefault(require("./barcode"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var defalutOptions={number:!0,prefix:!0,color:"black",debug:!1,onValid:function(){},onInvalid:function(){},onSuccess:function(){},onError:function(){}};Component({properties:{width:{type:Number,value:200},height:{type:Number,value:100},number:{type:String,value:"",observer:function(e){this.draw({number:e})}},options:{type:Object,value:defalutOptions},canvasId:{type:String,value:"wux-barcode"}},methods:{draw:function(e){var t=0<arguments.length&&void 0!==e?e:{},n=Object.assign({},this.data,t),i=n.canvasId,r=n.number,o=n.width,u=n.height,a=n.options;new _barcode.default(i,r,Object.assign({width:o,height:u},a),this)}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<canvas class="wux-class" canvas-id="{{ canvasId }}" style="width: {{ width + 'px' }}; height: {{ height + 'px' }};"></canvas>
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-button"},type:{type:String,value:"stable"},clear:{type:Boolean,value:!1},block:{type:Boolean,value:!1},full:{type:Boolean,value:!1},outline:{type:Boolean,value:!1},bordered:{type:Boolean,value:!0},size:{type:String,value:"default"},disabled:{type:Boolean,value:!1},loading:{type:Boolean,value:!1},formType:{type:String,value:""},openType:{type:String,value:""},hoverClass:{type:String,value:"default"},hoverStopPropagation:{type:Boolean,value:!1},hoverStartTime:{type:Number,value:20},hoverStayTime:{type:Number,value:70},lang:{type:String,value:"en"},sessionFrom:{type:String,value:""},sendMessageTitle:{type:String,value:""},sendMessagePath:{type:String,value:""},sendMessageImg:{type:String,value:""},showMessageCard:{type:Boolean,value:!1},appParameter:{type:String,value:""}},computed:{classes:["prefixCls, hoverClass, type, size, block, full, clear, outline, bordered, disabled",function(e,t,n,r,a,o,i,l,u,s){var p;return{wrap:(0,_classNames2.default)(e,(_defineProperty(p={},"".concat(e,"--").concat(n),n),_defineProperty(p,"".concat(e,"--").concat(r),r),_defineProperty(p,"".concat(e,"--block"),a),_defineProperty(p,"".concat(e,"--full"),o),_defineProperty(p,"".concat(e,"--clear"),i),_defineProperty(p,"".concat(e,"--outline"),l),_defineProperty(p,"".concat(e,"--bordered"),u),_defineProperty(p,"".concat(e,"--disabled"),s),p)),hover:t&&"default"!==t?t:"".concat(e,"--hover")}}]},methods:{onTap:function(){this.data.disabled||this.data.loading||this.triggerEvent("click")},bindgetuserinfo:function(e){this.triggerEvent("getuserinfo",e.detail)},bindcontact:function(e){this.triggerEvent("contact",e.detail)},bindgetphonenumber:function(e){this.triggerEvent("getphonenumber",e.detail)},bindopensetting:function(e){this.triggerEvent("opensetting",e.detail)},onError:function(e){this.triggerEvent("error",e.detail)}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<button
class="wux-class {{ classes.wrap }}"
disabled="{{ disabled }}"
loading="{{ loading }}"
form-type="{{ formType }}"
open-type="{{ openType }}"
hover-class="wux-hover-class {{ !disabled ? classes.hover : 'none' }}"
hover-stop-propagation="{{ hoverStopPropagation }}"
hover-start-time="{{ hoverStartTime }}"
hover-stay-time="{{ hoverStayTime }}"
lang="{{ lang }}"
bindgetuserinfo="bindgetuserinfo"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
bindcontact="bindcontact"
bindgetphonenumber="bindgetphonenumber"
app-parameter="{{ appParameter }}"
binderror="onError"
bindopensetting="bindopensetting"
bindtap="onTap"
>
<slot></slot>
</button>
.wux-button{padding:0;border-radius:0;color:inherit!important;background:0 0!important;font-size:inherit;font-weight:400;line-height:inherit;text-align:inherit;text-decoration:none;overflow:visible;min-height:0!important;width:auto!important;-webkit-tap-highlight-color:transparent;position:relative;display:inline-block;box-sizing:border-box;margin:0;padding:0 24rpx;min-width:104rpx;min-height:88rpx!important;border:none;border-radius:8rpx;vertical-align:middle;text-align:center;text-overflow:ellipsis;font-size:32rpx;line-height:84rpx;cursor:pointer}.wux-button::after{display:block;position:static;top:auto;left:auto;width:auto;height:auto;border:none;border-radius:0;transform:none;transform-origin:0 0}.wux-button::after{content:" ";width:100%;height:100%;position:absolute;top:-12rpx;right:-12rpx;bottom:-12rpx;left:-12rpx;border:none;transform:none;transform-origin:0 0;box-sizing:border-box;border-radius:0}.wux-button--bordered{border:2rpx solid transparent}.wux-button--disabled{opacity:.4!important}.wux-button--small{padding:4rpx 8rpx 2rpx;min-width:56rpx;min-height:60rpx!important;font-size:24rpx;line-height:52rpx}.wux-button--large{padding:0 32rpx;min-width:136rpx;min-height:118rpx!important;font-size:40rpx;line-height:106rpx}.wux-button--block,.wux-button--full{width:100%!important;margin-top:20rpx;margin-bottom:20rpx}.wux-button--block{display:block;clear:both}.wux-button--block::after{clear:both}.wux-button--full{display:block;margin-right:0!important;margin-left:0!important;border-right-width:0;border-left-width:0;border-radius:0}.wux-button--outline.wux-button--hover{color:#fff!important}.wux-button--light,.wux-button--light--disabled{border-color:transparent!important;background-color:#fff!important;color:#444!important}.wux-button--light.wux-button--hover{background-color:#e6e6e6!important;color:#444!important}.wux-button--light.wux-button--outline,.wux-button--light.wux-button--outline.wux-button--disabled{border-color:#fff!important;background-color:transparent!important;color:#fff!important}.wux-button--light.wux-button--outline.wux-button--hover{background-color:#fff!important;color:#fff!important}.wux-button--light.wux-button--clear,.wux-button--light.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#e6e6e6!important}.wux-button--light.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--stable,.wux-button--stable--disabled{border-color:transparent!important;background-color:#f8f8f8!important;color:#444!important}.wux-button--stable.wux-button--hover{background-color:#dfdfdf!important;color:#444!important}.wux-button--stable.wux-button--outline,.wux-button--stable.wux-button--outline.wux-button--disabled{border-color:#f8f8f8!important;background-color:transparent!important;color:#f8f8f8!important}.wux-button--stable.wux-button--outline.wux-button--hover{background-color:#f8f8f8!important;color:#fff!important}.wux-button--stable.wux-button--clear,.wux-button--stable.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#dfdfdf!important}.wux-button--stable.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--positive,.wux-button--positive--disabled{border-color:transparent!important;background-color:#387ef5!important;color:#fff!important}.wux-button--positive.wux-button--hover{background-color:#0c60ee!important;color:#fff!important}.wux-button--positive.wux-button--outline,.wux-button--positive.wux-button--outline.wux-button--disabled{border-color:#387ef5!important;background-color:transparent!important;color:#387ef5!important}.wux-button--positive.wux-button--outline.wux-button--hover{background-color:#387ef5!important;color:#fff!important}.wux-button--positive.wux-button--clear,.wux-button--positive.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#0c60ee!important}.wux-button--positive.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--calm,.wux-button--calm--disabled{border-color:transparent!important;background-color:#11c1f3!important;color:#fff!important}.wux-button--calm.wux-button--hover{background-color:#0a9dc7!important;color:#fff!important}.wux-button--calm.wux-button--outline,.wux-button--calm.wux-button--outline.wux-button--disabled{border-color:#11c1f3!important;background-color:transparent!important;color:#11c1f3!important}.wux-button--calm.wux-button--outline.wux-button--hover{background-color:#11c1f3!important;color:#fff!important}.wux-button--calm.wux-button--clear,.wux-button--calm.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#0a9dc7!important}.wux-button--calm.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--assertive,.wux-button--assertive--disabled{border-color:transparent!important;background-color:#ef473a!important;color:#fff!important}.wux-button--assertive.wux-button--hover{background-color:#e42112!important;color:#fff!important}.wux-button--assertive.wux-button--outline,.wux-button--assertive.wux-button--outline.wux-button--disabled{border-color:#ef473a!important;background-color:transparent!important;color:#ef473a!important}.wux-button--assertive.wux-button--outline.wux-button--hover{background-color:#ef473a!important;color:#fff!important}.wux-button--assertive.wux-button--clear,.wux-button--assertive.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#e42112!important}.wux-button--assertive.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--balanced,.wux-button--balanced--disabled{border-color:transparent!important;background-color:#33cd5f!important;color:#fff!important}.wux-button--balanced.wux-button--hover{background-color:#28a54c!important;color:#fff!important}.wux-button--balanced.wux-button--outline,.wux-button--balanced.wux-button--outline.wux-button--disabled{border-color:#33cd5f!important;background-color:transparent!important;color:#33cd5f!important}.wux-button--balanced.wux-button--outline.wux-button--hover{background-color:#33cd5f!important;color:#fff!important}.wux-button--balanced.wux-button--clear,.wux-button--balanced.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#28a54c!important}.wux-button--balanced.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--energized,.wux-button--energized--disabled{border-color:transparent!important;background-color:#ffc900!important;color:#fff!important}.wux-button--energized.wux-button--hover{background-color:#cca100!important;color:#fff!important}.wux-button--energized.wux-button--outline,.wux-button--energized.wux-button--outline.wux-button--disabled{border-color:#ffc900!important;background-color:transparent!important;color:#ffc900!important}.wux-button--energized.wux-button--outline.wux-button--hover{background-color:#ffc900!important;color:#fff!important}.wux-button--energized.wux-button--clear,.wux-button--energized.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#cca100!important}.wux-button--energized.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--royal,.wux-button--royal--disabled{border-color:transparent!important;background-color:#886aea!important;color:#fff!important}.wux-button--royal.wux-button--hover{background-color:#643de4!important;color:#fff!important}.wux-button--royal.wux-button--outline,.wux-button--royal.wux-button--outline.wux-button--disabled{border-color:#886aea!important;background-color:transparent!important;color:#886aea!important}.wux-button--royal.wux-button--outline.wux-button--hover{background-color:#886aea!important;color:#fff!important}.wux-button--royal.wux-button--clear,.wux-button--royal.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#643de4!important}.wux-button--royal.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--dark,.wux-button--dark--disabled{border-color:transparent!important;background-color:#444!important;color:#fff!important}.wux-button--dark.wux-button--hover{background-color:#2b2b2b!important;color:#fff!important}.wux-button--dark.wux-button--outline,.wux-button--dark.wux-button--outline.wux-button--disabled{border-color:#444!important;background-color:transparent!important;color:#444!important}.wux-button--dark.wux-button--outline.wux-button--hover{background-color:#444!important;color:#fff!important}.wux-button--dark.wux-button--clear,.wux-button--dark.wux-button--clear.wux-button--disabled{background-color:transparent!important;color:#2b2b2b!important}.wux-button--dark.wux-button--clear.wux-button--hover{opacity:.3!important}.wux-button--light.wux-button--outline{border-color:#ddd!important;background-color:transparent!important;color:#ddd!important}.wux-button--light.wux-button--outline.wux-button--hover{background-color:#ddd!important;color:#fff!important}.wux-button--stable.wux-button--outline{border-color:#b2b2b2!important;background-color:transparent!important;color:#b2b2b2!important}.wux-button--stable.wux-button--outline.wux-button--hover{background-color:#b2b2b2!important;color:#fff!important}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames4=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var defaults={prefixCls:"wux-calendar",monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["周日","周一","周二","周三","周四","周五","周六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],firstDay:1,weekendDays:[0,6],multiple:!1,dateFormat:"yyyy-mm-dd",direction:"horizontal",minDate:null,maxDate:null,touchMove:!0,animate:!0,closeOnSelect:!0,weekHeader:!0,toolbar:!0,value:[],onMonthAdd:function(){},onChange:function(){},onOpen:function(){},onClose:function(){},onDayClick:function(){},onMonthYearChangeStart:function(){},onMonthYearChangeEnd:function(){}},getTouchPosition=function(t){var e=t.touches[0]||t.changedTouches[0];return{x:e.pageX,y:e.pageY}},getTransform=function(t,e){return"transform: translate3d(".concat(e?t:0,"%, ").concat(e?0:t,"%, 0)")},isSameDate=function(t,e){var n=new Date(t),a=new Date(e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()};(0,_baseComponent.default)({useFunc:!0,data:defaults,computed:{classes:["prefixCls, direction",function(t,e){return{wrap:(0,_classNames4.default)(t,_defineProperty({},"".concat(t,"--").concat(e),e)),content:"".concat(t,"__content"),hd:"".concat(t,"__hd"),toolbar:"".concat(t,"__toolbar"),picker:"".concat(t,"__picker"),link:"".concat(t,"__link"),prev:(0,_classNames4.default)("".concat(t,"__icon"),_defineProperty({},"".concat(t,"__icon--prev"),!0)),next:(0,_classNames4.default)("".concat(t,"__icon"),_defineProperty({},"".concat(t,"__icon--next"),!0)),value:"".concat(t,"__value"),bd:"".concat(t,"__bd"),weekdays:"".concat(t,"__weekdays"),weekday:"".concat(t,"__weekday"),months:"".concat(t,"__months"),monthsContent:"".concat(t,"__months-content"),month:"".concat(t,"__month"),days:"".concat(t,"__days"),day:"".concat(t,"__day"),text:"".concat(t,"__text")}}]},methods:{open:function(t){var e=this,n=0<arguments.length&&void 0!==t?t:{},a=this.$$mergeOptionsAndBindMethods(Object.assign({},defaults,n));this.monthsTranslate=0,this.isH="horizontal"===a.direction,this.$$setData(_objectSpread({in:!0},a)).then(function(){return e.init()}),this.setValue(a.value),"function"==typeof this.fns.onOpen&&this.fns.onOpen.call(this)},close:function(){this.$$setData({in:!1}),"function"==typeof this.fns.onClose&&this.fns.onClose.call(this)},init:function(){var e=this,t=this.setWeekHeader(),n=this.setMonthsHTML(),a=this.setMonthsTranslate();return"function"==typeof this.fns.onMonthAdd&&n.forEach(function(t){return e.fns.onMonthAdd.call(e,t)}),this.$$setData({weeks:t,months:n,monthsTranslate:a,wrapperTranslate:""}).then(function(){return e.$$setData(_objectSpread({},e.updateCurrentMonthYear()))})},setMonthsTranslate:function(t){var e=0<arguments.length&&void 0!==t?t:this.monthsTranslate,n=100*-e,a=100*-(e-1);return[getTransform(100*-(e+1),this.isH),getTransform(n,this.isH),getTransform(a,this.isH)]},updateCurrentMonthYear:function(t){var e=this.data,n=e.months,a=e.monthNames;if(void 0===t){var s=parseInt(n[1].month,10);return{currentMonth:s,currentYear:parseInt(n[1].year,10),currentMonthName:a[s]}}var o=parseInt(n["next"===t?n.length-1:0].month,10);return{currentMonth:o,currentYear:parseInt(n["next"===t?n.length-1:0].year,10),currentMonthName:a[o]}},onTouchStart:function(t){!this.data.touchMove||this.isMoved||this.isRendered||(this.start=getTouchPosition(t),this.move={},this.touchesDiff=0,this.allowItemClick=!0,this.isMoved=!1)},onTouchMove:function(r){var i=this;if(this.data.touchMove&&!this.isRendered){this.allowItemClick=!1,this.isMoved||(this.isMoved=!0),this.$$setData({swiping:!0});var t=this.data.prefixCls,e=wx.createSelectorQuery().in(this);e.select(".".concat(t,"__months-content")).boundingClientRect(function(t){if(t&&i.isMoved){i.move=getTouchPosition(r),i.touchesDiff=i.isH?i.move.x-i.start.x:i.move.y-i.start.y;var e=t.width,n=t.height,a=i.touchesDiff/(i.isH?e:n),s=100*(i.monthsTranslate+a),o=getTransform(s,i.isH);i.$$setData({wrapperTranslate:"transition-duration: 0s; ".concat(o)})}}),e.exec()}},onTouchEnd:function(){var t=this;this.data.touchMove&&this.isMoved&&!this.isRendered&&(this.isMoved=!1,this.$$setData({swiping:!1}),Math.abs(this.touchesDiff)<30?this.resetMonth():30<=this.touchesDiff?this.prevMonth():this.nextMonth(),setTimeout(function(){return t.allowItemClick=!0},100))},onDayClick:function(t){if(this.allowItemClick){var e=t.currentTarget.dataset,n=e.year,a=e.month,s=e.day,o=e.type;if(o.selected&&!this.data.multiple)return;if(o.disabled)return;o.next&&this.nextMonth(),o.prev&&this.prevMonth(),"function"==typeof this.fns.onDayClick&&this.fns.onDayClick.call(this,n,a,s),this.addValue(new Date(n,a,s).getTime()),this.data.closeOnSelect&&!this.data.multiple&&this.close()}},resetMonth:function(){var t=100*this.monthsTranslate,e=getTransform(t,this.isH);this.$$setData({wrapperTranslate:"transition-duration: 0s; ".concat(e)})},setYearMonth:function(t,e){var n=this,a=0<arguments.length&&void 0!==t?t:this.data.currentYear,s=1<arguments.length&&void 0!==e?e:this.data.currentMonth,o=this.data,r=o.months,i=o.monthsTranslate,h=o.maxDate,c=o.minDate,u=o.currentYear,l=o.currentMonth,d=a<u?new Date(a,s+1,-1).getTime():new Date(a,s).getTime();if(!(h&&d>new Date(h).getTime()||c&&d<new Date(c).getTime())){var f=new Date(u,l).getTime(),m=f<d?"next":"prev",p=this.monthHTML(new Date(a,s)),g=this.monthsTranslate=this.monthsTranslate||0;if(f<d){this.monthsTranslate=this.monthsTranslate-1;var v=getTransform(100*-(g-1),this.isH);this.$$setData({months:[r[1],r[2],p],monthsTranslate:[i[1],i[2],v]})}else{this.monthsTranslate=this.monthsTranslate+1;var y=getTransform(100*-(g+1),this.isH);this.$$setData({months:[p,r[0],r[1]],monthsTranslate:[y,i[0],i[1]]})}this.onMonthChangeStart(m);var D=getTransform(100*this.monthsTranslate,this.isH),M=this.data.animate?.3:0,T="transition-duration: ".concat(M,"s; ").concat(D);this.$$setData({wrapperTranslate:T}),setTimeout(function(){return n.onMonthChangeEnd(m,!0)},M)}},nextYear:function(){this.setYearMonth(this.data.currentYear+1)},prevYear:function(){this.setYearMonth(this.data.currentYear-1)},nextMonth:function(){var t=this,e=this.data,n=e.months,a=e.monthsTranslate,s=e.maxDate,o=e.currentMonth,r=parseInt(n[n.length-1].month,10),i=parseInt(n[n.length-1].year,10),h=new Date(i,r).getTime();if(s&&h>new Date(s).getTime())return this.resetMonth();if(this.monthsTranslate=this.monthsTranslate-1,r===o){var c=100*-this.monthsTranslate,u=this.monthHTML(h,"next"),l=getTransform(c,this.isH),d=[this.data.months[1],this.data.months[2],u];this.$$setData({months:d,monthsTranslate:[a[1],a[2],l]}),"function"==typeof this.fns.onMonthAdd&&this.fns.onMonthAdd.call(this,d[d.length-1])}this.onMonthChangeStart("next");var f=getTransform(100*this.monthsTranslate,this.isH),m=this.data.animate?.3:0,p="transition-duration: ".concat(m,"s; ").concat(f);this.$$setData({wrapperTranslate:p}),setTimeout(function(){return t.onMonthChangeEnd("next")},m)},prevMonth:function(){var t=this,e=this.data,n=e.months,a=e.monthsTranslate,s=e.minDate,o=e.currentMonth,r=parseInt(n[0].month,10),i=parseInt(n[0].year,10),h=new Date(i,r+1,-1).getTime();if(s&&h<new Date(s).getTime())return this.resetMonth();if(this.monthsTranslate=this.monthsTranslate+1,r===o){var c=100*-this.monthsTranslate,u=this.monthHTML(h,"prev"),l=getTransform(c,this.isH),d=[u,this.data.months[0],this.data.months[1]];this.$$setData({months:d,monthsTranslate:[l,a[0],a[1]]}),"function"==typeof this.fns.onMonthAdd&&this.fns.onMonthAdd.call(this,d[0])}this.onMonthChangeStart("prev");var f=getTransform(100*this.monthsTranslate,this.isH),m=this.data.animate?.3:0,p="transition-duration: ".concat(m,"s; ").concat(f);this.$$setData({wrapperTranslate:p}),setTimeout(function(){return t.onMonthChangeEnd("prev")},m)},onMonthChangeStart:function(t){var e=this.updateCurrentMonthYear(t);this.$$setData(e),"function"==typeof this.fns.onMonthYearChangeStart&&this.fns.onMonthYearChangeStart.call(this,e.currentYear,e.currentMonth)},onMonthChangeEnd:function(t,e){var n,a,s,o=this,r=0<arguments.length&&void 0!==t?t:"next",i=1<arguments.length&&void 0!==e&&e,h=this.data,c=h.currentYear,u=h.currentMonth,l=_toConsumableArray(this.data.months);i?(a=this.monthHTML(new Date(c,u),"prev"),n=this.monthHTML(new Date(c,u),"next"),l=[a,l["next"===r?l.length-1:0],n]):(s=this.monthHTML(new Date(c,u),r),"next"===r?l=[l[1],l[2],s]:"prev"===r&&(l=[s,l[0],l[1]]));var d=this.setMonthsTranslate(this.monthsTranslate);this.isRendered=!0,this.$$setData({months:l,monthsTranslate:d}).then(function(){return o.isRendered=!1}),"function"==typeof this.fns.onMonthAdd&&this.fns.onMonthAdd.call(this,"next"===r?l[l.length-1]:l[0]),"function"==typeof this.fns.onMonthYearChangeEnd&&this.fns.onMonthYearChangeEnd.call(this,c,u)},setWeekHeader:function(){var t=this.data,e=t.weekHeader,n=t.firstDay,a=t.dayNamesShort,s=t.weekendDays,o=[];if(e)for(var r=0;r<7;r++){var i=6<r+n?r-7+n:r+n,h=a[i],c=0<=s.indexOf(i);o.push({weekend:c,dayName:h})}return o},daysInMonth:function(t){var e=new Date(t);return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()},monthHTML:function(t,e){var n=(t=new Date(t)).getFullYear(),a=t.getMonth(),s=t.getTime(),o={year:n,month:a,time:s,items:[]};"next"===e&&(t=11===a?new Date(n+1,0):new Date(n,a+1,1)),"prev"===e&&(t=0===a?new Date(n-1,11):new Date(n,a-1,1)),"next"!==e&&"prev"!==e||(a=t.getMonth(),n=t.getFullYear(),s=t.getTime());var r=this.daysInMonth(new Date(t.getFullYear(),t.getMonth()).getTime()-864e6),i=this.daysInMonth(t),h=new Date(t.getFullYear(),t.getMonth()).getDay();0===h&&(h=7);var c,u=[],l=this.data.firstDay-1+0,d=(new Date).setHours(0,0,0,0),f=this.data.minDate?new Date(this.data.minDate).getTime():null,m=this.data.maxDate?new Date(this.data.maxDate).getTime():null;if(this.data.value&&this.data.value.length)for(var p=0;p<this.data.value.length;p++)u.push(new Date(this.data.value[p]).setHours(0,0,0,0));for(var g=1;g<=6;g++){for(var v=[],y=1;y<=7;y++){var D=y,M=++l-h,T={};(c=M<0?(M=r+M+1,T.prev=!0,new Date(a-1<0?n-1:n,a-1<0?11:a-1,M).getTime()):i<(M+=1)?(M-=i,T.next=!0,new Date(11<a+1?n+1:n,11<a+1?0:a+1,M).getTime()):new Date(n,a,M).getTime())===d&&(T.today=!0),0<=u.indexOf(c)&&(T.selected=!0),0<=this.data.weekendDays.indexOf(D-1)&&(T.weekend=!0),(f&&c<f||m&&m<c)&&(T.disabled=!0);var w=(c=new Date(c)).getFullYear(),_=c.getMonth();v.push({type:T,year:w,month:_,day:M,date:"".concat(w,"-").concat(_+1,"-").concat(M)})}o.year=n,o.month=a,o.time=s,o.items.push(v)}return o},setMonthsHTML:function(){var t=this.data.value&&this.data.value.length?this.data.value[0]:(new Date).setHours(0,0,0,0);return[this.monthHTML(t,"prev"),this.monthHTML(t),this.monthHTML(t,"next")]},formatDate:function(t){var e=(t=new Date(t)).getFullYear(),n=t.getMonth(),a=n+1,s=t.getDate(),o=t.getDay();return this.data.dateFormat.replace(/yyyy/g,e).replace(/yy/g,(e+"").substring(2)).replace(/mm/g,a<10?"0"+a:a).replace(/m/g,a).replace(/MM/g,this.data.monthNames[n]).replace(/M/g,this.data.monthNamesShort[n]).replace(/dd/g,s<10?"0"+s:s).replace(/d/g,s).replace(/DD/g,this.data.dayNames[o]).replace(/D/g,this.data.dayNamesShort[o])},addValue:function(t){if(this.data.multiple){for(var e=this.data.value||[],n=-1,a=0;a<e.length;a++)isSameDate(t,e[a])&&(n=a);-1===n?e.push(t):e.splice(n,1),this.setValue(e)}else this.setValue([t])},setValue:function(t){var e=this;this.$$setData({value:t}).then(function(){return e.updateValue()})},updateValue:function(){var n=this,i={};this.data.months.forEach(function(t,a){t.items.forEach(function(t,n){t.forEach(function(t,e){t.type.selected&&(i["months[".concat(a,"].items[").concat(n,"][").concat(e,"].type.selected")]=!1)})})});for(var t=function(t){var e=new Date(n.data.value[t]),s=e.getFullYear(),o=e.getMonth(),r=e.getDate();n.data.months.forEach(function(t,a){t.year===s&&t.month===o&&t.items.forEach(function(t,n){t.forEach(function(t,e){t.year===s&&t.month===o&&t.day===r&&(i["months[".concat(a,"].items[").concat(n,"][").concat(e,"].type.selected")]=!0)})})})},e=0;e<this.data.value.length;e++)t(e);this.$$setData(i),"function"==typeof this.fns.onChange&&this.fns.onChange.call(this,this.data.value,this.data.value.map(function(t){return n.formatDate(t)}))},noop:function(){}}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-popup": "../popup/index"
}
}
\ No newline at end of file
<wux-popup position="bottom" visible="{{ in }}" zIndex="1010" safeArea="bottom" bind:close="close">
<view class="wux-class {{ classes.wrap }}">
<view class="{{ classes.content }}">
<view class="{{ classes.hd }}" wx:if="{{ toolbar }}">
<view class="{{ classes.toolbar }}">
<view class="{{ classes.picker }}">
<view class="{{ classes.link }}" bindtap="prevMonth">
<view class="{{ classes.prev }}"></view>
</view>
<view class="{{ classes.value }}">{{ currentMonthName }}</view>
<view class="{{ classes.link }}" bindtap="nextMonth">
<view class="{{ classes.next }}"></view>
</view>
</view>
<view class="{{ classes.picker }}">
<view class="{{ classes.link }}" bindtap="prevYear">
<view class="{{ classes.prev }}"></view>
</view>
<text class="{{ classes.value }}">{{ currentYear }}</text>
<view class="{{ classes.link }}" bindtap="nextYear">
<view class="{{ classes.next }}"></view>
</view>
</view>
</view>
</view>
<view class="{{ classes.bd }}">
<view class="{{ classes.weekdays }}" wx:if="{{ weekHeader }}">
<block wx:for="{{ weeks }}" wx:key="">
<view class="{{ classes.weekday }} {{ item.weekend ? prefixCls + '__weekday--weekend' : '' }}">
{{ item.dayName }}
</view>
</block>
</view>
<view class="{{ classes.months }}">
<view class="{{ classes.monthsContent }}" bindtouchstart="onTouchStart" catchtouchmove="{{ swiping ? 'noop' : '' }}" capture-bind:touchmove="onTouchMove" bindtouchend="onTouchEnd" style="{{ wrapperTranslate }}">
<block wx:for="{{ months }}" wx:for-item="month" wx:key="">
<view
data-year="{{ month.year }}"
data-month="{{ month.month }}"
class="{{ classes.month }} {{ index === 0 ? (prefixCls + '__month--prev') : index === 1 ? (prefixCls + '__month--current') : (prefixCls + '__month--next') }}"
style="{{ monthsTranslate[index] }}"
>
<block wx:for="{{ month.items }}" wx:for-item="row" wx:key="">
<view class="{{ classes.days }}">
<block wx:for="{{ row }}" wx:for-item="col" wx:key="">
<view
data-year="{{ col.year }}"
data-month="{{ col.month }}"
data-day="{{ col.day }}"
data-date="{{ col.date }}"
data-type="{{ col.type }}"
class="{{ classes.day }} {{ col.type.prev ? prefixCls + '__day--prev' : '' }} {{ col.type.next ? prefixCls + '__day--next' : '' }} {{ col.type.today ? prefixCls + '__day--today' : '' }} {{ col.type.selected ? prefixCls + '__day--selected' : '' }} {{ col.type.weekend ? prefixCls + '__day--weekend' : '' }} {{ col.type.disabled ? prefixCls + '__day--disabled' : '' }}"
bindtap="onDayClick"
>
<text class="{{ classes.text }}">{{ col.day }}</text>
</view>
</block>
</view>
</block>
</view>
</block>
</view>
</view>
</view>
</view>
</view>
</wux-popup>
.wux-calendar{position:relative;background:#fff;height:600rpx;width:100%;overflow:hidden}.wux-calendar__content{position:relative;width:100%;height:100%;transition:transform .3s}.wux-calendar__bd{height:100%;position:relative;overflow:hidden}.wux-calendar__hd{position:relative;width:100%}.wux-calendar__hd::before{content:" ";position:absolute;left:0;top:0;right:0;height:1PX;border-top:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 0;transform:scaleY(.5)}.wux-calendar__hd+.wux-calendar__bd{height:calc(97.8%)}.wux-calendar__toolbar{height:2.2rem;display:-ms-flexbox;display:flex;text-align:center}.wux-calendar__picker{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:50%;max-width:400rpx;-ms-flex-negative:10;flex-shrink:10;display:block;line-height:2.2rem}.wux-calendar__link{float:left;width:25%;height:2.2rem;line-height:2rem;min-width:72rpx}.wux-calendar__icon{display:inline-block;vertical-align:middle;background-size:100% auto;background-position:center}.wux-calendar__icon--next,.wux-calendar__icon--prev{width:.75rem;height:.75rem}.wux-calendar__icon--next{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2015%2015'%3E%3Cg%3E%3Cpath%20fill%3D'%23007aff'%20d%3D'M1%2C1.6l11.8%2C5.8L1%2C13.4V1.6%20M0%2C0v15l15-7.6L0%2C0L0%2C0z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.wux-calendar__icon--prev{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2015%2015'%3E%3Cg%3E%3Cpath%20fill%3D'%23007aff'%20d%3D'M14%2C1.6v11.8L2.2%2C7.6L14%2C1.6%20M15%2C0L0%2C7.6L15%2C15V0L15%2C0z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.wux-calendar__value{-ms-flex-negative:1;flex-shrink:1;position:relative;overflow:hidden;text-overflow:ellipsis;float:left;width:50%;height:2.2rem}.wux-calendar__weekdays{height:36rpx;background:#f7f7f8;display:-ms-flexbox;display:flex;font-size:22rpx;box-sizing:border-box;position:relative}.wux-calendar__weekdays::after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5)}.wux-calendar__weekdays+.wux-calendar__months{height:calc(82%)}.wux-calendar__weekday{-ms-flex-negative:1;flex-shrink:1;width:14.28571429%;width:calc(14.28571429%);line-height:34rpx;text-align:center}.wux-calendar__months{width:100%;height:100%;overflow:hidden;position:relative}.wux-calendar__months-content{width:100%;height:100%;display:-ms-flexbox;display:flex;position:relative;-webkit-backface-visibility:hidden;transform:translate3d(0,0,0)}.wux-calendar__month{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;height:100%;position:absolute;left:0;top:0}.wux-calendar__days{height:16.66666667%;height:calc(16.66666667%);display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;width:100%;position:relative}.wux-calendar__days::after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5)}.wux-calendar__days:last-child::after{display:none}.wux-calendar__day{-ms-flex-negative:1;flex-shrink:1;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;width:14.28571429%;width:calc(14.28571429%);text-align:center;color:#3d4145;font-size:30rpx;cursor:pointer}.wux-calendar__day--prev{color:#ccc}.wux-calendar__day--next{color:#ccc}.wux-calendar__day--disabled{color:#d4d4d4;cursor:auto}.wux-calendar__day--today .wux-calendar__text{background:#e3e3e3}.wux-calendar__day--selected .wux-calendar__text{background:#0894ec;color:#fff}.wux-calendar__text{display:inline-block;border-radius:100%;width:60rpx;height:60rpx;line-height:60rpx}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames3=_interopRequireDefault(require("../helpers/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/styleToCssString"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-card"},bordered:{type:Boolean,value:!0},full:{type:Boolean,value:!1},title:{type:String,value:""},thumb:{type:String,value:""},thumbStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}},extra:{type:String,value:""},actions:{type:Array,value:[]}},data:{extStyle:""},computed:{classes:["prefixCls, bordered, full, actions",function(a,e,t,n){var r;return{wrap:(0,_classNames3.default)(a,(_defineProperty(r={},"".concat(a,"--bordered"),e),_defineProperty(r,"".concat(a,"--full"),t),_defineProperty(r,"".concat(a,"--has-actions"),0<n.length),r)),hd:"".concat(a,"__hd"),content:"".concat(a,"__content"),thumb:"".concat(a,"__thumb"),extra:"".concat(a,"__extra"),bd:"".concat(a,"__bd"),ft:"".concat(a,"__ft"),actions:"".concat(a,"__actions"),action:n.map(function(e){var t;return{wrap:(0,_classNames3.default)("".concat(a,"__action"),(_defineProperty(t={},"".concat(a,"__action--").concat(e.type||"default"),e.type||"default"),_defineProperty(t,"".concat(a,"__action--bold"),e.bold),_defineProperty(t,"".concat(a,"__action--disabled"),e.disabled),_defineProperty(t,"".concat(e.className),e.className),t)),hover:e.hoverClass&&"default"!==e.hoverClass?e.hoverClass:"".concat(a,"__action--hover")}})}}]},methods:{onAction:function(e){var t=e.currentTarget.dataset.index,a=this.data.actions,n=a[t];n.disabled||this.triggerEvent("action",{index:t,action:n,actions:a})}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ classes.wrap }}">
<view class="{{ classes.hd }}" wx:if="{{ thumb || title || extra }}">
<view class="{{ classes.content }}" wx:if="{{ thumb || title }}">
<image class="{{ classes.thumb }}" src="{{ thumb }}" mode="aspectFit" style="{{ extStyle }}" wx:if="{{ thumb }}" />
<text>{{ title }}</text>
</view>
<view class="{{ classes.extra }}" wx:if="{{ extra }}">{{ extra }}</view>
<slot name="extra" wx:else></slot>
</view>
<view class="{{ classes.bd }}">
<slot name="body"></slot>
</view>
<view class="{{ classes.ft }}">
<slot name="footer"></slot>
</view>
<view class="{{ classes.actions }}" wx:if="{{ actions.length > 0 }}">
<block wx:for="{{ actions }}" wx:for-item="action" wx:key="">
<view
class="{{ classes.action[index].wrap }}"
hover-class="{{ !action.disabled ? classes.action[index].hover : 'none' }}"
data-index="{{ index }}"
bindtap="onAction"
>
{{ action.text }}
</view>
</block>
</view>
</view>
.wux-card{position:relative;min-height:192rpx;padding-bottom:12rpx;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#fff}.wux-card--bordered{border-radius:20rpx}.wux-card--bordered::before{content:" ";position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #d9d9d9;border-radius:20rpx;border-top-width:1PX;border-right-width:1PX;border-bottom-width:1PX;border-left-width:1PX}.wux-card--full::before{border-radius:0;border-right-width:0;border-left-width:0}.wux-card--has-actions{padding-bottom:0}.wux-card__hd{position:relative;display:-ms-flexbox;display:flex;font-size:34rpx;padding:18rpx 30rpx;-ms-flex-align:center;align-items:center}.wux-card__hd::before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5)}.wux-card__content{-ms-flex:1;flex:1;text-align:left;color:#000}.wux-card__thumb{width:64rpx;height:64rpx;display:inline-block;position:relative;margin-left:auto;margin-right:10rpx;overflow:hidden;vertical-align:middle}.wux-card__extra{-ms-flex:1;flex:1;text-align:right;font-size:34rpx;color:rgba(0,0,0,.45)}.wux-card__bd{position:relative;padding:30rpx 30rpx 12rpx;font-size:30rpx;color:rgba(0,0,0,.85);min-height:80rpx}.wux-card__ft{display:-ms-flexbox;display:flex;font-size:28rpx;color:rgba(0,0,0,.45);padding:0 30rpx}.wux-card__actions{position:relative;display:-ms-flexbox;display:flex;line-height:100rpx;margin-top:12rpx;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.wux-card__actions::before{content:" ";position:absolute;left:0;top:0;right:0;height:1PX;border-top:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 0;transform:scaleY(.5)}.wux-card__action{position:relative;display:block;-ms-flex:1;flex:1;color:#33cd5f;text-align:center}.wux-card__action::before{content:" ";position:absolute;right:0;top:0;width:1PX;bottom:0;border-right:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:100% 0;transform:scaleX(.5)}.wux-card__action:last-child::before{display:none}.wux-card__action--default{color:#444}.wux-card__action--primary{color:#33cd5f!important}.wux-card__action--bold{font-weight:500!important}.wux-card__action--hover{background-color:#ececec!important}.wux-card__action--disabled{opacity:.3}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/classNames")),_arrayTreeFilter=_interopRequireDefault(require("../helpers/arrayTreeFilter")),_props=require("../multi-picker-view/props");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(r,!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,_baseComponent.default)({properties:_objectSpread({},_props.props,{cols:{type:Number,value:3}}),data:{inputValue:[],showOptions:[],fieldNames:_props.defaultFieldNames},observers:_defineProperty({inputValue:function(e){this.fixFieldName();var r=this.getFieldName("value"),i=this.getFieldName("label"),t=this.getShowOptions(e).reduce(function(e,t){return[].concat(_toConsumableArray(e),[t.map(function(e){var t;return _defineProperty(t={},r,e[r]),_defineProperty(t,i,e[i]),_defineProperty(t,"disabled",!!e.disabled),t})])},[]);this.setData({showOptions:t})}},"value, options, cols",function(e,t,r){this.fixFieldName(),this.setValue(e,t,r)}),methods:{updated:function(e){this.data.inputValue!==e&&this.setData({inputValue:e})},setValue:function(e,t,r){var i=this.getRealValue(t,e,r);this.updated(i)},onValueChange:function(e){var t=e.detail,r=t.value,i=t.index,n=this.getNextValue(r,i),a=this.getRealValue(this.data.options,n),o=this.getValue(a);this.updated(a),this.triggerEvent("valueChange",_objectSpread({},o,{index:i}))},getValue:function(e){var t=0<arguments.length&&void 0!==e?e:this.data.inputValue,r=this.getRealValue(this.data.options,t),i=this.getShowOptions(r);return this.picker=this.picker||this.selectComponent("#wux-picker"),this.picker.getValue(r,i)},getNextValue:function(r,i){for(var e=this.data.options,n=this.getFieldName("value"),t=this.getFieldName("children"),a=(0,_arrayTreeFilter.default)(e,function(e,t){return t<=i&&e[n]===r[t]},{childrenKeyName:t})[i],o=i+1;o<this.data.cols;)a&&a[t]&&a[t].length&&(a=a[t][0],r[o]=a[n]),o++;return r.length=o,r},getRealValue:function(o,u,e){var l=this,s=2<arguments.length&&void 0!==e?e:this.data.cols;if(!u||!u.length||-1<u.indexOf(void 0)||u.length!==s){var t=function(){for(var t=l.getFieldName("value"),e=l.getFieldName("children"),r=[],i=_toConsumableArray(o),n=0;n<s;){if(i&&i.length){r[n]=u[n]||i[0][t];var a=0;r[n]&&-1===(a=i.map(function(e){return e[t]}).indexOf(r[n]))&&(a=0,r[n]=i[0][t]),i=i[a][e]}n++}return{v:r}}();if("object"===_typeof(t))return t.v}return u},getActiveOptions:function(r){var e=this.data.options,i=this.getFieldName("value"),t=this.getFieldName("children");return(0,_arrayTreeFilter.default)(e,function(e,t){return e[i]===r[t]},{childrenKeyName:t})},getShowOptions:function(e){var t=this.data,r=t.options,i=t.cols,n=this.getFieldName("children"),a=this.getActiveOptions(e).map(function(e){return e[n]}).filter(function(e){return!!e});return[r].concat(_toConsumableArray(a)).filter(function(e,t){return t<i})},getFieldName:function(e){return this.data.fieldNames[e]},fixFieldName:function(){if(!this.hasFieldName){var e=Object.assign({},_props.defaultFieldNames,this.data.defaultFieldNames);this.setData({fieldNames:e}),this.hasFieldName=!0}}},attached:function(){var e=this.data,t=e.value,r=e.options,i=e.cols;this.fixFieldName(),this.setValue(t,r,i)}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-multi-picker-view": "../multi-picker-view/index"
}
}
<wux-multi-picker-view
id="wux-picker"
prefixCls="{{ prefixCls }}"
pickerPrefixCls="{{ pickerPrefixCls }}"
value="{{ inputValue }}"
itemHeight="{{ itemHeight }}"
itemStyle="{{ itemStyle }}"
indicatorStyle="{{ indicatorStyle }}"
indicatorClass="{{ indicatorClass }}"
maskStyle="{{ maskStyle }}"
maskClass="{{ maskClass }}"
labelAlign="{{ labelAlign }}"
defaultFieldNames="{{ fieldNames }}"
options="{{ showOptions }}"
loading="{{ loading }}"
bind:valueChange="onValueChange"
/>
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/classNames")),_arrayTreeFilter=_interopRequireDefault(require("../helpers/arrayTreeFilter"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,a=new Array(e.length);t<e.length;t++)a[t]=e[t];return a}}var WUX_CASCADER="wux-cascader",defaultFieldNames={label:"label",value:"value",children:"children"};(0,_baseComponent.default)({externalClasses:["wux-scroll-view-class"],properties:{prefixCls:{type:String,value:"wux-cascader"},defaultValue:{type:Array,value:[]},value:{type:Array,value:[]},controlled:{type:Boolean,value:!1},title:{type:String,value:""},options:{type:Array,value:[]},chooseTitle:{type:String,value:"请选择"},visible:{type:Boolean,value:!1},defaultFieldNames:{type:Object,value:defaultFieldNames}},data:{activeOptions:[],activeIndex:0,bodyStyle:"",activeValue:[],showOptions:[],fieldNames:{}},computed:{classes:["prefixCls",function(e){return{wrap:(0,_classNames.default)(e),hd:"".concat(e,"__hd"),title:"".concat(e,"__title"),menus:"".concat(e,"__menus"),menu:"".concat(e,"__menu"),bd:"".concat(e,"__bd"),inner:"".concat(e,"__inner"),scrollView:"".concat(e,"__scroll-view"),option:"".concat(e,"__option"),item:"".concat(e,"__item"),icon:"".concat(e,"__icon"),ft:"".concat(e,"__ft")}}]},observers:{value:function(e){this.data.controlled&&(this.setData({activeValue:e}),this.getCurrentOptions(e))},options:function(){this.getCurrentOptions(this.data.activeValue)}},methods:{getActiveOptions:function(a){var e=this.data.options,i=this.getFieldName("value"),t=this.getFieldName("children");return(0,_arrayTreeFilter.default)(e,function(e,t){return e[i]===a[t]},{childrenKeyName:t})},getShowOptions:function(e){var t=this.data.options,a=this.getFieldName("children"),i=this.getActiveOptions(e).map(function(e){return e[a]}).filter(function(e){return!!e});return[t].concat(_toConsumableArray(i))},getMenus:function(e,t){var a=0<arguments.length&&void 0!==e?e:[],i=1<arguments.length?t:void 0,n=this.data,r=(n.options,n.chooseTitle),o=this.getActiveOptions(a);if(i){var l,s=this.getFieldName("value"),u=this.getFieldName("label");o.push((_defineProperty(l={},s,WUX_CASCADER),_defineProperty(l,u,r),l))}return o},getNextActiveValue:function(e,t){var a=this.data.activeValue;return(a=a.slice(0,t+1))[t]=e,a},updated:function(e,t,a,i){var n=this.getFieldName("value"),r=this.getFieldName("children"),o=e[r]&&0<e[r].length,l=this.getNextActiveValue(e[n],t),s=this.getMenus(l,o),u=s.length-1,c=this.getShowOptions(l),d={activeValue:l,activeOptions:s,activeIndex:u,showOptions:c};(o||l.length===c.length&&(t=Math.max(0,t-1)))&&(d.bodyStyle="transform: translate(".concat(-50*t,"%)"),d.showOptions=c),a&&this.setData(d),"function"==typeof i&&i.call(this,e,s,!o)},getCurrentOptions:function(e){var t=0<arguments.length&&void 0!==e?e:this.data.activeValue,a=Math.max(0,t.length-1),i=this.getActiveOptions(t),n=i[a];if(n)this.updated(n,a,!0);else{var r,o=this.getFieldName("value"),l=this.getFieldName("label");i.push((_defineProperty(r={},o,WUX_CASCADER),_defineProperty(r,l,this.data.chooseTitle),r));var s={showOptions:this.getShowOptions(t),activeOptions:i,activeIndex:i.length-1,bodyStyle:""};this.setData(s)}},onMenuClick:function(e){var t=e.currentTarget.dataset.menuIndex,a="transform: translate(".concat(-50*(1<t?t-1:0),"%)");this.setData({bodyStyle:a,activeIndex:t})},onItemSelect:function(e){var t=e.currentTarget.dataset,a=t.item,i=t.optionIndex;a&&!a.disabled&&this.updated(a,i,!this.data.controlled,this.onChange)},onPopupClose:function(){this.triggerEvent("close")},onChange:function(e,t,a){var i=this,n=0<arguments.length&&void 0!==e?e:{},r=2<arguments.length&&void 0!==a&&a,o=(1<arguments.length&&void 0!==t?t:[]).filter(function(e){return e[i.getFieldName("value")]!==WUX_CASCADER}),l=o.map(function(e){return e[i.getFieldName("value")]});if(!1===n.isLeaf&&!n.children)return this.emitEvent({value:l,options:o,done:!1}),void this.triggerEvent("load",{value:l,options:o});this.emitEvent({value:l,options:o,done:r})},emitEvent:function(e){var t=0<arguments.length&&void 0!==e?e:{};this.triggerEvent("change",t),t.done&&this.onPopupClose()},getFieldName:function(e){return this.data.fieldNames[e]}},attached:function(){var e=this.data,t=e.defaultValue,a=e.value,i=e.controlled?a:t,n=Object.assign({},defaultFieldNames,this.data.defaultFieldNames);this.setData({activeValue:i,fieldNames:n}),this.getCurrentOptions(i)}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-popup": "../popup/index"
}
}
\ No newline at end of file
<wux-popup position="bottom" visible="{{ visible }}" safeArea="bottom" bind:close="onPopupClose">
<view class="wux-class {{ classes.wrap }}">
<view class="{{ classes.hd }}">
<view class="{{ classes.title }}" wx:if="{{ title }}">{{ title }}</view>
<view class="{{ classes.menus }}" wx:if="{{ activeOptions.length }}">
<block wx:for="{{ activeOptions }}" wx:key="">
<view class="{{ classes.menu }} {{ activeIndex === index ? prefixCls + '__menu--active' : '' }}" data-menu-index="{{ index }}" bindtap="onMenuClick">{{ item[fieldNames['label']] }}</view>
</block>
</view>
</view>
<view class="{{ classes.bd }}" style="{{ bodyStyle }}">
<block wx:for="{{ showOptions }}" wx:for-item="option" wx:for-index="optionIndex" wx:key="">
<view class="{{ classes.inner }}">
<scroll-view scroll-y class="wux-scroll-view-class {{ classes.scrollView }}">
<view class="{{ classes.option }}">
<block wx:for="{{ option }}" wx:key="">
<view
class="{{ classes.item }} {{ activeValue[optionIndex] === item[fieldNames['value']] ? prefixCls + '__item--active' : '' }} {{ item.disabled ? prefixCls + '__item--disabled' : '' }}"
data-option-index="{{ optionIndex }}"
data-item="{{ item }}"
bindtap="onItemSelect"
>
<text>{{ item[fieldNames['label']] }}</text>
<icon class="{{ classes.icon }}" type="success_no_circle" size="16" color="#ef473a" wx:if="{{ activeValue[optionIndex] === item[fieldNames['value']] }}" />
</view>
</block>
</view>
</scroll-view>
</view>
</block>
</view>
</view>
</wux-popup>
.wux-cascader__hd{position:relative;width:100%;font-size:34rpx;line-height:1.5;color:#444}.wux-cascader__hd::after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5)}.wux-cascader__title{position:relative;height:88rpx;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-align:center;box-sizing:border-box}.wux-cascader__title::after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5)}.wux-cascader__menus{display:-ms-flexbox;display:flex;height:88rpx;padding:0 20rpx;-ms-flex-align:center;align-items:center;box-sizing:border-box}.wux-cascader__menu{font-size:26rpx;padding:0 20rpx;max-width:40%;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.wux-cascader__menu--active{color:#ef473a}.wux-cascader__bd{width:100%;display:-ms-flexbox;display:flex;transition:transform .3s;background-color:#f5f5f5}.wux-cascader__inner{display:block;height:inherit;width:50%;-ms-flex:0 0 50%;flex:0 0 50%;background-color:#fff}.wux-cascader__inner:nth-child(2n){background-color:#f5f5f5}.wux-cascader__scroll-view{max-height:540rpx}.wux-cascader__option{width:100%;height:inherit;display:block;padding:0 40rpx;box-sizing:border-box}.wux-cascader__item{position:relative;z-index:10;display:block;color:rgba(0,0,0,.85);font-size:26rpx;height:80rpx;line-height:80rpx;text-align:left;padding-right:36rpx;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.wux-cascader__item::after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5)}.wux-cascader__item--active{color:#ef473a}.wux-cascader__item--disabled{opacity:.3}.wux-cascader__icon{position:absolute;top:24rpx;right:0;z-index:20;font-size:0;line-height:1}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,_baseComponent.default)({options:{multipleSlots:!1},relations:{"../cell/index":{type:"descendant",observer:function(){this.debounce(this.updateIsLastElement)}}},properties:{prefixCls:{type:String,value:"wux-cell-group"},title:{type:String,value:""},label:{type:String,value:""}},computed:{classes:["prefixCls",function(e){return{wrap:(0,_classNames.default)(e),hd:"".concat(e,"__hd"),bd:"".concat(e,"__bd"),ft:"".concat(e,"__ft")}}]},methods:{updateIsLastElement:function(){var e=this.getRelationNodes("../cell/index");if(0<e.length){var n=e.length-1;e.forEach(function(e,t){e.updateIsLastElement(t===n)})}},getBoundingClientRect:function(t){var n=this,e=".".concat(this.data.prefixCls);wx.createSelectorQuery().in(this).select(e).boundingClientRect(function(e){e&&t.call(n,e.height)}).exec()}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ classes.wrap }}">
<view class="{{ classes.hd }}" wx:if="{{ title }}">{{ title }}</view>
<view class="{{ classes.bd }}">
<slot></slot>
</view>
<view class="{{ classes.ft }}" wx:if="{{ label }}">{{ label }}</view>
</view>
.wux-cell-group__hd{padding:30rpx 30rpx 18rpx;font-size:28rpx;color:rgba(0,0,0,.45);width:100%;box-sizing:border-box}.wux-cell-group__bd{position:relative;background-color:#fff}.wux-cell-group__bd::after{content:" ";position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #d9d9d9;border-top-width:1PX;border-bottom-width:1PX}.wux-cell-group__ft{padding:18rpx 30rpx 30rpx;font-size:28rpx;color:rgba(0,0,0,.45)}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames")),_eventsMixin=_interopRequireDefault(require("../helpers/eventsMixin"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var defaultEvents={onClick:function(){},onError:function(){}};(0,_baseComponent.default)({behaviors:[(0,_eventsMixin.default)({defaultEvents:defaultEvents})],relations:{"../cell-group/index":{type:"ancestor"},"../picker/index":{type:"parent"},"../date-picker/index":{type:"parent"},"../popup-select/index":{type:"parent"}},properties:{prefixCls:{type:String,value:"wux-cell"},disabled:{type:Boolean,value:!1},hoverClass:{type:String,value:"default"},hoverStopPropagation:{type:Boolean,value:!1},hoverStartTime:{type:Number,value:20},hoverStayTime:{type:Number,value:70},lang:{type:String,value:"en"},sessionFrom:{type:String,value:""},sendMessageTitle:{type:String,value:""},sendMessagePath:{type:String,value:""},sendMessageImg:{type:String,value:""},showMessageCard:{type:Boolean,value:!1},appParameter:{type:String,value:""},thumb:{type:String,value:""},title:{type:String,value:""},label:{type:String,value:""},extra:{type:String,value:""},isLink:{type:Boolean,value:!1},openType:{type:String,value:"navigateTo"},url:{type:String,value:""},delta:{type:Number,value:1}},data:{isLast:!1},computed:{classes:["prefixCls, hoverClass, isLast, isLink, disabled",function(e,t,n,a,i){var r;return{wrap:(0,_classNames2.default)(e,(_defineProperty(r={},"".concat(e,"--last"),n),_defineProperty(r,"".concat(e,"--access"),a),_defineProperty(r,"".concat(e,"--disabled"),i),r)),hd:"".concat(e,"__hd"),thumb:"".concat(e,"__thumb"),bd:"".concat(e,"__bd"),text:"".concat(e,"__text"),desc:"".concat(e,"__desc"),ft:"".concat(e,"__ft"),hover:t&&"default"!==t?t:"".concat(e,"--hover")}}]},methods:{onTap:function(){this.data.disabled||(this.triggerEvent("click"),this.linkTo())},bindgetuserinfo:function(e){this.triggerEvent("getuserinfo",e.detail)},bindcontact:function(e){this.triggerEvent("contact",e.detail)},bindgetphonenumber:function(e){this.triggerEvent("getphonenumber",e.detail)},bindopensetting:function(e){this.triggerEvent("opensetting",e.detail)},onError:function(e){this.triggerEvent("error",e.detail)},linkTo:function(){var e=this.data,t=e.url,n=e.isLink,a=e.openType,i=e.delta;return!!(n&&t&&["navigateTo","redirectTo","switchTab","navigateBack","reLaunch"].includes(a))&&("navigateBack"===a?wx[a].call(wx,{delta:i}):wx[a].call(wx,{url:t}))},updateIsLastElement:function(e){this.setData({isLast:e})}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<button
class="wux-class {{ classes.wrap }}"
disabled="{{ disabled }}"
open-type="{{ openType }}"
hover-class="{{ !disabled ? classes.hover : 'none' }}"
hover-stop-propagation="{{ hoverStopPropagation }}"
hover-start-time="{{ hoverStartTime }}"
hover-stay-time="{{ hoverStayTime }}"
lang="{{ lang }}"
bindgetuserinfo="bindgetuserinfo"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
bindcontact="bindcontact"
bindgetphonenumber="bindgetphonenumber"
app-parameter="{{ appParameter }}"
binderror="onError"
bindopensetting="bindopensetting"
bindtap="onTap"
>
<view class="{{ classes.hd }}">
<block wx:if="{{ thumb }}">
<image class="{{ classes.thumb }}" src="{{ thumb }}" />
</block>
<block wx:else>
<slot name="header"></slot>
</block>
</view>
<view class="{{ classes.bd }}">
<view wx:if="{{ title }}" class="{{ classes.text }}">{{ title }}</view>
<view wx:if="{{ label }}" class="{{ classes.desc }}">{{ label }}</view>
<slot></slot>
</view>
<view class="{{ classes.ft }}">
<block wx:if="{{ extra }}">{{ extra }}</block>
<block wx:else>
<slot name="footer"></slot>
</block>
</view>
</button>
.wux-cell{padding:0;margin:0;border-radius:0;color:inherit!important;background:0 0!important;font-size:inherit;font-weight:400;line-height:inherit;text-align:inherit;text-decoration:none;overflow:visible;min-height:0!important;width:auto!important;box-sizing:border-box;-webkit-tap-highlight-color:transparent;padding:20rpx 30rpx;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:#fff}.wux-cell::after{display:block;position:static;top:auto;left:auto;width:auto;height:auto;border:none;border-radius:0;transform:none;transform-origin:0 0}.wux-cell::after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1PX;border-bottom:1PX solid #d9d9d9;color:#d9d9d9;transform-origin:0 100%;transform:scaleY(.5);left:30rpx}.wux-cell--last::after{display:none}.wux-cell--hover{background-color:#ececec!important}.wux-cell--disabled{opacity:.3}.wux-cell__thumb{width:40rpx;height:40rpx;display:block;margin-right:10rpx}.wux-cell__bd{-ms-flex:1;flex:1}.wux-cell__text{text-align:left}.wux-cell__desc{text-align:left;line-height:1.2;font-size:24rpx;color:rgba(0,0,0,.45)}.wux-cell__ft{text-align:right;color:rgba(0,0,0,.45)}.wux-cell--access .wux-cell__ft{padding-right:34rpx;position:relative}.wux-cell--access .wux-cell__ft::after{content:" ";display:inline-block;width:30rpx;height:30rpx;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2216%22%20height%3D%2226%22%20viewBox%3D%220%200%2016%2026%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2%200L0%202l11.5%2011L0%2024l2%202%2014-13z%22%20fill%3D%22%23c7c7cc%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");background-size:contain;background-repeat:no-repeat;background-position:50% 50%;transform:rotate(0);transform:rotate(0) translateY(-50%);position:absolute;top:50%;right:0}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_eventsMixin=_interopRequireDefault(require("../helpers/eventsMixin"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(n,!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function getOptions(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).map(function(e,t){return"string"==typeof e?{title:e,value:e,index:t}:_objectSpread({},e,{index:t})})}function getCheckedValues(t){var e=_toConsumableArray(1<arguments.length&&void 0!==arguments[1]?arguments[1]:[]);return e=-1!==e.indexOf(t)?e.filter(function(e){return e!==t}):[].concat(_toConsumableArray(e),[t])}(0,_baseComponent.default)({useField:!0,behaviors:[(0,_eventsMixin.default)()],relations:{"../field/index":{type:"ancestor"},"../checkbox/index":{type:"descendant",observer:function(){this.debounce(this.changeValue)}}},properties:{prefixCls:{type:String,value:"wux-checkbox-group"},cellGroupPrefixCls:{type:String,value:"wux-cell-group"},value:{type:Array,value:[]},title:{type:String,value:""},label:{type:String,value:""},options:{type:Array,value:[]}},data:{inputValue:[],keys:[]},observers:{value:function(e){this.hasFieldDecorator||(this.updated(e),this.changeValue(e))},inputValue:function(e){this.hasFieldDecorator&&this.changeValue(e)},options:function(e){this.changeValue(this.data.inputValue,e)}},methods:{updated:function(e){this.data.inputValue!==e&&this.setData({inputValue:e})},changeValue:function(e,t){var n=0<arguments.length&&void 0!==e?e:this.data.inputValue,r=getOptions(1<arguments.length&&void 0!==t?t:this.data.options),a=this.getRelationNodes("../checkbox/index"),i=0<r.length?r:a?a.map(function(e){return e.data}):[];!r.length&&a&&0<a.length&&a.forEach(function(e,t){e.changeValue(Array.isArray(n)&&n.includes(e.data.value),t)}),this.data.keys!==i&&this.setData({keys:i})},onChange:function(e){var t=getCheckedValues(e.value,this.data.inputValue);this.hasFieldDecorator&&(e.value=t),this.triggerEvent("change",_objectSpread({},this.getValue(t),{},e,{name:this.data.name,value:e.value}))},onCheckboxChange:function(e){var t=e.currentTarget.dataset.index;this.onChange(_objectSpread({},e.detail,{index:t}))},getValue:function(e,t){var n=0<arguments.length&&void 0!==e?e:this.data.inputValue,r=1<arguments.length&&void 0!==t?t:this.data.keys,a=r.filter(function(e){return n.includes(e.value)}).map(function(e){return e.title})||[],i=r.map(function(e){return e.value}),o=n.map(function(e){return i.indexOf(e)});return{value:n,displayValue:a,selectedIndex:o,selectedValue:n,cols:r}},getBoundingClientRect:function(e){return this.cellGroup=this.cellGroup||this.selectComponent("#wux-cell-group"),this.cellGroup&&this.cellGroup.getBoundingClientRect(e)}}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-cell-group": "../cell-group/index",
"wux-checkbox": "../checkbox/index"
}
}
<wux-cell-group id="wux-cell-group" wux-class="{{ prefixCls }}" prefixCls="{{ cellGroupPrefixCls }}" title="{{ title }}" label="{{ label }}">
<block wx:for="{{ common.getOptions(options) }}" wx:for-item="option" wx:key="" wx:if="{{ options.length > 0 }}">
<wux-checkbox
prefixCls="{{ option.prefixCls || 'wux-checkbox' }}"
cellPrefixCls="{{ option.cellPrefixCls || 'wux-cell' }}"
selectablePrefixCls="{{ option.selectablePrefixCls || 'wux-selectable' }}"
title="{{ option.title }}"
label="{{ option.label }}"
extra="{{ option.extra }}"
value="{{ option.value }}"
checked="{{ common.getChecked(inputValue, option) }}"
disabled="{{ option.disabled }}"
color="{{ option.color || 'balanced' }}"
data-index="{{ index }}"
bind:change="onCheckboxChange"
/>
</block>
<block wx:if="{{ options.length === 0 }}">
<slot></slot>
</block>
</wux-cell-group>
<wxs module="common">
module.exports.getOptions = function(options) { return options.map(function(option) { if (option.constructor === 'String') { return { title: option, value: option } } return option }) }
module.exports.getChecked = function(values, option) { return values.indexOf(option.value) !== -1 }
</wxs>
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,_baseComponent.default)({relations:{"../checkbox-group/index":{type:"ancestor"}},properties:{prefixCls:{type:String,value:"wux-checkbox"},cellPrefixCls:{type:String,value:"wux-cell"},selectablePrefixCls:{type:String,value:"wux-selectable"},title:{type:String,value:""},label:{type:String,value:""},extra:{type:String,value:""},value:{type:String,value:""},checked:{type:Boolean,value:!1,observer:function(e){this.setData({inputChecked:e})}},disabled:{type:Boolean,value:!1},color:{type:String,value:"balanced"}},data:{index:0,inputChecked:!1},computed:{classes:["prefixCls",function(e){return{cell:(0,_classNames.default)(e),selectable:"".concat(e,"__selectable")}}]},methods:{checkboxChange:function(e){var t=this.data,a=t.value,l=t.index,n=t.disabled,i=this.getRelationNodes("../checkbox-group/index")[0],r={checked:e.detail.checked,value:a,index:l};n||(i?i.onChange(r):this.triggerEvent("change",r))},changeValue:function(e,t){var a=0<arguments.length&&void 0!==e&&e,l=1<arguments.length&&void 0!==t?t:0;this.setData({inputChecked:a,index:l})}}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-cell": "../cell/index",
"wux-selectable": "../selectable/index"
}
}
\ No newline at end of file
<wux-cell wux-class="{{ classes.cell }}" prefixCls="{{ cellPrefixCls }}" title="{{ title }}" label="{{ label }}" extra="{{ extra }}">
<wux-selectable slot="header" wux-class="{{ classes.selectable }}" prefixCls="{{ selectablePrefixCls }}" value="{{ value }}" checked="{{ inputChecked }}" color="{{ color }}" disabled="{{ disabled }}" controlled bind:change="checkboxChange" />
</wux-cell>
.wux-checkbox__selectable{position:static!important}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var toAngle=function(e){return e/180*Math.PI},percent=function(e){return toAngle(e/100*360)},easeInOutCubic=function(e,t,n,a){return(e/=a/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t};(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-circle"},percent:{type:Number,value:0,observer:"redraw"},strokeWidth:{type:Number,value:10},size:{type:Number,value:120,observer:"updateStyle"},lineCap:{type:String,value:"round"},backgroundColor:{type:String,value:"#f3f3f3"},color:{type:String,value:"#33cd5f"},sAngle:{type:Number,value:0,observer:function(e){this.setData({beginAngle:toAngle(e)})}},counterclockwise:{type:Boolean,value:!1},speed:{type:Number,value:2e3},animate:{type:Boolean,value:!0},background:{type:Boolean,value:!0}},data:{beginAngle:0,startAngle:0,endAngle:0,currentAngle:0},computed:{classes:["prefixCls",function(e){return{wrap:(0,_classNames.default)(e),inner:"".concat(e,"__inner")}}]},methods:{updateStyle:function(e){var t=0<arguments.length&&void 0!==e?e:this.data.size,n="width: ".concat(t,"px; height: ").concat(t,"px;");this.setData({style:n})},redraw:function(e){var t=this,n=0<arguments.length&&void 0!==e?e:this.data.percent,a=percent(n),i=Date.now(),r=this.data.currentAngle>a,s=r?this.data.endAngle:this.data.currentAngle;this.cancelNextCallback(),this.clearTimer(),this.safeSetData({startAngle:s,endAngle:a},function(){t.animate(i,i,r)})},draw:function(e){var t=this,n=!(0<arguments.length&&void 0!==e)||e,a=this.data,i=a.lineCap,r=a.backgroundColor,s=a.color,c=a.size,l=a.strokeWidth,u=a.counterclockwise,o=a.background,h=c/2,d=h-l/2,g=2*Math.PI,p=u?g-this.data.beginAngle:this.data.beginAngle,f=u?g-(this.data.beginAngle+this.data.currentAngle):this.data.beginAngle+this.data.currentAngle;this.ctx=this.ctx||wx.createCanvasContext("circle",this),this.ctx.clearRect(0,0,c,c),o&&(this.ctx.beginPath(),this.ctx.arc(h,h,d,0,2*Math.PI),this.ctx.setLineWidth(l),this.ctx.setStrokeStyle(r),this.ctx.stroke()),n&&(this.ctx.beginPath(),this.ctx.arc(h,h,d,p,f),this.ctx.setLineWidth(l),this.ctx.setStrokeStyle(s),this.ctx.setLineCap(i),this.ctx.stroke()),this.ctx.draw(!1,function(){t.triggerEvent("change",{value:t.data.currentAngle})})},animate:function(e,t,n){var a=this,i=Date.now(),r=i-e<1?1:i-e,s=this.data,c=s.animate,l=s.speed,u=s.startAngle,o=s.endAngle,h=!n&&1e3*this.data.currentAngle<=Math.floor(1e3*o)||n&&1e3*this.data.currentAngle>=Math.floor(1e3*o);if(c&&e-t<1.05*l&&h){var d=easeInOutCubic((e-t)/r,u,o-u,l/r),g=d<0?0:d;e=Date.now(),this.safeSetData({currentAngle:g},function(){a.draw(0!==g),a.timer=setTimeout(function(){return a.animate(e,t,n)},1e3/60)})}else this.safeSetData({currentAngle:o},function(){return a.draw(0!==o)})},clearTimer:function(){this.timer&&(clearTimeout(this.timer),this.timer=null)}},attached:function(){this.updateStyle(),0===this.data.percent&&this.draw(!1)},detached:function(){this.ctx=null,this.clearTimer()}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ classes.wrap }}" style="{{ style }}">
<canvas style="{{ style }}" canvas-id="circle" />
<view class="{{ classes.inner }}">
<slot></slot>
</view>
</view>
\ No newline at end of file
.wux-circle{display:inline-block;position:relative}.wux-circle__inner{width:100%;text-align:center;position:absolute;left:0;top:50%;transform:translate3d(0,-50%,0);line-height:1}
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,_baseComponent.default)({relations:{"../row/index":{type:"parent"}},properties:{prefixCls:{type:String,value:"wux-col"},span:{value:0,type:Number},offset:{value:0,type:Number},pull:{value:0,type:Number},push:{value:0,type:Number}},data:{colStyle:""},computed:{classes:["prefixCls, span, offset, pull, push",function(e,t,r,a,n){var o;return{wrap:(0,_classNames2.default)(e,(_defineProperty(o={},"".concat(e,"--span-").concat(t),t),_defineProperty(o,"".concat(e,"--offset-").concat(r),r),_defineProperty(o,"".concat(e,"--pull-").concat(a),a),_defineProperty(o,"".concat(e,"--push-").concat(n),n),o))}}]},methods:{updateStyle:function(e){this.data.colStyle!==e&&this.setData({colStyle:e})}}});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<view class="wux-class {{ classes.wrap }}" style="{{ colStyle }}">
<slot></slot>
</view>
.wux-col{position:relative;min-height:2rpx;box-sizing:border-box}.wux-col--span-12{float:left;width:100%}.wux-col--pull-12{right:100%}.wux-col--push-12{left:100%}.wux-col--offset-12{margin-left:100%}.wux-col--span-11{float:left;width:91.66666667%}.wux-col--pull-11{right:91.66666667%}.wux-col--push-11{left:91.66666667%}.wux-col--offset-11{margin-left:91.66666667%}.wux-col--span-10{float:left;width:83.33333333%}.wux-col--pull-10{right:83.33333333%}.wux-col--push-10{left:83.33333333%}.wux-col--offset-10{margin-left:83.33333333%}.wux-col--span-9{float:left;width:75%}.wux-col--pull-9{right:75%}.wux-col--push-9{left:75%}.wux-col--offset-9{margin-left:75%}.wux-col--span-8{float:left;width:66.66666667%}.wux-col--pull-8{right:66.66666667%}.wux-col--push-8{left:66.66666667%}.wux-col--offset-8{margin-left:66.66666667%}.wux-col--span-7{float:left;width:58.33333333%}.wux-col--pull-7{right:58.33333333%}.wux-col--push-7{left:58.33333333%}.wux-col--offset-7{margin-left:58.33333333%}.wux-col--span-6{float:left;width:50%}.wux-col--pull-6{right:50%}.wux-col--push-6{left:50%}.wux-col--offset-6{margin-left:50%}.wux-col--span-5{float:left;width:41.66666667%}.wux-col--pull-5{right:41.66666667%}.wux-col--push-5{left:41.66666667%}.wux-col--offset-5{margin-left:41.66666667%}.wux-col--span-4{float:left;width:33.33333333%}.wux-col--pull-4{right:33.33333333%}.wux-col--push-4{left:33.33333333%}.wux-col--offset-4{margin-left:33.33333333%}.wux-col--span-3{float:left;width:25%}.wux-col--pull-3{right:25%}.wux-col--push-3{left:25%}.wux-col--offset-3{margin-left:25%}.wux-col--span-2{float:left;width:16.66666667%}.wux-col--pull-2{right:16.66666667%}.wux-col--push-2{left:16.66666667%}.wux-col--offset-2{margin-left:16.66666667%}.wux-col--span-1{float:left;width:8.33333333%}.wux-col--pull-1{right:8.33333333%}.wux-col--push-1{left:8.33333333%}.wux-col--offset-1{margin-left:8.33333333%}
\ No newline at end of file
{
"components": [
"accordion",
"actionsheet",
"alert",
"animation-group",
"avatar",
"backdrop",
"badge",
"barcode",
"button",
"calendar",
"card",
"cascader",
"cascader-picker-view",
"cell",
"checkbox",
"circle",
"layout",
"countdown",
"countup",
"date-picker",
"date-picker-view",
"dialog",
"divider",
"fab-button",
"field",
"filterbar",
"form",
"gallery",
"grid",
"icon",
"image",
"index",
"input",
"input-number",
"keyboard",
"landscape",
"loading",
"media",
"multi-picker-view",
"navbar",
"notice-bar",
"notification",
"pagination",
"picker",
"picker-view",
"popover",
"popup",
"popup-select",
"progress",
"prompt",
"qrcode",
"radio",
"rater",
"refresher",
"result",
"search-bar",
"segmented-control",
"select",
"selectable",
"skeleton",
"slider",
"spin",
"steps",
"sticky",
"swipe-action",
"switch",
"tabs",
"tabbar",
"tag",
"textarea",
"timeago",
"timeline",
"toast",
"toptips",
"upload",
"vcode",
"virtual-list",
"white-space",
"wing-blank"
]
}
\ No newline at end of file
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var Countdown=function(){function n(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:getCurrentPages()[getCurrentPages().length-1];_classCallCheck(this,n),Object.assign(this,{page:e,options:t}),this.__init()}return _createClass(n,[{key:"__init",value:function(){this.setData=this.page.setData.bind(this.page),this.restart(this.options)}},{key:"setDefaults",value:function(){return{date:"June 7, 2087 15:03:25",refresh:1e3,offset:0,onEnd:function(){},render:function(t){}}}},{key:"mergeOptions",value:function(t){var e=this.setDefaults();for(var n in e)e.hasOwnProperty(n)&&(this.options[n]=void 0!==t[n]?t[n]:e[n],"date"===n&&"object"!==_typeof(this.options.date)&&(this.options.date=new Date(this.options.date)),"function"==typeof this.options[n]&&(this.options[n]=this.options[n].bind(this)));"object"!==_typeof(this.options.date)&&(this.options.date=new Date(this.options.date))}},{key:"getDiffDate",value:function(){var t=(this.options.date.getTime()-Date.now()+this.options.offset)/1e3,e={years:0,days:0,hours:0,min:0,sec:0,millisec:0};return t<=0?this.interval&&(this.stop(),this.options.onEnd()):(31557600<=t&&(e.years=Math.floor(t/31557600),t-=365.25*e.years*86400),86400<=t&&(e.days=Math.floor(t/86400),t-=86400*e.days),3600<=t&&(e.hours=Math.floor(t/3600),t-=3600*e.hours),60<=t&&(e.min=Math.floor(t/60),t-=60*e.min),e.sec=Math.round(t),e.millisec=t%1*1e3),e}},{key:"leadingZeros",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:2;return(t=String(t)).length>n?t:(Array(n+1).join("0")+t).substr(-n)}},{key:"update",value:function(t){return this.options.date="object"!==_typeof(t)?new Date(t):t,this.render(),this}},{key:"stop",value:function(){return this.interval&&(clearInterval(this.interval),this.interval=!1),this}},{key:"render",value:function(){return this.options.render(this.getDiffDate()),this}},{key:"start",value:function(){var t=this;return!this.interval&&(this.render(),this.options.refresh&&(this.interval=setInterval(function(){t.render()},this.options.refresh)),this)}},{key:"updateOffset",value:function(t){return this.options.offset=t,this}},{key:"restart",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};return this.mergeOptions(e),this.interval=!1,this.start(),this}}]),n}(),_default=Countdown;exports.default=_default;
\ No newline at end of file
"use strict";function _classCallCheck(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function _createClass(t,i,s){return i&&_defineProperties(t.prototype,i),s&&_defineProperties(t,s),t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var CountUp=function(){function r(t,i,s,a){var e=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},n=5<arguments.length&&void 0!==arguments[5]?arguments[5]:getCurrentPages()[getCurrentPages().length-1];_classCallCheck(this,r),Object.assign(this,{page:n,startVal:t,endVal:i,decimals:s,duration:a,options:e}),this.__init()}return _createClass(r,[{key:"__init",value:function(){this.setData=this.page.setData.bind(this.page),this.lastTime=0,this.mergeOptions(this.options),this.startVal=Number(this.startVal),this.cacheVal=this.startVal,this.endVal=Number(this.endVal),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,this.decimals||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(this.duration)||2e3,this.printValue(this.formattingFn(this.startVal))}},{key:"setDefaultOptions",value:function(){return{useEasing:!0,useGrouping:!0,separator:",",decimal:".",easingFn:null,formattingFn:null,printValue:function(t){}}}},{key:"mergeOptions",value:function(t){var i=this.setDefaultOptions();for(var s in i)i.hasOwnProperty(s)&&(this.options[s]=void 0!==t[s]?t[s]:i[s],"function"==typeof this.options[s]&&(this.options[s]=this.options[s].bind(this)));""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.printValue=this.options.printValue?this.options.printValue:function(){}}},{key:"requestAnimationFrame",value:function(t){var i=this,s=(new Date).getTime(),a=Math.max(0,16-(s-this.lastTime)),e=setTimeout(function(){t.bind(i)(s+a)},a);return this.lastTime=s+a,e}},{key:"cancelAnimationFrame",value:function(t){clearTimeout(t)}},{key:"formatNumber",value:function(t){var i,s,a,e;if(t=t.toFixed(this.decimals),s=(i=(t+="").split("."))[0],a=1<i.length?this.options.decimal+i[1]:"",e=/(\d+)(\d{3})/,this.options.useGrouping)for(;e.test(s);)s=s.replace(e,"$1"+this.options.separator+"$2");return this.options.prefix+s+a+this.options.suffix}},{key:"easeOutExpo",value:function(t,i,s,a){return s*(1-Math.pow(2,-10*t/a))*1024/1023+i}},{key:"count",value:function(t){this.startTime||(this.startTime=t);var i=(this.timestamp=t)-this.startTime;this.remaining=this.duration-i,this.options.useEasing?this.countDown?this.frameVal=this.startVal-this.easingFn(i,0,this.startVal-this.endVal,this.duration):this.frameVal=this.easingFn(i,this.startVal,this.endVal-this.startVal,this.duration):this.countDown?this.frameVal=this.startVal-(this.startVal-this.endVal)*(i/this.duration):this.frameVal=this.startVal+(this.endVal-this.startVal)*(i/this.duration),this.countDown?this.frameVal=this.frameVal<this.endVal?this.endVal:this.frameVal:this.frameVal=this.frameVal>this.endVal?this.endVal:this.frameVal,this.frameVal=Math.round(this.frameVal*this.dec)/this.dec,this.printValue(this.formattingFn(this.frameVal)),i<this.duration?this.rAF=this.requestAnimationFrame(this.count):this.callback&&this.callback()}},{key:"start",value:function(t){return this.callback=t,this.rAF=this.requestAnimationFrame(this.count),!1}},{key:"pauseResume",value:function(){this.paused?(this.paused=!1,delete this.startTime,this.duration=this.remaining,this.startVal=this.frameVal,this.requestAnimationFrame(this.count)):(this.paused=!0,this.cancelAnimationFrame(this.rAF))}},{key:"reset",value:function(){this.paused=!1,delete this.startTime,this.startVal=this.cacheVal,this.cancelAnimationFrame(this.rAF),this.printValue(this.formattingFn(this.startVal))}},{key:"update",value:function(t){this.cancelAnimationFrame(this.rAF),this.paused=!1,delete this.startTime,this.startVal=this.frameVal,this.endVal=Number(t),this.countDown=this.startVal>this.endVal,this.rAF=this.requestAnimationFrame(this.count)}}]),r}(),_default=CountUp;exports.default=_default;
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/classNames")),_index=_interopRequireDefault(require("./locales/index")),_props=require("./props");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(a,!0).forEach(function(e){_defineProperty(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ownKeys(a).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function _construct(e,t,a){return(_construct=isNativeReflectConstruct()?Reflect.construct:function(e,t,a){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return a&&_setPrototypeOf(n,a.prototype),n}).apply(null,arguments)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,a=new Array(e.length);t<e.length;t++)a[t]=e[t];return a}}var DATETIME="datetime",DATE="date",TIME="time",MONTH="month",YEAR="year",ONE_DAY=864e5;function fomartArray(e,t){for(var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,r=e,n=[];r<=t;)n.push(r),r+=a;return n}function getDaysInMonth(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function pad(e){return e<10?"0".concat(e):e+""}function cloneDate(e){return new Date(+e)}function setMonth(e,t){e.setDate(Math.min(e.getDate(),getDaysInMonth(new Date(e.getFullYear(),t)))),e.setMonth(t)}function valueToDate(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(e))return"string"==typeof e&&(e=e.replace(/\-/g,"/")),isNaN(Number(e))||(e=Number(e)),new Date(e);var a=t.mode,r=t.use12Hours,n=new Date,i=n.getFullYear(),u=n.getMonth(),o=n.getDate(),s=e.map(function(e){return Number(e)});if(r&&[DATETIME,TIME].includes(a)){var l=a===DATETIME?3:0,c=s.length-1,h=Number(s[c]),f=Number(s[l]);f=1===h?(f<=12&&(f+=12),24<=f?0:f):(0===f&&(f=12),12<f&&(f-=12),12<=f?0:f),s.splice(l,1,f),s.splice(c,1)}for(a===TIME?(s.unshift(o),s.unshift(u),s.unshift(i)):a===MONTH?s.push(o):a===YEAR&&(s.push(u),s.push(o));s.length<=6;)s.push(0);return _construct(Date,_toConsumableArray(s))}(0,_baseComponent.default)({properties:_props.props,data:{inputValue:[],options:[]},observers:_defineProperty({inputValue:function(){this.updatedCols()},value:function(e){this.setValue(e)}},"mode, minuteStep, use12Hours, minDate, maxDate, minHour, maxHour, minMinute, maxMinute, lang",function(){this.setValue(this.data.inputValue)}),methods:{getDefaultMinDate:function(){return this.defaultMinDate||(this.defaultMinDate=new Date(2e3,1,1,0,0,0)),this.defaultMinDate},getDefaultMaxDate:function(){return this.defaultMaxDate||(this.defaultMaxDate=new Date(2030,1,1,23,59,59)),this.defaultMaxDate},getMinDate:function(){return this.data.minDate?valueToDate(this.data.minDate,this.data):this.getDefaultMinDate()},getMaxDate:function(){return this.data.maxDate?valueToDate(this.data.maxDate,this.data):this.getDefaultMaxDate()},getDateMember:function(e,t){var a=1<arguments.length&&void 0!==t?t:"year",r={min:"getMinDate",max:"getMaxDate",year:"getFullYear",month:"getMonth",day:"getDate",hour:"getHours",minute:"getMinutes"};return this[r[0<arguments.length&&void 0!==e?e:"min"]]()[r[a]]()},getDisplayHour:function(e){return this.data.use12Hours&&(0===e&&(e=12),12<e&&(e-=12)),e},setHours:function(e,t){if(this.data.use12Hours){var a=t;a=24<=(a=12<=e.getHours()?t+12:t)?0:a,e.setHours(a)}else e.setHours(t)},setAmPm:function(e,t){0===t?e.setTime(+e-ONE_DAY/2):e.setTime(+e+ONE_DAY/2)},getNewDate:function(e,t){var a=parseInt(e[t],10),r=this.data.mode,n=cloneDate(this.getDate());if(r===DATETIME||r===DATE||r===YEAR||r===MONTH)switch(t){case 0:n.setFullYear(a);break;case 1:setMonth(n,a);break;case 2:n.setDate(a);break;case 3:this.setHours(n,a);break;case 4:n.setMinutes(a);break;case 5:this.setAmPm(n,a)}else if(r===TIME)switch(t){case 0:this.setHours(n,a);break;case 1:n.setMinutes(a);break;case 2:this.setAmPm(n,a)}return this.clipDate(n)},clipDate:function(e){var t=this.data.mode,a=this.getMinDate(),r=this.getMaxDate();if(t===DATETIME){if(e<a)return cloneDate(a);if(r<e)return cloneDate(r)}else if(t===DATE||t===YEAR||t===MONTH){if(+e+ONE_DAY<=a)return cloneDate(a);if(+r+ONE_DAY<=e)return cloneDate(r)}else if(t===TIME){var n=r.getHours(),i=r.getMinutes(),u=a.getHours(),o=a.getMinutes(),s=e.getHours(),l=e.getMinutes();if(s<u||s===u&&l<o)return cloneDate(a);if(n<s||s===n&&i<l)return cloneDate(r)}return e},getDate:function(e){var t=e||this.data.value;return this.clipDate(t?valueToDate(t,this.data):this.getMinDate())},getDateData:function(e){var t=this.data,a=t.mode,r=t.lang,n=_index.default[r],i=e.getFullYear(),u=e.getMonth(),o=this.getDateMember("min","year"),s=this.getDateMember("max","year"),l=this.getDateMember("min","month"),c=this.getDateMember("max","month"),h=this.getDateMember("min","day"),f=this.getDateMember("max","day"),D=fomartArray(o,s).map(function(e){return{value:e+"",label:e+n.year+""}});if(a===YEAR)return[D];var m=fomartArray(o===i?l:0,s===i?c:11).map(function(e){return{value:e+"",label:e+1+n.month+""}});return a===MONTH?[D,m]:[D,m,fomartArray(o===i&&l===u?h:1,s===i&&c===u?f:getDaysInMonth(e)).map(function(e){return{value:e+"",label:e+n.day+""}})]},getTimeData:function(e){var t=this.data,a=t.minHour,r=t.maxHour,n=t.minMinute,i=t.maxMinute,u=this.data,o=u.mode,s=u.minuteStep,l=u.use12Hours,c=u.lang,h=_index.default[c],f=this.getDateMember("min","minute"),D=this.getDateMember("max","minute"),m=this.getDateMember("min","hour"),g=this.getDateMember("max","hour"),p=e.getHours();if(o===DATETIME){var d=e.getFullYear(),M=e.getMonth(),b=e.getDate(),y=this.getDateMember("min","year"),v=this.getDateMember("max","year"),_=this.getDateMember("min","month"),A=this.getDateMember("max","month"),T=this.getDateMember("min","day"),E=this.getDateMember("max","day");y===d&&_===M&&T===b&&(a=m)===p&&(n=f),v===d&&A===M&&E===b&&(r=g)===p&&(i=D)}else(a=m)===p&&(n=f),(r=g)===p&&(i=D);var O=[];0===a&&0===r||0!==a&&0!==r?a=this.getDisplayHour(a):0===a&&l&&(a=1,O.push({value:"0",label:h.hour?"12"+h.hour:"12"})),r=this.getDisplayHour(r),O=[].concat(_toConsumableArray(O),_toConsumableArray(fomartArray(a,r).map(function(e){return{value:e+"",label:h.hour?e+h.hour+"":pad(e)}})));for(var H=[],x=e.getMinutes(),w=n;w<=i;w+=s)H.push({value:w+"",label:h.minute?w+h.minute+"":pad(w)}),w<x&&x<w+s&&H.push({value:x+"",label:h.minute?x+h.minute+"":pad(x)});var N=[{value:"0",label:h.am},{value:"1",label:h.pm}];return[O,H].concat(l?[N]:[])},getValueCols:function(e){var t=this.data,a=t.mode,r=t.use12Hours,n=this.getDate(e),i=[],u=[];if(a===YEAR)return{cols:this.getDateData(n),value:[n.getFullYear()+""]};if(a===MONTH)return{cols:this.getDateData(n),value:[n.getFullYear()+"",n.getMonth()+""]};if(a!==DATETIME&&a!==DATE||(i=this.getDateData(n),u=[n.getFullYear()+"",n.getMonth()+"",n.getDate()+""]),a===DATETIME||a===TIME){i=i.concat(this.getTimeData(n));var o=n.getHours(),s=n.getMinutes(),l=[o+"",s+""];r&&(l=[(0===o?12:12<o?o-12:o)+"",s+"",(12<=o?1:0)+""]),u=u.concat(l)}return{value:u,cols:i}},onValueChange:function(e){var t=e.detail,a=t.value,r=t.index,n=this.getNewDate(a,r),i=this.getValueCols(n),u=i.value,o=i.cols,s=this.getValue(u,o);this.triggerEvent("valueChange",_objectSpread({},e.detail,{},s,{date:+n}))},updatedCols:function(){var e=this.getValueCols().cols;this.setData({cols:e})},updated:function(e){this.data.inputValue!==e&&this.setData({inputValue:e})},setValue:function(e){0<arguments.length&&void 0!==e||this.data.inputValue;var t=this.getValueCols().value;this.updated(t)},getValue:function(e,t){var a=0<arguments.length&&void 0!==e?e:this.data.inputValue,r=1<arguments.length&&void 0!==t?t:this.data.cols;return this.picker=this.picker||this.selectComponent("#wux-picker"),_objectSpread({},this.picker.getValue(a,r),{date:+this.getDate()})}},attached:function(){this.setValue(this.data.value)}});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-multi-picker-view": "../multi-picker-view/index"
}
}
<wux-multi-picker-view
id="wux-picker"
prefixCls="{{ multiPickerPrefixCls }}"
pickerPrefixCls="{{ pickerPrefixCls }}"
value="{{ inputValue }}"
itemHeight="{{ itemHeight }}"
itemStyle="{{ itemStyle }}"
indicatorStyle="{{ indicatorStyle }}"
indicatorClass="{{ indicatorClass }}"
maskStyle="{{ maskStyle }}"
maskClass="{{ maskClass }}"
labelAlign="{{ labelAlign }}"
options="{{ cols }}"
bind:valueChange="onValueChange"
/>
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default={year:"",month:"",day:"",hour:"",minute:"",am:"AM",pm:"PM"};exports.default=_default;
\ No newline at end of file
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _en=_interopRequireDefault(require("./en")),_zh_CN=_interopRequireDefault(require("./zh_CN")),_zh_TW=_interopRequireDefault(require("./zh_TW"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default={en:_en.default,zh_CN:_zh_CN.default,zh_TW:_zh_TW.default};exports.default=_default;
\ No newline at end of file
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default={year:"",month:"",day:"",hour:"",minute:"",am:"上午",pm:"下午"};exports.default=_default;
\ No newline at end of file
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default={year:"",month:"",day:"",hour:"",minute:"",am:"上午",pm:"下午"};exports.default=_default;
\ No newline at end of file
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.props=void 0;var props={prefixCls:{type:String,value:"wux-date-picker"},multiPickerPrefixCls:{type:String,value:"wux-picker"},pickerPrefixCls:{type:String,value:"wux-picker-col"},value:{type:null,value:null},itemHeight:{type:Number,value:34},itemStyle:{type:[String,Object,Array],value:""},indicatorStyle:{type:[String,Object,Array],value:""},indicatorClass:{type:String,value:""},maskStyle:{type:[String,Object,Array],value:""},maskClass:{type:String,value:""},labelAlign:{type:String,value:"center"},mode:{type:String,value:"datetime"},minuteStep:{type:Number,value:1},use12Hours:{type:Boolean,value:!1},minDate:{type:null,value:null},maxDate:{type:null,value:null},minHour:{type:Number,value:0},maxHour:{type:Number,value:23},minMinute:{type:Number,value:0},maxMinute:{type:Number,value:59},lang:{type:String,value:"zh_CN"}};exports.props=props;
\ No newline at end of file
"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_popupMixin=_interopRequireDefault(require("../helpers/popupMixin")),_props=require("../date-picker-view/props"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var platformProps={labelPropName:"label",format:function(e,r){return(0,_utils.formatDate)(e.date,{datetime:"yyyy-MM-dd hh:mm",date:"yyyy-MM-dd",year:"yyyy",month:"yyyy-MM",time:"hh:mm"}[r.mode])}};(0,_baseComponent.default)({behaviors:[(0,_popupMixin.default)("#wux-picker",platformProps)],properties:_props.props});
\ No newline at end of file
{
"component": true,
"usingComponents": {
"wux-popup": "../popup/index",
"wux-date-picker-view": "../date-picker-view/index"
}
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册