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, { enumerable: true, get: getter });
|
41 | }
|
42 | };
|
43 |
|
44 |
|
45 | __webpack_require__.r = function(exports) {
|
46 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
47 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
48 | }
|
49 | Object.defineProperty(exports, '__esModule', { value: true });
|
50 | };
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | __webpack_require__.t = function(value, mode) {
|
58 | if(mode & 1) value = __webpack_require__(value);
|
59 | if(mode & 8) return value;
|
60 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
61 | var ns = Object.create(null);
|
62 | __webpack_require__.r(ns);
|
63 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
64 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
65 | return ns;
|
66 | };
|
67 |
|
68 |
|
69 | __webpack_require__.n = function(module) {
|
70 | var getter = module && module.__esModule ?
|
71 | function getDefault() { return module['default']; } :
|
72 | function getModuleExports() { return module; };
|
73 | __webpack_require__.d(getter, 'a', getter);
|
74 | return getter;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
79 |
|
80 |
|
81 | __webpack_require__.p = "/dist/";
|
82 |
|
83 |
|
84 |
|
85 | return __webpack_require__(__webpack_require__.s = 129);
|
86 | })
|
87 |
|
88 | ({
|
89 |
|
90 | 0:
|
91 | (function(module, __webpack_exports__, __webpack_require__) {
|
92 |
|
93 | "use strict";
|
94 | __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | function normalizeComponent (
|
102 | scriptExports,
|
103 | render,
|
104 | staticRenderFns,
|
105 | functionalTemplate,
|
106 | injectStyles,
|
107 | scopeId,
|
108 | moduleIdentifier, /* server only */
|
109 | shadowMode /* vue-cli only */
|
110 | ) {
|
111 |
|
112 | var options = typeof scriptExports === 'function'
|
113 | ? scriptExports.options
|
114 | : scriptExports
|
115 |
|
116 |
|
117 | if (render) {
|
118 | options.render = render
|
119 | options.staticRenderFns = staticRenderFns
|
120 | options._compiled = true
|
121 | }
|
122 |
|
123 |
|
124 | if (functionalTemplate) {
|
125 | options.functional = true
|
126 | }
|
127 |
|
128 |
|
129 | if (scopeId) {
|
130 | options._scopeId = 'data-v-' + scopeId
|
131 | }
|
132 |
|
133 | var hook
|
134 | if (moduleIdentifier) {
|
135 | hook = function (context) {
|
136 |
|
137 | context =
|
138 | context ||
|
139 | (this.$vnode && this.$vnode.ssrContext) ||
|
140 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
141 |
|
142 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
143 | context = __VUE_SSR_CONTEXT__
|
144 | }
|
145 |
|
146 | if (injectStyles) {
|
147 | injectStyles.call(this, context)
|
148 | }
|
149 |
|
150 | if (context && context._registeredComponents) {
|
151 | context._registeredComponents.add(moduleIdentifier)
|
152 | }
|
153 | }
|
154 |
|
155 |
|
156 | options._ssrRegister = hook
|
157 | } else if (injectStyles) {
|
158 | hook = shadowMode
|
159 | ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
160 | : injectStyles
|
161 | }
|
162 |
|
163 | if (hook) {
|
164 | if (options.functional) {
|
165 |
|
166 |
|
167 | options._injectStyles = hook
|
168 |
|
169 | var originalRender = options.render
|
170 | options.render = function renderWithStyleInjection (h, context) {
|
171 | hook.call(context)
|
172 | return originalRender(h, context)
|
173 | }
|
174 | } else {
|
175 |
|
176 | var existing = options.beforeCreate
|
177 | options.beforeCreate = existing
|
178 | ? [].concat(existing, hook)
|
179 | : [hook]
|
180 | }
|
181 | }
|
182 |
|
183 | return {
|
184 | exports: scriptExports,
|
185 | options: options
|
186 | }
|
187 | }
|
188 |
|
189 |
|
190 | }),
|
191 |
|
192 | 129:
|
193 | (function(module, __webpack_exports__, __webpack_require__) {
|
194 |
|
195 | "use strict";
|
196 | __webpack_require__.r(__webpack_exports__);
|
197 |
|
198 |
|
199 | var collapse_transition_ = __webpack_require__(28);
|
200 | var collapse_transition_default = __webpack_require__.n(collapse_transition_);
|
201 |
|
202 |
|
203 | var menu_mixin = __webpack_require__(37);
|
204 |
|
205 |
|
206 | var emitter_ = __webpack_require__(4);
|
207 | var emitter_default = __webpack_require__.n(emitter_);
|
208 |
|
209 |
|
210 | var vue_popper_ = __webpack_require__(5);
|
211 | var vue_popper_default = __webpack_require__.n(vue_popper_);
|
212 |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 | var poperMixins = {
|
221 | props: {
|
222 | transformOrigin: {
|
223 | type: [Boolean, String],
|
224 | default: false
|
225 | },
|
226 | offset: vue_popper_default.a.props.offset,
|
227 | boundariesPadding: vue_popper_default.a.props.boundariesPadding,
|
228 | popperOptions: vue_popper_default.a.props.popperOptions
|
229 | },
|
230 | data: vue_popper_default.a.data,
|
231 | methods: vue_popper_default.a.methods,
|
232 | beforeDestroy: vue_popper_default.a.beforeDestroy,
|
233 | deactivated: vue_popper_default.a.deactivated
|
234 | };
|
235 |
|
236 | var submenuvue_type_script_lang_js_ = ({
|
237 | name: 'ElSubmenu',
|
238 |
|
239 | componentName: 'ElSubmenu',
|
240 |
|
241 | mixins: [menu_mixin["a" ], emitter_default.a, poperMixins],
|
242 |
|
243 | components: { ElCollapseTransition: collapse_transition_default.a },
|
244 |
|
245 | props: {
|
246 | index: {
|
247 | type: String,
|
248 | required: true
|
249 | },
|
250 | showTimeout: {
|
251 | type: Number,
|
252 | default: 300
|
253 | },
|
254 | hideTimeout: {
|
255 | type: Number,
|
256 | default: 300
|
257 | },
|
258 | popperClass: String,
|
259 | disabled: Boolean,
|
260 | popperAppendToBody: {
|
261 | type: Boolean,
|
262 | default: undefined
|
263 | }
|
264 | },
|
265 |
|
266 | data: function data() {
|
267 | return {
|
268 | popperJS: null,
|
269 | timeout: null,
|
270 | items: {},
|
271 | submenus: {},
|
272 | mouseInChild: false
|
273 | };
|
274 | },
|
275 |
|
276 | watch: {
|
277 | opened: function opened(val) {
|
278 | var _this = this;
|
279 |
|
280 | if (this.isMenuPopup) {
|
281 | this.$nextTick(function (_) {
|
282 | _this.updatePopper();
|
283 | });
|
284 | }
|
285 | }
|
286 | },
|
287 | computed: {
|
288 |
|
289 | appendToBody: function appendToBody() {
|
290 | return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
|
291 | },
|
292 | menuTransitionName: function menuTransitionName() {
|
293 | return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
|
294 | },
|
295 | opened: function opened() {
|
296 | return this.rootMenu.openedMenus.indexOf(this.index) > -1;
|
297 | },
|
298 | active: function active() {
|
299 | var isActive = false;
|
300 | var submenus = this.submenus;
|
301 | var items = this.items;
|
302 |
|
303 | Object.keys(items).forEach(function (index) {
|
304 | if (items[index].active) {
|
305 | isActive = true;
|
306 | }
|
307 | });
|
308 |
|
309 | Object.keys(submenus).forEach(function (index) {
|
310 | if (submenus[index].active) {
|
311 | isActive = true;
|
312 | }
|
313 | });
|
314 |
|
315 | return isActive;
|
316 | },
|
317 | hoverBackground: function hoverBackground() {
|
318 | return this.rootMenu.hoverBackground;
|
319 | },
|
320 | backgroundColor: function backgroundColor() {
|
321 | return this.rootMenu.backgroundColor || '';
|
322 | },
|
323 | activeTextColor: function activeTextColor() {
|
324 | return this.rootMenu.activeTextColor || '';
|
325 | },
|
326 | textColor: function textColor() {
|
327 | return this.rootMenu.textColor || '';
|
328 | },
|
329 | mode: function mode() {
|
330 | return this.rootMenu.mode;
|
331 | },
|
332 | isMenuPopup: function isMenuPopup() {
|
333 | return this.rootMenu.isMenuPopup;
|
334 | },
|
335 | titleStyle: function titleStyle() {
|
336 | if (this.mode !== 'horizontal') {
|
337 | return {
|
338 | color: this.textColor
|
339 | };
|
340 | }
|
341 | return {
|
342 | borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
|
343 | color: this.active ? this.activeTextColor : this.textColor
|
344 | };
|
345 | },
|
346 | isFirstLevel: function isFirstLevel() {
|
347 | var isFirstLevel = true;
|
348 | var parent = this.$parent;
|
349 | while (parent && parent !== this.rootMenu) {
|
350 | if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
|
351 | isFirstLevel = false;
|
352 | break;
|
353 | } else {
|
354 | parent = parent.$parent;
|
355 | }
|
356 | }
|
357 | return isFirstLevel;
|
358 | }
|
359 | },
|
360 | methods: {
|
361 | handleCollapseToggle: function handleCollapseToggle(value) {
|
362 | if (value) {
|
363 | this.initPopper();
|
364 | } else {
|
365 | this.doDestroy();
|
366 | }
|
367 | },
|
368 | addItem: function addItem(item) {
|
369 | this.$set(this.items, item.index, item);
|
370 | },
|
371 | removeItem: function removeItem(item) {
|
372 | delete this.items[item.index];
|
373 | },
|
374 | addSubmenu: function addSubmenu(item) {
|
375 | this.$set(this.submenus, item.index, item);
|
376 | },
|
377 | removeSubmenu: function removeSubmenu(item) {
|
378 | delete this.submenus[item.index];
|
379 | },
|
380 | handleClick: function handleClick() {
|
381 | var rootMenu = this.rootMenu,
|
382 | disabled = this.disabled;
|
383 |
|
384 | if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
|
385 | return;
|
386 | }
|
387 | this.dispatch('ElMenu', 'submenu-click', this);
|
388 | },
|
389 | handleMouseenter: function handleMouseenter(event) {
|
390 | var _this2 = this;
|
391 |
|
392 | var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout;
|
393 |
|
394 |
|
395 | if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
|
396 | return;
|
397 | }
|
398 | var rootMenu = this.rootMenu,
|
399 | disabled = this.disabled;
|
400 |
|
401 | if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
|
402 | return;
|
403 | }
|
404 | this.dispatch('ElSubmenu', 'mouse-enter-child');
|
405 | clearTimeout(this.timeout);
|
406 | this.timeout = setTimeout(function () {
|
407 | _this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
|
408 | }, showTimeout);
|
409 |
|
410 | if (this.appendToBody) {
|
411 | this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter'));
|
412 | }
|
413 | },
|
414 | handleMouseleave: function handleMouseleave() {
|
415 | var _this3 = this;
|
416 |
|
417 | var deepDispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
418 | var rootMenu = this.rootMenu;
|
419 |
|
420 | if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
|
421 | return;
|
422 | }
|
423 | this.dispatch('ElSubmenu', 'mouse-leave-child');
|
424 | clearTimeout(this.timeout);
|
425 | this.timeout = setTimeout(function () {
|
426 | !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
|
427 | }, this.hideTimeout);
|
428 |
|
429 | if (this.appendToBody && deepDispatch) {
|
430 | if (this.$parent.$options.name === 'ElSubmenu') {
|
431 | this.$parent.handleMouseleave(true);
|
432 | }
|
433 | }
|
434 | },
|
435 | handleTitleMouseenter: function handleTitleMouseenter() {
|
436 | if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
|
437 | var title = this.$refs['submenu-title'];
|
438 | title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
|
439 | },
|
440 | handleTitleMouseleave: function handleTitleMouseleave() {
|
441 | if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
|
442 | var title = this.$refs['submenu-title'];
|
443 | title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
|
444 | },
|
445 | updatePlacement: function updatePlacement() {
|
446 | this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
|
447 | },
|
448 | initPopper: function initPopper() {
|
449 | this.referenceElm = this.$el;
|
450 | this.popperElm = this.$refs.menu;
|
451 | this.updatePlacement();
|
452 | }
|
453 | },
|
454 | created: function created() {
|
455 | var _this4 = this;
|
456 |
|
457 | this.$on('toggle-collapse', this.handleCollapseToggle);
|
458 | this.$on('mouse-enter-child', function () {
|
459 | _this4.mouseInChild = true;
|
460 | clearTimeout(_this4.timeout);
|
461 | });
|
462 | this.$on('mouse-leave-child', function () {
|
463 | _this4.mouseInChild = false;
|
464 | clearTimeout(_this4.timeout);
|
465 | });
|
466 | },
|
467 | mounted: function mounted() {
|
468 | this.parentMenu.addSubmenu(this);
|
469 | this.rootMenu.addSubmenu(this);
|
470 | this.initPopper();
|
471 | },
|
472 | beforeDestroy: function beforeDestroy() {
|
473 | this.parentMenu.removeSubmenu(this);
|
474 | this.rootMenu.removeSubmenu(this);
|
475 | },
|
476 | render: function render(h) {
|
477 | var _this5 = this;
|
478 |
|
479 | var active = this.active,
|
480 | opened = this.opened,
|
481 | paddingStyle = this.paddingStyle,
|
482 | titleStyle = this.titleStyle,
|
483 | backgroundColor = this.backgroundColor,
|
484 | rootMenu = this.rootMenu,
|
485 | currentPlacement = this.currentPlacement,
|
486 | menuTransitionName = this.menuTransitionName,
|
487 | mode = this.mode,
|
488 | disabled = this.disabled,
|
489 | popperClass = this.popperClass,
|
490 | $slots = this.$slots,
|
491 | isFirstLevel = this.isFirstLevel;
|
492 |
|
493 |
|
494 | var popupMenu = h(
|
495 | 'transition',
|
496 | {
|
497 | attrs: { name: menuTransitionName }
|
498 | },
|
499 | [h(
|
500 | 'div',
|
501 | {
|
502 | ref: 'menu',
|
503 | directives: [{
|
504 | name: 'show',
|
505 | value: opened
|
506 | }],
|
507 |
|
508 | 'class': ['el-menu--' + mode, popperClass],
|
509 | on: {
|
510 | 'mouseenter': function mouseenter($event) {
|
511 | return _this5.handleMouseenter($event, 100);
|
512 | },
|
513 | 'mouseleave': function mouseleave() {
|
514 | return _this5.handleMouseleave(true);
|
515 | },
|
516 | 'focus': function focus($event) {
|
517 | return _this5.handleMouseenter($event, 100);
|
518 | }
|
519 | }
|
520 | },
|
521 | [h(
|
522 | 'ul',
|
523 | {
|
524 | attrs: {
|
525 | role: 'menu'
|
526 | },
|
527 | 'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement],
|
528 | style: { backgroundColor: rootMenu.backgroundColor || '' } },
|
529 | [$slots.default]
|
530 | )]
|
531 | )]
|
532 | );
|
533 |
|
534 | var inlineMenu = h('el-collapse-transition', [h(
|
535 | 'ul',
|
536 | {
|
537 | attrs: {
|
538 | role: 'menu'
|
539 | },
|
540 | 'class': 'el-menu el-menu--inline',
|
541 | directives: [{
|
542 | name: 'show',
|
543 | value: opened
|
544 | }],
|
545 |
|
546 | style: { backgroundColor: rootMenu.backgroundColor || '' } },
|
547 | [$slots.default]
|
548 | )]);
|
549 |
|
550 | var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
|
551 |
|
552 | return h(
|
553 | 'li',
|
554 | {
|
555 | 'class': {
|
556 | 'el-submenu': true,
|
557 | 'is-active': active,
|
558 | 'is-opened': opened,
|
559 | 'is-disabled': disabled
|
560 | },
|
561 | attrs: { role: 'menuitem',
|
562 | 'aria-haspopup': 'true',
|
563 | 'aria-expanded': opened
|
564 | },
|
565 | on: {
|
566 | 'mouseenter': this.handleMouseenter,
|
567 | 'mouseleave': function mouseleave() {
|
568 | return _this5.handleMouseleave(false);
|
569 | },
|
570 | 'focus': this.handleMouseenter
|
571 | }
|
572 | },
|
573 | [h(
|
574 | 'div',
|
575 | {
|
576 | 'class': 'el-submenu__title',
|
577 | ref: 'submenu-title',
|
578 | on: {
|
579 | 'click': this.handleClick,
|
580 | 'mouseenter': this.handleTitleMouseenter,
|
581 | 'mouseleave': this.handleTitleMouseleave
|
582 | },
|
583 |
|
584 | style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }]
|
585 | },
|
586 | [$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })]
|
587 | ), this.isMenuPopup ? popupMenu : inlineMenu]
|
588 | );
|
589 | }
|
590 | });
|
591 |
|
592 | var src_submenuvue_type_script_lang_js_ = (submenuvue_type_script_lang_js_);
|
593 |
|
594 | var componentNormalizer = __webpack_require__(0);
|
595 |
|
596 |
|
597 | var render, staticRenderFns
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 | var component = Object(componentNormalizer["a" ])(
|
605 | src_submenuvue_type_script_lang_js_,
|
606 | render,
|
607 | staticRenderFns,
|
608 | false,
|
609 | null,
|
610 | null,
|
611 | null
|
612 |
|
613 | )
|
614 |
|
615 |
|
616 | if (false) { var api; }
|
617 | component.options.__file = "packages/menu/src/submenu.vue"
|
618 | var submenu = (component.exports);
|
619 |
|
620 |
|
621 |
|
622 |
|
623 | submenu.install = function (Vue) {
|
624 | Vue.component(submenu.name, submenu);
|
625 | };
|
626 |
|
627 | var packages_submenu = __webpack_exports__["default"] = (submenu);
|
628 |
|
629 | }),
|
630 |
|
631 | 28:
|
632 | (function(module, exports) {
|
633 |
|
634 | module.exports = require("element-ui/lib/transitions/collapse-transition");
|
635 |
|
636 | }),
|
637 |
|
638 | 37:
|
639 | (function(module, __webpack_exports__, __webpack_require__) {
|
640 |
|
641 | "use strict";
|
642 | __webpack_exports__["a"] = ({
|
643 | inject: ['rootMenu'],
|
644 | computed: {
|
645 | indexPath: function indexPath() {
|
646 | var path = [this.index];
|
647 | var parent = this.$parent;
|
648 | while (parent.$options.componentName !== 'ElMenu') {
|
649 | if (parent.index) {
|
650 | path.unshift(parent.index);
|
651 | }
|
652 | parent = parent.$parent;
|
653 | }
|
654 | return path;
|
655 | },
|
656 | parentMenu: function parentMenu() {
|
657 | var parent = this.$parent;
|
658 | while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
|
659 | parent = parent.$parent;
|
660 | }
|
661 | return parent;
|
662 | },
|
663 | paddingStyle: function paddingStyle() {
|
664 | if (this.rootMenu.mode !== 'vertical') return {};
|
665 |
|
666 | var padding = 20;
|
667 | var parent = this.$parent;
|
668 |
|
669 | if (this.rootMenu.collapse) {
|
670 | padding = 20;
|
671 | } else {
|
672 | while (parent && parent.$options.componentName !== 'ElMenu') {
|
673 | if (parent.$options.componentName === 'ElSubmenu') {
|
674 | padding += 20;
|
675 | }
|
676 | parent = parent.$parent;
|
677 | }
|
678 | }
|
679 | return { paddingLeft: padding + 'px' };
|
680 | }
|
681 | }
|
682 | });
|
683 |
|
684 | }),
|
685 |
|
686 | 4:
|
687 | (function(module, exports) {
|
688 |
|
689 | module.exports = require("element-ui/lib/mixins/emitter");
|
690 |
|
691 | }),
|
692 |
|
693 | 5:
|
694 | (function(module, exports) {
|
695 |
|
696 | module.exports = require("element-ui/lib/utils/vue-popper");
|
697 |
|
698 | })
|
699 |
|
700 | }); |
\ | No newline at end of file |