UNPKG

aos-element

Version:

A Component Library for Vue.js.

1,082 lines (1,049 loc) 144 kB
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 = 38); /******/ }) /************************************************************************/ /******/ ({ /***/ 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, (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 } } /***/ }), /***/ 20: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addResizeListener; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeResizeListener; }); /* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27); /* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var throttle_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21); /* harmony import */ var throttle_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(throttle_debounce__WEBPACK_IMPORTED_MODULE_1__); var isServer = typeof window === 'undefined'; /* istanbul ignore next */ var resizeHandler = function resizeHandler(entries) { for (var _iterator = entries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var entry = _ref; var listeners = entry.target.__resizeListeners__ || []; if (listeners.length) { listeners.forEach(function (fn) { fn(); }); } } }; /* istanbul ignore next */ var addResizeListener = function addResizeListener(element, fn) { if (isServer) return; if (!element.__resizeListeners__) { element.__resizeListeners__ = []; element.__ro__ = new resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_0___default.a(Object(throttle_debounce__WEBPACK_IMPORTED_MODULE_1__["debounce"])(10, resizeHandler)); element.__ro__.observe(element); } element.__resizeListeners__.push(fn); }; /* istanbul ignore next */ var removeResizeListener = function removeResizeListener(element, fn) { if (!element || !element.__resizeListeners__) return; element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { element.__ro__.disconnect(); } }; /***/ }), /***/ 21: /***/ (function(module, exports) { module.exports = require("throttle-debounce"); /***/ }), /***/ 27: /***/ (function(module, exports) { module.exports = require("resize-observer-polyfill"); /***/ }), /***/ 38: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/aos-form/src/main.vue?vue&type=template&id=9663e1da& var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { ref: "formContainer", staticClass: "aos-form" }, [ _c( "el-form", { ref: "form", staticClass: "aos-form clearfix", staticStyle: { width: "100%" }, attrs: { model: _vm.copyData, rules: _vm.formRules, edit: _vm.edit, "label-position": _vm.labelPosition, "label-width": _vm.labelWidth } }, _vm._l(_vm.copyFormTemplate, function(item, index) { return _c( "el-form-item", { key: item.prop, staticClass: "aos-form-item", class: { "aos-form-item-sm": _vm.formItemSm, "aos-form-item-md": _vm.formItemMd, "aos-form-item-xl": _vm.formItemXl, "aos-form-item-lg": _vm.formItemLg, "aos-form-item-hlg": _vm.formItemHLg }, style: "width:" + item.width, attrs: { title: item.label, label: item.label, rules: item.rules, required: item.required || false, "label-width": "130px", prop: item.prop } }, [ item.type === "input" || "" || undefined ? [ _vm.edit ? _c( "el-input", { ref: item.prop + "-ref", refInFor: true, style: { width: (item.attrs && item.attrs.width) || "" }, attrs: { title: _vm.copyData[item.prop], type: (item.attrs && item.attrs.type) || "text", minlength: (item.attrs && item.attrs.minlength) || 0, maxlength: (item.attrs && item.attrs.maxlength) || 10000, placeholder: (item.attrs && item.attrs.placeholder) || "请在此输入", clearable: !item.attrs || (item.attrs && item.attrs.clearable !== false), size: (item.attrs && item.attrs.size) || "small", disabled: (item.attrs && item.attrs.disabled) || false, "show-word-limit": (item.attrs && item.attrs.showWordLimit) || false, "show-password": (item.attrs && item.attrs.showPassword) || false, readonly: item.attrs && item.attrs.readonly, max: item.attrs && item.attrs.max, min: item.attrs && item.attrs.min, step: item.attrs && item.attrs.step, resize: item.attrs && item.attrs.resize, autofocus: (item.attrs && item.attrs.autofocus) || false, "validate-event": (item.attrs && item.attrs.validateEvent) || true, "text-align": (item.attrs && item.attrs.textAlign) || "left", "data-can-copy": item.attrs && item.attrs.dataCanCopy }, on: { blur: function($event) { _vm.formHandleEmit(item, "blur") }, change: function($event) { _vm.formHandleEmit(item, "change") }, input: function($event) { _vm.formHandleEmit(item, "input") }, focus: function($event) { _vm.formHandleEmit(item, "focus") }, clear: function($event) { _vm.formHandleEmit(item, "clear") } }, model: { value: _vm.copyData[item.prop], callback: function($$v) { _vm.$set( _vm.copyData, item.prop, typeof $$v === "string" ? $$v.trim() : $$v ) }, expression: "copyData[item.prop]" } }, [ item.attrs && (item.attrs.suffixString || item.attrs.buttonString || item.attrs.secondButtonString || item.attrs.countTime || item.attrs.icon || item.attrs.ocrType) ? [ _c( "div", { attrs: { slot: "append" }, slot: "append" }, [ item.attrs.suffixString ? _c( "div", { staticClass: "aos-form-input-append", on: { click: function($event) { _vm.formHandleEmit( item, "suffix" ) } } }, [ _vm._v( "\n " + _vm._s( item.attrs.suffixString ? item.attrs.suffixString : "" ) + "\n " ) ] ) : _vm._e(), item.attrs.icon ? _c( "span", { staticStyle: { cursor: "pointer" }, style: { "margin-left": item.attrs .suffixString ? "8px" : "0px", color: item.attrs && item.attrs.iconActive ? "#409EFF" : "#909399" }, attrs: { type: "primary", title: item.attrs.iconTitle }, on: { click: function($event) { _vm.formHandleEmit( item, "icon" ) } } }, [ _c("i", { class: "el-icon-" + item.attrs.icon }) ] ) : _vm._e(), item.attrs.buttonString ? _c( "span", { staticStyle: { color: "#409EFF", cursor: "pointer" }, style: { "margin-left": item.attrs.icon ? "8px" : "0px" }, attrs: { title: item.attrs.buttonString, type: "primary" }, on: { click: function($event) { _vm.formHandleEmit( item, "button" ) } } }, [ _vm._v( "\n " + _vm._s( item.attrs.buttonString ? item.attrs.buttonString : "" ) + "\n " ) ] ) : _vm._e(), item.attrs.secondButtonString ? _c( "span", { staticStyle: { color: "#409EFF", "border-left": "1px solid #eee", cursor: "pointer" }, attrs: { title: item.attrs.secondButtonString, type: "primary" }, on: { click: function($event) { _vm.formHandleEmit( item, "second-button" ) } } }, [ _vm._v( "\n " + _vm._s( item.attrs .secondButtonString ? item.attrs .secondButtonString : "" ) + "\n " ) ] ) : _vm._e(), item.attrs.countTime ? _c("aos-count-time", { ref: item.prop + "-count-time-ref", refInFor: true, attrs: { time: item.attrs.countTime.time, "count-name": item.attrs.countTime.countName, "default-name": item.attrs.countTime .defaultName, disabled: item.attrs.countTime.disabled, "auto-count": item.attrs.countTime.autoCount }, on: { click: function($event) { _vm.formHandleEmit( item, "count-time" ) } } }) : _vm._e(), item.attrs && item.attrs.ocrType ? _c( "el-upload", { attrs: { action: "/cmbiz/api/ocr/" + _vm.ocrObject[ item.attrs.ocrType ], data: _vm.data, disabled: !_vm.edit, "show-file-list": false, "on-preview": function( response, file, fileList ) { _vm.handleInlineOcr( item, "preview", response, file, fileList ) }, "on-remove": function( response, file, fileList ) { _vm.handleInlineOcr( item, "remove", response, file, fileList ) }, "on-error": function( response, file, fileList ) { _vm.handleInlineOcr( item, "error", response, file, fileList ) }, "on-success": function( response, file, fileList ) { _vm.handleInlineOcr( item, "success", response, file, fileList ) } } }, [ _c( "div", { attrs: { slot: "trigger" }, slot: "trigger" }, [ item.attrs.ocrType ? _c("el-button", { attrs: { disabled: !_vm.edit, icon: "el-icon-camera" } }) : _vm._e() ], 1 ) ] ) : _vm._e() ], 1 ) ] : _vm._e() ], 2 ) : _c( "div", { staticClass: "el-form-item__content aos-form-input-text" }, [ _c( "div", { attrs: { title: _vm.copyData[item.prop] } }, [ _vm._v( "\n " + _vm._s(_vm.copyData[item.prop]) + "\n " ), item.attrs && item.attrs.suffixString ? _c( "span", { staticStyle: { "margin-left": "8px" } }, [_vm._v(_vm._s(item.attrs.suffixString))] ) : _vm._e(), item.viewSlot ? _c( "span", { staticStyle: { "margin-left": "8px" } }, [ _vm._t(item.prop + "-view-slot", null, { scope: _vm.copyData }) ], 2 ) : _vm._e() ] ) ] ) ] : _vm._e(), item.type == "textarea" ? [ _vm.edit ? _c("el-input", { ref: item.prop + "-ref", refInFor: true, staticStyle: { width: "100%" }, style: { width: (item.attrs && item.attrs.width) || "" }, attrs: { title: _vm.copyData[item.prop], type: "textarea", size: (item.attrs && item.attrs.size) || "small", minlength: (item.attrs && item.attrs.minlength) || 0, maxlength: (item.attrs && item.attrs.maxlength) || 10000, rows: (item.attrs && item.attrs.rows) || 4, placeholder: (item.attrs && item.attrs.placeholder) || "请在此输入", disabled: (item.attrs && item.attrs.disabled) || false, "show-word-limit": (item.attrs && item.attrs.showWordLimit) || false, autosize: (item.attrs && item.attrs.autosize) || false, "data-can-copy": item.attrs && item.attrs.dataCanCopy }, on: { blur: function($event) { _vm.formHandleEmit(item, "blur") }, change: function($event) { _vm.formHandleEmit(item, "change") }, focus: function($event) { _vm.formHandleEmit(item, "focus") }, clear: function($event) { _vm.formHandleEmit(item, "clear") } }, model: { value: _vm.copyData[item.prop], callback: function($$v) { _vm.$set(_vm.copyData, item.prop, $$v) }, expression: "copyData[item.prop]" } }) : _c( "div", { staticClass: "el-form-item__content aos-form-input-text" }, [ _c( "div", { attrs: { title: _vm.copyData[item.prop] } }, [_vm._v(_vm._s(_vm.copyData[item.prop]))] ) ] ) ] : _vm._e(), item.type == "select" ? [ _vm.edit ? _c( "el-select", { ref: item.prop + "-ref", refInFor: true, attrs: { title: _vm.copyData[item.prop], placeholder: (item.attrs && item.attrs.placeholder) || "请在此输入", disabled: (item.attrs && item.attrs.disabled) || false, clearable: !item.attrs || (item.attrs && item.attrs.clearable !== false), multiple: (item.attrs && item.attrs.multiple) || false, size: (item.attrs && item.attrs.size) || "small", "collapse-tags": (item.attrs && item.attrs["collapse-tags"]) || false, "multiple-limit": (item.attrs && item.attrs["multiple-limit"]) || 0, filterable: (item.attrs && item.attrs.filterable) || false, "allow-create": (item.attrs && item.attrs["allow-create"]) || false, "filter-method": (item.attrs && item.attrs["filter-method"]) || function() {}, remote: (item.attrs && item.attrs.remote) || false, "remote-method": (item.attrs && item.attrs["remote-method"]) || function() {}, loading: (item.attrs && item.attrs.loading) || false, "no-match-text": (item.attrs && item.attrs["no-match-text"]) || "无匹配数据", "no-data-text": (item.attrs && item.attrs["no-data-text"]) || "无数据", "reserve-keyword": (item.attrs && item.attrs["reserve-keyword"]) || false, "default-first-option": (item.attrs && item.attrs["default-first-option"]) || false, "popper-append-to-body": (item.attrs && item.attrs["popper-append-to-body"]) || true }, on: { change: function($event) { _vm.formHandleEmit(item, "change") }, "visible-change": function($event) { _vm.formHandleEmit(item, "visible-change") }, "remove-tag": function($event) { _vm.formHandleEmit(item, "remove-tag") }, clear: function($event) { _vm.formHandleEmit(item, "clear") }, blur: function($event) { _vm.formHandleEmit(item, "blur") }, focus: function($event) { _vm.formHandleEmit(item, "focus") } }, model: { value: _vm.copyData[item.prop], callback: function($$v) { _vm.$set(_vm.copyData, item.prop, $$v) }, expression: "copyData[item.prop]" } }, _vm._l(item.option, function(item) { return _c("el-option", { key: item.value, attrs: { label: item.label, value: item.value, disabled: item.disabled } }) }), 1 ) : _c( "div", { staticClass: "el-form-item__content aos-form-input-text" }, [ _c("div", [ _vm._v( _vm._s(_vm.selectNoEditLabelObject[item.prop]) ) ]) ] ) ] : _vm._e(), item.type == "time-picker" ? [ _vm.edit ? _c("el-time-picker", { ref: item.prop + "-ref", refInFor: true, attrs: { title: _vm.copyData[item.prop], readonly: (item.attrs && item.attrs.readonly) || false, disabled: (item.attrs && item.attrs.disabled) || false, editable: (item.attrs && item.attrs.editable) || true, clearable: !item.attrs || (item.attrs && item.attrs.clearable !== false), size: (item.attrs && item.attrs.size) || "small", placeholder: (item.attrs && item.attrs.placeholder) || "请选择时间", "is-range": (item.attrs && item.attrs["is-range"]) || false, "arrow-control": (item.attrs && item.attrs["arrow-control"]) || false, "start-placeholder": (item.attrs && item.attrs["start-placeholder"]) || "开始时间", "end-placeholder": (item.attrs && item.attrs["end-placeholder"]) || "结束时间", align: (item.attrs && item.attrs.align) || "left", "picker-options": (item.attrs && item.attrs["picker-options"]) || { format: "HH:mm:ss" }, "range-separator": (item.attrs && item.attrs["range-separator"]) || "-", "value-format": (item.attrs && item.attrs["value-format"]) || "HH:mm:ss", "prefix-icon": (item.attrs && item.attrs["prefix-icon"]) || "el-icon-time", "clear-icon": (item.attrs && item.attrs["clear-icon"]) || "el-icon-circle-close" }, on: { change: function($event) { _vm.formHandleEmit(item, "change") }, blur: function($event) { _vm.formHandleEmit(item, "blur") }, focus: function($event) { _vm.formHandleEmit(item, "focus") } }, model: { value: _vm.copyData[item.prop], callback: function($$v) { _vm.$set(_vm.copyData, item.prop, $$v) }, expression: "copyData[item.prop]" } }) : _c( "div", { staticClass: "el-form-item__content aos-form-input-text" }, [ _c( "div", { attrs: { title: _vm.copyData[item.prop] } }, [_vm._v(_vm._s(_vm.copyData[item.prop]))] ) ] ) ] : _vm._e(), item.type == "time-select" ? [ _vm.edit ? _c("el-time-select", { ref: item.prop + "-ref", refInFor: true, attrs: { title: _vm.copyData[item.prop], readonly: (item.attrs && item.attrs.readonly) || false, disabled: (item.attrs && item.attrs.disabled) || false, editable: (item.attrs && item.attrs.editable) || true, clearable: !item.attrs || (item.attrs && item.attrs.clearable !== false), size: (item.attrs && item.attrs.size) || "small", placeholder: (item.attrs && item.attrs.placeholder) || "请选择时间", "start-placeholder": (item.attrs && item.attrs["start-placeholder"]) || "开始时间", "end-placeholder": (item.attrs && item.attrs["end-placeholder"]) || "结束时间", align: (item.attrs && item.attrs.align) || "left", "picker-options": (item.attrs && item.attrs["picker-options"]) || { start: "08:00", step: "00:15", end: "18:30" }, "range-separator": (item.attrs && item.attrs["range-separator"]) || "-", "prefix-icon": (item.attrs && item.attrs["prefix-icon"]) || "el-icon-time", "clear-icon": (item.attrs && item.attrs["clear-icon"]) || "el-icon-circle-close" }, on: { change: function($event) { _vm.formHandleEmit(item, "change") }, blur: function($event) { _vm.formHandleEmit(item, "blur") }, focus: function($event) { _vm.formHandleEmit(item, "focus") } }, model: { value: _vm.copyData[item.prop], callback: function($$v) { _vm.$set(_vm.copyData, item.prop, $$v) }, expression: "copyData[item.prop]" } }) : _c( "div", { staticClass: "el-form-item__content aos-form-input-text" }, [ _c( "div", { attrs: { title: _vm.copyData[item.prop] } }, [_vm._v(_vm._s(_vm.copyData[item.prop]))] ) ] ) ] : _vm._e(), item.type == "date-picker" ? [ _vm.edit ? _c("el-date-picker", { ref: item.prop + "-ref", refInFo