"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames4=_interopRequireDefault(require("../helpers/classNames")),_gestures=require("../helpers/gestures");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(t,e){var i=[],n=!0,s=!1,o=void 0;try{for(var a,r=t[Symbol.iterator]();!(n=(a=r.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){s=!0,o=t}finally{try{n||null==r.return||r.return()}finally{if(s)throw o}}return i}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}(0,_baseComponent.default)({relations:{"../swipe-action-group/index":{type:"ancestor"}},properties:{prefixCls:{type:String,value:"wux-swipe"},autoClose:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1},left:{type:Array,value:[],observer:"updateBtns"},right:{type:Array,value:[],observer:"updateBtns"},useSlots:{type:Boolean,value:!1}},data:{index:0,swiping:!1,showCover:!1,offsetStyle:""},computed:{classes:["prefixCls, swiping",function(t,e){return{wrap:(0,_classNames4.default)(t,_defineProperty({},"".concat(t,"--swiping"),e)),cover:"".concat(t,"__cover"),left:(0,_classNames4.default)("".concat(t,"__actions"),_defineProperty({},"".concat(t,"__actions--left"),!0)),right:(0,_classNames4.default)("".concat(t,"__actions"),_defineProperty({},"".concat(t,"__actions--right"),!0)),action:"".concat(t,"__action"),text:"".concat(t,"__text"),content:"".concat(t,"__content")}}]},methods:{updated:function(t){this.data.index!==t&&this.setData({index:t})},onCloseSwipe:function(){var t=this.getRelationNodes("../swipe-action-group/index")[0];t&&t.onCloseSwipe(this.data.index)},getContentEasing:function(t,e){var i=Math.abs(t)-Math.abs(e),n=0Math.abs(e)?e:t):t},setStyle:function(t){var e=0this.btnsRightWidth/2,n=this.needShowLeft&&Math.abs(e)>this.btnsLeftWidth/2;i?this.onOpenRight():n?this.onOpenLeft():this.onClose(),this.swiping=!1,this.setData({swiping:!1}),this.needShowLeft=!1,this.needShowRight=!1}},noop:function(){}},created:function(){this.btnsLeftWidth=0,this.btnsRightWidth=0,this.openedLeft=!1,this.openedRight=!1,this.needShowLeft=!1,this.needShowRight=!1},ready:function(){this.updateBtns()}});