cy-element-ui 1.0.71 → 1.0.73

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