@smallwei/avue 3.0.12 → 3.0.13

Sign up to get free protection for your applications and to get access to all the features.
package/lib/avue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Avue.js v3.0.12
2
+ * Avue.js v3.0.13
3
3
  * (c) 2017-2022 Smallwei
4
4
  * Released under the MIT License.
5
5
  *
@@ -4456,7 +4456,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
4456
4456
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4457
4457
 
4458
4458
  "use strict";
4459
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var global_variable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! global/variable */ \"./src/global/variable.js\");\n/* harmony import */ var core_locale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/locale */ \"./src/core/locale.js\");\n/* harmony import */ var core_create__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/create */ \"./src/core/create.js\");\n/* harmony import */ var _core_directive_permission__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../core/directive/permission */ \"./packages/core/directive/permission.js\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(core_create__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({\n name: \"tree\",\n mixins: [core_locale__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n directives: {\n permission: _core_directive_permission__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n props: {\n indent: Number,\n filterNodeMethod: Function,\n checkOnClickNode: Boolean,\n permission: {\n type: [Function, Object],\n \"default\": function _default() {\n return {};\n }\n },\n iconClass: {\n type: String\n },\n loading: {\n type: Boolean,\n \"default\": false\n },\n expandOnClickNode: {\n type: Boolean,\n \"default\": false\n },\n option: {\n type: Object,\n \"default\": function _default() {\n return {};\n }\n },\n data: {\n type: Array,\n \"default\": function _default() {\n return [];\n }\n },\n modelValue: {\n type: Object,\n \"default\": function _default() {\n return {};\n }\n }\n },\n data: function data() {\n return {\n filterValue: \"\",\n client: {\n x: 0,\n y: 0,\n show: false\n },\n box: false,\n type: \"\",\n node: {},\n obj: {},\n form: {}\n };\n },\n computed: {\n styleName: function styleName() {\n return {\n top: this.setPx(this.client.y - 10),\n left: this.setPx(this.client.x - 10)\n };\n },\n treeProps: function treeProps() {\n return Object.assign(this.props, {\n isLeaf: this.leafKey\n });\n },\n menu: function menu() {\n return this.validData(this.option.menu, true);\n },\n title: function title() {\n return this.option.title;\n },\n treeLoad: function treeLoad() {\n return this.option.treeLoad;\n },\n checkStrictly: function checkStrictly() {\n return this.option.checkStrictly;\n },\n accordion: function accordion() {\n return this.option.accordion;\n },\n multiple: function multiple() {\n return this.option.multiple;\n },\n lazy: function lazy() {\n return this.option.lazy;\n },\n addText: function addText() {\n return this.addFlag ? this.t(\"crud.addBtn\") : this.t(\"crud.editBtn\");\n },\n addFlag: function addFlag() {\n return [\"add\", \"parentAdd\"].includes(this.type);\n },\n size: function size() {\n return this.option.size;\n },\n props: function props() {\n return this.option.props || {};\n },\n leafKey: function leafKey() {\n return this.props.leaf || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].leaf;\n },\n valueKey: function valueKey() {\n return this.props.value || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].value;\n },\n labelKey: function labelKey() {\n return this.props.label || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].label;\n },\n childrenKey: function childrenKey() {\n return this.props.children || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].children;\n },\n nodeKey: function nodeKey() {\n return this.option.nodeKey || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].nodeKey;\n },\n defaultExpandAll: function defaultExpandAll() {\n return this.option.defaultExpandAll;\n },\n defaultExpandedKeys: function defaultExpandedKeys() {\n return this.option.defaultExpandedKeys;\n },\n formOption: function formOption() {\n return Object.assign(this.option.formOption, {\n submitText: this.addText\n });\n }\n },\n mounted: function mounted() {\n var _this = this;\n\n document.addEventListener('click', function (e) {\n if (!_this.$el.contains(e.target)) _this.client.show = false;\n });\n this.initFun();\n },\n watch: {\n filterValue: function filterValue(val) {\n this.$refs.tree.filter(val);\n },\n modelValue: function modelValue(val) {\n this.form = val;\n },\n form: function form(val) {\n this.$emit('update:modelValue', val);\n }\n },\n methods: {\n getPermission: function getPermission(key) {\n if (typeof this.permission === \"function\") {\n return this.permission(key, this.node);\n } else if (!this.validatenull(this.permission[key])) {\n return this.permission[key];\n } else {\n return true;\n }\n },\n initFun: function initFun() {\n var _this2 = this;\n\n ['filter', 'updateKeyChildren', 'getCheckedNodes', 'setCheckedNodes', 'getCheckedKeys', 'setCheckedKeys', 'setChecked', 'getHalfCheckedNodes', 'getHalfCheckedKeys', 'getCurrentKey', 'getCurrentNode', 'setCurrentKey', 'setCurrentNode', 'getNode', 'remove', 'append', 'insertBefore', 'insertAfter'].forEach(function (ele) {\n _this2[ele] = _this2.$refs.tree[ele];\n });\n },\n nodeContextmenu: function nodeContextmenu(e, data) {\n this.node = this.deepClone(data);\n this.client.x = e.clientX;\n this.client.y = e.clientY;\n this.client.show = true;\n },\n handleCheckChange: function handleCheckChange(data, checked, indeterminate) {\n this.$emit('check-change', data, checked, indeterminate);\n },\n handleSubmit: function handleSubmit(form, done) {\n this.addFlag ? this.save(form, done) : this.update(form, done);\n },\n nodeClick: function nodeClick(data, node, nodeComp) {\n this.client.show = false;\n this.$emit(\"node-click\", data, node, nodeComp);\n },\n filterNode: function filterNode(value, data) {\n if (typeof this.filterNodeMethod === 'function') {\n return this.filterNodeMethod(value, data);\n }\n\n if (!value) return true;\n return data[this.labelKey].indexOf(value) !== -1;\n },\n hide: function hide() {\n this.box = false;\n this.node = {};\n this.$refs.form.resetForm();\n this.$refs.form.clearValidate();\n },\n save: function save(data, done) {\n var _this3 = this;\n\n var callback = function callback() {\n var form = _this3.deepClone(_this3.form);\n\n if (_this3.type === \"add\") {\n _this3.$refs.tree.append(form, _this3.node[_this3.valueKey]);\n } else if (_this3.type === \"parentAdd\") {\n _this3.$refs.tree.append(form);\n }\n\n _this3.hide();\n\n done();\n };\n\n this.$emit(\"save\", this.node, data, callback, done);\n },\n update: function update(data, done) {\n var _this4 = this;\n\n var callback = function callback() {\n var node = _this4.$refs.tree.getNode(_this4.node[_this4.valueKey]) || {};\n node.data = _this4.deepClone(_this4.form);\n\n _this4.hide();\n\n done();\n };\n\n this.$emit(\"update\", this.node, data, callback, done);\n },\n rowEdit: function rowEdit(a) {\n this.type = \"edit\";\n this.form = this.node;\n this.show();\n },\n parentAdd: function parentAdd() {\n this.type = \"parentAdd\";\n this.show();\n },\n rowAdd: function rowAdd() {\n this.type = \"add\";\n this.show();\n },\n show: function show() {\n this.client.show = false;\n this.box = true;\n },\n rowRemove: function rowRemove() {\n var _this5 = this;\n\n this.client.show = false;\n\n var callback = function callback() {\n _this5.$refs.tree.remove(_this5.node[_this5.valueKey]);\n };\n\n this.$emit(\"del\", this.node, callback);\n }\n }\n}));\n\n//# sourceURL=webpack://AVUE/./packages/element-ui/tree/index.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/dist??ref--1");
4459
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var global_variable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! global/variable */ \"./src/global/variable.js\");\n/* harmony import */ var core_locale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/locale */ \"./src/core/locale.js\");\n/* harmony import */ var core_create__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/create */ \"./src/core/create.js\");\n/* harmony import */ var _core_directive_permission__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../core/directive/permission */ \"./packages/core/directive/permission.js\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(core_create__WEBPACK_IMPORTED_MODULE_2__[\"default\"])({\n name: \"tree\",\n mixins: [core_locale__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n directives: {\n permission: _core_directive_permission__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n props: {\n indent: Number,\n filterNodeMethod: Function,\n checkOnClickNode: Boolean,\n permission: {\n type: [Function, Object],\n \"default\": function _default() {\n return {};\n }\n },\n iconClass: {\n type: String\n },\n loading: {\n type: Boolean,\n \"default\": false\n },\n expandOnClickNode: {\n type: Boolean,\n \"default\": false\n },\n option: {\n type: Object,\n \"default\": function _default() {\n return {};\n }\n },\n data: {\n type: Array,\n \"default\": function _default() {\n return [];\n }\n },\n modelValue: {\n type: Object,\n \"default\": function _default() {\n return {};\n }\n }\n },\n data: function data() {\n return {\n filterValue: \"\",\n client: {\n x: 0,\n y: 0,\n show: false\n },\n box: false,\n type: \"\",\n node: {},\n obj: {},\n form: {}\n };\n },\n computed: {\n styleName: function styleName() {\n return {\n top: this.setPx(this.client.y - 10),\n left: this.setPx(this.client.x - 10)\n };\n },\n treeProps: function treeProps() {\n return Object.assign(this.props, {\n isLeaf: this.leafKey\n });\n },\n menu: function menu() {\n return this.validData(this.option.menu, true);\n },\n title: function title() {\n return this.option.title;\n },\n treeLoad: function treeLoad() {\n return this.option.treeLoad;\n },\n checkStrictly: function checkStrictly() {\n return this.option.checkStrictly;\n },\n accordion: function accordion() {\n return this.option.accordion;\n },\n multiple: function multiple() {\n return this.option.multiple;\n },\n lazy: function lazy() {\n return this.option.lazy;\n },\n addText: function addText() {\n return this.addFlag ? this.t(\"crud.addBtn\") : this.t(\"crud.editBtn\");\n },\n addFlag: function addFlag() {\n return [\"add\", \"parentAdd\"].includes(this.type);\n },\n size: function size() {\n return this.option.size;\n },\n props: function props() {\n return this.option.props || {};\n },\n leafKey: function leafKey() {\n return this.props.leaf || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].leaf;\n },\n valueKey: function valueKey() {\n return this.props.value || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].value;\n },\n labelKey: function labelKey() {\n return this.props.label || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].label;\n },\n childrenKey: function childrenKey() {\n return this.props.children || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].children;\n },\n nodeKey: function nodeKey() {\n return this.option.nodeKey || global_variable__WEBPACK_IMPORTED_MODULE_0__[\"DIC_PROPS\"].nodeKey;\n },\n defaultExpandAll: function defaultExpandAll() {\n return this.option.defaultExpandAll;\n },\n defaultExpandedKeys: function defaultExpandedKeys() {\n return this.option.defaultExpandedKeys;\n },\n formOption: function formOption() {\n return Object.assign(this.option.formOption || {}, {\n submitText: this.addText\n });\n }\n },\n mounted: function mounted() {\n var _this = this;\n\n document.addEventListener('click', function (e) {\n if (!_this.$el.contains(e.target)) _this.client.show = false;\n });\n this.initFun();\n },\n watch: {\n filterValue: function filterValue(val) {\n this.$refs.tree.filter(val);\n },\n modelValue: function modelValue(val) {\n this.form = val;\n },\n form: function form(val) {\n this.$emit('update:modelValue', val);\n }\n },\n methods: {\n getPermission: function getPermission(key) {\n if (typeof this.permission === \"function\") {\n return this.permission(key, this.node);\n } else if (!this.validatenull(this.permission[key])) {\n return this.permission[key];\n } else {\n return true;\n }\n },\n initFun: function initFun() {\n var _this2 = this;\n\n ['filter', 'updateKeyChildren', 'getCheckedNodes', 'setCheckedNodes', 'getCheckedKeys', 'setCheckedKeys', 'setChecked', 'getHalfCheckedNodes', 'getHalfCheckedKeys', 'getCurrentKey', 'getCurrentNode', 'setCurrentKey', 'setCurrentNode', 'getNode', 'remove', 'append', 'insertBefore', 'insertAfter'].forEach(function (ele) {\n _this2[ele] = _this2.$refs.tree[ele];\n });\n },\n nodeContextmenu: function nodeContextmenu(e, data) {\n this.node = this.deepClone(data);\n this.client.x = e.clientX;\n this.client.y = e.clientY;\n this.client.show = true;\n },\n handleCheckChange: function handleCheckChange(data, checked, indeterminate) {\n this.$emit('check-change', data, checked, indeterminate);\n },\n handleSubmit: function handleSubmit(form, done) {\n this.addFlag ? this.save(form, done) : this.update(form, done);\n },\n nodeClick: function nodeClick(data, node, nodeComp) {\n this.client.show = false;\n this.$emit(\"node-click\", data, node, nodeComp);\n },\n filterNode: function filterNode(value, data) {\n if (typeof this.filterNodeMethod === 'function') {\n return this.filterNodeMethod(value, data);\n }\n\n if (!value) return true;\n return data[this.labelKey].indexOf(value) !== -1;\n },\n hide: function hide() {\n this.box = false;\n this.node = {};\n this.$refs.form.resetForm();\n this.$refs.form.clearValidate();\n },\n save: function save(data, done) {\n var _this3 = this;\n\n var callback = function callback() {\n var form = _this3.deepClone(_this3.form);\n\n if (_this3.type === \"add\") {\n _this3.$refs.tree.append(form, _this3.node[_this3.valueKey]);\n } else if (_this3.type === \"parentAdd\") {\n _this3.$refs.tree.append(form);\n }\n\n _this3.hide();\n\n done();\n };\n\n this.$emit(\"save\", this.node, data, callback, done);\n },\n update: function update(data, done) {\n var _this4 = this;\n\n var callback = function callback() {\n var node = _this4.$refs.tree.getNode(_this4.node[_this4.valueKey]) || {};\n node.data = _this4.deepClone(_this4.form);\n\n _this4.hide();\n\n done();\n };\n\n this.$emit(\"update\", this.node, data, callback, done);\n },\n rowEdit: function rowEdit(a) {\n this.type = \"edit\";\n this.form = this.node;\n this.show();\n },\n parentAdd: function parentAdd() {\n this.type = \"parentAdd\";\n this.show();\n },\n rowAdd: function rowAdd() {\n this.type = \"add\";\n this.show();\n },\n show: function show() {\n this.client.show = false;\n this.box = true;\n },\n rowRemove: function rowRemove() {\n var _this5 = this;\n\n this.client.show = false;\n\n var callback = function callback() {\n _this5.$refs.tree.remove(_this5.node[_this5.valueKey]);\n };\n\n this.$emit(\"del\", this.node, callback);\n }\n }\n}));\n\n//# sourceURL=webpack://AVUE/./packages/element-ui/tree/index.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/dist??ref--1");
4460
4460
 
4461
4461
  /***/ }),
4462
4462
 
@@ -8402,7 +8402,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
8402
8402
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
8403
8403
 
8404
8404
  "use strict";
8405
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"t\", function() { return t; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"use\", function() { return use; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"i18n\", function() { return i18n; });\n/* harmony import */ var _format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./format */ \"./src/locale/format.js\");\n/* harmony import */ var _lang_zh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lang/zh */ \"./src/locale/lang/zh.js\");\n\n\nvar Vue = window.Vue;\nvar format = Object(_format__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Vue);\nvar lang = _lang_zh__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nvar merged = false;\n\nvar i18nHandler = function i18nHandler() {\n var vuei18n = Object.getPrototypeOf(this || Vue).$t;\n\n if (typeof vuei18n === 'function' && !!Vue.locale) {\n if (!merged) {\n merged = true;\n Vue.locale(Vue.config.lang, Object.assign(lang, Vue.locale(Vue.config.lang) || {}, {\n clone: true\n }));\n }\n\n return vuei18n.apply(this, arguments);\n }\n};\n\nvar t = function t(path, options) {\n var value = i18nHandler.apply(this, arguments);\n if (value !== null && value !== undefined) return value;\n var array = path.split('.');\n var current = lang;\n\n for (var i = 0, j = array.length; i < j; i++) {\n var property = array[i];\n value = current[property];\n if (i === j - 1) return format(value, options);\n if (!value) return '';\n current = value;\n }\n\n return '';\n};\nvar use = function use(l) {\n lang = l || lang;\n};\nvar i18n = function i18n(fn) {\n i18nHandler = fn || i18nHandler;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n use: use,\n t: t,\n i18n: i18n\n});\n\n//# sourceURL=webpack://AVUE/./src/locale/index.js?");
8405
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"t\", function() { return t; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"use\", function() { return use; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"i18n\", function() { return i18n; });\n/* harmony import */ var _format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./format */ \"./src/locale/format.js\");\n/* harmony import */ var _lang_zh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lang/zh */ \"./src/locale/lang/zh.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nvar Vue = Object(vue__WEBPACK_IMPORTED_MODULE_2__[\"createApp\"])({});\nvar format = Object(_format__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Vue);\nvar lang = _lang_zh__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nvar merged = false;\n\nvar i18nHandler = function i18nHandler() {\n var vuei18n = Object.getPrototypeOf(this || Vue).$t;\n\n if (typeof vuei18n === 'function' && !!Vue.locale) {\n if (!merged) {\n merged = true;\n Vue.locale(Vue.config.lang, Object.assign(lang, Vue.locale(Vue.config.lang) || {}, {\n clone: true\n }));\n }\n\n return vuei18n.apply(this, arguments);\n }\n};\n\nvar t = function t(path, options) {\n var value = i18nHandler.apply(this, arguments);\n if (value !== null && value !== undefined) return value;\n var array = path.split('.');\n var current = lang;\n\n for (var i = 0, j = array.length; i < j; i++) {\n var property = array[i];\n value = current[property];\n if (i === j - 1) return format(value, options);\n if (!value) return '';\n current = value;\n }\n\n return '';\n};\nvar use = function use(l) {\n lang = l || lang;\n};\nvar i18n = function i18n(fn) {\n i18nHandler = fn || i18nHandler;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n use: use,\n t: t,\n i18n: i18n\n});\n\n//# sourceURL=webpack://AVUE/./src/locale/index.js?");
8406
8406
 
8407
8407
  /***/ }),
8408
8408
 
@@ -8678,7 +8678,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
8678
8678
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
8679
8679
 
8680
8680
  "use strict";
8681
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\nvar version = '3.0.12';\n\n//# sourceURL=webpack://AVUE/./src/version.js?");
8681
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\nvar version = '3.0.13';\n\n//# sourceURL=webpack://AVUE/./src/version.js?");
8682
8682
 
8683
8683
  /***/ }),
8684
8684