1 | module.exports =
|
2 | (function(modules) {
|
3 |
|
4 | var installedModules = {};
|
5 |
|
6 |
|
7 | function __webpack_require__(moduleId) {
|
8 |
|
9 |
|
10 | if(installedModules[moduleId]) {
|
11 | return installedModules[moduleId].exports;
|
12 | }
|
13 |
|
14 | var module = installedModules[moduleId] = {
|
15 | i: moduleId,
|
16 | l: false,
|
17 | exports: {}
|
18 | };
|
19 |
|
20 |
|
21 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
|
23 |
|
24 | module.l = true;
|
25 |
|
26 |
|
27 | return module.exports;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | __webpack_require__.m = modules;
|
33 |
|
34 |
|
35 | __webpack_require__.c = installedModules;
|
36 |
|
37 |
|
38 | __webpack_require__.d = function(exports, name, getter) {
|
39 | if(!__webpack_require__.o(exports, name)) {
|
40 | Object.defineProperty(exports, name, {
|
41 | configurable: false,
|
42 | enumerable: true,
|
43 | get: getter
|
44 | /******/ });
|
45 | /******/ }
|
46 | /******/ };
|
47 | /******/
|
48 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
49 | /******/ __webpack_require__.n = function(module) {
|
50 | var getter = module && module.__esModule ?
|
51 | function getDefault() { return module['default']; } :
|
52 | function getModuleExports() { return module; };
|
53 | __webpack_require__.d(getter, 'a', getter);
|
54 | return getter;
|
55 | };
|
56 |
|
57 |
|
58 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
59 |
|
60 |
|
61 | __webpack_require__.p = "/dist/";
|
62 |
|
63 |
|
64 | return __webpack_require__(__webpack_require__.s = 209);
|
65 | })
|
66 |
|
67 | ({
|
68 |
|
69 | 0:
|
70 | (function(module, exports) {
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | module.exports = function normalizeComponent (
|
79 | rawScriptExports,
|
80 | compiledTemplate,
|
81 | functionalTemplate,
|
82 | injectStyles,
|
83 | scopeId,
|
84 | moduleIdentifier /* server only */
|
85 | ) {
|
86 | var esModule
|
87 | var scriptExports = rawScriptExports = rawScriptExports || {}
|
88 |
|
89 |
|
90 | var type = typeof rawScriptExports.default
|
91 | if (type === 'object' || type === 'function') {
|
92 | esModule = rawScriptExports
|
93 | scriptExports = rawScriptExports.default
|
94 | }
|
95 |
|
96 |
|
97 | var options = typeof scriptExports === 'function'
|
98 | ? scriptExports.options
|
99 | : scriptExports
|
100 |
|
101 |
|
102 | if (compiledTemplate) {
|
103 | options.render = compiledTemplate.render
|
104 | options.staticRenderFns = compiledTemplate.staticRenderFns
|
105 | options._compiled = true
|
106 | }
|
107 |
|
108 |
|
109 | if (functionalTemplate) {
|
110 | options.functional = true
|
111 | }
|
112 |
|
113 |
|
114 | if (scopeId) {
|
115 | options._scopeId = scopeId
|
116 | }
|
117 |
|
118 | var hook
|
119 | if (moduleIdentifier) {
|
120 | hook = function (context) {
|
121 |
|
122 | context =
|
123 | context ||
|
124 | (this.$vnode && this.$vnode.ssrContext) ||
|
125 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
126 |
|
127 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
128 | context = __VUE_SSR_CONTEXT__
|
129 | }
|
130 |
|
131 | if (injectStyles) {
|
132 | injectStyles.call(this, context)
|
133 | }
|
134 |
|
135 | if (context && context._registeredComponents) {
|
136 | context._registeredComponents.add(moduleIdentifier)
|
137 | }
|
138 | }
|
139 |
|
140 |
|
141 | options._ssrRegister = hook
|
142 | } else if (injectStyles) {
|
143 | hook = injectStyles
|
144 | }
|
145 |
|
146 | if (hook) {
|
147 | var functional = options.functional
|
148 | var existing = functional
|
149 | ? options.render
|
150 | : options.beforeCreate
|
151 |
|
152 | if (!functional) {
|
153 |
|
154 | options.beforeCreate = existing
|
155 | ? [].concat(existing, hook)
|
156 | : [hook]
|
157 | } else {
|
158 |
|
159 |
|
160 | options._injectStyles = hook
|
161 |
|
162 | options.render = function renderWithStyleInjection (h, context) {
|
163 | hook.call(context)
|
164 | return existing(h, context)
|
165 | }
|
166 | }
|
167 | }
|
168 |
|
169 | return {
|
170 | esModule: esModule,
|
171 | exports: scriptExports,
|
172 | options: options
|
173 | }
|
174 | }
|
175 |
|
176 |
|
177 | }),
|
178 |
|
179 | 12:
|
180 | (function(module, exports) {
|
181 |
|
182 | module.exports = require("element-ui/lib/locale");
|
183 |
|
184 | }),
|
185 |
|
186 | 13:
|
187 | (function(module, exports) {
|
188 |
|
189 | module.exports = require("element-ui/lib/utils/popup");
|
190 |
|
191 | }),
|
192 |
|
193 | 15:
|
194 | (function(module, exports) {
|
195 |
|
196 | module.exports = require("element-ui/lib/button");
|
197 |
|
198 | }),
|
199 |
|
200 | 20:
|
201 | (function(module, exports) {
|
202 |
|
203 | module.exports = require("element-ui/lib/utils/vdom");
|
204 |
|
205 | }),
|
206 |
|
207 | 209:
|
208 | (function(module, exports, __webpack_require__) {
|
209 |
|
210 | "use strict";
|
211 |
|
212 |
|
213 | exports.__esModule = true;
|
214 |
|
215 | var _main = __webpack_require__(210);
|
216 |
|
217 | var _main2 = _interopRequireDefault(_main);
|
218 |
|
219 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
220 |
|
221 | exports.default = _main2.default;
|
222 |
|
223 | }),
|
224 |
|
225 | 210:
|
226 | (function(module, exports, __webpack_require__) {
|
227 |
|
228 | "use strict";
|
229 |
|
230 |
|
231 | exports.__esModule = true;
|
232 | exports.MessageBox = undefined;
|
233 |
|
234 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
235 |
|
236 | var _vue = __webpack_require__(4);
|
237 |
|
238 | var _vue2 = _interopRequireDefault(_vue);
|
239 |
|
240 | var _main = __webpack_require__(211);
|
241 |
|
242 | var _main2 = _interopRequireDefault(_main);
|
243 |
|
244 | var _merge = __webpack_require__(9);
|
245 |
|
246 | var _merge2 = _interopRequireDefault(_merge);
|
247 |
|
248 | var _vdom = __webpack_require__(20);
|
249 |
|
250 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
251 |
|
252 | var defaults = {
|
253 | title: null,
|
254 | message: '',
|
255 | type: '',
|
256 | iconClass: '',
|
257 | showInput: false,
|
258 | showClose: true,
|
259 | modalFade: true,
|
260 | lockScroll: true,
|
261 | closeOnClickModal: true,
|
262 | closeOnPressEscape: true,
|
263 | closeOnHashChange: true,
|
264 | inputValue: null,
|
265 | inputPlaceholder: '',
|
266 | inputType: 'text',
|
267 | inputPattern: null,
|
268 | inputValidator: null,
|
269 | inputErrorMessage: '',
|
270 | showConfirmButton: true,
|
271 | showCancelButton: false,
|
272 | confirmButtonPosition: 'right',
|
273 | confirmButtonHighlight: false,
|
274 | cancelButtonHighlight: false,
|
275 | confirmButtonText: '',
|
276 | cancelButtonText: '',
|
277 | confirmButtonClass: '',
|
278 | cancelButtonClass: '',
|
279 | customClass: '',
|
280 | beforeClose: null,
|
281 | dangerouslyUseHTMLString: false,
|
282 | center: false,
|
283 | roundButton: false,
|
284 | distinguishCancelAndClose: false
|
285 | };
|
286 |
|
287 | var MessageBoxConstructor = _vue2.default.extend(_main2.default);
|
288 |
|
289 | var currentMsg = void 0,
|
290 | instance = void 0;
|
291 | var msgQueue = [];
|
292 |
|
293 | var defaultCallback = function defaultCallback(action) {
|
294 | if (currentMsg) {
|
295 | var callback = currentMsg.callback;
|
296 | if (typeof callback === 'function') {
|
297 | if (instance.showInput) {
|
298 | callback(instance.inputValue, action);
|
299 | } else {
|
300 | callback(action);
|
301 | }
|
302 | }
|
303 | if (currentMsg.resolve) {
|
304 | if (action === 'confirm') {
|
305 | if (instance.showInput) {
|
306 | currentMsg.resolve({ value: instance.inputValue, action: action });
|
307 | } else {
|
308 | currentMsg.resolve(action);
|
309 | }
|
310 | } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {
|
311 | currentMsg.reject(action);
|
312 | }
|
313 | }
|
314 | }
|
315 | };
|
316 |
|
317 | var initInstance = function initInstance() {
|
318 | instance = new MessageBoxConstructor({
|
319 | el: document.createElement('div')
|
320 | });
|
321 |
|
322 | instance.callback = defaultCallback;
|
323 | };
|
324 |
|
325 | var showNextMsg = function showNextMsg() {
|
326 | if (!instance) {
|
327 | initInstance();
|
328 | }
|
329 | instance.action = '';
|
330 |
|
331 | if (!instance.visible || instance.closeTimer) {
|
332 | if (msgQueue.length > 0) {
|
333 | (function () {
|
334 | currentMsg = msgQueue.shift();
|
335 |
|
336 | var options = currentMsg.options;
|
337 | for (var prop in options) {
|
338 | if (options.hasOwnProperty(prop)) {
|
339 | instance[prop] = options[prop];
|
340 | }
|
341 | }
|
342 | if (options.callback === undefined) {
|
343 | instance.callback = defaultCallback;
|
344 | }
|
345 |
|
346 | var oldCb = instance.callback;
|
347 | instance.callback = function (action, instance) {
|
348 | oldCb(action, instance);
|
349 | showNextMsg();
|
350 | };
|
351 | if ((0, _vdom.isVNode)(instance.message)) {
|
352 | instance.$slots.default = [instance.message];
|
353 | instance.message = null;
|
354 | } else {
|
355 | delete instance.$slots.default;
|
356 | }
|
357 | ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(function (prop) {
|
358 | if (instance[prop] === undefined) {
|
359 | instance[prop] = true;
|
360 | }
|
361 | });
|
362 | document.body.appendChild(instance.$el);
|
363 |
|
364 | _vue2.default.nextTick(function () {
|
365 | instance.visible = true;
|
366 | });
|
367 | })();
|
368 | }
|
369 | }
|
370 | };
|
371 |
|
372 | var MessageBox = function MessageBox(options, callback) {
|
373 | if (_vue2.default.prototype.$isServer) return;
|
374 | if (typeof options === 'string' || (0, _vdom.isVNode)(options)) {
|
375 | options = {
|
376 | message: options
|
377 | };
|
378 | if (typeof arguments[1] === 'string') {
|
379 | options.title = arguments[1];
|
380 | }
|
381 | } else if (options.callback && !callback) {
|
382 | callback = options.callback;
|
383 | }
|
384 |
|
385 | if (typeof Promise !== 'undefined') {
|
386 | return new Promise(function (resolve, reject) {
|
387 |
|
388 | msgQueue.push({
|
389 | options: (0, _merge2.default)({}, defaults, MessageBox.defaults, options),
|
390 | callback: callback,
|
391 | resolve: resolve,
|
392 | reject: reject
|
393 | });
|
394 |
|
395 | showNextMsg();
|
396 | });
|
397 | } else {
|
398 | msgQueue.push({
|
399 | options: (0, _merge2.default)({}, defaults, MessageBox.defaults, options),
|
400 | callback: callback
|
401 | });
|
402 |
|
403 | showNextMsg();
|
404 | }
|
405 | };
|
406 |
|
407 | MessageBox.setDefaults = function (defaults) {
|
408 | MessageBox.defaults = defaults;
|
409 | };
|
410 |
|
411 | MessageBox.alert = function (message, title, options) {
|
412 | if ((typeof title === 'undefined' ? 'undefined' : _typeof(title)) === 'object') {
|
413 | options = title;
|
414 | title = '';
|
415 | } else if (title === undefined) {
|
416 | title = '';
|
417 | }
|
418 | return MessageBox((0, _merge2.default)({
|
419 | title: title,
|
420 | message: message,
|
421 | $type: 'alert',
|
422 | closeOnPressEscape: false,
|
423 | closeOnClickModal: false
|
424 | }, options));
|
425 | };
|
426 |
|
427 | MessageBox.confirm = function (message, title, options) {
|
428 | if ((typeof title === 'undefined' ? 'undefined' : _typeof(title)) === 'object') {
|
429 | options = title;
|
430 | title = '';
|
431 | } else if (title === undefined) {
|
432 | title = '';
|
433 | }
|
434 | return MessageBox((0, _merge2.default)({
|
435 | title: title,
|
436 | message: message,
|
437 | $type: 'confirm',
|
438 | showCancelButton: true
|
439 | }, options));
|
440 | };
|
441 |
|
442 | MessageBox.prompt = function (message, title, options) {
|
443 | if ((typeof title === 'undefined' ? 'undefined' : _typeof(title)) === 'object') {
|
444 | options = title;
|
445 | title = '';
|
446 | } else if (title === undefined) {
|
447 | title = '';
|
448 | }
|
449 | return MessageBox((0, _merge2.default)({
|
450 | title: title,
|
451 | message: message,
|
452 | showCancelButton: true,
|
453 | showInput: true,
|
454 | $type: 'prompt'
|
455 | }, options));
|
456 | };
|
457 |
|
458 | MessageBox.close = function () {
|
459 | instance.doClose();
|
460 | instance.visible = false;
|
461 | msgQueue = [];
|
462 | currentMsg = null;
|
463 | };
|
464 |
|
465 | exports.default = MessageBox;
|
466 | exports.MessageBox = MessageBox;
|
467 |
|
468 | }),
|
469 |
|
470 | 211:
|
471 | (function(module, __webpack_exports__, __webpack_require__) {
|
472 |
|
473 | "use strict";
|
474 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
475 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue__ = __webpack_require__(212);
|
476 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue__);
|
477 | var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_05b9df22_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_main_vue__ = __webpack_require__(214);
|
478 | var normalizeComponent = __webpack_require__(0)
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 | var __vue_template_functional__ = false
|
485 |
|
486 | var __vue_styles__ = null
|
487 |
|
488 | var __vue_scopeId__ = null
|
489 |
|
490 | var __vue_module_identifier__ = null
|
491 | var Component = normalizeComponent(
|
492 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue___default.a,
|
493 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_05b9df22_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_main_vue__["a" ],
|
494 | __vue_template_functional__,
|
495 | __vue_styles__,
|
496 | __vue_scopeId__,
|
497 | __vue_module_identifier__
|
498 | )
|
499 |
|
500 | __webpack_exports__["default"] = (Component.exports);
|
501 |
|
502 |
|
503 | }),
|
504 |
|
505 | 212:
|
506 | (function(module, exports, __webpack_require__) {
|
507 |
|
508 | "use strict";
|
509 |
|
510 |
|
511 | exports.__esModule = true;
|
512 |
|
513 | var _popup = __webpack_require__(13);
|
514 |
|
515 | var _popup2 = _interopRequireDefault(_popup);
|
516 |
|
517 | var _locale = __webpack_require__(5);
|
518 |
|
519 | var _locale2 = _interopRequireDefault(_locale);
|
520 |
|
521 | var _input = __webpack_require__(6);
|
522 |
|
523 | var _input2 = _interopRequireDefault(_input);
|
524 |
|
525 | var _button = __webpack_require__(15);
|
526 |
|
527 | var _button2 = _interopRequireDefault(_button);
|
528 |
|
529 | var _dom = __webpack_require__(3);
|
530 |
|
531 | var _locale3 = __webpack_require__(12);
|
532 |
|
533 | var _ariaDialog = __webpack_require__(213);
|
534 |
|
535 | var _ariaDialog2 = _interopRequireDefault(_ariaDialog);
|
536 |
|
537 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
538 |
|
539 | var messageBox = void 0;
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 | var typeMap = {
|
619 | success: 'success',
|
620 | info: 'info',
|
621 | warning: 'warning',
|
622 | error: 'error'
|
623 | };
|
624 |
|
625 | exports.default = {
|
626 | mixins: [_popup2.default, _locale2.default],
|
627 |
|
628 | props: {
|
629 | modal: {
|
630 | default: true
|
631 | },
|
632 | lockScroll: {
|
633 | default: true
|
634 | },
|
635 | showClose: {
|
636 | type: Boolean,
|
637 | default: true
|
638 | },
|
639 | closeOnClickModal: {
|
640 | default: true
|
641 | },
|
642 | closeOnPressEscape: {
|
643 | default: true
|
644 | },
|
645 | closeOnHashChange: {
|
646 | default: true
|
647 | },
|
648 | center: {
|
649 | default: false,
|
650 | type: Boolean
|
651 | },
|
652 | roundButton: {
|
653 | default: false,
|
654 | type: Boolean
|
655 | }
|
656 | },
|
657 |
|
658 | components: {
|
659 | ElInput: _input2.default,
|
660 | ElButton: _button2.default
|
661 | },
|
662 |
|
663 | computed: {
|
664 | icon: function icon() {
|
665 | var type = this.type,
|
666 | iconClass = this.iconClass;
|
667 |
|
668 | return iconClass || (type && typeMap[type] ? 'el-icon-' + typeMap[type] : '');
|
669 | },
|
670 | confirmButtonClasses: function confirmButtonClasses() {
|
671 | return 'el-button--primary ' + this.confirmButtonClass;
|
672 | },
|
673 | cancelButtonClasses: function cancelButtonClasses() {
|
674 | return '' + this.cancelButtonClass;
|
675 | }
|
676 | },
|
677 |
|
678 | methods: {
|
679 | getSafeClose: function getSafeClose() {
|
680 | var _this = this;
|
681 |
|
682 | var currentId = this.uid;
|
683 | return function () {
|
684 | _this.$nextTick(function () {
|
685 | if (currentId === _this.uid) _this.doClose();
|
686 | });
|
687 | };
|
688 | },
|
689 | doClose: function doClose() {
|
690 | var _this2 = this;
|
691 |
|
692 | if (!this.visible) return;
|
693 | this.visible = false;
|
694 | this._closing = true;
|
695 |
|
696 | this.onClose && this.onClose();
|
697 | messageBox.closeDialog();
|
698 | if (this.lockScroll) {
|
699 | setTimeout(this.restoreBodyStyle, 200);
|
700 | }
|
701 | this.opened = false;
|
702 | this.doAfterClose();
|
703 | setTimeout(function () {
|
704 | if (_this2.action) _this2.callback(_this2.action, _this2);
|
705 | });
|
706 | },
|
707 | handleWrapperClick: function handleWrapperClick() {
|
708 | if (this.closeOnClickModal) {
|
709 | this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel');
|
710 | }
|
711 | },
|
712 | handleInputEnter: function handleInputEnter() {
|
713 | if (this.inputType !== 'textarea') {
|
714 | return this.handleAction('confirm');
|
715 | }
|
716 | },
|
717 | handleAction: function handleAction(action) {
|
718 | if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) {
|
719 | return;
|
720 | }
|
721 | this.action = action;
|
722 | if (typeof this.beforeClose === 'function') {
|
723 | this.close = this.getSafeClose();
|
724 | this.beforeClose(action, this, this.close);
|
725 | } else {
|
726 | this.doClose();
|
727 | }
|
728 | },
|
729 | validate: function validate() {
|
730 | if (this.$type === 'prompt') {
|
731 | var inputPattern = this.inputPattern;
|
732 | if (inputPattern && !inputPattern.test(this.inputValue || '')) {
|
733 | this.editorErrorMessage = this.inputErrorMessage || (0, _locale3.t)('el.messagebox.error');
|
734 | (0, _dom.addClass)(this.getInputElement(), 'invalid');
|
735 | return false;
|
736 | }
|
737 | var inputValidator = this.inputValidator;
|
738 | if (typeof inputValidator === 'function') {
|
739 | var validateResult = inputValidator(this.inputValue);
|
740 | if (validateResult === false) {
|
741 | this.editorErrorMessage = this.inputErrorMessage || (0, _locale3.t)('el.messagebox.error');
|
742 | (0, _dom.addClass)(this.getInputElement(), 'invalid');
|
743 | return false;
|
744 | }
|
745 | if (typeof validateResult === 'string') {
|
746 | this.editorErrorMessage = validateResult;
|
747 | (0, _dom.addClass)(this.getInputElement(), 'invalid');
|
748 | return false;
|
749 | }
|
750 | }
|
751 | }
|
752 | this.editorErrorMessage = '';
|
753 | (0, _dom.removeClass)(this.getInputElement(), 'invalid');
|
754 | return true;
|
755 | },
|
756 | getFirstFocus: function getFirstFocus() {
|
757 | var btn = this.$el.querySelector('.el-message-box__btns .el-button');
|
758 | var title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
|
759 | return btn || title;
|
760 | },
|
761 | getInputElement: function getInputElement() {
|
762 | var inputRefs = this.$refs.input.$refs;
|
763 | return inputRefs.input || inputRefs.textarea;
|
764 | }
|
765 | },
|
766 |
|
767 | watch: {
|
768 | inputValue: {
|
769 | immediate: true,
|
770 | handler: function handler(val) {
|
771 | var _this3 = this;
|
772 |
|
773 | this.$nextTick(function (_) {
|
774 | if (_this3.$type === 'prompt' && val !== null) {
|
775 | _this3.validate();
|
776 | }
|
777 | });
|
778 | }
|
779 | },
|
780 |
|
781 | visible: function visible(val) {
|
782 | var _this4 = this;
|
783 |
|
784 | if (val) {
|
785 | this.uid++;
|
786 | if (this.$type === 'alert' || this.$type === 'confirm') {
|
787 | this.$nextTick(function () {
|
788 | _this4.$refs.confirm.$el.focus();
|
789 | });
|
790 | }
|
791 | this.focusAfterClosed = document.activeElement;
|
792 | messageBox = new _ariaDialog2.default(this.$el, this.focusAfterClosed, this.getFirstFocus());
|
793 | }
|
794 |
|
795 |
|
796 | if (this.$type !== 'prompt') return;
|
797 | if (val) {
|
798 | setTimeout(function () {
|
799 | if (_this4.$refs.input && _this4.$refs.input.$el) {
|
800 | _this4.getInputElement().focus();
|
801 | }
|
802 | }, 500);
|
803 | } else {
|
804 | this.editorErrorMessage = '';
|
805 | (0, _dom.removeClass)(this.getInputElement(), 'invalid');
|
806 | }
|
807 | }
|
808 | },
|
809 |
|
810 | mounted: function mounted() {
|
811 | var _this5 = this;
|
812 |
|
813 | this.$nextTick(function () {
|
814 | if (_this5.closeOnHashChange) {
|
815 | window.addEventListener('hashchange', _this5.close);
|
816 | }
|
817 | });
|
818 | },
|
819 | beforeDestroy: function beforeDestroy() {
|
820 | if (this.closeOnHashChange) {
|
821 | window.removeEventListener('hashchange', this.close);
|
822 | }
|
823 | setTimeout(function () {
|
824 | messageBox.closeDialog();
|
825 | });
|
826 | },
|
827 | data: function data() {
|
828 | return {
|
829 | uid: 1,
|
830 | title: undefined,
|
831 | message: '',
|
832 | type: '',
|
833 | iconClass: '',
|
834 | customClass: '',
|
835 | showInput: false,
|
836 | inputValue: null,
|
837 | inputPlaceholder: '',
|
838 | inputType: 'text',
|
839 | inputPattern: null,
|
840 | inputValidator: null,
|
841 | inputErrorMessage: '',
|
842 | showConfirmButton: true,
|
843 | showCancelButton: false,
|
844 | action: '',
|
845 | confirmButtonText: '',
|
846 | cancelButtonText: '',
|
847 | confirmButtonLoading: false,
|
848 | cancelButtonLoading: false,
|
849 | confirmButtonClass: '',
|
850 | confirmButtonDisabled: false,
|
851 | cancelButtonClass: '',
|
852 | editorErrorMessage: null,
|
853 | callback: null,
|
854 | dangerouslyUseHTMLString: false,
|
855 | focusAfterClosed: null,
|
856 | isOnComposition: false,
|
857 | distinguishCancelAndClose: false
|
858 | };
|
859 | }
|
860 | };
|
861 |
|
862 | }),
|
863 |
|
864 | 213:
|
865 | (function(module, exports) {
|
866 |
|
867 | module.exports = require("element-ui/lib/utils/aria-dialog");
|
868 |
|
869 | }),
|
870 |
|
871 | 214:
|
872 | (function(module, __webpack_exports__, __webpack_require__) {
|
873 |
|
874 | "use strict";
|
875 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"msgbox-fade"}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.visible),expression:"visible"}],staticClass:"el-message-box__wrapper",attrs:{"tabindex":"-1","role":"dialog","aria-modal":"true","aria-label":_vm.title || 'dialog'},on:{"click":function($event){if($event.target !== $event.currentTarget){ return null; }_vm.handleWrapperClick($event)}}},[_c('div',{staticClass:"el-message-box",class:[_vm.customClass, _vm.center && 'el-message-box--center']},[(_vm.title !== null)?_c('div',{staticClass:"el-message-box__header"},[_c('div',{staticClass:"el-message-box__title"},[(_vm.icon && _vm.center)?_c('div',{class:['el-message-box__status', _vm.icon]}):_vm._e(),_c('span',[_vm._v(_vm._s(_vm.title))])]),(_vm.showClose)?_c('button',{staticClass:"el-message-box__headerbtn",attrs:{"type":"button","aria-label":"Close"},on:{"click":function($event){_vm.handleAction(_vm.distinguishCancelAndClose ? 'close' : 'cancel')},"keydown":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.handleAction(_vm.distinguishCancelAndClose ? 'close' : 'cancel')}}},[_c('i',{staticClass:"el-message-box__close el-icon-close"})]):_vm._e()]):_vm._e(),_c('div',{staticClass:"el-message-box__content"},[(_vm.icon && !_vm.center && _vm.message !== '')?_c('div',{class:['el-message-box__status', _vm.icon]}):_vm._e(),(_vm.message !== '')?_c('div',{staticClass:"el-message-box__message"},[_vm._t("default",[(!_vm.dangerouslyUseHTMLString)?_c('p',[_vm._v(_vm._s(_vm.message))]):_c('p',{domProps:{"innerHTML":_vm._s(_vm.message)}})])],2):_vm._e(),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.showInput),expression:"showInput"}],staticClass:"el-message-box__input"},[_c('el-input',{ref:"input",attrs:{"type":_vm.inputType,"placeholder":_vm.inputPlaceholder},nativeOn:{"keydown":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.handleInputEnter($event)}},model:{value:(_vm.inputValue),callback:function ($$v) {_vm.inputValue=$$v},expression:"inputValue"}}),_c('div',{staticClass:"el-message-box__errormsg",style:({ visibility: !!_vm.editorErrorMessage ? 'visible' : 'hidden' })},[_vm._v(_vm._s(_vm.editorErrorMessage))])],1)]),_c('div',{staticClass:"el-message-box__btns"},[(_vm.showCancelButton)?_c('el-button',{class:[ _vm.cancelButtonClasses ],attrs:{"loading":_vm.cancelButtonLoading,"round":_vm.roundButton,"size":"small"},on:{"keydown":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.handleAction('cancel')}},nativeOn:{"click":function($event){_vm.handleAction('cancel')}}},[_vm._v("\n "+_vm._s(_vm.cancelButtonText || _vm.t('el.messagebox.cancel'))+"\n ")]):_vm._e(),_c('el-button',{directives:[{name:"show",rawName:"v-show",value:(_vm.showConfirmButton),expression:"showConfirmButton"}],ref:"confirm",class:[ _vm.confirmButtonClasses ],attrs:{"loading":_vm.confirmButtonLoading,"round":_vm.roundButton,"size":"small"},on:{"keydown":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.handleAction('confirm')}},nativeOn:{"click":function($event){_vm.handleAction('confirm')}}},[_vm._v("\n "+_vm._s(_vm.confirmButtonText || _vm.t('el.messagebox.confirm'))+"\n ")])],1)])])])}
|
876 | var staticRenderFns = []
|
877 | var esExports = { render: render, staticRenderFns: staticRenderFns }
|
878 | __webpack_exports__["a"] = (esExports);
|
879 |
|
880 | }),
|
881 |
|
882 | 3:
|
883 | (function(module, exports) {
|
884 |
|
885 | module.exports = require("element-ui/lib/utils/dom");
|
886 |
|
887 | }),
|
888 |
|
889 | 4:
|
890 | (function(module, exports) {
|
891 |
|
892 | module.exports = require("vue");
|
893 |
|
894 | }),
|
895 |
|
896 | 5:
|
897 | (function(module, exports) {
|
898 |
|
899 | module.exports = require("element-ui/lib/mixins/locale");
|
900 |
|
901 | }),
|
902 |
|
903 | 6:
|
904 | (function(module, exports) {
|
905 |
|
906 | module.exports = require("element-ui/lib/input");
|
907 |
|
908 | }),
|
909 |
|
910 | 9:
|
911 | (function(module, exports) {
|
912 |
|
913 | module.exports = require("element-ui/lib/utils/merge");
|
914 |
|
915 | })
|
916 |
|
917 | }); |
\ | No newline at end of file |