@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/timepicker.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("./_util/proptype"), require("./icon"), require("
|
|
3
|
+
module.exports = factory(require("vue"), require("./_util/proptype"), require("./icon"), require("./transition"), require("./_mixin/emitter"), require("./button"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["./_util/proptype", "./icon", "
|
|
5
|
+
define(["vue", "./_util/proptype", "./icon", "./transition", "./_mixin/emitter", "./button"], factory);
|
|
6
6
|
else {
|
|
7
|
-
var a = typeof exports === 'object' ? factory(require("./_util/proptype"), require("./icon"), require("
|
|
7
|
+
var a = typeof exports === 'object' ? factory(require("vue"), require("./_util/proptype"), require("./icon"), require("./transition"), require("./_mixin/emitter"), require("./button")) : factory(root["Vue"], root["./_util/proptype"], root["./icon"], root["./transition"], root["./_mixin/emitter"], root["./button"]);
|
|
8
8
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
9
9
|
}
|
|
10
|
-
})(window, function(
|
|
10
|
+
})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__8__, __WEBPACK_EXTERNAL_MODULE__11__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__13__) {
|
|
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 = 94);
|
|
95
95
|
/******/ })
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
@@ -204,76 +204,2657 @@ function normalizeComponent (
|
|
|
204
204
|
/***/ }),
|
|
205
205
|
|
|
206
206
|
/***/ 1:
|
|
207
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
208
|
+
|
|
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__);
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
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);
|
|
235
|
+
|
|
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
|
+
};
|
|
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
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}();
|
|
263
|
+
|
|
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);
|
|
288
|
+
};
|
|
289
|
+
on(el, event, listener);
|
|
290
|
+
};
|
|
291
|
+
|
|
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;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (!el.classList) {
|
|
322
|
+
el.setAttribute('class', curClass);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
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];
|
|
381
|
+
}
|
|
382
|
+
};
|
|
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
|
+
/***/ 11:
|
|
503
|
+
/***/ (function(module, exports) {
|
|
504
|
+
|
|
505
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__11__;
|
|
506
|
+
|
|
507
|
+
/***/ }),
|
|
508
|
+
|
|
509
|
+
/***/ 12:
|
|
510
|
+
/***/ (function(module, exports) {
|
|
511
|
+
|
|
512
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
|
|
513
|
+
|
|
514
|
+
/***/ }),
|
|
515
|
+
|
|
516
|
+
/***/ 13:
|
|
517
|
+
/***/ (function(module, exports) {
|
|
518
|
+
|
|
519
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
|
|
520
|
+
|
|
521
|
+
/***/ }),
|
|
522
|
+
|
|
523
|
+
/***/ 139:
|
|
524
|
+
/***/ (function(module, exports) {
|
|
525
|
+
|
|
526
|
+
// removed by extract-text-webpack-plugin
|
|
527
|
+
|
|
528
|
+
/***/ }),
|
|
529
|
+
|
|
530
|
+
/***/ 14:
|
|
531
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
532
|
+
|
|
533
|
+
"use strict";
|
|
534
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
535
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
536
|
+
/* harmony import */ var _dom_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
537
|
+
/* harmony import */ var _popup_manager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
|
|
538
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _popup_manager__WEBPACK_IMPORTED_MODULE_2__["a"]; });
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
var idSeed = 1;
|
|
545
|
+
|
|
546
|
+
var scrollBarWidth = void 0;
|
|
547
|
+
|
|
548
|
+
/* harmony default export */ __webpack_exports__["b"] = ({
|
|
549
|
+
props: {
|
|
550
|
+
visibility: {
|
|
551
|
+
type: Boolean,
|
|
552
|
+
default: false
|
|
553
|
+
},
|
|
554
|
+
openDelay: {},
|
|
555
|
+
closeDelay: {},
|
|
556
|
+
zIndex: {},
|
|
557
|
+
modal: {
|
|
558
|
+
type: Boolean,
|
|
559
|
+
default: false
|
|
560
|
+
},
|
|
561
|
+
modalFade: {
|
|
562
|
+
type: Boolean,
|
|
563
|
+
default: true
|
|
564
|
+
},
|
|
565
|
+
modalClass: {},
|
|
566
|
+
modalAppendToBody: {
|
|
567
|
+
type: Boolean,
|
|
568
|
+
default: false
|
|
569
|
+
},
|
|
570
|
+
lockScroll: {
|
|
571
|
+
type: Boolean,
|
|
572
|
+
default: true
|
|
573
|
+
},
|
|
574
|
+
closeOnPressEscape: {
|
|
575
|
+
type: Boolean,
|
|
576
|
+
default: false
|
|
577
|
+
},
|
|
578
|
+
closeOnClickModal: {
|
|
579
|
+
type: Boolean,
|
|
580
|
+
default: false
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
|
|
584
|
+
beforeMount: function beforeMount() {
|
|
585
|
+
this._popupId = 'popup-' + idSeed++;
|
|
586
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].register(this._popupId, this);
|
|
587
|
+
},
|
|
588
|
+
beforeDestroy: function beforeDestroy() {
|
|
589
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].deregister(this._popupId);
|
|
590
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].closeModal(this._popupId);
|
|
591
|
+
|
|
592
|
+
this.restoreBodyStyle();
|
|
593
|
+
},
|
|
594
|
+
data: function data() {
|
|
595
|
+
return {
|
|
596
|
+
opened: false,
|
|
597
|
+
bodyPaddingRight: null,
|
|
598
|
+
computedBodyPaddingRight: 0,
|
|
599
|
+
withoutHiddenClass: true,
|
|
600
|
+
rendered: false
|
|
601
|
+
};
|
|
602
|
+
},
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
watch: {
|
|
606
|
+
visibility: function visibility(val) {
|
|
607
|
+
var _this = this;
|
|
608
|
+
|
|
609
|
+
if (val) {
|
|
610
|
+
if (this._opening) return;
|
|
611
|
+
if (!this.rendered) {
|
|
612
|
+
this.rendered = true;
|
|
613
|
+
vue__WEBPACK_IMPORTED_MODULE_0___default.a.nextTick(function () {
|
|
614
|
+
_this.open();
|
|
615
|
+
});
|
|
616
|
+
} else {
|
|
617
|
+
this.open();
|
|
618
|
+
}
|
|
619
|
+
} else {
|
|
620
|
+
this.close();
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
|
|
625
|
+
methods: {
|
|
626
|
+
open: function open(options) {
|
|
627
|
+
var _this2 = this;
|
|
628
|
+
|
|
629
|
+
if (!this.rendered) {
|
|
630
|
+
this.rendered = true;
|
|
631
|
+
}
|
|
632
|
+
var props = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* merge */ "e"])({}, this.$props || this, options);
|
|
633
|
+
|
|
634
|
+
if (this._closeTimer) {
|
|
635
|
+
clearTimeout(this._closeTimer);
|
|
636
|
+
this._closeTimer = null;
|
|
637
|
+
}
|
|
638
|
+
clearTimeout(this._openTimer);
|
|
639
|
+
|
|
640
|
+
var openDelay = Number(props.openDelay);
|
|
641
|
+
if (openDelay > 0) {
|
|
642
|
+
this._openTimer = setTimeout(function () {
|
|
643
|
+
_this2._openTimer = null;
|
|
644
|
+
_this2.doOpen(props);
|
|
645
|
+
}, openDelay);
|
|
646
|
+
} else {
|
|
647
|
+
this.doOpen(props);
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
doOpen: function doOpen(props) {
|
|
651
|
+
if (this.$isServer) return;
|
|
652
|
+
if (this.willOpen && !this.willOpen()) return;
|
|
653
|
+
if (this.opened) return;
|
|
654
|
+
|
|
655
|
+
this._opening = true;
|
|
656
|
+
|
|
657
|
+
var dom = this.$el;
|
|
658
|
+
|
|
659
|
+
var modal = props.modal;
|
|
660
|
+
|
|
661
|
+
var zIndex = props.zIndex;
|
|
662
|
+
if (zIndex) {
|
|
663
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].zIndex = zIndex;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
if (modal) {
|
|
667
|
+
if (this._closing) {
|
|
668
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].closeModal(this._popupId);
|
|
669
|
+
this._closing = false;
|
|
670
|
+
}
|
|
671
|
+
_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);
|
|
672
|
+
if (props.lockScroll) {
|
|
673
|
+
this.withoutHiddenClass = !Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* hasClass */ "d"])(document.body, 'mds-popup-parent--hidden');
|
|
674
|
+
if (this.withoutHiddenClass) {
|
|
675
|
+
this.bodyPaddingRight = document.body.style.paddingRight;
|
|
676
|
+
this.computedBodyPaddingRight = parseInt(Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* getStyle */ "c"])(document.body, 'paddingRight'), 10);
|
|
677
|
+
}
|
|
678
|
+
scrollBarWidth = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* getScrollBarWidth */ "b"])();
|
|
679
|
+
var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
|
|
680
|
+
var bodyOverflowY = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* getStyle */ "c"])(document.body, 'overflowY');
|
|
681
|
+
if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
|
|
682
|
+
document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
|
|
683
|
+
}
|
|
684
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(document.body, 'mds-popup-parent--hidden');
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if (getComputedStyle(dom).position === 'static') {
|
|
689
|
+
dom.style.position = 'absolute';
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
dom.style.zIndex = _popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].nextZIndex();
|
|
693
|
+
this.opened = true;
|
|
694
|
+
|
|
695
|
+
this.onOpen && this.onOpen();
|
|
696
|
+
|
|
697
|
+
this.doAfterOpen();
|
|
698
|
+
},
|
|
699
|
+
doAfterOpen: function doAfterOpen() {
|
|
700
|
+
this._opening = false;
|
|
701
|
+
},
|
|
702
|
+
close: function close() {
|
|
703
|
+
var _this3 = this;
|
|
704
|
+
|
|
705
|
+
if (this.willClose && !this.willClose()) return;
|
|
706
|
+
|
|
707
|
+
if (this._openTimer !== null) {
|
|
708
|
+
clearTimeout(this._openTimer);
|
|
709
|
+
this._openTimer = null;
|
|
710
|
+
}
|
|
711
|
+
clearTimeout(this._closeTimer);
|
|
712
|
+
|
|
713
|
+
var closeDelay = Number(this.closeDelay);
|
|
714
|
+
|
|
715
|
+
if (closeDelay > 0) {
|
|
716
|
+
this._closeTimer = setTimeout(function () {
|
|
717
|
+
_this3._closeTimer = null;
|
|
718
|
+
_this3.doClose();
|
|
719
|
+
}, closeDelay);
|
|
720
|
+
} else {
|
|
721
|
+
this.doClose();
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
doClose: function doClose() {
|
|
725
|
+
this._closing = true;
|
|
726
|
+
|
|
727
|
+
this.onClose && this.onClose();
|
|
728
|
+
|
|
729
|
+
if (this.lockScroll) {
|
|
730
|
+
setTimeout(this.restoreBodyStyle, 200);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
this.opened = false;
|
|
734
|
+
|
|
735
|
+
this.doAfterClose();
|
|
736
|
+
},
|
|
737
|
+
doAfterClose: function doAfterClose() {
|
|
738
|
+
_popup_manager__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].closeModal(this._popupId);
|
|
739
|
+
this._closing = false;
|
|
740
|
+
},
|
|
741
|
+
restoreBodyStyle: function restoreBodyStyle() {
|
|
742
|
+
if (this.modal && this.withoutHiddenClass) {
|
|
743
|
+
document.body.style.paddingRight = this.bodyPaddingRight;
|
|
744
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(document.body, 'mds-popup-parent--hidden');
|
|
745
|
+
}
|
|
746
|
+
this.withoutHiddenClass = true;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
/***/ }),
|
|
754
|
+
|
|
755
|
+
/***/ 17:
|
|
756
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
757
|
+
|
|
758
|
+
"use strict";
|
|
759
|
+
|
|
760
|
+
// EXTERNAL MODULE: ./components/_util/_popper/popup/popup-main.js
|
|
761
|
+
var popup_main = __webpack_require__(14);
|
|
762
|
+
|
|
763
|
+
// EXTERNAL MODULE: external "babel-runtime/core-js/object/get-own-property-descriptor"
|
|
764
|
+
var get_own_property_descriptor_ = __webpack_require__(18);
|
|
765
|
+
var get_own_property_descriptor_default = /*#__PURE__*/__webpack_require__.n(get_own_property_descriptor_);
|
|
766
|
+
|
|
767
|
+
// EXTERNAL MODULE: external "babel-runtime/core-js/object/keys"
|
|
768
|
+
var keys_ = __webpack_require__(10);
|
|
769
|
+
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
770
|
+
|
|
771
|
+
// EXTERNAL MODULE: external "babel-runtime/core-js/object/assign"
|
|
772
|
+
var assign_ = __webpack_require__(6);
|
|
773
|
+
var assign_default = /*#__PURE__*/__webpack_require__.n(assign_);
|
|
774
|
+
|
|
775
|
+
// CONCATENATED MODULE: ./components/_util/_popper/popper.js
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
781
|
+
* @version {{version}}
|
|
782
|
+
* @license
|
|
783
|
+
* Copyright (c) 2016 Federico Zivolo and contributors
|
|
784
|
+
*
|
|
785
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
786
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
787
|
+
* in the Software without restriction, including without limitation the rights
|
|
788
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
789
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
790
|
+
* furnished to do so, subject to the following conditions:
|
|
791
|
+
*
|
|
792
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
793
|
+
* copies or substantial portions of the Software.
|
|
794
|
+
*
|
|
795
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
796
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
797
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
798
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
799
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
800
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
801
|
+
* SOFTWARE.
|
|
802
|
+
*/
|
|
803
|
+
/* eslint-disable */
|
|
804
|
+
// Cross module loader
|
|
805
|
+
// Supported: Node, AMD, Browser globals
|
|
806
|
+
//
|
|
807
|
+
function popper_createPopper() {
|
|
808
|
+
'use strict';
|
|
809
|
+
|
|
810
|
+
var root = window;
|
|
811
|
+
|
|
812
|
+
// default options
|
|
813
|
+
var DEFAULTS = {
|
|
814
|
+
// placement of the popper
|
|
815
|
+
placement: 'bottom',
|
|
816
|
+
|
|
817
|
+
gpuAcceleration: false,
|
|
818
|
+
|
|
819
|
+
// shift popper from its origin by the given amount of pixels (can be negative)
|
|
820
|
+
offset: 0,
|
|
821
|
+
|
|
822
|
+
// the element which will act as boundary of the popper
|
|
823
|
+
boundariesElement: 'viewport',
|
|
824
|
+
|
|
825
|
+
// amount of pixel used to define a minimum distance between the boundaries and the popper
|
|
826
|
+
boundariesPadding: 5,
|
|
827
|
+
|
|
828
|
+
// popper will try to prevent overflow following this order,
|
|
829
|
+
// by default, then, it could overflow on the left and on top of the boundariesElement
|
|
830
|
+
preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
|
831
|
+
|
|
832
|
+
// the behavior used by flip to change the placement of the popper
|
|
833
|
+
flipBehavior: 'flip',
|
|
834
|
+
|
|
835
|
+
arrowElement: '[x-arrow]',
|
|
836
|
+
|
|
837
|
+
arrowOffset: 0,
|
|
838
|
+
|
|
839
|
+
// list of functions used to modify the offsets before they are applied to the popper
|
|
840
|
+
modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
|
|
841
|
+
|
|
842
|
+
modifiersIgnored: [],
|
|
843
|
+
|
|
844
|
+
forceAbsolute: false
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Create a new Popper.js instance
|
|
848
|
+
* @constructor Popper
|
|
849
|
+
* @param {HTMLElement} reference - The reference element used to position the popper
|
|
850
|
+
* @param {HTMLElement|Object} popper
|
|
851
|
+
* The HTML element used as popper, or a configuration used to generate the popper.
|
|
852
|
+
* @param {String} [popper.tagName='div'] The tag name of the generated popper.
|
|
853
|
+
* @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.
|
|
854
|
+
* @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.
|
|
855
|
+
* @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.
|
|
856
|
+
* @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`.
|
|
857
|
+
* @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.
|
|
858
|
+
* @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.
|
|
859
|
+
* @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.
|
|
860
|
+
* @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.
|
|
861
|
+
* @param {Object} options
|
|
862
|
+
* @param {String} [options.placement=bottom]
|
|
863
|
+
* Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),
|
|
864
|
+
* left(-start, -end)`
|
|
865
|
+
*
|
|
866
|
+
* @param {HTMLElement|String} [options.arrowElement='[x-arrow]']
|
|
867
|
+
* The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of
|
|
868
|
+
* its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its
|
|
869
|
+
* reference element.
|
|
870
|
+
* By default, it will look for a child node of the popper with the `x-arrow` attribute.
|
|
871
|
+
*
|
|
872
|
+
* @param {Boolean} [options.gpuAcceleration=true]
|
|
873
|
+
* When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the
|
|
874
|
+
* browser to use the GPU to accelerate the rendering.
|
|
875
|
+
* If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.
|
|
876
|
+
*
|
|
877
|
+
* @param {Number} [options.offset=0]
|
|
878
|
+
* Amount of pixels the popper will be shifted (can be negative).
|
|
879
|
+
*
|
|
880
|
+
* @param {String|Element} [options.boundariesElement='viewport']
|
|
881
|
+
* The element which will define the boundaries of the popper position, the popper will never be placed outside
|
|
882
|
+
* of the defined boundaries (except if `keepTogether` is enabled)
|
|
883
|
+
*
|
|
884
|
+
* @param {Number} [options.boundariesPadding=5]
|
|
885
|
+
* Additional padding for the boundaries
|
|
886
|
+
*
|
|
887
|
+
* @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]
|
|
888
|
+
* Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,
|
|
889
|
+
* this means that the last ones will never overflow
|
|
890
|
+
*
|
|
891
|
+
* @param {String|Array} [options.flipBehavior='flip']
|
|
892
|
+
* The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to
|
|
893
|
+
* overlap its reference element. Defining `flip` as value, the placement will be flipped on
|
|
894
|
+
* its axis (`right - left`, `top - bottom`).
|
|
895
|
+
* You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify
|
|
896
|
+
* how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,
|
|
897
|
+
* then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)
|
|
898
|
+
*
|
|
899
|
+
* @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]
|
|
900
|
+
* List of functions used to modify the data before they are applied to the popper, add your custom functions
|
|
901
|
+
* to this array to edit the offsets and placement.
|
|
902
|
+
* The function should reflect the @params and @returns of preventOverflow
|
|
903
|
+
*
|
|
904
|
+
* @param {Array} [options.modifiersIgnored=[]]
|
|
905
|
+
* Put here any built-in modifier name you want to exclude from the modifiers list
|
|
906
|
+
* The function should reflect the @params and @returns of preventOverflow
|
|
907
|
+
*
|
|
908
|
+
* @param {Boolean} [options.removeOnDestroy=false]
|
|
909
|
+
* Set to true if you want to automatically remove the popper when you call the `destroy` method.
|
|
910
|
+
*/
|
|
911
|
+
};function Popper(reference, popper, options) {
|
|
912
|
+
this._reference = reference.jquery ? reference[0] : reference;
|
|
913
|
+
this.state = {};
|
|
914
|
+
|
|
915
|
+
// if the popper variable is a configuration object, parse it to generate an HTMLElement
|
|
916
|
+
// generate a default popper if is not defined
|
|
917
|
+
var isNotDefined = typeof popper === 'undefined' || popper === null;
|
|
918
|
+
var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';
|
|
919
|
+
if (isNotDefined || isConfig) {
|
|
920
|
+
this._popper = this.parse(isConfig ? popper : {});
|
|
921
|
+
}
|
|
922
|
+
// otherwise, use the given HTMLElement as popper
|
|
923
|
+
else {
|
|
924
|
+
this._popper = popper.jquery ? popper[0] : popper;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
// with {} we create a new object with the options inside it
|
|
928
|
+
this._options = assign_default()({}, DEFAULTS, options);
|
|
929
|
+
|
|
930
|
+
// refactoring modifiers' list
|
|
931
|
+
this._options.modifiers = this._options.modifiers.map(function (modifier) {
|
|
932
|
+
// remove ignored modifiers
|
|
933
|
+
if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
|
|
934
|
+
|
|
935
|
+
// set the x-placement attribute before everything else because it could be used to add margins to the popper
|
|
936
|
+
// margins needs to be calculated to get the correct popper offsets
|
|
937
|
+
if (modifier === 'applyStyle') {
|
|
938
|
+
this._popper.setAttribute('x-placement', this._options.placement);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// return predefined modifier identified by string or keep the custom one
|
|
942
|
+
return this.modifiers[modifier] || modifier;
|
|
943
|
+
}.bind(this));
|
|
944
|
+
|
|
945
|
+
// make sure to apply the popper position before any computation
|
|
946
|
+
this.state.position = this._getPosition(this._popper, this._reference);
|
|
947
|
+
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
948
|
+
|
|
949
|
+
// fire the first update to position the popper in the right place
|
|
950
|
+
this.update();
|
|
951
|
+
|
|
952
|
+
// setup event listeners, they will take care of update the position in specific situations
|
|
953
|
+
this._setupEventListeners();
|
|
954
|
+
return this;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
//
|
|
958
|
+
// Methods
|
|
959
|
+
//
|
|
960
|
+
/**
|
|
961
|
+
* Destroy the popper
|
|
962
|
+
* @method
|
|
963
|
+
* @memberof Popper
|
|
964
|
+
*/
|
|
965
|
+
Popper.prototype.destroy = function () {
|
|
966
|
+
this._popper.removeAttribute('x-placement');
|
|
967
|
+
this._popper.style.left = '';
|
|
968
|
+
this._popper.style.position = '';
|
|
969
|
+
this._popper.style.top = '';
|
|
970
|
+
this._popper.style[getSupportedPropertyName('transform')] = '';
|
|
971
|
+
this._removeEventListeners();
|
|
972
|
+
|
|
973
|
+
// remove the popper if user explicity asked for the deletion on destroy
|
|
974
|
+
if (this._options.removeOnDestroy) {
|
|
975
|
+
this._popper.remove();
|
|
976
|
+
}
|
|
977
|
+
return this;
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Updates the position of the popper, computing the new offsets and applying the new style
|
|
982
|
+
* @method
|
|
983
|
+
* @memberof Popper
|
|
984
|
+
*/
|
|
985
|
+
Popper.prototype.update = function () {
|
|
986
|
+
var data = { instance: this, styles: {}
|
|
987
|
+
|
|
988
|
+
// store placement inside the data object, modifiers will be able to edit `placement` if needed
|
|
989
|
+
// and refer to _originalPlacement to know the original value
|
|
990
|
+
};data.placement = this._options.placement;
|
|
991
|
+
data._originalPlacement = this._options.placement;
|
|
992
|
+
|
|
993
|
+
// compute the popper and reference offsets and put them inside data.offsets
|
|
994
|
+
data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
|
|
995
|
+
|
|
996
|
+
// get boundaries
|
|
997
|
+
data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
|
|
998
|
+
|
|
999
|
+
data = this.runModifiers(data, this._options.modifiers);
|
|
1000
|
+
|
|
1001
|
+
if (typeof this.state.updateCallback === 'function') {
|
|
1002
|
+
this.state.updateCallback(data);
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.
|
|
1008
|
+
* @method
|
|
1009
|
+
* @memberof Popper
|
|
1010
|
+
* @param {Function} callback
|
|
1011
|
+
*/
|
|
1012
|
+
Popper.prototype.onCreate = function (callback) {
|
|
1013
|
+
// the createCallbacks return as first argument the popper instance
|
|
1014
|
+
callback(this);
|
|
1015
|
+
return this;
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations
|
|
1020
|
+
* used to style popper and its arrow.
|
|
1021
|
+
* NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!
|
|
1022
|
+
* @method
|
|
1023
|
+
* @memberof Popper
|
|
1024
|
+
* @param {Function} callback
|
|
1025
|
+
*/
|
|
1026
|
+
Popper.prototype.onUpdate = function (callback) {
|
|
1027
|
+
this.state.updateCallback = callback;
|
|
1028
|
+
return this;
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Helper used to generate poppers from a configuration file
|
|
1033
|
+
* @method
|
|
1034
|
+
* @memberof Popper
|
|
1035
|
+
* @param config {Object} configuration
|
|
1036
|
+
* @returns {HTMLElement} popper
|
|
1037
|
+
*/
|
|
1038
|
+
Popper.prototype.parse = function (config) {
|
|
1039
|
+
var defaultConfig = {
|
|
1040
|
+
tagName: 'div',
|
|
1041
|
+
classNames: ['popper'],
|
|
1042
|
+
attributes: [],
|
|
1043
|
+
parent: root.document.body,
|
|
1044
|
+
content: '',
|
|
1045
|
+
contentType: 'text',
|
|
1046
|
+
arrowTagName: 'div',
|
|
1047
|
+
arrowClassNames: ['popper__arrow'],
|
|
1048
|
+
arrowAttributes: ['x-arrow']
|
|
1049
|
+
};
|
|
1050
|
+
config = assign_default()({}, defaultConfig, config);
|
|
1051
|
+
|
|
1052
|
+
var d = root.document;
|
|
1053
|
+
|
|
1054
|
+
var popper = d.createElement(config.tagName);
|
|
1055
|
+
addClassNames(popper, config.classNames);
|
|
1056
|
+
addAttributes(popper, config.attributes);
|
|
1057
|
+
if (config.contentType === 'node') {
|
|
1058
|
+
popper.appendChild(config.content.jquery ? config.content[0] : config.content);
|
|
1059
|
+
} else if (config.contentType === 'html') {
|
|
1060
|
+
popper.innerHTML = config.content;
|
|
1061
|
+
} else {
|
|
1062
|
+
popper.textContent = config.content;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
if (config.arrowTagName) {
|
|
1066
|
+
var arrow = d.createElement(config.arrowTagName);
|
|
1067
|
+
addClassNames(arrow, config.arrowClassNames);
|
|
1068
|
+
addAttributes(arrow, config.arrowAttributes);
|
|
1069
|
+
popper.appendChild(arrow);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
var parent = config.parent.jquery ? config.parent[0] : config.parent;
|
|
1073
|
+
|
|
1074
|
+
// if the given parent is a string, use it to match an element
|
|
1075
|
+
// if more than one element is matched, the first one will be used as parent
|
|
1076
|
+
// if no elements are matched, the script will throw an error
|
|
1077
|
+
if (typeof parent === 'string') {
|
|
1078
|
+
parent = d.querySelectorAll(config.parent);
|
|
1079
|
+
if (parent.length > 1) {
|
|
1080
|
+
console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');
|
|
1081
|
+
}
|
|
1082
|
+
if (parent.length === 0) {
|
|
1083
|
+
throw "ERROR: the given `parent` doesn't exists!";
|
|
1084
|
+
}
|
|
1085
|
+
parent = parent[0];
|
|
1086
|
+
}
|
|
1087
|
+
// if the given parent is a DOM nodes list or an array of nodes with more than one element,
|
|
1088
|
+
// the first one will be used as parent
|
|
1089
|
+
if (parent.length > 1 && parent instanceof Element === false) {
|
|
1090
|
+
console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');
|
|
1091
|
+
parent = parent[0];
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// append the generated popper to its parent
|
|
1095
|
+
parent.appendChild(popper);
|
|
1096
|
+
|
|
1097
|
+
return popper;
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Adds class names to the given element
|
|
1101
|
+
* @function
|
|
1102
|
+
* @ignore
|
|
1103
|
+
* @param {HTMLElement} target
|
|
1104
|
+
* @param {Array} classes
|
|
1105
|
+
*/
|
|
1106
|
+
function addClassNames(element, classNames) {
|
|
1107
|
+
classNames.forEach(function (className) {
|
|
1108
|
+
element.classList.add(className);
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Adds attributes to the given element
|
|
1114
|
+
* @function
|
|
1115
|
+
* @ignore
|
|
1116
|
+
* @param {HTMLElement} target
|
|
1117
|
+
* @param {Array} attributes
|
|
1118
|
+
* @example
|
|
1119
|
+
* addAttributes(element, [ 'data-info:foobar' ]);
|
|
1120
|
+
*/
|
|
1121
|
+
function addAttributes(element, attributes) {
|
|
1122
|
+
attributes.forEach(function (attribute) {
|
|
1123
|
+
element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Helper used to get the position which will be applied to the popper
|
|
1130
|
+
* @method
|
|
1131
|
+
* @memberof Popper
|
|
1132
|
+
* @param config {HTMLElement} popper element
|
|
1133
|
+
* @param reference {HTMLElement} reference element
|
|
1134
|
+
* @returns {String} position
|
|
1135
|
+
*/
|
|
1136
|
+
Popper.prototype._getPosition = function (popper, reference) {
|
|
1137
|
+
var container = getOffsetParent(reference);
|
|
1138
|
+
|
|
1139
|
+
if (this._options.forceAbsolute) {
|
|
1140
|
+
return 'absolute';
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
// Decide if the popper will be fixed
|
|
1144
|
+
// If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together
|
|
1145
|
+
var isParentFixed = isFixed(reference, container);
|
|
1146
|
+
return isParentFixed ? 'fixed' : 'absolute';
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* Get offsets to the popper
|
|
1151
|
+
* @method
|
|
1152
|
+
* @memberof Popper
|
|
1153
|
+
* @access private
|
|
1154
|
+
* @param {Element} popper - the popper element
|
|
1155
|
+
* @param {Element} reference - the reference element (the popper will be relative to this)
|
|
1156
|
+
* @returns {Object} An object containing the offsets which will be applied to the popper
|
|
1157
|
+
*/
|
|
1158
|
+
Popper.prototype._getOffsets = function (popper, reference, placement) {
|
|
1159
|
+
placement = placement.split('-')[0];
|
|
1160
|
+
var popperOffsets = {};
|
|
1161
|
+
|
|
1162
|
+
popperOffsets.position = this.state.position;
|
|
1163
|
+
var isParentFixed = popperOffsets.position === 'fixed';
|
|
1164
|
+
|
|
1165
|
+
//
|
|
1166
|
+
// Get reference element position
|
|
1167
|
+
//
|
|
1168
|
+
var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
|
|
1169
|
+
|
|
1170
|
+
//
|
|
1171
|
+
// Get popper sizes
|
|
1172
|
+
//
|
|
1173
|
+
var popperRect = getOuterSizes(popper);
|
|
1174
|
+
|
|
1175
|
+
//
|
|
1176
|
+
// Compute offsets of popper
|
|
1177
|
+
//
|
|
1178
|
+
|
|
1179
|
+
// depending by the popper placement we have to compute its offsets slightly differently
|
|
1180
|
+
if (['right', 'left'].indexOf(placement) !== -1) {
|
|
1181
|
+
popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
|
|
1182
|
+
if (placement === 'left') {
|
|
1183
|
+
popperOffsets.left = referenceOffsets.left - popperRect.width;
|
|
1184
|
+
} else {
|
|
1185
|
+
popperOffsets.left = referenceOffsets.right;
|
|
1186
|
+
}
|
|
1187
|
+
} else {
|
|
1188
|
+
popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
|
|
1189
|
+
if (placement === 'top') {
|
|
1190
|
+
popperOffsets.top = referenceOffsets.top - popperRect.height;
|
|
1191
|
+
} else {
|
|
1192
|
+
popperOffsets.top = referenceOffsets.bottom;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
// Add width and height to our offsets object
|
|
1197
|
+
popperOffsets.width = popperRect.width;
|
|
1198
|
+
popperOffsets.height = popperRect.height;
|
|
1199
|
+
|
|
1200
|
+
return {
|
|
1201
|
+
popper: popperOffsets,
|
|
1202
|
+
reference: referenceOffsets
|
|
1203
|
+
};
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* Setup needed event listeners used to update the popper position
|
|
1208
|
+
* @method
|
|
1209
|
+
* @memberof Popper
|
|
1210
|
+
* @access private
|
|
1211
|
+
*/
|
|
1212
|
+
Popper.prototype._setupEventListeners = function () {
|
|
1213
|
+
// NOTE: 1 DOM access here
|
|
1214
|
+
this.state.updateBound = this.update.bind(this);
|
|
1215
|
+
root.addEventListener('resize', this.state.updateBound);
|
|
1216
|
+
// if the boundariesElement is window we don't need to listen for the scroll event
|
|
1217
|
+
if (this._options.boundariesElement !== 'window') {
|
|
1218
|
+
var target = getScrollParent(this._reference);
|
|
1219
|
+
// here it could be both `body` or `documentElement` thanks to Firefox, we then check both
|
|
1220
|
+
if (target === root.document.body || target === root.document.documentElement) {
|
|
1221
|
+
target = root;
|
|
1222
|
+
}
|
|
1223
|
+
target.addEventListener('scroll', this.state.updateBound);
|
|
1224
|
+
this.state.scrollTarget = target;
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
/**
|
|
1229
|
+
* Remove event listeners used to update the popper position
|
|
1230
|
+
* @method
|
|
1231
|
+
* @memberof Popper
|
|
1232
|
+
* @access private
|
|
1233
|
+
*/
|
|
1234
|
+
Popper.prototype._removeEventListeners = function () {
|
|
1235
|
+
// NOTE: 1 DOM access here
|
|
1236
|
+
root.removeEventListener('resize', this.state.updateBound);
|
|
1237
|
+
if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
|
|
1238
|
+
this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);
|
|
1239
|
+
this.state.scrollTarget = null;
|
|
1240
|
+
}
|
|
1241
|
+
this.state.updateBound = null;
|
|
1242
|
+
};
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* Computed the boundaries limits and return them
|
|
1246
|
+
* @method
|
|
1247
|
+
* @memberof Popper
|
|
1248
|
+
* @access private
|
|
1249
|
+
* @param {Object} data - Object containing the property "offsets" generated by `_getOffsets`
|
|
1250
|
+
* @param {Number} padding - Boundaries padding
|
|
1251
|
+
* @param {Element} boundariesElement - Element used to define the boundaries
|
|
1252
|
+
* @returns {Object} Coordinates of the boundaries
|
|
1253
|
+
*/
|
|
1254
|
+
Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
|
1255
|
+
// NOTE: 1 DOM access here
|
|
1256
|
+
var boundaries = {};
|
|
1257
|
+
var width, height;
|
|
1258
|
+
if (boundariesElement === 'window') {
|
|
1259
|
+
var body = root.document.body,
|
|
1260
|
+
html = root.document.documentElement;
|
|
1261
|
+
|
|
1262
|
+
height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
|
|
1263
|
+
width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
|
|
1264
|
+
|
|
1265
|
+
boundaries = {
|
|
1266
|
+
top: 0,
|
|
1267
|
+
right: width,
|
|
1268
|
+
bottom: height,
|
|
1269
|
+
left: 0
|
|
1270
|
+
};
|
|
1271
|
+
} else if (boundariesElement === 'viewport') {
|
|
1272
|
+
var offsetParent = getOffsetParent(this._popper);
|
|
1273
|
+
var scrollParent = getScrollParent(this._popper);
|
|
1274
|
+
var offsetParentRect = getOffsetRect(offsetParent);
|
|
1275
|
+
|
|
1276
|
+
// Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`
|
|
1277
|
+
var getScrollTopValue = function getScrollTopValue(element) {
|
|
1278
|
+
return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;
|
|
1279
|
+
};
|
|
1280
|
+
var getScrollLeftValue = function getScrollLeftValue(element) {
|
|
1281
|
+
return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
// if the popper is fixed we don't have to substract scrolling from the boundaries
|
|
1285
|
+
var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);
|
|
1286
|
+
var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);
|
|
1287
|
+
|
|
1288
|
+
boundaries = {
|
|
1289
|
+
top: 0 - (offsetParentRect.top - scrollTop),
|
|
1290
|
+
right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
|
|
1291
|
+
bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
|
|
1292
|
+
left: 0 - (offsetParentRect.left - scrollLeft)
|
|
1293
|
+
};
|
|
1294
|
+
} else {
|
|
1295
|
+
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
1296
|
+
boundaries = {
|
|
1297
|
+
top: 0,
|
|
1298
|
+
left: 0,
|
|
1299
|
+
right: boundariesElement.clientWidth,
|
|
1300
|
+
bottom: boundariesElement.clientHeight
|
|
1301
|
+
};
|
|
1302
|
+
} else {
|
|
1303
|
+
boundaries = getOffsetRect(boundariesElement);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
boundaries.left += padding;
|
|
1307
|
+
boundaries.right -= padding;
|
|
1308
|
+
boundaries.top = boundaries.top + padding;
|
|
1309
|
+
boundaries.bottom = boundaries.bottom - padding;
|
|
1310
|
+
return boundaries;
|
|
1311
|
+
};
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* Loop trough the list of modifiers and run them in order, each of them will then edit the data object
|
|
1315
|
+
* @method
|
|
1316
|
+
* @memberof Popper
|
|
1317
|
+
* @access public
|
|
1318
|
+
* @param {Object} data
|
|
1319
|
+
* @param {Array} modifiers
|
|
1320
|
+
* @param {Function} ends
|
|
1321
|
+
*/
|
|
1322
|
+
Popper.prototype.runModifiers = function (data, modifiers, ends) {
|
|
1323
|
+
var modifiersToRun = modifiers.slice();
|
|
1324
|
+
if (ends !== undefined) {
|
|
1325
|
+
modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
modifiersToRun.forEach(function (modifier) {
|
|
1329
|
+
if (isFunction(modifier)) {
|
|
1330
|
+
data = modifier.call(this, data);
|
|
1331
|
+
}
|
|
1332
|
+
}.bind(this));
|
|
1333
|
+
|
|
1334
|
+
return data;
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* Helper used to know if the given modifier depends from another one.
|
|
1339
|
+
* @method
|
|
1340
|
+
* @memberof Popper
|
|
1341
|
+
* @param {String} requesting - name of requesting modifier
|
|
1342
|
+
* @param {String} requested - name of requested modifier
|
|
1343
|
+
* @returns {Boolean}
|
|
1344
|
+
*/
|
|
1345
|
+
Popper.prototype.isModifierRequired = function (requesting, requested) {
|
|
1346
|
+
var index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
1347
|
+
return !!this._options.modifiers.slice(0, index).filter(function (modifier) {
|
|
1348
|
+
return modifier === requested;
|
|
1349
|
+
}).length;
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
//
|
|
1353
|
+
// Modifiers
|
|
1354
|
+
//
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Modifiers list
|
|
1358
|
+
* @namespace Popper.modifiers
|
|
1359
|
+
* @memberof Popper
|
|
1360
|
+
* @type {Object}
|
|
1361
|
+
*/
|
|
1362
|
+
Popper.prototype.modifiers = {};
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* Apply the computed styles to the popper element
|
|
1366
|
+
* @method
|
|
1367
|
+
* @memberof Popper.modifiers
|
|
1368
|
+
* @argument {Object} data - The data object generated by `update` method
|
|
1369
|
+
* @returns {Object} The same data object
|
|
1370
|
+
*/
|
|
1371
|
+
Popper.prototype.modifiers.applyStyle = function (data) {
|
|
1372
|
+
// apply the final offsets to the popper
|
|
1373
|
+
// NOTE: 1 DOM access here
|
|
1374
|
+
var styles = {
|
|
1375
|
+
position: data.offsets.popper.position
|
|
1376
|
+
|
|
1377
|
+
// round top and left to avoid blurry text
|
|
1378
|
+
};var left = Math.round(data.offsets.popper.left);
|
|
1379
|
+
var top = Math.round(data.offsets.popper.top);
|
|
1380
|
+
|
|
1381
|
+
// if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper
|
|
1382
|
+
// we automatically use the supported prefixed version if needed
|
|
1383
|
+
var prefixedProperty;
|
|
1384
|
+
if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {
|
|
1385
|
+
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
|
1386
|
+
styles.top = 0;
|
|
1387
|
+
styles.left = 0;
|
|
1388
|
+
}
|
|
1389
|
+
// othwerise, we use the standard `left` and `top` properties
|
|
1390
|
+
else {
|
|
1391
|
+
styles.left = left;
|
|
1392
|
+
styles.top = top;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
// any property present in `data.styles` will be applied to the popper,
|
|
1396
|
+
// in this way we can make the 3rd party modifiers add custom styles to it
|
|
1397
|
+
// Be aware, modifiers could override the properties defined in the previous
|
|
1398
|
+
// lines of this modifier!
|
|
1399
|
+
assign_default()(styles, data.styles);
|
|
1400
|
+
|
|
1401
|
+
setStyle(this._popper, styles);
|
|
1402
|
+
|
|
1403
|
+
// set an attribute which will be useful to style the tooltip (use it to properly position its arrow)
|
|
1404
|
+
// NOTE: 1 DOM access here
|
|
1405
|
+
if (!this._popper._prevClass.includes('mds-date-picker')) {
|
|
1406
|
+
this._popper.setAttribute('x-placement', data.placement);
|
|
1407
|
+
var popper = this._popper;
|
|
1408
|
+
var instanceType = popper.classList[0];
|
|
1409
|
+
popper.classList.replace(popper.classList[1], instanceType + '-placement-' + data.placement);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
// console.log(data.placement)
|
|
1413
|
+
|
|
1414
|
+
// if the arrow modifier is required and the arrow style has been computed, apply the arrow style
|
|
1415
|
+
if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
|
|
1416
|
+
setStyle(data.arrowElement, data.offsets.arrow);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
return data;
|
|
1420
|
+
};
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
* Modifier used to shift the popper on the start or end of its reference element side
|
|
1424
|
+
* @method
|
|
1425
|
+
* @memberof Popper.modifiers
|
|
1426
|
+
* @argument {Object} data - The data object generated by `update` method
|
|
1427
|
+
* @returns {Object} The data object, properly modified
|
|
1428
|
+
*/
|
|
1429
|
+
Popper.prototype.modifiers.shift = function (data) {
|
|
1430
|
+
var placement = data.placement;
|
|
1431
|
+
var basePlacement = placement.split('-')[0];
|
|
1432
|
+
var shiftVariation = placement.split('-')[1];
|
|
1433
|
+
|
|
1434
|
+
// if shift shiftVariation is specified, run the modifier
|
|
1435
|
+
if (shiftVariation) {
|
|
1436
|
+
var reference = data.offsets.reference;
|
|
1437
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1438
|
+
|
|
1439
|
+
var shiftOffsets = {
|
|
1440
|
+
y: {
|
|
1441
|
+
start: { top: reference.top },
|
|
1442
|
+
end: { top: reference.top + reference.height - popper.height }
|
|
1443
|
+
},
|
|
1444
|
+
x: {
|
|
1445
|
+
start: { left: reference.left },
|
|
1446
|
+
end: { left: reference.left + reference.width - popper.width }
|
|
1447
|
+
}
|
|
1448
|
+
};
|
|
1449
|
+
|
|
1450
|
+
var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';
|
|
1451
|
+
|
|
1452
|
+
data.offsets.popper = assign_default()(popper, shiftOffsets[axis][shiftVariation]);
|
|
1453
|
+
}
|
|
1454
|
+
return data;
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* Modifier used to make sure the popper does not overflows from it's boundaries
|
|
1459
|
+
* @method
|
|
1460
|
+
* @memberof Popper.modifiers
|
|
1461
|
+
* @argument {Object} data - The data object generated by `update` method
|
|
1462
|
+
* @returns {Object} The data object, properly modified
|
|
1463
|
+
*/
|
|
1464
|
+
Popper.prototype.modifiers.preventOverflow = function (data) {
|
|
1465
|
+
var order = this._options.preventOverflowOrder;
|
|
1466
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1467
|
+
|
|
1468
|
+
var check = {
|
|
1469
|
+
left: function left() {
|
|
1470
|
+
var left = popper.left;
|
|
1471
|
+
if (popper.left < data.boundaries.left) {
|
|
1472
|
+
left = Math.max(popper.left, data.boundaries.left);
|
|
1473
|
+
}
|
|
1474
|
+
return { left: left };
|
|
1475
|
+
},
|
|
1476
|
+
right: function right() {
|
|
1477
|
+
var left = popper.left;
|
|
1478
|
+
if (popper.right > data.boundaries.right) {
|
|
1479
|
+
left = Math.min(popper.left, data.boundaries.right - popper.width);
|
|
1480
|
+
}
|
|
1481
|
+
return { left: left };
|
|
1482
|
+
},
|
|
1483
|
+
top: function top() {
|
|
1484
|
+
var top = popper.top;
|
|
1485
|
+
if (popper.top < data.boundaries.top) {
|
|
1486
|
+
top = Math.max(popper.top, data.boundaries.top);
|
|
1487
|
+
}
|
|
1488
|
+
return { top: top };
|
|
1489
|
+
},
|
|
1490
|
+
bottom: function bottom() {
|
|
1491
|
+
var top = popper.top;
|
|
1492
|
+
if (popper.bottom > data.boundaries.bottom) {
|
|
1493
|
+
top = Math.min(popper.top, data.boundaries.bottom - popper.height);
|
|
1494
|
+
}
|
|
1495
|
+
return { top: top };
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
|
|
1499
|
+
order.forEach(function (direction) {
|
|
1500
|
+
data.offsets.popper = assign_default()(popper, check[direction]());
|
|
1501
|
+
});
|
|
1502
|
+
|
|
1503
|
+
return data;
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* Modifier used to make sure the popper is always near its reference
|
|
1508
|
+
* @method
|
|
1509
|
+
* @memberof Popper.modifiers
|
|
1510
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1511
|
+
* @returns {Object} The data object, properly modified
|
|
1512
|
+
*/
|
|
1513
|
+
Popper.prototype.modifiers.keepTogether = function (data) {
|
|
1514
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1515
|
+
var reference = data.offsets.reference;
|
|
1516
|
+
var f = Math.floor;
|
|
1517
|
+
|
|
1518
|
+
if (popper.right < f(reference.left)) {
|
|
1519
|
+
data.offsets.popper.left = f(reference.left) - popper.width;
|
|
1520
|
+
}
|
|
1521
|
+
if (popper.left > f(reference.right)) {
|
|
1522
|
+
data.offsets.popper.left = f(reference.right);
|
|
1523
|
+
}
|
|
1524
|
+
if (popper.bottom < f(reference.top)) {
|
|
1525
|
+
data.offsets.popper.top = f(reference.top) - popper.height;
|
|
1526
|
+
}
|
|
1527
|
+
if (popper.top > f(reference.bottom)) {
|
|
1528
|
+
data.offsets.popper.top = f(reference.bottom);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
return data;
|
|
1532
|
+
};
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.
|
|
1536
|
+
* Requires the `preventOverflow` modifier before it in order to work.
|
|
1537
|
+
* **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!
|
|
1538
|
+
* @method
|
|
1539
|
+
* @memberof Popper.modifiers
|
|
1540
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1541
|
+
* @returns {Object} The data object, properly modified
|
|
1542
|
+
*/
|
|
1543
|
+
Popper.prototype.modifiers.flip = function (data) {
|
|
1544
|
+
// check if preventOverflow is in the list of modifiers before the flip modifier.
|
|
1545
|
+
// otherwise flip would not work as expected.
|
|
1546
|
+
if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
|
|
1547
|
+
console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');
|
|
1548
|
+
return data;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
if (data.flipped && data.placement === data._originalPlacement) {
|
|
1552
|
+
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
|
1553
|
+
return data;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
var placement = data.placement.split('-')[0];
|
|
1557
|
+
var placementOpposite = getOppositePlacement(placement);
|
|
1558
|
+
var variation = data.placement.split('-')[1] || '';
|
|
1559
|
+
var flipOrder = [];
|
|
1560
|
+
if (this._options.flipBehavior === 'flip') {
|
|
1561
|
+
flipOrder = [placement, placementOpposite];
|
|
1562
|
+
} else {
|
|
1563
|
+
flipOrder = this._options.flipBehavior;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
flipOrder.forEach(function (step, index) {
|
|
1567
|
+
if (placement !== step || flipOrder.length === index + 1) {
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
placement = data.placement.split('-')[0];
|
|
1572
|
+
placementOpposite = getOppositePlacement(placement);
|
|
1573
|
+
|
|
1574
|
+
var popperOffsets = getPopperClientRect(data.offsets.popper);
|
|
1575
|
+
|
|
1576
|
+
// this boolean is used to distinguish right and bottom from top and left
|
|
1577
|
+
// they need different computations to get flipped
|
|
1578
|
+
var a = ['right', 'bottom'].indexOf(placement) !== -1;
|
|
1579
|
+
|
|
1580
|
+
// using Math.floor because the reference offsets may contain decimals we are not going to consider here
|
|
1581
|
+
if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
|
|
1582
|
+
// we'll use this boolean to detect any flip loop
|
|
1583
|
+
data.flipped = true;
|
|
1584
|
+
data.placement = flipOrder[index + 1];
|
|
1585
|
+
if (variation) {
|
|
1586
|
+
data.placement += '-' + variation;
|
|
1587
|
+
}
|
|
1588
|
+
data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
|
|
1589
|
+
data = this.runModifiers(data, this._options.modifiers, this._flip);
|
|
1590
|
+
}
|
|
1591
|
+
}.bind(this));
|
|
1592
|
+
return data;
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.
|
|
1597
|
+
* The offsets will shift the popper on the side of its reference element.
|
|
1598
|
+
* @method
|
|
1599
|
+
* @memberof Popper.modifiers
|
|
1600
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1601
|
+
* @returns {Object} The data object, properly modified
|
|
1602
|
+
*/
|
|
1603
|
+
Popper.prototype.modifiers.offset = function (data) {
|
|
1604
|
+
var offset = this._options.offset;
|
|
1605
|
+
var popper = data.offsets.popper;
|
|
1606
|
+
|
|
1607
|
+
if (data.placement.indexOf('left') !== -1) {
|
|
1608
|
+
popper.top -= offset;
|
|
1609
|
+
} else if (data.placement.indexOf('right') !== -1) {
|
|
1610
|
+
popper.top += offset;
|
|
1611
|
+
} else if (data.placement.indexOf('top') !== -1) {
|
|
1612
|
+
popper.left -= offset;
|
|
1613
|
+
} else if (data.placement.indexOf('bottom') !== -1) {
|
|
1614
|
+
popper.left += offset;
|
|
1615
|
+
}
|
|
1616
|
+
return data;
|
|
1617
|
+
};
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* 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
|
|
1621
|
+
* It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed
|
|
1622
|
+
* @method
|
|
1623
|
+
* @memberof Popper.modifiers
|
|
1624
|
+
* @argument {Object} data - The data object generated by _update method
|
|
1625
|
+
* @returns {Object} The data object, properly modified
|
|
1626
|
+
*/
|
|
1627
|
+
Popper.prototype.modifiers.arrow = function (data) {
|
|
1628
|
+
var arrow = this._options.arrowElement;
|
|
1629
|
+
var arrowOffset = this._options.arrowOffset;
|
|
1630
|
+
|
|
1631
|
+
// if the arrowElement is a string, suppose it's a CSS selector
|
|
1632
|
+
if (typeof arrow === 'string') {
|
|
1633
|
+
arrow = this._popper.querySelector(arrow);
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
// if arrow element is not found, don't run the modifier
|
|
1637
|
+
if (!arrow) {
|
|
1638
|
+
return data;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
// the arrow element must be child of its popper
|
|
1642
|
+
if (!this._popper.contains(arrow)) {
|
|
1643
|
+
console.warn('WARNING: `arrowElement` must be child of its popper element!');
|
|
1644
|
+
return data;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
// arrow depends on keepTogether in order to work
|
|
1648
|
+
if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
|
|
1649
|
+
console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');
|
|
1650
|
+
return data;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
var arrowStyle = {};
|
|
1654
|
+
var placement = data.placement.split('-')[0];
|
|
1655
|
+
var popper = getPopperClientRect(data.offsets.popper);
|
|
1656
|
+
var reference = data.offsets.reference;
|
|
1657
|
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
|
1658
|
+
|
|
1659
|
+
var len = isVertical ? 'height' : 'width';
|
|
1660
|
+
var side = isVertical ? 'top' : 'left';
|
|
1661
|
+
var translate = isVertical ? 'translateY' : 'translateX';
|
|
1662
|
+
var altSide = isVertical ? 'left' : 'top';
|
|
1663
|
+
var opSide = isVertical ? 'bottom' : 'right';
|
|
1664
|
+
var arrowSize = getOuterSizes(arrow)[len];
|
|
1665
|
+
|
|
1666
|
+
//
|
|
1667
|
+
// extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction
|
|
1668
|
+
//
|
|
1669
|
+
|
|
1670
|
+
// top/left side
|
|
1671
|
+
if (reference[opSide] - arrowSize < popper[side]) {
|
|
1672
|
+
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
|
1673
|
+
}
|
|
1674
|
+
// bottom/right side
|
|
1675
|
+
if (reference[side] + arrowSize > popper[opSide]) {
|
|
1676
|
+
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
// compute center of the popper
|
|
1680
|
+
var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
|
|
1681
|
+
|
|
1682
|
+
var sideValue = center - popper[side];
|
|
1683
|
+
|
|
1684
|
+
// prevent arrow from being placed not contiguously to its popper
|
|
1685
|
+
sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
|
|
1686
|
+
arrowStyle[side] = sideValue;
|
|
1687
|
+
arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow
|
|
1688
|
+
|
|
1689
|
+
data.offsets.arrow = arrowStyle;
|
|
1690
|
+
data.arrowElement = arrow;
|
|
1691
|
+
|
|
1692
|
+
return data;
|
|
1693
|
+
};
|
|
1694
|
+
|
|
1695
|
+
//
|
|
1696
|
+
// Helpers
|
|
1697
|
+
//
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* Get the outer sizes of the given element (offset size + margins)
|
|
1701
|
+
* @function
|
|
1702
|
+
* @ignore
|
|
1703
|
+
* @argument {Element} element
|
|
1704
|
+
* @returns {Object} object containing width and height properties
|
|
1705
|
+
*/
|
|
1706
|
+
function getOuterSizes(element) {
|
|
1707
|
+
// NOTE: 1 DOM access here
|
|
1708
|
+
var _display = element.style.display,
|
|
1709
|
+
_visibility = element.style.visibility;
|
|
1710
|
+
element.style.display = 'block';
|
|
1711
|
+
element.style.visibility = 'hidden';
|
|
1712
|
+
var calcWidthToForceRepaint = element.offsetWidth;
|
|
1713
|
+
|
|
1714
|
+
// original method
|
|
1715
|
+
var styles = root.getComputedStyle(element);
|
|
1716
|
+
var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
1717
|
+
var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
1718
|
+
var result = {
|
|
1719
|
+
width: element.offsetWidth + y,
|
|
1720
|
+
height: element.offsetHeight + x
|
|
1721
|
+
|
|
1722
|
+
// reset element styles
|
|
1723
|
+
};element.style.display = _display;
|
|
1724
|
+
element.style.visibility = _visibility;
|
|
1725
|
+
return result;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
/**
|
|
1729
|
+
* Get the opposite placement of the given one/
|
|
1730
|
+
* @function
|
|
1731
|
+
* @ignore
|
|
1732
|
+
* @argument {String} placement
|
|
1733
|
+
* @returns {String} flipped placement
|
|
1734
|
+
*/
|
|
1735
|
+
function getOppositePlacement(placement) {
|
|
1736
|
+
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
|
1737
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
1738
|
+
return hash[matched];
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
/**
|
|
1743
|
+
* Given the popper offsets, generate an output similar to getBoundingClientRect
|
|
1744
|
+
* @function
|
|
1745
|
+
* @ignore
|
|
1746
|
+
* @argument {Object} popperOffsets
|
|
1747
|
+
* @returns {Object} ClientRect like output
|
|
1748
|
+
*/
|
|
1749
|
+
function getPopperClientRect(popperOffsets) {
|
|
1750
|
+
var offsets = assign_default()({}, popperOffsets);
|
|
1751
|
+
offsets.right = offsets.left + offsets.width;
|
|
1752
|
+
offsets.bottom = offsets.top + offsets.height;
|
|
1753
|
+
return offsets;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
/**
|
|
1757
|
+
* Given an array and the key to find, returns its index
|
|
1758
|
+
* @function
|
|
1759
|
+
* @ignore
|
|
1760
|
+
* @argument {Array} arr
|
|
1761
|
+
* @argument keyToFind
|
|
1762
|
+
* @returns index or null
|
|
1763
|
+
*/
|
|
1764
|
+
function getArrayKeyIndex(arr, keyToFind) {
|
|
1765
|
+
var i = 0,
|
|
1766
|
+
key;
|
|
1767
|
+
for (key in arr) {
|
|
1768
|
+
if (arr[key] === keyToFind) {
|
|
1769
|
+
return i;
|
|
1770
|
+
}
|
|
1771
|
+
i++;
|
|
1772
|
+
}
|
|
1773
|
+
return null;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* Get CSS computed property of the given element
|
|
1778
|
+
* @function
|
|
1779
|
+
* @ignore
|
|
1780
|
+
* @argument {Eement} element
|
|
1781
|
+
* @argument {String} property
|
|
1782
|
+
*/
|
|
1783
|
+
function getStyleComputedProperty(element, property) {
|
|
1784
|
+
// NOTE: 1 DOM access here
|
|
1785
|
+
var css = root.getComputedStyle(element, null);
|
|
1786
|
+
return css[property];
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* Returns the offset parent of the given element
|
|
1791
|
+
* @function
|
|
1792
|
+
* @ignore
|
|
1793
|
+
* @argument {Element} element
|
|
1794
|
+
* @returns {Element} offset parent
|
|
1795
|
+
*/
|
|
1796
|
+
function getOffsetParent(element) {
|
|
1797
|
+
// NOTE: 1 DOM access here
|
|
1798
|
+
var offsetParent = element.offsetParent;
|
|
1799
|
+
return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
/**
|
|
1803
|
+
* Returns the scrolling parent of the given element
|
|
1804
|
+
* @function
|
|
1805
|
+
* @ignore
|
|
1806
|
+
* @argument {Element} element
|
|
1807
|
+
* @returns {Element} offset parent
|
|
1808
|
+
*/
|
|
1809
|
+
function getScrollParent(element) {
|
|
1810
|
+
var parent = element.parentNode;
|
|
1811
|
+
|
|
1812
|
+
if (!parent) {
|
|
1813
|
+
return element;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
if (parent === root.document) {
|
|
1817
|
+
// Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
|
|
1818
|
+
// greater than 0 and return the proper element
|
|
1819
|
+
if (root.document.body.scrollTop || root.document.body.scrollLeft) {
|
|
1820
|
+
return root.document.body;
|
|
1821
|
+
} else {
|
|
1822
|
+
return root.document.documentElement;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
// Firefox want us to check `-x` and `-y` variations as well
|
|
1827
|
+
if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {
|
|
1828
|
+
// If the detected scrollParent is body, we perform an additional check on its parentNode
|
|
1829
|
+
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
|
|
1830
|
+
// fixes issue #65
|
|
1831
|
+
return parent;
|
|
1832
|
+
}
|
|
1833
|
+
return getScrollParent(element.parentNode);
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* Check if the given element is fixed or is inside a fixed parent
|
|
1838
|
+
* @function
|
|
1839
|
+
* @ignore
|
|
1840
|
+
* @argument {Element} element
|
|
1841
|
+
* @argument {Element} customContainer
|
|
1842
|
+
* @returns {Boolean} answer to "isFixed?"
|
|
1843
|
+
*/
|
|
1844
|
+
function isFixed(element) {
|
|
1845
|
+
if (element === root.document.body) {
|
|
1846
|
+
return false;
|
|
1847
|
+
}
|
|
1848
|
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
|
1849
|
+
return true;
|
|
1850
|
+
}
|
|
1851
|
+
return element.parentNode ? isFixed(element.parentNode) : element;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* Set the style to the given popper
|
|
1856
|
+
* @function
|
|
1857
|
+
* @ignore
|
|
1858
|
+
* @argument {Element} element - Element to apply the style to
|
|
1859
|
+
* @argument {Object} styles - Object with a list of properties and values which will be applied to the element
|
|
1860
|
+
*/
|
|
1861
|
+
function setStyle(element, styles) {
|
|
1862
|
+
function is_numeric(n) {
|
|
1863
|
+
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
|
1864
|
+
}
|
|
1865
|
+
keys_default()(styles).forEach(function (prop) {
|
|
1866
|
+
var unit = '';
|
|
1867
|
+
// add unit if the value is numeric and is one of the following
|
|
1868
|
+
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
|
|
1869
|
+
unit = 'px';
|
|
1870
|
+
}
|
|
1871
|
+
element.style[prop] = styles[prop] + unit;
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* Check if the given variable is a function
|
|
1877
|
+
* @function
|
|
1878
|
+
* @ignore
|
|
1879
|
+
* @argument {*} functionToCheck - variable to check
|
|
1880
|
+
* @returns {Boolean} answer to: is a function?
|
|
1881
|
+
*/
|
|
1882
|
+
function isFunction(functionToCheck) {
|
|
1883
|
+
var getType = {};
|
|
1884
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* Get the position of the given element, relative to its offset parent
|
|
1889
|
+
* @function
|
|
1890
|
+
* @ignore
|
|
1891
|
+
* @param {Element} element
|
|
1892
|
+
* @return {Object} position - Coordinates of the element and its `scrollTop`
|
|
1893
|
+
*/
|
|
1894
|
+
function getOffsetRect(element) {
|
|
1895
|
+
var elementRect = {
|
|
1896
|
+
width: element.offsetWidth,
|
|
1897
|
+
height: element.offsetHeight,
|
|
1898
|
+
left: element.offsetLeft,
|
|
1899
|
+
top: element.offsetTop
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
elementRect.right = elementRect.left + elementRect.width;
|
|
1903
|
+
elementRect.bottom = elementRect.top + elementRect.height;
|
|
1904
|
+
|
|
1905
|
+
// position
|
|
1906
|
+
return elementRect;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* Get bounding client rect of given element
|
|
1911
|
+
* @function
|
|
1912
|
+
* @ignore
|
|
1913
|
+
* @param {HTMLElement} element
|
|
1914
|
+
* @return {Object} client rect
|
|
1915
|
+
*/
|
|
1916
|
+
function getBoundingClientRect(element) {
|
|
1917
|
+
var rect = element.getBoundingClientRect();
|
|
1918
|
+
|
|
1919
|
+
// whether the IE version is lower than 11
|
|
1920
|
+
var isIE = navigator.userAgent.indexOf('MSIE') != -1;
|
|
1921
|
+
|
|
1922
|
+
// fix ie document bounding top always 0 bug
|
|
1923
|
+
var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;
|
|
1924
|
+
|
|
1925
|
+
return {
|
|
1926
|
+
left: rect.left,
|
|
1927
|
+
top: rectTop,
|
|
1928
|
+
right: rect.right,
|
|
1929
|
+
bottom: rect.bottom,
|
|
1930
|
+
width: rect.right - rect.left,
|
|
1931
|
+
height: rect.bottom - rectTop
|
|
1932
|
+
};
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
/**
|
|
1936
|
+
* Given an element and one of its parents, return the offset
|
|
1937
|
+
* @function
|
|
1938
|
+
* @ignore
|
|
1939
|
+
* @param {HTMLElement} element
|
|
1940
|
+
* @param {HTMLElement} parent
|
|
1941
|
+
* @return {Object} rect
|
|
1942
|
+
*/
|
|
1943
|
+
function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
|
|
1944
|
+
var elementRect = getBoundingClientRect(element);
|
|
1945
|
+
var parentRect = getBoundingClientRect(parent);
|
|
1946
|
+
|
|
1947
|
+
if (fixed) {
|
|
1948
|
+
var scrollParent = getScrollParent(parent);
|
|
1949
|
+
parentRect.top += scrollParent.scrollTop;
|
|
1950
|
+
parentRect.bottom += scrollParent.scrollTop;
|
|
1951
|
+
parentRect.left += scrollParent.scrollLeft;
|
|
1952
|
+
parentRect.right += scrollParent.scrollLeft;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
var rect = {
|
|
1956
|
+
top: elementRect.top - parentRect.top,
|
|
1957
|
+
left: elementRect.left - parentRect.left,
|
|
1958
|
+
bottom: elementRect.top - parentRect.top + elementRect.height,
|
|
1959
|
+
right: elementRect.left - parentRect.left + elementRect.width,
|
|
1960
|
+
width: elementRect.width,
|
|
1961
|
+
height: elementRect.height
|
|
1962
|
+
};
|
|
1963
|
+
return rect;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
/**
|
|
1967
|
+
* Get the prefixed supported property name
|
|
1968
|
+
* @function
|
|
1969
|
+
* @ignore
|
|
1970
|
+
* @argument {String} property (camelCase)
|
|
1971
|
+
* @returns {String} prefixed property (camelCase)
|
|
1972
|
+
*/
|
|
1973
|
+
function getSupportedPropertyName(property) {
|
|
1974
|
+
var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];
|
|
1975
|
+
|
|
1976
|
+
for (var i = 0; i < prefixes.length; i++) {
|
|
1977
|
+
var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
|
|
1978
|
+
if (typeof root.document.body.style[toCheck] !== 'undefined') {
|
|
1979
|
+
return toCheck;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
return null;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
/**
|
|
1986
|
+
* The Object.assign() method is used to copy the values of all enumerable own properties from one or more source
|
|
1987
|
+
* objects to a target object. It will return the target object.
|
|
1988
|
+
* This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway
|
|
1989
|
+
* Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
|
|
1990
|
+
* @function
|
|
1991
|
+
* @ignore
|
|
1992
|
+
*/
|
|
1993
|
+
if (!assign_default.a) {
|
|
1994
|
+
Object.defineProperty(Object, 'assign', {
|
|
1995
|
+
enumerable: false,
|
|
1996
|
+
configurable: true,
|
|
1997
|
+
writable: true,
|
|
1998
|
+
value: function value(target) {
|
|
1999
|
+
if (target === undefined || target === null) {
|
|
2000
|
+
throw new TypeError('Cannot convert first argument to object');
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
var to = Object(target);
|
|
2004
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2005
|
+
var nextSource = arguments[i];
|
|
2006
|
+
if (nextSource === undefined || nextSource === null) {
|
|
2007
|
+
continue;
|
|
2008
|
+
}
|
|
2009
|
+
nextSource = Object(nextSource);
|
|
2010
|
+
|
|
2011
|
+
var keysArray = keys_default()(nextSource);
|
|
2012
|
+
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
|
|
2013
|
+
var nextKey = keysArray[nextIndex];
|
|
2014
|
+
var desc = get_own_property_descriptor_default()(nextSource, nextKey);
|
|
2015
|
+
if (desc !== undefined && desc.enumerable) {
|
|
2016
|
+
to[nextKey] = nextSource[nextKey];
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
return to;
|
|
2021
|
+
}
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
return Popper;
|
|
2026
|
+
}
|
|
2027
|
+
/* harmony default export */ var _popper_popper = (popper_createPopper());
|
|
2028
|
+
// CONCATENATED MODULE: ./components/_util/_popper/vue-popper.js
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
var stop = function stop(e) {
|
|
2033
|
+
return e.stopPropagation();
|
|
2034
|
+
};
|
|
2035
|
+
/**
|
|
2036
|
+
* @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.
|
|
2037
|
+
* @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.
|
|
2038
|
+
* @param {String} [placement=button] - Placement of the popper accepted values: top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end)
|
|
2039
|
+
* @param {Number} [offset=0] - Amount of pixels the popper will be shifted (can be negative).
|
|
2040
|
+
* @param {Boolean} [visible=false] Visibility of the popup element.
|
|
2041
|
+
* @param {Boolean} [visible-arrow=false] Visibility of the arrow, no style.
|
|
2042
|
+
*/
|
|
2043
|
+
/* harmony default export */ var vue_popper = __webpack_exports__["a"] = ({
|
|
2044
|
+
props: {
|
|
2045
|
+
transformOrigin: {
|
|
2046
|
+
type: [Boolean, String],
|
|
2047
|
+
default: true
|
|
2048
|
+
},
|
|
2049
|
+
placement: {
|
|
2050
|
+
type: String,
|
|
2051
|
+
default: 'bottom'
|
|
2052
|
+
},
|
|
2053
|
+
boundariesPadding: {
|
|
2054
|
+
type: Number,
|
|
2055
|
+
default: 5
|
|
2056
|
+
},
|
|
2057
|
+
reference: {},
|
|
2058
|
+
popper: {},
|
|
2059
|
+
offset: {
|
|
2060
|
+
default: 0
|
|
2061
|
+
},
|
|
2062
|
+
value: Boolean,
|
|
2063
|
+
visibleArrow: Boolean,
|
|
2064
|
+
arrowOffset: {
|
|
2065
|
+
type: Number,
|
|
2066
|
+
default: 35
|
|
2067
|
+
},
|
|
2068
|
+
appendToBody: {
|
|
2069
|
+
type: Boolean,
|
|
2070
|
+
default: true
|
|
2071
|
+
},
|
|
2072
|
+
popperOptions: {
|
|
2073
|
+
type: Object,
|
|
2074
|
+
default: function _default() {
|
|
2075
|
+
return {
|
|
2076
|
+
gpuAcceleration: false
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
},
|
|
2081
|
+
|
|
2082
|
+
data: function data() {
|
|
2083
|
+
return {
|
|
2084
|
+
showPopper: false,
|
|
2085
|
+
currentPlacement: ''
|
|
2086
|
+
};
|
|
2087
|
+
},
|
|
2088
|
+
|
|
2089
|
+
|
|
2090
|
+
watch: {
|
|
2091
|
+
value: {
|
|
2092
|
+
immediate: true,
|
|
2093
|
+
handler: function handler(val) {
|
|
2094
|
+
this.showPopper = val;
|
|
2095
|
+
this.$emit('input', val);
|
|
2096
|
+
}
|
|
2097
|
+
},
|
|
2098
|
+
|
|
2099
|
+
showPopper: function showPopper(val) {
|
|
2100
|
+
if (this.disabled) return;
|
|
2101
|
+
val ? this.updatePopper() : this.destroyPopper();
|
|
2102
|
+
this.$emit('input', val);
|
|
2103
|
+
}
|
|
2104
|
+
},
|
|
2105
|
+
|
|
2106
|
+
methods: {
|
|
2107
|
+
createPopper: function createPopper() {
|
|
2108
|
+
var _this = this;
|
|
2109
|
+
|
|
2110
|
+
var options = this.popperOptions;
|
|
2111
|
+
var popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper;
|
|
2112
|
+
var realPlacement = void 0;
|
|
2113
|
+
if (popper.__vue__ && popper.__vue__.$parent && popper.__vue__.$parent.$options.name === 'MdsCascader') {
|
|
2114
|
+
realPlacement = 'bottom-start';
|
|
2115
|
+
} else {
|
|
2116
|
+
realPlacement = this.realPlacement || this.placement;
|
|
2117
|
+
}
|
|
2118
|
+
this.currentPlacement = this.currentPlacement || realPlacement;
|
|
2119
|
+
if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {
|
|
2120
|
+
return;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
var reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;
|
|
2124
|
+
|
|
2125
|
+
if (!reference && this.$slots.reference && this.$slots.reference[0]) {
|
|
2126
|
+
reference = this.referenceElm = this.$slots.reference[0].elm;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
if (!popper || !reference) return;
|
|
2130
|
+
if (this.visibleArrow) this.appendArrow(popper);
|
|
2131
|
+
if (this.appendToBody) document.body.appendChild(this.popperElm);
|
|
2132
|
+
if (this.popperJS && this.popperJS.destroy) {
|
|
2133
|
+
this.popperJS.destroy();
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
options.placement = this.currentPlacement;
|
|
2137
|
+
options.offset = this.offset;
|
|
2138
|
+
options.arrowOffset = this.arrowOffset;
|
|
2139
|
+
this.popperJS = new _popper_popper(reference, popper, options);
|
|
2140
|
+
this.popperJS.onCreate(function (_) {
|
|
2141
|
+
_this.$emit('created', _this);
|
|
2142
|
+
_this.resetTransformOrigin();
|
|
2143
|
+
_this.$nextTick(_this.updatePopper);
|
|
2144
|
+
});
|
|
2145
|
+
if (typeof options.onUpdate === 'function') {
|
|
2146
|
+
this.popperJS.onUpdate(options.onUpdate);
|
|
2147
|
+
}
|
|
2148
|
+
this.popperJS._popper.style.zIndex = popup_main["a" /* PopupMain */].nextZIndex();
|
|
2149
|
+
this.popperElm.addEventListener('click', stop);
|
|
2150
|
+
},
|
|
2151
|
+
updatePopper: function updatePopper(zIndexFlag) {
|
|
2152
|
+
var popperJS = this.popperJS;
|
|
2153
|
+
if (popperJS) {
|
|
2154
|
+
popperJS.update();
|
|
2155
|
+
if (popperJS._popper) {
|
|
2156
|
+
if (!zIndexFlag) {
|
|
2157
|
+
popperJS._popper.style.zIndex = popup_main["a" /* PopupMain */].nextZIndex();
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
} else {
|
|
2161
|
+
this.createPopper();
|
|
2162
|
+
}
|
|
2163
|
+
},
|
|
2164
|
+
doDestroy: function doDestroy(forceDestroy) {
|
|
2165
|
+
/* istanbul ignore if */
|
|
2166
|
+
if (!this.popperJS || this.showPopper && !forceDestroy) return;
|
|
2167
|
+
this.popperJS.destroy();
|
|
2168
|
+
this.popperJS = null;
|
|
2169
|
+
},
|
|
2170
|
+
destroyPopper: function destroyPopper() {
|
|
2171
|
+
if (this.popperJS) {
|
|
2172
|
+
this.resetTransformOrigin();
|
|
2173
|
+
}
|
|
2174
|
+
},
|
|
2175
|
+
resetTransformOrigin: function resetTransformOrigin() {
|
|
2176
|
+
if (!this.transformOrigin) return;
|
|
2177
|
+
var placementMap = {
|
|
2178
|
+
top: 'bottom',
|
|
2179
|
+
bottom: 'top',
|
|
2180
|
+
left: 'right',
|
|
2181
|
+
right: 'left'
|
|
2182
|
+
};
|
|
2183
|
+
var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
|
|
2184
|
+
var origin = placementMap[placement];
|
|
2185
|
+
this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? 'center ' + origin : origin + ' center';
|
|
2186
|
+
},
|
|
2187
|
+
appendArrow: function appendArrow(element) {
|
|
2188
|
+
var hash = void 0;
|
|
2189
|
+
if (this.appended) {
|
|
2190
|
+
return;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
this.appended = true;
|
|
2194
|
+
|
|
2195
|
+
for (var item in element.attributes) {
|
|
2196
|
+
if (/^_v-/.test(element.attributes[item].name)) {
|
|
2197
|
+
hash = element.attributes[item].name;
|
|
2198
|
+
break;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
var arrow = document.createElement('div');
|
|
2203
|
+
|
|
2204
|
+
if (hash) {
|
|
2205
|
+
arrow.setAttribute(hash, '');
|
|
2206
|
+
}
|
|
2207
|
+
arrow.setAttribute('x-arrow', '');
|
|
2208
|
+
arrow.className = 'popper__arrow';
|
|
2209
|
+
element.appendChild(arrow);
|
|
2210
|
+
}
|
|
2211
|
+
},
|
|
2212
|
+
|
|
2213
|
+
beforeDestroy: function beforeDestroy() {
|
|
2214
|
+
this.doDestroy(true);
|
|
2215
|
+
if (this.popperElm && this.popperElm.parentNode === document.body) {
|
|
2216
|
+
this.popperElm.removeEventListener('click', stop);
|
|
2217
|
+
document.body.removeChild(this.popperElm);
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
2220
|
+
deactivated: function deactivated() {
|
|
2221
|
+
this.$options.beforeDestroy[0].call(this);
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
|
|
2225
|
+
/***/ }),
|
|
2226
|
+
|
|
2227
|
+
/***/ 18:
|
|
2228
|
+
/***/ (function(module, exports) {
|
|
2229
|
+
|
|
2230
|
+
module.exports = require("babel-runtime/core-js/object/get-own-property-descriptor");
|
|
2231
|
+
|
|
2232
|
+
/***/ }),
|
|
2233
|
+
|
|
2234
|
+
/***/ 2:
|
|
2235
|
+
/***/ (function(module, exports) {
|
|
2236
|
+
|
|
2237
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
2238
|
+
|
|
2239
|
+
/***/ }),
|
|
2240
|
+
|
|
2241
|
+
/***/ 21:
|
|
2242
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2243
|
+
|
|
2244
|
+
"use strict";
|
|
2245
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return on; });
|
|
2246
|
+
/* unused harmony export off */
|
|
2247
|
+
/* unused harmony export once */
|
|
2248
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hasClass; });
|
|
2249
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
|
|
2250
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return removeClass; });
|
|
2251
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getStyle; });
|
|
2252
|
+
/* unused harmony export setStyle */
|
|
2253
|
+
/* unused harmony export isScroll */
|
|
2254
|
+
/* unused harmony export getScrollContainer */
|
|
2255
|
+
/* unused harmony export isInContainer */
|
|
2256
|
+
/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
|
2257
|
+
/* harmony import */ var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
|
2258
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
|
2259
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
|
|
2260
|
+
|
|
2261
|
+
/* istanbul ignore next */
|
|
2262
|
+
|
|
2263
|
+
|
|
2264
|
+
|
|
2265
|
+
var isServer = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer;
|
|
2266
|
+
|
|
2267
|
+
/* eslint no-useless-escape: 0 */
|
|
2268
|
+
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
|
2269
|
+
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
2270
|
+
var ieVersion = isServer ? 0 : Number(document.documentMode);
|
|
2271
|
+
|
|
2272
|
+
/* istanbul ignore next */
|
|
2273
|
+
var trim = function trim(string) {
|
|
2274
|
+
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
|
2275
|
+
};
|
|
2276
|
+
/* istanbul ignore next */
|
|
2277
|
+
var camelCase = function camelCase(name) {
|
|
2278
|
+
return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
|
2279
|
+
return offset ? letter.toUpperCase() : letter;
|
|
2280
|
+
}).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
|
2281
|
+
};
|
|
2282
|
+
|
|
2283
|
+
/* istanbul ignore next */
|
|
2284
|
+
var on = function () {
|
|
2285
|
+
if (!isServer && document.addEventListener) {
|
|
2286
|
+
return function (element, event, handler) {
|
|
2287
|
+
if (element && event && handler) {
|
|
2288
|
+
element.addEventListener(event, handler, false);
|
|
2289
|
+
}
|
|
2290
|
+
};
|
|
2291
|
+
} else {
|
|
2292
|
+
return function (element, event, handler) {
|
|
2293
|
+
if (element && event && handler) {
|
|
2294
|
+
element.attachEvent('on' + event, handler);
|
|
2295
|
+
}
|
|
2296
|
+
};
|
|
2297
|
+
}
|
|
2298
|
+
}();
|
|
2299
|
+
|
|
2300
|
+
/* istanbul ignore next */
|
|
2301
|
+
var off = function () {
|
|
2302
|
+
if (!isServer && document.removeEventListener) {
|
|
2303
|
+
return function (element, event, handler) {
|
|
2304
|
+
if (element && event) {
|
|
2305
|
+
element.removeEventListener(event, handler, false);
|
|
2306
|
+
}
|
|
2307
|
+
};
|
|
2308
|
+
} else {
|
|
2309
|
+
return function (element, event, handler) {
|
|
2310
|
+
if (element && event) {
|
|
2311
|
+
element.detachEvent('on' + event, handler);
|
|
2312
|
+
}
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
}();
|
|
2316
|
+
|
|
2317
|
+
/* istanbul ignore next */
|
|
2318
|
+
var once = function once(el, event, fn) {
|
|
2319
|
+
var listener = function listener() {
|
|
2320
|
+
if (fn) {
|
|
2321
|
+
fn.apply(this, arguments);
|
|
2322
|
+
}
|
|
2323
|
+
off(el, event, listener);
|
|
2324
|
+
};
|
|
2325
|
+
on(el, event, listener);
|
|
2326
|
+
};
|
|
2327
|
+
|
|
2328
|
+
/* istanbul ignore next */
|
|
2329
|
+
function hasClass(el, cls) {
|
|
2330
|
+
if (!el || !cls) return false;
|
|
2331
|
+
if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
|
|
2332
|
+
if (el.classList) {
|
|
2333
|
+
return el.classList.contains(cls);
|
|
2334
|
+
} else {
|
|
2335
|
+
return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
/* istanbul ignore next */
|
|
2340
|
+
function addClass(el, cls) {
|
|
2341
|
+
if (!el) return;
|
|
2342
|
+
var curClass = el.className;
|
|
2343
|
+
var classes = (cls || '').split(' ');
|
|
2344
|
+
|
|
2345
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
2346
|
+
var clsName = classes[i];
|
|
2347
|
+
if (!clsName) continue;
|
|
2348
|
+
|
|
2349
|
+
if (el.classList) {
|
|
2350
|
+
el.classList.add(clsName);
|
|
2351
|
+
} else if (!hasClass(el, clsName)) {
|
|
2352
|
+
curClass += ' ' + clsName;
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
if (!el.classList) {
|
|
2356
|
+
el.className = curClass;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
/* istanbul ignore next */
|
|
2361
|
+
function removeClass(el, cls) {
|
|
2362
|
+
if (!el || !cls) return;
|
|
2363
|
+
var classes = cls.split(' ');
|
|
2364
|
+
var curClass = ' ' + el.className + ' ';
|
|
2365
|
+
|
|
2366
|
+
for (var i = 0, j = classes.length; i < j; i++) {
|
|
2367
|
+
var clsName = classes[i];
|
|
2368
|
+
if (!clsName) continue;
|
|
2369
|
+
|
|
2370
|
+
if (el.classList) {
|
|
2371
|
+
el.classList.remove(clsName);
|
|
2372
|
+
} else if (hasClass(el, clsName)) {
|
|
2373
|
+
curClass = curClass.replace(' ' + clsName + ' ', ' ');
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
if (!el.classList) {
|
|
2377
|
+
el.className = trim(curClass);
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
/* istanbul ignore next */
|
|
2382
|
+
var getStyle = ieVersion < 9 ? function (element, styleName) {
|
|
2383
|
+
if (isServer) return;
|
|
2384
|
+
if (!element || !styleName) return null;
|
|
2385
|
+
styleName = camelCase(styleName);
|
|
2386
|
+
if (styleName === 'float') {
|
|
2387
|
+
styleName = 'styleFloat';
|
|
2388
|
+
}
|
|
2389
|
+
try {
|
|
2390
|
+
switch (styleName) {
|
|
2391
|
+
case 'opacity':
|
|
2392
|
+
try {
|
|
2393
|
+
return element.filters.item('alpha').opacity / 100;
|
|
2394
|
+
} catch (e) {
|
|
2395
|
+
return 1.0;
|
|
2396
|
+
}
|
|
2397
|
+
default:
|
|
2398
|
+
return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
|
2399
|
+
}
|
|
2400
|
+
} catch (e) {
|
|
2401
|
+
return element.style[styleName];
|
|
2402
|
+
}
|
|
2403
|
+
} : function (element, styleName) {
|
|
2404
|
+
if (isServer) return;
|
|
2405
|
+
if (!element || !styleName) return null;
|
|
2406
|
+
styleName = camelCase(styleName);
|
|
2407
|
+
if (styleName === 'float') {
|
|
2408
|
+
styleName = 'cssFloat';
|
|
2409
|
+
}
|
|
2410
|
+
try {
|
|
2411
|
+
var computed = document.defaultView.getComputedStyle(element, '');
|
|
2412
|
+
return element.style[styleName] || computed ? computed[styleName] : null;
|
|
2413
|
+
} catch (e) {
|
|
2414
|
+
return element.style[styleName];
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2417
|
+
|
|
2418
|
+
/* istanbul ignore next */
|
|
2419
|
+
function setStyle(element, styleName, value) {
|
|
2420
|
+
if (!element || !styleName) return;
|
|
2421
|
+
|
|
2422
|
+
if ((typeof styleName === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(styleName)) === 'object') {
|
|
2423
|
+
for (var prop in styleName) {
|
|
2424
|
+
if (styleName.hasOwnProperty(prop)) {
|
|
2425
|
+
setStyle(element, prop, styleName[prop]);
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
} else {
|
|
2429
|
+
styleName = camelCase(styleName);
|
|
2430
|
+
if (styleName === 'opacity' && ieVersion < 9) {
|
|
2431
|
+
element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
|
|
2432
|
+
} else {
|
|
2433
|
+
element.style[styleName] = value;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
var isScroll = function isScroll(el, vertical) {
|
|
2439
|
+
if (isServer) return;
|
|
2440
|
+
|
|
2441
|
+
var determinedDirection = vertical !== null || vertical !== undefined;
|
|
2442
|
+
var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
|
|
2443
|
+
|
|
2444
|
+
return overflow.match(/(scroll|auto)/);
|
|
2445
|
+
};
|
|
2446
|
+
|
|
2447
|
+
var getScrollContainer = function getScrollContainer(el, vertical) {
|
|
2448
|
+
if (isServer) return;
|
|
2449
|
+
|
|
2450
|
+
var parent = el;
|
|
2451
|
+
while (parent) {
|
|
2452
|
+
if ([window, document, document.documentElement].includes(parent)) {
|
|
2453
|
+
return window;
|
|
2454
|
+
}
|
|
2455
|
+
if (isScroll(parent, vertical)) {
|
|
2456
|
+
return parent;
|
|
2457
|
+
}
|
|
2458
|
+
parent = parent.parentNode;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
return parent;
|
|
2462
|
+
};
|
|
2463
|
+
|
|
2464
|
+
var isInContainer = function isInContainer(el, container) {
|
|
2465
|
+
if (isServer || !el || !container) return false;
|
|
2466
|
+
|
|
2467
|
+
var elRect = el.getBoundingClientRect();
|
|
2468
|
+
var containerRect = void 0;
|
|
2469
|
+
|
|
2470
|
+
if ([window, document, document.documentElement, null, undefined].includes(container)) {
|
|
2471
|
+
containerRect = {
|
|
2472
|
+
top: 0,
|
|
2473
|
+
right: window.innerWidth,
|
|
2474
|
+
bottom: window.innerHeight,
|
|
2475
|
+
left: 0
|
|
2476
|
+
};
|
|
2477
|
+
} else {
|
|
2478
|
+
containerRect = container.getBoundingClientRect();
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2484
|
+
/***/ }),
|
|
2485
|
+
|
|
2486
|
+
/***/ 22:
|
|
2487
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2488
|
+
|
|
2489
|
+
"use strict";
|
|
2490
|
+
/* harmony import */ var mds_ui_transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
|
|
2491
|
+
/* harmony import */ var mds_ui_transition__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(mds_ui_transition__WEBPACK_IMPORTED_MODULE_0__);
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
var placementMap = {
|
|
2495
|
+
top: 'top',
|
|
2496
|
+
left: 'left',
|
|
2497
|
+
right: 'right',
|
|
2498
|
+
bottom: 'bottom',
|
|
2499
|
+
topLeft: 'top-start',
|
|
2500
|
+
topRight: 'top-end',
|
|
2501
|
+
bottomLeft: 'bottom-start',
|
|
2502
|
+
bottomRight: 'bottom-end',
|
|
2503
|
+
leftTop: 'left-start',
|
|
2504
|
+
leftBottom: 'left-end',
|
|
2505
|
+
rightTop: 'right-start',
|
|
2506
|
+
rightBottom: 'right-end'
|
|
2507
|
+
};
|
|
2508
|
+
|
|
2509
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
2510
|
+
components: {
|
|
2511
|
+
mdsTransition: mds_ui_transition__WEBPACK_IMPORTED_MODULE_0___default.a
|
|
2512
|
+
},
|
|
2513
|
+
computed: {
|
|
2514
|
+
realPlacement: function realPlacement() {
|
|
2515
|
+
return placementMap[this.placement];
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
});
|
|
2519
|
+
|
|
2520
|
+
/***/ }),
|
|
2521
|
+
|
|
2522
|
+
/***/ 232:
|
|
2523
|
+
/***/ (function(module, exports) {
|
|
2524
|
+
|
|
2525
|
+
// removed by extract-text-webpack-plugin
|
|
2526
|
+
|
|
2527
|
+
/***/ }),
|
|
2528
|
+
|
|
2529
|
+
/***/ 29:
|
|
2530
|
+
/***/ (function(module, exports) {
|
|
2531
|
+
|
|
2532
|
+
module.exports = require("moment");
|
|
2533
|
+
|
|
2534
|
+
/***/ }),
|
|
2535
|
+
|
|
2536
|
+
/***/ 3:
|
|
207
2537
|
/***/ (function(module, exports) {
|
|
208
2538
|
|
|
209
2539
|
module.exports = require("babel-runtime/helpers/defineProperty");
|
|
210
2540
|
|
|
211
2541
|
/***/ }),
|
|
212
2542
|
|
|
213
|
-
/***/
|
|
214
|
-
/***/ (function(module,
|
|
2543
|
+
/***/ 38:
|
|
2544
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2545
|
+
|
|
2546
|
+
"use strict";
|
|
2547
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
2548
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
2549
|
+
/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
|
|
2550
|
+
|
|
2551
|
+
|
|
2552
|
+
|
|
2553
|
+
var nodeList = [];
|
|
2554
|
+
var ctx = '@@clickoutsideContext';
|
|
2555
|
+
|
|
2556
|
+
var startClick = void 0;
|
|
2557
|
+
var seed = 0;
|
|
2558
|
+
|
|
2559
|
+
!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__[/* on */ "d"])(document, 'mousedown', function (e) {
|
|
2560
|
+
return startClick = e;
|
|
2561
|
+
});
|
|
2562
|
+
|
|
2563
|
+
!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__[/* on */ "d"])(document, 'mouseup', function (e) {
|
|
2564
|
+
nodeList.forEach(function (node) {
|
|
2565
|
+
return node[ctx].documentHandler(e, startClick);
|
|
2566
|
+
});
|
|
2567
|
+
});
|
|
2568
|
+
|
|
2569
|
+
function createDocumentHandler(el, binding, vnode) {
|
|
2570
|
+
return function () {
|
|
2571
|
+
var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2572
|
+
var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2573
|
+
|
|
2574
|
+
if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || vnode.context.popperElm && (vnode.context.popperElm.contains(mouseup.target) || vnode.context.popperElm.contains(mousedown.target))) return;
|
|
2575
|
+
|
|
2576
|
+
if (binding.expression && el[ctx].methodName && vnode.context[el[ctx].methodName]) {
|
|
2577
|
+
vnode.context[el[ctx].methodName]();
|
|
2578
|
+
} else {
|
|
2579
|
+
el[ctx].bindingFn && el[ctx].bindingFn();
|
|
2580
|
+
}
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* v-clickoutside
|
|
2586
|
+
* @desc 点击元素外面才会触发的事件
|
|
2587
|
+
* @example
|
|
2588
|
+
* ```vue
|
|
2589
|
+
* <div v-element-clickoutside="handleClose">
|
|
2590
|
+
* ```
|
|
2591
|
+
*/
|
|
2592
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
2593
|
+
bind: function bind(el, binding, vnode) {
|
|
2594
|
+
nodeList.push(el);
|
|
2595
|
+
var id = seed++;
|
|
2596
|
+
el[ctx] = {
|
|
2597
|
+
id: id,
|
|
2598
|
+
documentHandler: createDocumentHandler(el, binding, vnode),
|
|
2599
|
+
methodName: binding.expression,
|
|
2600
|
+
bindingFn: binding.value
|
|
2601
|
+
};
|
|
2602
|
+
},
|
|
2603
|
+
update: function update(el, binding, vnode) {
|
|
2604
|
+
el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
|
|
2605
|
+
el[ctx].methodName = binding.expression;
|
|
2606
|
+
el[ctx].bindingFn = binding.value;
|
|
2607
|
+
},
|
|
2608
|
+
unbind: function unbind(el) {
|
|
2609
|
+
var len = nodeList.length;
|
|
2610
|
+
|
|
2611
|
+
for (var i = 0; i < len; i++) {
|
|
2612
|
+
if (nodeList[i][ctx].id === el[ctx].id) {
|
|
2613
|
+
nodeList.splice(i, 1);
|
|
2614
|
+
break;
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
delete el[ctx];
|
|
2618
|
+
}
|
|
2619
|
+
});
|
|
2620
|
+
|
|
2621
|
+
/***/ }),
|
|
2622
|
+
|
|
2623
|
+
/***/ 5:
|
|
2624
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
215
2625
|
|
|
216
|
-
|
|
2626
|
+
"use strict";
|
|
2627
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
2628
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
2629
|
+
/* harmony import */ var _dom_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
var hasModal = false;
|
|
2634
|
+
var hasInitZIndex = false;
|
|
2635
|
+
var zIndex = void 0;
|
|
2636
|
+
|
|
2637
|
+
var getModal = function getModal() {
|
|
2638
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
2639
|
+
var modalDom = PopupManager.modalDom;
|
|
2640
|
+
if (modalDom) {
|
|
2641
|
+
hasModal = true;
|
|
2642
|
+
} else {
|
|
2643
|
+
hasModal = false;
|
|
2644
|
+
modalDom = document.createElement('div');
|
|
2645
|
+
PopupManager.modalDom = modalDom;
|
|
2646
|
+
|
|
2647
|
+
modalDom.addEventListener('touchmove', function (event) {
|
|
2648
|
+
event.preventDefault();
|
|
2649
|
+
event.stopPropagation();
|
|
2650
|
+
});
|
|
2651
|
+
|
|
2652
|
+
modalDom.addEventListener('click', function () {
|
|
2653
|
+
PopupManager.doOnModalClick && PopupManager.doOnModalClick();
|
|
2654
|
+
});
|
|
2655
|
+
}
|
|
217
2656
|
|
|
218
|
-
|
|
2657
|
+
return modalDom;
|
|
2658
|
+
};
|
|
219
2659
|
|
|
220
|
-
|
|
221
|
-
/***/ (function(module, exports) {
|
|
2660
|
+
var instances = {};
|
|
222
2661
|
|
|
223
|
-
|
|
2662
|
+
var PopupManager = {
|
|
2663
|
+
modalFade: true,
|
|
224
2664
|
|
|
225
|
-
|
|
2665
|
+
getInstance: function getInstance(id) {
|
|
2666
|
+
return instances[id];
|
|
2667
|
+
},
|
|
226
2668
|
|
|
227
|
-
|
|
228
|
-
|
|
2669
|
+
register: function register(id, instance) {
|
|
2670
|
+
if (id && instance) {
|
|
2671
|
+
instances[id] = instance;
|
|
2672
|
+
}
|
|
2673
|
+
},
|
|
229
2674
|
|
|
230
|
-
|
|
2675
|
+
deregister: function deregister(id) {
|
|
2676
|
+
if (id) {
|
|
2677
|
+
instances[id] = null;
|
|
2678
|
+
delete instances[id];
|
|
2679
|
+
}
|
|
2680
|
+
},
|
|
231
2681
|
|
|
232
|
-
|
|
2682
|
+
nextZIndex: function nextZIndex() {
|
|
2683
|
+
return PopupManager.zIndex++;
|
|
2684
|
+
},
|
|
233
2685
|
|
|
234
|
-
|
|
235
|
-
/***/ (function(module, exports) {
|
|
2686
|
+
modalStack: [],
|
|
236
2687
|
|
|
237
|
-
|
|
2688
|
+
doOnModalClick: function doOnModalClick() {
|
|
2689
|
+
var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
2690
|
+
if (!topItem) return;
|
|
238
2691
|
|
|
239
|
-
|
|
2692
|
+
var instance = PopupManager.getInstance(topItem.id);
|
|
2693
|
+
if (instance && instance.closeOnClickModal) {
|
|
2694
|
+
instance.close();
|
|
2695
|
+
}
|
|
2696
|
+
},
|
|
240
2697
|
|
|
241
|
-
|
|
242
|
-
|
|
2698
|
+
openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
|
|
2699
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
2700
|
+
if (!id || zIndex === undefined) return;
|
|
2701
|
+
this.modalFade = modalFade;
|
|
2702
|
+
|
|
2703
|
+
var modalStack = this.modalStack;
|
|
2704
|
+
|
|
2705
|
+
for (var i = 0, j = modalStack.length; i < j; i++) {
|
|
2706
|
+
var item = modalStack[i];
|
|
2707
|
+
if (item.id === id) {
|
|
2708
|
+
return;
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
var modalDom = getModal();
|
|
2713
|
+
|
|
2714
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal');
|
|
2715
|
+
if (this.modalFade && !hasModal) {
|
|
2716
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-enter');
|
|
2717
|
+
}
|
|
2718
|
+
if (modalClass) {
|
|
2719
|
+
var classArr = modalClass.trim().split(/\s+/);
|
|
2720
|
+
classArr.forEach(function (item) {
|
|
2721
|
+
return Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, item);
|
|
2722
|
+
});
|
|
2723
|
+
}
|
|
2724
|
+
setTimeout(function () {
|
|
2725
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(modalDom, 'v-modal-enter');
|
|
2726
|
+
}, 200);
|
|
2727
|
+
|
|
2728
|
+
if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
|
|
2729
|
+
dom.parentNode.appendChild(modalDom);
|
|
2730
|
+
} else {
|
|
2731
|
+
document.body.appendChild(modalDom);
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
if (zIndex) {
|
|
2735
|
+
modalDom.style.zIndex = zIndex;
|
|
2736
|
+
}
|
|
2737
|
+
modalDom.tabIndex = 0;
|
|
2738
|
+
modalDom.style.display = '';
|
|
2739
|
+
|
|
2740
|
+
this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
|
|
2741
|
+
},
|
|
2742
|
+
|
|
2743
|
+
closeModal: function closeModal(id) {
|
|
2744
|
+
var modalStack = this.modalStack;
|
|
2745
|
+
var modalDom = getModal();
|
|
2746
|
+
|
|
2747
|
+
if (modalStack.length > 0) {
|
|
2748
|
+
var topItem = modalStack[modalStack.length - 1];
|
|
2749
|
+
if (topItem.id === id) {
|
|
2750
|
+
if (topItem.modalClass) {
|
|
2751
|
+
var classArr = topItem.modalClass.trim().split(/\s+/);
|
|
2752
|
+
classArr.forEach(function (item) {
|
|
2753
|
+
return Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(modalDom, item);
|
|
2754
|
+
});
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
modalStack.pop();
|
|
2758
|
+
if (modalStack.length > 0) {
|
|
2759
|
+
modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
|
|
2760
|
+
}
|
|
2761
|
+
} else {
|
|
2762
|
+
for (var i = modalStack.length - 1; i >= 0; i--) {
|
|
2763
|
+
if (modalStack[i].id === id) {
|
|
2764
|
+
modalStack.splice(i, 1);
|
|
2765
|
+
break;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
if (modalStack.length === 0) {
|
|
2772
|
+
if (this.modalFade) {
|
|
2773
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* addClass */ "a"])(modalDom, 'v-modal-leave');
|
|
2774
|
+
}
|
|
2775
|
+
setTimeout(function () {
|
|
2776
|
+
if (modalStack.length === 0) {
|
|
2777
|
+
if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
|
|
2778
|
+
modalDom.style.display = 'none';
|
|
2779
|
+
PopupManager.modalDom = undefined;
|
|
2780
|
+
}
|
|
2781
|
+
Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[/* removeClass */ "h"])(modalDom, 'v-modal-leave');
|
|
2782
|
+
}, 200);
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
243
2786
|
|
|
244
|
-
|
|
2787
|
+
Object.defineProperty(PopupManager, 'zIndex', {
|
|
2788
|
+
configurable: true,
|
|
2789
|
+
get: function get() {
|
|
2790
|
+
if (!hasInitZIndex) {
|
|
2791
|
+
zIndex = zIndex || (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$ELEMENT || {}).zIndex || 2000;
|
|
2792
|
+
hasInitZIndex = true;
|
|
2793
|
+
}
|
|
2794
|
+
return zIndex;
|
|
2795
|
+
},
|
|
2796
|
+
set: function set(value) {
|
|
2797
|
+
zIndex = value;
|
|
2798
|
+
}
|
|
2799
|
+
});
|
|
2800
|
+
|
|
2801
|
+
var getTopPopup = function getTopPopup() {
|
|
2802
|
+
if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
|
2803
|
+
if (PopupManager.modalStack.length > 0) {
|
|
2804
|
+
var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
|
2805
|
+
if (!topPopup) return;
|
|
2806
|
+
var instance = PopupManager.getInstance(topPopup.id);
|
|
2807
|
+
|
|
2808
|
+
return instance;
|
|
2809
|
+
}
|
|
2810
|
+
};
|
|
2811
|
+
|
|
2812
|
+
if (!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) {
|
|
2813
|
+
// handle `esc` key when the popup is shown
|
|
2814
|
+
window.addEventListener('keydown', function (event) {
|
|
2815
|
+
if (event.keyCode === 27) {
|
|
2816
|
+
var topPopup = getTopPopup();
|
|
2817
|
+
|
|
2818
|
+
if (topPopup && topPopup.closeOnPressEscape) {
|
|
2819
|
+
topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
/* harmony default export */ __webpack_exports__["a"] = (PopupManager);
|
|
245
2826
|
|
|
246
2827
|
/***/ }),
|
|
247
2828
|
|
|
248
|
-
/***/
|
|
2829
|
+
/***/ 6:
|
|
249
2830
|
/***/ (function(module, exports) {
|
|
250
2831
|
|
|
251
|
-
module.exports =
|
|
2832
|
+
module.exports = require("babel-runtime/core-js/object/assign");
|
|
252
2833
|
|
|
253
2834
|
/***/ }),
|
|
254
2835
|
|
|
255
|
-
/***/
|
|
2836
|
+
/***/ 7:
|
|
256
2837
|
/***/ (function(module, exports) {
|
|
257
2838
|
|
|
258
|
-
module.exports =
|
|
2839
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
|
|
259
2840
|
|
|
260
2841
|
/***/ }),
|
|
261
2842
|
|
|
262
|
-
/***/
|
|
2843
|
+
/***/ 8:
|
|
263
2844
|
/***/ (function(module, exports) {
|
|
264
2845
|
|
|
265
|
-
module.exports =
|
|
2846
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__8__;
|
|
266
2847
|
|
|
267
2848
|
/***/ }),
|
|
268
2849
|
|
|
269
|
-
/***/
|
|
2850
|
+
/***/ 9:
|
|
270
2851
|
/***/ (function(module, exports) {
|
|
271
2852
|
|
|
272
|
-
module.exports =
|
|
2853
|
+
module.exports = require("babel-runtime/helpers/typeof");
|
|
273
2854
|
|
|
274
2855
|
/***/ }),
|
|
275
2856
|
|
|
276
|
-
/***/
|
|
2857
|
+
/***/ 94:
|
|
277
2858
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
278
2859
|
|
|
279
2860
|
"use strict";
|
|
@@ -281,10 +2862,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__6__;
|
|
|
281
2862
|
__webpack_require__.r(__webpack_exports__);
|
|
282
2863
|
|
|
283
2864
|
// EXTERNAL MODULE: ./components/style/index.less
|
|
284
|
-
var style = __webpack_require__(
|
|
2865
|
+
var style = __webpack_require__(139);
|
|
285
2866
|
|
|
286
2867
|
// EXTERNAL MODULE: ./components/timepicker/style/index.less
|
|
287
|
-
var timepicker_style = __webpack_require__(
|
|
2868
|
+
var timepicker_style = __webpack_require__(232);
|
|
288
2869
|
|
|
289
2870
|
// CONCATENATED MODULE: ./components/timepicker/style/index.js
|
|
290
2871
|
|
|
@@ -293,21 +2874,59 @@ var timepicker_style = __webpack_require__(223);
|
|
|
293
2874
|
// style dependencies
|
|
294
2875
|
// import '../../input/style'
|
|
295
2876
|
// EXTERNAL MODULE: external "babel-runtime/helpers/defineProperty"
|
|
296
|
-
var defineProperty_ = __webpack_require__(
|
|
2877
|
+
var defineProperty_ = __webpack_require__(3);
|
|
297
2878
|
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
|
|
298
2879
|
|
|
299
|
-
// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
|
|
300
|
-
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(5);
|
|
301
|
-
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
|
|
302
|
-
|
|
303
2880
|
// EXTERNAL MODULE: external "moment"
|
|
304
2881
|
var external_moment_ = __webpack_require__(29);
|
|
305
2882
|
var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_);
|
|
306
2883
|
|
|
307
|
-
// EXTERNAL MODULE:
|
|
308
|
-
var
|
|
309
|
-
|
|
2884
|
+
// EXTERNAL MODULE: ./components/_util/_popper/popper-mixin.js
|
|
2885
|
+
var popper_mixin = __webpack_require__(22);
|
|
2886
|
+
|
|
2887
|
+
// EXTERNAL MODULE: ./components/_util/_popper/vue-popper.js + 1 modules
|
|
2888
|
+
var vue_popper = __webpack_require__(17);
|
|
2889
|
+
|
|
2890
|
+
// CONCATENATED MODULE: ./components/timepicker/lazyMode.js
|
|
2891
|
+
/* harmony default export */ var lazyMode = ({
|
|
2892
|
+
data: function data() {
|
|
2893
|
+
return {
|
|
2894
|
+
lazyMomentValue: null, // lazyMode模式下用于展示时间值,确定后回显
|
|
2895
|
+
lazyTempValue: null // lazyMode模式下用于暂存时间值
|
|
2896
|
+
};
|
|
2897
|
+
},
|
|
310
2898
|
|
|
2899
|
+
methods: {
|
|
2900
|
+
lazyCancel: function lazyCancel(e) {
|
|
2901
|
+
var _this = this;
|
|
2902
|
+
|
|
2903
|
+
e.stopPropagation();
|
|
2904
|
+
this.closePopper();
|
|
2905
|
+
setTimeout(function () {
|
|
2906
|
+
_this.momentValue = _this.lazyTempValue;
|
|
2907
|
+
}, 300);
|
|
2908
|
+
},
|
|
2909
|
+
lazyConfirm: function lazyConfirm(e) {
|
|
2910
|
+
e.stopPropagation();
|
|
2911
|
+
this.lazyTempValue = this.momentValue;
|
|
2912
|
+
this.emitChange(this.momentValue);
|
|
2913
|
+
this.closePopper();
|
|
2914
|
+
},
|
|
2915
|
+
emitChange: function emitChange(value) {
|
|
2916
|
+
if (this.isRange) {
|
|
2917
|
+
var formatValue = [];
|
|
2918
|
+
formatValue[0] = this.valueFormat ? value[0] ? value[0].format(this.valueFormat) : '' : value[0];
|
|
2919
|
+
formatValue[1] = this.valueFormat ? value[1] ? value[1].format(this.valueFormat) : '' : value[1];
|
|
2920
|
+
this.$emit('change', formatValue);
|
|
2921
|
+
this.dispatch('MdsFormItem', 'formItemChange', formatValue);
|
|
2922
|
+
} else {
|
|
2923
|
+
var _formatValue = this.valueFormat ? value.format(this.valueFormat) : value;
|
|
2924
|
+
this.$emit('change', _formatValue);
|
|
2925
|
+
this.dispatch('MdsFormItem', 'formItemChange', _formatValue);
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
});
|
|
311
2930
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/header.vue?vue&type=template&id=94a41d54&
|
|
312
2931
|
var headervue_type_template_id_94a41d54_render = function () {
|
|
313
2932
|
var _vm = this
|
|
@@ -392,7 +3011,7 @@ headervue_type_template_id_94a41d54_render._withStripped = true
|
|
|
392
3011
|
// CONCATENATED MODULE: ./components/timepicker/header.vue?vue&type=template&id=94a41d54&
|
|
393
3012
|
|
|
394
3013
|
// EXTERNAL MODULE: external "./icon"
|
|
395
|
-
var external_icon_ = __webpack_require__(
|
|
3014
|
+
var external_icon_ = __webpack_require__(8);
|
|
396
3015
|
var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
|
|
397
3016
|
|
|
398
3017
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/header.vue?vue&type=script&lang=js&
|
|
@@ -641,6 +3260,9 @@ var scrollTo = function scrollTo(element, to, duration) {
|
|
|
641
3260
|
}
|
|
642
3261
|
var index = this.selectedIndex < 0 ? 0 : this.selectedIndex;
|
|
643
3262
|
var topOption = list.children[index];
|
|
3263
|
+
if (!topOption) {
|
|
3264
|
+
return;
|
|
3265
|
+
}
|
|
644
3266
|
var to = topOption.offsetTop;
|
|
645
3267
|
scrollTo(select, to, duration);
|
|
646
3268
|
}
|
|
@@ -907,6 +3529,7 @@ combobox_component.options.__file = "components/timepicker/combobox.vue"
|
|
|
907
3529
|
|
|
908
3530
|
|
|
909
3531
|
|
|
3532
|
+
|
|
910
3533
|
var generateOptions = function generateOptions(length, disabledOptions, hideDisabledOptions) {
|
|
911
3534
|
var step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
912
3535
|
|
|
@@ -929,6 +3552,8 @@ var isAM = function isAM(value) {
|
|
|
929
3552
|
disabledHours: Function,
|
|
930
3553
|
disabledMinutes: Function,
|
|
931
3554
|
disabledSeconds: Function,
|
|
3555
|
+
mintime: Object,
|
|
3556
|
+
maxtime: Object,
|
|
932
3557
|
isRange: Boolean,
|
|
933
3558
|
isShow: Boolean,
|
|
934
3559
|
format: String,
|
|
@@ -943,12 +3568,23 @@ var isAM = function isAM(value) {
|
|
|
943
3568
|
showSecond: Boolean,
|
|
944
3569
|
use12Hours: Boolean,
|
|
945
3570
|
allowEmpty: Boolean,
|
|
946
|
-
value: null
|
|
3571
|
+
value: null,
|
|
3572
|
+
step: Number
|
|
947
3573
|
},
|
|
948
3574
|
components: {
|
|
949
3575
|
MdsPickerHeader: header,
|
|
950
3576
|
MdsPickerCombobox: combobox
|
|
951
3577
|
},
|
|
3578
|
+
data: function data() {
|
|
3579
|
+
return {
|
|
3580
|
+
handleTimeMap: {
|
|
3581
|
+
H: this.handleDisabledHoursOptions,
|
|
3582
|
+
m: this.handleDisabledMinutesOptions,
|
|
3583
|
+
s: this.handleDisabledSecondsOptions
|
|
3584
|
+
}
|
|
3585
|
+
};
|
|
3586
|
+
},
|
|
3587
|
+
|
|
952
3588
|
methods: {
|
|
953
3589
|
handleChange: function handleChange(value, index) {
|
|
954
3590
|
if (typeof index === 'number' && this.isRange) {
|
|
@@ -963,6 +3599,129 @@ var isAM = function isAM(value) {
|
|
|
963
3599
|
},
|
|
964
3600
|
handleHeaderClick: function handleHeaderClick(e) {
|
|
965
3601
|
this.$emit('clear', e);
|
|
3602
|
+
},
|
|
3603
|
+
handleMinOrMaxTime: function handleMinOrMaxTime(type) {
|
|
3604
|
+
var result = [];
|
|
3605
|
+
if (this.mintime && !external_moment_default.a.isMoment(this.mintime)) {
|
|
3606
|
+
return result;
|
|
3607
|
+
}
|
|
3608
|
+
if (this.maxtime && !external_moment_default.a.isMoment(this.maxtime)) {
|
|
3609
|
+
return result;
|
|
3610
|
+
}
|
|
3611
|
+
|
|
3612
|
+
// 如果设置的初始时间不在限定时间范围内,做重新修正(会引起后续bug,暂不实现)
|
|
3613
|
+
this.fixCurrentTime();
|
|
3614
|
+
if (Array.isArray(this.value)) {
|
|
3615
|
+
return result;
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
result = this.handleTimeMap[type]();
|
|
3619
|
+
return result;
|
|
3620
|
+
},
|
|
3621
|
+
fixCurrentTime: function fixCurrentTime() {
|
|
3622
|
+
if (!this.value || Array.isArray(this.value)) {
|
|
3623
|
+
return;
|
|
3624
|
+
}
|
|
3625
|
+
var now = this.value._d.getTime();
|
|
3626
|
+
if (this.mintime) {
|
|
3627
|
+
var min = this.mintime._d.getTime();
|
|
3628
|
+
if (now < min) {
|
|
3629
|
+
this.$emit('change', this.mintime);
|
|
3630
|
+
return;
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3633
|
+
if (this.maxtime) {
|
|
3634
|
+
var max = this.maxtime._d.getTime();
|
|
3635
|
+
if (now > max) {
|
|
3636
|
+
this.$emit('change', this.maxtime);
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
},
|
|
3640
|
+
handleDisabledHoursOptions: function handleDisabledHoursOptions() {
|
|
3641
|
+
var result = [];
|
|
3642
|
+
var step = 24;
|
|
3643
|
+
var min = 0;
|
|
3644
|
+
var max = 24;
|
|
3645
|
+
if (this.mintime) {
|
|
3646
|
+
min = parseInt(this.mintime.format('H'));
|
|
3647
|
+
}
|
|
3648
|
+
if (this.maxtime) {
|
|
3649
|
+
max = parseInt(this.maxtime.format('H'));
|
|
3650
|
+
}
|
|
3651
|
+
for (var i = 0; i < min; i++) {
|
|
3652
|
+
result.push(i);
|
|
3653
|
+
}
|
|
3654
|
+
for (var _i = max + 1; _i < step; _i++) {
|
|
3655
|
+
result.push(_i);
|
|
3656
|
+
}
|
|
3657
|
+
return result;
|
|
3658
|
+
},
|
|
3659
|
+
handleDisabledMinutesOptions: function handleDisabledMinutesOptions() {
|
|
3660
|
+
var result = [];
|
|
3661
|
+
if (!this.value) {
|
|
3662
|
+
return result;
|
|
3663
|
+
}
|
|
3664
|
+
var currentHour = parseInt(this.value.format('H'));
|
|
3665
|
+
var minHour = void 0;
|
|
3666
|
+
var maxHour = void 0;
|
|
3667
|
+
var minMinute = 0;
|
|
3668
|
+
var maxMinute = 60;
|
|
3669
|
+
var step = 60;
|
|
3670
|
+
if (this.mintime) {
|
|
3671
|
+
minMinute = parseInt(this.mintime.format('m'));
|
|
3672
|
+
minHour = parseInt(this.mintime.format('H'));
|
|
3673
|
+
}
|
|
3674
|
+
if (this.maxtime) {
|
|
3675
|
+
maxMinute = parseInt(this.maxtime.format('m'));
|
|
3676
|
+
maxHour = parseInt(this.maxtime.format('H'));
|
|
3677
|
+
}
|
|
3678
|
+
if (currentHour === minHour) {
|
|
3679
|
+
for (var i = 0; i < minMinute; i++) {
|
|
3680
|
+
result.push(i);
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
if (currentHour === maxHour) {
|
|
3684
|
+
for (var _i2 = maxMinute + 1; _i2 < step; _i2++) {
|
|
3685
|
+
result.push(_i2);
|
|
3686
|
+
}
|
|
3687
|
+
}
|
|
3688
|
+
return result;
|
|
3689
|
+
},
|
|
3690
|
+
handleDisabledSecondsOptions: function handleDisabledSecondsOptions() {
|
|
3691
|
+
var result = [];
|
|
3692
|
+
if (!this.value) {
|
|
3693
|
+
return result;
|
|
3694
|
+
}
|
|
3695
|
+
var currentHour = parseInt(this.value.format('H'));
|
|
3696
|
+
var currentMinute = parseInt(this.value.format('m'));
|
|
3697
|
+
var minHour = void 0;
|
|
3698
|
+
var maxHour = void 0;
|
|
3699
|
+
var minMinute = void 0;
|
|
3700
|
+
var maxMinute = void 0;
|
|
3701
|
+
var minSecond = 0;
|
|
3702
|
+
var maxSecond = 60;
|
|
3703
|
+
var step = 60;
|
|
3704
|
+
if (this.mintime) {
|
|
3705
|
+
minSecond = parseInt(this.mintime.format('s'));
|
|
3706
|
+
minMinute = parseInt(this.mintime.format('m'));
|
|
3707
|
+
minHour = parseInt(this.mintime.format('H'));
|
|
3708
|
+
}
|
|
3709
|
+
if (this.maxtime) {
|
|
3710
|
+
maxSecond = parseInt(this.maxtime.format('s'));
|
|
3711
|
+
maxMinute = parseInt(this.maxtime.format('m'));
|
|
3712
|
+
maxHour = parseInt(this.maxtime.format('H'));
|
|
3713
|
+
}
|
|
3714
|
+
if (currentHour === minHour && currentMinute === minMinute) {
|
|
3715
|
+
for (var i = 0; i < minSecond; i++) {
|
|
3716
|
+
result.push(i);
|
|
3717
|
+
}
|
|
3718
|
+
}
|
|
3719
|
+
if (currentHour === maxHour && currentMinute === maxMinute) {
|
|
3720
|
+
for (var _i3 = maxSecond + 1; _i3 < step; _i3++) {
|
|
3721
|
+
result.push(_i3);
|
|
3722
|
+
}
|
|
3723
|
+
}
|
|
3724
|
+
return result;
|
|
966
3725
|
}
|
|
967
3726
|
},
|
|
968
3727
|
render: function render(h) {
|
|
@@ -984,9 +3743,10 @@ var isAM = function isAM(value) {
|
|
|
984
3743
|
var otherValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
985
3744
|
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
986
3745
|
|
|
987
|
-
var disabledHourOptions = disabledHours(value);
|
|
988
|
-
var disabledMinuteOptions = _this.disabledMinutes(value ? value.hour() : null);
|
|
989
|
-
|
|
3746
|
+
var disabledHourOptions = disabledHours(value).concat(_this.handleMinOrMaxTime('H'));
|
|
3747
|
+
var disabledMinuteOptions = _this.disabledMinutes(value ? value.hour() : null).concat(_this.handleMinOrMaxTime('m'));
|
|
3748
|
+
|
|
3749
|
+
var disabledSecondOptions = _this.disabledSeconds(value ? value.hour() : null, value ? value.minute() : null).concat(_this.handleMinOrMaxTime('s'));
|
|
990
3750
|
if (index === 0 && otherValue) {
|
|
991
3751
|
var totalHour = void 0;
|
|
992
3752
|
_this.use12Hours ? totalHour = 12 : totalHour = 24;
|
|
@@ -994,33 +3754,41 @@ var isAM = function isAM(value) {
|
|
|
994
3754
|
if (disabledHourOptions.indexOf(i) < 0) disabledHourOptions.push(i);
|
|
995
3755
|
}
|
|
996
3756
|
if (value && value.hour() >= otherValue.hour()) {
|
|
997
|
-
for (var
|
|
998
|
-
if (disabledMinuteOptions.indexOf(
|
|
3757
|
+
for (var _i4 = otherValue.minute(); _i4 <= 60; _i4++) {
|
|
3758
|
+
if (disabledMinuteOptions.indexOf(_i4) < 0) {
|
|
3759
|
+
disabledMinuteOptions.push(_i4);
|
|
3760
|
+
}
|
|
999
3761
|
}
|
|
1000
3762
|
}
|
|
1001
3763
|
if (value && value.hour() >= otherValue.hour() && value.minute() >= otherValue.minute()) {
|
|
1002
|
-
for (var
|
|
1003
|
-
if (disabledSecondOptions.indexOf(
|
|
3764
|
+
for (var _i5 = otherValue.second() + 1; _i5 <= 60; _i5++) {
|
|
3765
|
+
if (disabledSecondOptions.indexOf(_i5) < 0) {
|
|
3766
|
+
disabledSecondOptions.push(_i5);
|
|
3767
|
+
}
|
|
1004
3768
|
}
|
|
1005
3769
|
}
|
|
1006
3770
|
} else if (index === 1 && otherValue) {
|
|
1007
|
-
for (var
|
|
1008
|
-
if (disabledHourOptions.indexOf(
|
|
3771
|
+
for (var _i6 = 0; _i6 < otherValue.hour(); _i6++) {
|
|
3772
|
+
if (disabledHourOptions.indexOf(_i6) < 0) disabledHourOptions.push(_i6);
|
|
1009
3773
|
}
|
|
1010
3774
|
if (value && value.hour() <= otherValue.hour()) {
|
|
1011
|
-
for (var
|
|
1012
|
-
if (disabledMinuteOptions.indexOf(
|
|
3775
|
+
for (var _i7 = 0; _i7 < otherValue.minute(); _i7++) {
|
|
3776
|
+
if (disabledMinuteOptions.indexOf(_i7) < 0) {
|
|
3777
|
+
disabledMinuteOptions.push(_i7);
|
|
3778
|
+
}
|
|
1013
3779
|
}
|
|
1014
3780
|
}
|
|
1015
3781
|
if (value && value.hour() <= otherValue.hour() && value.minute() <= otherValue.minute()) {
|
|
1016
|
-
for (var
|
|
1017
|
-
if (disabledSecondOptions.indexOf(
|
|
3782
|
+
for (var _i8 = 0; _i8 < otherValue.second(); _i8++) {
|
|
3783
|
+
if (disabledSecondOptions.indexOf(_i8) < 0) {
|
|
3784
|
+
disabledSecondOptions.push(_i8);
|
|
3785
|
+
}
|
|
1018
3786
|
}
|
|
1019
3787
|
}
|
|
1020
3788
|
}
|
|
1021
3789
|
|
|
1022
3790
|
var hourOptions = generateOptions(24, disabledHourOptions, _this.hideDisabledOptions);
|
|
1023
|
-
var minuteOptions = generateOptions(60, disabledMinuteOptions, _this.hideDisabledOptions);
|
|
3791
|
+
var minuteOptions = generateOptions(60, disabledMinuteOptions, _this.hideDisabledOptions, _this.step);
|
|
1024
3792
|
var secondOptions = generateOptions(60, disabledSecondOptions, _this.hideDisabledOptions);
|
|
1025
3793
|
return h(combobox, {
|
|
1026
3794
|
attrs: {
|
|
@@ -1042,7 +3810,8 @@ var isAM = function isAM(value) {
|
|
|
1042
3810
|
|
|
1043
3811
|
use12Hours: _this.use12Hours,
|
|
1044
3812
|
index: index,
|
|
1045
|
-
value: value
|
|
3813
|
+
value: value
|
|
3814
|
+
},
|
|
1046
3815
|
on: {
|
|
1047
3816
|
'change': _this.handleChange
|
|
1048
3817
|
}
|
|
@@ -1063,7 +3832,9 @@ var isAM = function isAM(value) {
|
|
|
1063
3832
|
if (_this.isRange) {
|
|
1064
3833
|
return h(
|
|
1065
3834
|
'div',
|
|
1066
|
-
{
|
|
3835
|
+
{
|
|
3836
|
+
'class': _this.prefixCls + '-picker-box ' + _this.prefixCls + '-picker-half'
|
|
3837
|
+
},
|
|
1067
3838
|
[h(
|
|
1068
3839
|
'div',
|
|
1069
3840
|
{ 'class': _this.prefixCls + '-picker-box-halfbox' },
|
|
@@ -1090,21 +3861,7 @@ var isAM = function isAM(value) {
|
|
|
1090
3861
|
return h(
|
|
1091
3862
|
'div',
|
|
1092
3863
|
{ 'class': this.prefixCls + '-inner' },
|
|
1093
|
-
[
|
|
1094
|
-
attrs: {
|
|
1095
|
-
size: this.size,
|
|
1096
|
-
prefixCls: this.prefixCls,
|
|
1097
|
-
allowEmpty: this.allowEmpty,
|
|
1098
|
-
isRange: this.isRange,
|
|
1099
|
-
clearText: this.clearText,
|
|
1100
|
-
format: this.format,
|
|
1101
|
-
|
|
1102
|
-
placeholder: this.placeholder,
|
|
1103
|
-
value: this.value },
|
|
1104
|
-
on: {
|
|
1105
|
-
'clear': this.handleHeaderClick
|
|
1106
|
-
}
|
|
1107
|
-
}), getPickerBox()]
|
|
3864
|
+
[getPickerBox()]
|
|
1108
3865
|
);
|
|
1109
3866
|
}
|
|
1110
3867
|
});
|
|
@@ -1133,15 +3890,22 @@ var panel_component = Object(componentNormalizer["a" /* default */])(
|
|
|
1133
3890
|
if (false) { var panel_api; }
|
|
1134
3891
|
panel_component.options.__file = "components/timepicker/panel.vue"
|
|
1135
3892
|
/* harmony default export */ var panel = (panel_component.exports);
|
|
3893
|
+
// EXTERNAL MODULE: ./components/_util/clickoutside.js
|
|
3894
|
+
var clickoutside = __webpack_require__(38);
|
|
3895
|
+
|
|
1136
3896
|
// EXTERNAL MODULE: external "./_util/proptype"
|
|
1137
|
-
var proptype_ = __webpack_require__(
|
|
3897
|
+
var proptype_ = __webpack_require__(7);
|
|
1138
3898
|
|
|
1139
3899
|
// EXTERNAL MODULE: external "./transition"
|
|
1140
|
-
var external_transition_ = __webpack_require__(
|
|
3900
|
+
var external_transition_ = __webpack_require__(11);
|
|
1141
3901
|
var external_transition_default = /*#__PURE__*/__webpack_require__.n(external_transition_);
|
|
1142
3902
|
|
|
3903
|
+
// EXTERNAL MODULE: external "./button"
|
|
3904
|
+
var external_button_ = __webpack_require__(13);
|
|
3905
|
+
var external_button_default = /*#__PURE__*/__webpack_require__.n(external_button_);
|
|
3906
|
+
|
|
1143
3907
|
// EXTERNAL MODULE: external "./_mixin/emitter"
|
|
1144
|
-
var emitter_ = __webpack_require__(
|
|
3908
|
+
var emitter_ = __webpack_require__(12);
|
|
1145
3909
|
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
1146
3910
|
|
|
1147
3911
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/time-picker.vue?vue&type=script&lang=js&
|
|
@@ -1156,6 +3920,10 @@ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
|
1156
3920
|
|
|
1157
3921
|
|
|
1158
3922
|
|
|
3923
|
+
|
|
3924
|
+
|
|
3925
|
+
|
|
3926
|
+
|
|
1159
3927
|
function generateShowHourMinuteSecond(format) {
|
|
1160
3928
|
// Ref: http://momentjs.com/docs/#/parsing/string-format/
|
|
1161
3929
|
return {
|
|
@@ -1167,7 +3935,8 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1167
3935
|
|
|
1168
3936
|
/* harmony default export */ var time_pickervue_type_script_lang_js_ = ({
|
|
1169
3937
|
name: 'MdsTimePicker',
|
|
1170
|
-
mixins: [
|
|
3938
|
+
mixins: [vue_popper["a" /* default */], popper_mixin["a" /* default */], emitter_default.a, lazyMode],
|
|
3939
|
+
directives: { Clickoutside: clickoutside["a" /* default */] },
|
|
1171
3940
|
model: {
|
|
1172
3941
|
event: 'change'
|
|
1173
3942
|
},
|
|
@@ -1186,7 +3955,8 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1186
3955
|
}
|
|
1187
3956
|
},
|
|
1188
3957
|
visible: false,
|
|
1189
|
-
momentValue: null
|
|
3958
|
+
momentValue: null,
|
|
3959
|
+
inputHover: false
|
|
1190
3960
|
};
|
|
1191
3961
|
},
|
|
1192
3962
|
|
|
@@ -1195,10 +3965,7 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1195
3965
|
type: String,
|
|
1196
3966
|
default: 'mds-time-picker'
|
|
1197
3967
|
},
|
|
1198
|
-
width:
|
|
1199
|
-
type: Number,
|
|
1200
|
-
default: 240
|
|
1201
|
-
},
|
|
3968
|
+
width: Number,
|
|
1202
3969
|
allowEmpty: {
|
|
1203
3970
|
type: Boolean,
|
|
1204
3971
|
default: true
|
|
@@ -1214,7 +3981,7 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1214
3981
|
},
|
|
1215
3982
|
|
|
1216
3983
|
default: function _default() {
|
|
1217
|
-
return external_moment_default()();
|
|
3984
|
+
return external_moment_default()('00:00:00', 'HH:mm:ss');
|
|
1218
3985
|
}
|
|
1219
3986
|
},
|
|
1220
3987
|
disabled: {
|
|
@@ -1239,6 +4006,8 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1239
4006
|
return [];
|
|
1240
4007
|
}
|
|
1241
4008
|
},
|
|
4009
|
+
mintime: Object,
|
|
4010
|
+
maxtime: Object,
|
|
1242
4011
|
format: {
|
|
1243
4012
|
type: String,
|
|
1244
4013
|
default: ''
|
|
@@ -1257,7 +4026,7 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1257
4026
|
},
|
|
1258
4027
|
placement: {
|
|
1259
4028
|
type: String,
|
|
1260
|
-
default: '
|
|
4029
|
+
default: 'bottomLeft'
|
|
1261
4030
|
},
|
|
1262
4031
|
placeholder: {
|
|
1263
4032
|
type: String,
|
|
@@ -1300,12 +4069,19 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1300
4069
|
},
|
|
1301
4070
|
|
|
1302
4071
|
required: true
|
|
1303
|
-
}
|
|
4072
|
+
},
|
|
4073
|
+
step: {
|
|
4074
|
+
type: Number,
|
|
4075
|
+
default: 1
|
|
4076
|
+
},
|
|
4077
|
+
// 不得不说这也是一次可耻的业务封装,用来在面板下面加个确定取消,延迟回显
|
|
4078
|
+
lazyMode: Boolean
|
|
1304
4079
|
},
|
|
1305
4080
|
components: {
|
|
1306
4081
|
MdsPanel: panel,
|
|
1307
4082
|
MdsTransition: external_transition_default.a,
|
|
1308
|
-
MdsIcon: external_icon_default.a
|
|
4083
|
+
MdsIcon: external_icon_default.a,
|
|
4084
|
+
MdsButton: external_button_default.a
|
|
1309
4085
|
},
|
|
1310
4086
|
computed: {
|
|
1311
4087
|
classes: function classes() {
|
|
@@ -1316,34 +4092,66 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1316
4092
|
},
|
|
1317
4093
|
defaultFormat: function defaultFormat() {
|
|
1318
4094
|
return this.format ? this.format : this.use12Hours ? 'h:mm:ss a' : 'HH:mm:ss';
|
|
4095
|
+
},
|
|
4096
|
+
realMomentValue: function realMomentValue() {
|
|
4097
|
+
return this.lazyMode ? this.lazyMomentValue : this.momentValue;
|
|
4098
|
+
},
|
|
4099
|
+
displayClear: function displayClear() {
|
|
4100
|
+
return this.inputHover && this.realMomentValue;
|
|
1319
4101
|
}
|
|
1320
4102
|
},
|
|
1321
4103
|
created: function created() {
|
|
1322
4104
|
this.initMomentValue();
|
|
1323
4105
|
},
|
|
1324
4106
|
mounted: function mounted() {
|
|
1325
|
-
this.popper = this.popperVM.$el;
|
|
1326
|
-
this.popper.style.width = this.$el.offsetWidth + 'px';
|
|
1327
|
-
this.reference = this.$refs.picker;
|
|
1328
4107
|
this.visible = this.open;
|
|
1329
|
-
|
|
1330
|
-
},
|
|
1331
|
-
destroyed: function destroyed() {
|
|
1332
|
-
document.removeEventListener('click', this.closePopper);
|
|
4108
|
+
this.updatePopper();
|
|
1333
4109
|
},
|
|
1334
4110
|
|
|
4111
|
+
|
|
1335
4112
|
watch: {
|
|
1336
4113
|
open: function open(v) {
|
|
1337
4114
|
this.visible = v;
|
|
1338
4115
|
},
|
|
1339
4116
|
visible: function visible(v) {
|
|
4117
|
+
var _this = this;
|
|
4118
|
+
|
|
1340
4119
|
this.$emit('open-change', v);
|
|
4120
|
+
if (v) {
|
|
4121
|
+
if (this.lazyMode) {
|
|
4122
|
+
this.lazyTempValue = this.value;
|
|
4123
|
+
}
|
|
4124
|
+
this.$nextTick(function () {
|
|
4125
|
+
_this.updatePopper();
|
|
4126
|
+
var panel = _this.$refs.popper.querySelector('.mds-time-picker-panel');
|
|
4127
|
+
panel.style.minWidth = getComputedStyle(_this.$refs.reference).width;
|
|
4128
|
+
});
|
|
4129
|
+
} else {
|
|
4130
|
+
if (this.lazyMode) {
|
|
4131
|
+
setTimeout(function () {
|
|
4132
|
+
_this.momentValue = _this.lazyTempValue;
|
|
4133
|
+
}, 300);
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
1341
4136
|
},
|
|
1342
4137
|
value: function value(v) {
|
|
1343
4138
|
this.initMomentValue();
|
|
1344
4139
|
}
|
|
1345
4140
|
},
|
|
1346
4141
|
methods: {
|
|
4142
|
+
clearValue: function clearValue(e) {
|
|
4143
|
+
e.stopPropagation();
|
|
4144
|
+
if (this.lazyMode) {
|
|
4145
|
+
this.momentValue = '';
|
|
4146
|
+
this.lazyTempValue = '';
|
|
4147
|
+
this.emitChange(this.momentValue);
|
|
4148
|
+
} else {
|
|
4149
|
+
this.handleChange('');
|
|
4150
|
+
}
|
|
4151
|
+
},
|
|
4152
|
+
initWidth: function initWidth() {
|
|
4153
|
+
this.popper.style.width = this.$el.offsetWidth + 'px';
|
|
4154
|
+
},
|
|
1347
4155
|
initMomentValue: function initMomentValue() {
|
|
1348
4156
|
if (this.isRange) {
|
|
1349
4157
|
this.momentValue = [null, null];
|
|
@@ -1358,6 +4166,10 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1358
4166
|
this.momentValue = external_moment_default()(this.value, this.defaultFormat);
|
|
1359
4167
|
} else this.momentValue = null;
|
|
1360
4168
|
}
|
|
4169
|
+
|
|
4170
|
+
if (this.lazyMode) {
|
|
4171
|
+
this.lazyMomentValue = this.momentValue;
|
|
4172
|
+
}
|
|
1361
4173
|
},
|
|
1362
4174
|
handleClick: function handleClick() {
|
|
1363
4175
|
if (this.disabled) {
|
|
@@ -1377,13 +4189,17 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1377
4189
|
formatValue[0] = this.valueFormat ? value[0] ? value[0].format(this.valueFormat) : '' : value[0];
|
|
1378
4190
|
formatValue[1] = this.valueFormat ? value[1] ? value[1].format(this.valueFormat) : '' : value[1];
|
|
1379
4191
|
this.momentValue = value;
|
|
1380
|
-
this
|
|
1381
|
-
|
|
4192
|
+
if (!this.lazyMode) {
|
|
4193
|
+
this.$emit('change', formatValue);
|
|
4194
|
+
this.dispatch('MdsFormItem', 'formItemChange', formatValue);
|
|
4195
|
+
}
|
|
1382
4196
|
} else {
|
|
1383
4197
|
var _formatValue = this.valueFormat ? value.format(this.valueFormat) : value;
|
|
1384
|
-
this.$emit('change', _formatValue);
|
|
1385
4198
|
this.momentValue = value;
|
|
1386
|
-
this.
|
|
4199
|
+
if (!this.lazyMode) {
|
|
4200
|
+
this.$emit('change', _formatValue);
|
|
4201
|
+
this.dispatch('MdsFormItem', 'formItemChange', _formatValue);
|
|
4202
|
+
}
|
|
1387
4203
|
}
|
|
1388
4204
|
},
|
|
1389
4205
|
handleClear: function handleClear(e) {
|
|
@@ -1400,12 +4216,11 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1400
4216
|
this.$emit('clear', e);
|
|
1401
4217
|
},
|
|
1402
4218
|
closePopper: function closePopper(e) {
|
|
1403
|
-
if (!this.visible || !this.$el || !this.reference || !this.popper || this.$el.contains(e.target) || this.reference.contains(e.target) || this.popper.contains(e.target)) return;
|
|
1404
4219
|
this.visible = false;
|
|
1405
4220
|
}
|
|
1406
4221
|
},
|
|
1407
4222
|
render: function render(h) {
|
|
1408
|
-
var
|
|
4223
|
+
var _this2 = this;
|
|
1409
4224
|
|
|
1410
4225
|
if (this.isRange && !Array.isArray(this.value)) {
|
|
1411
4226
|
throw new Error('传入的值必须为数组');
|
|
@@ -1413,118 +4228,194 @@ function generateShowHourMinuteSecond(format) {
|
|
|
1413
4228
|
throw new Error('传入的值不能为数组');
|
|
1414
4229
|
}
|
|
1415
4230
|
|
|
1416
|
-
var
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
4231
|
+
var footer = function footer() {
|
|
4232
|
+
var slotFooter = _this2.$slots.default;
|
|
4233
|
+
|
|
4234
|
+
if (!_this2.lazyMode && !slotFooter) {
|
|
4235
|
+
return null;
|
|
4236
|
+
}
|
|
4237
|
+
|
|
4238
|
+
if (slotFooter) {
|
|
4239
|
+
return slotFooter;
|
|
4240
|
+
}
|
|
1420
4241
|
|
|
1421
|
-
|
|
1422
|
-
this.popperVM = new external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a({
|
|
1423
|
-
render: function render(h) {
|
|
4242
|
+
if (_this2.lazyMode) {
|
|
1424
4243
|
return h(
|
|
1425
|
-
|
|
1426
|
-
{
|
|
1427
|
-
attrs: { type: 'slide', motion: 'up' }
|
|
1428
|
-
},
|
|
4244
|
+
'div',
|
|
4245
|
+
{ 'class': 'lazy-footer' },
|
|
1429
4246
|
[h(
|
|
1430
|
-
'
|
|
4247
|
+
'mds-button',
|
|
1431
4248
|
{
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
[h(
|
|
1440
|
-
panel,
|
|
1441
|
-
{
|
|
1442
|
-
attrs: {
|
|
1443
|
-
size: vm.size,
|
|
1444
|
-
allowEmpty: vm.allowEmpty,
|
|
1445
|
-
clearText: vm.clearText,
|
|
1446
|
-
defaultOpenValue: vm.defaultOpenValue,
|
|
1447
|
-
isRange: vm.isRange,
|
|
1448
|
-
disabledHours: vm.disabledHours,
|
|
1449
|
-
disabledMinutes: vm.disabledMinutes,
|
|
1450
|
-
disabledSeconds: vm.disabledSeconds,
|
|
1451
|
-
format: vm.defaultFormat,
|
|
1452
|
-
hideDisabledOptions: vm.hideDisabledOptions,
|
|
1453
|
-
prefixCls: vm.prefixCls + '-panel',
|
|
1454
|
-
placeholder: vm.placeholder,
|
|
1455
|
-
showHour: showHour,
|
|
1456
|
-
showMinute: showMinute,
|
|
1457
|
-
showSecond: showSecond,
|
|
1458
|
-
use12Hours: vm.use12Hours,
|
|
1459
|
-
isShow: vm.visible,
|
|
1460
|
-
|
|
1461
|
-
value: vm.momentValue },
|
|
1462
|
-
on: {
|
|
1463
|
-
'change': vm.handleChange,
|
|
1464
|
-
'clear': vm.handleClear
|
|
4249
|
+
attrs: {
|
|
4250
|
+
type: 'normal',
|
|
4251
|
+
size: 'large-small'
|
|
4252
|
+
},
|
|
4253
|
+
on: {
|
|
4254
|
+
'click': function click(e) {
|
|
4255
|
+
_this2.lazyCancel(e);
|
|
1465
4256
|
}
|
|
4257
|
+
}
|
|
4258
|
+
},
|
|
4259
|
+
['\u53D6\u6D88']
|
|
4260
|
+
), h(
|
|
4261
|
+
'mds-button',
|
|
4262
|
+
{
|
|
4263
|
+
attrs: {
|
|
4264
|
+
type: 'normal',
|
|
4265
|
+
size: 'large-small'
|
|
1466
4266
|
},
|
|
1467
|
-
|
|
1468
|
-
|
|
4267
|
+
style: 'margin-left: 0',
|
|
4268
|
+
on: {
|
|
4269
|
+
'click': function click(e) {
|
|
4270
|
+
_this2.lazyConfirm(e);
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4273
|
+
},
|
|
4274
|
+
['\u786E\u5B9A']
|
|
1469
4275
|
)]
|
|
1470
4276
|
);
|
|
1471
4277
|
}
|
|
1472
|
-
}
|
|
4278
|
+
};
|
|
4279
|
+
|
|
4280
|
+
var _generateShowHourMinu = generateShowHourMinuteSecond(this.defaultFormat),
|
|
4281
|
+
showHour = _generateShowHourMinu.showHour,
|
|
4282
|
+
showMinute = _generateShowHourMinu.showMinute,
|
|
4283
|
+
showSecond = _generateShowHourMinu.showSecond;
|
|
4284
|
+
|
|
4285
|
+
var popperVM = h(
|
|
4286
|
+
external_transition_default.a,
|
|
4287
|
+
{
|
|
4288
|
+
attrs: { type: 'slide', motion: 'up' }
|
|
4289
|
+
},
|
|
4290
|
+
[h(
|
|
4291
|
+
'div',
|
|
4292
|
+
{
|
|
4293
|
+
'class': [this.prefixCls + '-panel', defineProperty_default()({}, this.prefixCls + '-panel-narrow', (!showHour || !showMinute || !showSecond) && !this.use12Hours)],
|
|
4294
|
+
directives: [{
|
|
4295
|
+
name: 'show',
|
|
4296
|
+
value: this.visible
|
|
4297
|
+
}]
|
|
4298
|
+
},
|
|
4299
|
+
[h(
|
|
4300
|
+
panel,
|
|
4301
|
+
{
|
|
4302
|
+
attrs: {
|
|
4303
|
+
step: this.step,
|
|
4304
|
+
size: this.size,
|
|
4305
|
+
allowEmpty: this.allowEmpty,
|
|
4306
|
+
clearText: this.clearText,
|
|
4307
|
+
defaultOpenValue: this.defaultOpenValue,
|
|
4308
|
+
isRange: this.isRange,
|
|
4309
|
+
disabledHours: this.disabledHours,
|
|
4310
|
+
disabledMinutes: this.disabledMinutes,
|
|
4311
|
+
disabledSeconds: this.disabledSeconds,
|
|
4312
|
+
mintime: this.mintime,
|
|
4313
|
+
maxtime: this.maxtime,
|
|
4314
|
+
format: this.defaultFormat,
|
|
4315
|
+
hideDisabledOptions: this.hideDisabledOptions,
|
|
4316
|
+
prefixCls: this.prefixCls + '-panel',
|
|
4317
|
+
placeholder: this.placeholder,
|
|
4318
|
+
showHour: showHour,
|
|
4319
|
+
showMinute: showMinute,
|
|
4320
|
+
showSecond: showSecond,
|
|
4321
|
+
use12Hours: this.use12Hours,
|
|
4322
|
+
isShow: this.visible,
|
|
4323
|
+
|
|
4324
|
+
value: this.momentValue
|
|
4325
|
+
},
|
|
4326
|
+
on: {
|
|
4327
|
+
'change': this.handleChange,
|
|
4328
|
+
'clear': this.handleClear
|
|
4329
|
+
}
|
|
4330
|
+
},
|
|
4331
|
+
[footer()]
|
|
4332
|
+
)]
|
|
4333
|
+
)]
|
|
4334
|
+
);
|
|
4335
|
+
|
|
1473
4336
|
var getInput = function getInput() {
|
|
1474
|
-
if (
|
|
4337
|
+
if (_this2.isRange) {
|
|
1475
4338
|
return h(
|
|
1476
4339
|
'div',
|
|
1477
|
-
{ 'class':
|
|
4340
|
+
{ 'class': _this2.prefixCls + '-box' },
|
|
1478
4341
|
[h('input', {
|
|
1479
4342
|
ref: 'inputF',
|
|
1480
|
-
'class':
|
|
1481
|
-
attrs: { disabled:
|
|
1482
|
-
placeholder:
|
|
4343
|
+
'class': _this2.prefixCls + '-input ' + _this2.prefixCls + '-box-half',
|
|
4344
|
+
attrs: { disabled: _this2.disabled,
|
|
4345
|
+
placeholder: _this2.startPlaceholder
|
|
1483
4346
|
},
|
|
1484
4347
|
domProps: {
|
|
1485
|
-
'value':
|
|
4348
|
+
'value': _this2.realMomentValue[0] && _this2.realMomentValue[0].format(_this2.defaultFormat) || ''
|
|
1486
4349
|
}
|
|
1487
4350
|
}), h(
|
|
1488
4351
|
'span',
|
|
1489
|
-
{ 'class':
|
|
4352
|
+
{ 'class': _this2.prefixCls + '-box-span' },
|
|
1490
4353
|
['-']
|
|
1491
4354
|
), h('input', {
|
|
1492
4355
|
ref: 'inputS',
|
|
1493
|
-
'class':
|
|
1494
|
-
attrs: { disabled:
|
|
1495
|
-
placeholder:
|
|
4356
|
+
'class': _this2.prefixCls + '-input ' + _this2.prefixCls + '-box-half',
|
|
4357
|
+
attrs: { disabled: _this2.disabled,
|
|
4358
|
+
placeholder: _this2.endPlaceholder
|
|
1496
4359
|
},
|
|
1497
4360
|
domProps: {
|
|
1498
|
-
'value':
|
|
4361
|
+
'value': _this2.realMomentValue[1] && _this2.realMomentValue[1].format(_this2.defaultFormat) || ''
|
|
1499
4362
|
}
|
|
1500
4363
|
})]
|
|
1501
4364
|
);
|
|
1502
4365
|
} else {
|
|
1503
4366
|
return h('input', {
|
|
1504
4367
|
ref: 'input',
|
|
1505
|
-
'class':
|
|
1506
|
-
attrs: { disabled:
|
|
1507
|
-
placeholder:
|
|
4368
|
+
'class': _this2.prefixCls + '-input',
|
|
4369
|
+
attrs: { disabled: _this2.disabled,
|
|
4370
|
+
placeholder: _this2.placeholder
|
|
1508
4371
|
},
|
|
1509
4372
|
domProps: {
|
|
1510
|
-
'value':
|
|
4373
|
+
'value': _this2.realMomentValue && _this2.realMomentValue.format(_this2.defaultFormat) || ''
|
|
1511
4374
|
}
|
|
1512
4375
|
});
|
|
1513
4376
|
}
|
|
1514
4377
|
};
|
|
1515
|
-
|
|
1516
|
-
|
|
4378
|
+
|
|
4379
|
+
return h('span', [h(
|
|
4380
|
+
'div',
|
|
1517
4381
|
{
|
|
1518
|
-
ref: '
|
|
1519
|
-
|
|
4382
|
+
ref: 'reference',
|
|
4383
|
+
directives: [{
|
|
4384
|
+
name: 'clickoutside',
|
|
4385
|
+
value: this.closePopper
|
|
4386
|
+
}],
|
|
4387
|
+
|
|
4388
|
+
style: this.width ? 'width: ' + this.width + 'px' : '',
|
|
1520
4389
|
'class': this.classes,
|
|
1521
4390
|
on: {
|
|
1522
|
-
'click': this.handleClick
|
|
4391
|
+
'click': this.handleClick,
|
|
4392
|
+
'mouseenter': function mouseenter() {
|
|
4393
|
+
_this2.inputHover = true;
|
|
4394
|
+
},
|
|
4395
|
+
'mouseleave': function mouseleave() {
|
|
4396
|
+
_this2.inputHover = false;
|
|
4397
|
+
}
|
|
1523
4398
|
}
|
|
1524
4399
|
},
|
|
1525
|
-
[getInput(), h(external_icon_default.a, {
|
|
4400
|
+
[getInput(), this.displayClear ? h(external_icon_default.a, {
|
|
4401
|
+
'class': this.prefixCls + '-icon',
|
|
4402
|
+
attrs: { type: 'line-close'
|
|
4403
|
+
},
|
|
4404
|
+
nativeOn: {
|
|
4405
|
+
'click': function click(e) {
|
|
4406
|
+
_this2.clearValue(e);
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4409
|
+
}) : h(external_icon_default.a, {
|
|
4410
|
+
'class': this.prefixCls + '-icon',
|
|
4411
|
+
attrs: { type: 'line-clock-circle-o'
|
|
4412
|
+
}
|
|
1526
4413
|
})]
|
|
1527
|
-
)
|
|
4414
|
+
), h(
|
|
4415
|
+
'div',
|
|
4416
|
+
{ 'class': [this.prefixCls + '-panel-content', this.prefixCls + '-panel-content-placement', this.popupClassName], ref: 'popper' },
|
|
4417
|
+
[popperVM]
|
|
4418
|
+
)]);
|
|
1528
4419
|
}
|
|
1529
4420
|
});
|
|
1530
4421
|
// CONCATENATED MODULE: ./components/timepicker/time-picker.vue?vue&type=script&lang=js&
|