"use strict";

var _lodash = _interopRequireDefault(require("lodash"));

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

var PROVINCE = 'province';
var CITY = 'city';
var DISTRICT = 'district';
var PROJECT = 'project';

var CitySelector =
/*#__PURE__*/
function () {
  function CitySelector(props) {
    _classCallCheck(this, CitySelector);

    this.DEFAULTS = {
      simple: false,
      Clickable: {},
      responsive: false,
      placeholder: '请选择省/市/区(包括地级市)',
      level: 'project',
      province: '',
      city: '',
      district: '',
      project: '',
      handEnd: function handEnd() {}
    };
    this.$dropdown = null;
    this.options = Object.assign({}, this.DEFAULTS, _lodash["default"].isPlainObject(props.options) ? props.options : {});
    this.active = false;
    this.dems = [];
    this.needBlur = false;
  }

  _createClass(CitySelector, [{
    key: "setDefaults",
    value: function setDefaults(options) {
      this.DEFAULTS = Object.assign(this.DEFAULTS, options);
    }
  }, {
    key: "init",
    value: function init() {}
  }, {
    key: "render",
    value: function render() {}
  }, {
    key: "refresh",
    value: function refresh() {}
  }, {
    key: "defineDems",
    value: function defineDems() {}
  }, {
    key: "includeDem",
    value: function includeDem() {}
  }, {
    key: "getPosition",
    value: function getPosition() {}
  }, {
    key: "getSize",
    value: function getSize() {}
  }, {
    key: "getWidthStyle",
    value: function getWidthStyle(w, dropdown) {
      return 'width:500px;';
    }
  }, {
    key: "simplize",
    value: function simplize(address, type) {
      address = address || '';

      if (type === PROVINCE) {
        return address.replace(/[省,市,自治区,壮族,回族,维吾尔]/g, '');
      } else if (type === CITY) {
        return address.replace(/[市,地区,回族,蒙古,苗族,白族,傣族,景颇族,藏族,彝族,壮族,傈僳族,布依族,侗族]/g, '').replace('哈萨克', '').replace('自治州', '').replace(/自治县/, '');
      } else if (type === DISTRICT) {
        return address;
      }
    }
  }, {
    key: "symbolNumber",
    value: function symbolNumber(num) {
      var symbolArr = ['①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳', '㉑', '㉒', '㉓', '㉔', '㉕', '㉖', '㉗', '㉘', '㉙', '㉚', '㉛', '㉜', '㉝', '㉞', '㉟', '㊱', '㊲', '㊳', '㊴', '㊵', '㊶', '㊷', '㊸', '㊹', '㊺', '㊻', '㊼', '㊽', '㊾', '㊿'];
      return symbolArr[num - 1];
    }
  }]);

  return CitySelector;
}();