bkui-vue 0.0.1-beta.44 → 0.0.1-beta.47

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 (148) hide show
  1. package/dist/index.cjs.js +27 -27
  2. package/dist/index.esm.js +689 -306
  3. package/dist/index.umd.js +28 -28
  4. package/dist/style.css +1 -1
  5. package/lib/alert/index.js +1 -0
  6. package/lib/animate-number/{animate-number.js → index.js} +1 -1
  7. package/lib/backtop/{backtop.js → index.js} +1 -1
  8. package/lib/badge/index.js +1 -0
  9. package/lib/breadcrumb/index.js +1 -0
  10. package/lib/button/index.js +1 -0
  11. package/lib/card/index.js +1 -0
  12. package/lib/checkbox/checkbox.css +12 -0
  13. package/lib/checkbox/checkbox.d.ts +5 -11
  14. package/lib/checkbox/checkbox.less +17 -0
  15. package/lib/checkbox/checkbox.variable.css +12 -0
  16. package/lib/checkbox/common.d.ts +3 -3
  17. package/lib/checkbox/index.d.ts +10 -18
  18. package/lib/checkbox/index.js +1 -0
  19. package/lib/checkbox/type.d.ts +2 -6
  20. package/lib/code-diff/index.js +1 -0
  21. package/lib/collapse/index.js +1 -0
  22. package/lib/date-picker/index.js +1 -0
  23. package/lib/dialog/dialog.css +3 -0
  24. package/lib/dialog/dialog.d.ts +89 -17
  25. package/lib/dialog/dialog.less +4 -0
  26. package/lib/dialog/dialog.variable.css +3 -0
  27. package/lib/dialog/index.d.ts +191 -36
  28. package/lib/dialog/index.js +1 -0
  29. package/lib/directives/index.js +2 -0
  30. package/lib/directives/{directives.js.LICENSE.txt → index.js.LICENSE.txt} +0 -0
  31. package/lib/divider/{divider.js → index.js} +0 -0
  32. package/lib/dropdown/{dropdown.js → index.js} +0 -0
  33. package/lib/exception/{exception.js → index.js} +1 -1
  34. package/lib/fixed-navbar/{fixed-navbar.js → index.js} +1 -1
  35. package/lib/form/compose-form-item.d.ts +16 -0
  36. package/lib/form/form.css +73 -12
  37. package/lib/form/form.less +120 -46
  38. package/lib/form/form.variable.css +167 -12
  39. package/lib/form/index.d.ts +17 -1
  40. package/lib/form/index.js +1 -0
  41. package/lib/icon/funnel.d.ts +4 -0
  42. package/lib/icon/funnel.js +1 -0
  43. package/lib/icon/index.d.ts +1 -0
  44. package/lib/icon/{icon.js → index.js} +1 -1
  45. package/lib/input/index.js +1 -0
  46. package/lib/link/{link.js → index.js} +0 -0
  47. package/lib/loading/index.js +1 -0
  48. package/lib/menu/index.js +1 -0
  49. package/lib/message/{message.js → index.js} +0 -0
  50. package/lib/modal/index.d.ts +149 -1
  51. package/lib/modal/index.js +1 -0
  52. package/lib/modal/modal.css +20 -0
  53. package/lib/modal/modal.d.ts +58 -0
  54. package/lib/modal/modal.less +25 -0
  55. package/lib/modal/modal.variable.css +20 -0
  56. package/lib/modal/props.mixin.d.ts +26 -0
  57. package/lib/navigation/index.js +1 -0
  58. package/lib/notify/index.js +1 -0
  59. package/lib/pagination/index.js +1 -0
  60. package/lib/popover/index.d.ts +33 -2
  61. package/lib/popover/index.js +1 -0
  62. package/lib/popover/popover.d.ts +16 -1
  63. package/lib/popover/props.d.ts +12 -0
  64. package/lib/process/index.js +1 -0
  65. package/lib/progress/index.js +1 -0
  66. package/lib/radio/common.d.ts +5 -5
  67. package/lib/radio/index.d.ts +17 -16
  68. package/lib/radio/index.js +1 -0
  69. package/lib/radio/radio-button.d.ts +5 -4
  70. package/lib/radio/radio.css +2 -2
  71. package/lib/radio/radio.d.ts +4 -4
  72. package/lib/radio/radio.less +2 -2
  73. package/lib/radio/radio.variable.css +2 -2
  74. package/lib/radio/type.d.ts +9 -4
  75. package/lib/rate/index.js +1 -0
  76. package/lib/resize-layout/index.js +1 -0
  77. package/lib/select/index.js +1 -0
  78. package/lib/shared/index.js +1 -0
  79. package/lib/sideslider/index.d.ts +123 -1
  80. package/lib/sideslider/index.js +1 -0
  81. package/lib/sideslider/sideslider.d.ts +58 -0
  82. package/lib/slider/index.js +1 -0
  83. package/lib/steps/index.js +1 -0
  84. package/lib/swiper/index.js +1 -0
  85. package/lib/switcher/index.js +1 -0
  86. package/lib/switcher/switcher.less +2 -0
  87. package/lib/tab/index.d.ts +1 -1
  88. package/lib/tab/index.js +1 -0
  89. package/lib/tab/tab-panel.d.ts +1 -1
  90. package/lib/table/index.js +1 -0
  91. package/lib/table/plugins/head-filter.css +68 -0
  92. package/lib/table/plugins/head-filter.less +83 -0
  93. package/lib/table/plugins/head-filter.variable.css +162 -0
  94. package/lib/table/plugins/head-sort.css +22 -0
  95. package/lib/table/plugins/head-sort.less +28 -0
  96. package/lib/table/plugins/head-sort.variable.css +116 -0
  97. package/lib/table/props.d.ts +8 -1
  98. package/lib/table/render.d.ts +10 -15
  99. package/lib/table/table.css +94 -26
  100. package/lib/table/table.less +9 -28
  101. package/lib/table/table.variable.css +108 -40
  102. package/lib/table/utils.d.ts +10 -1
  103. package/lib/tag/index.js +1 -0
  104. package/lib/tag-input/index.js +1 -0
  105. package/lib/timeline/{timeline.js → index.js} +0 -0
  106. package/lib/transfer/index.js +1 -0
  107. package/lib/tree/index.js +1 -0
  108. package/lib/virtual-render/index.js +1 -0
  109. package/package.json +30 -16
  110. package/lib/alert/alert.js +0 -1
  111. package/lib/badge/badge.js +0 -1
  112. package/lib/breadcrumb/breadcrumb.js +0 -1
  113. package/lib/button/button.js +0 -1
  114. package/lib/card/card.js +0 -1
  115. package/lib/checkbox/checkbox.js +0 -1
  116. package/lib/code-diff/code-diff.js +0 -1
  117. package/lib/collapse/collapse.js +0 -1
  118. package/lib/date-picker/date-picker.js +0 -1
  119. package/lib/dialog/dialog.js +0 -1
  120. package/lib/directives/directives.js +0 -2
  121. package/lib/form/form.js +0 -1
  122. package/lib/input/input.js +0 -1
  123. package/lib/loading/loading.js +0 -1
  124. package/lib/menu/menu.js +0 -1
  125. package/lib/modal/modal.js +0 -1
  126. package/lib/navigation/navigation.js +0 -1
  127. package/lib/notify/notify.js +0 -1
  128. package/lib/pagination/pagination.js +0 -1
  129. package/lib/popover/popover.js +0 -1
  130. package/lib/process/process.js +0 -1
  131. package/lib/progress/progress.js +0 -1
  132. package/lib/radio/radio.js +0 -1
  133. package/lib/rate/rate.js +0 -1
  134. package/lib/resize-layout/resize-layout.js +0 -1
  135. package/lib/select/select.js +0 -1
  136. package/lib/shared/shared.js +0 -1
  137. package/lib/sideslider/sideslider.js +0 -1
  138. package/lib/slider/slider.js +0 -1
  139. package/lib/steps/steps.js +0 -1
  140. package/lib/swiper/swiper.js +0 -1
  141. package/lib/switcher/switcher.js +0 -1
  142. package/lib/tab/tab.js +0 -1
  143. package/lib/table/table.js +0 -1
  144. package/lib/tag/tag.js +0 -1
  145. package/lib/tag-input/tag-input.js +0 -1
  146. package/lib/transfer/transfer.js +0 -1
  147. package/lib/tree/tree.js +0 -1
  148. package/lib/virtual-render/virtual-render.js +0 -1
@@ -1 +0,0 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/toConsumableArray"),require("vue"),require("../directives"),require("../icon"),require("../loading"),require("../popover"),require("../shared"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/typeof","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/toConsumableArray","vue","../directives","../icon","../loading","../popover","../shared"],t);else{var r="object"==typeof exports?t(require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/toConsumableArray"),require("vue"),require("../directives"),require("../icon"),require("../loading"),require("../popover"),require("../shared")):t(e["@babel/runtime/helpers/typeof"],e["@babel/runtime/helpers/slicedToArray"],e["@babel/runtime/helpers/defineProperty"],e["@babel/runtime/helpers/toConsumableArray"],e.vue,e["../directives"],e["../icon"],e["../loading"],e["../popover"],e["../shared"]);for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(self,((e,t,r,a,n,o,l,i,s,u)=>(()=>{"use strict";var c={4061:e=>{e.exports=o},6870:e=>{e.exports=l},4870:e=>{e.exports=i},5537:e=>{e.exports=s},4212:e=>{e.exports=u},311:e=>{e.exports=r},1673:e=>{e.exports=t},642:e=>{e.exports=a},8541:t=>{t.exports=e},748:e=>{e.exports=n}},d={};function p(e){var t=d[e];if(void 0!==t)return t.exports;var r=d[e]={exports:{}};return c[e](r,r.exports,p),r.exports}p.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return p.d(t,{a:t}),t},p.d=(e,t)=>{for(var r in t)p.o(t,r)&&!p.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},p.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};return(()=>{p.r(f),p.d(f,{default:()=>w});var e=p(8541),t=p.n(e),r=p(1673),a=p.n(r),n=p(311),o=p.n(n),l=p(642),i=p.n(l),s=p(748),u=p(4061),c=p(6870),d=p(4870),g=p.n(d),v=p(5537),h=p.n(v),y=12,m=function(e){for(var t=e.length,r=0,a=0;a<t;a++)0!=(65280&e.charCodeAt(a))&&(r+=1),r+=1;return r},b=p(4212);const T=(0,s.defineComponent)({name:"ListTagRender",props:{node:b.PropTypes.object,searchKey:b.PropTypes.oneOfType([b.PropTypes.string,b.PropTypes.arrayOf(b.PropTypes.string)]),displayKey:b.PropTypes.string,searchKeyword:b.PropTypes.string,tpl:{type:Function,default:null}},render:function(){var e=this,t=arguments[0],r=function(t){if(e.searchKeyword){var r=new RegExp("(".concat(e.searchKeyword,")"),"i");return t.replace(r,'<strong class="highlight-text">$1</strong>')}return t};if(this.tpl)return this.tpl(this.node,r,t,this);var a=this.node[this.displayKey];return(0,s.createVNode)("div",{class:"bk-selector-node"},[(0,s.createVNode)("span",{class:"text",innerHTML:r(a)},[a])])}}),L=(0,s.defineComponent)({name:"TagRender",props:{node:b.PropTypes.object,displayKey:b.PropTypes.string,tpl:{type:Function,default:null}},render:function(){var e=arguments[0];return this.tpl?this.tpl(this.node,e,this):(0,s.createVNode)("div",{class:"tag"},[(0,s.createVNode)("span",{class:"text"},[this.node[this.displayKey]])])}}),P=(0,s.defineComponent)({name:"BkTagInput",directives:{bkTooltips:u.bkTooltips},props:{modelValue:b.PropTypes.arrayOf(b.PropTypes.string).def([]),placeholder:b.PropTypes.string.def("请输入并按 Enter 结束"),list:b.PropTypes.arrayOf(b.PropTypes.object).def([]),disabled:b.PropTypes.bool.def(!1),tooltipKey:b.PropTypes.string.def(""),saveKey:b.PropTypes.string.def("id"),displayKey:b.PropTypes.string.def("name"),hasDeleteIcon:b.PropTypes.bool.def(!1),clearable:b.PropTypes.bool.def(!0),trigger:b.PropTypes.commonType(["focus","search"]).def("search"),searchKey:b.PropTypes.oneOfType([b.PropTypes.string,b.PropTypes.arrayOf(b.PropTypes.string)]).def("name"),useGroup:b.PropTypes.bool.def(!1),allowCreate:b.PropTypes.bool.def(!1),maxData:b.PropTypes.number.def(-1),maxResult:b.PropTypes.number.def(10),contentMaxHeight:b.PropTypes.number.def(300),contentWidth:b.PropTypes.number.def(190),separator:b.PropTypes.string.def(""),allowNextFocus:b.PropTypes.bool.def(!0),allowAutoMatch:b.PropTypes.bool.def(!1),showClearOnlyHover:b.PropTypes.bool.def(!1),leftSpace:b.PropTypes.number.def(0),createTagValidator:{type:Function,default:null},filterCallback:{type:Function,default:null},tagTpl:{type:Function,default:null},tpl:{type:Function,default:null},pasteFn:{type:Function,default:null}},emits:["update:modelValue","change","select","blur","remove","removeAll"],setup:function(e,r){var n=r.emit,l=(0,s.reactive)({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),u=(0,s.reactive)({isShow:!1,width:190,modifiers:[{name:"offset",options:{offset:[0,4]}}]}),c=function(e){var t=(0,s.reactive)({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:function(){var e,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.curPage=1,t.totalSize=a.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;var n=[];if(t.pageSize>0)for(var o=0;o<t.totalSize;o+=t.pageSize)n.push(a.slice(o,o+t.pageSize));(e=t.renderListPaged).splice.apply(e,[0,t.renderListPaged.length].concat(n)),(r=t.curPageList).splice.apply(r,[0,t.curPageList.length].concat(i()(t.renderListPaged[t.curPage-1]||[])))},pageChange:function(e){var r;t.curPage=e,(r=t.curPageList).splice.apply(r,[t.curPageList.length,0].concat(i()(t.renderListPaged[t.curPage-1]||[]))),t.isPageLoading=!1}}}((0,s.toRefs)(e).maxResult),d=c.pageState,p=c.initPage,f=c.pageChange,g=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,a=e;return(0,s.customRef)((function(e,n){return{get:function(){return e(),a},set:function(e){clearTimeout(t),t=setTimeout((function(){a=e,n()}),r)}}}))}("",150),v=(0,s.ref)(null),h=(0,s.ref)(null),b=(0,s.ref)(null),T=(0,s.ref)(null),L=(0,s.ref)(null),P=(0,s.ref)(null),w=(0,s.ref)(null),x=(0,s.computed)((function(){return!e.disabled&&e.hasDeleteIcon})),I=(0,s.computed)((function(){return 1===e.maxData})),C=(0,s.computed)((function(){return 0===A.selectedTagList.length&&""===g.value&&!l.isEdit})),S=(0,s.computed)((function(){return e.clearable&&!e.disabled&&0!==A.selectedTagList.length&&(!e.showClearOnlyHover||l.isHover)})),K=(0,s.computed)((function(){return{"bk-tag-input-trigger":!0,active:l.isEdit,disabled:e.disabled}}));(0,s.watch)([function(){return i()(e.modelValue)},function(){return i()(e.list)}],(function(){D()})),(0,s.watch)(g,(function(t){var r=0!==d.curPageList.length;""!==t&&r||""===t&&"focus"===e.trigger?u.isShow=!0:"focus"===e.trigger&&r||(u.isShow=!1)})),(0,s.watch)((function(){return u.isShow}),(function(e){k(),e&&L.value&&((0,s.nextTick)((function(){L.value.scrollTop=0})),L.value.removeEventListener("scroll",V),L.value.addEventListener("scroll",V))}));var k=function(){var e,t,r=I.value?0:null===(e=T.value)||void 0===e?void 0:e.offsetLeft;u.modifiers=[{name:"offset",options:{offset:[r,4]}}],null===(t=P.value)||void 0===t||t.update()},V=function(){if(!d.isPageLoading&&0!==L.value.scrollTop){var e=L.value;if(e.scrollTop+e.offsetHeight>=e.scrollHeight){var t=d.curPage+1;t<=d.totalPage&&(d.isPageLoading=!0,setTimeout((function(){f(t)}),500))}}},N=function(){var e;return Array.from((null===(e=b.value)||void 0===e?void 0:e.childNodes)||[]).filter((function(e){return e.nodeType!==Node.TEXT_NODE}))},R=function(t){if(!e.disabled){if(null==t?void 0:t.target){var r=t.target.className;(r.indexOf("bk-tag-input-trigger")>-1||r.indexOf("tag-list")>-1)&&b.value.appendChild(T.value)}clearTimeout(w.value),I.value&&O.value.length&&(A.tagListCache=i()(O.value),A.selectedTagListCache=i()(A.selectedTagList),g.value=A.selectedTagListCache[0][e.saveKey],U(A.selectedTagList[0],0),H()),l.isEdit=!0,(0,s.nextTick)((function(){var t;null===(t=v.value)||void 0===t||t.focus(),"focus"===e.trigger&&0!==A.localList.length&&(j(),u.isShow?k():u.isShow=!0)}))}},A=(0,s.reactive)({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),O=(0,s.computed)((function(){return A.selectedTagList.map((function(t){return t[e.saveKey]}))})),E=function(e){var t=(0,s.toRefs)(e),r=t.useGroup,a=t.saveKey,n=t.displayKey,o=t.list,l=(0,s.reactive)([]);return(0,s.watch)([r,a,n,o],(function(){var e=o.value;r.value&&(e=o.value.reduce((function(e,t){var r=[];return t.children&&(r=t.children.map((function(e){return Object.assign({group:{groupId:t[a.value],groupName:t[n.value]}},e)}))),e.concat(r)}),[])),l.splice.apply(l,[0,l.length].concat(i()(e)))}),{immediate:!0,deep:!0}),l}(e),q=(0,s.computed)((function(){if(e.useGroup){var t={};return d.curPageList.forEach((function(e,r){e.__index__=r,t[e.group.groupId]||(t[e.group.groupId]={id:e.group.groupId,name:e.group.groupName,children:[]}),t[e.group.groupId].children.push(e)})),Object.keys(t).map((function(e){return t[e]}))}return d.curPageList})),D=function(){var t=e.saveKey,r=e.modelValue,a=e.displayKey,n=e.allowCreate,l=e.trigger;A.selectedTagList=[],A.localList=i()(E),r.length&&(r.forEach((function(e){var r=A.localList.find((function(r){return e===r[t]}));if(void 0!==r)A.selectedTagList.push(r);else if(n&&!O.value.includes(e)){var l;A.selectedTagList.push((l={},o()(l,t,e),o()(l,a,e),l))}})),I.value||(A.localList=A.localList.filter((function(e){return!r.includes(e[t])})))),"focus"===l&&j()},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=e.searchKey,a=e.filterCallback,n=t.toLowerCase(),o=[];if("function"==typeof a)o=a(n,r,A.localList)||[];else if(Array.isArray(r)){var l=r.map((function(e){return A.localList.filter((function(t){return-1!==t[e].toLowerCase().indexOf(n)}))}));o=Array.from(new Set(l.flat()))}else o=A.localList.filter((function(e){return-1!==e[r].toLowerCase().indexOf(n)}));p(o)};(0,s.onMounted)((function(){D()}));var F=function(){g.value=""},z=function(){if(I.value)return 0;var e=N().findIndex((function(e){return"tagInputItem"===e.id}));return e>=0?e:0},_=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t&&e){var a=t;r&&(a=t.nextElementSibling||null),t.parentNode.insertBefore(e,a)}},H=function(t){var r=e.maxData,a=e.trigger,n=e.allowCreate;if(-1===r||r>O.value.length){var o=((null==t?void 0:t.target)?t.target:g).value,i=m(o);i?(j(o),v.value.style.width="".concat(i*y,"px")):"focus"===a&&j()}else M(),g.value="",u.isShow=!1;l.isEdit=!0,l.focusItemIndex=n?-1:0},M=function(){w.value=setTimeout((function(){var t=g.value;if(F(),l.isEdit=!1,I.value){var r=a()(A.tagListCache,1)[0];t&&t===r&&A.selectedTagListCache.length?W(A.selectedTagListCache[0],"select"):G("remove")}else if(e.allowAutoMatch&&t){var o=d.curPageList.find((function(r){return Array.isArray(e.searchKey)?e.searchKey.map((function(e){return r[e]})).includes(t):r[e.searchKey]===t}));o?B(o,"select"):e.allowCreate&&B(t,"custom")}u.isShow=!1,n("blur",t,O.value)}),50)},B=function(e,t,r){null==r||r.stopPropagation(),e&&!e.disabled&&(I.value&&(A.tagListCache=[],A.selectedTagListCache=[],A.selectedTagList=[]),W(e,t),G("select"),F(),u.isShow=!1)},G=function(e){n("change",O.value),n(e),n("update:modelValue",O.value)},Z=function(){var e=L.value.clientHeight,t=L.value.getBoundingClientRect().y;(0,s.nextTick)((function(){var r=L.value.querySelector(".bk-selector-actived");if(r){var a=r.clientHeight,n=r.getBoundingClientRect().y;n<t&&(L.value.scrollTop=L.value.scrollTop-(t-n));var o=n+a-t;o>e&&(L.value.scrollTop=L.value.scrollTop+o-e)}}))},W=function(r,a){if(!(A.selectedTagList.length>=e.maxData&&-1!==e.maxData)){var n,l=e.separator,u=e.saveKey,c=e.displayKey,d=e.createTagValidator,p=z(),f=1,g=!1,h=function(e){return"function"!=typeof d||d(e)},m=function(e){return A.localList.find((function(t){return t[u]===e}))};if("custom"===a)if(l){var b,L=r.split(l),P=(L=L.filter((function(e){return(null==e?void 0:e.trim())&&!O.value.includes(e)&&h(e)}))).map((function(e){var t;return m(e)||(t={},o()(t,u,e),o()(t,c,e),t)}));L.length&&((b=A.selectedTagList).splice.apply(b,[p,0].concat(i()(P))),f=P.length,g=!0)}else{var w="object"===t()(r);if(void 0!==(n=(n=w?r[u]:r.trim()).replace(/\s+/g,""))&&!O.value.includes(n)&&h(n)){var x,C=m(n)||(w?r:(x={},o()(x,u,n),o()(x,c,n),x));A.selectedTagList.splice(p,0,C),g=!0}}else r&&(void 0===(n=r[u])||O.value.includes(n)||(A.selectedTagList.splice(p,0,r),g=!0));g&&(0,s.nextTick)((function(){for(var t=1;t<=f;t++){var r=N()[p+t];_(r,T.value)}v.value.style.width="".concat(y,"px"),I.value||(e.allowNextFocus&&R(),A.localList=A.localList.filter((function(e){return!O.value.includes(e[u])})))}))}},U=function(t,r){A.selectedTagList.splice(r,1);var a=E.some((function(r){return r===t[e.saveKey]}));(e.allowCreate&&a||!e.allowCreate)&&!I.value&&A.localList.push(t)};return Object.assign(Object.assign(Object.assign(Object.assign({popoverProps:u},(0,s.toRefs)(l)),(0,s.toRefs)(A)),(0,s.toRefs)(d)),{isShowPlaceholder:C,isShowClear:S,curInputValue:g,formatList:E,renderList:q,showTagClose:x,tagInputRef:v,bkTagSelectorRef:h,tagListRef:b,tagInputItemRef:T,selectorListRef:L,popoverRef:P,triggerClass:K,focusInputTrigger:R,activeClass:function(t,r){var a={"bk-selector-actived":!1,"bk-selector-selected":O.value.includes(t[e.saveKey])};return e.useGroup?a["bk-selector-actived"]=t.__index__===l.focusItemIndex:a["bk-selector-actived"]=r===l.focusItemIndex,a},handleInput:H,handleFocus:function(){var t;u.width=I.value?null===(t=h.value)||void 0===t?void 0:t.clientWidth:e.contentWidth},handleBlur:M,handleTagSelected:B,handleTagRemove:function(e,t,r){null==r||r.stopPropagation(),U(e,t),F(),G("remove"),v.value.style.width="".concat(y,"px")},handleClear:function(t){t.stopPropagation();var r=A.selectedTagList;A.selectedTagList=[];var a,n=E.filter((function(t){return r.some((function(r){return r[e.saveKey]===t[e.saveKey]}))}));(!e.allowCreate||0===n.length)&&e.allowCreate||I.value||(a=A.localList).push.apply(a,i()(n)),G("removeAll")},tagFocus:function(t){e.disabled||(_(T.value,t.currentTarget,!0),v.value.style.width="".concat(y,"px"),u.isShow&&k())},handleKeydown:function(t){if(!d.isPageLoading){var r=t.target.value,a=m(r),n=z(),o=N();switch(t.code){case"ArrowUp":if(t.preventDefault(),!u.isShow)return;l.focusItemIndex=l.focusItemIndex-1,l.focusItemIndex=l.focusItemIndex<0?-1:l.focusItemIndex,-1===l.focusItemIndex&&(l.focusItemIndex=d.curPageList.length-1),Z();break;case"ArrowDown":if(t.preventDefault(),!u.isShow)return;l.focusItemIndex=l.focusItemIndex+1,l.focusItemIndex=l.focusItemIndex>d.curPageList.length-1?d.curPageList.length:l.focusItemIndex,l.focusItemIndex===d.curPageList.length&&(l.focusItemIndex=0),Z();break;case"ArrowLeft":if(l.isEdit=!0,!a){if(n<1)return;_(T.value,o[n-1]),R()}break;case"ArrowRight":if(l.isEdit=!0,!a){if(n===o.length-1)return;_(o[n+1],T.value),R()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&u.isShow||e.allowCreate&&l.focusItemIndex>=0&&u.isShow?B(d.curPageList[l.focusItemIndex],"select",t):e.allowCreate&&B(g.value,"custom",t),t.preventDefault();break;case"Backspace":0===n||g.value||function(t,r){var a=N();_(T.value,a[t-1]),A.selectedTagList.splice(t-1,1),R();var n=E.some((function(t){return t===r[e.saveKey]}));(e.allowCreate&&n||!e.allowCreate)&&!I.value&&A.localList.push(r),v.value="".concat(y,"px"),G("remove")}(n,A.selectedTagList[n-1])}}},handlePaste:function(t){if(t.preventDefault(),I.value)return!1;var r=e.maxData,a=e.saveKey,n=e.pasteFn,l=t.clipboardData.getData("text"),s=n?n(l):function(t){var r=[];return t.split(";").forEach((function(t){if(t.match(/^[a-zA-Z][a-zA-Z_]+/g)){var a,n=t.match(/^[a-zA-Z][a-zA-Z_]+/g).join("");r.push((a={},o()(a,e.saveKey,n),o()(a,e.displayKey,n),a))}})),r}(l),u=s.map((function(e){return e[a]}));if(u.length){var c=N(),d=z(),p=A.localList.map((function(e){return e[a]}));if(u=u.filter((function(e){return(null==e?void 0:e.trim())&&!O.value.includes(e)&&p.includes(e)})),-1!==r){var f=A.selectedTagList.length;if(f<r){var g=r-f;u.length>g&&(u=i()(u.slice(0,g)))}else u=[]}var h,m=A.localList.filter((function(e){return u.includes(e[a])}));u.length&&((h=A.selectedTagList).splice.apply(h,[d,0].concat(i()(m))),_(T.value,c[d]),v.value.style.width="".concat(y,"px"),A.localList=A.localList.filter((function(e){return!u.includes(e[a])})),G("select"),R())}}})},render:function(){var e=this;return(0,s.createVNode)("div",{class:"bk-tag-input",ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:function(){return e.isHover=!0},onMouseleave:function(){return e.isHover=!1}},[(0,s.createVNode)(h(),{ref:"popoverRef",theme:"light",trigger:"manual",placement:"bottom-start",arrow:!1,width:this.popoverProps.width,isShow:this.popoverProps.isShow,modifiers:this.popoverProps.modifiers},{default:function(){return(0,s.createVNode)("div",{class:e.triggerClass},[(0,s.createVNode)("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:"".concat(e.leftSpace,"px")}},[e.selectedTagList.map((function(t,r){var a={boundary:"window",theme:"light",distance:12,content:t[e.tooltipKey],disabled:!e.tooltipKey};return(0,s.withDirectives)((0,s.createVNode)("li",{class:"tag-item",onClick:e.tagFocus},[(0,s.createVNode)(L,{node:t,tpl:e.tagTpl,displayKey:e.displayKey},null),e.showTagClose?(0,s.createVNode)(c.Error,{class:"remove-tag",onClick:e.handleTagRemove.bind(e,t,r)},null):null]),[[(0,s.resolveDirective)("bk-tooltips"),a]])})),(0,s.withDirectives)((0,s.createVNode)("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[(0,s.createVNode)("input",(0,s.mergeProps)({"on-input":function(t){t.target.composing||(e.curInputValue=t.target.value)},type:"text",class:"tag-input",ref:"tagInputRef",onInput:e.handleInput,onFocus:e.handleFocus,onBlur:e.handleBlur,onKeydown:e.handleKeydown,onPaste:e.handlePaste,"domProps-value":e.curInputValue},{directives:[{name:"model",value:e.curInputValue,modifiers:{}}]}),null)]),[[s.vShow,e.isEdit]])]),(0,s.withDirectives)((0,s.createVNode)("p",{class:"placeholder"},[e.placeholder]),[[s.vShow,e.isShowPlaceholder]]),e.isShowClear?(0,s.createVNode)(c.Close,{class:"clear-icon",onClick:e.handleClear},null):null])},content:function(){return(0,s.createVNode)("div",{class:"bk-selector-list"},[(0,s.createVNode)("ul",{ref:"selectorListRef",style:{"max-height":"".concat(e.contentMaxHeight,"px")},class:"outside-ul"},[e.useGroup?e.renderList.map((function(t){return(0,s.createVNode)("li",{class:"bk-selector-group-item"},[(0,s.createVNode)("span",{class:"group-name"},[t.name,(0,s.createTextVNode)(" ("),t.children.length,(0,s.createTextVNode)(")")]),(0,s.createVNode)("ul",{class:"bk-selector-group-list-item"},[t.children.map((function(t,r){return(0,s.createVNode)("li",{class:["bk-selector-list-item",{disabled:t.disabled},e.activeClass(t,r)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,s.createVNode)(T,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])}))])])})):e.renderList.map((function(t,r){return(0,s.createVNode)("li",{class:["bk-selector-list-item",{disabled:t.disabled},e.activeClass(t,r)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,s.createVNode)(T,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])})),e.isPageLoading?(0,s.createVNode)("li",{class:"bk-selector-list-item loading"},[(0,s.createVNode)(g(),{theme:"primary",size:d.BkLoadingSize.Small},null)]):null])])}})])}});P.install=function(e){e.component(P.name,P)};const w=P})(),f})()));
@@ -1 +0,0 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/toConsumableArray"),require("vue"),require("../icon/"),require("../input"));else if("function"==typeof define&&define.amd)define(["../shared","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/toConsumableArray","vue","../icon/","../input"],t);else{var r="object"==typeof exports?t(require("../shared"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/toConsumableArray"),require("vue"),require("../icon/"),require("../input")):t(e["../shared"],e["@babel/runtime/helpers/slicedToArray"],e["@babel/runtime/helpers/toConsumableArray"],e.vue,e["../icon/"],e["../input"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,a,o)=>(()=>{"use strict";var l={7685:e=>{e.exports=a},8133:e=>{e.exports=o},4212:t=>{t.exports=e},1673:e=>{e.exports=t},642:e=>{e.exports=r},748:e=>{e.exports=n}},u={};function i(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return l[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{i.r(s),i.d(s,{default:()=>f});var e=i(4212),t=i(1673),r=i.n(t),n=i(642),a=i.n(n),o=i(748),l=i(7685),u=i(8133),c=i.n(u);e.PropTypes.string,e.PropTypes.string,e.PropTypes.string,e.PropTypes.string,e.PropTypes.bool,e.PropTypes.bool,e.PropTypes.string,e.PropTypes.bool;const v=(0,o.defineComponent)({name:"Transfer",props:{title:{type:Array,default:function(){return[]}},extCls:{type:String,default:""},searchPlaceholder:{type:String,default:""},settingKey:{type:String,default:"id"},displayKey:{type:String,default:"value"},sortKey:{type:String,default:""},showOverflowTips:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},sortable:{type:Boolean,default:!1},sourceList:{type:Array,default:function(){return[]}},targetList:{type:Array,default:function(){return[]}},emptyContent:{type:Array,default:function(){return[]}}},emits:["change"],slots:["left-header","right-header","source-option","target-option","left-empty-content","right-empty-content"],setup:function(t,n){var l=n.emit,u=[],i=t.sortKey,s=t.sortable,c=(0,o.ref)(""),v=(0,o.ref)(null),f=(0,o.ref)([]),d=(0,o.ref)([]),p=(0,o.ref)(-1),h=(0,o.ref)(-1),y=(0,o.computed)((function(){return t.sourceList&&Array.isArray(t.sourceList)?-1!==t.sourceList.toString().indexOf("[object Object]"):"empty"})),g=(0,o.computed)((function(){return y.value?t.settingKey:"index"})),b=(0,o.computed)((function(){return y.value?t.displayKey:"value"})),m=(0,o.computed)((function(){return c.value?f.value.filter((function(t){return!(0,e.isEmpty)(t[b.value])&&String(t[b.value]).indexOf(c.value)>-1})):f.value}));(0,o.watch)((function(){return t.sourceList}),(function(){"empty"!==y.value&&(L(),N())}),{deep:!0}),(0,o.watch)((function(){return t.targetList}),(function(){L(),N()}),{deep:!0}),(0,o.watch)((function(){return[b.value,g.value]}),(function(){L()})),(0,o.watch)((function(){return t.sortKey}),(function(e){i=e,N()})),(0,o.watch)((function(){return t.sortable}),(function(e){s=e,N()}));var L=function(){"empty"!==y.value&&(y.value?T():x())},x=function(){if(!t.targetList.length||t.targetList.length>t.sourceList.length){for(var e,r=[],n=0;n<t.sourceList.length;n++)r.push({index:n,value:t.sourceList[n]});f.value=[].concat(r),(e=d.value).splice.apply(e,[0,d.value.length].concat([])),l("change",f.value,[],[])}else{for(var o=[],u=[],i=0;i<t.sourceList.length;i++)o.push({index:i,value:t.sourceList[i]});t.targetList.forEach((function(e){var t=o.find((function(t){return t.value===e}));t&&u.push(t)})),d.value=[].concat(u);var s=o.filter((function(e){return u.every((function(t){return t.index!==e.index}))}));f.value=a()(s),l("change",f.value,a()(C(d.value,!1)),[])}},T=function(){if(!t.targetList.length||t.targetList.length>t.sourceList.length){var e;(e=f.value).splice.apply(e,[0,f.value.length].concat(a()(t.sourceList))),d.value=[],l("change",f.value,[],[])}else{var r=t.sourceList.filter((function(e){return t.targetList.every((function(t){return t!==e[g.value]}))})),n=[];t.sourceList.forEach((function(e){t.targetList.forEach((function(t){e[g.value]===t&&n.push(e)}))})),d.value=[].concat(n),f.value=a()(r);var o=a()(C(d.value));l("change",f.value,d.value,o)}},N=function(){var e=[];if(y.value)s||(i=""),e=a()(t.sourceList);else{i=s?"index":"";for(var r=0;r<t.sourceList.length;r++)e.push({index:r,value:t.sourceList[r]})}if(i){var n=[];if(e.forEach((function(e){n.push(e[i])})),(u=[].concat(n)).length===t.sourceList.length){var o=a()(f.value);f.value=a()(P(o,i,u))}}},V=function(){var e=f.value,t=y.value?d.value:a()(C(d.value,!1)),r=y.value?a()(C(d.value)):[];l("change",e,t,r)},C=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[];if(!e.length)return[];var o=a()(e);return o.forEach((function(e){if(t)for(var a=0,o=Object.entries(e);a<o.length;a++){var l=r()(o[a],2),u=l[0],i=l[1];u===g.value&&n.push(i)}else n.push(e.value)})),n},P=function(e,t,r){var n=r;return e.sort((function(e,r){return n.indexOf(e[t])-n.indexOf(r[t])>=0}))},S=function(e){f.value=f.value.filter((function(t){return t[g.value]!==e[g.value]}))};return"empty"!==y.value&&(y.value?T():x(),N()),{keyword:c,transferRef:v,dataList:f,allToRight:function(){p.value=-1;var e=m.value,r=d.value;e.forEach((function(e){r.push(e),S(e)})),u.length===t.sourceList.length?d.value=a()(P(r,i,u)):d.value=a()(r),V()},allToLeft:function(){h.value=-1;for(var e=d.value,r=f.value;e.length;){var n=e.shift();r.push(n),u.length===t.sourceList.length?f.value=a()(P(r,i,u)):f.value=a()(r)}V()},displayDataList:m,displayCode:b,leftHoverIndex:p,rightHoverIndex:h,handleItemMouseEvent:function(e,t,r,n){t.preventDefault(),t.stopPropagation();var a="over"===e?n:-1;r?p.value=a:h.value=a},handleItemClick:function(e,r,n){e.preventDefault(),e.stopPropagation(),n?p.value=-1:h.value=-1;var o=n?m.value[r]:d.value.splice(r,1)[0],l=n?d.value:f.value;l.push(o),n&&S(o);var s=u.length===t.sourceList.length?a()(P(l,i,u)):a()(l);n?d.value=a()(s):f.value=a()(s),V()},hasSelectedList:d}},render:function(){var e=this,t=this.$props,r=t.extCls,n=t.title,a=t.emptyContent,u=t.searchable,i=t.searchPlaceholder,s=function(t){var r,a,l="left-header"===t,u="".concat(l?null!==(r=n[0])&&void 0!==r?r:"左侧列表":null!==(a=n[1])&&void 0!==a?a:"右侧列表"),i=l?!e.dataList.length:!e.hasSelectedList.length;return e.$slots[t]?(0,o.createVNode)("div",{class:"slot-header"},[(0,o.createVNode)("div",{class:"slot-content"},[e.$slots[t]()])]):(0,o.createVNode)("div",{class:"header"},["".concat(u,"(共").concat(e.dataList.length,"条)"),(0,o.createVNode)("span",{class:{disabled:i},onClick:function(){return l&&e.dataList.length&&e.allToRight(),void(!l&&e.hasSelectedList.length&&e.allToLeft())}},[l?"全部添加":"清空"])])},v=function(t,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=n?e.leftHoverIndex:e.rightHoverIndex;return(0,o.createVNode)("div",{class:"item-content"},[(0,o.createVNode)("span",{class:"content-text",title:t[e.displayCode]},[t[e.displayCode]]),(0,o.createVNode)("span",{class:["icon-wrapper",r===a?"hover":""]},[n?(0,o.createVNode)(l.ArrowsRight,{class:"bk-icon"},null):(0,o.createVNode)(l.Error,{class:"bk-icon"},null)])])},f=function(t){var r="left"===t,n=r?e.displayDataList:e.hasSelectedList,l=r?"source-option":"target-option",i=r?"left-empty-content":"right-empty-content";return n.length?(0,o.createVNode)("ul",{class:["content",u&&r?"is-search":""]},[n.map((function(t,n){var a,u,i;return(0,o.createVNode)("li",{key:n,class:[e.$slots[l]?"custom-item":""],onClick:function(t){return e.handleItemClick(t,n,r)},onMouseover:function(t){return e.handleItemMouseEvent("over",t,r,n)},onMouseleave:function(t){return e.handleItemMouseEvent("leave",t,r,n)}},[null!==(i=null===(u=(a=e.$slots)[l])||void 0===u?void 0:u.call(a,t))&&void 0!==i?i:v(t,n,r)])}))]):function(t){var r,n="left-empty-content"===t,l=null!==(r=n?a[0]:a[1])&&void 0!==r?r:n?"无数据":"未选择任何项";return e.$slots[t]?(0,o.createVNode)("div",null,[e.$slots[t]()]):(0,o.createVNode)("div",{class:"empty"},[l])}(i)};return(0,o.createVNode)("div",{class:["bk-transfer",r],ref:"transferRef"},[(0,o.createVNode)("div",{class:"source-list"},[s("left-header"),u&&(0,o.createVNode)(c(),{class:"transfer-search-input",clearable:!0,placeholder:i||"请输入搜索关键字",type:"search","left-icon":"bk-icon icon-search",model:{value:e.keyword,callback:function(t){e.keyword=t}}},null),f("left")]),(0,o.createVNode)("div",{class:"transfer"},null),(0,o.createVNode)("div",{class:"target-list"},[s("right-header"),f("right")])])}}),f=(0,e.withInstall)(v)})(),s})()));
package/lib/tree/tree.js DELETED
@@ -1 +0,0 @@
1
- !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("../shared"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/defineProperty"),require("vue"),require("../icon/"),require("../virtual-render"),require("@babel/runtime/helpers/toConsumableArray"));else if("function"==typeof define&&define.amd)define(["../shared","@babel/runtime/helpers/typeof","@babel/runtime/helpers/defineProperty","vue","../icon/","../virtual-render","@babel/runtime/helpers/toConsumableArray"],n);else{var r="object"==typeof exports?n(require("../shared"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/defineProperty"),require("vue"),require("../icon/"),require("../virtual-render"),require("@babel/runtime/helpers/toConsumableArray")):n(e["../shared"],e["@babel/runtime/helpers/typeof"],e["@babel/runtime/helpers/defineProperty"],e.vue,e["../icon/"],e["../virtual-render"],e["@babel/runtime/helpers/toConsumableArray"]);for(var t in r)("object"==typeof exports?exports:e)[t]=r[t]}}(self,((e,n,r,t,o,i,a)=>(()=>{var l={8022:(e,n,r)=>{var t=r(4481),o=r(6426),i=o;i.v1=t,i.v4=o,e.exports=i},8725:e=>{for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var t=r||0,o=n;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].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 r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var t=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;return t}}},4481:(e,n,r)=>{var t,o,i=r(9157),a=r(8725),l=0,u=0;e.exports=function(e,n,r){var c=n&&r||0,s=n||[],d=(e=e||{}).node||t,f=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==f){var p=i();null==d&&(d=t=[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:u+1,h=v-l+(y-u)/1e4;if(h<0&&void 0===e.clockseq&&(f=f+1&16383),(h<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,u=y,o=f;var _=(1e4*(268435455&(v+=122192928e5))+y)%4294967296;s[c++]=_>>>24&255,s[c++]=_>>>16&255,s[c++]=_>>>8&255,s[c++]=255&_;var b=v/4294967296*1e4&268435455;s[c++]=b>>>8&255,s[c++]=255&b,s[c++]=b>>>24&15|16,s[c++]=b>>>16&255,s[c++]=f>>>8|128,s[c++]=255&f;for(var m=0;m<6;++m)s[c+m]=d[m];return n||a(s)}},6426:(e,n,r)=>{var t=r(9157),o=r(8725);e.exports=function(e,n,r){var i=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||t)();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)}},7685:e=>{"use strict";e.exports=o},4212:n=>{"use strict";n.exports=e},3511:e=>{"use strict";e.exports=i},311:e=>{"use strict";e.exports=r},642:e=>{"use strict";e.exports=a},8541:e=>{"use strict";e.exports=n},748:e=>{"use strict";e.exports=t}},u={};function c(e){var n=u[e];if(void 0!==n)return n.exports;var r=u[e]={exports:{}};return l[e](r,r.exports,c),r.exports}c.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return c.d(n,{a:n}),n},c.d=(e,n)=>{for(var r in n)c.o(n,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},c.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),c.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";c.r(s),c.d(s,{default:()=>w});var e=c(4212),n=c(8541),r=c.n(n),t=c(311),o=c.n(t),i=c(748),a=c(7685),l=c(3511),u=c.n(l),d={data:e.PropTypes.arrayOf(e.PropTypes.any).def([]),label:e.PropTypes.oneOfType([e.PropTypes.func.def(void 0),e.PropTypes.string.def("label")]),children:e.PropTypes.string.def("children"),indent:e.PropTypes.number.def(18),lineHeight:e.PropTypes.number.def(32),levelLine:e.PropTypes.oneOfType([e.PropTypes.bool.def(!1),e.PropTypes.func.def(void 0),e.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:e.PropTypes.bool.def(!1),prefixIcon:e.PropTypes.oneOfType([e.PropTypes.func.def((function(){})),e.PropTypes.bool.def(!1)]).def(!0),async:e.PropTypes.shape({callback:e.PropTypes.func.def(null),cache:e.PropTypes.bool.def(!0)}),offsetLeft:e.PropTypes.number.def(5)},f=c(642),p=c.n(f),v=c(8022),y=void 0,h="1px dashed #c3cdd7",_=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=e.data,a=e.children,l=[],u=0,c=new Map;function s(e,n,r,o){var i=(t||[]).find((function(n){return n.__uuid===e}));return i?i[o]:n[r]}function d(e,n){return s(e,n,"isOpen","__isOpen")}function f(e,n){return s(e,n,"checked","__checked")}function p(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=e.length,y=0;y<s;y++){var h=e[y];if(Array.isArray(h))p(h,n,t,i);else if("object"===r()(h)&&null!==h){var _=h.__uuid||(0,v.v4)(),b=null!==i?"".concat(i,"-").concat(y):"".concat(y),m=!!(h[a]||[]).length,g=o()({__depth:n,__index:y,__uuid:_,__parentId:t,__hasChild:m,__path:b,__isRoot:null===t,__order:u,__isOpen:d(_,h)&&m,__checked:f(_,h)},a,null);Object.assign(h,{__uuid:_}),c.set(_,g),u+=1,l.push(Object.assign(Object.assign({},h),o()({},a,null))),Object.prototype.hasOwnProperty.call(h,a)&&p(h[a]||[],n+1,_,b)}}}return p(n||i),[l,c]},b=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,t=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?t:o:m(r,e,n,i)},m=function(e,n,t){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=n[t];if("string"==typeof i)return"object"===r()(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(y,[e].concat(p()(o)));return"string"==typeof a?a:void console.error("props label with function return value is not string, please check and return string")}},g=function(e,n){return m(e,n,"label")},x=function(e,n){return e.get(n)||{}},N=function(e,n,r){var t;return null===(t=x(e,n))||void 0===t?void 0:t[r]},P=function(e,n){return{"--level-line":b(n,"levelLine",e,h,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),"--offset-left":"".concat(n.offsetLeft,"px")}},C=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=r.schema,o=N(t,e.__uuid,"__depth");return Object.assign({"--depth":o},"function"==typeof n.levelLine?{"--level-line":b(n,"levelLine",e,h,null,["node"])}:{})},O=function(e,n,r){var t=x(n,e.__uuid)||{};return{"is-root":t.__isRoot,"bk-tree-node":!0,"is-open":t.__isOpen,"is-virtual-render":r.virtualRender,"level-line":r.levelLine}},T=function(n,r){var t=(x(r,n.__uuid)||{}).__checked;return o()({"is-checked":t},(0,e.resolveClassName)("node-row"),!0)},j=function(e,n,r,t){var o=e.split("-").reduce((function(e,n){var t=Number(n);return Array.isArray(e)?e[t]:e[r][t]}),n);Object.assign(o,t||{})};const k=(0,i.defineComponent)({name:"Tree",props:d,emits:["check"],setup:function(n,t){var l=this.$createElement,u=_(n),c=[],s=(0,i.reactive)({data:u[0],schema:u[1],levelLineSchema:{}});(0,i.watch)((function(){return[n.data]}),(function(e){var r=_(n,e,d.value);s.data=r[0],s.schema=r[1]}),{deep:!0});var d=(0,i.computed)((function(){return Array.from(s.schema.values())})),f=function(e){return s.schema.get(e)},p=function(e,n){var r;return null===(r=f(e.__uuid))||void 0===r?void 0:r[n]},v=function(e,n,r){return s.schema.set(e.__uuid,Object.assign(Object.assign({},f(e.__uuid)),o()({},n,r)))},y=function(e){return p(e,"__path")},h=function(e){return p(e,"__isRoot")},b=function(e){return p(e,"__isOpen")},m=function(e){return p(e,"__hasChild")},g=(0,i.computed)((function(){return s.data.filter((function(e){return T(e)}))})),x=function(e){var n;return"object"===r()(e)?b(e):"string"==typeof e&&(null===(n=f(e))||void 0===n?void 0:n.__isOpen)},N=function(n){return x(n)?(0,i.createVNode)(a.FolderShapeOpen,{class:(0,e.resolveClassName)("tree-icon")},null):(0,i.createVNode)(a.Folder,{class:(0,e.resolveClassName)("tree-icon")},null)},P=function(e){if("string"==typeof e)return e;if("object"===r()(e)&&null!==e){if(e.__v_isVNode)return e;var n=e.node,t=e.className,o=e.text,i=e.style;return l(n,{class:t,style:i},o)}return null},C=function(e,t){if("object"===r()(e)&&null!==e){v(t,"__isOpen",!0);var i=Array.isArray(e)?e:[e];!function(e,n,r,t,i){j(e,n,r,o()({},t,i))}(y(t),n.data,n.children,n.children,i)}},O=function(e){if(e.async){var r=n.async||{},t=r.callback,o=void 0===t?null:t,i=r.cache,a=void 0===i||i;if("function"==typeof o){if(e.cached)return;Object.assign(e,{loading:!0}),o(e,(function(n){return C(n,e)})).then((function(n){return C(n,e)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){j(y(e),n.data,n.children,Object.assign({loading:!1},a?{cached:!0}:{}))}))}else console.error("async need to set prop: asyncLoad with function wich will return promise object")}m(e)&&function(e){var n=!x(e);v(e,"__isOpen",n),n||g.value.filter((function(n){return String.prototype.startsWith.call(y(n),y(e))})).forEach((function(e){return v(e,"__isOpen",n)}))}(e)},T=function(e){return h(e)||x(e)||x(p(e,"__parentId"))},k=(0,i.ref)(),w=function(){var n;if(null===(n=k.value)||void 0===n?void 0:n.$el){var r=".".concat((0,e.resolveClassName)("tree-node")),t=".".concat((0,e.resolveClassName)("node-content"));Array.prototype.forEach.call(k.value.$el.querySelectorAll(r),(function(e){var n=e.querySelectorAll("".concat(t," span")),r=Array.prototype.slice.call(n,-1)[0];if(r){var o=e.offsetWidth-r.offsetLeft;r.style.setProperty("max-width","".concat(o,"px"))}}))}};return(0,i.onMounted)((function(){w()})),(0,i.onUpdated)((function(){w()})),{renderData:g,flatData:s,root:k,hanldeTreeNodeClick:O,handleNodeContentClick:function(e){c.includes(e.__uuid)||(c.forEach((function(e){return v({__uuid:e},"__checked",!1)})),c.length=0,v(e,"__checked",!0),c.push(e.__uuid),b(e)||O(e),t.emit("check",e,f(e.__uuid)))},handleNodeActionClick:function(e,n){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),O(n)},getActionIcon:function(e){var r=null;return"function"==typeof n.prefixIcon&&"default"!==(r=n.prefixIcon(h(e),m(e)||e.async,x(e),"action",e))?P(r):("default"===r||"boolean"==typeof n.prefixIcon&&n.prefixIcon)&&(m(e)||e.async)?x(e)?(0,i.createVNode)(a.DownShape,null,null):(0,i.createVNode)(a.RightShape,null,null):null},getRootIcon:N,getVirtualLines:function(e){if(!n.levelLine)return null;var r=p(e,"__depth")+1;return new Array(r).fill("").map((function(e,n){return n})).filter((function(n){return function(e,n){if(h(n))return!1;var r=y(n),t="".concat(r).split("-").slice(0,e+1);if(t.join("-")===r)return!0;var o=t.pop(),i=parseInt(o,10);t.push("".concat(i+1));var a=t.join("-");return d.value.some((function(e){return e.__path===a}))}(n,e)})).filter((function(e){return e>0})).map((function(e){return(0,i.createVNode)("span",{class:"node-virtual-line",style:(n=r-e,{"--depth":n})},null);var n}))},getNodePrefixIcon:function(r){var t=null;return"function"==typeof n.prefixIcon&&"default"!==(t=n.prefixIcon(h(r),m(r)||r.async,x(r),"node_type",r))?P(t):"default"===t||"boolean"==typeof n.prefixIcon&&n.prefixIcon?h(r)||m(r)?N(r):(0,i.createVNode)(a.TextFile,{class:(0,e.resolveClassName)("tree-icon")},null):null},getLoadingIcon:function(e){return e.loading?(0,i.createVNode)(a.Spinner,null,null):""}}},render:function(){var n=this,r=this.$props,t=function(t){return(0,i.createVNode)("div",{class:T(t,n.flatData.schema)},[(0,i.createVNode)("div",{class:O(t,n.flatData.schema,r),style:C(t,r,n.flatData),onClick:function(){return n.handleNodeContentClick(t)}},[(0,i.createVNode)("span",{class:(0,e.resolveClassName)("node-action"),onClick:function(e){return n.handleNodeActionClick(e,t)}},[n.getActionIcon(t)]),(0,i.createVNode)("span",{class:(0,e.resolveClassName)("node-content")},[[n.getNodePrefixIcon(t),n.getLoadingIcon(t)],(0,i.createVNode)("span",{class:(0,e.resolveClassName)("node-text")},[g(t,r)])]),n.getVirtualLines(t)])])};return(0,i.createVNode)(u(),{class:(0,e.resolveClassName)("tree"),style:P(null,r),list:this.renderData,lineHeight:r.lineHeight,enabled:r.virtualRender,contentClassName:(0,e.resolveClassName)("container"),throttleDelay:0,ref:"root"},{default:function(e){return(e.data||[]).map(t)}})}}),w=(0,e.withInstall)(k)})(),s})()));
@@ -1 +0,0 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("vue"),require("lodash"));else if("function"==typeof define&&define.amd)define(["../shared","@babel/runtime/helpers/toConsumableArray","@babel/runtime/helpers/typeof","vue","lodash"],t);else{var o="object"==typeof exports?t(require("../shared"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/typeof"),require("vue"),require("lodash")):t(e["../shared"],e["@babel/runtime/helpers/toConsumableArray"],e["@babel/runtime/helpers/typeof"],e.vue,e.lodash);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,((e,t,o,n,r)=>(()=>{"use strict";var l={4212:t=>{t.exports=e},642:e=>{e.exports=t},8541:e=>{e.exports=o},467:e=>{e.exports=r},748:e=>{e.exports=n}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return l[e](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var o in t)s.o(t,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{s.r(a),s.d(a,{default:()=>T});var e=s(4212),t=s(642),o=s.n(t),n=s(8541),r=s.n(n),l=s(748),i={onContentScroll:Function},u=Object.assign({list:e.PropTypes.array.def([]),enabled:e.PropTypes.bool.def(!0),lineHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.func]).def(30),minHeight:e.PropTypes.number.def(30),height:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),width:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),className:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentClassName:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentStyle:e.PropTypes.object.def({}),scrollXName:e.PropTypes.string.def("bk-scroll-x"),scrollYName:e.PropTypes.string.def("bk-scroll-y"),groupItemCount:e.PropTypes.number.def(1),preloadItemCount:e.PropTypes.number.def(1),renderAs:e.PropTypes.string.def("div"),contentAs:e.PropTypes.string.def("div"),scrollOffsetTop:e.PropTypes.number.def(0),scrollPosition:e.PropTypes.string.def("content"),abosuteHeight:e.PropTypes.oneOfType([e.PropTypes.string.def("auto"),e.PropTypes.number]).def("auto"),throttleDelay:e.PropTypes.number.def(60)},i),p=s(467),c=void 0;function d(e,t,o,n){for(var r=0,l=0,i=0,s=0;r<e;r++){if(l+(s=n(r,[r*o,(r+1)*o]))>t){i=t-l;break}l+=s}return{startIndex:r,height:l,diffHeight:i}}function f(e,t,o,n,r){if(n){var l=n.scrollTop,i=o.scrollTop,s=o.count,a=o.groupItemCount,u=o.startIndex,p=o.endIndex,c=n.offsetHeight,f=0,y=0,v=0;if("number"==typeof e&&(f=Math.floor(l/e),y=Math.ceil(c/e)+f,v=l%e),"function"==typeof e){var b=d(s,l,a,e);f=b.startIndex>0?b.startIndex:0,v=b.diffHeight,y=d(s,c,a,e).startIndex+f+1}l===i&&f===u&&y===p||"function"==typeof t&&t(r,f,y,l,v)}}function y(e,t,o){var n=o.value,r=n.lineHeight,l=void 0===r?30:r,i=n.handleScrollCallback,s=n.pagination,a=void 0===s?{}:s,u=a.startIndex,p=a.endIndex,c=a.groupItemCount,d=a.count;f(l,i,{scrollTop:a.scrollTop,startIndex:u,endIndex:p,groupItemCount:c,count:d},t,e)}var v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return(0,p.throttle)((function(e,t,o){return y(e,t,o)}),e)},b=null,h=function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;b||(b=v(n)),"function"==typeof b&&b.call(c,e,t,o)};const m={mounted:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;o.addEventListener("scroll",(function(e){h(e,o,t,n)}))},updated:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;h(null,o,t,n)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",v)}}},g=(0,l.defineComponent)({name:"VirtualRender",directives:{bkVirtualRender:m},props:u,emits:["content-scroll"],setup:function(e,t){var n=this,i=e.renderAs,s=e.contentAs,a=function(e){return"string"==typeof e?[e]:"object"!==r()(e)||Array.isArray(e)?e:[e]};if(!e.enabled)return function(){var o,n,r,u,p,c,d,f,y;return(0,l.h)(i,{class:a(e.className)},[null!==(r=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==r?r:"",(0,l.h)(s,{class:a(e.contentClassName),style:e.contentStyle},[null!==(c=null===(p=(u=t.slots).default)||void 0===p?void 0:p.call(u,{data:e.list}))&&void 0!==c?c:""]),null!==(y=null===(f=(d=t.slots).afterContent)||void 0===f?void 0:f.call(d))&&void 0!==y?y:""])};var u=(0,l.ref)(null),p=(0,l.reactive)({startIndex:0,endIndex:0,scrollTop:1,translateY:0,count:0,groupItemCount:e.groupItemCount}),c=function(e,o,n,r,l){p.startIndex=o,p.endIndex=n,p.scrollTop=r,p.translateY=l,t.emit("content-scroll",[e,p])};(0,l.onMounted)((function(){(0,l.nextTick)((function(){b(e.list),h()}))})),(0,l.watch)((function(){return e.list}),(function(){d(),h()}),{deep:!0}),(0,l.watch)((function(){return e.lineHeight}),(function(){d(),h()}));var d=function(){b(e.list)},y=(0,l.ref)(0),v=(0,l.ref)(0),b=function(t){if(y.value=Math.ceil((t||[]).length/e.groupItemCount),p.count=y.value,p.startIndex=0,p.endIndex=0,p.translateY=0,p.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){v.value=0;for(var o=0,r=0;r<y.value;r++){var l=e.lineHeight.call(n,r,t.slice(r*e.groupItemCount,e.groupItemCount));o+="number"==typeof l?l:0}v.value=o}else v.value=e.lineHeight*y.value;else v.value=e.abosuteHeight},h=function(){var t,o=null===(t=u.value)||void 0===t?void 0:t.parentNode;f(e.lineHeight,c,p,o,null)},m=(0,l.computed)((function(){return(e.list||[]).map((function(e,t){return Object.assign(Object.assign({},e),{$index:t})}))})),g=(0,l.computed)((function(){return m.value.slice(p.startIndex*e.groupItemCount,(p.endIndex+e.preloadItemCount)*e.groupItemCount)})),T=(0,l.computed)((function(){return"content"===e.scrollPosition?{top:"".concat(p.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(p.translateY,"px)")}:{}})),P=(0,l.computed)((function(){return Object.assign({height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"number"==typeof e.width?"".concat(e.width,"px"):e.width,display:"inline-block"},"container"===e.scrollPosition?T.value:{})})),x=(0,l.computed)((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(v.value<e.minHeight?e.minHeight:v.value,"px"),display:t?"none":"block"}})),I=(0,l.computed)((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(o()(a(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=(0,l.computed)((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(o()(a(e.contentClassName)))})),O=(0,l.resolveDirective)("bkVirtualRender"),H={lineHeight:e.lineHeight,handleScrollCallback:c,pagination:p,throttleDelay:e.throttleDelay};return function(){var o,n,r,a,p,c,d,f,y;return(0,l.h)(i||"div",{ref:u,class:I.value,style:P.value},[null!==(r=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==r?r:"",(0,l.withDirectives)((0,l.h)(s||"div",{class:C.value,style:Object.assign(Object.assign({},T.value),e.contentStyle)},[null!==(c=null===(p=(a=t.slots).default)||void 0===p?void 0:p.call(a,{data:g.value}))&&void 0!==c?c:""]),[[O,H]]),null!==(y=null===(f=(d=t.slots).afterContent)||void 0===f?void 0:f.call(d))&&void 0!==y?y:"",(0,l.h)("div",{class:["bk-virtual-section"],style:x.value})])}}}),T=(0,e.withInstall)(g)})(),a})()));