vxe-pc-ui 4.6.9 → 4.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/es/button/src/button.js +2 -4
  2. package/es/form/render/index.js +2 -4
  3. package/es/form/src/form.js +97 -37
  4. package/es/form-design/src/form-view.js +1 -3
  5. package/es/icon/style.css +1 -1
  6. package/es/list-design/src/layout-preview.js +5 -7
  7. package/es/list-design/src/list-view.js +5 -7
  8. package/es/modal/src/modal.js +2 -4
  9. package/es/pager/src/pager.js +1 -3
  10. package/es/style.css +1 -1
  11. package/es/style.min.css +1 -1
  12. package/es/table-select/src/table-select.js +5 -7
  13. package/es/tabs/src/tabs.js +2 -6
  14. package/es/tree/src/tree.js +238 -173
  15. package/es/ui/index.js +3 -7
  16. package/es/ui/src/log.js +1 -1
  17. package/es/upload/src/upload.js +5 -7
  18. package/lib/button/src/button.js +2 -4
  19. package/lib/button/src/button.min.js +1 -1
  20. package/lib/form/render/index.js +2 -4
  21. package/lib/form/render/index.min.js +1 -1
  22. package/lib/form/src/form.js +95 -36
  23. package/lib/form/src/form.min.js +1 -1
  24. package/lib/form-design/src/form-view.js +1 -3
  25. package/lib/form-design/src/form-view.min.js +1 -1
  26. package/lib/icon/style/style.css +1 -1
  27. package/lib/icon/style/style.min.css +1 -1
  28. package/lib/index.umd.js +422 -275
  29. package/lib/index.umd.min.js +1 -1
  30. package/lib/list-design/src/layout-preview.js +5 -7
  31. package/lib/list-design/src/layout-preview.min.js +1 -1
  32. package/lib/list-design/src/list-view.js +5 -7
  33. package/lib/list-design/src/list-view.min.js +1 -1
  34. package/lib/modal/src/modal.js +2 -4
  35. package/lib/modal/src/modal.min.js +1 -1
  36. package/lib/pager/src/pager.js +1 -3
  37. package/lib/pager/src/pager.min.js +1 -1
  38. package/lib/style.css +1 -1
  39. package/lib/style.min.css +1 -1
  40. package/lib/table-select/src/table-select.js +5 -7
  41. package/lib/table-select/src/table-select.min.js +1 -1
  42. package/lib/tabs/src/tabs.js +2 -6
  43. package/lib/tabs/src/tabs.min.js +1 -1
  44. package/lib/tree/src/tree.js +293 -179
  45. package/lib/tree/src/tree.min.js +1 -1
  46. package/lib/ui/index.js +3 -7
  47. package/lib/ui/index.min.js +1 -1
  48. package/lib/ui/src/log.js +1 -1
  49. package/lib/ui/src/log.min.js +1 -1
  50. package/lib/upload/src/upload.js +5 -7
  51. package/lib/upload/src/upload.min.js +1 -1
  52. package/package.json +1 -1
  53. package/packages/button/src/button.ts +2 -4
  54. package/packages/form/render/index.ts +2 -4
  55. package/packages/form/src/form.ts +98 -35
  56. package/packages/form-design/src/form-view.ts +1 -3
  57. package/packages/list-design/src/layout-preview.ts +5 -7
  58. package/packages/list-design/src/list-view.ts +5 -7
  59. package/packages/modal/src/modal.ts +2 -4
  60. package/packages/pager/src/pager.ts +1 -3
  61. package/packages/table-select/src/table-select.ts +5 -7
  62. package/packages/tabs/src/tabs.ts +2 -6
  63. package/packages/tree/src/tree.ts +235 -172
  64. package/packages/ui/index.ts +2 -6
  65. package/packages/upload/src/upload.ts +5 -7
  66. package/types/components/tree.d.ts +7 -5
  67. /package/es/icon/{iconfont.1747279440023.ttf → iconfont.1747318422186.ttf} +0 -0
  68. /package/es/icon/{iconfont.1747279440023.woff → iconfont.1747318422186.woff} +0 -0
  69. /package/es/icon/{iconfont.1747279440023.woff2 → iconfont.1747318422186.woff2} +0 -0
  70. /package/es/{iconfont.1747279440023.ttf → iconfont.1747318422186.ttf} +0 -0
  71. /package/es/{iconfont.1747279440023.woff → iconfont.1747318422186.woff} +0 -0
  72. /package/es/{iconfont.1747279440023.woff2 → iconfont.1747318422186.woff2} +0 -0
  73. /package/lib/icon/style/{iconfont.1747279440023.ttf → iconfont.1747318422186.ttf} +0 -0
  74. /package/lib/icon/style/{iconfont.1747279440023.woff → iconfont.1747318422186.woff} +0 -0
  75. /package/lib/icon/style/{iconfont.1747279440023.woff2 → iconfont.1747318422186.woff2} +0 -0
  76. /package/lib/{iconfont.1747279440023.ttf → iconfont.1747318422186.ttf} +0 -0
  77. /package/lib/{iconfont.1747279440023.woff → iconfont.1747318422186.woff} +0 -0
  78. /package/lib/{iconfont.1747279440023.woff2 → iconfont.1747318422186.woff2} +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_ui=require("../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils")),_vn=require("../../ui/src/vn"),_dom=require("../../ui/src/dom"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getNodeUniqueId(){return _xeUtils.default.uniqueId("node_")}var _default=exports.default=(0,_vue.defineComponent)({name:"VxeTree",props:{data:Array,height:[String,Number],minHeight:{type:[String,Number],default:()=>(0,_ui.getConfig)().tree.minHeight},loading:Boolean,loadingConfig:Object,accordion:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.accordion},childrenField:{type:String,default:()=>(0,_ui.getConfig)().tree.childrenField},valueField:{type:String,default:()=>(0,_ui.getConfig)().tree.valueField},keyField:{type:String,default:()=>(0,_ui.getConfig)().tree.keyField},parentField:{type:String,default:()=>(0,_ui.getConfig)().tree.parentField},titleField:{type:String,default:()=>(0,_ui.getConfig)().tree.titleField},hasChildField:{type:String,default:()=>(0,_ui.getConfig)().tree.hasChildField},transform:Boolean,isCurrent:Boolean,isHover:Boolean,expandAll:Boolean,showLine:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.showLine},trigger:String,indent:{type:Number,default:()=>(0,_ui.getConfig)().tree.indent},showRadio:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.showRadio},checkNodeKey:{type:[String,Number],default:()=>(0,_ui.getConfig)().tree.checkNodeKey},radioConfig:Object,showCheckbox:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.showCheckbox},checkNodeKeys:{type:Array,default:()=>(0,_ui.getConfig)().tree.checkNodeKeys},checkboxConfig:Object,nodeConfig:Object,lazy:Boolean,toggleMethod:Function,loadMethod:Function,showIcon:{type:Boolean,default:!0},iconOpen:{type:String,default:()=>(0,_ui.getConfig)().tree.iconOpen},iconClose:{type:String,default:()=>(0,_ui.getConfig)().tree.iconClose},iconLoaded:{type:String,default:()=>(0,_ui.getConfig)().tree.iconLoaded},size:{type:String,default:()=>(0,_ui.getConfig)().tree.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","update:checkNodeKey","update:checkNodeKeys","node-click","node-dblclick","current-change","radio-change","checkbox-change","load-success","load-error"],setup(O,e){const{emit:n,slots:w}=e;var t=_xeUtils.default.uniqueId();const k=(0,_ui.useSize)(O)["computeSize"],c=(0,_vue.ref)(),R=(0,_vue.reactive)({currentNode:null,nodeMaps:{},selectRadioKey:O.checkNodeKey,treeList:[],treeExpandedMaps:{},treeExpandLazyLoadedMaps:{},selectCheckboxMaps:{},indeterminateCheckboxMaps:{}}),s={},E={refElem:c},$=(0,_vue.computed)(()=>O.titleField||"title"),u=(0,_vue.computed)(()=>O.keyField||"id"),h=(0,_vue.computed)(()=>{var e=u.value;return O.valueField||e}),y=(0,_vue.computed)(()=>O.parentField||"parentId"),T=(0,_vue.computed)(()=>O.childrenField||"children"),K=(0,_vue.computed)(()=>O.hasChildField||"hasChild"),m=(0,_vue.computed)(()=>{var e=p.value["isCurrent"];return _xeUtils.default.isBoolean(e)?e:O.isCurrent}),N=(0,_vue.computed)(()=>{var e=p.value["isHover"];return _xeUtils.default.isBoolean(e)?e:O.isHover}),B=(0,_vue.computed)(()=>Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.radioConfig,O.radioConfig)),j=(0,_vue.computed)(()=>Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.checkboxConfig,O.checkboxConfig)),p=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tree.nodeConfig,O.nodeConfig)),b=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tree.loadingConfig,O.loadingConfig)),M=(0,_vue.computed)(()=>{var{height:e,minHeight:t}=O,a={};return e&&(a.height=(0,_dom.toCssUnit)(e)),t&&(a.minHeight=(0,_dom.toCssUnit)(t)),a}),L={computeRadioOpts:B,computeCheckboxOpts:j,computeNodeOpts:p},z={xID:t,props:O,context:e,internalData:s,reactData:R,getRefMaps:()=>E,getComputeMaps:()=>L},A=e=>{var t=h.value,e=_xeUtils.default.get(e,t);return _xeUtils.default.eqNull(e)?"":encodeURIComponent(e)};const a=e=>{var t=R["selectRadioKey"];return t===e};const D=e=>{var t=R["selectCheckboxMaps"];return!!t[e]};const S=e=>{var t=R["indeterminateCheckboxMaps"];return!!t[e]};const U=e=>{n("update:checkNodeKeys",e)},I=e=>{n("update:checkNodeKey",e)};const l=(e,t)=>{const a=Object.assign({},R.selectCheckboxMaps);e.forEach(e=>{t?a[e]=!0:a[e]&&delete a[e]}),R.selectCheckboxMaps=a},d=e=>{const t={};e&&e.forEach(e=>{t[e]=!0}),R.selectCheckboxMaps=t},o=(e,t,a)=>{t?a[e]||(a[e]=!0):a[e]&&delete a[e]},F=(e,t,a)=>{n(e,(0,_ui.createEvent)(a,{$tree:z},t))},v={dispatchEvent:F,clearCurrentNode(){return(R.currentNode=null,_vue.nextTick)()},getCurrentNodeId(){var e=R["currentNode"];return e?A(e):null},getCurrentNode(){var{currentNode:e,nodeMaps:t}=R;if(e){t=t[A(e)];if(t)return t.item}return null},setCurrentNodeId(e){var t=R["nodeMaps"],t=t[e];return R.currentNode=t?t.item:null,(0,_vue.nextTick)()},setCurrentNode(e){return R.currentNode=e,(0,_vue.nextTick)()},clearRadioNode(){return(R.selectRadioKey=null,_vue.nextTick)()},getRadioNodeId(){return R.selectRadioKey||null},getRadioNode(){var{selectRadioKey:e,nodeMaps:t}=R;if(e){t=t[e];if(t)return t.item}return null},setRadioNodeId(e){return R.selectRadioKey=e,(0,_vue.nextTick)()},setRadioNode:e=>(e&&(R.selectRadioKey=A(e)),(0,_vue.nextTick)()),setCheckboxNode:(e,t)=>(e&&(_xeUtils.default.isArray(e)||(e=[e]),l(e.map(e=>A(e)),t)),(0,_vue.nextTick)()),setCheckboxByNodeId:(e,t)=>(e&&(_xeUtils.default.isArray(e)||(e=[e]),l(e,t)),(0,_vue.nextTick)()),getCheckboxNodeIds(){var e=R["selectCheckboxMaps"];return Object.keys(e)},getCheckboxNodes(){const{nodeMaps:a,selectCheckboxMaps:e}=R,n=[];return _xeUtils.default.each(e,(e,t)=>{t=a[t];t&&n.push(t.item)}),n},clearCheckboxNode(){return R.selectCheckboxMaps={},(0,_vue.nextTick)()},setAllCheckboxNode(e){const t={};var a=T.value;return e&&_xeUtils.default.eachTree(R.treeList,e=>{e=A(e);t[e]=!0},{children:a}),R.selectCheckboxMaps=t,(0,_vue.nextTick)()},clearExpandNode(){return v.clearAllExpandNode()},clearAllExpandNode(){return _xeUtils.default.each(R.nodeMaps,e=>{e.treeLoaded=!1}),R.treeExpandedMaps={},(0,_vue.nextTick)()},setExpandByNodeId(e,t){const a=Object.assign({},R.treeExpandedMaps);return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{o(e,t,a)}),R.treeExpandedMaps=a),(0,_vue.nextTick)()},getExpandNodeIds(){var e=R["treeExpandedMaps"];return Object.keys(e)},getExpandNodes(){const{nodeMaps:a,treeExpandedMaps:e}=R,n=[];return _xeUtils.default.each(e,(e,t)=>{t=a[t];t&&n.push(t.item)}),n},setExpandNode(e,t){const a=Object.assign({},R.treeExpandedMaps);return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{e=A(e);o(e,t,a)}),R.treeExpandedMaps=a),(0,_vue.nextTick)()},toggleExpandByNodeId(e){const t=Object.assign({},R.treeExpandedMaps);return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{o(e,!t[e],t)}),R.treeExpandedMaps=t),(0,_vue.nextTick)()},toggleExpandNode(e){const t=Object.assign({},R.treeExpandedMaps);return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{e=A(e);o(e,!t[e],t)}),R.treeExpandedMaps=t),(0,_vue.nextTick)()},setAllExpandNode(e){const a={},n=T.value;return e&&_xeUtils.default.eachTree(R.treeList,e=>{var t=_xeUtils.default.get(e,n);t&&t.length&&(t=A(e),a[t]=!0)},{children:n}),R.treeExpandedMaps=a,(0,_vue.nextTick)()},reloadExpandNode(e){var t=O["lazy"];return t?(v.clearExpandLoaded(e),x(e)):(0,_vue.nextTick)()},clearExpandLoaded(e){var t=O["lazy"],a=R["nodeMaps"];return t&&(t=a[A(e)])&&(t.treeLoaded=!1),(0,_vue.nextTick)()},loadChildrenNode(r,e){const{lazy:t,transform:a}=O,i=R["nodeMaps"];if(!t)return Promise.resolve([]);const n=T.value,l=i[A(r)],s=l?l.level:0,c=l?l.nodes:[];return(e=>{const a=h.value;return Promise.resolve(e.map(e=>{var t,e=Object.assign({},e);return A(e)||(t=getNodeUniqueId(),_xeUtils.default.set(e,a,t)),e}))})(e).then(e=>(_xeUtils.default.eachTree(e,(e,t,a,n,d,o)=>{e=A(e);i[e]={item:r,itemIndex:-1,items:a,parent:d||l.item,nodes:c.concat(o),level:s+o.length,lineCount:0,treeLoaded:!1}},{children:n}),r[n]=e,a&&(r[n]=e),g(r),e))},isExpandByNode:e=>{var t=R["treeExpandedMaps"];return!!t[A(e)]},isCheckedByRadioNodeId:a,isCheckedByRadioNode:e=>a(A(e)),isCheckedByCheckboxNodeId:D,isIndeterminateByCheckboxNode:e=>S(A(e)),isCheckedByCheckboxNode:e=>D(A(e)),getCheckboxIndeterminateNodes(){const{treeList:e,indeterminateCheckboxMaps:t}=R,a=[];return _xeUtils.default.eachTree(e,e=>{t[A(e)]&&a.push(e)}),a}},r=e=>{var{expandAll:t,transform:a}=O,n=s["initialized"],d=u.value,o=y.value,r=T.value;R.treeList=a?_xeUtils.default.toArrayTree(e,{key:d,parentKey:o,mapChildren:r}):e?e.slice(0):[];{a=R.treeList;const i=h.value,l=(d=T.value,{});_xeUtils.default.eachTree(a,(e,t,a,n,d,o)=>{let r=A(e);r||(r=getNodeUniqueId(),_xeUtils.default.set(e,i,r)),l[r]={item:e,itemIndex:t,items:a,parent:d,nodes:o,level:o.length,lineCount:0,treeLoaded:!1}},{children:d}),R.nodeMaps=l}t&&!n&&e&&e.length&&(s.initialized=!0,z.setAllExpandNode(!0))},i=(e,n,d)=>{var t=R["treeExpandedMaps"],a=T.value,o=A(e);d.lineCount++,t[o]&&_xeUtils.default.arrayEach(e[a],(e,t,a)=>{(!n||t<a.length-1)&&i(e,!1,d)})},g=e=>{const a=R["nodeMaps"];e&&(e=A(e),e=a[e])&&_xeUtils.default.lastArrayEach(e.nodes,e=>{var t=A(e),t=a[t];t&&(t.lineCount=0,i(e,!0,t))})},X=(e,t)=>{var{showRadio:a,showCheckbox:n,trigger:d}=O,o=B.value,r=j.value;let i=!1,l=!1,s=!1,c=!1;m.value?(i=!0,((e,t)=>{e.preventDefault();const a=p.value,{currentMethod:n,trigger:d}=a,o=T.value,r=_xeUtils.default.get(t,o),i=r&&r.length;let l=!!n;if(d==="child"){if(i)return}else if(d==="parent")if(!i)return;if(n)l=!n({node:t});var s;l||(s=!0,R.currentNode=t,F("current-change",{node:t,checked:!0},e))})(e,t)):R.currentNode&&(R.currentNode=null),"node"===d&&(c=!0,q(e,t)),a&&"node"===o.trigger&&(l=!0,P(e,t)),n&&"node"===r.trigger&&(s=!0,H(e,t)),F("node-click",{node:t,triggerCurrent:i,triggerRadio:l,triggerCheckbox:s,triggerExpand:c},e)},x=o=>{var e=j.value;const r=O["loadMethod"],i=e["checkStrictly"];return new Promise(e=>{if(r){var t=Object.assign({},R.treeExpandLazyLoadedMaps),a=R["nodeMaps"];const n=A(o),d=a[n];t[n]=!0,R.treeExpandLazyLoadedMaps=t,Promise.resolve(r({$tree:z,node:o})).then(a=>{var e=R["treeExpandLazyLoadedMaps"];if(d.treeLoaded=!0,e[n]&&(e[n]=!1),a=_xeUtils.default.isArray(a)?a:[])return v.loadChildrenNode(o,a).then(e=>{var t=Object.assign({},R.treeExpandedMaps);return e.length&&!t[n]&&(t[n]=!0),R.treeExpandedMaps=t,!i&&v.isCheckedByCheckboxNodeId(n)&&l(e.map(e=>A(e)),!0),g(o),F("load-success",{node:o,data:a},new Event("load-success")),(0,_vue.nextTick)()});g(o),F("load-success",{node:o,data:a},new Event("load-success"))}).catch(e=>{var t=R["treeExpandLazyLoadedMaps"];d.treeLoaded=!1,t[n]&&(t[n]=!1),g(o),F("load-error",{node:o,data:e},new Event("load-error"))}).finally(()=>(0,_vue.nextTick)())}else e()})},G=(e,t)=>{const{lazy:n,accordion:a,toggleMethod:d}=O,{nodeMaps:o,treeExpandLazyLoadedMaps:r}=R,i=Object.assign({},R.treeExpandedMaps),l=T.value,s=K.value,c=[];let u=d?e.filter(e=>d({$tree:z,expanded:t,node:e})):e;a&&(u=u.length?[u[u.length-1]]:[],e=A(u[0]),e=o[e])&&e.items.forEach(e=>{e=A(e);i[e]&&delete i[e]});const h=[];return t?u.forEach(e=>{var t,a=A(e);i[a]||(t=o[a],n&&e[s]&&!t.treeLoaded&&!r[a]?c.push(x(e)):e[l]&&e[l].length&&(i[a]=!0,h.push(e)))}):u.forEach(e=>{var t=A(e);i[t]&&(delete i[t],h.push(e))}),R.treeExpandedMaps=i,h.forEach(g),Promise.all(c)},q=(e,t)=>{var a=O["lazy"],{treeExpandedMaps:n,treeExpandLazyLoadedMaps:d}=R,o=A(t),n=!n[o];e.stopPropagation(),a&&d[o]||G([t],n)},_=(e,d,o)=>{var t=T.value,t=_xeUtils.default.get(e,t),e=A(e);if(t&&t.length){let a=!1,n=0;t.forEach(e=>{var e=A(e),t=d[e];(t||o[e])&&(t&&n++,a=!0)}),n===t.length?(d[e]||(d[e]=!0),o[e]&&delete o[e]):(d[e]&&delete d[e],o[e]=a)}else o[e]&&delete o[e]},J=()=>{var e=R["treeList"];const l=T.value;var t=j.value["checkStrictly"];if(!t){const s=Object.assign({},R.selectCheckboxMaps),c={};_xeUtils.default.eachTree(e,(e,t,a,n,d,o)=>{var r=_xeUtils.default.get(e,l);if(r&&r.length||_(e,s,c),t===a.length-1)for(let e=o.length-2;0<=e;e--){var i=o[e];_(i,s,c)}}),R.selectCheckboxMaps=s,R.indeterminateCheckboxMaps=c}},H=(e,a)=>{e.preventDefault(),e.stopPropagation();var{checkStrictly:n,checkMethod:d}=j.value;let t=!!d;if(!(t=d?!d({node:a}):t)){const r=Object.assign({},R.selectCheckboxMaps);var d=T.value,o=A(a);let t=!1;r[o]?delete r[o]:(t=!0,r[o]=t),n||_xeUtils.default.eachTree(_xeUtils.default.get(a,d),e=>{e=A(e);t?r[e]||(r[e]=!0):r[e]&&delete r[e]},{children:d}),R.selectCheckboxMaps=r,J();o=Object.keys(R.selectCheckboxMaps);U(o),F("checkbox-change",{node:a,value:o,checked:t},e)}},P=(e,t)=>{e.preventDefault(),e.stopPropagation();var a=B.value["checkMethod"];let n=!!a;(n=a?!a({node:t}):n)||(a=A(t),R.selectRadioKey=a,I(a),F("radio-change",{node:t,value:a,checked:!0},e))};Object.assign(z,v,{});const V=a=>{var{lazy:e,showRadio:t,showCheckbox:n,showLine:d,indent:o,iconOpen:r,iconClose:i,iconLoaded:l,showIcon:s}=O,{nodeMaps:c,treeExpandedMaps:u,currentNode:h,selectRadioKey:p,treeExpandLazyLoadedMaps:v}=R,g=T.value,x=$.value,_=K.value,g=_xeUtils.default.get(a,g),f=g&&g.length,C=w.icon,k=w.title,E=w.extra,y=A(a),m=u[y],c=c[y],x=_xeUtils.default.get(a,x);const N=[];f&&u[y]&&(d&&N.push((0,_vue.h)("div",{key:"line",class:"vxe-tree--node-child-line",style:{height:`calc(${c.lineCount} * var(--vxe-ui-tree-node-height) - var(--vxe-ui-tree-node-height) / 2)`,left:(c.level+1)*(o||1)+"px"}})),g.forEach(e=>{N.push(V(e))}));let b=!1,M=(t&&(b=y==p),!1),L=(n&&(M=D(y)),!1),U=!1,I=!1;return e&&(U=!!v[y],L=a[_],I=!!c.treeLoaded),(0,_vue.h)("div",{class:["vxe-tree--node-wrapper","node--level-"+c.level],nodeid:y},[(0,_vue.h)("div",{class:["vxe-tree--node-item",{"is--current":h&&y===A(h),"is-radio--checked":b,"is-checkbox--checked":M}],style:{paddingLeft:(c.level-1)*(o||1)+"px"},onClick(e){X(e,a)},onDblclick(e){var t;e=e,t=a,F("node-dblclick",{node:t},e)}},[s||d?(0,_vue.h)("div",{class:"vxe-tree--node-item-switcher"},s&&(!e||I?f:L)?[(0,_vue.h)("div",{class:"vxe-tree--node-item-icon",onClick(e){q(e,a)}},C?C({node:a,isExpand:m}):[(0,_vue.h)("i",{class:U?l||(0,_ui.getIcon)().TREE_NODE_LOADED:m?r||(0,_ui.getIcon)().TREE_NODE_OPEN:i||(0,_ui.getIcon)().TREE_NODE_CLOSE})])]:[]):(0,_ui.renderEmptyElement)(z),((t,e)=>{var a=O["showRadio"],{showIcon:n,checkMethod:d,visibleMethod:o}=B.value,o=!o||o({node:t});let r=!!d;return a&&n&&o?(d&&(r=!d({node:t})),(0,_vue.h)("div",{class:["vxe-tree--radio-option",{"is--checked":e,"is--disabled":r}],onClick:e=>{r||P(e,t)}},[(0,_vue.h)("span",{class:["vxe-radio--icon",e?(0,_ui.getIcon)().RADIO_CHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})])):(0,_ui.renderEmptyElement)(z)})(a,b),((t,e,a)=>{var n=O["showCheckbox"],{showIcon:d,checkMethod:o,visibleMethod:r}=j.value,e=S(e),r=!r||r({node:t});let i=!!o;return n&&d&&r?(o&&(i=!o({node:t})),(0,_vue.h)("div",{class:["vxe-tree--checkbox-option",{"is--checked":a,"is--indeterminate":e,"is--disabled":i}],onClick:e=>{i||H(e,t)}},[(0,_vue.h)("span",{class:["vxe-checkbox--icon",e?(0,_ui.getIcon)().CHECKBOX_INDETERMINATE:a?(0,_ui.getIcon)().CHECKBOX_CHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})])):(0,_ui.renderEmptyElement)(z)})(a,y,M),(0,_vue.h)("div",{class:"vxe-tree--node-item-inner"},[(0,_vue.h)("div",{class:"vxe-tree--node-item-title"},k?(0,_vn.getSlotVNs)(k({node:a,isExpand:m})):""+x),E?(0,_vue.h)("div",{class:"vxe-tree--node-item-extra"},(0,_vn.getSlotVNs)(E({node:a,isExpand:m}))):(0,_ui.renderEmptyElement)(z)])]),f&&u[y]?(0,_vue.h)("div",{class:"vxe-tree--node-child-wrapper"},N):(0,_ui.renderEmptyElement)(z)])};const f=(0,_vue.ref)(0),C=((0,_vue.watch)(()=>O.data?O.data.length:0,()=>{f.value++}),(0,_vue.watch)(()=>O.data,()=>{f.value++}),(0,_vue.watch)(f,()=>{r(O.data||[])}),(0,_vue.watch)(()=>O.checkNodeKey,e=>{R.selectRadioKey=e}),(0,_vue.ref)(0));return(0,_vue.watch)(()=>O.checkNodeKeys?O.checkNodeKeys.length:0,()=>{C.value++}),(0,_vue.watch)(()=>O.checkNodeKeys,()=>{C.value++}),(0,_vue.watch)(C,()=>{d(O.checkNodeKeys||[])}),(0,_vue.onUnmounted)(()=>{R.treeList=[],R.treeExpandedMaps={},R.nodeMaps={}}),r(O.data||[]),d(O.checkNodeKeys||[]),z.renderVN=()=>{var{loading:e,trigger:t,showLine:a}=O,n=k.value,d=B.value,o=j.value,r=M.value,i=b.value,l=N.value;const s=w.loading;return(0,_vue.h)("div",{ref:c,class:["vxe-tree",{["size--"+n]:n,"show--line":a,"checkbox--highlight":o.highlight,"radio--highlight":d.highlight,"node--hover":l,"node--trigger":"node"===t,"is--loading":e}],style:r},[(n=R.treeList,(0,_vue.h)("div",{class:"vxe-tree--node-list-wrapper"},n.map(e=>V(e)))),(0,_vue.h)(_loading.default,{class:"vxe-tree--loading",modelValue:e,icon:i.icon,text:i.text},s?{default:()=>s({$tree:z})}:{})])},z},render(){return this.renderVN()}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_ui=require("../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils")),_vn=require("../../ui/src/vn"),_dom=require("../../ui/src/dom"),_loading=_interopRequireDefault(require("../../loading/src/loading"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getNodeUniqueId(){return _xeUtils.default.uniqueId("node_")}var _default=exports.default=(0,_vue.defineComponent)({name:"VxeTree",props:{data:Array,height:[String,Number],minHeight:{type:[String,Number],default:()=>(0,_ui.getConfig)().tree.minHeight},loading:Boolean,loadingConfig:Object,accordion:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.accordion},childrenField:{type:String,default:()=>(0,_ui.getConfig)().tree.childrenField},valueField:{type:String,default:()=>(0,_ui.getConfig)().tree.valueField},keyField:{type:String,default:()=>(0,_ui.getConfig)().tree.keyField},parentField:{type:String,default:()=>(0,_ui.getConfig)().tree.parentField},titleField:{type:String,default:()=>(0,_ui.getConfig)().tree.titleField},hasChildField:{type:String,default:()=>(0,_ui.getConfig)().tree.hasChildField},mapChildrenField:{type:String,default:()=>(0,_ui.getConfig)().tree.mapChildrenField},transform:Boolean,isCurrent:Boolean,isHover:Boolean,expandAll:Boolean,showLine:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.showLine},trigger:String,indent:{type:Number,default:()=>(0,_ui.getConfig)().tree.indent},showRadio:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.showRadio},checkNodeKey:{type:[String,Number],default:()=>(0,_ui.getConfig)().tree.checkNodeKey},radioConfig:Object,showCheckbox:{type:Boolean,default:()=>(0,_ui.getConfig)().tree.showCheckbox},checkNodeKeys:{type:Array,default:()=>(0,_ui.getConfig)().tree.checkNodeKeys},checkboxConfig:Object,nodeConfig:Object,lazy:Boolean,toggleMethod:Function,loadMethod:Function,showIcon:{type:Boolean,default:!0},iconOpen:{type:String,default:()=>(0,_ui.getConfig)().tree.iconOpen},iconClose:{type:String,default:()=>(0,_ui.getConfig)().tree.iconClose},iconLoaded:{type:String,default:()=>(0,_ui.getConfig)().tree.iconLoaded},size:{type:String,default:()=>(0,_ui.getConfig)().tree.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","update:checkNodeKey","update:checkNodeKeys","node-click","node-dblclick","current-change","radio-change","checkbox-change","load-success","load-error"],setup(L,e){const{emit:d,slots:w}=e;var C=_xeUtils.default.uniqueId();const k=(0,_ui.useSize)(L)["computeSize"],c=(0,_vue.ref)(),R=(0,_vue.reactive)({currentNode:null,selectRadioKey:L.checkNodeKey,treeList:[],updateExpandedFlag:1,updateCheckboxFlag:1}),T={nodeMaps:{},selectCheckboxMaps:{},indeterminateRowMaps:{},treeExpandedMaps:{},treeExpandLazyLoadedMaps:{}},E={refElem:c},X=(0,_vue.computed)(()=>L.titleField||"title"),u=(0,_vue.computed)(()=>L.keyField||"id"),s=(0,_vue.computed)(()=>{var e=u.value;return L.valueField||e}),y=(0,_vue.computed)(()=>L.parentField||"parentId"),K=(0,_vue.computed)(()=>L.childrenField||"children"),h=(0,_vue.computed)(()=>L.mapChildrenField||"mapChildren"),O=(0,_vue.computed)(()=>L.hasChildField||"hasChild"),m=(0,_vue.computed)(()=>{var e=p.value["isCurrent"];return _xeUtils.default.isBoolean(e)?e:L.isCurrent}),N=(0,_vue.computed)(()=>{var e=p.value["isHover"];return _xeUtils.default.isBoolean(e)?e:L.isHover}),B=(0,_vue.computed)(()=>Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.radioConfig,L.radioConfig)),S=(0,_vue.computed)(()=>Object.assign({showIcon:!0},(0,_ui.getConfig)().tree.checkboxConfig,L.checkboxConfig)),p=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tree.nodeConfig,L.nodeConfig)),M=(0,_vue.computed)(()=>Object.assign({},(0,_ui.getConfig)().tree.loadingConfig,L.loadingConfig)),b=(0,_vue.computed)(()=>{var{height:e,minHeight:t}=L,a={};return e&&(a.height=(0,_dom.toCssUnit)(e)),t&&(a.minHeight=(0,_dom.toCssUnit)(t)),a}),U={computeRadioOpts:B,computeCheckboxOpts:S,computeNodeOpts:p},z={xID:C,props:L,context:e,internalData:T,reactData:R,getRefMaps:()=>E,getComputeMaps:()=>U},A=e=>{var t=s.value,e=_xeUtils.default.get(e,t);return _xeUtils.default.eqNull(e)?"":encodeURIComponent(e)};const t=e=>{var t=R["selectRadioKey"];return t===e};const D=e=>{var t=R["updateCheckboxFlag"],a=T["selectCheckboxMaps"];return!(!t||!a[e])};const q=e=>{var t=R["updateCheckboxFlag"],a=T["indeterminateRowMaps"];return!(!t||!a[e])};const I=e=>{d("update:checkNodeKeys",e)},F=e=>{d("update:checkNodeKey",e)};const a=(e,t)=>{const a=T["nodeMaps"];if(e){_xeUtils.default.isArray(e)||(e=[e]);const d=[];e.forEach(e=>{e=a[e];e&&d.push(e.item)}),i(d,t)}return(0,_vue.nextTick)()},i=(e,a)=>{var t=L["transform"];const d=T["selectCheckboxMaps"];var n=h.value,o=K.value,r=S.value["checkStrictly"],i=e=>{var t=A(e);a?d[t]||(d[t]=e):d[t]&&delete d[t]};r?e.forEach(i):_xeUtils.default.eachTree(e,i,{children:t?n:o}),R.updateCheckboxFlag++,x()},n=(e,t,a)=>{t?a[e]||(a[e]=!0):a[e]&&delete a[e]},H=(e,t,a)=>{d(e,(0,_ui.createEvent)(a,{$tree:z},t))},o={dispatchEvent:H,clearCurrentNode(){return(R.currentNode=null,_vue.nextTick)()},getCurrentNodeId(){var e=R["currentNode"];return e?A(e):null},getCurrentNode(){var e=R["currentNode"],t=T["nodeMaps"];if(e){t=t[A(e)];if(t)return t.item}return null},setCurrentNodeId(e){var t=T["nodeMaps"],t=t[e];return R.currentNode=t?t.item:null,(0,_vue.nextTick)()},setCurrentNode(e){return R.currentNode=e,(0,_vue.nextTick)()},clearRadioNode(){return(R.selectRadioKey=null,_vue.nextTick)()},getRadioNodeId(){return R.selectRadioKey||null},getRadioNode(){var e=R["selectRadioKey"],t=T["nodeMaps"];if(e){t=t[e];if(t)return t.item}return null},setRadioNodeId(e){return R.selectRadioKey=e,(0,_vue.nextTick)()},setRadioNode:e=>(e&&(R.selectRadioKey=A(e)),(0,_vue.nextTick)()),setCheckboxNode:(e,t)=>(e&&(_xeUtils.default.isArray(e)||(e=[e]),i(e,t)),(0,_vue.nextTick)()),setCheckboxByNodeId:a,getCheckboxNodeIds(){var e=T["selectCheckboxMaps"];return Object.keys(e)},getCheckboxNodes(){const{nodeMaps:a,selectCheckboxMaps:e}=T,d=[];return _xeUtils.default.each(e,(e,t)=>{t=a[t];t&&d.push(t.item)}),d},clearCheckboxNode(){return T.selectCheckboxMaps={},R.updateCheckboxFlag++,(0,_vue.nextTick)()},setAllCheckboxNode(e){var t=L["transform"];const a={};var d=K.value,n=h.value;return e&&_xeUtils.default.eachTree(R.treeList,e=>{e=A(e);a[e]=!0},{children:t?n:d}),T.selectCheckboxMaps=a,R.updateCheckboxFlag++,(0,_vue.nextTick)()},clearExpandNode(){return o.clearAllExpandNode()},clearAllExpandNode(){var e=T["nodeMaps"];return _xeUtils.default.each(e,e=>{e.treeLoaded=!1}),T.treeExpandedMaps={},R.updateExpandedFlag++,(0,_vue.nextTick)()},setExpandByNodeId(e,t){const a=T["treeExpandedMaps"];return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{n(e,t,a)}),R.updateExpandedFlag++),(0,_vue.nextTick)()},getExpandNodeIds(){var e=T["treeExpandedMaps"];return _xeUtils.default.keys(e)},getExpandNodes(){const{nodeMaps:a,treeExpandedMaps:e}=T,d=[];return _xeUtils.default.each(e,(e,t)=>{t=a[t];t&&d.push(t.item)}),d},setExpandNode(e,t){const a=T["treeExpandedMaps"];return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{e=A(e);n(e,t,a)}),R.updateExpandedFlag++),(0,_vue.nextTick)()},toggleExpandByNodeId(e){const t=T["treeExpandedMaps"];return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{n(e,!t[e],t)}),R.updateExpandedFlag++),(0,_vue.nextTick)()},toggleExpandNode(e){const t=T["treeExpandedMaps"];return e&&((e=_xeUtils.default.isArray(e)?e:[e]).forEach(e=>{e=A(e);n(e,!t[e],t)}),R.updateExpandedFlag++),(0,_vue.nextTick)()},setAllExpandNode(e){var t=L["transform"];const a=T["treeExpandedMaps"],d=K.value;var n=h.value;return e&&_xeUtils.default.eachTree(R.treeList,e=>{var t=_xeUtils.default.get(e,d);t&&t.length&&(t=A(e),a[t]=!0)},{children:t?n:d}),R.updateExpandedFlag++,(0,_vue.nextTick)()},reloadExpandNode(e){var t=L["lazy"];return t?(o.clearExpandLoaded(e),g(e)):(0,_vue.nextTick)()},clearExpandLoaded(e){var t=L["lazy"],a=T["nodeMaps"];return t&&(t=a[A(e)])&&(t.treeLoaded=!1),(0,_vue.nextTick)()},loadChildrenNode(r,e){const{lazy:t,transform:a}=L,i=T["nodeMaps"];if(!t)return Promise.resolve([]);const d=K.value,l=i[A(r)],u=l?l.level:0,c=l?l.nodes:[];return(e=>{const a=s.value;return Promise.resolve(e.map(e=>{var t,e=Object.assign({},e);return A(e)||(t=getNodeUniqueId(),_xeUtils.default.set(e,a,t)),e}))})(e).then(e=>(_xeUtils.default.eachTree(e,(e,t,a,d,n,o)=>{e=A(e);i[e]={item:r,itemIndex:-1,items:a,parent:n||l.item,nodes:c.concat(o),level:u+o.length,lineCount:0,treeLoaded:!1}},{children:d}),r[d]=e,a&&(r[d]=e),v(r),e))},isExpandByNode:e=>{var t=R["updateExpandedFlag"],a=T["treeExpandedMaps"],e=A(e);return!(!t||!a[e])},isCheckedByRadioNodeId:t,isCheckedByRadioNode:e=>t(A(e)),isCheckedByCheckboxNodeId:D,isIndeterminateByCheckboxNode:e=>q(A(e)),isCheckedByCheckboxNode:e=>D(A(e)),getCheckboxIndeterminateNodes(){const{nodeMaps:a,indeterminateRowMaps:e}=T,d=[];return _xeUtils.default.each(e,(e,t)=>{t=a[t];t&&d.push(t.item)}),d}},r=e=>{var{expandAll:t,transform:a}=L,d=T["initialized"],n=u.value,o=y.value,r=h.value;R.treeList=a?_xeUtils.default.toArrayTree(e,{key:n,parentKey:o,mapChildren:r}):e?e.slice(0):[];{a=L.transform,n=R.treeList;const i=s.value,l=(o=K.value,r=h.value,{});_xeUtils.default.eachTree(n,(e,t,a,d,n,o)=>{let r=A(e);r||(r=getNodeUniqueId(),_xeUtils.default.set(e,i,r)),l[r]={item:e,itemIndex:t,items:a,parent:n,nodes:o,level:o.length,lineCount:0,treeLoaded:!1}},{children:a?r:o}),T.nodeMaps=l}d||e&&e.length&&(T.initialized=!0,t&&z.setAllExpandNode(!0),z.setCheckboxByNodeId(L.checkNodeKeys||[],!0))},l=(e,d,n)=>{var t=T["treeExpandedMaps"],a=K.value,o=A(e);n.lineCount++,t[o]&&_xeUtils.default.arrayEach(e[a],(e,t,a)=>{(!d||t<a.length-1)&&l(e,!1,n)})},v=e=>{const a=T["nodeMaps"];e&&(e=A(e),e=a[e])&&_xeUtils.default.lastArrayEach(e.nodes,e=>{var t=A(e),t=a[t];t&&(t.lineCount=0,l(e,!0,t))})},G=(e,t)=>{var{showRadio:a,showCheckbox:d,trigger:n}=L,o=B.value,r=S.value;let i=!1,l=!1,u=!1,c=!1;m.value?(i=!0,((e,t)=>{e.preventDefault();const a=p.value,{currentMethod:d,trigger:n}=a,o=K.value,r=_xeUtils.default.get(t,o),i=r&&r.length;let l=!!d;if(n==="child"){if(i)return}else if(n==="parent")if(!i)return;if(d)l=!d({node:t});var u;l||(u=!0,R.currentNode=t,H("current-change",{node:t,checked:!0},e))})(e,t)):R.currentNode&&(R.currentNode=null),"node"===n&&(c=!0,j(e,t)),a&&"node"===o.trigger&&(l=!0,V(e,t)),d&&"node"===r.trigger&&(u=!0,P(e,t)),H("node-click",{node:t,triggerCurrent:i,triggerRadio:l,triggerCheckbox:u,triggerExpand:c},e)},g=o=>{var e=S.value;const a=L["loadMethod"],r=e["checkStrictly"];return new Promise(e=>{if(a){var t=T["nodeMaps"];const d=A(o),n=t[d];T.treeExpandLazyLoadedMaps[d]=!0,Promise.resolve(a({$tree:z,node:o})).then(a=>{var e=T["treeExpandLazyLoadedMaps"];if(n.treeLoaded=!0,e[d]&&(e[d]=!1),a=_xeUtils.default.isArray(a)?a:[])return z.loadChildrenNode(o,a).then(e=>{var t=T["treeExpandedMaps"];return e.length&&!t[d]&&(t[d]=!0),R.updateExpandedFlag++,!r&&z.isCheckedByCheckboxNodeId(d)&&i(e,!0),v(o),H("load-success",{node:o,data:a},new Event("load-success")),(0,_vue.nextTick)()});v(o),H("load-success",{node:o,data:a},new Event("load-success"))}).catch(e=>{var t=T["treeExpandLazyLoadedMaps"];n.treeLoaded=!1,t[d]&&(t[d]=!1),v(o),H("load-error",{node:o,data:e},new Event("load-error"))}).finally(()=>(0,_vue.nextTick)())}else e()})},J=(e,t)=>{const{lazy:d,accordion:a,toggleMethod:n}=L,{treeExpandLazyLoadedMaps:o,treeExpandedMaps:r}=T,i=T["nodeMaps"],l=K.value,u=O.value,c=[];let s=n?e.filter(e=>n({$tree:z,expanded:t,node:e})):e;a&&(s=s.length?[s[s.length-1]]:[],e=A(s[0]),e=i[e])&&e.items.forEach(e=>{e=A(e);r[e]&&delete r[e]});const h=[];return t?s.forEach(e=>{var t,a=A(e);r[a]||(t=i[a],d&&e[u]&&!t.treeLoaded&&!o[a]?c.push(g(e)):e[l]&&e[l].length&&(r[a]=!0,h.push(e)))}):s.forEach(e=>{var t=A(e);r[t]&&(delete r[t],h.push(e))}),R.updateExpandedFlag++,h.forEach(v),Promise.all(c)},j=(e,t)=>{var a=L["lazy"],{treeExpandedMaps:d,treeExpandLazyLoadedMaps:n}=T,o=A(t),d=!d[o];e.stopPropagation(),a&&n[o]||J([t],d)},x=()=>{var e=L["transform"],t=R["treeList"];const{selectCheckboxMaps:i,indeterminateRowMaps:l}=T,d=K.value;var a=h.value;const{checkStrictly:n,checkMethod:u}=S.value;if(!n){const o={},r=[];_xeUtils.default.eachTree(t,e=>{var t=A(e),a=e[d];a&&a.length&&!o[t]&&(o[t]=1,r.unshift([e,t,a]))},{children:e?a:d}),r.forEach(e=>{var t=e[0],a=e[1],e=e[2];let d=0,n=0,o=0;e.forEach(u?e=>{var t=A(e),a=i[t];u({node:e})?(a?d++:l[t]&&n++,o++):a?d++:l[t]&&n++}:e=>{e=A(e);i[e]?d++:l[e]&&n++,o++});var e=d>=o,r=!e&&(1<=d||1<=n);e?(i[a]=t,l[a]&&delete l[a]):(i[a]&&delete i[a],r?l[a]=t:l[a]&&delete l[a])}),R.updateCheckboxFlag++}},P=(e,a)=>{e.preventDefault(),e.stopPropagation();var d=L["transform"];const n=T["selectCheckboxMaps"];var o=K.value,r=h.value,{checkStrictly:i,checkMethod:l}=S.value;let t=!!l;if(!(t=l?!l({node:a}):t)){l=A(a);let t=!1;n[l]?delete n[l]:(t=!0,n[l]=a),i||_xeUtils.default.eachTree(_xeUtils.default.get(a,o),e=>{e=A(e);t?n[e]||(n[e]=!0):n[e]&&delete n[e]},{children:d?r:o}),R.updateCheckboxFlag++,x();l=_xeUtils.default.keys(n);I(l),H("checkbox-change",{node:a,value:l,checked:t},e)}},V=(e,t)=>{e.preventDefault(),e.stopPropagation();var a=B.value["checkMethod"];let d=!!a;(d=a?!a({node:t}):d)||(a=A(t),R.selectRadioKey=a,F(a),H("radio-change",{node:t,value:a,checked:!0},e))};Object.assign(z,o,{});const $=a=>{var{lazy:e,showRadio:t,showCheckbox:d,showLine:n,indent:o,iconOpen:r,iconClose:i,iconLoaded:l,showIcon:u}=L,{currentNode:c,selectRadioKey:s,updateExpandedFlag:h}=R,{nodeMaps:p,treeExpandedMaps:v,treeExpandLazyLoadedMaps:g}=T,x=K.value,_=X.value,f=O.value,x=_xeUtils.default.get(a,x),C=x&&x.length,k=w.icon,E=w.title,y=w.extra,m=A(a),h=h&&v[m],p=p[m],_=_xeUtils.default.get(a,_);const N=[];C&&v[m]&&(n&&N.push((0,_vue.h)("div",{key:"line",class:"vxe-tree--node-child-line",style:{height:`calc(${p.lineCount} * var(--vxe-ui-tree-node-height) - var(--vxe-ui-tree-node-height) / 2)`,left:(p.level+1)*(o||1)+"px"}})),x.forEach(e=>{N.push($(e))}));let M=!1,b=(t&&(M=m==s),!1),U=(d&&(b=D(m)),!1),I=!1,F=!1;return e&&(I=!!g[m],U=a[f],F=!!p.treeLoaded),(0,_vue.h)("div",{class:["vxe-tree--node-wrapper","node--level-"+p.level],nodeid:m},[(0,_vue.h)("div",{class:["vxe-tree--node-item",{"is--current":c&&m===A(c),"is-radio--checked":M,"is-checkbox--checked":b}],style:{paddingLeft:(p.level-1)*(o||1)+"px"},onClick(e){G(e,a)},onDblclick(e){var t;e=e,t=a,H("node-dblclick",{node:t},e)}},[u||n?(0,_vue.h)("div",{class:"vxe-tree--node-item-switcher"},u&&(!e||F?C:U)?[(0,_vue.h)("div",{class:"vxe-tree--node-item-icon",onClick(e){j(e,a)}},k?k({node:a,isExpand:h}):[(0,_vue.h)("i",{class:I?l||(0,_ui.getIcon)().TREE_NODE_LOADED:h?r||(0,_ui.getIcon)().TREE_NODE_OPEN:i||(0,_ui.getIcon)().TREE_NODE_CLOSE})])]:[]):(0,_ui.renderEmptyElement)(z),((t,e)=>{var a=L["showRadio"],{showIcon:d,checkMethod:n,visibleMethod:o}=B.value,o=!o||o({node:t});let r=!!n;return a&&d&&o?(n&&(r=!n({node:t})),(0,_vue.h)("div",{class:["vxe-tree--radio-option",{"is--checked":e,"is--disabled":r}],onClick:e=>{r||V(e,t)}},[(0,_vue.h)("span",{class:["vxe-radio--icon",e?(0,_ui.getIcon)().RADIO_CHECKED:(0,_ui.getIcon)().RADIO_UNCHECKED]})])):(0,_ui.renderEmptyElement)(z)})(a,M),((t,e,a)=>{var d=L["showCheckbox"],{showIcon:n,checkMethod:o,visibleMethod:r}=S.value,e=q(e),r=!r||r({node:t});let i=!!o;return d&&n&&r?(o&&(i=!o({node:t})),(0,_vue.h)("div",{class:["vxe-tree--checkbox-option",{"is--checked":a,"is--indeterminate":e,"is--disabled":i}],onClick:e=>{i||P(e,t)}},[(0,_vue.h)("span",{class:["vxe-checkbox--icon",e?(0,_ui.getIcon)().CHECKBOX_INDETERMINATE:a?(0,_ui.getIcon)().CHECKBOX_CHECKED:(0,_ui.getIcon)().CHECKBOX_UNCHECKED]})])):(0,_ui.renderEmptyElement)(z)})(a,m,b),(0,_vue.h)("div",{class:"vxe-tree--node-item-inner"},[(0,_vue.h)("div",{class:"vxe-tree--node-item-title"},E?(0,_vn.getSlotVNs)(E({node:a,isExpand:h})):""+_),y?(0,_vue.h)("div",{class:"vxe-tree--node-item-extra"},(0,_vn.getSlotVNs)(y({node:a,isExpand:h}))):(0,_ui.renderEmptyElement)(z)])]),C&&v[m]?(0,_vue.h)("div",{class:"vxe-tree--node-child-wrapper"},N):(0,_ui.renderEmptyElement)(z)])};const _=(0,_vue.ref)(0),f=((0,_vue.watch)(()=>L.data?L.data.length:0,()=>{_.value++}),(0,_vue.watch)(()=>L.data,()=>{_.value++}),(0,_vue.watch)(_,()=>{r(L.data||[])}),(0,_vue.watch)(()=>L.checkNodeKey,e=>{R.selectRadioKey=e}),(0,_vue.ref)(0));return(0,_vue.watch)(()=>L.checkNodeKeys?L.checkNodeKeys.length:0,()=>{f.value++}),(0,_vue.watch)(()=>L.checkNodeKeys,()=>{f.value++}),(0,_vue.watch)(f,()=>{var e;e=L.checkNodeKeys||[],a(e,!0)}),(0,_vue.onUnmounted)(()=>{R.treeList=[],T.treeExpandedMaps={},T.indeterminateRowMaps={},T.nodeMaps={}}),r(L.data||[]),z.renderVN=()=>{var{loading:e,trigger:t,showLine:a}=L,d=k.value,n=B.value,o=S.value,r=b.value,i=M.value,l=N.value;const u=w.loading;return(0,_vue.h)("div",{ref:c,class:["vxe-tree",{["size--"+d]:d,"show--line":a,"checkbox--highlight":o.highlight,"radio--highlight":n.highlight,"node--hover":l,"node--trigger":"node"===t,"is--loading":e}],style:r},[(d=R.treeList,(0,_vue.h)("div",{class:"vxe-tree--node-list-wrapper"},d.map(e=>$(e)))),(0,_vue.h)(_loading.default,{class:"vxe-tree--loading",modelValue:e,icon:i.icon,text:i.text},u?{default:()=>u({$tree:z})}:{})])},z},render(){return this.renderVN()}});
package/lib/ui/index.js CHANGED
@@ -26,19 +26,15 @@ Object.keys(_core).forEach(function (key) {
26
26
  });
27
27
  var _dynamics = require("../dynamics");
28
28
  var _log = require("./src/log");
29
- const version = exports.version = "4.6.9";
29
+ const version = exports.version = "4.6.10";
30
30
  _core.VxeUI.uiVersion = version;
31
31
  _core.VxeUI.dynamicApp = _dynamics.dynamicApp;
32
32
  function config(options) {
33
- if (process.env.NODE_ENV === 'development') {
34
- (0, _log.warnLog)('vxe.error.delFunc', ['config', 'setConfig']);
35
- }
33
+ (0, _log.warnLog)('vxe.error.delFunc', ['config', 'setConfig']);
36
34
  return (0, _core.setConfig)(options);
37
35
  }
38
36
  function setup(options) {
39
- if (process.env.NODE_ENV === 'development') {
40
- (0, _log.warnLog)('vxe.error.delFunc', ['setup', 'setConfig']);
41
- }
37
+ (0, _log.warnLog)('vxe.error.delFunc', ['setup', 'setConfig']);
42
38
  return (0, _core.setConfig)(options);
43
39
  }
44
40
  _core.VxeUI.config = config;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.6.9";function config(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"hex",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_COPY:iconPrefix+"copy",EYE_DROPPER:iconPrefix+"dropper",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={version:!0,config:!0,setup:!0},_core=(exports.config=config,exports.default=void 0,exports.setup=setup,exports.version=void 0,require("@vxe-ui/core")),_dynamics=(Object.keys(_core).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_core[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _core[e]}})}),require("../dynamics")),_log=require("./src/log");const version=exports.version="4.6.10";function config(e){return(0,_log.warnLog)("vxe.error.delFunc",["config","setConfig"]),(0,_core.setConfig)(e)}function setup(e){return(0,_log.warnLog)("vxe.error.delFunc",["setup","setConfig"]),(0,_core.setConfig)(e)}_core.VxeUI.uiVersion=version,_core.VxeUI.dynamicApp=_dynamics.dynamicApp,_core.VxeUI.config=config,_core.VxeUI.setup=setup,(0,_core.setConfig)({alert:{},anchor:{},anchorLink:{},avatar:{},badge:{},breadcrumb:{separator:"/"},breadcrumbItem:{},button:{trigger:"hover",prefixTooltip:{enterable:!0},suffixTooltip:{enterable:!0}},buttonGroup:{},calendar:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1},card:{border:!0,padding:!0},carousel:{height:200,loop:!0,interval:5e3},carouselItem:{},checkbox:{},checkboxGroup:{},col:{},collapse:{padding:!0,expandConfig:{showIcon:!0}},collapsePane:{},countdown:{},colorPicker:{type:"hex",clearable:!0,showAlpha:!0,clickToCopy:!0,showColorExtractor:!0,showQuick:!0},datePanel:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1},datePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,autoClose:!0,showClearButton:null,showConfirmButton:null},dateRangePicker:{shortcutConfig:{align:"left",mode:"text",autoClose:!0},startDay:1,selectDay:1,separator:" ~ ",autoClose:!0,showClearButton:null,showConfirmButton:null},drawer:{position:"right",showHeader:!0,lockView:!0,mask:!0,showTitleOverflow:!0,showClose:!0,padding:!0,cancelClosable:!0,confirmClosable:!0},empty:{},form:{validConfig:{showMessage:!0,autoPos:!0,theme:"beautify"},tooltipConfig:{enterable:!0},titleAsterisk:!0,titleOverflow:!1,padding:!0},formDesign:{height:400,showHeader:!0,showPc:!0},formGather:{},formGroup:{},formItem:{},formView:{},icon:{},iconPicker:{icons:["home","company","comment","setting","send","envelope","envelope-open","bell","search","print","pc","goods","chart-line","edit","delete","save","folder","microphone","flag","link","location","sunny","rmb","usd","user","add-user","add-users","star","unlock","time","text","feedback","calendar","association-form","cloud-download","cloud-upload","file","subtable","chart-bar-x","chart-bar-y","chart-line","chart-pie","chart-radar"]},image:{showPreview:!0,showPrintButton:!0,maskClosable:!0},imageGroup:{showPreview:!0,showPrintButton:!0},imagePreview:{showPrintButton:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},layoutAside:{},layoutBody:{},layoutContainer:{},layoutFooter:{},layoutHeader:{},link:{underline:!0},listDesign:{height:400,showPc:!0},listView:{},list:{virtualYConfig:{enabled:!0,gt:100}},loading:{showIcon:!0,showText:!0},modal:{top:16,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,padding:!0,draggable:!0,showConfirmButton:null,cancelClosable:!0,confirmClosable:!0,zoomConfig:{minimizeMaxSize:10,minimizeVerticalOffset:{top:-24,left:0},minimizeHorizontalOffset:{top:0,left:32}},storageKey:"VXE_MODAL_POSITION"},noticeBar:{},numberInput:{digits:2,autoFill:!0,controlConfig:{enabled:!0,layout:"right",showButton:!0,isWheel:!0}},optgroup:{},option:{},pager:{pageSizePlacement:"top"},print:{pageStyle:{}},passwordInput:{controls:!0},printPageBreak:{},pulldown:{destroyOnClose:!0},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},rate:{},result:{},row:{},select:{multiCharOverflow:8,remoteConfig:{enabled:!0,autoLoad:!0},virtualYConfig:{enabled:!0,gt:100,oSize:2}},split:{resize:!0,itemConfig:{minWidth:40,minHeight:40}},splitPane:{},slider:{max:100,min:0},steps:{},switch:{},tabPane:{},tableSelect:{gridConfig:{showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,rowConfig:{isHover:!0},virtualXConfig:{enabled:!0,gt:0},virtualYConfig:{enabled:!0,gt:0}}},tabs:{},tag:{},textEllipsis:{underline:!0},text:{},textarea:{resize:"none"},tip:{},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300,isArrow:!0},tree:{indent:20,minHeight:60,radioConfig:{strict:!0}},treeSelect:{treeConfig:{radioConfig:{},checkboxConfig:{}}},upload:{mode:"all",imageTypes:["jpg","jpeg","png","gif"],showList:!0,showUploadButton:!0,showButtonText:!0,showRemoveButton:!0,showButtonIcon:!0,showPreview:!0,dragToUpload:!0,showLimitSize:!0,showLimitCount:!0},watermark:{rotate:-30,gap:[100,100]},table:{},colgroup:{},column:{},toolbar:{},grid:{}});const iconPrefix="vxe-icon-";(0,_core.setIcon)({LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",BUTTON_TOOLTIP_ICON:iconPrefix+"question-circle-fill",MENU_ITEM_EXPAND_OPEN:iconPrefix+"arrow-down rotate180",MENU_ITEM_EXPAND_CLOSE:iconPrefix+"arrow-down",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",ADD_OPTION:iconPrefix+"add",ICON_PICKER_OPEN:iconPrefix+"caret-down rotate180",ICON_PICKER_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",RADIO_CHECKED:iconPrefix+"radio-checked-fill",RADIO_UNCHECKED:iconPrefix+"radio-unchecked",CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_SEARCH:iconPrefix+"search",INPUT_PLUS_NUM:iconPrefix+"caret-up",INPUT_MINUS_NUM:iconPrefix+"caret-down",NUMBER_INPUT_MINUS_NUM:iconPrefix+"minus",NUMBER_INPUT_PLUS_NUM:iconPrefix+"add",DATE_PICKER_DATE:iconPrefix+"calendar",PASSWORD_INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",PASSWORD_INPUT_HIDE_PWD:iconPrefix+"eye-fill",MODAL_ZOOM_MIN:iconPrefix+"minus",MODAL_ZOOM_REVERT:iconPrefix+"recover",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warning-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",DRAWER_CLOSE:iconPrefix+"close",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up",FORM_DESIGN_STYLE_SETTING:iconPrefix+"layout",FORM_DESIGN_PROPS_PC:iconPrefix+"pc",FORM_DESIGN_PROPS_MOBILE:iconPrefix+"mobile",FORM_DESIGN_PROPS_ADD:iconPrefix+"add",FORM_DESIGN_PROPS_EDIT:iconPrefix+"edit",FORM_DESIGN_WIDGET_ADD:iconPrefix+"square-plus-fill",FORM_DESIGN_WIDGET_COPY:iconPrefix+"copy",FORM_DESIGN_WIDGET_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_SWAP_LR:iconPrefix+"swap",FORM_DESIGN_WIDGET_OPTION_DELETE:iconPrefix+"delete",FORM_DESIGN_WIDGET_OPTION_EXPAND_OPEN:iconPrefix+"square-plus",FORM_DESIGN_WIDGET_OPTION_EXPAND_CLOSE:iconPrefix+"square-minus",LIST_DESIGN_FIELD_SETTING:iconPrefix+"custom-column",LIST_DESIGN_LIST_SETTING:iconPrefix+"menu",LIST_DESIGN_LIST_SETTING_SEARCH_DELETE:iconPrefix+"delete",LIST_DESIGN_LIST_SETTING_ACTIVE_DELETE:iconPrefix+"delete",UPLOAD_FILE_ERROR:iconPrefix+"warning-circle-fill",UPLOAD_FILE_ADD:iconPrefix+"upload",UPLOAD_FILE_REMOVE:iconPrefix+"delete",UPLOAD_FILE_DOWNLOAD:iconPrefix+"download",UPLOAD_IMAGE_RE_UPLOAD:iconPrefix+"repeat",UPLOAD_IMAGE_ADD:iconPrefix+"add",UPLOAD_IMAGE_REMOVE:iconPrefix+"close",UPLOAD_LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",UPLOAD_FILE_TYPE_DEFAULT:iconPrefix+"file",UPLOAD_FILE_TYPE_XLSX:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_XLS:iconPrefix+"file-excel",UPLOAD_FILE_TYPE_PDF:iconPrefix+"file-pdf",UPLOAD_FILE_TYPE_PNG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_GIF:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_JPEG:iconPrefix+"file-image",UPLOAD_FILE_TYPE_MD:iconPrefix+"file-markdown",UPLOAD_FILE_TYPE_PPD:iconPrefix+"file-ppt",UPLOAD_FILE_TYPE_DOCX:iconPrefix+"file-word",UPLOAD_FILE_TYPE_DOC:iconPrefix+"file-word",UPLOAD_FILE_TYPE_ZIP:iconPrefix+"file-zip",UPLOAD_FILE_TYPE_TXT:iconPrefix+"file-txt",IMAGE_PREVIEW_CLOSE:iconPrefix+"close",IMAGE_PREVIEW_PREVIOUS:iconPrefix+"arrow-left",IMAGE_PREVIEW_NEXT:iconPrefix+"arrow-right",IMAGE_PREVIEW_PCT_FULL:iconPrefix+"pct-full",IMAGE_PREVIEW_PCT_1_1:iconPrefix+"pct-1-1",IMAGE_PREVIEW_ZOOM_OUT:iconPrefix+"search-zoom-out",IMAGE_PREVIEW_ZOOM_IN:iconPrefix+"search-zoom-in",IMAGE_PREVIEW_ROTATE_LEFT:iconPrefix+"rotate-left",IMAGE_PREVIEW_ROTATE_RIGHT:iconPrefix+"rotate-right",IMAGE_PREVIEW_PRINT:iconPrefix+"print",IMAGE_PREVIEW_DOWNLOAD:iconPrefix+"download",ALERT_CLOSE:iconPrefix+"close",ALERT_INFO:iconPrefix+"info-circle-fill",ALERT_SUCCESS:iconPrefix+"success-circle-fill",ALERT_WARNING:iconPrefix+"warning-circle-fill",ALERT_ERROR:iconPrefix+"error-circle-fill",TREE_NODE_OPEN:iconPrefix+"caret-right rotate90",TREE_NODE_CLOSE:iconPrefix+"caret-right",TREE_NODE_LOADED:iconPrefix+"spinner roll",TREE_SELECT_LOADED:iconPrefix+"spinner roll",TREE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TREE_SELECT_CLOSE:iconPrefix+"caret-down",TABLE_SELECT_LOADED:iconPrefix+"spinner roll",TABLE_SELECT_OPEN:iconPrefix+"caret-down rotate180",TABLE_SELECT_CLOSE:iconPrefix+"caret-down",TABS_TAB_BUTTON_LEFT:iconPrefix+"arrow-left",TABS_TAB_BUTTON_RIGHT:iconPrefix+"arrow-right",TABS_TAB_CLOSE:iconPrefix+"close",TABS_TAB_REFRESH:iconPrefix+"refresh",TABS_TAB_REFRESH_LOADING:iconPrefix+"refresh roll",TEXT_COPY:iconPrefix+"copy",TEXT_LOADING:iconPrefix+"spinner roll",CAROUSEL_HORIZONTAL_PREVIOUS:iconPrefix+"arrow-left",CAROUSEL_HORIZONTAL_NEXT:iconPrefix+"arrow-right",CAROUSEL_VERTICAL_PREVIOUS:iconPrefix+"arrow-up",CAROUSEL_VERTICAL_NEXT:iconPrefix+"arrow-down",COLLAPSE_OPEN:iconPrefix+"arrow-right rotate90",COLLAPSE_CLOSE:iconPrefix+"arrow-right",EMPTY_DEFAULT:iconPrefix+"empty",RESULT_INFO:iconPrefix+"info-circle-fill",RESULT_SUCCESS:iconPrefix+"success-circle-fill",RESULT_WARNING:iconPrefix+"warning-circle-fill",RESULT_ERROR:iconPrefix+"error-circle-fill",RESULT_QUESTION:iconPrefix+"question-circle-fill",RESULT_LOADING:iconPrefix+"spinner roll",RATE_CHECKED:iconPrefix+"star-fill",RATE_UNCHECKED:iconPrefix+"star",COLOR_COPY:iconPrefix+"copy",EYE_DROPPER:iconPrefix+"dropper",SPLIT_TOP_ACTION:iconPrefix+"arrow-up",SPLIT_BOTTOM_ACTION:iconPrefix+"arrow-down",SPLIT_LEFT_ACTION:iconPrefix+"arrow-left",SPLIT_RIGHT_ACTION:iconPrefix+"arrow-right"});var _default=exports.default=_core.VxeUI;
package/lib/ui/src/log.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.warnLog = exports.errLog = void 0;
7
7
  var _core = require("@vxe-ui/core");
8
- const version = `ui v${"4.6.9"}`;
8
+ const version = `ui v${"4.6.10"}`;
9
9
  const warnLog = exports.warnLog = _core.log.create('warn', version);
10
10
  const errLog = exports.errLog = _core.log.create('error', version);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.6.9",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");const version="ui v4.6.10",warnLog=exports.warnLog=_core.log.create("warn",version),errLog=exports.errLog=_core.log.create("error",version);
@@ -1625,13 +1625,11 @@ var _default = exports.default = (0, _vue.defineComponent)({
1625
1625
  updateFileList();
1626
1626
  });
1627
1627
  (0, _vue.onMounted)(() => {
1628
- if (process.env.NODE_ENV === 'development') {
1629
- if (props.multiple && props.singleMode) {
1630
- (0, _log.errLog)('vxe.error.errConflicts', ['multiple', 'single-mode']);
1631
- }
1632
- if (props.imageStyle) {
1633
- (0, _log.warnLog)('vxe.error.delProp', ['image-style', 'image-config']);
1634
- }
1628
+ if (props.multiple && props.singleMode) {
1629
+ (0, _log.errLog)('vxe.error.errConflicts', ['multiple', 'single-mode']);
1630
+ }
1631
+ if (props.imageStyle) {
1632
+ (0, _log.warnLog)('vxe.error.delProp', ['image-style', 'image-config']);
1635
1633
  }
1636
1634
  if (props.dragSort) {
1637
1635
  (0, _dom.initTpImg)();
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_dom=require("../../ui/src/dom"),_util=require("./util"),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_vue.defineComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},tipText:[String,Number,Function],hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend"],setup(E,e){const{emit:u,slots:w}=e,U=(0,_vue.inject)("$xeForm",null),b=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const R=(0,_ui.useSize)(E)["computeSize"],g=(0,_vue.ref)(),v=(0,_vue.ref)(),m=(0,_vue.ref)(),c=(0,_vue.ref)(),T=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:g},C=(0,_vue.computed)(()=>{var e=E["readonly"];return null===e?!!U&&U.props.readonly:e}),I=(0,_vue.computed)(()=>{var e=E["disabled"];return null===e?!!U&&U.props.disabled:e}),M=(0,_vue.computed)(()=>E.keyField||"_X_KEY"),_=(0,_vue.computed)(()=>"image"===E.mode),D=(0,_vue.computed)(()=>E.nameField||"name"),S=(0,_vue.computed)(()=>E.typeField||"type"),B=(0,_vue.computed)(()=>E.urlField||"url"),L=(0,_vue.computed)(()=>E.sizeField||"size"),$=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(E.limitSize)*1024),P=(0,_vue.computed)(()=>E.multiple?_xeUtils.default.toNumber(E.limitCount):1),f=(0,_vue.computed)(()=>{var e=E["multiple"],t=T["fileList"],o=P.value;return e?!o||t.length>=o:1<=t.length}),q=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(E.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),G=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=E;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),H=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=E,l=E.tipText||E.hintText,a=_.value,u=q.value;return _xeUtils.default.isString(l)?l:_xeUtils.default.isFunction(l)?""+l({}):(l=[],a?(o&&i&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[i])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[u]))):(t&&t.length&&l.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[t.join("/")])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[u])),o&&i&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[i]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),a=(0,_vue.computed)(()=>Object.assign({},E.imageConfig||E.imageStyle)),Y=(0,_vue.computed)(()=>{var{width:e,height:t}=a.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),Q=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},E.moreConfig)),d={},F={xID:t,props:E,context:e,reactData:T,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>d},O=()=>_xeUtils.default.uniqueId(),A=e=>{return e[M.value]},s=()=>{var{modelValue:e,multiple:t}=E,o=C.value;const l=M.value,a=D.value,u=S.value,n=B.value,r=L.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(e=>{if(!e||_xeUtils.default.isString(e)){var t=""+(e||""),o=_xeUtils.default.parseUrl(e);const i=(o?o.searchQuery[a]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[a]:i,[u]:(o?o.searchQuery[u]:"")||V(i),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:O()}}const i=e[a]||"";return e[a]=i,e[u]=e[u]||V(i),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||O(),e}):[];T.fileList=o||t?e:e.slice(0,1)},V=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},z=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:F},t))},N=e=>{var{singleMode:t,urlMode:o}=E;const i=B.value,l=D.value;let a=e?e.slice(0):[];o&&(a=a.map(e=>{var t=e[i];if(t&&!_xeUtils.default.parseUrl(t).searchQuery[l])return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"");return t})),u("update:modelValue",t?a[0]||null:a)},X=e=>{var t=E.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:F,option:e}):n(e)},n=e=>{var t=E.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=B.value;return t?t({$upload:F,option:e}):e[o]},W=(e,t)=>{var o=E.previewMethod||(0,_ui.getConfig)().upload.previewMethod;if(E.showPreview)if(o)o({$upload:F,option:t});else{var i=t;var{imageTypes:o,showDownloadButton:t}=E;const a=S.value,u=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var l=r["imagePreviewTypes"];l.concat(o||[]).some(e=>(""+e).toLowerCase()===(""+i[a]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[n(i)],showDownloadButton:t,beforeDownloadMethod:u?()=>u({$upload:F,option:i}):void 0})}},K=(e,t,o)=>{var i=E["showDownloadButton"];const l=T["fileList"],a=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;E.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:l.map(e=>n(e)),activeIndex:o,showDownloadButton:i,beforeDownloadMethod:a?({index:e})=>a({$upload:F,option:l[e]}):void 0})},J=(o,e)=>{const i=E["showErrorStatus"],l=A(o);var t=E.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:F,file:e,option:o,updateProgress(e){var t=T["fileCacheMaps"],t=t[A(o)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=T["fileCacheMaps"],t=t[l];t&&(t.percent=100),Object.assign(o,e),z("upload-success",{option:o,data:e},null)}).catch(e=>{var t=T["fileCacheMaps"],t=t[l];t&&(t.status="error"),i?Object.assign(o,e):T.fileList=T.fileList.filter(e=>A(e)!==l),z("upload-error",{option:o,data:e},null)}).finally(()=>{var e=T["fileCacheMaps"],e=e[l];e&&(e.loading=!1)}):(t=T["fileCacheMaps"],(e=t[l])&&(e.loading=!1),Promise.resolve())},Z=e=>{const{uploadMethod:t,urlMode:o}=E;var i,l=T["fileCacheMaps"],l=l[A(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(i=l.file,l.loading=!0,l.status="",l.percent=0,J(e,i).then(()=>{o&&N(T.fileList)}))},p=(t,i)=>{var{multiple:e,urlMode:o,showLimitSize:l,limitSizeText:a,showLimitCount:u,limitCountText:n}=E,r=T["fileList"];const d=E.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,s=M.value,p=D.value,v=S.value,g=B.value,m=L.value;var c=$.value;const _=P.value;var f=q.value;let h=t;if(e&&_){if(u&&r.length>=_)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:n?""+(_xeUtils.default.isFunction(n)?n({maxCount:_}):n):(0,_ui.getI18n)("vxe.upload.overCountErr",[_])}));const C=h.length-(_-r.length);if(u&&0<C){const I=h.slice(_-r.length);n?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(n)?n({maxCount:_}):n)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[_,C])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},I.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}h=h.slice(0,_-r.length)}if(l&&c)for(let e=0;e<t.length;e++)if(t[0].size>c)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:a?""+(_xeUtils.default.isFunction(a)?a({maxSize:c}):a):(0,_ui.getI18n)("vxe.upload.overSizeErr",[f])}));const x=Object.assign({},T.fileCacheMaps),y=e?r:[],w=[];h.forEach(e=>{var t=e["name"],o=O(),t={[p]:t,[v]:V(t),[m]:e.size,[g]:URL.createObjectURL(e),[s]:o},o=(d&&(x[o]={file:e,loading:!0,status:"",percent:0}),(0,_vue.reactive)(t));d&&w.push(J(o,e)),y.push(o),z("add",{option:o},i)}),T.fileList=y,T.fileCacheMaps=x,Promise.all(o?w:[]).then(()=>{N(y),U&&b&&U.triggerItemEvent(i,b.itemConfig.field,y)})},ee=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=E,l=I.value,a=_.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(p(e.files,t),e))},te=e=>{ee(e).catch(()=>{})},oe=(e,t,o)=>{var i=T["fileList"];i.splice(o,1),N(i),U&&b&&U.triggerItemEvent(e,b.itemConfig.field,i),z("remove",{option:t},e)},ie=(t,o,i)=>{var e=E.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=E.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:F,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:F,option:o})).then(()=>{oe(t,o,i)}).catch(e=>e):oe(t,o,i):z("remove-fail",{option:o},t)})},le=(e,t)=>{z("download",{option:t},e)},ae=(t,o)=>{var e=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const i=E.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:F,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:F,option:o})).then(()=>{le(t,o)}).catch(e=>e):le(t,o):z("download-fail",{option:o},t)})},ue=e=>{var t,o,i,l=e.currentTarget,{clientX:e,clientY:a}=e;l&&({x:l,y:t,height:o,width:i}=l.getBoundingClientRect(),e<l||l+i<e||a<t||t+o<a)&&(T.isDragUploadStatus=!1)},ne=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),T.isDragUploadStatus=!0)},re=(e,t)=>{const{imageTypes:o,fileTypes:i}=E;var l=r["imagePreviewTypes"];if(_.value){const a=l.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!a.some(e=>(""+e).toLowerCase()===t)})}else if(i&&i.length){const u=[];if(t.forEach(e=>{const t=V(e.name);i.some(e=>(""+e).toLowerCase()===t)||u.push(t)}),u.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[u.join(", ")]),status:"error"}))}t.length?p(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},de=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=se(t)).length)&&re(e,t),T.isDragUploadStatus=!1},se=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},h=()=>{const s=C.value,p=_.value;_ui.VxeUI.modal&&_ui.VxeUI.modal.open({title:s?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(p?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o}=E,{isActivated:i,isDragMove:l,isDragUploadStatus:a,dragIndex:u}=T;const n=T["fileList"];var r=I.value,d={};return t&&-1===u&&(d.onDragover=ne,d.onDragleave=ue,d.onDrop=de),(0,_vue.h)("div",Object.assign({ref:v,class:["vxe-upload--more-popup",{"is--readonly":s,"is--disabled":r,"is--active":i,"show--error":e,"is--drag":a}]},d),[p?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>j(n,!0).concat(k(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},j(n,!0).concat(k(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[y(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(n,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(n,!0))]),o?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(F),a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(F)])}},onShow(){T.showMorePopup=!0},onHide(){T.showMorePopup=!1}})},pe=(e,t,o)=>{var i,l=T["showMorePopup"],a=g.value,u=v.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=m.value,i=c.value,l=l?i:u)&&(i=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,i.y-a.y)+"px",l.style.left=Math.max(1,i.x-a.x)+"px",l.style.height=i.height+"px",l.style.width=i.width-1+"px",l.setAttribute("drag-pos",o))},ve=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);const t=e.currentTarget;e=t.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),e=>t===e);T.isDragMove=!0,T.dragIndex=e,setTimeout(()=>{T.isDragMove=!1},500)},ge=t=>{t.stopPropagation(),t.preventDefault();var o=T["dragIndex"];if(-1!==o){var i=_.value;const a=t.currentTarget;var l=a.parentElement,l=_xeUtils.default.findIndexOf(Array.from(l.children),e=>a===e);let e="";e=i?t.clientX-a.getBoundingClientRect().x<a.clientWidth/2?"left":"right":t.clientY-a.getBoundingClientRect().y<a.clientHeight/2?"top":"bottom",o===l?pe(0,a,e):(pe(0,a,e),r.prevDragIndex=l,r.prevDragPos=e)}},me=e=>{var{fileList:t,dragIndex:o}=T,{prevDragIndex:i,prevDragPos:l}=r,a="bottom"===l||"right"===l?1:0,u=t[o];const n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+a,t.splice(i,0,u),z("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),t=m.value,u=c.value,t&&(t.style.display=""),u&&(u.style.display=""),T.dragIndex=-1},ce=e=>{i&&e.stopPropagation(),T.isActivated=!0},_e=e=>{var t=E["pasteToUpload"],o=T["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=se(t)).length&&(e.preventDefault(),re(e,o))},fe=e=>{var t=g.value,o=v.value;let i=(0,_dom.getEventTargetNode)(e,t).flag;!i&&o&&(o=(t=o.parentElement||o)&&t.parentElement,i=(0,_dom.getEventTargetNode)(e,o).flag),T.isActivated=i},he=()=>{T.isActivated=!1};t={dispatchEvent:z,choose(){return ee(null)}};Object.assign(F,t,{});const x=(e,u)=>{const{showRemoveButton:n,showDownloadButton:r,showProgress:d,progressText:s,showPreview:p,showErrorStatus:v,dragSort:g}=E,m=T["fileCacheMaps"],c=I.value,_=C.value,f=D.value,h=S.value,x=w.corner,y={};return g&&1<e.length&&(y.onDragstart=ve,y.onDragover=ge,y.onDragend=me),e.map((t,o)=>{var e=A(t),i=m[e];const l=i&&i.loading,a=i&&"error"===i.status;return(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--file-item",{"is--preview":p,"is--loading":l,"is--error":a}],fileid:e,draggable:!!g||null},y),[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+t[h]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",onClick(e){l||a||W(e,t)}},""+(t[f]||"")),l?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(F),d&&l&&i?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},s?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(s)?s({}):s),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(F),v&&a?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_ui.renderEmptyElement)(F),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},[x?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(x({option:t,isMoreView:u,readonly:_}))):(0,_ui.renderEmptyElement)(F),r&&!l?(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){ae(e,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_ui.renderEmptyElement)(F),!n||_||c||l?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){ie(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},y=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=E,n=I.value,r=C.value,d=G.value,s=H.value,p=f.value,v=w.default,g=w.tip||w.hint;return r||!t?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&p?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:te},v?(0,_vn.getSlotVNs)(v({$upload:F})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:a?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:n})]),d&&(s||g)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},g?(0,_vn.getSlotVNs)(g({$upload:F})):""+s):(0,_ui.renderEmptyElement)(F)])},j=(e,u)=>{const{showRemoveButton:n,showProgress:r,progressText:d,showPreview:s,showErrorStatus:p,dragSort:v}=E,g=T["fileCacheMaps"],m=I.value,c=C.value,_=a.value,f=Y.value,h=w.corner,x={onMousedown:ce};return v&&1<e.length&&(x.onDragstart=ve,x.onDragover=ge,x.onDragend=me),e.map((t,o)=>{var e=A(t),i=g[e];const l=i&&i.loading,a=i&&"error"===i.status;return(0,_vue.h)("div",Object.assign({key:v?e:o,class:["vxe-upload--image-item",{"is--preview":s,"is--circle":_.circle,"is--loading":l,"is--error":a}],fileid:e,draggable:!!v||null},x),[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:u?null:f,title:(0,_ui.getI18n)("vxe.upload.viewItemTitle"),onClick(e){l||a||K(e,t,o)}},[l&&i?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),r?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(d)?d({}):d),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(F)]):(0,_ui.renderEmptyElement)(F),l?(0,_ui.renderEmptyElement)(F):a&&p?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper"},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:X(t)})]),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},[h?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(h({option:t,isMoreView:u,readonly:c}))):(0,_ui.renderEmptyElement)(F),!n||c||m||l?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),ie(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},k=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=E,n=C.value,r=G.value,d=H.value,s=f.value,p=Y.value,v=w.default,g=w.tip||w.hint;return n||!t||u&&s?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:te},v?v({$upload:F}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:p},[a?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(F),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(F),r&&(d||g)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},g?(0,_vn.getSlotVNs)(g({$upload:F})):""+d):(0,_ui.renderEmptyElement)(F)])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>E.modelValue?E.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>E.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{"development"===process.env.NODE_ENV&&(E.multiple&&E.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["multiple","single-mode"]),E.imageStyle)&&(0,_log.warnLog)("vxe.error.delProp",["image-style","image-config"]),E.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(F,"paste",_e),_ui.globalEvents.on(F,"mousedown",fe),_ui.globalEvents.on(F,"blur",he)}),(0,_vue.onUnmounted)(()=>{T.isDragUploadStatus=!1,_ui.globalEvents.off(F,"paste"),_ui.globalEvents.off(F,"mousedown"),_ui.globalEvents.off(F,"blur")}),s(),F.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i}=E,{isDragUploadStatus:l,showMorePopup:a,isActivated:u,dragIndex:n}=T,r=R.value,d=I.value,s=C.value,p=_.value,v={onMousedown:ce};return t&&-1===n&&(v.onDragover=ne,v.onDragleave=ue,v.onDrop=de),(0,_vue.h)("div",Object.assign({ref:g,class:["vxe-upload",{["size--"+r]:r,"is--active":u,"is--readonly":s,"is--disabled":d,"is--paste":o,"show--error":e,"is--drag":l}]},v),[(p?()=>{var{showList:e,dragSort:t}=E;const{fileList:o,isDragMove:i}=T,{maxCount:l,showMoreButton:a}=Q.value;let u=o,n=0;return l&&o.length>l&&(n=o.length-l,u=o.slice(0,l)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>j(u,!1).concat([a&&n?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(F),k(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},j(u,!1).concat([a&&n?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(F),k(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[k(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=E,{fileList:i,isDragMove:l}=T,{maxCount:a,showMoreButton:u,layout:n}=Q.value,n="horizontal"===n;let r=i,d=0;return a&&i.length>a&&(d=i.length-a,r=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(F):y(!0),r.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[r.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(r,!1)):(0,_ui.renderEmptyElement)(F),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(F),u&&t&&n?y(!1):(0,_ui.renderEmptyElement)(F)]):(0,_ui.renderEmptyElement)(F)]:[y(!1)])})(),i?(0,_vue.h)("div",{ref:m,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(F),l&&!a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(F)])},F},render(){return this.renderVN()}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../ui"),_vn=require("../../ui/src/vn"),_log=require("../../ui/src/log"),_dom=require("../../ui/src/dom"),_util=require("./util"),_button=_interopRequireDefault(require("../../button/src/button"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _default=exports.default=(0,_vue.defineComponent)({name:"VxeUpload",props:{modelValue:[Array,String,Object],showList:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showList},moreConfig:Object,readonly:{type:Boolean,default:null},disabled:{type:Boolean,default:null},mode:{type:String,default:()=>(0,_ui.getConfig)().upload.mode},imageTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageTypes,!0)},imageConfig:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageConfig,!0)},imageStyle:{type:Object,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.imageStyle,!0)},fileTypes:{type:Array,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.fileTypes,!0)},dragSort:Boolean,dragToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.dragToUpload,!0)},pasteToUpload:{type:Boolean,default:()=>_xeUtils.default.clone((0,_ui.getConfig)().upload.pasteToUpload,!0)},keyField:String,singleMode:Boolean,urlMode:Boolean,multiple:Boolean,limitSize:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitSize},showLimitSize:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitSize},limitSizeText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitSizeText},limitCount:{type:[String,Number],default:()=>(0,_ui.getConfig)().upload.limitCount},showLimitCount:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showLimitCount},limitCountText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.limitCountText},nameField:{type:String,default:()=>(0,_ui.getConfig)().upload.nameField},typeField:{type:String,default:()=>(0,_ui.getConfig)().upload.typeField},urlField:{type:String,default:()=>(0,_ui.getConfig)().upload.urlField},sizeField:{type:String,default:()=>(0,_ui.getConfig)().upload.sizeField},showErrorStatus:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showErrorStatus},showProgress:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showProgress},progressText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.progressText},autoHiddenButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.autoHiddenButton},showUploadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showUploadButton},buttonText:{type:[String,Number,Function],default:()=>(0,_ui.getConfig)().upload.buttonText},buttonIcon:{type:String,default:()=>(0,_ui.getConfig)().upload.buttonIcon},showButtonText:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonText},showButtonIcon:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showButtonIcon},showRemoveButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showRemoveButton},showDownloadButton:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showDownloadButton},showPreview:{type:Boolean,default:()=>(0,_ui.getConfig)().upload.showPreview},showTip:{type:Boolean,default:()=>null},tipText:[String,Number,Function],hintText:String,previewMethod:Function,uploadMethod:Function,beforeRemoveMethod:Function,removeMethod:Function,beforeDownloadMethod:Function,downloadMethod:Function,getUrlMethod:Function,getThumbnailUrlMethod:Function,size:{type:String,default:()=>(0,_ui.getConfig)().upload.size||(0,_ui.getConfig)().size}},emits:["update:modelValue","add","remove","remove-fail","download","download-fail","upload-success","upload-error","sort-dragend"],setup(E,e){const{emit:u,slots:w}=e,U=(0,_vue.inject)("$xeForm",null),b=(0,_vue.inject)("xeFormItemInfo",null),i=(0,_vue.inject)("$xeTable",null);var t=_xeUtils.default.uniqueId();const R=(0,_ui.useSize)(E)["computeSize"],g=(0,_vue.ref)(),v=(0,_vue.ref)(),m=(0,_vue.ref)(),c=(0,_vue.ref)(),T=(0,_vue.reactive)({isDragUploadStatus:!1,showMorePopup:!1,isActivated:!1,fileList:[],fileCacheMaps:{},isDragMove:!1,dragIndex:-1,dragTipText:""}),r={imagePreviewTypes:["jpg","jpeg","png","gif"],prevDragIndex:-1},l={refElem:g},C=(0,_vue.computed)(()=>{var e=E["readonly"];return null===e?!!U&&U.props.readonly:e}),I=(0,_vue.computed)(()=>{var e=E["disabled"];return null===e?!!U&&U.props.disabled:e}),M=(0,_vue.computed)(()=>E.keyField||"_X_KEY"),_=(0,_vue.computed)(()=>"image"===E.mode),D=(0,_vue.computed)(()=>E.nameField||"name"),S=(0,_vue.computed)(()=>E.typeField||"type"),B=(0,_vue.computed)(()=>E.urlField||"url"),L=(0,_vue.computed)(()=>E.sizeField||"size"),$=(0,_vue.computed)(()=>1024*_xeUtils.default.toNumber(E.limitSize)*1024),P=(0,_vue.computed)(()=>E.multiple?_xeUtils.default.toNumber(E.limitCount):1),f=(0,_vue.computed)(()=>{var e=E["multiple"],t=T["fileList"],o=P.value;return e?!o||t.length>=o:1<=t.length}),q=(0,_vue.computed)(()=>{var e=_xeUtils.default.toNumber(E.limitSize);return e?1048576<e?e/1048576+"T":1024<e?e/1024+"G":e+"M":""}),G=(0,_vue.computed)(()=>{var{showTip:e,tipText:t}=E;return _xeUtils.default.isBoolean(e)||(e=(0,_ui.getConfig)().upload.showTip,_xeUtils.default.isBoolean(e))?e:!!t}),H=(0,_vue.computed)(()=>{var{limitSize:e,fileTypes:t,multiple:o,limitCount:i}=E,l=E.tipText||E.hintText,a=_.value,u=q.value;return _xeUtils.default.isString(l)?l:_xeUtils.default.isFunction(l)?""+l({}):(l=[],a?(o&&i&&l.push((0,_ui.getI18n)("vxe.upload.imgCountHint",[i])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.imgSizeHint",[u]))):(t&&t.length&&l.push((0,_ui.getI18n)("vxe.upload.fileTypeHint",[t.join("/")])),e&&u&&l.push((0,_ui.getI18n)("vxe.upload.fileSizeHint",[u])),o&&i&&l.push((0,_ui.getI18n)("vxe.upload.fileCountHint",[i]))),l.join((0,_ui.getI18n)("vxe.base.comma")))}),a=(0,_vue.computed)(()=>Object.assign({},E.imageConfig||E.imageStyle)),Y=(0,_vue.computed)(()=>{var{width:e,height:t}=a.value,o={};return e&&(o.width=(0,_dom.toCssUnit)(e)),t&&(o.height=(0,_dom.toCssUnit)(t)),o}),Q=(0,_vue.computed)(()=>Object.assign({showMoreButton:!0},E.moreConfig)),d={},F={xID:t,props:E,context:e,reactData:T,internalData:r,getRefMaps:()=>l,getComputeMaps:()=>d},O=()=>_xeUtils.default.uniqueId(),A=e=>{return e[M.value]},s=()=>{var{modelValue:e,multiple:t}=E,o=C.value;const l=M.value,a=D.value,u=S.value,n=B.value,r=L.value;e=e?(e?_xeUtils.default.isArray(e)?e:[e]:[]).map(e=>{if(!e||_xeUtils.default.isString(e)){var t=""+(e||""),o=_xeUtils.default.parseUrl(e);const i=(o?o.searchQuery[a]:"")||decodeURIComponent(""+(t||"")).split("/").pop()||"";return{[a]:i,[u]:(o?o.searchQuery[u]:"")||V(i),[n]:t,[r]:_xeUtils.default.toNumber(o?o.searchQuery[r]:0)||0,[l]:O()}}const i=e[a]||"";return e[a]=i,e[u]=e[u]||V(i),e[n]=e[n]||"",e[r]=e[r]||0,e[l]=e[l]||O(),e}):[];T.fileList=o||t?e:e.slice(0,1)},V=e=>{var t=e.lastIndexOf(".");return 0<t?e.substring(t+1).toLowerCase():""},z=(e,t,o)=>{u(e,(0,_ui.createEvent)(o,{$upload:F},t))},j=e=>{var{singleMode:t,urlMode:o}=E;const i=B.value,l=D.value;let a=e?e.slice(0):[];o&&(a=a.map(e=>{var t=e[i];if(t&&!_xeUtils.default.parseUrl(t).searchQuery[l])return""+t+(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(e[l]||"");return t})),u("update:modelValue",t?a[0]||null:a)},X=e=>{var t=E.getThumbnailUrlMethod||(0,_ui.getConfig)().upload.getThumbnailUrlMethod;return t?t({$upload:F,option:e}):n(e)},n=e=>{var t=E.getUrlMethod||(0,_ui.getConfig)().upload.getUrlMethod,o=B.value;return t?t({$upload:F,option:e}):e[o]},W=(e,t)=>{var o=E.previewMethod||(0,_ui.getConfig)().upload.previewMethod;if(E.showPreview)if(o)o({$upload:F,option:t});else{var i=t;var{imageTypes:o,showDownloadButton:t}=E;const a=S.value,u=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;var l=r["imagePreviewTypes"];l.concat(o||[]).some(e=>(""+e).toLowerCase()===(""+i[a]).toLowerCase())&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:[n(i)],showDownloadButton:t,beforeDownloadMethod:u?()=>u({$upload:F,option:i}):void 0})}},K=(e,t,o)=>{var i=E["showDownloadButton"];const l=T["fileList"],a=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;E.showPreview&&_ui.VxeUI.previewImage&&_ui.VxeUI.previewImage({urlList:l.map(e=>n(e)),activeIndex:o,showDownloadButton:i,beforeDownloadMethod:a?({index:e})=>a({$upload:F,option:l[e]}):void 0})},J=(o,e)=>{const i=E["showErrorStatus"],l=A(o);var t=E.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod;return t?Promise.resolve(t({$upload:F,file:e,option:o,updateProgress(e){var t=T["fileCacheMaps"],t=t[A(o)];t&&(t.percent=Math.max(0,Math.min(99,_xeUtils.default.toNumber(e))))}})).then(e=>{var t=T["fileCacheMaps"],t=t[l];t&&(t.percent=100),Object.assign(o,e),z("upload-success",{option:o,data:e},null)}).catch(e=>{var t=T["fileCacheMaps"],t=t[l];t&&(t.status="error"),i?Object.assign(o,e):T.fileList=T.fileList.filter(e=>A(e)!==l),z("upload-error",{option:o,data:e},null)}).finally(()=>{var e=T["fileCacheMaps"],e=e[l];e&&(e.loading=!1)}):(t=T["fileCacheMaps"],(e=t[l])&&(e.loading=!1),Promise.resolve())},Z=e=>{const{uploadMethod:t,urlMode:o}=E;var i,l=T["fileCacheMaps"],l=l[A(e)];(t||(0,_ui.getConfig)().upload.uploadMethod)&&l&&(i=l.file,l.loading=!0,l.status="",l.percent=0,J(e,i).then(()=>{o&&j(T.fileList)}))},p=(t,i)=>{var{multiple:e,urlMode:o,showLimitSize:l,limitSizeText:a,showLimitCount:u,limitCountText:n}=E,r=T["fileList"];const d=E.uploadMethod||(0,_ui.getConfig)().upload.uploadMethod,s=M.value,p=D.value,v=S.value,g=B.value,m=L.value;var c=$.value;const _=P.value;var f=q.value;let h=t;if(e&&_){if(u&&r.length>=_)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:n?""+(_xeUtils.default.isFunction(n)?n({maxCount:_}):n):(0,_ui.getI18n)("vxe.upload.overCountErr",[_])}));const C=h.length-(_-r.length);if(u&&0<C){const I=h.slice(_-r.length);n?_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:""+(_xeUtils.default.isFunction(n)?n({maxCount:_}):n)}):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",width:null,slots:{default(){return(0,_vue.h)("div",{class:"vxe-upload--file-message-over-error"},[(0,_vue.h)("div",{},(0,_ui.getI18n)("vxe.upload.overCountExtraErr",[_,C])),(0,_vue.h)("div",{class:"vxe-upload--file-message-over-extra"},I.map((e,t)=>(0,_vue.h)("div",{key:t,class:"vxe-upload--file-message-over-extra-item"},e.name)))])}}})}h=h.slice(0,_-r.length)}if(l&&c)for(let e=0;e<t.length;e++)if(t[0].size>c)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:a?""+(_xeUtils.default.isFunction(a)?a({maxSize:c}):a):(0,_ui.getI18n)("vxe.upload.overSizeErr",[f])}));const x=Object.assign({},T.fileCacheMaps),y=e?r:[],w=[];h.forEach(e=>{var t=e["name"],o=O(),t={[p]:t,[v]:V(t),[m]:e.size,[g]:URL.createObjectURL(e),[s]:o},o=(d&&(x[o]={file:e,loading:!0,status:"",percent:0}),(0,_vue.reactive)(t));d&&w.push(J(o,e)),y.push(o),z("add",{option:o},i)}),T.fileList=y,T.fileCacheMaps=x,Promise.all(o?w:[]).then(()=>{j(y),U&&b&&U.triggerItemEvent(i,b.itemConfig.field,y)})},ee=t=>{var{multiple:e,imageTypes:o,fileTypes:i}=E,l=I.value,a=_.value;return l?Promise.resolve({status:!1,files:[],file:null}):(0,_util.readLocalFile)({multiple:e,types:a?o:i}).then(e=>(p(e.files,t),e))},te=e=>{ee(e).catch(()=>{})},oe=(e,t,o)=>{var i=T["fileList"];i.splice(o,1),j(i),U&&b&&U.triggerItemEvent(e,b.itemConfig.field,i),z("remove",{option:t},e)},ie=(t,o,i)=>{var e=E.beforeRemoveMethod||(0,_ui.getConfig)().upload.beforeRemoveMethod;const l=E.removeMethod||(0,_ui.getConfig)().upload.removeMethod;Promise.resolve(!e||e({$upload:F,option:o})).then(e=>{e?l?Promise.resolve(l({$upload:F,option:o})).then(()=>{oe(t,o,i)}).catch(e=>e):oe(t,o,i):z("remove-fail",{option:o},t)})},le=(e,t)=>{z("download",{option:t},e)},ae=(t,o)=>{var e=E.beforeDownloadMethod||(0,_ui.getConfig)().upload.beforeDownloadMethod;const i=E.downloadMethod||(0,_ui.getConfig)().upload.downloadMethod;Promise.resolve(!e||e({$upload:F,option:o})).then(e=>{e?i?Promise.resolve(i({$upload:F,option:o})).then(()=>{le(t,o)}).catch(e=>e):le(t,o):z("download-fail",{option:o},t)})},ue=e=>{var t,o,i,l=e.currentTarget,{clientX:e,clientY:a}=e;l&&({x:l,y:t,height:o,width:i}=l.getBoundingClientRect(),e<l||l+i<e||a<t||t+o<a)&&(T.isDragUploadStatus=!1)},ne=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),T.isDragUploadStatus=!0)},re=(e,t)=>{const{imageTypes:o,fileTypes:i}=E;var l=r["imagePreviewTypes"];if(_.value){const a=l.concat(o&&o.length?o:[]);t=t.filter(e=>{const t=(""+(e.type.split("/")[1]||"")).toLowerCase();return!!a.some(e=>(""+e).toLowerCase()===t)})}else if(i&&i.length){const u=[];if(t.forEach(e=>{const t=V(e.name);i.some(e=>(""+e).toLowerCase()===t)||u.push(t)}),u.length)return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({content:(0,_ui.getI18n)("vxe.error.notType",[u.join(", ")]),status:"error"}))}t.length?p(t,e):_ui.VxeUI.modal&&_ui.VxeUI.modal.notification({title:(0,_ui.getI18n)("vxe.modal.errTitle"),status:"error",content:(0,_ui.getI18n)("vxe.upload.uploadTypeErr")})},de=e=>{var t=e.dataTransfer;t&&(t=t["items"],t)&&t.length&&(e.preventDefault(),(t=se(t)).length)&&re(e,t),T.isDragUploadStatus=!1},se=e=>{const t=[];return _xeUtils.default.arrayEach(e,e=>{e=e.getAsFile();e&&t.push(e)}),t},h=()=>{const s=C.value,p=_.value;_ui.VxeUI.modal&&_ui.VxeUI.modal.open({title:s?(0,_ui.getI18n)("vxe.upload.morePopup.readTitle"):(0,_ui.getI18n)("vxe.upload.morePopup."+(p?"imageTitle":"fileTitle")),width:660,height:500,escClosable:!0,showMaximize:!0,resize:!0,maskClosable:!0,slots:{default(){var{showErrorStatus:e,dragToUpload:t,dragSort:o}=E,{isActivated:i,isDragMove:l,isDragUploadStatus:a,dragIndex:u}=T;const n=T["fileList"];var r=I.value,d={};return t&&-1===u&&(d.onDragover=ne,d.onDragleave=ue,d.onDrop=de),(0,_vue.h)("div",Object.assign({ref:v,class:["vxe-upload--more-popup",{"is--readonly":s,"is--disabled":r,"is--active":i,"show--error":e,"is--drag":a}]},d),[p?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--image-more-list"},{default:()=>k(n,!0).concat(N(!0))}):(0,_vue.h)("div",{class:"vxe-upload--image-more-list"},k(n,!0).concat(N(!0))):(0,_vue.h)("div",{class:"vxe-upload--file-more-list"},[y(!0),o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(n,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(n,!0))]),o?(0,_vue.h)("div",{ref:c,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(F),a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(F)])}},onShow(){T.showMorePopup=!0},onHide(){T.showMorePopup=!1}})},pe=(e,t,o)=>{var i,l=T["showMorePopup"],a=g.value,u=v.value,u=l?u:a;u&&(a=u.getBoundingClientRect(),u=m.value,i=c.value,l=l?i:u)&&(i=t.getBoundingClientRect(),l.style.display="block",l.style.top=Math.max(1,i.y-a.y)+"px",l.style.left=Math.max(1,i.x-a.x)+"px",l.style.height=i.height+"px",l.style.width=i.width-1+"px",l.setAttribute("drag-pos",o))},ve=e=>{e.stopPropagation(),e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0);const t=e.currentTarget;e=t.parentElement,e=_xeUtils.default.findIndexOf(Array.from(e.children),e=>t===e);T.isDragMove=!0,T.dragIndex=e,setTimeout(()=>{T.isDragMove=!1},500)},ge=t=>{t.stopPropagation(),t.preventDefault();var o=T["dragIndex"];if(-1!==o){var i=_.value;const a=t.currentTarget;var l=a.parentElement,l=_xeUtils.default.findIndexOf(Array.from(l.children),e=>a===e);let e="";e=i?t.clientX-a.getBoundingClientRect().x<a.clientWidth/2?"left":"right":t.clientY-a.getBoundingClientRect().y<a.clientHeight/2?"top":"bottom",o===l?pe(0,a,e):(pe(0,a,e),r.prevDragIndex=l,r.prevDragPos=e)}},me=e=>{var{fileList:t,dragIndex:o}=T,{prevDragIndex:i,prevDragPos:l}=r,a="bottom"===l||"right"===l?1:0,u=t[o];const n=t[i];u&&n&&(t.splice(o,1),i=_xeUtils.default.findIndexOf(t,e=>n===e)+a,t.splice(i,0,u),z("sort-dragend",{oldItem:u,newItem:n,dragPos:l,offsetIndex:a,_index:{newIndex:i,oldIndex:o}},e)),t=m.value,u=c.value,t&&(t.style.display=""),u&&(u.style.display=""),T.dragIndex=-1},ce=e=>{i&&e.stopPropagation(),T.isActivated=!0},_e=e=>{var t=E["pasteToUpload"],o=T["isActivated"];o&&t&&(o=e.clipboardData||e.originalEvent.clipboardData)&&(t=o["items"],t)&&(o=se(t)).length&&(e.preventDefault(),re(e,o))},fe=e=>{var t=g.value,o=v.value;let i=(0,_dom.getEventTargetNode)(e,t).flag;!i&&o&&(o=(t=o.parentElement||o)&&t.parentElement,i=(0,_dom.getEventTargetNode)(e,o).flag),T.isActivated=i},he=()=>{T.isActivated=!1};t={dispatchEvent:z,choose(){return ee(null)}};Object.assign(F,t,{});const x=(e,u)=>{const{showRemoveButton:n,showDownloadButton:r,showProgress:d,progressText:s,showPreview:p,showErrorStatus:v,dragSort:g}=E,m=T["fileCacheMaps"],c=I.value,_=C.value,f=D.value,h=S.value,x=w.corner,y={};return g&&1<e.length&&(y.onDragstart=ve,y.onDragover=ge,y.onDragend=me),e.map((t,o)=>{var e=A(t),i=m[e];const l=i&&i.loading,a=i&&"error"===i.status;return(0,_vue.h)("div",Object.assign({key:g?e:o,class:["vxe-upload--file-item",{"is--preview":p,"is--loading":l,"is--error":a}],fileid:e,draggable:!!g||null},y),[(0,_vue.h)("div",{class:"vxe-upload--file-item-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)()["UPLOAD_FILE_TYPE_"+(""+t[h]).toLocaleUpperCase()]||(0,_ui.getIcon)().UPLOAD_FILE_TYPE_DEFAULT})]),(0,_vue.h)("div",{class:"vxe-upload--file-item-name",onClick(e){l||a||W(e,t)}},""+(t[f]||"")),l?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]):(0,_ui.renderEmptyElement)(F),d&&l&&i?(0,_vue.h)("div",{class:"vxe-upload--file-item-loading-text"},s?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(s)?s({}):s),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(F),v&&a?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_ui.renderEmptyElement)(F),(0,_vue.h)("div",{class:"vxe-upload--file-item-btn-wrapper"},[x?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(x({option:t,isMoreView:u,readonly:_}))):(0,_ui.renderEmptyElement)(F),r&&!l?(0,_vue.h)("div",{class:"vxe-upload--file-item-download-btn",onClick(e){ae(e,t)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_DOWNLOAD})]):(0,_ui.renderEmptyElement)(F),!n||_||c||l?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-item-remove-btn",onClick(e){ie(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_FILE_REMOVE})])])])})},y=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=E,n=I.value,r=C.value,d=G.value,s=H.value,p=f.value,v=w.default,g=w.tip||w.hint;return r||!t?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-action"},[u&&p?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--file-action-btn",onClick:te},v?(0,_vn.getSlotVNs)(v({$upload:F})):[(0,_vue.h)(_button.default,{class:"vxe-upload--file-action-button",content:e||l?o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.fileBtnText"):"",icon:a?i||(0,_ui.getIcon)().UPLOAD_FILE_ADD:"",disabled:n})]),d&&(s||g)?(0,_vue.h)("div",{class:"vxe-upload--file-action-tip"},g?(0,_vn.getSlotVNs)(g({$upload:F})):""+s):(0,_ui.renderEmptyElement)(F)])},k=(e,u)=>{const{showRemoveButton:n,showProgress:r,progressText:d,showPreview:s,showErrorStatus:p,dragSort:v}=E,g=T["fileCacheMaps"],m=I.value,c=C.value,_=a.value,f=Y.value,h=w.corner,x={onMousedown:ce};return v&&1<e.length&&(x.onDragstart=ve,x.onDragover=ge,x.onDragend=me),e.map((t,o)=>{var e=A(t),i=g[e];const l=i&&i.loading,a=i&&"error"===i.status;return(0,_vue.h)("div",Object.assign({key:v?e:o,class:["vxe-upload--image-item",{"is--preview":s,"is--circle":_.circle,"is--loading":l,"is--error":a}],fileid:e,draggable:!!v||null},x),[(0,_vue.h)("div",{class:"vxe-upload--image-item-box",style:u?null:f,title:(0,_ui.getI18n)("vxe.upload.viewItemTitle"),onClick(e){l||a||K(e,t,o)}},[l&&i?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading"},[(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-icon"},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_LOADING})]),r?(0,_vue.h)("div",{class:"vxe-upload--image-item-loading-text"},d?_xeUtils.default.toFormatString(""+(_xeUtils.default.isFunction(d)?d({}):d),{percent:i.percent}):(0,_ui.getI18n)("vxe.upload.uploadProgress",[i.percent])):(0,_ui.renderEmptyElement)(F)]):(0,_ui.renderEmptyElement)(F),l?(0,_ui.renderEmptyElement)(F):a&&p?(0,_vue.h)("div",{class:"vxe-upload--image-item-error"},[(0,_vue.h)(_button.default,{icon:(0,_ui.getIcon)().UPLOAD_IMAGE_RE_UPLOAD,mode:"text",status:"primary",content:(0,_ui.getI18n)("vxe.upload.reUpload"),onClick(){Z(t)}})]):(0,_vue.h)("div",{class:"vxe-upload--image-item-img-wrapper"},[(0,_vue.h)("img",{class:"vxe-upload--image-item-img",src:X(t)})]),(0,_vue.h)("div",{class:"vxe-upload--image-item-btn-wrapper",onClick(e){e.stopPropagation()}},[h?(0,_vue.h)("div",{class:"vxe-upload--file-item-corner"},(0,_vn.getSlotVNs)(h({option:t,isMoreView:u,readonly:c}))):(0,_ui.renderEmptyElement)(F),!n||c||m||l?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{class:"vxe-upload--image-item-remove-btn",onClick(e){e.stopPropagation(),ie(e,t,o)}},[(0,_vue.h)("i",{class:(0,_ui.getIcon)().UPLOAD_IMAGE_REMOVE})])])])])})},N=e=>{var{showUploadButton:t,buttonText:o,buttonIcon:i,showButtonText:l,showButtonIcon:a,autoHiddenButton:u}=E,n=C.value,r=G.value,d=H.value,s=f.value,p=Y.value,v=w.default,g=w.tip||w.hint;return n||!t||u&&s?(0,_ui.renderEmptyElement)(F):(0,_vue.h)("div",{key:"action",class:"vxe-upload--image-action"},[(0,_vue.h)("div",{class:"vxe-upload--image-action-btn",onClick:te},v?v({$upload:F}):[(0,_vue.h)("div",{class:"vxe-upload--image-action-box",style:e?null:p},[a?(0,_vue.h)("div",{class:"vxe-upload--image-action-icon"},[(0,_vue.h)("i",{class:i||(0,_ui.getIcon)().UPLOAD_IMAGE_ADD})]):(0,_ui.renderEmptyElement)(F),e||l?(0,_vue.h)("div",{class:"vxe-upload--image-action-content"},o?""+(_xeUtils.default.isFunction(o)?o({}):o):(0,_ui.getI18n)("vxe.upload.imgBtnText")):(0,_ui.renderEmptyElement)(F),r&&(d||g)?(0,_vue.h)("div",{class:"vxe-upload--image-action-hint"},g?(0,_vn.getSlotVNs)(g({$upload:F})):""+d):(0,_ui.renderEmptyElement)(F)])])])};const o=(0,_vue.ref)(0);return(0,_vue.watch)(()=>E.modelValue?E.modelValue.length:0,()=>{o.value++}),(0,_vue.watch)(()=>E.modelValue,()=>{o.value++}),(0,_vue.watch)(o,()=>{s()}),(0,_vue.onMounted)(()=>{E.multiple&&E.singleMode&&(0,_log.errLog)("vxe.error.errConflicts",["multiple","single-mode"]),E.imageStyle&&(0,_log.warnLog)("vxe.error.delProp",["image-style","image-config"]),E.dragSort&&(0,_dom.initTpImg)(),_ui.globalEvents.on(F,"paste",_e),_ui.globalEvents.on(F,"mousedown",fe),_ui.globalEvents.on(F,"blur",he)}),(0,_vue.onUnmounted)(()=>{T.isDragUploadStatus=!1,_ui.globalEvents.off(F,"paste"),_ui.globalEvents.off(F,"mousedown"),_ui.globalEvents.off(F,"blur")}),s(),F.renderVN=()=>{var{showErrorStatus:e,dragToUpload:t,pasteToUpload:o,dragSort:i}=E,{isDragUploadStatus:l,showMorePopup:a,isActivated:u,dragIndex:n}=T,r=R.value,d=I.value,s=C.value,p=_.value,v={onMousedown:ce};return t&&-1===n&&(v.onDragover=ne,v.onDragleave=ue,v.onDrop=de),(0,_vue.h)("div",Object.assign({ref:g,class:["vxe-upload",{["size--"+r]:r,"is--active":u,"is--readonly":s,"is--disabled":d,"is--paste":o,"show--error":e,"is--drag":l}]},v),[(p?()=>{var{showList:e,dragSort:t}=E;const{fileList:o,isDragMove:i}=T,{maxCount:l,showMoreButton:a}=Q.value;let u=o,n=0;return l&&o.length>l&&(n=o.length-l,u=o.slice(0,l)),(0,_vue.h)("div",{key:"image",class:"vxe-upload--image-wrapper"},e?[t?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(i?"":"-disabled"),tag:"div",class:"vxe-upload--image-list"},{default:()=>k(u,!1).concat([a&&n?(0,_vue.h)("div",{key:"om",class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(F),N(!1)])}):(0,_vue.h)("div",{class:"vxe-upload--image-list"},k(u,!1).concat([a&&n?(0,_vue.h)("div",{class:"vxe-upload--image-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[o.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(F),N(!1)]))]:[(0,_vue.h)("div",{class:"vxe-upload--image-list"},[N(!1)])])}:()=>{var{showList:e,moreConfig:t,dragSort:o}=E,{fileList:i,isDragMove:l}=T,{maxCount:a,showMoreButton:u,layout:n}=Q.value,n="horizontal"===n;let r=i,d=0;return a&&i.length>a&&(d=i.length-a,r=i.slice(0,a)),(0,_vue.h)("div",{key:"all",class:"vxe-upload--file-wrapper"},e?[u&&t&&n?(0,_ui.renderEmptyElement)(F):y(!0),r.length||u&&n?(0,_vue.h)("div",{class:["vxe-upload--file-list-wrapper",{"is--horizontal":n}]},[r.length?o?(0,_vue.h)(_vue.TransitionGroup,{name:"vxe-upload--drag-list"+(l?"":"-disabled"),tag:"div",class:"vxe-upload--file-list"},{default:()=>x(r,!1)}):(0,_vue.h)("div",{class:"vxe-upload--file-list"},x(r,!1)):(0,_ui.renderEmptyElement)(F),u&&d?(0,_vue.h)("div",{class:"vxe-upload--file-over-more"},[(0,_vue.h)(_button.default,{mode:"text",content:(0,_ui.getI18n)("vxe.upload.moreBtnText",[i.length]),status:"primary",onClick:h})]):(0,_ui.renderEmptyElement)(F),u&&t&&n?y(!1):(0,_ui.renderEmptyElement)(F)]):(0,_ui.renderEmptyElement)(F)]:[y(!1)])})(),i?(0,_vue.h)("div",{ref:m,class:"vxe-upload--drag-line"}):(0,_ui.renderEmptyElement)(F),l&&!a?(0,_vue.h)("div",{class:"vxe-upload--drag-placeholder"},(0,_ui.getI18n)("vxe.upload.dragPlaceholder")):(0,_ui.renderEmptyElement)(F)])},F},render(){return this.renderVN()}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-pc-ui",
3
- "version": "4.6.9",
3
+ "version": "4.6.10",
4
4
  "description": "A vue based PC component library",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -717,10 +717,8 @@ const VxeButtonComponent = defineComponent({
717
717
  $xeButton.renderVN = renderVN
718
718
 
719
719
  onMounted(() => {
720
- if (process.env.VUE_APP_VXE_ENV === 'development') {
721
- if (props.type === 'text') {
722
- warnLog('vxe.error.delProp', ['type=text', 'mode=text'])
723
- }
720
+ if (props.type === 'text') {
721
+ warnLog('vxe.error.delProp', ['type=text', 'mode=text'])
724
722
  }
725
723
 
726
724
  globalEvents.on($xeButton, 'mousewheel', handleGlobalMousewheelEvent)
@@ -100,10 +100,8 @@ function getComponentOns (renderOpts: any, params: any, eFns?: {
100
100
  const ons: any = {}
101
101
  XEUtils.objectEach(events, (func, key: any) => {
102
102
  ons[getOnName(key)] = function (...args: any[]) {
103
- if (process.env.VUE_APP_VXE_ENV === 'development') {
104
- if (!XEUtils.isFunction(func)) {
105
- errLog('vxe.error.errFunc', [func])
106
- }
103
+ if (!XEUtils.isFunction(func)) {
104
+ errLog('vxe.error.errFunc', [func])
107
105
  }
108
106
  func(params, ...args)
109
107
  }
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, h, ref, Ref, provide, computed, inject, reactive, watch, nextTick, PropType, onMounted } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { getConfig, validators, renderer, createEvent, useSize } from '../../ui'
4
- import { getFuncText, isEnableConf, eqEmptyValue } from '../../ui/src/utils'
4
+ import { getFuncText, isEnableConf } from '../../ui/src/utils'
5
5
  import { scrollToView } from '../../ui/src/dom'
6
6
  import { createItem, handleFieldOrItem, isHiddenItem, isActiveItem } from './util'
7
7
  import VxeTooltipComponent from '../../tooltip/src/tooltip'
@@ -39,27 +39,104 @@ class Rule {
39
39
  [key: string]: any
40
40
  }
41
41
 
42
- const validErrorRuleValue = (rule: VxeFormDefines.FormRule, val: any) => {
42
+ // 如果存在 pattern,判断正则
43
+ function validREValue (pattern: string | RegExp | undefined, val: string) {
44
+ if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
45
+ return false
46
+ }
47
+ return true
48
+ }
49
+
50
+ // 如果存在 max,判断最大值
51
+ function validMaxValue (max: string | number | undefined, num: number) {
52
+ if (!XEUtils.eqNull(max) && num > XEUtils.toNumber(max)) {
53
+ return false
54
+ }
55
+ return true
56
+ }
57
+
58
+ // 如果存在 min,判断最小值
59
+ function validMinValue (min: string | number | undefined, num: number) {
60
+ if (!XEUtils.eqNull(min) && num < XEUtils.toNumber(min)) {
61
+ return false
62
+ }
63
+ return true
64
+ }
65
+
66
+ function validRuleValue (rule: VxeFormDefines.FormRule, val: any, required: boolean | undefined) {
43
67
  const { type, min, max, pattern } = rule
68
+ const isArrType = type === 'array'
44
69
  const isNumType = type === 'number'
45
- const numVal = isNumType ? XEUtils.toNumber(val) : XEUtils.getSize(val)
46
- // 判断数值
47
- if (isNumType && isNaN(val)) {
48
- return true
49
- }
50
- // 如果存在 min,判断最小值
51
- if (!XEUtils.eqNull(min) && numVal < XEUtils.toNumber(min)) {
52
- return true
70
+ const isStrType = type === 'string'
71
+ const strVal = `${val}`
72
+ if (!validREValue(pattern, strVal)) {
73
+ return false
53
74
  }
54
- // 如果存在 max,判断最大值
55
- if (!XEUtils.eqNull(max) && numVal > XEUtils.toNumber(max)) {
56
- return true
75
+ if (isArrType) {
76
+ if (!XEUtils.isArray(val)) {
77
+ return false
78
+ }
79
+ if (required) {
80
+ if (!val.length) {
81
+ return false
82
+ }
83
+ }
84
+ if (!validMinValue(min, val.length)) {
85
+ return false
86
+ }
87
+ if (!validMaxValue(max, val.length)) {
88
+ return false
89
+ }
90
+ } else if (isNumType) {
91
+ const numVal = Number(val)
92
+ if (isNaN(numVal)) {
93
+ return false
94
+ }
95
+ if (!validMinValue(min, numVal)) {
96
+ return false
97
+ }
98
+ if (!validMaxValue(max, numVal)) {
99
+ return false
100
+ }
101
+ } else {
102
+ if (isStrType) {
103
+ if (!XEUtils.isString(val)) {
104
+ return false
105
+ }
106
+ }
107
+ if (required) {
108
+ if (!strVal) {
109
+ return false
110
+ }
111
+ }
112
+ if (!validMinValue(min, strVal.length)) {
113
+ return false
114
+ }
115
+ if (!validMaxValue(max, strVal.length)) {
116
+ return false
117
+ }
57
118
  }
58
- // 如果存在 pattern,正则校验
59
- if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
60
- return true
119
+ return true
120
+ }
121
+
122
+ function checkRuleStatus (rule: VxeFormDefines.FormRule, val: any) {
123
+ const { required } = rule
124
+ const isEmptyVal = XEUtils.eqNull(val)
125
+ if (required) {
126
+ if (isEmptyVal) {
127
+ return false
128
+ }
129
+ if (!validRuleValue(rule, val, required)) {
130
+ return false
131
+ }
132
+ } else {
133
+ if (!isEmptyVal) {
134
+ if (!validRuleValue(rule, val, required)) {
135
+ return false
136
+ }
137
+ }
61
138
  }
62
- return false
139
+ return true
63
140
  }
64
141
 
65
142
  export default defineComponent({
@@ -416,7 +493,7 @@ export default defineComponent({
416
493
  if (rules) {
417
494
  const itemValue = XEUtils.isUndefined(val) ? XEUtils.get(data, property) : val
418
495
  rules.forEach((rule) => {
419
- const { type, trigger, required, validator } = rule
496
+ const { trigger, validator } = rule
420
497
  if (validType === 'all' || !trigger || validType === trigger) {
421
498
  if (validator) {
422
499
  const validParams = {
@@ -436,14 +513,10 @@ export default defineComponent({
436
513
  if (validatorMethod) {
437
514
  customValid = validatorMethod(validParams)
438
515
  } else {
439
- if (process.env.VUE_APP_VXE_ENV === 'development') {
440
- warnLog('vxe.error.notValidators', [validator])
441
- }
516
+ warnLog('vxe.error.notValidators', [validator])
442
517
  }
443
518
  } else {
444
- if (process.env.VUE_APP_VXE_ENV === 'development') {
445
- errLog('vxe.error.notValidators', [validator])
446
- }
519
+ errLog('vxe.error.notValidators', [validator])
447
520
  }
448
521
  } else {
449
522
  customValid = validator(validParams)
@@ -461,17 +534,7 @@ export default defineComponent({
461
534
  }
462
535
  }
463
536
  } else {
464
- const isArrType = type === 'array'
465
- const isArrVal = XEUtils.isArray(itemValue)
466
- let hasEmpty = true
467
- if (isArrType || isArrVal) {
468
- hasEmpty = !isArrVal || !itemValue.length
469
- } else if (XEUtils.isString(itemValue)) {
470
- hasEmpty = eqEmptyValue(itemValue.trim())
471
- } else {
472
- hasEmpty = eqEmptyValue(itemValue)
473
- }
474
- if (required ? (hasEmpty || validErrorRuleValue(rule, itemValue)) : (!hasEmpty && validErrorRuleValue(rule, itemValue))) {
537
+ if (!checkRuleStatus(rule, itemValue)) {
475
538
  errorRules.push(new Rule(rule))
476
539
  }
477
540
  }
@@ -248,9 +248,7 @@ export default defineComponent({
248
248
  * @deprecated
249
249
  */
250
250
  updateItemStatus (widget, value) {
251
- if (process.env.VUE_APP_VXE_ENV === 'development') {
252
- warnLog('vxe.error.delFunc', ['updateItemStatus', 'updateWidgetStatus'])
253
- }
251
+ warnLog('vxe.error.delFunc', ['updateItemStatus', 'updateWidgetStatus'])
254
252
  return updateWidgetStatus(widget, value)
255
253
  }
256
254
  }
@@ -118,13 +118,11 @@ export default defineComponent({
118
118
  updateTableData()
119
119
  })
120
120
 
121
- if (process.env.VUE_APP_VXE_ENV === 'development') {
122
- nextTick(() => {
123
- if (!VxeTableGridComponent) {
124
- errLog('vxe.error.reqComp', ['vxe-grid'])
125
- }
126
- })
127
- }
121
+ nextTick(() => {
122
+ if (!VxeTableGridComponent) {
123
+ errLog('vxe.error.reqComp', ['vxe-grid'])
124
+ }
125
+ })
128
126
 
129
127
  return () => {
130
128
  const { searchFormData, searchFormItems } = listDesignReactData
@@ -467,13 +467,11 @@ export default defineComponent({
467
467
 
468
468
  provide('$xeListView', $xeListView)
469
469
 
470
- if (process.env.VUE_APP_VXE_ENV === 'development') {
471
- nextTick(() => {
472
- if (!VxeTableGridComponent) {
473
- errLog('vxe.error.reqComp', ['vxe-grid'])
474
- }
475
- })
476
- }
470
+ nextTick(() => {
471
+ if (!VxeTableGridComponent) {
472
+ errLog('vxe.error.reqComp', ['vxe-grid'])
473
+ }
474
+ })
477
475
 
478
476
  $xeListView.renderVN = renderVN
479
477