123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- 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, {
- /******/ 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 = "/dist/";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 235);
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ 12:
- /***/ (function(module, exports) {
- module.exports = require("throttle-debounce/debounce");
- /***/ }),
- /***/ 2:
- /***/ (function(module, exports) {
- module.exports = require("element-ui/lib/utils/dom");
- /***/ }),
- /***/ 20:
- /***/ (function(module, exports) {
- module.exports = require("element-ui/lib/utils/vdom");
- /***/ }),
- /***/ 235:
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(236);
- /***/ }),
- /***/ 236:
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _main = __webpack_require__(237);
- var _main2 = _interopRequireDefault(_main);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- /* istanbul ignore next */
- _main2.default.install = function (Vue) {
- Vue.component(_main2.default.name, _main2.default);
- };
- exports.default = _main2.default;
- /***/ }),
- /***/ 237:
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _vuePopper = __webpack_require__(8);
- var _vuePopper2 = _interopRequireDefault(_vuePopper);
- var _debounce = __webpack_require__(12);
- var _debounce2 = _interopRequireDefault(_debounce);
- var _dom = __webpack_require__(2);
- var _vdom = __webpack_require__(20);
- var _util = __webpack_require__(3);
- var _vue = __webpack_require__(5);
- var _vue2 = _interopRequireDefault(_vue);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'ElTooltip',
- mixins: [_vuePopper2.default],
- props: {
- openDelay: {
- type: Number,
- default: 0
- },
- disabled: Boolean,
- manual: Boolean,
- effect: {
- type: String,
- default: 'dark'
- },
- popperClass: String,
- content: String,
- visibleArrow: {
- default: true
- },
- transition: {
- type: String,
- default: 'el-fade-in-linear'
- },
- popperOptions: {
- default: function _default() {
- return {
- boundariesPadding: 10,
- gpuAcceleration: false
- };
- }
- },
- enterable: {
- type: Boolean,
- default: true
- },
- hideAfter: {
- type: Number,
- default: 0
- }
- },
- data: function data() {
- return {
- timeoutPending: null,
- focusing: false
- };
- },
- computed: {
- tooltipId: function tooltipId() {
- return 'el-tooltip-' + (0, _util.generateId)();
- }
- },
- beforeCreate: function beforeCreate() {
- var _this = this;
- if (this.$isServer) return;
- this.popperVM = new _vue2.default({
- data: { node: '' },
- render: function render(h) {
- return this.node;
- }
- }).$mount();
- this.debounceClose = (0, _debounce2.default)(200, function () {
- return _this.handleClosePopper();
- });
- },
- render: function render(h) {
- var _this2 = this;
- if (this.popperVM) {
- this.popperVM.node = h(
- 'transition',
- {
- attrs: {
- name: this.transition
- },
- on: {
- 'afterLeave': this.doDestroy
- }
- },
- [h(
- 'div',
- {
- on: {
- 'mouseleave': function mouseleave() {
- _this2.setExpectedState(false);_this2.debounceClose();
- },
- 'mouseenter': function mouseenter() {
- _this2.setExpectedState(true);
- }
- },
- ref: 'popper',
- attrs: { role: 'tooltip',
- id: this.tooltipId,
- 'aria-hidden': this.disabled || !this.showPopper ? 'true' : 'false'
- },
- directives: [{
- name: 'show',
- value: !this.disabled && this.showPopper
- }],
- 'class': ['el-tooltip__popper', 'is-' + this.effect, this.popperClass] },
- [this.$slots.content || this.content]
- )]
- );
- }
- if (!this.$slots.default || !this.$slots.default.length) return this.$slots.default;
- var vnode = (0, _vdom.getFirstComponentChild)(this.$slots.default);
- if (!vnode) return vnode;
- var data = vnode.data = vnode.data || {};
- var on = vnode.data.on = vnode.data.on || {};
- var nativeOn = vnode.data.nativeOn = vnode.data.nativeOn || {};
- data.staticClass = this.concatClass(data.staticClass, 'el-tooltip');
- nativeOn.mouseenter = on.mouseenter = this.addEventHandle(on.mouseenter, this.show);
- nativeOn.mouseleave = on.mouseleave = this.addEventHandle(on.mouseleave, this.hide);
- nativeOn.focus = on.focus = this.addEventHandle(on.focus, this.handleFocus);
- nativeOn.blur = on.blur = this.addEventHandle(on.blur, this.handleBlur);
- nativeOn.click = on.click = this.addEventHandle(on.click, function () {
- _this2.focusing = false;
- });
- return vnode;
- },
- mounted: function mounted() {
- this.referenceElm = this.$el;
- if (this.$el.nodeType === 1) {
- this.$el.setAttribute('aria-describedby', this.tooltipId);
- this.$el.setAttribute('tabindex', 0);
- }
- },
- watch: {
- focusing: function focusing(val) {
- if (val) {
- (0, _dom.addClass)(this.referenceElm, 'focusing');
- } else {
- (0, _dom.removeClass)(this.referenceElm, 'focusing');
- }
- }
- },
- methods: {
- show: function show() {
- this.setExpectedState(true);
- this.handleShowPopper();
- },
- hide: function hide() {
- this.setExpectedState(false);
- this.debounceClose();
- },
- handleFocus: function handleFocus() {
- this.focusing = true;
- this.show();
- },
- handleBlur: function handleBlur() {
- this.focusing = false;
- this.hide();
- },
- addEventHandle: function addEventHandle(old, fn) {
- if (!old) {
- return fn;
- } else if (Array.isArray(old)) {
- return old.indexOf(fn) > -1 ? old : old.concat(fn);
- } else {
- return old === fn ? old : [old, fn];
- }
- },
- concatClass: function concatClass(a, b) {
- if (a && a.indexOf(b) > -1) return a;
- return a ? b ? a + ' ' + b : a : b || '';
- },
- handleShowPopper: function handleShowPopper() {
- var _this3 = this;
- if (!this.expectedState || this.manual) return;
- clearTimeout(this.timeout);
- this.timeout = setTimeout(function () {
- _this3.showPopper = true;
- }, this.openDelay);
- if (this.hideAfter > 0) {
- this.timeoutPending = setTimeout(function () {
- _this3.showPopper = false;
- }, this.hideAfter);
- }
- },
- handleClosePopper: function handleClosePopper() {
- if (this.enterable && this.expectedState || this.manual) return;
- clearTimeout(this.timeout);
- if (this.timeoutPending) {
- clearTimeout(this.timeoutPending);
- }
- this.showPopper = false;
- },
- setExpectedState: function setExpectedState(expectedState) {
- if (expectedState === false) {
- clearTimeout(this.timeoutPending);
- }
- this.expectedState = expectedState;
- }
- }
- };
- /***/ }),
- /***/ 3:
- /***/ (function(module, exports) {
- module.exports = require("element-ui/lib/utils/util");
- /***/ }),
- /***/ 5:
- /***/ (function(module, exports) {
- module.exports = require("vue");
- /***/ }),
- /***/ 8:
- /***/ (function(module, exports) {
- module.exports = require("element-ui/lib/utils/vue-popper");
- /***/ })
- /******/ });
|