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;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// 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 = "/dist/";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 159);
/******/ })
/************************************************************************/
/******/ ({

/***/ 1:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent (
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier, /* server only */
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

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

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + 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 = shadowMode
      ? function () {
        injectStyles.call(
          this,
          (options.functional ? this.parent : this).$root.$options.shadowRoot
        )
      }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection (h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing
        ? [].concat(existing, hook)
        : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}


/***/ }),

/***/ 159:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: external "tdh-element-ui/lib/utils/resize-event"
var resize_event_ = __webpack_require__(23);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/clamp/src/main.vue?vue&type=script&lang=js&

// import { addListener, removeListener } from 'resize-detector';


/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'ElClamp',
  props: {
    tag: {
      type: String,
      default: 'div'
    },
    autoresize: {
      type: Boolean,
      default: false
    },
    maxLines: Number,
    maxHeight: [String, Number],
    ellipsis: {
      type: String,
      default: '…'
    },
    location: {
      type: String,
      default: 'end',
      validator: function validator(value) {
        return ['start', 'middle', 'end'].indexOf(value) !== -1;
      }
    },
    expanded: Boolean
  },
  data: function data() {
    return {
      offset: null,
      text: this.getText(),
      localExpanded: !!this.expanded
    };
  },

  computed: {
    clampedText: function clampedText() {
      if (this.location === 'start') {
        return this.ellipsis + (this.text.slice(-this.offset) || '').trim();
      } else if (this.location === 'middle') {
        var split = Math.floor(this.offset / 2);
        return (this.text.slice(0, split) || '').trim() + this.ellipsis + (this.text.slice(-split) || '').trim();
      }

      return (this.text.slice(0, this.offset) || '').trim() + this.ellipsis;
    },
    isClamped: function isClamped() {
      if (!this.text) {
        return false;
      }
      return this.offset !== this.text.length;
    },
    realText: function realText() {
      return this.isClamped ? this.clampedText : this.text;
    },
    realMaxHeight: function realMaxHeight() {
      if (this.localExpanded) {
        return null;
      }
      var maxHeight = this.maxHeight;

      if (!maxHeight) {
        return null;
      }
      return typeof maxHeight === 'number' ? maxHeight + 'px' : maxHeight;
    }
  },
  watch: {
    expanded: function expanded(val) {
      this.localExpanded = val;
    },
    localExpanded: function localExpanded(val) {
      if (val) {
        this.clampAt(this.text.length);
      } else {
        this.update();
      }
      if (this.expanded !== val) {
        this.$emit('update:expanded', val);
      }
    },

    isClamped: {
      handler: function handler(val) {
        var _this = this;

        this.$nextTick(function () {
          return _this.$emit('clampchange', val);
        });
      },

      immediate: true
    }
  },
  mounted: function mounted() {
    this.init();

    this.$watch(function (vm) {
      return [vm.maxLines, vm.maxHeight, vm.ellipsis, vm.isClamped, vm.location].join();
    }, this.update);
    this.$watch(function (vm) {
      return [vm.tag, vm.text, vm.autoresize].join();
    }, this.init);
  },
  updated: function updated() {
    this.text = this.getText();
    this.applyChange();
  },
  beforeDestroy: function beforeDestroy() {
    this.cleanUp();
  },

  methods: {
    init: function init() {
      var _this2 = this;

      var contents = this.$slots.default;
      if (!contents) {
        return;
      }

      this.offset = this.text.length;

      this.cleanUp();

      if (this.autoresize) {
        Object(resize_event_["addResizeListener"])(this.$el, this.update);
        this.unregisterResizeCallback = function () {
          Object(resize_event_["removeResizeListener"])(_this2.$el, _this2.update);
        };
      }
      this.update();
    },
    update: function update() {
      if (this.localExpanded) {
        return;
      }
      this.applyChange();
      if (this.isOverflow() || this.isClamped) {
        this.search();
      }
    },
    expand: function expand() {
      this.localExpanded = true;
    },
    collapse: function collapse() {
      this.localExpanded = false;
    },
    toggle: function toggle() {
      this.localExpanded = !this.localExpanded;
    },
    getLines: function getLines() {
      return Object.keys(Array.prototype.slice.call(this.$refs.content.getClientRects()).reduce(function (prev, _ref) {
        var top = _ref.top,
            bottom = _ref.bottom;

        var key = top + '/' + bottom;
        if (!prev[key]) {
          prev[key] = true;
        }
        return prev;
      }, {})).length;
    },
    isOverflow: function isOverflow() {
      if (!this.maxLines && !this.maxHeight) {
        return false;
      }

      if (this.maxLines) {
        if (this.getLines() > this.maxLines) {
          return true;
        }
      }

      if (this.maxHeight) {
        if (this.$el.scrollHeight > this.$el.offsetHeight) {
          return true;
        }
      }
      return false;
    },
    getText: function getText() {
      // Look for the first non-empty text node
      var _filter = (this.$slots.default || []).filter(function (node) {
        return !node.tag && !node.isComment;
      }),
          content = _filter[0];

      return content ? content.text.trim() : '';
    },
    moveEdge: function moveEdge(steps) {
      this.clampAt(this.offset + steps);
    },
    clampAt: function clampAt(offset) {
      this.offset = offset;
      this.applyChange();
    },
    applyChange: function applyChange() {
      this.$refs.text.textContent = this.realText;
    },
    stepToFit: function stepToFit() {
      this.fill();
      this.clamp();
    },
    fill: function fill() {
      while ((!this.isOverflow() || this.getLines() < 2) && this.offset < this.text.length) {
        this.moveEdge(1);
      }
    },
    clamp: function clamp() {
      while (this.isOverflow() && this.getLines() > 1 && this.offset > 0) {
        this.moveEdge(-1);
      }
    },
    search: function search() {
      for (var _len = arguments.length, range = Array(_len), _key = 0; _key < _len; _key++) {
        range[_key] = arguments[_key];
      }

      var _range$ = range[0],
          from = _range$ === undefined ? 0 : _range$,
          _range$2 = range[1],
          to = _range$2 === undefined ? this.offset : _range$2;

      if (to - from <= 3) {
        this.stepToFit();
        return;
      }
      var target = Math.floor((to + from) / 2);
      this.clampAt(target);
      if (this.isOverflow()) {
        this.search(from, target);
      } else {
        this.search(target, to);
      }
    },
    cleanUp: function cleanUp() {
      if (this.unregisterResizeCallback) {
        this.unregisterResizeCallback();
      }
    }
  },
  render: function render(h) {
    var contents = [h('span', this.$isServer ? {} : {
      ref: 'text',
      attrs: {
        'aria-label': this.text.trim()
      }
    }, this.$isServer ? this.text : this.realText)];

    var expand = this.expand,
        collapse = this.collapse,
        toggle = this.toggle;

    var scope = {
      expand: expand,
      collapse: collapse,
      toggle: toggle,
      clamped: this.isClamped,
      expanded: this.localExpanded
    };
    var before = this.$scopedSlots.before ? this.$scopedSlots.before(scope) : this.$slots.before;
    if (before) {
      contents.unshift.apply(contents, Array.isArray(before) ? before : [before]);
    }
    var after = this.$scopedSlots.after ? this.$scopedSlots.after(scope) : this.$slots.after;
    if (after) {
      contents.push.apply(contents, Array.isArray(after) ? after : [after]);
    }
    var lines = [h('span', {
      style: {
        boxShadow: 'transparent 0 0'
      },
      ref: 'content'
    }, contents)];
    return h(this.tag, {
      style: {
        maxHeight: this.realMaxHeight,
        overflow: 'hidden'
      }
    }, lines);
  }
});
// CONCATENATED MODULE: ./packages/clamp/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./packages/clamp/src/main.vue
var render, staticRenderFns




/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "packages/clamp/src/main.vue"
/* harmony default export */ var main = (component.exports);
// CONCATENATED MODULE: ./packages/clamp/index.js


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

/* harmony default export */ var clamp = __webpack_exports__["default"] = (main);

/***/ }),

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

module.exports = require("tdh-element-ui/lib/utils/resize-event");

/***/ })

/******/ });