@form-create/component-elm-upload
Advanced tools
Comparing version 3.1.15 to 3.1.16
/*! | ||
* @form-create/component-elm-upload v3.1.15 | ||
* @form-create/component-elm-upload v3.1.16 | ||
* (c) 2018-2022 xaboy | ||
@@ -207,8 +207,9 @@ * Github https://github.com/xaboy/form-create with upload | ||
var len = toArray(this.modelValue).length; | ||
return createVNode(Fragment, null, [createVNode(resolveComponent("ElUpload"), mergeProps({ | ||
"key": this.modelValue.length, | ||
"key": len, | ||
"list-type": "picture-card" | ||
}, this.$attrs, { | ||
"class": { | ||
'_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= this.modelValue.length : false | ||
'_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= len : false | ||
}, | ||
@@ -215,0 +216,0 @@ "onPreview": this.handlePreview, |
/*! | ||
* @form-create/component-elm-upload v3.1.15 | ||
* @form-create/component-elm-upload v3.1.16 | ||
* (c) 2018-2022 xaboy | ||
@@ -7,2 +7,2 @@ * Github https://github.com/xaboy/form-create with upload | ||
*/ | ||
import{openBlock as e,createElementBlock as t,createElementVNode as i,defineComponent as n,createVNode as r,Fragment as l,resolveComponent as o,mergeProps as a}from"vue";function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function u(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){c(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function c(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("._fc-exceed .el-upload{display:none}");var p={name:"IconUpload"},h={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},f=[i("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)];function m(e,t){return{url:e,name:v(e),uid:t}}function v(e){return(""+e).split("/").pop()}p.render=function(i,n,r,l,o,a){return e(),t("svg",h,f)};var y=n({name:"fcUpload",inheritAttrs:!1,props:{previewMask:void 0,modalTitle:String,modelValue:[Array,String]},emits:["update:modelValue","change","remove"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=d(this.modelValue).map(m)},watch:{modelValue:function(e){this.fileList=d(e).map(m)},limit:function(e,t){1!==t&&1!==e||this.update()}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",1===this.limit?t[0]||"":t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)}},render:function(){var e,t,i,n,s=this;return r(l,null,[r(o("ElUpload"),a({key:this.modelValue.length,"list-type":"picture-card"},this.$attrs,{class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=this.modelValue.length},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,fileList:this.fileList}),u({default:function(){return[(null===(e=(t=s.$slots).default)||void 0===e?void 0:e.call(t))||r(o("ElIcon"),null,{default:function(){return[r(p,null,null)]}})]}},(i=this.$slots,n=["default"],Object.keys(i).reduce((function(e,t){return n&&-1!==n.indexOf(t)||e.push(i[t]),e}),[])))),r(o("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[r("img",{style:"width: 100%",src:s.previewImage},null)]}})])}});export{y as default}; | ||
import{openBlock as e,createElementBlock as t,createElementVNode as i,defineComponent as n,createVNode as r,Fragment as l,resolveComponent as o,mergeProps as a}from"vue";function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function u(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){c(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function c(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("._fc-exceed .el-upload{display:none}");var p={name:"IconUpload"},h={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},f=[i("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)];function m(e,t){return{url:e,name:v(e),uid:t}}function v(e){return(""+e).split("/").pop()}p.render=function(i,n,r,l,o,a){return e(),t("svg",h,f)};var y=n({name:"fcUpload",inheritAttrs:!1,props:{previewMask:void 0,modalTitle:String,modelValue:[Array,String]},emits:["update:modelValue","change","remove"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=d(this.modelValue).map(m)},watch:{modelValue:function(e){this.fileList=d(e).map(m)},limit:function(e,t){1!==t&&1!==e||this.update()}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",1===this.limit?t[0]||"":t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)}},render:function(){var e,t,i,n,s=this,c=d(this.modelValue).length;return r(l,null,[r(o("ElUpload"),a({key:c,"list-type":"picture-card"},this.$attrs,{class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=c},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,fileList:this.fileList}),u({default:function(){return[(null===(e=(t=s.$slots).default)||void 0===e?void 0:e.call(t))||r(o("ElIcon"),null,{default:function(){return[r(p,null,null)]}})]}},(i=this.$slots,n=["default"],Object.keys(i).reduce((function(e,t){return n&&-1!==n.indexOf(t)||e.push(i[t]),e}),[])))),r(o("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[r("img",{style:"width: 100%",src:s.previewImage},null)]}})])}});export{y as default}; |
/*! | ||
* @form-create/component-elm-upload v3.1.15 | ||
* @form-create/component-elm-upload v3.1.16 | ||
* (c) 2018-2022 xaboy | ||
@@ -211,8 +211,9 @@ * Github https://github.com/xaboy/form-create with upload | ||
var len = toArray(this.modelValue).length; | ||
return vue.createVNode(vue.Fragment, null, [vue.createVNode(vue.resolveComponent("ElUpload"), vue.mergeProps({ | ||
"key": this.modelValue.length, | ||
"key": len, | ||
"list-type": "picture-card" | ||
}, this.$attrs, { | ||
"class": { | ||
'_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= this.modelValue.length : false | ||
'_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= len : false | ||
}, | ||
@@ -219,0 +220,0 @@ "onPreview": this.handlePreview, |
/*! | ||
* @form-create/component-elm-upload v3.1.15 | ||
* @form-create/component-elm-upload v3.1.16 | ||
* (c) 2018-2022 xaboy | ||
@@ -7,2 +7,2 @@ * Github https://github.com/xaboy/form-create with upload | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FcUpload={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("._fc-exceed .el-upload{display:none}");var l={name:"IconUpload"},a={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},s=[t.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)];function u(e,t){return{url:e,name:c(e),uid:t}}function c(e){return(""+e).split("/").pop()}l.render=function(e,n,i,r,o,l){return t.openBlock(),t.createElementBlock("svg",a,s)};var d=t.defineComponent({name:"fcUpload",inheritAttrs:!1,props:{previewMask:void 0,modalTitle:String,modelValue:[Array,String]},emits:["update:modelValue","change","remove"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=o(this.modelValue).map(u)},watch:{modelValue:function(e){this.fileList=o(e).map(u)},limit:function(e,t){1!==t&&1!==e||this.update()}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",1===this.limit?t[0]||"":t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)}},render:function(){var e,n,r,o,a=this;return t.createVNode(t.Fragment,null,[t.createVNode(t.resolveComponent("ElUpload"),t.mergeProps({key:this.modelValue.length,"list-type":"picture-card"},this.$attrs,{class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=this.modelValue.length},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,fileList:this.fileList}),i({default:function(){return[(null===(e=(n=a.$slots).default)||void 0===e?void 0:e.call(n))||t.createVNode(t.resolveComponent("ElIcon"),null,{default:function(){return[t.createVNode(l,null,null)]}})]}},(r=this.$slots,o=["default"],Object.keys(r).reduce((function(e,t){return o&&-1!==o.indexOf(t)||e.push(r[t]),e}),[])))),t.createVNode(t.resolveComponent("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[t.createVNode("img",{style:"width: 100%",src:a.previewImage},null)]}})])}});e.default=d,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FcUpload={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("._fc-exceed .el-upload{display:none}");var l={name:"IconUpload"},a={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},s=[t.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)];function u(e,t){return{url:e,name:c(e),uid:t}}function c(e){return(""+e).split("/").pop()}l.render=function(e,n,i,r,o,l){return t.openBlock(),t.createElementBlock("svg",a,s)};var d=t.defineComponent({name:"fcUpload",inheritAttrs:!1,props:{previewMask:void 0,modalTitle:String,modelValue:[Array,String]},emits:["update:modelValue","change","remove"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=o(this.modelValue).map(u)},watch:{modelValue:function(e){this.fileList=o(e).map(u)},limit:function(e,t){1!==t&&1!==e||this.update()}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",1===this.limit?t[0]||"":t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)}},render:function(){var e,n,r,a,s=this,u=o(this.modelValue).length;return t.createVNode(t.Fragment,null,[t.createVNode(t.resolveComponent("ElUpload"),t.mergeProps({key:u,"list-type":"picture-card"},this.$attrs,{class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=u},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,fileList:this.fileList}),i({default:function(){return[(null===(e=(n=s.$slots).default)||void 0===e?void 0:e.call(n))||t.createVNode(t.resolveComponent("ElIcon"),null,{default:function(){return[t.createVNode(l,null,null)]}})]}},(r=this.$slots,a=["default"],Object.keys(r).reduce((function(e,t){return a&&-1!==a.indexOf(t)||e.push(r[t]),e}),[])))),t.createVNode(t.resolveComponent("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[t.createVNode("img",{style:"width: 100%",src:s.previewImage},null)]}})])}});e.default=d,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@form-create/component-elm-upload", | ||
"version": "3.1.15", | ||
"version": "3.1.16", | ||
"description": "@form-create/element-ui 内置组件", | ||
@@ -50,3 +50,3 @@ "main": "./dist/index.min.js", | ||
}, | ||
"gitHead": "9eafec70e2e9a94f5473c798c68cda4abf988caf" | ||
"gitHead": "41af60432b767d7a11b9b14a211f1c7594695e54" | ||
} |
@@ -78,5 +78,6 @@ import toArray from '@form-create/utils/lib/toarray'; | ||
render() { | ||
const len = toArray(this.modelValue).length; | ||
return ( | ||
<><ElUpload key={this.modelValue.length} list-type="picture-card" {...this.$attrs} | ||
class={{'_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= this.modelValue.length : false}} | ||
<><ElUpload key={len} list-type="picture-card" {...this.$attrs} | ||
class={{'_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= len : false}} | ||
onPreview={this.handlePreview} onChange={this.handleChange} | ||
@@ -83,0 +84,0 @@ onRemove={this.handleRemove} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27819
576