element-nice-ui
Version:
A Component Library for Vue.js.
878 lines (811 loc) • 28.2 kB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 189);
/******/ })
/************************************************************************/
/******/ ({
/***/ 189:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
var babel_helper_vue_jsx_merge_props_ = __webpack_require__(30);
var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
// CONCATENATED MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_@vue+compiler-sfc@3.5.18_css-loader@5.2.7_webpack@4.47.0__lodash@4.1_bb9a19950a80e648dc95ba33c71fa343/node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/.pnpm/vue-loader@15.11.1_@vue+compiler-sfc@3.5.18_css-loader@5.2.7_webpack@4.47.0__lodash@4.1_bb9a19950a80e648dc95ba33c71fa343/node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-bar.vue?vue&type=template&id=4c82474e
var render = function render() {
var _vm = this,
_c = _vm._self._c
return _c("div", {
staticClass: "el-tabs__active-bar",
class: `is-${_vm.rootTabs.tabPosition}`,
style: _vm.barStyle,
})
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=template&id=4c82474e
// EXTERNAL MODULE: external "element-nice-ui/lib/utils/util"
var util_ = __webpack_require__(5);
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.4.1_@babel+core@7.28.0_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_@vue+compiler-sfc@3.5.18_css-loader@5.2.7_webpack@4.47.0__lodash@4.1_bb9a19950a80e648dc95ba33c71fa343/node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-bar.vue?vue&type=script&lang=js
/* harmony default export */ var tab_barvue_type_script_lang_js = ({
name: 'TabBar',
props: {
tabs: Array
},
inject: ['rootTabs'],
computed: {
barStyle: {
get() {
let style = {};
let offset = 0;
let tabSize = 0;
const sizeName = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
const sizeDir = sizeName === 'width' ? 'x' : 'y';
const firstUpperCase = str => {
return str.toLowerCase().replace(/( |^)[a-z]/g, L => L.toUpperCase());
};
this.tabs.every((tab, index) => {
let $el = Object(util_["arrayFind"])(this.$parent.$refs.tabs || [], t => t.id.replace('tab-', '') === tab.paneName);
if (!$el) {
return false;
}
if (!tab.active) {
offset += $el["client".concat(firstUpperCase(sizeName))];
return true;
} else {
tabSize = $el["client".concat(firstUpperCase(sizeName))];
const tabStyles = window.getComputedStyle($el);
if (sizeName === 'width' && this.tabs.length > 1) {
tabSize -= parseFloat(tabStyles.paddingLeft) + parseFloat(tabStyles.paddingRight);
}
if (sizeName === 'width') {
offset += parseFloat(tabStyles.paddingLeft);
}
return false;
}
});
const transform = "translate".concat(firstUpperCase(sizeDir), "(").concat(offset, "px)");
style[sizeName] = tabSize + 'px';
style.transform = transform;
style.msTransform = transform;
style.webkitTransform = transform;
return style;
}
}
}
});
// CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=script&lang=js
/* harmony default export */ var src_tab_barvue_type_script_lang_js = (tab_barvue_type_script_lang_js);
// EXTERNAL MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_@vue+compiler-sfc@3.5.18_css-loader@5.2.7_webpack@4.47.0__lodash@4.1_bb9a19950a80e648dc95ba33c71fa343/node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);
// CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
src_tab_barvue_type_script_lang_js,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var tab_bar = (component.exports);
// EXTERNAL MODULE: external "element-nice-ui/lib/utils/resize-event"
var resize_event_ = __webpack_require__(35);
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.4.1_@babel+core@7.28.0_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_@vue+compiler-sfc@3.5.18_css-loader@5.2.7_webpack@4.47.0__lodash@4.1_bb9a19950a80e648dc95ba33c71fa343/node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-nav.vue?vue&type=script&lang=js
function noop() {}
const tab_navvue_type_script_lang_js_firstUpperCase = str => {
return str.toLowerCase().replace(/( |^)[a-z]/g, L => L.toUpperCase());
};
/* harmony default export */ var tab_navvue_type_script_lang_js = ({
name: 'TabNav',
components: {
TabBar: tab_bar
},
inject: ['rootTabs'],
props: {
panes: Array,
currentName: String,
editable: Boolean,
onTabClick: {
type: Function,
default: noop
},
onTabRemove: {
type: Function,
default: noop
},
type: String,
stretch: Boolean
},
data() {
return {
scrollable: false,
navOffset: 0,
isFocus: false,
focusable: true
};
},
computed: {
navStyle() {
const dir = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'X' : 'Y';
return {
transform: "translate".concat(dir, "(-").concat(this.navOffset, "px)")
};
},
sizeName() {
return ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
}
},
methods: {
scrollPrev() {
const containerSize = this.$refs.navScroll["offset".concat(tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName))];
const currentOffset = this.navOffset;
if (!currentOffset) return;
let newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
this.navOffset = newOffset;
},
scrollNext() {
const navSize = this.$refs.nav["offset".concat(tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName))];
const containerSize = this.$refs.navScroll["offset".concat(tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName))];
const currentOffset = this.navOffset;
if (navSize - currentOffset <= containerSize) return;
let newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
this.navOffset = newOffset;
},
scrollToActiveTab() {
if (!this.scrollable) return;
const nav = this.$refs.nav;
const activeTab = this.$el.querySelector('.is-active');
if (!activeTab) return;
const navScroll = this.$refs.navScroll;
const isHorizontal = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1;
const activeTabBounding = activeTab.getBoundingClientRect();
const navScrollBounding = navScroll.getBoundingClientRect();
const maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
const currentOffset = this.navOffset;
let newOffset = currentOffset;
if (isHorizontal) {
if (activeTabBounding.left < navScrollBounding.left) {
newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
}
if (activeTabBounding.right > navScrollBounding.right) {
newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
}
} else {
if (activeTabBounding.top < navScrollBounding.top) {
newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
}
if (activeTabBounding.bottom > navScrollBounding.bottom) {
newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
}
}
newOffset = Math.max(newOffset, 0);
this.navOffset = Math.min(newOffset, maxOffset);
},
update() {
if (!this.$refs.nav) return;
const sizeName = this.sizeName;
const navSize = this.$refs.nav["offset".concat(tab_navvue_type_script_lang_js_firstUpperCase(sizeName))];
const containerSize = this.$refs.navScroll["offset".concat(tab_navvue_type_script_lang_js_firstUpperCase(sizeName))];
const currentOffset = this.navOffset;
if (containerSize < navSize) {
const currentOffset = this.navOffset;
this.scrollable = this.scrollable || {};
this.scrollable.prev = currentOffset;
this.scrollable.next = currentOffset + containerSize < navSize;
if (navSize - currentOffset < containerSize) {
this.navOffset = navSize - containerSize;
}
} else {
this.scrollable = false;
if (currentOffset > 0) {
this.navOffset = 0;
}
}
},
changeTab(e) {
const keyCode = e.keyCode;
let nextIndex;
let currentIndex, tabList;
if ([37, 38, 39, 40].indexOf(keyCode) !== -1) {
// 左右上下键更换tab
tabList = e.currentTarget.querySelectorAll('[role=tab]');
currentIndex = Array.prototype.indexOf.call(tabList, e.target);
} else {
return;
}
if (keyCode === 37 || keyCode === 38) {
// left
if (currentIndex === 0) {
// first
nextIndex = tabList.length - 1;
} else {
nextIndex = currentIndex - 1;
}
} else {
// right
if (currentIndex < tabList.length - 1) {
// not last
nextIndex = currentIndex + 1;
} else {
nextIndex = 0;
}
}
tabList[nextIndex].focus(); // 改变焦点元素
tabList[nextIndex].click(); // 选中下一个tab
this.setFocus();
},
setFocus() {
if (this.focusable) {
this.isFocus = true;
}
},
removeFocus() {
this.isFocus = false;
},
visibilityChangeHandler() {
const visibility = document.visibilityState;
if (visibility === 'hidden') {
this.focusable = false;
} else if (visibility === 'visible') {
setTimeout(() => {
this.focusable = true;
}, 50);
}
},
windowBlurHandler() {
this.focusable = false;
},
windowFocusHandler() {
setTimeout(() => {
this.focusable = true;
}, 50);
}
},
updated() {
this.update();
},
render(h) {
const {
type,
panes,
editable,
stretch,
onTabClick,
onTabRemove,
navStyle,
scrollable,
scrollNext,
scrollPrev,
changeTab,
setFocus,
removeFocus
} = this;
const scrollBtn = scrollable ? [h("span", {
"class": ['el-tabs__nav-prev', scrollable.prev ? '' : 'is-disabled'],
"on": {
"click": scrollPrev
}
}, [h("i", {
"class": "el-icon-arrow-left"
})]), h("span", {
"class": ['el-tabs__nav-next', scrollable.next ? '' : 'is-disabled'],
"on": {
"click": scrollNext
}
}, [h("i", {
"class": "el-icon-arrow-right"
})])] : null;
const tabs = this._l(panes, (pane, index) => {
let tabName = pane.name || pane.index || index;
const closable = pane.isClosable || editable;
pane.index = "".concat(index);
const btnClose = closable ? h("span", {
"class": "el-icon-close",
"on": {
"click": ev => {
onTabRemove(pane, ev);
}
}
}) : null;
const tabLabelContent = pane.$slots.label || pane.label;
const tabindex = pane.active ? 0 : -1;
return h("div", {
"class": {
'el-tabs__item': true,
["is-".concat(this.rootTabs.tabPosition)]: true,
'is-active': pane.active,
'is-disabled': pane.disabled,
'is-closable': closable,
'is-focus': this.isFocus
},
"attrs": {
"id": "tab-".concat(tabName),
"aria-controls": "pane-".concat(tabName),
"role": "tab",
"aria-selected": pane.active,
"tabindex": tabindex
},
"key": "tab-".concat(tabName),
"ref": "tabs",
"refInFor": true,
"on": {
"focus": () => {
setFocus();
},
"blur": () => {
removeFocus();
},
"click": ev => {
removeFocus();
onTabClick(pane, tabName, ev);
},
"keydown": ev => {
if (closable && (ev.keyCode === 46 || ev.keyCode === 8)) {
onTabRemove(pane, ev);
}
}
}
}, [tabLabelContent, btnClose]);
});
return h("div", {
"class": ['el-tabs__nav-wrap', scrollable ? 'is-scrollable' : '', "is-".concat(this.rootTabs.tabPosition)]
}, [scrollBtn, h("div", {
"class": ['el-tabs__nav-scroll'],
"ref": "navScroll"
}, [h("div", {
"class": ['el-tabs__nav', "is-".concat(this.rootTabs.tabPosition), stretch && ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'is-stretch' : ''],
"ref": "nav",
"style": navStyle,
"attrs": {
"role": "tablist"
},
"on": {
"keydown": changeTab
}
}, [!type ? h("tab-bar", {
"attrs": {
"tabs": panes
}
}) : null, tabs])])]);
},
mounted() {
Object(resize_event_["addResizeListener"])(this.$el, this.update);
document.addEventListener('visibilitychange', this.visibilityChangeHandler);
window.addEventListener('blur', this.windowBlurHandler);
window.addEventListener('focus', this.windowFocusHandler);
setTimeout(() => {
this.scrollToActiveTab();
}, 0);
},
beforeDestroy() {
if (this.$el && this.update) Object(resize_event_["removeResizeListener"])(this.$el, this.update);
document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
window.removeEventListener('blur', this.windowBlurHandler);
window.removeEventListener('focus', this.windowFocusHandler);
}
});
// CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue?vue&type=script&lang=js
/* harmony default export */ var src_tab_navvue_type_script_lang_js = (tab_navvue_type_script_lang_js);
// CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue
var tab_nav_render, tab_nav_staticRenderFns
/* normalize component */
var tab_nav_component = Object(componentNormalizer["a" /* default */])(
src_tab_navvue_type_script_lang_js,
tab_nav_render,
tab_nav_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var tab_nav = (tab_nav_component.exports);
// EXTERNAL MODULE: external "element-nice-ui/lib/perfect-scrollbar"
var perfect_scrollbar_ = __webpack_require__(47);
var perfect_scrollbar_default = /*#__PURE__*/__webpack_require__.n(perfect_scrollbar_);
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.4.1_@babel+core@7.28.0_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_@vue+compiler-sfc@3.5.18_css-loader@5.2.7_webpack@4.47.0__lodash@4.1_bb9a19950a80e648dc95ba33c71fa343/node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tabs.vue?vue&type=script&lang=jsx
/* harmony default export */ var tabsvue_type_script_lang_jsx = ({
name: 'ElTabs',
components: {
TabNav: tab_nav,
ElPerfectScrollbar: perfect_scrollbar_default.a
},
props: {
type: String,
activeName: String,
closable: Boolean,
addable: Boolean,
value: {},
editable: Boolean,
tabPosition: {
type: String,
default: 'top'
},
beforeLeave: Function,
stretch: Boolean,
height: String
},
provide() {
return {
rootTabs: this
};
},
data() {
return {
currentName: this.value || this.activeName,
panes: [],
observerConfig: {
subtree: true,
attributeFilter: ['aria-hidden']
}
};
},
watch: {
activeName(value) {
this.setCurrentName(value);
},
value(value) {
this.setCurrentName(value);
},
currentName(value) {
if (this.$refs.nav) {
this.$nextTick(() => {
this.$refs.nav.$nextTick(_ => {
this.$refs.nav.scrollToActiveTab();
});
});
}
}
},
methods: {
calcPaneInstances() {
let isForceUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (this.$slots.default) {
const paneSlots = this.$slots.default.filter(vnode => vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane');
// update indeed
const panes = paneSlots.map(_ref => {
let {
componentInstance
} = _ref;
return componentInstance;
});
const panesChanged = !(panes.length === this.panes.length && panes.every((pane, index) => pane === this.panes[index]));
if (isForceUpdate || panesChanged) {
this.panes = panes;
}
} else if (this.panes.length !== 0) {
this.panes = [];
}
},
handleTabClick(tab, tabName, event) {
if (tab.disabled) return;
this.setCurrentName(tabName);
this.$emit('tab-click', tab, event);
},
handleTabRemove(pane, ev) {
if (pane.disabled) return;
ev.stopPropagation();
this.$emit('edit', pane.name, 'remove');
this.$emit('tab-remove', pane.name);
},
handleTabAdd() {
this.$emit('edit', null, 'add');
this.$emit('tab-add');
},
setCurrentName(value) {
const changeCurrentName = () => {
this.currentName = value;
this.$emit('input', value);
};
if (this.currentName !== value && this.beforeLeave) {
const before = this.beforeLeave(value, this.currentName);
if (before && before.then) {
before.then(() => {
changeCurrentName();
this.$refs.nav && this.$refs.nav.removeFocus();
}, () => {
// https://github.com/ElemeFE/element/pull/14816
// ignore promise rejection in `before-leave` hook
});
} else if (before !== false) {
changeCurrentName();
}
} else {
changeCurrentName();
}
}
},
render(h) {
let {
type,
handleTabClick,
handleTabRemove,
handleTabAdd,
currentName,
panes,
editable,
addable,
tabPosition,
stretch,
height,
observerConfig
} = this;
const newButton = editable || addable ? h("span", {
"class": "el-tabs__new-tab",
"on": {
"click": handleTabAdd,
"keydown": ev => {
if (ev.keyCode === 13) {
handleTabAdd();
}
}
},
"attrs": {
"tabindex": "0"
}
}, [h("i", {
"class": "el-icon-plus"
})]) : null;
const navData = {
props: {
currentName,
onTabClick: handleTabClick,
onTabRemove: handleTabRemove,
editable,
type,
panes,
stretch
},
ref: 'nav'
};
const header = h("div", {
"class": ['el-tabs__header', "is-".concat(tabPosition)]
}, [newButton, h("tab-nav", babel_helper_vue_jsx_merge_props_default()([{}, navData]))]);
const panels = h("el-perfect-scrollbar", {
"attrs": {
"observer-config": observerConfig,
"tag": "div"
},
"style": {
height
},
"class": "el-tabs__content"
}, [this.$slots.default]);
return h("div", {
"class": {
'el-tabs': true,
'el-tabs--card': type === 'card',
["el-tabs--".concat(tabPosition)]: true,
'el-tabs--border-card': type === 'border-card'
}
}, [tabPosition !== 'bottom' ? [header, panels] : [panels, header]]);
},
created() {
if (!this.currentName) {
this.setCurrentName('0');
}
this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
},
mounted() {
this.calcPaneInstances();
},
updated() {
this.calcPaneInstances();
}
});
// CONCATENATED MODULE: ./packages/tabs/src/tabs.vue?vue&type=script&lang=jsx
/* harmony default export */ var src_tabsvue_type_script_lang_jsx = (tabsvue_type_script_lang_jsx);
// CONCATENATED MODULE: ./packages/tabs/src/tabs.vue
var tabs_render, tabs_staticRenderFns
/* normalize component */
var tabs_component = Object(componentNormalizer["a" /* default */])(
src_tabsvue_type_script_lang_jsx,
tabs_render,
tabs_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var tabs = (tabs_component.exports);
// CONCATENATED MODULE: ./packages/tabs/index.js
/* istanbul ignore next */
tabs.install = function (Vue) {
Vue.component(tabs.name, tabs);
};
/* harmony default export */ var packages_tabs = __webpack_exports__["default"] = (tabs);
/***/ }),
/***/ 2:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
function normalizeComponent(
scriptExports,
render,
staticRenderFns,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier /* server only */,
shadowMode /* vue-cli only */
) {
// Vue.extend constructor export interop
var options =
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
// render functions
if (render) {
options.render = render
options.staticRenderFns = staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 'data-v-' + scopeId
}
var hook
if (moduleIdentifier) {
// server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () {
injectStyles.call(
this,
(options.functional ? this.parent : this).$root.$options.shadowRoot
)
}
: injectStyles
}
if (hook) {
if (options.functional) {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functional component in vue file
var originalRender = options.render
options.render = function renderWithStyleInjection(h, context) {
hook.call(context)
return originalRender(h, context)
}
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
}
}
return {
exports: scriptExports,
options: options
}
}
/***/ }),
/***/ 30:
/***/ (function(module, exports) {
module.exports = require("@vue/babel-helper-vue-jsx-merge-props");
/***/ }),
/***/ 35:
/***/ (function(module, exports) {
module.exports = require("element-nice-ui/lib/utils/resize-event");
/***/ }),
/***/ 47:
/***/ (function(module, exports) {
module.exports = require("element-nice-ui/lib/perfect-scrollbar");
/***/ }),
/***/ 5:
/***/ (function(module, exports) {
module.exports = require("element-nice-ui/lib/utils/util");
/***/ })
/******/ });