wot-design
Version:
Mobile UI components built on vue.js
393 lines (357 loc) • 12.9 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 = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 117);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (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, 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 functioal 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
}
}
/***/ }),
/***/ 117:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js
var helper = __webpack_require__(49);
var helper_default = /*#__PURE__*/__webpack_require__.n(helper);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tag/src/main.vue?vue&type=script&lang=js&
/* harmony default export */ var mainvue_type_script_lang_js_ = ({
name: 'WdTag',
props: {
type: String,
icon: String,
closable: Boolean,
plain: Boolean,
round: Boolean,
mark: Boolean,
dynamic: Boolean,
color: String,
bgColor: String,
disableTransition: Boolean
},
data: function data() {
return {
dynamicValue: '',
dynamicInput: false
};
},
computed: {
tagClass: function tagClass() {
var tagClass = ['wd-tag'];
this.type && tagClass.push("is-".concat(this.type));
this.plain && tagClass.push('is-plain');
this.round && tagClass.push('is-round');
this.mark && tagClass.push('is-mark');
return tagClass;
}
},
methods: {
handleClick: function handleClick() {
this.$emit('click');
},
handleClose: function handleClose(event) {
event.stopPropagation();
this.$emit('close');
},
handleBlur: function handleBlur() {
this.setDynamicInput();
},
handleConfirm: function handleConfirm(event) {
if (event.keyCode === 13) {
this.setDynamicInput();
this.$emit('confirm', this.dynamicValue);
}
},
setDynamicInput: function setDynamicInput() {
this.dynamicInput = false;
},
handleAdd: function handleAdd() {
var _this = this;
this.dynamicInput = true;
this.dynamicValue = '';
this.$nextTick(function () {
_this.$refs.addText.focus();
});
}
},
render: function render(h) {
var _this2 = this;
var Icon = this.$slots.icon ? this.$slots.icon : this.icon ? h("i", {
"class": ['wd-tag__icon', this.icon]
}) : '';
var Content = !this.dynamic ? h("div", {
"class": "wd-tag__text-container"
}, [h("span", {
"class": ['wd-tag__text', this.round || this.icon ? '' : 'wd-tag__text-hidden']
}, [this.$slots.default]), h("span", {
"directives": [{
name: "show",
value: !this.round && !this.icon
}],
"class": "wd-tag__text wd-tag__text-real",
"style": {
color: this.color
}
}, [this.$slots.default])]) : this.dynamicInput ? h("input", helper_default()([{
"on": {
"input": function input($event) {
if ($event.target.composing) return;
_this2.dynamicValue = $event.target.value;
},
"blur": this.handleBlur,
"keypress": this.handleConfirm
},
"ref": "addText",
"class": "wd-tag__add-text",
"attrs": {
"type": "text",
"autofocus": true,
"placeholder": "请输入"
},
"domProps": {
"value": _this2.dynamicValue
}
}, {
directives: [{
name: "model",
value: _this2.dynamicValue,
modifiers: {}
}]
}])) : h("span", {
"class": "wd-tag__text",
"style": {
color: this.color
},
"on": {
"click": this.handleAdd
}
}, [h("i", {
"class": "wd-tag__add wd-icon-add"
}), "\u65B0\u589E\u6807\u7B7E"]);
var Tag = h("div", {
"class": [this.tagClass, {
'is-icon': Icon,
'is-dynamic': this.dynamic,
'is-dynamic-input': this.dynamicInput
}],
"style": {
background: !this.plain && this.bgColor,
borderColor: this.bgColor
},
"on": {
"click": this.handleClick
}
}, [Icon, Content, this.closable && this.round ? h("i", {
"class": "wd-tag__close wd-icon-error-fill",
"on": {
"click": this.handleClose
}
}) : '']);
return this.disableTransition ? Tag : h("transition", {
"attrs": {
"name": "wd-fade"
}
}, [Tag]);
}
});
// CONCATENATED MODULE: ./packages/tag/src/main.vue?vue&type=script&lang=js&
/* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./packages/tag/src/main.vue
var main_render, staticRenderFns
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
src_mainvue_type_script_lang_js_,
main_render,
staticRenderFns,
false,
null,
null,
null
)
/* hot reload */
if (false) { var api; }
component.options.__file = "packages/tag/src/main.vue"
/* harmony default export */ var main = (component.exports);
// CONCATENATED MODULE: ./packages/tag/index.js
main.install = function (Vue) {
Vue.component(main.name, main);
};
/* harmony default export */ var tag = __webpack_exports__["default"] = (main);
/***/ }),
/***/ 49:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(a){return a.reduce(function(c,a){for(var b in a)if(!c[b])c[b]=a[b];else if(-1!==normalMerge.indexOf(b))c[b]=_extends({},c[b],a[b]);else if(-1!==toArrayMerge.indexOf(b)){var d=c[b]instanceof Array?c[b]:[c[b]],e=a[b]instanceof Array?a[b]:[a[b]];c[b]=d.concat(e)}else if(-1!==functionalMerge.indexOf(b)){for(var f in a[b])if(c[b][f]){var g=c[b][f]instanceof Array?c[b][f]:[c[b][f]],h=a[b][f]instanceof Array?a[b][f]:[a[b][f]];c[b][f]=g.concat(h)}else c[b][f]=a[b][f];}else if("hook"==b)for(var i in a[b])c[b][i]=c[b][i]?mergeFn(c[b][i],a[b][i]):a[b][i];else c[b]=a[b];return c},{})},mergeFn=function(a,b){return function(){a&&a.apply(this,arguments),b&&b.apply(this,arguments)}};module.exports=mergeJsxProps;
/***/ })
/******/ });