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__) {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
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 |
|
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 |
|
62 |
|
63 |
|
64 |
|
65 |
|
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 |
|
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 |
|
87 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88 |
|
89 |
|
90 | __webpack_require__.p = "/dist/";
|
91 |
|
92 |
|
93 |
|
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 | __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | function normalizeComponent (
|
111 | scriptExports,
|
112 | render,
|
113 | staticRenderFns,
|
114 | functionalTemplate,
|
115 | injectStyles,
|
116 | scopeId,
|
117 | moduleIdentifier, /* server only */
|
118 | shadowMode /* vue-cli only */
|
119 | ) {
|
120 |
|
121 | var options = typeof scriptExports === 'function'
|
122 | ? scriptExports.options
|
123 | : scriptExports
|
124 |
|
125 |
|
126 | if (render) {
|
127 | options.render = render
|
128 | options.staticRenderFns = staticRenderFns
|
129 | options._compiled = true
|
130 | }
|
131 |
|
132 |
|
133 | if (functionalTemplate) {
|
134 | options.functional = true
|
135 | }
|
136 |
|
137 |
|
138 | if (scopeId) {
|
139 | options._scopeId = 'data-v-' + scopeId
|
140 | }
|
141 |
|
142 | var hook
|
143 | if (moduleIdentifier) {
|
144 | hook = function (context) {
|
145 |
|
146 | context =
|
147 | context ||
|
148 | (this.$vnode && this.$vnode.ssrContext) ||
|
149 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
150 |
|
151 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
152 | context = __VUE_SSR_CONTEXT__
|
153 | }
|
154 |
|
155 | if (injectStyles) {
|
156 | injectStyles.call(this, context)
|
157 | }
|
158 |
|
159 | if (context && context._registeredComponents) {
|
160 | context._registeredComponents.add(moduleIdentifier)
|
161 | }
|
162 | }
|
163 |
|
164 |
|
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 |
|
180 |
|
181 | options._injectStyles = hook
|
182 |
|
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 |
|
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 | __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
|
211 | __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
|
212 |
|
213 | __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
|
214 | __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
|
215 | __webpack_require__.d(__webpack_exports__, "h", function() { return removeClass; });
|
216 | __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
|
217 |
|
218 |
|
219 |
|
220 |
|
221 | __webpack_require__.d(__webpack_exports__, "e", function() { return merge; });
|
222 | __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollBarWidth; });
|
223 | var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
224 | var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
225 | var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
226 | var vue__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
|
227 |
|
228 |
|
229 |
|
230 |
|
231 | var isServer = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer;
|
232 | var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
233 | var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
234 | var ieVersion = isServer ? 0 : Number(document.documentMode);
|
235 |
|
236 |
|
237 | var trim = function trim(string) {
|
238 | return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
239 | };
|
240 |
|
241 | var camelCase = function camelCase(name) {
|
242 | return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
243 | return offset ? letter.toUpperCase() : letter;
|
244 | }).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
245 | };
|
246 |
|
247 |
|
248 | var on = function () {
|
249 | if (!isServer && document.addEventListener) {
|
250 | return function (element, event, handler) {
|
251 | if (element && event && handler) {
|
252 | element.addEventListener(event, handler, false);
|
253 | }
|
254 | };
|
255 | } else {
|
256 | return function (element, event, handler) {
|
257 | if (element && event && handler) {
|
258 | element.attachEvent('on' + event, handler);
|
259 | }
|
260 | };
|
261 | }
|
262 | }();
|
263 |
|
264 |
|
265 | var off = function () {
|
266 | if (!isServer && document.removeEventListener) {
|
267 | return function (element, event, handler) {
|
268 | if (element && event) {
|
269 | element.removeEventListener(event, handler, false);
|
270 | }
|
271 | };
|
272 | } else {
|
273 | return function (element, event, handler) {
|
274 | if (element && event) {
|
275 | element.detachEvent('on' + event, handler);
|
276 | }
|
277 | };
|
278 | }
|
279 | }();
|
280 |
|
281 |
|
282 | var once = function once(el, event, fn) {
|
283 | var listener = function listener() {
|
284 | if (fn) {
|
285 | fn.apply(this, arguments);
|
286 | }
|
287 | off(el, event, listener);
|
288 | };
|
289 | on(el, event, listener);
|
290 | };
|
291 |
|
292 |
|
293 | function hasClass(el, cls) {
|
294 | if (!el || !cls) return false;
|
295 | if (cls.indexOf(' ') !== -1) {
|
296 | throw new Error('className should not contain space.');
|
297 | }
|
298 | if (el.classList) {
|
299 | return el.classList.contains(cls);
|
300 | } else {
|
301 | return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
|
302 | }
|
303 | }
|
304 |
|
305 |
|
306 | function addClass(el, cls) {
|
307 | if (!el) return;
|
308 | var curClass = el.className;
|
309 | var classes = (cls || '').split(' ');
|
310 |
|
311 | for (var i = 0, j = classes.length; i < j; i++) {
|
312 | var clsName = classes[i];
|
313 | if (!clsName) continue;
|
314 |
|
315 | if (el.classList) {
|
316 | el.classList.add(clsName);
|
317 | } else if (!hasClass(el, clsName)) {
|
318 | curClass += ' ' + clsName;
|
319 | }
|
320 | }
|
321 | if (!el.classList) {
|
322 | el.setAttribute('class', curClass);
|
323 | }
|
324 | }
|
325 |
|
326 |
|
327 | function removeClass(el, cls) {
|
328 | if (!el || !cls) return;
|
329 | var classes = cls.split(' ');
|
330 | var curClass = ' ' + el.className + ' ';
|
331 |
|
332 | for (var i = 0, j = classes.length; i < j; i++) {
|
333 | var clsName = classes[i];
|
334 | if (!clsName) continue;
|
335 |
|
336 | if (el.classList) {
|
337 | el.classList.remove(clsName);
|
338 | } else if (hasClass(el, clsName)) {
|
339 | curClass = curClass.replace(' ' + clsName + ' ', ' ');
|
340 | }
|
341 | }
|
342 | if (!el.classList) {
|
343 | el.setAttribute('class', trim(curClass));
|
344 | }
|
345 | }
|
346 |
|
347 |
|
348 | var getStyle = ieVersion < 9 ? function (element, styleName) {
|
349 | if (isServer) return;
|
350 | if (!element || !styleName) return null;
|
351 | styleName = camelCase(styleName);
|
352 | if (styleName === 'float') {
|
353 | styleName = 'styleFloat';
|
354 | }
|
355 | try {
|
356 | switch (styleName) {
|
357 | case 'opacity':
|
358 | try {
|
359 | return element.filters.item('alpha').opacity / 100;
|
360 | } catch (e) {
|
361 | return 1.0;
|
362 | }
|
363 | default:
|
364 | return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
365 | }
|
366 | } catch (e) {
|
367 | return element.style[styleName];
|
368 | }
|
369 | } : function (element, styleName) {
|
370 | if (isServer) return;
|
371 | if (!element || !styleName) return null;
|
372 | styleName = camelCase(styleName);
|
373 | if (styleName === 'float') {
|
374 | styleName = 'cssFloat';
|
375 | }
|
376 | try {
|
377 | var computed = document.defaultView.getComputedStyle(element, '');
|
378 | return element.style[styleName] || computed ? computed[styleName] : null;
|
379 | } catch (e) {
|
380 | return element.style[styleName];
|
381 | }
|
382 | };
|
383 |
|
384 |
|
385 | function setStyle(element, styleName, value) {
|
386 | if (!element || !styleName) return;
|
387 |
|
388 | if ((typeof styleName === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(styleName)) === 'object') {
|
389 | for (var prop in styleName) {
|
390 | if (styleName.hasOwnProperty(prop)) {
|
391 | setStyle(element, prop, styleName[prop]);
|
392 | }
|
393 | }
|
394 | } else {
|
395 | styleName = camelCase(styleName);
|
396 | if (styleName === 'opacity' && ieVersion < 9) {
|
397 | element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
|
398 | } else {
|
399 | element.style[styleName] = value;
|
400 | }
|
401 | }
|
402 | }
|
403 |
|
404 | var isScroll = function isScroll(el, vertical) {
|
405 | if (isServer) return;
|
406 |
|
407 | var determinedDirection = vertical !== null && vertical !== undefined;
|
408 | var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
|
409 |
|
410 | return overflow.match(/(scroll|auto|overlay)/);
|
411 | };
|
412 |
|
413 | var getScrollContainer = function getScrollContainer(el, vertical) {
|
414 | if (isServer) return;
|
415 |
|
416 | var parent = el;
|
417 | while (parent) {
|
418 | if ([window, document, document.documentElement].includes(parent)) {
|
419 | return window;
|
420 | }
|
421 | if (isScroll(parent, vertical)) {
|
422 | return parent;
|
423 | }
|
424 | parent = parent.parentNode;
|
425 | }
|
426 |
|
427 | return parent;
|
428 | };
|
429 |
|
430 | var isInContainer = function isInContainer(el, container) {
|
431 | if (isServer || !el || !container) return false;
|
432 |
|
433 | var elRect = el.getBoundingClientRect();
|
434 | var containerRect = void 0;
|
435 |
|
436 | if ([window, document, document.documentElement, null, undefined].includes(container)) {
|
437 | containerRect = {
|
438 | top: 0,
|
439 | right: window.innerWidth,
|
440 | bottom: window.innerHeight,
|
441 | left: 0
|
442 | };
|
443 | } else {
|
444 | containerRect = container.getBoundingClientRect();
|
445 | }
|
446 |
|
447 | return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
448 | };
|
449 |
|
450 | function merge(target) {
|
451 | for (var i = 1, j = arguments.length; i < j; i++) {
|
452 | var source = arguments[i] || {};
|
453 | for (var prop in source) {
|
454 | if (source.hasOwnProperty(prop)) {
|
455 | var value = source[prop];
|
456 | if (value !== undefined) {
|
457 | target[prop] = value;
|
458 | }
|
459 | }
|
460 | }
|
461 | }
|
462 |
|
463 | return target;
|
464 | }
|
465 |
|
466 | var scrollBarWidth = void 0;
|
467 | function getScrollBarWidth() {
|
468 | if (vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer) return 0;
|
469 | if (scrollBarWidth !== undefined) return scrollBarWidth;
|
470 |
|
471 | var outer = document.createElement('div');
|
472 | outer.className = 'el-scrollbar__wrap';
|
473 | outer.style.visibility = 'hidden';
|
474 | outer.style.width = '100px';
|
475 | outer.style.position = 'absolute';
|
476 | outer.style.top = '-9999px';
|
477 | document.body.appendChild(outer);
|
478 |
|
479 | var widthNoScroll = outer.offsetWidth;
|
480 | outer.style.overflow = 'scroll';
|
481 |
|
482 | var inner = document.createElement('div');
|
483 | inner.style.width = '100%';
|
484 | outer.appendChild(inner);
|
485 |
|
486 | var widthWithScroll = inner.offsetWidth;
|
487 | outer.parentNode.removeChild(outer);
|
488 | scrollBarWidth = widthNoScroll - widthWithScroll;
|
489 |
|
490 | return scrollBarWidth;
|
491 | }
|
492 |
|
493 | }),
|
494 |
|
495 | 10:
|
496 | (function(module, exports) {
|
497 |
|
498 | module.exports = require("babel-runtime/core-js/object/keys");
|
499 |
|
500 | }),
|
501 |
|
502 | 11:
|
503 | (function(module, exports) {
|
504 |
|
505 | module.exports = __WEBPACK_EXTERNAL_MODULE__11__;
|
506 |
|
507 | }),
|
508 |
|
509 | 12:
|
510 | (function(module, exports) {
|
511 |
|
512 | module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
|
513 |
|
514 | }),
|
515 |
|
516 | 13:
|
517 | (function(module, exports) {
|
518 |
|
519 | module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
|
520 |
|
521 | }),
|
522 |
|
523 | 139:
|
524 | (function(module, exports) {
|
525 |
|
526 |
|
527 |
|
528 | }),
|
529 |
|
530 | 14:
|
531 | (function(module, __webpack_exports__, __webpack_require__) {
|
532 |
|
533 | "use strict";
|
534 | var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
535 | var vue__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
536 | var _dom_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
537 | var _popup_manager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
|
538 | __webpack_require__.d(__webpack_exports__, "a", function() { return _popup_manager__WEBPACK_IMPORTED_MODULE_2__["a"]; });
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 | var idSeed = 1;
|
545 |
|
546 | var scrollBarWidth = void 0;
|
547 |
|
548 | __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__[ "a"].register(this._popupId, this);
|
587 | },
|
588 | beforeDestroy: function beforeDestroy() {
|
589 | _popup_manager__WEBPACK_IMPORTED_MODULE_2__[ "a"].deregister(this._popupId);
|
590 | _popup_manager__WEBPACK_IMPORTED_MODULE_2__[ "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__[ "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__[ "a"].zIndex = zIndex;
|
664 | }
|
665 |
|
666 | if (modal) {
|
667 | if (this._closing) {
|
668 | _popup_manager__WEBPACK_IMPORTED_MODULE_2__[ "a"].closeModal(this._popupId);
|
669 | this._closing = false;
|
670 | }
|
671 | _popup_manager__WEBPACK_IMPORTED_MODULE_2__[ "a"].openModal(this._popupId, _popup_manager__WEBPACK_IMPORTED_MODULE_2__[ "a"].nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
|
672 | if (props.lockScroll) {
|
673 | this.withoutHiddenClass = !Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[ "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__[ "c"])(document.body, 'paddingRight'), 10);
|
677 | }
|
678 | scrollBarWidth = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[ "b"])();
|
679 | var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
|
680 | var bodyOverflowY = Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[ "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__[ "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__[ "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__[ "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__[ "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 |
|
761 | var popup_main = __webpack_require__(14);
|
762 |
|
763 |
|
764 | var get_own_property_descriptor_ = __webpack_require__(18);
|
765 | var get_own_property_descriptor_default = __webpack_require__.n(get_own_property_descriptor_);
|
766 |
|
767 |
|
768 | var keys_ = __webpack_require__(10);
|
769 | var keys_default = __webpack_require__.n(keys_);
|
770 |
|
771 |
|
772 | var assign_ = __webpack_require__(6);
|
773 | var assign_default = __webpack_require__.n(assign_);
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 | function popper_createPopper() {
|
808 | 'use strict';
|
809 |
|
810 | var root = window;
|
811 |
|
812 |
|
813 | var DEFAULTS = {
|
814 |
|
815 | placement: 'bottom',
|
816 |
|
817 | gpuAcceleration: false,
|
818 |
|
819 |
|
820 | offset: 0,
|
821 |
|
822 |
|
823 | boundariesElement: 'viewport',
|
824 |
|
825 |
|
826 | boundariesPadding: 5,
|
827 |
|
828 |
|
829 |
|
830 | preventOverflowOrder: ['left', 'right', 'top', 'bottom'],
|
831 |
|
832 |
|
833 | flipBehavior: 'flip',
|
834 |
|
835 | arrowElement: '[x-arrow]',
|
836 |
|
837 | arrowOffset: 0,
|
838 |
|
839 |
|
840 | modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],
|
841 |
|
842 | modifiersIgnored: [],
|
843 |
|
844 | forceAbsolute: false
|
845 |
|
846 | |
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 |
|
899 |
|
900 |
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 | };function Popper(reference, popper, options) {
|
912 | this._reference = reference.jquery ? reference[0] : reference;
|
913 | this.state = {};
|
914 |
|
915 |
|
916 |
|
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 |
|
923 | else {
|
924 | this._popper = popper.jquery ? popper[0] : popper;
|
925 | }
|
926 |
|
927 |
|
928 | this._options = assign_default()({}, DEFAULTS, options);
|
929 |
|
930 |
|
931 | this._options.modifiers = this._options.modifiers.map(function (modifier) {
|
932 |
|
933 | if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;
|
934 |
|
935 |
|
936 |
|
937 | if (modifier === 'applyStyle') {
|
938 | this._popper.setAttribute('x-placement', this._options.placement);
|
939 | }
|
940 |
|
941 |
|
942 | return this.modifiers[modifier] || modifier;
|
943 | }.bind(this));
|
944 |
|
945 |
|
946 | this.state.position = this._getPosition(this._popper, this._reference);
|
947 | setStyle(this._popper, { position: this.state.position, top: 0 });
|
948 |
|
949 |
|
950 | this.update();
|
951 |
|
952 |
|
953 | this._setupEventListeners();
|
954 | return this;
|
955 | }
|
956 |
|
957 |
|
958 |
|
959 |
|
960 | |
961 |
|
962 |
|
963 |
|
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 |
|
974 | if (this._options.removeOnDestroy) {
|
975 | this._popper.remove();
|
976 | }
|
977 | return this;
|
978 | };
|
979 |
|
980 | |
981 |
|
982 |
|
983 |
|
984 |
|
985 | Popper.prototype.update = function () {
|
986 | var data = { instance: this, styles: {}
|
987 |
|
988 |
|
989 |
|
990 | };data.placement = this._options.placement;
|
991 | data._originalPlacement = this._options.placement;
|
992 |
|
993 |
|
994 | data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
|
995 |
|
996 |
|
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 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 | Popper.prototype.onCreate = function (callback) {
|
1013 |
|
1014 | callback(this);
|
1015 | return this;
|
1016 | };
|
1017 |
|
1018 | |
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 | Popper.prototype.onUpdate = function (callback) {
|
1027 | this.state.updateCallback = callback;
|
1028 | return this;
|
1029 | };
|
1030 |
|
1031 | |
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
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 |
|
1075 |
|
1076 |
|
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 |
|
1088 |
|
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 |
|
1095 | parent.appendChild(popper);
|
1096 |
|
1097 | return popper;
|
1098 |
|
1099 | |
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 |
|
1106 | function addClassNames(element, classNames) {
|
1107 | classNames.forEach(function (className) {
|
1108 | element.classList.add(className);
|
1109 | });
|
1110 | }
|
1111 |
|
1112 | |
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 |
|
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 |
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
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 |
|
1144 |
|
1145 | var isParentFixed = isFixed(reference, container);
|
1146 | return isParentFixed ? 'fixed' : 'absolute';
|
1147 | };
|
1148 |
|
1149 | |
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
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 |
|
1167 |
|
1168 | var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 | var popperRect = getOuterSizes(popper);
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
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 |
|
1197 | popperOffsets.width = popperRect.width;
|
1198 | popperOffsets.height = popperRect.height;
|
1199 |
|
1200 | return {
|
1201 | popper: popperOffsets,
|
1202 | reference: referenceOffsets
|
1203 | };
|
1204 | };
|
1205 |
|
1206 | |
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 | Popper.prototype._setupEventListeners = function () {
|
1213 |
|
1214 | this.state.updateBound = this.update.bind(this);
|
1215 | root.addEventListener('resize', this.state.updateBound);
|
1216 |
|
1217 | if (this._options.boundariesElement !== 'window') {
|
1218 | var target = getScrollParent(this._reference);
|
1219 |
|
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 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 | Popper.prototype._removeEventListeners = function () {
|
1235 |
|
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 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 | Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {
|
1255 |
|
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 |
|
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 |
|
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 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 |
|
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 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
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 |
|
1354 |
|
1355 |
|
1356 | |
1357 |
|
1358 |
|
1359 |
|
1360 |
|
1361 |
|
1362 | Popper.prototype.modifiers = {};
|
1363 |
|
1364 | |
1365 |
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 | Popper.prototype.modifiers.applyStyle = function (data) {
|
1372 |
|
1373 |
|
1374 | var styles = {
|
1375 | position: data.offsets.popper.position
|
1376 |
|
1377 |
|
1378 | };var left = Math.round(data.offsets.popper.left);
|
1379 | var top = Math.round(data.offsets.popper.top);
|
1380 |
|
1381 |
|
1382 |
|
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 |
|
1390 | else {
|
1391 | styles.left = left;
|
1392 | styles.top = top;
|
1393 | }
|
1394 |
|
1395 |
|
1396 |
|
1397 |
|
1398 |
|
1399 | assign_default()(styles, data.styles);
|
1400 |
|
1401 | setStyle(this._popper, styles);
|
1402 |
|
1403 |
|
1404 |
|
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 |
|
1413 |
|
1414 |
|
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 |
|
1424 |
|
1425 |
|
1426 |
|
1427 |
|
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 |
|
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 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
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 |
|
1508 |
|
1509 |
|
1510 |
|
1511 |
|
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 |
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 | Popper.prototype.modifiers.flip = function (data) {
|
1544 |
|
1545 |
|
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 |
|
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 |
|
1577 |
|
1578 | var a = ['right', 'bottom'].indexOf(placement) !== -1;
|
1579 |
|
1580 |
|
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 |
|
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 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
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 |
|
1621 |
|
1622 |
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 | Popper.prototype.modifiers.arrow = function (data) {
|
1628 | var arrow = this._options.arrowElement;
|
1629 | var arrowOffset = this._options.arrowOffset;
|
1630 |
|
1631 |
|
1632 | if (typeof arrow === 'string') {
|
1633 | arrow = this._popper.querySelector(arrow);
|
1634 | }
|
1635 |
|
1636 |
|
1637 | if (!arrow) {
|
1638 | return data;
|
1639 | }
|
1640 |
|
1641 |
|
1642 | if (!this._popper.contains(arrow)) {
|
1643 | console.warn('WARNING: `arrowElement` must be child of its popper element!');
|
1644 | return data;
|
1645 | }
|
1646 |
|
1647 |
|
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 |
|
1668 |
|
1669 |
|
1670 |
|
1671 | if (reference[opSide] - arrowSize < popper[side]) {
|
1672 | data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
1673 | }
|
1674 |
|
1675 | if (reference[side] + arrowSize > popper[opSide]) {
|
1676 | data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
1677 | }
|
1678 |
|
1679 |
|
1680 | var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
|
1681 |
|
1682 | var sideValue = center - popper[side];
|
1683 |
|
1684 |
|
1685 | sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
|
1686 | arrowStyle[side] = sideValue;
|
1687 | arrowStyle[altSide] = '';
|
1688 |
|
1689 | data.offsets.arrow = arrowStyle;
|
1690 | data.arrowElement = arrow;
|
1691 |
|
1692 | return data;
|
1693 | };
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 | |
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 | function getOuterSizes(element) {
|
1707 |
|
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 |
|
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 |
|
1723 | };element.style.display = _display;
|
1724 | element.style.visibility = _visibility;
|
1725 | return result;
|
1726 | }
|
1727 |
|
1728 | |
1729 |
|
1730 |
|
1731 |
|
1732 |
|
1733 |
|
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 |
|
1744 |
|
1745 |
|
1746 |
|
1747 |
|
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 |
|
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
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 |
|
1778 |
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 | function getStyleComputedProperty(element, property) {
|
1784 |
|
1785 | var css = root.getComputedStyle(element, null);
|
1786 | return css[property];
|
1787 | }
|
1788 |
|
1789 | |
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 | function getOffsetParent(element) {
|
1797 |
|
1798 | var offsetParent = element.offsetParent;
|
1799 | return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
|
1800 | }
|
1801 |
|
1802 | |
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
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 |
|
1818 |
|
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 |
|
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 |
|
1829 |
|
1830 |
|
1831 | return parent;
|
1832 | }
|
1833 | return getScrollParent(element.parentNode);
|
1834 | }
|
1835 |
|
1836 | |
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
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 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
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 |
|
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 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 | function isFunction(functionToCheck) {
|
1883 | var getType = {};
|
1884 | return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
1885 | }
|
1886 |
|
1887 | |
1888 |
|
1889 |
|
1890 |
|
1891 |
|
1892 |
|
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 |
|
1906 | return elementRect;
|
1907 | }
|
1908 |
|
1909 | |
1910 |
|
1911 |
|
1912 |
|
1913 |
|
1914 |
|
1915 |
|
1916 | function getBoundingClientRect(element) {
|
1917 | var rect = element.getBoundingClientRect();
|
1918 |
|
1919 |
|
1920 | var isIE = navigator.userAgent.indexOf('MSIE') != -1;
|
1921 |
|
1922 |
|
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 |
|
1937 |
|
1938 |
|
1939 |
|
1940 |
|
1941 |
|
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 |
|
1968 |
|
1969 |
|
1970 |
|
1971 |
|
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 |
|
1987 |
|
1988 |
|
1989 |
|
1990 |
|
1991 |
|
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 | var _popper_popper = (popper_createPopper());
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 | var stop = function stop(e) {
|
2033 | return e.stopPropagation();
|
2034 | };
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 | 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" ].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" ].nextZIndex();
|
2158 | }
|
2159 | }
|
2160 | } else {
|
2161 | this.createPopper();
|
2162 | }
|
2163 | },
|
2164 | doDestroy: function doDestroy(forceDestroy) {
|
2165 |
|
2166 | if (!this.popperJS || this.showPopper && !forceDestroy) return;
|
2167 | this.popperJS.destroy();
|
2168 | this.popperJS = null;
|
2169 | },
|
2170 | destroyPopper: function destroyPopper() {
|
2171 | if (this.popperJS) {
|
2172 | this.resetTransformOrigin();
|
2173 | }
|
2174 | },
|
2175 | resetTransformOrigin: function resetTransformOrigin() {
|
2176 | if (!this.transformOrigin) return;
|
2177 | var placementMap = {
|
2178 | top: 'bottom',
|
2179 | bottom: 'top',
|
2180 | left: 'right',
|
2181 | right: 'left'
|
2182 | };
|
2183 | var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
|
2184 | var origin = placementMap[placement];
|
2185 | this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? 'center ' + origin : origin + ' center';
|
2186 | },
|
2187 | appendArrow: function appendArrow(element) {
|
2188 | var hash = void 0;
|
2189 | if (this.appended) {
|
2190 | return;
|
2191 | }
|
2192 |
|
2193 | this.appended = true;
|
2194 |
|
2195 | for (var item in element.attributes) {
|
2196 | if (/^_v-/.test(element.attributes[item].name)) {
|
2197 | hash = element.attributes[item].name;
|
2198 | break;
|
2199 | }
|
2200 | }
|
2201 |
|
2202 | var arrow = document.createElement('div');
|
2203 |
|
2204 | if (hash) {
|
2205 | arrow.setAttribute(hash, '');
|
2206 | }
|
2207 | arrow.setAttribute('x-arrow', '');
|
2208 | arrow.className = 'popper__arrow';
|
2209 | element.appendChild(arrow);
|
2210 | }
|
2211 | },
|
2212 |
|
2213 | beforeDestroy: function beforeDestroy() {
|
2214 | this.doDestroy(true);
|
2215 | if (this.popperElm && this.popperElm.parentNode === document.body) {
|
2216 | this.popperElm.removeEventListener('click', stop);
|
2217 | document.body.removeChild(this.popperElm);
|
2218 | }
|
2219 | },
|
2220 | deactivated: function deactivated() {
|
2221 | this.$options.beforeDestroy[0].call(this);
|
2222 | }
|
2223 | });
|
2224 |
|
2225 | }),
|
2226 |
|
2227 | 18:
|
2228 | (function(module, exports) {
|
2229 |
|
2230 | module.exports = require("babel-runtime/core-js/object/get-own-property-descriptor");
|
2231 |
|
2232 | }),
|
2233 |
|
2234 | 2:
|
2235 | (function(module, exports) {
|
2236 |
|
2237 | module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
2238 |
|
2239 | }),
|
2240 |
|
2241 | 21:
|
2242 | (function(module, __webpack_exports__, __webpack_require__) {
|
2243 |
|
2244 | "use strict";
|
2245 | __webpack_require__.d(__webpack_exports__, "d", function() { return on; });
|
2246 |
|
2247 |
|
2248 | __webpack_require__.d(__webpack_exports__, "c", function() { return hasClass; });
|
2249 | __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
|
2250 | __webpack_require__.d(__webpack_exports__, "e", function() { return removeClass; });
|
2251 | __webpack_require__.d(__webpack_exports__, "b", function() { return getStyle; });
|
2252 |
|
2253 |
|
2254 |
|
2255 |
|
2256 | var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
2257 | var babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
2258 | var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
2259 | var vue__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_1__);
|
2260 |
|
2261 |
|
2262 |
|
2263 |
|
2264 |
|
2265 | var isServer = vue__WEBPACK_IMPORTED_MODULE_1___default.a.prototype.$isServer;
|
2266 |
|
2267 |
|
2268 | var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
2269 | var MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
2270 | var ieVersion = isServer ? 0 : Number(document.documentMode);
|
2271 |
|
2272 |
|
2273 | var trim = function trim(string) {
|
2274 | return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
|
2275 | };
|
2276 |
|
2277 | var camelCase = function camelCase(name) {
|
2278 | return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
|
2279 | return offset ? letter.toUpperCase() : letter;
|
2280 | }).replace(MOZ_HACK_REGEXP, 'Moz$1');
|
2281 | };
|
2282 |
|
2283 |
|
2284 | var on = function () {
|
2285 | if (!isServer && document.addEventListener) {
|
2286 | return function (element, event, handler) {
|
2287 | if (element && event && handler) {
|
2288 | element.addEventListener(event, handler, false);
|
2289 | }
|
2290 | };
|
2291 | } else {
|
2292 | return function (element, event, handler) {
|
2293 | if (element && event && handler) {
|
2294 | element.attachEvent('on' + event, handler);
|
2295 | }
|
2296 | };
|
2297 | }
|
2298 | }();
|
2299 |
|
2300 |
|
2301 | var off = function () {
|
2302 | if (!isServer && document.removeEventListener) {
|
2303 | return function (element, event, handler) {
|
2304 | if (element && event) {
|
2305 | element.removeEventListener(event, handler, false);
|
2306 | }
|
2307 | };
|
2308 | } else {
|
2309 | return function (element, event, handler) {
|
2310 | if (element && event) {
|
2311 | element.detachEvent('on' + event, handler);
|
2312 | }
|
2313 | };
|
2314 | }
|
2315 | }();
|
2316 |
|
2317 |
|
2318 | var once = function once(el, event, fn) {
|
2319 | var listener = function listener() {
|
2320 | if (fn) {
|
2321 | fn.apply(this, arguments);
|
2322 | }
|
2323 | off(el, event, listener);
|
2324 | };
|
2325 | on(el, event, listener);
|
2326 | };
|
2327 |
|
2328 |
|
2329 | function hasClass(el, cls) {
|
2330 | if (!el || !cls) return false;
|
2331 | if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
|
2332 | if (el.classList) {
|
2333 | return el.classList.contains(cls);
|
2334 | } else {
|
2335 | return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
|
2336 | }
|
2337 | }
|
2338 |
|
2339 |
|
2340 | function addClass(el, cls) {
|
2341 | if (!el) return;
|
2342 | var curClass = el.className;
|
2343 | var classes = (cls || '').split(' ');
|
2344 |
|
2345 | for (var i = 0, j = classes.length; i < j; i++) {
|
2346 | var clsName = classes[i];
|
2347 | if (!clsName) continue;
|
2348 |
|
2349 | if (el.classList) {
|
2350 | el.classList.add(clsName);
|
2351 | } else if (!hasClass(el, clsName)) {
|
2352 | curClass += ' ' + clsName;
|
2353 | }
|
2354 | }
|
2355 | if (!el.classList) {
|
2356 | el.className = curClass;
|
2357 | }
|
2358 | }
|
2359 |
|
2360 |
|
2361 | function removeClass(el, cls) {
|
2362 | if (!el || !cls) return;
|
2363 | var classes = cls.split(' ');
|
2364 | var curClass = ' ' + el.className + ' ';
|
2365 |
|
2366 | for (var i = 0, j = classes.length; i < j; i++) {
|
2367 | var clsName = classes[i];
|
2368 | if (!clsName) continue;
|
2369 |
|
2370 | if (el.classList) {
|
2371 | el.classList.remove(clsName);
|
2372 | } else if (hasClass(el, clsName)) {
|
2373 | curClass = curClass.replace(' ' + clsName + ' ', ' ');
|
2374 | }
|
2375 | }
|
2376 | if (!el.classList) {
|
2377 | el.className = trim(curClass);
|
2378 | }
|
2379 | }
|
2380 |
|
2381 |
|
2382 | var getStyle = ieVersion < 9 ? function (element, styleName) {
|
2383 | if (isServer) return;
|
2384 | if (!element || !styleName) return null;
|
2385 | styleName = camelCase(styleName);
|
2386 | if (styleName === 'float') {
|
2387 | styleName = 'styleFloat';
|
2388 | }
|
2389 | try {
|
2390 | switch (styleName) {
|
2391 | case 'opacity':
|
2392 | try {
|
2393 | return element.filters.item('alpha').opacity / 100;
|
2394 | } catch (e) {
|
2395 | return 1.0;
|
2396 | }
|
2397 | default:
|
2398 | return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
|
2399 | }
|
2400 | } catch (e) {
|
2401 | return element.style[styleName];
|
2402 | }
|
2403 | } : function (element, styleName) {
|
2404 | if (isServer) return;
|
2405 | if (!element || !styleName) return null;
|
2406 | styleName = camelCase(styleName);
|
2407 | if (styleName === 'float') {
|
2408 | styleName = 'cssFloat';
|
2409 | }
|
2410 | try {
|
2411 | var computed = document.defaultView.getComputedStyle(element, '');
|
2412 | return element.style[styleName] || computed ? computed[styleName] : null;
|
2413 | } catch (e) {
|
2414 | return element.style[styleName];
|
2415 | }
|
2416 | };
|
2417 |
|
2418 |
|
2419 | function setStyle(element, styleName, value) {
|
2420 | if (!element || !styleName) return;
|
2421 |
|
2422 | if ((typeof styleName === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(styleName)) === 'object') {
|
2423 | for (var prop in styleName) {
|
2424 | if (styleName.hasOwnProperty(prop)) {
|
2425 | setStyle(element, prop, styleName[prop]);
|
2426 | }
|
2427 | }
|
2428 | } else {
|
2429 | styleName = camelCase(styleName);
|
2430 | if (styleName === 'opacity' && ieVersion < 9) {
|
2431 | element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
|
2432 | } else {
|
2433 | element.style[styleName] = value;
|
2434 | }
|
2435 | }
|
2436 | }
|
2437 |
|
2438 | var isScroll = function isScroll(el, vertical) {
|
2439 | if (isServer) return;
|
2440 |
|
2441 | var determinedDirection = vertical !== null || vertical !== undefined;
|
2442 | var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
|
2443 |
|
2444 | return overflow.match(/(scroll|auto)/);
|
2445 | };
|
2446 |
|
2447 | var getScrollContainer = function getScrollContainer(el, vertical) {
|
2448 | if (isServer) return;
|
2449 |
|
2450 | var parent = el;
|
2451 | while (parent) {
|
2452 | if ([window, document, document.documentElement].includes(parent)) {
|
2453 | return window;
|
2454 | }
|
2455 | if (isScroll(parent, vertical)) {
|
2456 | return parent;
|
2457 | }
|
2458 | parent = parent.parentNode;
|
2459 | }
|
2460 |
|
2461 | return parent;
|
2462 | };
|
2463 |
|
2464 | var isInContainer = function isInContainer(el, container) {
|
2465 | if (isServer || !el || !container) return false;
|
2466 |
|
2467 | var elRect = el.getBoundingClientRect();
|
2468 | var containerRect = void 0;
|
2469 |
|
2470 | if ([window, document, document.documentElement, null, undefined].includes(container)) {
|
2471 | containerRect = {
|
2472 | top: 0,
|
2473 | right: window.innerWidth,
|
2474 | bottom: window.innerHeight,
|
2475 | left: 0
|
2476 | };
|
2477 | } else {
|
2478 | containerRect = container.getBoundingClientRect();
|
2479 | }
|
2480 |
|
2481 | return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
|
2482 | };
|
2483 |
|
2484 | }),
|
2485 |
|
2486 | 22:
|
2487 | (function(module, __webpack_exports__, __webpack_require__) {
|
2488 |
|
2489 | "use strict";
|
2490 | var mds_ui_transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
|
2491 | var mds_ui_transition__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(mds_ui_transition__WEBPACK_IMPORTED_MODULE_0__);
|
2492 |
|
2493 |
|
2494 | var placementMap = {
|
2495 | top: 'top',
|
2496 | left: 'left',
|
2497 | right: 'right',
|
2498 | bottom: 'bottom',
|
2499 | topLeft: 'top-start',
|
2500 | topRight: 'top-end',
|
2501 | bottomLeft: 'bottom-start',
|
2502 | bottomRight: 'bottom-end',
|
2503 | leftTop: 'left-start',
|
2504 | leftBottom: 'left-end',
|
2505 | rightTop: 'right-start',
|
2506 | rightBottom: 'right-end'
|
2507 | };
|
2508 |
|
2509 | __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 |
|
2526 |
|
2527 | }),
|
2528 |
|
2529 | 29:
|
2530 | (function(module, exports) {
|
2531 |
|
2532 | module.exports = require("moment");
|
2533 |
|
2534 | }),
|
2535 |
|
2536 | 3:
|
2537 | (function(module, exports) {
|
2538 |
|
2539 | module.exports = require("babel-runtime/helpers/defineProperty");
|
2540 |
|
2541 | }),
|
2542 |
|
2543 | 38:
|
2544 | (function(module, __webpack_exports__, __webpack_require__) {
|
2545 |
|
2546 | "use strict";
|
2547 | var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
2548 | var vue__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
2549 | var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
|
2550 |
|
2551 |
|
2552 |
|
2553 | var nodeList = [];
|
2554 | var ctx = '@@clickoutsideContext';
|
2555 |
|
2556 | var startClick = void 0;
|
2557 | var seed = 0;
|
2558 |
|
2559 | !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__[ "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__[ "d"])(document, 'mouseup', function (e) {
|
2564 | nodeList.forEach(function (node) {
|
2565 | return node[ctx].documentHandler(e, startClick);
|
2566 | });
|
2567 | });
|
2568 |
|
2569 | function createDocumentHandler(el, binding, vnode) {
|
2570 | return function () {
|
2571 | var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
2572 | var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2573 |
|
2574 | if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || vnode.context.popperElm && (vnode.context.popperElm.contains(mouseup.target) || vnode.context.popperElm.contains(mousedown.target))) return;
|
2575 |
|
2576 | if (binding.expression && el[ctx].methodName && vnode.context[el[ctx].methodName]) {
|
2577 | vnode.context[el[ctx].methodName]();
|
2578 | } else {
|
2579 | el[ctx].bindingFn && el[ctx].bindingFn();
|
2580 | }
|
2581 | };
|
2582 | }
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 | __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 | var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
2628 | var vue__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
2629 | var _dom_helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
2630 |
|
2631 |
|
2632 |
|
2633 | var hasModal = false;
|
2634 | var hasInitZIndex = false;
|
2635 | var zIndex = void 0;
|
2636 |
|
2637 | var getModal = function getModal() {
|
2638 | if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
2639 | var modalDom = PopupManager.modalDom;
|
2640 | if (modalDom) {
|
2641 | hasModal = true;
|
2642 | } else {
|
2643 | hasModal = false;
|
2644 | modalDom = document.createElement('div');
|
2645 | PopupManager.modalDom = modalDom;
|
2646 |
|
2647 | modalDom.addEventListener('touchmove', function (event) {
|
2648 | event.preventDefault();
|
2649 | event.stopPropagation();
|
2650 | });
|
2651 |
|
2652 | modalDom.addEventListener('click', function () {
|
2653 | PopupManager.doOnModalClick && PopupManager.doOnModalClick();
|
2654 | });
|
2655 | }
|
2656 |
|
2657 | return modalDom;
|
2658 | };
|
2659 |
|
2660 | var instances = {};
|
2661 |
|
2662 | var 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__[ "a"])(modalDom, 'v-modal');
|
2715 | if (this.modalFade && !hasModal) {
|
2716 | Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[ "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__[ "a"])(modalDom, item);
|
2722 | });
|
2723 | }
|
2724 | setTimeout(function () {
|
2725 | Object(_dom_helper__WEBPACK_IMPORTED_MODULE_1__[ "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__[ "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__[ "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__[ "h"])(modalDom, 'v-modal-leave');
|
2782 | }, 200);
|
2783 | }
|
2784 | }
|
2785 | };
|
2786 |
|
2787 | Object.defineProperty(PopupManager, 'zIndex', {
|
2788 | configurable: true,
|
2789 | get: function get() {
|
2790 | if (!hasInitZIndex) {
|
2791 | zIndex = zIndex || (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$ELEMENT || {}).zIndex || 2000;
|
2792 | hasInitZIndex = true;
|
2793 | }
|
2794 | return zIndex;
|
2795 | },
|
2796 | set: function set(value) {
|
2797 | zIndex = value;
|
2798 | }
|
2799 | });
|
2800 |
|
2801 | var getTopPopup = function getTopPopup() {
|
2802 | if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
|
2803 | if (PopupManager.modalStack.length > 0) {
|
2804 | var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
|
2805 | if (!topPopup) return;
|
2806 | var instance = PopupManager.getInstance(topPopup.id);
|
2807 |
|
2808 | return instance;
|
2809 | }
|
2810 | };
|
2811 |
|
2812 | if (!vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) {
|
2813 |
|
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 | __webpack_exports__["a"] = (PopupManager);
|
2826 |
|
2827 | }),
|
2828 |
|
2829 | 6:
|
2830 | (function(module, exports) {
|
2831 |
|
2832 | module.exports = require("babel-runtime/core-js/object/assign");
|
2833 |
|
2834 | }),
|
2835 |
|
2836 | 7:
|
2837 | (function(module, exports) {
|
2838 |
|
2839 | module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
|
2840 |
|
2841 | }),
|
2842 |
|
2843 | 8:
|
2844 | (function(module, exports) {
|
2845 |
|
2846 | module.exports = __WEBPACK_EXTERNAL_MODULE__8__;
|
2847 |
|
2848 | }),
|
2849 |
|
2850 | 9:
|
2851 | (function(module, exports) {
|
2852 |
|
2853 | module.exports = require("babel-runtime/helpers/typeof");
|
2854 |
|
2855 | }),
|
2856 |
|
2857 | 94:
|
2858 | (function(module, __webpack_exports__, __webpack_require__) {
|
2859 |
|
2860 | "use strict";
|
2861 |
|
2862 | __webpack_require__.r(__webpack_exports__);
|
2863 |
|
2864 |
|
2865 | var style = __webpack_require__(139);
|
2866 |
|
2867 |
|
2868 | var timepicker_style = __webpack_require__(232);
|
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 |
|
2876 |
|
2877 | var defineProperty_ = __webpack_require__(3);
|
2878 | var defineProperty_default = __webpack_require__.n(defineProperty_);
|
2879 |
|
2880 |
|
2881 | var external_moment_ = __webpack_require__(29);
|
2882 | var external_moment_default = __webpack_require__.n(external_moment_);
|
2883 |
|
2884 |
|
2885 | var popper_mixin = __webpack_require__(22);
|
2886 |
|
2887 |
|
2888 | var vue_popper = __webpack_require__(17);
|
2889 |
|
2890 |
|
2891 | var lazyMode = ({
|
2892 | data: function data() {
|
2893 | return {
|
2894 | lazyMomentValue: null,
|
2895 | lazyTempValue: null
|
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 |
|
2931 | var 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 | }
|
3007 | var staticRenderFns = []
|
3008 | headervue_type_template_id_94a41d54_render._withStripped = true
|
3009 |
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 | var external_icon_ = __webpack_require__(8);
|
3015 | var external_icon_default = __webpack_require__.n(external_icon_);
|
3016 |
|
3017 |
|
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 | 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 |
|
3100 | var timepicker_headervue_type_script_lang_js_ = (headervue_type_script_lang_js_);
|
3101 |
|
3102 | var componentNormalizer = __webpack_require__(0);
|
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 |
|
3111 |
|
3112 | var component = Object(componentNormalizer["a" ])(
|
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 |
|
3124 | if (false) { var api; }
|
3125 | component.options.__file = "components/timepicker/header.vue"
|
3126 | var header = (component.exports);
|
3127 |
|
3128 | var 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 | }
|
3173 | var selectvue_type_template_id_45c91776_staticRenderFns = []
|
3174 | selectvue_type_template_id_45c91776_render._withStripped = true
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 | var scrollTo = function scrollTo(element, to, duration) {
|
3205 | var requestAnimationFrame = window.requestAnimationFrame || function requestAnimationFrameTimeout() {
|
3206 | return setTimeout(arguments[0], 10);
|
3207 | };
|
3208 |
|
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 | 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 |
|
3281 | var timepicker_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 | var select_component = Object(componentNormalizer["a" ])(
|
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 |
|
3302 | if (false) { var select_api; }
|
3303 | select_component.options.__file = "components/timepicker/select.vue"
|
3304 | var timepicker_select = (select_component.exports);
|
3305 |
|
3306 |
|
3307 |
|
3308 |
|
3309 | var 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 | 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']
|
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 |
|
3502 | var timepicker_comboboxvue_type_script_lang_js_ = (comboboxvue_type_script_lang_js_);
|
3503 |
|
3504 | var combobox_render, combobox_staticRenderFns
|
3505 |
|
3506 |
|
3507 |
|
3508 |
|
3509 |
|
3510 |
|
3511 | var combobox_component = Object(componentNormalizer["a" ])(
|
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 |
|
3523 | if (false) { var combobox_api; }
|
3524 | combobox_component.options.__file = "components/timepicker/combobox.vue"
|
3525 | var combobox = (combobox_component.exports);
|
3526 |
|
3527 |
|
3528 |
|
3529 |
|
3530 |
|
3531 |
|
3532 |
|
3533 | var 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 | };
|
3544 | var isAM = function isAM(value) {
|
3545 | return value && value.hour() >= 0 && value.hour() < 12;
|
3546 | };
|
3547 |
|
3548 | 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 |
|
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 |
|
3869 | var timepicker_panelvue_type_script_lang_js_ = (panelvue_type_script_lang_js_);
|
3870 |
|
3871 | var panel_render, panel_staticRenderFns
|
3872 |
|
3873 |
|
3874 |
|
3875 |
|
3876 |
|
3877 |
|
3878 | var panel_component = Object(componentNormalizer["a" ])(
|
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 |
|
3890 | if (false) { var panel_api; }
|
3891 | panel_component.options.__file = "components/timepicker/panel.vue"
|
3892 | var panel = (panel_component.exports);
|
3893 |
|
3894 | var clickoutside = __webpack_require__(38);
|
3895 |
|
3896 |
|
3897 | var proptype_ = __webpack_require__(7);
|
3898 |
|
3899 |
|
3900 | var external_transition_ = __webpack_require__(11);
|
3901 | var external_transition_default = __webpack_require__.n(external_transition_);
|
3902 |
|
3903 |
|
3904 | var external_button_ = __webpack_require__(13);
|
3905 | var external_button_default = __webpack_require__.n(external_button_);
|
3906 |
|
3907 |
|
3908 | var emitter_ = __webpack_require__(12);
|
3909 | var emitter_default = __webpack_require__.n(emitter_);
|
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 |
|
3915 |
|
3916 |
|
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 |
|
3927 | function generateShowHourMinuteSecond(format) {
|
3928 |
|
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 | var time_pickervue_type_script_lang_js_ = ({
|
3937 | name: 'MdsTimePicker',
|
3938 | mixins: [vue_popper["a" ], popper_mixin["a" ], emitter_default.a, lazyMode],
|
3939 | directives: { Clickoutside: clickoutside["a" ] },
|
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 |
|
4422 | var timepicker_time_pickervue_type_script_lang_js_ = (time_pickervue_type_script_lang_js_);
|
4423 |
|
4424 | var time_picker_render, time_picker_staticRenderFns
|
4425 |
|
4426 |
|
4427 |
|
4428 |
|
4429 |
|
4430 |
|
4431 | var time_picker_component = Object(componentNormalizer["a" ])(
|
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 |
|
4443 | if (false) { var time_picker_api; }
|
4444 | time_picker_component.options.__file = "components/timepicker/time-picker.vue"
|
4445 | var time_picker = (time_picker_component.exports);
|
4446 |
|
4447 |
|
4448 |
|
4449 |
|
4450 | time_picker.install = function (Vue) {
|
4451 | Vue.component(time_picker.name, time_picker);
|
4452 | };
|
4453 | var timepicker = __webpack_exports__["default"] = (time_picker);
|
4454 |
|
4455 | })
|
4456 |
|
4457 | });
|
4458 | }); |
\ | No newline at end of file |