123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549 |
- 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: []}
- /***/ }
- /******/ });
|