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