fast-element-plus 1.0.0-alpha.9 → 1.0.1

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 (155) hide show
  1. package/dist/index.full.js +3180 -4581
  2. package/dist/index.full.js.map +1 -1
  3. package/dist/index.full.min.js +5 -5
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +5 -5
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +3180 -4581
  8. package/dist/index.full.mjs.map +1 -1
  9. package/dist/styles/index.css +2 -2
  10. package/es/components/avatar/index.d.ts +1 -1
  11. package/es/components/avatar/index.mjs.map +1 -1
  12. package/es/components/avatar/src/avatar.d.ts +18 -102
  13. package/es/components/avatar/src/avatar.mjs +1 -2
  14. package/es/components/avatar/src/avatar.mjs.map +1 -1
  15. package/es/components/button/index.d.ts +1 -1
  16. package/es/components/button/index.mjs.map +1 -1
  17. package/es/components/button/src/button.d.ts +35 -180
  18. package/es/components/button/src/button.mjs +14 -4
  19. package/es/components/button/src/button.mjs.map +1 -1
  20. package/es/components/carNumber/src/carNumber.d.ts +58 -194
  21. package/es/components/contextMenu/src/contextMenu.mjs +1 -1
  22. package/es/components/contextMenu/src/contextMenu.mjs.map +1 -1
  23. package/es/components/dialog/src/dialog.d.ts +45 -297
  24. package/es/components/drawer/src/drawer.d.ts +72 -450
  25. package/es/components/form/src/form.d.ts +28 -133
  26. package/es/components/form/src/formItem.d.ts +32 -137
  27. package/es/components/iconSelector/src/iconSelector.mjs +2 -2
  28. package/es/components/iconSelector/src/iconSelector.mjs.map +1 -1
  29. package/es/components/image/src/image.d.ts +43 -253
  30. package/es/components/select/src/select.d.ts +25 -81
  31. package/es/components/select/src/select.mjs +1 -0
  32. package/es/components/select/src/select.mjs.map +1 -1
  33. package/es/components/selectPage/src/selectPage.d.ts +19 -61
  34. package/es/components/selectV2/src/selectV2.d.ts +25 -81
  35. package/es/components/selectV2/src/selectV2.mjs +1 -0
  36. package/es/components/selectV2/src/selectV2.mjs.map +1 -1
  37. package/es/components/table/src/table.d.ts +5 -12
  38. package/es/components/table/src/table.mjs +4 -6
  39. package/es/components/table/src/table.mjs.map +1 -1
  40. package/es/components/table/src/table.state.d.ts +1 -1
  41. package/es/components/table/src/table.type.d.ts +4 -1
  42. package/es/components/table/src/table.type.mjs.map +1 -1
  43. package/es/components/table/src/tableColumn.d.ts +1 -1
  44. package/es/components/table/src/tableColumn.mjs +7 -7
  45. package/es/components/table/src/tableColumn.mjs.map +1 -1
  46. package/es/components/table/src/tableSearchForm.d.ts +6 -4
  47. package/es/components/table/src/tableSearchForm.mjs +2 -2
  48. package/es/components/table/src/tableSearchForm.mjs.map +1 -1
  49. package/es/components/table/src/useTable.mjs +3 -3
  50. package/es/components/table/src/useTable.mjs.map +1 -1
  51. package/es/components/tree/src/tree.d.ts +23 -653
  52. package/es/components/tree/src/tree.mjs +1 -1
  53. package/es/components/tree/src/tree.mjs.map +1 -1
  54. package/es/components/tree/src/tree.type.d.ts +1 -1
  55. package/es/components/treeSelect/src/treeSelect.d.ts +20 -62
  56. package/es/components/treeSelect/src/treeSelect.mjs +1 -0
  57. package/es/components/treeSelect/src/treeSelect.mjs.map +1 -1
  58. package/es/components/upload/src/upload.d.ts +298 -460
  59. package/es/components/upload/src/useUpload.mjs +2 -2
  60. package/es/components/upload/src/useUpload.mjs.map +1 -1
  61. package/es/components/uploadImage/src/uploadImage.d.ts +295 -394
  62. package/es/components/uploadImage/src/uploadImage.mjs +1 -1
  63. package/es/components/uploadImage/src/uploadImage.mjs.map +1 -1
  64. package/es/components/uploadImages/src/uploadImages.d.ts +300 -420
  65. package/es/components/uploadImages/src/uploadImages.mjs +4 -4
  66. package/es/components/uploadImages/src/uploadImages.mjs.map +1 -1
  67. package/es/constants/regex.mjs +13 -13
  68. package/es/constants/regex.mjs.map +1 -1
  69. package/es/directive.d.ts +1 -1
  70. package/es/directives/click-copy/index.d.ts +1 -1
  71. package/es/directives/click-debounce/index.d.ts +1 -1
  72. package/es/directives/click-draggable/index.d.ts +1 -1
  73. package/es/directives/click-icon-copy/index.d.ts +1 -1
  74. package/es/directives/click-longpress/index.d.ts +1 -1
  75. package/es/directives/click-throttle/index.d.ts +1 -1
  76. package/es/element-plus.mjs +1 -1
  77. package/es/element-plus.mjs.map +1 -1
  78. package/es/make-installer.mjs +4 -0
  79. package/es/make-installer.mjs.map +1 -1
  80. package/es/version.d.ts +1 -1
  81. package/es/version.mjs +1 -1
  82. package/es/version.mjs.map +1 -1
  83. package/lib/components/avatar/index.d.ts +1 -1
  84. package/lib/components/avatar/index.js.map +1 -1
  85. package/lib/components/avatar/src/avatar.d.ts +18 -102
  86. package/lib/components/avatar/src/avatar.js +1 -1
  87. package/lib/components/avatar/src/avatar.js.map +1 -1
  88. package/lib/components/button/index.d.ts +1 -1
  89. package/lib/components/button/index.js.map +1 -1
  90. package/lib/components/button/src/button.d.ts +35 -180
  91. package/lib/components/button/src/button.js +1 -1
  92. package/lib/components/button/src/button.js.map +1 -1
  93. package/lib/components/carNumber/src/carNumber.d.ts +58 -194
  94. package/lib/components/contextMenu/src/contextMenu.js +1 -1
  95. package/lib/components/contextMenu/src/contextMenu.js.map +1 -1
  96. package/lib/components/dialog/src/dialog.d.ts +45 -297
  97. package/lib/components/drawer/src/drawer.d.ts +72 -450
  98. package/lib/components/form/src/form.d.ts +28 -133
  99. package/lib/components/form/src/formItem.d.ts +32 -137
  100. package/lib/components/image/src/image.d.ts +43 -253
  101. package/lib/components/select/src/select.d.ts +25 -81
  102. package/lib/components/select/src/select.js +1 -1
  103. package/lib/components/select/src/select.js.map +1 -1
  104. package/lib/components/selectPage/src/selectPage.d.ts +19 -61
  105. package/lib/components/selectV2/src/selectV2.d.ts +25 -81
  106. package/lib/components/selectV2/src/selectV2.js +1 -1
  107. package/lib/components/selectV2/src/selectV2.js.map +1 -1
  108. package/lib/components/table/src/table.d.ts +5 -12
  109. package/lib/components/table/src/table.js +1 -1
  110. package/lib/components/table/src/table.js.map +1 -1
  111. package/lib/components/table/src/table.state.d.ts +1 -1
  112. package/lib/components/table/src/table.type.d.ts +4 -1
  113. package/lib/components/table/src/table.type.js.map +1 -1
  114. package/lib/components/table/src/tableColumn.d.ts +1 -1
  115. package/lib/components/table/src/tableColumn.js +1 -1
  116. package/lib/components/table/src/tableColumn.js.map +1 -1
  117. package/lib/components/table/src/tableSearchForm.d.ts +6 -4
  118. package/lib/components/table/src/tableSearchForm.js +1 -1
  119. package/lib/components/table/src/tableSearchForm.js.map +1 -1
  120. package/lib/components/table/src/useTable.js +1 -1
  121. package/lib/components/table/src/useTable.js.map +1 -1
  122. package/lib/components/tree/src/tree.d.ts +23 -653
  123. package/lib/components/tree/src/tree.js +1 -1
  124. package/lib/components/tree/src/tree.js.map +1 -1
  125. package/lib/components/tree/src/tree.type.d.ts +1 -1
  126. package/lib/components/treeSelect/src/treeSelect.d.ts +20 -62
  127. package/lib/components/treeSelect/src/treeSelect.js +1 -1
  128. package/lib/components/treeSelect/src/treeSelect.js.map +1 -1
  129. package/lib/components/upload/src/upload.d.ts +298 -460
  130. package/lib/components/upload/src/useUpload.js +1 -1
  131. package/lib/components/upload/src/useUpload.js.map +1 -1
  132. package/lib/components/uploadImage/src/uploadImage.d.ts +295 -394
  133. package/lib/components/uploadImage/src/uploadImage.js +1 -1
  134. package/lib/components/uploadImage/src/uploadImage.js.map +1 -1
  135. package/lib/components/uploadImages/src/uploadImages.d.ts +300 -420
  136. package/lib/components/uploadImages/src/uploadImages.js +1 -1
  137. package/lib/components/uploadImages/src/uploadImages.js.map +1 -1
  138. package/lib/constants/regex.js +1 -1
  139. package/lib/constants/regex.js.map +1 -1
  140. package/lib/directive.d.ts +1 -1
  141. package/lib/directives/click-copy/index.d.ts +1 -1
  142. package/lib/directives/click-debounce/index.d.ts +1 -1
  143. package/lib/directives/click-draggable/index.d.ts +1 -1
  144. package/lib/directives/click-icon-copy/index.d.ts +1 -1
  145. package/lib/directives/click-longpress/index.d.ts +1 -1
  146. package/lib/directives/click-throttle/index.d.ts +1 -1
  147. package/lib/element-plus.js +1 -1
  148. package/lib/element-plus.js.map +1 -1
  149. package/lib/make-installer.js +1 -1
  150. package/lib/make-installer.js.map +1 -1
  151. package/lib/version.d.ts +1 -1
  152. package/lib/version.js +1 -1
  153. package/lib/version.js.map +1 -1
  154. package/package.json +8 -8
  155. package/styles/components/contextMenu.scss +2 -2
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus"),a=require("@element-plus/icons-vue"),r=require("@fast-china/utils"),l=require("@vueuse/core"),o=require("lodash-unified"),n=require("./tree.props.js"),d={...n.treeProps,nodeKey:{type:String,default:"value"},defaultExpandAll:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!0},highlightCurrent:{type:Boolean,default:!0},collapseOnClickNode:Boolean,modelValue:{type:r.definePropType([String,Number,Boolean,Object]),default:void 0},label:String,width:{type:[String,Number],default:180},defaultSelection:[String,Number],title:String,hamburger:Boolean,hideAll:Boolean,hideFilter:Boolean,allValue:{type:r.definePropType([String,Number,Boolean,Object]),default:void 0},data:{type:r.definePropType(Array),default:()=>[]},requestApi:{type:r.definePropType(Function)},initParam:r.definePropType([String,Number,Object])},i={"update:modelValue":e=>o.isString(e)||o.isNumber(e)||o.isBoolean(e)||o.isObject(e)||o.isNull(e),"update:label":e=>o.isString(e)||o.isNull(e),dataChangeCallBack:(e,t)=>o.isArray(e)&&o.isArray(t),change:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a)&&r instanceof MouseEvent,nodeClick:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a)&&r instanceof MouseEvent,nodeContextmenu:(e,t,a,r)=>e instanceof Event&&o.isObject(t)&&o.isObject(a)&&o.isObject(r),checkChange:(e,t,a)=>o.isObject(e)&&o.isBoolean(t)&&o.isBoolean(a),check:(e,t)=>o.isObject(e)&&o.isObject(t),currentChange:(e,t)=>o.isObject(e)&&o.isObject(t),nodeExpand:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a),nodeCollapse:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a),nodeDragStart:(e,t)=>o.isObject(e)&&t instanceof DragEvent,nodeDragEnter:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&a instanceof DragEvent,nodeDragLeave:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&a instanceof DragEvent,nodeDragOver:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&a instanceof DragEvent,nodeDragEnd:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isString(a)&&r instanceof DragEvent,nodeDrop:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isString(a)&&r instanceof DragEvent},u=e.defineComponent({name:"FaTree",props:d,emits:i,slots:r.makeSlots(),setup(o,{attrs:d,slots:i,emit:u,expose:c}){const s=l.useVModel(o,"label",u,{passive:!0}),p=t.useGlobalSize(),g=e.reactive({value:r.withDefineType(),loading:!1,searchValue:r.withDefineType(),orgTreeData:r.withDefineType([]),treeData:r.withDefineType([]),hamburger:!1,width:e.computed(()=>{if(o.hamburger||g.hamburger)return"130px";{const e=r.addUnit(o.width);return"small"===p.value?`calc(${e} * 0.9)`:e}})}),h=e.computed(()=>0===[...g.orgTreeData].filter(e=>e[o.props.children]?.length>0).length),f=e.ref(),b=e=>{o.hideAll||e.unshift({[o.nodeKey]:o.allValue,label:"全部",all:!0}),g.treeData=e},m=async()=>{let t;if(o.nodeKey&&(t=f.value.getCurrentKey()),o.requestApi){g.loading=!0;const e={...o.initParam??{},searchValue:g.searchValue};try{const t=await o.requestApi(e);g.orgTreeData=t,b(t)}catch(a){r.consoleError("FaTree",a),g.orgTreeData=[],b([]),u("dataChangeCallBack",g.treeData,g.orgTreeData)}finally{g.loading=!1}}else g.orgTreeData=o.data,b(o.data);o.nodeKey&&t?e.nextTick(()=>{f.value.setCurrentKey(t)}):o.defaultSelection&&e.nextTick(()=>{f.value.setCurrentKey(o.defaultSelection)})},v=()=>{o.hamburger||g.hamburger?b(g.orgTreeData):g.treeData=g.orgTreeData.map(e=>({...e,[o.props.children]:[]})),g.hamburger=!g.hamburger},C=(e,t,a)=>{if(!e)return!0;let r=a.parent,l=t.all?[t.label]:[a.label],n=1;for(;n<a.level;)l=[...l,r.label],r=r.parent,n++;const d=l.some(t=>-1!==t.indexOf(e));return o.filterNodeMethod?d&&o.filterNodeMethod(e,t,a):d},N=(e,t,a,r)=>{o.expandOnClickNode&&(t.expanded?t.expanded&&o.collapseOnClickNode&&t.collapse():t.expand()),g.value=t.key,s.value=t.label,u("update:modelValue",g.value),u("change",e,t,a,r),u("nodeClick",e,t,a,r)};e.onMounted(async()=>{await m(),e.watch(()=>o.data,async()=>{o.requestApi||await m()},{deep:!0})});const y=r.useProps(o,n.treeProps,["data","expandOnClickNode","filterNodeMethod"]);return r.useRender(()=>e.withDirectives(e.createVNode("div",{class:["el-card fa-tree",`fa-tree-${p.value}`,{"fa-tree__fold":o.hamburger&&g.hamburger||h.value}],style:{width:g.width}},[(o.title||o.hamburger)&&e.createVNode("div",{class:"fa-tree__title"},[o.title&&e.createVNode("h4",null,[o.title]),o.hamburger&&(g.hamburger?e.createVNode(t.ElIcon,{onClick:v,title:"展开"},{default:()=>[e.createVNode(a.Expand,null,null)]}):e.createVNode(t.ElIcon,{onClick:v,title:"折叠"},{default:()=>[e.createVNode(a.Fold,null,null)]}))]),!o.hideFilter&&e.createVNode(t.ElInput,{class:"fa-tree__search-input",modelValue:g.searchValue,modelModifiers:{trim:!0},"onUpdate:modelValue":e=>g.searchValue=e,placeholder:o.hamburger||g.hamburger?"关键字过滤":"输入关键字进行过滤",clearable:!0,onInput:e=>f.value.filter(e)},null),e.createVNode(t.ElScrollbar,{class:"fa-tree__scrollbar"},{default:()=>[e.createVNode(t.ElTree,e.mergeProps(y.value,{ref:f,data:g.treeData,expandOnClickNode:!o.checkOnClickNode&&o.expandOnClickNode,filterNodeMethod:C,onNodeClick:N,onNodeContextmenu:(e,t,a,r)=>u("nodeContextmenu",e,t,a,r),onCheckChange:(e,t,a)=>u("checkChange",e,t,a),onCheck:(e,t)=>u("check",e,t),onCurrentChange:(e,t)=>u("currentChange",e,t),onNodeExpand:(e,t,a)=>u("nodeExpand",e,t,a),onNodeCollapse:(e,t,a)=>u("nodeCollapse",e,t,a),onNodeDragStart:(e,t)=>u("nodeDragStart",e,t),onNodeDragEnter:(e,t,a)=>u("nodeDragEnter",e,t,a),onNodeDragLeave:(e,t,a)=>u("nodeDragLeave",e,t,a),onNodeDragOver:(e,t,a)=>u("nodeDragOver",e,t,a),onNodeDragEnd:(e,t,a,r)=>u("nodeDragEnd",e,t,a,r),onNodeDrop:(e,t,a,r)=>u("nodeDrop",e,t,a,r)}),{default:({node:t,data:a})=>e.createVNode("span",{class:"el-tree-node__label",title:a?.all?a.label:t.label,style:{paddingLeft:h.value?"3px":""}},[e.createVNode("span",null,[i.label?i.label({node:t,data:a}):a?.all?a.label:t.label]),t.key&&a.showNum?e.createVNode("span",null,[e.createTextVNode("["),a.quantity,e.createTextVNode("]")]):null,i.default&&e.createVNode("span",null,[i.default({node:t,data:a})])]),...i.empty&&{empty:()=>i.empty()}})]})]),[[e.resolveDirective("loading"),g.loading]])),r.useExpose(c,{filter:e.computed(()=>f.value?.filter),updateKeyChildren:e.computed(()=>f.value?.updateKeyChildren),getCheckedNodes:e.computed(()=>f.value?.getCheckedNodes),setCheckedNodes:e.computed(()=>f.value?.setCheckedNodes),getCheckedKeys:e.computed(()=>f.value?.getCheckedKeys),setCheckedKeys:e.computed(()=>f.value?.setCheckedKeys),setChecked:e.computed(()=>f.value?.setChecked),getHalfCheckedNodes:e.computed(()=>f.value?.getHalfCheckedNodes),getHalfCheckedKeys:e.computed(()=>f.value?.getHalfCheckedKeys),getCurrentKey:e.computed(()=>f.value?.getCurrentKey),getCurrentNode:e.computed(()=>f.value?.getCurrentNode),setCurrentKey:e.computed(()=>f.value?.setCurrentKey),setCurrentNode:e.computed(()=>f.value?.setCurrentNode),getNode:e.computed(()=>f.value?.getNode),remove:e.computed(()=>f.value?.remove),append:e.computed(()=>f.value?.append),insertBefore:e.computed(()=>f.value?.insertBefore),insertAfter:e.computed(()=>f.value?.insertAfter),loading:e.computed(()=>g.loading),refresh:m})}});exports.default=u,exports.faTreeEmits=i,exports.faTreeProps=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus"),a=require("@element-plus/icons-vue"),r=require("@fast-china/utils"),l=require("@vueuse/core"),o=require("lodash-unified"),n=require("./tree.props.js"),d={...n.treeProps,nodeKey:{type:String,default:"value"},defaultExpandAll:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!0},highlightCurrent:{type:Boolean,default:!0},collapseOnClickNode:Boolean,modelValue:{type:r.definePropType([String,Number,Boolean,Object]),default:void 0},label:String,width:{type:[String,Number],default:180},defaultSelection:[String,Number],title:String,hamburger:Boolean,hideAll:Boolean,hideFilter:Boolean,allValue:{type:r.definePropType([String,Number,Boolean,Object]),default:void 0},data:{type:r.definePropType(Array),default:()=>[]},requestApi:{type:r.definePropType(Function)},initParam:r.definePropType([String,Number,Object])},i={"update:modelValue":e=>o.isString(e)||o.isNumber(e)||o.isBoolean(e)||o.isObject(e)||o.isNull(e),"update:label":e=>o.isString(e)||o.isNull(e),dataChangeCallBack:(e,t)=>o.isArray(e)&&o.isArray(t),change:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a)&&r instanceof MouseEvent,nodeClick:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a)&&r instanceof MouseEvent,nodeContextmenu:(e,t,a,r)=>e instanceof Event&&o.isObject(t)&&o.isObject(a)&&o.isObject(r),checkChange:(e,t,a)=>o.isObject(e)&&o.isBoolean(t)&&o.isBoolean(a),check:(e,t)=>o.isObject(e)&&o.isObject(t),currentChange:(e,t)=>o.isObject(e)&&o.isObject(t),nodeExpand:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a),nodeCollapse:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&o.isObject(a),nodeDragStart:(e,t)=>o.isObject(e)&&t instanceof DragEvent,nodeDragEnter:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&a instanceof DragEvent,nodeDragLeave:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&a instanceof DragEvent,nodeDragOver:(e,t,a)=>o.isObject(e)&&o.isObject(t)&&a instanceof DragEvent,nodeDragEnd:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isString(a)&&r instanceof DragEvent,nodeDrop:(e,t,a,r)=>o.isObject(e)&&o.isObject(t)&&o.isString(a)&&r instanceof DragEvent},u=e.defineComponent({name:"FaTree",props:d,emits:i,slots:r.makeSlots(),setup(o,{attrs:d,slots:i,emit:u,expose:c}){const s=l.useVModel(o,"label",u,{passive:!0}),p=t.useGlobalSize(),g=e.reactive({value:r.withDefineType(),loading:!1,searchValue:r.withDefineType(),orgTreeData:r.withDefineType([]),treeData:r.withDefineType([]),hamburger:!1,width:e.computed(()=>{if(o.hamburger||g.hamburger)return"130px";{const e=r.addUnit(o.width);return"small"===p.value?`calc(${e} * 0.9)`:e}})}),h=e.computed(()=>0===[...g.orgTreeData].filter(e=>e[o.props.children]?.length>0).length),f=e.ref(),b=e=>{o.hideAll||e.unshift({[o.nodeKey]:o.allValue,label:"全部",all:!0}),g.treeData=e},m=async()=>{let t;if(o.nodeKey&&(t=f.value.getCurrentKey()),o.requestApi){g.loading=!0;const e={...o.initParam??{},searchValue:g.searchValue};try{const t=await o.requestApi(e);g.orgTreeData=t,b(t)}catch(a){r.consoleError("FaTree",a),g.orgTreeData=[],b([]),u("dataChangeCallBack",g.treeData,g.orgTreeData)}finally{g.loading=!1}}else g.orgTreeData=o.data,b(o.data);o.nodeKey&&t?e.nextTick(()=>{f.value.setCurrentKey(t)}):o.defaultSelection&&e.nextTick(()=>{f.value.setCurrentKey(o.defaultSelection)})},v=()=>{o.hamburger||g.hamburger?b(g.orgTreeData):g.treeData=g.orgTreeData.map(e=>({...e,[o.props.children]:[]})),g.hamburger=!g.hamburger},C=(e,t,a)=>{if(!e)return!0;let r=a.parent,l=t.all?[t.label]:[a.label],n=1;for(;n<a.level;)l=[...l,r.label],r=r.parent,n++;const d=l.some(t=>-1!==t.indexOf(e));return o.filterNodeMethod?d&&o.filterNodeMethod(e,t,a):d},N=(e,t,a,r)=>{o.expandOnClickNode&&(t.expanded?t.expanded&&o.collapseOnClickNode&&t.collapse():t.expand()),g.value=t.key,s.value=t.label,u("update:modelValue",g.value),u("change",e,t,a,r),u("nodeClick",e,t,a,r)};e.onMounted(async()=>{await m(),e.watch(()=>o.data,async()=>{o.requestApi||await m()},{deep:!0})});const y=r.useProps(o,n.treeProps,["data","expandOnClickNode","filterNodeMethod"]);return r.useRender(()=>e.withDirectives(e.createVNode("div",{class:["el-card fa-tree",`fa-tree-${p.value}`,{"fa-tree__fold":o.hamburger&&g.hamburger||h.value}],style:{width:g.width}},[(o.title||o.hamburger)&&e.createVNode("div",{class:"fa-tree__title"},[o.title&&e.createVNode("h4",null,[o.title]),o.hamburger&&(g.hamburger?e.createVNode(t.ElIcon,{onClick:v,title:"展开"},{default:()=>[e.createVNode(a.Expand,null,null)]}):e.createVNode(t.ElIcon,{onClick:v,title:"折叠"},{default:()=>[e.createVNode(a.Fold,null,null)]}))]),!o.hideFilter&&e.createVNode(t.ElInput,{class:"fa-tree__search-input",modelValue:g.searchValue,modelModifiers:{trim:!0},"onUpdate:modelValue":e=>g.searchValue=e,placeholder:o.hamburger||g.hamburger?"关键字过滤":"输入关键字进行过滤",clearable:!0,onInput:e=>f.value.filter(e)},null),e.createVNode(t.ElScrollbar,{class:"fa-tree__scrollbar"},{default:()=>[e.createVNode(t.ElTree,e.mergeProps(y.value,{ref:f,data:g.treeData,expandOnClickNode:!o.checkOnClickNode&&o.expandOnClickNode,filterNodeMethod:C,onNodeClick:N,onNodeContextmenu:(e,t,a,r)=>u("nodeContextmenu",e,t,a,r),onCheckChange:(e,t,a)=>u("checkChange",e,t,a),onCheck:(e,t)=>u("check",e,t),onCurrentChange:(e,t)=>u("currentChange",e,t),onNodeExpand:(e,t,a)=>u("nodeExpand",e,t,a),onNodeCollapse:(e,t,a)=>u("nodeCollapse",e,t,a),onNodeDragStart:(e,t)=>u("nodeDragStart",e,t),onNodeDragEnter:(e,t,a)=>u("nodeDragEnter",e,t,a),onNodeDragLeave:(e,t,a)=>u("nodeDragLeave",e,t,a),onNodeDragOver:(e,t,a)=>u("nodeDragOver",e,t,a),onNodeDragEnd:(e,t,a,r)=>u("nodeDragEnd",e,t,a,r),onNodeDrop:(e,t,a,r)=>u("nodeDrop",e,t,a,r)}),{default:({node:t,data:a})=>e.createVNode("span",{class:"el-tree-node__label",title:a?.all?a.label:t.label,style:{paddingLeft:h.value?"3px":""}},[e.createVNode("span",null,[i.label?i.label({node:t,data:a}):a?.all?a.label:t.label]),t.key&&a.showQuantity?e.createVNode("span",null,[e.createTextVNode("["),a.quantity,e.createTextVNode("]")]):null,i.default&&e.createVNode("span",null,[i.default({node:t,data:a})])]),...i.empty&&{empty:()=>i.empty()}})]})]),[[e.resolveDirective("loading"),g.loading]])),r.useExpose(c,{filter:e.computed(()=>f.value?.filter),updateKeyChildren:e.computed(()=>f.value?.updateKeyChildren),getCheckedNodes:e.computed(()=>f.value?.getCheckedNodes),setCheckedNodes:e.computed(()=>f.value?.setCheckedNodes),getCheckedKeys:e.computed(()=>f.value?.getCheckedKeys),setCheckedKeys:e.computed(()=>f.value?.setCheckedKeys),setChecked:e.computed(()=>f.value?.setChecked),getHalfCheckedNodes:e.computed(()=>f.value?.getHalfCheckedNodes),getHalfCheckedKeys:e.computed(()=>f.value?.getHalfCheckedKeys),getCurrentKey:e.computed(()=>f.value?.getCurrentKey),getCurrentNode:e.computed(()=>f.value?.getCurrentNode),setCurrentKey:e.computed(()=>f.value?.setCurrentKey),setCurrentNode:e.computed(()=>f.value?.setCurrentNode),getNode:e.computed(()=>f.value?.getNode),remove:e.computed(()=>f.value?.remove),append:e.computed(()=>f.value?.append),insertBefore:e.computed(()=>f.value?.insertBefore),insertAfter:e.computed(()=>f.value?.insertAfter),loading:e.computed(()=>g.loading),refresh:m})}});exports.default=u,exports.faTreeEmits=i,exports.faTreeProps=d;
2
2
  //# sourceMappingURL=tree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","sources":["../../../../../packages/components/tree/src/tree.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, useGlobalSize } from \"element-plus\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { addUnit, consoleError, definePropType, makeSlots, useExpose, useProps, useRender, withDefineType } from \"@fast-china/utils\";\nimport { useVModel } from \"@vueuse/core\";\nimport { isArray, isBoolean, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { treeProps } from \"./tree.props\";\nimport type { FilterValue, NodeDropType, TreeKey, TreeNodeData } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: (): ElTreeOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: any) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | any>([String, Number, Object]),\n};\n\nexport const faTreeEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string): boolean => isString(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElTreeOutput[], orgData: ElTreeOutput[]): boolean => isArray(data) && isArray(orgData),\n\t/** @description 改变 */\n\tchange: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance) && event instanceof MouseEvent,\n\t/** @description 当节点被点击的时候触发 */\n\tnodeClick: (data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance, event?: MouseEvent): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance) && event instanceof MouseEvent,\n\t/** @description 当某一节点被鼠标右键点击时会触发该事件 */\n\tnodeContextmenu: (event: Event, data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance): boolean =>\n\t\tevent instanceof Event && isObject(data) && isObject(node) && isObject(instance),\n\t/** @description 当复选框被点击的时候触发 */\n\tcheckChange: (data: ElTreeOutput, checked: boolean, indeterminate: boolean): boolean =>\n\t\tisObject(data) && isBoolean(checked) && isBoolean(indeterminate),\n\t/** @description 点击节点复选框之后触发 */\n\tcheck: (\n\t\tdata: ElTreeOutput,\n\t\tnode: {\n\t\t\tcheckedNodes: ElTreeOutput[];\n\t\t\tcheckedKeys: TreeKey[];\n\t\t\thalfCheckedNodes: ElTreeOutput[];\n\t\t\thalfCheckedKeys: TreeKey[];\n\t\t}\n\t): boolean => isObject(data) && isObject(node),\n\t/** @description 当前选中节点变化时触发的事件 */\n\tcurrentChange: (data: ElTreeOutput, node: any): boolean => isObject(data) && isObject(node),\n\t/** @description 节点被展开时触发的事件 */\n\tnodeExpand: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点被关闭时触发的事件 */\n\tnodeCollapse: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点开始拖拽时触发的事件 */\n\tnodeDragStart: (node: any, event: DragEvent): boolean => isObject(node) && event instanceof DragEvent,\n\t/** @description 拖拽进入其他节点时触发的事件 */\n\tnodeDragEnter: (node: any, enterNode: any, event: DragEvent): boolean => isObject(node) && isObject(enterNode) && event instanceof DragEvent,\n\t/** @description 拖拽离开某个节点时触发的事件 */\n\tnodeDragLeave: (node: any, leaveNode: any, event: DragEvent): boolean => isObject(node) && isObject(leaveNode) && event instanceof DragEvent,\n\t/** @description 在拖拽节点时触发的事件(类似浏览器的 mouseover 事件) */\n\tnodeDragOver: (node: any, dropNode: any, event: DragEvent): boolean => isObject(node) && isObject(dropNode) && event instanceof DragEvent,\n\t/** @description 拖拽结束时(可能未成功)触发的事件 */\n\tnodeDragEnd: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n\t/** @description 拖拽成功完成时触发的事件 */\n\tnodeDrop: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n};\n\ntype FaTreeSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: any; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: any; data: ElTreeOutput };\n};\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object>(),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\torgTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (props.hamburger || state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addUnit(props.width);\n\t\t\t\t\tif (_globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => [...state.orgTreeData].filter((f) => f[props.props.children]?.length > 0).length === 0);\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\n\t\tconst setTreeData = (treeData: ElTreeOutput[] | any[]): void => {\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", all: true } as any);\n\t\t\t}\n\t\t\tstate.treeData = treeData;\n\t\t};\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tlet curSelectedData;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tcurSelectedData = treeRef.value.getCurrentKey();\n\t\t\t}\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = { ...(props.initParam ?? {}), searchValue: state.searchValue };\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tstate.orgTreeData = resData;\n\t\t\t\t\tsetTreeData(resData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsoleError(\"FaTree\", error);\n\t\t\t\t\tstate.orgTreeData = [];\n\t\t\t\t\tsetTreeData([]);\n\t\t\t\t\temit(\"dataChangeCallBack\", state.treeData, state.orgTreeData);\n\t\t\t\t} finally {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstate.orgTreeData = props.data;\n\t\t\t\tsetTreeData(props.data);\n\t\t\t}\n\t\t\tif (props.nodeKey && curSelectedData) {\n\t\t\t\tnextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value.setCurrentKey(curSelectedData);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (props.defaultSelection) {\n\t\t\t\t\tnextTick(() => {\n\t\t\t\t\t\ttreeRef.value.setCurrentKey(props.defaultSelection);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (props.hamburger || state.hamburger) {\n\t\t\t\tsetTreeData(state.orgTreeData);\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((m) => ({ ...m, [props.props.children]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: any): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = data.all ? [data.label] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst result = labels.some((label) => label.indexOf(value) !== -1);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent): void => {\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tstate.value = node.key;\n\t\t\tselectedLabel.value = node.label;\n\t\t\temit(\"update:modelValue\", state.value);\n\t\t\temit(\"change\", data, node, instance, event);\n\t\t\temit(\"nodeClick\", data, node, instance, event);\n\t\t};\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\tasync () => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${_globalSize.value}`, { \"fa-tree__fold\": (props.hamburger && state.hamburger) || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={props.hamburger || state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable\n\t\t\t\t\t\tonInput={(value) => treeRef.value.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNodeClick={handleNodeClick}\n\t\t\t\t\t\tonNodeContextmenu={(event: Event, data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeContextmenu\", event, data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonCheckChange={(data: ElTreeOutput, checked: boolean, indeterminate: boolean) =>\n\t\t\t\t\t\t\temit(\"checkChange\", data, checked, indeterminate)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonCheck={(\n\t\t\t\t\t\t\tdata: ElTreeOutput,\n\t\t\t\t\t\t\tnode: {\n\t\t\t\t\t\t\t\tcheckedNodes: ElTreeOutput[];\n\t\t\t\t\t\t\t\tcheckedKeys: TreeKey[];\n\t\t\t\t\t\t\t\thalfCheckedNodes: ElTreeOutput[];\n\t\t\t\t\t\t\t\thalfCheckedKeys: TreeKey[];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) => emit(\"check\", data, node)}\n\t\t\t\t\t\tonCurrentChange={(data: ElTreeOutput, node: any) => emit(\"currentChange\", data, node)}\n\t\t\t\t\t\tonNodeExpand={(data: ElTreeOutput, node: any, instance: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeExpand\", data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeCollapse={(data: ElTreeOutput, node: any, instance: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeCollapse\", data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeDragStart={(node: any, event: DragEvent) => emit(\"nodeDragStart\", node, event)}\n\t\t\t\t\t\tonNodeDragEnter={(node: any, enterNode: any, event: DragEvent) => emit(\"nodeDragEnter\", node, enterNode, event)}\n\t\t\t\t\t\tonNodeDragLeave={(node: any, leaveNode: any, event: DragEvent) => emit(\"nodeDragLeave\", node, leaveNode, event)}\n\t\t\t\t\t\tonNodeDragOver={(node: any, dropNode: any, event: DragEvent) => emit(\"nodeDragOver\", node, dropNode, event)}\n\t\t\t\t\t\tonNodeDragEnd={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) =>\n\t\t\t\t\t\t\temit(\"nodeDragEnd\", node, dropNode, dropType, event)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeDrop={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) =>\n\t\t\t\t\t\t\temit(\"nodeDrop\", node, dropNode, dropType, event)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: any; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data?.all ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span>{slots.label ? slots.label({ node, data }) : data?.all ? data.label : node.label}</span>\n\t\t\t\t\t\t\t\t\t{node.key && data.showNum ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty() }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"names":["faTreeProps","treeProps","nodeKey","type","String","default","defaultExpandAll","Boolean","checkOnClickNode","highlightCurrent","collapseOnClickNode","modelValue","definePropType","Number","Object","undefined","label","width","defaultSelection","title","hamburger","hideAll","hideFilter","allValue","data","Array","requestApi","Function","initParam","faTreeEmits","isString","value","isNumber","isBoolean","isObject","isNull","dataChangeCallBack","orgData","isArray","change","node","instance","event","MouseEvent","nodeClick","nodeContextmenu","Event","checkChange","checked","indeterminate","check","currentChange","nodeExpand","nodeCollapse","nodeDragStart","DragEvent","nodeDragEnter","enterNode","nodeDragLeave","leaveNode","nodeDragOver","dropNode","nodeDragEnd","dropType","nodeDrop","Tree","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","selectedLabel","useVModel","passive","_globalSize","useGlobalSize","state","reactive","withDefineType","loading","searchValue","orgTreeData","treeData","computed","addUnit","fold","filter","f","children","length","treeRef","ref","setTreeData","unshift","all","loadData","async","curSelectedData","getCurrentKey","params","resData","error","consoleError","nextTick","setCurrentKey","handleHamburgerClick","map","m","handleFilterNode","child","parentNode","parent","labels","level","result","some","indexOf","filterNodeMethod","handleNodeClick","expandOnClickNode","expanded","collapse","expand","key","onMounted","watch","deep","elTreeProps","useProps","useRender","_withDirectives","_createVNode","class","style","ElIcon","onClick","Expand","Fold","ElInput","modelModifiers","trim","$event","placeholder","clearable","onInput","ElScrollbar","ElTree","_mergeProps","onNodeClick","onNodeContextmenu","onCheckChange","onCheck","onCurrentChange","onNodeExpand","onNodeCollapse","onNodeDragStart","onNodeDragEnter","onNodeDragLeave","onNodeDragOver","onNodeDragEnd","onNodeDrop","paddingLeft","showNum","_createTextVNode","quantity","empty","_resolveDirective","useExpose","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentNode","setCurrentNode","getNode","remove","append","insertBefore","insertAfter","refresh"],"mappings":"oTAWaA,EAAc,IACvBC,EAAAA,UAEHC,QAAS,CACRC,KAAMC,OACNC,QAAS,SAGVC,iBAAkB,CACjBH,KAAMI,QACNF,SAAS,GAGVG,iBAAkB,CACjBL,KAAMI,QACNF,SAAS,GAGVI,iBAAkB,CACjBN,KAAMI,QACNF,SAAS,GAGVK,oBAAqBH,QAErBI,WAAY,CACXR,KAAMS,EAAAA,eAAmD,CAACR,OAAQS,OAAQN,QAASO,SACnFT,aAASU,GAGVC,MAAOZ,OAEPa,MAAO,CACNd,KAAM,CAACC,OAAQS,QACfR,QAAS,KAGVa,iBAAkB,CAACd,OAAQS,QAE3BM,MAAOf,OAEPgB,UAAWb,QAEXc,QAASd,QAETe,WAAYf,QAEZgB,SAAU,CACTpB,KAAMS,EAAAA,eAAmD,CAACR,OAAQS,OAAQN,QAASO,SACnFT,aAASU,GAGVS,KAAM,CACLrB,KAAMS,EAAAA,eAA+Ba,OACrCpB,QAASA,IAAsB,IAGhCqB,WAAY,CACXvB,KAAMS,EAAAA,eAA0De,WAGjEC,UAAWhB,EAAAA,eAAsC,CAACR,OAAQS,OAAQC,UAGtDe,EAAc,CAE1B,uBACCC,EAAAA,SAASC,IAAUC,EAAAA,SAASD,IAAUE,EAAAA,UAAUF,IAAUG,EAAAA,SAASH,IAAUI,EAAAA,OAAOJ,GAErF,kBAA4CD,EAAAA,SAASC,IAAUI,EAAAA,O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E9CC,WAAY1F,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOkJ,YAE1CC,oBAAqB3F,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOmJ,qBAEnDC,mBAAoB5F,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOoJ,oBAElD7E,cAAef,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOuE,eAE7C8E,eAAgB7F,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOqJ,gBAE9CxE,cAAerB,EAAAA,SAAS,IAAMO,EAAQ/D,OAAO6E,eAE7CyE,eAAgB9F,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOsJ,gBAE9CC,QAAS/F,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOuJ,SAEvCC,OAAQhG,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOwJ,QAEtCC,OAAQjG,EAAAA,SAAS,IAAMO,EAAQ/D,OAAOyJ,QAEtCC,aAAclG,EAAAA,SAAS,IAAMO,EAAQ/D,OAAO0J,cAE5CC,YAAanG,EAAAA,SAAS,IAAMO,EAAQ/D,OAAO2J,aAE3CvG,QAASI,EAAAA,SAAS,IAAMP,EAAMG,SAE9BwG,QAASxF,GAEX"}
1
+ {"version":3,"file":"tree.js","sources":["../../../../../packages/components/tree/src/tree.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, useGlobalSize } from \"element-plus\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { addUnit, consoleError, definePropType, makeSlots, useExpose, useProps, useRender, withDefineType } from \"@fast-china/utils\";\nimport { useVModel } from \"@vueuse/core\";\nimport { isArray, isBoolean, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { treeProps } from \"./tree.props\";\nimport type { FilterValue, NodeDropType, TreeKey, TreeNodeData } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: (): ElTreeOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: any) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | any>([String, Number, Object]),\n};\n\nexport const faTreeEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string): boolean => isString(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElTreeOutput[], orgData: ElTreeOutput[]): boolean => isArray(data) && isArray(orgData),\n\t/** @description 改变 */\n\tchange: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance) && event instanceof MouseEvent,\n\t/** @description 当节点被点击的时候触发 */\n\tnodeClick: (data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance, event?: MouseEvent): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance) && event instanceof MouseEvent,\n\t/** @description 当某一节点被鼠标右键点击时会触发该事件 */\n\tnodeContextmenu: (event: Event, data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance): boolean =>\n\t\tevent instanceof Event && isObject(data) && isObject(node) && isObject(instance),\n\t/** @description 当复选框被点击的时候触发 */\n\tcheckChange: (data: ElTreeOutput, checked: boolean, indeterminate: boolean): boolean =>\n\t\tisObject(data) && isBoolean(checked) && isBoolean(indeterminate),\n\t/** @description 点击节点复选框之后触发 */\n\tcheck: (\n\t\tdata: ElTreeOutput,\n\t\tnode: {\n\t\t\tcheckedNodes: ElTreeOutput[];\n\t\t\tcheckedKeys: TreeKey[];\n\t\t\thalfCheckedNodes: ElTreeOutput[];\n\t\t\thalfCheckedKeys: TreeKey[];\n\t\t}\n\t): boolean => isObject(data) && isObject(node),\n\t/** @description 当前选中节点变化时触发的事件 */\n\tcurrentChange: (data: ElTreeOutput, node: any): boolean => isObject(data) && isObject(node),\n\t/** @description 节点被展开时触发的事件 */\n\tnodeExpand: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点被关闭时触发的事件 */\n\tnodeCollapse: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点开始拖拽时触发的事件 */\n\tnodeDragStart: (node: any, event: DragEvent): boolean => isObject(node) && event instanceof DragEvent,\n\t/** @description 拖拽进入其他节点时触发的事件 */\n\tnodeDragEnter: (node: any, enterNode: any, event: DragEvent): boolean => isObject(node) && isObject(enterNode) && event instanceof DragEvent,\n\t/** @description 拖拽离开某个节点时触发的事件 */\n\tnodeDragLeave: (node: any, leaveNode: any, event: DragEvent): boolean => isObject(node) && isObject(leaveNode) && event instanceof DragEvent,\n\t/** @description 在拖拽节点时触发的事件(类似浏览器的 mouseover 事件) */\n\tnodeDragOver: (node: any, dropNode: any, event: DragEvent): boolean => isObject(node) && isObject(dropNode) && event instanceof DragEvent,\n\t/** @description 拖拽结束时(可能未成功)触发的事件 */\n\tnodeDragEnd: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n\t/** @description 拖拽成功完成时触发的事件 */\n\tnodeDrop: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n};\n\ntype FaTreeSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: any; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: any; data: ElTreeOutput };\n};\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object>(),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\torgTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (props.hamburger || state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addUnit(props.width);\n\t\t\t\t\tif (_globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => [...state.orgTreeData].filter((f) => f[props.props.children]?.length > 0).length === 0);\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\n\t\tconst setTreeData = (treeData: ElTreeOutput[] | any[]): void => {\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", all: true } as any);\n\t\t\t}\n\t\t\tstate.treeData = treeData;\n\t\t};\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tlet curSelectedData;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tcurSelectedData = treeRef.value.getCurrentKey();\n\t\t\t}\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = { ...(props.initParam ?? {}), searchValue: state.searchValue };\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tstate.orgTreeData = resData;\n\t\t\t\t\tsetTreeData(resData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsoleError(\"FaTree\", error);\n\t\t\t\t\tstate.orgTreeData = [];\n\t\t\t\t\tsetTreeData([]);\n\t\t\t\t\temit(\"dataChangeCallBack\", state.treeData, state.orgTreeData);\n\t\t\t\t} finally {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstate.orgTreeData = props.data;\n\t\t\t\tsetTreeData(props.data);\n\t\t\t}\n\t\t\tif (props.nodeKey && curSelectedData) {\n\t\t\t\tnextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value.setCurrentKey(curSelectedData);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (props.defaultSelection) {\n\t\t\t\t\tnextTick(() => {\n\t\t\t\t\t\ttreeRef.value.setCurrentKey(props.defaultSelection);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (props.hamburger || state.hamburger) {\n\t\t\t\tsetTreeData(state.orgTreeData);\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((m) => ({ ...m, [props.props.children]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: any): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = data.all ? [data.label] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst result = labels.some((label) => label.indexOf(value) !== -1);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent): void => {\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tstate.value = node.key;\n\t\t\tselectedLabel.value = node.label;\n\t\t\temit(\"update:modelValue\", state.value);\n\t\t\temit(\"change\", data, node, instance, event);\n\t\t\temit(\"nodeClick\", data, node, instance, event);\n\t\t};\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\tasync () => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${_globalSize.value}`, { \"fa-tree__fold\": (props.hamburger && state.hamburger) || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={props.hamburger || state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable\n\t\t\t\t\t\tonInput={(value) => treeRef.value.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNodeClick={handleNodeClick}\n\t\t\t\t\t\tonNodeContextmenu={(event: Event, data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeContextmenu\", event, data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonCheckChange={(data: ElTreeOutput, checked: boolean, indeterminate: boolean) =>\n\t\t\t\t\t\t\temit(\"checkChange\", data, checked, indeterminate)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonCheck={(\n\t\t\t\t\t\t\tdata: ElTreeOutput,\n\t\t\t\t\t\t\tnode: {\n\t\t\t\t\t\t\t\tcheckedNodes: ElTreeOutput[];\n\t\t\t\t\t\t\t\tcheckedKeys: TreeKey[];\n\t\t\t\t\t\t\t\thalfCheckedNodes: ElTreeOutput[];\n\t\t\t\t\t\t\t\thalfCheckedKeys: TreeKey[];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) => emit(\"check\", data, node)}\n\t\t\t\t\t\tonCurrentChange={(data: ElTreeOutput, node: any) => emit(\"currentChange\", data, node)}\n\t\t\t\t\t\tonNodeExpand={(data: ElTreeOutput, node: any, instance: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeExpand\", data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeCollapse={(data: ElTreeOutput, node: any, instance: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeCollapse\", data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeDragStart={(node: any, event: DragEvent) => emit(\"nodeDragStart\", node, event)}\n\t\t\t\t\t\tonNodeDragEnter={(node: any, enterNode: any, event: DragEvent) => emit(\"nodeDragEnter\", node, enterNode, event)}\n\t\t\t\t\t\tonNodeDragLeave={(node: any, leaveNode: any, event: DragEvent) => emit(\"nodeDragLeave\", node, leaveNode, event)}\n\t\t\t\t\t\tonNodeDragOver={(node: any, dropNode: any, event: DragEvent) => emit(\"nodeDragOver\", node, dropNode, event)}\n\t\t\t\t\t\tonNodeDragEnd={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) =>\n\t\t\t\t\t\t\temit(\"nodeDragEnd\", node, dropNode, dropType, event)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeDrop={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) =>\n\t\t\t\t\t\t\temit(\"nodeDrop\", node, dropNode, dropType, event)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: any; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data?.all ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span>{slots.label ? slots.label({ node, data }) : data?.all ? data.label : node.label}</span>\n\t\t\t\t\t\t\t\t\t{node.key && data.showQuantity ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty() }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"names":["faTreeProps","treeProps","nodeKey","type","String","default","defaultExpandAll","Boolean","checkOnClickNode","highlightCurrent","collapseOnClickNode","modelValue","definePropType","Number","Object","undefined","label","width","defaultSelection","title","hamburger","hideAll","hideFilter","allValue","data","Array","requestApi","Function","initParam","faTreeEmits","isString","value","isNumber","isBoolean","isObject","isNull","dataChangeCallBack","orgData","isArray","change","node","instance","event","MouseEvent","nodeClick","nodeContextmenu","Event","checkChange","checked","indeterminate","check","currentChange","nodeExpand","nodeCollapse","nodeDragStart","DragEvent","nodeDragEnter","enterNode","nodeDragLeave","leaveNode","nodeDragOver","dropNode","nodeDragEnd","dropType","nodeDrop","Tree","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","selectedLabel","useVModel","passive","_globalSize","useGlobalSize","state","reactive","withDefineType","loading","searchValue","orgTreeData","treeData","computed","addUnit","fold","filter","f","children","length","treeRef","ref","setTreeData","unshift","all","loadData","async","curSelectedData","getCurrentKey","params","resData","error","consoleError","nextTick","setCurrentKey","handleHamburgerClick","map","m","handleFilterNode","child","parentNode","parent","labels","level","result","some","indexOf","filterNodeMethod","handleNodeClick","expandOnClickNode","expanded","collapse","expand","key","onMounted","watch","deep","elTreeProps","useProps","useRender","_withDirectives","_createVNode","class","style","ElIcon","onClick","Expand","Fold","ElInput","modelModifiers","trim","$event","placeholder","clearable","onInput","ElScrollbar","ElTree","_mergeProps","onNodeClick","onNodeContextmenu","onCheckChange","onCheck","onCurrentChange","onNodeExpand","onNodeCollapse","onNodeDragStart","onNodeDragEnter","onNodeDragLeave","onNodeDragOver","onNodeDragEnd","onNodeDrop","paddingLeft","showQuantity","_createTextVNode","quantity","empty","_resolveDirective","useExpose","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentNode","setCurrentNode","getNode","remove","append","insertBefore","insertAfter","refresh"],"mappings":"oTAWaA,EAAc,IACvBC,EAAAA,UAEHC,QAAS,CACRC,KAAMC,OACNC,QAAS,SAGVC,iBAAkB,CACjBH,KAAMI,QACNF,SAAS,GAGVG,iBAAkB,CACjBL,KAAMI,QACNF,SAAS,GAGVI,iBAAkB,CACjBN,KAAMI,QACNF,SAAS,GAGVK,oBAAqBH,QAErBI,WAAY,CACXR,KAAMS,EAAAA,eAAmD,CAACR,OAAQS,OAAQN,QAASO,SACnFT,aAASU,GAGVC,MAAOZ,OAEPa,MAAO,CACNd,KAAM,CAACC,OAAQS,QACfR,QAAS,KAGVa,iBAAkB,CAACd,OAAQS,QAE3BM,MAAOf,OAEPgB,UAAWb,QAEXc,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olean | object
27
27
  /**
28
28
  * 是否显示数量
29
29
  */
30
- showNum?: boolean;
30
+ showQuantity?: boolean;
31
31
  /**
32
32
  * 数量
33
33
  */
@@ -147,14 +147,7 @@ export declare const faTreeSelectProps: {
147
147
  };
148
148
  ariaLabel: StringConstructor;
149
149
  emptyValues: ArrayConstructor;
150
- valueOnClear: {
151
- readonly type: import('vue').PropType<string | number | boolean | Function>;
152
- readonly required: false;
153
- readonly validator: ((val: unknown) => boolean) | undefined;
154
- __epPropKey: true;
155
- } & {
156
- readonly default: undefined;
157
- };
150
+ valueOnClear: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown, undefined, boolean>;
158
151
  name: StringConstructor;
159
152
  id: StringConstructor;
160
153
  autocomplete: {
@@ -163,7 +156,7 @@ export declare const faTreeSelectProps: {
163
156
  };
164
157
  automaticDropdown: BooleanConstructor;
165
158
  size: {
166
- readonly type: import('vue').PropType<"" | "small" | "default" | "large">;
159
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
167
160
  readonly required: false;
168
161
  readonly validator: ((val: unknown) => boolean) | undefined;
169
162
  __epPropKey: true;
@@ -209,14 +202,7 @@ export declare const faTreeSelectProps: {
209
202
  type: NumberConstructor;
210
203
  default: number;
211
204
  };
212
- teleported: {
213
- readonly type: import('vue').PropType<boolean>;
214
- readonly required: false;
215
- readonly validator: ((val: unknown) => boolean) | undefined;
216
- __epPropKey: true;
217
- } & {
218
- readonly default: true;
219
- };
205
+ teleported: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
220
206
  persistent: {
221
207
  type: BooleanConstructor;
222
208
  default: boolean;
@@ -232,14 +218,14 @@ export declare const faTreeSelectProps: {
232
218
  };
233
219
  tagType: {
234
220
  default: string;
235
- type: import('vue').PropType<"primary" | "success" | "warning" | "info" | "danger">;
221
+ type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
236
222
  required: false;
237
223
  validator: ((val: unknown) => boolean) | undefined;
238
224
  __epPropKey: true;
239
225
  };
240
226
  tagEffect: {
241
227
  default: string;
242
- type: import('vue').PropType<"plain" | "dark" | "light">;
228
+ type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "plain" | "dark" | "light", unknown>>;
243
229
  required: false;
244
230
  validator: ((val: unknown) => boolean) | undefined;
245
231
  __epPropKey: true;
@@ -478,14 +464,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
478
464
  };
479
465
  ariaLabel: StringConstructor;
480
466
  emptyValues: ArrayConstructor;
481
- valueOnClear: {
482
- readonly type: import('vue').PropType<string | number | boolean | Function>;
483
- readonly required: false;
484
- readonly validator: ((val: unknown) => boolean) | undefined;
485
- __epPropKey: true;
486
- } & {
487
- readonly default: undefined;
488
- };
467
+ valueOnClear: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown, undefined, boolean>;
489
468
  name: StringConstructor;
490
469
  id: StringConstructor;
491
470
  autocomplete: {
@@ -494,7 +473,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
494
473
  };
495
474
  automaticDropdown: BooleanConstructor;
496
475
  size: {
497
- readonly type: import('vue').PropType<"" | "small" | "default" | "large">;
476
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
498
477
  readonly required: false;
499
478
  readonly validator: ((val: unknown) => boolean) | undefined;
500
479
  __epPropKey: true;
@@ -540,14 +519,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
540
519
  type: NumberConstructor;
541
520
  default: number;
542
521
  };
543
- teleported: {
544
- readonly type: import('vue').PropType<boolean>;
545
- readonly required: false;
546
- readonly validator: ((val: unknown) => boolean) | undefined;
547
- __epPropKey: true;
548
- } & {
549
- readonly default: true;
550
- };
522
+ teleported: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
551
523
  persistent: {
552
524
  type: BooleanConstructor;
553
525
  default: boolean;
@@ -563,14 +535,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
563
535
  };
564
536
  tagType: {
565
537
  default: string;
566
- type: import('vue').PropType<"primary" | "success" | "warning" | "info" | "danger">;
538
+ type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
567
539
  required: false;
568
540
  validator: ((val: unknown) => boolean) | undefined;
569
541
  __epPropKey: true;
570
542
  };
571
543
  tagEffect: {
572
544
  default: string;
573
- type: import('vue').PropType<"plain" | "dark" | "light">;
545
+ type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "plain" | "dark" | "light", unknown>>;
574
546
  required: false;
575
547
  validator: ((val: unknown) => boolean) | undefined;
576
548
  __epPropKey: true;
@@ -834,14 +806,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
834
806
  };
835
807
  ariaLabel: StringConstructor;
836
808
  emptyValues: ArrayConstructor;
837
- valueOnClear: {
838
- readonly type: import('vue').PropType<string | number | boolean | Function>;
839
- readonly required: false;
840
- readonly validator: ((val: unknown) => boolean) | undefined;
841
- __epPropKey: true;
842
- } & {
843
- readonly default: undefined;
844
- };
809
+ valueOnClear: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown, undefined, boolean>;
845
810
  name: StringConstructor;
846
811
  id: StringConstructor;
847
812
  autocomplete: {
@@ -850,7 +815,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
850
815
  };
851
816
  automaticDropdown: BooleanConstructor;
852
817
  size: {
853
- readonly type: import('vue').PropType<"" | "small" | "default" | "large">;
818
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
854
819
  readonly required: false;
855
820
  readonly validator: ((val: unknown) => boolean) | undefined;
856
821
  __epPropKey: true;
@@ -896,14 +861,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
896
861
  type: NumberConstructor;
897
862
  default: number;
898
863
  };
899
- teleported: {
900
- readonly type: import('vue').PropType<boolean>;
901
- readonly required: false;
902
- readonly validator: ((val: unknown) => boolean) | undefined;
903
- __epPropKey: true;
904
- } & {
905
- readonly default: true;
906
- };
864
+ teleported: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
907
865
  persistent: {
908
866
  type: BooleanConstructor;
909
867
  default: boolean;
@@ -919,14 +877,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
919
877
  };
920
878
  tagType: {
921
879
  default: string;
922
- type: import('vue').PropType<"primary" | "success" | "warning" | "info" | "danger">;
880
+ type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
923
881
  required: false;
924
882
  validator: ((val: unknown) => boolean) | undefined;
925
883
  __epPropKey: true;
926
884
  };
927
885
  tagEffect: {
928
886
  default: string;
929
- type: import('vue').PropType<"plain" | "dark" | "light">;
887
+ type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "plain" | "dark" | "light", unknown>>;
930
888
  required: false;
931
889
  validator: ((val: unknown) => boolean) | undefined;
932
890
  __epPropKey: true;
@@ -1050,6 +1008,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1050
1008
  placement: Placement;
1051
1009
  loading: boolean;
1052
1010
  disabled: boolean;
1011
+ lazy: boolean;
1053
1012
  modelValue: string | number | boolean | object | (string | number | boolean | object)[];
1054
1013
  autocomplete: string;
1055
1014
  clearable: boolean;
@@ -1059,12 +1018,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1059
1018
  popperOptions: Options;
1060
1019
  popperClass: string;
1061
1020
  effect: string | (string & {});
1062
- teleported: boolean;
1021
+ teleported: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
1063
1022
  width: string | number;
1064
1023
  persistent: boolean;
1065
1024
  draggable: boolean;
1066
1025
  fallbackPlacements: Placement[];
1067
- lazy: boolean;
1068
1026
  moreDetail: boolean;
1069
1027
  loadingText: string;
1070
1028
  noMatchText: string;
@@ -1072,7 +1030,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1072
1030
  collapseTags: boolean;
1073
1031
  collapseTagsTooltip: boolean;
1074
1032
  defaultSelected: boolean;
1075
- valueOnClear: string | number | boolean | Function;
1033
+ valueOnClear: import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null))[], unknown, unknown>;
1076
1034
  automaticDropdown: boolean;
1077
1035
  filterable: boolean;
1078
1036
  allowCreate: boolean;
@@ -1084,8 +1042,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1084
1042
  valueKey: string;
1085
1043
  maxCollapseTags: number;
1086
1044
  fitInputWidth: boolean;
1087
- tagType: "primary" | "success" | "warning" | "info" | "danger";
1088
- tagEffect: "plain" | "dark" | "light";
1045
+ tagType: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>;
1046
+ tagEffect: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "plain" | "dark" | "light", unknown>;
1089
1047
  remoteShowSuffix: boolean;
1090
1048
  nodeKey: string;
1091
1049
  defaultExpandAll: boolean;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("element-plus"),a=require("../../select/src/select.js"),t=require("../../tree/src/tree.props.js"),o=require("@fast-china/utils"),r=require("@vueuse/core"),n=require("lodash-unified"),i={...a.SelectProps,...t.treeProps,loadingText:{type:String,default:"加载中..."},noMatchText:{type:String,default:"暂无匹配的数据"},noDataText:{type:String,default:"暂无数据"},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},nodeKey:{type:String,default:"value"},defaultExpandAll:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!0},highlightCurrent:{type:Boolean,default:!0},expandOnClickNode:Boolean,collapseOnClickNode:Boolean,cacheData:{type:Array,default:()=>[]},modelValue:{type:o.definePropType([String,Number,Boolean,Object,Array]),default:void 0},label:o.definePropType([String,Array]),width:{type:[String,Number],default:"100%"},moreDetail:Boolean,lazy:{type:Boolean,default:!0},defaultSelected:Boolean,props:{type:o.definePropType(Object),default:()=>({label:"label",hide:"hide",disabled:"disabled",children:"children"})},data:{type:o.definePropType(Array),default:()=>[]},requestApi:{type:o.definePropType(Function)},initParam:o.definePropType([String,Number,Object])},d={"update:modelValue":e=>n.isString(e)||n.isNumber(e)||n.isBoolean(e)||n.isObject(e)||n.isArray(e)||n.isNull(e),"update:label":e=>n.isString(e)||n.isArray(e)||n.isNull(e),dataChangeCallBack:e=>n.isArray(e),change:(e,l)=>(n.isObject(e)||n.isArray(e)||n.isNull(e))&&(n.isString(l)||n.isNumber(l)||n.isBoolean(l)||n.isObject(l)||n.isArray(l)||n.isNull(l)),visibleChange:e=>n.isBoolean(e),removeTag:e=>n.isString(e)||n.isNumber(e)||n.isBoolean(e)||n.isObject(e)||n.isArray(e),clear:()=>!0,blur:e=>e instanceof FocusEvent,focus:e=>e instanceof FocusEvent,nodeClick:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&n.isObject(a),nodeContextmenu:(e,l,a,t)=>e instanceof Event&&n.isObject(l)&&n.isObject(a)&&n.isObject(t),checkChange:(e,l,a)=>n.isObject(e)&&n.isBoolean(l)&&n.isBoolean(a),check:(e,l)=>n.isObject(e)&&n.isObject(l),currentChange:(e,l)=>n.isObject(e)&&n.isObject(l),nodeExpand:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&n.isObject(a),nodeCollapse:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&n.isObject(a),nodeDragStart:(e,l)=>n.isObject(e)&&l instanceof DragEvent,nodeDragEnter:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&a instanceof DragEvent,nodeDragLeave:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&a instanceof DragEvent,nodeDragOver:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&a instanceof DragEvent,nodeDragEnd:(e,l,a,t)=>n.isObject(e)&&n.isObject(l)&&n.isString(a)&&t instanceof DragEvent,nodeDrop:(e,l,a,t)=>n.isObject(e)&&n.isObject(l)&&n.isString(a)&&t instanceof DragEvent},s=e.defineComponent({name:"FaTreeSelect",props:i,emits:d,slots:o.makeSlots(),setup(i,{attrs:d,slots:s,emit:u,expose:c}){const p=r.useVModel(i,"label",u,{passive:!0}),f=e.reactive({value:o.withDefineType(),loading:!1,selectorData:o.withDefineType([]),debut:!0,echo:!(i.data?.length>0),nextRefresh:!1}),g=e.ref(),h=e=>e?.map(e=>({...e,value:e[i.nodeKey],label:n.isFunction(i.props.label)?i.props.label(e):e[i.props.label??"label"],hide:n.isFunction(i.props.hide)?i.props.hide(e):e[i.props.hide??"hide"],disabled:n.isFunction(i.props.disabled)?i.props.disabled(e):e[i.props.disabled??"disabled"],children:n.isFunction(i.props.children)?h(i.props.children(e)):h(e[i.props.children??"children"])})).filter(e=>!e.hide),b=async()=>{if(i.requestApi){f.loading=!0;const l=i.initParam??{};try{const e=await i.requestApi(l);f.echo=!1,f.selectorData=h(e),u("dataChangeCallBack",f.selectorData)}catch(e){o.consoleError("FaTreeSelect",e),f.selectorData=[]}finally{f.loading=!1}}else f.selectorData=h(i.data)},v=(e,l,a)=>{if(!e)return!0;let t=a.parent,o=[a.label],r=1;for(;r<a.level;)o=[...o,t.label],t=t.parent,r++;const n=o.some(l=>-1!==l.indexOf(e));return i.filterNodeMethod?n&&i.filterNodeMethod(e,l,a):n},m=(e,l)=>{if(i.multiple){const l=e;if(0===l?.length)return f.value=null,p.value=null,u("update:modelValue",null),void u("change",null,null);const a=f.selectorData.filter(e=>l.includes(e.value));f.value=e,p.value=a.map(e=>e.label),u("update:modelValue",e),u("change",a,e)}else{if(n.isNil(e))return f.value=null,p.value=null,u("update:modelValue",null),void u("change",null,null);l??=f.selectorData.find(l=>l.value===e),f.value=e,p.value=l.label,u("update:modelValue",e),u("change",l,e)}},y=()=>{f.value=null,p.value=null,u("clear")},C=(e,l,a,t)=>{i.expandOnClickNode&&(l.expanded?l.expanded&&i.collapseOnClickNode&&l.collapse():l.expand()),(i.checkStrictly||l.isLeaf)&&m(e.value,e),u("nodeClick",e,l,a)},N=async e=>{e&&(f.debut?(f.debut=!1,i.lazy&&await b()):f.nextRefresh&&(f.nextRefresh=!1,await b())),u("visibleChange",e)};e.watch(()=>i.modelValue,e=>{if(f.echo&&!n.isNil(e)){const l=!n.isNil(i.label);if(i.multiple){if(!n.isArray(e))return void o.consoleError("FaTreeSelect","当启用 multiple 时,传入的 modelValue 必须是Array。");if(l&&!n.isArray(i.label))return void o.consoleError("FaTreeSelect","当启用 multiple 时,传入的 modelValue:label 必须是Array。");f.selectorData=e.slice(0,i.multipleLimit>0?i.multipleLimit:e.length).map((e,a)=>({value:e,label:l?i.label[a]:void 0}))}else{if(n.isArray(e))return void o.consoleError("FaTreeSelect","当禁用 multiple 时,传入的 modelValue 不能是Array。");if(l&&n.isArray(i.label))return void o.consoleError("FaTreeSelect","当禁用 multiple 时,传入的 modelValue:label 不能是Array。");f.selectorData=[{value:e,label:i.label}]}}f.value=e},{immediate:!0}),e.onMounted(async()=>{i.defaultSelected?(await b(),f.selectorData.length>0&&(i.multiple?m([f.selectorData[0].value]):m(f.selectorData[0].value,f.selectorData[0]))):!i.requestApi&&i.data?.length>0?(f.debut=!1,await b()):i.lazy||await b(),e.watch(()=>i.initParam,(e,l)=>{n.isEqual(e,l)||(f.nextRefresh=!0,n.isNil(f.value)||m())}),e.watch(()=>i.data,async()=>{i.requestApi||await b()},{deep:!0})});const O=o.useProps(i,{...a.SelectProps,...t.treeProps},["modelValue","popperClass","loading","expandOnClickNode","filterNodeMethod"]);return o.useRender(()=>e.createVNode(l.ElTreeSelect,e.mergeProps(O.value,{ref:g,class:"fa-tree-select",popperClass:`fa-tree-select-dropdown ${i.popperClass}`,style:{width:o.addUnit(i.width)},modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,loading:f.loading,data:f.selectorData,expandOnClickNode:!i.checkOnClickNode&&i.expandOnClickNode,filterNodeMethod:v,onNodeClick:C,onClear:y,onVisibleChange:N,onRemoveTag:e=>u("removeTag",e),onBlur:e=>u("blur",e),onFocus:e=>u("focus",e),onNodeContextmenu:(e,l,a,t)=>u("nodeContextmenu",e,l,a,t),onCheckChange:(e,l,a)=>u("checkChange",e,l,a),onCheck:(e,l)=>u("check",e,l),onCurrentChange:(e,l)=>u("currentChange",e,l),onNodeExpand:(e,l,a)=>u("nodeExpand",e,l,a),onNodeCollapse:(e,l,a)=>u("nodeCollapse",e,l,a),onNodeDragStart:(e,l)=>u("nodeDragStart",e,l),onNodeDragEnter:(e,l,a)=>u("nodeDragEnter",e,l,a),onNodeDragLeave:(e,l,a)=>u("nodeDragLeave",e,l,a),onNodeDragOver:(e,l,a)=>u("nodeDragOver",e,l,a),onNodeDragEnd:(e,l,a,t)=>u("nodeDragEnd",e,l,a,t),onNodeDrop:(e,l,a,t)=>u("nodeDrop",e,l,a,t)}),{...s.default&&{default:({node:e,data:l})=>s.default({node:e,data:l})},...s.header&&{header:()=>s.header()},...s.footer&&{footer:()=>s.footer()},...s.prefix&&{prefix:()=>s.prefix()},...s.empty&&{empty:()=>s.empty()},...s.tag&&{tag:()=>s.tag()},...s.loading&&{loading:()=>s.loading()},...s.label&&{label:({label:e,value:l})=>s.label({label:e,value:l})}})),o.useExpose(c,{focus:e.computed(()=>g.value?.focus),blur:e.computed(()=>g.value?.blur),selectedLabel:e.computed(()=>g.value?.selectedLabel),filter:e.computed(()=>g.value?.filter),updateKeyChildren:e.computed(()=>g.value?.updateKeyChildren),getCheckedNodes:e.computed(()=>g.value?.getCheckedNodes),setCheckedNodes:e.computed(()=>g.value?.setCheckedNodes),getCheckedKeys:e.computed(()=>g.value?.getCheckedKeys),setCheckedKeys:e.computed(()=>g.value?.setCheckedKeys),setChecked:e.computed(()=>g.value?.setChecked),getHalfCheckedNodes:e.computed(()=>g.value?.getHalfCheckedNodes),getHalfCheckedKeys:e.computed(()=>g.value?.getHalfCheckedKeys),getCurrentKey:e.computed(()=>g.value?.getCurrentKey),getCurrentNode:e.computed(()=>g.value?.getCurrentNode),setCurrentKey:e.computed(()=>g.value?.setCurrentKey),setCurrentNode:e.computed(()=>g.value?.setCurrentNode),getNode:e.computed(()=>g.value?.getNode),remove:e.computed(()=>g.value?.remove),append:e.computed(()=>g.value?.append),insertBefore:e.computed(()=>g.value?.insertBefore),insertAfter:e.computed(()=>g.value?.insertAfter),loading:e.computed(()=>f.loading),refresh:b,setSelection:e=>m(e),clearSelection:()=>m(null)})}});exports.default=s,exports.faTreeSelectEmits=d,exports.faTreeSelectProps=i;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("element-plus"),a=require("../../select/src/select.js"),t=require("../../tree/src/tree.props.js"),o=require("@fast-china/utils"),r=require("@vueuse/core"),n=require("lodash-unified"),i={...a.SelectProps,...t.treeProps,loadingText:{type:String,default:"加载中..."},noMatchText:{type:String,default:"暂无匹配的数据"},noDataText:{type:String,default:"暂无数据"},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},nodeKey:{type:String,default:"value"},defaultExpandAll:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!0},highlightCurrent:{type:Boolean,default:!0},expandOnClickNode:Boolean,collapseOnClickNode:Boolean,cacheData:{type:Array,default:()=>[]},modelValue:{type:o.definePropType([String,Number,Boolean,Object,Array]),default:void 0},label:o.definePropType([String,Array]),width:{type:[String,Number],default:"100%"},moreDetail:Boolean,lazy:{type:Boolean,default:!0},defaultSelected:Boolean,props:{type:o.definePropType(Object),default:()=>({label:"label",hide:"hide",disabled:"disabled",children:"children"})},data:{type:o.definePropType(Array),default:()=>[]},requestApi:{type:o.definePropType(Function)},initParam:o.definePropType([String,Number,Object])},d={"update:modelValue":e=>n.isString(e)||n.isNumber(e)||n.isBoolean(e)||n.isObject(e)||n.isArray(e)||n.isNull(e),"update:label":e=>n.isString(e)||n.isArray(e)||n.isNull(e),dataChangeCallBack:e=>n.isArray(e),change:(e,l)=>(n.isObject(e)||n.isArray(e)||n.isNull(e))&&(n.isString(l)||n.isNumber(l)||n.isBoolean(l)||n.isObject(l)||n.isArray(l)||n.isNull(l)),visibleChange:e=>n.isBoolean(e),removeTag:e=>n.isString(e)||n.isNumber(e)||n.isBoolean(e)||n.isObject(e)||n.isArray(e),clear:()=>!0,blur:e=>e instanceof FocusEvent,focus:e=>e instanceof FocusEvent,nodeClick:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&n.isObject(a),nodeContextmenu:(e,l,a,t)=>e instanceof Event&&n.isObject(l)&&n.isObject(a)&&n.isObject(t),checkChange:(e,l,a)=>n.isObject(e)&&n.isBoolean(l)&&n.isBoolean(a),check:(e,l)=>n.isObject(e)&&n.isObject(l),currentChange:(e,l)=>n.isObject(e)&&n.isObject(l),nodeExpand:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&n.isObject(a),nodeCollapse:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&n.isObject(a),nodeDragStart:(e,l)=>n.isObject(e)&&l instanceof DragEvent,nodeDragEnter:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&a instanceof DragEvent,nodeDragLeave:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&a instanceof DragEvent,nodeDragOver:(e,l,a)=>n.isObject(e)&&n.isObject(l)&&a instanceof DragEvent,nodeDragEnd:(e,l,a,t)=>n.isObject(e)&&n.isObject(l)&&n.isString(a)&&t instanceof DragEvent,nodeDrop:(e,l,a,t)=>n.isObject(e)&&n.isObject(l)&&n.isString(a)&&t instanceof DragEvent},s=e.defineComponent({name:"FaTreeSelect",props:i,emits:d,slots:o.makeSlots(),setup(i,{attrs:d,slots:s,emit:u,expose:c}){const p=r.useVModel(i,"label",u,{passive:!0}),f=e.reactive({value:o.withDefineType(),loading:!1,selectorData:o.withDefineType([]),debut:!0,echo:!(i.data?.length>0),nextRefresh:!1}),g=e.ref(),h=e=>e?.map(e=>({...e,value:e[i.nodeKey],label:n.isFunction(i.props.label)?i.props.label(e):e[i.props.label??"label"],hide:n.isFunction(i.props.hide)?i.props.hide(e):e[i.props.hide??"hide"],disabled:n.isFunction(i.props.disabled)?i.props.disabled(e):e[i.props.disabled??"disabled"],children:n.isFunction(i.props.children)?h(i.props.children(e)):h(e[i.props.children??"children"])})).filter(e=>!e.hide),b=async()=>{if(i.requestApi){f.loading=!0;const l=i.initParam??{};try{const e=await i.requestApi(l);f.echo=!1,f.selectorData=h(e),u("dataChangeCallBack",f.selectorData)}catch(e){o.consoleError("FaTreeSelect",e),f.selectorData=[]}finally{f.loading=!1}}else f.echo=!1,f.selectorData=h(i.data)},v=(e,l,a)=>{if(!e)return!0;let t=a.parent,o=[a.label],r=1;for(;r<a.level;)o=[...o,t.label],t=t.parent,r++;const n=o.some(l=>-1!==l.indexOf(e));return i.filterNodeMethod?n&&i.filterNodeMethod(e,l,a):n},m=(e,l)=>{if(i.multiple){const l=e;if(0===l?.length)return f.value=null,p.value=null,u("update:modelValue",null),void u("change",null,null);const a=f.selectorData.filter(e=>l.includes(e.value));f.value=e,p.value=a.map(e=>e.label),u("update:modelValue",e),u("change",a,e)}else{if(n.isNil(e))return f.value=null,p.value=null,u("update:modelValue",null),void u("change",null,null);l??=f.selectorData.find(l=>l.value===e),f.value=e,p.value=l.label,u("update:modelValue",e),u("change",l,e)}},y=()=>{f.value=null,p.value=null,u("clear")},C=(e,l,a,t)=>{i.expandOnClickNode&&(l.expanded?l.expanded&&i.collapseOnClickNode&&l.collapse():l.expand()),(i.checkStrictly||l.isLeaf)&&m(e.value,e),u("nodeClick",e,l,a)},N=async e=>{e&&(f.debut?(f.debut=!1,i.lazy&&await b()):f.nextRefresh&&(f.nextRefresh=!1,await b())),u("visibleChange",e)};e.watch(()=>i.modelValue,e=>{if(f.echo&&!n.isNil(e)){const l=!n.isNil(i.label);if(i.multiple){if(!n.isArray(e))return void o.consoleError("FaTreeSelect","当启用 multiple 时,传入的 modelValue 必须是Array。");if(l&&!n.isArray(i.label))return void o.consoleError("FaTreeSelect","当启用 multiple 时,传入的 modelValue:label 必须是Array。");f.selectorData=e.slice(0,i.multipleLimit>0?i.multipleLimit:e.length).map((e,a)=>({value:e,label:l?i.label[a]:void 0}))}else{if(n.isArray(e))return void o.consoleError("FaTreeSelect","当禁用 multiple 时,传入的 modelValue 不能是Array。");if(l&&n.isArray(i.label))return void o.consoleError("FaTreeSelect","当禁用 multiple 时,传入的 modelValue:label 不能是Array。");f.selectorData=[{value:e,label:i.label}]}}f.value=e},{immediate:!0}),e.onMounted(async()=>{i.defaultSelected?(await b(),f.selectorData.length>0&&(i.multiple?m([f.selectorData[0].value]):m(f.selectorData[0].value,f.selectorData[0]))):!i.requestApi&&i.data?.length>0?(f.debut=!1,await b()):i.lazy||await b(),e.watch(()=>i.initParam,(e,l)=>{n.isEqual(e,l)||(f.nextRefresh=!0,n.isNil(f.value)||m())}),e.watch(()=>i.data,async()=>{i.requestApi||await b()},{deep:!0})});const O=o.useProps(i,{...a.SelectProps,...t.treeProps},["modelValue","popperClass","loading","expandOnClickNode","filterNodeMethod"]);return o.useRender(()=>e.createVNode(l.ElTreeSelect,e.mergeProps(O.value,{ref:g,class:"fa-tree-select",popperClass:`fa-tree-select-dropdown ${i.popperClass}`,style:{width:o.addUnit(i.width)},modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,loading:f.loading,data:f.selectorData,expandOnClickNode:!i.checkOnClickNode&&i.expandOnClickNode,filterNodeMethod:v,onNodeClick:C,onClear:y,onVisibleChange:N,onRemoveTag:e=>u("removeTag",e),onBlur:e=>u("blur",e),onFocus:e=>u("focus",e),onNodeContextmenu:(e,l,a,t)=>u("nodeContextmenu",e,l,a,t),onCheckChange:(e,l,a)=>u("checkChange",e,l,a),onCheck:(e,l)=>u("check",e,l),onCurrentChange:(e,l)=>u("currentChange",e,l),onNodeExpand:(e,l,a)=>u("nodeExpand",e,l,a),onNodeCollapse:(e,l,a)=>u("nodeCollapse",e,l,a),onNodeDragStart:(e,l)=>u("nodeDragStart",e,l),onNodeDragEnter:(e,l,a)=>u("nodeDragEnter",e,l,a),onNodeDragLeave:(e,l,a)=>u("nodeDragLeave",e,l,a),onNodeDragOver:(e,l,a)=>u("nodeDragOver",e,l,a),onNodeDragEnd:(e,l,a,t)=>u("nodeDragEnd",e,l,a,t),onNodeDrop:(e,l,a,t)=>u("nodeDrop",e,l,a,t)}),{...s.default&&{default:({node:e,data:l})=>s.default({node:e,data:l})},...s.header&&{header:()=>s.header()},...s.footer&&{footer:()=>s.footer()},...s.prefix&&{prefix:()=>s.prefix()},...s.empty&&{empty:()=>s.empty()},...s.tag&&{tag:()=>s.tag()},...s.loading&&{loading:()=>s.loading()},...s.label&&{label:({label:e,value:l})=>s.label({label:e,value:l})}})),o.useExpose(c,{focus:e.computed(()=>g.value?.focus),blur:e.computed(()=>g.value?.blur),selectedLabel:e.computed(()=>g.value?.selectedLabel),filter:e.computed(()=>g.value?.filter),updateKeyChildren:e.computed(()=>g.value?.updateKeyChildren),getCheckedNodes:e.computed(()=>g.value?.getCheckedNodes),setCheckedNodes:e.computed(()=>g.value?.setCheckedNodes),getCheckedKeys:e.computed(()=>g.value?.getCheckedKeys),setCheckedKeys:e.computed(()=>g.value?.setCheckedKeys),setChecked:e.computed(()=>g.value?.setChecked),getHalfCheckedNodes:e.computed(()=>g.value?.getHalfCheckedNodes),getHalfCheckedKeys:e.computed(()=>g.value?.getHalfCheckedKeys),getCurrentKey:e.computed(()=>g.value?.getCurrentKey),getCurrentNode:e.computed(()=>g.value?.getCurrentNode),setCurrentKey:e.computed(()=>g.value?.setCurrentKey),setCurrentNode:e.computed(()=>g.value?.setCurrentNode),getNode:e.computed(()=>g.value?.getNode),remove:e.computed(()=>g.value?.remove),append:e.computed(()=>g.value?.append),insertBefore:e.computed(()=>g.value?.insertBefore),insertAfter:e.computed(()=>g.value?.insertAfter),loading:e.computed(()=>f.loading),refresh:b,setSelection:e=>m(e),clearSelection:()=>m(null)})}});exports.default=s,exports.faTreeSelectEmits=d,exports.faTreeSelectProps=i;
2
2
  //# sourceMappingURL=treeSelect.js.map