UNPKG

140 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory(require("vue"), require("./_util/proptype"), require("./icon"), require("./transition"), require("./_mixin/emitter"), require("./button"));
4 else if(typeof define === 'function' && define.amd)
5 define(["vue", "./_util/proptype", "./icon", "./transition", "./_mixin/emitter", "./button"], factory);
6 else {
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 for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9 }
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__) {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50/******/ }
51/******/ };
52/******/
53/******/ // define __esModule on exports
54/******/ __webpack_require__.r = function(exports) {
55/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57/******/ }
58/******/ Object.defineProperty(exports, '__esModule', { value: true });
59/******/ };
60/******/
61/******/ // create a fake namespace object
62/******/ // mode & 1: value is a module id, require it
63/******/ // mode & 2: merge all properties of value into the ns
64/******/ // mode & 4: return value when already ns object
65/******/ // mode & 8|1: behave like require
66/******/ __webpack_require__.t = function(value, mode) {
67/******/ if(mode & 1) value = __webpack_require__(value);
68/******/ if(mode & 8) return value;
69/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70/******/ var ns = Object.create(null);
71/******/ __webpack_require__.r(ns);
72/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74/******/ return ns;
75/******/ };
76/******/
77/******/ // getDefaultExport function for compatibility with non-harmony modules
78/******/ __webpack_require__.n = function(module) {
79/******/ var getter = module && module.__esModule ?
80/******/ function getDefault() { return module['default']; } :
81/******/ function getModuleExports() { return module; };
82/******/ __webpack_require__.d(getter, 'a', getter);
83/******/ return getter;
84/******/ };
85/******/
86/******/ // Object.prototype.hasOwnProperty.call
87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88/******/
89/******/ // __webpack_public_path__
90/******/ __webpack_require__.p = "/dist/";
91/******/
92/******/
93/******/ // Load entry module and return exports
94/******/ return __webpack_require__(__webpack_require__.s = 94);
95/******/ })
96/************************************************************************/
97/******/ ({
98
99/***/ 0:
100/***/ (function(module, __webpack_exports__, __webpack_require__) {
101
102"use strict";
103/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
104/* globals __VUE_SSR_CONTEXT__ */
105
106// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
107// This module is a runtime utility for cleaner component module output and will
108// be included in the final webpack user bundle.
109
110function normalizeComponent (
111 scriptExports,
112 render,
113 staticRenderFns,
114 functionalTemplate,
115 injectStyles,
116 scopeId,
117 moduleIdentifier, /* server only */
118 shadowMode /* vue-cli only */
119) {
120 // Vue.extend constructor export interop
121 var options = typeof scriptExports === 'function'
122 ? scriptExports.options
123 : scriptExports
124
125 // render functions
126 if (render) {
127 options.render = render
128 options.staticRenderFns = staticRenderFns
129 options._compiled = true
130 }
131
132 // functional template
133 if (functionalTemplate) {
134 options.functional = true
135 }
136
137 // scopedId
138 if (scopeId) {
139 options._scopeId = 'data-v-' + scopeId
140 }
141
142 var hook
143 if (moduleIdentifier) { // server build
144 hook = function (context) {
145 // 2.3 injection
146 context =
147 context || // cached call
148 (this.$vnode && this.$vnode.ssrContext) || // stateful
149 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
150 // 2.2 with runInNewContext: true
151 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
152 context = __VUE_SSR_CONTEXT__
153 }
154 // inject component styles
155 if (injectStyles) {
156 injectStyles.call(this, context)
157 }
158 // register component module identifier for async chunk inferrence
159 if (context && context._registeredComponents) {
160 context._registeredComponents.add(moduleIdentifier)
161 }
162 }
163 // used by ssr in case component is cached and beforeCreate
164 // never gets called
165 options._ssrRegister = hook
166 } else if (injectStyles) {
167 hook = shadowMode
168 ? function () {
169 injectStyles.call(
170 this,
171 (options.functional ? this.parent : this).$root.$options.shadowRoot
172 )
173 }
174 : injectStyles
175 }
176
177 if (hook) {
178 if (options.functional) {
179 // for template-only hot-reload because in that case the render fn doesn't
180 // go through the normalizer
181 options._injectStyles = hook
182 // register for functional component in vue file
183 var originalRender = options.render
184 options.render = function renderWithStyleInjection (h, context) {
185 hook.call(context)
186 return originalRender(h, context)
187 }
188 } else {
189 // inject component registration as beforeCreate hook
190 var existing = options.beforeCreate
191 options.beforeCreate = existing
192 ? [].concat(existing, hook)
193 : [hook]
194 }
195 }
196
197 return {
198 exports: scriptExports,
199 options: options
200 }
201}
202
203
204/***/ }),
205
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 */
231var isServer = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer;
232var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
233var MOZ_HACK_REGEXP = /^moz([A-Z])/;
234var ieVersion = isServer ? 0 : Number(document.documentMode);
235
236/* istanbul ignore next */
237var trim = function trim(string) {
238 return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
239};
240/* istanbul ignore next */
241var 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 */
248var 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 */
265var 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 */
282var 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 */
293function 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 */
306function 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 */
327function 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 */
348var 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 */
385function 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
404var 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
413var 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
430var 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
450function 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
466var scrollBarWidth = void 0;
467function 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
498module.exports = require("babel-runtime/core-js/object/keys");
499
500/***/ }),
501
502/***/ 11:
503/***/ (function(module, exports) {
504
505module.exports = __WEBPACK_EXTERNAL_MODULE__11__;
506
507/***/ }),
508
509/***/ 12:
510/***/ (function(module, exports) {
511
512module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
513
514/***/ }),
515
516/***/ 13:
517/***/ (function(module, exports) {
518
519module.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
544var idSeed = 1;
545
546var 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
761var popup_main = __webpack_require__(14);
762
763// EXTERNAL MODULE: external "babel-runtime/core-js/object/get-own-property-descriptor"
764var get_own_property_descriptor_ = __webpack_require__(18);
765var get_own_property_descriptor_default = /*#__PURE__*/__webpack_require__.n(get_own_property_descriptor_);
766
767// EXTERNAL MODULE: external "babel-runtime/core-js/object/keys"
768var keys_ = __webpack_require__(10);
769var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
770
771// EXTERNAL MODULE: external "babel-runtime/core-js/object/assign"
772var assign_ = __webpack_require__(6);
773var 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//
807function 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
2032var 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
2230module.exports = require("babel-runtime/core-js/object/get-own-property-descriptor");
2231
2232/***/ }),
2233
2234/***/ 2:
2235/***/ (function(module, exports) {
2236
2237module.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
2265var isServer = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer;
2266
2267/* eslint no-useless-escape: 0 */
2268var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
2269var MOZ_HACK_REGEXP = /^moz([A-Z])/;
2270var ieVersion = isServer ? 0 : Number(document.documentMode);
2271
2272/* istanbul ignore next */
2273var trim = function trim(string) {
2274 return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
2275};
2276/* istanbul ignore next */
2277var 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 */
2284var 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 */
2301var 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 */
2318var 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 */
2329function 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 */
2340function 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 */
2361function 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 */
2382var 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 */
2419function 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
2438var 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
2447var 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
2464var 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
2494var 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
2532module.exports = require("moment");
2533
2534/***/ }),
2535
2536/***/ 3:
2537/***/ (function(module, exports) {
2538
2539module.exports = require("babel-runtime/helpers/defineProperty");
2540
2541/***/ }),
2542
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
2553var nodeList = [];
2554var ctx = '@@clickoutsideContext';
2555
2556var startClick = void 0;
2557var 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
2569function 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__) {
2625
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
2633var hasModal = false;
2634var hasInitZIndex = false;
2635var zIndex = void 0;
2636
2637var 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 }
2656
2657 return modalDom;
2658};
2659
2660var instances = {};
2661
2662var PopupManager = {
2663 modalFade: true,
2664
2665 getInstance: function getInstance(id) {
2666 return instances[id];
2667 },
2668
2669 register: function register(id, instance) {
2670 if (id && instance) {
2671 instances[id] = instance;
2672 }
2673 },
2674
2675 deregister: function deregister(id) {
2676 if (id) {
2677 instances[id] = null;
2678 delete instances[id];
2679 }
2680 },
2681
2682 nextZIndex: function nextZIndex() {
2683 return PopupManager.zIndex++;
2684 },
2685
2686 modalStack: [],
2687
2688 doOnModalClick: function doOnModalClick() {
2689 var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
2690 if (!topItem) return;
2691
2692 var instance = PopupManager.getInstance(topItem.id);
2693 if (instance && instance.closeOnClickModal) {
2694 instance.close();
2695 }
2696 },
2697
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};
2786
2787Object.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
2801var 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
2812if (!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);
2826
2827/***/ }),
2828
2829/***/ 6:
2830/***/ (function(module, exports) {
2831
2832module.exports = require("babel-runtime/core-js/object/assign");
2833
2834/***/ }),
2835
2836/***/ 7:
2837/***/ (function(module, exports) {
2838
2839module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
2840
2841/***/ }),
2842
2843/***/ 8:
2844/***/ (function(module, exports) {
2845
2846module.exports = __WEBPACK_EXTERNAL_MODULE__8__;
2847
2848/***/ }),
2849
2850/***/ 9:
2851/***/ (function(module, exports) {
2852
2853module.exports = require("babel-runtime/helpers/typeof");
2854
2855/***/ }),
2856
2857/***/ 94:
2858/***/ (function(module, __webpack_exports__, __webpack_require__) {
2859
2860"use strict";
2861// ESM COMPAT FLAG
2862__webpack_require__.r(__webpack_exports__);
2863
2864// EXTERNAL MODULE: ./components/style/index.less
2865var style = __webpack_require__(139);
2866
2867// EXTERNAL MODULE: ./components/timepicker/style/index.less
2868var timepicker_style = __webpack_require__(232);
2869
2870// CONCATENATED MODULE: ./components/timepicker/style/index.js
2871
2872
2873
2874// style dependencies
2875// import '../../input/style'
2876// EXTERNAL MODULE: external "babel-runtime/helpers/defineProperty"
2877var defineProperty_ = __webpack_require__(3);
2878var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
2879
2880// EXTERNAL MODULE: external "moment"
2881var external_moment_ = __webpack_require__(29);
2882var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_);
2883
2884// EXTERNAL MODULE: ./components/_util/_popper/popper-mixin.js
2885var popper_mixin = __webpack_require__(22);
2886
2887// EXTERNAL MODULE: ./components/_util/_popper/vue-popper.js + 1 modules
2888var 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 },
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});
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&
2931var headervue_type_template_id_94a41d54_render = function () {
2932 var _vm = this
2933 var _h = _vm.$createElement
2934 var _c = _vm._self._c || _h
2935 return _c(
2936 "div",
2937 {
2938 class: [
2939 _vm.prefixCls + "-input-wrap",
2940 _vm.prefixCls + "-input-wrap-" + _vm.size,
2941 ],
2942 },
2943 [
2944 _vm.isRange
2945 ? [
2946 _c("div", { class: [this.prefixCls + "-box"] }, [
2947 _c("input", {
2948 class: [
2949 _vm.prefixCls + "-input",
2950 _vm.prefixCls + "-input-half",
2951 _vm.invalid ? _vm.prefixCls + "-input-invalid" : "",
2952 ],
2953 attrs: { readonly: "", placeholder: _vm.placeholder },
2954 domProps: {
2955 value:
2956 (_vm.value[0] && _vm.value[0].format(this.format)) || "",
2957 },
2958 }),
2959 _c("span", { class: [this.prefixCls + "-box-span"] }, [
2960 _vm._v("-"),
2961 ]),
2962 _c("input", {
2963 class: [
2964 _vm.prefixCls + "-input",
2965 _vm.prefixCls + "-input-half",
2966 _vm.invalid ? _vm.prefixCls + "-input-invalid" : "",
2967 ],
2968 attrs: { readonly: "", placeholder: _vm.placeholder },
2969 domProps: {
2970 value:
2971 (_vm.value[1] && _vm.value[1].format(this.format)) || "",
2972 },
2973 }),
2974 ]),
2975 ]
2976 : [
2977 _c("input", {
2978 class: [
2979 _vm.prefixCls + "-input",
2980 _vm.invalid ? _vm.prefixCls + "-input-invalid" : "",
2981 ],
2982 attrs: { readonly: "", placeholder: _vm.placeholder },
2983 domProps: {
2984 value: (_vm.value && _vm.value.format(this.format)) || "",
2985 },
2986 }),
2987 ],
2988 _c(
2989 "div",
2990 {
2991 class: _vm.prefixCls + "-clear-btn",
2992 on: { click: _vm.handleClearClick },
2993 },
2994 [
2995 _vm.allowEmpty
2996 ? _c("mds-icon", {
2997 attrs: { title: _vm.clearText, type: "line-close" },
2998 })
2999 : _vm._e(),
3000 ],
3001 1
3002 ),
3003 ],
3004 2
3005 )
3006}
3007var staticRenderFns = []
3008headervue_type_template_id_94a41d54_render._withStripped = true
3009
3010
3011// CONCATENATED MODULE: ./components/timepicker/header.vue?vue&type=template&id=94a41d54&
3012
3013// EXTERNAL MODULE: external "./icon"
3014var external_icon_ = __webpack_require__(8);
3015var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
3016
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&
3018//
3019//
3020//
3021//
3022//
3023//
3024//
3025//
3026//
3027//
3028//
3029//
3030//
3031//
3032//
3033//
3034//
3035//
3036//
3037//
3038//
3039//
3040//
3041//
3042//
3043//
3044//
3045//
3046//
3047//
3048//
3049//
3050//
3051//
3052//
3053//
3054//
3055//
3056//
3057//
3058//
3059//
3060//
3061//
3062//
3063//
3064//
3065//
3066//
3067
3068
3069/* harmony default export */ var headervue_type_script_lang_js_ = ({
3070 components: {
3071 MdsIcon: external_icon_default.a
3072 },
3073 props: {
3074 prefixCls: String,
3075 allowEmpty: {
3076 type: Boolean,
3077 default: true
3078 },
3079 clearText: {
3080 type: String,
3081 default: 'clear'
3082 },
3083 isRange: Boolean,
3084 format: String,
3085 invalid: {
3086 type: Boolean,
3087 default: false
3088 },
3089 size: String,
3090 placeholder: String,
3091 value: null
3092 },
3093 methods: {
3094 handleClearClick: function handleClearClick(e) {
3095 this.$emit('clear', e);
3096 }
3097 }
3098});
3099// CONCATENATED MODULE: ./components/timepicker/header.vue?vue&type=script&lang=js&
3100 /* harmony default export */ var timepicker_headervue_type_script_lang_js_ = (headervue_type_script_lang_js_);
3101// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3102var componentNormalizer = __webpack_require__(0);
3103
3104// CONCATENATED MODULE: ./components/timepicker/header.vue
3105
3106
3107
3108
3109
3110/* normalize component */
3111
3112var component = Object(componentNormalizer["a" /* default */])(
3113 timepicker_headervue_type_script_lang_js_,
3114 headervue_type_template_id_94a41d54_render,
3115 staticRenderFns,
3116 false,
3117 null,
3118 null,
3119 null
3120
3121)
3122
3123/* hot reload */
3124if (false) { var api; }
3125component.options.__file = "components/timepicker/header.vue"
3126/* harmony default export */ var header = (component.exports);
3127// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/select.vue?vue&type=template&id=45c91776&
3128var selectvue_type_template_id_45c91776_render = function () {
3129 var _vm = this
3130 var _h = _vm.$createElement
3131 var _c = _vm._self._c || _h
3132 return _c(
3133 "div",
3134 {
3135 class: _vm.classes,
3136 on: {
3137 mouseenter: _vm.handleMouseEnter,
3138 mouseleave: _vm.handleMouseLeave,
3139 },
3140 },
3141 [
3142 _c(
3143 "ul",
3144 { ref: "list" },
3145 _vm._l(_vm.options, function (item, index) {
3146 var _obj
3147 return _c(
3148 "li",
3149 {
3150 key: item.value,
3151 class:
3152 ((_obj = {}),
3153 (_obj[_vm.prefixCls + "-select-option-selected"] =
3154 _vm.selectedIndex === index),
3155 (_obj[_vm.prefixCls + "-select-option-disabled"] =
3156 item.disabled),
3157 _obj),
3158 attrs: { disabled: item.disabled },
3159 on: {
3160 click: function ($event) {
3161 !item.disabled ? _vm.handleClick(item.value) : null
3162 },
3163 },
3164 },
3165 [_vm._v("\n " + _vm._s(item.value) + "\n ")]
3166 )
3167 }),
3168 0
3169 ),
3170 ]
3171 )
3172}
3173var selectvue_type_template_id_45c91776_staticRenderFns = []
3174selectvue_type_template_id_45c91776_render._withStripped = true
3175
3176
3177// CONCATENATED MODULE: ./components/timepicker/select.vue?vue&type=template&id=45c91776&
3178
3179// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/select.vue?vue&type=script&lang=js&
3180
3181//
3182//
3183//
3184//
3185//
3186//
3187//
3188//
3189//
3190//
3191//
3192//
3193//
3194//
3195//
3196//
3197//
3198//
3199//
3200//
3201//
3202
3203
3204var scrollTo = function scrollTo(element, to, duration) {
3205 var requestAnimationFrame = window.requestAnimationFrame || function requestAnimationFrameTimeout() {
3206 return setTimeout(arguments[0], 10);
3207 };
3208 // jump to target if duration zero
3209 if (duration <= 0) {
3210 element.scrollTop = to;
3211 return;
3212 }
3213 var difference = to - element.scrollTop;
3214 var perTick = difference / duration * 10;
3215
3216 requestAnimationFrame(function () {
3217 element.scrollTop = element.scrollTop + perTick;
3218 if (element.scrollTop === to) return;
3219 scrollTo(element, to, duration - 10);
3220 });
3221};
3222
3223/* harmony default export */ var selectvue_type_script_lang_js_ = ({
3224 props: {
3225 isShow: Boolean,
3226 prefixCls: String,
3227 options: Array,
3228 selectedIndex: Number,
3229 type: String
3230 },
3231 data: function data() {
3232 return {
3233 active: false
3234 };
3235 },
3236
3237 watch: {
3238 isShow: function isShow(v) {
3239 v && this.scrollToSelected(0);
3240 },
3241 selectedIndex: function selectedIndex(v) {
3242 this.scrollToSelected(120);
3243 }
3244 },
3245 methods: {
3246 handleMouseEnter: function handleMouseEnter() {
3247 this.active = true;
3248 },
3249 handleMouseLeave: function handleMouseLeave() {
3250 this.active = false;
3251 },
3252 handleClick: function handleClick(value) {
3253 this.$emit('selected', this.type, value);
3254 },
3255 scrollToSelected: function scrollToSelected(duration) {
3256 var select = this.$el;
3257 var list = this.$refs.list;
3258 if (!list) {
3259 return;
3260 }
3261 var index = this.selectedIndex < 0 ? 0 : this.selectedIndex;
3262 var topOption = list.children[index];
3263 if (!topOption) {
3264 return;
3265 }
3266 var to = topOption.offsetTop;
3267 scrollTo(select, to, duration);
3268 }
3269 },
3270 computed: {
3271 classes: function classes() {
3272 var prefixCls = this.prefixCls;
3273 return [prefixCls + '-select', defineProperty_default()({}, prefixCls + '-select-active', this.active)];
3274 }
3275 },
3276 mounted: function mounted() {
3277 this.scrollToSelected(0);
3278 }
3279});
3280// CONCATENATED MODULE: ./components/timepicker/select.vue?vue&type=script&lang=js&
3281 /* harmony default export */ var timepicker_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
3282// CONCATENATED MODULE: ./components/timepicker/select.vue
3283
3284
3285
3286
3287
3288/* normalize component */
3289
3290var select_component = Object(componentNormalizer["a" /* default */])(
3291 timepicker_selectvue_type_script_lang_js_,
3292 selectvue_type_template_id_45c91776_render,
3293 selectvue_type_template_id_45c91776_staticRenderFns,
3294 false,
3295 null,
3296 null,
3297 null
3298
3299)
3300
3301/* hot reload */
3302if (false) { var select_api; }
3303select_component.options.__file = "components/timepicker/select.vue"
3304/* harmony default export */ var timepicker_select = (select_component.exports);
3305// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/combobox.vue?vue&type=script&lang=js&
3306
3307
3308
3309var formatOption = function formatOption(option, disabledOptions) {
3310 var value = option < 10 ? '0' + option : '' + option;
3311 var disabled = disabledOptions && disabledOptions.indexOf(option) >= 0;
3312
3313 return {
3314 value: value,
3315 disabled: disabled
3316 };
3317};
3318
3319/* harmony default export */ var comboboxvue_type_script_lang_js_ = ({
3320 props: {
3321 prefixCls: String,
3322 defaultOpenValue: Object,
3323 disabledHours: Array,
3324 disabledMinutes: Array,
3325 disabledSeconds: Array,
3326 format: String,
3327 isShow: Boolean,
3328 hourOptions: Array,
3329 minuteOptions: Array,
3330 secondOptions: Array,
3331 showHour: Boolean,
3332 showMinute: Boolean,
3333 showSecond: Boolean,
3334 use12Hours: Boolean,
3335 isAM: Boolean,
3336 index: Number,
3337 value: null
3338 },
3339 components: {
3340 MdsPickerSelect: timepicker_select
3341 },
3342 methods: {
3343 handleSelected: function handleSelected(type, itemValue) {
3344 var value = (this.value || this.defaultOpenValue).clone();
3345 if (type === 'hour') {
3346 if (this.use12Hours) {
3347 if (this.isAM) {
3348 value.hour(+itemValue % 12);
3349 } else {
3350 value.hour(+itemValue % 12 + 12);
3351 }
3352 } else {
3353 value.hour(+itemValue);
3354 }
3355 } else if (type === 'minute') {
3356 value.minute(+itemValue);
3357 } else if (type === 'ampm') {
3358 var ampm = itemValue.toUpperCase();
3359 if (this.use12Hours) {
3360 if (ampm === 'PM' && value.hour() < 12) {
3361 value.hour(value.hour() % 12 + 12);
3362 }
3363 if (ampm === 'AM') {
3364 if (value.hour() >= 12) {
3365 value.hour(value.hour() - 12);
3366 }
3367 }
3368 }
3369 } else {
3370 value.second(+itemValue);
3371 }
3372 this.$emit('change', value, this.index);
3373 }
3374 },
3375 render: function render(h) {
3376 var _this = this;
3377
3378 var value = this.value || this.defaultOpenValue;
3379
3380 var getHourSelect = function getHourSelect(hour) {
3381 if (!_this.showHour) {
3382 return null;
3383 }
3384 var disabledOptions = _this.disabledHours;
3385 var hourOptionsAdj = _this.use12Hours ? [12].concat(_this.hourOptions.filter(function (h) {
3386 return h < 12 && h > 0;
3387 })) : _this.hourOptions;
3388 var hourAdj = _this.use12Hours ? hour % 12 || 12 : hour;
3389 var options = hourOptionsAdj.map(function (el) {
3390 return formatOption(el, disabledOptions);
3391 });
3392 var selectedIndex = hourOptionsAdj.indexOf(hourAdj);
3393
3394 return h(timepicker_select, {
3395 attrs: {
3396 isShow: _this.isShow,
3397 prefixCls: _this.prefixCls,
3398 options: options,
3399 selectedIndex: selectedIndex,
3400
3401 type: 'hour' },
3402 on: {
3403 'selected': _this.handleSelected
3404 }
3405 });
3406 };
3407
3408 var getMinuteSelect = function getMinuteSelect(minute) {
3409 if (!_this.showMinute) {
3410 return null;
3411 }
3412 var disabledOptions = _this.disabledMinutes;
3413 var options = _this.minuteOptions.map(function (option) {
3414 return formatOption(option, disabledOptions);
3415 });
3416 var selectedIndex = _this.minuteOptions.indexOf(minute);
3417
3418 return h(timepicker_select, {
3419 attrs: {
3420 isShow: _this.isShow,
3421 prefixCls: _this.prefixCls,
3422 options: options,
3423 selectedIndex: selectedIndex,
3424 type: 'minute'
3425 },
3426 on: {
3427 'selected': _this.handleSelected
3428 }
3429 });
3430 };
3431
3432 var getSecondSelect = function getSecondSelect(second) {
3433 if (!_this.showSecond) {
3434 return null;
3435 }
3436 var disabledOptions = _this.disabledSeconds;
3437 var options = _this.secondOptions.map(function (option) {
3438 return formatOption(option, disabledOptions);
3439 });
3440 var selectedIndex = _this.secondOptions.indexOf(second);
3441
3442 return h(timepicker_select, {
3443 attrs: {
3444 isShow: _this.isShow,
3445 prefixCls: _this.prefixCls,
3446 options: options,
3447 selectedIndex: selectedIndex,
3448 type: 'second'
3449 },
3450 on: {
3451 'selected': _this.handleSelected
3452 }
3453 });
3454 };
3455
3456 var getAMPMSelect = function getAMPMSelect() {
3457 if (!_this.use12Hours) {
3458 return null;
3459 }
3460 var AMPMOptions = ['am', 'pm'] // If format has A char, then we should uppercase AM/PM
3461 .map(function (c) {
3462 return _this.format.match(/\sA/) ? c.toUpperCase() : c;
3463 }).map(function (c) {
3464 return { value: c };
3465 });
3466
3467 var selectedIndex = _this.isAM ? 0 : 1;
3468
3469 return h(timepicker_select, {
3470 attrs: {
3471 isShow: _this.isShow,
3472 prefixCls: _this.prefixCls,
3473 options: AMPMOptions,
3474 selectedIndex: selectedIndex,
3475 type: 'ampm'
3476 },
3477 on: {
3478 'selected': _this.handleSelected
3479 }
3480 });
3481 };
3482
3483 var addon = function addon() {
3484 if (!_this.$slots.default) {
3485 return null;
3486 }
3487 return h(
3488 'div',
3489 { 'class': _this.prefixCls + '-addon' },
3490 [_this.$slots.default]
3491 );
3492 };
3493
3494 return h(
3495 'div',
3496 { 'class': this.prefixCls + '-combobox' },
3497 [getHourSelect(value.hour()), getMinuteSelect(value.minute()), getSecondSelect(value.second()), getAMPMSelect(), addon()]
3498 );
3499 }
3500});
3501// CONCATENATED MODULE: ./components/timepicker/combobox.vue?vue&type=script&lang=js&
3502 /* harmony default export */ var timepicker_comboboxvue_type_script_lang_js_ = (comboboxvue_type_script_lang_js_);
3503// CONCATENATED MODULE: ./components/timepicker/combobox.vue
3504var combobox_render, combobox_staticRenderFns
3505
3506
3507
3508
3509/* normalize component */
3510
3511var combobox_component = Object(componentNormalizer["a" /* default */])(
3512 timepicker_comboboxvue_type_script_lang_js_,
3513 combobox_render,
3514 combobox_staticRenderFns,
3515 false,
3516 null,
3517 null,
3518 null
3519
3520)
3521
3522/* hot reload */
3523if (false) { var combobox_api; }
3524combobox_component.options.__file = "components/timepicker/combobox.vue"
3525/* harmony default export */ var combobox = (combobox_component.exports);
3526// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/timepicker/panel.vue?vue&type=script&lang=js&
3527//
3528
3529
3530
3531
3532
3533var generateOptions = function generateOptions(length, disabledOptions, hideDisabledOptions) {
3534 var step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
3535
3536 var arr = [];
3537 for (var value = 0; value < length; value += step) {
3538 if (!disabledOptions || disabledOptions.indexOf(value) < 0 || !hideDisabledOptions) {
3539 arr.push(value);
3540 }
3541 }
3542 return arr;
3543};
3544var isAM = function isAM(value) {
3545 return value && value.hour() >= 0 && value.hour() < 12;
3546};
3547
3548/* harmony default export */ var panelvue_type_script_lang_js_ = ({
3549 props: {
3550 prefixCls: String,
3551 defaultOpenValue: Object,
3552 disabledHours: Function,
3553 disabledMinutes: Function,
3554 disabledSeconds: Function,
3555 mintime: Object,
3556 maxtime: Object,
3557 isRange: Boolean,
3558 isShow: Boolean,
3559 format: String,
3560 hideDisabledOptions: Boolean,
3561 hourOptions: Array,
3562 minuteOptions: Array,
3563 placeholder: String,
3564 size: String,
3565 secondOptions: Array,
3566 showHour: Boolean,
3567 showMinute: Boolean,
3568 showSecond: Boolean,
3569 use12Hours: Boolean,
3570 allowEmpty: Boolean,
3571 value: null,
3572 step: Number
3573 },
3574 components: {
3575 MdsPickerHeader: header,
3576 MdsPickerCombobox: combobox
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
3588 methods: {
3589 handleChange: function handleChange(value, index) {
3590 if (typeof index === 'number' && this.isRange) {
3591 var f = this.value[0] ? this.value[0].clone() : null;
3592 var s = this.value[1] ? this.value[1].clone() : null;
3593 var val = [f, s];
3594 val[index] = value;
3595 this.$emit('change', val);
3596 } else {
3597 this.$emit('change', value);
3598 }
3599 },
3600 handleHeaderClick: function handleHeaderClick(e) {
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;
3725 }
3726 },
3727 render: function render(h) {
3728 var _this = this;
3729
3730 var disabledHours = function disabledHours(value) {
3731 var disabledOptions = _this.disabledHours();
3732 var result = _this.use12Hours && Array.isArray(disabledOptions) ? isAM(value) ? disabledOptions.filter(function (h) {
3733 return h < 12;
3734 }).map(function (h) {
3735 return h === 0 ? 12 : h;
3736 }) : disabledOptions.map(function (h) {
3737 return h === 12 ? 12 : h - 12;
3738 }) : disabledOptions;
3739 return result;
3740 };
3741
3742 var getPickerCombobox = function getPickerCombobox(value) {
3743 var otherValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
3744 var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3745
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'));
3750 if (index === 0 && otherValue) {
3751 var totalHour = void 0;
3752 _this.use12Hours ? totalHour = 12 : totalHour = 24;
3753 for (var i = otherValue.hour() + 1; i < totalHour; i++) {
3754 if (disabledHourOptions.indexOf(i) < 0) disabledHourOptions.push(i);
3755 }
3756 if (value && value.hour() >= otherValue.hour()) {
3757 for (var _i4 = otherValue.minute(); _i4 <= 60; _i4++) {
3758 if (disabledMinuteOptions.indexOf(_i4) < 0) {
3759 disabledMinuteOptions.push(_i4);
3760 }
3761 }
3762 }
3763 if (value && value.hour() >= otherValue.hour() && value.minute() >= otherValue.minute()) {
3764 for (var _i5 = otherValue.second() + 1; _i5 <= 60; _i5++) {
3765 if (disabledSecondOptions.indexOf(_i5) < 0) {
3766 disabledSecondOptions.push(_i5);
3767 }
3768 }
3769 }
3770 } else if (index === 1 && otherValue) {
3771 for (var _i6 = 0; _i6 < otherValue.hour(); _i6++) {
3772 if (disabledHourOptions.indexOf(_i6) < 0) disabledHourOptions.push(_i6);
3773 }
3774 if (value && value.hour() <= otherValue.hour()) {
3775 for (var _i7 = 0; _i7 < otherValue.minute(); _i7++) {
3776 if (disabledMinuteOptions.indexOf(_i7) < 0) {
3777 disabledMinuteOptions.push(_i7);
3778 }
3779 }
3780 }
3781 if (value && value.hour() <= otherValue.hour() && value.minute() <= otherValue.minute()) {
3782 for (var _i8 = 0; _i8 < otherValue.second(); _i8++) {
3783 if (disabledSecondOptions.indexOf(_i8) < 0) {
3784 disabledSecondOptions.push(_i8);
3785 }
3786 }
3787 }
3788 }
3789
3790 var hourOptions = generateOptions(24, disabledHourOptions, _this.hideDisabledOptions);
3791 var minuteOptions = generateOptions(60, disabledMinuteOptions, _this.hideDisabledOptions, _this.step);
3792 var secondOptions = generateOptions(60, disabledSecondOptions, _this.hideDisabledOptions);
3793 return h(combobox, {
3794 attrs: {
3795 prefixCls: _this.prefixCls,
3796 defaultOpenValue: _this.defaultOpenValue,
3797 disabledHours: disabledHourOptions,
3798 disabledMinutes: disabledMinuteOptions,
3799 disabledSeconds: disabledSecondOptions,
3800 format: _this.format,
3801 isAM: isAM(value),
3802 isShow: _this.isShow,
3803 hideDisabledOptions: _this.hideDisabledOptions,
3804 hourOptions: hourOptions,
3805 minuteOptions: minuteOptions,
3806 secondOptions: secondOptions,
3807 showHour: _this.showHour,
3808 showMinute: _this.showMinute,
3809 showSecond: _this.showSecond,
3810
3811 use12Hours: _this.use12Hours,
3812 index: index,
3813 value: value
3814 },
3815 on: {
3816 'change': _this.handleChange
3817 }
3818 });
3819 };
3820 var getPickerBox = function getPickerBox() {
3821 var getPickerBottom = function getPickerBottom() {
3822 if (_this.$slots.default === undefined) {
3823 return '';
3824 } else {
3825 return h(
3826 'div',
3827 { 'class': _this.prefixCls + '-picker-box-bottom' },
3828 [_this.$slots.default]
3829 );
3830 }
3831 };
3832 if (_this.isRange) {
3833 return h(
3834 'div',
3835 {
3836 'class': _this.prefixCls + '-picker-box ' + _this.prefixCls + '-picker-half'
3837 },
3838 [h(
3839 'div',
3840 { 'class': _this.prefixCls + '-picker-box-halfbox' },
3841 [h(
3842 'div',
3843 { 'class': _this.prefixCls + '-picker-box-half' },
3844 [h('h2', ['\u5F00\u59CB\u65F6\u95F4']), getPickerCombobox(_this.value[0], _this.value[1], 0)]
3845 ), h(
3846 'div',
3847 { 'class': _this.prefixCls + '-picker-box-half' },
3848 [h('h2', ['\u7ED3\u675F\u65F6\u95F4']), getPickerCombobox(_this.value[1], _this.value[0], 1)]
3849 )]
3850 ), getPickerBottom()]
3851 );
3852 } else {
3853 return h(
3854 'div',
3855 { 'class': _this.prefixCls + '-picker-box' },
3856 [getPickerCombobox(_this.value), getPickerBottom()]
3857 );
3858 }
3859 };
3860
3861 return h(
3862 'div',
3863 { 'class': this.prefixCls + '-inner' },
3864 [getPickerBox()]
3865 );
3866 }
3867});
3868// CONCATENATED MODULE: ./components/timepicker/panel.vue?vue&type=script&lang=js&
3869 /* harmony default export */ var timepicker_panelvue_type_script_lang_js_ = (panelvue_type_script_lang_js_);
3870// CONCATENATED MODULE: ./components/timepicker/panel.vue
3871var panel_render, panel_staticRenderFns
3872
3873
3874
3875
3876/* normalize component */
3877
3878var panel_component = Object(componentNormalizer["a" /* default */])(
3879 timepicker_panelvue_type_script_lang_js_,
3880 panel_render,
3881 panel_staticRenderFns,
3882 false,
3883 null,
3884 null,
3885 null
3886
3887)
3888
3889/* hot reload */
3890if (false) { var panel_api; }
3891panel_component.options.__file = "components/timepicker/panel.vue"
3892/* harmony default export */ var panel = (panel_component.exports);
3893// EXTERNAL MODULE: ./components/_util/clickoutside.js
3894var clickoutside = __webpack_require__(38);
3895
3896// EXTERNAL MODULE: external "./_util/proptype"
3897var proptype_ = __webpack_require__(7);
3898
3899// EXTERNAL MODULE: external "./transition"
3900var external_transition_ = __webpack_require__(11);
3901var external_transition_default = /*#__PURE__*/__webpack_require__.n(external_transition_);
3902
3903// EXTERNAL MODULE: external "./button"
3904var external_button_ = __webpack_require__(13);
3905var external_button_default = /*#__PURE__*/__webpack_require__.n(external_button_);
3906
3907// EXTERNAL MODULE: external "./_mixin/emitter"
3908var emitter_ = __webpack_require__(12);
3909var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
3910
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&
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927function generateShowHourMinuteSecond(format) {
3928 // Ref: http://momentjs.com/docs/#/parsing/string-format/
3929 return {
3930 showHour: format.indexOf('H') > -1 || format.indexOf('h') > -1 || format.indexOf('k') > -1,
3931 showMinute: format.indexOf('m') > -1,
3932 showSecond: format.indexOf('s') > -1
3933 };
3934}
3935
3936/* harmony default export */ var time_pickervue_type_script_lang_js_ = ({
3937 name: 'MdsTimePicker',
3938 mixins: [vue_popper["a" /* default */], popper_mixin["a" /* default */], emitter_default.a, lazyMode],
3939 directives: { Clickoutside: clickoutside["a" /* default */] },
3940 model: {
3941 event: 'change'
3942 },
3943 data: function data() {
3944 return {
3945 current: 0,
3946 showHour: true,
3947 showMinute: true,
3948 showSecond: true,
3949 popperModifiers: {
3950 inner: {
3951 enabled: true
3952 },
3953 offset: {
3954 offset: '2px'
3955 }
3956 },
3957 visible: false,
3958 momentValue: null,
3959 inputHover: false
3960 };
3961 },
3962
3963 props: {
3964 prefixCls: {
3965 type: String,
3966 default: 'mds-time-picker'
3967 },
3968 width: Number,
3969 allowEmpty: {
3970 type: Boolean,
3971 default: true
3972 },
3973 clearText: {
3974 type: String,
3975 default: 'clear'
3976 },
3977 defaultOpenValue: {
3978 type: Object,
3979 validator: function validator(value) {
3980 return external_moment_default.a.isMoment(value);
3981 },
3982
3983 default: function _default() {
3984 return external_moment_default()('00:00:00', 'HH:mm:ss');
3985 }
3986 },
3987 disabled: {
3988 type: Boolean,
3989 default: false
3990 },
3991 disabledHours: {
3992 type: Function,
3993 default: function _default() {
3994 return [];
3995 }
3996 },
3997 disabledMinutes: {
3998 type: Function,
3999 default: function _default(h) {
4000 return [];
4001 }
4002 },
4003 disabledSeconds: {
4004 type: Function,
4005 default: function _default(h, m) {
4006 return [];
4007 }
4008 },
4009 mintime: Object,
4010 maxtime: Object,
4011 format: {
4012 type: String,
4013 default: ''
4014 },
4015 valueFormat: {
4016 type: String,
4017 default: ''
4018 },
4019 hideDisabledOptions: {
4020 type: Boolean,
4021 default: false
4022 },
4023 open: {
4024 type: Boolean,
4025 default: false
4026 },
4027 placement: {
4028 type: String,
4029 default: 'bottomLeft'
4030 },
4031 placeholder: {
4032 type: String,
4033 default: '请选择时间'
4034 },
4035 startPlaceholder: {
4036 type: String,
4037 default: '开始时间'
4038 },
4039 endPlaceholder: {
4040 type: String,
4041 default: '结束时间'
4042 },
4043 popupClassName: {
4044 type: String,
4045 default: ''
4046 },
4047 size: {
4048 type: String,
4049 default: 'default',
4050 validator: function validator(value) {
4051 return Object(proptype_["oneOf"])(value, ['large', 'default', 'small', 'mini']);
4052 }
4053 },
4054 use12Hours: {
4055 type: Boolean,
4056 default: false
4057 },
4058 isRange: {
4059 type: Boolean,
4060 default: false
4061 },
4062 value: {
4063 validator: function validator(value) {
4064 if (Array.isArray(value)) {
4065 return (value[0] ? external_moment_default.a.isMoment(value[0]) || typeof value[0] === 'string' : true) && (value[1] ? external_moment_default.a.isMoment(value[1]) || typeof value[1] === 'string' : true);
4066 } else {
4067 return typeof value === 'string' || external_moment_default.a.isMoment(value);
4068 }
4069 },
4070
4071 required: true
4072 },
4073 step: {
4074 type: Number,
4075 default: 1
4076 },
4077 // 不得不说这也是一次可耻的业务封装,用来在面板下面加个确定取消,延迟回显
4078 lazyMode: Boolean
4079 },
4080 components: {
4081 MdsPanel: panel,
4082 MdsTransition: external_transition_default.a,
4083 MdsIcon: external_icon_default.a,
4084 MdsButton: external_button_default.a
4085 },
4086 computed: {
4087 classes: function classes() {
4088 var _ref;
4089
4090 var prefixCls = this.prefixCls;
4091 return ['' + prefixCls, (_ref = {}, defineProperty_default()(_ref, prefixCls + '-' + this.size, !!this.size), defineProperty_default()(_ref, prefixCls + '-disabled', this.disabled), _ref)];
4092 },
4093 defaultFormat: function defaultFormat() {
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;
4101 }
4102 },
4103 created: function created() {
4104 this.initMomentValue();
4105 },
4106 mounted: function mounted() {
4107 this.visible = this.open;
4108 this.updatePopper();
4109 },
4110
4111
4112 watch: {
4113 open: function open(v) {
4114 this.visible = v;
4115 },
4116 visible: function visible(v) {
4117 var _this = this;
4118
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 }
4136 },
4137 value: function value(v) {
4138 this.initMomentValue();
4139 }
4140 },
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 },
4155 initMomentValue: function initMomentValue() {
4156 if (this.isRange) {
4157 this.momentValue = [null, null];
4158 if (this.value[0]) {
4159 this.momentValue[0] = external_moment_default()(this.value[0], this.defaultFormat);
4160 }
4161 if (this.value[1]) {
4162 this.momentValue[1] = external_moment_default()(this.value[1], this.defaultFormat);
4163 }
4164 } else {
4165 if (this.value) {
4166 this.momentValue = external_moment_default()(this.value, this.defaultFormat);
4167 } else this.momentValue = null;
4168 }
4169
4170 if (this.lazyMode) {
4171 this.lazyMomentValue = this.momentValue;
4172 }
4173 },
4174 handleClick: function handleClick() {
4175 if (this.disabled) {
4176 return;
4177 }
4178 this.visible = !this.visible;
4179 if (this.isRange) {
4180 this.$refs.inputF.blur();
4181 this.$refs.inputS.blur();
4182 } else {
4183 this.$refs.input.blur();
4184 }
4185 },
4186 handleChange: function handleChange(value) {
4187 if (this.isRange) {
4188 var formatValue = [];
4189 formatValue[0] = this.valueFormat ? value[0] ? value[0].format(this.valueFormat) : '' : value[0];
4190 formatValue[1] = this.valueFormat ? value[1] ? value[1].format(this.valueFormat) : '' : value[1];
4191 this.momentValue = value;
4192 if (!this.lazyMode) {
4193 this.$emit('change', formatValue);
4194 this.dispatch('MdsFormItem', 'formItemChange', formatValue);
4195 }
4196 } else {
4197 var _formatValue = this.valueFormat ? value.format(this.valueFormat) : value;
4198 this.momentValue = value;
4199 if (!this.lazyMode) {
4200 this.$emit('change', _formatValue);
4201 this.dispatch('MdsFormItem', 'formItemChange', _formatValue);
4202 }
4203 }
4204 },
4205 handleClear: function handleClear(e) {
4206 if (this.isRange) {
4207 this.momentValue = [null, null];
4208 this.$emit('change', ['', '']);
4209 this.dispatch('MdsFormItem', 'formItemChange', ['', '']);
4210 } else {
4211 this.momentValue = '';
4212 this.$emit('change', '');
4213 this.dispatch('MdsFormItem', 'formItemChange', '');
4214 }
4215 this.visible = false;
4216 this.$emit('clear', e);
4217 },
4218 closePopper: function closePopper(e) {
4219 this.visible = false;
4220 }
4221 },
4222 render: function render(h) {
4223 var _this2 = this;
4224
4225 if (this.isRange && !Array.isArray(this.value)) {
4226 throw new Error('传入的值必须为数组');
4227 } else if (!this.isRange && Array.isArray(this.value)) {
4228 throw new Error('传入的值不能为数组');
4229 }
4230
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 }
4241
4242 if (_this2.lazyMode) {
4243 return h(
4244 'div',
4245 { 'class': 'lazy-footer' },
4246 [h(
4247 'mds-button',
4248 {
4249 attrs: {
4250 type: 'normal',
4251 size: 'large-small'
4252 },
4253 on: {
4254 'click': function click(e) {
4255 _this2.lazyCancel(e);
4256 }
4257 }
4258 },
4259 ['\u53D6\u6D88']
4260 ), h(
4261 'mds-button',
4262 {
4263 attrs: {
4264 type: 'normal',
4265 size: 'large-small'
4266 },
4267 style: 'margin-left: 0',
4268 on: {
4269 'click': function click(e) {
4270 _this2.lazyConfirm(e);
4271 }
4272 }
4273 },
4274 ['\u786E\u5B9A']
4275 )]
4276 );
4277 }
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
4336 var getInput = function getInput() {
4337 if (_this2.isRange) {
4338 return h(
4339 'div',
4340 { 'class': _this2.prefixCls + '-box' },
4341 [h('input', {
4342 ref: 'inputF',
4343 'class': _this2.prefixCls + '-input ' + _this2.prefixCls + '-box-half',
4344 attrs: { disabled: _this2.disabled,
4345 placeholder: _this2.startPlaceholder
4346 },
4347 domProps: {
4348 'value': _this2.realMomentValue[0] && _this2.realMomentValue[0].format(_this2.defaultFormat) || ''
4349 }
4350 }), h(
4351 'span',
4352 { 'class': _this2.prefixCls + '-box-span' },
4353 ['-']
4354 ), h('input', {
4355 ref: 'inputS',
4356 'class': _this2.prefixCls + '-input ' + _this2.prefixCls + '-box-half',
4357 attrs: { disabled: _this2.disabled,
4358 placeholder: _this2.endPlaceholder
4359 },
4360 domProps: {
4361 'value': _this2.realMomentValue[1] && _this2.realMomentValue[1].format(_this2.defaultFormat) || ''
4362 }
4363 })]
4364 );
4365 } else {
4366 return h('input', {
4367 ref: 'input',
4368 'class': _this2.prefixCls + '-input',
4369 attrs: { disabled: _this2.disabled,
4370 placeholder: _this2.placeholder
4371 },
4372 domProps: {
4373 'value': _this2.realMomentValue && _this2.realMomentValue.format(_this2.defaultFormat) || ''
4374 }
4375 });
4376 }
4377 };
4378
4379 return h('span', [h(
4380 'div',
4381 {
4382 ref: 'reference',
4383 directives: [{
4384 name: 'clickoutside',
4385 value: this.closePopper
4386 }],
4387
4388 style: this.width ? 'width: ' + this.width + 'px' : '',
4389 'class': this.classes,
4390 on: {
4391 'click': this.handleClick,
4392 'mouseenter': function mouseenter() {
4393 _this2.inputHover = true;
4394 },
4395 'mouseleave': function mouseleave() {
4396 _this2.inputHover = false;
4397 }
4398 }
4399 },
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 }
4413 })]
4414 ), h(
4415 'div',
4416 { 'class': [this.prefixCls + '-panel-content', this.prefixCls + '-panel-content-placement', this.popupClassName], ref: 'popper' },
4417 [popperVM]
4418 )]);
4419 }
4420});
4421// CONCATENATED MODULE: ./components/timepicker/time-picker.vue?vue&type=script&lang=js&
4422 /* harmony default export */ var timepicker_time_pickervue_type_script_lang_js_ = (time_pickervue_type_script_lang_js_);
4423// CONCATENATED MODULE: ./components/timepicker/time-picker.vue
4424var time_picker_render, time_picker_staticRenderFns
4425
4426
4427
4428
4429/* normalize component */
4430
4431var time_picker_component = Object(componentNormalizer["a" /* default */])(
4432 timepicker_time_pickervue_type_script_lang_js_,
4433 time_picker_render,
4434 time_picker_staticRenderFns,
4435 false,
4436 null,
4437 null,
4438 null
4439
4440)
4441
4442/* hot reload */
4443if (false) { var time_picker_api; }
4444time_picker_component.options.__file = "components/timepicker/time-picker.vue"
4445/* harmony default export */ var time_picker = (time_picker_component.exports);
4446// CONCATENATED MODULE: ./components/timepicker/index.js
4447
4448
4449/* istanbul ignore next */
4450time_picker.install = function (Vue) {
4451 Vue.component(time_picker.name, time_picker);
4452};
4453/* harmony default export */ var timepicker = __webpack_exports__["default"] = (time_picker);
4454
4455/***/ })
4456
4457/******/ });
4458});
\No newline at end of file