bkui-vue 0.0.1-beta.84 → 0.0.1-beta.85
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.
- package/dist/index.cjs.js +27 -27
- package/dist/index.esm.js +327 -413
- package/dist/index.umd.js +29 -29
- package/dist/style.css +1 -1
- package/lib/alert/alert.css +3 -3
- package/lib/alert/alert.less +5 -3
- package/lib/alert/alert.variable.css +3 -3
- package/lib/alert/index.js +1 -1
- package/lib/badge/badge.d.ts +1 -1
- package/lib/badge/index.d.ts +4 -4
- package/lib/button/button.d.ts +1 -1
- package/lib/button/index.d.ts +4 -4
- package/lib/cascader/cascader.d.ts +2 -2
- package/lib/cascader/index.d.ts +7 -7
- package/lib/checkbox/index.js +1 -1
- package/lib/date-picker/date-picker.d.ts +1 -1
- package/lib/date-picker/index.d.ts +4 -4
- package/lib/date-picker/index.js +1 -1
- package/lib/dialog/dialog.d.ts +1 -1
- package/lib/dialog/index.d.ts +4 -4
- package/lib/dropdown/dropdown.d.ts +2 -2
- package/lib/dropdown/index.d.ts +7 -7
- package/lib/form/form-item.d.ts +3 -3
- package/lib/form/form.d.ts +23 -9
- package/lib/form/index.d.ts +44 -21
- package/lib/form/index.js +1 -1
- package/lib/form/type.d.ts +5 -4
- package/lib/form/validator.d.ts +1 -0
- package/lib/input/index.d.ts +20 -20
- package/lib/input/index.js +1 -1
- package/lib/input/input.d.ts +6 -6
- package/lib/link/index.d.ts +7 -7
- package/lib/link/link.d.ts +2 -2
- package/lib/message/messageConstructor.d.ts +1 -1
- package/lib/notify/notifyConstructor.d.ts +2 -2
- package/lib/pagination/index.d.ts +4 -4
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +1 -1
- package/lib/popover/index.d.ts +13 -13
- package/lib/popover/popover.d.ts +4 -4
- package/lib/progress/index.d.ts +4 -4
- package/lib/progress/progress.d.ts +1 -1
- package/lib/radio/index.js +1 -1
- package/lib/rate/index.js +1 -1
- package/lib/resize-layout/index.d.ts +7 -7
- package/lib/resize-layout/resize-layout.d.ts +2 -2
- package/lib/select/index.d.ts +34 -87
- package/lib/select/index.js +1 -1
- package/lib/select/option.d.ts +2 -7
- package/lib/select/optionGroup.d.ts +1 -1
- package/lib/select/select.d.ts +6 -14
- package/lib/shared/index.d.ts +2 -0
- package/lib/shared/index.js +1 -1
- package/lib/shared/token.d.ts +4 -2
- package/lib/switcher/index.d.ts +4 -4
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.d.ts +1 -1
- package/lib/tab/index.d.ts +5 -5
- package/lib/tab/tab-panel.d.ts +1 -1
- package/lib/tab/tab.d.ts +1 -1
- package/lib/table/const.d.ts +3 -1
- package/lib/table/index.d.ts +68 -2
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +24 -0
- package/lib/table/table.d.ts +30 -0
- package/lib/table/utils.d.ts +7 -0
- package/lib/tag-input/index.d.ts +11 -11
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.d.ts +3 -3
- package/lib/transfer/const.d.ts +5 -0
- package/lib/transfer/index.d.ts +164 -150
- package/lib/transfer/index.js +1 -1
- package/lib/transfer/props.d.ts +54 -0
- package/lib/transfer/transfer.css +6 -6
- package/lib/transfer/transfer.d.ts +70 -95
- package/lib/transfer/transfer.less +4 -4
- package/lib/transfer/transfer.variable.css +6 -6
- package/lib/tree/index.js +1 -1
- package/lib/upload/upload-list.d.ts +1 -1
- package/lib/upload/upload-trigger.d.ts +1 -1
- package/lib/upload/upload.d.ts +1 -1
- package/lib/virtual-render/index.js +1 -1
- package/package.json +1 -1
- package/lib/form/common.d.ts +0 -3
- package/lib/styles/mixins/clearfix.css +0 -8
- package/lib/use-form.d.ts +0 -3
package/lib/tag-input/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("lodash"),require("../directives"),require("../icon"),require("../loading"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","lodash","../directives","../icon","../loading","../popover"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("lodash"),require("../directives"),require("../icon"),require("../loading"),require("../popover")):t(e["../shared"],e.vue,e.lodash,e["../directives"],e["../icon"],e["../loading"],e["../popover"]);for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(self,((e,t,r,a,n,o,l)=>(()=>{"use strict";var i={4061:e=>{e.exports=a},6870:e=>{e.exports=n},4870:e=>{e.exports=o},5537:e=>{e.exports=l},4212:t=>{t.exports=e},467:e=>{e.exports=r},748:e=>{e.exports=t}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return i[e](r,r.exports,u),r.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{u.r(c),u.d(c,{default:()=>L});var e=u(4212);function t(e){return t="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},t(e)}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function a(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(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.")}()}var l=u(748),i=u(467),s=u(4061),d=u(6870),p=u(4870),f=u.n(p),v=u(5537),g=u.n(v),h=12,y=function(e){for(var t=e.length,r=0,a=0;a<t;a++)0!=(65280&e.charCodeAt(a))&&(r+=1),r+=1;return r};const m=(0,l.defineComponent)({name:"ListTagRender",props:{node:e.PropTypes.object,searchKey:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.arrayOf(e.PropTypes.string)]),displayKey:e.PropTypes.string,searchKeyword:e.PropTypes.string,tpl:{type:Function,default:null}},render:function(){var e=this,t=function(t){if(e.searchKeyword){var r=new RegExp("(".concat(e.searchKeyword,")"),"i");return t.replace(r,'<strong class="highlight-text">$1</strong>')}return t};if(this.tpl)return this.tpl(this.node,t,l.h,this);var r=this.node[this.displayKey];return(0,l.createVNode)("div",{class:"bk-selector-node"},[(0,l.createVNode)("span",{class:"text",innerHTML:t(r)},[r])])}}),b=(0,l.defineComponent)({name:"TagRender",props:{node:e.PropTypes.object,displayKey:e.PropTypes.string,tpl:{type:Function,default:null}},render:function(){return this.tpl?this.tpl(this.node,l.h,this):(0,l.createVNode)("div",{class:"tag"},[(0,l.createVNode)("span",{class:"text"},[this.node[this.displayKey]])])}}),T=(0,l.defineComponent)({name:"TagInput",directives:{bkTooltips:s.bkTooltips},props:{modelValue:e.PropTypes.arrayOf(e.PropTypes.string).def([]),placeholder:e.PropTypes.string.def("请输入并按 Enter 结束"),list:e.PropTypes.arrayOf(e.PropTypes.object).def([]),disabled:e.PropTypes.bool.def(!1),tooltipKey:e.PropTypes.string.def(""),saveKey:e.PropTypes.string.def("id"),displayKey:e.PropTypes.string.def("name"),hasDeleteIcon:e.PropTypes.bool.def(!1),clearable:e.PropTypes.bool.def(!0),trigger:e.PropTypes.commonType(["focus","search"]).def("search"),searchKey:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.arrayOf(e.PropTypes.string)]).def("name"),useGroup:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),maxData:e.PropTypes.number.def(-1),maxResult:e.PropTypes.number.def(10),contentMaxHeight:e.PropTypes.number.def(300),contentWidth:e.PropTypes.number.def(190),separator:e.PropTypes.string.def(""),allowNextFocus:e.PropTypes.bool.def(!0),allowAutoMatch:e.PropTypes.bool.def(!1),showClearOnlyHover:e.PropTypes.bool.def(!1),leftSpace:e.PropTypes.number.def(0),createTagValidator:{type:Function,default:null},filterCallback:{type:Function,default:null},tagTpl:{type:Function,default:null},tpl:{type:Function,default:null},pasteFn:{type:Function,default:null}},emits:["update:modelValue","change","select","blur","remove","removeAll"],setup:function(e,r){var s=r.emit,u=(0,l.reactive)({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),c=(0,l.reactive)({isShow:!1,width:190,modifiers:[{name:"offset",options:{offset:[0,4]}}]}),d=function(e){var t=(0,l.reactive)({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:function(){var e,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.curPage=1,t.totalSize=a.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;var n=[];if(t.pageSize>0)for(var l=0;l<t.totalSize;l+=t.pageSize)n.push(a.slice(l,l+t.pageSize));(e=t.renderListPaged).splice.apply(e,[0,t.renderListPaged.length].concat(n)),(r=t.curPageList).splice.apply(r,[0,t.curPageList.length].concat(o(t.renderListPaged[t.curPage-1]||[])))},pageChange:function(e){var r;t.curPage=e,(r=t.curPageList).splice.apply(r,[t.curPageList.length,0].concat(o(t.renderListPaged[t.curPage-1]||[]))),t.isPageLoading=!1}}}((0,l.toRefs)(e).maxResult),p=d.pageState,f=d.initPage,v=d.pageChange,g=(0,l.ref)(""),m=(0,l.ref)(null),b=(0,l.ref)(null),T=(0,l.ref)(null),L=(0,l.ref)(null),w=(0,l.ref)(null),P=(0,l.ref)(null),x=(0,l.ref)(null),I=(0,l.computed)((function(){return!e.disabled&&e.hasDeleteIcon})),S=(0,l.computed)((function(){return 1===e.maxData})),C=(0,l.computed)((function(){return 0===R.selectedTagList.length&&""===g.value&&!u.isEdit})),K=(0,l.computed)((function(){return e.clearable&&!e.disabled&&0!==R.selectedTagList.length&&(!e.showClearOnlyHover||u.isHover)})),V=(0,l.computed)((function(){return{"bk-tag-input-trigger":!0,active:u.isEdit,disabled:e.disabled}}));(0,l.watch)([function(){return o(e.modelValue)},function(){return o(e.list)}],(function(){F()})),(0,l.watch)(g,(0,i.debounce)((function(){var t=0!==p.curPageList.length,r=g.value;""!==r&&t||""===r&&"focus"===e.trigger&&t?c.isShow=!0:"focus"===e.trigger&&t||(c.isShow=!1)}),150)),(0,l.watch)((function(){return c.isShow}),(function(e){k(),e&&w.value&&((0,l.nextTick)((function(){w.value.scrollTop=0})),w.value.removeEventListener("scroll",N),w.value.addEventListener("scroll",N))}));var k=function(){var e,t,r=S.value?0:null===(e=L.value)||void 0===e?void 0:e.offsetLeft;c.modifiers=[{name:"offset",options:{offset:[r,4]}}],null===(t=P.value)||void 0===t||t.update()},N=function(){if(!p.isPageLoading&&0!==w.value.scrollTop){var e=w.value;if(e.scrollTop+e.offsetHeight>=e.scrollHeight){var t=p.curPage+1;t<=p.totalPage&&(p.isPageLoading=!0,setTimeout((function(){v(t)}),500))}}},A=function(){var e;return Array.from((null===(e=T.value)||void 0===e?void 0:e.childNodes)||[]).filter((function(e){return e.nodeType!==Node.TEXT_NODE}))},O=function(t){if(!e.disabled){if(null==t?void 0:t.target){var r=t.target.className;(r.indexOf("bk-tag-input-trigger")>-1||r.indexOf("tag-list")>-1)&&T.value.appendChild(L.value)}clearTimeout(x.value),S.value&&j.value.length&&(R.tagListCache=o(j.value),R.selectedTagListCache=o(R.selectedTagList),g.value=R.selectedTagListCache[0][e.saveKey],$(R.selectedTagList[0],0),H()),u.isEdit=!0,(0,l.nextTick)((function(){var t;null===(t=m.value)||void 0===t||t.focus(),"focus"===e.trigger&&0!==R.localList.length&&(q(),c.isShow?k():c.isShow=!0)}))}},R=(0,l.reactive)({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),j=(0,l.computed)((function(){return R.selectedTagList.map((function(t){return t[e.saveKey]}))})),E=function(e){var t=(0,l.toRefs)(e),r=t.useGroup,a=t.saveKey,n=t.displayKey,i=t.list,s=(0,l.reactive)([]);return(0,l.watch)([r,a,n,i],(function(){var e=i.value;r.value&&(e=i.value.reduce((function(e,t){var r=[];return t.children&&(r=t.children.map((function(e){return Object.assign({group:{groupId:t[a.value],groupName:t[n.value]}},e)}))),e.concat(r)}),[])),s.splice.apply(s,[0,s.length].concat(o(e)))}),{immediate:!0,deep:!0}),s}(e),D=(0,l.computed)((function(){if(e.useGroup){var t={};return p.curPageList.forEach((function(e,r){e.__index__=r,t[e.group.groupId]||(t[e.group.groupId]={id:e.group.groupId,name:e.group.groupName,children:[]}),t[e.group.groupId].children.push(e)})),Object.keys(t).map((function(e){return t[e]}))}return p.curPageList})),F=function(){var t=e.saveKey,r=e.modelValue,a=e.displayKey,l=e.allowCreate,i=e.trigger;R.selectedTagList=[],R.localList=o(E),r.length&&(r.forEach((function(e){var r=R.localList.find((function(r){return e===r[t]}));if(void 0!==r)R.selectedTagList.push(r);else if(l&&!j.value.includes(e)){var o;R.selectedTagList.push((n(o={},t,e),n(o,a,e),o))}})),S.value||(R.localList=R.localList.filter((function(e){return!r.includes(e[t])})))),"focus"===i&&q()},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=e.searchKey,a=e.filterCallback,n=t.toLowerCase(),o=[];if("function"==typeof a)o=a(n,r,R.localList)||[];else if(Array.isArray(r)){var l=r.map((function(e){return R.localList.filter((function(t){return-1!==t[e].toLowerCase().indexOf(n)}))}));o=Array.from(new Set(l.flat()))}else o=R.localList.filter((function(e){return-1!==e[r].toLowerCase().indexOf(n)}));f(o)};(0,l.onMounted)((function(){F()}));var z=function(){g.value=""},_=function(){if(S.value)return 0;var e=A().findIndex((function(e){return"tagInputItem"===e.id}));return e>=0?e:0},M=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t&&e){var a=t;r&&(a=t.nextElementSibling||null),t.parentNode.insertBefore(e,a)}},H=function(t){var r=e.maxData,a=e.trigger,n=e.allowCreate;if(-1===r||r>j.value.length){var o=((null==t?void 0:t.target)?t.target:g).value,l=y(o);l?(q(o),m.value.style.width="".concat(l*h,"px")):"focus"===a&&q()}else B(),g.value="",c.isShow=!1;u.isEdit=!0,u.focusItemIndex=n?-1:0},B=function(){x.value=setTimeout((function(){var t,r,n=g.value;if(z(),u.isEdit=!1,S.value){var o=(t=R.tagListCache,r=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,o=[],l=!0,i=!1;try{for(r=r.call(e);!(l=(a=r.next()).done)&&(o.push(a.value),!t||o.length!==t);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t,r)||a(t,r)||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];n&&n===o&&R.selectedTagListCache.length?W(R.selectedTagListCache[0],"select"):Z("remove")}else if(e.allowAutoMatch&&n){var l=p.curPageList.find((function(t){return Array.isArray(e.searchKey)?e.searchKey.map((function(e){return t[e]})).includes(n):t[e.searchKey]===n}));l?G(l,"select"):e.allowCreate&&G(n,"custom")}c.isShow=!1,s("blur",n,j.value)}),50)},G=function(e,t,r){null==r||r.stopPropagation(),e&&!e.disabled&&(S.value&&(R.tagListCache=[],R.selectedTagListCache=[],R.selectedTagList=[]),W(e,t),Z("select"),z(),c.isShow=!1)},Z=function(e,t){s("change",j.value),s(e,t),s("update:modelValue",j.value)},U=function(){var e=w.value.clientHeight,t=w.value.getBoundingClientRect().y;(0,l.nextTick)((function(){var r=w.value.querySelector(".bk-selector-actived");if(r){var a=r.clientHeight,n=r.getBoundingClientRect().y;n<t&&(w.value.scrollTop=w.value.scrollTop-(t-n));var o=n+a-t;o>e&&(w.value.scrollTop=w.value.scrollTop+o-e)}}))},W=function(r,a){if(!(R.selectedTagList.length>=e.maxData&&-1!==e.maxData)){var i,s=e.separator,u=e.saveKey,c=e.displayKey,d=e.createTagValidator,p=_(),f=1,v=!1,g=function(e){return"function"!=typeof d||d(e)},y=function(e){return R.localList.find((function(t){return t[u]===e}))};if("custom"===a)if(s){var b,T=r.split(s),w=(T=T.filter((function(e){return(null==e?void 0:e.trim())&&!j.value.includes(e)&&g(e)}))).map((function(e){var t;return y(e)||(n(t={},u,e),n(t,c,e),t)}));T.length&&((b=R.selectedTagList).splice.apply(b,[p,0].concat(o(w))),f=w.length,v=!0)}else{var P="object"===t(r);if(void 0!==(i=(i=P?r[u]:r.trim()).replace(/\s+/g,""))&&!j.value.includes(i)&&g(i)){var x,I=y(i)||(P?r:(n(x={},u,i),n(x,c,i),x));R.selectedTagList.splice(p,0,I),v=!0}}else r&&(void 0===(i=r[u])||j.value.includes(i)||(R.selectedTagList.splice(p,0,r),v=!0));v&&(0,l.nextTick)((function(){for(var t=1;t<=f;t++){var r=A()[p+t];M(r,L.value)}m.value.style.width="".concat(h,"px"),S.value||(e.allowNextFocus&&O(),R.localList=R.localList.filter((function(e){return!j.value.includes(e[u])})))}))}},$=function(t,r){R.selectedTagList.splice(r,1);var a=E.some((function(r){return r===t[e.saveKey]}));(e.allowCreate&&a||!e.allowCreate)&&!S.value&&R.localList.push(t)};return Object.assign(Object.assign(Object.assign(Object.assign({popoverProps:c},(0,l.toRefs)(u)),(0,l.toRefs)(R)),(0,l.toRefs)(p)),{isShowPlaceholder:C,isShowClear:K,curInputValue:g,formatList:E,renderList:D,showTagClose:I,tagInputRef:m,bkTagSelectorRef:b,tagListRef:T,tagInputItemRef:L,selectorListRef:w,popoverRef:P,triggerClass:V,focusInputTrigger:O,activeClass:function(t,r){var a={"bk-selector-actived":!1,"bk-selector-selected":j.value.includes(t[e.saveKey])};return e.useGroup?a["bk-selector-actived"]=t.__index__===u.focusItemIndex:a["bk-selector-actived"]=r===u.focusItemIndex,a},handleInput:H,handleFocus:function(){var t;c.width=S.value?null===(t=b.value)||void 0===t?void 0:t.clientWidth:e.contentWidth},handleBlur:B,handleTagSelected:G,handleTagRemove:function(e,t,r){null==r||r.stopPropagation(),$(e,t),z(),Z("remove",e),m.value.style.width="".concat(h,"px")},handleClear:function(t){t.stopPropagation();var r=R.selectedTagList;R.selectedTagList=[];var a,n=E.filter((function(t){return r.some((function(r){return r[e.saveKey]===t[e.saveKey]}))}));(!e.allowCreate||0===n.length)&&e.allowCreate||S.value||(a=R.localList).push.apply(a,o(n)),Z("removeAll")},tagFocus:function(t){e.disabled||(M(L.value,t.currentTarget,!0),m.value.style.width="".concat(h,"px"),c.isShow&&k())},handleKeydown:function(t){if(!p.isPageLoading){var r=t.target.value,a=y(r),n=_(),o=A();switch(t.code){case"ArrowUp":if(t.preventDefault(),!c.isShow)return;u.focusItemIndex=u.focusItemIndex-1,u.focusItemIndex=u.focusItemIndex<0?-1:u.focusItemIndex,-1===u.focusItemIndex&&(u.focusItemIndex=p.curPageList.length-1),U();break;case"ArrowDown":if(t.preventDefault(),!c.isShow)return;u.focusItemIndex=u.focusItemIndex+1,u.focusItemIndex=u.focusItemIndex>p.curPageList.length-1?p.curPageList.length:u.focusItemIndex,u.focusItemIndex===p.curPageList.length&&(u.focusItemIndex=0),U();break;case"ArrowLeft":if(u.isEdit=!0,!a){if(n<1)return;M(L.value,o[n-1]),O()}break;case"ArrowRight":if(u.isEdit=!0,!a){if(n===o.length-1)return;M(o[n+1],L.value),O()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&c.isShow||e.allowCreate&&u.focusItemIndex>=0&&c.isShow?G(p.curPageList[u.focusItemIndex],"select",t):e.allowCreate&&G(g.value,"custom",t),t.preventDefault();break;case"Backspace":0===n||g.value||function(t,r){var a=A();M(L.value,a[t-1]),R.selectedTagList.splice(t-1,1),O();var n=E.some((function(t){return t===r[e.saveKey]}));(e.allowCreate&&n||!e.allowCreate)&&!S.value&&R.localList.push(r),m.value="".concat(h,"px"),Z("remove")}(n,R.selectedTagList[n-1])}}},handlePaste:function(t){if(t.preventDefault(),S.value)return!1;var r=e.maxData,a=e.saveKey,l=e.pasteFn,i=t.clipboardData.getData("text"),s=l?l(i):function(t){var r=[];return t.split(";").forEach((function(t){if(t.match(/^[a-zA-Z][a-zA-Z_]+/g)){var a,o=t.match(/^[a-zA-Z][a-zA-Z_]+/g).join("");r.push((n(a={},e.saveKey,o),n(a,e.displayKey,o),a))}})),r}(i),u=s.map((function(e){return e[a]}));if(u.length){var c=A(),d=_(),p=R.localList.map((function(e){return e[a]}));if(u=u.filter((function(e){return(null==e?void 0:e.trim())&&!j.value.includes(e)&&p.includes(e)})),-1!==r){var f=R.selectedTagList.length;if(f<r){var v=r-f;u.length>v&&(u=o(u.slice(0,v)))}else u=[]}var g,y=R.localList.filter((function(e){return u.includes(e[a])}));u.length&&((g=R.selectedTagList).splice.apply(g,[d,0].concat(o(y))),M(L.value,c[d]),m.value.style.width="".concat(h,"px"),R.localList=R.localList.filter((function(e){return!u.includes(e[a])})),Z("select"),O())}}})},render:function(){var e=this;return(0,l.createVNode)("div",{class:"bk-tag-input",ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:function(){return e.isHover=!0},onMouseleave:function(){return e.isHover=!1}},[(0,l.createVNode)(g(),{ref:"popoverRef",theme:"light",trigger:"manual",placement:"bottom-start",arrow:!1,width:this.popoverProps.width,isShow:this.popoverProps.isShow,modifiers:this.popoverProps.modifiers},{default:function(){var t,r,a;return(0,l.createVNode)("div",{class:e.triggerClass},[(0,l.createVNode)("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:"".concat(e.leftSpace,"px")}},[e.selectedTagList.map((function(t,r){var a={boundary:"window",theme:"light",distance:12,content:t[e.tooltipKey],disabled:!e.tooltipKey};return(0,l.withDirectives)((0,l.createVNode)("li",{class:"tag-item",onClick:e.tagFocus},[(0,l.createVNode)(b,{node:t,tpl:e.tagTpl,displayKey:e.displayKey},null),e.showTagClose?(0,l.createVNode)(d.Error,{class:"remove-tag",onClick:e.handleTagRemove.bind(e,t,r)},null):null]),[[(0,l.resolveDirective)("bk-tooltips"),a]])})),(0,l.withDirectives)((0,l.createVNode)("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[(0,l.withDirectives)((0,l.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),[[l.vModelText,e.curInputValue]])]),[[l.vShow,e.isEdit]])]),(0,l.withDirectives)((0,l.createVNode)("p",{class:"placeholder"},[e.placeholder]),[[l.vShow,e.isShowPlaceholder]]),null!==(a=null===(r=null===(t=e.$slots)||void 0===t?void 0:t.suffix)||void 0===r?void 0:r.call(t))&&void 0!==a?a:e.isShowClear&&(0,l.createVNode)(d.Close,{class:"clear-icon",onClick:e.handleClear},null)])},content:function(){return(0,l.createVNode)("div",{class:"bk-selector-list"},[(0,l.createVNode)("ul",{ref:"selectorListRef",style:{"max-height":"".concat(e.contentMaxHeight,"px")},class:"outside-ul"},[e.useGroup?e.renderList.map((function(t){return(0,l.createVNode)("li",{class:"bk-selector-group-item"},[(0,l.createVNode)("span",{class:"group-name"},[t.name,(0,l.createTextVNode)(" ("),t.children.length,(0,l.createTextVNode)(")")]),(0,l.createVNode)("ul",{class:"bk-selector-group-list-item"},[t.children.map((function(t,r){return(0,l.createVNode)("li",{class:["bk-selector-list-item",{disabled:t.disabled},e.activeClass(t,r)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,l.createVNode)(m,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])}))])])})):e.renderList.map((function(t,r){return(0,l.createVNode)("li",{class:["bk-selector-list-item",{disabled:t.disabled},e.activeClass(t,r)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,l.createVNode)(m,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])})),e.isPageLoading?(0,l.createVNode)("li",{class:"bk-selector-list-item loading"},[(0,l.createVNode)(f(),{theme:"primary",size:p.BkLoadingSize.Small},null)]):null])])}})])}}),L=(0,e.withInstall)(T)})(),c})()));
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("lodash"),require("../directives"),require("../icon"),require("../loading"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","lodash","../directives","../icon","../loading","../popover"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("lodash"),require("../directives"),require("../icon"),require("../loading"),require("../popover")):t(e["../shared"],e.vue,e.lodash,e["../directives"],e["../icon"],e["../loading"],e["../popover"]);for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(self,((e,t,r,a,n,o,l)=>(()=>{"use strict";var i={4061:e=>{e.exports=a},6870:e=>{e.exports=n},4870:e=>{e.exports=o},5537:e=>{e.exports=l},4212:t=>{t.exports=e},467:e=>{e.exports=r},748:e=>{e.exports=t}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return i[e](r,r.exports,u),r.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{u.r(c),u.d(c,{default:()=>L});var e=u(4212);function t(e){return t="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},t(e)}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function a(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(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.")}()}var l=u(748),i=u(467),s=u(4061),d=u(6870),p=u(4870),f=u.n(p),v=u(5537),g=u.n(v),h=12,y=function(e){for(var t=e.length,r=0,a=0;a<t;a++)0!=(65280&e.charCodeAt(a))&&(r+=1),r+=1;return r};const m=(0,l.defineComponent)({name:"ListTagRender",props:{node:e.PropTypes.object,searchKey:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.arrayOf(e.PropTypes.string)]),displayKey:e.PropTypes.string,searchKeyword:e.PropTypes.string,tpl:{type:Function,default:null}},render:function(){var e=this,t=function(t){if(e.searchKeyword){var r=new RegExp("(".concat(e.searchKeyword,")"),"i");return t.replace(r,'<strong class="highlight-text">$1</strong>')}return t};if(this.tpl)return this.tpl(this.node,t,l.h,this);var r=this.node[this.displayKey];return(0,l.createVNode)("div",{class:"bk-selector-node"},[(0,l.createVNode)("span",{class:"text",innerHTML:t(r)},[r])])}}),b=(0,l.defineComponent)({name:"TagRender",props:{node:e.PropTypes.object,displayKey:e.PropTypes.string,tpl:{type:Function,default:null}},render:function(){return this.tpl?this.tpl(this.node,l.h,this):(0,l.createVNode)("div",{class:"tag"},[(0,l.createVNode)("span",{class:"text"},[this.node[this.displayKey]])])}}),T=(0,l.defineComponent)({name:"TagInput",directives:{bkTooltips:s.bkTooltips},props:{modelValue:e.PropTypes.arrayOf(e.PropTypes.string).def([]),placeholder:e.PropTypes.string.def("请输入并按 Enter 结束"),list:e.PropTypes.arrayOf(e.PropTypes.object).def([]),disabled:e.PropTypes.bool.def(!1),tooltipKey:e.PropTypes.string.def(""),saveKey:e.PropTypes.string.def("id"),displayKey:e.PropTypes.string.def("name"),hasDeleteIcon:e.PropTypes.bool.def(!1),clearable:e.PropTypes.bool.def(!0),trigger:e.PropTypes.commonType(["focus","search"]).def("search"),searchKey:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.arrayOf(e.PropTypes.string)]).def("name"),useGroup:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),maxData:e.PropTypes.number.def(-1),maxResult:e.PropTypes.number.def(10),contentMaxHeight:e.PropTypes.number.def(300),contentWidth:e.PropTypes.number.def(190),separator:e.PropTypes.string.def(""),allowNextFocus:e.PropTypes.bool.def(!0),allowAutoMatch:e.PropTypes.bool.def(!1),showClearOnlyHover:e.PropTypes.bool.def(!1),leftSpace:e.PropTypes.number.def(0),createTagValidator:{type:Function,default:null},filterCallback:{type:Function,default:null},tagTpl:{type:Function,default:null},tpl:{type:Function,default:null},pasteFn:{type:Function,default:null}},emits:["update:modelValue","change","select","blur","remove","removeAll"],setup:function(r,s){var u=s.emit,c=(0,e.useFormItem)(),d=(0,l.reactive)({isEdit:!1,isHover:!1,focusItemIndex:r.allowCreate?-1:0}),p=(0,l.reactive)({isShow:!1,width:190,modifiers:[{name:"offset",options:{offset:[0,4]}}]}),f=function(e){var t=(0,l.reactive)({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:function(){var e,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.curPage=1,t.totalSize=a.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;var n=[];if(t.pageSize>0)for(var l=0;l<t.totalSize;l+=t.pageSize)n.push(a.slice(l,l+t.pageSize));(e=t.renderListPaged).splice.apply(e,[0,t.renderListPaged.length].concat(n)),(r=t.curPageList).splice.apply(r,[0,t.curPageList.length].concat(o(t.renderListPaged[t.curPage-1]||[])))},pageChange:function(e){var r;t.curPage=e,(r=t.curPageList).splice.apply(r,[t.curPageList.length,0].concat(o(t.renderListPaged[t.curPage-1]||[]))),t.isPageLoading=!1}}}((0,l.toRefs)(r).maxResult),v=f.pageState,g=f.initPage,m=f.pageChange,b=(0,l.ref)(""),T=(0,l.ref)(null),L=(0,l.ref)(null),w=(0,l.ref)(null),P=(0,l.ref)(null),x=(0,l.ref)(null),I=(0,l.ref)(null),S=(0,l.ref)(null),C=(0,l.computed)((function(){return!r.disabled&&r.hasDeleteIcon})),K=(0,l.computed)((function(){return 1===r.maxData})),V=(0,l.computed)((function(){return 0===E.selectedTagList.length&&""===b.value&&!d.isEdit})),k=(0,l.computed)((function(){return r.clearable&&!r.disabled&&0!==E.selectedTagList.length&&(!r.showClearOnlyHover||d.isHover)})),N=(0,l.computed)((function(){return{"bk-tag-input-trigger":!0,active:d.isEdit,disabled:r.disabled}}));(0,l.watch)([function(){return o(r.modelValue)},function(){return o(r.list)}],(function(){z()})),(0,l.watch)(b,(0,i.debounce)((function(){var e=0!==v.curPageList.length,t=b.value;""!==t&&e||""===t&&"focus"===r.trigger&&e?p.isShow=!0:"focus"===r.trigger&&e||(p.isShow=!1)}),150)),(0,l.watch)((function(){return p.isShow}),(function(e){A(),e&&x.value&&((0,l.nextTick)((function(){x.value.scrollTop=0})),x.value.removeEventListener("scroll",O),x.value.addEventListener("scroll",O))}));var A=function(){var e,t,r=K.value?0:null===(e=P.value)||void 0===e?void 0:e.offsetLeft;p.modifiers=[{name:"offset",options:{offset:[r,4]}}],null===(t=I.value)||void 0===t||t.update()},O=function(){if(!v.isPageLoading&&0!==x.value.scrollTop){var e=x.value;if(e.scrollTop+e.offsetHeight>=e.scrollHeight){var t=v.curPage+1;t<=v.totalPage&&(v.isPageLoading=!0,setTimeout((function(){m(t)}),500))}}},R=function(){var e;return Array.from((null===(e=w.value)||void 0===e?void 0:e.childNodes)||[]).filter((function(e){return e.nodeType!==Node.TEXT_NODE}))},j=function(e){if(!r.disabled){if(null==e?void 0:e.target){var t=e.target.className;(t.indexOf("bk-tag-input-trigger")>-1||t.indexOf("tag-list")>-1)&&w.value.appendChild(P.value)}clearTimeout(S.value),K.value&&D.value.length&&(E.tagListCache=o(D.value),E.selectedTagListCache=o(E.selectedTagList),b.value=E.selectedTagListCache[0][r.saveKey],J(E.selectedTagList[0],0),G()),d.isEdit=!0,(0,l.nextTick)((function(){var e;null===(e=T.value)||void 0===e||e.focus(),"focus"===r.trigger&&0!==E.localList.length&&(_(),p.isShow?A():p.isShow=!0)}))}},E=(0,l.reactive)({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=(0,l.computed)((function(){return E.selectedTagList.map((function(e){return e[r.saveKey]}))})),F=function(e){var t=(0,l.toRefs)(e),r=t.useGroup,a=t.saveKey,n=t.displayKey,i=t.list,s=(0,l.reactive)([]);return(0,l.watch)([r,a,n,i],(function(){var e=i.value;r.value&&(e=i.value.reduce((function(e,t){var r=[];return t.children&&(r=t.children.map((function(e){return Object.assign({group:{groupId:t[a.value],groupName:t[n.value]}},e)}))),e.concat(r)}),[])),s.splice.apply(s,[0,s.length].concat(o(e)))}),{immediate:!0,deep:!0}),s}(r),q=(0,l.computed)((function(){if(r.useGroup){var e={};return v.curPageList.forEach((function(t,r){t.__index__=r,e[t.group.groupId]||(e[t.group.groupId]={id:t.group.groupId,name:t.group.groupName,children:[]}),e[t.group.groupId].children.push(t)})),Object.keys(e).map((function(t){return e[t]}))}return v.curPageList})),z=function(){var e=r.saveKey,t=r.modelValue,a=r.displayKey,l=r.allowCreate,i=r.trigger;E.selectedTagList=[],E.localList=o(F),t.length&&(t.forEach((function(t){var r=E.localList.find((function(r){return t===r[e]}));if(void 0!==r)E.selectedTagList.push(r);else if(l&&!D.value.includes(t)){var o;E.selectedTagList.push((n(o={},e,t),n(o,a,t),o))}})),K.value||(E.localList=E.localList.filter((function(r){return!t.includes(r[e])})))),"focus"===i&&_()},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=r.searchKey,a=r.filterCallback,n=e.toLowerCase(),o=[];if("function"==typeof a)o=a(n,t,E.localList)||[];else if(Array.isArray(t)){var l=t.map((function(e){return E.localList.filter((function(t){return-1!==t[e].toLowerCase().indexOf(n)}))}));o=Array.from(new Set(l.flat()))}else o=E.localList.filter((function(e){return-1!==e[t].toLowerCase().indexOf(n)}));g(o)};(0,l.onMounted)((function(){z()}));var M=function(){b.value=""},H=function(){if(K.value)return 0;var e=R().findIndex((function(e){return"tagInputItem"===e.id}));return e>=0?e:0},B=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t&&e){var a=t;r&&(a=t.nextElementSibling||null),t.parentNode.insertBefore(e,a)}},G=function(e){var t=r.maxData,a=r.trigger,n=r.allowCreate;if(-1===t||t>D.value.length){var o=((null==e?void 0:e.target)?e.target:b).value,l=y(o);l?(_(o),T.value.style.width="".concat(l*h,"px")):"focus"===a&&_()}else Z(),b.value="",p.isShow=!1;d.isEdit=!0,d.focusItemIndex=n?-1:0},Z=function(){S.value=setTimeout((function(){var e,t,n,o=b.value;if(M(),d.isEdit=!1,K.value){var l=(t=E.tagListCache,n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,o=[],l=!0,i=!1;try{for(r=r.call(e);!(l=(a=r.next()).done)&&(o.push(a.value),!t||o.length!==t);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t,n)||a(t,n)||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];o&&o===l&&E.selectedTagListCache.length?X(E.selectedTagListCache[0],"select"):W("remove")}else if(r.allowAutoMatch&&o){var i=v.curPageList.find((function(e){return Array.isArray(r.searchKey)?r.searchKey.map((function(t){return e[t]})).includes(o):e[r.searchKey]===o}));i?U(i,"select"):r.allowCreate&&U(o,"custom")}p.isShow=!1,u("blur",o,D.value),null===(e=null==c?void 0:c.validate)||void 0===e||e.call(c,"blur")}),50)},U=function(e,t,r){null==r||r.stopPropagation(),e&&!e.disabled&&(K.value&&(E.tagListCache=[],E.selectedTagListCache=[],E.selectedTagList=[]),X(e,t),W("select"),M(),p.isShow=!1)},W=function(e,t){var r;u("change",D.value),u(e,t),u("update:modelValue",D.value),null===(r=null==c?void 0:c.validate)||void 0===r||r.call(c,"change")},$=function(){var e=x.value.clientHeight,t=x.value.getBoundingClientRect().y;(0,l.nextTick)((function(){var r=x.value.querySelector(".bk-selector-actived");if(r){var a=r.clientHeight,n=r.getBoundingClientRect().y;n<t&&(x.value.scrollTop=x.value.scrollTop-(t-n));var o=n+a-t;o>e&&(x.value.scrollTop=x.value.scrollTop+o-e)}}))},X=function(e,a){if(!(E.selectedTagList.length>=r.maxData&&-1!==r.maxData)){var i,s=r.separator,u=r.saveKey,c=r.displayKey,d=r.createTagValidator,p=H(),f=1,v=!1,g=function(e){return"function"!=typeof d||d(e)},y=function(e){return E.localList.find((function(t){return t[u]===e}))};if("custom"===a)if(s){var m,b=e.split(s),L=(b=b.filter((function(e){return(null==e?void 0:e.trim())&&!D.value.includes(e)&&g(e)}))).map((function(e){var t;return y(e)||(n(t={},u,e),n(t,c,e),t)}));b.length&&((m=E.selectedTagList).splice.apply(m,[p,0].concat(o(L))),f=L.length,v=!0)}else{var w="object"===t(e);if(void 0!==(i=(i=w?e[u]:e.trim()).replace(/\s+/g,""))&&!D.value.includes(i)&&g(i)){var x,I=y(i)||(w?e:(n(x={},u,i),n(x,c,i),x));E.selectedTagList.splice(p,0,I),v=!0}}else e&&(void 0===(i=e[u])||D.value.includes(i)||(E.selectedTagList.splice(p,0,e),v=!0));v&&(0,l.nextTick)((function(){for(var e=1;e<=f;e++){var t=R()[p+e];B(t,P.value)}T.value.style.width="".concat(h,"px"),K.value||(r.allowNextFocus&&j(),E.localList=E.localList.filter((function(e){return!D.value.includes(e[u])})))}))}},J=function(e,t){E.selectedTagList.splice(t,1);var a=F.some((function(t){return t===e[r.saveKey]}));(r.allowCreate&&a||!r.allowCreate)&&!K.value&&E.localList.push(e)};return Object.assign(Object.assign(Object.assign(Object.assign({popoverProps:p},(0,l.toRefs)(d)),(0,l.toRefs)(E)),(0,l.toRefs)(v)),{isShowPlaceholder:V,isShowClear:k,curInputValue:b,formatList:F,renderList:q,showTagClose:C,tagInputRef:T,bkTagSelectorRef:L,tagListRef:w,tagInputItemRef:P,selectorListRef:x,popoverRef:I,triggerClass:N,focusInputTrigger:j,activeClass:function(e,t){var a={"bk-selector-actived":!1,"bk-selector-selected":D.value.includes(e[r.saveKey])};return r.useGroup?a["bk-selector-actived"]=e.__index__===d.focusItemIndex:a["bk-selector-actived"]=t===d.focusItemIndex,a},handleInput:G,handleFocus:function(){var e;p.width=K.value?null===(e=L.value)||void 0===e?void 0:e.clientWidth:r.contentWidth},handleBlur:Z,handleTagSelected:U,handleTagRemove:function(e,t,r){null==r||r.stopPropagation(),J(e,t),M(),W("remove",e),T.value.style.width="".concat(h,"px")},handleClear:function(e){e.stopPropagation();var t=E.selectedTagList;E.selectedTagList=[];var a,n=F.filter((function(e){return t.some((function(t){return t[r.saveKey]===e[r.saveKey]}))}));(!r.allowCreate||0===n.length)&&r.allowCreate||K.value||(a=E.localList).push.apply(a,o(n)),W("removeAll")},tagFocus:function(e){r.disabled||(B(P.value,e.currentTarget,!0),T.value.style.width="".concat(h,"px"),p.isShow&&A())},handleKeydown:function(e){if(!v.isPageLoading){var t=e.target.value,a=y(t),n=H(),o=R();switch(e.code){case"ArrowUp":if(e.preventDefault(),!p.isShow)return;d.focusItemIndex=d.focusItemIndex-1,d.focusItemIndex=d.focusItemIndex<0?-1:d.focusItemIndex,-1===d.focusItemIndex&&(d.focusItemIndex=v.curPageList.length-1),$();break;case"ArrowDown":if(e.preventDefault(),!p.isShow)return;d.focusItemIndex=d.focusItemIndex+1,d.focusItemIndex=d.focusItemIndex>v.curPageList.length-1?v.curPageList.length:d.focusItemIndex,d.focusItemIndex===v.curPageList.length&&(d.focusItemIndex=0),$();break;case"ArrowLeft":if(d.isEdit=!0,!a){if(n<1)return;B(P.value,o[n-1]),j()}break;case"ArrowRight":if(d.isEdit=!0,!a){if(n===o.length-1)return;B(o[n+1],P.value),j()}break;case"Enter":case"NumpadEnter":!r.allowCreate&&p.isShow||r.allowCreate&&d.focusItemIndex>=0&&p.isShow?U(v.curPageList[d.focusItemIndex],"select",e):r.allowCreate&&U(b.value,"custom",e),e.preventDefault();break;case"Backspace":0===n||b.value||function(e,t){var a=R();B(P.value,a[e-1]),E.selectedTagList.splice(e-1,1),j();var n=F.some((function(e){return e===t[r.saveKey]}));(r.allowCreate&&n||!r.allowCreate)&&!K.value&&E.localList.push(t),T.value="".concat(h,"px"),W("remove")}(n,E.selectedTagList[n-1])}}},handlePaste:function(e){if(e.preventDefault(),K.value)return!1;var t=r.maxData,a=r.saveKey,l=r.pasteFn,i=e.clipboardData.getData("text"),s=l?l(i):function(e){var t=[];return e.split(";").forEach((function(e){if(e.match(/^[a-zA-Z][a-zA-Z_]+/g)){var a,o=e.match(/^[a-zA-Z][a-zA-Z_]+/g).join("");t.push((n(a={},r.saveKey,o),n(a,r.displayKey,o),a))}})),t}(i),u=s.map((function(e){return e[a]}));if(u.length){var c=R(),d=H(),p=E.localList.map((function(e){return e[a]}));if(u=u.filter((function(e){return(null==e?void 0:e.trim())&&!D.value.includes(e)&&p.includes(e)})),-1!==t){var f=E.selectedTagList.length;if(f<t){var v=t-f;u.length>v&&(u=o(u.slice(0,v)))}else u=[]}var g,y=E.localList.filter((function(e){return u.includes(e[a])}));u.length&&((g=E.selectedTagList).splice.apply(g,[d,0].concat(o(y))),B(P.value,c[d]),T.value.style.width="".concat(h,"px"),E.localList=E.localList.filter((function(e){return!u.includes(e[a])})),W("select"),j())}}})},render:function(){var e=this;return(0,l.createVNode)("div",{class:"bk-tag-input",ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:function(){return e.isHover=!0},onMouseleave:function(){return e.isHover=!1}},[(0,l.createVNode)(g(),{ref:"popoverRef",theme:"light",trigger:"manual",placement:"bottom-start",arrow:!1,width:this.popoverProps.width,isShow:this.popoverProps.isShow,modifiers:this.popoverProps.modifiers},{default:function(){var t,r,a;return(0,l.createVNode)("div",{class:e.triggerClass},[(0,l.createVNode)("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:"".concat(e.leftSpace,"px")}},[e.selectedTagList.map((function(t,r){var a={boundary:"window",theme:"light",distance:12,content:t[e.tooltipKey],disabled:!e.tooltipKey};return(0,l.withDirectives)((0,l.createVNode)("li",{class:"tag-item",onClick:e.tagFocus},[(0,l.createVNode)(b,{node:t,tpl:e.tagTpl,displayKey:e.displayKey},null),e.showTagClose?(0,l.createVNode)(d.Error,{class:"remove-tag",onClick:e.handleTagRemove.bind(e,t,r)},null):null]),[[(0,l.resolveDirective)("bk-tooltips"),a]])})),(0,l.withDirectives)((0,l.createVNode)("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[(0,l.withDirectives)((0,l.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),[[l.vModelText,e.curInputValue]])]),[[l.vShow,e.isEdit]])]),(0,l.withDirectives)((0,l.createVNode)("p",{class:"placeholder"},[e.placeholder]),[[l.vShow,e.isShowPlaceholder]]),null!==(a=null===(r=null===(t=e.$slots)||void 0===t?void 0:t.suffix)||void 0===r?void 0:r.call(t))&&void 0!==a?a:e.isShowClear&&(0,l.createVNode)(d.Close,{class:"clear-icon",onClick:e.handleClear},null)])},content:function(){return(0,l.createVNode)("div",{class:"bk-selector-list"},[(0,l.createVNode)("ul",{ref:"selectorListRef",style:{"max-height":"".concat(e.contentMaxHeight,"px")},class:"outside-ul"},[e.useGroup?e.renderList.map((function(t){return(0,l.createVNode)("li",{class:"bk-selector-group-item"},[(0,l.createVNode)("span",{class:"group-name"},[t.name,(0,l.createTextVNode)(" ("),t.children.length,(0,l.createTextVNode)(")")]),(0,l.createVNode)("ul",{class:"bk-selector-group-list-item"},[t.children.map((function(t,r){return(0,l.createVNode)("li",{class:["bk-selector-list-item",{disabled:t.disabled},e.activeClass(t,r)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,l.createVNode)(m,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])}))])])})):e.renderList.map((function(t,r){return(0,l.createVNode)("li",{class:["bk-selector-list-item",{disabled:t.disabled},e.activeClass(t,r)],onClick:e.handleTagSelected.bind(e,t,"select")},[(0,l.createVNode)(m,{node:t,displayKey:e.displayKey,tpl:e.tpl,searchKey:e.searchKey,searchKeyword:e.curInputValue},null)])})),e.isPageLoading?(0,l.createVNode)("li",{class:"bk-selector-list-item loading"},[(0,l.createVNode)(f(),{theme:"primary",size:p.BkLoadingSize.Small},null)]):null])])}})])}}),L=(0,e.withInstall)(T)})(),c})()));
|
@@ -326,23 +326,23 @@ declare const _default: import("vue").DefineComponent<{
|
|
326
326
|
default: any;
|
327
327
|
};
|
328
328
|
}>> & {
|
329
|
-
onChange?: (...args: any[]) => any;
|
330
329
|
onBlur?: (...args: any[]) => any;
|
330
|
+
onChange?: (...args: any[]) => any;
|
331
331
|
onSelect?: (...args: any[]) => any;
|
332
332
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
333
333
|
onRemove?: (...args: any[]) => any;
|
334
334
|
onRemoveAll?: (...args: any[]) => any;
|
335
335
|
}, {
|
336
|
+
trigger: string;
|
337
|
+
disabled: boolean;
|
336
338
|
placeholder: string;
|
337
339
|
list: {
|
338
340
|
[key: string]: any;
|
339
341
|
}[];
|
340
342
|
separator: string;
|
341
|
-
disabled: boolean;
|
342
343
|
clearable: boolean;
|
343
344
|
showClearOnlyHover: boolean;
|
344
345
|
modelValue: string[];
|
345
|
-
trigger: string;
|
346
346
|
allowCreate: boolean;
|
347
347
|
searchKey: string | string[];
|
348
348
|
displayKey: string;
|
package/lib/transfer/index.d.ts
CHANGED
@@ -32,66 +32,71 @@ declare const Transfer: {
|
|
32
32
|
extCls: string;
|
33
33
|
displayKey: string;
|
34
34
|
sortable: boolean;
|
35
|
-
settingKey: string;
|
36
35
|
searchPlaceholder: string;
|
36
|
+
settingKey: string;
|
37
|
+
sortKey: string;
|
37
38
|
showOverflowTips: boolean;
|
38
39
|
searchable: boolean;
|
39
|
-
|
40
|
-
|
41
|
-
targetList: unknown[];
|
40
|
+
sourceList: any[];
|
41
|
+
targetList: any[];
|
42
42
|
emptyContent: string[];
|
43
43
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
44
|
-
title: {
|
45
|
-
|
46
|
-
default: () => any[];
|
44
|
+
title: import("vue-types").VueTypeDef<string[]> & {
|
45
|
+
default: () => string[];
|
47
46
|
};
|
48
|
-
extCls: {
|
49
|
-
|
47
|
+
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
48
|
+
default: string;
|
49
|
+
} & {
|
50
50
|
default: string;
|
51
51
|
};
|
52
|
-
searchPlaceholder: {
|
53
|
-
|
52
|
+
searchPlaceholder: import("vue-types").VueTypeValidableDef<string> & {
|
53
|
+
default: string;
|
54
|
+
} & {
|
54
55
|
default: string;
|
55
56
|
};
|
56
|
-
settingKey: {
|
57
|
-
|
57
|
+
settingKey: import("vue-types").VueTypeValidableDef<string> & {
|
58
|
+
default: string;
|
59
|
+
} & {
|
58
60
|
default: string;
|
59
61
|
};
|
60
|
-
displayKey: {
|
61
|
-
|
62
|
+
displayKey: import("vue-types").VueTypeValidableDef<string> & {
|
63
|
+
default: string;
|
64
|
+
} & {
|
62
65
|
default: string;
|
63
66
|
};
|
64
|
-
sortKey: {
|
65
|
-
|
67
|
+
sortKey: import("vue-types").VueTypeValidableDef<string> & {
|
68
|
+
default: string;
|
69
|
+
} & {
|
66
70
|
default: string;
|
67
71
|
};
|
68
|
-
showOverflowTips: {
|
69
|
-
|
72
|
+
showOverflowTips: import("vue-types").VueTypeValidableDef<boolean> & {
|
73
|
+
default: boolean;
|
74
|
+
} & {
|
70
75
|
default: boolean;
|
71
76
|
};
|
72
|
-
searchable: {
|
73
|
-
|
77
|
+
searchable: import("vue-types").VueTypeValidableDef<boolean> & {
|
78
|
+
default: boolean;
|
79
|
+
} & {
|
74
80
|
default: boolean;
|
75
81
|
};
|
76
|
-
sortable: {
|
77
|
-
|
82
|
+
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
83
|
+
default: boolean;
|
84
|
+
} & {
|
78
85
|
default: boolean;
|
79
86
|
};
|
80
|
-
sourceList: {
|
81
|
-
type: ArrayConstructor;
|
87
|
+
sourceList: import("vue-types").VueTypeDef<any[]> & {
|
82
88
|
default: () => any[];
|
83
89
|
};
|
84
|
-
targetList: {
|
85
|
-
type: ArrayConstructor;
|
90
|
+
targetList: import("vue-types").VueTypeDef<any[]> & {
|
86
91
|
default: () => any[];
|
87
92
|
};
|
88
|
-
emptyContent: {
|
89
|
-
|
90
|
-
default: () => any[];
|
93
|
+
emptyContent: import("vue-types").VueTypeDef<string[]> & {
|
94
|
+
default: () => string[];
|
91
95
|
};
|
92
96
|
}>> & {
|
93
97
|
onChange?: (...args: any[]) => any;
|
94
|
-
|
98
|
+
"onUpdate:targetList"?: (...args: any[]) => any;
|
99
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "extCls" | "displayKey" | "sortable" | "searchPlaceholder" | "settingKey" | "sortKey" | "showOverflowTips" | "searchable" | "sourceList" | "targetList" | "emptyContent">;
|
95
100
|
$attrs: {
|
96
101
|
[x: string]: unknown;
|
97
102
|
};
|
@@ -103,84 +108,87 @@ declare const Transfer: {
|
|
103
108
|
}>;
|
104
109
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
105
110
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
106
|
-
$emit: (event: "change", ...args: any[]) => void;
|
111
|
+
$emit: (event: "change" | "update:targetList", ...args: any[]) => void;
|
107
112
|
$el: any;
|
108
113
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
109
|
-
title: {
|
110
|
-
|
111
|
-
default: () => any[];
|
114
|
+
title: import("vue-types").VueTypeDef<string[]> & {
|
115
|
+
default: () => string[];
|
112
116
|
};
|
113
|
-
extCls: {
|
114
|
-
|
117
|
+
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
118
|
+
default: string;
|
119
|
+
} & {
|
115
120
|
default: string;
|
116
121
|
};
|
117
|
-
searchPlaceholder: {
|
118
|
-
|
122
|
+
searchPlaceholder: import("vue-types").VueTypeValidableDef<string> & {
|
123
|
+
default: string;
|
124
|
+
} & {
|
119
125
|
default: string;
|
120
126
|
};
|
121
|
-
settingKey: {
|
122
|
-
|
127
|
+
settingKey: import("vue-types").VueTypeValidableDef<string> & {
|
128
|
+
default: string;
|
129
|
+
} & {
|
123
130
|
default: string;
|
124
131
|
};
|
125
|
-
displayKey: {
|
126
|
-
|
132
|
+
displayKey: import("vue-types").VueTypeValidableDef<string> & {
|
133
|
+
default: string;
|
134
|
+
} & {
|
127
135
|
default: string;
|
128
136
|
};
|
129
|
-
sortKey: {
|
130
|
-
|
137
|
+
sortKey: import("vue-types").VueTypeValidableDef<string> & {
|
138
|
+
default: string;
|
139
|
+
} & {
|
131
140
|
default: string;
|
132
141
|
};
|
133
|
-
showOverflowTips: {
|
134
|
-
|
142
|
+
showOverflowTips: import("vue-types").VueTypeValidableDef<boolean> & {
|
143
|
+
default: boolean;
|
144
|
+
} & {
|
135
145
|
default: boolean;
|
136
146
|
};
|
137
|
-
searchable: {
|
138
|
-
|
147
|
+
searchable: import("vue-types").VueTypeValidableDef<boolean> & {
|
148
|
+
default: boolean;
|
149
|
+
} & {
|
139
150
|
default: boolean;
|
140
151
|
};
|
141
|
-
sortable: {
|
142
|
-
|
152
|
+
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
153
|
+
default: boolean;
|
154
|
+
} & {
|
143
155
|
default: boolean;
|
144
156
|
};
|
145
|
-
sourceList: {
|
146
|
-
type: ArrayConstructor;
|
157
|
+
sourceList: import("vue-types").VueTypeDef<any[]> & {
|
147
158
|
default: () => any[];
|
148
159
|
};
|
149
|
-
targetList: {
|
150
|
-
type: ArrayConstructor;
|
160
|
+
targetList: import("vue-types").VueTypeDef<any[]> & {
|
151
161
|
default: () => any[];
|
152
162
|
};
|
153
|
-
emptyContent: {
|
154
|
-
|
155
|
-
default: () => any[];
|
163
|
+
emptyContent: import("vue-types").VueTypeDef<string[]> & {
|
164
|
+
default: () => string[];
|
156
165
|
};
|
157
166
|
}>> & {
|
158
167
|
onChange?: (...args: any[]) => any;
|
168
|
+
"onUpdate:targetList"?: (...args: any[]) => any;
|
159
169
|
}, {
|
160
|
-
|
161
|
-
|
162
|
-
|
170
|
+
selectSearchQuery: import("vue").Ref<string>;
|
171
|
+
selectListSearch: import("vue").ComputedRef<any>;
|
172
|
+
selectedList: import("vue").Ref<any[]>;
|
173
|
+
selectListSort: import("vue").ComputedRef<any[]>;
|
174
|
+
selectedListSort: import("vue").ComputedRef<any[]>;
|
175
|
+
settingCode: import("vue").ComputedRef<string>;
|
176
|
+
displayCode: import("vue").ComputedRef<string>;
|
163
177
|
allToRight: () => void;
|
164
178
|
allToLeft: () => void;
|
165
|
-
|
166
|
-
|
167
|
-
leftHoverIndex: import("vue").Ref<number>;
|
168
|
-
rightHoverIndex: import("vue").Ref<number>;
|
169
|
-
handleItemMouseEvent: (type: any, event: any, isLeft: any, index: any) => void;
|
170
|
-
handleItemClick: (event: any, index: any, isLeft: any) => void;
|
171
|
-
hasSelectedList: import("vue").Ref<any[]>;
|
172
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], string, {
|
179
|
+
handleItemClick: (itemKey: any, isLeft: any) => void;
|
180
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:targetList")[], string, {
|
173
181
|
title: string[];
|
174
182
|
extCls: string;
|
175
183
|
displayKey: string;
|
176
184
|
sortable: boolean;
|
177
|
-
settingKey: string;
|
178
185
|
searchPlaceholder: string;
|
186
|
+
settingKey: string;
|
187
|
+
sortKey: string;
|
179
188
|
showOverflowTips: boolean;
|
180
189
|
searchable: boolean;
|
181
|
-
|
182
|
-
|
183
|
-
targetList: unknown[];
|
190
|
+
sourceList: any[];
|
191
|
+
targetList: any[];
|
184
192
|
emptyContent: string[];
|
185
193
|
}> & {
|
186
194
|
beforeCreate?: (() => void) | (() => void)[];
|
@@ -203,149 +211,155 @@ declare const Transfer: {
|
|
203
211
|
$nextTick: typeof import("vue").nextTick;
|
204
212
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
205
213
|
} & Readonly<import("vue").ExtractPropTypes<{
|
206
|
-
title: {
|
207
|
-
|
208
|
-
default: () => any[];
|
214
|
+
title: import("vue-types").VueTypeDef<string[]> & {
|
215
|
+
default: () => string[];
|
209
216
|
};
|
210
|
-
extCls: {
|
211
|
-
|
217
|
+
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
218
|
+
default: string;
|
219
|
+
} & {
|
212
220
|
default: string;
|
213
221
|
};
|
214
|
-
searchPlaceholder: {
|
215
|
-
|
222
|
+
searchPlaceholder: import("vue-types").VueTypeValidableDef<string> & {
|
223
|
+
default: string;
|
224
|
+
} & {
|
216
225
|
default: string;
|
217
226
|
};
|
218
|
-
settingKey: {
|
219
|
-
|
227
|
+
settingKey: import("vue-types").VueTypeValidableDef<string> & {
|
228
|
+
default: string;
|
229
|
+
} & {
|
220
230
|
default: string;
|
221
231
|
};
|
222
|
-
displayKey: {
|
223
|
-
|
232
|
+
displayKey: import("vue-types").VueTypeValidableDef<string> & {
|
233
|
+
default: string;
|
234
|
+
} & {
|
224
235
|
default: string;
|
225
236
|
};
|
226
|
-
sortKey: {
|
227
|
-
|
237
|
+
sortKey: import("vue-types").VueTypeValidableDef<string> & {
|
238
|
+
default: string;
|
239
|
+
} & {
|
228
240
|
default: string;
|
229
241
|
};
|
230
|
-
showOverflowTips: {
|
231
|
-
|
242
|
+
showOverflowTips: import("vue-types").VueTypeValidableDef<boolean> & {
|
243
|
+
default: boolean;
|
244
|
+
} & {
|
232
245
|
default: boolean;
|
233
246
|
};
|
234
|
-
searchable: {
|
235
|
-
|
247
|
+
searchable: import("vue-types").VueTypeValidableDef<boolean> & {
|
248
|
+
default: boolean;
|
249
|
+
} & {
|
236
250
|
default: boolean;
|
237
251
|
};
|
238
|
-
sortable: {
|
239
|
-
|
252
|
+
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
253
|
+
default: boolean;
|
254
|
+
} & {
|
240
255
|
default: boolean;
|
241
256
|
};
|
242
|
-
sourceList: {
|
243
|
-
type: ArrayConstructor;
|
257
|
+
sourceList: import("vue-types").VueTypeDef<any[]> & {
|
244
258
|
default: () => any[];
|
245
259
|
};
|
246
|
-
targetList: {
|
247
|
-
type: ArrayConstructor;
|
260
|
+
targetList: import("vue-types").VueTypeDef<any[]> & {
|
248
261
|
default: () => any[];
|
249
262
|
};
|
250
|
-
emptyContent: {
|
251
|
-
|
252
|
-
default: () => any[];
|
263
|
+
emptyContent: import("vue-types").VueTypeDef<string[]> & {
|
264
|
+
default: () => string[];
|
253
265
|
};
|
254
266
|
}>> & {
|
255
267
|
onChange?: (...args: any[]) => any;
|
268
|
+
"onUpdate:targetList"?: (...args: any[]) => any;
|
256
269
|
} & import("vue").ShallowUnwrapRef<{
|
257
|
-
|
258
|
-
|
259
|
-
|
270
|
+
selectSearchQuery: import("vue").Ref<string>;
|
271
|
+
selectListSearch: import("vue").ComputedRef<any>;
|
272
|
+
selectedList: import("vue").Ref<any[]>;
|
273
|
+
selectListSort: import("vue").ComputedRef<any[]>;
|
274
|
+
selectedListSort: import("vue").ComputedRef<any[]>;
|
275
|
+
settingCode: import("vue").ComputedRef<string>;
|
276
|
+
displayCode: import("vue").ComputedRef<string>;
|
260
277
|
allToRight: () => void;
|
261
278
|
allToLeft: () => void;
|
262
|
-
|
263
|
-
displayCode: import("vue").ComputedRef<string>;
|
264
|
-
leftHoverIndex: import("vue").Ref<number>;
|
265
|
-
rightHoverIndex: import("vue").Ref<number>;
|
266
|
-
handleItemMouseEvent: (type: any, event: any, isLeft: any, index: any) => void;
|
267
|
-
handleItemClick: (event: any, index: any, isLeft: any) => void;
|
268
|
-
hasSelectedList: import("vue").Ref<any[]>;
|
279
|
+
handleItemClick: (itemKey: any, isLeft: any) => void;
|
269
280
|
}> & {} & {} & import("vue").ComponentCustomProperties;
|
270
281
|
__isFragment?: never;
|
271
282
|
__isTeleport?: never;
|
272
283
|
__isSuspense?: never;
|
273
284
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
274
|
-
title: {
|
275
|
-
|
276
|
-
default: () => any[];
|
285
|
+
title: import("vue-types").VueTypeDef<string[]> & {
|
286
|
+
default: () => string[];
|
277
287
|
};
|
278
|
-
extCls: {
|
279
|
-
|
288
|
+
extCls: import("vue-types").VueTypeValidableDef<string> & {
|
289
|
+
default: string;
|
290
|
+
} & {
|
280
291
|
default: string;
|
281
292
|
};
|
282
|
-
searchPlaceholder: {
|
283
|
-
|
293
|
+
searchPlaceholder: import("vue-types").VueTypeValidableDef<string> & {
|
294
|
+
default: string;
|
295
|
+
} & {
|
284
296
|
default: string;
|
285
297
|
};
|
286
|
-
settingKey: {
|
287
|
-
|
298
|
+
settingKey: import("vue-types").VueTypeValidableDef<string> & {
|
299
|
+
default: string;
|
300
|
+
} & {
|
288
301
|
default: string;
|
289
302
|
};
|
290
|
-
displayKey: {
|
291
|
-
|
303
|
+
displayKey: import("vue-types").VueTypeValidableDef<string> & {
|
304
|
+
default: string;
|
305
|
+
} & {
|
292
306
|
default: string;
|
293
307
|
};
|
294
|
-
sortKey: {
|
295
|
-
|
308
|
+
sortKey: import("vue-types").VueTypeValidableDef<string> & {
|
309
|
+
default: string;
|
310
|
+
} & {
|
296
311
|
default: string;
|
297
312
|
};
|
298
|
-
showOverflowTips: {
|
299
|
-
|
313
|
+
showOverflowTips: import("vue-types").VueTypeValidableDef<boolean> & {
|
314
|
+
default: boolean;
|
315
|
+
} & {
|
300
316
|
default: boolean;
|
301
317
|
};
|
302
|
-
searchable: {
|
303
|
-
|
318
|
+
searchable: import("vue-types").VueTypeValidableDef<boolean> & {
|
319
|
+
default: boolean;
|
320
|
+
} & {
|
304
321
|
default: boolean;
|
305
322
|
};
|
306
|
-
sortable: {
|
307
|
-
|
323
|
+
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
324
|
+
default: boolean;
|
325
|
+
} & {
|
308
326
|
default: boolean;
|
309
327
|
};
|
310
|
-
sourceList: {
|
311
|
-
type: ArrayConstructor;
|
328
|
+
sourceList: import("vue-types").VueTypeDef<any[]> & {
|
312
329
|
default: () => any[];
|
313
330
|
};
|
314
|
-
targetList: {
|
315
|
-
type: ArrayConstructor;
|
331
|
+
targetList: import("vue-types").VueTypeDef<any[]> & {
|
316
332
|
default: () => any[];
|
317
333
|
};
|
318
|
-
emptyContent: {
|
319
|
-
|
320
|
-
default: () => any[];
|
334
|
+
emptyContent: import("vue-types").VueTypeDef<string[]> & {
|
335
|
+
default: () => string[];
|
321
336
|
};
|
322
337
|
}>> & {
|
323
338
|
onChange?: (...args: any[]) => any;
|
339
|
+
"onUpdate:targetList"?: (...args: any[]) => any;
|
324
340
|
}, {
|
325
|
-
|
326
|
-
|
327
|
-
|
341
|
+
selectSearchQuery: import("vue").Ref<string>;
|
342
|
+
selectListSearch: import("vue").ComputedRef<any>;
|
343
|
+
selectedList: import("vue").Ref<any[]>;
|
344
|
+
selectListSort: import("vue").ComputedRef<any[]>;
|
345
|
+
selectedListSort: import("vue").ComputedRef<any[]>;
|
346
|
+
settingCode: import("vue").ComputedRef<string>;
|
347
|
+
displayCode: import("vue").ComputedRef<string>;
|
328
348
|
allToRight: () => void;
|
329
349
|
allToLeft: () => void;
|
330
|
-
|
331
|
-
|
332
|
-
leftHoverIndex: import("vue").Ref<number>;
|
333
|
-
rightHoverIndex: import("vue").Ref<number>;
|
334
|
-
handleItemMouseEvent: (type: any, event: any, isLeft: any, index: any) => void;
|
335
|
-
handleItemClick: (event: any, index: any, isLeft: any) => void;
|
336
|
-
hasSelectedList: import("vue").Ref<any[]>;
|
337
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", {
|
350
|
+
handleItemClick: (itemKey: any, isLeft: any) => void;
|
351
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:targetList")[], "change" | "update:targetList", {
|
338
352
|
title: string[];
|
339
353
|
extCls: string;
|
340
354
|
displayKey: string;
|
341
355
|
sortable: boolean;
|
342
|
-
settingKey: string;
|
343
356
|
searchPlaceholder: string;
|
357
|
+
settingKey: string;
|
358
|
+
sortKey: string;
|
344
359
|
showOverflowTips: boolean;
|
345
360
|
searchable: boolean;
|
346
|
-
|
347
|
-
|
348
|
-
targetList: unknown[];
|
361
|
+
sourceList: any[];
|
362
|
+
targetList: any[];
|
349
363
|
emptyContent: string[];
|
350
364
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
351
365
|
export default Transfer;
|