mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-05-06 22:57:57 +08:00
549 lines
13 KiB
JavaScript
549 lines
13 KiB
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] = {
|
|
/******/ exports: {},
|
|
/******/ id: moduleId,
|
|
/******/ loaded: false
|
|
/******/ };
|
|
|
|
/******/ // Execute the module function
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
|
|
/******/ // Flag the module as loaded
|
|
/******/ module.loaded = 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;
|
|
|
|
/******/ // __webpack_public_path__
|
|
/******/ __webpack_require__.p = "/dist/";
|
|
|
|
/******/ // Load entry module and return exports
|
|
/******/ return __webpack_require__(0);
|
|
/******/ })
|
|
/************************************************************************/
|
|
/******/ ({
|
|
|
|
/***/ 0:
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
module.exports = __webpack_require__(160);
|
|
|
|
|
|
/***/ },
|
|
|
|
/***/ 3:
|
|
/***/ function(module, exports) {
|
|
|
|
module.exports = function normalizeComponent (
|
|
rawScriptExports,
|
|
compiledTemplate,
|
|
scopeId,
|
|
cssModules
|
|
) {
|
|
var esModule
|
|
var scriptExports = rawScriptExports = rawScriptExports || {}
|
|
|
|
// ES6 modules interop
|
|
var type = typeof rawScriptExports.default
|
|
if (type === 'object' || type === 'function') {
|
|
esModule = rawScriptExports
|
|
scriptExports = rawScriptExports.default
|
|
}
|
|
|
|
// Vue.extend constructor export interop
|
|
var options = typeof scriptExports === 'function'
|
|
? scriptExports.options
|
|
: scriptExports
|
|
|
|
// render functions
|
|
if (compiledTemplate) {
|
|
options.render = compiledTemplate.render
|
|
options.staticRenderFns = compiledTemplate.staticRenderFns
|
|
}
|
|
|
|
// scopedId
|
|
if (scopeId) {
|
|
options._scopeId = scopeId
|
|
}
|
|
|
|
// inject cssModules
|
|
if (cssModules) {
|
|
var computed = options.computed || (options.computed = {})
|
|
Object.keys(cssModules).forEach(function (key) {
|
|
var module = cssModules[key]
|
|
computed[key] = function () { return module }
|
|
})
|
|
}
|
|
|
|
return {
|
|
esModule: esModule,
|
|
exports: scriptExports,
|
|
options: options
|
|
}
|
|
}
|
|
|
|
|
|
/***/ },
|
|
|
|
/***/ 14:
|
|
/***/ function(module, exports) {
|
|
|
|
module.exports = require("element-ui/lib/mixins/emitter");
|
|
|
|
/***/ },
|
|
|
|
/***/ 160:
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
exports.__esModule = true;
|
|
|
|
var _input = __webpack_require__(161);
|
|
|
|
var _input2 = _interopRequireDefault(_input);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
/* istanbul ignore next */
|
|
_input2.default.install = function (Vue) {
|
|
Vue.component(_input2.default.name, _input2.default);
|
|
};
|
|
|
|
exports.default = _input2.default;
|
|
|
|
/***/ },
|
|
|
|
/***/ 161:
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
var Component = __webpack_require__(3)(
|
|
/* script */
|
|
__webpack_require__(162),
|
|
/* template */
|
|
__webpack_require__(165),
|
|
/* scopeId */
|
|
null,
|
|
/* cssModules */
|
|
null
|
|
)
|
|
|
|
module.exports = Component.exports
|
|
|
|
|
|
/***/ },
|
|
|
|
/***/ 162:
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
exports.__esModule = true;
|
|
|
|
var _emitter = __webpack_require__(14);
|
|
|
|
var _emitter2 = _interopRequireDefault(_emitter);
|
|
|
|
var _calcTextareaHeight = __webpack_require__(163);
|
|
|
|
var _calcTextareaHeight2 = _interopRequireDefault(_calcTextareaHeight);
|
|
|
|
var _merge = __webpack_require__(164);
|
|
|
|
var _merge2 = _interopRequireDefault(_merge);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
exports.default = {
|
|
name: 'ElInput',
|
|
|
|
componentName: 'ElInput',
|
|
|
|
mixins: [_emitter2.default],
|
|
|
|
data: function data() {
|
|
return {
|
|
currentValue: this.value,
|
|
textareaCalcStyle: {}
|
|
};
|
|
},
|
|
|
|
|
|
props: {
|
|
value: [String, Number],
|
|
placeholder: String,
|
|
size: String,
|
|
resize: String,
|
|
readonly: Boolean,
|
|
autofocus: Boolean,
|
|
icon: String,
|
|
disabled: Boolean,
|
|
type: {
|
|
type: String,
|
|
default: 'text'
|
|
},
|
|
name: String,
|
|
autosize: {
|
|
type: [Boolean, Object],
|
|
default: false
|
|
},
|
|
rows: {
|
|
type: Number,
|
|
default: 2
|
|
},
|
|
autoComplete: {
|
|
type: String,
|
|
default: 'off'
|
|
},
|
|
form: String,
|
|
maxlength: Number,
|
|
minlength: Number,
|
|
max: {},
|
|
min: {},
|
|
step: {},
|
|
validateEvent: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
onIconClick: Function
|
|
},
|
|
|
|
computed: {
|
|
validating: function validating() {
|
|
return this.$parent.validateState === 'validating';
|
|
},
|
|
textareaStyle: function textareaStyle() {
|
|
return (0, _merge2.default)({}, this.textareaCalcStyle, { resize: this.resize });
|
|
}
|
|
},
|
|
|
|
watch: {
|
|
'value': function value(val, oldValue) {
|
|
this.setCurrentValue(val);
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
handleBlur: function handleBlur(event) {
|
|
this.$emit('blur', event);
|
|
if (this.validateEvent) {
|
|
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
|
|
}
|
|
},
|
|
inputSelect: function inputSelect() {
|
|
this.$refs.input.select();
|
|
},
|
|
resizeTextarea: function resizeTextarea() {
|
|
if (this.$isServer) return;
|
|
var autosize = this.autosize,
|
|
type = this.type;
|
|
|
|
if (!autosize || type !== 'textarea') return;
|
|
var minRows = autosize.minRows;
|
|
var maxRows = autosize.maxRows;
|
|
|
|
this.textareaCalcStyle = (0, _calcTextareaHeight2.default)(this.$refs.textarea, minRows, maxRows);
|
|
},
|
|
handleFocus: function handleFocus(event) {
|
|
this.$emit('focus', event);
|
|
},
|
|
handleInput: function handleInput(event) {
|
|
var value = event.target.value;
|
|
this.$emit('input', value);
|
|
this.setCurrentValue(value);
|
|
this.$emit('change', value);
|
|
},
|
|
handleIconClick: function handleIconClick(event) {
|
|
if (this.onIconClick) {
|
|
this.onIconClick(event);
|
|
}
|
|
this.$emit('click', event);
|
|
},
|
|
setCurrentValue: function setCurrentValue(value) {
|
|
var _this = this;
|
|
|
|
if (value === this.currentValue) return;
|
|
this.$nextTick(function (_) {
|
|
_this.resizeTextarea();
|
|
});
|
|
this.currentValue = value;
|
|
if (this.validateEvent) {
|
|
this.dispatch('ElFormItem', 'el.form.change', [value]);
|
|
}
|
|
}
|
|
},
|
|
|
|
created: function created() {
|
|
this.$on('inputSelect', this.inputSelect);
|
|
},
|
|
mounted: function mounted() {
|
|
this.resizeTextarea();
|
|
}
|
|
}; //
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
|
|
/***/ },
|
|
|
|
/***/ 163:
|
|
/***/ function(module, exports) {
|
|
|
|
'use strict';
|
|
|
|
exports.__esModule = true;
|
|
exports.default = calcTextareaHeight;
|
|
var hiddenTextarea = void 0;
|
|
|
|
var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
|
|
|
|
var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
|
|
|
|
function calculateNodeStyling(node) {
|
|
var style = window.getComputedStyle(node);
|
|
|
|
var boxSizing = style.getPropertyValue('box-sizing');
|
|
|
|
var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
|
|
|
|
var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
|
|
|
|
var contextStyle = CONTEXT_STYLE.map(function (name) {
|
|
return name + ':' + style.getPropertyValue(name);
|
|
}).join(';');
|
|
|
|
return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
|
|
}
|
|
|
|
function calcTextareaHeight(targetNode) {
|
|
var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
|
|
if (!hiddenTextarea) {
|
|
hiddenTextarea = document.createElement('textarea');
|
|
document.body.appendChild(hiddenTextarea);
|
|
}
|
|
|
|
var _calculateNodeStyling = calculateNodeStyling(targetNode),
|
|
paddingSize = _calculateNodeStyling.paddingSize,
|
|
borderSize = _calculateNodeStyling.borderSize,
|
|
boxSizing = _calculateNodeStyling.boxSizing,
|
|
contextStyle = _calculateNodeStyling.contextStyle;
|
|
|
|
hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
|
|
hiddenTextarea.value = targetNode.value || targetNode.placeholder || '';
|
|
|
|
var height = hiddenTextarea.scrollHeight;
|
|
|
|
if (boxSizing === 'border-box') {
|
|
height = height + borderSize;
|
|
} else if (boxSizing === 'content-box') {
|
|
height = height - paddingSize;
|
|
}
|
|
|
|
hiddenTextarea.value = '';
|
|
var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
|
|
|
|
if (minRows !== null) {
|
|
var minHeight = singleRowHeight * minRows;
|
|
if (boxSizing === 'border-box') {
|
|
minHeight = minHeight + paddingSize + borderSize;
|
|
}
|
|
height = Math.max(minHeight, height);
|
|
}
|
|
if (maxRows !== null) {
|
|
var maxHeight = singleRowHeight * maxRows;
|
|
if (boxSizing === 'border-box') {
|
|
maxHeight = maxHeight + paddingSize + borderSize;
|
|
}
|
|
height = Math.min(maxHeight, height);
|
|
}
|
|
|
|
return { height: height + 'px' };
|
|
};
|
|
|
|
/***/ },
|
|
|
|
/***/ 164:
|
|
/***/ function(module, exports) {
|
|
|
|
module.exports = require("element-ui/lib/utils/merge");
|
|
|
|
/***/ },
|
|
|
|
/***/ 165:
|
|
/***/ function(module, exports) {
|
|
|
|
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
|
|
return _c('div', {
|
|
class: [
|
|
_vm.type === 'textarea' ? 'el-textarea' : 'el-input',
|
|
_vm.size ? 'el-input--' + _vm.size : '', {
|
|
'is-disabled': _vm.disabled,
|
|
'el-input-group': _vm.$slots.prepend || _vm.$slots.append,
|
|
'el-input-group--append': _vm.$slots.append,
|
|
'el-input-group--prepend': _vm.$slots.prepend
|
|
}
|
|
]
|
|
}, [(_vm.type !== 'textarea') ? [(_vm.$slots.prepend) ? _c('div', {
|
|
staticClass: "el-input-group__prepend"
|
|
}, [_vm._t("prepend")], 2) : _vm._e(), _vm._t("icon", [(_vm.icon) ? _c('i', {
|
|
staticClass: "el-input__icon",
|
|
class: [
|
|
'el-icon-' + _vm.icon,
|
|
_vm.onIconClick ? 'is-clickable' : ''
|
|
],
|
|
on: {
|
|
"click": _vm.handleIconClick
|
|
}
|
|
}) : _vm._e()]), (_vm.type !== 'textarea') ? _c('input', {
|
|
ref: "input",
|
|
staticClass: "el-input__inner",
|
|
attrs: {
|
|
"type": _vm.type,
|
|
"name": _vm.name,
|
|
"placeholder": _vm.placeholder,
|
|
"disabled": _vm.disabled,
|
|
"readonly": _vm.readonly,
|
|
"maxlength": _vm.maxlength,
|
|
"minlength": _vm.minlength,
|
|
"autocomplete": _vm.autoComplete,
|
|
"autofocus": _vm.autofocus,
|
|
"min": _vm.min,
|
|
"max": _vm.max,
|
|
"step": _vm.step,
|
|
"form": _vm.form
|
|
},
|
|
domProps: {
|
|
"value": _vm.currentValue
|
|
},
|
|
on: {
|
|
"input": _vm.handleInput,
|
|
"focus": _vm.handleFocus,
|
|
"blur": _vm.handleBlur
|
|
}
|
|
}) : _vm._e(), (_vm.validating) ? _c('i', {
|
|
staticClass: "el-input__icon el-icon-loading"
|
|
}) : _vm._e(), (_vm.$slots.append) ? _c('div', {
|
|
staticClass: "el-input-group__append"
|
|
}, [_vm._t("append")], 2) : _vm._e()] : _c('textarea', {
|
|
ref: "textarea",
|
|
staticClass: "el-textarea__inner",
|
|
style: (_vm.textareaStyle),
|
|
attrs: {
|
|
"name": _vm.name,
|
|
"placeholder": _vm.placeholder,
|
|
"disabled": _vm.disabled,
|
|
"readonly": _vm.readonly,
|
|
"rows": _vm.rows,
|
|
"form": _vm.form,
|
|
"autofocus": _vm.autofocus,
|
|
"maxlength": _vm.maxlength,
|
|
"minlength": _vm.minlength
|
|
},
|
|
domProps: {
|
|
"value": _vm.currentValue
|
|
},
|
|
on: {
|
|
"input": _vm.handleInput,
|
|
"focus": _vm.handleFocus,
|
|
"blur": _vm.handleBlur
|
|
}
|
|
})], 2)
|
|
},staticRenderFns: []}
|
|
|
|
/***/ }
|
|
|
|
/******/ }); |