1 | module.exports =
|
2 | (function(modules) {
|
3 |
|
4 | var installedModules = {};
|
5 |
|
6 |
|
7 | function __webpack_require__(moduleId) {
|
8 |
|
9 |
|
10 | if(installedModules[moduleId]) {
|
11 | return installedModules[moduleId].exports;
|
12 | }
|
13 |
|
14 | var module = installedModules[moduleId] = {
|
15 | i: moduleId,
|
16 | l: false,
|
17 | exports: {}
|
18 | };
|
19 |
|
20 |
|
21 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
|
23 |
|
24 | module.l = true;
|
25 |
|
26 |
|
27 | return module.exports;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | __webpack_require__.m = modules;
|
33 |
|
34 |
|
35 | __webpack_require__.c = installedModules;
|
36 |
|
37 |
|
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 |
|
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 |
|
53 |
|
54 |
|
55 |
|
56 |
|
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 |
|
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 |
|
78 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
79 |
|
80 |
|
81 | __webpack_require__.p = "/lib/";
|
82 |
|
83 |
|
84 |
|
85 | return __webpack_require__(__webpack_require__.s = 43);
|
86 | })
|
87 |
|
88 | ([
|
89 |
|
90 | (function(module, __webpack_exports__, __webpack_require__) {
|
91 |
|
92 | "use strict";
|
93 | __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | function normalizeComponent (
|
101 | scriptExports,
|
102 | render,
|
103 | staticRenderFns,
|
104 | functionalTemplate,
|
105 | injectStyles,
|
106 | scopeId,
|
107 | moduleIdentifier, /* server only */
|
108 | shadowMode /* vue-cli only */
|
109 | ) {
|
110 |
|
111 | var options = typeof scriptExports === 'function'
|
112 | ? scriptExports.options
|
113 | : scriptExports
|
114 |
|
115 |
|
116 | if (render) {
|
117 | options.render = render
|
118 | options.staticRenderFns = staticRenderFns
|
119 | options._compiled = true
|
120 | }
|
121 |
|
122 |
|
123 | if (functionalTemplate) {
|
124 | options.functional = true
|
125 | }
|
126 |
|
127 |
|
128 | if (scopeId) {
|
129 | options._scopeId = 'data-v-' + scopeId
|
130 | }
|
131 |
|
132 | var hook
|
133 | if (moduleIdentifier) {
|
134 | hook = function (context) {
|
135 |
|
136 | context =
|
137 | context ||
|
138 | (this.$vnode && this.$vnode.ssrContext) ||
|
139 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
140 |
|
141 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
142 | context = __VUE_SSR_CONTEXT__
|
143 | }
|
144 |
|
145 | if (injectStyles) {
|
146 | injectStyles.call(this, context)
|
147 | }
|
148 |
|
149 | if (context && context._registeredComponents) {
|
150 | context._registeredComponents.add(moduleIdentifier)
|
151 | }
|
152 | }
|
153 |
|
154 |
|
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 |
|
170 |
|
171 | options._injectStyles = hook
|
172 |
|
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 |
|
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 |
|
196 | (function(module, exports) {
|
197 |
|
198 | module.exports = require("vue");
|
199 |
|
200 | }),
|
201 |
|
202 | (function(module, exports, __webpack_require__) {
|
203 |
|
204 | "use strict";
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | module.exports = function (useSourceMap) {
|
213 | var list = [];
|
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 | };
|
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];
|
245 |
|
246 |
|
247 |
|
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 |
|
264 | function 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 | }
|
282 |
|
283 |
|
284 | function toComment(sourceMap) {
|
285 |
|
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 |
|
293 | (function(module, exports, __webpack_require__) {
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 | var stylesInDom = {};
|
301 |
|
302 | var 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 |
|
311 | var isOldIE = memoize(function () {
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 | return window && document && document.all && !window.atob;
|
318 | });
|
319 |
|
320 | var getTarget = function (target, parent) {
|
321 | if (parent){
|
322 | return parent.querySelector(target);
|
323 | }
|
324 | return document.querySelector(target);
|
325 | };
|
326 |
|
327 | var getElement = (function (fn) {
|
328 | var memo = {};
|
329 |
|
330 | return function(target, parent) {
|
331 |
|
332 |
|
333 |
|
334 |
|
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 |
|
342 | if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
343 | try {
|
344 |
|
345 |
|
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 |
|
357 | var singleton = null;
|
358 | var singletonCounter = 0;
|
359 | var stylesInsertedAtTop = [];
|
360 |
|
361 | var fixUrls = __webpack_require__(8);
|
362 |
|
363 | module.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 |
|
373 |
|
374 | if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
|
375 |
|
376 |
|
377 | if (!options.insertInto) options.insertInto = "head";
|
378 |
|
379 |
|
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 |
|
414 | function 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 |
|
441 | function 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 |
|
460 | function 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 |
|
488 | function 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 |
|
498 | function 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 |
|
518 | function 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 |
|
532 | function addAttrs (el, attrs) {
|
533 | Object.keys(attrs).forEach(function (key) {
|
534 | el.setAttribute(key, attrs[key]);
|
535 | });
|
536 | }
|
537 |
|
538 | function getNonce() {
|
539 | if (false) {}
|
540 |
|
541 | return __webpack_require__.nc;
|
542 | }
|
543 |
|
544 | function addStyle (obj, options) {
|
545 | var style, update, remove, result;
|
546 |
|
547 |
|
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 |
|
555 |
|
556 | obj.css = result;
|
557 | } else {
|
558 |
|
559 |
|
560 | return function() {
|
561 |
|
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 |
|
616 | var 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 |
|
626 | function 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 |
|
645 | function 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 |
|
664 | function updateLink (link, options, obj) {
|
665 | var css = obj.css;
|
666 | var sourceMap = obj.sourceMap;
|
667 |
|
668 | |
669 |
|
670 |
|
671 |
|
672 |
|
673 |
|
674 | var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
|
675 |
|
676 | if (options.convertToAbsoluteUrls || autoFixUrls) {
|
677 | css = fixUrls(css);
|
678 | }
|
679 |
|
680 | if (sourceMap) {
|
681 |
|
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 |
|
697 | (function(module, exports, __webpack_require__) {
|
698 |
|
699 | "use strict";
|
700 |
|
701 |
|
702 | exports.__esModule = true;
|
703 | exports.isInContainer = exports.getScrollContainer = exports.isScroll = exports.getStyle = exports.once = exports.off = exports.on = undefined;
|
704 |
|
705 | var _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; };
|
706 |
|
707 | exports.hasClass = hasClass;
|
708 | exports.addClass = addClass;
|
709 | exports.removeClass = removeClass;
|
710 | exports.setStyle = setStyle;
|
711 |
|
712 | var _vue = __webpack_require__(1);
|
713 |
|
714 | var _vue2 = _interopRequireDefault(_vue);
|
715 |
|
716 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
717 |
|
718 | var isServer = _vue2.default.prototype.$isServer;
|
719 | var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
720 | var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
721 | var ieVersion = isServer ? 0 : Number(document.documentMode);
|
722 |
|
723 |
|
724 | var trim = function trim(string) {
|
725 | return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
726 | };
|
727 |
|
728 | var 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 |
|
735 | var 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 |
|
752 | var 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 |
|
769 | var 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 |
|
780 | function 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 |
|
791 | function 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 |
|
812 | function 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 |
|
833 | var 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 |
|
870 | function 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 |
|
889 | var 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 |
|
898 | var 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 |
|
915 | var 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 | ,
|
937 |
|
938 | (function(module, exports, __webpack_require__) {
|
939 |
|
940 | "use strict";
|
941 |
|
942 |
|
943 | exports.__esModule = true;
|
944 | exports.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 |
|
946 | var _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 |
|
948 | exports.noop = noop;
|
949 | exports.hasOwn = hasOwn;
|
950 | exports.toObject = toObject;
|
951 | exports.getPropByPath = getPropByPath;
|
952 | exports.rafThrottle = rafThrottle;
|
953 | exports.objToArray = objToArray;
|
954 |
|
955 | var _vue = __webpack_require__(1);
|
956 |
|
957 | var _vue2 = _interopRequireDefault(_vue);
|
958 |
|
959 | var _types = __webpack_require__(23);
|
960 |
|
961 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
962 |
|
963 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
964 |
|
965 | function noop() {};
|
966 |
|
967 | function hasOwn(obj, key) {
|
968 | return hasOwnProperty.call(obj, key);
|
969 | };
|
970 |
|
971 | function extend(to, _from) {
|
972 | for (var key in _from) {
|
973 | to[key] = _from[key];
|
974 | }
|
975 | return to;
|
976 | };
|
977 |
|
978 | function 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 |
|
988 | var 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 |
|
1006 | function 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 |
|
1032 | var generateId = exports.generateId = function generateId() {
|
1033 | return Math.floor(Math.random() * 10000);
|
1034 | };
|
1035 |
|
1036 | var valueEquals = exports.valueEquals = function valueEquals(a, b) {
|
1037 |
|
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 |
|
1048 | var 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 |
|
1054 | var 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 |
|
1063 | var arrayFind = exports.arrayFind = function arrayFind(arr, pred) {
|
1064 | var idx = arrayFindIndex(arr, pred);
|
1065 | return idx !== -1 ? arr[idx] : undefined;
|
1066 | };
|
1067 |
|
1068 |
|
1069 | var 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 |
|
1079 | var isIE = exports.isIE = function isIE() {
|
1080 | return !_vue2.default.prototype.$isServer && !isNaN(Number(document.documentMode));
|
1081 | };
|
1082 |
|
1083 | var isEdge = exports.isEdge = function isEdge() {
|
1084 | return !_vue2.default.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
|
1085 | };
|
1086 |
|
1087 | var isFirefox = exports.isFirefox = function isFirefox() {
|
1088 | return !_vue2.default.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
|
1089 | };
|
1090 |
|
1091 | var 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 |
|
1106 | var 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 |
|
1111 | var 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 |
|
1116 | var 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 |
|
1128 | var 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 |
|
1145 | var 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 |
|
1152 | var isEmpty = exports.isEmpty = function isEmpty(val) {
|
1153 |
|
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 |
|
1164 | case '[object String]':
|
1165 | case '[object Array]':
|
1166 | return !val.length;
|
1167 |
|
1168 |
|
1169 | case '[object File]':
|
1170 | case '[object Map]':
|
1171 | case '[object Set]':
|
1172 | {
|
1173 | return !val.size;
|
1174 | }
|
1175 |
|
1176 | case '[object Object]':
|
1177 | {
|
1178 | return !Object.keys(val).length;
|
1179 | }
|
1180 | }
|
1181 |
|
1182 | return false;
|
1183 | };
|
1184 |
|
1185 | function 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 |
|
1203 | function objToArray(obj) {
|
1204 | if (Array.isArray(obj)) {
|
1205 | return obj;
|
1206 | }
|
1207 | return isEmpty(obj) ? [] : [obj];
|
1208 | }
|
1209 |
|
1210 | }),
|
1211 | ,
|
1212 |
|
1213 | (function(module, exports) {
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 | module.exports = function (css) {
|
1230 |
|
1231 | var location = typeof window !== "undefined" && window.location;
|
1232 |
|
1233 | if (!location) {
|
1234 | throw new Error("fixUrls requires window.location");
|
1235 | }
|
1236 |
|
1237 |
|
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 |
|
1246 | |
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 | var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
|
1272 |
|
1273 | var unquotedOrigUrl = origUrl
|
1274 | .trim()
|
1275 | .replace(/^"(.*)"$/, function(o, $1){ return $1; })
|
1276 | .replace(/^'(.*)'$/, function(o, $1){ return $1; });
|
1277 |
|
1278 |
|
1279 | if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
|
1280 | return fullMatch;
|
1281 | }
|
1282 |
|
1283 |
|
1284 | var newUrl;
|
1285 |
|
1286 | if (unquotedOrigUrl.indexOf("//") === 0) {
|
1287 |
|
1288 | newUrl = unquotedOrigUrl;
|
1289 | } else if (unquotedOrigUrl.indexOf("/") === 0) {
|
1290 |
|
1291 | newUrl = baseUrl + unquotedOrigUrl;
|
1292 | } else {
|
1293 |
|
1294 | newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, "");
|
1295 | }
|
1296 |
|
1297 |
|
1298 | return "url(" + JSON.stringify(newUrl) + ")";
|
1299 | });
|
1300 |
|
1301 |
|
1302 | return fixedCss;
|
1303 | };
|
1304 |
|
1305 |
|
1306 | }),
|
1307 | ,
|
1308 |
|
1309 | (function(module, exports, __webpack_require__) {
|
1310 |
|
1311 |
|
1312 |
|
1313 | var throttle = __webpack_require__(21);
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 |
|
1323 |
|
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 |
|
1329 | module.exports = function ( delay, atBegin, callback ) {
|
1330 | return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
|
1331 | };
|
1332 |
|
1333 |
|
1334 | }),
|
1335 |
|
1336 | (function(module, exports, __webpack_require__) {
|
1337 |
|
1338 | "use strict";
|
1339 |
|
1340 |
|
1341 | exports.__esModule = true;
|
1342 |
|
1343 | var _vue = __webpack_require__(1);
|
1344 |
|
1345 | var _vue2 = _interopRequireDefault(_vue);
|
1346 |
|
1347 | var _popup = __webpack_require__(22);
|
1348 |
|
1349 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1350 |
|
1351 | var PopperJS = _vue2.default.prototype.$isServer ? function () {} : __webpack_require__(25);
|
1352 | var stop = function stop(e) {
|
1353 | return e.stopPropagation();
|
1354 | };
|
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 |
|
1361 |
|
1362 |
|
1363 |
|
1364 | exports.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 |
|
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 |
|
1537 | deactivated: function deactivated() {
|
1538 | this.$options.beforeDestroy[0].call(this);
|
1539 | }
|
1540 | };
|
1541 |
|
1542 | }),
|
1543 |
|
1544 | (function(module, exports, __webpack_require__) {
|
1545 |
|
1546 | "use strict";
|
1547 |
|
1548 |
|
1549 | exports.__esModule = true;
|
1550 |
|
1551 | exports.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 |
|
1577 | var _vue = __webpack_require__(1);
|
1578 |
|
1579 | var _vue2 = _interopRequireDefault(_vue);
|
1580 |
|
1581 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1582 |
|
1583 | var scrollBarWidth = void 0;
|
1584 |
|
1585 | ;
|
1586 |
|
1587 | }),
|
1588 |
|
1589 | (function(module, exports, __webpack_require__) {
|
1590 |
|
1591 | "use strict";
|
1592 |
|
1593 |
|
1594 | exports.__esModule = true;
|
1595 |
|
1596 | exports.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 | ,
|
1616 |
|
1617 | (function(module, exports, __webpack_require__) {
|
1618 |
|
1619 | module.exports =
|
1620 | (function(modules) {
|
1621 |
|
1622 | var installedModules = {};
|
1623 |
|
1624 |
|
1625 | function __webpack_require__(moduleId) {
|
1626 |
|
1627 |
|
1628 | if(installedModules[moduleId]) {
|
1629 | return installedModules[moduleId].exports;
|
1630 | }
|
1631 |
|
1632 | var module = installedModules[moduleId] = {
|
1633 | i: moduleId,
|
1634 | l: false,
|
1635 | exports: {}
|
1636 | };
|
1637 |
|
1638 |
|
1639 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
1640 |
|
1641 |
|
1642 | module.l = true;
|
1643 |
|
1644 |
|
1645 | return module.exports;
|
1646 | }
|
1647 |
|
1648 |
|
1649 |
|
1650 | __webpack_require__.m = modules;
|
1651 |
|
1652 |
|
1653 | __webpack_require__.c = installedModules;
|
1654 |
|
1655 |
|
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 |
|
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 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
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 |
|
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 |
|
1696 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
1697 |
|
1698 |
|
1699 | __webpack_require__.p = "/dist/";
|
1700 |
|
1701 |
|
1702 |
|
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 |
|
1715 | var vue_popper_ = __webpack_require__(5);
|
1716 | var vue_popper_default = __webpack_require__.n(vue_popper_);
|
1717 |
|
1718 |
|
1719 | var debounce_ = __webpack_require__(17);
|
1720 | var debounce_default = __webpack_require__.n(debounce_);
|
1721 |
|
1722 |
|
1723 | var dom_ = __webpack_require__(2);
|
1724 |
|
1725 |
|
1726 | var util_ = __webpack_require__(3);
|
1727 |
|
1728 |
|
1729 | var external_vue_ = __webpack_require__(7);
|
1730 | var external_vue_default = __webpack_require__.n(external_vue_);
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 |
|
1739 | 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 |
|
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 |
|
1995 |
|
1996 |
|
1997 |
|
1998 | main.install = function (Vue) {
|
1999 | Vue.component(main.name, main);
|
2000 | };
|
2001 |
|
2002 | var tooltip = __webpack_exports__["default"] = (main);
|
2003 |
|
2004 | }),
|
2005 |
|
2006 | 17:
|
2007 | (function(module, exports) {
|
2008 |
|
2009 | module.exports = __webpack_require__(10);
|
2010 |
|
2011 | }),
|
2012 |
|
2013 | 2:
|
2014 | (function(module, exports) {
|
2015 |
|
2016 | module.exports = __webpack_require__(4);
|
2017 |
|
2018 | }),
|
2019 |
|
2020 | 3:
|
2021 | (function(module, exports) {
|
2022 |
|
2023 | module.exports = __webpack_require__(6);
|
2024 |
|
2025 | }),
|
2026 |
|
2027 | 5:
|
2028 | (function(module, exports) {
|
2029 |
|
2030 | module.exports = __webpack_require__(11);
|
2031 |
|
2032 | }),
|
2033 |
|
2034 | 7:
|
2035 | (function(module, exports) {
|
2036 |
|
2037 | module.exports = __webpack_require__(1);
|
2038 |
|
2039 | })
|
2040 |
|
2041 | });
|
2042 |
|
2043 | }),
|
2044 |
|
2045 | (function(module, exports, __webpack_require__) {
|
2046 |
|
2047 |
|
2048 |
|
2049 | }),
|
2050 | ,
|
2051 | ,
|
2052 | ,
|
2053 | ,
|
2054 |
|
2055 | (function(module, exports) {
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 |
|
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 |
|
2072 |
|
2073 |
|
2074 |
|
2075 | module.exports = function ( delay, noTrailing, callback, debounceMode ) {
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 | var timeoutID;
|
2081 |
|
2082 |
|
2083 | var lastExec = 0;
|
2084 |
|
2085 |
|
2086 | if ( typeof noTrailing !== 'boolean' ) {
|
2087 | debounceMode = callback;
|
2088 | callback = noTrailing;
|
2089 | noTrailing = undefined;
|
2090 | }
|
2091 |
|
2092 |
|
2093 |
|
2094 |
|
2095 | function wrapper () {
|
2096 |
|
2097 | var self = this;
|
2098 | var elapsed = Number(new Date()) - lastExec;
|
2099 | var args = arguments;
|
2100 |
|
2101 |
|
2102 | function exec () {
|
2103 | lastExec = Number(new Date());
|
2104 | callback.apply(self, args);
|
2105 | }
|
2106 |
|
2107 |
|
2108 |
|
2109 | function clear () {
|
2110 | timeoutID = undefined;
|
2111 | }
|
2112 |
|
2113 | if ( debounceMode && !timeoutID ) {
|
2114 |
|
2115 |
|
2116 | exec();
|
2117 | }
|
2118 |
|
2119 |
|
2120 | if ( timeoutID ) {
|
2121 | clearTimeout(timeoutID);
|
2122 | }
|
2123 |
|
2124 | if ( debounceMode === undefined && elapsed > delay ) {
|
2125 |
|
2126 |
|
2127 | exec();
|
2128 |
|
2129 | } else if ( noTrailing !== true ) {
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 | timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
2140 | }
|
2141 |
|
2142 | }
|
2143 |
|
2144 |
|
2145 | return wrapper;
|
2146 |
|
2147 | };
|
2148 |
|
2149 |
|
2150 | }),
|
2151 |
|
2152 | (function(module, exports, __webpack_require__) {
|
2153 |
|
2154 | "use strict";
|
2155 |
|
2156 |
|
2157 | exports.__esModule = true;
|
2158 | exports.PopupManager = undefined;
|
2159 |
|
2160 | var _vue = __webpack_require__(1);
|
2161 |
|
2162 | var _vue2 = _interopRequireDefault(_vue);
|
2163 |
|
2164 | var _merge = __webpack_require__(13);
|
2165 |
|
2166 | var _merge2 = _interopRequireDefault(_merge);
|
2167 |
|
2168 | var _popupManager = __webpack_require__(24);
|
2169 |
|
2170 | var _popupManager2 = _interopRequireDefault(_popupManager);
|
2171 |
|
2172 | var _scrollbarWidth = __webpack_require__(12);
|
2173 |
|
2174 | var _scrollbarWidth2 = _interopRequireDefault(_scrollbarWidth);
|
2175 |
|
2176 | var _dom = __webpack_require__(4);
|
2177 |
|
2178 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2179 |
|
2180 | var idSeed = 1;
|
2181 |
|
2182 | var scrollBarWidth = void 0;
|
2183 |
|
2184 | exports.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 | };
|
2387 | exports.PopupManager = _popupManager2.default;
|
2388 |
|
2389 | }),
|
2390 |
|
2391 | (function(module, exports, __webpack_require__) {
|
2392 |
|
2393 | "use strict";
|
2394 |
|
2395 |
|
2396 | exports.__esModule = true;
|
2397 | exports.isString = isString;
|
2398 | exports.isObject = isObject;
|
2399 | exports.isHtmlElement = isHtmlElement;
|
2400 | function isString(obj) {
|
2401 | return Object.prototype.toString.call(obj) === '[object String]';
|
2402 | }
|
2403 |
|
2404 | function isObject(obj) {
|
2405 | return Object.prototype.toString.call(obj) === '[object Object]';
|
2406 | }
|
2407 |
|
2408 | function isHtmlElement(node) {
|
2409 | return node && node.nodeType === Node.ELEMENT_NODE;
|
2410 | }
|
2411 |
|
2412 | var isFunction = exports.isFunction = function isFunction(functionToCheck) {
|
2413 | var getType = {};
|
2414 | return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
2415 | };
|
2416 |
|
2417 | var isUndefined = exports.isUndefined = function isUndefined(val) {
|
2418 | return val === void 0;
|
2419 | };
|
2420 |
|
2421 | var isDefined = exports.isDefined = function isDefined(val) {
|
2422 | return val !== undefined && val !== null;
|
2423 | };
|
2424 |
|
2425 | }),
|
2426 |
|
2427 | (function(module, exports, __webpack_require__) {
|
2428 |
|
2429 | "use strict";
|
2430 |
|
2431 |
|
2432 | exports.__esModule = true;
|
2433 |
|
2434 | var _vue = __webpack_require__(1);
|
2435 |
|
2436 | var _vue2 = _interopRequireDefault(_vue);
|
2437 |
|
2438 | var _dom = __webpack_require__(4);
|
2439 |
|
2440 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2441 |
|
2442 | var hasModal = false;
|
2443 | var hasInitZIndex = false;
|
2444 | var zIndex = void 0;
|
2445 |
|
2446 | var 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 |
|
2469 | var instances = {};
|
2470 |
|
2471 | var 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 |
|
2596 | Object.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 |
|
2610 | var 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 |
|
2621 | if (!_vue2.default.prototype.$isServer) {
|
2622 |
|
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 |
|
2634 | exports.default = PopupManager;
|
2635 |
|
2636 | }),
|
2637 |
|
2638 | (function(module, exports, __webpack_require__) {
|
2639 |
|
2640 | "use strict";
|
2641 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
2642 |
|
2643 | var _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 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 | ;(function (root, factory) {
|
2675 | if (true) {
|
2676 |
|
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 |
|
2690 | var DEFAULTS = {
|
2691 |
|
2692 | placement: 'bottom',
|
2693 |
|
2694 | gpuAcceleration: true,
|
2695 |
|
2696 |
|
2697 | offset: 0,
|
2698 |
|
2699 |
|
2700 | boundariesElement: 'viewport',
|
2701 |
|
2702 |
|
2703 | boundariesPadding: 5,
|
2704 |
|
2705 |
|
2706 |
|
2707 | preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
2708 |
|
2709 |
|
2710 | flipBehavior: 'flip',
|
2711 |
|
2712 | arrowElement: '[x-arrow]',
|
2713 |
|
2714 | arrowOffset: 0,
|
2715 |
|
2716 |
|
2717 | modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
|
2718 |
|
2719 | modifiersIgnored: [],
|
2720 |
|
2721 | forceAbsolute: false
|
2722 | };
|
2723 |
|
2724 | |
2725 |
|
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 |
|
2741 |
|
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 | function Popper(reference, popper, options) {
|
2790 | this._reference = reference.jquery ? reference[0] : reference;
|
2791 | this.state = {};
|
2792 |
|
2793 |
|
2794 |
|
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 |
|
2801 | else {
|
2802 | this._popper = popper.jquery ? popper[0] : popper;
|
2803 | }
|
2804 |
|
2805 |
|
2806 | this._options = Object.assign({}, DEFAULTS, options);
|
2807 |
|
2808 |
|
2809 | this._options.modifiers = this._options.modifiers.map(function (modifier) {
|
2810 |
|
2811 | if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
|
2812 |
|
2813 |
|
2814 |
|
2815 | if (modifier === 'applyStyle') {
|
2816 | this._popper.setAttribute('x-placement', this._options.placement);
|
2817 | }
|
2818 |
|
2819 |
|
2820 | return this.modifiers[modifier] || modifier;
|
2821 | }.bind(this));
|
2822 |
|
2823 |
|
2824 | this.state.position = this._getPosition(this._popper, this._reference);
|
2825 | setStyle(this._popper, { position: this.state.position, top: 0 });
|
2826 |
|
2827 |
|
2828 | this.update();
|
2829 |
|
2830 |
|
2831 | this._setupEventListeners();
|
2832 | return this;
|
2833 | }
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 | |
2839 |
|
2840 |
|
2841 |
|
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 |
|
2852 | if (this._options.removeOnDestroy) {
|
2853 | this._popper.remove();
|
2854 | }
|
2855 | return this;
|
2856 | };
|
2857 |
|
2858 | |
2859 |
|
2860 |
|
2861 |
|
2862 |
|
2863 | Popper.prototype.update = function () {
|
2864 | var data = { instance: this, styles: {} };
|
2865 |
|
2866 |
|
2867 |
|
2868 | data.placement = this._options.placement;
|
2869 | data._originalPlacement = this._options.placement;
|
2870 |
|
2871 |
|
2872 | data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
|
2873 |
|
2874 |
|
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 |
|
2886 |
|
2887 |
|
2888 |
|
2889 |
|
2890 | Popper.prototype.onCreate = function (callback) {
|
2891 |
|
2892 | callback(this);
|
2893 | return this;
|
2894 | };
|
2895 |
|
2896 | |
2897 |
|
2898 |
|
2899 |
|
2900 |
|
2901 |
|
2902 |
|
2903 |
|
2904 | Popper.prototype.onUpdate = function (callback) {
|
2905 | this.state.updateCallback = callback;
|
2906 | return this;
|
2907 | };
|
2908 |
|
2909 | |
2910 |
|
2911 |
|
2912 |
|
2913 |
|
2914 |
|
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 |
|
2953 |
|
2954 |
|
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 |
|
2966 |
|
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 |
|
2973 | parent.appendChild(popper);
|
2974 |
|
2975 | return popper;
|
2976 |
|
2977 | |
2978 |
|
2979 |
|
2980 |
|
2981 |
|
2982 |
|
2983 |
|
2984 | function addClassNames(element, classNames) {
|
2985 | classNames.forEach(function (className) {
|
2986 | element.classList.add(className);
|
2987 | });
|
2988 | }
|
2989 |
|
2990 | |
2991 |
|
2992 |
|
2993 |
|
2994 |
|
2995 |
|
2996 |
|
2997 |
|
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 |
|
3008 |
|
3009 |
|
3010 |
|
3011 |
|
3012 |
|
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 |
|
3022 |
|
3023 | var isParentFixed = isFixed(reference, container);
|
3024 | return isParentFixed ? 'fixed' : 'absolute';
|
3025 | };
|
3026 |
|
3027 | |
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 |
|
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 |
|
3045 |
|
3046 | var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
|
3047 |
|
3048 |
|
3049 |
|
3050 |
|
3051 | var popperRect = getOuterSizes(popper);
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
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 |
|
3075 | popperOffsets.width = popperRect.width;
|
3076 | popperOffsets.height = popperRect.height;
|
3077 |
|
3078 | return {
|
3079 | popper: popperOffsets,
|
3080 | reference: referenceOffsets
|
3081 | };
|
3082 | };
|
3083 |
|
3084 | |
3085 |
|
3086 |
|
3087 |
|
3088 |
|
3089 |
|
3090 | Popper.prototype._setupEventListeners = function () {
|
3091 |
|
3092 | this.state.updateBound = this.update.bind(this);
|
3093 | root.addEventListener('resize', this.state.updateBound);
|
3094 |
|
3095 | if (this._options.boundariesElement !== 'window') {
|
3096 | var target = getScrollParent(this._reference);
|
3097 |
|
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 |
|
3108 |
|
3109 |
|
3110 |
|
3111 |
|
3112 | Popper.prototype._removeEventListeners = function () {
|
3113 |
|
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 |
|
3124 |
|
3125 |
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 |
|
3132 | Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
3133 |
|
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 |
|
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 |
|
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 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
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 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
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 |
|
3232 |
|
3233 |
|
3234 | |
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 | Popper.prototype.modifiers = {};
|
3241 |
|
3242 | |
3243 |
|
3244 |
|
3245 |
|
3246 |
|
3247 |
|
3248 |
|
3249 | Popper.prototype.modifiers.applyStyle = function (data) {
|
3250 |
|
3251 |
|
3252 | var styles = {
|
3253 | position: data.offsets.popper.position
|
3254 | };
|
3255 |
|
3256 |
|
3257 | var left = Math.round(data.offsets.popper.left);
|
3258 | var top = Math.round(data.offsets.popper.top);
|
3259 |
|
3260 |
|
3261 |
|
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 |
|
3269 | else {
|
3270 | styles.left = left;
|
3271 | styles.top = top;
|
3272 | }
|
3273 |
|
3274 |
|
3275 |
|
3276 |
|
3277 |
|
3278 | Object.assign(styles, data.styles);
|
3279 |
|
3280 | setStyle(this._popper, styles);
|
3281 |
|
3282 |
|
3283 |
|
3284 | this._popper.setAttribute('x-placement', data.placement);
|
3285 |
|
3286 |
|
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 |
|
3296 |
|
3297 |
|
3298 |
|
3299 |
|
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 |
|
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 |
|
3332 |
|
3333 |
|
3334 |
|
3335 |
|
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 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
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 |
|
3409 |
|
3410 |
|
3411 |
|
3412 |
|
3413 |
|
3414 |
|
3415 |
|
3416 | Popper.prototype.modifiers.flip = function (data) {
|
3417 |
|
3418 |
|
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 |
|
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 |
|
3451 |
|
3452 | var a = ['right', 'bottom'].indexOf(placement) !== -1;
|
3453 |
|
3454 |
|
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 |
|
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 |
|
3472 |
|
3473 |
|
3474 |
|
3475 |
|
3476 |
|
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 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 |
|
3502 | Popper.prototype.modifiers.arrow = function (data) {
|
3503 | var arrow = this._options.arrowElement;
|
3504 | var arrowOffset = this._options.arrowOffset;
|
3505 |
|
3506 |
|
3507 | if (typeof arrow === 'string') {
|
3508 | arrow = this._popper.querySelector(arrow);
|
3509 | }
|
3510 |
|
3511 |
|
3512 | if (!arrow) {
|
3513 | return data;
|
3514 | }
|
3515 |
|
3516 |
|
3517 | if (!this._popper.contains(arrow)) {
|
3518 | console.warn('WARNING: `arrowElement` must be child of its popper element!');
|
3519 | return data;
|
3520 | }
|
3521 |
|
3522 |
|
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 |
|
3543 |
|
3544 |
|
3545 |
|
3546 | if (reference[opSide] - arrowSize < popper[side]) {
|
3547 | data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
3548 | }
|
3549 |
|
3550 | if (reference[side] + arrowSize > popper[opSide]) {
|
3551 | data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
3552 | }
|
3553 |
|
3554 |
|
3555 | var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
|
3556 |
|
3557 | var sideValue = center - popper[side];
|
3558 |
|
3559 |
|
3560 | sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
|
3561 | arrowStyle[side] = sideValue;
|
3562 | arrowStyle[altSide] = '';
|
3563 |
|
3564 | data.offsets.arrow = arrowStyle;
|
3565 | data.arrowElement = arrow;
|
3566 |
|
3567 | return data;
|
3568 | };
|
3569 |
|
3570 |
|
3571 |
|
3572 |
|
3573 |
|
3574 | |
3575 |
|
3576 |
|
3577 |
|
3578 |
|
3579 |
|
3580 |
|
3581 | function getOuterSizes(element) {
|
3582 |
|
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 |
|
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 |
|
3595 | element.style.display = _display;element.style.visibility = _visibility;
|
3596 | return result;
|
3597 | }
|
3598 |
|
3599 | |
3600 |
|
3601 |
|
3602 |
|
3603 |
|
3604 |
|
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 |
|
3615 |
|
3616 |
|
3617 |
|
3618 |
|
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 |
|
3629 |
|
3630 |
|
3631 |
|
3632 |
|
3633 |
|
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 |
|
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 | function getStyleComputedProperty(element, property) {
|
3655 |
|
3656 | var css = root.getComputedStyle(element, null);
|
3657 | return css[property];
|
3658 | }
|
3659 |
|
3660 | |
3661 |
|
3662 |
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 | function getOffsetParent(element) {
|
3668 |
|
3669 | var offsetParent = element.offsetParent;
|
3670 | return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
|
3671 | }
|
3672 |
|
3673 | |
3674 |
|
3675 |
|
3676 |
|
3677 |
|
3678 |
|
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 |
|
3689 |
|
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 |
|
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 |
|
3700 |
|
3701 |
|
3702 | return parent;
|
3703 | }
|
3704 | return getScrollParent(element.parentNode);
|
3705 | }
|
3706 |
|
3707 | |
3708 |
|
3709 |
|
3710 |
|
3711 |
|
3712 |
|
3713 |
|
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 |
|
3727 |
|
3728 |
|
3729 |
|
3730 |
|
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 |
|
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 |
|
3748 |
|
3749 |
|
3750 |
|
3751 |
|
3752 |
|
3753 | function isFunction(functionToCheck) {
|
3754 | var getType = {};
|
3755 | return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
3756 | }
|
3757 |
|
3758 | |
3759 |
|
3760 |
|
3761 |
|
3762 |
|
3763 |
|
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 |
|
3777 | return elementRect;
|
3778 | }
|
3779 |
|
3780 | |
3781 |
|
3782 |
|
3783 |
|
3784 |
|
3785 |
|
3786 |
|
3787 | function getBoundingClientRect(element) {
|
3788 | var rect = element.getBoundingClientRect();
|
3789 |
|
3790 |
|
3791 | var isIE = navigator.userAgent.indexOf("MSIE") != -1;
|
3792 |
|
3793 |
|
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 |
|
3808 |
|
3809 |
|
3810 |
|
3811 |
|
3812 |
|
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 |
|
3839 |
|
3840 |
|
3841 |
|
3842 |
|
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 |
|
3858 |
|
3859 |
|
3860 |
|
3861 |
|
3862 |
|
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 | ,
|
3901 | ,
|
3902 | ,
|
3903 | ,
|
3904 | ,
|
3905 | ,
|
3906 | ,
|
3907 | ,
|
3908 | ,
|
3909 | ,
|
3910 | ,
|
3911 | ,
|
3912 | ,
|
3913 | ,
|
3914 | ,
|
3915 | ,
|
3916 | ,
|
3917 |
|
3918 | (function(module, __webpack_exports__, __webpack_require__) {
|
3919 |
|
3920 | "use strict";
|
3921 |
|
3922 | __webpack_require__.r(__webpack_exports__);
|
3923 |
|
3924 |
|
3925 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"k-tip-box",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",style:(("max-width:" + _vm.textWidth + "px"))},[_vm._t("default",[_vm._v(_vm._s(_vm.text))])],2)])],1)}
|
3926 | var staticRenderFns = []
|
3927 |
|
3928 |
|
3929 |
|
3930 |
|
3931 |
|
3932 | var tooltip = __webpack_require__(15);
|
3933 | var tooltip_default = __webpack_require__.n(tooltip);
|
3934 |
|
3935 |
|
3936 |
|
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 | __webpack_require__(55);
|
3973 |
|
3974 | var Tipvue_type_script_lang_js_ = ({
|
3975 | name: "KTip",
|
3976 | components: {
|
3977 | Tooltip: tooltip_default.a
|
3978 | },
|
3979 | props: {
|
3980 | popperClass: {
|
3981 | type: String,
|
3982 | default: function _default() {
|
3983 | return "";
|
3984 | }
|
3985 | },
|
3986 | text: {
|
3987 | type: String,
|
3988 | default: function _default() {
|
3989 | return "文本";
|
3990 | }
|
3991 | },
|
3992 | content: {
|
3993 | type: String,
|
3994 | default: function _default() {
|
3995 | return "提示内容";
|
3996 | }
|
3997 | },
|
3998 | position: {
|
3999 | type: String,
|
4000 | default: function _default() {
|
4001 | return "top";
|
4002 | }
|
4003 | },
|
4004 | textWidth: {
|
4005 | type: Number,
|
4006 | default: function _default() {
|
4007 | return 110;
|
4008 | }
|
4009 | }
|
4010 | },
|
4011 | data: function data() {
|
4012 | return {
|
4013 | textOverFlow: false
|
4014 | };
|
4015 | },
|
4016 | methods: {
|
4017 | showTip: function showTip(_e) {
|
4018 | var _e$target = _e.target,
|
4019 | scrollHeight = _e$target.scrollHeight,
|
4020 | scrollWidth = _e$target.scrollWidth,
|
4021 | clientHeight = _e$target.clientHeight,
|
4022 | clientWidth = _e$target.clientWidth;
|
4023 |
|
4024 | if (scrollHeight > clientHeight || scrollWidth > clientWidth) {
|
4025 | this.textOverFlow = true;
|
4026 | } else {
|
4027 | this.textOverFlow = false;
|
4028 | }
|
4029 | },
|
4030 | hideTip: function hideTip() {
|
4031 | this.textOverFlow = false;
|
4032 | }
|
4033 | }
|
4034 | });
|
4035 |
|
4036 | var src_Tipvue_type_script_lang_js_ = (Tipvue_type_script_lang_js_);
|
4037 |
|
4038 | var Tipvue_type_style_index_0_lang_scss_ = __webpack_require__(57);
|
4039 |
|
4040 |
|
4041 | var componentNormalizer = __webpack_require__(0);
|
4042 |
|
4043 |
|
4044 |
|
4045 |
|
4046 |
|
4047 |
|
4048 |
|
4049 |
|
4050 |
|
4051 |
|
4052 | var component = Object(componentNormalizer["a" ])(
|
4053 | src_Tipvue_type_script_lang_js_,
|
4054 | render,
|
4055 | staticRenderFns,
|
4056 | false,
|
4057 | null,
|
4058 | null,
|
4059 | null
|
4060 |
|
4061 | )
|
4062 |
|
4063 | var Tip = (component.exports);
|
4064 |
|
4065 | var _this = undefined;
|
4066 |
|
4067 | function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }
|
4068 |
|
4069 |
|
4070 |
|
4071 | Tip.install = function (Vue) {
|
4072 | _newArrowCheck(this, _this);
|
4073 |
|
4074 | Vue.component(Tip.name, Tip);
|
4075 | }.bind(undefined);
|
4076 |
|
4077 | var tip = __webpack_exports__["default"] = (Tip);
|
4078 |
|
4079 | }),
|
4080 | ,
|
4081 | ,
|
4082 | ,
|
4083 | ,
|
4084 | ,
|
4085 | ,
|
4086 | ,
|
4087 | ,
|
4088 | ,
|
4089 | ,
|
4090 | ,
|
4091 |
|
4092 | (function(module, exports, __webpack_require__) {
|
4093 |
|
4094 |
|
4095 | var content = __webpack_require__(56);
|
4096 |
|
4097 | if(typeof content === 'string') content = [[module.i, content, '']];
|
4098 |
|
4099 | var transform;
|
4100 | var insertInto;
|
4101 |
|
4102 |
|
4103 |
|
4104 | var options = {"hmr":true}
|
4105 |
|
4106 | options.transform = transform
|
4107 | options.insertInto = undefined;
|
4108 |
|
4109 | var update = __webpack_require__(3)(content, options);
|
4110 |
|
4111 | if(content.locals) module.exports = content.locals;
|
4112 |
|
4113 | if(false) {}
|
4114 |
|
4115 | }),
|
4116 |
|
4117 | (function(module, exports, __webpack_require__) {
|
4118 |
|
4119 | exports = module.exports = __webpack_require__(2)(false);
|
4120 |
|
4121 | exports.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}", ""]);
|
4122 |
|
4123 |
|
4124 |
|
4125 | }),
|
4126 |
|
4127 | (function(module, __webpack_exports__, __webpack_require__) {
|
4128 |
|
4129 | "use strict";
|
4130 | 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);
|
4131 | 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 = __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__);
|
4132 |
|
4133 | 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);
|
4134 |
|
4135 | })
|
4136 | ]); |
\ | No newline at end of file |