bkui-vue 0.0.2-beta.35 → 0.0.2-beta.37

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 (182) hide show
  1. package/dist/index.cjs.js +25 -25
  2. package/dist/index.esm.js +30 -14
  3. package/dist/index.umd.js +44 -44
  4. package/lib/affix/index.js +391 -1
  5. package/lib/alert/index.js +287 -1
  6. package/lib/animate-number/index.js +219 -1
  7. package/lib/backtop/index.js +264 -1
  8. package/lib/badge/index.js +304 -1
  9. package/lib/breadcrumb/index.js +379 -1
  10. package/lib/button/index.js +403 -1
  11. package/lib/card/index.js +369 -1
  12. package/lib/cascader/index.js +2095 -2
  13. package/lib/checkbox/index.js +602 -1
  14. package/lib/code-diff/index.js +5548 -1
  15. package/lib/collapse/index.js +605 -1
  16. package/lib/collapse-transition/index.js +237 -1
  17. package/lib/color-picker/index.js +2735 -1
  18. package/lib/components.js +770 -1
  19. package/lib/config-provider/index.js +377 -1
  20. package/lib/container/index.js +408 -1
  21. package/lib/date-picker/index.js +5576 -1
  22. package/lib/dialog/index.js +1324 -2
  23. package/lib/directives/index.js +1386 -2
  24. package/lib/dist.index.js +179 -1
  25. package/lib/divider/index.js +237 -1
  26. package/lib/dropdown/index.js +455 -1
  27. package/lib/exception/index.js +435 -1
  28. package/lib/fixed-navbar/index.js +222 -1
  29. package/lib/form/index.js +1004 -1
  30. package/lib/hooks.js +133 -1
  31. package/lib/icon/angle-double-down-line.js +541 -1
  32. package/lib/icon/angle-double-left-line.js +541 -1
  33. package/lib/icon/angle-double-left.js +541 -1
  34. package/lib/icon/angle-double-right-line.js +541 -1
  35. package/lib/icon/angle-double-right.js +541 -1
  36. package/lib/icon/angle-double-up-line.js +541 -1
  37. package/lib/icon/angle-down-fill.js +541 -1
  38. package/lib/icon/angle-down-line.js +541 -1
  39. package/lib/icon/angle-down.js +541 -1
  40. package/lib/icon/angle-left.js +541 -1
  41. package/lib/icon/angle-right.js +541 -1
  42. package/lib/icon/angle-up-fill.js +541 -1
  43. package/lib/icon/angle-up.js +541 -1
  44. package/lib/icon/archive-fill.js +541 -1
  45. package/lib/icon/arrows-left.js +541 -1
  46. package/lib/icon/arrows-right.js +541 -1
  47. package/lib/icon/assistant.js +541 -1
  48. package/lib/icon/audio-fill.js +541 -1
  49. package/lib/icon/bk.js +541 -1
  50. package/lib/icon/circle.js +541 -1
  51. package/lib/icon/close-line.js +541 -1
  52. package/lib/icon/close.js +541 -1
  53. package/lib/icon/code.js +541 -1
  54. package/lib/icon/cog-shape.js +541 -1
  55. package/lib/icon/collapse-left.js +541 -1
  56. package/lib/icon/copy-shape.js +541 -1
  57. package/lib/icon/copy.js +541 -1
  58. package/lib/icon/data-shape.js +541 -1
  59. package/lib/icon/del.js +541 -1
  60. package/lib/icon/doc-fill.js +541 -1
  61. package/lib/icon/done.js +541 -1
  62. package/lib/icon/down-shape.js +541 -1
  63. package/lib/icon/down-small.js +541 -1
  64. package/lib/icon/edit-line.js +541 -1
  65. package/lib/icon/ellipsis.js +541 -1
  66. package/lib/icon/enlarge-line.js +541 -1
  67. package/lib/icon/error.js +541 -1
  68. package/lib/icon/excel-fill.js +541 -1
  69. package/lib/icon/exclamation-circle-shape.js +541 -1
  70. package/lib/icon/eye.js +541 -1
  71. package/lib/icon/filliscreen-line.js +541 -1
  72. package/lib/icon/fix-line.js +541 -1
  73. package/lib/icon/fix-shape.js +541 -1
  74. package/lib/icon/folder-open.js +541 -1
  75. package/lib/icon/folder-shape-open.js +541 -1
  76. package/lib/icon/folder-shape.js +541 -1
  77. package/lib/icon/folder.js +541 -1
  78. package/lib/icon/funnel.js +541 -1
  79. package/lib/icon/help-document-fill.js +541 -1
  80. package/lib/icon/help-fill.js +541 -1
  81. package/lib/icon/help.js +541 -1
  82. package/lib/icon/image-fill.js +563 -1
  83. package/lib/icon/img-error.js +563 -1
  84. package/lib/icon/img-placehoulder.js +563 -1
  85. package/lib/icon/index.js +2353 -1
  86. package/lib/icon/info-line.js +563 -1
  87. package/lib/icon/info.js +563 -1
  88. package/lib/icon/left-shape.js +563 -1
  89. package/lib/icon/left-turn-line.js +563 -1
  90. package/lib/icon/narrow-line.js +563 -1
  91. package/lib/icon/original.js +563 -1
  92. package/lib/icon/pdf-fill.js +563 -1
  93. package/lib/icon/play-shape.js +563 -1
  94. package/lib/icon/plus.js +563 -1
  95. package/lib/icon/ppt-fill.js +563 -1
  96. package/lib/icon/qq.js +563 -1
  97. package/lib/icon/right-shape.js +563 -1
  98. package/lib/icon/right-turn-line.js +563 -1
  99. package/lib/icon/search.js +563 -1
  100. package/lib/icon/share.js +563 -1
  101. package/lib/icon/spinner.js +563 -1
  102. package/lib/icon/success.js +563 -1
  103. package/lib/icon/switcher-loading.js +563 -1
  104. package/lib/icon/text-file.js +563 -1
  105. package/lib/icon/text-fill.js +563 -1
  106. package/lib/icon/transfer.js +563 -1
  107. package/lib/icon/tree-application-shape.js +563 -1
  108. package/lib/icon/unfull-screen.js +563 -1
  109. package/lib/icon/unvisible.js +563 -1
  110. package/lib/icon/up-shape.js +563 -1
  111. package/lib/icon/upload.js +563 -1
  112. package/lib/icon/video-fill.js +563 -1
  113. package/lib/icon/warn.js +563 -1
  114. package/lib/icon/weixin-pro.js +563 -1
  115. package/lib/icon/weixin.js +563 -1
  116. package/lib/image/index.js +681 -1
  117. package/lib/index.js +195 -1
  118. package/lib/info-box/index.js +1514 -2
  119. package/lib/input/index.js +1038 -1
  120. package/lib/link/index.js +232 -1
  121. package/lib/loading/index.js +443 -1
  122. package/lib/locale/index.js +489 -1
  123. package/lib/menu/index.js +793 -1
  124. package/lib/message/index.js +1842 -2
  125. package/lib/message/messageConstructor.d.ts +1 -1
  126. package/lib/modal/index.js +407 -1
  127. package/lib/navigation/index.js +439 -1
  128. package/lib/notify/index.js +470 -1
  129. package/lib/overflow-title/index.js +547 -1
  130. package/lib/pagination/index.js +974 -1
  131. package/lib/plugin-popover/index.js +4121 -1
  132. package/lib/plugins/index.js +130 -1
  133. package/lib/pop-confirm/index.js +367 -1
  134. package/lib/popover/content.d.ts +8 -0
  135. package/lib/popover/index.d.ts +12 -0
  136. package/lib/popover/index.js +4127 -1
  137. package/lib/popover/popover.d.ts +7 -0
  138. package/lib/popover/props.d.ts +3 -0
  139. package/lib/popover2/index.js +171 -1
  140. package/lib/preset.js +164 -1
  141. package/lib/process/index.js +1146 -2
  142. package/lib/progress/index.js +495 -1
  143. package/lib/radio/index.js +693 -1
  144. package/lib/rate/index.js +406 -1
  145. package/lib/resize-layout/index.js +499 -1
  146. package/lib/search-select/index.js +3024 -2
  147. package/lib/select/index.d.ts +25 -3
  148. package/lib/select/index.js +2599 -2
  149. package/lib/select/select.d.ts +11 -1
  150. package/lib/shared/index.js +2832 -1
  151. package/lib/sideslider/index.js +1056 -2
  152. package/lib/slider/index.js +1683 -2
  153. package/lib/steps/index.js +1215 -2
  154. package/lib/swiper/index.js +404 -1
  155. package/lib/switcher/index.js +335 -1
  156. package/lib/tab/index.js +935 -1
  157. package/lib/table/index.js +6588 -1
  158. package/lib/table-column/index.js +768 -1
  159. package/lib/tag/index.js +309 -1
  160. package/lib/tag-input/index.d.ts +9 -0
  161. package/lib/tag-input/index.js +1758 -1
  162. package/lib/tag-input/tag-input.d.ts +20 -0
  163. package/lib/tag-input/tag-props.d.ts +3 -0
  164. package/lib/time-picker/index.js +142 -1
  165. package/lib/timeline/index.js +310 -1
  166. package/lib/transfer/index.js +767 -1
  167. package/lib/tree/index.js +2664 -1
  168. package/lib/upload/index.js +3257 -2
  169. package/lib/virtual-render/index.js +806 -1
  170. package/package.json +1 -1
  171. package/lib/cascader/index.js.LICENSE.txt +0 -1
  172. package/lib/dialog/index.js.LICENSE.txt +0 -1
  173. package/lib/directives/index.js.LICENSE.txt +0 -14
  174. package/lib/info-box/index.js.LICENSE.txt +0 -1
  175. package/lib/message/index.js.LICENSE.txt +0 -6
  176. package/lib/process/index.js.LICENSE.txt +0 -1
  177. package/lib/search-select/index.js.LICENSE.txt +0 -1
  178. package/lib/select/index.js.LICENSE.txt +0 -1
  179. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  180. package/lib/slider/index.js.LICENSE.txt +0 -1
  181. package/lib/steps/index.js.LICENSE.txt +0 -1
  182. package/lib/upload/index.js.LICENSE.txt +0 -1
package/lib/tree/index.js CHANGED
@@ -1 +1,2664 @@
1
- !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("../shared"),require("vue"),require("../config-provider"),require("../virtual-render"),require("vue-types"),require("../exception"),require("../checkbox"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../virtual-render","vue-types","../exception","../checkbox","../icon"],n);else{var t="object"==typeof exports?n(require("../shared"),require("vue"),require("../config-provider"),require("../virtual-render"),require("vue-types"),require("../exception"),require("../checkbox"),require("../icon")):n(e["../shared"],e.vue,e["../config-provider"],e["../virtual-render"],e["vue-types"],e["../exception"],e["../checkbox"],e["../icon"]);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(self,((e,n,t,r,o,i,a,l)=>(()=>{var c={8022:(e,n,t)=>{var r=t(4481),o=t(6426),i=o;i.v1=r,i.v4=o,e.exports=i},8725:e=>{for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},9157:e=>{var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}},4481:(e,n,t)=>{var r,o,i=t(9157),a=t(8725),l=0,c=0;e.exports=function(e,n,t){var u=n&&t||0,d=n||[],s=(e=e||{}).node||r,f=void 0!==e.clockseq?e.clockseq:o;if(null==s||null==f){var p=i();null==s&&(s=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==f&&(f=o=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:c+1,_=v-l+(y-c)/1e4;if(_<0&&void 0===e.clockseq&&(f=f+1&16383),(_<0||v>l)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=v,c=y,o=f;var N=(1e4*(268435455&(v+=122192928e5))+y)%4294967296;d[u++]=N>>>24&255,d[u++]=N>>>16&255,d[u++]=N>>>8&255,d[u++]=255&N;var h=v/4294967296*1e4&268435455;d[u++]=h>>>8&255,d[u++]=255&h,d[u++]=h>>>24&15|16,d[u++]=h>>>16&255,d[u++]=f>>>8|128,d[u++]=255&f;for(var E=0;E<6;++E)d[u+E]=s[E];return n||a(d)}},6426:(e,n,t)=>{var r=t(9157),o=t(8725);e.exports=function(e,n,t){var i=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var l=0;l<16;++l)n[i+l]=a[l];return n||o(a)}},5800:e=>{"use strict";e.exports=a},2717:e=>{"use strict";e.exports=t},9911:e=>{"use strict";e.exports=i},6870:e=>{"use strict";e.exports=l},4212:n=>{"use strict";n.exports=e},3511:e=>{"use strict";e.exports=r},748:e=>{"use strict";e.exports=n},210:e=>{"use strict";e.exports=o}},u={};function d(e){var n=u[e];if(void 0!==n)return n.exports;var t=u[e]={exports:{}};return c[e](t,t.exports,d),t.exports}d.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return d.d(n,{a:n}),n},d.d=(e,n)=>{for(var t in n)d.o(n,t)&&!d.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},d.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";d.r(s),d.d(s,{default:()=>Y});var e,n,t,r=d(4212),o=d(748),i=d(2717),a=d(3511),l=d.n(a);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==c(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}!function(e){e.NODE_CLICK="nodeClick",e.NODE_COLLAPSE="nodeCollapse",e.NODE_EXPAND="nodeExpand",e.NODE_CHECKED="nodeChecked",e.NODE_DRAG_START="nodeDragStart",e.NODE_DRAG_OVER="nodeDragOver",e.NODE_DRAG_LEAVE="nodeDragLeave",e.NODE_DROP="nodeDrop"}(t||(t={}));var f,p=function(){return!0},v=(u(e={},t.NODE_CLICK,p),u(e,t.NODE_COLLAPSE,p),u(e,t.NODE_EXPAND,p),u(e,t.NODE_CHECKED,p),u(e,t.NODE_DRAG_START,p),u(e,t.NODE_DRAG_OVER,p),u(e,t.NODE_DRAG_LEAVE,p),u(e,t.NODE_DROP,p),e);!function(e){e.DEPTH="__depth",e.INDEX="__index",e.UUID="__uuid",e.PARENT_ID="__parent_id",e.HAS_CHILD="__has_child",e.PATH="__path",e.IS_ROOT="__is_root",e.ORDER="__order",e.IS_OPEN="__is_open",e.IS_CHECKED="__is_checked",e.IS_SELECTED="__is_selected",e.IS_ASYNC_INIT="__is_async_init",e.IS_MATCH="__is_match",e.IS_NULL="__IS_NULL",e.IS_CACHED="__is_cached",e.IS_ASYNC="__is_async",e.IS_LOADING="__is_loading",e.TREE_NODE_ATTR="__attr__",e.SOURCE_ITEM="__source_item__"}(f||(f={}));var y,_=(u(n={},f.IS_OPEN,"isOpen"),u(n,f.IS_SELECTED,"selected"),u(n,f.IS_MATCH,"isMatch"),u(n,f.HAS_CHILD,"hasChild"),u(n,f.IS_CHECKED,"checked"),u(n,f.IS_ASYNC,"async"),u(n,f.IS_LOADING,"loading"),u(n,f.IS_ROOT,"isRoot"),n);!function(e){e.CLICK="click",e.SELECTED="selected",e.EXPAND="expand",e.COLLAPSE="collapse"}(y||(y={}));var N,h,E,I=d(210);!function(e){e.ONCE="once",e.EVERY="every"}(N||(N={})),function(e){e.FUZZY="fuzzy",e.FULL="full"}(h||(h={})),function(e){e.TREE="tree",e.LIST="list"}(E||(E={}));var S={data:r.PropTypes.arrayOf(r.PropTypes.any).def([]),label:r.PropTypes.oneOfType([r.PropTypes.func.def(void 0),r.PropTypes.string.def("label")]),nodeKey:r.PropTypes.string.def(void 0),children:r.PropTypes.string.def("children"),indent:r.PropTypes.number.def(18),lineHeight:r.PropTypes.number.def(32),levelLine:r.PropTypes.oneOfType([r.PropTypes.bool.def(!1),r.PropTypes.func.def(void 0),r.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:r.PropTypes.bool.def(!1),prefixIcon:r.PropTypes.oneOfType([r.PropTypes.func.def((function(){})),r.PropTypes.bool.def(!1)]).def(!0),async:r.PropTypes.shape({callback:r.PropTypes.func.def(void 0),cache:r.PropTypes.bool.def(!0),deepAutoOpen:(0,I.toType)("columnType",{}).def(N.ONCE)}),offsetLeft:r.PropTypes.number.def(5),search:r.PropTypes.oneOfType([r.PropTypes.shape({value:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string,r.PropTypes.bool]).def(""),match:r.PropTypes.oneOfType([(0,I.string)(),r.PropTypes.func]).def(h.FUZZY),resultType:(0,I.string)().def(E.TREE),openResultNode:r.PropTypes.bool}),r.PropTypes.string,r.PropTypes.number,r.PropTypes.bool]).def(void 0),emptyText:r.PropTypes.string.def("没有数据"),draggable:r.PropTypes.bool.def(!1),disableDrag:r.PropTypes.func,disableDrop:r.PropTypes.func,dragSort:r.PropTypes.bool.def(!1),selectable:r.PropTypes.oneOfType([r.PropTypes.bool,r.PropTypes.func]).def(!0),disabledFolderSelectable:r.PropTypes.bool.def(!1),showCheckbox:r.PropTypes.bool.def(!1),showNodeTypeIcon:r.PropTypes.bool.def(!0),selected:r.PropTypes.oneOfType([r.PropTypes.string,r.PropTypes.number,r.PropTypes.object]),autoCheckChildren:r.PropTypes.bool.def(!0),autoOpenParentNode:r.PropTypes.bool.def(!0),expandAll:r.PropTypes.bool.def(!1),nodeContentAction:r.PropTypes.oneOfType([r.PropTypes.arrayOf((0,I.toType)("nodeContentActionType",{}).def(y.CLICK)),r.PropTypes.func.def((function(){return["selected"]}))]).def(["selected","expand","click"]),keepSlotData:r.PropTypes.bool.def(!1)},D=d(9911),g=d.n(D),T=d(5800),A=d.n(T),C=d(6870);const O=function(e,n){var t=function(n){return e.schema.get(n)},r=function(e,n){var r;return null===(r=t(e[f.UUID]))||void 0===r?void 0:r[n]},o=function(n,r,o){e.schema.set(n[f.UUID],Object.assign(Object.assign({},t(n[f.UUID])),u({},r,o)))},i=function(e){return r(e,f.PATH)},a=function(e){return r(e,f.UUID)},l=function(e){return r(e,f.IS_ROOT)},d=function(e){return r(e,f.IS_OPEN)},s=function(e){return r(e,f.HAS_CHILD)},p=function(e){return r(e,f.IS_MATCH)},v=function(e){return r(e,f.IS_CHECKED)},y=function(e){return r(e,f.PARENT_ID)},N=function(e){return r(u({},f.UUID,e),f.PARENT_ID)},h=function(e){var n;return"object"===c(e)?d(e):"string"==typeof e&&(null===(n=t(e))||void 0===n?void 0:n[f.IS_OPEN])},E=function(e,t){var r=e.split("-").reduce((function(e,t){var r=Number(t);return Array.isArray(e)?e[r]:e[n.children][r]}),n.data);return t&&Object.assign(r,u({},f.UUID,t)),r},I=function(e){return E(i(u({},f.UUID,e)),e)},S=function(e){var n;return u(n={},_[f.IS_LOADING],r(e,f.IS_LOADING)),u(n,_[f.HAS_CHILD],s(e)),u(n,_[f.IS_MATCH],p(e)),u(n,_[f.IS_CHECKED],v(e)),u(n,_[f.IS_OPEN],d(e)),u(n,_[f.IS_ROOT],l(e)),u(n,"fullPath",r(e,f.PATH)),u(n,"uuid",a(e)),u(n,"parentId",r(e,f.PARENT_ID)),n};return{getSchemaVal:t,getNodeAttr:r,getNodeId:a,getNodeParentId:y,getNodeParentIdById:N,getParentNodeData:function(e){return l(u({},f.UUID,e))?u({},n.children,n.data):I(N(e))},getParentNode:function(e){return t(y(e))},setNodeAttr:o,getNodePath:i,isRootNode:l,isNodeOpened:d,hasChildNode:s,isItemOpen:h,isNodeChecked:v,isNodeMatched:p,isNodeLoading:function(e){return r(e,f.IS_LOADING)},checkNodeIsOpen:function(e){return l(e)||function(e){return h(r(e,f.PARENT_ID))}(e)},getSourceNodeByPath:E,getSourceNodeByUID:I,deleteNodeSchema:function(n){return e.schema.delete(n)},resolveScopedSlotParam:S,setTreeNodeLoading:function(e,n){o(e,f.IS_LOADING,n)},extendNodeAttr:function(e){return Object.assign(Object.assign({},r(e,f.SOURCE_ITEM)),u({},f.TREE_NODE_ATTR,S(e)))},getChildNodes:function(n){var t=e.schema;return Array.prototype.filter.call(Array.from(t.keys()),(function(e){return t.get(e)[f.PARENT_ID]===n[f.UUID]}))},extendNodeScopedData:function(e){return{data:r(e,f.SOURCE_ITEM),attributes:S(e)}}}};function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var P="1px dashed #c3cdd7",b=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=e[n];return"boolean"==typeof a?a?r:o:U(t,e,n,i)},U=function(e,n,t){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=n[t];if("string"==typeof i)return"object"===c(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,i)||console.error("cannot find node label with key ".concat(i)),e[i]):i;if("function"==typeof i){var a=i.apply(void 0,[e].concat(function(e){if(Array.isArray(e))return m(e)}(r=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,n){if(e){if("string"==typeof e)return m(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m(e,n):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));return"string"==typeof a?a:void console.error("props label with function return value is not string, please check and return string")}},L=function(e,n){return U(e,n,"label")},x=function(e,n){return e.get(n)||{}},R=function(e,n){return{"--level-line":b(n,"levelLine",e,P,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),"--offset-left":"".concat(n.offsetLeft,"px")}},H=function(e,n){var t=function(e,n,t){var r;return null===(r=x(e,n))||void 0===r?void 0:r[t]}((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).schema,e[f.UUID],f.DEPTH);return Object.assign({"--depth":t},"function"==typeof n.levelLine?{"--level-line":b(n,"levelLine",e,P,null,["node"])}:{})},k=function(e,n,t){var r=x(n,e[f.UUID])||{};return{"is-root":r.__is_root,"bk-tree-node":!0,"is-open":r.__is_open,"is-virtual-render":t.virtualRender,"level-line":t.levelLine}},w=function(e,n){var t=x(n,e[f.UUID])||{};return u({"is-checked":t.__is_checked,"is-selected":t.__is_selected,"node-folder":e.is_folder,"node-leaf":e.is_leaf},(0,r.resolveClassName)("node-row"),!0)},j=function(e){return null==e?{__IS_NULL:!0}:"string"==typeof e||"number"==typeof e||"symbol"===c(e)?u({},f.UUID,e):(Object.prototype.hasOwnProperty.call(e,f.UUID)||console.error("setNodeAction Error: node id cannot found"),e)};const V=function(e,n){var t=O(n,e),r=t.setNodeAttr,o=t.getNodePath,i=t.getNodeAttr,a=t.resolveScopedSlotParam,l=t.setTreeNodeLoading,d=function(n,t){if("object"===c(n)&&null!==n){r(t,f.IS_OPEN,!0);var i=Array.isArray(n)?n:[n];return function(e,n,t,r,o){!function(e,n,t,r){var o=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(o,r||{})}(e,n,t,u({},r,o))}(o(t),e.data,e.children,e.children,i),Promise.resolve(n)}return Promise.resolve(n)},s=function(n){var t=e.async||{},o=t.callback,u=void 0===o?null:o,s=t.cache,p=void 0===s||s;if("function"==typeof u&&i(n,f.IS_ASYNC)){if(r(n,f.IS_ASYNC_INIT,!0),!i(n,f.IS_CACHED)){r(n,f.IS_CACHED,p);var v=a(n),y=u(n,(function(e){return d(e,n)}),v);if("object"===c(y)&&null!==y)return l(n,!0),y instanceof Promise?Promise.resolve(y.then((function(e){return d(e,n)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){l(n,!1),r(n,f.IS_CACHED,!0)}))):(d(y,n),l(n,!1),Promise.resolve(!0))}return Promise.resolve(!0)}return Promise.resolve(!0)};return{asyncNodeClick:s,deepAutoOpen:function e(){var t=n.data.filter((function(e){return i(e,f.IS_ASYNC)&&e[_[f.IS_OPEN]]&&!i(e,f.IS_ASYNC_INIT)}));t.length&&Promise.all(t.map((function(e){return s(e)}))).then((function(){e()})).catch((function(e){console.warn(e)}))}}},M=function(e,n,r,a,l,d){var s=e.selected,p=O(r,e),v=p.setNodeAttr,y=p.getNodePath,_=p.getSchemaVal,N=p.getNodeAttr,h=p.getNodeId,E=p.getChildNodes,I=p.isRootNode,S=p.hasChildNode,D=p.isItemOpen,g=p.isNodeOpened,T=p.isNodeLoading,m=p.isNodeChecked,P=p.getParentNode,b=p.resolveScopedSlotParam,U=p.extendNodeAttr,x=p.extendNodeScopedData,R=(0,i.usePrefix)().resolveClassName,M=d.registerNextLoop,K=V(e,r),q=K.asyncNodeClick,G=K.deepAutoOpen,Y=function(e){if("string"==typeof e)return e;if("object"===c(e)&&null!==e){if(e.__v_isVNode)return e;var n=e.node,t=e.className,r=e.text,i=e.style;return(0,o.h)(n,{class:t,style:i},r)}return null},F=function(t){if(n.slots.nodeAction)return n.slots.nodeAction(ae(t));var r=null;return T(t)?function(e){var t,r,i;return(null!==(i=null===(r=(t=n.slots).nodeLoading)||void 0===r?void 0:r.call(t,ae(e)))&&void 0!==i?i:T(e))?(0,o.createVNode)(C.Spinner,null,null):""}(t):"function"==typeof e.prefixIcon&&"default"!==(r=e.prefixIcon(ae(t),"node_action"))?Y(r):("default"===r||"boolean"==typeof e.prefixIcon&&e.prefixIcon)&&(S(t)||t.async||!e.autoCheckChildren)?D(t)?(0,o.createVNode)(C.DownShape,{class:R("node-prefix")},null):(0,o.createVNode)(C.RightShape,{class:R("node-prefix")},null):null},X=function(t){if(!e.showNodeTypeIcon)return null;if(n.slots.nodeType)return n.slots.nodeType(ae(t));var r=null;return"function"==typeof e.prefixIcon&&"default"!==(r=e.prefixIcon(ae(t),"node_type"))?Y(r):"default"===r||"boolean"==typeof e.prefixIcon&&e.prefixIcon?I(t)||S(t)?function(e){return D(e)?(0,o.createVNode)(C.FolderShapeOpen,{class:[R("tree-icon"),R("node-prefix")]},null):(0,o.createVNode)(C.Folder,{class:[R("tree-icon"),R("node-prefix")]},null)}(t):(0,o.createVNode)(C.TextFile,{class:[R("tree-icon"),R("node-prefix")]},null):null},z=function e(n,t){var r=P(n);r&&(v(r,f.IS_CHECKED,t),I(r)||e(r,t))},B=function e(n,t,r){E(n).forEach((function(n){v(u({},f.UUID,n),t,r),e(u({},f.UUID,n),t,r)}))},W=function(e,r){v(e,f.IS_CHECKED,!!r),B(e,f.IS_CHECKED,!!r),z(e,r),n.emit(t.NODE_CHECKED,l.value.filter((function(e){return m(e)})).map((function(e){return e[f.UUID]})))},J=function(e){return m(e)&&!l.value.filter((function(n){var t;return null===(t=y(n))||void 0===t?void 0:t.startsWith(y(e))})).every((function(e){return m(e)}))},Z=function(e){return m(e)||l.value.filter((function(n){var t;return null===(t=y(n))||void 0===t?void 0:t.startsWith(y(e))})).some((function(e){return m(e)}))},$=function(n){return e.showCheckbox?(0,o.createVNode)(A(),{size:"small",modelValue:Z(n),indeterminate:J(n),onChange:function(e){return W(n,!!e)}},null):null},Q=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=null===r?!D(e):!!r;if(a||B(e,f.IS_OPEN,a),v(e,f.IS_OPEN,a),i){var l=D(e)?t.NODE_EXPAND:t.NODE_COLLAPSE,c=N(e,f.SOURCE_ITEM);n.emit(l,c,b(e),_(e[f.UUID]),o)}},ee=function(e,n,t){Array.isArray(e)?e.forEach((function(e){return v(j(e),n,t)})):v(j(e),n,t)},ne=function e(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=j(n);o[f.IS_NULL]||(r?t?(ee(o,f.IS_OPEN,!0),I(o)||e(N(o,f.PARENT_ID),!0,!0)):Q(o,!1,null,!1):ee(o,f.IS_OPEN,t))},te=function(e,n){g(e)?Q(e,!1,n):q(e).finally((function(){N(e,f.IS_LOADING)?M("setNodeOpenedAfterLoading",{type:"once",fn:function(){return Q(e,!0,n)}}):Q(e,!0,n)}))},re=function n(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Array.isArray(t)?t:[t];if(a.length){var l=j(a[0]);l[f.IS_NULL]||(!e.selectable||"function"==typeof e.selectable&&!e.selectable(t)||e.disabledFolderSelectable&&!0===(null==t?void 0:t.is_folder)?console.warn("props.selectable is false or undefined, please set selectable with true"):(null!=s&&v(u({},f.UUID,s),f.IS_SELECTED,!r),e.selected&&e.selected!==s&&v(u({},f.UUID,e.selected),f.IS_SELECTED,!r),v(l,f.IS_SELECTED,r),s=h(l),i&&1===a.length&&ne(l,!0,!0),N(l,f.IS_ASYNC)&&q(l).then((function(){(0,o.nextTick)((function(){a.shift(),n(a,r,i)}))}))))}},oe=function(n){if(!e.levelLine)return null;var t=N(n,f.DEPTH)+1;return new Array(t).fill("").map((function(e,n){return n})).filter((function(e){return function(e,n){if(I(n))return!1;var t=y(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),i=parseInt(o,10);r.push("".concat(i+1));var a=r.join("-");return l.value.some((function(e){return e[f.PATH]===a}))}(e,n)})).filter((function(e){return e>0})).map((function(e){return(0,o.createVNode)("span",{class:"node-virtual-line",style:(n=t-e,{"--depth":n})},null);var n}))},ie=function(t){var r,o,i,a;return n.slots.node?null===(o=(r=n.slots).node)||void 0===o?void 0:o.call(r,ae(t)):n.slots.default?null===(a=(i=n.slots).default)||void 0===a?void 0:a.call(i,x(t)):[L(t,e)]},ae=function(n){return e.keepSlotData?x(n):U(n)};return{renderTreeNode:function(i){var a,l;return(0,o.createVNode)("div",{"data-tree-node":h(i),key:h(i),class:w(i,r.schema)},[(0,o.createVNode)("div",{class:k(i,r.schema,e),style:H(i,e,r),onClick:function(r){return function(r,o){var i,a=(i=r,"function"==typeof e.nodeContentAction?Reflect.apply(e.nodeContentAction,void 0,[{node:i}]):"string"==typeof e.nodeContentAction?[e.nodeContentAction]:Array.isArray(e.nodeContentAction)?e.nodeContentAction:["selected","expand","click"]);if(a.includes("selected")&&re(r,!0,!1),a.includes("expand")&&(g(r)||te(r,o)),a.includes("collapse")&&g(r)&&te(r,o),a.includes("click")){var l=t.NODE_CLICK,c=N(r,f.SOURCE_ITEM);n.emit(l,c,b(r),_(r[f.UUID]),o)}}(i,r)}},[(0,o.createVNode)("div",{class:[R("node-action")],onClick:function(e){return function(e,n){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),te(n,e)}(e,i)}},[F(i)]),(0,o.createVNode)("div",{class:R("node-content")},[[$(i),X(i)],(0,o.createVNode)("span",{class:R("node-text")},[ie(i)]),null===(l=(a=n.slots).nodeAppend)||void 0===l?void 0:l.call(a,ae(i))]),oe(i)])])},handleTreeNodeClick:te,deepAutoOpen:G,asyncNodeClick:q,setNodeAction:ee,setNodeOpened:Q,setSelect:re,setOpen:ne}};var K=d(8022),q=void 0;const G=(0,o.defineComponent)({name:"Tree",props:S,emits:v,setup:function(e,n){var r=function(e){var n,t=function(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=e.data,i=e.children,a=[],l=[],d=0,s=new Map;function p(e,n,t,r){if(null!=e&&s.has(e)&&![f.UUID,f.PARENT_ID].includes(n)){var o=s.get(e);Object.prototype.hasOwnProperty.call(o,n)&&"function"==typeof r&&Reflect.apply(r,self,[o,n,t])&&(Object.assign(o,u({},n,t)),p(o[f.PARENT_ID],n,t,r))}}function v(n){var t=null;return"string"==typeof e.nodeKey&&(t=n[e.nodeKey]||(0,K.v4)()),t||n[f.UUID]||(0,K.v4)()}var y=(u(n={},f.IS_OPEN,(function(){return!!e.expandAll})),u(n,f.IS_CHECKED,(function(){return!1})),u(n,f.IS_MATCH,(function(){return!0})),u(n,f.IS_SELECTED,(function(n){return e.selected===n})),u(n,f.IS_CACHED,(function(){return!1})),u(n,f.IS_ASYNC,(function(){return null})),u(n,f.IS_LOADING,(function(){return!1})),n);function N(e,n,t){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=o;void 0===o&&"function"==typeof y[t]&&(i=y[t](e,n));var a=_[t];if(Object.prototype.hasOwnProperty.call(n,a))return n[a];var l=(r||[]).find((function(n){return n[f.UUID]===e})),c=void 0;return l&&(c=l[t]),null==c&&(c=i),c}function h(n,t){return!!e.selectable&&N(n,t,f.IS_SELECTED,e.selected===n)}function E(e,n,t){var r,o=N(e,n,f.IS_OPEN),i=!s.has(t)||(null===(r=s.get(t))||void 0===r?void 0:r[f.IS_OPEN]);return o&&i}function I(e){return!e[f.IS_OPEN]}return function n(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,y=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,_=t.length,S=0;S<_;S++){var D=t[S];if(Array.isArray(D))n(D,r,o,y);else if("object"===c(D)&&null!==D){var g,T,A=null!==y?"".concat(y,"-").concat(S):"".concat(S),C="".concat(v(D)),O=!!(D[i]||[]).length,m=N(C,D,f.IS_OPEN);e.autoOpenParentNode?m&&p(o,f.IS_OPEN,!0,I):m=E(C,D,o);var P=e.showCheckbox&&N(C,D,f.IS_CHECKED);P&&a.push(C),s.set(C,(u(g={},f.DEPTH,r),u(g,f.INDEX,S),u(g,f.UUID,C),u(g,f.PARENT_ID,o),u(g,f.HAS_CHILD,O),u(g,f.PATH,A),u(g,f.IS_ROOT,null===o),u(g,f.ORDER,d),u(g,f.IS_SELECTED,h(C,D)),u(g,f.IS_MATCH,N(C,D,f.IS_MATCH)),u(g,f.IS_OPEN,m),u(g,f.IS_CHECKED,P),u(g,f.IS_CACHED,N(C,D,f.IS_CACHED)),u(g,f.IS_ASYNC,N(C,D,f.IS_ASYNC)),u(g,f.IS_LOADING,N(C,D,f.IS_LOADING)),u(g,f.SOURCE_ITEM,D),u(g,i,null),g)),d+=1,l.push((u(T={},f.UUID,C),u(T,e.label,D[e.label]),u(T,f.IS_OPEN,m),u(T,i,null),T)),Object.prototype.hasOwnProperty.call(D,i)&&n(D[i]||[],r+1,C,A)}}}(t||o),e.showCheckbox&&(null==a||a.forEach((function(e){Array.from(s.values()).filter((function(n){var t;return null===(t=n[f.PATH])||void 0===t?void 0:t.startsWith(s.get(e)[f.PATH])})).forEach((function(e){return Object.assign(e,u({},f.IS_CHECKED,!0))})),p(e,f.IS_CHECKED,!0,(function(){return!0}))}))),[l,s]},r=t(e),i=new Map,a=[],l=[],d=(0,o.reactive)({data:r[0],schema:r[1],levelLineSchema:{}}),s=(0,o.computed)((function(){return Array.from(d.schema.values())})),p=V(e,d),v=p.asyncNodeClick,y=p.deepAutoOpen,N=function(e,n){(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&i.has(e)&&i.delete(e),i.set(e,n)},h=function(e){var n,t=function(e){return"function"==typeof e?{type:"loop",fn:e}:"object"===c(e)&&"string"==typeof e.type&&"function"==typeof e.fn?e:(console.error("loop event error",e),null)}(e);return null!==t&&Reflect.apply(t.fn,q,[]),null!==(n=null==t?void 0:t.type)&&void 0!==n?n:"once"};return(0,o.watch)((function(){return[e.data]}),(function(n){var r,o,a=t(e,n,s.value);d.data=a[0],d.schema=a[1],(null===(r=e.async)||void 0===r?void 0:r.callback)&&"every"===(null===(o=e.async)||void 0===o?void 0:o.deepAutoOpen)&&y(),Array.from(i.keys()).forEach((function(e){var n=i.get(e);if(Array.isArray(n)){var t=[];n.forEach((function(e,n){"once"===h(e)&&t.unshift(n)})),t.length&&t.forEach((function(e){return n.splice(e,1)})),0===n.length&&i.delete(e)}else"once"===h(n)&&i.delete(e)}))}),{deep:!0}),e.selectable&&(0,o.onMounted)((function(){(0,o.watch)((function(){return e.selected}),(function(e){l.length=0,a.forEach((function(n){Reflect.apply(n,q,[e]),l.push((function(){return Reflect.apply(n,q,[e])}))})),N("afterSelectWatch",l)}),{immediate:!0})})),(null===(n=e.async)||void 0===n?void 0:n.callback)&&y(),{flatData:d,schemaValues:s,asyncNodeClick:v,deepAutoOpen:y,afterDataUpdate:function(e){N("afterDataUpdate",e)},registerNextLoop:N,onSelected:function(e){a.push(e)}}}(e),a=r.flatData,d=r.schemaValues,s=r.onSelected,p=r.registerNextLoop,v=O(a,e),y=v.setNodeAttr,N=v.checkNodeIsOpen,h=v.getNodeAttr,E=v.getNodePath,I=v.isRootNode,S=v.isNodeOpened,D=v.isNodeChecked,T=v.isNodeMatched,A=v.hasChildNode,C=function(e){var n,t=(0,o.toRef)(e,"search"),r=null!==(n=e.search)&&void 0!==n?n:{},i=r.openResultNode,a=void 0!==i&&i,l=r.resultType,u=void 0===l?"tree":l,d=function(e){return["string","number","boolean"].includes(c(e))},s=function(e,n){return e===n},f=function(e,n){return new RegExp("".concat(e),"i").test("".concat(n))},p=function(e,n){return Reflect.apply(e,void 0,n)},v=void 0===t.value||!1===t.value,y=(0,o.computed)((function(){return!1!==t.value&&(d(t.value)?"".concat(t.value).length>0:"object"===c(t.value))}));return{searchFn:function(e,n){if(v)return!0;if(d(t.value))return p(f,[t.value,e,n]);var r=t.value,o=r.value,i=void 0===o?"":o,a=r.match,l=void 0===a?"fuzzy":a,c="function"==typeof l?l:"fuzzy"===l?f:s;return 0==="".concat(i).length||p(c,[i,e,n])},refSearch:t,isSearchActive:y,isSearchDisabled:v,openResultNode:a,resultType:u,isTreeUI:"tree"===u}}(e),m=C.searchFn,P=C.isSearchActive,b=C.refSearch,U=C.openResultNode,x=C.isTreeUI;C.isSearchDisabled||(0,o.watch)([b],(function(){a.data.forEach((function(n){var t=m(L(n,e),n);y(n,f.IS_MATCH,t),U&&F(n,!0,!0)}))}));var H=(0,o.computed)((function(){return a.data.filter((function(e){return N(e)&&function(e){return!P.value||(h(e,f.IS_MATCH)||!!x&&d.value.some((function(n){var t;return(null===(t=n[f.PATH])||void 0===t?void 0:t.startsWith(E(e)))&&n[f.IS_MATCH]})))}(e)}))})),k=M(e,n,a,0,d,{registerNextLoop:p}),w=k.renderTreeNode,G=k.handleTreeNodeClick,Y=k.setNodeOpened,F=k.setOpen,X=k.setNodeAction,z=k.setSelect,B=k.asyncNodeClick,W=(0,o.ref)();s((function(n){z(n,!0,e.autoOpenParentNode),J()}));var J=function(){};n.expose({handleTreeNodeClick:G,isNodeChecked:D,isRootNode:I,isNodeOpened:S,isNodeMatched:T,hasChildNode:A,setOpen:F,setChecked:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];X(j(e),f.IS_CHECKED,n)},setNodeAction:X,setNodeOpened:Y,setSelect:z,asyncNodeClick:B,getData:function(){return a}});var Z=function(e,n){var t=n.slots;return{renderEmpty:function(n){var r,i;return(0,o.createVNode)(g(),{scene:"part",type:n},{default:function(){return[null!==(i=null===(r=t.default)||void 0===r?void 0:r.call(t))&&void 0!==i?i:e.emptyText]}})}}}(e,n),$=Z.renderEmpty;!function(e,n,r,a){var l=O(a,e),c=l.getSourceNodeByUID,d=l.getNodeParentIdById,s=l.getParentNodeData,p=l.extendNodeAttr,v=l.getNodeAttr,y=l.getNodePath,_=l.isRootNode,N=(0,i.usePrefix)().resolveClassName,h=(0,o.computed)((function(){return"function"==typeof e.disableDrag})),E=(0,o.computed)((function(){return"function"==typeof e.disableDrop})),I="",S=function(e){return e.target.closest("[data-tree-node]")},D=function(e){var n,t=null===(n=null==e?void 0:e.dataset)||void 0===n?void 0:n.treeNode;return c(t)},g=function e(n){S(n).removeEventListener("mouseup",e)},T=function(n){var t=S(n),r=D(t);!1===r.draggable||h.value&&e.disableDrag(r)?t.classList.add("".concat(N("tree-drag-disabled"))):(t.setAttribute("draggable","true"),t.addEventListener("mouseup",g))},A=function(r){r.preventDefault();var o=S(r),i=p(D(o));if(n.emit(t.NODE_DRAG_OVER,r,o,i),E.value&&(null==e?void 0:e.disableDrop(i)))return r.dataTransfer.effectAllowed="move",r.dataTransfer.dropEffect="none",void o.classList.add("".concat(N("tree-drop-disabled")));o.classList.add("".concat(N("tree-drop-active")));var a=r.dataTransfer.getData("node-id");a=I;var l=o.getAttribute("data-tree-node"),c=P(a,l)?"move":"none";r.dataTransfer.effectAllowed=c,r.dataTransfer.dropEffect=c},C=function(e){e.dataTransfer.effectAllowed="move",e.dataTransfer.dropEffect="move";var r=S(e);e.dataTransfer.setData("text/plain","");var o=r.getAttribute("data-tree-node");I=o,e.dataTransfer.setData("node-id",o),n.emit(t.NODE_DRAG_START,e,r)},m=function(r){r.preventDefault(),r.stopPropagation();var o=S(r);o.classList.remove("".concat(N("tree-drop-active")),"".concat(N("tree-drop-disabled")));var i=p(D(o));if(!E.value||!e.disableDrop(i)){var a=I,l=o.getAttribute("data-tree-node");Reflect.apply(e.dragSort?b:U,void 0,[a,l]),n.emit(t.NODE_DROP,r,o,i)}},P=function(e,n){var t=y(u({},f.UUID,e)),r=y(u({},f.UUID,n));return d(e)===d(n)||-1===t.indexOf(r)&&-1===r.indexOf(t)},b=function(n,t){if(P(n,t)){var r=JSON.parse(JSON.stringify(c(n))),o=JSON.parse(JSON.stringify(c(t))),i=s(n),a=s(t),l=v(u({},f.UUID,n),f.INDEX),d=v(u({},f.UUID,t),f.INDEX);null==i||i[e.children].splice(l,1,o),null==a||a[e.children].splice(d,1,r)}},U=function(n,t){var r=c(n),o=c(t),i=null;if(_(u({},f.UUID,n)))i=e.data;else{var a=d(n);if(null!=a){i=c(a);var l=v(u({},f.UUID,n),f.INDEX);null==i||i[e.children].splice(l,1)}}o[e.children]||(o[e.children]=[]),o[e.children].unshift(r)},L=function(e){e.preventDefault();var r=S(e);r.classList.remove("".concat(N("tree-drop-active")),"".concat(N("tree-drop-disabled"))),n.emit(t.NODE_DRAG_LEAVE,e,r)};(0,o.onMounted)((function(){if(e.draggable&&r.value){var n=r.value.$el;n.addEventListener("mousedown",T),n.addEventListener("dragstart",C),n.addEventListener("dragover",A),n.addEventListener("dragleave",L),n.addEventListener("drop",m)}})),(0,o.onUnmounted)((function(){if(e.draggable&&r.value){var n=r.value.$el;n.removeEventListener("mousedown",T),n.removeEventListener("dragstart",C),n.removeEventListener("dragover",A),n.removeEventListener("dragleave",L),n.removeEventListener("drop",m)}}))}(e,n,W,a);var Q=(0,i.usePrefix)().resolveClassName;return function(){return(0,o.createVNode)(l(),{class:Q("tree"),style:R(null,e),list:H.value,lineHeight:e.lineHeight,enabled:e.virtualRender,rowKey:f.UUID,keepAlive:!0,contentClassName:Q("container"),throttleDelay:0,ref:W},{default:function(e){return function(e){var t,r,o;if(e.length)return e.map(w);var i=P.value?"search-empty":"empty";return null!==(o=null===(r=(t=n.slots).empty)||void 0===r?void 0:r.call(t))&&void 0!==o?o:$(i)}(e.data||[])}})}}}),Y=(0,r.withInstall)(G)})(),s})()));
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("../shared"), require("vue"), require("../config-provider"), require("../virtual-render"), require("vue-types"), require("../exception"), require("../checkbox"), require("../icon"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["../shared", "vue", "../config-provider", "../virtual-render", "vue-types", "../exception", "../checkbox", "../icon"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../config-provider"), require("../virtual-render"), require("vue-types"), require("../exception"), require("../checkbox"), require("../icon")) : factory(root["../shared"], root["vue"], root["../config-provider"], root["../virtual-render"], root["vue-types"], root["../exception"], root["../checkbox"], root["../icon"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__2717__, __WEBPACK_EXTERNAL_MODULE__3511__, __WEBPACK_EXTERNAL_MODULE__210__, __WEBPACK_EXTERNAL_MODULE__9911__, __WEBPACK_EXTERNAL_MODULE__5800__, __WEBPACK_EXTERNAL_MODULE__6870__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 8022:
15
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
16
+
17
+ var v1 = __webpack_require__(4481);
18
+ var v4 = __webpack_require__(6426);
19
+
20
+ var uuid = v4;
21
+ uuid.v1 = v1;
22
+ uuid.v4 = v4;
23
+
24
+ module.exports = uuid;
25
+
26
+
27
+ /***/ }),
28
+
29
+ /***/ 8725:
30
+ /***/ ((module) => {
31
+
32
+ /**
33
+ * Convert array of 16 byte values to UUID string format of the form:
34
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
35
+ */
36
+ var byteToHex = [];
37
+ for (var i = 0; i < 256; ++i) {
38
+ byteToHex[i] = (i + 0x100).toString(16).substr(1);
39
+ }
40
+
41
+ function bytesToUuid(buf, offset) {
42
+ var i = offset || 0;
43
+ var bth = byteToHex;
44
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
45
+ return ([
46
+ bth[buf[i++]], bth[buf[i++]],
47
+ bth[buf[i++]], bth[buf[i++]], '-',
48
+ bth[buf[i++]], bth[buf[i++]], '-',
49
+ bth[buf[i++]], bth[buf[i++]], '-',
50
+ bth[buf[i++]], bth[buf[i++]], '-',
51
+ bth[buf[i++]], bth[buf[i++]],
52
+ bth[buf[i++]], bth[buf[i++]],
53
+ bth[buf[i++]], bth[buf[i++]]
54
+ ]).join('');
55
+ }
56
+
57
+ module.exports = bytesToUuid;
58
+
59
+
60
+ /***/ }),
61
+
62
+ /***/ 9157:
63
+ /***/ ((module) => {
64
+
65
+ // Unique ID creation requires a high quality random # generator. In the
66
+ // browser this is a little complicated due to unknown quality of Math.random()
67
+ // and inconsistent support for the `crypto` API. We do the best we can via
68
+ // feature-detection
69
+
70
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto
71
+ // implementation. Also, find the complete implementation of crypto on IE11.
72
+ var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
73
+ (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
74
+
75
+ if (getRandomValues) {
76
+ // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
77
+ var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
78
+
79
+ module.exports = function whatwgRNG() {
80
+ getRandomValues(rnds8);
81
+ return rnds8;
82
+ };
83
+ } else {
84
+ // Math.random()-based (RNG)
85
+ //
86
+ // If all else fails, use Math.random(). It's fast, but is of unspecified
87
+ // quality.
88
+ var rnds = new Array(16);
89
+
90
+ module.exports = function mathRNG() {
91
+ for (var i = 0, r; i < 16; i++) {
92
+ if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
93
+ rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
94
+ }
95
+
96
+ return rnds;
97
+ };
98
+ }
99
+
100
+
101
+ /***/ }),
102
+
103
+ /***/ 4481:
104
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
105
+
106
+ var rng = __webpack_require__(9157);
107
+ var bytesToUuid = __webpack_require__(8725);
108
+
109
+ // **`v1()` - Generate time-based UUID**
110
+ //
111
+ // Inspired by https://github.com/LiosK/UUID.js
112
+ // and http://docs.python.org/library/uuid.html
113
+
114
+ var _nodeId;
115
+ var _clockseq;
116
+
117
+ // Previous uuid creation time
118
+ var _lastMSecs = 0;
119
+ var _lastNSecs = 0;
120
+
121
+ // See https://github.com/uuidjs/uuid for API details
122
+ function v1(options, buf, offset) {
123
+ var i = buf && offset || 0;
124
+ var b = buf || [];
125
+
126
+ options = options || {};
127
+ var node = options.node || _nodeId;
128
+ var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
129
+
130
+ // node and clockseq need to be initialized to random values if they're not
131
+ // specified. We do this lazily to minimize issues related to insufficient
132
+ // system entropy. See #189
133
+ if (node == null || clockseq == null) {
134
+ var seedBytes = rng();
135
+ if (node == null) {
136
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
137
+ node = _nodeId = [
138
+ seedBytes[0] | 0x01,
139
+ seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
140
+ ];
141
+ }
142
+ if (clockseq == null) {
143
+ // Per 4.2.2, randomize (14 bit) clockseq
144
+ clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
145
+ }
146
+ }
147
+
148
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
149
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
150
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
151
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
152
+ var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
153
+
154
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
155
+ // cycle to simulate higher resolution clock
156
+ var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
157
+
158
+ // Time since last uuid creation (in msecs)
159
+ var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
160
+
161
+ // Per 4.2.1.2, Bump clockseq on clock regression
162
+ if (dt < 0 && options.clockseq === undefined) {
163
+ clockseq = clockseq + 1 & 0x3fff;
164
+ }
165
+
166
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
167
+ // time interval
168
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
169
+ nsecs = 0;
170
+ }
171
+
172
+ // Per 4.2.1.2 Throw error if too many uuids are requested
173
+ if (nsecs >= 10000) {
174
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
175
+ }
176
+
177
+ _lastMSecs = msecs;
178
+ _lastNSecs = nsecs;
179
+ _clockseq = clockseq;
180
+
181
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
182
+ msecs += 12219292800000;
183
+
184
+ // `time_low`
185
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
186
+ b[i++] = tl >>> 24 & 0xff;
187
+ b[i++] = tl >>> 16 & 0xff;
188
+ b[i++] = tl >>> 8 & 0xff;
189
+ b[i++] = tl & 0xff;
190
+
191
+ // `time_mid`
192
+ var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
193
+ b[i++] = tmh >>> 8 & 0xff;
194
+ b[i++] = tmh & 0xff;
195
+
196
+ // `time_high_and_version`
197
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
198
+ b[i++] = tmh >>> 16 & 0xff;
199
+
200
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
201
+ b[i++] = clockseq >>> 8 | 0x80;
202
+
203
+ // `clock_seq_low`
204
+ b[i++] = clockseq & 0xff;
205
+
206
+ // `node`
207
+ for (var n = 0; n < 6; ++n) {
208
+ b[i + n] = node[n];
209
+ }
210
+
211
+ return buf ? buf : bytesToUuid(b);
212
+ }
213
+
214
+ module.exports = v1;
215
+
216
+
217
+ /***/ }),
218
+
219
+ /***/ 6426:
220
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
221
+
222
+ var rng = __webpack_require__(9157);
223
+ var bytesToUuid = __webpack_require__(8725);
224
+
225
+ function v4(options, buf, offset) {
226
+ var i = buf && offset || 0;
227
+
228
+ if (typeof(options) == 'string') {
229
+ buf = options === 'binary' ? new Array(16) : null;
230
+ options = null;
231
+ }
232
+ options = options || {};
233
+
234
+ var rnds = options.random || (options.rng || rng)();
235
+
236
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
237
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
238
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
239
+
240
+ // Copy bytes to buffer, if provided
241
+ if (buf) {
242
+ for (var ii = 0; ii < 16; ++ii) {
243
+ buf[i + ii] = rnds[ii];
244
+ }
245
+ }
246
+
247
+ return buf || bytesToUuid(rnds);
248
+ }
249
+
250
+ module.exports = v4;
251
+
252
+
253
+ /***/ }),
254
+
255
+ /***/ 5800:
256
+ /***/ ((module) => {
257
+
258
+ "use strict";
259
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5800__;
260
+
261
+ /***/ }),
262
+
263
+ /***/ 2717:
264
+ /***/ ((module) => {
265
+
266
+ "use strict";
267
+ module.exports = __WEBPACK_EXTERNAL_MODULE__2717__;
268
+
269
+ /***/ }),
270
+
271
+ /***/ 9911:
272
+ /***/ ((module) => {
273
+
274
+ "use strict";
275
+ module.exports = __WEBPACK_EXTERNAL_MODULE__9911__;
276
+
277
+ /***/ }),
278
+
279
+ /***/ 6870:
280
+ /***/ ((module) => {
281
+
282
+ "use strict";
283
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
284
+
285
+ /***/ }),
286
+
287
+ /***/ 4212:
288
+ /***/ ((module) => {
289
+
290
+ "use strict";
291
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
292
+
293
+ /***/ }),
294
+
295
+ /***/ 3511:
296
+ /***/ ((module) => {
297
+
298
+ "use strict";
299
+ module.exports = __WEBPACK_EXTERNAL_MODULE__3511__;
300
+
301
+ /***/ }),
302
+
303
+ /***/ 748:
304
+ /***/ ((module) => {
305
+
306
+ "use strict";
307
+ module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
308
+
309
+ /***/ }),
310
+
311
+ /***/ 210:
312
+ /***/ ((module) => {
313
+
314
+ "use strict";
315
+ module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
316
+
317
+ /***/ })
318
+
319
+ /******/ });
320
+ /************************************************************************/
321
+ /******/ // The module cache
322
+ /******/ var __webpack_module_cache__ = {};
323
+ /******/
324
+ /******/ // The require function
325
+ /******/ function __webpack_require__(moduleId) {
326
+ /******/ // Check if module is in cache
327
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
328
+ /******/ if (cachedModule !== undefined) {
329
+ /******/ return cachedModule.exports;
330
+ /******/ }
331
+ /******/ // Create a new module (and put it into the cache)
332
+ /******/ var module = __webpack_module_cache__[moduleId] = {
333
+ /******/ // no module.id needed
334
+ /******/ // no module.loaded needed
335
+ /******/ exports: {}
336
+ /******/ };
337
+ /******/
338
+ /******/ // Execute the module function
339
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
340
+ /******/
341
+ /******/ // Return the exports of the module
342
+ /******/ return module.exports;
343
+ /******/ }
344
+ /******/
345
+ /************************************************************************/
346
+ /******/ /* webpack/runtime/compat get default export */
347
+ /******/ (() => {
348
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
349
+ /******/ __webpack_require__.n = (module) => {
350
+ /******/ var getter = module && module.__esModule ?
351
+ /******/ () => (module['default']) :
352
+ /******/ () => (module);
353
+ /******/ __webpack_require__.d(getter, { a: getter });
354
+ /******/ return getter;
355
+ /******/ };
356
+ /******/ })();
357
+ /******/
358
+ /******/ /* webpack/runtime/define property getters */
359
+ /******/ (() => {
360
+ /******/ // define getter functions for harmony exports
361
+ /******/ __webpack_require__.d = (exports, definition) => {
362
+ /******/ for(var key in definition) {
363
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
364
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
365
+ /******/ }
366
+ /******/ }
367
+ /******/ };
368
+ /******/ })();
369
+ /******/
370
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
371
+ /******/ (() => {
372
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
373
+ /******/ })();
374
+ /******/
375
+ /******/ /* webpack/runtime/make namespace object */
376
+ /******/ (() => {
377
+ /******/ // define __esModule on exports
378
+ /******/ __webpack_require__.r = (exports) => {
379
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
380
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
381
+ /******/ }
382
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
383
+ /******/ };
384
+ /******/ })();
385
+ /******/
386
+ /************************************************************************/
387
+ var __webpack_exports__ = {};
388
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
389
+ (() => {
390
+ "use strict";
391
+ // ESM COMPAT FLAG
392
+ __webpack_require__.r(__webpack_exports__);
393
+
394
+ // EXPORTS
395
+ __webpack_require__.d(__webpack_exports__, {
396
+ "default": () => (/* binding */ src)
397
+ });
398
+
399
+ // EXTERNAL MODULE: external "../shared"
400
+ var external_shared_ = __webpack_require__(4212);
401
+ // EXTERNAL MODULE: external "vue"
402
+ var external_vue_ = __webpack_require__(748);
403
+ // EXTERNAL MODULE: external "../config-provider"
404
+ var external_config_provider_ = __webpack_require__(2717);
405
+ // EXTERNAL MODULE: external "../virtual-render"
406
+ var external_virtual_render_ = __webpack_require__(3511);
407
+ var external_virtual_render_default = /*#__PURE__*/__webpack_require__.n(external_virtual_render_);
408
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
409
+ function _typeof(obj) {
410
+ "@babel/helpers - typeof";
411
+
412
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
413
+ return typeof obj;
414
+ } : function (obj) {
415
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
416
+ }, _typeof(obj);
417
+ }
418
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
419
+
420
+ function _toPrimitive(input, hint) {
421
+ if (_typeof(input) !== "object" || input === null) return input;
422
+ var prim = input[Symbol.toPrimitive];
423
+ if (prim !== undefined) {
424
+ var res = prim.call(input, hint || "default");
425
+ if (_typeof(res) !== "object") return res;
426
+ throw new TypeError("@@toPrimitive must return a primitive value.");
427
+ }
428
+ return (hint === "string" ? String : Number)(input);
429
+ }
430
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
431
+
432
+
433
+ function _toPropertyKey(arg) {
434
+ var key = _toPrimitive(arg, "string");
435
+ return _typeof(key) === "symbol" ? key : String(key);
436
+ }
437
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
438
+
439
+ function _defineProperty(obj, key, value) {
440
+ key = _toPropertyKey(key);
441
+ if (key in obj) {
442
+ Object.defineProperty(obj, key, {
443
+ value: value,
444
+ enumerable: true,
445
+ configurable: true,
446
+ writable: true
447
+ });
448
+ } else {
449
+ obj[key] = value;
450
+ }
451
+ return obj;
452
+ }
453
+ ;// CONCATENATED MODULE: ../../packages/tree/src/constant.ts
454
+
455
+ var _TreeEmitEventsType, _NODE_SOURCE_ATTRS;
456
+ /*
457
+ * Tencent is pleased to support the open source community by making
458
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
459
+ *
460
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
461
+ *
462
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
463
+ *
464
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
465
+ *
466
+ * ---------------------------------------------------
467
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
468
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
469
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
470
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
471
+ *
472
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
473
+ * the Software.
474
+ *
475
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
476
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
477
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
478
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
479
+ * IN THE SOFTWARE.
480
+ */
481
+ var EVENTS;
482
+ (function (EVENTS) {
483
+ EVENTS["NODE_CLICK"] = "nodeClick";
484
+ EVENTS["NODE_COLLAPSE"] = "nodeCollapse";
485
+ EVENTS["NODE_EXPAND"] = "nodeExpand";
486
+ EVENTS["NODE_CHECKED"] = "nodeChecked";
487
+ EVENTS["NODE_DRAG_START"] = "nodeDragStart";
488
+ EVENTS["NODE_DRAG_OVER"] = "nodeDragOver";
489
+ EVENTS["NODE_DRAG_LEAVE"] = "nodeDragLeave";
490
+ EVENTS["NODE_DROP"] = "nodeDrop";
491
+ })(EVENTS || (EVENTS = {}));
492
+ var EMPTY = function EMPTY() {
493
+ return true;
494
+ };
495
+ var TreeEmitEventsType = (_TreeEmitEventsType = {}, _defineProperty(_TreeEmitEventsType, EVENTS.NODE_CLICK, EMPTY), _defineProperty(_TreeEmitEventsType, EVENTS.NODE_COLLAPSE, EMPTY), _defineProperty(_TreeEmitEventsType, EVENTS.NODE_EXPAND, EMPTY), _defineProperty(_TreeEmitEventsType, EVENTS.NODE_CHECKED, EMPTY), _defineProperty(_TreeEmitEventsType, EVENTS.NODE_DRAG_START, EMPTY), _defineProperty(_TreeEmitEventsType, EVENTS.NODE_DRAG_OVER, EMPTY), _defineProperty(_TreeEmitEventsType, EVENTS.NODE_DRAG_LEAVE, EMPTY), _defineProperty(_TreeEmitEventsType, EVENTS.NODE_DROP, EMPTY), _TreeEmitEventsType);
496
+ /**
497
+ * 节点扩展属性
498
+ */
499
+ // eslint-disable-next-line @typescript-eslint/naming-convention
500
+ var NODE_ATTRIBUTES;
501
+ (function (NODE_ATTRIBUTES) {
502
+ NODE_ATTRIBUTES["DEPTH"] = "__depth";
503
+ NODE_ATTRIBUTES["INDEX"] = "__index";
504
+ NODE_ATTRIBUTES["UUID"] = "__uuid";
505
+ NODE_ATTRIBUTES["PARENT_ID"] = "__parent_id";
506
+ NODE_ATTRIBUTES["HAS_CHILD"] = "__has_child";
507
+ NODE_ATTRIBUTES["PATH"] = "__path";
508
+ NODE_ATTRIBUTES["IS_ROOT"] = "__is_root";
509
+ NODE_ATTRIBUTES["ORDER"] = "__order";
510
+ NODE_ATTRIBUTES["IS_OPEN"] = "__is_open";
511
+ NODE_ATTRIBUTES["IS_CHECKED"] = "__is_checked";
512
+ NODE_ATTRIBUTES["IS_SELECTED"] = "__is_selected";
513
+ NODE_ATTRIBUTES["IS_ASYNC_INIT"] = "__is_async_init";
514
+ NODE_ATTRIBUTES["IS_MATCH"] = "__is_match";
515
+ NODE_ATTRIBUTES["IS_NULL"] = "__IS_NULL";
516
+ NODE_ATTRIBUTES["IS_CACHED"] = "__is_cached";
517
+ NODE_ATTRIBUTES["IS_ASYNC"] = "__is_async";
518
+ NODE_ATTRIBUTES["IS_LOADING"] = "__is_loading";
519
+ NODE_ATTRIBUTES["TREE_NODE_ATTR"] = "__attr__";
520
+ NODE_ATTRIBUTES["SOURCE_ITEM"] = "__source_item__";
521
+ })(NODE_ATTRIBUTES || (NODE_ATTRIBUTES = {}));
522
+ var NODE_SOURCE_ATTRS = (_NODE_SOURCE_ATTRS = {}, _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.IS_OPEN, 'isOpen'), _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.IS_SELECTED, 'selected'), _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.IS_MATCH, 'isMatch'), _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.HAS_CHILD, 'hasChild'), _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.IS_CHECKED, 'checked'), _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.IS_ASYNC, 'async'), _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.IS_LOADING, 'loading'), _defineProperty(_NODE_SOURCE_ATTRS, NODE_ATTRIBUTES.IS_ROOT, 'isRoot'), _NODE_SOURCE_ATTRS);
523
+ /**
524
+ * 节点点击可执行行为配置
525
+ */
526
+ var NodeContentActionEnum;
527
+ (function (NodeContentActionEnum) {
528
+ NodeContentActionEnum["CLICK"] = "click";
529
+ NodeContentActionEnum["SELECTED"] = "selected";
530
+ NodeContentActionEnum["EXPAND"] = "expand";
531
+ NodeContentActionEnum["COLLAPSE"] = "collapse";
532
+ })(NodeContentActionEnum || (NodeContentActionEnum = {}));
533
+ // EXTERNAL MODULE: external "vue-types"
534
+ var external_vue_types_ = __webpack_require__(210);
535
+ ;// CONCATENATED MODULE: ../../packages/tree/src/props.ts
536
+
537
+
538
+
539
+ var ColumnTypeEnum;
540
+ (function (ColumnTypeEnum) {
541
+ ColumnTypeEnum["ONCE"] = "once";
542
+ ColumnTypeEnum["EVERY"] = "every";
543
+ })(ColumnTypeEnum || (ColumnTypeEnum = {}));
544
+ var TreeSearchMatchEnum;
545
+ (function (TreeSearchMatchEnum) {
546
+ TreeSearchMatchEnum["FUZZY"] = "fuzzy";
547
+ TreeSearchMatchEnum["FULL"] = "full";
548
+ })(TreeSearchMatchEnum || (TreeSearchMatchEnum = {}));
549
+ var TreeSearchResultEnum;
550
+ (function (TreeSearchResultEnum) {
551
+ TreeSearchResultEnum["TREE"] = "tree";
552
+ TreeSearchResultEnum["LIST"] = "list";
553
+ })(TreeSearchResultEnum || (TreeSearchResultEnum = {}));
554
+ var treeProps = {
555
+ /**
556
+ * 渲染列表
557
+ */
558
+ data: external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.any).def([]),
559
+ /**
560
+ * 指定节点标签为节点对象的某个属性值
561
+ */
562
+ label: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.func.def(undefined), external_shared_.PropTypes.string.def('label')]),
563
+ /**
564
+ * 每个树节点用来作为唯一标识的属性,此标识应该是唯一的
565
+ * 如果设置系统会默认自动生成唯一id
566
+ */
567
+ nodeKey: external_shared_.PropTypes.string.def(undefined),
568
+ /**
569
+ * 子节点 Key, 用于读取子节点
570
+ * 默认 children
571
+ */
572
+ children: external_shared_.PropTypes.string.def('children'),
573
+ /**
574
+ * 相邻级节点间的水平缩进,单位为像素
575
+ */
576
+ indent: external_shared_.PropTypes.number.def(18),
577
+ /**
578
+ * 设置行高
579
+ */
580
+ lineHeight: external_shared_.PropTypes.number.def(32),
581
+ /**
582
+ * 设置层级连线
583
+ */
584
+ levelLine: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.bool.def(false), external_shared_.PropTypes.func.def(undefined), external_shared_.PropTypes.string.def('1px dashed #c3cdd7')]).def(false),
585
+ /**
586
+ * 是否开启虚拟滚动
587
+ * 默认虚拟滚动是开启的,数据量大的情况下有利于性能优化,可以通过设置 virtualRender = false 关闭虚拟滚动
588
+ */
589
+ virtualRender: external_shared_.PropTypes.bool.def(false),
590
+ /**
591
+ * 当前节点标识图标
592
+ * 默认 true
593
+ */
594
+ prefixIcon: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.func.def(function () {}), external_shared_.PropTypes.bool.def(false)]).def(true),
595
+ /**
596
+ * 异步加载节点数据配置
597
+ * @param callback 请求数据回调函数,函数返回 Promise
598
+ * @param cache 是否缓存请求结果,默认为True,只有在第一次才会发起请求,若设置为false则每次都会发起请求
599
+ */
600
+ async: external_shared_.PropTypes.shape({
601
+ /**
602
+ * 点击节点需要执行的异步函数
603
+ * 返回 Promise
604
+ */
605
+ callback: external_shared_.PropTypes.func.def(undefined),
606
+ /**
607
+ * 是否缓存异步请求结果
608
+ * true 只在第一次点击请求异步函数
609
+ * false 每次点击都执行异步函数
610
+ */
611
+ cache: external_shared_.PropTypes.bool.def(true),
612
+ /**
613
+ * 异步请求节点是否自动展开
614
+ * 可选值:once 只在初始化是执行一次
615
+ * every 每次数据更新都执行
616
+ */
617
+ deepAutoOpen: (0,external_vue_types_.toType)('columnType', {}).def(ColumnTypeEnum.ONCE)
618
+ }),
619
+ /**
620
+ * 每个节点偏移左侧距离
621
+ */
622
+ offsetLeft: external_shared_.PropTypes.number.def(5),
623
+ /**
624
+ * 搜索配置
625
+ * 可以为一个配置项 SearchOption
626
+ * 或者直接为一个字符串,如果直接为字符串则模糊匹配此值
627
+ */
628
+ search: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.shape({
629
+ /**
630
+ * 需要匹配的值
631
+ * */
632
+ value: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string, external_shared_.PropTypes.bool]).def(''),
633
+ /**
634
+ * 匹配方式
635
+ * 支持模糊匹配(fuzzy) || 完全匹配(full)
636
+ * 默认 模糊匹配(fuzzy)
637
+ * 支持自定义匹配函数 (searchValue, itemText, item) => true || false
638
+ */
639
+ match: external_shared_.PropTypes.oneOfType([(0,external_vue_types_.string)(), external_shared_.PropTypes.func]).def(TreeSearchMatchEnum.FUZZY),
640
+ /**
641
+ * 搜索结果如何展示
642
+ * 显示为 tree || list
643
+ * 默认 tree
644
+ */
645
+ resultType: (0,external_vue_types_.string)().def(TreeSearchResultEnum.TREE),
646
+ /**
647
+ * 默认展开所有搜索结果
648
+ */
649
+ openResultNode: external_shared_.PropTypes.bool
650
+ }), external_shared_.PropTypes.string, external_shared_.PropTypes.number, external_shared_.PropTypes.bool]).def(undefined),
651
+ emptyText: external_shared_.PropTypes.string.def('没有数据'),
652
+ draggable: external_shared_.PropTypes.bool.def(false),
653
+ disableDrag: external_shared_.PropTypes.func,
654
+ disableDrop: external_shared_.PropTypes.func,
655
+ /**
656
+ * 节点拖拽时可交换位置(开启拖拽可交换位置后将不支持改变层级)
657
+ */
658
+ dragSort: external_shared_.PropTypes.bool.def(false),
659
+ /**
660
+ * 节点是否可以选中
661
+ */
662
+ selectable: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.bool, external_shared_.PropTypes.func]).def(true),
663
+ disabledFolderSelectable: external_shared_.PropTypes.bool.def(false),
664
+ /**
665
+ * 是否支持多选
666
+ */
667
+ showCheckbox: external_shared_.PropTypes.bool.def(false),
668
+ /**
669
+ * 是否显示节点类型Icon
670
+ */
671
+ showNodeTypeIcon: external_shared_.PropTypes.bool.def(true),
672
+ /**
673
+ * 默认选中的节点id,selectable为false时无效
674
+ */
675
+ selected: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string, external_shared_.PropTypes.number, external_shared_.PropTypes.object]),
676
+ /**
677
+ * 是否自动检查当前节点是否有子节点
678
+ * 节点前面的展开收起Icon会根据判定值做改变
679
+ * 如果需要自已控制,请设置为false
680
+ */
681
+ autoCheckChildren: external_shared_.PropTypes.bool.def(true),
682
+ /**
683
+ * 如果设置了某一个叶子节点状态为展开,是否自动展开所有父级节点
684
+ * 默认为true,如果设置为false,则每层状态需要自己控制
685
+ */
686
+ autoOpenParentNode: external_shared_.PropTypes.bool.def(true),
687
+ /**
688
+ * 默认是否展开所有节点
689
+ */
690
+ expandAll: external_shared_.PropTypes.bool.def(false),
691
+ /**
692
+ * 节点内容点击行为
693
+ * 此处配置每个节点除了展开\收起箭头之外的内容块时的行为
694
+ * 默认为 ['selected', 'expand', 'click'],点击内容块为选中当前节点
695
+ */
696
+ nodeContentAction: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.arrayOf((0,external_vue_types_.toType)('nodeContentActionType', {}).def(NodeContentActionEnum.CLICK)), external_shared_.PropTypes.func.def(function () {
697
+ return ['selected'];
698
+ })]).def(['selected', 'expand', 'click']),
699
+ /**
700
+ * 是否作用域插槽抛出参数是否保持源数据的引用
701
+ * 如果设置为true,则作用域插槽参数格式为: { data: node, attributes: {} }
702
+ * 如果设置为false,则作用域插槽参数格式为: { ...node, ...attributes }
703
+ * attributes 为节点内置属性,包含节点是否展开,是否选中,是否有子节点等等
704
+ */
705
+ keepSlotData: external_shared_.PropTypes.bool.def(false)
706
+ };
707
+ // EXTERNAL MODULE: external "../exception"
708
+ var external_exception_ = __webpack_require__(9911);
709
+ var external_exception_default = /*#__PURE__*/__webpack_require__.n(external_exception_);
710
+ ;// CONCATENATED MODULE: ../../packages/tree/src/use-empty.tsx
711
+
712
+ /*
713
+ * Tencent is pleased to support the open source community by making
714
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
715
+ *
716
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
717
+ *
718
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
719
+ *
720
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
721
+ *
722
+ * ---------------------------------------------------
723
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
724
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
725
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
726
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
727
+ *
728
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
729
+ * the Software.
730
+ *
731
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
732
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
733
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
734
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
735
+ * IN THE SOFTWARE.
736
+ */
737
+
738
+ /* harmony default export */ const use_empty = (function (props, _ref) {
739
+ var slots = _ref.slots;
740
+ return {
741
+ renderEmpty: function renderEmpty(type) {
742
+ var _a, _b;
743
+ return (0,external_vue_.createVNode)((external_exception_default()), {
744
+ "scene": "part",
745
+ "type": type
746
+ }, {
747
+ "default": function _default() {
748
+ return [(_b = (_a = slots["default"]) === null || _a === void 0 ? void 0 : _a.call(slots)) !== null && _b !== void 0 ? _b : props.emptyText];
749
+ }
750
+ });
751
+ }
752
+ };
753
+ });
754
+ // EXTERNAL MODULE: external "../checkbox"
755
+ var external_checkbox_ = __webpack_require__(5800);
756
+ var external_checkbox_default = /*#__PURE__*/__webpack_require__.n(external_checkbox_);
757
+ // EXTERNAL MODULE: external "../icon"
758
+ var external_icon_ = __webpack_require__(6870);
759
+ ;// CONCATENATED MODULE: ../../packages/tree/src/use-node-attribute.tsx
760
+
761
+
762
+ /*
763
+ * Tencent is pleased to support the open source community by making
764
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
765
+ *
766
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
767
+ *
768
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
769
+ *
770
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
771
+ *
772
+ * ---------------------------------------------------
773
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
774
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
775
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
776
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
777
+ *
778
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
779
+ * the Software.
780
+ *
781
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
782
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
783
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
784
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
785
+ * IN THE SOFTWARE.
786
+ */
787
+
788
+ /* harmony default export */ const use_node_attribute = (function (flatData, props) {
789
+ /**
790
+ * 获取Schema中指定的对象值
791
+ * @param key
792
+ * @returns
793
+ */
794
+ var getSchemaVal = function getSchemaVal(key) {
795
+ return flatData.schema.get(key);
796
+ };
797
+ /**
798
+ * 获取节点属性
799
+ * @param node 当前节点
800
+ * @param attr 节点属性
801
+ * @returns
802
+ */
803
+ var getNodeAttr = function getNodeAttr(node, attr) {
804
+ var _a;
805
+ return (_a = getSchemaVal(node[NODE_ATTRIBUTES.UUID])) === null || _a === void 0 ? void 0 : _a[attr];
806
+ };
807
+ /**
808
+ * 设置节点属性
809
+ * @param node 指定节点
810
+ * @param attr 节点属性
811
+ * @param val 属性值
812
+ * @returns
813
+ */
814
+ var setNodeAttr = function setNodeAttr(node, attr, val) {
815
+ flatData.schema.set(node[NODE_ATTRIBUTES.UUID], Object.assign(Object.assign({}, getSchemaVal(node[NODE_ATTRIBUTES.UUID])), _defineProperty({}, attr, val)));
816
+ };
817
+ var getNodePath = function getNodePath(node) {
818
+ return getNodeAttr(node, NODE_ATTRIBUTES.PATH);
819
+ };
820
+ var getNodeId = function getNodeId(node) {
821
+ return getNodeAttr(node, NODE_ATTRIBUTES.UUID);
822
+ };
823
+ var isRootNode = function isRootNode(node) {
824
+ return getNodeAttr(node, NODE_ATTRIBUTES.IS_ROOT);
825
+ };
826
+ var isNodeOpened = function isNodeOpened(node) {
827
+ return getNodeAttr(node, NODE_ATTRIBUTES.IS_OPEN);
828
+ };
829
+ var hasChildNode = function hasChildNode(node) {
830
+ return getNodeAttr(node, NODE_ATTRIBUTES.HAS_CHILD);
831
+ };
832
+ var isNodeMatched = function isNodeMatched(node) {
833
+ return getNodeAttr(node, NODE_ATTRIBUTES.IS_MATCH);
834
+ };
835
+ var isNodeChecked = function isNodeChecked(node) {
836
+ return getNodeAttr(node, NODE_ATTRIBUTES.IS_CHECKED);
837
+ };
838
+ var getNodeParentId = function getNodeParentId(node) {
839
+ return getNodeAttr(node, NODE_ATTRIBUTES.PARENT_ID);
840
+ };
841
+ var getNodeParentIdById = function getNodeParentIdById(id) {
842
+ return getNodeAttr(_defineProperty({}, NODE_ATTRIBUTES.UUID, id), NODE_ATTRIBUTES.PARENT_ID);
843
+ };
844
+ var isNodeLoading = function isNodeLoading(node) {
845
+ return getNodeAttr(node, NODE_ATTRIBUTES.IS_LOADING);
846
+ };
847
+ var setTreeNodeLoading = function setTreeNodeLoading(node, value) {
848
+ setNodeAttr(node, NODE_ATTRIBUTES.IS_LOADING, value);
849
+ };
850
+ var deleteNodeSchema = function deleteNodeSchema(id) {
851
+ return flatData.schema["delete"](id);
852
+ };
853
+ var getParentNode = function getParentNode(node) {
854
+ return getSchemaVal(getNodeParentId(node));
855
+ };
856
+ /**
857
+ * 判定指定节点是否为展开状态
858
+ * @param item 节点或者节点 UUID
859
+ * @returns
860
+ */
861
+ var isItemOpen = function isItemOpen(item) {
862
+ var _a;
863
+ if (_typeof(item) === 'object') {
864
+ return isNodeOpened(item);
865
+ }
866
+ if (typeof item === 'string') {
867
+ return (_a = getSchemaVal(item)) === null || _a === void 0 ? void 0 : _a[NODE_ATTRIBUTES.IS_OPEN];
868
+ }
869
+ return false;
870
+ };
871
+ var isParentNodeOpened = function isParentNodeOpened(node) {
872
+ return isItemOpen(getNodeAttr(node, NODE_ATTRIBUTES.PARENT_ID));
873
+ };
874
+ /**
875
+ * 过滤当前状态为Open的节点
876
+ * 页面展示只会展示Open的节点
877
+ * @param item
878
+ * @returns
879
+ */
880
+ var checkNodeIsOpen = function checkNodeIsOpen(node) {
881
+ return isRootNode(node) || isParentNodeOpened(node);
882
+ };
883
+ /**
884
+ * 根据节点path返回源数据中节点信息
885
+ * @param path
886
+ * @returns
887
+ */
888
+ var getSourceNodeByPath = function getSourceNodeByPath(path, uid) {
889
+ var paths = path.split('-');
890
+ var target = paths.reduce(function (pre, nodeIndex) {
891
+ var index = Number(nodeIndex);
892
+ return Array.isArray(pre) ? pre[index] : pre[props.children][index];
893
+ }, props.data);
894
+ if (uid) {
895
+ Object.assign(target, _defineProperty({}, NODE_ATTRIBUTES.UUID, uid));
896
+ }
897
+ return target;
898
+ };
899
+ var getChildNodes = function getChildNodes(node) {
900
+ var source = flatData.schema;
901
+ return Array.prototype.filter.call(Array.from(source.keys()), function (key) {
902
+ return source.get(key)[NODE_ATTRIBUTES.PARENT_ID] === node[NODE_ATTRIBUTES.UUID];
903
+ });
904
+ };
905
+ var getSourceNodeByUID = function getSourceNodeByUID(uid) {
906
+ return getSourceNodeByPath(getNodePath(_defineProperty({}, NODE_ATTRIBUTES.UUID, uid)), uid);
907
+ };
908
+ var getParentNodeData = function getParentNodeData(uid) {
909
+ if (isRootNode(_defineProperty({}, NODE_ATTRIBUTES.UUID, uid))) {
910
+ return _defineProperty({}, props.children, props.data);
911
+ }
912
+ return getSourceNodeByUID(getNodeParentIdById(uid));
913
+ };
914
+ /**
915
+ * 处理scoped slot 透传数据
916
+ * @param item 当前节点数据
917
+ * @returns
918
+ */
919
+ var resolveScopedSlotParam = function resolveScopedSlotParam(item) {
920
+ var _ref2;
921
+ return _ref2 = {}, _defineProperty(_ref2, NODE_SOURCE_ATTRS[NODE_ATTRIBUTES.IS_LOADING], getNodeAttr(item, NODE_ATTRIBUTES.IS_LOADING)), _defineProperty(_ref2, NODE_SOURCE_ATTRS[NODE_ATTRIBUTES.HAS_CHILD], hasChildNode(item)), _defineProperty(_ref2, NODE_SOURCE_ATTRS[NODE_ATTRIBUTES.IS_MATCH], isNodeMatched(item)), _defineProperty(_ref2, NODE_SOURCE_ATTRS[NODE_ATTRIBUTES.IS_CHECKED], isNodeChecked(item)), _defineProperty(_ref2, NODE_SOURCE_ATTRS[NODE_ATTRIBUTES.IS_OPEN], isNodeOpened(item)), _defineProperty(_ref2, NODE_SOURCE_ATTRS[NODE_ATTRIBUTES.IS_ROOT], isRootNode(item)), _defineProperty(_ref2, "fullPath", getNodeAttr(item, NODE_ATTRIBUTES.PATH)), _defineProperty(_ref2, "uuid", getNodeId(item)), _defineProperty(_ref2, "parentId", getNodeAttr(item, NODE_ATTRIBUTES.PARENT_ID)), _ref2;
922
+ };
923
+ var extendNodeAttr = function extendNodeAttr(item) {
924
+ return Object.assign(Object.assign({}, getNodeAttr(item, NODE_ATTRIBUTES.SOURCE_ITEM)), _defineProperty({}, NODE_ATTRIBUTES.TREE_NODE_ATTR, resolveScopedSlotParam(item)));
925
+ };
926
+ var extendNodeScopedData = function extendNodeScopedData(item) {
927
+ return {
928
+ data: getNodeAttr(item, NODE_ATTRIBUTES.SOURCE_ITEM),
929
+ attributes: resolveScopedSlotParam(item)
930
+ };
931
+ };
932
+ return {
933
+ getSchemaVal: getSchemaVal,
934
+ getNodeAttr: getNodeAttr,
935
+ getNodeId: getNodeId,
936
+ getNodeParentId: getNodeParentId,
937
+ getNodeParentIdById: getNodeParentIdById,
938
+ getParentNodeData: getParentNodeData,
939
+ getParentNode: getParentNode,
940
+ setNodeAttr: setNodeAttr,
941
+ getNodePath: getNodePath,
942
+ isRootNode: isRootNode,
943
+ isNodeOpened: isNodeOpened,
944
+ hasChildNode: hasChildNode,
945
+ isItemOpen: isItemOpen,
946
+ isNodeChecked: isNodeChecked,
947
+ isNodeMatched: isNodeMatched,
948
+ isNodeLoading: isNodeLoading,
949
+ checkNodeIsOpen: checkNodeIsOpen,
950
+ getSourceNodeByPath: getSourceNodeByPath,
951
+ getSourceNodeByUID: getSourceNodeByUID,
952
+ deleteNodeSchema: deleteNodeSchema,
953
+ resolveScopedSlotParam: resolveScopedSlotParam,
954
+ setTreeNodeLoading: setTreeNodeLoading,
955
+ extendNodeAttr: extendNodeAttr,
956
+ getChildNodes: getChildNodes,
957
+ extendNodeScopedData: extendNodeScopedData
958
+ };
959
+ });
960
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
961
+ function _arrayLikeToArray(arr, len) {
962
+ if (len == null || len > arr.length) len = arr.length;
963
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
964
+ return arr2;
965
+ }
966
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
967
+
968
+ function _arrayWithoutHoles(arr) {
969
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
970
+ }
971
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
972
+ function _iterableToArray(iter) {
973
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
974
+ }
975
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
976
+
977
+ function _unsupportedIterableToArray(o, minLen) {
978
+ if (!o) return;
979
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
980
+ var n = Object.prototype.toString.call(o).slice(8, -1);
981
+ if (n === "Object" && o.constructor) n = o.constructor.name;
982
+ if (n === "Map" || n === "Set") return Array.from(o);
983
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
984
+ }
985
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
986
+ function _nonIterableSpread() {
987
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
988
+ }
989
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
990
+
991
+
992
+
993
+
994
+ function _toConsumableArray(arr) {
995
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
996
+ }
997
+ ;// CONCATENATED MODULE: ../../packages/tree/src/util.ts
998
+
999
+
1000
+
1001
+ var _this = undefined;
1002
+ /*
1003
+ * Tencent is pleased to support the open source community by making
1004
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1005
+ *
1006
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1007
+ *
1008
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1009
+ *
1010
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1011
+ *
1012
+ * ---------------------------------------------------
1013
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1014
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1015
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1016
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1017
+ *
1018
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1019
+ * the Software.
1020
+ *
1021
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1022
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1023
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1024
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1025
+ * IN THE SOFTWARE.
1026
+ */
1027
+
1028
+
1029
+ var DEFAULT_LEVLE_LINE = '1px dashed #c3cdd7';
1030
+ /**
1031
+ * 获取配置项可为Bool|String|Function类型,如果为Bool则配置默认值
1032
+ * @param props
1033
+ * @param key
1034
+ * @param item
1035
+ * @param defaultTrueValue
1036
+ * @param defaultFalseValue
1037
+ * @returns
1038
+ */
1039
+ var getPropsOneOfBoolValueWithDefault = function getPropsOneOfBoolValueWithDefault(props, key) {
1040
+ var item = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1041
+ var defaultTrueValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1042
+ var defaultFalseValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1043
+ var args = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
1044
+ var prop = props[key];
1045
+ if (typeof prop === 'boolean') {
1046
+ return prop ? defaultTrueValue : defaultFalseValue;
1047
+ }
1048
+ return getStringOrFuncStr(item, props, key, args);
1049
+ };
1050
+ /**
1051
+ * 处理Props中用户给定的配置项(返回值为String或者Function)
1052
+ * @param item 当前渲染数据(当item为Object时,返回当前Object中通过Props指定Key的Value,否则返回Props中指定的值)
1053
+ * @param props Props
1054
+ * @param key 配置项关键字
1055
+ * @param args 其他参数
1056
+ * @returns
1057
+ */
1058
+ var getStringOrFuncStr = function getStringOrFuncStr(item, props, key) {
1059
+ var args = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
1060
+ var value = props[key];
1061
+ if (typeof value === 'string') {
1062
+ if (_typeof(item) === 'object' && item !== null) {
1063
+ if (!Object.prototype.hasOwnProperty.call(item, value)) {
1064
+ console.error("cannot find node label with key ".concat(value));
1065
+ }
1066
+ return item[value];
1067
+ }
1068
+ return value;
1069
+ }
1070
+ if (typeof value === 'function') {
1071
+ var txt = value.apply(_this, [item].concat(_toConsumableArray(args)));
1072
+ if (typeof txt === 'string') {
1073
+ return txt;
1074
+ }
1075
+ console.error('props label with function return value is not string, please check and return string');
1076
+ return undefined;
1077
+ }
1078
+ return undefined;
1079
+ };
1080
+ /**
1081
+ * 获取当前节点显示Label
1082
+ * @param item 当前节点
1083
+ * @param props Props
1084
+ */
1085
+ var getLabel = function getLabel(item, props) {
1086
+ return getStringOrFuncStr(item, props, 'label');
1087
+ };
1088
+ var getSchemaVal = function getSchemaVal(schema, uuid) {
1089
+ return schema.get(uuid) || {};
1090
+ };
1091
+ var getNodeAttr = function getNodeAttr(schema, uuid, key) {
1092
+ var _a;
1093
+ return (_a = getSchemaVal(schema, uuid)) === null || _a === void 0 ? void 0 : _a[key];
1094
+ };
1095
+ /**
1096
+ * 根据Props获取Tree样式设置
1097
+ * @param item
1098
+ * @param props
1099
+ * @returns
1100
+ */
1101
+ var getTreeStyle = function getTreeStyle(item, props) {
1102
+ // 处理Props回调函数,参数 [tree] 表示 levelLine 回调参数第二个,此次渲染请求为Tree外层样式
1103
+ var levelLine = getPropsOneOfBoolValueWithDefault(props, 'levelLine', item, DEFAULT_LEVLE_LINE, null, ['tree']);
1104
+ return {
1105
+ '--level-line': levelLine,
1106
+ '--lineHeight': "".concat(props.lineHeight, "px"),
1107
+ '--indent': "".concat(props.indent, "px"),
1108
+ '--offset-left': "".concat(props.offsetLeft, "px")
1109
+ };
1110
+ };
1111
+ /**
1112
+ * 获取节点样式配置
1113
+ * @param item
1114
+ * @param props
1115
+ * @returns
1116
+ */
1117
+ var getNodeItemStyle = function getNodeItemStyle(item, props) {
1118
+ var flatData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1119
+ var schema = flatData.schema;
1120
+ var depth = getNodeAttr(schema, item[NODE_ATTRIBUTES.UUID], NODE_ATTRIBUTES.DEPTH);
1121
+ return Object.assign({
1122
+ '--depth': depth
1123
+ }, typeof props.levelLine === 'function' ? {
1124
+ '--level-line': getPropsOneOfBoolValueWithDefault(props, 'levelLine', item, DEFAULT_LEVLE_LINE, null, ['node'])
1125
+ } : {});
1126
+ };
1127
+ /**
1128
+ * 获取当前渲染节点Class List
1129
+ * @param item
1130
+ * @returns
1131
+ */
1132
+ var getNodeItemClass = function getNodeItemClass(item, schema, props) {
1133
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1134
+ var _ref = getSchemaVal(schema, item[NODE_ATTRIBUTES.UUID]) || {},
1135
+ __is_root = _ref.__is_root,
1136
+ __is_open = _ref.__is_open;
1137
+ return {
1138
+ 'is-root': __is_root,
1139
+ 'bk-tree-node': true,
1140
+ 'is-open': __is_open,
1141
+ 'is-virtual-render': props.virtualRender,
1142
+ 'level-line': props.levelLine
1143
+ };
1144
+ };
1145
+ /**
1146
+ * 获取当前渲染节点Class List
1147
+ * @param item
1148
+ * @returns
1149
+ */
1150
+ var getNodeRowClass = function getNodeRowClass(item, schema) {
1151
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1152
+ var _ref2 = getSchemaVal(schema, item[NODE_ATTRIBUTES.UUID]) || {},
1153
+ __is_checked = _ref2.__is_checked,
1154
+ __is_selected = _ref2.__is_selected;
1155
+ return _defineProperty({
1156
+ 'is-checked': __is_checked,
1157
+ 'is-selected': __is_selected,
1158
+ 'node-folder': item.is_folder,
1159
+ 'node-leaf': item.is_leaf
1160
+ }, (0,external_shared_.resolveClassName)('node-row'), true);
1161
+ };
1162
+ /**
1163
+ * 根据路径更新指定节点Child-Data
1164
+ * @param path 节点路径
1165
+ * @param treeData Tree Data
1166
+ * @param childKey Child Key
1167
+ * @param nodekey 节点key
1168
+ * @param nodeValue 节点值
1169
+ */
1170
+ var updateTreeNode = function updateTreeNode(path, treeData, childKey, nodekey, nodeValue) {
1171
+ assignTreeNode(path, treeData, childKey, _defineProperty({}, nodekey, nodeValue));
1172
+ };
1173
+ /**
1174
+ * 根据路径更新指定节点Child-Data
1175
+ * @param path 节点路径
1176
+ * @param treeData Tree Data
1177
+ * @param childKey Child Key
1178
+ * @param assignVal value
1179
+ */
1180
+ var assignTreeNode = function assignTreeNode(path, treeData, childKey, assignVal) {
1181
+ var paths = path.split('-');
1182
+ var targetNode = paths.reduce(function (pre, nodeIndex) {
1183
+ var index = Number(nodeIndex);
1184
+ return Array.isArray(pre) ? pre[index] : pre[childKey][index];
1185
+ }, treeData);
1186
+ Object.assign(targetNode, assignVal || {});
1187
+ };
1188
+ var resolveNodeItem = function resolveNodeItem(node) {
1189
+ if (node === undefined || node === null) {
1190
+ return {
1191
+ __IS_NULL: true
1192
+ };
1193
+ }
1194
+ if (typeof node === 'string' || typeof node === 'number' || _typeof(node) === 'symbol') {
1195
+ return _defineProperty({}, NODE_ATTRIBUTES.UUID, node);
1196
+ }
1197
+ if (Object.prototype.hasOwnProperty.call(node, NODE_ATTRIBUTES.UUID)) {
1198
+ return node;
1199
+ }
1200
+ console.error('setNodeAction Error: node id cannot found');
1201
+ return node;
1202
+ };
1203
+ ;// CONCATENATED MODULE: ../../packages/tree/src/use-node-async.tsx
1204
+
1205
+ /*
1206
+ * Tencent is pleased to support the open source community by making
1207
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1208
+ *
1209
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1210
+ *
1211
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1212
+ *
1213
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1214
+ *
1215
+ * ---------------------------------------------------
1216
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1217
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1218
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1219
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1220
+ *
1221
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1222
+ * the Software.
1223
+ *
1224
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1225
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1226
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1227
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1228
+ * IN THE SOFTWARE.
1229
+ */
1230
+
1231
+
1232
+
1233
+ ;
1234
+ /* harmony default export */ const use_node_async = (function (props, flatData) {
1235
+ var _useNodeAttribute = use_node_attribute(flatData, props),
1236
+ setNodeAttr = _useNodeAttribute.setNodeAttr,
1237
+ getNodePath = _useNodeAttribute.getNodePath,
1238
+ getNodeAttr = _useNodeAttribute.getNodeAttr,
1239
+ resolveScopedSlotParam = _useNodeAttribute.resolveScopedSlotParam,
1240
+ setTreeNodeLoading = _useNodeAttribute.setTreeNodeLoading;
1241
+ /**
1242
+ * 处理异步加载节点数据返回结果
1243
+ * @param resp 异步请求返回结果
1244
+ * @param item 当前节点
1245
+ */
1246
+ var setNodeRemoteLoad = function setNodeRemoteLoad(resp, item) {
1247
+ if (_typeof(resp) === 'object' && resp !== null) {
1248
+ setNodeAttr(item, NODE_ATTRIBUTES.IS_OPEN, true);
1249
+ var nodeValue = Array.isArray(resp) ? resp : [resp];
1250
+ updateTreeNode(getNodePath(item), props.data, props.children, props.children, nodeValue);
1251
+ return Promise.resolve(resp);
1252
+ }
1253
+ return Promise.resolve(resp);
1254
+ };
1255
+ var asyncNodeClick = function asyncNodeClick(item) {
1256
+ var _ref = props.async || {},
1257
+ _ref$callback = _ref.callback,
1258
+ callback = _ref$callback === void 0 ? null : _ref$callback,
1259
+ _ref$cache = _ref.cache,
1260
+ cache = _ref$cache === void 0 ? true : _ref$cache;
1261
+ /** 如果是异步请求加载 */
1262
+ if (typeof callback === 'function' && getNodeAttr(item, NODE_ATTRIBUTES.IS_ASYNC)) {
1263
+ /** 用于注释当前节点是否已经初始化过 */
1264
+ setNodeAttr(item, NODE_ATTRIBUTES.IS_ASYNC_INIT, true);
1265
+ if (!getNodeAttr(item, NODE_ATTRIBUTES.IS_CACHED)) {
1266
+ setNodeAttr(item, NODE_ATTRIBUTES.IS_CACHED, cache);
1267
+ var dataAttr = resolveScopedSlotParam(item);
1268
+ var callbackResult = callback(item, function (resp) {
1269
+ return setNodeRemoteLoad(resp, item);
1270
+ }, dataAttr);
1271
+ if (_typeof(callbackResult) === 'object' && callbackResult !== null) {
1272
+ setTreeNodeLoading(item, true);
1273
+ if (callbackResult instanceof Promise) {
1274
+ return Promise.resolve(callbackResult.then(function (resp) {
1275
+ return setNodeRemoteLoad(resp, item);
1276
+ })["catch"](function (err) {
1277
+ return console.error('load remote data error:', err);
1278
+ })["finally"](function () {
1279
+ setTreeNodeLoading(item, false);
1280
+ setNodeAttr(item, NODE_ATTRIBUTES.IS_CACHED, true);
1281
+ }));
1282
+ }
1283
+ setNodeRemoteLoad(callbackResult, item);
1284
+ setTreeNodeLoading(item, false);
1285
+ return Promise.resolve(true);
1286
+ }
1287
+ }
1288
+ return Promise.resolve(true);
1289
+ }
1290
+ return Promise.resolve(true);
1291
+ };
1292
+ var deepAutoOpen = function deepAutoOpen() {
1293
+ /** 过滤节点为异步加载 & 默认为展开 & 没有初始化过的节点 */
1294
+ var autoOpenNodes = flatData.data.filter(function (item) {
1295
+ return getNodeAttr(item, NODE_ATTRIBUTES.IS_ASYNC) && item[NODE_SOURCE_ATTRS[NODE_ATTRIBUTES.IS_OPEN]] && !getNodeAttr(item, NODE_ATTRIBUTES.IS_ASYNC_INIT);
1296
+ });
1297
+ if (autoOpenNodes.length) {
1298
+ Promise.all(autoOpenNodes.map(function (item) {
1299
+ return asyncNodeClick(item);
1300
+ })).then(function () {
1301
+ deepAutoOpen();
1302
+ })["catch"](function (err) {
1303
+ console.warn(err);
1304
+ });
1305
+ }
1306
+ };
1307
+ return {
1308
+ asyncNodeClick: asyncNodeClick,
1309
+ deepAutoOpen: deepAutoOpen
1310
+ };
1311
+ });
1312
+ ;// CONCATENATED MODULE: ../../packages/tree/src/use-node-action.tsx
1313
+
1314
+
1315
+ var use_node_action_this = undefined;
1316
+
1317
+ /*
1318
+ * Tencent is pleased to support the open source community by making
1319
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1320
+ *
1321
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1322
+ *
1323
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1324
+ *
1325
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1326
+ *
1327
+ * ---------------------------------------------------
1328
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1329
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1330
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1331
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1332
+ *
1333
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1334
+ * the Software.
1335
+ *
1336
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1337
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1338
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1339
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1340
+ * IN THE SOFTWARE.
1341
+ */
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+ /* harmony default export */ const use_node_action = (function (props, ctx, flatData, _renderData, schemaValues, initOption) {
1351
+ // const checkedNodes = [];
1352
+ var selectedNodeId = props.selected;
1353
+ var _useNodeAttribute = use_node_attribute(flatData, props),
1354
+ setNodeAttr = _useNodeAttribute.setNodeAttr,
1355
+ getNodePath = _useNodeAttribute.getNodePath,
1356
+ getSchemaVal = _useNodeAttribute.getSchemaVal,
1357
+ getNodeAttr = _useNodeAttribute.getNodeAttr,
1358
+ getNodeId = _useNodeAttribute.getNodeId,
1359
+ getChildNodes = _useNodeAttribute.getChildNodes,
1360
+ isRootNode = _useNodeAttribute.isRootNode,
1361
+ hasChildNode = _useNodeAttribute.hasChildNode,
1362
+ isItemOpen = _useNodeAttribute.isItemOpen,
1363
+ isNodeOpened = _useNodeAttribute.isNodeOpened,
1364
+ isNodeLoading = _useNodeAttribute.isNodeLoading,
1365
+ isNodeChecked = _useNodeAttribute.isNodeChecked,
1366
+ getParentNode = _useNodeAttribute.getParentNode,
1367
+ resolveScopedSlotParam = _useNodeAttribute.resolveScopedSlotParam,
1368
+ extendNodeAttr = _useNodeAttribute.extendNodeAttr,
1369
+ extendNodeScopedData = _useNodeAttribute.extendNodeScopedData;
1370
+ var _usePrefix = (0,external_config_provider_.usePrefix)(),
1371
+ resolveClassName = _usePrefix.resolveClassName;
1372
+ var registerNextLoop = initOption.registerNextLoop;
1373
+ var _useNodeAsync = use_node_async(props, flatData),
1374
+ asyncNodeClick = _useNodeAsync.asyncNodeClick,
1375
+ deepAutoOpen = _useNodeAsync.deepAutoOpen;
1376
+ /**
1377
+ * 根据当前节点状态获取节点类型Icon
1378
+ * @param item
1379
+ * @returns
1380
+ */
1381
+ var getRootIcon = function getRootIcon(item) {
1382
+ return isItemOpen(item) ? (0,external_vue_.createVNode)(external_icon_.FolderShapeOpen, {
1383
+ "class": [resolveClassName('tree-icon'), resolveClassName('node-prefix')]
1384
+ }, null) : (0,external_vue_.createVNode)(external_icon_.Folder, {
1385
+ "class": [resolveClassName('tree-icon'), resolveClassName('node-prefix')]
1386
+ }, null);
1387
+ };
1388
+ /**
1389
+ * 渲染动态设置的节点样式
1390
+ * @param val
1391
+ * @returns
1392
+ */
1393
+ var renderPrefixVal = function renderPrefixVal(val) {
1394
+ if (typeof val === 'string') {
1395
+ return val;
1396
+ }
1397
+ if (_typeof(val) === 'object' && val !== null) {
1398
+ if (val.__v_isVNode) {
1399
+ return val;
1400
+ }
1401
+ var node = val.node,
1402
+ className = val.className,
1403
+ text = val.text,
1404
+ style = val.style;
1405
+ return (0,external_vue_.h)(node, {
1406
+ "class": className,
1407
+ style: style
1408
+ }, text);
1409
+ }
1410
+ return null;
1411
+ };
1412
+ var getLoadingIcon = function getLoadingIcon(item) {
1413
+ var _a, _b, _c;
1414
+ return ((_c = (_b = (_a = ctx.slots).nodeLoading) === null || _b === void 0 ? void 0 : _b.call(_a, getScopedSlotData(item))) !== null && _c !== void 0 ? _c : isNodeLoading(item)) ? (0,external_vue_.createVNode)(external_icon_.Spinner, null, null) : '';
1415
+ };
1416
+ /**
1417
+ * 根据节点状态获取节点操作Icon
1418
+ * @param item
1419
+ * @returns
1420
+ */
1421
+ var getActionIcon = function getActionIcon(item) {
1422
+ if (ctx.slots.nodeAction) {
1423
+ return ctx.slots.nodeAction(getScopedSlotData(item));
1424
+ }
1425
+ var prefixFnVal = null;
1426
+ if (isNodeLoading(item)) {
1427
+ return getLoadingIcon(item);
1428
+ }
1429
+ if (typeof props.prefixIcon === 'function') {
1430
+ prefixFnVal = props.prefixIcon(getScopedSlotData(item), 'node_action');
1431
+ if (prefixFnVal !== 'default') {
1432
+ return renderPrefixVal(prefixFnVal);
1433
+ }
1434
+ }
1435
+ if (prefixFnVal === 'default' || typeof props.prefixIcon === 'boolean' && props.prefixIcon) {
1436
+ if (hasChildNode(item) || item.async || !props.autoCheckChildren) {
1437
+ return isItemOpen(item) ? (0,external_vue_.createVNode)(external_icon_.DownShape, {
1438
+ "class": resolveClassName('node-prefix')
1439
+ }, null) : (0,external_vue_.createVNode)(external_icon_.RightShape, {
1440
+ "class": resolveClassName('node-prefix')
1441
+ }, null);
1442
+ }
1443
+ }
1444
+ return null;
1445
+ };
1446
+ /**
1447
+ * 获取节点类型Icon
1448
+ * @param item
1449
+ * @returns
1450
+ */
1451
+ var getNodePrefixIcon = function getNodePrefixIcon(item) {
1452
+ if (!props.showNodeTypeIcon) {
1453
+ return null;
1454
+ }
1455
+ if (ctx.slots.nodeType) {
1456
+ return ctx.slots.nodeType(getScopedSlotData(item));
1457
+ }
1458
+ var prefixFnVal = null;
1459
+ if (typeof props.prefixIcon === 'function') {
1460
+ prefixFnVal = props.prefixIcon(getScopedSlotData(item), 'node_type');
1461
+ if (prefixFnVal !== 'default') {
1462
+ return renderPrefixVal(prefixFnVal);
1463
+ }
1464
+ }
1465
+ if (prefixFnVal === 'default' || typeof props.prefixIcon === 'boolean' && props.prefixIcon) {
1466
+ return isRootNode(item) || hasChildNode(item) ? getRootIcon(item) : (0,external_vue_.createVNode)(external_icon_.TextFile, {
1467
+ "class": [resolveClassName('tree-icon'), resolveClassName('node-prefix')]
1468
+ }, null);
1469
+ }
1470
+ return null;
1471
+ };
1472
+ var updateParentChecked = function updateParentChecked(item, isChecked) {
1473
+ var parent = getParentNode(item);
1474
+ if (parent) {
1475
+ setNodeAttr(parent, NODE_ATTRIBUTES.IS_CHECKED, isChecked);
1476
+ if (!isRootNode(parent)) {
1477
+ updateParentChecked(parent, isChecked);
1478
+ }
1479
+ }
1480
+ };
1481
+ var deepUpdateChildNode = function deepUpdateChildNode(node, attr, value) {
1482
+ getChildNodes(node).forEach(function (id) {
1483
+ setNodeAttr(_defineProperty({}, NODE_ATTRIBUTES.UUID, id), attr, value);
1484
+ deepUpdateChildNode(_defineProperty({}, NODE_ATTRIBUTES.UUID, id), attr, value);
1485
+ });
1486
+ };
1487
+ var handleNodeItemCheckboxChange = function handleNodeItemCheckboxChange(item, value) {
1488
+ setNodeAttr(item, NODE_ATTRIBUTES.IS_CHECKED, !!value);
1489
+ deepUpdateChildNode(item, NODE_ATTRIBUTES.IS_CHECKED, !!value);
1490
+ updateParentChecked(item, value);
1491
+ ctx.emit(EVENTS.NODE_CHECKED, schemaValues.value.filter(function (t) {
1492
+ return isNodeChecked(t);
1493
+ }).map(function (n) {
1494
+ return n[NODE_ATTRIBUTES.UUID];
1495
+ }));
1496
+ };
1497
+ var isIndeterminate = function isIndeterminate(item) {
1498
+ return isNodeChecked(item) && !schemaValues.value.filter(function (node) {
1499
+ var _a;
1500
+ return (_a = getNodePath(node)) === null || _a === void 0 ? void 0 : _a.startsWith(getNodePath(item));
1501
+ }).every(function (filterNode) {
1502
+ return isNodeChecked(filterNode);
1503
+ });
1504
+ };
1505
+ var isNodeItemChecked = function isNodeItemChecked(item) {
1506
+ return isNodeChecked(item) || schemaValues.value.filter(function (node) {
1507
+ var _a;
1508
+ return (_a = getNodePath(node)) === null || _a === void 0 ? void 0 : _a.startsWith(getNodePath(item));
1509
+ }).some(function (filterNode) {
1510
+ return isNodeChecked(filterNode);
1511
+ });
1512
+ };
1513
+ var getCheckboxRender = function getCheckboxRender(item) {
1514
+ if (!props.showCheckbox) {
1515
+ return null;
1516
+ }
1517
+ return (0,external_vue_.createVNode)((external_checkbox_default()), {
1518
+ "size": "small",
1519
+ "modelValue": isNodeItemChecked(item),
1520
+ "indeterminate": isIndeterminate(item),
1521
+ "onChange": function onChange(val) {
1522
+ return handleNodeItemCheckboxChange(item, !!val);
1523
+ }
1524
+ }, null);
1525
+ };
1526
+ /**
1527
+ * 设置指定节点是否展开
1528
+ * @param item
1529
+ * @param isOpen
1530
+ */
1531
+ var setNodeOpened = function setNodeOpened(item) {
1532
+ var isOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1533
+ var e = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1534
+ var fireEmit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
1535
+ var newVal = isOpen === null ? !isItemOpen(item) : !!isOpen;
1536
+ /**
1537
+ * 在收起节点时需要重置当前节点的所有叶子节点状态为 __isOpen = false
1538
+ * 如果是需要点击当前节点展开所有叶子节点此处也可以打开
1539
+ */
1540
+ if (!newVal) {
1541
+ deepUpdateChildNode(item, NODE_ATTRIBUTES.IS_OPEN, newVal);
1542
+ }
1543
+ setNodeAttr(item, NODE_ATTRIBUTES.IS_OPEN, newVal);
1544
+ if (fireEmit) {
1545
+ var emitEvent = isItemOpen(item) ? EVENTS.NODE_EXPAND : EVENTS.NODE_COLLAPSE;
1546
+ var source = getNodeAttr(item, NODE_ATTRIBUTES.SOURCE_ITEM);
1547
+ ctx.emit(emitEvent, source, resolveScopedSlotParam(item), getSchemaVal(item[NODE_ATTRIBUTES.UUID]), e);
1548
+ }
1549
+ };
1550
+ /**
1551
+ * 设置指定节点行为 checked isOpen
1552
+ * @param args
1553
+ * @param action
1554
+ * @param value
1555
+ * @returns
1556
+ */
1557
+ var setNodeAction = function setNodeAction(args, action, value) {
1558
+ if (Array.isArray(args)) {
1559
+ args.forEach(function (node) {
1560
+ return setNodeAttr(resolveNodeItem(node), action, value);
1561
+ });
1562
+ return;
1563
+ }
1564
+ setNodeAttr(resolveNodeItem(args), action, value);
1565
+ };
1566
+ /**
1567
+ * 指定节点展开
1568
+ * @param item 节点数据 | Node Id
1569
+ * @param isOpen 是否展开
1570
+ * @param autoOpenParents 如果是 isOpen = true,是否自动设置所有父级展开
1571
+ * @returns
1572
+ */
1573
+ var setOpen = function setOpen(item) {
1574
+ var isOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1575
+ var autoOpenParents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1576
+ var resolvedItem = resolveNodeItem(item);
1577
+ if (resolvedItem[NODE_ATTRIBUTES.IS_NULL]) {
1578
+ return;
1579
+ }
1580
+ if (autoOpenParents) {
1581
+ if (isOpen) {
1582
+ setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, true);
1583
+ if (!isRootNode(resolvedItem)) {
1584
+ var parentId = getNodeAttr(resolvedItem, NODE_ATTRIBUTES.PARENT_ID);
1585
+ setOpen(parentId, true, true);
1586
+ }
1587
+ } else {
1588
+ setNodeOpened(resolvedItem, false, null, false);
1589
+ }
1590
+ } else {
1591
+ setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, isOpen);
1592
+ }
1593
+ };
1594
+ /**
1595
+ * 节点点击
1596
+ * @param item
1597
+ */
1598
+ var handleTreeNodeClick = function handleTreeNodeClick(item, e) {
1599
+ var isOpen = isNodeOpened(item);
1600
+ if (isOpen) {
1601
+ setNodeOpened(item, false, e);
1602
+ return;
1603
+ }
1604
+ /** 如果是异步请求加载 */
1605
+ asyncNodeClick(item)["finally"](function () {
1606
+ if (getNodeAttr(item, NODE_ATTRIBUTES.IS_LOADING)) {
1607
+ registerNextLoop('setNodeOpenedAfterLoading', {
1608
+ type: 'once',
1609
+ fn: function fn() {
1610
+ return setNodeOpened(item, true, e);
1611
+ }
1612
+ });
1613
+ } else {
1614
+ setNodeOpened(item, true, e);
1615
+ }
1616
+ });
1617
+ };
1618
+ /**
1619
+ * 点击树形节点展开、收起图标处理事件
1620
+ * @param e 鼠标事件
1621
+ * @param node 当前节点
1622
+ */
1623
+ var handleNodeActionClick = function handleNodeActionClick(e, node) {
1624
+ e.stopImmediatePropagation();
1625
+ e.stopPropagation();
1626
+ e.preventDefault();
1627
+ handleTreeNodeClick(node, e);
1628
+ };
1629
+ var setSelect = function setSelect(uuid) {
1630
+ var selected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1631
+ var autoOpen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
1632
+ var nodeList = Array.isArray(uuid) ? uuid : [uuid];
1633
+ if (!nodeList.length) {
1634
+ return;
1635
+ }
1636
+ var resolvedItem = resolveNodeItem(nodeList[0]);
1637
+ if (resolvedItem[NODE_ATTRIBUTES.IS_NULL]) {
1638
+ return;
1639
+ }
1640
+ if (!props.selectable || typeof props.selectable === 'function' && !props.selectable(uuid) || props.disabledFolderSelectable && (uuid === null || uuid === void 0 ? void 0 : uuid.is_folder) === true) {
1641
+ console.warn('props.selectable is false or undefined, please set selectable with true');
1642
+ return;
1643
+ }
1644
+ if (selectedNodeId !== null && selectedNodeId !== undefined) {
1645
+ setNodeAttr(_defineProperty({}, NODE_ATTRIBUTES.UUID, selectedNodeId), NODE_ATTRIBUTES.IS_SELECTED, !selected);
1646
+ }
1647
+ if (props.selected && props.selected !== selectedNodeId) {
1648
+ setNodeAttr(_defineProperty({}, NODE_ATTRIBUTES.UUID, props.selected), NODE_ATTRIBUTES.IS_SELECTED, !selected);
1649
+ }
1650
+ setNodeAttr(resolvedItem, NODE_ATTRIBUTES.IS_SELECTED, selected);
1651
+ selectedNodeId = getNodeId(resolvedItem);
1652
+ /**
1653
+ * 如果设置了自动展开
1654
+ * 判定长度是为了处理异步节点,如果当前设置selected的节点为多级异步节点
1655
+ * 此时需要一层一层展开所有数据,只需要在最后一次执行setOpen即可
1656
+ */
1657
+ if (autoOpen && nodeList.length === 1) {
1658
+ setOpen(resolvedItem, true, true);
1659
+ }
1660
+ /**
1661
+ * 处理异步节点多层级展开选中
1662
+ */
1663
+ if (getNodeAttr(resolvedItem, NODE_ATTRIBUTES.IS_ASYNC)) {
1664
+ asyncNodeClick(resolvedItem).then(function () {
1665
+ (0,external_vue_.nextTick)(function () {
1666
+ nodeList.shift();
1667
+ setSelect(nodeList, selected, autoOpen);
1668
+ });
1669
+ });
1670
+ }
1671
+ };
1672
+ var resolveNodeAction = function resolveNodeAction(node) {
1673
+ if (typeof props.nodeContentAction === 'function') {
1674
+ return Reflect.apply(props.nodeContentAction, use_node_action_this, [{
1675
+ node: node
1676
+ }]);
1677
+ }
1678
+ if (typeof props.nodeContentAction === 'string') {
1679
+ return [props.nodeContentAction];
1680
+ }
1681
+ if (Array.isArray(props.nodeContentAction)) {
1682
+ return props.nodeContentAction;
1683
+ }
1684
+ return ['selected', 'expand', 'click'];
1685
+ };
1686
+ /**
1687
+ * 点击节点事件
1688
+ * @param item
1689
+ */
1690
+ var handleNodeContentClick = function handleNodeContentClick(item, e) {
1691
+ var nodeActions = resolveNodeAction(item);
1692
+ if (nodeActions.includes('selected')) {
1693
+ setSelect(item, true, false);
1694
+ }
1695
+ if (nodeActions.includes('expand')) {
1696
+ if (!isNodeOpened(item)) {
1697
+ handleTreeNodeClick(item, e);
1698
+ }
1699
+ }
1700
+ if (nodeActions.includes('collapse')) {
1701
+ if (isNodeOpened(item)) {
1702
+ handleTreeNodeClick(item, e);
1703
+ }
1704
+ }
1705
+ if (nodeActions.includes('click')) {
1706
+ var eventName = EVENTS.NODE_CLICK;
1707
+ var source = getNodeAttr(item, NODE_ATTRIBUTES.SOURCE_ITEM);
1708
+ ctx.emit(eventName, source, resolveScopedSlotParam(item), getSchemaVal(item[NODE_ATTRIBUTES.UUID]), e);
1709
+ }
1710
+ };
1711
+ /**
1712
+ * 用于判定当前节点需要展示的连线
1713
+ * 当前指定的depth需不需要展示连线
1714
+ * @param depth 当前需要判定的depth
1715
+ * @param node 当前节点
1716
+ * @returns
1717
+ */
1718
+ var filterNextNode = function filterNextNode(depth, node) {
1719
+ if (isRootNode(node)) {
1720
+ return false;
1721
+ }
1722
+ var nodepath = getNodePath(node);
1723
+ var paths = "".concat(nodepath).split('-').slice(0, depth + 1);
1724
+ var currentPath = paths.join('-');
1725
+ // 如果是判定当前节点,则必须要有一条线
1726
+ if (currentPath === nodepath) {
1727
+ return true;
1728
+ }
1729
+ var lastLevel = paths.pop();
1730
+ var nextLevel = parseInt(lastLevel, 10);
1731
+ paths.push("".concat(nextLevel + 1));
1732
+ var nextNodePath = paths.join('-');
1733
+ return schemaValues.value.some(function (val) {
1734
+ return val[NODE_ATTRIBUTES.PATH] === nextNodePath;
1735
+ });
1736
+ };
1737
+ /**
1738
+ * 获取层级连线
1739
+ * @param node 节点
1740
+ * @returns
1741
+ */
1742
+ var getVirtualLines = function getVirtualLines(node) {
1743
+ if (!props.levelLine) {
1744
+ return null;
1745
+ }
1746
+ var getNodeLineStyle = function getNodeLineStyle(dpth) {
1747
+ return {
1748
+ '--depth': dpth
1749
+ };
1750
+ };
1751
+ var maxDeep = getNodeAttr(node, NODE_ATTRIBUTES.DEPTH) + 1;
1752
+ return new Array(maxDeep).fill('').map(function (_, index) {
1753
+ return index;
1754
+ }).filter(function (depth) {
1755
+ return filterNextNode(depth, node);
1756
+ }).filter(function (depth) {
1757
+ return depth > 0;
1758
+ })
1759
+ // @ts-ignore:next-line
1760
+ .map(function (index) {
1761
+ return (0,external_vue_.createVNode)("span", {
1762
+ "class": "node-virtual-line",
1763
+ "style": getNodeLineStyle(maxDeep - index)
1764
+ }, null);
1765
+ });
1766
+ };
1767
+ var renderNodeSlots = function renderNodeSlots(item) {
1768
+ var _a, _b, _c, _d;
1769
+ if (ctx.slots.node) {
1770
+ return (_b = (_a = ctx.slots).node) === null || _b === void 0 ? void 0 : _b.call(_a, getScopedSlotData(item));
1771
+ }
1772
+ if (ctx.slots["default"]) {
1773
+ return (_d = (_c = ctx.slots)["default"]) === null || _d === void 0 ? void 0 : _d.call(_c, extendNodeScopedData(item));
1774
+ }
1775
+ return [getLabel(item, props)];
1776
+ };
1777
+ var getScopedSlotData = function getScopedSlotData(item) {
1778
+ if (props.keepSlotData) {
1779
+ return extendNodeScopedData(item);
1780
+ }
1781
+ return extendNodeAttr(item);
1782
+ };
1783
+ var renderTreeNode = function renderTreeNode(item) {
1784
+ var _a, _b;
1785
+ return (0,external_vue_.createVNode)("div", {
1786
+ "data-tree-node": getNodeId(item),
1787
+ "key": getNodeId(item),
1788
+ "class": getNodeRowClass(item, flatData.schema)
1789
+ }, [(0,external_vue_.createVNode)("div", {
1790
+ "class": getNodeItemClass(item, flatData.schema, props),
1791
+ "style": getNodeItemStyle(item, props, flatData),
1792
+ "onClick": function onClick(e) {
1793
+ return handleNodeContentClick(item, e);
1794
+ }
1795
+ }, [(0,external_vue_.createVNode)("div", {
1796
+ "class": [resolveClassName('node-action')],
1797
+ "onClick": function onClick(e) {
1798
+ return handleNodeActionClick(e, item);
1799
+ }
1800
+ }, [getActionIcon(item)]), (0,external_vue_.createVNode)("div", {
1801
+ "class": resolveClassName('node-content')
1802
+ }, [[getCheckboxRender(item), getNodePrefixIcon(item)], (0,external_vue_.createVNode)("span", {
1803
+ "class": resolveClassName('node-text')
1804
+ }, [renderNodeSlots(item)]), (_b = (_a = ctx.slots).nodeAppend) === null || _b === void 0 ? void 0 : _b.call(_a, getScopedSlotData(item))]), getVirtualLines(item)])]);
1805
+ };
1806
+ return {
1807
+ renderTreeNode: renderTreeNode,
1808
+ handleTreeNodeClick: handleTreeNodeClick,
1809
+ deepAutoOpen: deepAutoOpen,
1810
+ asyncNodeClick: asyncNodeClick,
1811
+ setNodeAction: setNodeAction,
1812
+ setNodeOpened: setNodeOpened,
1813
+ setSelect: setSelect,
1814
+ setOpen: setOpen
1815
+ };
1816
+ });
1817
+ ;// CONCATENATED MODULE: ../../packages/tree/src/use-node-drag.tsx
1818
+
1819
+ var use_node_drag_this = undefined;
1820
+ /*
1821
+ * Tencent is pleased to support the open source community by making
1822
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1823
+ *
1824
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1825
+ *
1826
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1827
+ *
1828
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1829
+ *
1830
+ * ---------------------------------------------------
1831
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1832
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1833
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1834
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1835
+ *
1836
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1837
+ * the Software.
1838
+ *
1839
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1840
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1841
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1842
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1843
+ * IN THE SOFTWARE.
1844
+ */
1845
+
1846
+
1847
+
1848
+
1849
+ /* harmony default export */ const use_node_drag = (function (props, ctx, root, flatData) {
1850
+ var _useNodeAttribute = use_node_attribute(flatData, props),
1851
+ getSourceNodeByUID = _useNodeAttribute.getSourceNodeByUID,
1852
+ getNodeParentIdById = _useNodeAttribute.getNodeParentIdById,
1853
+ getParentNodeData = _useNodeAttribute.getParentNodeData,
1854
+ extendNodeAttr = _useNodeAttribute.extendNodeAttr,
1855
+ getNodeAttr = _useNodeAttribute.getNodeAttr,
1856
+ getNodePath = _useNodeAttribute.getNodePath,
1857
+ isRootNode = _useNodeAttribute.isRootNode;
1858
+ var _usePrefix = (0,external_config_provider_.usePrefix)(),
1859
+ resolveClassName = _usePrefix.resolveClassName;
1860
+ var isNeedCheckDraggable = (0,external_vue_.computed)(function () {
1861
+ return typeof props.disableDrag === 'function';
1862
+ });
1863
+ var isNeedCheckDroppable = (0,external_vue_.computed)(function () {
1864
+ return typeof props.disableDrop === 'function';
1865
+ });
1866
+ var dragNodeId = '';
1867
+ var getTargetTreeNode = function getTargetTreeNode(e) {
1868
+ var target = e.target;
1869
+ return target.closest('[data-tree-node]');
1870
+ };
1871
+ var getNodeByTargetTreeNode = function getNodeByTargetTreeNode(targetNode) {
1872
+ var _a;
1873
+ var uid = (_a = targetNode === null || targetNode === void 0 ? void 0 : targetNode.dataset) === null || _a === void 0 ? void 0 : _a.treeNode;
1874
+ return getSourceNodeByUID(uid);
1875
+ };
1876
+ var handleTreeNodeMouseup = function handleTreeNodeMouseup(e) {
1877
+ var targetNode = getTargetTreeNode(e);
1878
+ targetNode.removeEventListener('mouseup', handleTreeNodeMouseup);
1879
+ };
1880
+ var handleTreeNodeMousedown = function handleTreeNodeMousedown(e) {
1881
+ var targetNode = getTargetTreeNode(e);
1882
+ var data = getNodeByTargetTreeNode(targetNode);
1883
+ if (data.draggable === false || isNeedCheckDraggable.value && props.disableDrag(data)) {
1884
+ targetNode.classList.add("".concat(resolveClassName('tree-drag-disabled')));
1885
+ return;
1886
+ }
1887
+ targetNode.setAttribute('draggable', 'true');
1888
+ targetNode.addEventListener('mouseup', handleTreeNodeMouseup);
1889
+ };
1890
+ var handleTreeNodeDragover = function handleTreeNodeDragover(e) {
1891
+ e.preventDefault();
1892
+ var targetNode = getTargetTreeNode(e);
1893
+ var data = extendNodeAttr(getNodeByTargetTreeNode(targetNode));
1894
+ ctx.emit(EVENTS.NODE_DRAG_OVER, e, targetNode, data);
1895
+ if (isNeedCheckDroppable.value && (props === null || props === void 0 ? void 0 : props.disableDrop(data))) {
1896
+ e.dataTransfer.effectAllowed = 'move';
1897
+ e.dataTransfer.dropEffect = 'none';
1898
+ targetNode.classList.add("".concat(resolveClassName('tree-drop-disabled')));
1899
+ return;
1900
+ }
1901
+ targetNode.classList.add("".concat(resolveClassName('tree-drop-active')));
1902
+ var sourceNodeId = e.dataTransfer.getData('node-id');
1903
+ sourceNodeId = dragNodeId;
1904
+ var targetNodeId = targetNode.getAttribute('data-tree-node');
1905
+ var transferEffect = isNodeSortable(sourceNodeId, targetNodeId) ? 'move' : 'none';
1906
+ e.dataTransfer.effectAllowed = transferEffect;
1907
+ e.dataTransfer.dropEffect = transferEffect;
1908
+ };
1909
+ var handleTreeNodeDragStart = function handleTreeNodeDragStart(e) {
1910
+ e.dataTransfer.effectAllowed = 'move';
1911
+ e.dataTransfer.dropEffect = 'move';
1912
+ var targetNode = getTargetTreeNode(e);
1913
+ e.dataTransfer.setData('text/plain', '');
1914
+ var nodeId = targetNode.getAttribute('data-tree-node');
1915
+ dragNodeId = nodeId;
1916
+ e.dataTransfer.setData('node-id', nodeId);
1917
+ ctx.emit(EVENTS.NODE_DRAG_START, e, targetNode);
1918
+ };
1919
+ var handleTreeNodeDrop = function handleTreeNodeDrop(e) {
1920
+ /** firefox的drop事件必须调用preventDefault()和stopPropagation(), 否则会自动重定向 */
1921
+ e.preventDefault();
1922
+ e.stopPropagation();
1923
+ var targetNode = getTargetTreeNode(e);
1924
+ targetNode.classList.remove("".concat(resolveClassName('tree-drop-active')), "".concat(resolveClassName('tree-drop-disabled')));
1925
+ var data = extendNodeAttr(getNodeByTargetTreeNode(targetNode));
1926
+ if (isNeedCheckDroppable.value && props.disableDrop(data)) {
1927
+ return;
1928
+ }
1929
+ var sourceNodeId = dragNodeId; // e.dataTransfer.getData('node-id');
1930
+ var targetNodeId = targetNode.getAttribute('data-tree-node');
1931
+ Reflect.apply(props.dragSort ? dragSortData : dragAsChildNode, use_node_drag_this, [sourceNodeId, targetNodeId]);
1932
+ ctx.emit(EVENTS.NODE_DROP, e, targetNode, data);
1933
+ };
1934
+ var isNodeSortable = function isNodeSortable(sourceId, targetId) {
1935
+ var sourcePath = getNodePath(_defineProperty({}, NODE_ATTRIBUTES.UUID, sourceId));
1936
+ var targetPath = getNodePath(_defineProperty({}, NODE_ATTRIBUTES.UUID, targetId));
1937
+ // if (!sourcePath || targetPath) {
1938
+ // return false;
1939
+ // }
1940
+ var sourceParentNodeId = getNodeParentIdById(sourceId);
1941
+ var targetParentNode = getNodeParentIdById(targetId);
1942
+ if (sourceParentNodeId === targetParentNode) {
1943
+ return true;
1944
+ }
1945
+ return sourcePath.indexOf(targetPath) === -1 && targetPath.indexOf(sourcePath) === -1;
1946
+ };
1947
+ var dragSortData = function dragSortData(sourceId, targetId) {
1948
+ if (!isNodeSortable(sourceId, targetId)) {
1949
+ return;
1950
+ }
1951
+ var sourceNodeData = JSON.parse(JSON.stringify(getSourceNodeByUID(sourceId)));
1952
+ var targetNodeData = JSON.parse(JSON.stringify(getSourceNodeByUID(targetId)));
1953
+ var sourceNodeParent = getParentNodeData(sourceId);
1954
+ var targetNodeParent = getParentNodeData(targetId);
1955
+ var sourceNodeIndex = getNodeAttr(_defineProperty({}, NODE_ATTRIBUTES.UUID, sourceId), NODE_ATTRIBUTES.INDEX);
1956
+ var targetNodeIndex = getNodeAttr(_defineProperty({}, NODE_ATTRIBUTES.UUID, targetId), NODE_ATTRIBUTES.INDEX);
1957
+ sourceNodeParent === null || sourceNodeParent === void 0 ? void 0 : sourceNodeParent[props.children].splice(sourceNodeIndex, 1, targetNodeData);
1958
+ targetNodeParent === null || targetNodeParent === void 0 ? void 0 : targetNodeParent[props.children].splice(targetNodeIndex, 1, sourceNodeData);
1959
+ };
1960
+ var dragAsChildNode = function dragAsChildNode(sourceNodeId, targetNodeId) {
1961
+ var sourceNodeData = getSourceNodeByUID(sourceNodeId);
1962
+ var targetNodeData = getSourceNodeByUID(targetNodeId);
1963
+ var parentNode = null;
1964
+ if (isRootNode(_defineProperty({}, NODE_ATTRIBUTES.UUID, sourceNodeId))) {
1965
+ parentNode = props.data;
1966
+ } else {
1967
+ var sourceNodeParentId = getNodeParentIdById(sourceNodeId);
1968
+ if (sourceNodeParentId !== undefined && sourceNodeParentId !== null) {
1969
+ parentNode = getSourceNodeByUID(sourceNodeParentId);
1970
+ var sourceNodeIndex = getNodeAttr(_defineProperty({}, NODE_ATTRIBUTES.UUID, sourceNodeId), NODE_ATTRIBUTES.INDEX);
1971
+ parentNode === null || parentNode === void 0 ? void 0 : parentNode[props.children].splice(sourceNodeIndex, 1);
1972
+ }
1973
+ }
1974
+ if (!targetNodeData[props.children]) {
1975
+ targetNodeData[props.children] = [];
1976
+ }
1977
+ targetNodeData[props.children].unshift(sourceNodeData);
1978
+ };
1979
+ var handleTreeNodeDragLeave = function handleTreeNodeDragLeave(e) {
1980
+ e.preventDefault();
1981
+ var targetNode = getTargetTreeNode(e);
1982
+ targetNode.classList.remove("".concat(resolveClassName('tree-drop-active')), "".concat(resolveClassName('tree-drop-disabled')));
1983
+ ctx.emit(EVENTS.NODE_DRAG_LEAVE, e, targetNode);
1984
+ };
1985
+ (0,external_vue_.onMounted)(function () {
1986
+ if (props.draggable && root.value) {
1987
+ var rootTree = root.value.$el;
1988
+ rootTree.addEventListener('mousedown', handleTreeNodeMousedown);
1989
+ rootTree.addEventListener('dragstart', handleTreeNodeDragStart);
1990
+ rootTree.addEventListener('dragover', handleTreeNodeDragover);
1991
+ rootTree.addEventListener('dragleave', handleTreeNodeDragLeave);
1992
+ rootTree.addEventListener('drop', handleTreeNodeDrop);
1993
+ }
1994
+ });
1995
+ (0,external_vue_.onUnmounted)(function () {
1996
+ if (props.draggable && root.value) {
1997
+ var rootTree = root.value.$el;
1998
+ rootTree.removeEventListener('mousedown', handleTreeNodeMousedown);
1999
+ rootTree.removeEventListener('dragstart', handleTreeNodeDragStart);
2000
+ rootTree.removeEventListener('dragover', handleTreeNodeDragover);
2001
+ rootTree.removeEventListener('dragleave', handleTreeNodeDragLeave);
2002
+ rootTree.removeEventListener('drop', handleTreeNodeDrop);
2003
+ }
2004
+ });
2005
+ });
2006
+ ;// CONCATENATED MODULE: ../../packages/tree/src/use-search.tsx
2007
+
2008
+ var use_search_this = undefined;
2009
+ /*
2010
+ * Tencent is pleased to support the open source community by making
2011
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2012
+ *
2013
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2014
+ *
2015
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2016
+ *
2017
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2018
+ *
2019
+ * ---------------------------------------------------
2020
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2021
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2022
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2023
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2024
+ *
2025
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2026
+ * the Software.
2027
+ *
2028
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2029
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2030
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2031
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2032
+ * IN THE SOFTWARE.
2033
+ */
2034
+
2035
+ /* harmony default export */ const use_search = (function (props) {
2036
+ var _a;
2037
+ var refSearch = (0,external_vue_.toRef)(props, 'search');
2038
+ var _ref = (_a = props.search) !== null && _a !== void 0 ? _a : {},
2039
+ _ref$openResultNode = _ref.openResultNode,
2040
+ openResultNode = _ref$openResultNode === void 0 ? false : _ref$openResultNode,
2041
+ _ref$resultType = _ref.resultType,
2042
+ resultType = _ref$resultType === void 0 ? 'tree' : _ref$resultType;
2043
+ var isCommonType = function isCommonType(val) {
2044
+ return ['string', 'number', 'boolean'].includes(_typeof(val));
2045
+ };
2046
+ var exactMath = function exactMath(matchValue, itemValue) {
2047
+ return matchValue === itemValue;
2048
+ };
2049
+ var regMatch = function regMatch(matchValue, itemValue) {
2050
+ return new RegExp("".concat(matchValue), 'i').test("".concat(itemValue));
2051
+ };
2052
+ var matchFn = function matchFn(match, args) {
2053
+ return Reflect.apply(match, use_search_this, args);
2054
+ };
2055
+ var isSearchDisabled = refSearch.value === undefined || refSearch.value === false;
2056
+ var searchFn = function searchFn(itemValue, item) {
2057
+ if (isSearchDisabled) {
2058
+ return true;
2059
+ }
2060
+ if (isCommonType(refSearch.value)) {
2061
+ return matchFn(regMatch, [refSearch.value, itemValue, item]);
2062
+ }
2063
+ var _refSearch$value = refSearch.value,
2064
+ _refSearch$value$valu = _refSearch$value.value,
2065
+ value = _refSearch$value$valu === void 0 ? '' : _refSearch$value$valu,
2066
+ _refSearch$value$matc = _refSearch$value.match,
2067
+ match = _refSearch$value$matc === void 0 ? 'fuzzy' : _refSearch$value$matc;
2068
+ var defultMatch = match === 'fuzzy' ? regMatch : exactMath;
2069
+ var matchCallback = typeof match === 'function' ? match : defultMatch;
2070
+ if ("".concat(value).length === 0) {
2071
+ return true;
2072
+ }
2073
+ return matchFn(matchCallback, [value, itemValue, item]);
2074
+ };
2075
+ var isSearchActive = (0,external_vue_.computed)(function () {
2076
+ return refSearch.value !== false && (isCommonType(refSearch.value) ? "".concat(refSearch.value).length > 0 : _typeof(refSearch.value) === 'object');
2077
+ });
2078
+ /**
2079
+ * 索索结果展示为Tree
2080
+ */
2081
+ var isTreeUI = resultType === 'tree';
2082
+ return {
2083
+ searchFn: searchFn,
2084
+ refSearch: refSearch,
2085
+ isSearchActive: isSearchActive,
2086
+ isSearchDisabled: isSearchDisabled,
2087
+ openResultNode: openResultNode,
2088
+ resultType: resultType,
2089
+ isTreeUI: isTreeUI
2090
+ };
2091
+ });
2092
+ // EXTERNAL MODULE: ../../node_modules/uuid/index.js
2093
+ var uuid = __webpack_require__(8022);
2094
+ ;// CONCATENATED MODULE: ../../packages/tree/src/use-tree-init.tsx
2095
+
2096
+
2097
+ var use_tree_init_this = undefined;
2098
+ /*
2099
+ * Tencent is pleased to support the open source community by making
2100
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2101
+ *
2102
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2103
+ *
2104
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2105
+ *
2106
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2107
+ *
2108
+ * ---------------------------------------------------
2109
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2110
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2111
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2112
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2113
+ *
2114
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2115
+ * the Software.
2116
+ *
2117
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2118
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2119
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2120
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2121
+ * IN THE SOFTWARE.
2122
+ */
2123
+
2124
+
2125
+
2126
+
2127
+ /* harmony default export */ const use_tree_init = (function (props) {
2128
+ var _a;
2129
+ /**
2130
+ * 扁平化当前数据
2131
+ * @param arrData
2132
+ * @returns
2133
+ */
2134
+ var getFlatdata = function getFlatdata(props) {
2135
+ var _cachedDefaultVal;
2136
+ var treeData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
2137
+ var cachedSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2138
+ var data = props.data,
2139
+ children = props.children;
2140
+ var checkedList = [];
2141
+ var outputData = [];
2142
+ var order = 0;
2143
+ var schema = new Map();
2144
+ /**
2145
+ * 递归更新节点属性
2146
+ * @param uuid 当前节点id
2147
+ * @param attrName 需要更新的节点属性名称
2148
+ * @param attrValue 需要更新的节点属性值
2149
+ * @param callFn 回电函数
2150
+ * @returns
2151
+ */
2152
+ function loopUpdateNodeAttr(uuid, attrName, attrValue, callFn) {
2153
+ if (uuid === undefined || uuid === null) {
2154
+ return;
2155
+ }
2156
+ if (schema.has(uuid) && ![NODE_ATTRIBUTES.UUID, NODE_ATTRIBUTES.PARENT_ID].includes(attrName)) {
2157
+ var target = schema.get(uuid);
2158
+ if (Object.prototype.hasOwnProperty.call(target, attrName)) {
2159
+ if (typeof callFn === 'function' && Reflect.apply(callFn, self, [target, attrName, attrValue])) {
2160
+ Object.assign(target, _defineProperty({}, attrName, attrValue));
2161
+ loopUpdateNodeAttr(target[NODE_ATTRIBUTES.PARENT_ID], attrName, attrValue, callFn);
2162
+ }
2163
+ }
2164
+ }
2165
+ }
2166
+ function getUid(item) {
2167
+ var uid = null;
2168
+ if (typeof props.nodeKey === 'string') {
2169
+ uid = item[props.nodeKey] || (0,uuid.v4)();
2170
+ }
2171
+ return uid || item[NODE_ATTRIBUTES.UUID] || (0,uuid.v4)();
2172
+ }
2173
+ var cachedDefaultVal = (_cachedDefaultVal = {}, _defineProperty(_cachedDefaultVal, NODE_ATTRIBUTES.IS_OPEN, function () {
2174
+ return !!props.expandAll;
2175
+ }), _defineProperty(_cachedDefaultVal, NODE_ATTRIBUTES.IS_CHECKED, function () {
2176
+ return false;
2177
+ }), _defineProperty(_cachedDefaultVal, NODE_ATTRIBUTES.IS_MATCH, function () {
2178
+ return true;
2179
+ }), _defineProperty(_cachedDefaultVal, NODE_ATTRIBUTES.IS_SELECTED, function (uuid) {
2180
+ return props.selected === uuid;
2181
+ }), _defineProperty(_cachedDefaultVal, NODE_ATTRIBUTES.IS_CACHED, function () {
2182
+ return false;
2183
+ }), _defineProperty(_cachedDefaultVal, NODE_ATTRIBUTES.IS_ASYNC, function () {
2184
+ return null;
2185
+ }), _defineProperty(_cachedDefaultVal, NODE_ATTRIBUTES.IS_LOADING, function () {
2186
+ return false;
2187
+ }), _cachedDefaultVal);
2188
+ function getCachedTreeNodeAttr(uuid, node, cachedAttr) {
2189
+ var defVal = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
2190
+ var defaultValue = defVal;
2191
+ if (defVal === undefined && typeof cachedDefaultVal[cachedAttr] === 'function') {
2192
+ defaultValue = cachedDefaultVal[cachedAttr](uuid, node);
2193
+ }
2194
+ var sourceAttr = NODE_SOURCE_ATTRS[cachedAttr];
2195
+ if (Object.prototype.hasOwnProperty.call(node, sourceAttr)) {
2196
+ return node[sourceAttr];
2197
+ }
2198
+ var cached = (cachedSchema || []).find(function (item) {
2199
+ return item[NODE_ATTRIBUTES.UUID] === uuid;
2200
+ });
2201
+ var result = undefined;
2202
+ if (cached) {
2203
+ result = cached[cachedAttr];
2204
+ }
2205
+ if (result === undefined || result === null) {
2206
+ result = defaultValue;
2207
+ }
2208
+ return result;
2209
+ }
2210
+ function isCachedTreeNodeSelected(uuid, node) {
2211
+ if (!props.selectable) {
2212
+ return false;
2213
+ }
2214
+ return getCachedTreeNodeAttr(uuid, node, NODE_ATTRIBUTES.IS_SELECTED, props.selected === uuid);
2215
+ }
2216
+ function isNodeOpend(uuid, item, parent) {
2217
+ var _a;
2218
+ var isItemOpened = getCachedTreeNodeAttr(uuid, item, NODE_ATTRIBUTES.IS_OPEN);
2219
+ var isParentOpened = schema.has(parent) ? (_a = schema.get(parent)) === null || _a === void 0 ? void 0 : _a[NODE_ATTRIBUTES.IS_OPEN] : true;
2220
+ return isItemOpened && isParentOpened;
2221
+ }
2222
+ function validateIsOpenLoopFn(target) {
2223
+ return !target[NODE_ATTRIBUTES.IS_OPEN];
2224
+ }
2225
+ function flatten(array) {
2226
+ var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2227
+ var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
2228
+ var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
2229
+ var arrLength = array.length;
2230
+ for (var i = 0; i < arrLength; i++) {
2231
+ var item = array[i];
2232
+ if (Array.isArray(item)) {
2233
+ flatten(item, depth, parent, path);
2234
+ } else {
2235
+ if (_typeof(item) === 'object' && item !== null) {
2236
+ var _schema$set, _outputData$push;
2237
+ var currentPath = path !== null ? "".concat(path, "-").concat(i) : "".concat(i);
2238
+ var uuid = "".concat(getUid(item));
2239
+ var hasChildren = !!(item[children] || []).length;
2240
+ /**
2241
+ * 当前节点设置是否为展开状态
2242
+ */
2243
+ var isOpened = getCachedTreeNodeAttr(uuid, item, NODE_ATTRIBUTES.IS_OPEN);
2244
+ /**
2245
+ * 如果初始化发现当前属性为展开或者选中 & 设置了 autoOpenParentNode = true
2246
+ * 此时需要设置当前节点的所有父级节点都为展开状态
2247
+ */
2248
+ if (props.autoOpenParentNode) {
2249
+ isOpened && loopUpdateNodeAttr(parent, NODE_ATTRIBUTES.IS_OPEN, true, validateIsOpenLoopFn);
2250
+ } else {
2251
+ /**
2252
+ * 如果没有设置自动展开所有父级
2253
+ * 此时需要判定当前节点是否可以展开状态需要同时判定父级是否展开
2254
+ * 如果父级不是展开状态,此节点不能展示,应该也是关闭状态,只有当父级展开时,此节点才为展开状态
2255
+ */
2256
+ isOpened = isNodeOpend(uuid, item, parent);
2257
+ }
2258
+ // Object.assign(item, { [NODE_ATTRIBUTES.UUID]: uuid });
2259
+ var isChecked = props.showCheckbox && getCachedTreeNodeAttr(uuid, item, NODE_ATTRIBUTES.IS_CHECKED);
2260
+ if (isChecked) {
2261
+ checkedList.push(uuid);
2262
+ }
2263
+ schema.set(uuid, (_schema$set = {}, _defineProperty(_schema$set, NODE_ATTRIBUTES.DEPTH, depth), _defineProperty(_schema$set, NODE_ATTRIBUTES.INDEX, i), _defineProperty(_schema$set, NODE_ATTRIBUTES.UUID, uuid), _defineProperty(_schema$set, NODE_ATTRIBUTES.PARENT_ID, parent), _defineProperty(_schema$set, NODE_ATTRIBUTES.HAS_CHILD, hasChildren), _defineProperty(_schema$set, NODE_ATTRIBUTES.PATH, currentPath), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_ROOT, parent === null), _defineProperty(_schema$set, NODE_ATTRIBUTES.ORDER, order), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_SELECTED, isCachedTreeNodeSelected(uuid, item)), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_MATCH, getCachedTreeNodeAttr(uuid, item, NODE_ATTRIBUTES.IS_MATCH)), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_OPEN, isOpened), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_CHECKED, isChecked), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_CACHED, getCachedTreeNodeAttr(uuid, item, NODE_ATTRIBUTES.IS_CACHED)), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_ASYNC, getCachedTreeNodeAttr(uuid, item, NODE_ATTRIBUTES.IS_ASYNC)), _defineProperty(_schema$set, NODE_ATTRIBUTES.IS_LOADING, getCachedTreeNodeAttr(uuid, item, NODE_ATTRIBUTES.IS_LOADING)), _defineProperty(_schema$set, NODE_ATTRIBUTES.SOURCE_ITEM, item), _defineProperty(_schema$set, children, null), _schema$set));
2264
+ order += 1;
2265
+ outputData.push((_outputData$push = {}, _defineProperty(_outputData$push, NODE_ATTRIBUTES.UUID, uuid), _defineProperty(_outputData$push, props.label, item[props.label]), _defineProperty(_outputData$push, NODE_ATTRIBUTES.IS_OPEN, isOpened), _defineProperty(_outputData$push, children, null), _outputData$push));
2266
+ if (Object.prototype.hasOwnProperty.call(item, children)) {
2267
+ flatten(item[children] || [], depth + 1, uuid, currentPath);
2268
+ }
2269
+ }
2270
+ }
2271
+ }
2272
+ }
2273
+ flatten(treeData ? treeData : data);
2274
+ if (props.showCheckbox) {
2275
+ checkedList === null || checkedList === void 0 ? void 0 : checkedList.forEach(function (value) {
2276
+ Array.from(schema.values()).filter(function (t) {
2277
+ var _a;
2278
+ return (_a = t[NODE_ATTRIBUTES.PATH]) === null || _a === void 0 ? void 0 : _a.startsWith(schema.get(value)[NODE_ATTRIBUTES.PATH]);
2279
+ }).forEach(function (n) {
2280
+ return Object.assign(n, _defineProperty({}, NODE_ATTRIBUTES.IS_CHECKED, true));
2281
+ });
2282
+ loopUpdateNodeAttr(value, NODE_ATTRIBUTES.IS_CHECKED, true, function () {
2283
+ return true;
2284
+ });
2285
+ });
2286
+ }
2287
+ return [outputData, schema];
2288
+ };
2289
+ var formatData = getFlatdata(props);
2290
+ var nextLoopEvents = new Map();
2291
+ var afterSelectEvents = [];
2292
+ var afterSelectWatch = [];
2293
+ /**
2294
+ * 扁平化数据
2295
+ * schema: 需要展示连线时,用于计算连线高度
2296
+ */
2297
+ var flatData = (0,external_vue_.reactive)({
2298
+ data: formatData[0],
2299
+ schema: formatData[1],
2300
+ levelLineSchema: {}
2301
+ });
2302
+ var schemaValues = (0,external_vue_.computed)(function () {
2303
+ return Array.from(flatData.schema.values());
2304
+ });
2305
+ var _useNodeAsync = use_node_async(props, flatData),
2306
+ asyncNodeClick = _useNodeAsync.asyncNodeClick,
2307
+ deepAutoOpen = _useNodeAsync.deepAutoOpen;
2308
+ /**
2309
+ * 抛出缓存函数,用于注册selected watch
2310
+ * @param event
2311
+ */
2312
+ var onSelected = function onSelected(event) {
2313
+ afterSelectEvents.push(event);
2314
+ };
2315
+ var registerNextLoop = function registerNextLoop(key, event) {
2316
+ var reset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2317
+ if (reset && nextLoopEvents.has(key)) {
2318
+ nextLoopEvents["delete"](key);
2319
+ }
2320
+ nextLoopEvents.set(key, event);
2321
+ };
2322
+ var resolveEventOption = function resolveEventOption(event) {
2323
+ if (typeof event === 'function') {
2324
+ return {
2325
+ type: 'loop',
2326
+ fn: event
2327
+ };
2328
+ }
2329
+ if (_typeof(event) === 'object' && typeof event.type === 'string' && typeof event.fn === 'function') {
2330
+ return event;
2331
+ }
2332
+ console.error('loop event error', event);
2333
+ return null;
2334
+ };
2335
+ var executeFn = function executeFn(event) {
2336
+ var _a;
2337
+ var resoveEvent = resolveEventOption(event);
2338
+ if (resoveEvent !== null) {
2339
+ Reflect.apply(resoveEvent.fn, use_tree_init_this, []);
2340
+ }
2341
+ return (_a = resoveEvent === null || resoveEvent === void 0 ? void 0 : resoveEvent.type) !== null && _a !== void 0 ? _a : 'once';
2342
+ };
2343
+ var executeNextEvent = function executeNextEvent() {
2344
+ Array.from(nextLoopEvents.keys()).forEach(function (key) {
2345
+ var target = nextLoopEvents.get(key);
2346
+ if (Array.isArray(target)) {
2347
+ var clearList = [];
2348
+ target.forEach(function (event, index) {
2349
+ var result = executeFn(event);
2350
+ if (result === 'once') {
2351
+ clearList.unshift(index);
2352
+ }
2353
+ });
2354
+ if (clearList.length) {
2355
+ clearList.forEach(function (index) {
2356
+ return target.splice(index, 1);
2357
+ });
2358
+ }
2359
+ if (target.length === 0) {
2360
+ nextLoopEvents["delete"](key);
2361
+ }
2362
+ } else {
2363
+ var result = executeFn(target);
2364
+ if (result === 'once') {
2365
+ nextLoopEvents["delete"](key);
2366
+ }
2367
+ }
2368
+ });
2369
+ };
2370
+ /**
2371
+ * 监听组件配置Data改变
2372
+ */
2373
+ (0,external_vue_.watch)(function () {
2374
+ return [props.data];
2375
+ }, function (newData) {
2376
+ var _a, _b;
2377
+ var formatData = getFlatdata(props, newData, schemaValues.value);
2378
+ flatData.data = formatData[0];
2379
+ flatData.schema = formatData[1];
2380
+ if (((_a = props.async) === null || _a === void 0 ? void 0 : _a.callback) && ((_b = props.async) === null || _b === void 0 ? void 0 : _b.deepAutoOpen) === 'every') {
2381
+ deepAutoOpen();
2382
+ }
2383
+ /**
2384
+ * 执行缓存下来的周期函数
2385
+ * 保证data改变之后执行相关操作
2386
+ */
2387
+ executeNextEvent();
2388
+ }, {
2389
+ deep: true
2390
+ });
2391
+ if (props.selectable) {
2392
+ (0,external_vue_.onMounted)(function () {
2393
+ (0,external_vue_.watch)(function () {
2394
+ return props.selected;
2395
+ }, function (newData) {
2396
+ // console.log('watch selected changed');
2397
+ afterSelectWatch.length = 0;
2398
+ afterSelectEvents.forEach(function (event) {
2399
+ Reflect.apply(event, use_tree_init_this, [newData]);
2400
+ /**
2401
+ * selected设置生效有可能会在props.data 改变之前
2402
+ * 此时需要缓存当前执行函数,保证在watch data change 之后执行
2403
+ */
2404
+ afterSelectWatch.push(function () {
2405
+ return Reflect.apply(event, use_tree_init_this, [newData]);
2406
+ });
2407
+ });
2408
+ registerNextLoop('afterSelectWatch', afterSelectWatch);
2409
+ }, {
2410
+ immediate: true
2411
+ });
2412
+ });
2413
+ }
2414
+ var afterDataUpdate = function afterDataUpdate(callFn) {
2415
+ registerNextLoop('afterDataUpdate', callFn);
2416
+ };
2417
+ /** 如果设置了异步请求 */
2418
+ if ((_a = props.async) === null || _a === void 0 ? void 0 : _a.callback) {
2419
+ deepAutoOpen();
2420
+ }
2421
+ return {
2422
+ flatData: flatData,
2423
+ schemaValues: schemaValues,
2424
+ asyncNodeClick: asyncNodeClick,
2425
+ deepAutoOpen: deepAutoOpen,
2426
+ afterDataUpdate: afterDataUpdate,
2427
+ registerNextLoop: registerNextLoop,
2428
+ onSelected: onSelected
2429
+ };
2430
+ });
2431
+ ;// CONCATENATED MODULE: ../../packages/tree/src/tree.tsx
2432
+
2433
+ /*
2434
+ * Tencent is pleased to support the open source community by making
2435
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2436
+ *
2437
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2438
+ *
2439
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2440
+ *
2441
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2442
+ *
2443
+ * ---------------------------------------------------
2444
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2445
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2446
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2447
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2448
+ *
2449
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2450
+ * the Software.
2451
+ *
2452
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2453
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2454
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2455
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2456
+ * IN THE SOFTWARE.
2457
+ */
2458
+
2459
+
2460
+
2461
+
2462
+
2463
+
2464
+
2465
+
2466
+
2467
+
2468
+
2469
+
2470
+ /* harmony default export */ const tree = ((0,external_vue_.defineComponent)({
2471
+ name: 'Tree',
2472
+ props: treeProps,
2473
+ emits: TreeEmitEventsType,
2474
+ setup: function setup(props, ctx) {
2475
+ var _useTreeInit = use_tree_init(props),
2476
+ flatData = _useTreeInit.flatData,
2477
+ schemaValues = _useTreeInit.schemaValues,
2478
+ onSelected = _useTreeInit.onSelected,
2479
+ registerNextLoop = _useTreeInit.registerNextLoop;
2480
+ var _useNodeAttribute = use_node_attribute(flatData, props),
2481
+ setNodeAttr = _useNodeAttribute.setNodeAttr,
2482
+ checkNodeIsOpen = _useNodeAttribute.checkNodeIsOpen,
2483
+ getNodeAttr = _useNodeAttribute.getNodeAttr,
2484
+ getNodePath = _useNodeAttribute.getNodePath,
2485
+ isRootNode = _useNodeAttribute.isRootNode,
2486
+ isNodeOpened = _useNodeAttribute.isNodeOpened,
2487
+ isNodeChecked = _useNodeAttribute.isNodeChecked,
2488
+ isNodeMatched = _useNodeAttribute.isNodeMatched,
2489
+ hasChildNode = _useNodeAttribute.hasChildNode;
2490
+ var _useSearch = use_search(props),
2491
+ searchFn = _useSearch.searchFn,
2492
+ isSearchActive = _useSearch.isSearchActive,
2493
+ refSearch = _useSearch.refSearch,
2494
+ openResultNode = _useSearch.openResultNode,
2495
+ isTreeUI = _useSearch.isTreeUI,
2496
+ isSearchDisabled = _useSearch.isSearchDisabled;
2497
+ if (!isSearchDisabled) {
2498
+ (0,external_vue_.watch)([refSearch], function () {
2499
+ flatData.data.forEach(function (item) {
2500
+ var isMatch = searchFn(getLabel(item, props), item);
2501
+ setNodeAttr(item, NODE_ATTRIBUTES.IS_MATCH, isMatch);
2502
+ if (openResultNode) {
2503
+ setOpen(item, true, true);
2504
+ }
2505
+ });
2506
+ });
2507
+ }
2508
+ var filterFn = function filterFn(item) {
2509
+ if (isSearchActive.value) {
2510
+ var treeUiFilter = function treeUiFilter() {
2511
+ return isTreeUI ? schemaValues.value.some(function (schema) {
2512
+ var _a;
2513
+ return ((_a = schema[NODE_ATTRIBUTES.PATH]) === null || _a === void 0 ? void 0 : _a.startsWith(getNodePath(item))) && schema[NODE_ATTRIBUTES.IS_MATCH];
2514
+ }) : false;
2515
+ };
2516
+ return getNodeAttr(item, NODE_ATTRIBUTES.IS_MATCH) || treeUiFilter();
2517
+ }
2518
+ return true;
2519
+ };
2520
+ // 计算当前需要渲染的节点信息
2521
+ var renderData = (0,external_vue_.computed)(function () {
2522
+ return flatData.data.filter(function (item) {
2523
+ return checkNodeIsOpen(item) && filterFn(item);
2524
+ });
2525
+ });
2526
+ var _useNodeAction = use_node_action(props, ctx, flatData, renderData, schemaValues, {
2527
+ registerNextLoop: registerNextLoop
2528
+ }),
2529
+ renderTreeNode = _useNodeAction.renderTreeNode,
2530
+ handleTreeNodeClick = _useNodeAction.handleTreeNodeClick,
2531
+ setNodeOpened = _useNodeAction.setNodeOpened,
2532
+ setOpen = _useNodeAction.setOpen,
2533
+ setNodeAction = _useNodeAction.setNodeAction,
2534
+ setSelect = _useNodeAction.setSelect,
2535
+ asyncNodeClick = _useNodeAction.asyncNodeClick;
2536
+ var root = (0,external_vue_.ref)();
2537
+ // const isScrolling = ref(false);
2538
+ /**
2539
+ * 设置指定节点是否选中
2540
+ * @param item Node item | Node Id
2541
+ * @param checked
2542
+ */
2543
+ var setChecked = function setChecked(item) {
2544
+ var checked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2545
+ setNodeAction(resolveNodeItem(item), NODE_ATTRIBUTES.IS_CHECKED, checked);
2546
+ };
2547
+ onSelected(function (newData) {
2548
+ setSelect(newData, true, props.autoOpenParentNode);
2549
+ scrollRending();
2550
+ });
2551
+ var scrollRending = function scrollRending() {
2552
+ // isScrolling.value = true;
2553
+ // // root.value.scrollTo({
2554
+ // // left: 0,
2555
+ // // top: 0,
2556
+ // // });
2557
+ // setTimeout(() => {
2558
+ // // root.value.scrollTo({
2559
+ // // left: treeScroll?.scrollLeft,
2560
+ // // top: treeScroll?.scrollTop,
2561
+ // // });
2562
+ // setTimeout(() => {
2563
+ // isScrolling.value = false;
2564
+ // });
2565
+ // });
2566
+ };
2567
+ var getData = function getData() {
2568
+ return flatData;
2569
+ };
2570
+ // const treeScroll: {
2571
+ // scrollLeft?: number,
2572
+ // scrollTop?: number
2573
+ // } = {};
2574
+ ctx.expose({
2575
+ handleTreeNodeClick: handleTreeNodeClick,
2576
+ isNodeChecked: isNodeChecked,
2577
+ isRootNode: isRootNode,
2578
+ isNodeOpened: isNodeOpened,
2579
+ isNodeMatched: isNodeMatched,
2580
+ hasChildNode: hasChildNode,
2581
+ setOpen: setOpen,
2582
+ setChecked: setChecked,
2583
+ setNodeAction: setNodeAction,
2584
+ setNodeOpened: setNodeOpened,
2585
+ setSelect: setSelect,
2586
+ asyncNodeClick: asyncNodeClick,
2587
+ getData: getData
2588
+ });
2589
+ var _useEmpty = use_empty(props, ctx),
2590
+ renderEmpty = _useEmpty.renderEmpty;
2591
+ use_node_drag(props, ctx, root, flatData);
2592
+ var renderTreeContent = function renderTreeContent(scopedData) {
2593
+ var _a, _b, _c;
2594
+ if (scopedData.length) {
2595
+ return scopedData.map(renderTreeNode);
2596
+ }
2597
+ var emptyType = isSearchActive.value ? 'search-empty' : 'empty';
2598
+ return (_c = (_b = (_a = ctx.slots).empty) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : renderEmpty(emptyType);
2599
+ };
2600
+ var _usePrefix = (0,external_config_provider_.usePrefix)(),
2601
+ resolveClassName = _usePrefix.resolveClassName;
2602
+ // const handleContentScroll = (args) => {
2603
+ // if (isScrolling.value) {
2604
+ // return;
2605
+ // }
2606
+ // Object.assign(treeScroll, args[1] || {});
2607
+ // console.log('handleContentScroll', treeScroll);
2608
+ // };
2609
+ return function () {
2610
+ return (0,external_vue_.createVNode)((external_virtual_render_default()), {
2611
+ "class": resolveClassName('tree'),
2612
+ "style": getTreeStyle(null, props),
2613
+ "list": renderData.value,
2614
+ "lineHeight": props.lineHeight,
2615
+ "enabled": props.virtualRender,
2616
+ "rowKey": NODE_ATTRIBUTES.UUID,
2617
+ "keepAlive": true,
2618
+ "contentClassName": resolveClassName('container'),
2619
+ "throttleDelay": 0,
2620
+ "ref": root
2621
+ }, {
2622
+ "default": function _default(scoped) {
2623
+ return renderTreeContent(scoped.data || []);
2624
+ }
2625
+ });
2626
+ };
2627
+ }
2628
+ }));
2629
+ ;// CONCATENATED MODULE: ../../packages/tree/src/index.ts
2630
+ /*
2631
+ * Tencent is pleased to support the open source community by making
2632
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2633
+ *
2634
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2635
+ *
2636
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2637
+ *
2638
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2639
+ *
2640
+ * ---------------------------------------------------
2641
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2642
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2643
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2644
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2645
+ *
2646
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2647
+ * the Software.
2648
+ *
2649
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2650
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2651
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2652
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2653
+ * IN THE SOFTWARE.
2654
+ */
2655
+
2656
+
2657
+ var BkTree = (0,external_shared_.withInstall)(tree);
2658
+ /* harmony default export */ const src = (BkTree);
2659
+ })();
2660
+
2661
+ /******/ return __webpack_exports__;
2662
+ /******/ })()
2663
+ ;
2664
+ });