module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmony imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 183);
/******/ })
/************************************************************************/
/******/ ({

/***/ 160:
/***/ (function(module, exports, __webpack_require__) {

var Component = __webpack_require__(9)(
  /* script */
  __webpack_require__(170),
  /* template */
  __webpack_require__(445),
  /* styles */
  null,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),

/***/ 170:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

exports.default = {
  name: 'XpRank',

  data: function data() {
    return {
      options: {},
      timer: null,
      rankHeight: 0,
      wrapHeight: 0,
      active: false,
      duration: 0
    };
  },


  props: {
    settings: {
      type: Object,
      default: function _default() {}
    },
    data: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },

  methods: {
    setBoolean: function setBoolean(bool, ret) {
      if (bool === undefined) {
        bool = ret;
      }
      return bool;
    },
    setOptions: function setOptions() {
      var settings = this.settings || {};
      this.options = {
        autoPlay: settings.autoPlay || false, // 自动播放
        playDuration: settings.playDuration || 4000,
        isPercent: this.setBoolean(settings.isPercent, true), // 是否是百分数
        fixed: settings.fixed || 2,
        showBar: this.setBoolean(settings.showBar, true), // 是否展示进度条
        wrapStyle: settings.wrapStyle || {}, // wrap样式
        itemStyle: settings.itemStyle || {}, // item样式
        iconStyle: settings.iconStyle || {}, // icon样式
        nameStyle: settings.nameStyle || {}, // name样式
        valueStyle: settings.valueStyle || {}, // value样式
        barStyle: settings.barStyle || {} };
    },
    updateData: function updateData() {
      this.setOptions();
      var options = this.options;
      if (options.autoPlay) {
        this.active = true;
        this.duration = options.playDuration || 20;
      }
    },
    calcValue: function calcValue(val) {
      var options = this.options;
      if (options.isPercent) {
        return val + '%';
      }
      return val;
    },
    calcWidth: function calcWidth(val, sum) {
      if (!sum) {
        sum = this.data.map(function (item) {
          return item.value;
        }).reduce(function (prev, next) {
          return prev + next;
        }, 0);
      }
      return val / sum * 100;
    }
  },

  watch: {
    settings: function settings(newVal) {
      this.updateData();
    }
  },

  mounted: function mounted() {
    this.updateData();
  }
};

/***/ }),

/***/ 183:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _rank = __webpack_require__(160);

var _rank2 = _interopRequireDefault(_rank);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* istanbul ignore next */
_rank2.default.install = function (Vue) {
  Vue.component(_rank2.default.name, _rank2.default);
};

exports.default = _rank2.default;

/***/ }),

/***/ 445:
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    ref: "rank",
    staticClass: "xp-rank u-fontNumber",
    style: (_vm.options.wrapStyle)
  }, [_c('div', {
    ref: "wrap",
    class: {
      'xp-rank__wrap': true,
    },
    style: ({
      msAnimationDuration: ((this.duration) + "s"),
      webkitAnimationDuration: ((this.duration) + "s"),
      animationDuration: ((this.duration) + "s"),
    })
  }, _vm._l((_vm.data), function(item, index) {
    return _c('div', {
      staticClass: "xp-rank__item",
      style: (_vm.options.itemStyle)
    }, [_c('span', {
      staticClass: "xp-rank__itemIcon",
      style: (_vm.options.iconStyle)
    }, [_vm._v(_vm._s(index + 1))]), _vm._v(" "), _c('span', {
      staticClass: "xp-rank__itemName",
      style: (_vm.options.nameStyle)
    }, [_vm._v(_vm._s(item.name))]), _vm._v(" "), _c('span', {
      staticClass: "xp-rank__itemValue",
      style: (_vm.options.valueStyle)
    }, [_vm._v(_vm._s(_vm.calcValue(item.value)))]), _vm._v(" "), _c('span', {
      directives: [{
        name: "show",
        rawName: "v-show",
        value: (_vm.options.showBar),
        expression: "options.showBar"
      }],
      staticClass: "xp-rank__itemBar",
      style: (Object.assign({}, _vm.options.barStyle, {
        width: ((_vm.calcWidth(item.value)) + "%")
      }))
    })])
  }))])
},staticRenderFns: []}

/***/ }),

/***/ 9:
/***/ (function(module, exports) {

/* globals __VUE_SSR_CONTEXT__ */

// this module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle

module.exports = function normalizeComponent (
  rawScriptExports,
  compiledTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */
) {
  var esModule
  var scriptExports = rawScriptExports = rawScriptExports || {}

  // ES6 modules interop
  var type = typeof rawScriptExports.default
  if (type === 'object' || type === 'function') {
    esModule = rawScriptExports
    scriptExports = rawScriptExports.default
  }

  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

  // render functions
  if (compiledTemplate) {
    options.render = compiledTemplate.render
    options.staticRenderFns = compiledTemplate.staticRenderFns
  }

  // scopedId
  if (scopeId) {
    options._scopeId = scopeId
  }

  var hook
  if (moduleIdentifier) { // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = injectStyles
  }

  if (hook) {
    var functional = options.functional
    var existing = functional
      ? options.render
      : options.beforeCreate
    if (!functional) {
      // inject component registration as beforeCreate hook
      options.beforeCreate = existing
        ? [].concat(existing, hook)
        : [hook]
    } else {
      // register for functioal component in vue file
      options.render = function renderWithStyleInjection (h, context) {
        hook.call(context)
        return existing(h, context)
      }
    }
  }

  return {
    esModule: esModule,
    exports: scriptExports,
    options: options
  }
}


/***/ })

/******/ });