UNPKG

135 kBJavaScriptView Raw
1module.exports =
2/******/ (function(modules) { // webpackBootstrap
3/******/ // The module cache
4/******/ var installedModules = {};
5/******/
6/******/ // The require function
7/******/ function __webpack_require__(moduleId) {
8/******/
9/******/ // Check if module is in cache
10/******/ if(installedModules[moduleId]) {
11/******/ return installedModules[moduleId].exports;
12/******/ }
13/******/ // Create a new module (and put it into the cache)
14/******/ var module = installedModules[moduleId] = {
15/******/ i: moduleId,
16/******/ l: false,
17/******/ exports: {}
18/******/ };
19/******/
20/******/ // Execute the module function
21/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22/******/
23/******/ // Flag the module as loaded
24/******/ module.l = true;
25/******/
26/******/ // Return the exports of the module
27/******/ return module.exports;
28/******/ }
29/******/
30/******/
31/******/ // expose the modules object (__webpack_modules__)
32/******/ __webpack_require__.m = modules;
33/******/
34/******/ // expose the module cache
35/******/ __webpack_require__.c = installedModules;
36/******/
37/******/ // define getter function for harmony exports
38/******/ __webpack_require__.d = function(exports, name, getter) {
39/******/ if(!__webpack_require__.o(exports, name)) {
40/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41/******/ }
42/******/ };
43/******/
44/******/ // define __esModule on exports
45/******/ __webpack_require__.r = function(exports) {
46/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48/******/ }
49/******/ Object.defineProperty(exports, '__esModule', { value: true });
50/******/ };
51/******/
52/******/ // create a fake namespace object
53/******/ // mode & 1: value is a module id, require it
54/******/ // mode & 2: merge all properties of value into the ns
55/******/ // mode & 4: return value when already ns object
56/******/ // mode & 8|1: behave like require
57/******/ __webpack_require__.t = function(value, mode) {
58/******/ if(mode & 1) value = __webpack_require__(value);
59/******/ if(mode & 8) return value;
60/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61/******/ var ns = Object.create(null);
62/******/ __webpack_require__.r(ns);
63/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65/******/ return ns;
66/******/ };
67/******/
68/******/ // getDefaultExport function for compatibility with non-harmony modules
69/******/ __webpack_require__.n = function(module) {
70/******/ var getter = module && module.__esModule ?
71/******/ function getDefault() { return module['default']; } :
72/******/ function getModuleExports() { return module; };
73/******/ __webpack_require__.d(getter, 'a', getter);
74/******/ return getter;
75/******/ };
76/******/
77/******/ // Object.prototype.hasOwnProperty.call
78/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79/******/
80/******/ // __webpack_public_path__
81/******/ __webpack_require__.p = "/lib/";
82/******/
83/******/
84/******/ // Load entry module and return exports
85/******/ return __webpack_require__(__webpack_require__.s = 43);
86/******/ })
87/************************************************************************/
88/******/ ([
89/* 0 */
90/***/ (function(module, __webpack_exports__, __webpack_require__) {
91
92"use strict";
93/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
94/* globals __VUE_SSR_CONTEXT__ */
95
96// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
97// This module is a runtime utility for cleaner component module output and will
98// be included in the final webpack user bundle.
99
100function normalizeComponent (
101 scriptExports,
102 render,
103 staticRenderFns,
104 functionalTemplate,
105 injectStyles,
106 scopeId,
107 moduleIdentifier, /* server only */
108 shadowMode /* vue-cli only */
109) {
110 // Vue.extend constructor export interop
111 var options = typeof scriptExports === 'function'
112 ? scriptExports.options
113 : scriptExports
114
115 // render functions
116 if (render) {
117 options.render = render
118 options.staticRenderFns = staticRenderFns
119 options._compiled = true
120 }
121
122 // functional template
123 if (functionalTemplate) {
124 options.functional = true
125 }
126
127 // scopedId
128 if (scopeId) {
129 options._scopeId = 'data-v-' + scopeId
130 }
131
132 var hook
133 if (moduleIdentifier) { // server build
134 hook = function (context) {
135 // 2.3 injection
136 context =
137 context || // cached call
138 (this.$vnode && this.$vnode.ssrContext) || // stateful
139 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
140 // 2.2 with runInNewContext: true
141 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
142 context = __VUE_SSR_CONTEXT__
143 }
144 // inject component styles
145 if (injectStyles) {
146 injectStyles.call(this, context)
147 }
148 // register component module identifier for async chunk inferrence
149 if (context && context._registeredComponents) {
150 context._registeredComponents.add(moduleIdentifier)
151 }
152 }
153 // used by ssr in case component is cached and beforeCreate
154 // never gets called
155 options._ssrRegister = hook
156 } else if (injectStyles) {
157 hook = shadowMode
158 ? function () {
159 injectStyles.call(
160 this,
161 (options.functional ? this.parent : this).$root.$options.shadowRoot
162 )
163 }
164 : injectStyles
165 }
166
167 if (hook) {
168 if (options.functional) {
169 // for template-only hot-reload because in that case the render fn doesn't
170 // go through the normalizer
171 options._injectStyles = hook
172 // register for functional component in vue file
173 var originalRender = options.render
174 options.render = function renderWithStyleInjection (h, context) {
175 hook.call(context)
176 return originalRender(h, context)
177 }
178 } else {
179 // inject component registration as beforeCreate hook
180 var existing = options.beforeCreate
181 options.beforeCreate = existing
182 ? [].concat(existing, hook)
183 : [hook]
184 }
185 }
186
187 return {
188 exports: scriptExports,
189 options: options
190 }
191}
192
193
194/***/ }),
195/* 1 */
196/***/ (function(module, exports) {
197
198module.exports = require("vue");
199
200/***/ }),
201/* 2 */
202/***/ (function(module, exports, __webpack_require__) {
203
204"use strict";
205
206
207/*
208 MIT License http://www.opensource.org/licenses/mit-license.php
209 Author Tobias Koppers @sokra
210*/
211// css base code, injected by the css-loader
212module.exports = function (useSourceMap) {
213 var list = []; // return the list of modules as css string
214
215 list.toString = function toString() {
216 return this.map(function (item) {
217 var content = cssWithMappingToString(item, useSourceMap);
218
219 if (item[2]) {
220 return '@media ' + item[2] + '{' + content + '}';
221 } else {
222 return content;
223 }
224 }).join('');
225 }; // import a list of modules into the list
226
227
228 list.i = function (modules, mediaQuery) {
229 if (typeof modules === 'string') {
230 modules = [[null, modules, '']];
231 }
232
233 var alreadyImportedModules = {};
234
235 for (var i = 0; i < this.length; i++) {
236 var id = this[i][0];
237
238 if (id != null) {
239 alreadyImportedModules[id] = true;
240 }
241 }
242
243 for (i = 0; i < modules.length; i++) {
244 var item = modules[i]; // skip already imported module
245 // this implementation is not 100% perfect for weird media query combinations
246 // when a module is imported multiple times with different media queries.
247 // I hope this will never occur (Hey this way we have smaller bundles)
248
249 if (item[0] == null || !alreadyImportedModules[item[0]]) {
250 if (mediaQuery && !item[2]) {
251 item[2] = mediaQuery;
252 } else if (mediaQuery) {
253 item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
254 }
255
256 list.push(item);
257 }
258 }
259 };
260
261 return list;
262};
263
264function cssWithMappingToString(item, useSourceMap) {
265 var content = item[1] || '';
266 var cssMapping = item[3];
267
268 if (!cssMapping) {
269 return content;
270 }
271
272 if (useSourceMap && typeof btoa === 'function') {
273 var sourceMapping = toComment(cssMapping);
274 var sourceURLs = cssMapping.sources.map(function (source) {
275 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
276 });
277 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
278 }
279
280 return [content].join('\n');
281} // Adapted from convert-source-map (MIT)
282
283
284function toComment(sourceMap) {
285 // eslint-disable-next-line no-undef
286 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
287 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
288 return '/*# ' + data + ' */';
289}
290
291/***/ }),
292/* 3 */
293/***/ (function(module, exports, __webpack_require__) {
294
295/*
296 MIT License http://www.opensource.org/licenses/mit-license.php
297 Author Tobias Koppers @sokra
298*/
299
300var stylesInDom = {};
301
302var memoize = function (fn) {
303 var memo;
304
305 return function () {
306 if (typeof memo === "undefined") memo = fn.apply(this, arguments);
307 return memo;
308 };
309};
310
311var isOldIE = memoize(function () {
312 // Test for IE <= 9 as proposed by Browserhacks
313 // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
314 // Tests for existence of standard globals is to allow style-loader
315 // to operate correctly into non-standard environments
316 // @see https://github.com/webpack-contrib/style-loader/issues/177
317 return window && document && document.all && !window.atob;
318});
319
320var getTarget = function (target, parent) {
321 if (parent){
322 return parent.querySelector(target);
323 }
324 return document.querySelector(target);
325};
326
327var getElement = (function (fn) {
328 var memo = {};
329
330 return function(target, parent) {
331 // If passing function in options, then use it for resolve "head" element.
332 // Useful for Shadow Root style i.e
333 // {
334 // insertInto: function () { return document.querySelector("#foo").shadowRoot }
335 // }
336 if (typeof target === 'function') {
337 return target();
338 }
339 if (typeof memo[target] === "undefined") {
340 var styleTarget = getTarget.call(this, target, parent);
341 // Special case to return head of iframe instead of iframe itself
342 if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
343 try {
344 // This will throw an exception if access to iframe is blocked
345 // due to cross-origin restrictions
346 styleTarget = styleTarget.contentDocument.head;
347 } catch(e) {
348 styleTarget = null;
349 }
350 }
351 memo[target] = styleTarget;
352 }
353 return memo[target]
354 };
355})();
356
357var singleton = null;
358var singletonCounter = 0;
359var stylesInsertedAtTop = [];
360
361var fixUrls = __webpack_require__(8);
362
363module.exports = function(list, options) {
364 if (typeof DEBUG !== "undefined" && DEBUG) {
365 if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
366 }
367
368 options = options || {};
369
370 options.attrs = typeof options.attrs === "object" ? options.attrs : {};
371
372 // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
373 // tags it will allow on a page
374 if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
375
376 // By default, add <style> tags to the <head> element
377 if (!options.insertInto) options.insertInto = "head";
378
379 // By default, add <style> tags to the bottom of the target
380 if (!options.insertAt) options.insertAt = "bottom";
381
382 var styles = listToStyles(list, options);
383
384 addStylesToDom(styles, options);
385
386 return function update (newList) {
387 var mayRemove = [];
388
389 for (var i = 0; i < styles.length; i++) {
390 var item = styles[i];
391 var domStyle = stylesInDom[item.id];
392
393 domStyle.refs--;
394 mayRemove.push(domStyle);
395 }
396
397 if(newList) {
398 var newStyles = listToStyles(newList, options);
399 addStylesToDom(newStyles, options);
400 }
401
402 for (var i = 0; i < mayRemove.length; i++) {
403 var domStyle = mayRemove[i];
404
405 if(domStyle.refs === 0) {
406 for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
407
408 delete stylesInDom[domStyle.id];
409 }
410 }
411 };
412};
413
414function addStylesToDom (styles, options) {
415 for (var i = 0; i < styles.length; i++) {
416 var item = styles[i];
417 var domStyle = stylesInDom[item.id];
418
419 if(domStyle) {
420 domStyle.refs++;
421
422 for(var j = 0; j < domStyle.parts.length; j++) {
423 domStyle.parts[j](item.parts[j]);
424 }
425
426 for(; j < item.parts.length; j++) {
427 domStyle.parts.push(addStyle(item.parts[j], options));
428 }
429 } else {
430 var parts = [];
431
432 for(var j = 0; j < item.parts.length; j++) {
433 parts.push(addStyle(item.parts[j], options));
434 }
435
436 stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
437 }
438 }
439}
440
441function listToStyles (list, options) {
442 var styles = [];
443 var newStyles = {};
444
445 for (var i = 0; i < list.length; i++) {
446 var item = list[i];
447 var id = options.base ? item[0] + options.base : item[0];
448 var css = item[1];
449 var media = item[2];
450 var sourceMap = item[3];
451 var part = {css: css, media: media, sourceMap: sourceMap};
452
453 if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
454 else newStyles[id].parts.push(part);
455 }
456
457 return styles;
458}
459
460function insertStyleElement (options, style) {
461 var target = getElement(options.insertInto)
462
463 if (!target) {
464 throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
465 }
466
467 var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
468
469 if (options.insertAt === "top") {
470 if (!lastStyleElementInsertedAtTop) {
471 target.insertBefore(style, target.firstChild);
472 } else if (lastStyleElementInsertedAtTop.nextSibling) {
473 target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
474 } else {
475 target.appendChild(style);
476 }
477 stylesInsertedAtTop.push(style);
478 } else if (options.insertAt === "bottom") {
479 target.appendChild(style);
480 } else if (typeof options.insertAt === "object" && options.insertAt.before) {
481 var nextSibling = getElement(options.insertAt.before, target);
482 target.insertBefore(style, nextSibling);
483 } else {
484 throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
485 }
486}
487
488function removeStyleElement (style) {
489 if (style.parentNode === null) return false;
490 style.parentNode.removeChild(style);
491
492 var idx = stylesInsertedAtTop.indexOf(style);
493 if(idx >= 0) {
494 stylesInsertedAtTop.splice(idx, 1);
495 }
496}
497
498function createStyleElement (options) {
499 var style = document.createElement("style");
500
501 if(options.attrs.type === undefined) {
502 options.attrs.type = "text/css";
503 }
504
505 if(options.attrs.nonce === undefined) {
506 var nonce = getNonce();
507 if (nonce) {
508 options.attrs.nonce = nonce;
509 }
510 }
511
512 addAttrs(style, options.attrs);
513 insertStyleElement(options, style);
514
515 return style;
516}
517
518function createLinkElement (options) {
519 var link = document.createElement("link");
520
521 if(options.attrs.type === undefined) {
522 options.attrs.type = "text/css";
523 }
524 options.attrs.rel = "stylesheet";
525
526 addAttrs(link, options.attrs);
527 insertStyleElement(options, link);
528
529 return link;
530}
531
532function addAttrs (el, attrs) {
533 Object.keys(attrs).forEach(function (key) {
534 el.setAttribute(key, attrs[key]);
535 });
536}
537
538function getNonce() {
539 if (false) {}
540
541 return __webpack_require__.nc;
542}
543
544function addStyle (obj, options) {
545 var style, update, remove, result;
546
547 // If a transform function was defined, run it on the css
548 if (options.transform && obj.css) {
549 result = typeof options.transform === 'function'
550 ? options.transform(obj.css)
551 : options.transform.default(obj.css);
552
553 if (result) {
554 // If transform returns a value, use that instead of the original css.
555 // This allows running runtime transformations on the css.
556 obj.css = result;
557 } else {
558 // If the transform function returns a falsy value, don't add this css.
559 // This allows conditional loading of css
560 return function() {
561 // noop
562 };
563 }
564 }
565
566 if (options.singleton) {
567 var styleIndex = singletonCounter++;
568
569 style = singleton || (singleton = createStyleElement(options));
570
571 update = applyToSingletonTag.bind(null, style, styleIndex, false);
572 remove = applyToSingletonTag.bind(null, style, styleIndex, true);
573
574 } else if (
575 obj.sourceMap &&
576 typeof URL === "function" &&
577 typeof URL.createObjectURL === "function" &&
578 typeof URL.revokeObjectURL === "function" &&
579 typeof Blob === "function" &&
580 typeof btoa === "function"
581 ) {
582 style = createLinkElement(options);
583 update = updateLink.bind(null, style, options);
584 remove = function () {
585 removeStyleElement(style);
586
587 if(style.href) URL.revokeObjectURL(style.href);
588 };
589 } else {
590 style = createStyleElement(options);
591 update = applyToTag.bind(null, style);
592 remove = function () {
593 removeStyleElement(style);
594 };
595 }
596
597 update(obj);
598
599 return function updateStyle (newObj) {
600 if (newObj) {
601 if (
602 newObj.css === obj.css &&
603 newObj.media === obj.media &&
604 newObj.sourceMap === obj.sourceMap
605 ) {
606 return;
607 }
608
609 update(obj = newObj);
610 } else {
611 remove();
612 }
613 };
614}
615
616var replaceText = (function () {
617 var textStore = [];
618
619 return function (index, replacement) {
620 textStore[index] = replacement;
621
622 return textStore.filter(Boolean).join('\n');
623 };
624})();
625
626function applyToSingletonTag (style, index, remove, obj) {
627 var css = remove ? "" : obj.css;
628
629 if (style.styleSheet) {
630 style.styleSheet.cssText = replaceText(index, css);
631 } else {
632 var cssNode = document.createTextNode(css);
633 var childNodes = style.childNodes;
634
635 if (childNodes[index]) style.removeChild(childNodes[index]);
636
637 if (childNodes.length) {
638 style.insertBefore(cssNode, childNodes[index]);
639 } else {
640 style.appendChild(cssNode);
641 }
642 }
643}
644
645function applyToTag (style, obj) {
646 var css = obj.css;
647 var media = obj.media;
648
649 if(media) {
650 style.setAttribute("media", media)
651 }
652
653 if(style.styleSheet) {
654 style.styleSheet.cssText = css;
655 } else {
656 while(style.firstChild) {
657 style.removeChild(style.firstChild);
658 }
659
660 style.appendChild(document.createTextNode(css));
661 }
662}
663
664function updateLink (link, options, obj) {
665 var css = obj.css;
666 var sourceMap = obj.sourceMap;
667
668 /*
669 If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
670 and there is no publicPath defined then lets turn convertToAbsoluteUrls
671 on by default. Otherwise default to the convertToAbsoluteUrls option
672 directly
673 */
674 var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
675
676 if (options.convertToAbsoluteUrls || autoFixUrls) {
677 css = fixUrls(css);
678 }
679
680 if (sourceMap) {
681 // http://stackoverflow.com/a/26603875
682 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
683 }
684
685 var blob = new Blob([css], { type: "text/css" });
686
687 var oldSrc = link.href;
688
689 link.href = URL.createObjectURL(blob);
690
691 if(oldSrc) URL.revokeObjectURL(oldSrc);
692}
693
694
695/***/ }),
696/* 4 */
697/***/ (function(module, exports, __webpack_require__) {
698
699"use strict";
700
701
702exports.__esModule = true;
703exports.isInContainer = exports.getScrollContainer = exports.isScroll = exports.getStyle = exports.once = exports.off = exports.on = undefined;
704
705var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* istanbul ignore next */
706
707exports.hasClass = hasClass;
708exports.addClass = addClass;
709exports.removeClass = removeClass;
710exports.setStyle = setStyle;
711
712var _vue = __webpack_require__(1);
713
714var _vue2 = _interopRequireDefault(_vue);
715
716function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
717
718var isServer = _vue2.default.prototype.$isServer;
719var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
720var MOZ_HACK_REGEXP = /^moz([A-Z])/;
721var ieVersion = isServer ? 0 : Number(document.documentMode);
722
723/* istanbul ignore next */
724var trim = function trim(string) {
725 return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
726};
727/* istanbul ignore next */
728var camelCase = function camelCase(name) {
729 return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
730 return offset ? letter.toUpperCase() : letter;
731 }).replace(MOZ_HACK_REGEXP, 'Moz$1');
732};
733
734/* istanbul ignore next */
735var on = exports.on = function () {
736 if (!isServer && document.addEventListener) {
737 return function (element, event, handler) {
738 if (element && event && handler) {
739 element.addEventListener(event, handler, false);
740 }
741 };
742 } else {
743 return function (element, event, handler) {
744 if (element && event && handler) {
745 element.attachEvent('on' + event, handler);
746 }
747 };
748 }
749}();
750
751/* istanbul ignore next */
752var off = exports.off = function () {
753 if (!isServer && document.removeEventListener) {
754 return function (element, event, handler) {
755 if (element && event) {
756 element.removeEventListener(event, handler, false);
757 }
758 };
759 } else {
760 return function (element, event, handler) {
761 if (element && event) {
762 element.detachEvent('on' + event, handler);
763 }
764 };
765 }
766}();
767
768/* istanbul ignore next */
769var once = exports.once = function once(el, event, fn) {
770 var listener = function listener() {
771 if (fn) {
772 fn.apply(this, arguments);
773 }
774 off(el, event, listener);
775 };
776 on(el, event, listener);
777};
778
779/* istanbul ignore next */
780function hasClass(el, cls) {
781 if (!el || !cls) return false;
782 if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
783 if (el.classList) {
784 return el.classList.contains(cls);
785 } else {
786 return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
787 }
788};
789
790/* istanbul ignore next */
791function addClass(el, cls) {
792 if (!el) return;
793 var curClass = el.className;
794 var classes = (cls || '').split(' ');
795
796 for (var i = 0, j = classes.length; i < j; i++) {
797 var clsName = classes[i];
798 if (!clsName) continue;
799
800 if (el.classList) {
801 el.classList.add(clsName);
802 } else if (!hasClass(el, clsName)) {
803 curClass += ' ' + clsName;
804 }
805 }
806 if (!el.classList) {
807 el.className = curClass;
808 }
809};
810
811/* istanbul ignore next */
812function removeClass(el, cls) {
813 if (!el || !cls) return;
814 var classes = cls.split(' ');
815 var curClass = ' ' + el.className + ' ';
816
817 for (var i = 0, j = classes.length; i < j; i++) {
818 var clsName = classes[i];
819 if (!clsName) continue;
820
821 if (el.classList) {
822 el.classList.remove(clsName);
823 } else if (hasClass(el, clsName)) {
824 curClass = curClass.replace(' ' + clsName + ' ', ' ');
825 }
826 }
827 if (!el.classList) {
828 el.className = trim(curClass);
829 }
830};
831
832/* istanbul ignore next */
833var getStyle = exports.getStyle = ieVersion < 9 ? function (element, styleName) {
834 if (isServer) return;
835 if (!element || !styleName) return null;
836 styleName = camelCase(styleName);
837 if (styleName === 'float') {
838 styleName = 'styleFloat';
839 }
840 try {
841 switch (styleName) {
842 case 'opacity':
843 try {
844 return element.filters.item('alpha').opacity / 100;
845 } catch (e) {
846 return 1.0;
847 }
848 default:
849 return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
850 }
851 } catch (e) {
852 return element.style[styleName];
853 }
854} : function (element, styleName) {
855 if (isServer) return;
856 if (!element || !styleName) return null;
857 styleName = camelCase(styleName);
858 if (styleName === 'float') {
859 styleName = 'cssFloat';
860 }
861 try {
862 var computed = document.defaultView.getComputedStyle(element, '');
863 return element.style[styleName] || computed ? computed[styleName] : null;
864 } catch (e) {
865 return element.style[styleName];
866 }
867};
868
869/* istanbul ignore next */
870function setStyle(element, styleName, value) {
871 if (!element || !styleName) return;
872
873 if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
874 for (var prop in styleName) {
875 if (styleName.hasOwnProperty(prop)) {
876 setStyle(element, prop, styleName[prop]);
877 }
878 }
879 } else {
880 styleName = camelCase(styleName);
881 if (styleName === 'opacity' && ieVersion < 9) {
882 element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
883 } else {
884 element.style[styleName] = value;
885 }
886 }
887};
888
889var isScroll = exports.isScroll = function isScroll(el, vertical) {
890 if (isServer) return;
891
892 var determinedDirection = vertical !== null || vertical !== undefined;
893 var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
894
895 return overflow.match(/(scroll|auto)/);
896};
897
898var getScrollContainer = exports.getScrollContainer = function getScrollContainer(el, vertical) {
899 if (isServer) return;
900
901 var parent = el;
902 while (parent) {
903 if ([window, document, document.documentElement].includes(parent)) {
904 return window;
905 }
906 if (isScroll(parent, vertical)) {
907 return parent;
908 }
909 parent = parent.parentNode;
910 }
911
912 return parent;
913};
914
915var isInContainer = exports.isInContainer = function isInContainer(el, container) {
916 if (isServer || !el || !container) return false;
917
918 var elRect = el.getBoundingClientRect();
919 var containerRect = void 0;
920
921 if ([window, document, document.documentElement, null, undefined].includes(container)) {
922 containerRect = {
923 top: 0,
924 right: window.innerWidth,
925 bottom: window.innerHeight,
926 left: 0
927 };
928 } else {
929 containerRect = container.getBoundingClientRect();
930 }
931
932 return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
933};
934
935/***/ }),
936/* 5 */,
937/* 6 */
938/***/ (function(module, exports, __webpack_require__) {
939
940"use strict";
941
942
943exports.__esModule = true;
944exports.isEmpty = exports.isEqual = exports.arrayEquals = exports.looseEqual = exports.capitalize = exports.kebabCase = exports.autoprefixer = exports.isFirefox = exports.isEdge = exports.isIE = exports.coerceTruthyValueToArray = exports.arrayFind = exports.arrayFindIndex = exports.escapeRegexpString = exports.valueEquals = exports.generateId = exports.getValueByPath = undefined;
945
946var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
947
948exports.noop = noop;
949exports.hasOwn = hasOwn;
950exports.toObject = toObject;
951exports.getPropByPath = getPropByPath;
952exports.rafThrottle = rafThrottle;
953exports.objToArray = objToArray;
954
955var _vue = __webpack_require__(1);
956
957var _vue2 = _interopRequireDefault(_vue);
958
959var _types = __webpack_require__(23);
960
961function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
962
963var hasOwnProperty = Object.prototype.hasOwnProperty;
964
965function noop() {};
966
967function hasOwn(obj, key) {
968 return hasOwnProperty.call(obj, key);
969};
970
971function extend(to, _from) {
972 for (var key in _from) {
973 to[key] = _from[key];
974 }
975 return to;
976};
977
978function toObject(arr) {
979 var res = {};
980 for (var i = 0; i < arr.length; i++) {
981 if (arr[i]) {
982 extend(res, arr[i]);
983 }
984 }
985 return res;
986};
987
988var getValueByPath = exports.getValueByPath = function getValueByPath(object, prop) {
989 prop = prop || '';
990 var paths = prop.split('.');
991 var current = object;
992 var result = null;
993 for (var i = 0, j = paths.length; i < j; i++) {
994 var path = paths[i];
995 if (!current) break;
996
997 if (i === j - 1) {
998 result = current[path];
999 break;
1000 }
1001 current = current[path];
1002 }
1003 return result;
1004};
1005
1006function getPropByPath(obj, path, strict) {
1007 var tempObj = obj;
1008 path = path.replace(/\[(\w+)\]/g, '.$1');
1009 path = path.replace(/^\./, '');
1010
1011 var keyArr = path.split('.');
1012 var i = 0;
1013 for (var len = keyArr.length; i < len - 1; ++i) {
1014 if (!tempObj && !strict) break;
1015 var key = keyArr[i];
1016 if (key in tempObj) {
1017 tempObj = tempObj[key];
1018 } else {
1019 if (strict) {
1020 throw new Error('please transfer a valid prop path to form item!');
1021 }
1022 break;
1023 }
1024 }
1025 return {
1026 o: tempObj,
1027 k: keyArr[i],
1028 v: tempObj ? tempObj[keyArr[i]] : null
1029 };
1030};
1031
1032var generateId = exports.generateId = function generateId() {
1033 return Math.floor(Math.random() * 10000);
1034};
1035
1036var valueEquals = exports.valueEquals = function valueEquals(a, b) {
1037 // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
1038 if (a === b) return true;
1039 if (!(a instanceof Array)) return false;
1040 if (!(b instanceof Array)) return false;
1041 if (a.length !== b.length) return false;
1042 for (var i = 0; i !== a.length; ++i) {
1043 if (a[i] !== b[i]) return false;
1044 }
1045 return true;
1046};
1047
1048var escapeRegexpString = exports.escapeRegexpString = function escapeRegexpString() {
1049 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1050 return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
1051};
1052
1053// TODO: use native Array.find, Array.findIndex when IE support is dropped
1054var arrayFindIndex = exports.arrayFindIndex = function arrayFindIndex(arr, pred) {
1055 for (var i = 0; i !== arr.length; ++i) {
1056 if (pred(arr[i])) {
1057 return i;
1058 }
1059 }
1060 return -1;
1061};
1062
1063var arrayFind = exports.arrayFind = function arrayFind(arr, pred) {
1064 var idx = arrayFindIndex(arr, pred);
1065 return idx !== -1 ? arr[idx] : undefined;
1066};
1067
1068// coerce truthy value to array
1069var coerceTruthyValueToArray = exports.coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
1070 if (Array.isArray(val)) {
1071 return val;
1072 } else if (val) {
1073 return [val];
1074 } else {
1075 return [];
1076 }
1077};
1078
1079var isIE = exports.isIE = function isIE() {
1080 return !_vue2.default.prototype.$isServer && !isNaN(Number(document.documentMode));
1081};
1082
1083var isEdge = exports.isEdge = function isEdge() {
1084 return !_vue2.default.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
1085};
1086
1087var isFirefox = exports.isFirefox = function isFirefox() {
1088 return !_vue2.default.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
1089};
1090
1091var autoprefixer = exports.autoprefixer = function autoprefixer(style) {
1092 if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;
1093 var rules = ['transform', 'transition', 'animation'];
1094 var prefixes = ['ms-', 'webkit-'];
1095 rules.forEach(function (rule) {
1096 var value = style[rule];
1097 if (rule && value) {
1098 prefixes.forEach(function (prefix) {
1099 style[prefix + rule] = value;
1100 });
1101 }
1102 });
1103 return style;
1104};
1105
1106var kebabCase = exports.kebabCase = function kebabCase(str) {
1107 var hyphenateRE = /([^-])([A-Z])/g;
1108 return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
1109};
1110
1111var capitalize = exports.capitalize = function capitalize(str) {
1112 if (!(0, _types.isString)(str)) return str;
1113 return str.charAt(0).toUpperCase() + str.slice(1);
1114};
1115
1116var looseEqual = exports.looseEqual = function looseEqual(a, b) {
1117 var isObjectA = (0, _types.isObject)(a);
1118 var isObjectB = (0, _types.isObject)(b);
1119 if (isObjectA && isObjectB) {
1120 return JSON.stringify(a) === JSON.stringify(b);
1121 } else if (!isObjectA && !isObjectB) {
1122 return String(a) === String(b);
1123 } else {
1124 return false;
1125 }
1126};
1127
1128var arrayEquals = exports.arrayEquals = function arrayEquals(arrayA, arrayB) {
1129 arrayA = arrayA || [];
1130 arrayB = arrayB || [];
1131
1132 if (arrayA.length !== arrayB.length) {
1133 return false;
1134 }
1135
1136 for (var i = 0; i < arrayA.length; i++) {
1137 if (!looseEqual(arrayA[i], arrayB[i])) {
1138 return false;
1139 }
1140 }
1141
1142 return true;
1143};
1144
1145var isEqual = exports.isEqual = function isEqual(value1, value2) {
1146 if (Array.isArray(value1) && Array.isArray(value2)) {
1147 return arrayEquals(value1, value2);
1148 }
1149 return looseEqual(value1, value2);
1150};
1151
1152var isEmpty = exports.isEmpty = function isEmpty(val) {
1153 // null or undefined
1154 if (val == null) return true;
1155
1156 if (typeof val === 'boolean') return false;
1157
1158 if (typeof val === 'number') return !val;
1159
1160 if (val instanceof Error) return val.message === '';
1161
1162 switch (Object.prototype.toString.call(val)) {
1163 // String or Array
1164 case '[object String]':
1165 case '[object Array]':
1166 return !val.length;
1167
1168 // Map or Set or File
1169 case '[object File]':
1170 case '[object Map]':
1171 case '[object Set]':
1172 {
1173 return !val.size;
1174 }
1175 // Plain Object
1176 case '[object Object]':
1177 {
1178 return !Object.keys(val).length;
1179 }
1180 }
1181
1182 return false;
1183};
1184
1185function rafThrottle(fn) {
1186 var locked = false;
1187 return function () {
1188 var _this = this;
1189
1190 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
1191 args[_key] = arguments[_key];
1192 }
1193
1194 if (locked) return;
1195 locked = true;
1196 window.requestAnimationFrame(function (_) {
1197 fn.apply(_this, args);
1198 locked = false;
1199 });
1200 };
1201}
1202
1203function objToArray(obj) {
1204 if (Array.isArray(obj)) {
1205 return obj;
1206 }
1207 return isEmpty(obj) ? [] : [obj];
1208}
1209
1210/***/ }),
1211/* 7 */,
1212/* 8 */
1213/***/ (function(module, exports) {
1214
1215
1216/**
1217 * When source maps are enabled, `style-loader` uses a link element with a data-uri to
1218 * embed the css on the page. This breaks all relative urls because now they are relative to a
1219 * bundle instead of the current page.
1220 *
1221 * One solution is to only use full urls, but that may be impossible.
1222 *
1223 * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
1224 *
1225 * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
1226 *
1227 */
1228
1229module.exports = function (css) {
1230 // get current location
1231 var location = typeof window !== "undefined" && window.location;
1232
1233 if (!location) {
1234 throw new Error("fixUrls requires window.location");
1235 }
1236
1237 // blank or null?
1238 if (!css || typeof css !== "string") {
1239 return css;
1240 }
1241
1242 var baseUrl = location.protocol + "//" + location.host;
1243 var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
1244
1245 // convert each url(...)
1246 /*
1247 This regular expression is just a way to recursively match brackets within
1248 a string.
1249
1250 /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
1251 ( = Start a capturing group
1252 (?: = Start a non-capturing group
1253 [^)(] = Match anything that isn't a parentheses
1254 | = OR
1255 \( = Match a start parentheses
1256 (?: = Start another non-capturing groups
1257 [^)(]+ = Match anything that isn't a parentheses
1258 | = OR
1259 \( = Match a start parentheses
1260 [^)(]* = Match anything that isn't a parentheses
1261 \) = Match a end parentheses
1262 ) = End Group
1263 *\) = Match anything and then a close parens
1264 ) = Close non-capturing group
1265 * = Match anything
1266 ) = Close capturing group
1267 \) = Match a close parens
1268
1269 /gi = Get all matches, not the first. Be case insensitive.
1270 */
1271 var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
1272 // strip quotes (if they exist)
1273 var unquotedOrigUrl = origUrl
1274 .trim()
1275 .replace(/^"(.*)"$/, function(o, $1){ return $1; })
1276 .replace(/^'(.*)'$/, function(o, $1){ return $1; });
1277
1278 // already a full url? no change
1279 if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
1280 return fullMatch;
1281 }
1282
1283 // convert the url to a full url
1284 var newUrl;
1285
1286 if (unquotedOrigUrl.indexOf("//") === 0) {
1287 //TODO: should we add protocol?
1288 newUrl = unquotedOrigUrl;
1289 } else if (unquotedOrigUrl.indexOf("/") === 0) {
1290 // path should be relative to the base url
1291 newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
1292 } else {
1293 // path should be relative to current directory
1294 newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
1295 }
1296
1297 // send back the fixed url(...)
1298 return "url(" + JSON.stringify(newUrl) + ")";
1299 });
1300
1301 // send back the fixed css
1302 return fixedCss;
1303};
1304
1305
1306/***/ }),
1307/* 9 */,
1308/* 10 */
1309/***/ (function(module, exports, __webpack_require__) {
1310
1311/* eslint-disable no-undefined */
1312
1313var throttle = __webpack_require__(21);
1314
1315/**
1316 * Debounce execution of a function. Debouncing, unlike throttling,
1317 * guarantees that a function is only executed a single time, either at the
1318 * very beginning of a series of calls, or at the very end.
1319 *
1320 * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
1321 * @param {Boolean} [atBegin] Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
1322 * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
1323 * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
1324 * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
1325 * to `callback` when the debounced-function is executed.
1326 *
1327 * @return {Function} A new, debounced function.
1328 */
1329module.exports = function ( delay, atBegin, callback ) {
1330 return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
1331};
1332
1333
1334/***/ }),
1335/* 11 */
1336/***/ (function(module, exports, __webpack_require__) {
1337
1338"use strict";
1339
1340
1341exports.__esModule = true;
1342
1343var _vue = __webpack_require__(1);
1344
1345var _vue2 = _interopRequireDefault(_vue);
1346
1347var _popup = __webpack_require__(22);
1348
1349function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1350
1351var PopperJS = _vue2.default.prototype.$isServer ? function () {} : __webpack_require__(25);
1352var stop = function stop(e) {
1353 return e.stopPropagation();
1354};
1355
1356/**
1357 * @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.
1358 * @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.
1359 * @param {String} [placement=button] - Placement of the popper accepted values: top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end)
1360 * @param {Number} [offset=0] - Amount of pixels the popper will be shifted (can be negative).
1361 * @param {Boolean} [visible=false] Visibility of the popup element.
1362 * @param {Boolean} [visible-arrow=false] Visibility of the arrow, no style.
1363 */
1364exports.default = {
1365 props: {
1366 transformOrigin: {
1367 type: [Boolean, String],
1368 default: true
1369 },
1370 placement: {
1371 type: String,
1372 default: 'bottom'
1373 },
1374 boundariesPadding: {
1375 type: Number,
1376 default: 5
1377 },
1378 reference: {},
1379 popper: {},
1380 offset: {
1381 default: 0
1382 },
1383 value: Boolean,
1384 visibleArrow: Boolean,
1385 arrowOffset: {
1386 type: Number,
1387 default: 35
1388 },
1389 appendToBody: {
1390 type: Boolean,
1391 default: true
1392 },
1393 popperOptions: {
1394 type: Object,
1395 default: function _default() {
1396 return {
1397 gpuAcceleration: false
1398 };
1399 }
1400 }
1401 },
1402
1403 data: function data() {
1404 return {
1405 showPopper: false,
1406 currentPlacement: ''
1407 };
1408 },
1409
1410
1411 watch: {
1412 value: {
1413 immediate: true,
1414 handler: function handler(val) {
1415 this.showPopper = val;
1416 this.$emit('input', val);
1417 }
1418 },
1419
1420 showPopper: function showPopper(val) {
1421 if (this.disabled) return;
1422 val ? this.updatePopper() : this.destroyPopper();
1423 this.$emit('input', val);
1424 }
1425 },
1426
1427 methods: {
1428 createPopper: function createPopper() {
1429 var _this = this;
1430
1431 if (this.$isServer) return;
1432 this.currentPlacement = this.currentPlacement || this.placement;
1433 if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {
1434 return;
1435 }
1436
1437 var options = this.popperOptions;
1438 var popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper;
1439 var reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;
1440
1441 if (!reference && this.$slots.reference && this.$slots.reference[0]) {
1442 reference = this.referenceElm = this.$slots.reference[0].elm;
1443 }
1444
1445 if (!popper || !reference) return;
1446 if (this.visibleArrow) this.appendArrow(popper);
1447 if (this.appendToBody) document.body.appendChild(this.popperElm);
1448 if (this.popperJS && this.popperJS.destroy) {
1449 this.popperJS.destroy();
1450 }
1451
1452 options.placement = this.currentPlacement;
1453 options.offset = this.offset;
1454 options.arrowOffset = this.arrowOffset;
1455 this.popperJS = new PopperJS(reference, popper, options);
1456 this.popperJS.onCreate(function (_) {
1457 _this.$emit('created', _this);
1458 _this.resetTransformOrigin();
1459 _this.$nextTick(_this.updatePopper);
1460 });
1461 if (typeof options.onUpdate === 'function') {
1462 this.popperJS.onUpdate(options.onUpdate);
1463 }
1464 this.popperJS._popper.style.zIndex = _popup.PopupManager.nextZIndex();
1465 this.popperElm.addEventListener('click', stop);
1466 },
1467 updatePopper: function updatePopper() {
1468 var popperJS = this.popperJS;
1469 if (popperJS) {
1470 popperJS.update();
1471 if (popperJS._popper) {
1472 popperJS._popper.style.zIndex = _popup.PopupManager.nextZIndex();
1473 }
1474 } else {
1475 this.createPopper();
1476 }
1477 },
1478 doDestroy: function doDestroy(forceDestroy) {
1479 /* istanbul ignore if */
1480 if (!this.popperJS || this.showPopper && !forceDestroy) return;
1481 this.popperJS.destroy();
1482 this.popperJS = null;
1483 },
1484 destroyPopper: function destroyPopper() {
1485 if (this.popperJS) {
1486 this.resetTransformOrigin();
1487 }
1488 },
1489 resetTransformOrigin: function resetTransformOrigin() {
1490 if (!this.transformOrigin) return;
1491 var placementMap = {
1492 top: 'bottom',
1493 bottom: 'top',
1494 left: 'right',
1495 right: 'left'
1496 };
1497 var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
1498 var origin = placementMap[placement];
1499 this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? 'center ' + origin : origin + ' center';
1500 },
1501 appendArrow: function appendArrow(element) {
1502 var hash = void 0;
1503 if (this.appended) {
1504 return;
1505 }
1506
1507 this.appended = true;
1508
1509 for (var item in element.attributes) {
1510 if (/^_v-/.test(element.attributes[item].name)) {
1511 hash = element.attributes[item].name;
1512 break;
1513 }
1514 }
1515
1516 var arrow = document.createElement('div');
1517
1518 if (hash) {
1519 arrow.setAttribute(hash, '');
1520 }
1521 arrow.setAttribute('x-arrow', '');
1522 arrow.className = 'popper__arrow';
1523 element.appendChild(arrow);
1524 }
1525 },
1526
1527 beforeDestroy: function beforeDestroy() {
1528 this.doDestroy(true);
1529 if (this.popperElm && this.popperElm.parentNode === document.body) {
1530 this.popperElm.removeEventListener('click', stop);
1531 document.body.removeChild(this.popperElm);
1532 }
1533 },
1534
1535
1536 // call destroy in keep-alive mode
1537 deactivated: function deactivated() {
1538 this.$options.beforeDestroy[0].call(this);
1539 }
1540};
1541
1542/***/ }),
1543/* 12 */
1544/***/ (function(module, exports, __webpack_require__) {
1545
1546"use strict";
1547
1548
1549exports.__esModule = true;
1550
1551exports.default = function () {
1552 if (_vue2.default.prototype.$isServer) return 0;
1553 if (scrollBarWidth !== undefined) return scrollBarWidth;
1554
1555 var outer = document.createElement('div');
1556 outer.className = 'el-scrollbar__wrap';
1557 outer.style.visibility = 'hidden';
1558 outer.style.width = '100px';
1559 outer.style.position = 'absolute';
1560 outer.style.top = '-9999px';
1561 document.body.appendChild(outer);
1562
1563 var widthNoScroll = outer.offsetWidth;
1564 outer.style.overflow = 'scroll';
1565
1566 var inner = document.createElement('div');
1567 inner.style.width = '100%';
1568 outer.appendChild(inner);
1569
1570 var widthWithScroll = inner.offsetWidth;
1571 outer.parentNode.removeChild(outer);
1572 scrollBarWidth = widthNoScroll - widthWithScroll;
1573
1574 return scrollBarWidth;
1575};
1576
1577var _vue = __webpack_require__(1);
1578
1579var _vue2 = _interopRequireDefault(_vue);
1580
1581function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1582
1583var scrollBarWidth = void 0;
1584
1585;
1586
1587/***/ }),
1588/* 13 */
1589/***/ (function(module, exports, __webpack_require__) {
1590
1591"use strict";
1592
1593
1594exports.__esModule = true;
1595
1596exports.default = function (target) {
1597 for (var i = 1, j = arguments.length; i < j; i++) {
1598 var source = arguments[i] || {};
1599 for (var prop in source) {
1600 if (source.hasOwnProperty(prop)) {
1601 var value = source[prop];
1602 if (value !== undefined) {
1603 target[prop] = value;
1604 }
1605 }
1606 }
1607 }
1608
1609 return target;
1610};
1611
1612;
1613
1614/***/ }),
1615/* 14 */,
1616/* 15 */
1617/***/ (function(module, exports, __webpack_require__) {
1618
1619module.exports =
1620/******/ (function(modules) { // webpackBootstrap
1621/******/ // The module cache
1622/******/ var installedModules = {};
1623/******/
1624/******/ // The require function
1625/******/ function __webpack_require__(moduleId) {
1626/******/
1627/******/ // Check if module is in cache
1628/******/ if(installedModules[moduleId]) {
1629/******/ return installedModules[moduleId].exports;
1630/******/ }
1631/******/ // Create a new module (and put it into the cache)
1632/******/ var module = installedModules[moduleId] = {
1633/******/ i: moduleId,
1634/******/ l: false,
1635/******/ exports: {}
1636/******/ };
1637/******/
1638/******/ // Execute the module function
1639/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1640/******/
1641/******/ // Flag the module as loaded
1642/******/ module.l = true;
1643/******/
1644/******/ // Return the exports of the module
1645/******/ return module.exports;
1646/******/ }
1647/******/
1648/******/
1649/******/ // expose the modules object (__webpack_modules__)
1650/******/ __webpack_require__.m = modules;
1651/******/
1652/******/ // expose the module cache
1653/******/ __webpack_require__.c = installedModules;
1654/******/
1655/******/ // define getter function for harmony exports
1656/******/ __webpack_require__.d = function(exports, name, getter) {
1657/******/ if(!__webpack_require__.o(exports, name)) {
1658/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
1659/******/ }
1660/******/ };
1661/******/
1662/******/ // define __esModule on exports
1663/******/ __webpack_require__.r = function(exports) {
1664/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1665/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1666/******/ }
1667/******/ Object.defineProperty(exports, '__esModule', { value: true });
1668/******/ };
1669/******/
1670/******/ // create a fake namespace object
1671/******/ // mode & 1: value is a module id, require it
1672/******/ // mode & 2: merge all properties of value into the ns
1673/******/ // mode & 4: return value when already ns object
1674/******/ // mode & 8|1: behave like require
1675/******/ __webpack_require__.t = function(value, mode) {
1676/******/ if(mode & 1) value = __webpack_require__(value);
1677/******/ if(mode & 8) return value;
1678/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
1679/******/ var ns = Object.create(null);
1680/******/ __webpack_require__.r(ns);
1681/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
1682/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
1683/******/ return ns;
1684/******/ };
1685/******/
1686/******/ // getDefaultExport function for compatibility with non-harmony modules
1687/******/ __webpack_require__.n = function(module) {
1688/******/ var getter = module && module.__esModule ?
1689/******/ function getDefault() { return module['default']; } :
1690/******/ function getModuleExports() { return module; };
1691/******/ __webpack_require__.d(getter, 'a', getter);
1692/******/ return getter;
1693/******/ };
1694/******/
1695/******/ // Object.prototype.hasOwnProperty.call
1696/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
1697/******/
1698/******/ // __webpack_public_path__
1699/******/ __webpack_require__.p = "/dist/";
1700/******/
1701/******/
1702/******/ // Load entry module and return exports
1703/******/ return __webpack_require__(__webpack_require__.s = 131);
1704/******/ })
1705/************************************************************************/
1706/******/ ({
1707
1708/***/ 131:
1709/***/ (function(module, __webpack_exports__, __webpack_require__) {
1710
1711"use strict";
1712__webpack_require__.r(__webpack_exports__);
1713
1714// EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
1715var vue_popper_ = __webpack_require__(5);
1716var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
1717
1718// EXTERNAL MODULE: external "throttle-debounce/debounce"
1719var debounce_ = __webpack_require__(17);
1720var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
1721
1722// EXTERNAL MODULE: external "element-ui/lib/utils/dom"
1723var dom_ = __webpack_require__(2);
1724
1725// EXTERNAL MODULE: external "element-ui/lib/utils/util"
1726var util_ = __webpack_require__(3);
1727
1728// EXTERNAL MODULE: external "vue"
1729var external_vue_ = __webpack_require__(7);
1730var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
1731
1732// CONCATENATED MODULE: ./packages/tooltip/src/main.js
1733
1734
1735
1736
1737
1738
1739/* harmony default export */ var main = ({
1740 name: 'ElTooltip',
1741
1742 mixins: [vue_popper_default.a],
1743
1744 props: {
1745 openDelay: {
1746 type: Number,
1747 default: 0
1748 },
1749 disabled: Boolean,
1750 manual: Boolean,
1751 effect: {
1752 type: String,
1753 default: 'dark'
1754 },
1755 arrowOffset: {
1756 type: Number,
1757 default: 0
1758 },
1759 popperClass: String,
1760 content: String,
1761 visibleArrow: {
1762 default: true
1763 },
1764 transition: {
1765 type: String,
1766 default: 'el-fade-in-linear'
1767 },
1768 popperOptions: {
1769 default: function _default() {
1770 return {
1771 boundariesPadding: 10,
1772 gpuAcceleration: false
1773 };
1774 }
1775 },
1776 enterable: {
1777 type: Boolean,
1778 default: true
1779 },
1780 hideAfter: {
1781 type: Number,
1782 default: 0
1783 },
1784 tabindex: {
1785 type: Number,
1786 default: 0
1787 }
1788 },
1789
1790 data: function data() {
1791 return {
1792 tooltipId: 'el-tooltip-' + Object(util_["generateId"])(),
1793 timeoutPending: null,
1794 focusing: false
1795 };
1796 },
1797 beforeCreate: function beforeCreate() {
1798 var _this = this;
1799
1800 if (this.$isServer) return;
1801
1802 this.popperVM = new external_vue_default.a({
1803 data: { node: '' },
1804 render: function render(h) {
1805 return this.node;
1806 }
1807 }).$mount();
1808
1809 this.debounceClose = debounce_default()(200, function () {
1810 return _this.handleClosePopper();
1811 });
1812 },
1813 render: function render(h) {
1814 var _this2 = this;
1815
1816 if (this.popperVM) {
1817 this.popperVM.node = h(
1818 'transition',
1819 {
1820 attrs: {
1821 name: this.transition
1822 },
1823 on: {
1824 'afterLeave': this.doDestroy
1825 }
1826 },
1827 [h(
1828 'div',
1829 {
1830 on: {
1831 'mouseleave': function mouseleave() {
1832 _this2.setExpectedState(false);_this2.debounceClose();
1833 },
1834 'mouseenter': function mouseenter() {
1835 _this2.setExpectedState(true);
1836 }
1837 },
1838
1839 ref: 'popper',
1840 attrs: { role: 'tooltip',
1841 id: this.tooltipId,
1842 'aria-hidden': this.disabled || !this.showPopper ? 'true' : 'false'
1843 },
1844 directives: [{
1845 name: 'show',
1846 value: !this.disabled && this.showPopper
1847 }],
1848
1849 'class': ['el-tooltip__popper', 'is-' + this.effect, this.popperClass] },
1850 [this.$slots.content || this.content]
1851 )]
1852 );
1853 }
1854
1855 var firstElement = this.getFirstElement();
1856 if (!firstElement) return null;
1857
1858 var data = firstElement.data = firstElement.data || {};
1859 data.staticClass = this.addTooltipClass(data.staticClass);
1860
1861 return firstElement;
1862 },
1863 mounted: function mounted() {
1864 var _this3 = this;
1865
1866 this.referenceElm = this.$el;
1867 if (this.$el.nodeType === 1) {
1868 this.$el.setAttribute('aria-describedby', this.tooltipId);
1869 this.$el.setAttribute('tabindex', this.tabindex);
1870 Object(dom_["on"])(this.referenceElm, 'mouseenter', this.show);
1871 Object(dom_["on"])(this.referenceElm, 'mouseleave', this.hide);
1872 Object(dom_["on"])(this.referenceElm, 'focus', function () {
1873 if (!_this3.$slots.default || !_this3.$slots.default.length) {
1874 _this3.handleFocus();
1875 return;
1876 }
1877 var instance = _this3.$slots.default[0].componentInstance;
1878 if (instance && instance.focus) {
1879 instance.focus();
1880 } else {
1881 _this3.handleFocus();
1882 }
1883 });
1884 Object(dom_["on"])(this.referenceElm, 'blur', this.handleBlur);
1885 Object(dom_["on"])(this.referenceElm, 'click', this.removeFocusing);
1886 }
1887 // fix issue https://github.com/ElemeFE/element/issues/14424
1888 if (this.value && this.popperVM) {
1889 this.popperVM.$nextTick(function () {
1890 if (_this3.value) {
1891 _this3.updatePopper();
1892 }
1893 });
1894 }
1895 },
1896
1897 watch: {
1898 focusing: function focusing(val) {
1899 if (val) {
1900 Object(dom_["addClass"])(this.referenceElm, 'focusing');
1901 } else {
1902 Object(dom_["removeClass"])(this.referenceElm, 'focusing');
1903 }
1904 }
1905 },
1906 methods: {
1907 show: function show() {
1908 this.setExpectedState(true);
1909 this.handleShowPopper();
1910 },
1911 hide: function hide() {
1912 this.setExpectedState(false);
1913 this.debounceClose();
1914 },
1915 handleFocus: function handleFocus() {
1916 this.focusing = true;
1917 this.show();
1918 },
1919 handleBlur: function handleBlur() {
1920 this.focusing = false;
1921 this.hide();
1922 },
1923 removeFocusing: function removeFocusing() {
1924 this.focusing = false;
1925 },
1926 addTooltipClass: function addTooltipClass(prev) {
1927 if (!prev) {
1928 return 'el-tooltip';
1929 } else {
1930 return 'el-tooltip ' + prev.replace('el-tooltip', '');
1931 }
1932 },
1933 handleShowPopper: function handleShowPopper() {
1934 var _this4 = this;
1935
1936 if (!this.expectedState || this.manual) return;
1937 clearTimeout(this.timeout);
1938 this.timeout = setTimeout(function () {
1939 _this4.showPopper = true;
1940 }, this.openDelay);
1941
1942 if (this.hideAfter > 0) {
1943 this.timeoutPending = setTimeout(function () {
1944 _this4.showPopper = false;
1945 }, this.hideAfter);
1946 }
1947 },
1948 handleClosePopper: function handleClosePopper() {
1949 if (this.enterable && this.expectedState || this.manual) return;
1950 clearTimeout(this.timeout);
1951
1952 if (this.timeoutPending) {
1953 clearTimeout(this.timeoutPending);
1954 }
1955 this.showPopper = false;
1956
1957 if (this.disabled) {
1958 this.doDestroy();
1959 }
1960 },
1961 setExpectedState: function setExpectedState(expectedState) {
1962 if (expectedState === false) {
1963 clearTimeout(this.timeoutPending);
1964 }
1965 this.expectedState = expectedState;
1966 },
1967 getFirstElement: function getFirstElement() {
1968 var slots = this.$slots.default;
1969 if (!Array.isArray(slots)) return null;
1970 var element = null;
1971 for (var index = 0; index < slots.length; index++) {
1972 if (slots[index] && slots[index].tag) {
1973 element = slots[index];
1974 };
1975 }
1976 return element;
1977 }
1978 },
1979
1980 beforeDestroy: function beforeDestroy() {
1981 this.popperVM && this.popperVM.$destroy();
1982 },
1983 destroyed: function destroyed() {
1984 var reference = this.referenceElm;
1985 if (reference.nodeType === 1) {
1986 Object(dom_["off"])(reference, 'mouseenter', this.show);
1987 Object(dom_["off"])(reference, 'mouseleave', this.hide);
1988 Object(dom_["off"])(reference, 'focus', this.handleFocus);
1989 Object(dom_["off"])(reference, 'blur', this.handleBlur);
1990 Object(dom_["off"])(reference, 'click', this.removeFocusing);
1991 }
1992 }
1993});
1994// CONCATENATED MODULE: ./packages/tooltip/index.js
1995
1996
1997/* istanbul ignore next */
1998main.install = function (Vue) {
1999 Vue.component(main.name, main);
2000};
2001
2002/* harmony default export */ var tooltip = __webpack_exports__["default"] = (main);
2003
2004/***/ }),
2005
2006/***/ 17:
2007/***/ (function(module, exports) {
2008
2009module.exports = __webpack_require__(10);
2010
2011/***/ }),
2012
2013/***/ 2:
2014/***/ (function(module, exports) {
2015
2016module.exports = __webpack_require__(4);
2017
2018/***/ }),
2019
2020/***/ 3:
2021/***/ (function(module, exports) {
2022
2023module.exports = __webpack_require__(6);
2024
2025/***/ }),
2026
2027/***/ 5:
2028/***/ (function(module, exports) {
2029
2030module.exports = __webpack_require__(11);
2031
2032/***/ }),
2033
2034/***/ 7:
2035/***/ (function(module, exports) {
2036
2037module.exports = __webpack_require__(1);
2038
2039/***/ })
2040
2041/******/ });
2042
2043/***/ }),
2044/* 16 */
2045/***/ (function(module, exports, __webpack_require__) {
2046
2047// extracted by mini-css-extract-plugin
2048
2049/***/ }),
2050/* 17 */,
2051/* 18 */,
2052/* 19 */,
2053/* 20 */,
2054/* 21 */
2055/***/ (function(module, exports) {
2056
2057/* eslint-disable no-undefined,no-param-reassign,no-shadow */
2058
2059/**
2060 * Throttle execution of a function. Especially useful for rate limiting
2061 * execution of handlers on events like resize and scroll.
2062 *
2063 * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
2064 * @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
2065 * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
2066 * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
2067 * the internal counter is reset)
2068 * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
2069 * to `callback` when the throttled-function is executed.
2070 * @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
2071 * schedule `callback` to execute after `delay` ms.
2072 *
2073 * @return {Function} A new, throttled, function.
2074 */
2075module.exports = function ( delay, noTrailing, callback, debounceMode ) {
2076
2077 // After wrapper has stopped being called, this timeout ensures that
2078 // `callback` is executed at the proper times in `throttle` and `end`
2079 // debounce modes.
2080 var timeoutID;
2081
2082 // Keep track of the last time `callback` was executed.
2083 var lastExec = 0;
2084
2085 // `noTrailing` defaults to falsy.
2086 if ( typeof noTrailing !== 'boolean' ) {
2087 debounceMode = callback;
2088 callback = noTrailing;
2089 noTrailing = undefined;
2090 }
2091
2092 // The `wrapper` function encapsulates all of the throttling / debouncing
2093 // functionality and when executed will limit the rate at which `callback`
2094 // is executed.
2095 function wrapper () {
2096
2097 var self = this;
2098 var elapsed = Number(new Date()) - lastExec;
2099 var args = arguments;
2100
2101 // Execute `callback` and update the `lastExec` timestamp.
2102 function exec () {
2103 lastExec = Number(new Date());
2104 callback.apply(self, args);
2105 }
2106
2107 // If `debounceMode` is true (at begin) this is used to clear the flag
2108 // to allow future `callback` executions.
2109 function clear () {
2110 timeoutID = undefined;
2111 }
2112
2113 if ( debounceMode && !timeoutID ) {
2114 // Since `wrapper` is being called for the first time and
2115 // `debounceMode` is true (at begin), execute `callback`.
2116 exec();
2117 }
2118
2119 // Clear any existing timeout.
2120 if ( timeoutID ) {
2121 clearTimeout(timeoutID);
2122 }
2123
2124 if ( debounceMode === undefined && elapsed > delay ) {
2125 // In throttle mode, if `delay` time has been exceeded, execute
2126 // `callback`.
2127 exec();
2128
2129 } else if ( noTrailing !== true ) {
2130 // In trailing throttle mode, since `delay` time has not been
2131 // exceeded, schedule `callback` to execute `delay` ms after most
2132 // recent execution.
2133 //
2134 // If `debounceMode` is true (at begin), schedule `clear` to execute
2135 // after `delay` ms.
2136 //
2137 // If `debounceMode` is false (at end), schedule `callback` to
2138 // execute after `delay` ms.
2139 timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
2140 }
2141
2142 }
2143
2144 // Return the wrapper function.
2145 return wrapper;
2146
2147};
2148
2149
2150/***/ }),
2151/* 22 */
2152/***/ (function(module, exports, __webpack_require__) {
2153
2154"use strict";
2155
2156
2157exports.__esModule = true;
2158exports.PopupManager = undefined;
2159
2160var _vue = __webpack_require__(1);
2161
2162var _vue2 = _interopRequireDefault(_vue);
2163
2164var _merge = __webpack_require__(13);
2165
2166var _merge2 = _interopRequireDefault(_merge);
2167
2168var _popupManager = __webpack_require__(24);
2169
2170var _popupManager2 = _interopRequireDefault(_popupManager);
2171
2172var _scrollbarWidth = __webpack_require__(12);
2173
2174var _scrollbarWidth2 = _interopRequireDefault(_scrollbarWidth);
2175
2176var _dom = __webpack_require__(4);
2177
2178function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2179
2180var idSeed = 1;
2181
2182var scrollBarWidth = void 0;
2183
2184exports.default = {
2185 props: {
2186 visible: {
2187 type: Boolean,
2188 default: false
2189 },
2190 openDelay: {},
2191 closeDelay: {},
2192 zIndex: {},
2193 modal: {
2194 type: Boolean,
2195 default: false
2196 },
2197 modalFade: {
2198 type: Boolean,
2199 default: true
2200 },
2201 modalClass: {},
2202 modalAppendToBody: {
2203 type: Boolean,
2204 default: false
2205 },
2206 lockScroll: {
2207 type: Boolean,
2208 default: true
2209 },
2210 closeOnPressEscape: {
2211 type: Boolean,
2212 default: false
2213 },
2214 closeOnClickModal: {
2215 type: Boolean,
2216 default: false
2217 }
2218 },
2219
2220 beforeMount: function beforeMount() {
2221 this._popupId = 'popup-' + idSeed++;
2222 _popupManager2.default.register(this._popupId, this);
2223 },
2224 beforeDestroy: function beforeDestroy() {
2225 _popupManager2.default.deregister(this._popupId);
2226 _popupManager2.default.closeModal(this._popupId);
2227
2228 this.restoreBodyStyle();
2229 },
2230 data: function data() {
2231 return {
2232 opened: false,
2233 bodyPaddingRight: null,
2234 computedBodyPaddingRight: 0,
2235 withoutHiddenClass: true,
2236 rendered: false
2237 };
2238 },
2239
2240
2241 watch: {
2242 visible: function visible(val) {
2243 var _this = this;
2244
2245 if (val) {
2246 if (this._opening) return;
2247 if (!this.rendered) {
2248 this.rendered = true;
2249 _vue2.default.nextTick(function () {
2250 _this.open();
2251 });
2252 } else {
2253 this.open();
2254 }
2255 } else {
2256 this.close();
2257 }
2258 }
2259 },
2260
2261 methods: {
2262 open: function open(options) {
2263 var _this2 = this;
2264
2265 if (!this.rendered) {
2266 this.rendered = true;
2267 }
2268
2269 var props = (0, _merge2.default)({}, this.$props || this, options);
2270
2271 if (this._closeTimer) {
2272 clearTimeout(this._closeTimer);
2273 this._closeTimer = null;
2274 }
2275 clearTimeout(this._openTimer);
2276
2277 var openDelay = Number(props.openDelay);
2278 if (openDelay > 0) {
2279 this._openTimer = setTimeout(function () {
2280 _this2._openTimer = null;
2281 _this2.doOpen(props);
2282 }, openDelay);
2283 } else {
2284 this.doOpen(props);
2285 }
2286 },
2287 doOpen: function doOpen(props) {
2288 if (this.$isServer) return;
2289 if (this.willOpen && !this.willOpen()) return;
2290 if (this.opened) return;
2291
2292 this._opening = true;
2293
2294 var dom = this.$el;
2295
2296 var modal = props.modal;
2297
2298 var zIndex = props.zIndex;
2299 if (zIndex) {
2300 _popupManager2.default.zIndex = zIndex;
2301 }
2302
2303 if (modal) {
2304 if (this._closing) {
2305 _popupManager2.default.closeModal(this._popupId);
2306 this._closing = false;
2307 }
2308 _popupManager2.default.openModal(this._popupId, _popupManager2.default.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
2309 if (props.lockScroll) {
2310 this.withoutHiddenClass = !(0, _dom.hasClass)(document.body, 'el-popup-parent--hidden');
2311 if (this.withoutHiddenClass) {
2312 this.bodyPaddingRight = document.body.style.paddingRight;
2313 this.computedBodyPaddingRight = parseInt((0, _dom.getStyle)(document.body, 'paddingRight'), 10);
2314 }
2315 scrollBarWidth = (0, _scrollbarWidth2.default)();
2316 var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
2317 var bodyOverflowY = (0, _dom.getStyle)(document.body, 'overflowY');
2318 if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
2319 document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
2320 }
2321 (0, _dom.addClass)(document.body, 'el-popup-parent--hidden');
2322 }
2323 }
2324
2325 if (getComputedStyle(dom).position === 'static') {
2326 dom.style.position = 'absolute';
2327 }
2328
2329 dom.style.zIndex = _popupManager2.default.nextZIndex();
2330 this.opened = true;
2331
2332 this.onOpen && this.onOpen();
2333
2334 this.doAfterOpen();
2335 },
2336 doAfterOpen: function doAfterOpen() {
2337 this._opening = false;
2338 },
2339 close: function close() {
2340 var _this3 = this;
2341
2342 if (this.willClose && !this.willClose()) return;
2343
2344 if (this._openTimer !== null) {
2345 clearTimeout(this._openTimer);
2346 this._openTimer = null;
2347 }
2348 clearTimeout(this._closeTimer);
2349
2350 var closeDelay = Number(this.closeDelay);
2351
2352 if (closeDelay > 0) {
2353 this._closeTimer = setTimeout(function () {
2354 _this3._closeTimer = null;
2355 _this3.doClose();
2356 }, closeDelay);
2357 } else {
2358 this.doClose();
2359 }
2360 },
2361 doClose: function doClose() {
2362 this._closing = true;
2363
2364 this.onClose && this.onClose();
2365
2366 if (this.lockScroll) {
2367 setTimeout(this.restoreBodyStyle, 200);
2368 }
2369
2370 this.opened = false;
2371
2372 this.doAfterClose();
2373 },
2374 doAfterClose: function doAfterClose() {
2375 _popupManager2.default.closeModal(this._popupId);
2376 this._closing = false;
2377 },
2378 restoreBodyStyle: function restoreBodyStyle() {
2379 if (this.modal && this.withoutHiddenClass) {
2380 document.body.style.paddingRight = this.bodyPaddingRight;
2381 (0, _dom.removeClass)(document.body, 'el-popup-parent--hidden');
2382 }
2383 this.withoutHiddenClass = true;
2384 }
2385 }
2386};
2387exports.PopupManager = _popupManager2.default;
2388
2389/***/ }),
2390/* 23 */
2391/***/ (function(module, exports, __webpack_require__) {
2392
2393"use strict";
2394
2395
2396exports.__esModule = true;
2397exports.isString = isString;
2398exports.isObject = isObject;
2399exports.isHtmlElement = isHtmlElement;
2400function isString(obj) {
2401 return Object.prototype.toString.call(obj) === '[object String]';
2402}
2403
2404function isObject(obj) {
2405 return Object.prototype.toString.call(obj) === '[object Object]';
2406}
2407
2408function isHtmlElement(node) {
2409 return node && node.nodeType === Node.ELEMENT_NODE;
2410}
2411
2412var isFunction = exports.isFunction = function isFunction(functionToCheck) {
2413 var getType = {};
2414 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
2415};
2416
2417var isUndefined = exports.isUndefined = function isUndefined(val) {
2418 return val === void 0;
2419};
2420
2421var isDefined = exports.isDefined = function isDefined(val) {
2422 return val !== undefined && val !== null;
2423};
2424
2425/***/ }),
2426/* 24 */
2427/***/ (function(module, exports, __webpack_require__) {
2428
2429"use strict";
2430
2431
2432exports.__esModule = true;
2433
2434var _vue = __webpack_require__(1);
2435
2436var _vue2 = _interopRequireDefault(_vue);
2437
2438var _dom = __webpack_require__(4);
2439
2440function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2441
2442var hasModal = false;
2443var hasInitZIndex = false;
2444var zIndex = void 0;
2445
2446var getModal = function getModal() {
2447 if (_vue2.default.prototype.$isServer) return;
2448 var modalDom = PopupManager.modalDom;
2449 if (modalDom) {
2450 hasModal = true;
2451 } else {
2452 hasModal = false;
2453 modalDom = document.createElement('div');
2454 PopupManager.modalDom = modalDom;
2455
2456 modalDom.addEventListener('touchmove', function (event) {
2457 event.preventDefault();
2458 event.stopPropagation();
2459 });
2460
2461 modalDom.addEventListener('click', function () {
2462 PopupManager.doOnModalClick && PopupManager.doOnModalClick();
2463 });
2464 }
2465
2466 return modalDom;
2467};
2468
2469var instances = {};
2470
2471var PopupManager = {
2472 modalFade: true,
2473
2474 getInstance: function getInstance(id) {
2475 return instances[id];
2476 },
2477
2478 register: function register(id, instance) {
2479 if (id && instance) {
2480 instances[id] = instance;
2481 }
2482 },
2483
2484 deregister: function deregister(id) {
2485 if (id) {
2486 instances[id] = null;
2487 delete instances[id];
2488 }
2489 },
2490
2491 nextZIndex: function nextZIndex() {
2492 return PopupManager.zIndex++;
2493 },
2494
2495 modalStack: [],
2496
2497 doOnModalClick: function doOnModalClick() {
2498 var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
2499 if (!topItem) return;
2500
2501 var instance = PopupManager.getInstance(topItem.id);
2502 if (instance && instance.closeOnClickModal) {
2503 instance.close();
2504 }
2505 },
2506
2507 openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
2508 if (_vue2.default.prototype.$isServer) return;
2509 if (!id || zIndex === undefined) return;
2510 this.modalFade = modalFade;
2511
2512 var modalStack = this.modalStack;
2513
2514 for (var i = 0, j = modalStack.length; i < j; i++) {
2515 var item = modalStack[i];
2516 if (item.id === id) {
2517 return;
2518 }
2519 }
2520
2521 var modalDom = getModal();
2522
2523 (0, _dom.addClass)(modalDom, 'v-modal');
2524 if (this.modalFade && !hasModal) {
2525 (0, _dom.addClass)(modalDom, 'v-modal-enter');
2526 }
2527 if (modalClass) {
2528 var classArr = modalClass.trim().split(/\s+/);
2529 classArr.forEach(function (item) {
2530 return (0, _dom.addClass)(modalDom, item);
2531 });
2532 }
2533 setTimeout(function () {
2534 (0, _dom.removeClass)(modalDom, 'v-modal-enter');
2535 }, 200);
2536
2537 if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
2538 dom.parentNode.appendChild(modalDom);
2539 } else {
2540 document.body.appendChild(modalDom);
2541 }
2542
2543 if (zIndex) {
2544 modalDom.style.zIndex = zIndex;
2545 }
2546 modalDom.tabIndex = 0;
2547 modalDom.style.display = '';
2548
2549 this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
2550 },
2551
2552 closeModal: function closeModal(id) {
2553 var modalStack = this.modalStack;
2554 var modalDom = getModal();
2555
2556 if (modalStack.length > 0) {
2557 var topItem = modalStack[modalStack.length - 1];
2558 if (topItem.id === id) {
2559 if (topItem.modalClass) {
2560 var classArr = topItem.modalClass.trim().split(/\s+/);
2561 classArr.forEach(function (item) {
2562 return (0, _dom.removeClass)(modalDom, item);
2563 });
2564 }
2565
2566 modalStack.pop();
2567 if (modalStack.length > 0) {
2568 modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
2569 }
2570 } else {
2571 for (var i = modalStack.length - 1; i >= 0; i--) {
2572 if (modalStack[i].id === id) {
2573 modalStack.splice(i, 1);
2574 break;
2575 }
2576 }
2577 }
2578 }
2579
2580 if (modalStack.length === 0) {
2581 if (this.modalFade) {
2582 (0, _dom.addClass)(modalDom, 'v-modal-leave');
2583 }
2584 setTimeout(function () {
2585 if (modalStack.length === 0) {
2586 if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
2587 modalDom.style.display = 'none';
2588 PopupManager.modalDom = undefined;
2589 }
2590 (0, _dom.removeClass)(modalDom, 'v-modal-leave');
2591 }, 200);
2592 }
2593 }
2594};
2595
2596Object.defineProperty(PopupManager, 'zIndex', {
2597 configurable: true,
2598 get: function get() {
2599 if (!hasInitZIndex) {
2600 zIndex = zIndex || (_vue2.default.prototype.$ELEMENT || {}).zIndex || 2000;
2601 hasInitZIndex = true;
2602 }
2603 return zIndex;
2604 },
2605 set: function set(value) {
2606 zIndex = value;
2607 }
2608});
2609
2610var getTopPopup = function getTopPopup() {
2611 if (_vue2.default.prototype.$isServer) return;
2612 if (PopupManager.modalStack.length > 0) {
2613 var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
2614 if (!topPopup) return;
2615 var instance = PopupManager.getInstance(topPopup.id);
2616
2617 return instance;
2618 }
2619};
2620
2621if (!_vue2.default.prototype.$isServer) {
2622 // handle `esc` key when the popup is shown
2623 window.addEventListener('keydown', function (event) {
2624 if (event.keyCode === 27) {
2625 var topPopup = getTopPopup();
2626
2627 if (topPopup && topPopup.closeOnPressEscape) {
2628 topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
2629 }
2630 }
2631 });
2632}
2633
2634exports.default = PopupManager;
2635
2636/***/ }),
2637/* 25 */
2638/***/ (function(module, exports, __webpack_require__) {
2639
2640"use strict";
2641var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
2642
2643var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2644
2645/**
2646 * @fileOverview Kickass library to create and place poppers near their reference elements.
2647 * @version {{version}}
2648 * @license
2649 * Copyright (c) 2016 Federico Zivolo and contributors
2650 *
2651 * Permission is hereby granted, free of charge, to any person obtaining a copy
2652 * of this software and associated documentation files (the "Software"), to deal
2653 * in the Software without restriction, including without limitation the rights
2654 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2655 * copies of the Software, and to permit persons to whom the Software is
2656 * furnished to do so, subject to the following conditions:
2657 *
2658 * The above copyright notice and this permission notice shall be included in all
2659 * copies or substantial portions of the Software.
2660 *
2661 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2662 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2663 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2664 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2665 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2666 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2667 * SOFTWARE.
2668 */
2669
2670//
2671// Cross module loader
2672// Supported: Node, AMD, Browser globals
2673//
2674;(function (root, factory) {
2675 if (true) {
2676 // AMD. Register as an anonymous module.
2677 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
2678 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
2679 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
2680 __WEBPACK_AMD_DEFINE_FACTORY__),
2681 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
2682 } else {}
2683})(undefined, function () {
2684
2685 'use strict';
2686
2687 var root = window;
2688
2689 // default options
2690 var DEFAULTS = {
2691 // placement of the popper
2692 placement: 'bottom',
2693
2694 gpuAcceleration: true,
2695
2696 // shift popper from its origin by the given amount of pixels (can be negative)
2697 offset: 0,
2698
2699 // the element which will act as boundary of the popper
2700 boundariesElement: 'viewport',
2701
2702 // amount of pixel used to define a minimum distance between the boundaries and the popper
2703 boundariesPadding: 5,
2704
2705 // popper will try to prevent overflow following this order,
2706 // by default, then, it could overflow on the left and on top of the boundariesElement
2707 preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
2708
2709 // the behavior used by flip to change the placement of the popper
2710 flipBehavior: 'flip',
2711
2712 arrowElement: '[x-arrow]',
2713
2714 arrowOffset: 0,
2715
2716 // list of functions used to modify the offsets before they are applied to the popper
2717 modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
2718
2719 modifiersIgnored: [],
2720
2721 forceAbsolute: false
2722 };
2723
2724 /**
2725 * Create a new Popper.js instance
2726 * @constructor Popper
2727 * @param {HTMLElement} reference - The reference element used to position the popper
2728 * @param {HTMLElement|Object} popper
2729 * The HTML element used as popper, or a configuration used to generate the popper.
2730 * @param {String} [popper.tagName='div'] The tag name of the generated popper.
2731 * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.
2732 * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.
2733 * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.
2734 * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.
2735 * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.
2736 * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.
2737 * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.
2738 * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.
2739 * @param {Object} options
2740 * @param {String} [options.placement=bottom]
2741 * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),
2742 * left(-start, -end)`
2743 *
2744 * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']
2745 * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of
2746 * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its
2747 * reference element.
2748 * By default, it will look for a child node of the popper with the `x-arrow` attribute.
2749 *
2750 * @param {Boolean} [options.gpuAcceleration=true]
2751 * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the
2752 * browser to use the GPU to accelerate the rendering.
2753 * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.
2754 *
2755 * @param {Number} [options.offset=0]
2756 * Amount of pixels the popper will be shifted (can be negative).
2757 *
2758 * @param {String|Element} [options.boundariesElement='viewport']
2759 * The element which will define the boundaries of the popper position, the popper will never be placed outside
2760 * of the defined boundaries (except if `keepTogether` is enabled)
2761 *
2762 * @param {Number} [options.boundariesPadding=5]
2763 * Additional padding for the boundaries
2764 *
2765 * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]
2766 * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,
2767 * this means that the last ones will never overflow
2768 *
2769 * @param {String|Array} [options.flipBehavior='flip']
2770 * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to
2771 * overlap its reference element. Defining `flip` as value, the placement will be flipped on
2772 * its axis (`right - left`, `top - bottom`).
2773 * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify
2774 * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,
2775 * then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)
2776 *
2777 * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]
2778 * List of functions used to modify the data before they are applied to the popper, add your custom functions
2779 * to this array to edit the offsets and placement.
2780 * The function should reflect the @params and @returns of preventOverflow
2781 *
2782 * @param {Array} [options.modifiersIgnored=[]]
2783 * Put here any built-in modifier name you want to exclude from the modifiers list
2784 * The function should reflect the @params and @returns of preventOverflow
2785 *
2786 * @param {Boolean} [options.removeOnDestroy=false]
2787 * Set to true if you want to automatically remove the popper when you call the `destroy` method.
2788 */
2789 function Popper(reference, popper, options) {
2790 this._reference = reference.jquery ? reference[0] : reference;
2791 this.state = {};
2792
2793 // if the popper variable is a configuration object, parse it to generate an HTMLElement
2794 // generate a default popper if is not defined
2795 var isNotDefined = typeof popper === 'undefined' || popper === null;
2796 var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
2797 if (isNotDefined || isConfig) {
2798 this._popper = this.parse(isConfig ? popper : {});
2799 }
2800 // otherwise, use the given HTMLElement as popper
2801 else {
2802 this._popper = popper.jquery ? popper[0] : popper;
2803 }
2804
2805 // with {} we create a new object with the options inside it
2806 this._options = Object.assign({}, DEFAULTS, options);
2807
2808 // refactoring modifiers' list
2809 this._options.modifiers = this._options.modifiers.map(function (modifier) {
2810 // remove ignored modifiers
2811 if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
2812
2813 // set the x-placement attribute before everything else because it could be used to add margins to the popper
2814 // margins needs to be calculated to get the correct popper offsets
2815 if (modifier === 'applyStyle') {
2816 this._popper.setAttribute('x-placement', this._options.placement);
2817 }
2818
2819 // return predefined modifier identified by string or keep the custom one
2820 return this.modifiers[modifier] || modifier;
2821 }.bind(this));
2822
2823 // make sure to apply the popper position before any computation
2824 this.state.position = this._getPosition(this._popper, this._reference);
2825 setStyle(this._popper, { position: this.state.position, top: 0 });
2826
2827 // fire the first update to position the popper in the right place
2828 this.update();
2829
2830 // setup event listeners, they will take care of update the position in specific situations
2831 this._setupEventListeners();
2832 return this;
2833 }
2834
2835 //
2836 // Methods
2837 //
2838 /**
2839 * Destroy the popper
2840 * @method
2841 * @memberof Popper
2842 */
2843 Popper.prototype.destroy = function () {
2844 this._popper.removeAttribute('x-placement');
2845 this._popper.style.left = '';
2846 this._popper.style.position = '';
2847 this._popper.style.top = '';
2848 this._popper.style[getSupportedPropertyName('transform')] = '';
2849 this._removeEventListeners();
2850
2851 // remove the popper if user explicity asked for the deletion on destroy
2852 if (this._options.removeOnDestroy) {
2853 this._popper.remove();
2854 }
2855 return this;
2856 };
2857
2858 /**
2859 * Updates the position of the popper, computing the new offsets and applying the new style
2860 * @method
2861 * @memberof Popper
2862 */
2863 Popper.prototype.update = function () {
2864 var data = { instance: this, styles: {} };
2865
2866 // store placement inside the data object, modifiers will be able to edit `placement` if needed
2867 // and refer to _originalPlacement to know the original value
2868 data.placement = this._options.placement;
2869 data._originalPlacement = this._options.placement;
2870
2871 // compute the popper and reference offsets and put them inside data.offsets
2872 data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
2873
2874 // get boundaries
2875 data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
2876
2877 data = this.runModifiers(data, this._options.modifiers);
2878
2879 if (typeof this.state.updateCallback === 'function') {
2880 this.state.updateCallback(data);
2881 }
2882 };
2883
2884 /**
2885 * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
2886 * @method
2887 * @memberof Popper
2888 * @param {Function} callback
2889 */
2890 Popper.prototype.onCreate = function (callback) {
2891 // the createCallbacks return as first argument the popper instance
2892 callback(this);
2893 return this;
2894 };
2895
2896 /**
2897 * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
2898 * used to style popper and its arrow.
2899 * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!
2900 * @method
2901 * @memberof Popper
2902 * @param {Function} callback
2903 */
2904 Popper.prototype.onUpdate = function (callback) {
2905 this.state.updateCallback = callback;
2906 return this;
2907 };
2908
2909 /**
2910 * Helper used to generate poppers from a configuration file
2911 * @method
2912 * @memberof Popper
2913 * @param config {Object} configuration
2914 * @returns {HTMLElement} popper
2915 */
2916 Popper.prototype.parse = function (config) {
2917 var defaultConfig = {
2918 tagName: 'div',
2919 classNames: ['popper'],
2920 attributes: [],
2921 parent: root.document.body,
2922 content: '',
2923 contentType: 'text',
2924 arrowTagName: 'div',
2925 arrowClassNames: ['popper__arrow'],
2926 arrowAttributes: ['x-arrow']
2927 };
2928 config = Object.assign({}, defaultConfig, config);
2929
2930 var d = root.document;
2931
2932 var popper = d.createElement(config.tagName);
2933 addClassNames(popper, config.classNames);
2934 addAttributes(popper, config.attributes);
2935 if (config.contentType === 'node') {
2936 popper.appendChild(config.content.jquery ? config.content[0] : config.content);
2937 } else if (config.contentType === 'html') {
2938 popper.innerHTML = config.content;
2939 } else {
2940 popper.textContent = config.content;
2941 }
2942
2943 if (config.arrowTagName) {
2944 var arrow = d.createElement(config.arrowTagName);
2945 addClassNames(arrow, config.arrowClassNames);
2946 addAttributes(arrow, config.arrowAttributes);
2947 popper.appendChild(arrow);
2948 }
2949
2950 var parent = config.parent.jquery ? config.parent[0] : config.parent;
2951
2952 // if the given parent is a string, use it to match an element
2953 // if more than one element is matched, the first one will be used as parent
2954 // if no elements are matched, the script will throw an error
2955 if (typeof parent === 'string') {
2956 parent = d.querySelectorAll(config.parent);
2957 if (parent.length > 1) {
2958 console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
2959 }
2960 if (parent.length === 0) {
2961 throw 'ERROR: the given `parent` doesn\'t exists!';
2962 }
2963 parent = parent[0];
2964 }
2965 // if the given parent is a DOM nodes list or an array of nodes with more than one element,
2966 // the first one will be used as parent
2967 if (parent.length > 1 && parent instanceof Element === false) {
2968 console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
2969 parent = parent[0];
2970 }
2971
2972 // append the generated popper to its parent
2973 parent.appendChild(popper);
2974
2975 return popper;
2976
2977 /**
2978 * Adds class names to the given element
2979 * @function
2980 * @ignore
2981 * @param {HTMLElement} target
2982 * @param {Array} classes
2983 */
2984 function addClassNames(element, classNames) {
2985 classNames.forEach(function (className) {
2986 element.classList.add(className);
2987 });
2988 }
2989
2990 /**
2991 * Adds attributes to the given element
2992 * @function
2993 * @ignore
2994 * @param {HTMLElement} target
2995 * @param {Array} attributes
2996 * @example
2997 * addAttributes(element, [ 'data-info:foobar' ]);
2998 */
2999 function addAttributes(element, attributes) {
3000 attributes.forEach(function (attribute) {
3001 element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
3002 });
3003 }
3004 };
3005
3006 /**
3007 * Helper used to get the position which will be applied to the popper
3008 * @method
3009 * @memberof Popper
3010 * @param config {HTMLElement} popper element
3011 * @param reference {HTMLElement} reference element
3012 * @returns {String} position
3013 */
3014 Popper.prototype._getPosition = function (popper, reference) {
3015 var container = getOffsetParent(reference);
3016
3017 if (this._options.forceAbsolute) {
3018 return 'absolute';
3019 }
3020
3021 // Decide if the popper will be fixed
3022 // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
3023 var isParentFixed = isFixed(reference, container);
3024 return isParentFixed ? 'fixed' : 'absolute';
3025 };
3026
3027 /**
3028 * Get offsets to the popper
3029 * @method
3030 * @memberof Popper
3031 * @access private
3032 * @param {Element} popper - the popper element
3033 * @param {Element} reference - the reference element (the popper will be relative to this)
3034 * @returns {Object} An object containing the offsets which will be applied to the popper
3035 */
3036 Popper.prototype._getOffsets = function (popper, reference, placement) {
3037 placement = placement.split('-')[0];
3038 var popperOffsets = {};
3039
3040 popperOffsets.position = this.state.position;
3041 var isParentFixed = popperOffsets.position === 'fixed';
3042
3043 //
3044 // Get reference element position
3045 //
3046 var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
3047
3048 //
3049 // Get popper sizes
3050 //
3051 var popperRect = getOuterSizes(popper);
3052
3053 //
3054 // Compute offsets of popper
3055 //
3056
3057 // depending by the popper placement we have to compute its offsets slightly differently
3058 if (['right', 'left'].indexOf(placement) !== -1) {
3059 popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
3060 if (placement === 'left') {
3061 popperOffsets.left = referenceOffsets.left - popperRect.width;
3062 } else {
3063 popperOffsets.left = referenceOffsets.right;
3064 }
3065 } else {
3066 popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
3067 if (placement === 'top') {
3068 popperOffsets.top = referenceOffsets.top - popperRect.height;
3069 } else {
3070 popperOffsets.top = referenceOffsets.bottom;
3071 }
3072 }
3073
3074 // Add width and height to our offsets object
3075 popperOffsets.width = popperRect.width;
3076 popperOffsets.height = popperRect.height;
3077
3078 return {
3079 popper: popperOffsets,
3080 reference: referenceOffsets
3081 };
3082 };
3083
3084 /**
3085 * Setup needed event listeners used to update the popper position
3086 * @method
3087 * @memberof Popper
3088 * @access private
3089 */
3090 Popper.prototype._setupEventListeners = function () {
3091 // NOTE: 1 DOM access here
3092 this.state.updateBound = this.update.bind(this);
3093 root.addEventListener('resize', this.state.updateBound);
3094 // if the boundariesElement is window we don't need to listen for the scroll event
3095 if (this._options.boundariesElement !== 'window') {
3096 var target = getScrollParent(this._reference);
3097 // here it could be both `body` or `documentElement` thanks to Firefox, we then check both
3098 if (target === root.document.body || target === root.document.documentElement) {
3099 target = root;
3100 }
3101 target.addEventListener('scroll', this.state.updateBound);
3102 this.state.scrollTarget = target;
3103 }
3104 };
3105
3106 /**
3107 * Remove event listeners used to update the popper position
3108 * @method
3109 * @memberof Popper
3110 * @access private
3111 */
3112 Popper.prototype._removeEventListeners = function () {
3113 // NOTE: 1 DOM access here
3114 root.removeEventListener('resize', this.state.updateBound);
3115 if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
3116 this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);
3117 this.state.scrollTarget = null;
3118 }
3119 this.state.updateBound = null;
3120 };
3121
3122 /**
3123 * Computed the boundaries limits and return them
3124 * @method
3125 * @memberof Popper
3126 * @access private
3127 * @param {Object} data - Object containing the property "offsets" generated by `_getOffsets`
3128 * @param {Number} padding - Boundaries padding
3129 * @param {Element} boundariesElement - Element used to define the boundaries
3130 * @returns {Object} Coordinates of the boundaries
3131 */
3132 Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
3133 // NOTE: 1 DOM access here
3134 var boundaries = {};
3135 var width, height;
3136 if (boundariesElement === 'window') {
3137 var body = root.document.body,
3138 html = root.document.documentElement;
3139
3140 height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
3141 width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
3142
3143 boundaries = {
3144 top: 0,
3145 right: width,
3146 bottom: height,
3147 left: 0
3148 };
3149 } else if (boundariesElement === 'viewport') {
3150 var offsetParent = getOffsetParent(this._popper);
3151 var scrollParent = getScrollParent(this._popper);
3152 var offsetParentRect = getOffsetRect(offsetParent);
3153
3154 // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`
3155 var getScrollTopValue = function getScrollTopValue(element) {
3156 return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;
3157 };
3158 var getScrollLeftValue = function getScrollLeftValue(element) {
3159 return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;
3160 };
3161
3162 // if the popper is fixed we don't have to substract scrolling from the boundaries
3163 var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);
3164 var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);
3165
3166 boundaries = {
3167 top: 0 - (offsetParentRect.top - scrollTop),
3168 right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
3169 bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
3170 left: 0 - (offsetParentRect.left - scrollLeft)
3171 };
3172 } else {
3173 if (getOffsetParent(this._popper) === boundariesElement) {
3174 boundaries = {
3175 top: 0,
3176 left: 0,
3177 right: boundariesElement.clientWidth,
3178 bottom: boundariesElement.clientHeight
3179 };
3180 } else {
3181 boundaries = getOffsetRect(boundariesElement);
3182 }
3183 }
3184 boundaries.left += padding;
3185 boundaries.right -= padding;
3186 boundaries.top = boundaries.top + padding;
3187 boundaries.bottom = boundaries.bottom - padding;
3188 return boundaries;
3189 };
3190
3191 /**
3192 * Loop trough the list of modifiers and run them in order, each of them will then edit the data object
3193 * @method
3194 * @memberof Popper
3195 * @access public
3196 * @param {Object} data
3197 * @param {Array} modifiers
3198 * @param {Function} ends
3199 */
3200 Popper.prototype.runModifiers = function (data, modifiers, ends) {
3201 var modifiersToRun = modifiers.slice();
3202 if (ends !== undefined) {
3203 modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
3204 }
3205
3206 modifiersToRun.forEach(function (modifier) {
3207 if (isFunction(modifier)) {
3208 data = modifier.call(this, data);
3209 }
3210 }.bind(this));
3211
3212 return data;
3213 };
3214
3215 /**
3216 * Helper used to know if the given modifier depends from another one.
3217 * @method
3218 * @memberof Popper
3219 * @param {String} requesting - name of requesting modifier
3220 * @param {String} requested - name of requested modifier
3221 * @returns {Boolean}
3222 */
3223 Popper.prototype.isModifierRequired = function (requesting, requested) {
3224 var index = getArrayKeyIndex(this._options.modifiers, requesting);
3225 return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
3226 return modifier === requested;
3227 }).length;
3228 };
3229
3230 //
3231 // Modifiers
3232 //
3233
3234 /**
3235 * Modifiers list
3236 * @namespace Popper.modifiers
3237 * @memberof Popper
3238 * @type {Object}
3239 */
3240 Popper.prototype.modifiers = {};
3241
3242 /**
3243 * Apply the computed styles to the popper element
3244 * @method
3245 * @memberof Popper.modifiers
3246 * @argument {Object} data - The data object generated by `update` method
3247 * @returns {Object} The same data object
3248 */
3249 Popper.prototype.modifiers.applyStyle = function (data) {
3250 // apply the final offsets to the popper
3251 // NOTE: 1 DOM access here
3252 var styles = {
3253 position: data.offsets.popper.position
3254 };
3255
3256 // round top and left to avoid blurry text
3257 var left = Math.round(data.offsets.popper.left);
3258 var top = Math.round(data.offsets.popper.top);
3259
3260 // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
3261 // we automatically use the supported prefixed version if needed
3262 var prefixedProperty;
3263 if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
3264 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
3265 styles.top = 0;
3266 styles.left = 0;
3267 }
3268 // othwerise, we use the standard `left` and `top` properties
3269 else {
3270 styles.left = left;
3271 styles.top = top;
3272 }
3273
3274 // any property present in `data.styles` will be applied to the popper,
3275 // in this way we can make the 3rd party modifiers add custom styles to it
3276 // Be aware, modifiers could override the properties defined in the previous
3277 // lines of this modifier!
3278 Object.assign(styles, data.styles);
3279
3280 setStyle(this._popper, styles);
3281
3282 // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
3283 // NOTE: 1 DOM access here
3284 this._popper.setAttribute('x-placement', data.placement);
3285
3286 // if the arrow modifier is required and the arrow style has been computed, apply the arrow style
3287 if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
3288 setStyle(data.arrowElement, data.offsets.arrow);
3289 }
3290
3291 return data;
3292 };
3293
3294 /**
3295 * Modifier used to shift the popper on the start or end of its reference element side
3296 * @method
3297 * @memberof Popper.modifiers
3298 * @argument {Object} data - The data object generated by `update` method
3299 * @returns {Object} The data object, properly modified
3300 */
3301 Popper.prototype.modifiers.shift = function (data) {
3302 var placement = data.placement;
3303 var basePlacement = placement.split('-')[0];
3304 var shiftVariation = placement.split('-')[1];
3305
3306 // if shift shiftVariation is specified, run the modifier
3307 if (shiftVariation) {
3308 var reference = data.offsets.reference;
3309 var popper = getPopperClientRect(data.offsets.popper);
3310
3311 var shiftOffsets = {
3312 y: {
3313 start: { top: reference.top },
3314 end: { top: reference.top + reference.height - popper.height }
3315 },
3316 x: {
3317 start: { left: reference.left },
3318 end: { left: reference.left + reference.width - popper.width }
3319 }
3320 };
3321
3322 var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
3323
3324 data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);
3325 }
3326
3327 return data;
3328 };
3329
3330 /**
3331 * Modifier used to make sure the popper does not overflows from it's boundaries
3332 * @method
3333 * @memberof Popper.modifiers
3334 * @argument {Object} data - The data object generated by `update` method
3335 * @returns {Object} The data object, properly modified
3336 */
3337 Popper.prototype.modifiers.preventOverflow = function (data) {
3338 var order = this._options.preventOverflowOrder;
3339 var popper = getPopperClientRect(data.offsets.popper);
3340
3341 var check = {
3342 left: function left() {
3343 var left = popper.left;
3344 if (popper.left < data.boundaries.left) {
3345 left = Math.max(popper.left, data.boundaries.left);
3346 }
3347 return { left: left };
3348 },
3349 right: function right() {
3350 var left = popper.left;
3351 if (popper.right > data.boundaries.right) {
3352 left = Math.min(popper.left, data.boundaries.right - popper.width);
3353 }
3354 return { left: left };
3355 },
3356 top: function top() {
3357 var top = popper.top;
3358 if (popper.top < data.boundaries.top) {
3359 top = Math.max(popper.top, data.boundaries.top);
3360 }
3361 return { top: top };
3362 },
3363 bottom: function bottom() {
3364 var top = popper.top;
3365 if (popper.bottom > data.boundaries.bottom) {
3366 top = Math.min(popper.top, data.boundaries.bottom - popper.height);
3367 }
3368 return { top: top };
3369 }
3370 };
3371
3372 order.forEach(function (direction) {
3373 data.offsets.popper = Object.assign(popper, check[direction]());
3374 });
3375
3376 return data;
3377 };
3378
3379 /**
3380 * Modifier used to make sure the popper is always near its reference
3381 * @method
3382 * @memberof Popper.modifiers
3383 * @argument {Object} data - The data object generated by _update method
3384 * @returns {Object} The data object, properly modified
3385 */
3386 Popper.prototype.modifiers.keepTogether = function (data) {
3387 var popper = getPopperClientRect(data.offsets.popper);
3388 var reference = data.offsets.reference;
3389 var f = Math.floor;
3390
3391 if (popper.right < f(reference.left)) {
3392 data.offsets.popper.left = f(reference.left) - popper.width;
3393 }
3394 if (popper.left > f(reference.right)) {
3395 data.offsets.popper.left = f(reference.right);
3396 }
3397 if (popper.bottom < f(reference.top)) {
3398 data.offsets.popper.top = f(reference.top) - popper.height;
3399 }
3400 if (popper.top > f(reference.bottom)) {
3401 data.offsets.popper.top = f(reference.bottom);
3402 }
3403
3404 return data;
3405 };
3406
3407 /**
3408 * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
3409 * Requires the `preventOverflow` modifier before it in order to work.
3410 * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!
3411 * @method
3412 * @memberof Popper.modifiers
3413 * @argument {Object} data - The data object generated by _update method
3414 * @returns {Object} The data object, properly modified
3415 */
3416 Popper.prototype.modifiers.flip = function (data) {
3417 // check if preventOverflow is in the list of modifiers before the flip modifier.
3418 // otherwise flip would not work as expected.
3419 if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
3420 console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
3421 return data;
3422 }
3423
3424 if (data.flipped && data.placement === data._originalPlacement) {
3425 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
3426 return data;
3427 }
3428
3429 var placement = data.placement.split('-')[0];
3430 var placementOpposite = getOppositePlacement(placement);
3431 var variation = data.placement.split('-')[1] || '';
3432
3433 var flipOrder = [];
3434 if (this._options.flipBehavior === 'flip') {
3435 flipOrder = [placement, placementOpposite];
3436 } else {
3437 flipOrder = this._options.flipBehavior;
3438 }
3439
3440 flipOrder.forEach(function (step, index) {
3441 if (placement !== step || flipOrder.length === index + 1) {
3442 return;
3443 }
3444
3445 placement = data.placement.split('-')[0];
3446 placementOpposite = getOppositePlacement(placement);
3447
3448 var popperOffsets = getPopperClientRect(data.offsets.popper);
3449
3450 // this boolean is used to distinguish right and bottom from top and left
3451 // they need different computations to get flipped
3452 var a = ['right', 'bottom'].indexOf(placement) !== -1;
3453
3454 // using Math.floor because the reference offsets may contain decimals we are not going to consider here
3455 if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
3456 // we'll use this boolean to detect any flip loop
3457 data.flipped = true;
3458 data.placement = flipOrder[index + 1];
3459 if (variation) {
3460 data.placement += '-' + variation;
3461 }
3462 data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
3463
3464 data = this.runModifiers(data, this._options.modifiers, this._flip);
3465 }
3466 }.bind(this));
3467 return data;
3468 };
3469
3470 /**
3471 * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
3472 * The offsets will shift the popper on the side of its reference element.
3473 * @method
3474 * @memberof Popper.modifiers
3475 * @argument {Object} data - The data object generated by _update method
3476 * @returns {Object} The data object, properly modified
3477 */
3478 Popper.prototype.modifiers.offset = function (data) {
3479 var offset = this._options.offset;
3480 var popper = data.offsets.popper;
3481
3482 if (data.placement.indexOf('left') !== -1) {
3483 popper.top -= offset;
3484 } else if (data.placement.indexOf('right') !== -1) {
3485 popper.top += offset;
3486 } else if (data.placement.indexOf('top') !== -1) {
3487 popper.left -= offset;
3488 } else if (data.placement.indexOf('bottom') !== -1) {
3489 popper.left += offset;
3490 }
3491 return data;
3492 };
3493
3494 /**
3495 * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element
3496 * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
3497 * @method
3498 * @memberof Popper.modifiers
3499 * @argument {Object} data - The data object generated by _update method
3500 * @returns {Object} The data object, properly modified
3501 */
3502 Popper.prototype.modifiers.arrow = function (data) {
3503 var arrow = this._options.arrowElement;
3504 var arrowOffset = this._options.arrowOffset;
3505
3506 // if the arrowElement is a string, suppose it's a CSS selector
3507 if (typeof arrow === 'string') {
3508 arrow = this._popper.querySelector(arrow);
3509 }
3510
3511 // if arrow element is not found, don't run the modifier
3512 if (!arrow) {
3513 return data;
3514 }
3515
3516 // the arrow element must be child of its popper
3517 if (!this._popper.contains(arrow)) {
3518 console.warn('WARNING: `arrowElement` must be child of its popper element!');
3519 return data;
3520 }
3521
3522 // arrow depends on keepTogether in order to work
3523 if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
3524 console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
3525 return data;
3526 }
3527
3528 var arrowStyle = {};
3529 var placement = data.placement.split('-')[0];
3530 var popper = getPopperClientRect(data.offsets.popper);
3531 var reference = data.offsets.reference;
3532 var isVertical = ['left', 'right'].indexOf(placement) !== -1;
3533
3534 var len = isVertical ? 'height' : 'width';
3535 var side = isVertical ? 'top' : 'left';
3536 var translate = isVertical ? 'translateY' : 'translateX';
3537 var altSide = isVertical ? 'left' : 'top';
3538 var opSide = isVertical ? 'bottom' : 'right';
3539 var arrowSize = getOuterSizes(arrow)[len];
3540
3541 //
3542 // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
3543 //
3544
3545 // top/left side
3546 if (reference[opSide] - arrowSize < popper[side]) {
3547 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
3548 }
3549 // bottom/right side
3550 if (reference[side] + arrowSize > popper[opSide]) {
3551 data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
3552 }
3553
3554 // compute center of the popper
3555 var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
3556
3557 var sideValue = center - popper[side];
3558
3559 // prevent arrow from being placed not contiguously to its popper
3560 sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
3561 arrowStyle[side] = sideValue;
3562 arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
3563
3564 data.offsets.arrow = arrowStyle;
3565 data.arrowElement = arrow;
3566
3567 return data;
3568 };
3569
3570 //
3571 // Helpers
3572 //
3573
3574 /**
3575 * Get the outer sizes of the given element (offset size + margins)
3576 * @function
3577 * @ignore
3578 * @argument {Element} element
3579 * @returns {Object} object containing width and height properties
3580 */
3581 function getOuterSizes(element) {
3582 // NOTE: 1 DOM access here
3583 var _display = element.style.display,
3584 _visibility = element.style.visibility;
3585 element.style.display = 'block';element.style.visibility = 'hidden';
3586 var calcWidthToForceRepaint = element.offsetWidth;
3587
3588 // original method
3589 var styles = root.getComputedStyle(element);
3590 var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
3591 var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
3592 var result = { width: element.offsetWidth + y, height: element.offsetHeight + x };
3593
3594 // reset element styles
3595 element.style.display = _display;element.style.visibility = _visibility;
3596 return result;
3597 }
3598
3599 /**
3600 * Get the opposite placement of the given one/
3601 * @function
3602 * @ignore
3603 * @argument {String} placement
3604 * @returns {String} flipped placement
3605 */
3606 function getOppositePlacement(placement) {
3607 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
3608 return placement.replace(/left|right|bottom|top/g, function (matched) {
3609 return hash[matched];
3610 });
3611 }
3612
3613 /**
3614 * Given the popper offsets, generate an output similar to getBoundingClientRect
3615 * @function
3616 * @ignore
3617 * @argument {Object} popperOffsets
3618 * @returns {Object} ClientRect like output
3619 */
3620 function getPopperClientRect(popperOffsets) {
3621 var offsets = Object.assign({}, popperOffsets);
3622 offsets.right = offsets.left + offsets.width;
3623 offsets.bottom = offsets.top + offsets.height;
3624 return offsets;
3625 }
3626
3627 /**
3628 * Given an array and the key to find, returns its index
3629 * @function
3630 * @ignore
3631 * @argument {Array} arr
3632 * @argument keyToFind
3633 * @returns index or null
3634 */
3635 function getArrayKeyIndex(arr, keyToFind) {
3636 var i = 0,
3637 key;
3638 for (key in arr) {
3639 if (arr[key] === keyToFind) {
3640 return i;
3641 }
3642 i++;
3643 }
3644 return null;
3645 }
3646
3647 /**
3648 * Get CSS computed property of the given element
3649 * @function
3650 * @ignore
3651 * @argument {Eement} element
3652 * @argument {String} property
3653 */
3654 function getStyleComputedProperty(element, property) {
3655 // NOTE: 1 DOM access here
3656 var css = root.getComputedStyle(element, null);
3657 return css[property];
3658 }
3659
3660 /**
3661 * Returns the offset parent of the given element
3662 * @function
3663 * @ignore
3664 * @argument {Element} element
3665 * @returns {Element} offset parent
3666 */
3667 function getOffsetParent(element) {
3668 // NOTE: 1 DOM access here
3669 var offsetParent = element.offsetParent;
3670 return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
3671 }
3672
3673 /**
3674 * Returns the scrolling parent of the given element
3675 * @function
3676 * @ignore
3677 * @argument {Element} element
3678 * @returns {Element} offset parent
3679 */
3680 function getScrollParent(element) {
3681 var parent = element.parentNode;
3682
3683 if (!parent) {
3684 return element;
3685 }
3686
3687 if (parent === root.document) {
3688 // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
3689 // greater than 0 and return the proper element
3690 if (root.document.body.scrollTop || root.document.body.scrollLeft) {
3691 return root.document.body;
3692 } else {
3693 return root.document.documentElement;
3694 }
3695 }
3696
3697 // Firefox want us to check `-x` and `-y` variations as well
3698 if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {
3699 // If the detected scrollParent is body, we perform an additional check on its parentNode
3700 // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
3701 // fixes issue #65
3702 return parent;
3703 }
3704 return getScrollParent(element.parentNode);
3705 }
3706
3707 /**
3708 * Check if the given element is fixed or is inside a fixed parent
3709 * @function
3710 * @ignore
3711 * @argument {Element} element
3712 * @argument {Element} customContainer
3713 * @returns {Boolean} answer to "isFixed?"
3714 */
3715 function isFixed(element) {
3716 if (element === root.document.body) {
3717 return false;
3718 }
3719 if (getStyleComputedProperty(element, 'position') === 'fixed') {
3720 return true;
3721 }
3722 return element.parentNode ? isFixed(element.parentNode) : element;
3723 }
3724
3725 /**
3726 * Set the style to the given popper
3727 * @function
3728 * @ignore
3729 * @argument {Element} element - Element to apply the style to
3730 * @argument {Object} styles - Object with a list of properties and values which will be applied to the element
3731 */
3732 function setStyle(element, styles) {
3733 function is_numeric(n) {
3734 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
3735 }
3736 Object.keys(styles).forEach(function (prop) {
3737 var unit = '';
3738 // add unit if the value is numeric and is one of the following
3739 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
3740 unit = 'px';
3741 }
3742 element.style[prop] = styles[prop] + unit;
3743 });
3744 }
3745
3746 /**
3747 * Check if the given variable is a function
3748 * @function
3749 * @ignore
3750 * @argument {*} functionToCheck - variable to check
3751 * @returns {Boolean} answer to: is a function?
3752 */
3753 function isFunction(functionToCheck) {
3754 var getType = {};
3755 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
3756 }
3757
3758 /**
3759 * Get the position of the given element, relative to its offset parent
3760 * @function
3761 * @ignore
3762 * @param {Element} element
3763 * @return {Object} position - Coordinates of the element and its `scrollTop`
3764 */
3765 function getOffsetRect(element) {
3766 var elementRect = {
3767 width: element.offsetWidth,
3768 height: element.offsetHeight,
3769 left: element.offsetLeft,
3770 top: element.offsetTop
3771 };
3772
3773 elementRect.right = elementRect.left + elementRect.width;
3774 elementRect.bottom = elementRect.top + elementRect.height;
3775
3776 // position
3777 return elementRect;
3778 }
3779
3780 /**
3781 * Get bounding client rect of given element
3782 * @function
3783 * @ignore
3784 * @param {HTMLElement} element
3785 * @return {Object} client rect
3786 */
3787 function getBoundingClientRect(element) {
3788 var rect = element.getBoundingClientRect();
3789
3790 // whether the IE version is lower than 11
3791 var isIE = navigator.userAgent.indexOf("MSIE") != -1;
3792
3793 // fix ie document bounding top always 0 bug
3794 var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
3795
3796 return {
3797 left: rect.left,
3798 top: rectTop,
3799 right: rect.right,
3800 bottom: rect.bottom,
3801 width: rect.right - rect.left,
3802 height: rect.bottom - rectTop
3803 };
3804 }
3805
3806 /**
3807 * Given an element and one of its parents, return the offset
3808 * @function
3809 * @ignore
3810 * @param {HTMLElement} element
3811 * @param {HTMLElement} parent
3812 * @return {Object} rect
3813 */
3814 function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
3815 var elementRect = getBoundingClientRect(element);
3816 var parentRect = getBoundingClientRect(parent);
3817
3818 if (fixed) {
3819 var scrollParent = getScrollParent(parent);
3820 parentRect.top += scrollParent.scrollTop;
3821 parentRect.bottom += scrollParent.scrollTop;
3822 parentRect.left += scrollParent.scrollLeft;
3823 parentRect.right += scrollParent.scrollLeft;
3824 }
3825
3826 var rect = {
3827 top: elementRect.top - parentRect.top,
3828 left: elementRect.left - parentRect.left,
3829 bottom: elementRect.top - parentRect.top + elementRect.height,
3830 right: elementRect.left - parentRect.left + elementRect.width,
3831 width: elementRect.width,
3832 height: elementRect.height
3833 };
3834 return rect;
3835 }
3836
3837 /**
3838 * Get the prefixed supported property name
3839 * @function
3840 * @ignore
3841 * @argument {String} property (camelCase)
3842 * @returns {String} prefixed property (camelCase)
3843 */
3844 function getSupportedPropertyName(property) {
3845 var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
3846
3847 for (var i = 0; i < prefixes.length; i++) {
3848 var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
3849 if (typeof root.document.body.style[toCheck] !== 'undefined') {
3850 return toCheck;
3851 }
3852 }
3853 return null;
3854 }
3855
3856 /**
3857 * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
3858 * objects to a target object. It will return the target object.
3859 * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
3860 * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
3861 * @function
3862 * @ignore
3863 */
3864 if (!Object.assign) {
3865 Object.defineProperty(Object, 'assign', {
3866 enumerable: false,
3867 configurable: true,
3868 writable: true,
3869 value: function value(target) {
3870 if (target === undefined || target === null) {
3871 throw new TypeError('Cannot convert first argument to object');
3872 }
3873
3874 var to = Object(target);
3875 for (var i = 1; i < arguments.length; i++) {
3876 var nextSource = arguments[i];
3877 if (nextSource === undefined || nextSource === null) {
3878 continue;
3879 }
3880 nextSource = Object(nextSource);
3881
3882 var keysArray = Object.keys(nextSource);
3883 for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
3884 var nextKey = keysArray[nextIndex];
3885 var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
3886 if (desc !== undefined && desc.enumerable) {
3887 to[nextKey] = nextSource[nextKey];
3888 }
3889 }
3890 }
3891 return to;
3892 }
3893 });
3894 }
3895
3896 return Popper;
3897});
3898
3899/***/ }),
3900/* 26 */,
3901/* 27 */,
3902/* 28 */,
3903/* 29 */,
3904/* 30 */,
3905/* 31 */,
3906/* 32 */,
3907/* 33 */,
3908/* 34 */,
3909/* 35 */,
3910/* 36 */,
3911/* 37 */,
3912/* 38 */,
3913/* 39 */,
3914/* 40 */,
3915/* 41 */,
3916/* 42 */,
3917/* 43 */
3918/***/ (function(module, __webpack_exports__, __webpack_require__) {
3919
3920"use strict";
3921// ESM COMPAT FLAG
3922__webpack_require__.r(__webpack_exports__);
3923
3924// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/tip/src/Tip.vue?vue&type=template&id=385cfedc&
3925var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"k-tip-box",style:(("width:" + _vm.textWidth + "px")),on:{"mouseover":function($event){return _vm.showTip($event)},"mousemove":function($event){return _vm.showTip($event)},"mouseout":_vm.hideTip}},[_c('tooltip',{attrs:{"content":_vm.content,"placement":_vm.position,"disabled":!_vm.textOverFlow,"popper-class":_vm.popperClass}},[_c('p',{staticClass:"k-tip-text-box"},[_vm._t("default",[_vm._v(_vm._s(_vm.text))])],2)])],1)}
3926var staticRenderFns = []
3927
3928
3929// CONCATENATED MODULE: ./src/components/tip/src/Tip.vue?vue&type=template&id=385cfedc&
3930
3931// EXTERNAL MODULE: ./node_modules/element-ui/lib/tooltip.js
3932var tooltip = __webpack_require__(15);
3933var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip);
3934
3935// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--5-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/tip/src/Tip.vue?vue&type=script&lang=js&
3936function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }
3937
3938//
3939//
3940//
3941//
3942//
3943//
3944//
3945//
3946//
3947//
3948//
3949//
3950//
3951//
3952//
3953//
3954//
3955//
3956//
3957//
3958//
3959//
3960//
3961//
3962//
3963//
3964//
3965//
3966//
3967//
3968//
3969//
3970//
3971//
3972
3973
3974__webpack_require__(55);
3975
3976/* harmony default export */ var Tipvue_type_script_lang_js_ = ({
3977 name: "KTip",
3978 components: {
3979 Tooltip: tooltip_default.a
3980 },
3981 props: {
3982 popperClass: {
3983 type: String,
3984 default: function _default() {
3985 return "";
3986 }
3987 },
3988 text: {
3989 type: String,
3990 default: function _default() {
3991 return "文本";
3992 }
3993 },
3994 content: {
3995 type: String,
3996 default: function _default() {
3997 return "提示内容";
3998 }
3999 },
4000 position: {
4001 type: String,
4002 default: function _default() {
4003 return "top";
4004 }
4005 },
4006 textWidth: {
4007 type: Number,
4008 default: function _default() {
4009 return 120;
4010 }
4011 },
4012 trigger: {
4013 type: String,
4014 default: function _default() {
4015 return "overflow"; // "hover"
4016 }
4017 }
4018 },
4019 data: function data() {
4020 return {
4021 textOverFlow: this.trigger === 'always'
4022 };
4023 },
4024 methods: {
4025 showTip: function showTip(_e) {
4026 var _this = this;
4027
4028 var showMap = new Map().set("overflow", function () {
4029 _newArrowCheck(this, _this);
4030
4031 var _e$target = _e.target,
4032 scrollHeight = _e$target.scrollHeight,
4033 scrollWidth = _e$target.scrollWidth,
4034 clientHeight = _e$target.clientHeight,
4035 clientWidth = _e$target.clientWidth; //如果文本溢出
4036
4037 if (scrollHeight > clientHeight || scrollWidth > clientWidth) {
4038 this.textOverFlow = true;
4039 } else {
4040 this.textOverFlow = false;
4041 }
4042 }.bind(this)).set("hover", function () {
4043 _newArrowCheck(this, _this);
4044
4045 this.textOverFlow = true;
4046 }.bind(this));
4047 showMap.get(this.trigger)();
4048 },
4049 hideTip: function hideTip() {
4050 this.textOverFlow = false;
4051 }
4052 }
4053});
4054// CONCATENATED MODULE: ./src/components/tip/src/Tip.vue?vue&type=script&lang=js&
4055 /* harmony default export */ var src_Tipvue_type_script_lang_js_ = (Tipvue_type_script_lang_js_);
4056// EXTERNAL MODULE: ./src/components/tip/src/Tip.vue?vue&type=style&index=0&lang=scss&
4057var Tipvue_type_style_index_0_lang_scss_ = __webpack_require__(57);
4058
4059// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
4060var componentNormalizer = __webpack_require__(0);
4061
4062// CONCATENATED MODULE: ./src/components/tip/src/Tip.vue
4063
4064
4065
4066
4067
4068
4069/* normalize component */
4070
4071var component = Object(componentNormalizer["a" /* default */])(
4072 src_Tipvue_type_script_lang_js_,
4073 render,
4074 staticRenderFns,
4075 false,
4076 null,
4077 null,
4078 null
4079
4080)
4081
4082/* harmony default export */ var Tip = (component.exports);
4083// CONCATENATED MODULE: ./src/components/tip/index.js
4084var _this = undefined;
4085
4086function tip_newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }
4087
4088
4089
4090Tip.install = function (Vue) {
4091 tip_newArrowCheck(this, _this);
4092
4093 Vue.component(Tip.name, Tip);
4094}.bind(undefined);
4095
4096/* harmony default export */ var tip = __webpack_exports__["default"] = (Tip);
4097
4098/***/ }),
4099/* 44 */,
4100/* 45 */,
4101/* 46 */,
4102/* 47 */,
4103/* 48 */,
4104/* 49 */,
4105/* 50 */,
4106/* 51 */,
4107/* 52 */,
4108/* 53 */,
4109/* 54 */,
4110/* 55 */
4111/***/ (function(module, exports, __webpack_require__) {
4112
4113
4114var content = __webpack_require__(56);
4115
4116if(typeof content === 'string') content = [[module.i, content, '']];
4117
4118var transform;
4119var insertInto;
4120
4121
4122
4123var options = {"hmr":true}
4124
4125options.transform = transform
4126options.insertInto = undefined;
4127
4128var update = __webpack_require__(3)(content, options);
4129
4130if(content.locals) module.exports = content.locals;
4131
4132if(false) {}
4133
4134/***/ }),
4135/* 56 */
4136/***/ (function(module, exports, __webpack_require__) {
4137
4138exports = module.exports = __webpack_require__(2)(false);
4139// Module
4140exports.push([module.i, ".el-tooltip:focus:hover,.el-tooltip:focus:not(.focusing){outline-width:0}.el-tooltip__popper{position:absolute;border-radius:4px;padding:10px;z-index:2000;font-size:12px;line-height:1.2;min-width:10px;word-wrap:break-word}.el-tooltip__popper .popper__arrow,.el-tooltip__popper .popper__arrow::after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-tooltip__popper .popper__arrow{border-width:6px}.el-tooltip__popper .popper__arrow::after{content:\" \";border-width:5px}.el-tooltip__popper[x-placement^=top]{margin-bottom:12px}.el-tooltip__popper[x-placement^=top] .popper__arrow{bottom:-6px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=top] .popper__arrow::after{bottom:1px;margin-left:-5px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=bottom]{margin-top:12px}.el-tooltip__popper[x-placement^=bottom] .popper__arrow{top:-6px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=bottom] .popper__arrow::after{top:1px;margin-left:-5px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=right]{margin-left:12px}.el-tooltip__popper[x-placement^=right] .popper__arrow{left:-6px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=right] .popper__arrow::after{bottom:-5px;left:1px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=left]{margin-right:12px}.el-tooltip__popper[x-placement^=left] .popper__arrow{right:-6px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper[x-placement^=left] .popper__arrow::after{right:1px;bottom:-5px;margin-left:-5px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper.is-dark{background:#303133;color:#FFF}.el-tooltip__popper.is-light{background:#FFF;border:1px solid #303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow{border-top-color:#303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow::after{border-top-color:#FFF}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow{border-bottom-color:#303133}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow::after{border-bottom-color:#FFF}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow{border-left-color:#303133}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow::after{border-left-color:#FFF}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow{border-right-color:#303133}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow::after{border-right-color:#FFF}", ""]);
4141
4142
4143
4144/***/ }),
4145/* 57 */
4146/***/ (function(module, __webpack_exports__, __webpack_require__) {
4147
4148"use strict";
4149/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_1_0_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_sass_resources_loader_lib_loader_js_ref_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Tip_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
4150/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_1_0_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_sass_resources_loader_lib_loader_js_ref_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Tip_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_1_0_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_sass_resources_loader_lib_loader_js_ref_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Tip_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
4151/* unused harmony reexport * */
4152 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_1_0_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_sass_resources_loader_lib_loader_js_ref_1_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Tip_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
4153
4154/***/ })
4155/******/ ]);
\No newline at end of file