cy-element-ui 1.0.72 → 1.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/alert.js +4 -4
- package/lib/aside.js +77 -77
- package/lib/autocomplete.js +3940 -159
- package/lib/avatar.js +108 -108
- package/lib/backtop.js +110 -110
- package/lib/badge.js +108 -108
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +4 -4
- package/lib/button-group.js +4 -4
- package/lib/button.js +4 -4
- package/lib/calendar.js +1545 -46
- package/lib/card.js +96 -96
- package/lib/carousel-item.js +452 -108
- package/lib/carousel.js +185 -116
- package/lib/cascader-panel.js +2270 -187
- package/lib/cascader.js +6452 -275
- package/lib/checkbox-button.js +43 -11
- 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 +3953 -153
- package/lib/container.js +88 -88
- package/lib/date-picker.js +5231 -420
- 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 +43 -11
- package/lib/dropdown-menu.js +2274 -72
- package/lib/dropdown.js +1072 -136
- package/lib/element-ui.common.js +26229 -13291
- package/lib/empty.js +603 -7
- package/lib/fileUpload.js +2478 -110
- package/lib/footer.js +77 -77
- package/lib/form-item.js +418 -28
- package/lib/form.js +29 -15
- package/lib/header.js +77 -77
- package/lib/icon.js +4 -4
- package/lib/image.js +1376 -49
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +311 -21
- package/lib/input-number.js +1423 -34
- package/lib/input.js +507 -37
- package/lib/link.js +4 -4
- package/lib/loading.js +804 -67
- package/lib/locale/format.js +1 -1
- package/lib/locale/index.js +1 -1
- package/lib/main.js +64 -64
- package/lib/menu-item-group.js +4 -4
- package/lib/menu-item.js +2925 -41
- package/lib/menu.js +745 -54
- package/lib/message-box.js +2536 -79
- package/lib/message.js +1102 -24
- package/lib/mixins/locale.js +1 -1
- package/lib/mixins/migrating.js +1 -1
- package/lib/notification.js +1102 -25
- package/lib/option-group.js +43 -11
- package/lib/option.js +394 -18
- package/lib/page-header.js +683 -87
- package/lib/pagination.js +6078 -139
- package/lib/popconfirm.js +3508 -219
- package/lib/popover.js +2604 -79
- package/lib/progress.js +4 -4
- package/lib/radio-button.js +43 -11
- package/lib/radio-group.js +43 -11
- package/lib/radio.js +47 -15
- package/lib/rate.js +756 -113
- package/lib/result.js +4 -4
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +735 -50
- package/lib/select.js +4352 -209
- package/lib/selectDisplayInput.js +108 -108
- package/lib/skeleton-item.js +2 -2
- package/lib/skeleton.js +108 -108
- package/lib/slider.js +4266 -120
- package/lib/spinner.js +4 -4
- package/lib/statistic.js +9605 -117
- package/lib/step.js +108 -108
- package/lib/steps.js +514 -99
- package/lib/subTitle.js +91 -91
- package/lib/submenu.js +2444 -123
- package/lib/switch.js +476 -21
- package/lib/tab-pane.js +4 -4
- package/lib/tabDialog.js +1544 -18
- package/lib/table-column.js +881 -33
- package/lib/table.js +4469 -426
- package/lib/tabs.js +425 -12
- package/lib/tag.js +4 -4
- package/lib/time-picker.js +5013 -285
- package/lib/time-select.js +4945 -177
- package/lib/timeline-item.js +108 -108
- package/lib/timeline.js +82 -82
- package/lib/tooltip.js +2566 -41
- package/lib/transfer.js +2135 -141
- package/lib/transitions/collapse-transition.js +1 -1
- package/lib/tree.js +1372 -55
- package/lib/treeSelect.js +3420 -105
- package/lib/upload.js +1047 -28
- 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/index.js +1 -1
package/lib/message.js
CHANGED
|
@@ -82,12 +82,261 @@ 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 = 83);
|
|
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
|
+
/***/ 2:
|
|
91
340
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
341
|
|
|
93
342
|
"use strict";
|
|
@@ -192,35 +441,427 @@ function normalizeComponent(
|
|
|
192
441
|
|
|
193
442
|
/***/ }),
|
|
194
443
|
|
|
195
|
-
/***/
|
|
196
|
-
/***/ (function(module,
|
|
444
|
+
/***/ 3:
|
|
445
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
446
|
+
|
|
447
|
+
"use strict";
|
|
448
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return noop; });
|
|
449
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; });
|
|
450
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toObject; });
|
|
451
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; });
|
|
452
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; });
|
|
453
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; });
|
|
454
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return valueEquals; });
|
|
455
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; });
|
|
456
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
|
|
457
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
|
|
458
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; });
|
|
459
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; });
|
|
460
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; });
|
|
461
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; });
|
|
462
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; });
|
|
463
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return kebabCase; });
|
|
464
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; });
|
|
465
|
+
/* unused harmony export looseEqual */
|
|
466
|
+
/* unused harmony export arrayEquals */
|
|
467
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; });
|
|
468
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; });
|
|
469
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return rafThrottle; });
|
|
470
|
+
/* unused harmony export objToArray */
|
|
471
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isMac; });
|
|
472
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
473
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
474
|
+
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
475
|
+
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; };
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
481
|
+
|
|
482
|
+
function noop() {};
|
|
483
|
+
|
|
484
|
+
function hasOwn(obj, key) {
|
|
485
|
+
return hasOwnProperty.call(obj, key);
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
function extend(to, _from) {
|
|
489
|
+
for (var key in _from) {
|
|
490
|
+
to[key] = _from[key];
|
|
491
|
+
}
|
|
492
|
+
return to;
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
function toObject(arr) {
|
|
496
|
+
var res = {};
|
|
497
|
+
for (var i = 0; i < arr.length; i++) {
|
|
498
|
+
if (arr[i]) {
|
|
499
|
+
extend(res, arr[i]);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return res;
|
|
503
|
+
};
|
|
197
504
|
|
|
198
|
-
|
|
505
|
+
var getValueByPath = function getValueByPath(object, prop) {
|
|
506
|
+
prop = prop || '';
|
|
507
|
+
var paths = prop.split('.');
|
|
508
|
+
var current = object;
|
|
509
|
+
var result = null;
|
|
510
|
+
for (var i = 0, j = paths.length; i < j; i++) {
|
|
511
|
+
var path = paths[i];
|
|
512
|
+
if (!current) break;
|
|
513
|
+
|
|
514
|
+
if (i === j - 1) {
|
|
515
|
+
result = current[path];
|
|
516
|
+
break;
|
|
517
|
+
}
|
|
518
|
+
current = current[path];
|
|
519
|
+
}
|
|
520
|
+
return result;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
function getPropByPath(obj, path, strict) {
|
|
524
|
+
var tempObj = obj;
|
|
525
|
+
path = path.replace(/\[(\w+)\]/g, '.$1');
|
|
526
|
+
path = path.replace(/^\./, '');
|
|
527
|
+
|
|
528
|
+
var keyArr = path.split('.');
|
|
529
|
+
var i = 0;
|
|
530
|
+
for (var len = keyArr.length; i < len - 1; ++i) {
|
|
531
|
+
if (!tempObj && !strict) break;
|
|
532
|
+
var key = keyArr[i];
|
|
533
|
+
if (key in tempObj) {
|
|
534
|
+
tempObj = tempObj[key];
|
|
535
|
+
} else {
|
|
536
|
+
if (strict) {
|
|
537
|
+
throw new Error('please transfer a valid prop path to form item!');
|
|
538
|
+
}
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return {
|
|
543
|
+
o: tempObj,
|
|
544
|
+
k: keyArr[i],
|
|
545
|
+
v: tempObj ? tempObj[keyArr[i]] : null
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
var generateId = function generateId() {
|
|
550
|
+
return Math.floor(Math.random() * 10000);
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
var valueEquals = function valueEquals(a, b) {
|
|
554
|
+
// see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
|
|
555
|
+
if (a === b) return true;
|
|
556
|
+
if (!(a instanceof Array)) return false;
|
|
557
|
+
if (!(b instanceof Array)) return false;
|
|
558
|
+
if (a.length !== b.length) return false;
|
|
559
|
+
for (var i = 0; i !== a.length; ++i) {
|
|
560
|
+
if (a[i] !== b[i]) return false;
|
|
561
|
+
}
|
|
562
|
+
return true;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
var escapeRegexpString = function escapeRegexpString() {
|
|
566
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
567
|
+
return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
// TODO: use native Array.find, Array.findIndex when IE support is dropped
|
|
571
|
+
var arrayFindIndex = function arrayFindIndex(arr, pred) {
|
|
572
|
+
for (var i = 0; i !== arr.length; ++i) {
|
|
573
|
+
if (pred(arr[i])) {
|
|
574
|
+
return i;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return -1;
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
var arrayFind = function arrayFind(arr, pred) {
|
|
581
|
+
var idx = arrayFindIndex(arr, pred);
|
|
582
|
+
return idx !== -1 ? arr[idx] : undefined;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
// coerce truthy value to array
|
|
586
|
+
var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
|
|
587
|
+
if (Array.isArray(val)) {
|
|
588
|
+
return val;
|
|
589
|
+
} else if (val) {
|
|
590
|
+
return [val];
|
|
591
|
+
} else {
|
|
592
|
+
return [];
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
var isIE = function isIE() {
|
|
597
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
var isEdge = function isEdge() {
|
|
601
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
var isFirefox = function isFirefox() {
|
|
605
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
var autoprefixer = function autoprefixer(style) {
|
|
609
|
+
if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;
|
|
610
|
+
var rules = ['transform', 'transition', 'animation'];
|
|
611
|
+
var prefixes = ['ms-', 'webkit-'];
|
|
612
|
+
rules.forEach(function (rule) {
|
|
613
|
+
var value = style[rule];
|
|
614
|
+
if (rule && value) {
|
|
615
|
+
prefixes.forEach(function (prefix) {
|
|
616
|
+
style[prefix + rule] = value;
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
return style;
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
var kebabCase = function kebabCase(str) {
|
|
624
|
+
var hyphenateRE = /([^-])([A-Z])/g;
|
|
625
|
+
return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
var capitalize = function capitalize(str) {
|
|
629
|
+
if (!Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str;
|
|
630
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
var looseEqual = function looseEqual(a, b) {
|
|
634
|
+
var isObjectA = Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a);
|
|
635
|
+
var isObjectB = Object(_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b);
|
|
636
|
+
if (isObjectA && isObjectB) {
|
|
637
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
638
|
+
} else if (!isObjectA && !isObjectB) {
|
|
639
|
+
return String(a) === String(b);
|
|
640
|
+
} else {
|
|
641
|
+
return false;
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
var arrayEquals = function arrayEquals(arrayA, arrayB) {
|
|
646
|
+
arrayA = arrayA || [];
|
|
647
|
+
arrayB = arrayB || [];
|
|
648
|
+
|
|
649
|
+
if (arrayA.length !== arrayB.length) {
|
|
650
|
+
return false;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
for (var i = 0; i < arrayA.length; i++) {
|
|
654
|
+
if (!looseEqual(arrayA[i], arrayB[i])) {
|
|
655
|
+
return false;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return true;
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
var isEqual = function isEqual(value1, value2) {
|
|
663
|
+
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
664
|
+
return arrayEquals(value1, value2);
|
|
665
|
+
}
|
|
666
|
+
return looseEqual(value1, value2);
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
var isEmpty = function isEmpty(val) {
|
|
670
|
+
// null or undefined
|
|
671
|
+
if (val == null) return true;
|
|
672
|
+
|
|
673
|
+
if (typeof val === 'boolean') return false;
|
|
674
|
+
|
|
675
|
+
if (typeof val === 'number') return !val;
|
|
676
|
+
|
|
677
|
+
if (val instanceof Error) return val.message === '';
|
|
678
|
+
|
|
679
|
+
switch (Object.prototype.toString.call(val)) {
|
|
680
|
+
// String or Array
|
|
681
|
+
case '[object String]':
|
|
682
|
+
case '[object Array]':
|
|
683
|
+
return !val.length;
|
|
684
|
+
|
|
685
|
+
// Map or Set or File
|
|
686
|
+
case '[object File]':
|
|
687
|
+
case '[object Map]':
|
|
688
|
+
case '[object Set]':
|
|
689
|
+
{
|
|
690
|
+
return !val.size;
|
|
691
|
+
}
|
|
692
|
+
// Plain Object
|
|
693
|
+
case '[object Object]':
|
|
694
|
+
{
|
|
695
|
+
return !Object.keys(val).length;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return false;
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
function rafThrottle(fn) {
|
|
703
|
+
var locked = false;
|
|
704
|
+
return function () {
|
|
705
|
+
var _this = this;
|
|
706
|
+
|
|
707
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
708
|
+
args[_key] = arguments[_key];
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
if (locked) return;
|
|
712
|
+
locked = true;
|
|
713
|
+
window.requestAnimationFrame(function (_) {
|
|
714
|
+
fn.apply(_this, args);
|
|
715
|
+
locked = false;
|
|
716
|
+
});
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function objToArray(obj) {
|
|
721
|
+
if (Array.isArray(obj)) {
|
|
722
|
+
return obj;
|
|
723
|
+
}
|
|
724
|
+
return isEmpty(obj) ? [] : [obj];
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
var isMac = function isMac() {
|
|
728
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
|
|
729
|
+
};
|
|
199
730
|
|
|
200
731
|
/***/ }),
|
|
201
732
|
|
|
202
|
-
/***/
|
|
203
|
-
/***/ (function(module,
|
|
733
|
+
/***/ 35:
|
|
734
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
735
|
+
|
|
736
|
+
"use strict";
|
|
737
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isVNode; });
|
|
738
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
739
|
+
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; };
|
|
740
|
+
|
|
204
741
|
|
|
205
|
-
|
|
742
|
+
|
|
743
|
+
function isVNode(node) {
|
|
744
|
+
return node !== null && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "j"])(node, 'componentOptions');
|
|
745
|
+
};
|
|
206
746
|
|
|
207
747
|
/***/ }),
|
|
208
748
|
|
|
209
|
-
/***/
|
|
210
|
-
/***/ (function(module,
|
|
749
|
+
/***/ 4:
|
|
750
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
751
|
+
|
|
752
|
+
"use strict";
|
|
753
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
|
|
754
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
|
|
755
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
|
|
756
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
|
|
757
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
|
|
758
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
|
|
759
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
760
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
761
|
+
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; };
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
function isString(obj) {
|
|
766
|
+
return Object.prototype.toString.call(obj) === '[object String]';
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function isObject(obj) {
|
|
770
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
function isHtmlElement(node) {
|
|
774
|
+
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* - Inspired:
|
|
779
|
+
* https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
|
|
780
|
+
*/
|
|
781
|
+
var isFunction = function isFunction(functionToCheck) {
|
|
782
|
+
var getType = {};
|
|
783
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
|
|
787
|
+
isFunction = function isFunction(obj) {
|
|
788
|
+
return typeof obj === 'function' || false;
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
|
|
211
793
|
|
|
212
|
-
|
|
794
|
+
var isUndefined = function isUndefined(val) {
|
|
795
|
+
return val === void 0;
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
var isDefined = function isDefined(val) {
|
|
799
|
+
return val !== undefined && val !== null;
|
|
800
|
+
};
|
|
213
801
|
|
|
214
802
|
/***/ }),
|
|
215
803
|
|
|
216
804
|
/***/ 7:
|
|
217
|
-
/***/ (function(module,
|
|
805
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
218
806
|
|
|
219
|
-
|
|
807
|
+
"use strict";
|
|
808
|
+
/* harmony default export */ __webpack_exports__["a"] = (function (target) {
|
|
809
|
+
for (var i = 1, j = arguments.length; i < j; i++) {
|
|
810
|
+
var source = arguments[i] || {};
|
|
811
|
+
for (var prop in source) {
|
|
812
|
+
if (source.hasOwnProperty(prop)) {
|
|
813
|
+
var value = source[prop];
|
|
814
|
+
if (value !== undefined) {
|
|
815
|
+
target[prop] = value;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
return target;
|
|
822
|
+
});;
|
|
220
823
|
|
|
221
824
|
/***/ }),
|
|
222
825
|
|
|
223
|
-
/***/
|
|
826
|
+
/***/ 8:
|
|
827
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
828
|
+
|
|
829
|
+
"use strict";
|
|
830
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
831
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
var scrollBarWidth = void 0;
|
|
835
|
+
|
|
836
|
+
/* harmony default export */ __webpack_exports__["a"] = (function () {
|
|
837
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
|
|
838
|
+
if (scrollBarWidth !== undefined) return scrollBarWidth;
|
|
839
|
+
|
|
840
|
+
var outer = document.createElement('div');
|
|
841
|
+
outer.className = 'el-scrollbar__wrap';
|
|
842
|
+
outer.style.visibility = 'hidden';
|
|
843
|
+
outer.style.width = '100px';
|
|
844
|
+
outer.style.position = 'absolute';
|
|
845
|
+
outer.style.top = '-9999px';
|
|
846
|
+
document.body.appendChild(outer);
|
|
847
|
+
|
|
848
|
+
var widthNoScroll = outer.offsetWidth;
|
|
849
|
+
outer.style.overflow = 'scroll';
|
|
850
|
+
|
|
851
|
+
var inner = document.createElement('div');
|
|
852
|
+
inner.style.width = '100%';
|
|
853
|
+
outer.appendChild(inner);
|
|
854
|
+
|
|
855
|
+
var widthWithScroll = inner.offsetWidth;
|
|
856
|
+
outer.parentNode.removeChild(outer);
|
|
857
|
+
scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
858
|
+
|
|
859
|
+
return scrollBarWidth;
|
|
860
|
+
});;
|
|
861
|
+
|
|
862
|
+
/***/ }),
|
|
863
|
+
|
|
864
|
+
/***/ 83:
|
|
224
865
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
225
866
|
|
|
226
867
|
"use strict";
|
|
@@ -228,7 +869,7 @@ module.exports = require("vue");
|
|
|
228
869
|
__webpack_require__.r(__webpack_exports__);
|
|
229
870
|
|
|
230
871
|
// EXTERNAL MODULE: external "vue"
|
|
231
|
-
var external_vue_ = __webpack_require__(
|
|
872
|
+
var external_vue_ = __webpack_require__(0);
|
|
232
873
|
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
|
|
233
874
|
|
|
234
875
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=template&id=42076ee3
|
|
@@ -391,7 +1032,7 @@ var typeMap = {
|
|
|
391
1032
|
// CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js
|
|
392
1033
|
/* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
|
|
393
1034
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
394
|
-
var componentNormalizer = __webpack_require__(
|
|
1035
|
+
var componentNormalizer = __webpack_require__(2);
|
|
395
1036
|
|
|
396
1037
|
// CONCATENATED MODULE: ./packages/message/src/main.vue
|
|
397
1038
|
|
|
@@ -413,14 +1054,14 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
413
1054
|
)
|
|
414
1055
|
|
|
415
1056
|
/* harmony default export */ var main = (component.exports);
|
|
416
|
-
// EXTERNAL MODULE:
|
|
417
|
-
var
|
|
1057
|
+
// EXTERNAL MODULE: ./src/utils/popup/index.js + 1 modules
|
|
1058
|
+
var popup = __webpack_require__(9);
|
|
418
1059
|
|
|
419
|
-
// EXTERNAL MODULE:
|
|
420
|
-
var
|
|
1060
|
+
// EXTERNAL MODULE: ./src/utils/vdom.js
|
|
1061
|
+
var vdom = __webpack_require__(35);
|
|
421
1062
|
|
|
422
|
-
// EXTERNAL MODULE:
|
|
423
|
-
var
|
|
1063
|
+
// EXTERNAL MODULE: ./src/utils/types.js
|
|
1064
|
+
var types = __webpack_require__(4);
|
|
424
1065
|
|
|
425
1066
|
// CONCATENATED MODULE: ./packages/message/src/main.js
|
|
426
1067
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
@@ -454,7 +1095,7 @@ var main_Message = function Message(options) {
|
|
|
454
1095
|
data: options
|
|
455
1096
|
});
|
|
456
1097
|
instance.id = id;
|
|
457
|
-
if (Object(
|
|
1098
|
+
if (Object(vdom["a" /* isVNode */])(instance.message)) {
|
|
458
1099
|
instance.$slots.default = [instance.message];
|
|
459
1100
|
instance.message = null;
|
|
460
1101
|
}
|
|
@@ -466,14 +1107,14 @@ var main_Message = function Message(options) {
|
|
|
466
1107
|
});
|
|
467
1108
|
instance.verticalOffset = verticalOffset;
|
|
468
1109
|
instance.visible = true;
|
|
469
|
-
instance.$el.style.zIndex =
|
|
1110
|
+
instance.$el.style.zIndex = popup["a" /* PopupManager */].nextZIndex();
|
|
470
1111
|
instances.push(instance);
|
|
471
1112
|
return instance;
|
|
472
1113
|
};
|
|
473
1114
|
|
|
474
1115
|
['success', 'warning', 'info', 'error'].forEach(function (type) {
|
|
475
1116
|
main_Message[type] = function (options) {
|
|
476
|
-
if (Object(
|
|
1117
|
+
if (Object(types["d" /* isObject */])(options) && !Object(vdom["a" /* isVNode */])(options)) {
|
|
477
1118
|
return main_Message(_extends({}, options, {
|
|
478
1119
|
type: type
|
|
479
1120
|
}));
|
|
@@ -518,6 +1159,443 @@ main_Message.closeAll = function () {
|
|
|
518
1159
|
|
|
519
1160
|
/* harmony default export */ var message = __webpack_exports__["default"] = (src_main);
|
|
520
1161
|
|
|
1162
|
+
/***/ }),
|
|
1163
|
+
|
|
1164
|
+
/***/ 9:
|
|
1165
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1166
|
+
|
|
1167
|
+
"use strict";
|
|
1168
|
+
|
|
1169
|
+
// EXPORTS
|
|
1170
|
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
|
|
1171
|
+
|
|
1172
|
+
// EXTERNAL MODULE: external "vue"
|
|
1173
|
+
var external_vue_ = __webpack_require__(0);
|
|
1174
|
+
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
|
|
1175
|
+
|
|
1176
|
+
// EXTERNAL MODULE: ./src/utils/merge.js
|
|
1177
|
+
var merge = __webpack_require__(7);
|
|
1178
|
+
|
|
1179
|
+
// EXTERNAL MODULE: ./src/utils/dom.js
|
|
1180
|
+
var utils_dom = __webpack_require__(1);
|
|
1181
|
+
|
|
1182
|
+
// CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
var hasModal = false;
|
|
1187
|
+
var hasInitZIndex = false;
|
|
1188
|
+
var popup_manager_zIndex = void 0;
|
|
1189
|
+
|
|
1190
|
+
var popup_manager_getModal = function getModal() {
|
|
1191
|
+
if (external_vue_default.a.prototype.$isServer) return;
|
|
1192
|
+
var modalDom = PopupManager.modalDom;
|
|
1193
|
+
if (modalDom) {
|
|
1194
|
+
hasModal = true;
|
|
1195
|
+
} else {
|
|
1196
|
+
hasModal = false;
|
|
1197
|
+
modalDom = document.createElement('div');
|
|
1198
|
+
PopupManager.modalDom = modalDom;
|
|
1199
|
+
|
|
1200
|
+
modalDom.addEventListener('touchmove', function (event) {
|
|
1201
|
+
event.preventDefault();
|
|
1202
|
+
event.stopPropagation();
|
|
1203
|
+
});
|
|
1204
|
+
|
|
1205
|
+
modalDom.addEventListener('click', function () {
|
|
1206
|
+
PopupManager.doOnModalClick && PopupManager.doOnModalClick();
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
return modalDom;
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
var instances = {};
|
|
1214
|
+
|
|
1215
|
+
var PopupManager = {
|
|
1216
|
+
modalFade: true,
|
|
1217
|
+
|
|
1218
|
+
getInstance: function getInstance(id) {
|
|
1219
|
+
return instances[id];
|
|
1220
|
+
},
|
|
1221
|
+
|
|
1222
|
+
register: function register(id, instance) {
|
|
1223
|
+
if (id && instance) {
|
|
1224
|
+
instances[id] = instance;
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
1227
|
+
|
|
1228
|
+
deregister: function deregister(id) {
|
|
1229
|
+
if (id) {
|
|
1230
|
+
instances[id] = null;
|
|
1231
|
+
delete instances[id];
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
|
|
1235
|
+
nextZIndex: function nextZIndex() {
|
|
1236
|
+
return PopupManager.zIndex++;
|
|
1237
|
+
},
|
|
1238
|
+
|
|
1239
|
+
modalStack: [],
|
|
1240
|
+
|
|
1241
|
+
doOnModalClick: function doOnModalClick() {
|
|
1242
|
+
var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
1243
|
+
if (!topItem) return;
|
|
1244
|
+
|
|
1245
|
+
var instance = PopupManager.getInstance(topItem.id);
|
|
1246
|
+
if (instance && instance.closeOnClickModal) {
|
|
1247
|
+
instance.close();
|
|
1248
|
+
}
|
|
1249
|
+
},
|
|
1250
|
+
|
|
1251
|
+
openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
|
|
1252
|
+
if (external_vue_default.a.prototype.$isServer) return;
|
|
1253
|
+
if (!id || zIndex === undefined) return;
|
|
1254
|
+
this.modalFade = modalFade;
|
|
1255
|
+
|
|
1256
|
+
var modalStack = this.modalStack;
|
|
1257
|
+
|
|
1258
|
+
for (var i = 0, j = modalStack.length; i < j; i++) {
|
|
1259
|
+
var item = modalStack[i];
|
|
1260
|
+
if (item.id === id) {
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
var modalDom = popup_manager_getModal();
|
|
1266
|
+
|
|
1267
|
+
Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
|
|
1268
|
+
if (this.modalFade && !hasModal) {
|
|
1269
|
+
Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
|
|
1270
|
+
}
|
|
1271
|
+
if (modalClass) {
|
|
1272
|
+
var classArr = modalClass.trim().split(/\s+/);
|
|
1273
|
+
classArr.forEach(function (item) {
|
|
1274
|
+
return Object(utils_dom["a" /* addClass */])(modalDom, item);
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
setTimeout(function () {
|
|
1278
|
+
Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
|
|
1279
|
+
}, 200);
|
|
1280
|
+
|
|
1281
|
+
if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
|
|
1282
|
+
dom.parentNode.appendChild(modalDom);
|
|
1283
|
+
} else {
|
|
1284
|
+
document.body.appendChild(modalDom);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
if (zIndex) {
|
|
1288
|
+
modalDom.style.zIndex = zIndex;
|
|
1289
|
+
}
|
|
1290
|
+
modalDom.tabIndex = 0;
|
|
1291
|
+
modalDom.style.display = '';
|
|
1292
|
+
|
|
1293
|
+
this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
|
|
1294
|
+
},
|
|
1295
|
+
|
|
1296
|
+
closeModal: function closeModal(id) {
|
|
1297
|
+
var modalStack = this.modalStack;
|
|
1298
|
+
var modalDom = popup_manager_getModal();
|
|
1299
|
+
|
|
1300
|
+
if (modalStack.length > 0) {
|
|
1301
|
+
var topItem = modalStack[modalStack.length - 1];
|
|
1302
|
+
if (topItem.id === id) {
|
|
1303
|
+
if (topItem.modalClass) {
|
|
1304
|
+
var classArr = topItem.modalClass.trim().split(/\s+/);
|
|
1305
|
+
classArr.forEach(function (item) {
|
|
1306
|
+
return Object(utils_dom["i" /* removeClass */])(modalDom, item);
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
modalStack.pop();
|
|
1311
|
+
if (modalStack.length > 0) {
|
|
1312
|
+
modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
|
|
1313
|
+
}
|
|
1314
|
+
} else {
|
|
1315
|
+
for (var i = modalStack.length - 1; i >= 0; i--) {
|
|
1316
|
+
if (modalStack[i].id === id) {
|
|
1317
|
+
modalStack.splice(i, 1);
|
|
1318
|
+
break;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
if (modalStack.length === 0) {
|
|
1325
|
+
if (this.modalFade) {
|
|
1326
|
+
Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
|
|
1327
|
+
}
|
|
1328
|
+
setTimeout(function () {
|
|
1329
|
+
if (modalStack.length === 0) {
|
|
1330
|
+
if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
|
|
1331
|
+
modalDom.style.display = 'none';
|
|
1332
|
+
PopupManager.modalDom = undefined;
|
|
1333
|
+
}
|
|
1334
|
+
Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
|
|
1335
|
+
}, 200);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
Object.defineProperty(PopupManager, 'zIndex', {
|
|
1341
|
+
configurable: true,
|
|
1342
|
+
get: function get() {
|
|
1343
|
+
if (!hasInitZIndex) {
|
|
1344
|
+
popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$ELEMENT || {}).zIndex || 2000;
|
|
1345
|
+
hasInitZIndex = true;
|
|
1346
|
+
}
|
|
1347
|
+
return popup_manager_zIndex;
|
|
1348
|
+
},
|
|
1349
|
+
set: function set(value) {
|
|
1350
|
+
popup_manager_zIndex = value;
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
|
|
1354
|
+
var popup_manager_getTopPopup = function getTopPopup() {
|
|
1355
|
+
if (external_vue_default.a.prototype.$isServer) return;
|
|
1356
|
+
if (PopupManager.modalStack.length > 0) {
|
|
1357
|
+
var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
1358
|
+
if (!topPopup) return;
|
|
1359
|
+
var instance = PopupManager.getInstance(topPopup.id);
|
|
1360
|
+
|
|
1361
|
+
return instance;
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
if (!external_vue_default.a.prototype.$isServer) {
|
|
1366
|
+
// handle `esc` key when the popup is shown
|
|
1367
|
+
window.addEventListener('keydown', function (event) {
|
|
1368
|
+
if (event.keyCode === 27) {
|
|
1369
|
+
var topPopup = popup_manager_getTopPopup();
|
|
1370
|
+
|
|
1371
|
+
if (topPopup && topPopup.closeOnPressEscape) {
|
|
1372
|
+
topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
/* harmony default export */ var popup_manager = (PopupManager);
|
|
1379
|
+
// EXTERNAL MODULE: ./src/utils/scrollbar-width.js
|
|
1380
|
+
var scrollbar_width = __webpack_require__(8);
|
|
1381
|
+
|
|
1382
|
+
// CONCATENATED MODULE: ./src/utils/popup/index.js
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
var idSeed = 1;
|
|
1390
|
+
|
|
1391
|
+
var scrollBarWidth = void 0;
|
|
1392
|
+
|
|
1393
|
+
/* harmony default export */ var popup = __webpack_exports__["b"] = ({
|
|
1394
|
+
props: {
|
|
1395
|
+
visible: {
|
|
1396
|
+
type: Boolean,
|
|
1397
|
+
default: false
|
|
1398
|
+
},
|
|
1399
|
+
openDelay: {},
|
|
1400
|
+
closeDelay: {},
|
|
1401
|
+
zIndex: {},
|
|
1402
|
+
modal: {
|
|
1403
|
+
type: Boolean,
|
|
1404
|
+
default: false
|
|
1405
|
+
},
|
|
1406
|
+
modalFade: {
|
|
1407
|
+
type: Boolean,
|
|
1408
|
+
default: true
|
|
1409
|
+
},
|
|
1410
|
+
modalClass: {},
|
|
1411
|
+
modalAppendToBody: {
|
|
1412
|
+
type: Boolean,
|
|
1413
|
+
default: false
|
|
1414
|
+
},
|
|
1415
|
+
lockScroll: {
|
|
1416
|
+
type: Boolean,
|
|
1417
|
+
default: true
|
|
1418
|
+
},
|
|
1419
|
+
closeOnPressEscape: {
|
|
1420
|
+
type: Boolean,
|
|
1421
|
+
default: false
|
|
1422
|
+
},
|
|
1423
|
+
closeOnClickModal: {
|
|
1424
|
+
type: Boolean,
|
|
1425
|
+
default: false
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
|
|
1429
|
+
beforeMount: function beforeMount() {
|
|
1430
|
+
this._popupId = 'popup-' + idSeed++;
|
|
1431
|
+
popup_manager.register(this._popupId, this);
|
|
1432
|
+
},
|
|
1433
|
+
beforeDestroy: function beforeDestroy() {
|
|
1434
|
+
popup_manager.deregister(this._popupId);
|
|
1435
|
+
popup_manager.closeModal(this._popupId);
|
|
1436
|
+
|
|
1437
|
+
this.restoreBodyStyle();
|
|
1438
|
+
},
|
|
1439
|
+
data: function data() {
|
|
1440
|
+
return {
|
|
1441
|
+
opened: false,
|
|
1442
|
+
bodyPaddingRight: null,
|
|
1443
|
+
computedBodyPaddingRight: 0,
|
|
1444
|
+
withoutHiddenClass: true,
|
|
1445
|
+
rendered: false
|
|
1446
|
+
};
|
|
1447
|
+
},
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
watch: {
|
|
1451
|
+
visible: function visible(val) {
|
|
1452
|
+
var _this = this;
|
|
1453
|
+
|
|
1454
|
+
if (val) {
|
|
1455
|
+
if (this._opening) return;
|
|
1456
|
+
if (!this.rendered) {
|
|
1457
|
+
this.rendered = true;
|
|
1458
|
+
external_vue_default.a.nextTick(function () {
|
|
1459
|
+
_this.open();
|
|
1460
|
+
});
|
|
1461
|
+
} else {
|
|
1462
|
+
this.open();
|
|
1463
|
+
}
|
|
1464
|
+
} else {
|
|
1465
|
+
this.close();
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1469
|
+
|
|
1470
|
+
methods: {
|
|
1471
|
+
open: function open(options) {
|
|
1472
|
+
var _this2 = this;
|
|
1473
|
+
|
|
1474
|
+
if (!this.rendered) {
|
|
1475
|
+
this.rendered = true;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
var props = Object(merge["a" /* default */])({}, this.$props || this, options);
|
|
1479
|
+
|
|
1480
|
+
if (this._closeTimer) {
|
|
1481
|
+
clearTimeout(this._closeTimer);
|
|
1482
|
+
this._closeTimer = null;
|
|
1483
|
+
}
|
|
1484
|
+
clearTimeout(this._openTimer);
|
|
1485
|
+
|
|
1486
|
+
var openDelay = Number(props.openDelay);
|
|
1487
|
+
if (openDelay > 0) {
|
|
1488
|
+
this._openTimer = setTimeout(function () {
|
|
1489
|
+
_this2._openTimer = null;
|
|
1490
|
+
_this2.doOpen(props);
|
|
1491
|
+
}, openDelay);
|
|
1492
|
+
} else {
|
|
1493
|
+
this.doOpen(props);
|
|
1494
|
+
}
|
|
1495
|
+
},
|
|
1496
|
+
doOpen: function doOpen(props) {
|
|
1497
|
+
if (this.$isServer) return;
|
|
1498
|
+
if (this.willOpen && !this.willOpen()) return;
|
|
1499
|
+
if (this.opened) return;
|
|
1500
|
+
|
|
1501
|
+
this._opening = true;
|
|
1502
|
+
|
|
1503
|
+
var dom = this.$el;
|
|
1504
|
+
|
|
1505
|
+
var modal = props.modal;
|
|
1506
|
+
|
|
1507
|
+
var zIndex = props.zIndex;
|
|
1508
|
+
if (zIndex) {
|
|
1509
|
+
popup_manager.zIndex = zIndex;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
if (modal) {
|
|
1513
|
+
if (this._closing) {
|
|
1514
|
+
popup_manager.closeModal(this._popupId);
|
|
1515
|
+
this._closing = false;
|
|
1516
|
+
}
|
|
1517
|
+
popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
|
|
1518
|
+
if (props.lockScroll) {
|
|
1519
|
+
this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'el-popup-parent--hidden');
|
|
1520
|
+
if (this.withoutHiddenClass) {
|
|
1521
|
+
this.bodyPaddingRight = document.body.style.paddingRight;
|
|
1522
|
+
this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
|
|
1523
|
+
}
|
|
1524
|
+
scrollBarWidth = Object(scrollbar_width["a" /* default */])();
|
|
1525
|
+
var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
|
|
1526
|
+
var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
|
|
1527
|
+
if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
|
|
1528
|
+
document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
|
|
1529
|
+
}
|
|
1530
|
+
Object(utils_dom["a" /* addClass */])(document.body, 'el-popup-parent--hidden');
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
if (getComputedStyle(dom).position === 'static') {
|
|
1535
|
+
dom.style.position = 'absolute';
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
dom.style.zIndex = popup_manager.nextZIndex();
|
|
1539
|
+
this.opened = true;
|
|
1540
|
+
|
|
1541
|
+
this.onOpen && this.onOpen();
|
|
1542
|
+
|
|
1543
|
+
this.doAfterOpen();
|
|
1544
|
+
},
|
|
1545
|
+
doAfterOpen: function doAfterOpen() {
|
|
1546
|
+
this._opening = false;
|
|
1547
|
+
},
|
|
1548
|
+
close: function close() {
|
|
1549
|
+
var _this3 = this;
|
|
1550
|
+
|
|
1551
|
+
if (this.willClose && !this.willClose()) return;
|
|
1552
|
+
|
|
1553
|
+
if (this._openTimer !== null) {
|
|
1554
|
+
clearTimeout(this._openTimer);
|
|
1555
|
+
this._openTimer = null;
|
|
1556
|
+
}
|
|
1557
|
+
clearTimeout(this._closeTimer);
|
|
1558
|
+
|
|
1559
|
+
var closeDelay = Number(this.closeDelay);
|
|
1560
|
+
|
|
1561
|
+
if (closeDelay > 0) {
|
|
1562
|
+
this._closeTimer = setTimeout(function () {
|
|
1563
|
+
_this3._closeTimer = null;
|
|
1564
|
+
_this3.doClose();
|
|
1565
|
+
}, closeDelay);
|
|
1566
|
+
} else {
|
|
1567
|
+
this.doClose();
|
|
1568
|
+
}
|
|
1569
|
+
},
|
|
1570
|
+
doClose: function doClose() {
|
|
1571
|
+
this._closing = true;
|
|
1572
|
+
|
|
1573
|
+
this.onClose && this.onClose();
|
|
1574
|
+
|
|
1575
|
+
if (this.lockScroll) {
|
|
1576
|
+
setTimeout(this.restoreBodyStyle, 200);
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
this.opened = false;
|
|
1580
|
+
|
|
1581
|
+
this.doAfterClose();
|
|
1582
|
+
},
|
|
1583
|
+
doAfterClose: function doAfterClose() {
|
|
1584
|
+
popup_manager.closeModal(this._popupId);
|
|
1585
|
+
this._closing = false;
|
|
1586
|
+
},
|
|
1587
|
+
restoreBodyStyle: function restoreBodyStyle() {
|
|
1588
|
+
if (this.modal && this.withoutHiddenClass) {
|
|
1589
|
+
document.body.style.paddingRight = this.bodyPaddingRight;
|
|
1590
|
+
Object(utils_dom["i" /* removeClass */])(document.body, 'el-popup-parent--hidden');
|
|
1591
|
+
}
|
|
1592
|
+
this.withoutHiddenClass = true;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
|
|
521
1599
|
/***/ })
|
|
522
1600
|
|
|
523
1601
|
/******/ });
|