"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames4=_interopRequireDefault(require("../helpers/libs/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/libs/styleToCssString"));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.")}(0,_baseComponent.default)({relations:{"../timeline/index":{type:"parent"}},properties:{prefixCls:{type:String,value:"wux-timeline-item"},content:{type:String,value:""},dotStyle:{type:[String,Object],value:"",observer:function(e){this.setData({extStyle:(0,_styleToCssString.default)(e)})}},custom:{type:Boolean,value:!1}},data:{isLast:!1,isPending:!1,pending:!1,className:"",extStyle:""},computed:{classes:["prefixCls, isLast, pending, isPending, custom",function(e,t,n,i,r){return{wrap:(0,_classNames4.default)(e,_defineProperty(_defineProperty({},"".concat(e,"--last"),t),"".concat(e,"--pending"),n)),tail:(0,_classNames4.default)("".concat(e,"__tail"),_defineProperty({},"".concat(e,"__tail--pending"),i)),dot:(0,_classNames4.default)("".concat(e,"__dot"),_defineProperty({},"".concat(e,"__dot--custom"),r)),content:"".concat(e,"__content")}}]},methods:{updateIsLastElement:function(e){var t=e.index,n=e.isLast,i=e.isPending,r=e.pending,e=e.position,o=this.data.prefixCls,t="alternate"===e?t%2==0?"".concat(o,"--alternate ").concat(o,"--left"):"".concat(o,"--alternate ").concat(o,"--right"):"right"===e?"".concat(o,"--right"):"";this.setData({isLast:n,isPending:i,pending:r,className:t})}}});