cy-element-ui 1.0.72 → 1.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/lib/alert.js +4 -4
  2. package/lib/aside.js +77 -77
  3. package/lib/autocomplete.js +3940 -159
  4. package/lib/avatar.js +108 -108
  5. package/lib/backtop.js +110 -110
  6. package/lib/badge.js +108 -108
  7. package/lib/breadcrumb-item.js +4 -4
  8. package/lib/breadcrumb.js +4 -4
  9. package/lib/button-group.js +4 -4
  10. package/lib/button.js +4 -4
  11. package/lib/calendar.js +1545 -46
  12. package/lib/card.js +96 -96
  13. package/lib/carousel-item.js +452 -108
  14. package/lib/carousel.js +185 -116
  15. package/lib/cascader-panel.js +2270 -187
  16. package/lib/cascader.js +6452 -275
  17. package/lib/checkbox-button.js +43 -11
  18. package/lib/checkbox-group.js +47 -15
  19. package/lib/checkbox.js +47 -15
  20. package/lib/col.js +2 -2
  21. package/lib/collapse-item.js +815 -110
  22. package/lib/collapse.js +108 -108
  23. package/lib/color-picker.js +3953 -153
  24. package/lib/container.js +88 -88
  25. package/lib/date-picker.js +5231 -420
  26. package/lib/descriptions-item.js +2 -2
  27. package/lib/descriptions.js +63 -8
  28. package/lib/dialog.js +1200 -22
  29. package/lib/directives/repeat-click.js +2 -2
  30. package/lib/divider.js +104 -104
  31. package/lib/drawer.js +875 -105
  32. package/lib/dropdown-item.js +43 -11
  33. package/lib/dropdown-menu.js +2274 -72
  34. package/lib/dropdown.js +1072 -136
  35. package/lib/element-ui.common.js +26236 -13298
  36. package/lib/empty.js +603 -7
  37. package/lib/fileUpload.js +2478 -110
  38. package/lib/footer.js +77 -77
  39. package/lib/form-item.js +420 -30
  40. package/lib/form.js +29 -15
  41. package/lib/header.js +77 -77
  42. package/lib/icon.js +4 -4
  43. package/lib/image.js +1376 -49
  44. package/lib/index.js +1 -1
  45. package/lib/infinite-scroll.js +311 -21
  46. package/lib/input-number.js +1423 -34
  47. package/lib/input.js +507 -37
  48. package/lib/link.js +4 -4
  49. package/lib/loading.js +804 -67
  50. package/lib/locale/format.js +1 -1
  51. package/lib/locale/index.js +1 -1
  52. package/lib/main.js +64 -64
  53. package/lib/menu-item-group.js +4 -4
  54. package/lib/menu-item.js +2925 -41
  55. package/lib/menu.js +745 -54
  56. package/lib/message-box.js +2536 -79
  57. package/lib/message.js +1102 -24
  58. package/lib/mixins/locale.js +1 -1
  59. package/lib/mixins/migrating.js +1 -1
  60. package/lib/notification.js +1102 -25
  61. package/lib/option-group.js +43 -11
  62. package/lib/option.js +394 -18
  63. package/lib/page-header.js +683 -87
  64. package/lib/pagination.js +6078 -139
  65. package/lib/popconfirm.js +3508 -219
  66. package/lib/popover.js +2604 -79
  67. package/lib/progress.js +4 -4
  68. package/lib/radio-button.js +43 -11
  69. package/lib/radio-group.js +43 -11
  70. package/lib/radio.js +47 -15
  71. package/lib/rate.js +756 -113
  72. package/lib/result.js +4 -4
  73. package/lib/row.js +2 -2
  74. package/lib/scrollbar.js +735 -50
  75. package/lib/select.js +4352 -209
  76. package/lib/selectDisplayInput.js +108 -108
  77. package/lib/skeleton-item.js +2 -2
  78. package/lib/skeleton.js +108 -108
  79. package/lib/slider.js +4266 -120
  80. package/lib/spinner.js +4 -4
  81. package/lib/statistic.js +9605 -117
  82. package/lib/step.js +108 -108
  83. package/lib/steps.js +514 -99
  84. package/lib/subTitle.js +91 -91
  85. package/lib/submenu.js +2444 -123
  86. package/lib/switch.js +476 -21
  87. package/lib/tab-pane.js +4 -4
  88. package/lib/tabDialog.js +1544 -18
  89. package/lib/table-column.js +881 -33
  90. package/lib/table.js +4469 -426
  91. package/lib/tabs.js +425 -12
  92. package/lib/tag.js +4 -4
  93. package/lib/time-picker.js +5013 -285
  94. package/lib/time-select.js +4945 -177
  95. package/lib/timeline-item.js +108 -108
  96. package/lib/timeline.js +82 -82
  97. package/lib/tooltip.js +2566 -41
  98. package/lib/transfer.js +2135 -141
  99. package/lib/transitions/collapse-transition.js +1 -1
  100. package/lib/tree.js +1372 -55
  101. package/lib/treeSelect.js +3420 -105
  102. package/lib/upload.js +1047 -28
  103. package/lib/utils/clickoutside.js +1 -1
  104. package/lib/utils/date-util.js +2 -2
  105. package/lib/utils/popup/index.js +2 -2
  106. package/lib/utils/popup/popup-manager.js +1 -1
  107. package/lib/utils/util.js +1 -1
  108. package/lib/utils/vdom.js +1 -1
  109. package/lib/utils/vue-popper.js +1 -1
  110. package/package.json +1 -1
  111. package/packages/form/src/form-item.vue +3 -3
  112. package/src/index.js +1 -1
package/lib/menu-item.js CHANGED
@@ -82,12 +82,464 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 89);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 86);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
90
  /***/ 0:
91
+ /***/ (function(module, exports) {
92
+
93
+ module.exports = require("vue");
94
+
95
+ /***/ }),
96
+
97
+ /***/ 1:
98
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
99
+
100
+ "use strict";
101
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
102
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
103
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
104
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
105
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
106
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
107
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
108
+ /* unused harmony export setStyle */
109
+ /* unused harmony export isScroll */
110
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
111
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
112
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
113
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
114
+ 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; };
115
+
116
+ /* istanbul ignore next */
117
+
118
+
119
+
120
+ var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
121
+ var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
122
+ var MOZ_HACK_REGEXP = /^moz([A-Z])/;
123
+ var ieVersion = isServer ? 0 : Number(document.documentMode);
124
+
125
+ /* istanbul ignore next */
126
+ var trim = function trim(string) {
127
+ return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
128
+ };
129
+ /* istanbul ignore next */
130
+ var camelCase = function camelCase(name) {
131
+ return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
132
+ return offset ? letter.toUpperCase() : letter;
133
+ }).replace(MOZ_HACK_REGEXP, 'Moz$1');
134
+ };
135
+
136
+ /* istanbul ignore next */
137
+ var on = function () {
138
+ if (!isServer && document.addEventListener) {
139
+ return function (element, event, handler) {
140
+ if (element && event && handler) {
141
+ element.addEventListener(event, handler, false);
142
+ }
143
+ };
144
+ } else {
145
+ return function (element, event, handler) {
146
+ if (element && event && handler) {
147
+ element.attachEvent('on' + event, handler);
148
+ }
149
+ };
150
+ }
151
+ }();
152
+
153
+ /* istanbul ignore next */
154
+ var off = function () {
155
+ if (!isServer && document.removeEventListener) {
156
+ return function (element, event, handler) {
157
+ if (element && event) {
158
+ element.removeEventListener(event, handler, false);
159
+ }
160
+ };
161
+ } else {
162
+ return function (element, event, handler) {
163
+ if (element && event) {
164
+ element.detachEvent('on' + event, handler);
165
+ }
166
+ };
167
+ }
168
+ }();
169
+
170
+ /* istanbul ignore next */
171
+ var once = function once(el, event, fn) {
172
+ var listener = function listener() {
173
+ if (fn) {
174
+ fn.apply(this, arguments);
175
+ }
176
+ off(el, event, listener);
177
+ };
178
+ on(el, event, listener);
179
+ };
180
+
181
+ /* istanbul ignore next */
182
+ function hasClass(el, cls) {
183
+ if (!el || !cls) return false;
184
+ if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
185
+ if (el.classList) {
186
+ return el.classList.contains(cls);
187
+ } else {
188
+ return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
189
+ }
190
+ };
191
+
192
+ /* istanbul ignore next */
193
+ function addClass(el, cls) {
194
+ if (!el) return;
195
+ var curClass = el.className;
196
+ var classes = (cls || '').split(' ');
197
+
198
+ for (var i = 0, j = classes.length; i < j; i++) {
199
+ var clsName = classes[i];
200
+ if (!clsName) continue;
201
+
202
+ if (el.classList) {
203
+ el.classList.add(clsName);
204
+ } else if (!hasClass(el, clsName)) {
205
+ curClass += ' ' + clsName;
206
+ }
207
+ }
208
+ if (!el.classList) {
209
+ el.setAttribute('class', curClass);
210
+ }
211
+ };
212
+
213
+ /* istanbul ignore next */
214
+ function removeClass(el, cls) {
215
+ if (!el || !cls) return;
216
+ var classes = cls.split(' ');
217
+ var curClass = ' ' + el.className + ' ';
218
+
219
+ for (var i = 0, j = classes.length; i < j; i++) {
220
+ var clsName = classes[i];
221
+ if (!clsName) continue;
222
+
223
+ if (el.classList) {
224
+ el.classList.remove(clsName);
225
+ } else if (hasClass(el, clsName)) {
226
+ curClass = curClass.replace(' ' + clsName + ' ', ' ');
227
+ }
228
+ }
229
+ if (!el.classList) {
230
+ el.setAttribute('class', trim(curClass));
231
+ }
232
+ };
233
+
234
+ /* istanbul ignore next */
235
+ var getStyle = ieVersion < 9 ? function (element, styleName) {
236
+ if (isServer) return;
237
+ if (!element || !styleName) return null;
238
+ styleName = camelCase(styleName);
239
+ if (styleName === 'float') {
240
+ styleName = 'styleFloat';
241
+ }
242
+ try {
243
+ switch (styleName) {
244
+ case 'opacity':
245
+ try {
246
+ return element.filters.item('alpha').opacity / 100;
247
+ } catch (e) {
248
+ return 1.0;
249
+ }
250
+ default:
251
+ return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
252
+ }
253
+ } catch (e) {
254
+ return element.style[styleName];
255
+ }
256
+ } : function (element, styleName) {
257
+ if (isServer) return;
258
+ if (!element || !styleName) return null;
259
+ styleName = camelCase(styleName);
260
+ if (styleName === 'float') {
261
+ styleName = 'cssFloat';
262
+ }
263
+ try {
264
+ var computed = document.defaultView.getComputedStyle(element, '');
265
+ return element.style[styleName] || computed ? computed[styleName] : null;
266
+ } catch (e) {
267
+ return element.style[styleName];
268
+ }
269
+ };
270
+
271
+ /* istanbul ignore next */
272
+ function setStyle(element, styleName, value) {
273
+ if (!element || !styleName) return;
274
+
275
+ if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
276
+ for (var prop in styleName) {
277
+ if (styleName.hasOwnProperty(prop)) {
278
+ setStyle(element, prop, styleName[prop]);
279
+ }
280
+ }
281
+ } else {
282
+ styleName = camelCase(styleName);
283
+ if (styleName === 'opacity' && ieVersion < 9) {
284
+ element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
285
+ } else {
286
+ element.style[styleName] = value;
287
+ }
288
+ }
289
+ };
290
+
291
+ var isScroll = function isScroll(el, vertical) {
292
+ if (isServer) return;
293
+
294
+ var determinedDirection = vertical !== null && vertical !== undefined;
295
+ var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
296
+
297
+ return overflow.match(/(scroll|auto|overlay)/);
298
+ };
299
+
300
+ var getScrollContainer = function getScrollContainer(el, vertical) {
301
+ if (isServer) return;
302
+
303
+ var parent = el;
304
+ while (parent) {
305
+ if ([window, document, document.documentElement].includes(parent)) {
306
+ return window;
307
+ }
308
+ if (isScroll(parent, vertical)) {
309
+ return parent;
310
+ }
311
+ parent = parent.parentNode;
312
+ }
313
+
314
+ return parent;
315
+ };
316
+
317
+ var isInContainer = function isInContainer(el, container) {
318
+ if (isServer || !el || !container) return false;
319
+
320
+ var elRect = el.getBoundingClientRect();
321
+ var containerRect = void 0;
322
+
323
+ if ([window, document, document.documentElement, null, undefined].includes(container)) {
324
+ containerRect = {
325
+ top: 0,
326
+ right: window.innerWidth,
327
+ bottom: window.innerHeight,
328
+ left: 0
329
+ };
330
+ } else {
331
+ containerRect = container.getBoundingClientRect();
332
+ }
333
+
334
+ return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
335
+ };
336
+
337
+ /***/ }),
338
+
339
+ /***/ 10:
340
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
341
+
342
+ "use strict";
343
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
344
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
345
+ /* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
346
+
347
+
348
+
349
+ var PopperJS = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer ? function () {} : __webpack_require__(23);
350
+ var stop = function stop(e) {
351
+ return e.stopPropagation();
352
+ };
353
+
354
+ /**
355
+ * @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.
356
+ * @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.
357
+ * @param {String} [placement=button] - Placement of the popper accepted values: top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end)
358
+ * @param {Number} [offset=0] - Amount of pixels the popper will be shifted (can be negative).
359
+ * @param {Boolean} [visible=false] Visibility of the popup element.
360
+ * @param {Boolean} [visible-arrow=false] Visibility of the arrow, no style.
361
+ */
362
+ /* harmony default export */ __webpack_exports__["a"] = ({
363
+ props: {
364
+ transformOrigin: {
365
+ type: [Boolean, String],
366
+ default: true
367
+ },
368
+ placement: {
369
+ type: String,
370
+ default: 'bottom'
371
+ },
372
+ boundariesPadding: {
373
+ type: Number,
374
+ default: 5
375
+ },
376
+ reference: {},
377
+ popper: {},
378
+ offset: {
379
+ default: 0
380
+ },
381
+ value: Boolean,
382
+ visibleArrow: Boolean,
383
+ arrowOffset: {
384
+ type: Number,
385
+ default: 35
386
+ },
387
+ appendToBody: {
388
+ type: Boolean,
389
+ default: true
390
+ },
391
+ popperOptions: {
392
+ type: Object,
393
+ default: function _default() {
394
+ return {
395
+ gpuAcceleration: false
396
+ };
397
+ }
398
+ }
399
+ },
400
+
401
+ data: function data() {
402
+ return {
403
+ showPopper: false,
404
+ currentPlacement: ''
405
+ };
406
+ },
407
+
408
+
409
+ watch: {
410
+ value: {
411
+ immediate: true,
412
+ handler: function handler(val) {
413
+ this.showPopper = val;
414
+ this.$emit('input', val);
415
+ }
416
+ },
417
+
418
+ showPopper: function showPopper(val) {
419
+ if (this.disabled) return;
420
+ val ? this.updatePopper() : this.destroyPopper();
421
+ this.$emit('input', val);
422
+ }
423
+ },
424
+
425
+ methods: {
426
+ createPopper: function createPopper() {
427
+ var _this = this;
428
+
429
+ if (this.$isServer) return;
430
+ this.currentPlacement = this.currentPlacement || this.placement;
431
+ if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {
432
+ return;
433
+ }
434
+
435
+ var options = this.popperOptions;
436
+ var popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper;
437
+ var reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;
438
+
439
+ if (!reference && this.$slots.reference && this.$slots.reference[0]) {
440
+ reference = this.referenceElm = this.$slots.reference[0].elm;
441
+ }
442
+
443
+ if (!popper || !reference) return;
444
+ if (this.visibleArrow) this.appendArrow(popper);
445
+ if (this.appendToBody) document.body.appendChild(this.popperElm);
446
+ if (this.popperJS && this.popperJS.destroy) {
447
+ this.popperJS.destroy();
448
+ }
449
+
450
+ options.placement = this.currentPlacement;
451
+ options.offset = this.offset;
452
+ options.arrowOffset = this.arrowOffset;
453
+ this.popperJS = new PopperJS(reference, popper, options);
454
+ this.popperJS.onCreate(function (_) {
455
+ _this.$emit('created', _this);
456
+ _this.resetTransformOrigin();
457
+ _this.$nextTick(_this.updatePopper);
458
+ });
459
+ if (typeof options.onUpdate === 'function') {
460
+ this.popperJS.onUpdate(options.onUpdate);
461
+ }
462
+ this.popperJS._popper.style.zIndex = _popup__WEBPACK_IMPORTED_MODULE_1__[/* PopupManager */ "a"].nextZIndex();
463
+ this.popperElm.addEventListener('click', stop);
464
+ },
465
+ updatePopper: function updatePopper() {
466
+ var popperJS = this.popperJS;
467
+ if (popperJS) {
468
+ popperJS.update();
469
+ if (popperJS._popper) {
470
+ popperJS._popper.style.zIndex = _popup__WEBPACK_IMPORTED_MODULE_1__[/* PopupManager */ "a"].nextZIndex();
471
+ }
472
+ } else {
473
+ this.createPopper();
474
+ }
475
+ },
476
+ doDestroy: function doDestroy(forceDestroy) {
477
+ /* istanbul ignore if */
478
+ if (!this.popperJS || this.showPopper && !forceDestroy) return;
479
+ this.popperJS.destroy();
480
+ this.popperJS = null;
481
+ },
482
+ destroyPopper: function destroyPopper() {
483
+ if (this.popperJS) {
484
+ this.resetTransformOrigin();
485
+ }
486
+ },
487
+ resetTransformOrigin: function resetTransformOrigin() {
488
+ if (!this.transformOrigin) return;
489
+ var placementMap = {
490
+ top: 'bottom',
491
+ bottom: 'top',
492
+ left: 'right',
493
+ right: 'left'
494
+ };
495
+ var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
496
+ var origin = placementMap[placement];
497
+ this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? 'center ' + origin : origin + ' center';
498
+ },
499
+ appendArrow: function appendArrow(element) {
500
+ var hash = void 0;
501
+ if (this.appended) {
502
+ return;
503
+ }
504
+
505
+ this.appended = true;
506
+
507
+ for (var item in element.attributes) {
508
+ if (/^_v-/.test(element.attributes[item].name)) {
509
+ hash = element.attributes[item].name;
510
+ break;
511
+ }
512
+ }
513
+
514
+ var arrow = document.createElement('div');
515
+
516
+ if (hash) {
517
+ arrow.setAttribute(hash, '');
518
+ }
519
+ arrow.setAttribute('x-arrow', '');
520
+ arrow.className = 'popper__arrow';
521
+ element.appendChild(arrow);
522
+ }
523
+ },
524
+
525
+ beforeDestroy: function beforeDestroy() {
526
+ this.doDestroy(true);
527
+ if (this.popperElm && this.popperElm.parentNode === document.body) {
528
+ this.popperElm.removeEventListener('click', stop);
529
+ document.body.removeChild(this.popperElm);
530
+ }
531
+ },
532
+
533
+
534
+ // call destroy in keep-alive mode
535
+ deactivated: function deactivated() {
536
+ this.$options.beforeDestroy[0].call(this);
537
+ }
538
+ });
539
+
540
+ /***/ }),
541
+
542
+ /***/ 2:
91
543
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
544
 
93
545
  "use strict";
@@ -165,41 +617,1945 @@ function normalizeComponent(
165
617
  : injectStyles
166
618
  }
167
619
 
168
- if (hook) {
169
- if (options.functional) {
170
- // for template-only hot-reload because in that case the render fn doesn't
171
- // go through the normalizer
172
- options._injectStyles = hook
173
- // register for functional component in vue file
174
- var originalRender = options.render
175
- options.render = function renderWithStyleInjection(h, context) {
176
- hook.call(context)
177
- return originalRender(h, context)
178
- }
179
- } else {
180
- // inject component registration as beforeCreate hook
181
- var existing = options.beforeCreate
182
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
183
- }
184
- }
620
+ if (hook) {
621
+ if (options.functional) {
622
+ // for template-only hot-reload because in that case the render fn doesn't
623
+ // go through the normalizer
624
+ options._injectStyles = hook
625
+ // register for functional component in vue file
626
+ var originalRender = options.render
627
+ options.render = function renderWithStyleInjection(h, context) {
628
+ hook.call(context)
629
+ return originalRender(h, context)
630
+ }
631
+ } else {
632
+ // inject component registration as beforeCreate hook
633
+ var existing = options.beforeCreate
634
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
635
+ }
636
+ }
637
+
638
+ return {
639
+ exports: scriptExports,
640
+ options: options
641
+ }
642
+ }
643
+
644
+
645
+ /***/ }),
646
+
647
+ /***/ 22:
648
+ /***/ (function(module, exports) {
649
+
650
+ module.exports = require("throttle-debounce/debounce");
651
+
652
+ /***/ }),
653
+
654
+ /***/ 23:
655
+ /***/ (function(module, exports, __webpack_require__) {
656
+
657
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;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; };
658
+
659
+ /**
660
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
661
+ * @version {{version}}
662
+ * @license
663
+ * Copyright (c) 2016 Federico Zivolo and contributors
664
+ *
665
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
666
+ * of this software and associated documentation files (the "Software"), to deal
667
+ * in the Software without restriction, including without limitation the rights
668
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
669
+ * copies of the Software, and to permit persons to whom the Software is
670
+ * furnished to do so, subject to the following conditions:
671
+ *
672
+ * The above copyright notice and this permission notice shall be included in all
673
+ * copies or substantial portions of the Software.
674
+ *
675
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
676
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
677
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
678
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
679
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
680
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
681
+ * SOFTWARE.
682
+ */
683
+
684
+ //
685
+ // Cross module loader
686
+ // Supported: Node, AMD, Browser globals
687
+ //
688
+ ;(function (root, factory) {
689
+ if (true) {
690
+ // AMD. Register as an anonymous module.
691
+ !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
692
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
693
+ (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
694
+ __WEBPACK_AMD_DEFINE_FACTORY__),
695
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
696
+ } else {}
697
+ })(this, function () {
698
+
699
+ 'use strict';
700
+
701
+ var root = window;
702
+
703
+ // default options
704
+ var DEFAULTS = {
705
+ // placement of the popper
706
+ placement: 'bottom',
707
+
708
+ gpuAcceleration: true,
709
+
710
+ // shift popper from its origin by the given amount of pixels (can be negative)
711
+ offset: 0,
712
+
713
+ // the element which will act as boundary of the popper
714
+ boundariesElement: 'viewport',
715
+
716
+ // amount of pixel used to define a minimum distance between the boundaries and the popper
717
+ boundariesPadding: 5,
718
+
719
+ // popper will try to prevent overflow following this order,
720
+ // by default, then, it could overflow on the left and on top of the boundariesElement
721
+ preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
722
+
723
+ // the behavior used by flip to change the placement of the popper
724
+ flipBehavior: 'flip',
725
+
726
+ arrowElement: '[x-arrow]',
727
+
728
+ arrowOffset: 0,
729
+
730
+ // list of functions used to modify the offsets before they are applied to the popper
731
+ modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
732
+
733
+ modifiersIgnored: [],
734
+
735
+ forceAbsolute: false
736
+ };
737
+
738
+ /**
739
+ * Create a new Popper.js instance
740
+ * @constructor Popper
741
+ * @param {HTMLElement} reference - The reference element used to position the popper
742
+ * @param {HTMLElement|Object} popper
743
+ * The HTML element used as popper, or a configuration used to generate the popper.
744
+ * @param {String} [popper.tagName='div'] The tag name of the generated popper.
745
+ * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.
746
+ * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.
747
+ * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.
748
+ * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.
749
+ * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.
750
+ * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.
751
+ * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.
752
+ * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.
753
+ * @param {Object} options
754
+ * @param {String} [options.placement=bottom]
755
+ * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),
756
+ * left(-start, -end)`
757
+ *
758
+ * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']
759
+ * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of
760
+ * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its
761
+ * reference element.
762
+ * By default, it will look for a child node of the popper with the `x-arrow` attribute.
763
+ *
764
+ * @param {Boolean} [options.gpuAcceleration=true]
765
+ * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the
766
+ * browser to use the GPU to accelerate the rendering.
767
+ * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.
768
+ *
769
+ * @param {Number} [options.offset=0]
770
+ * Amount of pixels the popper will be shifted (can be negative).
771
+ *
772
+ * @param {String|Element} [options.boundariesElement='viewport']
773
+ * The element which will define the boundaries of the popper position, the popper will never be placed outside
774
+ * of the defined boundaries (except if `keepTogether` is enabled)
775
+ *
776
+ * @param {Number} [options.boundariesPadding=5]
777
+ * Additional padding for the boundaries
778
+ *
779
+ * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]
780
+ * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,
781
+ * this means that the last ones will never overflow
782
+ *
783
+ * @param {String|Array} [options.flipBehavior='flip']
784
+ * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to
785
+ * overlap its reference element. Defining `flip` as value, the placement will be flipped on
786
+ * its axis (`right - left`, `top - bottom`).
787
+ * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify
788
+ * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,
789
+ * then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)
790
+ *
791
+ * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]
792
+ * List of functions used to modify the data before they are applied to the popper, add your custom functions
793
+ * to this array to edit the offsets and placement.
794
+ * The function should reflect the @params and @returns of preventOverflow
795
+ *
796
+ * @param {Array} [options.modifiersIgnored=[]]
797
+ * Put here any built-in modifier name you want to exclude from the modifiers list
798
+ * The function should reflect the @params and @returns of preventOverflow
799
+ *
800
+ * @param {Boolean} [options.removeOnDestroy=false]
801
+ * Set to true if you want to automatically remove the popper when you call the `destroy` method.
802
+ */
803
+ function Popper(reference, popper, options) {
804
+ this._reference = reference.jquery ? reference[0] : reference;
805
+ this.state = {};
806
+
807
+ // if the popper variable is a configuration object, parse it to generate an HTMLElement
808
+ // generate a default popper if is not defined
809
+ var isNotDefined = typeof popper === 'undefined' || popper === null;
810
+ var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
811
+ if (isNotDefined || isConfig) {
812
+ this._popper = this.parse(isConfig ? popper : {});
813
+ }
814
+ // otherwise, use the given HTMLElement as popper
815
+ else {
816
+ this._popper = popper.jquery ? popper[0] : popper;
817
+ }
818
+
819
+ // with {} we create a new object with the options inside it
820
+ this._options = Object.assign({}, DEFAULTS, options);
821
+
822
+ // refactoring modifiers' list
823
+ this._options.modifiers = this._options.modifiers.map(function (modifier) {
824
+ // remove ignored modifiers
825
+ if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
826
+
827
+ // set the x-placement attribute before everything else because it could be used to add margins to the popper
828
+ // margins needs to be calculated to get the correct popper offsets
829
+ if (modifier === 'applyStyle') {
830
+ this._popper.setAttribute('x-placement', this._options.placement);
831
+ }
832
+
833
+ // return predefined modifier identified by string or keep the custom one
834
+ return this.modifiers[modifier] || modifier;
835
+ }.bind(this));
836
+
837
+ // make sure to apply the popper position before any computation
838
+ this.state.position = this._getPosition(this._popper, this._reference);
839
+ setStyle(this._popper, { position: this.state.position, top: 0 });
840
+
841
+ // fire the first update to position the popper in the right place
842
+ this.update();
843
+
844
+ // setup event listeners, they will take care of update the position in specific situations
845
+ this._setupEventListeners();
846
+ return this;
847
+ }
848
+
849
+ //
850
+ // Methods
851
+ //
852
+ /**
853
+ * Destroy the popper
854
+ * @method
855
+ * @memberof Popper
856
+ */
857
+ Popper.prototype.destroy = function () {
858
+ this._popper.removeAttribute('x-placement');
859
+ this._popper.style.left = '';
860
+ this._popper.style.position = '';
861
+ this._popper.style.top = '';
862
+ this._popper.style[getSupportedPropertyName('transform')] = '';
863
+ this._removeEventListeners();
864
+
865
+ // remove the popper if user explicity asked for the deletion on destroy
866
+ if (this._options.removeOnDestroy) {
867
+ this._popper.remove();
868
+ }
869
+ return this;
870
+ };
871
+
872
+ /**
873
+ * Updates the position of the popper, computing the new offsets and applying the new style
874
+ * @method
875
+ * @memberof Popper
876
+ */
877
+ Popper.prototype.update = function () {
878
+ var data = { instance: this, styles: {} };
879
+
880
+ // store placement inside the data object, modifiers will be able to edit `placement` if needed
881
+ // and refer to _originalPlacement to know the original value
882
+ data.placement = this._options.placement;
883
+ data._originalPlacement = this._options.placement;
884
+
885
+ // compute the popper and reference offsets and put them inside data.offsets
886
+ data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
887
+
888
+ // get boundaries
889
+ data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
890
+
891
+ data = this.runModifiers(data, this._options.modifiers);
892
+
893
+ if (typeof this.state.updateCallback === 'function') {
894
+ this.state.updateCallback(data);
895
+ }
896
+ };
897
+
898
+ /**
899
+ * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
900
+ * @method
901
+ * @memberof Popper
902
+ * @param {Function} callback
903
+ */
904
+ Popper.prototype.onCreate = function (callback) {
905
+ // the createCallbacks return as first argument the popper instance
906
+ callback(this);
907
+ return this;
908
+ };
909
+
910
+ /**
911
+ * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
912
+ * used to style popper and its arrow.
913
+ * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!
914
+ * @method
915
+ * @memberof Popper
916
+ * @param {Function} callback
917
+ */
918
+ Popper.prototype.onUpdate = function (callback) {
919
+ this.state.updateCallback = callback;
920
+ return this;
921
+ };
922
+
923
+ /**
924
+ * Helper used to generate poppers from a configuration file
925
+ * @method
926
+ * @memberof Popper
927
+ * @param config {Object} configuration
928
+ * @returns {HTMLElement} popper
929
+ */
930
+ Popper.prototype.parse = function (config) {
931
+ var defaultConfig = {
932
+ tagName: 'div',
933
+ classNames: ['popper'],
934
+ attributes: [],
935
+ parent: root.document.body,
936
+ content: '',
937
+ contentType: 'text',
938
+ arrowTagName: 'div',
939
+ arrowClassNames: ['popper__arrow'],
940
+ arrowAttributes: ['x-arrow']
941
+ };
942
+ config = Object.assign({}, defaultConfig, config);
943
+
944
+ var d = root.document;
945
+
946
+ var popper = d.createElement(config.tagName);
947
+ addClassNames(popper, config.classNames);
948
+ addAttributes(popper, config.attributes);
949
+ if (config.contentType === 'node') {
950
+ popper.appendChild(config.content.jquery ? config.content[0] : config.content);
951
+ } else if (config.contentType === 'html') {
952
+ popper.innerHTML = config.content;
953
+ } else {
954
+ popper.textContent = config.content;
955
+ }
956
+
957
+ if (config.arrowTagName) {
958
+ var arrow = d.createElement(config.arrowTagName);
959
+ addClassNames(arrow, config.arrowClassNames);
960
+ addAttributes(arrow, config.arrowAttributes);
961
+ popper.appendChild(arrow);
962
+ }
963
+
964
+ var parent = config.parent.jquery ? config.parent[0] : config.parent;
965
+
966
+ // if the given parent is a string, use it to match an element
967
+ // if more than one element is matched, the first one will be used as parent
968
+ // if no elements are matched, the script will throw an error
969
+ if (typeof parent === 'string') {
970
+ parent = d.querySelectorAll(config.parent);
971
+ if (parent.length > 1) {
972
+ console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
973
+ }
974
+ if (parent.length === 0) {
975
+ throw 'ERROR: the given `parent` doesn\'t exists!';
976
+ }
977
+ parent = parent[0];
978
+ }
979
+ // if the given parent is a DOM nodes list or an array of nodes with more than one element,
980
+ // the first one will be used as parent
981
+ if (parent.length > 1 && parent instanceof Element === false) {
982
+ console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
983
+ parent = parent[0];
984
+ }
985
+
986
+ // append the generated popper to its parent
987
+ parent.appendChild(popper);
988
+
989
+ return popper;
990
+
991
+ /**
992
+ * Adds class names to the given element
993
+ * @function
994
+ * @ignore
995
+ * @param {HTMLElement} target
996
+ * @param {Array} classes
997
+ */
998
+ function addClassNames(element, classNames) {
999
+ classNames.forEach(function (className) {
1000
+ element.classList.add(className);
1001
+ });
1002
+ }
1003
+
1004
+ /**
1005
+ * Adds attributes to the given element
1006
+ * @function
1007
+ * @ignore
1008
+ * @param {HTMLElement} target
1009
+ * @param {Array} attributes
1010
+ * @example
1011
+ * addAttributes(element, [ 'data-info:foobar' ]);
1012
+ */
1013
+ function addAttributes(element, attributes) {
1014
+ attributes.forEach(function (attribute) {
1015
+ element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
1016
+ });
1017
+ }
1018
+ };
1019
+
1020
+ /**
1021
+ * Helper used to get the position which will be applied to the popper
1022
+ * @method
1023
+ * @memberof Popper
1024
+ * @param config {HTMLElement} popper element
1025
+ * @param reference {HTMLElement} reference element
1026
+ * @returns {String} position
1027
+ */
1028
+ Popper.prototype._getPosition = function (popper, reference) {
1029
+ var container = getOffsetParent(reference);
1030
+
1031
+ if (this._options.forceAbsolute) {
1032
+ return 'absolute';
1033
+ }
1034
+
1035
+ // Decide if the popper will be fixed
1036
+ // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
1037
+ var isParentFixed = isFixed(reference, container);
1038
+ return isParentFixed ? 'fixed' : 'absolute';
1039
+ };
1040
+
1041
+ /**
1042
+ * Get offsets to the popper
1043
+ * @method
1044
+ * @memberof Popper
1045
+ * @access private
1046
+ * @param {Element} popper - the popper element
1047
+ * @param {Element} reference - the reference element (the popper will be relative to this)
1048
+ * @returns {Object} An object containing the offsets which will be applied to the popper
1049
+ */
1050
+ Popper.prototype._getOffsets = function (popper, reference, placement) {
1051
+ placement = placement.split('-')[0];
1052
+ var popperOffsets = {};
1053
+
1054
+ popperOffsets.position = this.state.position;
1055
+ var isParentFixed = popperOffsets.position === 'fixed';
1056
+
1057
+ //
1058
+ // Get reference element position
1059
+ //
1060
+ var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
1061
+
1062
+ //
1063
+ // Get popper sizes
1064
+ //
1065
+ var popperRect = getOuterSizes(popper);
1066
+
1067
+ //
1068
+ // Compute offsets of popper
1069
+ //
1070
+
1071
+ // depending by the popper placement we have to compute its offsets slightly differently
1072
+ if (['right', 'left'].indexOf(placement) !== -1) {
1073
+ popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
1074
+ if (placement === 'left') {
1075
+ popperOffsets.left = referenceOffsets.left - popperRect.width;
1076
+ } else {
1077
+ popperOffsets.left = referenceOffsets.right;
1078
+ }
1079
+ } else {
1080
+ popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
1081
+ if (placement === 'top') {
1082
+ popperOffsets.top = referenceOffsets.top - popperRect.height;
1083
+ } else {
1084
+ popperOffsets.top = referenceOffsets.bottom;
1085
+ }
1086
+ }
1087
+
1088
+ // Add width and height to our offsets object
1089
+ popperOffsets.width = popperRect.width;
1090
+ popperOffsets.height = popperRect.height;
1091
+
1092
+ return {
1093
+ popper: popperOffsets,
1094
+ reference: referenceOffsets
1095
+ };
1096
+ };
1097
+
1098
+ /**
1099
+ * Setup needed event listeners used to update the popper position
1100
+ * @method
1101
+ * @memberof Popper
1102
+ * @access private
1103
+ */
1104
+ Popper.prototype._setupEventListeners = function () {
1105
+ // NOTE: 1 DOM access here
1106
+ this.state.updateBound = this.update.bind(this);
1107
+ root.addEventListener('resize', this.state.updateBound);
1108
+ // if the boundariesElement is window we don't need to listen for the scroll event
1109
+ if (this._options.boundariesElement !== 'window') {
1110
+ var target = getScrollParent(this._reference);
1111
+ // here it could be both `body` or `documentElement` thanks to Firefox, we then check both
1112
+ if (target === root.document.body || target === root.document.documentElement) {
1113
+ target = root;
1114
+ }
1115
+ target.addEventListener('scroll', this.state.updateBound);
1116
+ this.state.scrollTarget = target;
1117
+ }
1118
+ };
1119
+
1120
+ /**
1121
+ * Remove event listeners used to update the popper position
1122
+ * @method
1123
+ * @memberof Popper
1124
+ * @access private
1125
+ */
1126
+ Popper.prototype._removeEventListeners = function () {
1127
+ // NOTE: 1 DOM access here
1128
+ root.removeEventListener('resize', this.state.updateBound);
1129
+ if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
1130
+ this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);
1131
+ this.state.scrollTarget = null;
1132
+ }
1133
+ this.state.updateBound = null;
1134
+ };
1135
+
1136
+ /**
1137
+ * Computed the boundaries limits and return them
1138
+ * @method
1139
+ * @memberof Popper
1140
+ * @access private
1141
+ * @param {Object} data - Object containing the property "offsets" generated by `_getOffsets`
1142
+ * @param {Number} padding - Boundaries padding
1143
+ * @param {Element} boundariesElement - Element used to define the boundaries
1144
+ * @returns {Object} Coordinates of the boundaries
1145
+ */
1146
+ Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
1147
+ // NOTE: 1 DOM access here
1148
+ var boundaries = {};
1149
+ var width, height;
1150
+ if (boundariesElement === 'window') {
1151
+ var body = root.document.body,
1152
+ html = root.document.documentElement;
1153
+
1154
+ height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
1155
+ width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
1156
+
1157
+ boundaries = {
1158
+ top: 0,
1159
+ right: width,
1160
+ bottom: height,
1161
+ left: 0
1162
+ };
1163
+ } else if (boundariesElement === 'viewport') {
1164
+ var offsetParent = getOffsetParent(this._popper);
1165
+ var scrollParent = getScrollParent(this._popper);
1166
+ var offsetParentRect = getOffsetRect(offsetParent);
1167
+
1168
+ // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`
1169
+ var getScrollTopValue = function getScrollTopValue(element) {
1170
+ return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;
1171
+ };
1172
+ var getScrollLeftValue = function getScrollLeftValue(element) {
1173
+ return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;
1174
+ };
1175
+
1176
+ // if the popper is fixed we don't have to substract scrolling from the boundaries
1177
+ var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);
1178
+ var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);
1179
+
1180
+ boundaries = {
1181
+ top: 0 - (offsetParentRect.top - scrollTop),
1182
+ right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
1183
+ bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
1184
+ left: 0 - (offsetParentRect.left - scrollLeft)
1185
+ };
1186
+ } else {
1187
+ if (getOffsetParent(this._popper) === boundariesElement) {
1188
+ boundaries = {
1189
+ top: 0,
1190
+ left: 0,
1191
+ right: boundariesElement.clientWidth,
1192
+ bottom: boundariesElement.clientHeight
1193
+ };
1194
+ } else {
1195
+ boundaries = getOffsetRect(boundariesElement);
1196
+ }
1197
+ }
1198
+ boundaries.left += padding;
1199
+ boundaries.right -= padding;
1200
+ boundaries.top = boundaries.top + padding;
1201
+ boundaries.bottom = boundaries.bottom - padding;
1202
+ return boundaries;
1203
+ };
1204
+
1205
+ /**
1206
+ * Loop trough the list of modifiers and run them in order, each of them will then edit the data object
1207
+ * @method
1208
+ * @memberof Popper
1209
+ * @access public
1210
+ * @param {Object} data
1211
+ * @param {Array} modifiers
1212
+ * @param {Function} ends
1213
+ */
1214
+ Popper.prototype.runModifiers = function (data, modifiers, ends) {
1215
+ var modifiersToRun = modifiers.slice();
1216
+ if (ends !== undefined) {
1217
+ modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
1218
+ }
1219
+
1220
+ modifiersToRun.forEach(function (modifier) {
1221
+ if (isFunction(modifier)) {
1222
+ data = modifier.call(this, data);
1223
+ }
1224
+ }.bind(this));
1225
+
1226
+ return data;
1227
+ };
1228
+
1229
+ /**
1230
+ * Helper used to know if the given modifier depends from another one.
1231
+ * @method
1232
+ * @memberof Popper
1233
+ * @param {String} requesting - name of requesting modifier
1234
+ * @param {String} requested - name of requested modifier
1235
+ * @returns {Boolean}
1236
+ */
1237
+ Popper.prototype.isModifierRequired = function (requesting, requested) {
1238
+ var index = getArrayKeyIndex(this._options.modifiers, requesting);
1239
+ return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
1240
+ return modifier === requested;
1241
+ }).length;
1242
+ };
1243
+
1244
+ //
1245
+ // Modifiers
1246
+ //
1247
+
1248
+ /**
1249
+ * Modifiers list
1250
+ * @namespace Popper.modifiers
1251
+ * @memberof Popper
1252
+ * @type {Object}
1253
+ */
1254
+ Popper.prototype.modifiers = {};
1255
+
1256
+ /**
1257
+ * Apply the computed styles to the popper element
1258
+ * @method
1259
+ * @memberof Popper.modifiers
1260
+ * @argument {Object} data - The data object generated by `update` method
1261
+ * @returns {Object} The same data object
1262
+ */
1263
+ Popper.prototype.modifiers.applyStyle = function (data) {
1264
+ // apply the final offsets to the popper
1265
+ // NOTE: 1 DOM access here
1266
+ var styles = {
1267
+ position: data.offsets.popper.position
1268
+ };
1269
+
1270
+ // round top and left to avoid blurry text
1271
+ var left = Math.round(data.offsets.popper.left);
1272
+ var top = Math.round(data.offsets.popper.top);
1273
+
1274
+ // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
1275
+ // we automatically use the supported prefixed version if needed
1276
+ var prefixedProperty;
1277
+ if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
1278
+ styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
1279
+ styles.top = 0;
1280
+ styles.left = 0;
1281
+ }
1282
+ // othwerise, we use the standard `left` and `top` properties
1283
+ else {
1284
+ styles.left = left;
1285
+ styles.top = top;
1286
+ }
1287
+
1288
+ // any property present in `data.styles` will be applied to the popper,
1289
+ // in this way we can make the 3rd party modifiers add custom styles to it
1290
+ // Be aware, modifiers could override the properties defined in the previous
1291
+ // lines of this modifier!
1292
+ Object.assign(styles, data.styles);
1293
+
1294
+ setStyle(this._popper, styles);
1295
+
1296
+ // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
1297
+ // NOTE: 1 DOM access here
1298
+ this._popper.setAttribute('x-placement', data.placement);
1299
+
1300
+ // if the arrow modifier is required and the arrow style has been computed, apply the arrow style
1301
+ if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
1302
+ setStyle(data.arrowElement, data.offsets.arrow);
1303
+ }
1304
+
1305
+ return data;
1306
+ };
1307
+
1308
+ /**
1309
+ * Modifier used to shift the popper on the start or end of its reference element side
1310
+ * @method
1311
+ * @memberof Popper.modifiers
1312
+ * @argument {Object} data - The data object generated by `update` method
1313
+ * @returns {Object} The data object, properly modified
1314
+ */
1315
+ Popper.prototype.modifiers.shift = function (data) {
1316
+ var placement = data.placement;
1317
+ var basePlacement = placement.split('-')[0];
1318
+ var shiftVariation = placement.split('-')[1];
1319
+
1320
+ // if shift shiftVariation is specified, run the modifier
1321
+ if (shiftVariation) {
1322
+ var reference = data.offsets.reference;
1323
+ var popper = getPopperClientRect(data.offsets.popper);
1324
+
1325
+ var shiftOffsets = {
1326
+ y: {
1327
+ start: { top: reference.top },
1328
+ end: { top: reference.top + reference.height - popper.height }
1329
+ },
1330
+ x: {
1331
+ start: { left: reference.left },
1332
+ end: { left: reference.left + reference.width - popper.width }
1333
+ }
1334
+ };
1335
+
1336
+ var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
1337
+
1338
+ data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);
1339
+ }
1340
+
1341
+ return data;
1342
+ };
1343
+
1344
+ /**
1345
+ * Modifier used to make sure the popper does not overflows from it's boundaries
1346
+ * @method
1347
+ * @memberof Popper.modifiers
1348
+ * @argument {Object} data - The data object generated by `update` method
1349
+ * @returns {Object} The data object, properly modified
1350
+ */
1351
+ Popper.prototype.modifiers.preventOverflow = function (data) {
1352
+ var order = this._options.preventOverflowOrder;
1353
+ var popper = getPopperClientRect(data.offsets.popper);
1354
+
1355
+ var check = {
1356
+ left: function left() {
1357
+ var left = popper.left;
1358
+ if (popper.left < data.boundaries.left) {
1359
+ left = Math.max(popper.left, data.boundaries.left);
1360
+ }
1361
+ return { left: left };
1362
+ },
1363
+ right: function right() {
1364
+ var left = popper.left;
1365
+ if (popper.right > data.boundaries.right) {
1366
+ left = Math.min(popper.left, data.boundaries.right - popper.width);
1367
+ }
1368
+ return { left: left };
1369
+ },
1370
+ top: function top() {
1371
+ var top = popper.top;
1372
+ if (popper.top < data.boundaries.top) {
1373
+ top = Math.max(popper.top, data.boundaries.top);
1374
+ }
1375
+ return { top: top };
1376
+ },
1377
+ bottom: function bottom() {
1378
+ var top = popper.top;
1379
+ if (popper.bottom > data.boundaries.bottom) {
1380
+ top = Math.min(popper.top, data.boundaries.bottom - popper.height);
1381
+ }
1382
+ return { top: top };
1383
+ }
1384
+ };
1385
+
1386
+ order.forEach(function (direction) {
1387
+ data.offsets.popper = Object.assign(popper, check[direction]());
1388
+ });
1389
+
1390
+ return data;
1391
+ };
1392
+
1393
+ /**
1394
+ * Modifier used to make sure the popper is always near its reference
1395
+ * @method
1396
+ * @memberof Popper.modifiers
1397
+ * @argument {Object} data - The data object generated by _update method
1398
+ * @returns {Object} The data object, properly modified
1399
+ */
1400
+ Popper.prototype.modifiers.keepTogether = function (data) {
1401
+ var popper = getPopperClientRect(data.offsets.popper);
1402
+ var reference = data.offsets.reference;
1403
+ var f = Math.floor;
1404
+
1405
+ if (popper.right < f(reference.left)) {
1406
+ data.offsets.popper.left = f(reference.left) - popper.width;
1407
+ }
1408
+ if (popper.left > f(reference.right)) {
1409
+ data.offsets.popper.left = f(reference.right);
1410
+ }
1411
+ if (popper.bottom < f(reference.top)) {
1412
+ data.offsets.popper.top = f(reference.top) - popper.height;
1413
+ }
1414
+ if (popper.top > f(reference.bottom)) {
1415
+ data.offsets.popper.top = f(reference.bottom);
1416
+ }
1417
+
1418
+ return data;
1419
+ };
1420
+
1421
+ /**
1422
+ * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
1423
+ * Requires the `preventOverflow` modifier before it in order to work.
1424
+ * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!
1425
+ * @method
1426
+ * @memberof Popper.modifiers
1427
+ * @argument {Object} data - The data object generated by _update method
1428
+ * @returns {Object} The data object, properly modified
1429
+ */
1430
+ Popper.prototype.modifiers.flip = function (data) {
1431
+ // check if preventOverflow is in the list of modifiers before the flip modifier.
1432
+ // otherwise flip would not work as expected.
1433
+ if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
1434
+ console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
1435
+ return data;
1436
+ }
1437
+
1438
+ if (data.flipped && data.placement === data._originalPlacement) {
1439
+ // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
1440
+ return data;
1441
+ }
1442
+
1443
+ var placement = data.placement.split('-')[0];
1444
+ var placementOpposite = getOppositePlacement(placement);
1445
+ var variation = data.placement.split('-')[1] || '';
1446
+
1447
+ var flipOrder = [];
1448
+ if (this._options.flipBehavior === 'flip') {
1449
+ flipOrder = [placement, placementOpposite];
1450
+ } else {
1451
+ flipOrder = this._options.flipBehavior;
1452
+ }
1453
+
1454
+ flipOrder.forEach(function (step, index) {
1455
+ if (placement !== step || flipOrder.length === index + 1) {
1456
+ return;
1457
+ }
1458
+
1459
+ placement = data.placement.split('-')[0];
1460
+ placementOpposite = getOppositePlacement(placement);
1461
+
1462
+ var popperOffsets = getPopperClientRect(data.offsets.popper);
1463
+
1464
+ // this boolean is used to distinguish right and bottom from top and left
1465
+ // they need different computations to get flipped
1466
+ var a = ['right', 'bottom'].indexOf(placement) !== -1;
1467
+
1468
+ // using Math.floor because the reference offsets may contain decimals we are not going to consider here
1469
+ if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
1470
+ // we'll use this boolean to detect any flip loop
1471
+ data.flipped = true;
1472
+ data.placement = flipOrder[index + 1];
1473
+ if (variation) {
1474
+ data.placement += '-' + variation;
1475
+ }
1476
+ data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
1477
+
1478
+ data = this.runModifiers(data, this._options.modifiers, this._flip);
1479
+ }
1480
+ }.bind(this));
1481
+ return data;
1482
+ };
1483
+
1484
+ /**
1485
+ * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
1486
+ * The offsets will shift the popper on the side of its reference element.
1487
+ * @method
1488
+ * @memberof Popper.modifiers
1489
+ * @argument {Object} data - The data object generated by _update method
1490
+ * @returns {Object} The data object, properly modified
1491
+ */
1492
+ Popper.prototype.modifiers.offset = function (data) {
1493
+ var offset = this._options.offset;
1494
+ var popper = data.offsets.popper;
1495
+
1496
+ if (data.placement.indexOf('left') !== -1) {
1497
+ popper.top -= offset;
1498
+ } else if (data.placement.indexOf('right') !== -1) {
1499
+ popper.top += offset;
1500
+ } else if (data.placement.indexOf('top') !== -1) {
1501
+ popper.left -= offset;
1502
+ } else if (data.placement.indexOf('bottom') !== -1) {
1503
+ popper.left += offset;
1504
+ }
1505
+ return data;
1506
+ };
1507
+
1508
+ /**
1509
+ * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element
1510
+ * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
1511
+ * @method
1512
+ * @memberof Popper.modifiers
1513
+ * @argument {Object} data - The data object generated by _update method
1514
+ * @returns {Object} The data object, properly modified
1515
+ */
1516
+ Popper.prototype.modifiers.arrow = function (data) {
1517
+ var arrow = this._options.arrowElement;
1518
+ var arrowOffset = this._options.arrowOffset;
1519
+
1520
+ // if the arrowElement is a string, suppose it's a CSS selector
1521
+ if (typeof arrow === 'string') {
1522
+ arrow = this._popper.querySelector(arrow);
1523
+ }
1524
+
1525
+ // if arrow element is not found, don't run the modifier
1526
+ if (!arrow) {
1527
+ return data;
1528
+ }
1529
+
1530
+ // the arrow element must be child of its popper
1531
+ if (!this._popper.contains(arrow)) {
1532
+ console.warn('WARNING: `arrowElement` must be child of its popper element!');
1533
+ return data;
1534
+ }
1535
+
1536
+ // arrow depends on keepTogether in order to work
1537
+ if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
1538
+ console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
1539
+ return data;
1540
+ }
1541
+
1542
+ var arrowStyle = {};
1543
+ var placement = data.placement.split('-')[0];
1544
+ var popper = getPopperClientRect(data.offsets.popper);
1545
+ var reference = data.offsets.reference;
1546
+ var isVertical = ['left', 'right'].indexOf(placement) !== -1;
1547
+
1548
+ var len = isVertical ? 'height' : 'width';
1549
+ var side = isVertical ? 'top' : 'left';
1550
+ var translate = isVertical ? 'translateY' : 'translateX';
1551
+ var altSide = isVertical ? 'left' : 'top';
1552
+ var opSide = isVertical ? 'bottom' : 'right';
1553
+ var arrowSize = getOuterSizes(arrow)[len];
1554
+
1555
+ //
1556
+ // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
1557
+ //
1558
+
1559
+ // top/left side
1560
+ if (reference[opSide] - arrowSize < popper[side]) {
1561
+ data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
1562
+ }
1563
+ // bottom/right side
1564
+ if (reference[side] + arrowSize > popper[opSide]) {
1565
+ data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
1566
+ }
1567
+
1568
+ // compute center of the popper
1569
+ var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
1570
+
1571
+ var sideValue = center - popper[side];
1572
+
1573
+ // prevent arrow from being placed not contiguously to its popper
1574
+ sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
1575
+ arrowStyle[side] = sideValue;
1576
+ arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
1577
+
1578
+ data.offsets.arrow = arrowStyle;
1579
+ data.arrowElement = arrow;
1580
+
1581
+ return data;
1582
+ };
1583
+
1584
+ //
1585
+ // Helpers
1586
+ //
1587
+
1588
+ /**
1589
+ * Get the outer sizes of the given element (offset size + margins)
1590
+ * @function
1591
+ * @ignore
1592
+ * @argument {Element} element
1593
+ * @returns {Object} object containing width and height properties
1594
+ */
1595
+ function getOuterSizes(element) {
1596
+ // NOTE: 1 DOM access here
1597
+ var _display = element.style.display,
1598
+ _visibility = element.style.visibility;
1599
+ element.style.display = 'block';element.style.visibility = 'hidden';
1600
+ var calcWidthToForceRepaint = element.offsetWidth;
1601
+
1602
+ // original method
1603
+ var styles = root.getComputedStyle(element);
1604
+ var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
1605
+ var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
1606
+ var result = { width: element.offsetWidth + y, height: element.offsetHeight + x };
1607
+
1608
+ // reset element styles
1609
+ element.style.display = _display;element.style.visibility = _visibility;
1610
+ return result;
1611
+ }
1612
+
1613
+ /**
1614
+ * Get the opposite placement of the given one/
1615
+ * @function
1616
+ * @ignore
1617
+ * @argument {String} placement
1618
+ * @returns {String} flipped placement
1619
+ */
1620
+ function getOppositePlacement(placement) {
1621
+ var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
1622
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
1623
+ return hash[matched];
1624
+ });
1625
+ }
1626
+
1627
+ /**
1628
+ * Given the popper offsets, generate an output similar to getBoundingClientRect
1629
+ * @function
1630
+ * @ignore
1631
+ * @argument {Object} popperOffsets
1632
+ * @returns {Object} ClientRect like output
1633
+ */
1634
+ function getPopperClientRect(popperOffsets) {
1635
+ var offsets = Object.assign({}, popperOffsets);
1636
+ offsets.right = offsets.left + offsets.width;
1637
+ offsets.bottom = offsets.top + offsets.height;
1638
+ return offsets;
1639
+ }
1640
+
1641
+ /**
1642
+ * Given an array and the key to find, returns its index
1643
+ * @function
1644
+ * @ignore
1645
+ * @argument {Array} arr
1646
+ * @argument keyToFind
1647
+ * @returns index or null
1648
+ */
1649
+ function getArrayKeyIndex(arr, keyToFind) {
1650
+ var i = 0,
1651
+ key;
1652
+ for (key in arr) {
1653
+ if (arr[key] === keyToFind) {
1654
+ return i;
1655
+ }
1656
+ i++;
1657
+ }
1658
+ return null;
1659
+ }
1660
+
1661
+ /**
1662
+ * Get CSS computed property of the given element
1663
+ * @function
1664
+ * @ignore
1665
+ * @argument {Eement} element
1666
+ * @argument {String} property
1667
+ */
1668
+ function getStyleComputedProperty(element, property) {
1669
+ // NOTE: 1 DOM access here
1670
+ var css = root.getComputedStyle(element, null);
1671
+ return css[property];
1672
+ }
1673
+
1674
+ /**
1675
+ * Returns the offset parent of the given element
1676
+ * @function
1677
+ * @ignore
1678
+ * @argument {Element} element
1679
+ * @returns {Element} offset parent
1680
+ */
1681
+ function getOffsetParent(element) {
1682
+ // NOTE: 1 DOM access here
1683
+ var offsetParent = element.offsetParent;
1684
+ return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
1685
+ }
1686
+
1687
+ /**
1688
+ * Returns the scrolling parent of the given element
1689
+ * @function
1690
+ * @ignore
1691
+ * @argument {Element} element
1692
+ * @returns {Element} offset parent
1693
+ */
1694
+ function getScrollParent(element) {
1695
+ var parent = element.parentNode;
1696
+
1697
+ if (!parent) {
1698
+ return element;
1699
+ }
1700
+
1701
+ if (parent === root.document) {
1702
+ // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
1703
+ // greater than 0 and return the proper element
1704
+ if (root.document.body.scrollTop || root.document.body.scrollLeft) {
1705
+ return root.document.body;
1706
+ } else {
1707
+ return root.document.documentElement;
1708
+ }
1709
+ }
1710
+
1711
+ // Firefox want us to check `-x` and `-y` variations as well
1712
+ if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {
1713
+ // If the detected scrollParent is body, we perform an additional check on its parentNode
1714
+ // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
1715
+ // fixes issue #65
1716
+ return parent;
1717
+ }
1718
+ return getScrollParent(element.parentNode);
1719
+ }
1720
+
1721
+ /**
1722
+ * Check if the given element is fixed or is inside a fixed parent
1723
+ * @function
1724
+ * @ignore
1725
+ * @argument {Element} element
1726
+ * @argument {Element} customContainer
1727
+ * @returns {Boolean} answer to "isFixed?"
1728
+ */
1729
+ function isFixed(element) {
1730
+ if (element === root.document.body) {
1731
+ return false;
1732
+ }
1733
+ if (getStyleComputedProperty(element, 'position') === 'fixed') {
1734
+ return true;
1735
+ }
1736
+ return element.parentNode ? isFixed(element.parentNode) : element;
1737
+ }
1738
+
1739
+ /**
1740
+ * Set the style to the given popper
1741
+ * @function
1742
+ * @ignore
1743
+ * @argument {Element} element - Element to apply the style to
1744
+ * @argument {Object} styles - Object with a list of properties and values which will be applied to the element
1745
+ */
1746
+ function setStyle(element, styles) {
1747
+ function is_numeric(n) {
1748
+ return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
1749
+ }
1750
+ Object.keys(styles).forEach(function (prop) {
1751
+ var unit = '';
1752
+ // add unit if the value is numeric and is one of the following
1753
+ if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
1754
+ unit = 'px';
1755
+ }
1756
+ element.style[prop] = styles[prop] + unit;
1757
+ });
1758
+ }
1759
+
1760
+ /**
1761
+ * Check if the given variable is a function
1762
+ * @function
1763
+ * @ignore
1764
+ * @argument {*} functionToCheck - variable to check
1765
+ * @returns {Boolean} answer to: is a function?
1766
+ */
1767
+ function isFunction(functionToCheck) {
1768
+ var getType = {};
1769
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
1770
+ }
1771
+
1772
+ /**
1773
+ * Get the position of the given element, relative to its offset parent
1774
+ * @function
1775
+ * @ignore
1776
+ * @param {Element} element
1777
+ * @return {Object} position - Coordinates of the element and its `scrollTop`
1778
+ */
1779
+ function getOffsetRect(element) {
1780
+ var elementRect = {
1781
+ width: element.offsetWidth,
1782
+ height: element.offsetHeight,
1783
+ left: element.offsetLeft,
1784
+ top: element.offsetTop
1785
+ };
1786
+
1787
+ elementRect.right = elementRect.left + elementRect.width;
1788
+ elementRect.bottom = elementRect.top + elementRect.height;
1789
+
1790
+ // position
1791
+ return elementRect;
1792
+ }
1793
+
1794
+ /**
1795
+ * Get bounding client rect of given element
1796
+ * @function
1797
+ * @ignore
1798
+ * @param {HTMLElement} element
1799
+ * @return {Object} client rect
1800
+ */
1801
+ function getBoundingClientRect(element) {
1802
+ var rect = element.getBoundingClientRect();
1803
+
1804
+ // whether the IE version is lower than 11
1805
+ var isIE = navigator.userAgent.indexOf("MSIE") != -1;
1806
+
1807
+ // fix ie document bounding top always 0 bug
1808
+ var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
1809
+
1810
+ return {
1811
+ left: rect.left,
1812
+ top: rectTop,
1813
+ right: rect.right,
1814
+ bottom: rect.bottom,
1815
+ width: rect.right - rect.left,
1816
+ height: rect.bottom - rectTop
1817
+ };
1818
+ }
1819
+
1820
+ /**
1821
+ * Given an element and one of its parents, return the offset
1822
+ * @function
1823
+ * @ignore
1824
+ * @param {HTMLElement} element
1825
+ * @param {HTMLElement} parent
1826
+ * @return {Object} rect
1827
+ */
1828
+ function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
1829
+ var elementRect = getBoundingClientRect(element);
1830
+ var parentRect = getBoundingClientRect(parent);
1831
+
1832
+ if (fixed) {
1833
+ var scrollParent = getScrollParent(parent);
1834
+ parentRect.top += scrollParent.scrollTop;
1835
+ parentRect.bottom += scrollParent.scrollTop;
1836
+ parentRect.left += scrollParent.scrollLeft;
1837
+ parentRect.right += scrollParent.scrollLeft;
1838
+ }
1839
+
1840
+ var rect = {
1841
+ top: elementRect.top - parentRect.top,
1842
+ left: elementRect.left - parentRect.left,
1843
+ bottom: elementRect.top - parentRect.top + elementRect.height,
1844
+ right: elementRect.left - parentRect.left + elementRect.width,
1845
+ width: elementRect.width,
1846
+ height: elementRect.height
1847
+ };
1848
+ return rect;
1849
+ }
1850
+
1851
+ /**
1852
+ * Get the prefixed supported property name
1853
+ * @function
1854
+ * @ignore
1855
+ * @argument {String} property (camelCase)
1856
+ * @returns {String} prefixed property (camelCase)
1857
+ */
1858
+ function getSupportedPropertyName(property) {
1859
+ var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
1860
+
1861
+ for (var i = 0; i < prefixes.length; i++) {
1862
+ var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
1863
+ if (typeof root.document.body.style[toCheck] !== 'undefined') {
1864
+ return toCheck;
1865
+ }
1866
+ }
1867
+ return null;
1868
+ }
1869
+
1870
+ /**
1871
+ * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
1872
+ * objects to a target object. It will return the target object.
1873
+ * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
1874
+ * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
1875
+ * @function
1876
+ * @ignore
1877
+ */
1878
+ if (!Object.assign) {
1879
+ Object.defineProperty(Object, 'assign', {
1880
+ enumerable: false,
1881
+ configurable: true,
1882
+ writable: true,
1883
+ value: function value(target) {
1884
+ if (target === undefined || target === null) {
1885
+ throw new TypeError('Cannot convert first argument to object');
1886
+ }
1887
+
1888
+ var to = Object(target);
1889
+ for (var i = 1; i < arguments.length; i++) {
1890
+ var nextSource = arguments[i];
1891
+ if (nextSource === undefined || nextSource === null) {
1892
+ continue;
1893
+ }
1894
+ nextSource = Object(nextSource);
1895
+
1896
+ var keysArray = Object.keys(nextSource);
1897
+ for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
1898
+ var nextKey = keysArray[nextIndex];
1899
+ var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
1900
+ if (desc !== undefined && desc.enumerable) {
1901
+ to[nextKey] = nextSource[nextKey];
1902
+ }
1903
+ }
1904
+ }
1905
+ return to;
1906
+ }
1907
+ });
1908
+ }
1909
+
1910
+ return Popper;
1911
+ });
1912
+
1913
+ /***/ }),
1914
+
1915
+ /***/ 3:
1916
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1917
+
1918
+ "use strict";
1919
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return noop; });
1920
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; });
1921
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toObject; });
1922
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; });
1923
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; });
1924
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; });
1925
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return valueEquals; });
1926
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; });
1927
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
1928
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
1929
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; });
1930
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; });
1931
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; });
1932
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; });
1933
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; });
1934
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return kebabCase; });
1935
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; });
1936
+ /* unused harmony export looseEqual */
1937
+ /* unused harmony export arrayEquals */
1938
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; });
1939
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; });
1940
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return rafThrottle; });
1941
+ /* unused harmony export objToArray */
1942
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isMac; });
1943
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1944
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
1945
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
1946
+ 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; };
1947
+
1948
+
1949
+
1950
+
1951
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1952
+
1953
+ function noop() {};
1954
+
1955
+ function hasOwn(obj, key) {
1956
+ return hasOwnProperty.call(obj, key);
1957
+ };
1958
+
1959
+ function extend(to, _from) {
1960
+ for (var key in _from) {
1961
+ to[key] = _from[key];
1962
+ }
1963
+ return to;
1964
+ };
1965
+
1966
+ function toObject(arr) {
1967
+ var res = {};
1968
+ for (var i = 0; i < arr.length; i++) {
1969
+ if (arr[i]) {
1970
+ extend(res, arr[i]);
1971
+ }
1972
+ }
1973
+ return res;
1974
+ };
1975
+
1976
+ var getValueByPath = function getValueByPath(object, prop) {
1977
+ prop = prop || '';
1978
+ var paths = prop.split('.');
1979
+ var current = object;
1980
+ var result = null;
1981
+ for (var i = 0, j = paths.length; i < j; i++) {
1982
+ var path = paths[i];
1983
+ if (!current) break;
1984
+
1985
+ if (i === j - 1) {
1986
+ result = current[path];
1987
+ break;
1988
+ }
1989
+ current = current[path];
1990
+ }
1991
+ return result;
1992
+ };
1993
+
1994
+ function getPropByPath(obj, path, strict) {
1995
+ var tempObj = obj;
1996
+ path = path.replace(/\[(\w+)\]/g, '.$1');
1997
+ path = path.replace(/^\./, '');
1998
+
1999
+ var keyArr = path.split('.');
2000
+ var i = 0;
2001
+ for (var len = keyArr.length; i < len - 1; ++i) {
2002
+ if (!tempObj && !strict) break;
2003
+ var key = keyArr[i];
2004
+ if (key in tempObj) {
2005
+ tempObj = tempObj[key];
2006
+ } else {
2007
+ if (strict) {
2008
+ throw new Error('please transfer a valid prop path to form item!');
2009
+ }
2010
+ break;
2011
+ }
2012
+ }
2013
+ return {
2014
+ o: tempObj,
2015
+ k: keyArr[i],
2016
+ v: tempObj ? tempObj[keyArr[i]] : null
2017
+ };
2018
+ };
2019
+
2020
+ var generateId = function generateId() {
2021
+ return Math.floor(Math.random() * 10000);
2022
+ };
2023
+
2024
+ var valueEquals = function valueEquals(a, b) {
2025
+ // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
2026
+ if (a === b) return true;
2027
+ if (!(a instanceof Array)) return false;
2028
+ if (!(b instanceof Array)) return false;
2029
+ if (a.length !== b.length) return false;
2030
+ for (var i = 0; i !== a.length; ++i) {
2031
+ if (a[i] !== b[i]) return false;
2032
+ }
2033
+ return true;
2034
+ };
2035
+
2036
+ var escapeRegexpString = function escapeRegexpString() {
2037
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2038
+ return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
2039
+ };
2040
+
2041
+ // TODO: use native Array.find, Array.findIndex when IE support is dropped
2042
+ var arrayFindIndex = function arrayFindIndex(arr, pred) {
2043
+ for (var i = 0; i !== arr.length; ++i) {
2044
+ if (pred(arr[i])) {
2045
+ return i;
2046
+ }
2047
+ }
2048
+ return -1;
2049
+ };
2050
+
2051
+ var arrayFind = function arrayFind(arr, pred) {
2052
+ var idx = arrayFindIndex(arr, pred);
2053
+ return idx !== -1 ? arr[idx] : undefined;
2054
+ };
2055
+
2056
+ // coerce truthy value to array
2057
+ var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
2058
+ if (Array.isArray(val)) {
2059
+ return val;
2060
+ } else if (val) {
2061
+ return [val];
2062
+ } else {
2063
+ return [];
2064
+ }
2065
+ };
2066
+
2067
+ var isIE = function isIE() {
2068
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
2069
+ };
2070
+
2071
+ var isEdge = function isEdge() {
2072
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
2073
+ };
2074
+
2075
+ var isFirefox = function isFirefox() {
2076
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
2077
+ };
2078
+
2079
+ var autoprefixer = function autoprefixer(style) {
2080
+ if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;
2081
+ var rules = ['transform', 'transition', 'animation'];
2082
+ var prefixes = ['ms-', 'webkit-'];
2083
+ rules.forEach(function (rule) {
2084
+ var value = style[rule];
2085
+ if (rule && value) {
2086
+ prefixes.forEach(function (prefix) {
2087
+ style[prefix + rule] = value;
2088
+ });
2089
+ }
2090
+ });
2091
+ return style;
2092
+ };
2093
+
2094
+ var kebabCase = function kebabCase(str) {
2095
+ var hyphenateRE = /([^-])([A-Z])/g;
2096
+ return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
2097
+ };
2098
+
2099
+ var capitalize = function capitalize(str) {
2100
+ if (!Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str;
2101
+ return str.charAt(0).toUpperCase() + str.slice(1);
2102
+ };
2103
+
2104
+ var looseEqual = function looseEqual(a, b) {
2105
+ var isObjectA = Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a);
2106
+ var isObjectB = Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b);
2107
+ if (isObjectA && isObjectB) {
2108
+ return JSON.stringify(a) === JSON.stringify(b);
2109
+ } else if (!isObjectA && !isObjectB) {
2110
+ return String(a) === String(b);
2111
+ } else {
2112
+ return false;
2113
+ }
2114
+ };
2115
+
2116
+ var arrayEquals = function arrayEquals(arrayA, arrayB) {
2117
+ arrayA = arrayA || [];
2118
+ arrayB = arrayB || [];
2119
+
2120
+ if (arrayA.length !== arrayB.length) {
2121
+ return false;
2122
+ }
2123
+
2124
+ for (var i = 0; i < arrayA.length; i++) {
2125
+ if (!looseEqual(arrayA[i], arrayB[i])) {
2126
+ return false;
2127
+ }
2128
+ }
2129
+
2130
+ return true;
2131
+ };
2132
+
2133
+ var isEqual = function isEqual(value1, value2) {
2134
+ if (Array.isArray(value1) && Array.isArray(value2)) {
2135
+ return arrayEquals(value1, value2);
2136
+ }
2137
+ return looseEqual(value1, value2);
2138
+ };
2139
+
2140
+ var isEmpty = function isEmpty(val) {
2141
+ // null or undefined
2142
+ if (val == null) return true;
2143
+
2144
+ if (typeof val === 'boolean') return false;
2145
+
2146
+ if (typeof val === 'number') return !val;
2147
+
2148
+ if (val instanceof Error) return val.message === '';
2149
+
2150
+ switch (Object.prototype.toString.call(val)) {
2151
+ // String or Array
2152
+ case '[object String]':
2153
+ case '[object Array]':
2154
+ return !val.length;
2155
+
2156
+ // Map or Set or File
2157
+ case '[object File]':
2158
+ case '[object Map]':
2159
+ case '[object Set]':
2160
+ {
2161
+ return !val.size;
2162
+ }
2163
+ // Plain Object
2164
+ case '[object Object]':
2165
+ {
2166
+ return !Object.keys(val).length;
2167
+ }
2168
+ }
2169
+
2170
+ return false;
2171
+ };
2172
+
2173
+ function rafThrottle(fn) {
2174
+ var locked = false;
2175
+ return function () {
2176
+ var _this = this;
2177
+
2178
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
2179
+ args[_key] = arguments[_key];
2180
+ }
2181
+
2182
+ if (locked) return;
2183
+ locked = true;
2184
+ window.requestAnimationFrame(function (_) {
2185
+ fn.apply(_this, args);
2186
+ locked = false;
2187
+ });
2188
+ };
2189
+ }
2190
+
2191
+ function objToArray(obj) {
2192
+ if (Array.isArray(obj)) {
2193
+ return obj;
2194
+ }
2195
+ return isEmpty(obj) ? [] : [obj];
2196
+ }
2197
+
2198
+ var isMac = function isMac() {
2199
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
2200
+ };
2201
+
2202
+ /***/ }),
2203
+
2204
+ /***/ 37:
2205
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2206
+
2207
+ "use strict";
2208
+ // ESM COMPAT FLAG
2209
+ __webpack_require__.r(__webpack_exports__);
2210
+
2211
+ // EXTERNAL MODULE: ./src/utils/vue-popper.js
2212
+ var vue_popper = __webpack_require__(10);
2213
+
2214
+ // EXTERNAL MODULE: external "throttle-debounce/debounce"
2215
+ var debounce_ = __webpack_require__(22);
2216
+ var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
2217
+
2218
+ // EXTERNAL MODULE: ./src/utils/dom.js
2219
+ var dom = __webpack_require__(1);
2220
+
2221
+ // EXTERNAL MODULE: ./src/utils/util.js
2222
+ var util = __webpack_require__(3);
2223
+
2224
+ // EXTERNAL MODULE: external "vue"
2225
+ var external_vue_ = __webpack_require__(0);
2226
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
2227
+
2228
+ // CONCATENATED MODULE: ./packages/tooltip/src/main.js
2229
+
2230
+
2231
+
2232
+
2233
+
2234
+
2235
+ /* harmony default export */ var main = ({
2236
+ name: 'ElTooltip',
2237
+
2238
+ mixins: [vue_popper["a" /* default */]],
2239
+
2240
+ props: {
2241
+ openDelay: {
2242
+ type: Number,
2243
+ default: 0
2244
+ },
2245
+ disabled: Boolean,
2246
+ manual: Boolean,
2247
+ effect: {
2248
+ type: String,
2249
+ default: 'dark'
2250
+ },
2251
+ arrowOffset: {
2252
+ type: Number,
2253
+ default: 0
2254
+ },
2255
+ popperClass: String,
2256
+ content: String,
2257
+ visibleArrow: {
2258
+ default: true
2259
+ },
2260
+ transition: {
2261
+ type: String,
2262
+ default: 'el-fade-in-linear'
2263
+ },
2264
+ popperOptions: {
2265
+ default: function _default() {
2266
+ return {
2267
+ boundariesPadding: 10,
2268
+ gpuAcceleration: false
2269
+ };
2270
+ }
2271
+ },
2272
+ enterable: {
2273
+ type: Boolean,
2274
+ default: true
2275
+ },
2276
+ hideAfter: {
2277
+ type: Number,
2278
+ default: 0
2279
+ },
2280
+ tabindex: {
2281
+ type: Number,
2282
+ default: 0
2283
+ }
2284
+ },
2285
+
2286
+ data: function data() {
2287
+ return {
2288
+ tooltipId: 'el-tooltip-' + Object(util["g" /* generateId */])(),
2289
+ timeoutPending: null,
2290
+ focusing: false
2291
+ };
2292
+ },
2293
+ beforeCreate: function beforeCreate() {
2294
+ var _this = this;
2295
+
2296
+ if (this.$isServer) return;
2297
+
2298
+ this.popperVM = new external_vue_default.a({
2299
+ data: { node: '' },
2300
+ render: function render(h) {
2301
+ return this.node;
2302
+ }
2303
+ }).$mount();
2304
+
2305
+ this.debounceClose = debounce_default()(200, function () {
2306
+ return _this.handleClosePopper();
2307
+ });
2308
+ },
2309
+ render: function render(h) {
2310
+ var _this2 = this;
2311
+
2312
+ if (this.popperVM) {
2313
+ this.popperVM.node = h(
2314
+ 'transition',
2315
+ {
2316
+ attrs: {
2317
+ name: this.transition
2318
+ },
2319
+ on: {
2320
+ 'afterLeave': this.doDestroy
2321
+ }
2322
+ },
2323
+ [h(
2324
+ 'div',
2325
+ {
2326
+ on: {
2327
+ 'mouseleave': function mouseleave() {
2328
+ _this2.setExpectedState(false);_this2.debounceClose();
2329
+ },
2330
+ 'mouseenter': function mouseenter() {
2331
+ _this2.setExpectedState(true);
2332
+ }
2333
+ },
2334
+
2335
+ ref: 'popper',
2336
+ attrs: { role: 'tooltip',
2337
+ id: this.tooltipId,
2338
+ 'aria-hidden': this.disabled || !this.showPopper ? 'true' : 'false'
2339
+ },
2340
+ directives: [{
2341
+ name: 'show',
2342
+ value: !this.disabled && this.showPopper
2343
+ }],
2344
+
2345
+ 'class': ['el-tooltip__popper', 'is-' + this.effect, this.popperClass] },
2346
+ [this.$slots.content || this.content]
2347
+ )]
2348
+ );
2349
+ }
2350
+
2351
+ var firstElement = this.getFirstElement();
2352
+ if (!firstElement) return null;
2353
+
2354
+ var data = firstElement.data = firstElement.data || {};
2355
+ data.staticClass = this.addTooltipClass(data.staticClass);
2356
+
2357
+ return firstElement;
2358
+ },
2359
+ mounted: function mounted() {
2360
+ var _this3 = this;
2361
+
2362
+ this.referenceElm = this.$el;
2363
+ if (this.$el.nodeType === 1) {
2364
+ this.$el.setAttribute('aria-describedby', this.tooltipId);
2365
+ this.$el.setAttribute('tabindex', this.tabindex);
2366
+ Object(dom["g" /* on */])(this.referenceElm, 'mouseenter', this.show);
2367
+ Object(dom["g" /* on */])(this.referenceElm, 'mouseleave', this.hide);
2368
+ Object(dom["g" /* on */])(this.referenceElm, 'focus', function () {
2369
+ if (!_this3.$slots.default || !_this3.$slots.default.length) {
2370
+ _this3.handleFocus();
2371
+ return;
2372
+ }
2373
+ var instance = _this3.$slots.default[0].componentInstance;
2374
+ if (instance && instance.focus) {
2375
+ instance.focus();
2376
+ } else {
2377
+ _this3.handleFocus();
2378
+ }
2379
+ });
2380
+ Object(dom["g" /* on */])(this.referenceElm, 'blur', this.handleBlur);
2381
+ Object(dom["g" /* on */])(this.referenceElm, 'click', this.removeFocusing);
2382
+ }
2383
+ // fix issue https://github.com/ElemeFE/element/issues/14424
2384
+ if (this.value && this.popperVM) {
2385
+ this.popperVM.$nextTick(function () {
2386
+ if (_this3.value) {
2387
+ _this3.updatePopper();
2388
+ }
2389
+ });
2390
+ }
2391
+ },
2392
+
2393
+ watch: {
2394
+ focusing: function focusing(val) {
2395
+ if (val) {
2396
+ Object(dom["a" /* addClass */])(this.referenceElm, 'focusing');
2397
+ } else {
2398
+ Object(dom["i" /* removeClass */])(this.referenceElm, 'focusing');
2399
+ }
2400
+ }
2401
+ },
2402
+ methods: {
2403
+ show: function show() {
2404
+ this.setExpectedState(true);
2405
+ this.handleShowPopper();
2406
+ },
2407
+ hide: function hide() {
2408
+ this.setExpectedState(false);
2409
+ this.debounceClose();
2410
+ },
2411
+ handleFocus: function handleFocus() {
2412
+ this.focusing = true;
2413
+ this.show();
2414
+ },
2415
+ handleBlur: function handleBlur() {
2416
+ this.focusing = false;
2417
+ this.hide();
2418
+ },
2419
+ removeFocusing: function removeFocusing() {
2420
+ this.focusing = false;
2421
+ },
2422
+ addTooltipClass: function addTooltipClass(prev) {
2423
+ if (!prev) {
2424
+ return 'el-tooltip';
2425
+ } else {
2426
+ return 'el-tooltip ' + prev.replace('el-tooltip', '');
2427
+ }
2428
+ },
2429
+ handleShowPopper: function handleShowPopper() {
2430
+ var _this4 = this;
2431
+
2432
+ if (!this.expectedState || this.manual) return;
2433
+ clearTimeout(this.timeout);
2434
+ this.timeout = setTimeout(function () {
2435
+ _this4.showPopper = true;
2436
+ }, this.openDelay);
2437
+
2438
+ if (this.hideAfter > 0) {
2439
+ this.timeoutPending = setTimeout(function () {
2440
+ _this4.showPopper = false;
2441
+ }, this.hideAfter);
2442
+ }
2443
+ },
2444
+ handleClosePopper: function handleClosePopper() {
2445
+ if (this.enterable && this.expectedState || this.manual) return;
2446
+ clearTimeout(this.timeout);
2447
+
2448
+ if (this.timeoutPending) {
2449
+ clearTimeout(this.timeoutPending);
2450
+ }
2451
+ this.showPopper = false;
2452
+
2453
+ if (this.disabled) {
2454
+ this.doDestroy();
2455
+ }
2456
+ },
2457
+ setExpectedState: function setExpectedState(expectedState) {
2458
+ if (expectedState === false) {
2459
+ clearTimeout(this.timeoutPending);
2460
+ }
2461
+ this.expectedState = expectedState;
2462
+ },
2463
+ getFirstElement: function getFirstElement() {
2464
+ var slots = this.$slots.default;
2465
+ if (!Array.isArray(slots)) return null;
2466
+ var element = null;
2467
+ for (var index = 0; index < slots.length; index++) {
2468
+ if (slots[index] && slots[index].tag) {
2469
+ element = slots[index];
2470
+ break;
2471
+ };
2472
+ }
2473
+ return element;
2474
+ }
2475
+ },
2476
+
2477
+ beforeDestroy: function beforeDestroy() {
2478
+ this.popperVM && this.popperVM.$destroy();
2479
+ },
2480
+ destroyed: function destroyed() {
2481
+ var reference = this.referenceElm;
2482
+ if (reference.nodeType === 1) {
2483
+ Object(dom["f" /* off */])(reference, 'mouseenter', this.show);
2484
+ Object(dom["f" /* off */])(reference, 'mouseleave', this.hide);
2485
+ Object(dom["f" /* off */])(reference, 'focus', this.handleFocus);
2486
+ Object(dom["f" /* off */])(reference, 'blur', this.handleBlur);
2487
+ Object(dom["f" /* off */])(reference, 'click', this.removeFocusing);
2488
+ }
2489
+ }
2490
+ });
2491
+ // CONCATENATED MODULE: ./packages/tooltip/index.js
2492
+
185
2493
 
186
- return {
187
- exports: scriptExports,
188
- options: options
189
- }
190
- }
2494
+ /* istanbul ignore next */
2495
+ main.install = function (Vue) {
2496
+ Vue.component(main.name, main);
2497
+ };
191
2498
 
2499
+ /* harmony default export */ var tooltip = __webpack_exports__["default"] = (main);
192
2500
 
193
2501
  /***/ }),
194
2502
 
195
- /***/ 29:
196
- /***/ (function(module, exports) {
2503
+ /***/ 4:
2504
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2505
+
2506
+ "use strict";
2507
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
2508
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
2509
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
2510
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
2511
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
2512
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
2513
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
2514
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
2515
+ 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; };
2516
+
2517
+
2518
+
2519
+ function isString(obj) {
2520
+ return Object.prototype.toString.call(obj) === '[object String]';
2521
+ }
2522
+
2523
+ function isObject(obj) {
2524
+ return Object.prototype.toString.call(obj) === '[object Object]';
2525
+ }
2526
+
2527
+ function isHtmlElement(node) {
2528
+ return node && node.nodeType === Node.ELEMENT_NODE;
2529
+ }
2530
+
2531
+ /**
2532
+ * - Inspired:
2533
+ * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
2534
+ */
2535
+ var isFunction = function isFunction(functionToCheck) {
2536
+ var getType = {};
2537
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
2538
+ };
2539
+
2540
+ if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
2541
+ isFunction = function isFunction(obj) {
2542
+ return typeof obj === 'function' || false;
2543
+ };
2544
+ }
2545
+
2546
+
2547
+
2548
+ var isUndefined = function isUndefined(val) {
2549
+ return val === void 0;
2550
+ };
197
2551
 
198
- module.exports = require("cy-element-ui/lib/tooltip");
2552
+ var isDefined = function isDefined(val) {
2553
+ return val !== undefined && val !== null;
2554
+ };
199
2555
 
200
2556
  /***/ }),
201
2557
 
202
- /***/ 37:
2558
+ /***/ 48:
203
2559
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
204
2560
 
205
2561
  "use strict";
@@ -247,14 +2603,107 @@ module.exports = require("cy-element-ui/lib/tooltip");
247
2603
 
248
2604
  /***/ }),
249
2605
 
250
- /***/ 4:
251
- /***/ (function(module, exports) {
2606
+ /***/ 6:
2607
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2608
+
2609
+ "use strict";
2610
+ function _broadcast(componentName, eventName, params) {
2611
+ this.$children.forEach(function (child) {
2612
+ var name = child.$options.componentName;
2613
+
2614
+ if (name === componentName) {
2615
+ child.$emit.apply(child, [eventName].concat(params));
2616
+ } else {
2617
+ _broadcast.apply(child, [componentName, eventName].concat([params]));
2618
+ }
2619
+ });
2620
+ }
2621
+ /* harmony default export */ __webpack_exports__["a"] = ({
2622
+ methods: {
2623
+ dispatch: function dispatch(componentName, eventName, params) {
2624
+ var parent = this.$parent || this.$root;
2625
+ var name = parent.$options.componentName;
2626
+
2627
+ while (parent && (!name || name !== componentName)) {
2628
+ parent = parent.$parent;
2629
+
2630
+ if (parent) {
2631
+ name = parent.$options.componentName;
2632
+ }
2633
+ }
2634
+ if (parent) {
2635
+ parent.$emit.apply(parent, [eventName].concat(params));
2636
+ }
2637
+ },
2638
+ broadcast: function broadcast(componentName, eventName, params) {
2639
+ _broadcast.call(this, componentName, eventName, params);
2640
+ }
2641
+ }
2642
+ });
2643
+
2644
+ /***/ }),
2645
+
2646
+ /***/ 7:
2647
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2648
+
2649
+ "use strict";
2650
+ /* harmony default export */ __webpack_exports__["a"] = (function (target) {
2651
+ for (var i = 1, j = arguments.length; i < j; i++) {
2652
+ var source = arguments[i] || {};
2653
+ for (var prop in source) {
2654
+ if (source.hasOwnProperty(prop)) {
2655
+ var value = source[prop];
2656
+ if (value !== undefined) {
2657
+ target[prop] = value;
2658
+ }
2659
+ }
2660
+ }
2661
+ }
2662
+
2663
+ return target;
2664
+ });;
2665
+
2666
+ /***/ }),
252
2667
 
253
- module.exports = require("cy-element-ui/lib/mixins/emitter");
2668
+ /***/ 8:
2669
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2670
+
2671
+ "use strict";
2672
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
2673
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
2674
+
2675
+
2676
+ var scrollBarWidth = void 0;
2677
+
2678
+ /* harmony default export */ __webpack_exports__["a"] = (function () {
2679
+ if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
2680
+ if (scrollBarWidth !== undefined) return scrollBarWidth;
2681
+
2682
+ var outer = document.createElement('div');
2683
+ outer.className = 'el-scrollbar__wrap';
2684
+ outer.style.visibility = 'hidden';
2685
+ outer.style.width = '100px';
2686
+ outer.style.position = 'absolute';
2687
+ outer.style.top = '-9999px';
2688
+ document.body.appendChild(outer);
2689
+
2690
+ var widthNoScroll = outer.offsetWidth;
2691
+ outer.style.overflow = 'scroll';
2692
+
2693
+ var inner = document.createElement('div');
2694
+ inner.style.width = '100%';
2695
+ outer.appendChild(inner);
2696
+
2697
+ var widthWithScroll = inner.offsetWidth;
2698
+ outer.parentNode.removeChild(outer);
2699
+ scrollBarWidth = widthNoScroll - widthWithScroll;
2700
+
2701
+ return scrollBarWidth;
2702
+ });;
254
2703
 
255
2704
  /***/ }),
256
2705
 
257
- /***/ 89:
2706
+ /***/ 86:
258
2707
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
259
2708
 
260
2709
  "use strict";
@@ -328,15 +2777,13 @@ render._withStripped = true
328
2777
  // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=template&id=7cde48fc
329
2778
 
330
2779
  // EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js
331
- var menu_mixin = __webpack_require__(37);
2780
+ var menu_mixin = __webpack_require__(48);
332
2781
 
333
- // EXTERNAL MODULE: external "cy-element-ui/lib/tooltip"
334
- var tooltip_ = __webpack_require__(29);
335
- var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_);
2782
+ // EXTERNAL MODULE: ./packages/tooltip/index.js + 1 modules
2783
+ var tooltip = __webpack_require__(37);
336
2784
 
337
- // EXTERNAL MODULE: external "cy-element-ui/lib/mixins/emitter"
338
- var emitter_ = __webpack_require__(4);
339
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
2785
+ // EXTERNAL MODULE: ./src/mixins/emitter.js
2786
+ var emitter = __webpack_require__(6);
340
2787
 
341
2788
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item.vue?vue&type=script&lang=js
342
2789
 
@@ -349,9 +2796,9 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
349
2796
 
350
2797
  componentName: 'ElMenuItem',
351
2798
 
352
- mixins: [menu_mixin["a" /* default */], emitter_default.a],
2799
+ mixins: [menu_mixin["a" /* default */], emitter["a" /* default */]],
353
2800
 
354
- components: { ElTooltip: tooltip_default.a },
2801
+ components: { ElTooltip: tooltip["default"] },
355
2802
 
356
2803
  props: {
357
2804
  index: {
@@ -423,7 +2870,7 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
423
2870
  // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=script&lang=js
424
2871
  /* harmony default export */ var src_menu_itemvue_type_script_lang_js = (menu_itemvue_type_script_lang_js);
425
2872
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
426
- var componentNormalizer = __webpack_require__(0);
2873
+ var componentNormalizer = __webpack_require__(2);
427
2874
 
428
2875
  // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue
429
2876
 
@@ -455,6 +2902,443 @@ menu_item.install = function (Vue) {
455
2902
 
456
2903
  /* harmony default export */ var packages_menu_item = __webpack_exports__["default"] = (menu_item);
457
2904
 
2905
+ /***/ }),
2906
+
2907
+ /***/ 9:
2908
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2909
+
2910
+ "use strict";
2911
+
2912
+ // EXPORTS
2913
+ __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
2914
+
2915
+ // EXTERNAL MODULE: external "vue"
2916
+ var external_vue_ = __webpack_require__(0);
2917
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
2918
+
2919
+ // EXTERNAL MODULE: ./src/utils/merge.js
2920
+ var merge = __webpack_require__(7);
2921
+
2922
+ // EXTERNAL MODULE: ./src/utils/dom.js
2923
+ var utils_dom = __webpack_require__(1);
2924
+
2925
+ // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
2926
+
2927
+
2928
+
2929
+ var hasModal = false;
2930
+ var hasInitZIndex = false;
2931
+ var popup_manager_zIndex = void 0;
2932
+
2933
+ var popup_manager_getModal = function getModal() {
2934
+ if (external_vue_default.a.prototype.$isServer) return;
2935
+ var modalDom = PopupManager.modalDom;
2936
+ if (modalDom) {
2937
+ hasModal = true;
2938
+ } else {
2939
+ hasModal = false;
2940
+ modalDom = document.createElement('div');
2941
+ PopupManager.modalDom = modalDom;
2942
+
2943
+ modalDom.addEventListener('touchmove', function (event) {
2944
+ event.preventDefault();
2945
+ event.stopPropagation();
2946
+ });
2947
+
2948
+ modalDom.addEventListener('click', function () {
2949
+ PopupManager.doOnModalClick && PopupManager.doOnModalClick();
2950
+ });
2951
+ }
2952
+
2953
+ return modalDom;
2954
+ };
2955
+
2956
+ var instances = {};
2957
+
2958
+ var PopupManager = {
2959
+ modalFade: true,
2960
+
2961
+ getInstance: function getInstance(id) {
2962
+ return instances[id];
2963
+ },
2964
+
2965
+ register: function register(id, instance) {
2966
+ if (id && instance) {
2967
+ instances[id] = instance;
2968
+ }
2969
+ },
2970
+
2971
+ deregister: function deregister(id) {
2972
+ if (id) {
2973
+ instances[id] = null;
2974
+ delete instances[id];
2975
+ }
2976
+ },
2977
+
2978
+ nextZIndex: function nextZIndex() {
2979
+ return PopupManager.zIndex++;
2980
+ },
2981
+
2982
+ modalStack: [],
2983
+
2984
+ doOnModalClick: function doOnModalClick() {
2985
+ var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
2986
+ if (!topItem) return;
2987
+
2988
+ var instance = PopupManager.getInstance(topItem.id);
2989
+ if (instance && instance.closeOnClickModal) {
2990
+ instance.close();
2991
+ }
2992
+ },
2993
+
2994
+ openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
2995
+ if (external_vue_default.a.prototype.$isServer) return;
2996
+ if (!id || zIndex === undefined) return;
2997
+ this.modalFade = modalFade;
2998
+
2999
+ var modalStack = this.modalStack;
3000
+
3001
+ for (var i = 0, j = modalStack.length; i < j; i++) {
3002
+ var item = modalStack[i];
3003
+ if (item.id === id) {
3004
+ return;
3005
+ }
3006
+ }
3007
+
3008
+ var modalDom = popup_manager_getModal();
3009
+
3010
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
3011
+ if (this.modalFade && !hasModal) {
3012
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
3013
+ }
3014
+ if (modalClass) {
3015
+ var classArr = modalClass.trim().split(/\s+/);
3016
+ classArr.forEach(function (item) {
3017
+ return Object(utils_dom["a" /* addClass */])(modalDom, item);
3018
+ });
3019
+ }
3020
+ setTimeout(function () {
3021
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
3022
+ }, 200);
3023
+
3024
+ if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
3025
+ dom.parentNode.appendChild(modalDom);
3026
+ } else {
3027
+ document.body.appendChild(modalDom);
3028
+ }
3029
+
3030
+ if (zIndex) {
3031
+ modalDom.style.zIndex = zIndex;
3032
+ }
3033
+ modalDom.tabIndex = 0;
3034
+ modalDom.style.display = '';
3035
+
3036
+ this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
3037
+ },
3038
+
3039
+ closeModal: function closeModal(id) {
3040
+ var modalStack = this.modalStack;
3041
+ var modalDom = popup_manager_getModal();
3042
+
3043
+ if (modalStack.length > 0) {
3044
+ var topItem = modalStack[modalStack.length - 1];
3045
+ if (topItem.id === id) {
3046
+ if (topItem.modalClass) {
3047
+ var classArr = topItem.modalClass.trim().split(/\s+/);
3048
+ classArr.forEach(function (item) {
3049
+ return Object(utils_dom["i" /* removeClass */])(modalDom, item);
3050
+ });
3051
+ }
3052
+
3053
+ modalStack.pop();
3054
+ if (modalStack.length > 0) {
3055
+ modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
3056
+ }
3057
+ } else {
3058
+ for (var i = modalStack.length - 1; i >= 0; i--) {
3059
+ if (modalStack[i].id === id) {
3060
+ modalStack.splice(i, 1);
3061
+ break;
3062
+ }
3063
+ }
3064
+ }
3065
+ }
3066
+
3067
+ if (modalStack.length === 0) {
3068
+ if (this.modalFade) {
3069
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
3070
+ }
3071
+ setTimeout(function () {
3072
+ if (modalStack.length === 0) {
3073
+ if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
3074
+ modalDom.style.display = 'none';
3075
+ PopupManager.modalDom = undefined;
3076
+ }
3077
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
3078
+ }, 200);
3079
+ }
3080
+ }
3081
+ };
3082
+
3083
+ Object.defineProperty(PopupManager, 'zIndex', {
3084
+ configurable: true,
3085
+ get: function get() {
3086
+ if (!hasInitZIndex) {
3087
+ popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$ELEMENT || {}).zIndex || 2000;
3088
+ hasInitZIndex = true;
3089
+ }
3090
+ return popup_manager_zIndex;
3091
+ },
3092
+ set: function set(value) {
3093
+ popup_manager_zIndex = value;
3094
+ }
3095
+ });
3096
+
3097
+ var popup_manager_getTopPopup = function getTopPopup() {
3098
+ if (external_vue_default.a.prototype.$isServer) return;
3099
+ if (PopupManager.modalStack.length > 0) {
3100
+ var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
3101
+ if (!topPopup) return;
3102
+ var instance = PopupManager.getInstance(topPopup.id);
3103
+
3104
+ return instance;
3105
+ }
3106
+ };
3107
+
3108
+ if (!external_vue_default.a.prototype.$isServer) {
3109
+ // handle `esc` key when the popup is shown
3110
+ window.addEventListener('keydown', function (event) {
3111
+ if (event.keyCode === 27) {
3112
+ var topPopup = popup_manager_getTopPopup();
3113
+
3114
+ if (topPopup && topPopup.closeOnPressEscape) {
3115
+ topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
3116
+ }
3117
+ }
3118
+ });
3119
+ }
3120
+
3121
+ /* harmony default export */ var popup_manager = (PopupManager);
3122
+ // EXTERNAL MODULE: ./src/utils/scrollbar-width.js
3123
+ var scrollbar_width = __webpack_require__(8);
3124
+
3125
+ // CONCATENATED MODULE: ./src/utils/popup/index.js
3126
+
3127
+
3128
+
3129
+
3130
+
3131
+
3132
+ var idSeed = 1;
3133
+
3134
+ var scrollBarWidth = void 0;
3135
+
3136
+ /* harmony default export */ var popup = __webpack_exports__["b"] = ({
3137
+ props: {
3138
+ visible: {
3139
+ type: Boolean,
3140
+ default: false
3141
+ },
3142
+ openDelay: {},
3143
+ closeDelay: {},
3144
+ zIndex: {},
3145
+ modal: {
3146
+ type: Boolean,
3147
+ default: false
3148
+ },
3149
+ modalFade: {
3150
+ type: Boolean,
3151
+ default: true
3152
+ },
3153
+ modalClass: {},
3154
+ modalAppendToBody: {
3155
+ type: Boolean,
3156
+ default: false
3157
+ },
3158
+ lockScroll: {
3159
+ type: Boolean,
3160
+ default: true
3161
+ },
3162
+ closeOnPressEscape: {
3163
+ type: Boolean,
3164
+ default: false
3165
+ },
3166
+ closeOnClickModal: {
3167
+ type: Boolean,
3168
+ default: false
3169
+ }
3170
+ },
3171
+
3172
+ beforeMount: function beforeMount() {
3173
+ this._popupId = 'popup-' + idSeed++;
3174
+ popup_manager.register(this._popupId, this);
3175
+ },
3176
+ beforeDestroy: function beforeDestroy() {
3177
+ popup_manager.deregister(this._popupId);
3178
+ popup_manager.closeModal(this._popupId);
3179
+
3180
+ this.restoreBodyStyle();
3181
+ },
3182
+ data: function data() {
3183
+ return {
3184
+ opened: false,
3185
+ bodyPaddingRight: null,
3186
+ computedBodyPaddingRight: 0,
3187
+ withoutHiddenClass: true,
3188
+ rendered: false
3189
+ };
3190
+ },
3191
+
3192
+
3193
+ watch: {
3194
+ visible: function visible(val) {
3195
+ var _this = this;
3196
+
3197
+ if (val) {
3198
+ if (this._opening) return;
3199
+ if (!this.rendered) {
3200
+ this.rendered = true;
3201
+ external_vue_default.a.nextTick(function () {
3202
+ _this.open();
3203
+ });
3204
+ } else {
3205
+ this.open();
3206
+ }
3207
+ } else {
3208
+ this.close();
3209
+ }
3210
+ }
3211
+ },
3212
+
3213
+ methods: {
3214
+ open: function open(options) {
3215
+ var _this2 = this;
3216
+
3217
+ if (!this.rendered) {
3218
+ this.rendered = true;
3219
+ }
3220
+
3221
+ var props = Object(merge["a" /* default */])({}, this.$props || this, options);
3222
+
3223
+ if (this._closeTimer) {
3224
+ clearTimeout(this._closeTimer);
3225
+ this._closeTimer = null;
3226
+ }
3227
+ clearTimeout(this._openTimer);
3228
+
3229
+ var openDelay = Number(props.openDelay);
3230
+ if (openDelay > 0) {
3231
+ this._openTimer = setTimeout(function () {
3232
+ _this2._openTimer = null;
3233
+ _this2.doOpen(props);
3234
+ }, openDelay);
3235
+ } else {
3236
+ this.doOpen(props);
3237
+ }
3238
+ },
3239
+ doOpen: function doOpen(props) {
3240
+ if (this.$isServer) return;
3241
+ if (this.willOpen && !this.willOpen()) return;
3242
+ if (this.opened) return;
3243
+
3244
+ this._opening = true;
3245
+
3246
+ var dom = this.$el;
3247
+
3248
+ var modal = props.modal;
3249
+
3250
+ var zIndex = props.zIndex;
3251
+ if (zIndex) {
3252
+ popup_manager.zIndex = zIndex;
3253
+ }
3254
+
3255
+ if (modal) {
3256
+ if (this._closing) {
3257
+ popup_manager.closeModal(this._popupId);
3258
+ this._closing = false;
3259
+ }
3260
+ popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
3261
+ if (props.lockScroll) {
3262
+ this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'el-popup-parent--hidden');
3263
+ if (this.withoutHiddenClass) {
3264
+ this.bodyPaddingRight = document.body.style.paddingRight;
3265
+ this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
3266
+ }
3267
+ scrollBarWidth = Object(scrollbar_width["a" /* default */])();
3268
+ var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
3269
+ var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
3270
+ if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
3271
+ document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
3272
+ }
3273
+ Object(utils_dom["a" /* addClass */])(document.body, 'el-popup-parent--hidden');
3274
+ }
3275
+ }
3276
+
3277
+ if (getComputedStyle(dom).position === 'static') {
3278
+ dom.style.position = 'absolute';
3279
+ }
3280
+
3281
+ dom.style.zIndex = popup_manager.nextZIndex();
3282
+ this.opened = true;
3283
+
3284
+ this.onOpen && this.onOpen();
3285
+
3286
+ this.doAfterOpen();
3287
+ },
3288
+ doAfterOpen: function doAfterOpen() {
3289
+ this._opening = false;
3290
+ },
3291
+ close: function close() {
3292
+ var _this3 = this;
3293
+
3294
+ if (this.willClose && !this.willClose()) return;
3295
+
3296
+ if (this._openTimer !== null) {
3297
+ clearTimeout(this._openTimer);
3298
+ this._openTimer = null;
3299
+ }
3300
+ clearTimeout(this._closeTimer);
3301
+
3302
+ var closeDelay = Number(this.closeDelay);
3303
+
3304
+ if (closeDelay > 0) {
3305
+ this._closeTimer = setTimeout(function () {
3306
+ _this3._closeTimer = null;
3307
+ _this3.doClose();
3308
+ }, closeDelay);
3309
+ } else {
3310
+ this.doClose();
3311
+ }
3312
+ },
3313
+ doClose: function doClose() {
3314
+ this._closing = true;
3315
+
3316
+ this.onClose && this.onClose();
3317
+
3318
+ if (this.lockScroll) {
3319
+ setTimeout(this.restoreBodyStyle, 200);
3320
+ }
3321
+
3322
+ this.opened = false;
3323
+
3324
+ this.doAfterClose();
3325
+ },
3326
+ doAfterClose: function doAfterClose() {
3327
+ popup_manager.closeModal(this._popupId);
3328
+ this._closing = false;
3329
+ },
3330
+ restoreBodyStyle: function restoreBodyStyle() {
3331
+ if (this.modal && this.withoutHiddenClass) {
3332
+ document.body.style.paddingRight = this.bodyPaddingRight;
3333
+ Object(utils_dom["i" /* removeClass */])(document.body, 'el-popup-parent--hidden');
3334
+ }
3335
+ this.withoutHiddenClass = true;
3336
+ }
3337
+ }
3338
+ });
3339
+
3340
+
3341
+
458
3342
  /***/ })
459
3343
 
460
3344
  /******/ });