bkui-vue 0.0.2-beta.82 → 0.0.2-beta.84

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 (180) hide show
  1. package/dist/index.cjs.js +135 -161
  2. package/dist/index.esm.js +16449 -19088
  3. package/dist/index.umd.js +135 -161
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +321 -1
  7. package/lib/alert/index.js +214 -1
  8. package/lib/animate-number/index.js +155 -1
  9. package/lib/backtop/index.js +188 -1
  10. package/lib/badge/index.js +235 -1
  11. package/lib/breadcrumb/index.js +309 -1
  12. package/lib/button/index.js +321 -1
  13. package/lib/card/index.js +285 -1
  14. package/lib/cascader/index.js +2036 -2
  15. package/lib/checkbox/index.js +542 -1
  16. package/lib/code-diff/index.js +5501 -1
  17. package/lib/collapse/index.js +570 -1
  18. package/lib/collapse-transition/index.js +177 -1
  19. package/lib/color-picker/index.js +2665 -1
  20. package/lib/components.js +530 -1
  21. package/lib/config-provider/index.js +365 -1
  22. package/lib/container/index.js +391 -1
  23. package/lib/date-picker/index.js +5555 -1
  24. package/lib/dialog/index.js +975 -2
  25. package/lib/directives/index.js +1375 -2
  26. package/lib/dist.index.js +87 -1
  27. package/lib/divider/index.js +169 -1
  28. package/lib/dropdown/index.js +369 -1
  29. package/lib/exception/index.js +385 -1
  30. package/lib/fixed-navbar/index.js +154 -1
  31. package/lib/form/index.js +952 -1
  32. package/lib/hooks.js +73 -1
  33. package/lib/icon/angle-double-down-line.js +191 -1
  34. package/lib/icon/angle-double-left-line.js +191 -1
  35. package/lib/icon/angle-double-left.js +191 -1
  36. package/lib/icon/angle-double-right-line.js +191 -1
  37. package/lib/icon/angle-double-right.js +191 -1
  38. package/lib/icon/angle-double-up-line.js +191 -1
  39. package/lib/icon/angle-down-fill.js +191 -1
  40. package/lib/icon/angle-down-line.js +191 -1
  41. package/lib/icon/angle-down.js +191 -1
  42. package/lib/icon/angle-left.js +191 -1
  43. package/lib/icon/angle-right.js +191 -1
  44. package/lib/icon/angle-up-fill.js +191 -1
  45. package/lib/icon/angle-up.js +191 -1
  46. package/lib/icon/archive-fill.js +191 -1
  47. package/lib/icon/arrows-left.js +191 -1
  48. package/lib/icon/arrows-right.js +191 -1
  49. package/lib/icon/assistant.js +191 -1
  50. package/lib/icon/audio-fill.js +191 -1
  51. package/lib/icon/bk.js +191 -1
  52. package/lib/icon/circle.js +191 -1
  53. package/lib/icon/close-line.js +191 -1
  54. package/lib/icon/close.js +191 -1
  55. package/lib/icon/code.js +191 -1
  56. package/lib/icon/cog-shape.js +191 -1
  57. package/lib/icon/collapse-left.js +191 -1
  58. package/lib/icon/copy-shape.js +191 -1
  59. package/lib/icon/copy.js +191 -1
  60. package/lib/icon/data-shape.js +191 -1
  61. package/lib/icon/del.js +191 -1
  62. package/lib/icon/doc-fill.js +191 -1
  63. package/lib/icon/done.js +191 -1
  64. package/lib/icon/down-shape.js +191 -1
  65. package/lib/icon/down-small.js +191 -1
  66. package/lib/icon/edit-line.js +191 -1
  67. package/lib/icon/ellipsis.js +191 -1
  68. package/lib/icon/enlarge-line.js +191 -1
  69. package/lib/icon/error.js +191 -1
  70. package/lib/icon/excel-fill.js +191 -1
  71. package/lib/icon/exclamation-circle-shape.js +191 -1
  72. package/lib/icon/eye.js +191 -1
  73. package/lib/icon/filliscreen-line.js +191 -1
  74. package/lib/icon/fix-line.js +191 -1
  75. package/lib/icon/fix-shape.js +191 -1
  76. package/lib/icon/folder-open.js +191 -1
  77. package/lib/icon/folder-shape-open.js +191 -1
  78. package/lib/icon/folder-shape.js +191 -1
  79. package/lib/icon/folder.js +191 -1
  80. package/lib/icon/funnel.js +191 -1
  81. package/lib/icon/help-document-fill.js +191 -1
  82. package/lib/icon/help-fill.js +191 -1
  83. package/lib/icon/help.js +191 -1
  84. package/lib/icon/image-fill.js +276 -1
  85. package/lib/icon/img-error.js +276 -1
  86. package/lib/icon/img-placehoulder.js +276 -1
  87. package/lib/icon/index.js +2399 -1
  88. package/lib/icon/info-line.js +276 -1
  89. package/lib/icon/info.js +276 -1
  90. package/lib/icon/left-shape.js +276 -1
  91. package/lib/icon/left-turn-line.js +276 -1
  92. package/lib/icon/narrow-line.js +276 -1
  93. package/lib/icon/original.js +276 -1
  94. package/lib/icon/pdf-fill.js +276 -1
  95. package/lib/icon/play-shape.js +276 -1
  96. package/lib/icon/plus.js +276 -1
  97. package/lib/icon/ppt-fill.js +276 -1
  98. package/lib/icon/qq.js +276 -1
  99. package/lib/icon/right-shape.js +276 -1
  100. package/lib/icon/right-turn-line.js +276 -1
  101. package/lib/icon/search.js +276 -1
  102. package/lib/icon/share.js +276 -1
  103. package/lib/icon/spinner.js +276 -1
  104. package/lib/icon/success.js +276 -1
  105. package/lib/icon/switcher-loading.js +276 -1
  106. package/lib/icon/text-file.js +276 -1
  107. package/lib/icon/text-fill.js +276 -1
  108. package/lib/icon/transfer.js +276 -1
  109. package/lib/icon/tree-application-shape.js +276 -1
  110. package/lib/icon/unfull-screen.js +276 -1
  111. package/lib/icon/unvisible.js +276 -1
  112. package/lib/icon/up-shape.js +276 -1
  113. package/lib/icon/upload.js +276 -1
  114. package/lib/icon/video-fill.js +276 -1
  115. package/lib/icon/warn.js +276 -1
  116. package/lib/icon/weixin-pro.js +276 -1
  117. package/lib/icon/weixin.js +276 -1
  118. package/lib/image/index.js +641 -1
  119. package/lib/index.js +97 -1
  120. package/lib/info-box/index.js +1165 -2
  121. package/lib/input/index.js +1218 -2
  122. package/lib/link/index.js +160 -1
  123. package/lib/loading/index.js +381 -1
  124. package/lib/locale/index.js +465 -1
  125. package/lib/menu/index.js +724 -1
  126. package/lib/message/index.js +1795 -2
  127. package/lib/modal/index.js +396 -1
  128. package/lib/navigation/index.js +367 -1
  129. package/lib/notify/index.js +397 -1
  130. package/lib/overflow-title/index.js +461 -1
  131. package/lib/pagination/index.js +880 -1
  132. package/lib/plugin-popover/index.js +4089 -1
  133. package/lib/plugins/index.js +63 -1
  134. package/lib/pop-confirm/index.js +273 -1
  135. package/lib/popover/index.js +4097 -1
  136. package/lib/popover2/index.js +107 -1
  137. package/lib/preset.js +93 -1
  138. package/lib/process/index.js +759 -2
  139. package/lib/progress/index.js +431 -1
  140. package/lib/radio/index.js +627 -1
  141. package/lib/rate/index.js +338 -1
  142. package/lib/resize-layout/index.js +429 -1
  143. package/lib/search-select/index.js +2729 -2
  144. package/lib/search-select/search-select.css +1 -3
  145. package/lib/search-select/search-select.less +1 -3
  146. package/lib/search-select/search-select.variable.css +1 -3
  147. package/lib/select/index.js +2251 -2
  148. package/lib/shared/index.js +2873 -1
  149. package/lib/sideslider/index.js +714 -2
  150. package/lib/slider/index.js +1291 -2
  151. package/lib/steps/index.js +825 -2
  152. package/lib/swiper/index.js +336 -1
  153. package/lib/switcher/index.js +277 -1
  154. package/lib/tab/index.js +914 -1
  155. package/lib/table/index.js +6421 -1
  156. package/lib/table/plugins/use-column-resize.d.ts +1 -1
  157. package/lib/table-column/index.js +763 -1
  158. package/lib/tag/index.js +233 -1
  159. package/lib/tag-input/index.js +1660 -1
  160. package/lib/tag-input/tag-input.d.ts +2 -14
  161. package/lib/time-picker/index.js +71 -1
  162. package/lib/timeline/index.js +241 -1
  163. package/lib/transfer/index.js +673 -1
  164. package/lib/tree/index.js +2686 -1
  165. package/lib/upload/index.js +2874 -2
  166. package/lib/virtual-render/index.js +865 -1
  167. package/package.json +13 -2
  168. package/lib/cascader/index.js.LICENSE.txt +0 -1
  169. package/lib/dialog/index.js.LICENSE.txt +0 -1
  170. package/lib/directives/index.js.LICENSE.txt +0 -14
  171. package/lib/info-box/index.js.LICENSE.txt +0 -1
  172. package/lib/input/index.js.LICENSE.txt +0 -1
  173. package/lib/message/index.js.LICENSE.txt +0 -6
  174. package/lib/process/index.js.LICENSE.txt +0 -1
  175. package/lib/search-select/index.js.LICENSE.txt +0 -1
  176. package/lib/select/index.js.LICENSE.txt +0 -1
  177. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  178. package/lib/slider/index.js.LICENSE.txt +0 -1
  179. package/lib/steps/index.js.LICENSE.txt +0 -1
  180. package/lib/upload/index.js.LICENSE.txt +0 -1
@@ -1 +1,1660 @@
1
- import*as e from"../shared";import*as t from"vue";import*as a from"lodash";import*as r from"../config-provider";import*as o from"../directives";import*as n from"../icon";import*as l from"../loading";import*as i from"../popover";import*as s from"vue-types";var c={d:(e,t)=>{for(var a in t)c.o(t,a)&&!c.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},u={};c.d(u,{Z:()=>A});const d=(p={PropTypes:()=>e.PropTypes,checkOverflow:()=>e.checkOverflow,useFormItem:()=>e.useFormItem,withInstall:()=>e.withInstall},f={},c.d(f,p),f);var p,f;function v(e){return v="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},v(e)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function h(e,t){if(e){if("string"==typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function y(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||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.")}()}function m(e,t,a){return(t=function(e){var t=function(e,t){if("object"!==v(e)||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,"string");if("object"!==v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===v(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const T=(e=>{var t={};return c.d(t,e),t})({computed:()=>t.computed,createTextVNode:()=>t.createTextVNode,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,h:()=>t.h,markRaw:()=>t.markRaw,mergeProps:()=>t.mergeProps,nextTick:()=>t.nextTick,onMounted:()=>t.onMounted,reactive:()=>t.reactive,ref:()=>t.ref,resolveDirective:()=>t.resolveDirective,toRefs:()=>t.toRefs,vModelText:()=>t.vModelText,vShow:()=>t.vShow,watch:()=>t.watch,withDirectives:()=>t.withDirectives}),w=(e=>{var t={};return c.d(t,e),t})({debounce:()=>a.debounce}),b=(e=>{var t={};return c.d(t,e),t})({useLocale:()=>r.useLocale,usePrefix:()=>r.usePrefix}),L=(e=>{var t={};return c.d(t,e),t})({bkTooltips:()=>o.bkTooltips}),P=(e=>{var t={};return c.d(t,e),t})({Close:()=>n.Close,Error:()=>n.Error}),x=(e=>{var t={};return c.d(t,e),t})({BkLoadingSize:()=>l.BkLoadingSize,default:()=>l.default}),I=(e=>{var t={};return c.d(t,e),t})({default:()=>i.default});var C=12,S=function(e){for(var t=e.length,a=0,r=0;r<t;r++)0!=(65280&e.charCodeAt(r))&&(a+=1),a+=1;return a};const N=(0,T.defineComponent)({name:"ListTagRender",props:{node:d.PropTypes.object,searchKey:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.arrayOf(d.PropTypes.string)]),displayKey:d.PropTypes.string,searchKeyword:d.PropTypes.string,tpl:{type:Function}},render:function(){var e=this,t=(0,b.usePrefix)().resolveClassName,a=function(t){if(e.searchKeyword){var a=new RegExp("(".concat(e.searchKeyword,")"),"i");return t.replace(a,'<strong class="highlight-text">$1</strong>')}return t};if(this.tpl)return this.tpl(this.node,a,T.h,this);var r=this.node[this.displayKey];return(0,T.createVNode)("div",{class:"".concat(t("selector-node"))},[(0,T.createVNode)("span",{class:"text",innerHTML:a(r)},[r])])}}),K=(e=>{var t={};return c.d(t,e),t})({toType:()=>s.toType});var V;!function(e){e.FOCUS="focus",e.SEARCH="search"}(V||(V={}));const O=(0,T.defineComponent)({name:"TagRender",directives:{bkTooltips:L.bkTooltips},props:{node:d.PropTypes.object,displayKey:d.PropTypes.string,tpl:{type:Function},hasTips:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:function(){return{}}}},setup:function(e){var t=(0,T.ref)(),a=(0,T.ref)(!1),r=(0,T.computed)((function(){return Object.assign({boundary:"window",theme:"light",distance:12,content:e.node[e.displayKey],disabled:e.hasTips||!a.value},e.tagOverflowTips)}));return(0,T.onMounted)((function(){a.value=(0,d.checkOverflow)(t.value)})),{overflowTips:r,tagRef:t}},render:function(){return this.tpl?this.tpl(this.node,T.h,this):(0,T.withDirectives)((0,T.createVNode)("div",{class:"tag",ref:"tagRef"},[(0,T.createVNode)("span",{class:"text"},[this.node[this.displayKey]])]),[[(0,T.resolveDirective)("bk-tooltips"),this.overflowTips]])}}),k=(0,T.defineComponent)({name:"TagInput",directives:{bkTooltips:L.bkTooltips},props:{modelValue:d.PropTypes.arrayOf(d.PropTypes.string).def([]),placeholder:d.PropTypes.string.def(""),list:d.PropTypes.arrayOf(d.PropTypes.object).def([]),disabled:d.PropTypes.bool.def(!1),tooltipKey:d.PropTypes.string.def(""),saveKey:d.PropTypes.string.def("id"),displayKey:d.PropTypes.string.def("name"),hasDeleteIcon:d.PropTypes.bool.def(!1),clearable:d.PropTypes.bool.def(!0),trigger:(0,K.toType)("treeTriggerType",{}).def(V.SEARCH),searchKey:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.arrayOf(d.PropTypes.string)]).def("name"),useGroup:d.PropTypes.bool.def(!1),allowCreate:d.PropTypes.bool.def(!1),maxData:d.PropTypes.number.def(-1),maxResult:d.PropTypes.number.def(10),contentMaxHeight:d.PropTypes.number.def(300),contentWidth:d.PropTypes.number.def(190),separator:d.PropTypes.string.def(""),allowNextFocus:d.PropTypes.bool.def(!0),allowAutoMatch:d.PropTypes.bool.def(!1),showClearOnlyHover:d.PropTypes.bool.def(!1),isAsyncList:d.PropTypes.bool.def(!1),leftSpace:d.PropTypes.number.def(0),createTagValidator:{type:Function},filterCallback:{type:Function},tagTpl:{type:Function},tpl:{type:Function},pasteFn:{type:Function},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:function(){return{}}},collapseTags:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:function(){return{}}}},emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup:function(e,t){var a=t.emit,r=(0,d.useFormItem)(),o=(0,b.useLocale)("tagInput"),n=(0,T.reactive)({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),l=(0,T.reactive)(Object.assign({isShow:!1,width:190,offset:{mainAxis:4,crossAxis:0}},e.popoverProps)),i=(0,b.usePrefix)().resolveClassName,s=function(e){var t=(0,T.reactive)({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:function(){var e,a,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.curPage=1,t.totalSize=r.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;var o=[];if(t.pageSize>0)for(var n=0;n<t.totalSize;n+=t.pageSize)o.push(r.slice(n,n+t.pageSize));(e=t.renderListPaged).splice.apply(e,[0,t.renderListPaged.length].concat(o)),(a=t.curPageList).splice.apply(a,[0,t.curPageList.length].concat(y(t.renderListPaged[t.curPage-1]||[])))},pageChange:function(e){var a;t.curPage=e,(a=t.curPageList).splice.apply(a,[t.curPageList.length,0].concat(y(t.renderListPaged[t.curPage-1]||[]))),t.isPageLoading=!1}}}((0,T.toRefs)(e).maxResult),c=s.pageState,u=s.initPage,p=s.pageChange,f=(0,T.ref)(""),g=(0,T.ref)(null),L=(0,T.ref)(null),P=(0,T.ref)(null),x=(0,T.ref)(null),I=(0,T.ref)(null),N=(0,T.ref)(null),K=(0,T.computed)((function(){return!e.disabled&&e.hasDeleteIcon})),V=(0,T.computed)((function(){return 1===e.maxData})),O=(0,T.computed)((function(){return 0===E.selectedTagList.length&&""===f.value&&!n.isEdit})),k=(0,T.computed)((function(){return e.placeholder||o.value.placeholder})),A=(0,T.computed)((function(){return e.clearable&&!e.disabled&&0!==E.selectedTagList.length&&(!e.showClearOnlyHover||n.isHover)})),R=(0,T.computed)((function(){var t;return m(t={},"".concat(i("tag-input-trigger")),!0),m(t,"active",n.isEdit),m(t,"disabled",e.disabled),t})),E=(0,T.reactive)({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=(0,T.computed)((function(){return E.selectedTagList.map((function(t){return t[e.saveKey]}))})),j=function(e){var t=(0,T.toRefs)(e),a=t.useGroup,r=t.saveKey,o=t.displayKey,n=t.list,l=(0,T.ref)([]),i=(0,T.ref)({});return(0,T.watch)([a,r,o,n],(function(){l.value=[];var e=(0,T.markRaw)(n.value);a.value&&(e=e.reduce((function(e,t){var a=[];return t.children&&(a=t.children.map((function(e){return Object.assign({group:{groupId:t[r.value],groupName:t[o.value]}},e)}))),e.concat(a)}),[])),l.value=e,i.value=e.reduce((function(e,t){return e[t[r.value]]=t,e}),{})}),{immediate:!0,deep:!0}),{flatList:l,saveKeyMap:i}}(e),F=j.flatList,M=j.saveKeyMap,z=(0,T.computed)((function(){if(e.useGroup){var t={};return c.curPageList.forEach((function(e,a){e.__index__=a,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 c.curPageList}));(0,T.watch)([function(){return F.value}],(function(){(0,T.nextTick)((function(){U()}))}),{deep:!0}),(0,T.watch)((function(){return e.modelValue}),(function(t){var a,o,n;n=t,(o=D.value).length===n.length&&n.every((function(e,t){return o[t]===e}))||((0,T.nextTick)((function(){U()})),e.withValidate&&(null===(a=null==r?void 0:r.validate)||void 0===a||a.call(r,"change")))})),(0,T.watch)(f,(0,w.debounce)((function(){var t=0!==c.curPageList.length,a=f.value;""!==a&&t||""===a&&"focus"===e.trigger&&t?l.isShow=!0:"focus"===e.trigger&&t||(l.isShow=!1)}),150)),(0,T.watch)((function(){return l.isShow}),(function(e){H(),e&&I.value&&((0,T.nextTick)((function(){I.value.scrollTop=0})),I.value.removeEventListener("scroll",B),I.value.addEventListener("scroll",B))})),(0,T.onMounted)((function(){U()}));var H=function(){var e;l.offset.crossAxis=V.value?0:null===(e=x.value)||void 0===e?void 0:e.offsetLeft},B=function(){if(!c.isPageLoading&&0!==I.value.scrollTop){var e=I.value;if(e.scrollTop+e.offsetHeight>=e.scrollHeight){var t=c.curPage+1;t<=c.totalPage&&(c.isPageLoading=!0,setTimeout((function(){p(t)}),500))}}},_=function(){var e;return Array.from((null===(e=P.value)||void 0===e?void 0:e.childNodes)||[]).filter((function(e){return![Node.TEXT_NODE,Node.COMMENT_NODE].includes(e.nodeType)}))},G=function(t){if(!e.disabled){if(null==t?void 0:t.target){var a=t.target.className;(a.indexOf("".concat(i("tag-input-trigger")))>-1||a.indexOf("tag-list")>-1)&&P.value.appendChild(x.value)}clearTimeout(N.value),V.value&&D.value.length&&(E.tagListCache=y(D.value),E.selectedTagListCache=y(E.selectedTagList),f.value=E.selectedTagListCache[0][e.saveKey],ae(E.selectedTagList[0],0),X()),n.isEdit=!0,setTimeout((function(){var t;null===(t=g.value)||void 0===t||t.focus(),"focus"===e.trigger&&0!==E.localList.length&&(Z(),l.isShow?H():l.isShow=!0)}),200)}},U=function(){var t=e.saveKey,a=e.modelValue,r=e.displayKey,o=e.allowCreate,n=e.trigger,i=e.isAsyncList;if(E.selectedTagList=[],E.localList=F.value,a.length){var s={};E.selectedTagList=a.map((function(e){var a,n=M.value[e];return s[e]=1,!n&&o?(m(a={},t,e),m(a,r,e),a):n})).filter((function(e){return e})),V.value||(E.localList=E.localList.filter((function(e){return!s[e[t]]})))}if(i&&f.value)return Z(f.value),void(c.curPageList.length&&(l.isShow=!0));"focus"===n&&Z()},Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=e.searchKey,r=e.filterCallback,o=t.toLowerCase().trim();if(""!==o){var n;n="function"==typeof r?r(o,a,E.localList)||[]:Array.isArray(a)?E.localList.filter((function(e){return a.some((function(t){return e[t].toLowerCase().indexOf(o)>-1}))})):E.localList.filter((function(e){return e[a].toLowerCase().indexOf(o)>-1})),u(n)}else u(E.localList)},W=function(){f.value=""},$=function(){if(V.value)return 0;var e=_().findIndex((function(e){return"tagInputItem"===e.id}));return e>=0?e:0},q=function(e,t){if(t&&e){var a=t;arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(a=t.nextElementSibling||null),t.parentNode.insertBefore(e,a)}},X=function(t){var r=e.maxData,o=e.trigger,i=e.allowCreate;if(-1===r||r>D.value.length){var s=((null==t?void 0:t.target)?t.target:f).value,c=S(s);c?(Z(s),g.value.style.width="".concat(c*C,"px")):"focus"===o&&Z()}else J(),f.value="",l.isShow=!1;n.isEdit=!0,n.focusItemIndex=i?-1:0,a("input",f.value)},J=function(){N.value=setTimeout((function(){var t,o,i,s=f.value;if(W(),n.isEdit=!1,V.value){var u=(o=E.tagListCache,i=1,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,o,n,l,i=[],s=!0,c=!1;try{if(n=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;s=!1}else for(;!(s=(r=n.call(a)).done)&&(i.push(r.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=a.return&&(l=a.return(),Object(l)!==l))return}finally{if(c)throw o}}return i}}(o,i)||h(o,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];s&&s===u&&E.selectedTagListCache.length?te(E.selectedTagListCache[0],"select"):Y("remove")}else if(e.allowAutoMatch&&s){var d=c.curPageList.find((function(t){return Array.isArray(e.searchKey)?e.searchKey.map((function(e){return t[e]})).includes(s):t[e.searchKey]===s}));d?Q(d,"select"):e.allowCreate&&Q(s,"custom")}l.isShow=!1,a("blur",s,D.value),null===(t=null==r?void 0:r.validate)||void 0===t||t.call(r,"blur")}),200)},Q=function(e,t,a){null==a||a.stopPropagation(),e&&!e.disabled&&(V.value&&(E.tagListCache=[],E.selectedTagListCache=[],E.selectedTagList=[]),te(e,t),Y("select"),W(),l.isShow=!1)},Y=function(e,t){a(e,t),a("update:modelValue",D.value),a("change",D.value)},ee=function(){var e=I.value.clientHeight,t=I.value.getBoundingClientRect().y;(0,T.nextTick)((function(){var a=I.value.querySelector(".".concat(i("selector-actived")));if(a){var r=a.clientHeight,o=a.getBoundingClientRect().y;o<t&&(I.value.scrollTop=I.value.scrollTop-(t-o));var n=o+r-t;n>e&&(I.value.scrollTop=I.value.scrollTop+n-e)}}))},te=function(t,a){if(!(E.selectedTagList.length>=e.maxData&&-1!==e.maxData)){var r,o=e.separator,n=e.saveKey,l=e.displayKey,i=e.createTagValidator,s=$(),c=1,u=!1,d=function(e){return"function"!=typeof i||i(e)};if("custom"===a)if(o){var p,f=t.split(o),h=(f=f.filter((function(e){return(null==e?void 0:e.trim())&&!D.value.includes(e)&&d(e)}))).map((function(e){var t;return M.value[e]||(m(t={},n,e),m(t,l,e),t)}));f.length&&((p=E.selectedTagList).splice.apply(p,[s,0].concat(y(h))),c=h.length,u=!0)}else{var w="object"===v(t);if(void 0!==(r=(r=w?t[n]:t.trim()).replace(/\s+/g,""))&&!D.value.includes(r)&&d(r)){var b,L=M.value[r]||(w?t:(m(b={},n,r),m(b,l,r),b));E.selectedTagList.splice(s,0,L),u=!0}}else t&&(void 0===(r=t[n])||D.value.includes(r)||(E.selectedTagList.splice(s,0,t),u=!0));u&&(0,T.nextTick)((function(){for(var t=1;t<=c;t++){var a=_()[s+t];q(a,x.value)}if(g.value.style.width="".concat(C,"px"),!V.value){e.allowNextFocus&&G();var r=D.value.reduce((function(e,t){return e[t]=1,e}),{});E.localList=E.localList.filter((function(e){return!r[e[n]]}))}}))}},ae=function(t,a){E.selectedTagList.splice(a,1);var r=M.value[t[e.saveKey]];(e.allowCreate&&r||!e.allowCreate)&&!V.value&&E.localList.push(t)},re=(0,T.computed)((function(){return e.collapseTags?e.collapseTags&&!n.isEdit:e.collapseTags})),oe=function(e,t,a){(0,T.watch)([a,t],(function(){o()}),{flush:"post"});var r=(0,T.ref)(null),o=function(){t.value&&(r.value=null,setTimeout((function(){var t=Array.from(e.value.querySelectorAll(".tag-item")),a=t.findIndex((function(e,a){return!!a&&t[a-1].offsetTop!==e.offsetTop}));r.value=a>0?a-1:null})))};return{overflowTagIndex:r}}(L,re,D),ne=oe.overflowTagIndex;return Object.assign(Object.assign(Object.assign(Object.assign({popoverProps:l},(0,T.toRefs)(n)),(0,T.toRefs)(E)),(0,T.toRefs)(c)),{isShowPlaceholder:O,isShowClear:A,placeholderText:k,curInputValue:f,renderList:z,showTagClose:K,tagInputRef:g,bkTagSelectorRef:L,tagListRef:P,tagInputItemRef:x,selectorListRef:I,triggerClass:R,overflowTagIndex:ne,localCollapseTags:re,focusInputTrigger:G,activeClass:function(t,a){var r,o=(m(r={},"".concat(i("selector-actived")),!0),m(r,"".concat(i("selector-selected")),D.value.includes(t[e.saveKey])),r);return e.useGroup?o["".concat(i("selector-actived"))]=t.__index__===n.focusItemIndex:o["".concat(i("selector-actived"))]=a===n.focusItemIndex,o},handleInput:X,handleFocus:function(){var t;l.width=V.value?null===(t=L.value)||void 0===t?void 0:t.clientWidth:e.contentWidth,a("focus")},handleBlur:J,handleTagSelected:Q,handleTagRemove:function(e,t,a){null==a||a.stopPropagation(),ae(e,t),W(),Y("remove",e),g.value.style.width="".concat(C,"px")},handleClear:function(t){t.stopPropagation();var a=E.selectedTagList;E.selectedTagList=[];var r,o=a.filter((function(t){return M.value[t[e.saveKey]]}));(!e.allowCreate||0===o.length)&&e.allowCreate||V.value||(r=E.localList).push.apply(r,y(o)),Y("removeAll")},tagFocus:function(t){e.disabled||(q(x.value,t.currentTarget,!0),g.value.style.width="".concat(C,"px"),l.isShow&&H())},handleKeydown:function(t){if(!c.isPageLoading){var a=t.target.value,r=S(a),o=$(),i=_();switch(t.code){case"ArrowUp":if(t.preventDefault(),!l.isShow)return;n.focusItemIndex=n.focusItemIndex-1,n.focusItemIndex=n.focusItemIndex<0?-1:n.focusItemIndex,-1===n.focusItemIndex&&(n.focusItemIndex=c.curPageList.length-1),ee();break;case"ArrowDown":if(t.preventDefault(),!l.isShow)return;n.focusItemIndex=n.focusItemIndex+1,n.focusItemIndex=n.focusItemIndex>c.curPageList.length-1?c.curPageList.length:n.focusItemIndex,n.focusItemIndex===c.curPageList.length&&(n.focusItemIndex=0),ee();break;case"ArrowLeft":if(n.isEdit=!0,!r){if(o<1)return;q(x.value,i[o-1]),G()}break;case"ArrowRight":if(n.isEdit=!0,!r){if(o===i.length-1)return;q(i[o+1],x.value),G()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&l.isShow||e.allowCreate&&n.focusItemIndex>=0&&l.isShow?Q(c.curPageList[n.focusItemIndex],"select",t):e.allowCreate&&f.value.trim()&&Q(f.value,"custom",t),t.preventDefault();break;case"Backspace":0===o||f.value||function(t,a){var r=_();q(x.value,r[t-1]),E.selectedTagList.splice(t-1,1),G();var o=M.value[a[e.saveKey]];(e.allowCreate&&o||!e.allowCreate)&&!V.value&&E.localList.push(a),g.value="".concat(C,"px"),Y("remove")}(o,E.selectedTagList[o-1])}}},handlePaste:function(t){if(t.preventDefault(),V.value)return!1;var a=e.maxData,r=e.saveKey,o=e.displayKey,n=e.pasteFn,l=e.allowCreate,i=t.clipboardData.getData("text"),s=n?n(i):function(t){var a=[],r=t.split(";"),o=/^[a-zA-Z][a-zA-Z_]*/g;return r.forEach((function(t){var r=t.match(o);if(r){var n,l=r.join("");a.push((m(n={},e.saveKey,l),m(n,e.displayKey,l),n))}})),a}(i),c=s.map((function(e){return e[r]}));if(c.length){var u=_(),d=$(),p=E.localList.map((function(e){return e[r]}));if(c=c.filter((function(e){var t=(null==e?void 0:e.trim())&&!D.value.includes(e);return l?t:t&&p.includes(e)})),-1!==a){var f=E.selectedTagList.length;if(f<a){var v=a-f;c.length>v&&(c=y(c.slice(0,v)))}else c=[]}var h,T=l?c.map((function(e){var t,a=E.localList.find((function(t){return t[r]===e}));return null!=a?a:(m(t={},r,e),m(t,o,e),t)})):E.localList.filter((function(e){return c.includes(e[r])}));c.length&&((h=E.selectedTagList).splice.apply(h,[d,0].concat(y(T))),q(x.value,u[d]),g.value.style.width="".concat(C,"px"),E.localList=E.localList.filter((function(e){return!c.includes(e[r])})),Y("select"),G())}},resolveClassName:i})},render:function(){var e=this;return(0,T.createVNode)("div",{class:"".concat(this.resolveClassName("tag-input")),ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:function(){return e.isHover=!0},onMouseleave:function(){return e.isHover=!1}},[(0,T.createVNode)(I.default,(0,T.mergeProps)({theme:"light ".concat(this.resolveClassName("tag-input-popover-content")),trigger:"manual",placement:"bottom-start",arrow:!1},this.popoverProps),{default:function(){var t,a,r;return(0,T.createVNode)("div",{class:e.triggerClass},[(0,T.createVNode)("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:"".concat(e.leftSpace,"px")}},[e.selectedTagList.map((function(t,a){var r={boundary:"window",theme:"light",distance:12,content:t[e.tooltipKey],disabled:!e.tooltipKey},o=e.localCollapseTags&&e.overflowTagIndex&&a>=e.overflowTagIndex;return(0,T.withDirectives)((0,T.createVNode)("li",{class:"tag-item",style:{display:o?"none":""},onClick:e.tagFocus},[(0,T.createVNode)(O,{node:t,tpl:e.tagTpl,displayKey:e.displayKey,hasTips:!!e.tooltipKey,tagOverflowTips:e.tagOverflowTips},null),e.showTagClose?(0,T.createVNode)(P.Error,{class:"remove-tag",onClick:e.handleTagRemove.bind(e,t,a)},null):null]),[[(0,T.resolveDirective)("bk-tooltips"),r]])})),(0,T.withDirectives)((0,T.createVNode)("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[(0,T.withDirectives)((0,T.createVNode)("input",{type:"text",class:"tag-input",ref:"tagInputRef","onUpdate:modelValue":function(t){return e.curInputValue=t},onInput:e.handleInput,onFocus:e.handleFocus,onBlur:e.handleBlur,onKeydown:e.handleKeydown,onPaste:e.handlePaste},null),[[T.vModelText,e.curInputValue]])]),[[T.vShow,e.isEdit]]),!!e.overflowTagIndex&&e.localCollapseTags&&(0,T.createVNode)("li",{class:"tag-item"},[(0,T.createVNode)("div",{class:"tag"},[(0,T.createVNode)("span",{class:"text"},[(0,T.createTextVNode)("+"),e.selectedTagList.length-e.overflowTagIndex])])])]),(0,T.withDirectives)((0,T.createVNode)("p",{class:"placeholder"},[e.placeholderText]),[[T.vShow,e.isShowPlaceholder]]),null!==(r=null===(a=null===(t=e.$slots)||void 0===t?void 0:t.suffix)||void 0===a?void 0:a.call(t))&&void 0!==r?r:e.isShowClear&&(0,T.createVNode)(P.Close,{class:"clear-icon",onClick:e.handleClear},null)])},content:function(){return(0,T.createVNode)("div",{class:"".concat(e.resolveClassName("selector-list"))},[(0,T.createVNode)("ul",{ref:"selectorListRef",style:{"max-height":"".concat(e.contentMaxHeight,"px")},class:"outside-ul"},[e.renderList.map((function(t,a){return e.useGroup?(0,T.createVNode)("li",{class:"".concat(e.resolveClassName("selector-group-item"))},[(0,T.createVNode)("span",{class:"group-name"},[t.name,(0,T.createTextVNode)(" ("),t.children.length,(0,T.createTextVNode)(")")]),(0,T.createVNode)("ul",{class:"".concat(e.resolveClassName("selector-group-list-item"))},[t.children.map((function(t,a){return(0,T.createVNode)("li",{class:["".concat(e.resolveClassName("selector-list-item")),{disabled:t.disabled},e.activeClass(t,a)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,T.createVNode)(N,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])}))])]):(0,T.createVNode)("li",{class:["".concat(e.resolveClassName("selector-list-item")),{disabled:t.disabled},e.activeClass(t,a)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,T.createVNode)(N,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])})),e.isPageLoading?(0,T.createVNode)("li",{class:"".concat(e.resolveClassName("selector-list-item")," loading")},[(0,T.createVNode)(x.default,{theme:"primary",size:x.BkLoadingSize.Small},null)]):null])])}})])}}),A=(0,d.withInstall)(k);var R=u.Z;export{R as default};
1
+ import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__ from "../directives";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__ from "../loading";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__ from "../popover";
9
+ import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
10
+ /******/ // The require scope
11
+ /******/ var __webpack_require__ = {};
12
+ /******/
13
+ /************************************************************************/
14
+ /******/ /* webpack/runtime/define property getters */
15
+ /******/ (() => {
16
+ /******/ // define getter functions for harmony exports
17
+ /******/ __webpack_require__.d = (exports, definition) => {
18
+ /******/ for(var key in definition) {
19
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
20
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
21
+ /******/ }
22
+ /******/ }
23
+ /******/ };
24
+ /******/ })();
25
+ /******/
26
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
27
+ /******/ (() => {
28
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29
+ /******/ })();
30
+ /******/
31
+ /************************************************************************/
32
+ var __webpack_exports__ = {};
33
+
34
+ // EXPORTS
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ Z: () => (/* binding */ src)
37
+ });
38
+
39
+ ;// CONCATENATED MODULE: external "../shared"
40
+ var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
41
+ var y = x => () => x
42
+ const external_shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["checkOverflow"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.checkOverflow, ["useFormItem"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.useFormItem, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
43
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
44
+ function _typeof(obj) {
45
+ "@babel/helpers - typeof";
46
+
47
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
48
+ return typeof obj;
49
+ } : function (obj) {
50
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
51
+ }, _typeof(obj);
52
+ }
53
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
54
+ function _arrayWithHoles(arr) {
55
+ if (Array.isArray(arr)) return arr;
56
+ }
57
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
58
+ function _iterableToArrayLimit(arr, i) {
59
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
60
+ if (null != _i) {
61
+ var _s,
62
+ _e,
63
+ _x,
64
+ _r,
65
+ _arr = [],
66
+ _n = !0,
67
+ _d = !1;
68
+ try {
69
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
70
+ if (Object(_i) !== _i) return;
71
+ _n = !1;
72
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
73
+ } catch (err) {
74
+ _d = !0, _e = err;
75
+ } finally {
76
+ try {
77
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
78
+ } finally {
79
+ if (_d) throw _e;
80
+ }
81
+ }
82
+ return _arr;
83
+ }
84
+ }
85
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
86
+ function _arrayLikeToArray(arr, len) {
87
+ if (len == null || len > arr.length) len = arr.length;
88
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
89
+ return arr2;
90
+ }
91
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
92
+
93
+ function _unsupportedIterableToArray(o, minLen) {
94
+ if (!o) return;
95
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
96
+ var n = Object.prototype.toString.call(o).slice(8, -1);
97
+ if (n === "Object" && o.constructor) n = o.constructor.name;
98
+ if (n === "Map" || n === "Set") return Array.from(o);
99
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
100
+ }
101
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
102
+ function _nonIterableRest() {
103
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
104
+ }
105
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
106
+
107
+
108
+
109
+
110
+ function _slicedToArray(arr, i) {
111
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
112
+ }
113
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
114
+
115
+ function _arrayWithoutHoles(arr) {
116
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
117
+ }
118
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
119
+ function _iterableToArray(iter) {
120
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
121
+ }
122
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
123
+ function _nonIterableSpread() {
124
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
125
+ }
126
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
127
+
128
+
129
+
130
+
131
+ function _toConsumableArray(arr) {
132
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
133
+ }
134
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
135
+
136
+ function _toPrimitive(input, hint) {
137
+ if (_typeof(input) !== "object" || input === null) return input;
138
+ var prim = input[Symbol.toPrimitive];
139
+ if (prim !== undefined) {
140
+ var res = prim.call(input, hint || "default");
141
+ if (_typeof(res) !== "object") return res;
142
+ throw new TypeError("@@toPrimitive must return a primitive value.");
143
+ }
144
+ return (hint === "string" ? String : Number)(input);
145
+ }
146
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
147
+
148
+
149
+ function _toPropertyKey(arg) {
150
+ var key = _toPrimitive(arg, "string");
151
+ return _typeof(key) === "symbol" ? key : String(key);
152
+ }
153
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
154
+
155
+ function _defineProperty(obj, key, value) {
156
+ key = _toPropertyKey(key);
157
+ if (key in obj) {
158
+ Object.defineProperty(obj, key, {
159
+ value: value,
160
+ enumerable: true,
161
+ configurable: true,
162
+ writable: true
163
+ });
164
+ } else {
165
+ obj[key] = value;
166
+ }
167
+ return obj;
168
+ }
169
+ ;// CONCATENATED MODULE: external "vue"
170
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
171
+ var external_vue_y = x => () => x
172
+ const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["markRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.markRaw, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vModelText"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vModelText, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
173
+ ;// CONCATENATED MODULE: external "lodash/debounce"
174
+ var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
175
+ var debounce_y = x => () => x
176
+ const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
177
+ ;// CONCATENATED MODULE: external "../config-provider"
178
+ var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
179
+ var external_config_provider_y = x => () => x
180
+ const external_config_provider_namespaceObject = external_config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
181
+ ;// CONCATENATED MODULE: external "../directives"
182
+ var external_directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
183
+ var external_directives_y = x => () => x
184
+ const external_directives_namespaceObject = external_directives_x({ ["bkTooltips"]: () => __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__.bkTooltips });
185
+ ;// CONCATENATED MODULE: external "../icon"
186
+ var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
187
+ var external_icon_y = x => () => x
188
+ const external_icon_namespaceObject = external_icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Error });
189
+ ;// CONCATENATED MODULE: external "../loading"
190
+ var external_loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
191
+ var external_loading_y = x => () => x
192
+ const external_loading_namespaceObject = external_loading_x({ ["BkLoadingSize"]: () => __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__.BkLoadingSize, ["default"]: () => __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__["default"] });
193
+ ;// CONCATENATED MODULE: external "../popover"
194
+ var external_popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
195
+ var external_popover_y = x => () => x
196
+ const external_popover_namespaceObject = external_popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__["default"] });
197
+ ;// CONCATENATED MODULE: ../../packages/tag-input/src/common.ts
198
+
199
+
200
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
201
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
202
+ /*
203
+ * Tencent is pleased to support the open source community by making
204
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
205
+ *
206
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
207
+ *
208
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
209
+ *
210
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
211
+ *
212
+ * ---------------------------------------------------
213
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
214
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
215
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
216
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
217
+ *
218
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
219
+ * the Software.
220
+ *
221
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
222
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
223
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
224
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
225
+ * IN THE SOFTWARE.
226
+ */
227
+
228
+ var INPUT_MIN_WIDTH = 12;
229
+ function useDebouncedRef(value) {
230
+ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
231
+ var timeout;
232
+ var innerValue = value;
233
+ return customRef(function (track, trigger) {
234
+ return {
235
+ get: function get() {
236
+ track();
237
+ return innerValue;
238
+ },
239
+ set: function set(newValue) {
240
+ clearTimeout(timeout);
241
+ timeout = setTimeout(function () {
242
+ innerValue = newValue;
243
+ trigger();
244
+ }, delay);
245
+ }
246
+ };
247
+ });
248
+ }
249
+ function usePage(pageSize) {
250
+ var state = (0,external_vue_namespaceObject.reactive)({
251
+ curPage: 1,
252
+ totalSize: 0,
253
+ totalPage: 0,
254
+ pageSize: pageSize,
255
+ isPageLoading: false,
256
+ curPageList: [],
257
+ renderListPaged: []
258
+ });
259
+ // 初始化分页信息
260
+ var initPage = function initPage() {
261
+ var _state$renderListPage, _state$curPageList;
262
+ var allList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
263
+ state.curPage = 1;
264
+ state.totalSize = allList.length;
265
+ state.totalPage = Math.ceil(state.totalSize / state.pageSize) || 1;
266
+ var list = [];
267
+ // 小于等于0会无限循环
268
+ if (state.pageSize > 0) {
269
+ for (var i = 0; i < state.totalSize; i += state.pageSize) {
270
+ list.push(allList.slice(i, i + state.pageSize));
271
+ }
272
+ }
273
+ (_state$renderListPage = state.renderListPaged).splice.apply(_state$renderListPage, [0, state.renderListPaged.length].concat(list));
274
+ (_state$curPageList = state.curPageList).splice.apply(_state$curPageList, [0, state.curPageList.length].concat(_toConsumableArray(state.renderListPaged[state.curPage - 1] || [])));
275
+ };
276
+ var pageChange = function pageChange(page) {
277
+ var _state$curPageList2;
278
+ state.curPage = page;
279
+ (_state$curPageList2 = state.curPageList).splice.apply(_state$curPageList2, [state.curPageList.length, 0].concat(_toConsumableArray(state.renderListPaged[state.curPage - 1] || [])));
280
+ state.isPageLoading = false;
281
+ };
282
+ return {
283
+ pageState: state,
284
+ initPage: initPage,
285
+ pageChange: pageChange
286
+ };
287
+ }
288
+ function useFlatList(props) {
289
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
290
+ useGroup = _toRefs.useGroup,
291
+ saveKey = _toRefs.saveKey,
292
+ displayKey = _toRefs.displayKey,
293
+ list = _toRefs.list;
294
+ var flatList = (0,external_vue_namespaceObject.ref)([]);
295
+ var saveKeyMap = (0,external_vue_namespaceObject.ref)({});
296
+ (0,external_vue_namespaceObject.watch)([useGroup, saveKey, displayKey, list], function () {
297
+ flatList.value = [];
298
+ var formatList = (0,external_vue_namespaceObject.markRaw)(list.value);
299
+ if (useGroup.value) {
300
+ formatList = formatList.reduce(function (formatList, item) {
301
+ var children = [];
302
+ if (item.children) {
303
+ children = item.children.map(function (child) {
304
+ return _objectSpread({
305
+ group: {
306
+ groupId: item[saveKey.value],
307
+ groupName: item[displayKey.value]
308
+ }
309
+ }, child);
310
+ });
311
+ }
312
+ return formatList.concat(children);
313
+ }, []);
314
+ }
315
+ flatList.value = formatList;
316
+ saveKeyMap.value = formatList.reduce(function (acc, item) {
317
+ acc[item[saveKey.value]] = item;
318
+ return acc;
319
+ }, {});
320
+ }, {
321
+ immediate: true,
322
+ deep: true
323
+ });
324
+ return {
325
+ flatList: flatList,
326
+ saveKeyMap: saveKeyMap
327
+ };
328
+ }
329
+ /**
330
+ * 获取字符长度,汉字两个字节
331
+ * @param str 需要计算长度的字符
332
+ * @returns 字符长度
333
+ */
334
+ var getCharLength = function getCharLength(str) {
335
+ var len = str.length;
336
+ var bitLen = 0;
337
+ for (var i = 0; i < len; i++) {
338
+ if ((str.charCodeAt(i) & 0xff00) !== 0) {
339
+ bitLen += 1;
340
+ }
341
+ bitLen += 1;
342
+ }
343
+ return bitLen;
344
+ };
345
+ /**
346
+ * 获取隐藏 tag index
347
+ * @param tagInputRef 组件容器 ref
348
+ * @param collapseTags 是否折叠 tags
349
+ * @param selectedTagList 已选择 tags
350
+ */
351
+ var useTagsOverflow = function useTagsOverflow(tagInputRef, collapseTags, selectedTagList) {
352
+ (0,external_vue_namespaceObject.watch)([selectedTagList, collapseTags], function () {
353
+ calcOverflow();
354
+ }, {
355
+ flush: 'post'
356
+ });
357
+ var overflowTagIndex = (0,external_vue_namespaceObject.ref)(null);
358
+ // 计算出现换行的索引
359
+ var calcOverflow = function calcOverflow() {
360
+ if (!collapseTags.value) return;
361
+ overflowTagIndex.value = null;
362
+ setTimeout(function () {
363
+ var tags = Array.from(tagInputRef.value.querySelectorAll('.tag-item'));
364
+ var tagIndexInSecondRow = tags.findIndex(function (currentTag, index) {
365
+ if (!index) {
366
+ return false;
367
+ }
368
+ var previousTag = tags[index - 1];
369
+ return previousTag.offsetTop !== currentTag.offsetTop;
370
+ });
371
+ overflowTagIndex.value = tagIndexInSecondRow > 0 ? tagIndexInSecondRow - 1 : null;
372
+ });
373
+ };
374
+ return {
375
+ overflowTagIndex: overflowTagIndex
376
+ };
377
+ };
378
+ ;// CONCATENATED MODULE: ../../packages/tag-input/src/list-tag-render.tsx
379
+
380
+ /*
381
+ * Tencent is pleased to support the open source community by making
382
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
383
+ *
384
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
385
+ *
386
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
387
+ *
388
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
389
+ *
390
+ * ---------------------------------------------------
391
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
392
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
393
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
394
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
395
+ *
396
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
397
+ * the Software.
398
+ *
399
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
400
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
401
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
402
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
403
+ * IN THE SOFTWARE.
404
+ */
405
+
406
+
407
+
408
+ /* harmony default export */ const list_tag_render = ((0,external_vue_namespaceObject.defineComponent)({
409
+ name: 'ListTagRender',
410
+ props: {
411
+ node: external_shared_namespaceObject.PropTypes.object,
412
+ searchKey: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.string)]),
413
+ displayKey: external_shared_namespaceObject.PropTypes.string,
414
+ searchKeyword: external_shared_namespaceObject.PropTypes.string,
415
+ tpl: {
416
+ type: Function
417
+ }
418
+ },
419
+ render: function render() {
420
+ var _this = this;
421
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
422
+ resolveClassName = _usePrefix.resolveClassName;
423
+ var highlightKeyword = function highlightKeyword(value) {
424
+ if (_this.searchKeyword) {
425
+ var keywordReg = new RegExp("(".concat(_this.searchKeyword, ")"), 'i');
426
+ return value.replace(keywordReg, '<strong class="highlight-text">$1</strong>');
427
+ }
428
+ return value;
429
+ };
430
+ if (this.tpl) {
431
+ return this.tpl(this.node, highlightKeyword, external_vue_namespaceObject.h, this);
432
+ }
433
+ var displayText = this.node[this.displayKey];
434
+ return (0,external_vue_namespaceObject.createVNode)("div", {
435
+ "class": "".concat(resolveClassName('selector-node'))
436
+ }, [(0,external_vue_namespaceObject.createVNode)("span", {
437
+ "class": "text",
438
+ "innerHTML": highlightKeyword(displayText)
439
+ }, [displayText])]);
440
+ }
441
+ }));
442
+ ;// CONCATENATED MODULE: external "vue-types"
443
+ var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
444
+ var external_vue_types_y = x => () => x
445
+ const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
446
+ ;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-props.ts
447
+ /*
448
+ * Tencent is pleased to support the open source community by making
449
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
450
+ *
451
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
452
+ *
453
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
454
+ *
455
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
456
+ *
457
+ * ---------------------------------------------------
458
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
459
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
460
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
461
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
462
+ *
463
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
464
+ * the Software.
465
+ *
466
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
467
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
468
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
469
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
470
+ * IN THE SOFTWARE.
471
+ */
472
+
473
+
474
+ var TagInputTriggerEnum;
475
+ (function (TagInputTriggerEnum) {
476
+ TagInputTriggerEnum["FOCUS"] = "focus";
477
+ TagInputTriggerEnum["SEARCH"] = "search";
478
+ })(TagInputTriggerEnum || (TagInputTriggerEnum = {}));
479
+ var tagProps = function tagProps() {
480
+ return {
481
+ modelValue: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.string).def([]),
482
+ placeholder: external_shared_namespaceObject.PropTypes.string.def(''),
483
+ list: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.object).def([]),
484
+ disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
485
+ tooltipKey: external_shared_namespaceObject.PropTypes.string.def(''),
486
+ saveKey: external_shared_namespaceObject.PropTypes.string.def('id'),
487
+ displayKey: external_shared_namespaceObject.PropTypes.string.def('name'),
488
+ hasDeleteIcon: external_shared_namespaceObject.PropTypes.bool.def(false),
489
+ clearable: external_shared_namespaceObject.PropTypes.bool.def(true),
490
+ trigger: (0,external_vue_types_namespaceObject.toType)('treeTriggerType', {}).def(TagInputTriggerEnum.SEARCH),
491
+ searchKey: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.string)]).def('name'),
492
+ useGroup: external_shared_namespaceObject.PropTypes.bool.def(false),
493
+ allowCreate: external_shared_namespaceObject.PropTypes.bool.def(false),
494
+ maxData: external_shared_namespaceObject.PropTypes.number.def(-1),
495
+ maxResult: external_shared_namespaceObject.PropTypes.number.def(10),
496
+ contentMaxHeight: external_shared_namespaceObject.PropTypes.number.def(300),
497
+ contentWidth: external_shared_namespaceObject.PropTypes.number.def(190),
498
+ separator: external_shared_namespaceObject.PropTypes.string.def(''),
499
+ allowNextFocus: external_shared_namespaceObject.PropTypes.bool.def(true),
500
+ allowAutoMatch: external_shared_namespaceObject.PropTypes.bool.def(false),
501
+ showClearOnlyHover: external_shared_namespaceObject.PropTypes.bool.def(false),
502
+ isAsyncList: external_shared_namespaceObject.PropTypes.bool.def(false),
503
+ leftSpace: external_shared_namespaceObject.PropTypes.number.def(0),
504
+ createTagValidator: {
505
+ type: Function
506
+ },
507
+ filterCallback: {
508
+ type: Function
509
+ },
510
+ tagTpl: {
511
+ type: Function
512
+ },
513
+ tpl: {
514
+ type: Function
515
+ },
516
+ pasteFn: {
517
+ type: Function
518
+ },
519
+ withValidate: {
520
+ type: Boolean,
521
+ "default": true
522
+ },
523
+ popoverProps: {
524
+ type: Object,
525
+ "default": function _default() {
526
+ return {};
527
+ }
528
+ },
529
+ collapseTags: {
530
+ type: Boolean,
531
+ "default": false
532
+ },
533
+ tagOverflowTips: {
534
+ type: Object,
535
+ "default": function _default() {
536
+ return {};
537
+ }
538
+ }
539
+ };
540
+ };
541
+ /* harmony default export */ const tag_props = (tagProps);
542
+ ;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-render.tsx
543
+
544
+
545
+ function tag_render_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
546
+ function tag_render_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? tag_render_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : tag_render_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
547
+ /*
548
+ * Tencent is pleased to support the open source community by making
549
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
550
+ *
551
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
552
+ *
553
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
554
+ *
555
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
556
+ *
557
+ * ---------------------------------------------------
558
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
559
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
560
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
561
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
562
+ *
563
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
564
+ * the Software.
565
+ *
566
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
567
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
568
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
569
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
570
+ * IN THE SOFTWARE.
571
+ */
572
+
573
+
574
+
575
+ /* harmony default export */ const tag_render = ((0,external_vue_namespaceObject.defineComponent)({
576
+ name: 'TagRender',
577
+ directives: {
578
+ bkTooltips: external_directives_namespaceObject.bkTooltips
579
+ },
580
+ props: {
581
+ node: external_shared_namespaceObject.PropTypes.object,
582
+ displayKey: external_shared_namespaceObject.PropTypes.string,
583
+ tpl: {
584
+ type: Function
585
+ },
586
+ hasTips: {
587
+ type: Boolean,
588
+ "default": false
589
+ },
590
+ tagOverflowTips: {
591
+ type: Object,
592
+ "default": function _default() {
593
+ return {};
594
+ }
595
+ }
596
+ },
597
+ setup: function setup(props) {
598
+ var tagRef = (0,external_vue_namespaceObject.ref)();
599
+ var isOverflow = (0,external_vue_namespaceObject.ref)(false);
600
+ var overflowTips = (0,external_vue_namespaceObject.computed)(function () {
601
+ return tag_render_objectSpread({
602
+ boundary: 'window',
603
+ theme: 'light',
604
+ distance: 12,
605
+ content: props.node[props.displayKey],
606
+ disabled: props.hasTips || !isOverflow.value
607
+ }, props.tagOverflowTips);
608
+ });
609
+ (0,external_vue_namespaceObject.onMounted)(function () {
610
+ isOverflow.value = (0,external_shared_namespaceObject.checkOverflow)(tagRef.value);
611
+ });
612
+ return {
613
+ overflowTips: overflowTips,
614
+ tagRef: tagRef
615
+ };
616
+ },
617
+ render: function render() {
618
+ if (this.tpl) {
619
+ return this.tpl(this.node, external_vue_namespaceObject.h, this);
620
+ }
621
+ return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
622
+ "class": "tag",
623
+ "ref": "tagRef"
624
+ }, [(0,external_vue_namespaceObject.createVNode)("span", {
625
+ "class": "text"
626
+ }, [this.node[this.displayKey]])]), [[(0,external_vue_namespaceObject.resolveDirective)("bk-tooltips"), this.overflowTips]]);
627
+ }
628
+ }));
629
+ ;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-input.tsx
630
+
631
+
632
+
633
+
634
+
635
+ function tag_input_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
636
+ function tag_input_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? tag_input_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : tag_input_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
637
+ /*
638
+ * Tencent is pleased to support the open source community by making
639
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
640
+ *
641
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
642
+ *
643
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
644
+ *
645
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
646
+ *
647
+ * ---------------------------------------------------
648
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
649
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
650
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
651
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
652
+ *
653
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
654
+ * the Software.
655
+ *
656
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
657
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
658
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
659
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
660
+ * IN THE SOFTWARE.
661
+ */
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+
674
+ /* harmony default export */ const tag_input = ((0,external_vue_namespaceObject.defineComponent)({
675
+ name: 'TagInput',
676
+ directives: {
677
+ bkTooltips: external_directives_namespaceObject.bkTooltips
678
+ },
679
+ props: tag_props(),
680
+ emits: ['update:modelValue', 'change', 'select', 'focus', 'blur', 'remove', 'removeAll', 'input'],
681
+ setup: function setup(props, _ref) {
682
+ var emit = _ref.emit;
683
+ var formItem = (0,external_shared_namespaceObject.useFormItem)();
684
+ var t = (0,external_config_provider_namespaceObject.useLocale)('tagInput');
685
+ var state = (0,external_vue_namespaceObject.reactive)({
686
+ isEdit: false,
687
+ isHover: false,
688
+ focusItemIndex: props.allowCreate ? -1 : 0
689
+ });
690
+ var popoverProps = (0,external_vue_namespaceObject.reactive)(tag_input_objectSpread({
691
+ isShow: false,
692
+ width: 190,
693
+ offset: {
694
+ mainAxis: 4,
695
+ crossAxis: 0
696
+ // alignmentAxis: 50,
697
+ }
698
+ }, props.popoverProps));
699
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
700
+ resolveClassName = _usePrefix.resolveClassName;
701
+ // 分页处理
702
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
703
+ maxResult = _toRefs.maxResult;
704
+ var _usePage = usePage(maxResult),
705
+ pageState = _usePage.pageState,
706
+ initPage = _usePage.initPage,
707
+ pageChange = _usePage.pageChange;
708
+ var curInputValue = (0,external_vue_namespaceObject.ref)('');
709
+ var tagInputRef = (0,external_vue_namespaceObject.ref)(null);
710
+ var bkTagSelectorRef = (0,external_vue_namespaceObject.ref)(null);
711
+ var tagListRef = (0,external_vue_namespaceObject.ref)(null);
712
+ var tagInputItemRef = (0,external_vue_namespaceObject.ref)(null);
713
+ var selectorListRef = (0,external_vue_namespaceObject.ref)(null);
714
+ var timer = (0,external_vue_namespaceObject.ref)(null);
715
+ // 是否展示tag close
716
+ var showTagClose = (0,external_vue_namespaceObject.computed)(function () {
717
+ return !props.disabled && props.hasDeleteIcon;
718
+ });
719
+ // 是否单选
720
+ var isSingleSelect = (0,external_vue_namespaceObject.computed)(function () {
721
+ return props.maxData === 1;
722
+ });
723
+ // 是否展示placeholder
724
+ var isShowPlaceholder = (0,external_vue_namespaceObject.computed)(function () {
725
+ return listState.selectedTagList.length === 0 && curInputValue.value === '' && !state.isEdit;
726
+ });
727
+ var placeholderText = (0,external_vue_namespaceObject.computed)(function () {
728
+ return props.placeholder || t.value.placeholder;
729
+ });
730
+ // 是否展示清空Icon
731
+ /**
732
+ * 不显示条件:
733
+ * 1. 设置不可清除
734
+ * 2. 禁用时
735
+ * 3. tag标签为空时
736
+ * 4. 设置了showClearOnlyHover,且没有hover的时候
737
+ */
738
+ var isShowClear = (0,external_vue_namespaceObject.computed)(function () {
739
+ return props.clearable && !props.disabled && listState.selectedTagList.length !== 0 && (props.showClearOnlyHover ? state.isHover : true);
740
+ });
741
+ var triggerClass = (0,external_vue_namespaceObject.computed)(function () {
742
+ var _ref2;
743
+ return _ref2 = {}, _defineProperty(_ref2, "".concat(resolveClassName('tag-input-trigger')), true), _defineProperty(_ref2, "active", state.isEdit), _defineProperty(_ref2, "disabled", props.disabled), _ref2;
744
+ });
745
+ var listState = (0,external_vue_namespaceObject.reactive)({
746
+ localList: [],
747
+ tagListCache: [],
748
+ selectedTagList: [],
749
+ selectedTagListCache: []
750
+ });
751
+ // 选中标签 save key 列表
752
+ var tagList = (0,external_vue_namespaceObject.computed)(function () {
753
+ return listState.selectedTagList.map(function (tag) {
754
+ return tag[props.saveKey];
755
+ });
756
+ });
757
+ // 扁平化 list
758
+ var _useFlatList = useFlatList(props),
759
+ flatList = _useFlatList.flatList,
760
+ saveKeyMap = _useFlatList.saveKeyMap;
761
+ // 下拉框渲染列表
762
+ var renderList = (0,external_vue_namespaceObject.computed)(function () {
763
+ if (props.useGroup) {
764
+ var groupMap = {};
765
+ pageState.curPageList.forEach(function (item, index) {
766
+ item.__index__ = index;
767
+ if (!groupMap[item.group.groupId]) {
768
+ groupMap[item.group.groupId] = {
769
+ id: item.group.groupId,
770
+ name: item.group.groupName,
771
+ children: []
772
+ };
773
+ }
774
+ groupMap[item.group.groupId].children.push(item);
775
+ });
776
+ return Object.keys(groupMap).map(function (key) {
777
+ return groupMap[key];
778
+ });
779
+ }
780
+ return pageState.curPageList;
781
+ });
782
+ (0,external_vue_namespaceObject.watch)([function () {
783
+ return flatList.value;
784
+ }], function () {
785
+ (0,external_vue_namespaceObject.nextTick)(function () {
786
+ initData();
787
+ });
788
+ }, {
789
+ deep: true
790
+ });
791
+ (0,external_vue_namespaceObject.watch)(function () {
792
+ return props.modelValue;
793
+ }, function (val) {
794
+ if (!shallowCompareArray(tagList.value, val)) {
795
+ (0,external_vue_namespaceObject.nextTick)(function () {
796
+ initData();
797
+ });
798
+ if (props.withValidate) {
799
+ var _formItem$validate;
800
+ formItem === null || formItem === void 0 || (_formItem$validate = formItem.validate) === null || _formItem$validate === void 0 ? void 0 : _formItem$validate.call(formItem, 'change');
801
+ }
802
+ }
803
+ });
804
+ (0,external_vue_namespaceObject.watch)(curInputValue, (0,debounce_namespaceObject["default"])(function () {
805
+ var hasShowCount = pageState.curPageList.length !== 0;
806
+ var value = curInputValue.value;
807
+ /**
808
+ * 1. value !== '' && hasShowCount => search value list.
809
+ * 2. value === '' && props.trigger === 'focus' && hasShowCount => trigger is focus and show all list.
810
+ */
811
+ if (value !== '' && hasShowCount || value === '' && props.trigger === 'focus' && hasShowCount) {
812
+ popoverProps.isShow = true;
813
+ } else if (props.trigger !== 'focus' || !hasShowCount) {
814
+ popoverProps.isShow = false;
815
+ }
816
+ }, 150));
817
+ (0,external_vue_namespaceObject.watch)(function () {
818
+ return popoverProps.isShow;
819
+ }, function (show) {
820
+ changePopoverOffset();
821
+ if (show) {
822
+ if (selectorListRef.value) {
823
+ (0,external_vue_namespaceObject.nextTick)(function () {
824
+ selectorListRef.value.scrollTop = 0;
825
+ });
826
+ selectorListRef.value.removeEventListener('scroll', scrollHandler);
827
+ selectorListRef.value.addEventListener('scroll', scrollHandler);
828
+ }
829
+ }
830
+ });
831
+ (0,external_vue_namespaceObject.onMounted)(function () {
832
+ initData();
833
+ });
834
+ var changePopoverOffset = function changePopoverOffset() {
835
+ var _tagInputItemRef$valu;
836
+ // 修改popover offset
837
+ popoverProps.offset.crossAxis = isSingleSelect.value ? 0 : (_tagInputItemRef$valu = tagInputItemRef.value) === null || _tagInputItemRef$valu === void 0 ? void 0 : _tagInputItemRef$valu.offsetLeft;
838
+ };
839
+ var scrollHandler = function scrollHandler() {
840
+ if (pageState.isPageLoading || selectorListRef.value.scrollTop === 0) {
841
+ return;
842
+ }
843
+ var _selectorListRef$valu = selectorListRef.value,
844
+ scrollTop = _selectorListRef$valu.scrollTop,
845
+ offsetHeight = _selectorListRef$valu.offsetHeight,
846
+ scrollHeight = _selectorListRef$valu.scrollHeight;
847
+ if (scrollTop + offsetHeight >= scrollHeight) {
848
+ var curPage = pageState.curPage + 1;
849
+ if (curPage <= pageState.totalPage) {
850
+ pageState.isPageLoading = true;
851
+ setTimeout(function () {
852
+ pageChange(curPage);
853
+ }, 500);
854
+ }
855
+ }
856
+ };
857
+ // 获取选中元素节点
858
+ var getSelectedTagNodes = function getSelectedTagNodes() {
859
+ var _tagListRef$value;
860
+ var nodes = Array.from(((_tagListRef$value = tagListRef.value) === null || _tagListRef$value === void 0 ? void 0 : _tagListRef$value.childNodes) || []);
861
+ return nodes.filter(function (node) {
862
+ return ![Node.TEXT_NODE, Node.COMMENT_NODE].includes(node.nodeType);
863
+ });
864
+ };
865
+ /**
866
+ * 触发输入框聚焦
867
+ * @param e
868
+ */
869
+ var focusInputTrigger = function focusInputTrigger(e) {
870
+ if (props.disabled) return;
871
+ if (e !== null && e !== void 0 && e.target) {
872
+ var className = e.target.className;
873
+ if (className.indexOf("".concat(resolveClassName('tag-input-trigger'))) > -1 || className.indexOf('tag-list') > -1) {
874
+ // 如果没点在节点上,重置input位置(在最后插入input)
875
+ tagListRef.value.appendChild(tagInputItemRef.value);
876
+ }
877
+ }
878
+ clearTimeout(timer.value);
879
+ // 如果是单选,在获取焦点时自动定位为当前值
880
+ if (isSingleSelect.value && tagList.value.length) {
881
+ listState.tagListCache = _toConsumableArray(tagList.value);
882
+ listState.selectedTagListCache = _toConsumableArray(listState.selectedTagList);
883
+ curInputValue.value = listState.selectedTagListCache[0][props.saveKey];
884
+ removeTag(listState.selectedTagList[0], 0);
885
+ handleInput();
886
+ }
887
+ state.isEdit = true;
888
+ setTimeout(function () {
889
+ var _tagInputRef$value;
890
+ (_tagInputRef$value = tagInputRef.value) === null || _tagInputRef$value === void 0 ? void 0 : _tagInputRef$value.focus();
891
+ if (props.trigger === 'focus' && listState.localList.length !== 0) {
892
+ filterData();
893
+ if (popoverProps.isShow) {
894
+ changePopoverOffset();
895
+ } else {
896
+ popoverProps.isShow = true;
897
+ }
898
+ }
899
+ }, 200);
900
+ };
901
+ /**
902
+ * 初始化列表数据
903
+ */
904
+ var initData = function initData() {
905
+ var saveKey = props.saveKey,
906
+ modelValue = props.modelValue,
907
+ displayKey = props.displayKey,
908
+ allowCreate = props.allowCreate,
909
+ trigger = props.trigger,
910
+ isAsyncList = props.isAsyncList;
911
+ listState.selectedTagList = [];
912
+ listState.localList = flatList.value;
913
+ if (modelValue.length) {
914
+ var modelValueMap = {};
915
+ listState.selectedTagList = modelValue.map(function (tag) {
916
+ var item = saveKeyMap.value[tag];
917
+ modelValueMap[tag] = 1;
918
+ if (!item && allowCreate) {
919
+ var _ref3;
920
+ return _ref3 = {}, _defineProperty(_ref3, saveKey, tag), _defineProperty(_ref3, displayKey, tag), _ref3;
921
+ }
922
+ return item;
923
+ }).filter(function (item) {
924
+ return item;
925
+ });
926
+ // 如果不是单选时,需要将已选的过滤掉
927
+ if (!isSingleSelect.value) {
928
+ listState.localList = listState.localList.filter(function (val) {
929
+ return !modelValueMap[val[saveKey]];
930
+ });
931
+ }
932
+ }
933
+ if (isAsyncList && curInputValue.value) {
934
+ filterData(curInputValue.value);
935
+ if (pageState.curPageList.length) {
936
+ popoverProps.isShow = true;
937
+ }
938
+ return;
939
+ }
940
+ // 如果需要首次展示列表,先初始化
941
+ if (trigger === 'focus') {
942
+ filterData();
943
+ }
944
+ };
945
+ // 过滤数据
946
+ var filterData = function filterData() {
947
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
948
+ var searchKey = props.searchKey,
949
+ filterCallback = props.filterCallback;
950
+ var lowerCaseValue = value.toLowerCase().trim();
951
+ if (lowerCaseValue === '') {
952
+ initPage(listState.localList);
953
+ return;
954
+ }
955
+ var filterData = [];
956
+ if (typeof filterCallback === 'function') {
957
+ filterData = filterCallback(lowerCaseValue, searchKey, listState.localList) || [];
958
+ } else {
959
+ // 根据文本框输入的值筛选过来的数据
960
+ if (Array.isArray(searchKey)) {
961
+ // 数组,过滤多个关键字
962
+ filterData = listState.localList.filter(function (item) {
963
+ return searchKey.some(function (keyword) {
964
+ return item[keyword].toLowerCase().indexOf(lowerCaseValue) > -1;
965
+ });
966
+ });
967
+ } else {
968
+ filterData = listState.localList.filter(function (item) {
969
+ return item[searchKey].toLowerCase().indexOf(lowerCaseValue) > -1;
970
+ });
971
+ }
972
+ }
973
+ initPage(filterData);
974
+ };
975
+ var activeClass = function activeClass(data, index) {
976
+ var _style;
977
+ var style = (_style = {}, _defineProperty(_style, "".concat(resolveClassName('selector-actived')), true), _defineProperty(_style, "".concat(resolveClassName('selector-selected')), tagList.value.includes(data[props.saveKey])), _style);
978
+ if (props.useGroup) {
979
+ style["".concat(resolveClassName('selector-actived'))] = data.__index__ === state.focusItemIndex;
980
+ } else {
981
+ style["".concat(resolveClassName('selector-actived'))] = index === state.focusItemIndex;
982
+ }
983
+ return style;
984
+ };
985
+ function shallowCompareArray(arr1, arr2) {
986
+ if (arr1.length !== arr2.length) return false;
987
+ return arr2.every(function (item, index) {
988
+ return arr1[index] === item;
989
+ });
990
+ }
991
+ var clearSingleCache = function clearSingleCache() {
992
+ listState.tagListCache = [];
993
+ listState.selectedTagListCache = [];
994
+ listState.selectedTagList = [];
995
+ };
996
+ var clearInput = function clearInput() {
997
+ curInputValue.value = '';
998
+ };
999
+ /**
1000
+ * 获取输入框元素位置
1001
+ */
1002
+ var getTagInputItemSite = function getTagInputItemSite() {
1003
+ // 单选时,当前替换位置为第一个元素
1004
+ if (isSingleSelect.value) {
1005
+ return 0;
1006
+ }
1007
+ var childNodes = getSelectedTagNodes();
1008
+ var index = childNodes.findIndex(function (_ref4) {
1009
+ var id = _ref4.id;
1010
+ return id === 'tagInputItem';
1011
+ });
1012
+ return index >= 0 ? index : 0;
1013
+ };
1014
+ /**
1015
+ * 交换元素位置
1016
+ */
1017
+ var swapElementPositions = function swapElementPositions(newNode, referenceNode) {
1018
+ var isNextElementSibling = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1019
+ if (!referenceNode || !newNode) return;
1020
+ var swap = referenceNode;
1021
+ if (isNextElementSibling) {
1022
+ swap = referenceNode.nextElementSibling || null;
1023
+ }
1024
+ referenceNode.parentNode.insertBefore(newNode, swap);
1025
+ };
1026
+ var handleInput = function handleInput(e) {
1027
+ var maxData = props.maxData,
1028
+ trigger = props.trigger,
1029
+ allowCreate = props.allowCreate;
1030
+ if (maxData === -1 || maxData > tagList.value.length) {
1031
+ var _ref5 = e !== null && e !== void 0 && e.target ? e.target : curInputValue,
1032
+ value = _ref5.value;
1033
+ var charLen = getCharLength(value);
1034
+ if (charLen) {
1035
+ filterData(value);
1036
+ tagInputRef.value.style.width = "".concat(charLen * INPUT_MIN_WIDTH, "px");
1037
+ } else {
1038
+ if (trigger === 'focus') {
1039
+ filterData();
1040
+ }
1041
+ }
1042
+ } else {
1043
+ handleBlur();
1044
+ curInputValue.value = '';
1045
+ popoverProps.isShow = false;
1046
+ }
1047
+ state.isEdit = true;
1048
+ // 重置下拉菜单选中信息
1049
+ state.focusItemIndex = allowCreate ? -1 : 0;
1050
+ emit('input', curInputValue.value);
1051
+ };
1052
+ var handleFocus = function handleFocus() {
1053
+ var _bkTagSelectorRef$val;
1054
+ // this.dispatch('bk-form-item', 'form-focus')
1055
+ popoverProps.width = isSingleSelect.value ? (_bkTagSelectorRef$val = bkTagSelectorRef.value) === null || _bkTagSelectorRef$val === void 0 ? void 0 : _bkTagSelectorRef$val.clientWidth : props.contentWidth;
1056
+ emit('focus');
1057
+ // e.currentTarget.select();
1058
+ };
1059
+
1060
+ var handleBlur = function handleBlur() {
1061
+ timer.value = setTimeout(function () {
1062
+ var _formItem$validate2;
1063
+ var inputValue = curInputValue.value;
1064
+ clearInput();
1065
+ // 通知表单组件,可用于实时验证
1066
+ // this.dispatch('bk-form-item', 'form-blur')
1067
+ state.isEdit = false;
1068
+ if (isSingleSelect.value) {
1069
+ var _listState$tagListCac = _slicedToArray(listState.tagListCache, 1),
1070
+ oldValue = _listState$tagListCac[0];
1071
+ // 如果是单选,且input不为空,即保留了上次的结果则恢复
1072
+ if (inputValue && inputValue === oldValue && listState.selectedTagListCache.length) {
1073
+ addTag(listState.selectedTagListCache[0], 'select');
1074
+ } else {
1075
+ handleChange('remove');
1076
+ }
1077
+ } else if (props.allowAutoMatch && inputValue) {
1078
+ // 如果匹配,则自动选则
1079
+ var matchItem = pageState.curPageList.find(function (item) {
1080
+ if (Array.isArray(props.searchKey)) {
1081
+ var searchValue = props.searchKey.map(function (key) {
1082
+ return item[key];
1083
+ });
1084
+ return searchValue.includes(inputValue);
1085
+ }
1086
+ return item[props.searchKey] === inputValue;
1087
+ });
1088
+ if (matchItem) {
1089
+ handleTagSelected(matchItem, 'select');
1090
+ } else if (props.allowCreate) {
1091
+ // 支持自定义
1092
+ handleTagSelected(inputValue, 'custom');
1093
+ }
1094
+ }
1095
+ popoverProps.isShow = false;
1096
+ emit('blur', inputValue, tagList.value);
1097
+ formItem === null || formItem === void 0 || (_formItem$validate2 = formItem.validate) === null || _formItem$validate2 === void 0 ? void 0 : _formItem$validate2.call(formItem, 'blur');
1098
+ }, 200);
1099
+ };
1100
+ /**
1101
+ * tag selected handler
1102
+ * @param item tag data
1103
+ * @param type emit type
1104
+ */
1105
+ var handleTagSelected = function handleTagSelected(item, type, e) {
1106
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
1107
+ // 如果 item 不存在(备选项中没有包含输入的字母的情况即输入关键字没有备选项出现的情况)或者选中标签所在组是禁用状态,返回
1108
+ if (!item || item.disabled) {
1109
+ return;
1110
+ }
1111
+ // 如果是单选,清空上一次缓存结果
1112
+ if (isSingleSelect.value) {
1113
+ clearSingleCache();
1114
+ }
1115
+ addTag(item, type);
1116
+ handleChange('select');
1117
+ clearInput();
1118
+ popoverProps.isShow = false;
1119
+ };
1120
+ /**
1121
+ * remove selected tag
1122
+ * @param data tag data
1123
+ * @param index tag index
1124
+ * @param e mouse event
1125
+ */
1126
+ var handleTagRemove = function handleTagRemove(data, index, e) {
1127
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
1128
+ removeTag(data, index);
1129
+ clearInput();
1130
+ handleChange('remove', data);
1131
+ tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
1132
+ };
1133
+ /**
1134
+ * emit trigger
1135
+ * @param type emit type
1136
+ */
1137
+ var handleChange = function handleChange(type, data) {
1138
+ // this.dispatch('bk-form-item', 'form-change')
1139
+ emit(type, data);
1140
+ emit('update:modelValue', tagList.value);
1141
+ emit('change', tagList.value);
1142
+ };
1143
+ /**
1144
+ * clear all selected tags
1145
+ * @param e mouse event
1146
+ */
1147
+ var handleClear = function handleClear(e) {
1148
+ e.stopPropagation();
1149
+ var removeList = listState.selectedTagList;
1150
+ listState.selectedTagList = [];
1151
+ // 将删除的项加入加列表
1152
+ var existList = removeList.filter(function (item) {
1153
+ return saveKeyMap.value[item[props.saveKey]];
1154
+ });
1155
+ if ((props.allowCreate && existList.length !== 0 || !props.allowCreate) && !isSingleSelect.value) {
1156
+ var _listState$localList;
1157
+ (_listState$localList = listState.localList).push.apply(_listState$localList, _toConsumableArray(existList));
1158
+ }
1159
+ handleChange('removeAll');
1160
+ };
1161
+ var updateScrollTop = function updateScrollTop() {
1162
+ // 获取下拉列表容器的位置信息,用于判断上下键选中的元素是否在可视区域,若不在则需滚动至可视区域
1163
+ var panelInfo = {
1164
+ height: selectorListRef.value.clientHeight,
1165
+ yAxis: selectorListRef.value.getBoundingClientRect().y
1166
+ };
1167
+ (0,external_vue_namespaceObject.nextTick)(function () {
1168
+ var activeObj = selectorListRef.value.querySelector(".".concat(resolveClassName('selector-actived')));
1169
+ if (!activeObj) {
1170
+ return;
1171
+ }
1172
+ var activeInfo = {
1173
+ height: activeObj.clientHeight,
1174
+ yAxis: activeObj.getBoundingClientRect().y
1175
+ };
1176
+ // 选中元素顶部坐标大于容器顶部坐标时,则该元素有部分或者全部区域不在可视区域,执行滚动
1177
+ if (activeInfo.yAxis < panelInfo.yAxis) {
1178
+ selectorListRef.value.scrollTop = selectorListRef.value.scrollTop - (panelInfo.yAxis - activeInfo.yAxis);
1179
+ }
1180
+ var distanceToBottom = activeInfo.yAxis + activeInfo.height - panelInfo.yAxis;
1181
+ // 选中元素底部坐标大于容器顶部坐标,且超出容器的实际高度,则该元素有部分或者全部区域不在可视区域,执行滚动
1182
+ if (distanceToBottom > panelInfo.height) {
1183
+ selectorListRef.value.scrollTop = selectorListRef.value.scrollTop + distanceToBottom - panelInfo.height;
1184
+ }
1185
+ });
1186
+ };
1187
+ var backspaceHandler = function backspaceHandler(index, target) {
1188
+ // 先交换输入框与被删除节点位置,再进行删除
1189
+ var nodes = getSelectedTagNodes();
1190
+ swapElementPositions(tagInputItemRef.value, nodes[index - 1]);
1191
+ listState.selectedTagList.splice(index - 1, 1);
1192
+ focusInputTrigger();
1193
+ var isExistInit = saveKeyMap.value[target[props.saveKey]];
1194
+ // 将删除的项加入加列表
1195
+ if ((props.allowCreate && isExistInit || !props.allowCreate) && !isSingleSelect.value) {
1196
+ listState.localList.push(target);
1197
+ }
1198
+ tagInputRef.value = "".concat(INPUT_MIN_WIDTH, "px");
1199
+ handleChange('remove');
1200
+ };
1201
+ var handleKeydown = function handleKeydown(e) {
1202
+ if (pageState.isPageLoading) {
1203
+ return;
1204
+ }
1205
+ var target;
1206
+ var val = e.target.value;
1207
+ var valLen = getCharLength(val);
1208
+ var tagInputItemIndex = getTagInputItemSite();
1209
+ var nodes = getSelectedTagNodes();
1210
+ switch (e.code) {
1211
+ case 'ArrowUp':
1212
+ e.preventDefault();
1213
+ if (!popoverProps.isShow) {
1214
+ return;
1215
+ }
1216
+ state.focusItemIndex = state.focusItemIndex - 1;
1217
+ state.focusItemIndex = state.focusItemIndex < 0 ? -1 : state.focusItemIndex;
1218
+ if (state.focusItemIndex === -1) {
1219
+ state.focusItemIndex = pageState.curPageList.length - 1;
1220
+ }
1221
+ updateScrollTop();
1222
+ break;
1223
+ case 'ArrowDown':
1224
+ e.preventDefault();
1225
+ if (!popoverProps.isShow) {
1226
+ return;
1227
+ }
1228
+ state.focusItemIndex = state.focusItemIndex + 1;
1229
+ state.focusItemIndex = state.focusItemIndex > pageState.curPageList.length - 1 ? pageState.curPageList.length : state.focusItemIndex;
1230
+ if (state.focusItemIndex === pageState.curPageList.length) {
1231
+ state.focusItemIndex = 0;
1232
+ }
1233
+ updateScrollTop();
1234
+ break;
1235
+ case 'ArrowLeft':
1236
+ state.isEdit = true;
1237
+ if (!valLen) {
1238
+ // 输入框已经是第一个节点,无法左移
1239
+ if (tagInputItemIndex < 1) {
1240
+ return;
1241
+ }
1242
+ swapElementPositions(tagInputItemRef.value, nodes[tagInputItemIndex - 1]);
1243
+ focusInputTrigger();
1244
+ }
1245
+ break;
1246
+ case 'ArrowRight':
1247
+ state.isEdit = true;
1248
+ if (!valLen) {
1249
+ // 输入框已经是最后一个节点,无法右移
1250
+ if (tagInputItemIndex === nodes.length - 1) {
1251
+ return;
1252
+ }
1253
+ swapElementPositions(nodes[tagInputItemIndex + 1], tagInputItemRef.value);
1254
+ focusInputTrigger();
1255
+ }
1256
+ break;
1257
+ case 'Enter':
1258
+ case 'NumpadEnter':
1259
+ if (!props.allowCreate && popoverProps.isShow || props.allowCreate && state.focusItemIndex >= 0 && popoverProps.isShow) {
1260
+ handleTagSelected(pageState.curPageList[state.focusItemIndex], 'select', e);
1261
+ } else if (props.allowCreate && curInputValue.value.trim()) {
1262
+ handleTagSelected(curInputValue.value, 'custom', e);
1263
+ }
1264
+ // 如果是enter, 防止触发form submit
1265
+ e.preventDefault();
1266
+ break;
1267
+ case 'Backspace':
1268
+ if (tagInputItemIndex !== 0 && !curInputValue.value) {
1269
+ target = listState.selectedTagList[tagInputItemIndex - 1];
1270
+ backspaceHandler(tagInputItemIndex, target);
1271
+ }
1272
+ break;
1273
+ default:
1274
+ break;
1275
+ }
1276
+ };
1277
+ var defaultPasteFn = function defaultPasteFn(value) {
1278
+ var target = [];
1279
+ var textArr = value.split(';');
1280
+ var regx = /^[a-zA-Z][a-zA-Z_]*/g;
1281
+ textArr.forEach(function (item) {
1282
+ var matchValue = item.match(regx);
1283
+ if (matchValue) {
1284
+ var _target$push;
1285
+ var finalItem = matchValue.join('');
1286
+ target.push((_target$push = {}, _defineProperty(_target$push, props.saveKey, finalItem), _defineProperty(_target$push, props.displayKey, finalItem), _target$push));
1287
+ }
1288
+ });
1289
+ return target;
1290
+ };
1291
+ var handlePaste = function handlePaste(e) {
1292
+ e.preventDefault();
1293
+ // 单选禁止复制粘贴,防止粘贴多个tag
1294
+ if (isSingleSelect.value) {
1295
+ return false;
1296
+ }
1297
+ var maxData = props.maxData,
1298
+ saveKey = props.saveKey,
1299
+ displayKey = props.displayKey,
1300
+ pasteFn = props.pasteFn,
1301
+ allowCreate = props.allowCreate;
1302
+ var value = e.clipboardData.getData('text');
1303
+ var valArr = pasteFn ? pasteFn(value) : defaultPasteFn(value);
1304
+ var tags = valArr.map(function (value) {
1305
+ return value[saveKey];
1306
+ });
1307
+ if (tags.length) {
1308
+ var nodes = getSelectedTagNodes();
1309
+ var index = getTagInputItemSite();
1310
+ var localInitData = listState.localList.map(function (data) {
1311
+ return data[saveKey];
1312
+ });
1313
+ tags = tags.filter(function (tag) {
1314
+ var canSelected = (tag === null || tag === void 0 ? void 0 : tag.trim()) && !tagList.value.includes(tag);
1315
+ return allowCreate ? canSelected : canSelected && localInitData.includes(tag);
1316
+ });
1317
+ // 最大显示限制处理
1318
+ if (maxData !== -1) {
1319
+ var selectedLength = listState.selectedTagList.length;
1320
+ if (selectedLength < maxData) {
1321
+ var differ = maxData - selectedLength;
1322
+ if (tags.length > differ) {
1323
+ tags = _toConsumableArray(tags.slice(0, differ));
1324
+ }
1325
+ } else {
1326
+ tags = [];
1327
+ }
1328
+ }
1329
+ var localTags = allowCreate ? tags.map(function (tag) {
1330
+ var _ref6;
1331
+ var localTag = listState.localList.find(function (localTag) {
1332
+ return localTag[saveKey] === tag;
1333
+ });
1334
+ return localTag !== null && localTag !== void 0 ? localTag : (_ref6 = {}, _defineProperty(_ref6, saveKey, tag), _defineProperty(_ref6, displayKey, tag), _ref6);
1335
+ }) : listState.localList.filter(function (tag) {
1336
+ return tags.includes(tag[saveKey]);
1337
+ });
1338
+ if (tags.length) {
1339
+ var _listState$selectedTa;
1340
+ (_listState$selectedTa = listState.selectedTagList).splice.apply(_listState$selectedTa, [index, 0].concat(_toConsumableArray(localTags)));
1341
+ swapElementPositions(tagInputItemRef.value, nodes[index]);
1342
+ tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
1343
+ listState.localList = listState.localList.filter(function (val) {
1344
+ return !tags.includes(val[saveKey]);
1345
+ });
1346
+ handleChange('select');
1347
+ focusInputTrigger();
1348
+ }
1349
+ }
1350
+ };
1351
+ /**
1352
+ * 已选中标签点击
1353
+ * @param e mouse event
1354
+ */
1355
+ var tagFocus = function tagFocus(e) {
1356
+ if (props.disabled) {
1357
+ return;
1358
+ }
1359
+ swapElementPositions(tagInputItemRef.value, e.currentTarget, true);
1360
+ tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
1361
+ popoverProps.isShow && changePopoverOffset();
1362
+ };
1363
+ /**
1364
+ * add tag
1365
+ * @param item current tag data
1366
+ * @param type operation type
1367
+ */
1368
+ var addTag = function addTag(item, type) {
1369
+ // 不允许超过最大可选数量
1370
+ if (listState.selectedTagList.length >= props.maxData && props.maxData !== -1) return;
1371
+ var separator = props.separator,
1372
+ saveKey = props.saveKey,
1373
+ displayKey = props.displayKey,
1374
+ createTagValidator = props.createTagValidator;
1375
+ var targetIndex = getTagInputItemSite();
1376
+ var moveCount = 1;
1377
+ var isSelected = false;
1378
+ var newValue;
1379
+ var validateTag = function validateTag(value) {
1380
+ if (typeof createTagValidator === 'function') {
1381
+ return createTagValidator(value);
1382
+ }
1383
+ return true;
1384
+ };
1385
+ // 自定义
1386
+ if (type === 'custom') {
1387
+ // 自定义时,如果配置分隔符可以一次性输入多个值
1388
+ if (separator) {
1389
+ var tags = item.split(separator);
1390
+ tags = tags.filter(function (tag) {
1391
+ return (tag === null || tag === void 0 ? void 0 : tag.trim()) && !tagList.value.includes(tag) && validateTag(tag);
1392
+ });
1393
+ var localTags = tags.map(function (tag) {
1394
+ var _ref7;
1395
+ return saveKeyMap.value[tag] || (_ref7 = {}, _defineProperty(_ref7, saveKey, tag), _defineProperty(_ref7, displayKey, tag), _ref7);
1396
+ });
1397
+ if (tags.length) {
1398
+ var _listState$selectedTa2;
1399
+ (_listState$selectedTa2 = listState.selectedTagList).splice.apply(_listState$selectedTa2, [targetIndex, 0].concat(_toConsumableArray(localTags)));
1400
+ moveCount = localTags.length;
1401
+ isSelected = true;
1402
+ }
1403
+ } else {
1404
+ var isObject = _typeof(item) === 'object';
1405
+ newValue = isObject ? item[saveKey] : item.trim();
1406
+ newValue = newValue.replace(/\s+/g, '');
1407
+ if (newValue !== undefined && !tagList.value.includes(newValue) && validateTag(newValue)) {
1408
+ var _ref8;
1409
+ var localItem = saveKeyMap.value[newValue] || (isObject ? item : (_ref8 = {}, _defineProperty(_ref8, saveKey, newValue), _defineProperty(_ref8, displayKey, newValue), _ref8));
1410
+ listState.selectedTagList.splice(targetIndex, 0, localItem);
1411
+ isSelected = true;
1412
+ }
1413
+ }
1414
+ } else if (item) {
1415
+ newValue = item[saveKey];
1416
+ if (newValue !== undefined && !tagList.value.includes(newValue)) {
1417
+ listState.selectedTagList.splice(targetIndex, 0, item);
1418
+ isSelected = true;
1419
+ }
1420
+ }
1421
+ if (isSelected) {
1422
+ (0,external_vue_namespaceObject.nextTick)(function () {
1423
+ for (var count = 1; count <= moveCount; count++) {
1424
+ var nodes = getSelectedTagNodes();
1425
+ var site = nodes[targetIndex + count];
1426
+ swapElementPositions(site, tagInputItemRef.value);
1427
+ }
1428
+ tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
1429
+ // 非单选
1430
+ if (!isSingleSelect.value) {
1431
+ // focus继续让用户进行下一个输入
1432
+ props.allowNextFocus && focusInputTrigger();
1433
+ // 将已经选中的项从数据列表中去除
1434
+ var selectedMap = tagList.value.reduce(function (acc, tag) {
1435
+ acc[tag] = 1;
1436
+ return acc;
1437
+ }, {});
1438
+ listState.localList = listState.localList.filter(function (val) {
1439
+ return !selectedMap[val[saveKey]];
1440
+ });
1441
+ }
1442
+ });
1443
+ }
1444
+ };
1445
+ /**
1446
+ * remove current tag
1447
+ * @param data tag data
1448
+ * @param index tag index
1449
+ */
1450
+ var removeTag = function removeTag(data, index) {
1451
+ listState.selectedTagList.splice(index, 1);
1452
+ var isExistInit = saveKeyMap.value[data[props.saveKey]];
1453
+ // 将删除的项加入加列表
1454
+ if ((props.allowCreate && isExistInit || !props.allowCreate) && !isSingleSelect.value) {
1455
+ listState.localList.push(data);
1456
+ }
1457
+ };
1458
+ // 折叠 tags index
1459
+ var localCollapseTags = (0,external_vue_namespaceObject.computed)(function () {
1460
+ return props.collapseTags ? props.collapseTags && !state.isEdit : props.collapseTags;
1461
+ });
1462
+ var _useTagsOverflow = useTagsOverflow(bkTagSelectorRef, localCollapseTags, tagList),
1463
+ overflowTagIndex = _useTagsOverflow.overflowTagIndex;
1464
+ return tag_input_objectSpread(tag_input_objectSpread(tag_input_objectSpread(tag_input_objectSpread({
1465
+ popoverProps: popoverProps
1466
+ }, (0,external_vue_namespaceObject.toRefs)(state)), (0,external_vue_namespaceObject.toRefs)(listState)), (0,external_vue_namespaceObject.toRefs)(pageState)), {}, {
1467
+ isShowPlaceholder: isShowPlaceholder,
1468
+ isShowClear: isShowClear,
1469
+ placeholderText: placeholderText,
1470
+ curInputValue: curInputValue,
1471
+ renderList: renderList,
1472
+ showTagClose: showTagClose,
1473
+ tagInputRef: tagInputRef,
1474
+ bkTagSelectorRef: bkTagSelectorRef,
1475
+ tagListRef: tagListRef,
1476
+ tagInputItemRef: tagInputItemRef,
1477
+ selectorListRef: selectorListRef,
1478
+ triggerClass: triggerClass,
1479
+ overflowTagIndex: overflowTagIndex,
1480
+ localCollapseTags: localCollapseTags,
1481
+ focusInputTrigger: focusInputTrigger,
1482
+ activeClass: activeClass,
1483
+ handleInput: handleInput,
1484
+ handleFocus: handleFocus,
1485
+ handleBlur: handleBlur,
1486
+ handleTagSelected: handleTagSelected,
1487
+ handleTagRemove: handleTagRemove,
1488
+ handleClear: handleClear,
1489
+ tagFocus: tagFocus,
1490
+ handleKeydown: handleKeydown,
1491
+ handlePaste: handlePaste,
1492
+ resolveClassName: resolveClassName
1493
+ });
1494
+ },
1495
+ render: function render() {
1496
+ var _this = this;
1497
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1498
+ "class": "".concat(this.resolveClassName('tag-input')),
1499
+ "ref": "bkTagSelectorRef",
1500
+ "onClick": this.focusInputTrigger,
1501
+ "onMouseenter": function onMouseenter() {
1502
+ return _this.isHover = true;
1503
+ },
1504
+ "onMouseleave": function onMouseleave() {
1505
+ return _this.isHover = false;
1506
+ }
1507
+ }, [(0,external_vue_namespaceObject.createVNode)(external_popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
1508
+ "theme": "light ".concat(this.resolveClassName('tag-input-popover-content')),
1509
+ "trigger": "manual",
1510
+ "placement": "bottom-start",
1511
+ "arrow": false
1512
+ }, this.popoverProps), {
1513
+ "default": function _default() {
1514
+ var _this$$slots$suffix, _this$$slots, _this$$slots$suffix2;
1515
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1516
+ "class": _this.triggerClass
1517
+ }, [(0,external_vue_namespaceObject.createVNode)("ul", {
1518
+ "class": "tag-list",
1519
+ "ref": "tagListRef",
1520
+ "style": {
1521
+ marginLeft: "".concat(_this.leftSpace, "px")
1522
+ }
1523
+ }, [_this.selectedTagList.map(function (item, index) {
1524
+ var tooltips = {
1525
+ boundary: 'window',
1526
+ theme: 'light',
1527
+ distance: 12,
1528
+ content: item[_this.tooltipKey],
1529
+ disabled: !_this.tooltipKey
1530
+ };
1531
+ var isOverflow = _this.localCollapseTags && _this.overflowTagIndex && index >= _this.overflowTagIndex;
1532
+ return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("li", {
1533
+ "class": "tag-item",
1534
+ "style": {
1535
+ display: isOverflow ? 'none' : ''
1536
+ },
1537
+ "onClick": _this.tagFocus
1538
+ }, [(0,external_vue_namespaceObject.createVNode)(tag_render, {
1539
+ "node": item,
1540
+ "tpl": _this.tagTpl,
1541
+ "displayKey": _this.displayKey,
1542
+ "hasTips": !!_this.tooltipKey,
1543
+ "tagOverflowTips": _this.tagOverflowTips
1544
+ }, null), _this.showTagClose ? (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
1545
+ "class": "remove-tag",
1546
+ "onClick": _this.handleTagRemove.bind(_this, item, index)
1547
+ }, null) : null]), [[(0,external_vue_namespaceObject.resolveDirective)("bk-tooltips"), tooltips]]);
1548
+ }), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("li", {
1549
+ "ref": "tagInputItemRef",
1550
+ "id": "tagInputItem",
1551
+ "class": "tag-input-item",
1552
+ "role": "input"
1553
+ }, [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("input", {
1554
+ "type": "text",
1555
+ "class": "tag-input",
1556
+ "ref": "tagInputRef",
1557
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
1558
+ return _this.curInputValue = $event;
1559
+ },
1560
+ "onInput": _this.handleInput,
1561
+ "onFocus": _this.handleFocus,
1562
+ "onBlur": _this.handleBlur,
1563
+ "onKeydown": _this.handleKeydown,
1564
+ "onPaste": _this.handlePaste
1565
+ }, null), [[external_vue_namespaceObject.vModelText, _this.curInputValue]])]), [[external_vue_namespaceObject.vShow, _this.isEdit]]), !!_this.overflowTagIndex && _this.localCollapseTags && (0,external_vue_namespaceObject.createVNode)("li", {
1566
+ "class": "tag-item"
1567
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
1568
+ "class": "tag"
1569
+ }, [(0,external_vue_namespaceObject.createVNode)("span", {
1570
+ "class": "text"
1571
+ }, [(0,external_vue_namespaceObject.createTextVNode)("+"), _this.selectedTagList.length - _this.overflowTagIndex])])])]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("p", {
1572
+ "class": "placeholder"
1573
+ }, [_this.placeholderText]), [[external_vue_namespaceObject.vShow, _this.isShowPlaceholder]]), (_this$$slots$suffix = (_this$$slots = _this.$slots) === null || _this$$slots === void 0 || (_this$$slots$suffix2 = _this$$slots.suffix) === null || _this$$slots$suffix2 === void 0 ? void 0 : _this$$slots$suffix2.call(_this$$slots)) !== null && _this$$slots$suffix !== void 0 ? _this$$slots$suffix : _this.isShowClear && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, {
1574
+ "class": "clear-icon",
1575
+ "onClick": _this.handleClear
1576
+ }, null)]);
1577
+ },
1578
+ content: function content() {
1579
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1580
+ "class": "".concat(_this.resolveClassName('selector-list'))
1581
+ }, [(0,external_vue_namespaceObject.createVNode)("ul", {
1582
+ "ref": "selectorListRef",
1583
+ "style": {
1584
+ 'max-height': "".concat(_this.contentMaxHeight, "px")
1585
+ },
1586
+ "class": "outside-ul"
1587
+ }, [_this.renderList.map(function (group, index) {
1588
+ return _this.useGroup ? (0,external_vue_namespaceObject.createVNode)("li", {
1589
+ "class": "".concat(_this.resolveClassName('selector-group-item'))
1590
+ }, [(0,external_vue_namespaceObject.createVNode)("span", {
1591
+ "class": "group-name"
1592
+ }, [group.name, (0,external_vue_namespaceObject.createTextVNode)(" ("), group.children.length, (0,external_vue_namespaceObject.createTextVNode)(")")]), (0,external_vue_namespaceObject.createVNode)("ul", {
1593
+ "class": "".concat(_this.resolveClassName('selector-group-list-item'))
1594
+ }, [group.children.map(function (item, index) {
1595
+ return (0,external_vue_namespaceObject.createVNode)("li", {
1596
+ "class": ["".concat(_this.resolveClassName('selector-list-item')), {
1597
+ disabled: item.disabled
1598
+ }, _this.activeClass(item, index)],
1599
+ "onClick": _this.handleTagSelected.bind(_this, item, 'select')
1600
+ }, [(0,external_vue_namespaceObject.createVNode)(list_tag_render, {
1601
+ "node": item,
1602
+ "displayKey": _this.displayKey,
1603
+ "tpl": _this.tpl,
1604
+ "searchKey": _this.searchKey,
1605
+ "searchKeyword": _this.curInputValue
1606
+ }, null)]);
1607
+ })])]) : (0,external_vue_namespaceObject.createVNode)("li", {
1608
+ "class": ["".concat(_this.resolveClassName('selector-list-item')), {
1609
+ disabled: group.disabled
1610
+ }, _this.activeClass(group, index)],
1611
+ "onClick": _this.handleTagSelected.bind(_this, group, 'select')
1612
+ }, [(0,external_vue_namespaceObject.createVNode)(list_tag_render, {
1613
+ "node": group,
1614
+ "displayKey": _this.displayKey,
1615
+ "tpl": _this.tpl,
1616
+ "searchKey": _this.searchKey,
1617
+ "searchKeyword": _this.curInputValue
1618
+ }, null)]);
1619
+ }), _this.isPageLoading ? (0,external_vue_namespaceObject.createVNode)("li", {
1620
+ "class": "".concat(_this.resolveClassName('selector-list-item'), " loading")
1621
+ }, [(0,external_vue_namespaceObject.createVNode)(external_loading_namespaceObject["default"], {
1622
+ "theme": "primary",
1623
+ "size": external_loading_namespaceObject.BkLoadingSize.Small
1624
+ }, null)]) : null])]);
1625
+ }
1626
+ })]);
1627
+ }
1628
+ }));
1629
+ ;// CONCATENATED MODULE: ../../packages/tag-input/src/index.ts
1630
+ /*
1631
+ * Tencent is pleased to support the open source community by making
1632
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1633
+ *
1634
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1635
+ *
1636
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1637
+ *
1638
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1639
+ *
1640
+ * ---------------------------------------------------
1641
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1642
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1643
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1644
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1645
+ *
1646
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1647
+ * the Software.
1648
+ *
1649
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1650
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1651
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1652
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1653
+ * IN THE SOFTWARE.
1654
+ */
1655
+
1656
+
1657
+ var TagInput = (0,external_shared_namespaceObject.withInstall)(tag_input);
1658
+ /* harmony default export */ const src = (TagInput);
1659
+ var __webpack_exports__default = __webpack_exports__.Z;
1660
+ export { __webpack_exports__default as default };