"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames=_interopRequireDefault(require("../helpers/libs/classNames"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-pagination"},mode:{type:String,value:"button"},defaultCurrent:{type:Number,value:1},current:{type:Number,value:1,observer:function(e){this.data.controlled&&this.updated(e)}},controlled:{type:Boolean,value:!1},total:{type:Number,value:0},simple:{type:Boolean,value:!1}},data:{activeIndex:1},computed:{classes:["prefixCls",function(e){return{wrap:(0,_classNames.default)(e),prev:"".concat(e,"__prev"),button:"".concat(e,"__button"),number:"".concat(e,"__number"),active:"".concat(e,"__active"),pointer:"".concat(e,"__pointer"),dot:"".concat(e,"__dot"),next:"".concat(e,"__next")}}]},methods:{updated:function(e){this.data.activeIndex!==e&&this.setData({activeIndex:e})},onChange:function(e,t){this.data.controlled||this.updated(e),this.triggerEvent("change",{current:e,type:t})},onPrev:function(){var e=this.data.activeIndex-1;this.onChange(e,"prev"),this.triggerEvent("prev",{current:e})},onNext:function(){var e=this.data.activeIndex+1;this.onChange(e,"next"),this.triggerEvent("next",{current:e})}},attached:function(){var e=this.data,t=e.defaultCurrent,n=e.current,e=e.controlled;this.updated(e?n:t)}});