"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames2=_interopRequireDefault(require("../helpers/libs/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/libs/styleToCssString")),_eventsMixin=_interopRequireDefault(require("../helpers/mixins/eventsMixin")),_useNativeRoute=require("../helpers/hooks/useNativeRoute"),_useDOM=require("../helpers/hooks/useDOM");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 _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}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:""},hasLine:{type:Boolean,value:!0},isLink:{type:Boolean,value:!1},openType:{type:String,value:"navigateTo"},url:{type:String,value:""},delta:{type:Number,value:1},wrapStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}},align:{type:String,value:"center"}},data:{isLast:!1,extStyle:""},computed:{classes:["prefixCls, hoverClass, isLast, hasLine, isLink, disabled, align",function(e,t,n,i,r,a,o){return{wrap:(0,_classNames2.default)(e,_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"".concat(e,"--last"),n),"".concat(e,"--has-line"),i),"".concat(e,"--access"),r),"".concat(e,"--disabled"),a),"".concat(e,"--align-").concat(o),o)),hd:"".concat(e,"__hd"),thumb:"".concat(e,"__thumb"),bd:"".concat(e,"__bd"),text:"".concat(e,"__text"),desc:"".concat(e,"__desc"),ft:"".concat(e,"__ft"),arrow:"".concat(e,"__arrow"),hover:t&&"default"!==t?t:"".concat(e,"--hover")}}]},methods:{onTap:function(){var e=this.data,t=e.disabled,n=e.url,i=e.isLink,r=e.openType,e=e.delta;t||(this.triggerEvent("click"),i&&n&&(0,_useNativeRoute.useNativeRoute)({url:n,openType:r,delta:e},this))},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)},bindlaunchapp:function(e){this.triggerEvent("launchapp",e.detail)},bindchooseavatar:function(e){this.triggerEvent("chooseavatar",e.detail)},onError:function(e){this.triggerEvent("error",e.detail)},updateIsLastElement:function(e){e!==this.data.isLast&&this.setData({isLast:e})},getBoundingClientRect:function(t){var n=this;(0,_useDOM.useRect)(".".concat(this.data.prefixCls),this).then(function(e){e&&t.call(n,e.height,e)})}}});