@mdsfe/mds-ui 0.2.0 → 0.2.9-rc.1
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/CHANGELOG.md +178 -0
- package/README.md +9 -9
- package/dist/_mixin/popper.js +1 -0
- package/dist/_util/_popper/dom-helper.js +284 -0
- package/dist/_util/_popper/popper-mixin.js +35 -0
- package/dist/_util/_popper/popper.js +1267 -0
- package/dist/_util/_popper/popup/popup-main.js +224 -0
- package/dist/_util/_popper/popup/popup-manager.js +205 -0
- package/dist/_util/_popper/vue-popper.js +204 -0
- package/dist/_util/popup/index.js +1 -1
- package/dist/_util/tree/node.js +2 -0
- package/dist/_util/tree/tree.js +65 -21
- package/dist/_util/util.js +29 -1
- package/dist/affix.js +18 -18
- package/dist/anchor.js +18 -18
- package/dist/avatar.js +17 -17
- package/dist/backtop.js +19 -19
- package/dist/badge.js +21 -21
- package/dist/bordershadow.js +20 -9
- package/dist/breadcrumb.js +18 -18
- package/dist/button.js +21 -21
- package/dist/card.js +18 -18
- package/dist/carousel.js +76 -76
- package/dist/cascader.js +4980 -0
- package/dist/cascaderpanel.js +645 -603
- package/dist/checkbox.js +23 -23
- package/dist/col.js +14 -14
- package/dist/collapse.js +6 -6
- package/dist/color.js +6 -6
- package/dist/datepicker.js +2487 -266
- package/dist/divider.js +19 -19
- package/dist/drawer.js +787 -37
- package/dist/dropdown.js +150 -104
- package/dist/empty.js +19 -19
- package/dist/font/iconfont.28359fa.ttf +0 -0
- package/dist/font/iconfont.486e3d3.woff2 +0 -0
- package/dist/font/iconfont.675049e.woff +0 -0
- package/dist/font.js +6 -6
- package/dist/form.js +28 -26
- package/dist/icon.js +55 -47
- package/dist/index.js +1 -1
- package/dist/input.js +65 -49
- package/dist/inputnumber.js +59 -39
- package/dist/layout.js +25 -25
- package/dist/list.js +17 -17
- package/dist/loading.js +21 -8
- package/dist/mds-ui.min.css +3 -3
- package/dist/mds-ui.min.js +19183 -15407
- package/dist/menu.js +31 -31
- package/dist/message.js +773 -24
- package/dist/modal.js +1146 -307
- package/dist/notification.js +27 -27
- package/dist/pagination.js +78 -55
- package/dist/popconfirm.js +36 -36
- package/dist/popover.js +2778 -48
- package/dist/progress.js +107 -65
- package/dist/radio.js +56 -54
- package/dist/rate.js +67 -59
- package/dist/row.js +14 -14
- package/dist/select.js +847 -503
- package/dist/slider.js +25 -25
- package/dist/slottable.js +2663 -129
- package/dist/steps.js +18 -18
- package/dist/style/affix.css +224 -2
- package/dist/style/anchor.css +224 -2
- package/dist/style/avatar.css +224 -2
- package/dist/style/badge.css +224 -2
- package/dist/style/bordershadow.css +236 -59
- package/dist/style/breadcrumb.css +224 -2
- package/dist/style/button.css +234 -5
- package/dist/style/card.css +224 -2
- package/dist/style/carousel.css +224 -2
- package/dist/style/cascader.css +214 -0
- package/dist/style/cascaderpanel.css +13 -16
- package/dist/style/checkbox.css +230 -8
- package/dist/style/col.css +225 -3
- package/dist/style/collapse.css +224 -2
- package/dist/style/color.css +224 -2
- package/dist/style/datepicker.css +236 -2
- package/dist/style/divider.css +227 -2
- package/dist/style/drawer.css +224 -2
- package/dist/style/dropdown.css +234 -5
- package/dist/style/empty.css +224 -2
- package/dist/style/font.css +226 -4
- package/dist/style/form.css +224 -2
- package/dist/style/icon.css +226 -3
- package/dist/style/input.css +231 -5
- package/dist/style/inputnumber.css +224 -2
- package/dist/style/layout.css +224 -2
- package/dist/style/list.css +224 -2
- package/dist/style/loading.css +2527 -2
- package/dist/style/menu.css +340 -129
- package/dist/style/message.css +1 -4
- package/dist/style/modal.css +247 -25
- package/dist/style/notification.css +224 -2
- package/dist/style/pagination.css +236 -7
- package/dist/style/popconfirm.css +334 -180
- package/dist/style/popover.css +324 -177
- package/dist/style/progress.css +226 -3
- package/dist/style/radio.css +225 -3
- package/dist/style/rate.css +226 -3
- package/dist/style/row.css +225 -3
- package/dist/style/select.css +240 -12
- package/dist/style/slider.css +224 -2
- package/dist/style/slottable.css +350 -149
- package/dist/style/steps.css +224 -2
- package/dist/style/switch.css +224 -2
- package/dist/style/table.css +458 -314
- package/dist/style/tabs.css +225 -18
- package/dist/style/tag.css +224 -2
- package/dist/style/text.css +224 -2
- package/dist/style/timeline.css +224 -2
- package/dist/style/timepicker.css +231 -6
- package/dist/style/tooltip.css +340 -129
- package/dist/style/tree.css +228 -6
- package/dist/style/typography.css +224 -2
- package/dist/style/upload.css +224 -2
- package/dist/switch.js +20 -20
- package/dist/table.js +3071 -201
- package/dist/tabs.js +24 -22
- package/dist/tag.js +17 -23
- package/dist/text.js +38 -22
- package/dist/timeline.js +14 -14
- package/dist/timepicker.js +3063 -172
- package/dist/tooltip.js +2550 -27
- package/dist/transfer.js +28 -28
- package/dist/transition.js +6 -6
- package/dist/tree.js +316 -171
- package/dist/typography.js +6 -6
- package/dist/upload.js +46 -38
- package/package.json +9 -5
package/dist/datepicker.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(require("
|
|
3
|
+
module.exports = factory(require("vue"), require("./_util/dateUtil"), require("./_util/proptype"), require("./icon"), require("./_mixin/emitter"), require("./button"), require("./input"), require("./_util/util"), require("./_mixin/locale"), require("./_util/clickoutside"), require("./_util/merge"), require("./_util/repeatClick"), require("./_util/dom"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["./_util/dateUtil", "./_util/proptype", "./icon", "
|
|
5
|
+
define(["vue", "./_util/dateUtil", "./_util/proptype", "./icon", "./_mixin/emitter", "./button", "./input", "./_util/util", "./_mixin/locale", "./_util/clickoutside", "./_util/merge", "./_util/repeatClick", "./_util/dom"], factory);
|
|
6
6
|
else {
|
|
7
|
-
var a = typeof exports === 'object' ? factory(require("
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("vue"), require("./_util/dateUtil"), require("./_util/proptype"), require("./icon"), require("./_mixin/emitter"), require("./button"), require("./input"), require("./_util/util"), require("./_mixin/locale"), require("./_util/clickoutside"), require("./_util/merge"), require("./_util/repeatClick"), require("./_util/dom")) : factory(root["Vue"], root["./_util/dateUtil"], root["./_util/proptype"], root["./icon"], root["./_mixin/emitter"], root["./button"], root["./input"], root["./_util/util"], root["./_mixin/locale"], root["./_util/clickoutside"], root["./_util/merge"], root["./_util/repeatClick"], root["./_util/dom"]);
|
|
8
8
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
9
|
}
|
|
10
|
-
})(window, function(__WEBPACK_EXTERNAL_MODULE__2__,
|
|
10
|
+
})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__8__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__16__, __WEBPACK_EXTERNAL_MODULE__20__, __WEBPACK_EXTERNAL_MODULE__25__, __WEBPACK_EXTERNAL_MODULE__33__, __WEBPACK_EXTERNAL_MODULE__49__, __WEBPACK_EXTERNAL_MODULE__66__, __WEBPACK_EXTERNAL_MODULE__67__) {
|
|
11
11
|
return /******/ (function(modules) { // webpackBootstrap
|
|
12
12
|
/******/ // The module cache
|
|
13
13
|
/******/ var installedModules = {};
|
|
@@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
91
91
|
/******/
|
|
92
92
|
/******/
|
|
93
93
|
/******/ // Load entry module and return exports
|
|
94
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = 87);
|
|
95
95
|
/******/ })
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
@@ -203,213 +203,2270 @@ function normalizeComponent (
|
|
|
203
203
|
|
|
204
204
|
/***/ }),
|
|
205
205
|
|
|
206
|
-
/***/
|
|
207
|
-
/***/ (function(module,
|
|
206
|
+
/***/ 1:
|
|
207
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
"use strict";
|
|
210
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
|
|
211
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
|
|
212
|
+
/* unused harmony export once */
|
|
213
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
|
|
214
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
|
|
215
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return removeClass; });
|
|
216
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
|
|
217
|
+
/* unused harmony export setStyle */
|
|
218
|
+
/* unused harmony export isScroll */
|
|
219
|
+
/* unused harmony export getScrollContainer */
|
|
220
|
+
/* unused harmony export isInContainer */
|
|
221
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return merge; });
|
|
222
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollBarWidth; });
|
|
223
|
+
/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
|
224
|
+
/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
|
225
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
|
226
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
|
|
210
227
|
|
|
211
|
-
/***/ }),
|
|
212
228
|
|
|
213
|
-
/***/ 11:
|
|
214
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
215
229
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
|
|
222
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
|
|
223
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return coerceTruthyValueToArray; });
|
|
224
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isIE; });
|
|
225
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isEdge; });
|
|
226
|
-
/* unused harmony export isFirefox */
|
|
227
|
-
/* unused harmony export assert */
|
|
228
|
-
/* unused harmony export escapeRegexpString */
|
|
229
|
-
/* unused harmony export getOffsetWidth */
|
|
230
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isFunction; });
|
|
231
|
-
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
|
232
|
-
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
230
|
+
/* eslint-disable */
|
|
231
|
+
var isServer = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer;
|
|
232
|
+
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
|
233
|
+
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
234
|
+
var ieVersion = isServer ? 0 : Number(document.documentMode);
|
|
233
235
|
|
|
234
|
-
|
|
236
|
+
/* istanbul ignore next */
|
|
237
|
+
var trim = function trim(string) {
|
|
238
|
+
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
|
239
|
+
};
|
|
240
|
+
/* istanbul ignore next */
|
|
241
|
+
var camelCase = function camelCase(name) {
|
|
242
|
+
return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
|
243
|
+
return offset ? letter.toUpperCase() : letter;
|
|
244
|
+
}).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
|
245
|
+
};
|
|
235
246
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
+
/* istanbul ignore next */
|
|
248
|
+
var on = function () {
|
|
249
|
+
if (!isServer && document.addEventListener) {
|
|
250
|
+
return function (element, event, handler) {
|
|
251
|
+
if (element && event && handler) {
|
|
252
|
+
element.addEventListener(event, handler, false);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
} else {
|
|
256
|
+
return function (element, event, handler) {
|
|
257
|
+
if (element && event && handler) {
|
|
258
|
+
element.attachEvent('on' + event, handler);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
247
261
|
}
|
|
248
|
-
|
|
249
|
-
};
|
|
262
|
+
}();
|
|
250
263
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
/* istanbul ignore next */
|
|
265
|
+
var off = function () {
|
|
266
|
+
if (!isServer && document.removeEventListener) {
|
|
267
|
+
return function (element, event, handler) {
|
|
268
|
+
if (element && event) {
|
|
269
|
+
element.removeEventListener(event, handler, false);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
} else {
|
|
273
|
+
return function (element, event, handler) {
|
|
274
|
+
if (element && event) {
|
|
275
|
+
element.detachEvent('on' + event, handler);
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
}();
|
|
280
|
+
|
|
281
|
+
/* istanbul ignore next */
|
|
282
|
+
var once = function once(el, event, fn) {
|
|
283
|
+
var listener = function listener() {
|
|
284
|
+
if (fn) {
|
|
285
|
+
fn.apply(this, arguments);
|
|
286
|
+
}
|
|
287
|
+
off(el, event, listener);
|
|
266
288
|
};
|
|
289
|
+
on(el, event, listener);
|
|
267
290
|
};
|
|
268
291
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
*/
|
|
283
|
-
function
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
292
|
+
/* istanbul ignore next */
|
|
293
|
+
function hasClass(el, cls) {
|
|
294
|
+
if (!el || !cls) return false;
|
|
295
|
+
if (cls.indexOf(' ') !== -1) {
|
|
296
|
+
throw new Error('className should not contain space.');
|
|
297
|
+
}
|
|
298
|
+
if (el.classList) {
|
|
299
|
+
return el.classList.contains(cls);
|
|
300
|
+
} else {
|
|
301
|
+
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* istanbul ignore next */
|
|
306
|
+
function addClass(el, cls) {
|
|
307
|
+
if (!el) return;
|
|
308
|
+
var curClass = el.className;
|
|
309
|
+
var classes = (cls || '').split(' ');
|
|
310
|
+
|
|
311
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
312
|
+
var clsName = classes[i];
|
|
313
|
+
if (!clsName) continue;
|
|
314
|
+
|
|
315
|
+
if (el.classList) {
|
|
316
|
+
el.classList.add(clsName);
|
|
317
|
+
} else if (!hasClass(el, clsName)) {
|
|
318
|
+
curClass += ' ' + clsName;
|
|
293
319
|
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
320
|
+
}
|
|
321
|
+
if (!el.classList) {
|
|
322
|
+
el.setAttribute('class', curClass);
|
|
323
|
+
}
|
|
297
324
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
var
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
325
|
+
|
|
326
|
+
/* istanbul ignore next */
|
|
327
|
+
function removeClass(el, cls) {
|
|
328
|
+
if (!el || !cls) return;
|
|
329
|
+
var classes = cls.split(' ');
|
|
330
|
+
var curClass = ' ' + el.className + ' ';
|
|
331
|
+
|
|
332
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
333
|
+
var clsName = classes[i];
|
|
334
|
+
if (!clsName) continue;
|
|
335
|
+
|
|
336
|
+
if (el.classList) {
|
|
337
|
+
el.classList.remove(clsName);
|
|
338
|
+
} else if (hasClass(el, clsName)) {
|
|
339
|
+
curClass = curClass.replace(' ' + clsName + ' ', ' ');
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (!el.classList) {
|
|
343
|
+
el.setAttribute('class', trim(curClass));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* istanbul ignore next */
|
|
348
|
+
var getStyle = ieVersion < 9 ? function (element, styleName) {
|
|
349
|
+
if (isServer) return;
|
|
350
|
+
if (!element || !styleName) return null;
|
|
351
|
+
styleName = camelCase(styleName);
|
|
352
|
+
if (styleName === 'float') {
|
|
353
|
+
styleName = 'styleFloat';
|
|
354
|
+
}
|
|
355
|
+
try {
|
|
356
|
+
switch (styleName) {
|
|
357
|
+
case 'opacity':
|
|
358
|
+
try {
|
|
359
|
+
return element.filters.item('alpha').opacity / 100;
|
|
360
|
+
} catch (e) {
|
|
361
|
+
return 1.0;
|
|
362
|
+
}
|
|
363
|
+
default:
|
|
364
|
+
return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
|
365
|
+
}
|
|
366
|
+
} catch (e) {
|
|
367
|
+
return element.style[styleName];
|
|
368
|
+
}
|
|
369
|
+
} : function (element, styleName) {
|
|
370
|
+
if (isServer) return;
|
|
371
|
+
if (!element || !styleName) return null;
|
|
372
|
+
styleName = camelCase(styleName);
|
|
373
|
+
if (styleName === 'float') {
|
|
374
|
+
styleName = 'cssFloat';
|
|
375
|
+
}
|
|
376
|
+
try {
|
|
377
|
+
var computed = document.defaultView.getComputedStyle(element, '');
|
|
378
|
+
return element.style[styleName] || computed ? computed[styleName] : null;
|
|
379
|
+
} catch (e) {
|
|
380
|
+
return element.style[styleName];
|
|
313
381
|
}
|
|
314
|
-
return true;
|
|
315
382
|
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
383
|
+
|
|
384
|
+
/* istanbul ignore next */
|
|
385
|
+
function setStyle(element, styleName, value) {
|
|
386
|
+
if (!element || !styleName) return;
|
|
387
|
+
|
|
388
|
+
if ((typeof styleName === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(styleName)) === 'object') {
|
|
389
|
+
for (var prop in styleName) {
|
|
390
|
+
if (styleName.hasOwnProperty(prop)) {
|
|
391
|
+
setStyle(element, prop, styleName[prop]);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
styleName = camelCase(styleName);
|
|
396
|
+
if (styleName === 'opacity' && ieVersion < 9) {
|
|
397
|
+
element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
|
|
398
|
+
} else {
|
|
399
|
+
element.style[styleName] = value;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
var isScroll = function isScroll(el, vertical) {
|
|
405
|
+
if (isServer) return;
|
|
406
|
+
|
|
407
|
+
var determinedDirection = vertical !== null && vertical !== undefined;
|
|
408
|
+
var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
|
|
409
|
+
|
|
410
|
+
return overflow.match(/(scroll|auto|overlay)/);
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
var getScrollContainer = function getScrollContainer(el, vertical) {
|
|
414
|
+
if (isServer) return;
|
|
415
|
+
|
|
416
|
+
var parent = el;
|
|
417
|
+
while (parent) {
|
|
418
|
+
if ([window, document, document.documentElement].includes(parent)) {
|
|
419
|
+
return window;
|
|
420
|
+
}
|
|
421
|
+
if (isScroll(parent, vertical)) {
|
|
422
|
+
return parent;
|
|
423
|
+
}
|
|
424
|
+
parent = parent.parentNode;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return parent;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
var isInContainer = function isInContainer(el, container) {
|
|
431
|
+
if (isServer || !el || !container) return false;
|
|
432
|
+
|
|
433
|
+
var elRect = el.getBoundingClientRect();
|
|
434
|
+
var containerRect = void 0;
|
|
435
|
+
|
|
436
|
+
if ([window, document, document.documentElement, null, undefined].includes(container)) {
|
|
437
|
+
containerRect = {
|
|
438
|
+
top: 0,
|
|
439
|
+
right: window.innerWidth,
|
|
440
|
+
bottom: window.innerHeight,
|
|
441
|
+
left: 0
|
|
442
|
+
};
|
|
443
|
+
} else {
|
|
444
|
+
containerRect = container.getBoundingClientRect();
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
function merge(target) {
|
|
451
|
+
for (var i = 1, j = arguments.length; i < j; i++) {
|
|
452
|
+
var source = arguments[i] || {};
|
|
453
|
+
for (var prop in source) {
|
|
454
|
+
if (source.hasOwnProperty(prop)) {
|
|
455
|
+
var value = source[prop];
|
|
456
|
+
if (value !== undefined) {
|
|
457
|
+
target[prop] = value;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return target;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
var scrollBarWidth = void 0;
|
|
467
|
+
function getScrollBarWidth() {
|
|
468
|
+
if (vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer) return 0;
|
|
469
|
+
if (scrollBarWidth !== undefined) return scrollBarWidth;
|
|
470
|
+
|
|
471
|
+
var outer = document.createElement('div');
|
|
472
|
+
outer.className = 'el-scrollbar__wrap';
|
|
473
|
+
outer.style.visibility = 'hidden';
|
|
474
|
+
outer.style.width = '100px';
|
|
475
|
+
outer.style.position = 'absolute';
|
|
476
|
+
outer.style.top = '-9999px';
|
|
477
|
+
document.body.appendChild(outer);
|
|
478
|
+
|
|
479
|
+
var widthNoScroll = outer.offsetWidth;
|
|
480
|
+
outer.style.overflow = 'scroll';
|
|
481
|
+
|
|
482
|
+
var inner = document.createElement('div');
|
|
483
|
+
inner.style.width = '100%';
|
|
484
|
+
outer.appendChild(inner);
|
|
485
|
+
|
|
486
|
+
var widthWithScroll = inner.offsetWidth;
|
|
487
|
+
outer.parentNode.removeChild(outer);
|
|
488
|
+
scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
489
|
+
|
|
490
|
+
return scrollBarWidth;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/***/ }),
|
|
494
|
+
|
|
495
|
+
/***/ 10:
|
|
496
|
+
/***/ (function(module, exports) {
|
|
497
|
+
|
|
498
|
+
module.exports = require("babel-runtime/core-js/object/keys");
|
|
499
|
+
|
|
500
|
+
/***/ }),
|
|
501
|
+
|
|
502
|
+
/***/ 12:
|
|
503
|
+
/***/ (function(module, exports) {
|
|
504
|
+
|
|
505
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
|
|
506
|
+
|
|
507
|
+
/***/ }),
|
|
508
|
+
|
|
509
|
+
/***/ 13:
|
|
510
|
+
/***/ (function(module, exports) {
|
|
511
|
+
|
|
512
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
|
|
513
|
+
|
|
514
|
+
/***/ }),
|
|
515
|
+
|
|
516
|
+
/***/ 139:
|
|
517
|
+
/***/ (function(module, exports) {
|
|
518
|
+
|
|
519
|
+
// removed by extract-text-webpack-plugin
|
|
520
|
+
|
|
521
|
+
/***/ }),
|
|
522
|
+
|
|
523
|
+
/***/ 14:
|
|
524
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
525
|
+
|
|
526
|
+
"use strict";
|
|
527
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
528
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
529
|
+
/* harmony import */ var _dom_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
530
|
+
/* harmony import */ var _popup_manager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
|
|
531
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _popup_manager__WEBPACK_IMPORTED_MODULE_2__["a"]; });
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
var idSeed = 1;
|
|
538
|
+
|
|
539
|
+
var scrollBarWidth = void 0;
|
|
540
|
+
|
|
541
|
+
/* harmony default export */ __webpack_exports__["b"] = ({
|
|
542
|
+
props: {
|
|
543
|
+
visibility: {
|
|
544
|
+
type: Boolean,
|
|
545
|
+
default: false
|
|
546
|
+
},
|
|
547
|
+
openDelay: {},
|
|
548
|
+
closeDelay: {},
|
|
549
|
+
zIndex: {},
|
|
550
|
+
modal: {
|
|
551
|
+
type: Boolean,
|
|
552
|
+
default: false
|
|
553
|
+
},
|
|
554
|
+
modalFade: {
|
|
555
|
+
type: Boolean,
|
|
556
|
+
default: true
|
|
557
|
+
},
|
|
558
|
+
modalClass: {},
|
|
559
|
+
modalAppendToBody: {
|
|
560
|
+
type: Boolean,
|
|
561
|
+
default: false
|
|
562
|
+
},
|
|
563
|
+
lockScroll: {
|
|
564
|
+
type: Boolean,
|
|
565
|
+
default: true
|
|
566
|
+
},
|
|
567
|
+
closeOnPressEscape: {
|
|
568
|
+
type: Boolean,
|
|
569
|
+
default: false
|
|
570
|
+
},
|
|
571
|
+
closeOnClickModal: {
|
|
572
|
+
type: Boolean,
|
|
573
|
+
default: false
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
|
|
577
|
+
beforeMount: function beforeMount() {
|
|
578
|
+
this._popupId = 'popup-' + idSeed++;
|
|
579
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].register(this._popupId, this);
|
|
580
|
+
},
|
|
581
|
+
beforeDestroy: function beforeDestroy() {
|
|
582
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].deregister(this._popupId);
|
|
583
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].closeModal(this._popupId);
|
|
584
|
+
|
|
585
|
+
this.restoreBodyStyle();
|
|
586
|
+
},
|
|
587
|
+
data: function data() {
|
|
588
|
+
return {
|
|
589
|
+
opened: false,
|
|
590
|
+
bodyPaddingRight: null,
|
|
591
|
+
computedBodyPaddingRight: 0,
|
|
592
|
+
withoutHiddenClass: true,
|
|
593
|
+
rendered: false
|
|
594
|
+
};
|
|
595
|
+
},
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
watch: {
|
|
599
|
+
visibility: function visibility(val) {
|
|
600
|
+
var _this = this;
|
|
601
|
+
|
|
602
|
+
if (val) {
|
|
603
|
+
if (this._opening) return;
|
|
604
|
+
if (!this.rendered) {
|
|
605
|
+
this.rendered = true;
|
|
606
|
+
vue__WEBPACK_IMPORTED_MODULE_0___default.a.nextTick(function () {
|
|
607
|
+
_this.open();
|
|
608
|
+
});
|
|
609
|
+
} else {
|
|
610
|
+
this.open();
|
|
611
|
+
}
|
|
612
|
+
} else {
|
|
613
|
+
this.close();
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
|
|
618
|
+
methods: {
|
|
619
|
+
open: function open(options) {
|
|
620
|
+
var _this2 = this;
|
|
621
|
+
|
|
622
|
+
if (!this.rendered) {
|
|
623
|
+
this.rendered = true;
|
|
624
|
+
}
|
|
625
|
+
var props = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* merge */ "e"])({}, this.$props || this, options);
|
|
626
|
+
|
|
627
|
+
if (this._closeTimer) {
|
|
628
|
+
clearTimeout(this._closeTimer);
|
|
629
|
+
this._closeTimer = null;
|
|
630
|
+
}
|
|
631
|
+
clearTimeout(this._openTimer);
|
|
632
|
+
|
|
633
|
+
var openDelay = Number(props.openDelay);
|
|
634
|
+
if (openDelay > 0) {
|
|
635
|
+
this._openTimer = setTimeout(function () {
|
|
636
|
+
_this2._openTimer = null;
|
|
637
|
+
_this2.doOpen(props);
|
|
638
|
+
}, openDelay);
|
|
639
|
+
} else {
|
|
640
|
+
this.doOpen(props);
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
doOpen: function doOpen(props) {
|
|
644
|
+
if (this.$isServer) return;
|
|
645
|
+
if (this.willOpen && !this.willOpen()) return;
|
|
646
|
+
if (this.opened) return;
|
|
647
|
+
|
|
648
|
+
this._opening = true;
|
|
649
|
+
|
|
650
|
+
var dom = this.$el;
|
|
651
|
+
|
|
652
|
+
var modal = props.modal;
|
|
653
|
+
|
|
654
|
+
var zIndex = props.zIndex;
|
|
655
|
+
if (zIndex) {
|
|
656
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].zIndex = zIndex;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (modal) {
|
|
660
|
+
if (this._closing) {
|
|
661
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].closeModal(this._popupId);
|
|
662
|
+
this._closing = false;
|
|
663
|
+
}
|
|
664
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].openModal(this._popupId, _popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
|
|
665
|
+
if (props.lockScroll) {
|
|
666
|
+
this.withoutHiddenClass = !Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* hasClass */ "d"])(document.body, 'mds-popup-parent--hidden');
|
|
667
|
+
if (this.withoutHiddenClass) {
|
|
668
|
+
this.bodyPaddingRight = document.body.style.paddingRight;
|
|
669
|
+
this.computedBodyPaddingRight = parseInt(Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* getStyle */ "c"])(document.body, 'paddingRight'), 10);
|
|
670
|
+
}
|
|
671
|
+
scrollBarWidth = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* getScrollBarWidth */ "b"])();
|
|
672
|
+
var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
|
|
673
|
+
var bodyOverflowY = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* getStyle */ "c"])(document.body, 'overflowY');
|
|
674
|
+
if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
|
|
675
|
+
document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
|
|
676
|
+
}
|
|
677
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(document.body, 'mds-popup-parent--hidden');
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
if (getComputedStyle(dom).position === 'static') {
|
|
682
|
+
dom.style.position = 'absolute';
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
dom.style.zIndex = _popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].nextZIndex();
|
|
686
|
+
this.opened = true;
|
|
687
|
+
|
|
688
|
+
this.onOpen && this.onOpen();
|
|
689
|
+
|
|
690
|
+
this.doAfterOpen();
|
|
691
|
+
},
|
|
692
|
+
doAfterOpen: function doAfterOpen() {
|
|
693
|
+
this._opening = false;
|
|
694
|
+
},
|
|
695
|
+
close: function close() {
|
|
696
|
+
var _this3 = this;
|
|
697
|
+
|
|
698
|
+
if (this.willClose && !this.willClose()) return;
|
|
699
|
+
|
|
700
|
+
if (this._openTimer !== null) {
|
|
701
|
+
clearTimeout(this._openTimer);
|
|
702
|
+
this._openTimer = null;
|
|
703
|
+
}
|
|
704
|
+
clearTimeout(this._closeTimer);
|
|
705
|
+
|
|
706
|
+
var closeDelay = Number(this.closeDelay);
|
|
707
|
+
|
|
708
|
+
if (closeDelay > 0) {
|
|
709
|
+
this._closeTimer = setTimeout(function () {
|
|
710
|
+
_this3._closeTimer = null;
|
|
711
|
+
_this3.doClose();
|
|
712
|
+
}, closeDelay);
|
|
713
|
+
} else {
|
|
714
|
+
this.doClose();
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
doClose: function doClose() {
|
|
718
|
+
this._closing = true;
|
|
719
|
+
|
|
720
|
+
this.onClose && this.onClose();
|
|
721
|
+
|
|
722
|
+
if (this.lockScroll) {
|
|
723
|
+
setTimeout(this.restoreBodyStyle, 200);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
this.opened = false;
|
|
727
|
+
|
|
728
|
+
this.doAfterClose();
|
|
729
|
+
},
|
|
730
|
+
doAfterClose: function doAfterClose() {
|
|
731
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].closeModal(this._popupId);
|
|
732
|
+
this._closing = false;
|
|
733
|
+
},
|
|
734
|
+
restoreBodyStyle: function restoreBodyStyle() {
|
|
735
|
+
if (this.modal && this.withoutHiddenClass) {
|
|
736
|
+
document.body.style.paddingRight = this.bodyPaddingRight;
|
|
737
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(document.body, 'mds-popup-parent--hidden');
|
|
738
|
+
}
|
|
739
|
+
this.withoutHiddenClass = true;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
/***/ }),
|
|
747
|
+
|
|
748
|
+
/***/ 15:
|
|
749
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
750
|
+
|
|
751
|
+
"use strict";
|
|
752
|
+
/* unused harmony export noop */
|
|
753
|
+
/* unused harmony export getOffsetLeft */
|
|
754
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getValueByPath; });
|
|
755
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return valueEquals; });
|
|
756
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
|
|
757
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
|
|
758
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return coerceTruthyValueToArray; });
|
|
759
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isIE; });
|
|
760
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isEdge; });
|
|
761
|
+
/* unused harmony export isFirefox */
|
|
762
|
+
/* unused harmony export assert */
|
|
763
|
+
/* unused harmony export escapeRegexpString */
|
|
764
|
+
/* unused harmony export getOffsetWidth */
|
|
765
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isFunction; });
|
|
766
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return fixBodyScroll; });
|
|
767
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
768
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
// import { getScrollBarWidth } from './_popper/dom-helper'
|
|
772
|
+
var currentBodyOverflow = '';
|
|
773
|
+
// let currentBodyPaddingRight = ''
|
|
774
|
+
var noop = function noop() {};
|
|
775
|
+
|
|
776
|
+
var getScroll = function getScroll(w, top) {
|
|
777
|
+
var ret = top ? w.pageYOffset : w.pageXOffset;
|
|
778
|
+
var method = top ? 'scrollTop' : 'scrollLeft';
|
|
779
|
+
if (typeof ret !== 'number') {
|
|
780
|
+
var d = w.document;
|
|
781
|
+
// ie6,7,8 standard mode
|
|
782
|
+
ret = d.documentElement[method];
|
|
783
|
+
if (typeof ret !== 'number') {
|
|
784
|
+
// quirks mode
|
|
785
|
+
ret = d.body[method];
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
return ret;
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
var getClientPosition = function getClientPosition(elem) {
|
|
792
|
+
var box = void 0;
|
|
793
|
+
var x = void 0;
|
|
794
|
+
var y = void 0;
|
|
795
|
+
var doc = elem.ownerDocument;
|
|
796
|
+
var body = doc.body;
|
|
797
|
+
var docElem = doc && doc.documentElement;
|
|
798
|
+
box = elem.getBoundingClientRect();
|
|
799
|
+
x = box.left;
|
|
800
|
+
y = box.top;
|
|
801
|
+
x -= docElem.clientLeft || body.clientLeft || 0;
|
|
802
|
+
y -= docElem.clientTop || body.clientTop || 0;
|
|
803
|
+
return {
|
|
804
|
+
left: x,
|
|
805
|
+
top: y
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
var getOffsetLeft = function getOffsetLeft(el) {
|
|
810
|
+
var pos = getClientPosition(el);
|
|
811
|
+
var doc = el.ownerDocument;
|
|
812
|
+
var w = doc.defaultView || doc.parentWindow;
|
|
813
|
+
pos.left += getScroll(w);
|
|
814
|
+
return pos.left;
|
|
815
|
+
};
|
|
816
|
+
/**
|
|
817
|
+
* 获取对象深层级的对象,避免循环
|
|
818
|
+
* @export
|
|
819
|
+
* @param {*} sourceObj 源对象 {a:{b:{d:1}}}
|
|
820
|
+
* @param {*} pathName path组成的数组 例如:'a.b.c'
|
|
821
|
+
* @param {*} defaultValue 如果没有值默认的值 []
|
|
822
|
+
*/
|
|
823
|
+
function getValueByPath(sourceObj, pathName, defaultValue) {
|
|
824
|
+
var getValue = function getValue(sourceObj, pathNameArray) {
|
|
825
|
+
var key = pathNameArray.shift();
|
|
826
|
+
var value = sourceObj[key];
|
|
827
|
+
if (value === undefined || value === null) {
|
|
828
|
+
return defaultValue;
|
|
829
|
+
} else if (pathNameArray.length === 0) {
|
|
830
|
+
return value;
|
|
831
|
+
} else if (pathNameArray.length > 0) {
|
|
832
|
+
return getValue(value, pathNameArray);
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
var pathNameArray = pathName.split('.');
|
|
836
|
+
return getValue(sourceObj, pathNameArray);
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
*
|
|
840
|
+
* 判断两个数是否相等
|
|
841
|
+
* @param {*} a
|
|
842
|
+
* @param {*} b
|
|
843
|
+
* @returns
|
|
844
|
+
*/
|
|
845
|
+
var valueEquals = function valueEquals(a, b) {
|
|
846
|
+
// see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
|
|
847
|
+
if (a === b) return true;
|
|
848
|
+
if (!(a instanceof Array)) return false;
|
|
849
|
+
if (!(b instanceof Array)) return false;
|
|
850
|
+
if (a.length !== b.length) return false;
|
|
851
|
+
for (var i = 0; i !== a.length; ++i) {
|
|
852
|
+
if (a[i] !== b[i]) return false;
|
|
853
|
+
}
|
|
854
|
+
return true;
|
|
855
|
+
};
|
|
856
|
+
// TODO: use native Array.find, Array.findIndex when IE support is dropped
|
|
857
|
+
var arrayFindIndex = function arrayFindIndex(arr, pred) {
|
|
858
|
+
for (var i = 0; i !== arr.length; ++i) {
|
|
859
|
+
if (pred(arr[i])) {
|
|
860
|
+
return i;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return -1;
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
var arrayFind = function arrayFind(arr, pred) {
|
|
867
|
+
var idx = arrayFindIndex(arr, pred);
|
|
868
|
+
return idx !== -1 ? arr[idx] : undefined;
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
// coerce truthy value to array
|
|
872
|
+
var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
|
|
873
|
+
if (Array.isArray(val)) {
|
|
874
|
+
return val;
|
|
875
|
+
} else if (val) {
|
|
876
|
+
return [val];
|
|
877
|
+
} else {
|
|
878
|
+
return [];
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
var isIE = function isIE() {
|
|
883
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
var isEdge = function isEdge() {
|
|
887
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
var isFirefox = function isFirefox() {
|
|
891
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
var assert = function assert(condition, msg) {
|
|
895
|
+
if (!condition) throw new Error('[mds-ui] ' + msg);
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
*
|
|
899
|
+
* 特殊字符转译
|
|
900
|
+
* @param {string} [value='']
|
|
901
|
+
*/
|
|
902
|
+
var escapeRegexpString = function escapeRegexpString() {
|
|
903
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
904
|
+
return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
|
|
905
|
+
};
|
|
906
|
+
/**
|
|
907
|
+
* Get element offset width
|
|
908
|
+
* @param {*} node HTMLDOMElemment
|
|
909
|
+
* @return {Number} width
|
|
910
|
+
*/
|
|
911
|
+
/**
|
|
912
|
+
* Get element offset width
|
|
913
|
+
* @param {*} node HTMLDOMElemment
|
|
914
|
+
* @return {Number} width
|
|
915
|
+
*/
|
|
916
|
+
var getOffsetWidth = function getOffsetWidth(node) {
|
|
917
|
+
return node ? node.offsetWidth : 0;
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
/** 判断是否为函数
|
|
921
|
+
* @param {*} functionToCheck
|
|
922
|
+
* @returns
|
|
923
|
+
*/
|
|
924
|
+
var isFunction = function isFunction(functionToCheck) {
|
|
925
|
+
var getType = {};
|
|
926
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* 弹窗类组件显现时修正body滚动
|
|
931
|
+
* @param {Boolean} visible 弹窗显现状态
|
|
932
|
+
*/
|
|
933
|
+
function fixBodyScroll(visible) {
|
|
934
|
+
var bodyStyle = document.body.style;
|
|
935
|
+
if (visible) {
|
|
936
|
+
currentBodyOverflow = bodyStyle.overflow;
|
|
937
|
+
// currentBodyPaddingRight = bodyStyle.paddingRight
|
|
938
|
+
bodyStyle.overflow = 'hidden';
|
|
939
|
+
// const basePaddingRight = parseInt(currentBodyPaddingRight || 0)
|
|
940
|
+
// const baseScrollWidth = parseInt(getScrollBarWidth())
|
|
941
|
+
// 防止页面抖动,后续需要自定义滚动条解决
|
|
942
|
+
// bodyStyle.paddingRight = basePaddingRight + baseScrollWidth + 'px'
|
|
943
|
+
} else {
|
|
944
|
+
var timer = setTimeout(function () {
|
|
945
|
+
clearTimeout(timer);
|
|
946
|
+
bodyStyle.overflow = currentBodyOverflow;
|
|
947
|
+
// bodyStyle.paddingRight = currentBodyPaddingRight
|
|
948
|
+
// currentBodyPaddingRight = ''
|
|
949
|
+
}, 180);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
/***/ }),
|
|
954
|
+
|
|
955
|
+
/***/ 16:
|
|
956
|
+
/***/ (function(module, exports) {
|
|
957
|
+
|
|
958
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__16__;
|
|
959
|
+
|
|
960
|
+
/***/ }),
|
|
961
|
+
|
|
962
|
+
/***/ 17:
|
|
963
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
964
|
+
|
|
965
|
+
"use strict";
|
|
966
|
+
|
|
967
|
+
// EXTERNAL MODULE: ./components/_util/_popper/popup/popup-main.js
|
|
968
|
+
var popup_main = __webpack_require__(14);
|
|
969
|
+
|
|
970
|
+
// EXTERNAL MODULE: external "babel-runtime/core-js/object/get-own-property-descriptor"
|
|
971
|
+
var get_own_property_descriptor_ = __webpack_require__(18);
|
|
972
|
+
var get_own_property_descriptor_default = /*#__PURE__*/__webpack_require__.n(get_own_property_descriptor_);
|
|
973
|
+
|
|
974
|
+
// EXTERNAL MODULE: external "babel-runtime/core-js/object/keys"
|
|
975
|
+
var keys_ = __webpack_require__(10);
|
|
976
|
+
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
977
|
+
|
|
978
|
+
// EXTERNAL MODULE: external "babel-runtime/core-js/object/assign"
|
|
979
|
+
var assign_ = __webpack_require__(6);
|
|
980
|
+
var assign_default = /*#__PURE__*/__webpack_require__.n(assign_);
|
|
981
|
+
|
|
982
|
+
// CONCATENATED MODULE: ./components/_util/_popper/popper.js
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
988
|
+
* @version {{version}}
|
|
989
|
+
* @license
|
|
990
|
+
* Copyright (c) 2016 Federico Zivolo and contributors
|
|
991
|
+
*
|
|
992
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
993
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
994
|
+
* in the Software without restriction, including without limitation the rights
|
|
995
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
996
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
997
|
+
* furnished to do so, subject to the following conditions:
|
|
998
|
+
*
|
|
999
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
1000
|
+
* copies or substantial portions of the Software.
|
|
1001
|
+
*
|
|
1002
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1003
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1004
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1005
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1006
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1007
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1008
|
+
* SOFTWARE.
|
|
1009
|
+
*/
|
|
1010
|
+
/* eslint-disable */
|
|
1011
|
+
// Cross module loader
|
|
1012
|
+
// Supported: Node, AMD, Browser globals
|
|
1013
|
+
//
|
|
1014
|
+
function popper_createPopper() {
|
|
1015
|
+
'use strict';
|
|
1016
|
+
|
|
1017
|
+
var root = window;
|
|
1018
|
+
|
|
1019
|
+
// default options
|
|
1020
|
+
var DEFAULTS = {
|
|
1021
|
+
// placement of the popper
|
|
1022
|
+
placement: 'bottom',
|
|
1023
|
+
|
|
1024
|
+
gpuAcceleration: false,
|
|
1025
|
+
|
|
1026
|
+
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
1027
|
+
offset: 0,
|
|
1028
|
+
|
|
1029
|
+
// the element which will act as boundary of the popper
|
|
1030
|
+
boundariesElement: 'viewport',
|
|
1031
|
+
|
|
1032
|
+
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
1033
|
+
boundariesPadding: 5,
|
|
1034
|
+
|
|
1035
|
+
// popper will try to prevent overflow following this order,
|
|
1036
|
+
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
1037
|
+
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
1038
|
+
|
|
1039
|
+
// the behavior used by flip to change the placement of the popper
|
|
1040
|
+
flipBehavior: 'flip',
|
|
1041
|
+
|
|
1042
|
+
arrowElement: '[x-arrow]',
|
|
1043
|
+
|
|
1044
|
+
arrowOffset: 0,
|
|
1045
|
+
|
|
1046
|
+
// list of functions used to modify the offsets before they are applied to the popper
|
|
1047
|
+
modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
|
|
1048
|
+
|
|
1049
|
+
modifiersIgnored: [],
|
|
1050
|
+
|
|
1051
|
+
forceAbsolute: false
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Create a new Popper.js instance
|
|
1055
|
+
* @constructor Popper
|
|
1056
|
+
* @param {HTMLElement} reference - The reference element used to position the popper
|
|
1057
|
+
* @param {HTMLElement|Object} popper
|
|
1058
|
+
* The HTML element used as popper, or a configuration used to generate the popper.
|
|
1059
|
+
* @param {String} [popper.tagName='div'] The tag name of the generated popper.
|
|
1060
|
+
* @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.
|
|
1061
|
+
* @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.
|
|
1062
|
+
* @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.
|
|
1063
|
+
* @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`.
|
|
1064
|
+
* @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.
|
|
1065
|
+
* @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.
|
|
1066
|
+
* @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.
|
|
1067
|
+
* @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.
|
|
1068
|
+
* @param {Object} options
|
|
1069
|
+
* @param {String} [options.placement=bottom]
|
|
1070
|
+
* Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),
|
|
1071
|
+
* left(-start, -end)`
|
|
1072
|
+
*
|
|
1073
|
+
* @param {HTMLElement|String} [options.arrowElement='[x-arrow]']
|
|
1074
|
+
* The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of
|
|
1075
|
+
* its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its
|
|
1076
|
+
* reference element.
|
|
1077
|
+
* By default, it will look for a child node of the popper with the `x-arrow` attribute.
|
|
1078
|
+
*
|
|
1079
|
+
* @param {Boolean} [options.gpuAcceleration=true]
|
|
1080
|
+
* When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the
|
|
1081
|
+
* browser to use the GPU to accelerate the rendering.
|
|
1082
|
+
* If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.
|
|
1083
|
+
*
|
|
1084
|
+
* @param {Number} [options.offset=0]
|
|
1085
|
+
* Amount of pixels the popper will be shifted (can be negative).
|
|
1086
|
+
*
|
|
1087
|
+
* @param {String|Element} [options.boundariesElement='viewport']
|
|
1088
|
+
* The element which will define the boundaries of the popper position, the popper will never be placed outside
|
|
1089
|
+
* of the defined boundaries (except if `keepTogether` is enabled)
|
|
1090
|
+
*
|
|
1091
|
+
* @param {Number} [options.boundariesPadding=5]
|
|
1092
|
+
* Additional padding for the boundaries
|
|
1093
|
+
*
|
|
1094
|
+
* @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]
|
|
1095
|
+
* Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,
|
|
1096
|
+
* this means that the last ones will never overflow
|
|
1097
|
+
*
|
|
1098
|
+
* @param {String|Array} [options.flipBehavior='flip']
|
|
1099
|
+
* The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to
|
|
1100
|
+
* overlap its reference element. Defining `flip` as value, the placement will be flipped on
|
|
1101
|
+
* its axis (`right - left`, `top - bottom`).
|
|
1102
|
+
* You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify
|
|
1103
|
+
* how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,
|
|
1104
|
+
* then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)
|
|
1105
|
+
*
|
|
1106
|
+
* @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]
|
|
1107
|
+
* List of functions used to modify the data before they are applied to the popper, add your custom functions
|
|
1108
|
+
* to this array to edit the offsets and placement.
|
|
1109
|
+
* The function should reflect the @params and @returns of preventOverflow
|
|
1110
|
+
*
|
|
1111
|
+
* @param {Array} [options.modifiersIgnored=[]]
|
|
1112
|
+
* Put here any built-in modifier name you want to exclude from the modifiers list
|
|
1113
|
+
* The function should reflect the @params and @returns of preventOverflow
|
|
1114
|
+
*
|
|
1115
|
+
* @param {Boolean} [options.removeOnDestroy=false]
|
|
1116
|
+
* Set to true if you want to automatically remove the popper when you call the `destroy` method.
|
|
1117
|
+
*/
|
|
1118
|
+
};function Popper(reference, popper, options) {
|
|
1119
|
+
this._reference = reference.jquery ? reference[0] : reference;
|
|
1120
|
+
this.state = {};
|
|
1121
|
+
|
|
1122
|
+
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
1123
|
+
// generate a default popper if is not defined
|
|
1124
|
+
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
1125
|
+
var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
|
|
1126
|
+
if (isNotDefined || isConfig) {
|
|
1127
|
+
this._popper = this.parse(isConfig ? popper : {});
|
|
1128
|
+
}
|
|
1129
|
+
// otherwise, use the given HTMLElement as popper
|
|
1130
|
+
else {
|
|
1131
|
+
this._popper = popper.jquery ? popper[0] : popper;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
// with {} we create a new object with the options inside it
|
|
1135
|
+
this._options = assign_default()({}, DEFAULTS, options);
|
|
1136
|
+
|
|
1137
|
+
// refactoring modifiers' list
|
|
1138
|
+
this._options.modifiers = this._options.modifiers.map(function (modifier) {
|
|
1139
|
+
// remove ignored modifiers
|
|
1140
|
+
if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
|
|
1141
|
+
|
|
1142
|
+
// set the x-placement attribute before everything else because it could be used to add margins to the popper
|
|
1143
|
+
// margins needs to be calculated to get the correct popper offsets
|
|
1144
|
+
if (modifier === 'applyStyle') {
|
|
1145
|
+
this._popper.setAttribute('x-placement', this._options.placement);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
// return predefined modifier identified by string or keep the custom one
|
|
1149
|
+
return this.modifiers[modifier] || modifier;
|
|
1150
|
+
}.bind(this));
|
|
1151
|
+
|
|
1152
|
+
// make sure to apply the popper position before any computation
|
|
1153
|
+
this.state.position = this._getPosition(this._popper, this._reference);
|
|
1154
|
+
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
1155
|
+
|
|
1156
|
+
// fire the first update to position the popper in the right place
|
|
1157
|
+
this.update();
|
|
1158
|
+
|
|
1159
|
+
// setup event listeners, they will take care of update the position in specific situations
|
|
1160
|
+
this._setupEventListeners();
|
|
1161
|
+
return this;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
//
|
|
1165
|
+
// Methods
|
|
1166
|
+
//
|
|
1167
|
+
/**
|
|
1168
|
+
* Destroy the popper
|
|
1169
|
+
* @method
|
|
1170
|
+
* @memberof Popper
|
|
1171
|
+
*/
|
|
1172
|
+
Popper.prototype.destroy = function () {
|
|
1173
|
+
this._popper.removeAttribute('x-placement');
|
|
1174
|
+
this._popper.style.left = '';
|
|
1175
|
+
this._popper.style.position = '';
|
|
1176
|
+
this._popper.style.top = '';
|
|
1177
|
+
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
1178
|
+
this._removeEventListeners();
|
|
1179
|
+
|
|
1180
|
+
// remove the popper if user explicity asked for the deletion on destroy
|
|
1181
|
+
if (this._options.removeOnDestroy) {
|
|
1182
|
+
this._popper.remove();
|
|
1183
|
+
}
|
|
1184
|
+
return this;
|
|
1185
|
+
};
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Updates the position of the popper, computing the new offsets and applying the new style
|
|
1189
|
+
* @method
|
|
1190
|
+
* @memberof Popper
|
|
1191
|
+
*/
|
|
1192
|
+
Popper.prototype.update = function () {
|
|
1193
|
+
var data = { instance: this, styles: {}
|
|
1194
|
+
|
|
1195
|
+
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
1196
|
+
// and refer to _originalPlacement to know the original value
|
|
1197
|
+
};data.placement = this._options.placement;
|
|
1198
|
+
data._originalPlacement = this._options.placement;
|
|
1199
|
+
|
|
1200
|
+
// compute the popper and reference offsets and put them inside data.offsets
|
|
1201
|
+
data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
|
|
1202
|
+
|
|
1203
|
+
// get boundaries
|
|
1204
|
+
data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
|
|
1205
|
+
|
|
1206
|
+
data = this.runModifiers(data, this._options.modifiers);
|
|
1207
|
+
|
|
1208
|
+
if (typeof this.state.updateCallback === 'function') {
|
|
1209
|
+
this.state.updateCallback(data);
|
|
1210
|
+
}
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
|
|
1215
|
+
* @method
|
|
1216
|
+
* @memberof Popper
|
|
1217
|
+
* @param {Function} callback
|
|
1218
|
+
*/
|
|
1219
|
+
Popper.prototype.onCreate = function (callback) {
|
|
1220
|
+
// the createCallbacks return as first argument the popper instance
|
|
1221
|
+
callback(this);
|
|
1222
|
+
return this;
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
|
|
1227
|
+
* used to style popper and its arrow.
|
|
1228
|
+
* NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!
|
|
1229
|
+
* @method
|
|
1230
|
+
* @memberof Popper
|
|
1231
|
+
* @param {Function} callback
|
|
1232
|
+
*/
|
|
1233
|
+
Popper.prototype.onUpdate = function (callback) {
|
|
1234
|
+
this.state.updateCallback = callback;
|
|
1235
|
+
return this;
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Helper used to generate poppers from a configuration file
|
|
1240
|
+
* @method
|
|
1241
|
+
* @memberof Popper
|
|
1242
|
+
* @param config {Object} configuration
|
|
1243
|
+
* @returns {HTMLElement} popper
|
|
1244
|
+
*/
|
|
1245
|
+
Popper.prototype.parse = function (config) {
|
|
1246
|
+
var defaultConfig = {
|
|
1247
|
+
tagName: 'div',
|
|
1248
|
+
classNames: ['popper'],
|
|
1249
|
+
attributes: [],
|
|
1250
|
+
parent: root.document.body,
|
|
1251
|
+
content: '',
|
|
1252
|
+
contentType: 'text',
|
|
1253
|
+
arrowTagName: 'div',
|
|
1254
|
+
arrowClassNames: ['popper__arrow'],
|
|
1255
|
+
arrowAttributes: ['x-arrow']
|
|
1256
|
+
};
|
|
1257
|
+
config = assign_default()({}, defaultConfig, config);
|
|
1258
|
+
|
|
1259
|
+
var d = root.document;
|
|
1260
|
+
|
|
1261
|
+
var popper = d.createElement(config.tagName);
|
|
1262
|
+
addClassNames(popper, config.classNames);
|
|
1263
|
+
addAttributes(popper, config.attributes);
|
|
1264
|
+
if (config.contentType === 'node') {
|
|
1265
|
+
popper.appendChild(config.content.jquery ? config.content[0] : config.content);
|
|
1266
|
+
} else if (config.contentType === 'html') {
|
|
1267
|
+
popper.innerHTML = config.content;
|
|
1268
|
+
} else {
|
|
1269
|
+
popper.textContent = config.content;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
if (config.arrowTagName) {
|
|
1273
|
+
var arrow = d.createElement(config.arrowTagName);
|
|
1274
|
+
addClassNames(arrow, config.arrowClassNames);
|
|
1275
|
+
addAttributes(arrow, config.arrowAttributes);
|
|
1276
|
+
popper.appendChild(arrow);
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
var parent = config.parent.jquery ? config.parent[0] : config.parent;
|
|
1280
|
+
|
|
1281
|
+
// if the given parent is a string, use it to match an element
|
|
1282
|
+
// if more than one element is matched, the first one will be used as parent
|
|
1283
|
+
// if no elements are matched, the script will throw an error
|
|
1284
|
+
if (typeof parent === 'string') {
|
|
1285
|
+
parent = d.querySelectorAll(config.parent);
|
|
1286
|
+
if (parent.length > 1) {
|
|
1287
|
+
console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
|
|
1288
|
+
}
|
|
1289
|
+
if (parent.length === 0) {
|
|
1290
|
+
throw "ERROR: the given `parent` doesn't exists!";
|
|
1291
|
+
}
|
|
1292
|
+
parent = parent[0];
|
|
1293
|
+
}
|
|
1294
|
+
// if the given parent is a DOM nodes list or an array of nodes with more than one element,
|
|
1295
|
+
// the first one will be used as parent
|
|
1296
|
+
if (parent.length > 1 && parent instanceof Element === false) {
|
|
1297
|
+
console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
|
|
1298
|
+
parent = parent[0];
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
// append the generated popper to its parent
|
|
1302
|
+
parent.appendChild(popper);
|
|
1303
|
+
|
|
1304
|
+
return popper;
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Adds class names to the given element
|
|
1308
|
+
* @function
|
|
1309
|
+
* @ignore
|
|
1310
|
+
* @param {HTMLElement} target
|
|
1311
|
+
* @param {Array} classes
|
|
1312
|
+
*/
|
|
1313
|
+
function addClassNames(element, classNames) {
|
|
1314
|
+
classNames.forEach(function (className) {
|
|
1315
|
+
element.classList.add(className);
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* Adds attributes to the given element
|
|
1321
|
+
* @function
|
|
1322
|
+
* @ignore
|
|
1323
|
+
* @param {HTMLElement} target
|
|
1324
|
+
* @param {Array} attributes
|
|
1325
|
+
* @example
|
|
1326
|
+
* addAttributes(element, [ 'data-info:foobar' ]);
|
|
1327
|
+
*/
|
|
1328
|
+
function addAttributes(element, attributes) {
|
|
1329
|
+
attributes.forEach(function (attribute) {
|
|
1330
|
+
element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
};
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Helper used to get the position which will be applied to the popper
|
|
1337
|
+
* @method
|
|
1338
|
+
* @memberof Popper
|
|
1339
|
+
* @param config {HTMLElement} popper element
|
|
1340
|
+
* @param reference {HTMLElement} reference element
|
|
1341
|
+
* @returns {String} position
|
|
1342
|
+
*/
|
|
1343
|
+
Popper.prototype._getPosition = function (popper, reference) {
|
|
1344
|
+
var container = getOffsetParent(reference);
|
|
1345
|
+
|
|
1346
|
+
if (this._options.forceAbsolute) {
|
|
1347
|
+
return 'absolute';
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
// Decide if the popper will be fixed
|
|
1351
|
+
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
1352
|
+
var isParentFixed = isFixed(reference, container);
|
|
1353
|
+
return isParentFixed ? 'fixed' : 'absolute';
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Get offsets to the popper
|
|
1358
|
+
* @method
|
|
1359
|
+
* @memberof Popper
|
|
1360
|
+
* @access private
|
|
1361
|
+
* @param {Element} popper - the popper element
|
|
1362
|
+
* @param {Element} reference - the reference element (the popper will be relative to this)
|
|
1363
|
+
* @returns {Object} An object containing the offsets which will be applied to the popper
|
|
1364
|
+
*/
|
|
1365
|
+
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
1366
|
+
placement = placement.split('-')[0];
|
|
1367
|
+
var popperOffsets = {};
|
|
1368
|
+
|
|
1369
|
+
popperOffsets.position = this.state.position;
|
|
1370
|
+
var isParentFixed = popperOffsets.position === 'fixed';
|
|
1371
|
+
|
|
1372
|
+
//
|
|
1373
|
+
// Get reference element position
|
|
1374
|
+
//
|
|
1375
|
+
var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
|
|
1376
|
+
|
|
1377
|
+
//
|
|
1378
|
+
// Get popper sizes
|
|
1379
|
+
//
|
|
1380
|
+
var popperRect = getOuterSizes(popper);
|
|
1381
|
+
|
|
1382
|
+
//
|
|
1383
|
+
// Compute offsets of popper
|
|
1384
|
+
//
|
|
1385
|
+
|
|
1386
|
+
// depending by the popper placement we have to compute its offsets slightly differently
|
|
1387
|
+
if (['right', 'left'].indexOf(placement) !== -1) {
|
|
1388
|
+
popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
|
|
1389
|
+
if (placement === 'left') {
|
|
1390
|
+
popperOffsets.left = referenceOffsets.left - popperRect.width;
|
|
1391
|
+
} else {
|
|
1392
|
+
popperOffsets.left = referenceOffsets.right;
|
|
1393
|
+
}
|
|
1394
|
+
} else {
|
|
1395
|
+
popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
|
|
1396
|
+
if (placement === 'top') {
|
|
1397
|
+
popperOffsets.top = referenceOffsets.top - popperRect.height;
|
|
1398
|
+
} else {
|
|
1399
|
+
popperOffsets.top = referenceOffsets.bottom;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
// Add width and height to our offsets object
|
|
1404
|
+
popperOffsets.width = popperRect.width;
|
|
1405
|
+
popperOffsets.height = popperRect.height;
|
|
1406
|
+
|
|
1407
|
+
return {
|
|
1408
|
+
popper: popperOffsets,
|
|
1409
|
+
reference: referenceOffsets
|
|
1410
|
+
};
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* Setup needed event listeners used to update the popper position
|
|
1415
|
+
* @method
|
|
1416
|
+
* @memberof Popper
|
|
1417
|
+
* @access private
|
|
1418
|
+
*/
|
|
1419
|
+
Popper.prototype._setupEventListeners = function () {
|
|
1420
|
+
// NOTE: 1 DOM access here
|
|
1421
|
+
this.state.updateBound = this.update.bind(this);
|
|
1422
|
+
root.addEventListener('resize', this.state.updateBound);
|
|
1423
|
+
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
1424
|
+
if (this._options.boundariesElement !== 'window') {
|
|
1425
|
+
var target = getScrollParent(this._reference);
|
|
1426
|
+
// here it could be both `body` or `documentElement` thanks to Firefox, we then check both
|
|
1427
|
+
if (target === root.document.body || target === root.document.documentElement) {
|
|
1428
|
+
target = root;
|
|
1429
|
+
}
|
|
1430
|
+
target.addEventListener('scroll', this.state.updateBound);
|
|
1431
|
+
this.state.scrollTarget = target;
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
/**
|
|
1436
|
+
* Remove event listeners used to update the popper position
|
|
1437
|
+
* @method
|
|
1438
|
+
* @memberof Popper
|
|
1439
|
+
* @access private
|
|
1440
|
+
*/
|
|
1441
|
+
Popper.prototype._removeEventListeners = function () {
|
|
1442
|
+
// NOTE: 1 DOM access here
|
|
1443
|
+
root.removeEventListener('resize', this.state.updateBound);
|
|
1444
|
+
if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
|
|
1445
|
+
this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);
|
|
1446
|
+
this.state.scrollTarget = null;
|
|
1447
|
+
}
|
|
1448
|
+
this.state.updateBound = null;
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Computed the boundaries limits and return them
|
|
1453
|
+
* @method
|
|
1454
|
+
* @memberof Popper
|
|
1455
|
+
* @access private
|
|
1456
|
+
* @param {Object} data - Object containing the property "offsets" generated by `_getOffsets`
|
|
1457
|
+
* @param {Number} padding - Boundaries padding
|
|
1458
|
+
* @param {Element} boundariesElement - Element used to define the boundaries
|
|
1459
|
+
* @returns {Object} Coordinates of the boundaries
|
|
1460
|
+
*/
|
|
1461
|
+
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
1462
|
+
// NOTE: 1 DOM access here
|
|
1463
|
+
var boundaries = {};
|
|
1464
|
+
var width, height;
|
|
1465
|
+
if (boundariesElement === 'window') {
|
|
1466
|
+
var body = root.document.body,
|
|
1467
|
+
html = root.document.documentElement;
|
|
1468
|
+
|
|
1469
|
+
height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
|
|
1470
|
+
width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
|
|
1471
|
+
|
|
1472
|
+
boundaries = {
|
|
1473
|
+
top: 0,
|
|
1474
|
+
right: width,
|
|
1475
|
+
bottom: height,
|
|
1476
|
+
left: 0
|
|
1477
|
+
};
|
|
1478
|
+
} else if (boundariesElement === 'viewport') {
|
|
1479
|
+
var offsetParent = getOffsetParent(this._popper);
|
|
1480
|
+
var scrollParent = getScrollParent(this._popper);
|
|
1481
|
+
var offsetParentRect = getOffsetRect(offsetParent);
|
|
1482
|
+
|
|
1483
|
+
// Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`
|
|
1484
|
+
var getScrollTopValue = function getScrollTopValue(element) {
|
|
1485
|
+
return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;
|
|
1486
|
+
};
|
|
1487
|
+
var getScrollLeftValue = function getScrollLeftValue(element) {
|
|
1488
|
+
return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;
|
|
1489
|
+
};
|
|
1490
|
+
|
|
1491
|
+
// if the popper is fixed we don't have to substract scrolling from the boundaries
|
|
1492
|
+
var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);
|
|
1493
|
+
var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);
|
|
1494
|
+
|
|
1495
|
+
boundaries = {
|
|
1496
|
+
top: 0 - (offsetParentRect.top - scrollTop),
|
|
1497
|
+
right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
|
|
1498
|
+
bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
|
|
1499
|
+
left: 0 - (offsetParentRect.left - scrollLeft)
|
|
1500
|
+
};
|
|
1501
|
+
} else {
|
|
1502
|
+
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
1503
|
+
boundaries = {
|
|
1504
|
+
top: 0,
|
|
1505
|
+
left: 0,
|
|
1506
|
+
right: boundariesElement.clientWidth,
|
|
1507
|
+
bottom: boundariesElement.clientHeight
|
|
1508
|
+
};
|
|
1509
|
+
} else {
|
|
1510
|
+
boundaries = getOffsetRect(boundariesElement);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
boundaries.left += padding;
|
|
1514
|
+
boundaries.right -= padding;
|
|
1515
|
+
boundaries.top = boundaries.top + padding;
|
|
1516
|
+
boundaries.bottom = boundaries.bottom - padding;
|
|
1517
|
+
return boundaries;
|
|
1518
|
+
};
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Loop trough the list of modifiers and run them in order, each of them will then edit the data object
|
|
1522
|
+
* @method
|
|
1523
|
+
* @memberof Popper
|
|
1524
|
+
* @access public
|
|
1525
|
+
* @param {Object} data
|
|
1526
|
+
* @param {Array} modifiers
|
|
1527
|
+
* @param {Function} ends
|
|
1528
|
+
*/
|
|
1529
|
+
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
1530
|
+
var modifiersToRun = modifiers.slice();
|
|
1531
|
+
if (ends !== undefined) {
|
|
1532
|
+
modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
modifiersToRun.forEach(function (modifier) {
|
|
1536
|
+
if (isFunction(modifier)) {
|
|
1537
|
+
data = modifier.call(this, data);
|
|
1538
|
+
}
|
|
1539
|
+
}.bind(this));
|
|
1540
|
+
|
|
1541
|
+
return data;
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1544
|
+
/**
|
|
1545
|
+
* Helper used to know if the given modifier depends from another one.
|
|
1546
|
+
* @method
|
|
1547
|
+
* @memberof Popper
|
|
1548
|
+
* @param {String} requesting - name of requesting modifier
|
|
1549
|
+
* @param {String} requested - name of requested modifier
|
|
1550
|
+
* @returns {Boolean}
|
|
1551
|
+
*/
|
|
1552
|
+
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
1553
|
+
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
1554
|
+
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
1555
|
+
return modifier === requested;
|
|
1556
|
+
}).length;
|
|
1557
|
+
};
|
|
1558
|
+
|
|
1559
|
+
//
|
|
1560
|
+
// Modifiers
|
|
1561
|
+
//
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* Modifiers list
|
|
1565
|
+
* @namespace Popper.modifiers
|
|
1566
|
+
* @memberof Popper
|
|
1567
|
+
* @type {Object}
|
|
1568
|
+
*/
|
|
1569
|
+
Popper.prototype.modifiers = {};
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* Apply the computed styles to the popper element
|
|
1573
|
+
* @method
|
|
1574
|
+
* @memberof Popper.modifiers
|
|
1575
|
+
* @argument {Object} data - The data object generated by `update` method
|
|
1576
|
+
* @returns {Object} The same data object
|
|
1577
|
+
*/
|
|
1578
|
+
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
1579
|
+
// apply the final offsets to the popper
|
|
1580
|
+
// NOTE: 1 DOM access here
|
|
1581
|
+
var styles = {
|
|
1582
|
+
position: data.offsets.popper.position
|
|
1583
|
+
|
|
1584
|
+
// round top and left to avoid blurry text
|
|
1585
|
+
};var left = Math.round(data.offsets.popper.left);
|
|
1586
|
+
var top = Math.round(data.offsets.popper.top);
|
|
1587
|
+
|
|
1588
|
+
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
1589
|
+
// we automatically use the supported prefixed version if needed
|
|
1590
|
+
var prefixedProperty;
|
|
1591
|
+
if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
|
|
1592
|
+
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
|
1593
|
+
styles.top = 0;
|
|
1594
|
+
styles.left = 0;
|
|
1595
|
+
}
|
|
1596
|
+
// othwerise, we use the standard `left` and `top` properties
|
|
1597
|
+
else {
|
|
1598
|
+
styles.left = left;
|
|
1599
|
+
styles.top = top;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
// any property present in `data.styles` will be applied to the popper,
|
|
1603
|
+
// in this way we can make the 3rd party modifiers add custom styles to it
|
|
1604
|
+
// Be aware, modifiers could override the properties defined in the previous
|
|
1605
|
+
// lines of this modifier!
|
|
1606
|
+
assign_default()(styles, data.styles);
|
|
1607
|
+
|
|
1608
|
+
setStyle(this._popper, styles);
|
|
1609
|
+
|
|
1610
|
+
// set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
|
|
1611
|
+
// NOTE: 1 DOM access here
|
|
1612
|
+
if (!this._popper._prevClass.includes('mds-date-picker')) {
|
|
1613
|
+
this._popper.setAttribute('x-placement', data.placement);
|
|
1614
|
+
var popper = this._popper;
|
|
1615
|
+
var instanceType = popper.classList[0];
|
|
1616
|
+
popper.classList.replace(popper.classList[1], instanceType + '-placement-' + data.placement);
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
// console.log(data.placement)
|
|
1620
|
+
|
|
1621
|
+
// if the arrow modifier is required and the arrow style has been computed, apply the arrow style
|
|
1622
|
+
if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
|
|
1623
|
+
setStyle(data.arrowElement, data.offsets.arrow);
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
return data;
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Modifier used to shift the popper on the start or end of its reference element side
|
|
1631
|
+
* @method
|
|
1632
|
+
* @memberof Popper.modifiers
|
|
1633
|
+
* @argument {Object} data - The data object generated by `update` method
|
|
1634
|
+
* @returns {Object} The data object, properly modified
|
|
1635
|
+
*/
|
|
1636
|
+
Popper.prototype.modifiers.shift = function (data) {
|
|
1637
|
+
var placement = data.placement;
|
|
1638
|
+
var basePlacement = placement.split('-')[0];
|
|
1639
|
+
var shiftVariation = placement.split('-')[1];
|
|
1640
|
+
|
|
1641
|
+
// if shift shiftVariation is specified, run the modifier
|
|
1642
|
+
if (shiftVariation) {
|
|
1643
|
+
var reference = data.offsets.reference;
|
|
1644
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1645
|
+
|
|
1646
|
+
var shiftOffsets = {
|
|
1647
|
+
y: {
|
|
1648
|
+
start: { top: reference.top },
|
|
1649
|
+
end: { top: reference.top + reference.height - popper.height }
|
|
1650
|
+
},
|
|
1651
|
+
x: {
|
|
1652
|
+
start: { left: reference.left },
|
|
1653
|
+
end: { left: reference.left + reference.width - popper.width }
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
1658
|
+
|
|
1659
|
+
data.offsets.popper = assign_default()(popper, shiftOffsets[axis][shiftVariation]);
|
|
1660
|
+
}
|
|
1661
|
+
return data;
|
|
1662
|
+
};
|
|
1663
|
+
|
|
1664
|
+
/**
|
|
1665
|
+
* Modifier used to make sure the popper does not overflows from it's boundaries
|
|
1666
|
+
* @method
|
|
1667
|
+
* @memberof Popper.modifiers
|
|
1668
|
+
* @argument {Object} data - The data object generated by `update` method
|
|
1669
|
+
* @returns {Object} The data object, properly modified
|
|
1670
|
+
*/
|
|
1671
|
+
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
1672
|
+
var order = this._options.preventOverflowOrder;
|
|
1673
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1674
|
+
|
|
1675
|
+
var check = {
|
|
1676
|
+
left: function left() {
|
|
1677
|
+
var left = popper.left;
|
|
1678
|
+
if (popper.left < data.boundaries.left) {
|
|
1679
|
+
left = Math.max(popper.left, data.boundaries.left);
|
|
1680
|
+
}
|
|
1681
|
+
return { left: left };
|
|
1682
|
+
},
|
|
1683
|
+
right: function right() {
|
|
1684
|
+
var left = popper.left;
|
|
1685
|
+
if (popper.right > data.boundaries.right) {
|
|
1686
|
+
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
1687
|
+
}
|
|
1688
|
+
return { left: left };
|
|
1689
|
+
},
|
|
1690
|
+
top: function top() {
|
|
1691
|
+
var top = popper.top;
|
|
1692
|
+
if (popper.top < data.boundaries.top) {
|
|
1693
|
+
top = Math.max(popper.top, data.boundaries.top);
|
|
1694
|
+
}
|
|
1695
|
+
return { top: top };
|
|
1696
|
+
},
|
|
1697
|
+
bottom: function bottom() {
|
|
1698
|
+
var top = popper.top;
|
|
1699
|
+
if (popper.bottom > data.boundaries.bottom) {
|
|
1700
|
+
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
1701
|
+
}
|
|
1702
|
+
return { top: top };
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
order.forEach(function (direction) {
|
|
1707
|
+
data.offsets.popper = assign_default()(popper, check[direction]());
|
|
1708
|
+
});
|
|
1709
|
+
|
|
1710
|
+
return data;
|
|
1711
|
+
};
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Modifier used to make sure the popper is always near its reference
|
|
1715
|
+
* @method
|
|
1716
|
+
* @memberof Popper.modifiers
|
|
1717
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1718
|
+
* @returns {Object} The data object, properly modified
|
|
1719
|
+
*/
|
|
1720
|
+
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
1721
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1722
|
+
var reference = data.offsets.reference;
|
|
1723
|
+
var f = Math.floor;
|
|
1724
|
+
|
|
1725
|
+
if (popper.right < f(reference.left)) {
|
|
1726
|
+
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
1727
|
+
}
|
|
1728
|
+
if (popper.left > f(reference.right)) {
|
|
1729
|
+
data.offsets.popper.left = f(reference.right);
|
|
1730
|
+
}
|
|
1731
|
+
if (popper.bottom < f(reference.top)) {
|
|
1732
|
+
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
1733
|
+
}
|
|
1734
|
+
if (popper.top > f(reference.bottom)) {
|
|
1735
|
+
data.offsets.popper.top = f(reference.bottom);
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
return data;
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
|
|
1743
|
+
* Requires the `preventOverflow` modifier before it in order to work.
|
|
1744
|
+
* **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!
|
|
1745
|
+
* @method
|
|
1746
|
+
* @memberof Popper.modifiers
|
|
1747
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1748
|
+
* @returns {Object} The data object, properly modified
|
|
1749
|
+
*/
|
|
1750
|
+
Popper.prototype.modifiers.flip = function (data) {
|
|
1751
|
+
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
1752
|
+
// otherwise flip would not work as expected.
|
|
1753
|
+
if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
|
|
1754
|
+
console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
|
|
1755
|
+
return data;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
if (data.flipped && data.placement === data._originalPlacement) {
|
|
1759
|
+
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
|
1760
|
+
return data;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
var placement = data.placement.split('-')[0];
|
|
1764
|
+
var placementOpposite = getOppositePlacement(placement);
|
|
1765
|
+
var variation = data.placement.split('-')[1] || '';
|
|
1766
|
+
var flipOrder = [];
|
|
1767
|
+
if (this._options.flipBehavior === 'flip') {
|
|
1768
|
+
flipOrder = [placement, placementOpposite];
|
|
1769
|
+
} else {
|
|
1770
|
+
flipOrder = this._options.flipBehavior;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
flipOrder.forEach(function (step, index) {
|
|
1774
|
+
if (placement !== step || flipOrder.length === index + 1) {
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
placement = data.placement.split('-')[0];
|
|
1779
|
+
placementOpposite = getOppositePlacement(placement);
|
|
1780
|
+
|
|
1781
|
+
var popperOffsets = getPopperClientRect(data.offsets.popper);
|
|
1782
|
+
|
|
1783
|
+
// this boolean is used to distinguish right and bottom from top and left
|
|
1784
|
+
// they need different computations to get flipped
|
|
1785
|
+
var a = ['right', 'bottom'].indexOf(placement) !== -1;
|
|
1786
|
+
|
|
1787
|
+
// using Math.floor because the reference offsets may contain decimals we are not going to consider here
|
|
1788
|
+
if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
|
|
1789
|
+
// we'll use this boolean to detect any flip loop
|
|
1790
|
+
data.flipped = true;
|
|
1791
|
+
data.placement = flipOrder[index + 1];
|
|
1792
|
+
if (variation) {
|
|
1793
|
+
data.placement += '-' + variation;
|
|
1794
|
+
}
|
|
1795
|
+
data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
|
|
1796
|
+
data = this.runModifiers(data, this._options.modifiers, this._flip);
|
|
1797
|
+
}
|
|
1798
|
+
}.bind(this));
|
|
1799
|
+
return data;
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
/**
|
|
1803
|
+
* Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
|
|
1804
|
+
* The offsets will shift the popper on the side of its reference element.
|
|
1805
|
+
* @method
|
|
1806
|
+
* @memberof Popper.modifiers
|
|
1807
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1808
|
+
* @returns {Object} The data object, properly modified
|
|
1809
|
+
*/
|
|
1810
|
+
Popper.prototype.modifiers.offset = function (data) {
|
|
1811
|
+
var offset = this._options.offset;
|
|
1812
|
+
var popper = data.offsets.popper;
|
|
1813
|
+
|
|
1814
|
+
if (data.placement.indexOf('left') !== -1) {
|
|
1815
|
+
popper.top -= offset;
|
|
1816
|
+
} else if (data.placement.indexOf('right') !== -1) {
|
|
1817
|
+
popper.top += offset;
|
|
1818
|
+
} else if (data.placement.indexOf('top') !== -1) {
|
|
1819
|
+
popper.left -= offset;
|
|
1820
|
+
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
1821
|
+
popper.left += offset;
|
|
1822
|
+
}
|
|
1823
|
+
return data;
|
|
1824
|
+
};
|
|
1825
|
+
|
|
1826
|
+
/**
|
|
1827
|
+
* 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
|
|
1828
|
+
* It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
|
|
1829
|
+
* @method
|
|
1830
|
+
* @memberof Popper.modifiers
|
|
1831
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1832
|
+
* @returns {Object} The data object, properly modified
|
|
1833
|
+
*/
|
|
1834
|
+
Popper.prototype.modifiers.arrow = function (data) {
|
|
1835
|
+
var arrow = this._options.arrowElement;
|
|
1836
|
+
var arrowOffset = this._options.arrowOffset;
|
|
1837
|
+
|
|
1838
|
+
// if the arrowElement is a string, suppose it's a CSS selector
|
|
1839
|
+
if (typeof arrow === 'string') {
|
|
1840
|
+
arrow = this._popper.querySelector(arrow);
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
// if arrow element is not found, don't run the modifier
|
|
1844
|
+
if (!arrow) {
|
|
1845
|
+
return data;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
// the arrow element must be child of its popper
|
|
1849
|
+
if (!this._popper.contains(arrow)) {
|
|
1850
|
+
console.warn('WARNING: `arrowElement` must be child of its popper element!');
|
|
1851
|
+
return data;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
// arrow depends on keepTogether in order to work
|
|
1855
|
+
if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
|
|
1856
|
+
console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
|
|
1857
|
+
return data;
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
var arrowStyle = {};
|
|
1861
|
+
var placement = data.placement.split('-')[0];
|
|
1862
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1863
|
+
var reference = data.offsets.reference;
|
|
1864
|
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
|
1865
|
+
|
|
1866
|
+
var len = isVertical ? 'height' : 'width';
|
|
1867
|
+
var side = isVertical ? 'top' : 'left';
|
|
1868
|
+
var translate = isVertical ? 'translateY' : 'translateX';
|
|
1869
|
+
var altSide = isVertical ? 'left' : 'top';
|
|
1870
|
+
var opSide = isVertical ? 'bottom' : 'right';
|
|
1871
|
+
var arrowSize = getOuterSizes(arrow)[len];
|
|
1872
|
+
|
|
1873
|
+
//
|
|
1874
|
+
// extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
|
|
1875
|
+
//
|
|
1876
|
+
|
|
1877
|
+
// top/left side
|
|
1878
|
+
if (reference[opSide] - arrowSize < popper[side]) {
|
|
1879
|
+
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
|
1880
|
+
}
|
|
1881
|
+
// bottom/right side
|
|
1882
|
+
if (reference[side] + arrowSize > popper[opSide]) {
|
|
1883
|
+
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
// compute center of the popper
|
|
1887
|
+
var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
|
|
1888
|
+
|
|
1889
|
+
var sideValue = center - popper[side];
|
|
1890
|
+
|
|
1891
|
+
// prevent arrow from being placed not contiguously to its popper
|
|
1892
|
+
sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
|
|
1893
|
+
arrowStyle[side] = sideValue;
|
|
1894
|
+
arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
|
|
1895
|
+
|
|
1896
|
+
data.offsets.arrow = arrowStyle;
|
|
1897
|
+
data.arrowElement = arrow;
|
|
1898
|
+
|
|
1899
|
+
return data;
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
//
|
|
1903
|
+
// Helpers
|
|
1904
|
+
//
|
|
1905
|
+
|
|
1906
|
+
/**
|
|
1907
|
+
* Get the outer sizes of the given element (offset size + margins)
|
|
1908
|
+
* @function
|
|
1909
|
+
* @ignore
|
|
1910
|
+
* @argument {Element} element
|
|
1911
|
+
* @returns {Object} object containing width and height properties
|
|
1912
|
+
*/
|
|
1913
|
+
function getOuterSizes(element) {
|
|
1914
|
+
// NOTE: 1 DOM access here
|
|
1915
|
+
var _display = element.style.display,
|
|
1916
|
+
_visibility = element.style.visibility;
|
|
1917
|
+
element.style.display = 'block';
|
|
1918
|
+
element.style.visibility = 'hidden';
|
|
1919
|
+
var calcWidthToForceRepaint = element.offsetWidth;
|
|
1920
|
+
|
|
1921
|
+
// original method
|
|
1922
|
+
var styles = root.getComputedStyle(element);
|
|
1923
|
+
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
1924
|
+
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
1925
|
+
var result = {
|
|
1926
|
+
width: element.offsetWidth + y,
|
|
1927
|
+
height: element.offsetHeight + x
|
|
1928
|
+
|
|
1929
|
+
// reset element styles
|
|
1930
|
+
};element.style.display = _display;
|
|
1931
|
+
element.style.visibility = _visibility;
|
|
1932
|
+
return result;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
/**
|
|
1936
|
+
* Get the opposite placement of the given one/
|
|
1937
|
+
* @function
|
|
1938
|
+
* @ignore
|
|
1939
|
+
* @argument {String} placement
|
|
1940
|
+
* @returns {String} flipped placement
|
|
1941
|
+
*/
|
|
1942
|
+
function getOppositePlacement(placement) {
|
|
1943
|
+
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
1944
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
1945
|
+
return hash[matched];
|
|
1946
|
+
});
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
/**
|
|
1950
|
+
* Given the popper offsets, generate an output similar to getBoundingClientRect
|
|
1951
|
+
* @function
|
|
1952
|
+
* @ignore
|
|
1953
|
+
* @argument {Object} popperOffsets
|
|
1954
|
+
* @returns {Object} ClientRect like output
|
|
1955
|
+
*/
|
|
1956
|
+
function getPopperClientRect(popperOffsets) {
|
|
1957
|
+
var offsets = assign_default()({}, popperOffsets);
|
|
1958
|
+
offsets.right = offsets.left + offsets.width;
|
|
1959
|
+
offsets.bottom = offsets.top + offsets.height;
|
|
1960
|
+
return offsets;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
/**
|
|
1964
|
+
* Given an array and the key to find, returns its index
|
|
1965
|
+
* @function
|
|
1966
|
+
* @ignore
|
|
1967
|
+
* @argument {Array} arr
|
|
1968
|
+
* @argument keyToFind
|
|
1969
|
+
* @returns index or null
|
|
1970
|
+
*/
|
|
1971
|
+
function getArrayKeyIndex(arr, keyToFind) {
|
|
1972
|
+
var i = 0,
|
|
1973
|
+
key;
|
|
1974
|
+
for (key in arr) {
|
|
1975
|
+
if (arr[key] === keyToFind) {
|
|
1976
|
+
return i;
|
|
1977
|
+
}
|
|
1978
|
+
i++;
|
|
1979
|
+
}
|
|
1980
|
+
return null;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
/**
|
|
1984
|
+
* Get CSS computed property of the given element
|
|
1985
|
+
* @function
|
|
1986
|
+
* @ignore
|
|
1987
|
+
* @argument {Eement} element
|
|
1988
|
+
* @argument {String} property
|
|
1989
|
+
*/
|
|
1990
|
+
function getStyleComputedProperty(element, property) {
|
|
1991
|
+
// NOTE: 1 DOM access here
|
|
1992
|
+
var css = root.getComputedStyle(element, null);
|
|
1993
|
+
return css[property];
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
/**
|
|
1997
|
+
* Returns the offset parent of the given element
|
|
1998
|
+
* @function
|
|
1999
|
+
* @ignore
|
|
2000
|
+
* @argument {Element} element
|
|
2001
|
+
* @returns {Element} offset parent
|
|
2002
|
+
*/
|
|
2003
|
+
function getOffsetParent(element) {
|
|
2004
|
+
// NOTE: 1 DOM access here
|
|
2005
|
+
var offsetParent = element.offsetParent;
|
|
2006
|
+
return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* Returns the scrolling parent of the given element
|
|
2011
|
+
* @function
|
|
2012
|
+
* @ignore
|
|
2013
|
+
* @argument {Element} element
|
|
2014
|
+
* @returns {Element} offset parent
|
|
2015
|
+
*/
|
|
2016
|
+
function getScrollParent(element) {
|
|
2017
|
+
var parent = element.parentNode;
|
|
2018
|
+
|
|
2019
|
+
if (!parent) {
|
|
2020
|
+
return element;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
if (parent === root.document) {
|
|
2024
|
+
// Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
|
|
2025
|
+
// greater than 0 and return the proper element
|
|
2026
|
+
if (root.document.body.scrollTop || root.document.body.scrollLeft) {
|
|
2027
|
+
return root.document.body;
|
|
2028
|
+
} else {
|
|
2029
|
+
return root.document.documentElement;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
// Firefox want us to check `-x` and `-y` variations as well
|
|
2034
|
+
if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {
|
|
2035
|
+
// If the detected scrollParent is body, we perform an additional check on its parentNode
|
|
2036
|
+
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
|
|
2037
|
+
// fixes issue #65
|
|
2038
|
+
return parent;
|
|
2039
|
+
}
|
|
2040
|
+
return getScrollParent(element.parentNode);
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
* Check if the given element is fixed or is inside a fixed parent
|
|
2045
|
+
* @function
|
|
2046
|
+
* @ignore
|
|
2047
|
+
* @argument {Element} element
|
|
2048
|
+
* @argument {Element} customContainer
|
|
2049
|
+
* @returns {Boolean} answer to "isFixed?"
|
|
2050
|
+
*/
|
|
2051
|
+
function isFixed(element) {
|
|
2052
|
+
if (element === root.document.body) {
|
|
2053
|
+
return false;
|
|
2054
|
+
}
|
|
2055
|
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
2056
|
+
return true;
|
|
2057
|
+
}
|
|
2058
|
+
return element.parentNode ? isFixed(element.parentNode) : element;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
/**
|
|
2062
|
+
* Set the style to the given popper
|
|
2063
|
+
* @function
|
|
2064
|
+
* @ignore
|
|
2065
|
+
* @argument {Element} element - Element to apply the style to
|
|
2066
|
+
* @argument {Object} styles - Object with a list of properties and values which will be applied to the element
|
|
2067
|
+
*/
|
|
2068
|
+
function setStyle(element, styles) {
|
|
2069
|
+
function is_numeric(n) {
|
|
2070
|
+
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
2071
|
+
}
|
|
2072
|
+
keys_default()(styles).forEach(function (prop) {
|
|
2073
|
+
var unit = '';
|
|
2074
|
+
// add unit if the value is numeric and is one of the following
|
|
2075
|
+
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
|
|
2076
|
+
unit = 'px';
|
|
2077
|
+
}
|
|
2078
|
+
element.style[prop] = styles[prop] + unit;
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* Check if the given variable is a function
|
|
2084
|
+
* @function
|
|
2085
|
+
* @ignore
|
|
2086
|
+
* @argument {*} functionToCheck - variable to check
|
|
2087
|
+
* @returns {Boolean} answer to: is a function?
|
|
2088
|
+
*/
|
|
2089
|
+
function isFunction(functionToCheck) {
|
|
2090
|
+
var getType = {};
|
|
2091
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
/**
|
|
2095
|
+
* Get the position of the given element, relative to its offset parent
|
|
2096
|
+
* @function
|
|
2097
|
+
* @ignore
|
|
2098
|
+
* @param {Element} element
|
|
2099
|
+
* @return {Object} position - Coordinates of the element and its `scrollTop`
|
|
2100
|
+
*/
|
|
2101
|
+
function getOffsetRect(element) {
|
|
2102
|
+
var elementRect = {
|
|
2103
|
+
width: element.offsetWidth,
|
|
2104
|
+
height: element.offsetHeight,
|
|
2105
|
+
left: element.offsetLeft,
|
|
2106
|
+
top: element.offsetTop
|
|
2107
|
+
};
|
|
2108
|
+
|
|
2109
|
+
elementRect.right = elementRect.left + elementRect.width;
|
|
2110
|
+
elementRect.bottom = elementRect.top + elementRect.height;
|
|
2111
|
+
|
|
2112
|
+
// position
|
|
2113
|
+
return elementRect;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
/**
|
|
2117
|
+
* Get bounding client rect of given element
|
|
2118
|
+
* @function
|
|
2119
|
+
* @ignore
|
|
2120
|
+
* @param {HTMLElement} element
|
|
2121
|
+
* @return {Object} client rect
|
|
2122
|
+
*/
|
|
2123
|
+
function getBoundingClientRect(element) {
|
|
2124
|
+
var rect = element.getBoundingClientRect();
|
|
2125
|
+
|
|
2126
|
+
// whether the IE version is lower than 11
|
|
2127
|
+
var isIE = navigator.userAgent.indexOf('MSIE') != -1;
|
|
2128
|
+
|
|
2129
|
+
// fix ie document bounding top always 0 bug
|
|
2130
|
+
var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
|
|
2131
|
+
|
|
2132
|
+
return {
|
|
2133
|
+
left: rect.left,
|
|
2134
|
+
top: rectTop,
|
|
2135
|
+
right: rect.right,
|
|
2136
|
+
bottom: rect.bottom,
|
|
2137
|
+
width: rect.right - rect.left,
|
|
2138
|
+
height: rect.bottom - rectTop
|
|
2139
|
+
};
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* Given an element and one of its parents, return the offset
|
|
2144
|
+
* @function
|
|
2145
|
+
* @ignore
|
|
2146
|
+
* @param {HTMLElement} element
|
|
2147
|
+
* @param {HTMLElement} parent
|
|
2148
|
+
* @return {Object} rect
|
|
2149
|
+
*/
|
|
2150
|
+
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
2151
|
+
var elementRect = getBoundingClientRect(element);
|
|
2152
|
+
var parentRect = getBoundingClientRect(parent);
|
|
2153
|
+
|
|
2154
|
+
if (fixed) {
|
|
2155
|
+
var scrollParent = getScrollParent(parent);
|
|
2156
|
+
parentRect.top += scrollParent.scrollTop;
|
|
2157
|
+
parentRect.bottom += scrollParent.scrollTop;
|
|
2158
|
+
parentRect.left += scrollParent.scrollLeft;
|
|
2159
|
+
parentRect.right += scrollParent.scrollLeft;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
var rect = {
|
|
2163
|
+
top: elementRect.top - parentRect.top,
|
|
2164
|
+
left: elementRect.left - parentRect.left,
|
|
2165
|
+
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
2166
|
+
right: elementRect.left - parentRect.left + elementRect.width,
|
|
2167
|
+
width: elementRect.width,
|
|
2168
|
+
height: elementRect.height
|
|
2169
|
+
};
|
|
2170
|
+
return rect;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* Get the prefixed supported property name
|
|
2175
|
+
* @function
|
|
2176
|
+
* @ignore
|
|
2177
|
+
* @argument {String} property (camelCase)
|
|
2178
|
+
* @returns {String} prefixed property (camelCase)
|
|
2179
|
+
*/
|
|
2180
|
+
function getSupportedPropertyName(property) {
|
|
2181
|
+
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
2182
|
+
|
|
2183
|
+
for (var i = 0; i < prefixes.length; i++) {
|
|
2184
|
+
var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
|
|
2185
|
+
if (typeof root.document.body.style[toCheck] !== 'undefined') {
|
|
2186
|
+
return toCheck;
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
return null;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
/**
|
|
2193
|
+
* The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
|
|
2194
|
+
* objects to a target object. It will return the target object.
|
|
2195
|
+
* This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
|
|
2196
|
+
* Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
2197
|
+
* @function
|
|
2198
|
+
* @ignore
|
|
2199
|
+
*/
|
|
2200
|
+
if (!assign_default.a) {
|
|
2201
|
+
Object.defineProperty(Object, 'assign', {
|
|
2202
|
+
enumerable: false,
|
|
2203
|
+
configurable: true,
|
|
2204
|
+
writable: true,
|
|
2205
|
+
value: function value(target) {
|
|
2206
|
+
if (target === undefined || target === null) {
|
|
2207
|
+
throw new TypeError('Cannot convert first argument to object');
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
var to = Object(target);
|
|
2211
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2212
|
+
var nextSource = arguments[i];
|
|
2213
|
+
if (nextSource === undefined || nextSource === null) {
|
|
2214
|
+
continue;
|
|
2215
|
+
}
|
|
2216
|
+
nextSource = Object(nextSource);
|
|
2217
|
+
|
|
2218
|
+
var keysArray = keys_default()(nextSource);
|
|
2219
|
+
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
|
2220
|
+
var nextKey = keysArray[nextIndex];
|
|
2221
|
+
var desc = get_own_property_descriptor_default()(nextSource, nextKey);
|
|
2222
|
+
if (desc !== undefined && desc.enumerable) {
|
|
2223
|
+
to[nextKey] = nextSource[nextKey];
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
return to;
|
|
2228
|
+
}
|
|
2229
|
+
});
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
return Popper;
|
|
2233
|
+
}
|
|
2234
|
+
/* harmony default export */ var _popper_popper = (popper_createPopper());
|
|
2235
|
+
// CONCATENATED MODULE: ./components/_util/_popper/vue-popper.js
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
|
|
2239
|
+
var stop = function stop(e) {
|
|
2240
|
+
return e.stopPropagation();
|
|
2241
|
+
};
|
|
2242
|
+
/**
|
|
2243
|
+
* @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.
|
|
2244
|
+
* @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.
|
|
2245
|
+
* @param {String} [placement=button] - Placement of the popper accepted values: top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end)
|
|
2246
|
+
* @param {Number} [offset=0] - Amount of pixels the popper will be shifted (can be negative).
|
|
2247
|
+
* @param {Boolean} [visible=false] Visibility of the popup element.
|
|
2248
|
+
* @param {Boolean} [visible-arrow=false] Visibility of the arrow, no style.
|
|
2249
|
+
*/
|
|
2250
|
+
/* harmony default export */ var vue_popper = __webpack_exports__["a"] = ({
|
|
2251
|
+
props: {
|
|
2252
|
+
transformOrigin: {
|
|
2253
|
+
type: [Boolean, String],
|
|
2254
|
+
default: true
|
|
2255
|
+
},
|
|
2256
|
+
placement: {
|
|
2257
|
+
type: String,
|
|
2258
|
+
default: 'bottom'
|
|
2259
|
+
},
|
|
2260
|
+
boundariesPadding: {
|
|
2261
|
+
type: Number,
|
|
2262
|
+
default: 5
|
|
2263
|
+
},
|
|
2264
|
+
reference: {},
|
|
2265
|
+
popper: {},
|
|
2266
|
+
offset: {
|
|
2267
|
+
default: 0
|
|
2268
|
+
},
|
|
2269
|
+
value: Boolean,
|
|
2270
|
+
visibleArrow: Boolean,
|
|
2271
|
+
arrowOffset: {
|
|
2272
|
+
type: Number,
|
|
2273
|
+
default: 35
|
|
2274
|
+
},
|
|
2275
|
+
appendToBody: {
|
|
2276
|
+
type: Boolean,
|
|
2277
|
+
default: true
|
|
2278
|
+
},
|
|
2279
|
+
popperOptions: {
|
|
2280
|
+
type: Object,
|
|
2281
|
+
default: function _default() {
|
|
2282
|
+
return {
|
|
2283
|
+
gpuAcceleration: false
|
|
2284
|
+
};
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
},
|
|
2288
|
+
|
|
2289
|
+
data: function data() {
|
|
2290
|
+
return {
|
|
2291
|
+
showPopper: false,
|
|
2292
|
+
currentPlacement: ''
|
|
2293
|
+
};
|
|
2294
|
+
},
|
|
2295
|
+
|
|
2296
|
+
|
|
2297
|
+
watch: {
|
|
2298
|
+
value: {
|
|
2299
|
+
immediate: true,
|
|
2300
|
+
handler: function handler(val) {
|
|
2301
|
+
this.showPopper = val;
|
|
2302
|
+
this.$emit('input', val);
|
|
2303
|
+
}
|
|
2304
|
+
},
|
|
2305
|
+
|
|
2306
|
+
showPopper: function showPopper(val) {
|
|
2307
|
+
if (this.disabled) return;
|
|
2308
|
+
val ? this.updatePopper() : this.destroyPopper();
|
|
2309
|
+
this.$emit('input', val);
|
|
321
2310
|
}
|
|
322
|
-
}
|
|
323
|
-
return -1;
|
|
324
|
-
};
|
|
2311
|
+
},
|
|
325
2312
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
};
|
|
2313
|
+
methods: {
|
|
2314
|
+
createPopper: function createPopper() {
|
|
2315
|
+
var _this = this;
|
|
330
2316
|
|
|
331
|
-
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
2317
|
+
var options = this.popperOptions;
|
|
2318
|
+
var popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper;
|
|
2319
|
+
var realPlacement = void 0;
|
|
2320
|
+
if (popper.__vue__ && popper.__vue__.$parent && popper.__vue__.$parent.$options.name === 'MdsCascader') {
|
|
2321
|
+
realPlacement = 'bottom-start';
|
|
2322
|
+
} else {
|
|
2323
|
+
realPlacement = this.realPlacement || this.placement;
|
|
2324
|
+
}
|
|
2325
|
+
this.currentPlacement = this.currentPlacement || realPlacement;
|
|
2326
|
+
if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
341
2329
|
|
|
342
|
-
var
|
|
343
|
-
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
|
|
344
|
-
};
|
|
2330
|
+
var reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;
|
|
345
2331
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
2332
|
+
if (!reference && this.$slots.reference && this.$slots.reference[0]) {
|
|
2333
|
+
reference = this.referenceElm = this.$slots.reference[0].elm;
|
|
2334
|
+
}
|
|
349
2335
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
2336
|
+
if (!popper || !reference) return;
|
|
2337
|
+
if (this.visibleArrow) this.appendArrow(popper);
|
|
2338
|
+
if (this.appendToBody) document.body.appendChild(this.popperElm);
|
|
2339
|
+
if (this.popperJS && this.popperJS.destroy) {
|
|
2340
|
+
this.popperJS.destroy();
|
|
2341
|
+
}
|
|
353
2342
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
*/
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
2343
|
+
options.placement = this.currentPlacement;
|
|
2344
|
+
options.offset = this.offset;
|
|
2345
|
+
options.arrowOffset = this.arrowOffset;
|
|
2346
|
+
this.popperJS = new _popper_popper(reference, popper, options);
|
|
2347
|
+
this.popperJS.onCreate(function (_) {
|
|
2348
|
+
_this.$emit('created', _this);
|
|
2349
|
+
_this.resetTransformOrigin();
|
|
2350
|
+
_this.$nextTick(_this.updatePopper);
|
|
2351
|
+
});
|
|
2352
|
+
if (typeof options.onUpdate === 'function') {
|
|
2353
|
+
this.popperJS.onUpdate(options.onUpdate);
|
|
2354
|
+
}
|
|
2355
|
+
this.popperJS._popper.style.zIndex = popup_main["a" /* PopupMain */].nextZIndex();
|
|
2356
|
+
this.popperElm.addEventListener('click', stop);
|
|
2357
|
+
},
|
|
2358
|
+
updatePopper: function updatePopper(zIndexFlag) {
|
|
2359
|
+
var popperJS = this.popperJS;
|
|
2360
|
+
if (popperJS) {
|
|
2361
|
+
popperJS.update();
|
|
2362
|
+
if (popperJS._popper) {
|
|
2363
|
+
if (!zIndexFlag) {
|
|
2364
|
+
popperJS._popper.style.zIndex = popup_main["a" /* PopupMain */].nextZIndex();
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
} else {
|
|
2368
|
+
this.createPopper();
|
|
2369
|
+
}
|
|
2370
|
+
},
|
|
2371
|
+
doDestroy: function doDestroy(forceDestroy) {
|
|
2372
|
+
/* istanbul ignore if */
|
|
2373
|
+
if (!this.popperJS || this.showPopper && !forceDestroy) return;
|
|
2374
|
+
this.popperJS.destroy();
|
|
2375
|
+
this.popperJS = null;
|
|
2376
|
+
},
|
|
2377
|
+
destroyPopper: function destroyPopper() {
|
|
2378
|
+
if (this.popperJS) {
|
|
2379
|
+
this.resetTransformOrigin();
|
|
2380
|
+
}
|
|
2381
|
+
},
|
|
2382
|
+
resetTransformOrigin: function resetTransformOrigin() {
|
|
2383
|
+
if (!this.transformOrigin) return;
|
|
2384
|
+
var placementMap = {
|
|
2385
|
+
top: 'bottom',
|
|
2386
|
+
bottom: 'top',
|
|
2387
|
+
left: 'right',
|
|
2388
|
+
right: 'left'
|
|
2389
|
+
};
|
|
2390
|
+
var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
|
|
2391
|
+
var origin = placementMap[placement];
|
|
2392
|
+
this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? 'center ' + origin : origin + ' center';
|
|
2393
|
+
},
|
|
2394
|
+
appendArrow: function appendArrow(element) {
|
|
2395
|
+
var hash = void 0;
|
|
2396
|
+
if (this.appended) {
|
|
2397
|
+
return;
|
|
2398
|
+
}
|
|
379
2399
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
2400
|
+
this.appended = true;
|
|
2401
|
+
|
|
2402
|
+
for (var item in element.attributes) {
|
|
2403
|
+
if (/^_v-/.test(element.attributes[item].name)) {
|
|
2404
|
+
hash = element.attributes[item].name;
|
|
2405
|
+
break;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
var arrow = document.createElement('div');
|
|
2410
|
+
|
|
2411
|
+
if (hash) {
|
|
2412
|
+
arrow.setAttribute(hash, '');
|
|
2413
|
+
}
|
|
2414
|
+
arrow.setAttribute('x-arrow', '');
|
|
2415
|
+
arrow.className = 'popper__arrow';
|
|
2416
|
+
element.appendChild(arrow);
|
|
2417
|
+
}
|
|
2418
|
+
},
|
|
2419
|
+
|
|
2420
|
+
beforeDestroy: function beforeDestroy() {
|
|
2421
|
+
this.doDestroy(true);
|
|
2422
|
+
if (this.popperElm && this.popperElm.parentNode === document.body) {
|
|
2423
|
+
this.popperElm.removeEventListener('click', stop);
|
|
2424
|
+
document.body.removeChild(this.popperElm);
|
|
2425
|
+
}
|
|
2426
|
+
},
|
|
2427
|
+
deactivated: function deactivated() {
|
|
2428
|
+
this.$options.beforeDestroy[0].call(this);
|
|
2429
|
+
}
|
|
2430
|
+
});
|
|
388
2431
|
|
|
389
2432
|
/***/ }),
|
|
390
2433
|
|
|
391
|
-
/***/
|
|
2434
|
+
/***/ 171:
|
|
392
2435
|
/***/ (function(module, exports) {
|
|
393
2436
|
|
|
394
|
-
|
|
2437
|
+
// removed by extract-text-webpack-plugin
|
|
395
2438
|
|
|
396
2439
|
/***/ }),
|
|
397
2440
|
|
|
398
|
-
/***/
|
|
2441
|
+
/***/ 173:
|
|
399
2442
|
/***/ (function(module, exports) {
|
|
400
2443
|
|
|
401
2444
|
// removed by extract-text-webpack-plugin
|
|
402
2445
|
|
|
403
2446
|
/***/ }),
|
|
404
2447
|
|
|
405
|
-
/***/
|
|
2448
|
+
/***/ 18:
|
|
406
2449
|
/***/ (function(module, exports) {
|
|
407
2450
|
|
|
408
|
-
module.exports =
|
|
2451
|
+
module.exports = require("babel-runtime/core-js/object/get-own-property-descriptor");
|
|
409
2452
|
|
|
410
2453
|
/***/ }),
|
|
411
2454
|
|
|
412
|
-
/***/
|
|
2455
|
+
/***/ 2:
|
|
2456
|
+
/***/ (function(module, exports) {
|
|
2457
|
+
|
|
2458
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
2459
|
+
|
|
2460
|
+
/***/ }),
|
|
2461
|
+
|
|
2462
|
+
/***/ 20:
|
|
2463
|
+
/***/ (function(module, exports) {
|
|
2464
|
+
|
|
2465
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__20__;
|
|
2466
|
+
|
|
2467
|
+
/***/ }),
|
|
2468
|
+
|
|
2469
|
+
/***/ 21:
|
|
413
2470
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
414
2471
|
|
|
415
2472
|
"use strict";
|
|
@@ -424,9 +2481,9 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__14__;
|
|
|
424
2481
|
/* unused harmony export isScroll */
|
|
425
2482
|
/* unused harmony export getScrollContainer */
|
|
426
2483
|
/* unused harmony export isInContainer */
|
|
427
|
-
/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2484
|
+
/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
|
428
2485
|
/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
|
429
|
-
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
2486
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
|
430
2487
|
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
|
|
431
2488
|
|
|
432
2489
|
/* istanbul ignore next */
|
|
@@ -654,42 +2711,21 @@ var isInContainer = function isInContainer(el, container) {
|
|
|
654
2711
|
|
|
655
2712
|
/***/ }),
|
|
656
2713
|
|
|
657
|
-
/***/
|
|
658
|
-
/***/ (function(module, exports) {
|
|
659
|
-
|
|
660
|
-
// removed by extract-text-webpack-plugin
|
|
661
|
-
|
|
662
|
-
/***/ }),
|
|
663
|
-
|
|
664
|
-
/***/ 161:
|
|
665
|
-
/***/ (function(module, exports) {
|
|
666
|
-
|
|
667
|
-
// removed by extract-text-webpack-plugin
|
|
668
|
-
|
|
669
|
-
/***/ }),
|
|
670
|
-
|
|
671
|
-
/***/ 17:
|
|
2714
|
+
/***/ 24:
|
|
672
2715
|
/***/ (function(module, exports) {
|
|
673
2716
|
|
|
674
2717
|
module.exports = require("babel-runtime/helpers/toConsumableArray");
|
|
675
2718
|
|
|
676
2719
|
/***/ }),
|
|
677
2720
|
|
|
678
|
-
/***/
|
|
679
|
-
/***/ (function(module, exports) {
|
|
680
|
-
|
|
681
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__18__;
|
|
682
|
-
|
|
683
|
-
/***/ }),
|
|
684
|
-
|
|
685
|
-
/***/ 2:
|
|
2721
|
+
/***/ 25:
|
|
686
2722
|
/***/ (function(module, exports) {
|
|
687
2723
|
|
|
688
|
-
module.exports =
|
|
2724
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__25__;
|
|
689
2725
|
|
|
690
2726
|
/***/ }),
|
|
691
2727
|
|
|
692
|
-
/***/
|
|
2728
|
+
/***/ 27:
|
|
693
2729
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
694
2730
|
|
|
695
2731
|
"use strict";
|
|
@@ -782,42 +2818,234 @@ component.options.__file = "components/scroll-bar/scroll-bar.vue"
|
|
|
782
2818
|
|
|
783
2819
|
/***/ }),
|
|
784
2820
|
|
|
785
|
-
/***/
|
|
2821
|
+
/***/ 33:
|
|
786
2822
|
/***/ (function(module, exports) {
|
|
787
2823
|
|
|
788
|
-
module.exports =
|
|
2824
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__33__;
|
|
789
2825
|
|
|
790
2826
|
/***/ }),
|
|
791
2827
|
|
|
792
|
-
/***/
|
|
2828
|
+
/***/ 4:
|
|
793
2829
|
/***/ (function(module, exports) {
|
|
794
2830
|
|
|
795
|
-
module.exports =
|
|
2831
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__4__;
|
|
796
2832
|
|
|
797
2833
|
/***/ }),
|
|
798
2834
|
|
|
799
|
-
/***/
|
|
2835
|
+
/***/ 49:
|
|
800
2836
|
/***/ (function(module, exports) {
|
|
801
2837
|
|
|
802
|
-
module.exports =
|
|
2838
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__49__;
|
|
803
2839
|
|
|
804
2840
|
/***/ }),
|
|
805
2841
|
|
|
806
|
-
/***/
|
|
807
|
-
/***/ (function(module,
|
|
2842
|
+
/***/ 5:
|
|
2843
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
808
2844
|
|
|
809
|
-
|
|
2845
|
+
"use strict";
|
|
2846
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
2847
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
2848
|
+
/* harmony import */ var _dom_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
810
2849
|
|
|
811
|
-
/***/ }),
|
|
812
2850
|
|
|
813
|
-
/***/ 43:
|
|
814
|
-
/***/ (function(module, exports) {
|
|
815
2851
|
|
|
816
|
-
|
|
2852
|
+
var hasModal = false;
|
|
2853
|
+
var hasInitZIndex = false;
|
|
2854
|
+
var zIndex = void 0;
|
|
2855
|
+
|
|
2856
|
+
var getModal = function getModal() {
|
|
2857
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
2858
|
+
var modalDom = PopupManager.modalDom;
|
|
2859
|
+
if (modalDom) {
|
|
2860
|
+
hasModal = true;
|
|
2861
|
+
} else {
|
|
2862
|
+
hasModal = false;
|
|
2863
|
+
modalDom = document.createElement('div');
|
|
2864
|
+
PopupManager.modalDom = modalDom;
|
|
2865
|
+
|
|
2866
|
+
modalDom.addEventListener('touchmove', function (event) {
|
|
2867
|
+
event.preventDefault();
|
|
2868
|
+
event.stopPropagation();
|
|
2869
|
+
});
|
|
2870
|
+
|
|
2871
|
+
modalDom.addEventListener('click', function () {
|
|
2872
|
+
PopupManager.doOnModalClick && PopupManager.doOnModalClick();
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
return modalDom;
|
|
2877
|
+
};
|
|
2878
|
+
|
|
2879
|
+
var instances = {};
|
|
2880
|
+
|
|
2881
|
+
var PopupManager = {
|
|
2882
|
+
modalFade: true,
|
|
2883
|
+
|
|
2884
|
+
getInstance: function getInstance(id) {
|
|
2885
|
+
return instances[id];
|
|
2886
|
+
},
|
|
2887
|
+
|
|
2888
|
+
register: function register(id, instance) {
|
|
2889
|
+
if (id && instance) {
|
|
2890
|
+
instances[id] = instance;
|
|
2891
|
+
}
|
|
2892
|
+
},
|
|
2893
|
+
|
|
2894
|
+
deregister: function deregister(id) {
|
|
2895
|
+
if (id) {
|
|
2896
|
+
instances[id] = null;
|
|
2897
|
+
delete instances[id];
|
|
2898
|
+
}
|
|
2899
|
+
},
|
|
2900
|
+
|
|
2901
|
+
nextZIndex: function nextZIndex() {
|
|
2902
|
+
return PopupManager.zIndex++;
|
|
2903
|
+
},
|
|
2904
|
+
|
|
2905
|
+
modalStack: [],
|
|
2906
|
+
|
|
2907
|
+
doOnModalClick: function doOnModalClick() {
|
|
2908
|
+
var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
2909
|
+
if (!topItem) return;
|
|
2910
|
+
|
|
2911
|
+
var instance = PopupManager.getInstance(topItem.id);
|
|
2912
|
+
if (instance && instance.closeOnClickModal) {
|
|
2913
|
+
instance.close();
|
|
2914
|
+
}
|
|
2915
|
+
},
|
|
2916
|
+
|
|
2917
|
+
openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
|
|
2918
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
2919
|
+
if (!id || zIndex === undefined) return;
|
|
2920
|
+
this.modalFade = modalFade;
|
|
2921
|
+
|
|
2922
|
+
var modalStack = this.modalStack;
|
|
2923
|
+
|
|
2924
|
+
for (var i = 0, j = modalStack.length; i < j; i++) {
|
|
2925
|
+
var item = modalStack[i];
|
|
2926
|
+
if (item.id === id) {
|
|
2927
|
+
return;
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
var modalDom = getModal();
|
|
2932
|
+
|
|
2933
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal');
|
|
2934
|
+
if (this.modalFade && !hasModal) {
|
|
2935
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-enter');
|
|
2936
|
+
}
|
|
2937
|
+
if (modalClass) {
|
|
2938
|
+
var classArr = modalClass.trim().split(/\s+/);
|
|
2939
|
+
classArr.forEach(function (item) {
|
|
2940
|
+
return Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, item);
|
|
2941
|
+
});
|
|
2942
|
+
}
|
|
2943
|
+
setTimeout(function () {
|
|
2944
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(modalDom, 'v-modal-enter');
|
|
2945
|
+
}, 200);
|
|
2946
|
+
|
|
2947
|
+
if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
|
|
2948
|
+
dom.parentNode.appendChild(modalDom);
|
|
2949
|
+
} else {
|
|
2950
|
+
document.body.appendChild(modalDom);
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
if (zIndex) {
|
|
2954
|
+
modalDom.style.zIndex = zIndex;
|
|
2955
|
+
}
|
|
2956
|
+
modalDom.tabIndex = 0;
|
|
2957
|
+
modalDom.style.display = '';
|
|
2958
|
+
|
|
2959
|
+
this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
|
|
2960
|
+
},
|
|
2961
|
+
|
|
2962
|
+
closeModal: function closeModal(id) {
|
|
2963
|
+
var modalStack = this.modalStack;
|
|
2964
|
+
var modalDom = getModal();
|
|
2965
|
+
|
|
2966
|
+
if (modalStack.length > 0) {
|
|
2967
|
+
var topItem = modalStack[modalStack.length - 1];
|
|
2968
|
+
if (topItem.id === id) {
|
|
2969
|
+
if (topItem.modalClass) {
|
|
2970
|
+
var classArr = topItem.modalClass.trim().split(/\s+/);
|
|
2971
|
+
classArr.forEach(function (item) {
|
|
2972
|
+
return Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(modalDom, item);
|
|
2973
|
+
});
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
modalStack.pop();
|
|
2977
|
+
if (modalStack.length > 0) {
|
|
2978
|
+
modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
|
|
2979
|
+
}
|
|
2980
|
+
} else {
|
|
2981
|
+
for (var i = modalStack.length - 1; i >= 0; i--) {
|
|
2982
|
+
if (modalStack[i].id === id) {
|
|
2983
|
+
modalStack.splice(i, 1);
|
|
2984
|
+
break;
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
if (modalStack.length === 0) {
|
|
2991
|
+
if (this.modalFade) {
|
|
2992
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-leave');
|
|
2993
|
+
}
|
|
2994
|
+
setTimeout(function () {
|
|
2995
|
+
if (modalStack.length === 0) {
|
|
2996
|
+
if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
|
|
2997
|
+
modalDom.style.display = 'none';
|
|
2998
|
+
PopupManager.modalDom = undefined;
|
|
2999
|
+
}
|
|
3000
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(modalDom, 'v-modal-leave');
|
|
3001
|
+
}, 200);
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
};
|
|
3005
|
+
|
|
3006
|
+
Object.defineProperty(PopupManager, 'zIndex', {
|
|
3007
|
+
configurable: true,
|
|
3008
|
+
get: function get() {
|
|
3009
|
+
if (!hasInitZIndex) {
|
|
3010
|
+
zIndex = zIndex || (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$ELEMENT || {}).zIndex || 2000;
|
|
3011
|
+
hasInitZIndex = true;
|
|
3012
|
+
}
|
|
3013
|
+
return zIndex;
|
|
3014
|
+
},
|
|
3015
|
+
set: function set(value) {
|
|
3016
|
+
zIndex = value;
|
|
3017
|
+
}
|
|
3018
|
+
});
|
|
3019
|
+
|
|
3020
|
+
var getTopPopup = function getTopPopup() {
|
|
3021
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
3022
|
+
if (PopupManager.modalStack.length > 0) {
|
|
3023
|
+
var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
3024
|
+
if (!topPopup) return;
|
|
3025
|
+
var instance = PopupManager.getInstance(topPopup.id);
|
|
3026
|
+
|
|
3027
|
+
return instance;
|
|
3028
|
+
}
|
|
3029
|
+
};
|
|
3030
|
+
|
|
3031
|
+
if (!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) {
|
|
3032
|
+
// handle `esc` key when the popup is shown
|
|
3033
|
+
window.addEventListener('keydown', function (event) {
|
|
3034
|
+
if (event.keyCode === 27) {
|
|
3035
|
+
var topPopup = getTopPopup();
|
|
3036
|
+
|
|
3037
|
+
if (topPopup && topPopup.closeOnPressEscape) {
|
|
3038
|
+
topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
});
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
/* harmony default export */ __webpack_exports__["a"] = (PopupManager);
|
|
817
3045
|
|
|
818
3046
|
/***/ }),
|
|
819
3047
|
|
|
820
|
-
/***/
|
|
3048
|
+
/***/ 51:
|
|
821
3049
|
/***/ (function(module, exports, __webpack_require__) {
|
|
822
3050
|
|
|
823
3051
|
var __WEBPACK_AMD_DEFINE_RESULT__;/* Modified from https://github.com/taylorhakes/fecha
|
|
@@ -1188,14 +3416,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* Modified from https://github.com/taylorhake
|
|
|
1188
3416
|
|
|
1189
3417
|
/***/ }),
|
|
1190
3418
|
|
|
1191
|
-
/***/
|
|
1192
|
-
/***/ (function(module, exports) {
|
|
1193
|
-
|
|
1194
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__5__;
|
|
1195
|
-
|
|
1196
|
-
/***/ }),
|
|
1197
|
-
|
|
1198
|
-
/***/ 51:
|
|
3419
|
+
/***/ 56:
|
|
1199
3420
|
/***/ (function(module, exports) {
|
|
1200
3421
|
|
|
1201
3422
|
module.exports = require("babel-runtime/helpers/slicedToArray");
|
|
@@ -1205,21 +3426,21 @@ module.exports = require("babel-runtime/helpers/slicedToArray");
|
|
|
1205
3426
|
/***/ 6:
|
|
1206
3427
|
/***/ (function(module, exports) {
|
|
1207
3428
|
|
|
1208
|
-
module.exports =
|
|
3429
|
+
module.exports = require("babel-runtime/core-js/object/assign");
|
|
1209
3430
|
|
|
1210
3431
|
/***/ }),
|
|
1211
3432
|
|
|
1212
|
-
/***/
|
|
3433
|
+
/***/ 66:
|
|
1213
3434
|
/***/ (function(module, exports) {
|
|
1214
3435
|
|
|
1215
|
-
module.exports =
|
|
3436
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__66__;
|
|
1216
3437
|
|
|
1217
3438
|
/***/ }),
|
|
1218
3439
|
|
|
1219
|
-
/***/
|
|
3440
|
+
/***/ 67:
|
|
1220
3441
|
/***/ (function(module, exports) {
|
|
1221
3442
|
|
|
1222
|
-
module.exports =
|
|
3443
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__67__;
|
|
1223
3444
|
|
|
1224
3445
|
/***/ }),
|
|
1225
3446
|
|
|
@@ -1233,11 +3454,11 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
|
|
|
1233
3454
|
/***/ 8:
|
|
1234
3455
|
/***/ (function(module, exports) {
|
|
1235
3456
|
|
|
1236
|
-
module.exports =
|
|
3457
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__8__;
|
|
1237
3458
|
|
|
1238
3459
|
/***/ }),
|
|
1239
3460
|
|
|
1240
|
-
/***/
|
|
3461
|
+
/***/ 87:
|
|
1241
3462
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1242
3463
|
|
|
1243
3464
|
"use strict";
|
|
@@ -1245,13 +3466,13 @@ module.exports = require("babel-runtime/helpers/typeof");
|
|
|
1245
3466
|
__webpack_require__.r(__webpack_exports__);
|
|
1246
3467
|
|
|
1247
3468
|
// EXTERNAL MODULE: ./components/style/index.less
|
|
1248
|
-
var components_style = __webpack_require__(
|
|
3469
|
+
var components_style = __webpack_require__(139);
|
|
1249
3470
|
|
|
1250
3471
|
// EXTERNAL MODULE: ./components/datepicker/style/index.less
|
|
1251
|
-
var datepicker_style = __webpack_require__(
|
|
3472
|
+
var datepicker_style = __webpack_require__(171);
|
|
1252
3473
|
|
|
1253
3474
|
// EXTERNAL MODULE: ./components/datepicker/style/transition.less
|
|
1254
|
-
var transition = __webpack_require__(
|
|
3475
|
+
var transition = __webpack_require__(173);
|
|
1255
3476
|
|
|
1256
3477
|
// CONCATENATED MODULE: ./components/datepicker/style/index.js
|
|
1257
3478
|
|
|
@@ -1361,12 +3582,6 @@ var render = function () {
|
|
|
1361
3582
|
},
|
|
1362
3583
|
},
|
|
1363
3584
|
[
|
|
1364
|
-
_vm.type === "datetimerangeflat"
|
|
1365
|
-
? _c("i", {
|
|
1366
|
-
class: ["mdsicon", "mdsicon-line-clock-circle-o"],
|
|
1367
|
-
staticStyle: { color: "#ccd2db" },
|
|
1368
|
-
})
|
|
1369
|
-
: _vm._e(),
|
|
1370
3585
|
_c(
|
|
1371
3586
|
"input",
|
|
1372
3587
|
_vm._b(
|
|
@@ -1427,7 +3642,7 @@ var render = function () {
|
|
|
1427
3642
|
false
|
|
1428
3643
|
)
|
|
1429
3644
|
),
|
|
1430
|
-
_vm.showCalendar
|
|
3645
|
+
_vm.showCalendar
|
|
1431
3646
|
? _c("i", {
|
|
1432
3647
|
class: [
|
|
1433
3648
|
"mdsicon",
|
|
@@ -1460,50 +3675,49 @@ render._withStripped = true
|
|
|
1460
3675
|
// CONCATENATED MODULE: ./components/datepicker/picker/picker.vue?vue&type=template&id=311c2352&
|
|
1461
3676
|
|
|
1462
3677
|
// EXTERNAL MODULE: external "babel-runtime/helpers/toConsumableArray"
|
|
1463
|
-
var toConsumableArray_ = __webpack_require__(
|
|
3678
|
+
var toConsumableArray_ = __webpack_require__(24);
|
|
1464
3679
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray_);
|
|
1465
3680
|
|
|
1466
3681
|
// EXTERNAL MODULE: external "babel-runtime/core-js/object/keys"
|
|
1467
|
-
var keys_ = __webpack_require__(
|
|
3682
|
+
var keys_ = __webpack_require__(10);
|
|
1468
3683
|
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
1469
3684
|
|
|
1470
3685
|
// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
|
|
1471
|
-
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(
|
|
3686
|
+
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(2);
|
|
1472
3687
|
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
|
|
1473
3688
|
|
|
1474
3689
|
// EXTERNAL MODULE: external "./_util/clickoutside"
|
|
1475
|
-
var clickoutside_ = __webpack_require__(
|
|
3690
|
+
var clickoutside_ = __webpack_require__(33);
|
|
1476
3691
|
var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
|
|
1477
3692
|
|
|
1478
3693
|
// EXTERNAL MODULE: external "./_util/dateUtil"
|
|
1479
|
-
var dateUtil_ = __webpack_require__(
|
|
3694
|
+
var dateUtil_ = __webpack_require__(4);
|
|
1480
3695
|
|
|
1481
|
-
// EXTERNAL MODULE:
|
|
1482
|
-
var
|
|
1483
|
-
var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
|
|
3696
|
+
// EXTERNAL MODULE: ./components/_util/_popper/vue-popper.js + 1 modules
|
|
3697
|
+
var vue_popper = __webpack_require__(17);
|
|
1484
3698
|
|
|
1485
3699
|
// EXTERNAL MODULE: external "./_mixin/emitter"
|
|
1486
|
-
var emitter_ = __webpack_require__(
|
|
3700
|
+
var emitter_ = __webpack_require__(12);
|
|
1487
3701
|
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
1488
3702
|
|
|
1489
3703
|
// EXTERNAL MODULE: external "./input"
|
|
1490
|
-
var external_input_ = __webpack_require__(
|
|
3704
|
+
var external_input_ = __webpack_require__(16);
|
|
1491
3705
|
var external_input_default = /*#__PURE__*/__webpack_require__.n(external_input_);
|
|
1492
3706
|
|
|
1493
3707
|
// EXTERNAL MODULE: external "./icon"
|
|
1494
|
-
var external_icon_ = __webpack_require__(
|
|
3708
|
+
var external_icon_ = __webpack_require__(8);
|
|
1495
3709
|
var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
|
|
1496
3710
|
|
|
1497
3711
|
// EXTERNAL MODULE: external "./_util/merge"
|
|
1498
|
-
var merge_ = __webpack_require__(
|
|
3712
|
+
var merge_ = __webpack_require__(49);
|
|
1499
3713
|
var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
|
|
1500
3714
|
|
|
1501
3715
|
// EXTERNAL MODULE: external "./_mixin/locale"
|
|
1502
|
-
var locale_ = __webpack_require__(
|
|
3716
|
+
var locale_ = __webpack_require__(25);
|
|
1503
3717
|
var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
|
|
1504
3718
|
|
|
1505
3719
|
// EXTERNAL MODULE: external "./_util/proptype"
|
|
1506
|
-
var proptype_ = __webpack_require__(
|
|
3720
|
+
var proptype_ = __webpack_require__(7);
|
|
1507
3721
|
|
|
1508
3722
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/datepicker/picker/picker.vue?vue&type=script&lang=js&
|
|
1509
3723
|
|
|
@@ -1609,17 +3823,17 @@ var SIZEMAP = {
|
|
|
1609
3823
|
};
|
|
1610
3824
|
var NewPopper = {
|
|
1611
3825
|
props: {
|
|
1612
|
-
appendToBody:
|
|
1613
|
-
offset:
|
|
1614
|
-
boundariesPadding:
|
|
1615
|
-
arrowOffset:
|
|
3826
|
+
appendToBody: vue_popper["a" /* default */].props.appendToBody,
|
|
3827
|
+
offset: vue_popper["a" /* default */].props.offset,
|
|
3828
|
+
boundariesPadding: vue_popper["a" /* default */].props.boundariesPadding,
|
|
3829
|
+
arrowOffset: vue_popper["a" /* default */].props.arrowOffset
|
|
1616
3830
|
},
|
|
1617
|
-
methods:
|
|
3831
|
+
methods: vue_popper["a" /* default */].methods,
|
|
1618
3832
|
data: function data() {
|
|
1619
|
-
return merge_default()({ visibleArrow: true },
|
|
3833
|
+
return merge_default()({ visibleArrow: true }, vue_popper["a" /* default */].data);
|
|
1620
3834
|
},
|
|
1621
3835
|
|
|
1622
|
-
beforeDestroy:
|
|
3836
|
+
beforeDestroy: vue_popper["a" /* default */].beforeDestroy
|
|
1623
3837
|
};
|
|
1624
3838
|
|
|
1625
3839
|
var DEFAULT_FORMATS = {
|
|
@@ -2815,7 +5029,7 @@ datevue_type_template_id_1a0bc492_render._withStripped = true
|
|
|
2815
5029
|
// CONCATENATED MODULE: ./components/datepicker/picker/date.vue?vue&type=template&id=1a0bc492&
|
|
2816
5030
|
|
|
2817
5031
|
// EXTERNAL MODULE: external "./button"
|
|
2818
|
-
var external_button_ = __webpack_require__(
|
|
5032
|
+
var external_button_ = __webpack_require__(13);
|
|
2819
5033
|
var external_button_default = /*#__PURE__*/__webpack_require__.n(external_button_);
|
|
2820
5034
|
|
|
2821
5035
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/datepicker/picker/time.vue?vue&type=template&id=0c4cd956&
|
|
@@ -3061,7 +5275,7 @@ time_spinnervue_type_template_id_79c97ebf_render._withStripped = true
|
|
|
3061
5275
|
// CONCATENATED MODULE: ./components/datepicker/base/time-spinner.vue?vue&type=template&id=79c97ebf&
|
|
3062
5276
|
|
|
3063
5277
|
// EXTERNAL MODULE: ./components/_util/date.js
|
|
3064
|
-
var _util_date = __webpack_require__(
|
|
5278
|
+
var _util_date = __webpack_require__(51);
|
|
3065
5279
|
var date_default = /*#__PURE__*/__webpack_require__.n(_util_date);
|
|
3066
5280
|
|
|
3067
5281
|
// CONCATENATED MODULE: ./components/_util/dateUtil.js
|
|
@@ -3368,10 +5582,10 @@ var validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
|
|
|
3368
5582
|
return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
|
|
3369
5583
|
};
|
|
3370
5584
|
// EXTERNAL MODULE: ./components/scroll-bar/index.js + 5 modules
|
|
3371
|
-
var scroll_bar = __webpack_require__(
|
|
5585
|
+
var scroll_bar = __webpack_require__(27);
|
|
3372
5586
|
|
|
3373
5587
|
// EXTERNAL MODULE: external "./_util/repeatClick"
|
|
3374
|
-
var repeatClick_ = __webpack_require__(
|
|
5588
|
+
var repeatClick_ = __webpack_require__(66);
|
|
3375
5589
|
var repeatClick_default = /*#__PURE__*/__webpack_require__.n(repeatClick_);
|
|
3376
5590
|
|
|
3377
5591
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/datepicker/base/time-spinner.vue?vue&type=script&lang=js&
|
|
@@ -4072,10 +6286,10 @@ year_tablevue_type_template_id_aa64ca38_render._withStripped = true
|
|
|
4072
6286
|
// CONCATENATED MODULE: ./components/datepicker/base/year-table.vue?vue&type=template&id=aa64ca38&
|
|
4073
6287
|
|
|
4074
6288
|
// EXTERNAL MODULE: external "./_util/dom"
|
|
4075
|
-
var dom_ = __webpack_require__(
|
|
6289
|
+
var dom_ = __webpack_require__(67);
|
|
4076
6290
|
|
|
4077
6291
|
// EXTERNAL MODULE: external "./_util/util"
|
|
4078
|
-
var util_ = __webpack_require__(
|
|
6292
|
+
var util_ = __webpack_require__(20);
|
|
4079
6293
|
|
|
4080
6294
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/datepicker/base/year-table.vue?vue&type=script&lang=js&
|
|
4081
6295
|
//
|
|
@@ -4285,10 +6499,10 @@ month_tablevue_type_template_id_c295c5ea_render._withStripped = true
|
|
|
4285
6499
|
// CONCATENATED MODULE: ./components/datepicker/base/month-table.vue?vue&type=template&id=c295c5ea&
|
|
4286
6500
|
|
|
4287
6501
|
// EXTERNAL MODULE: ./components/_util/dom.js
|
|
4288
|
-
var dom = __webpack_require__(
|
|
6502
|
+
var dom = __webpack_require__(21);
|
|
4289
6503
|
|
|
4290
6504
|
// EXTERNAL MODULE: ./components/_util/util.js
|
|
4291
|
-
var util = __webpack_require__(
|
|
6505
|
+
var util = __webpack_require__(15);
|
|
4292
6506
|
|
|
4293
6507
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/datepicker/base/month-table.vue?vue&type=script&lang=js&
|
|
4294
6508
|
//
|
|
@@ -6251,7 +8465,7 @@ date_rangevue_type_template_id_6eca7cf8_render._withStripped = true
|
|
|
6251
8465
|
// CONCATENATED MODULE: ./components/datepicker/range/date-range.vue?vue&type=template&id=6eca7cf8&
|
|
6252
8466
|
|
|
6253
8467
|
// EXTERNAL MODULE: external "babel-runtime/helpers/slicedToArray"
|
|
6254
|
-
var slicedToArray_ = __webpack_require__(
|
|
8468
|
+
var slicedToArray_ = __webpack_require__(56);
|
|
6255
8469
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray_);
|
|
6256
8470
|
|
|
6257
8471
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/datepicker/picker/datetime-select.vue?vue&type=template&id=5b910c15&
|
|
@@ -8083,6 +10297,13 @@ datepicker_picker.install = function (Vue) {
|
|
|
8083
10297
|
};
|
|
8084
10298
|
/* harmony default export */ var datepicker = __webpack_exports__["default"] = (datepicker_picker);
|
|
8085
10299
|
|
|
10300
|
+
/***/ }),
|
|
10301
|
+
|
|
10302
|
+
/***/ 9:
|
|
10303
|
+
/***/ (function(module, exports) {
|
|
10304
|
+
|
|
10305
|
+
module.exports = require("babel-runtime/helpers/typeof");
|
|
10306
|
+
|
|
8086
10307
|
/***/ })
|
|
8087
10308
|
|
|
8088
10309
|
/******/ });
|