cy-element-ui 1.0.48 → 1.0.49

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