"use strict";var _baseComponent=_interopRequireDefault(require("../helpers/baseComponent")),_classNames3=_interopRequireDefault(require("../helpers/libs/classNames")),_styleToCssString=_interopRequireDefault(require("../helpers/libs/styleToCssString")),_colors=require("../helpers/colors");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,o){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,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 o=e[Symbol.toPrimitive];if(void 0===o)return("string"===t?String:Number)(e);o=o.call(e,t||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}(0,_baseComponent.default)({properties:{prefixCls:{type:String,value:"wux-spin"},classNames:{type:null,value:"wux-animate--fadeIn"},tip:{type:String,value:""},size:{type:String,value:"default"},spinning:{type:Boolean,value:!0,observer:"updated"},nested:{type:Boolean,value:!1},spinColor:{type:String,value:"default",observer:"setStyles"}},data:{spinVisible:!0,dotStyle:"",tipStyle:""},computed:{classes:["prefixCls, size, nested, tip, spinVisible",function(e,t,o,r,n){return{wrap:(0,_classNames3.default)(e,_defineProperty(_defineProperty(_defineProperty({},"".concat(e,"--").concat(t),t),"".concat(e,"--nested"),o),"".concat(e,"--show-text"),r)),anim:"".concat(e,o?"__spinning--nested":"__spinning"),dots:"".concat(e,"__dots"),dot:"".concat(e,"__dot"),tip:"".concat(e,"__tip"),container:(0,_classNames3.default)("".concat(e,"__container"),_defineProperty({},"".concat(e,"__container--blur"),n))}}]},methods:{updated:function(e){this.data.nested&&this.setData({spinVisible:e})},setStyles:function(e){var e=(0,_colors.isPresetColor)(e),t="default"!==e?(0,_styleToCssString.default)({backgroundColor:e}):"",e="default"!==e?(0,_styleToCssString.default)({color:e}):"";this.data.dotStyle===t&&this.data.tipStyle===e||this.setData({dotStyle:t,tipStyle:e})},attached:function(){this.setStyles(this.data.spinColor)}}});