bkui-vue 0.0.1-beta.452 → 0.0.1-beta.454

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.
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"],e["../popover"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,i,a)=>(()=>{var o={7162:(e,t,n)=>{e.exports=n(5047)},5047:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new I(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===f){if("throw"===i)throw a;return V()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=S(o,n);if(l){if(l===p)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?f:v,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=f,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",v="suspendedYield",h="executing",f="completed",p={};function m(){}function g(){}function _(){}var y={};u(y,a,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(N([])));b&&b!==n&&r.call(b,a)&&(y=b);var x=_.prototype=m.prototype=Object.create(y);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,o,l){var u=c(e[i],e,a);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,l)}),(function(e){n("throw",e,o,l)})):t.resolve(d).then((function(e){s.value=e,o(s)}),(function(e){return n("throw",e,o,l)}))}l(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:V}}function V(){return{value:t,done:!0}}return g.prototype=_,u(x,"constructor",_),u(_,"constructor",g),g.displayName=u(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},k(E.prototype),u(E.prototype,o,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new E(s(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(x),u(x,l,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return l.type="throw",l.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],l=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=a},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return o[e](n,n.exports,u),n.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 n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 s={};return(()=>{"use strict";u.r(s),u.d(s,{BkSearchSelect:()=>D,default:()=>A});var e=u(4212);function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=u(748),r=null,i=null;function a(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function o(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function l(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===o(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var c=0,d=null;function v(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=h.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&p(e)})),u=l(e),s=u.detached,v=u.rendered;e.__resize_observer_triggered__=!1===s&&!1===v,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){p(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(c||(d=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=o(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=a("div",{className:"resize-triggers"}),r=a("div",{className:"resize-expand-trigger"}),i=a("div"),l=a("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(l),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:l},m(e),e.addEventListener("scroll",f,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=l(e).rendered,window.MutationObserver){var g=new MutationObserver(e.__resize_mutation_handler__);g.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=g}e.__resize_listeners__.push(t),c++}function h(){var e=l(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(m(this),this.addEventListener("scroll",f,!0)),this.__resize_rendered__=t,p(this))}function f(){var e,t,n=this;m(this),this.__resize_raf__&&(e=this.__resize_raf__,i||(i=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),i(e)),this.__resize_raf__=(t=function(){var e,t,r,i,a,o,l=(r=(t=(e=n).__resize_last__).width,i=t.height,a=e.offsetWidth,o=e.offsetHeight,a!==r||o!==i?{width:a,height:o}:null);l&&(n.__resize_last__=l,p(n))},r||(r=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),r(t))}function p(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function m(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,a=i.scrollWidth,o=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,s=n.scrollWidth,c=n.scrollHeight;i.scrollLeft=a,i.scrollTop=o,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=s,n.scrollTop=c}var g=u(2717),_=u(4061),y=u(6870),w=u(7162),b=u.n(w);function x(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create;var k=u(5537),E=u.n(k);const S=(0,n.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}}},emits:["selectItem","selectCondition","footerClick"],setup:function(e,t){var r=t.emit,i=(0,g.useLocale)("searchSelect"),a=(0,g.usePrefix)().resolveClassName,o=(0,n.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:i.value.ok},{id:"cancel",name:i.value.cancel,disabled:!1}]:e.footerBtns}));return{handleClick:function(e){r("selectItem",e)},handleClickCondition:function(e){r("selectCondition",e)},handleClickFooterBtn:function(e){r("footerClick",e)},filterList:(0,n.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var r;return(null===(r=t.value)||void 0===r?void 0:r.name)?[(0,n.createVNode)("span",{class:"menu-name"},[t.name,(0,n.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var r=e.keyword,i=r.length;if(!(null==r?void 0:r.trim().length)||!t.toLocaleLowerCase().includes(r.toLocaleLowerCase()))return t;var a=[],o=-1;return r=r.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(r),"igm"),(function(e,r){return 0===a.length&&0!==r?a.push(t.slice(0,r)):o>=0&&a.push(t.slice(o+e.length,r)),a.push((0,n.createVNode)("span",{class:"is-keyword"},[e])),o=r,e})),o>=0&&a.push(t.slice(o+i)),a.length?a:t}(t.name)},localFooterBtns:o,resolveClassName:a}},render:function(){var e,t,r,i=this;return(0,n.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,n.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,n.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&i.handleClickCondition(e)}},[e.name])}))]),(0,n.createVNode)("ul",{class:"menu-content"},[null===(t=this.list)||void 0===t?void 0:t.map((function(e){return(0,n.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(i.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&i.handleClick(e)}},[i.$slots.default?i.$slots.default({item:e,list:i.list,multiple:!!i.multiple,hoverId:i.hoverId,getSearchNode:i.getSearchNode}):(0,n.createVNode)(n.Fragment,null,[i.getSearchNode(e),i.multiple&&i.selected.includes(e.id)&&(0,n.createVNode)(y.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(r=this.localFooterBtns)||void 0===r?void 0:r.length)&&(0,n.createVNode)("div",{class:"menu-footer"},[this.localFooterBtns.map((function(e){return(0,n.createVNode)("span",{class:"menu-footer-btn ".concat(e.disabled?"is-disabled":""),key:e.id,onClick:function(){return!e.disabled&&i.handleClickFooterBtn(e)}},[e.name])}))])])}});function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var I;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(I||(I={}));var N,V=Symbol("SEARCH_SLECT_PROVIDER_KEY"),z=function(){return(0,n.inject)(V)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(N||(N={}));var O=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"|";L(this,e),this.searchItem=t,this.type=n,this.splitCode=r,this.values=[],this.id=t.id,this.name=t.name}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}}))),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&C(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const T=(0,n.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:_.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:N.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,r){var i=r.emit,a=r.expose,o=(0,g.useLocale)("searchSelect"),l=(0,g.usePrefix)().resolveClassName,u=(0,n.ref)(null),s=(0,n.ref)(null),c=(0,n.ref)(""),d=(0,n.ref)(!1),v=(0,n.ref)(!1),h=(0,n.ref)(!1),f=(0,n.ref)(t.defautUsingItem),p=(0,n.ref)(""),m=(0,n.ref)(!1),_=(0,e.debounce)(300,M),y=!1,w=(0,n.ref)([]),k=(0,n.ref)([]),E=z(),S=E.editKey,L=E.onValidate,C=E.valueSplitCode;function V(e){switch(e.code){case"ArrowDown":case"ArrowUp":T(e);break;case"Enter":case"NumpadEnter":!function(e){if(y){e.preventDefault();var t=k.value.find((function(e){return e.id===p.value}));t&&B(t)}}(e)}}function T(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=k.value.length,r=n,i=k.value.findIndex((function(e){return e.id===p.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var a=k.value[i];if(a&&!a.disabled){r=-1;var o=document.getElementById(a.id);return null==o||o.focus(),void(p.value=a.id)}r-=1}}function F(e){q(),e&&M()}function j(e){var n;return x(this,void 0,void 0,b().mark((function r(){var a,o,l,u,s;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e||e.preventDefault(),r.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(f.value){r.next=16;break}if(c.value&&t.valueBehavior!==I.NEEDKEY){r.next=6;break}return r.abrupt("return");case 6:return a={id:c.value,name:c.value},r.next=9,D(a);case 9:if(r.sent){r.next=12;break}return r.abrupt("return");case 12:return i("add",new O(a,"text",C.value)),c.value="",M(),r.abrupt("return");case 16:if(null==(o=f.value.values)?void 0:o.length){r.next=43;break}if(!(null===(n=c.value)||void 0===n?void 0:n.length)){r.next=41;break}if(!c.value.includes(C.value)){r.next=29;break}return l=c.value.split(C.value),r.next=23,D({id:c.value,name:c.value});case 23:if(r.sent){r.next=26;break}return r.abrupt("return");case 26:l.forEach((function(e){return f.value.addValue({id:e,name:e})})),r.next=36;break;case 29:return u={id:c.value,name:c.value},r.next=32,D(u);case 32:if(r.sent){r.next=35;break}return r.abrupt("return");case 35:f.value.addValue(u);case 36:return i("add",f.value),c.value="",f.value=null,q(!0),r.abrupt("return");case 41:return d.value=!0,r.abrupt("return");case 43:if(!c.value){r.next=56;break}return s={id:c.value,name:c.value},r.next=47,D(s);case 47:if(r.sent){r.next=50;break}return r.abrupt("return");case 50:return f.value.addValue(s),i("add",f.value),c.value="",f.value=null,q(!0),r.abrupt("return");case 56:return r.next=58,D();case 58:if(r.sent){r.next=61;break}return r.abrupt("return");case 61:K();case 62:case"end":return r.stop()}}),r)})))}function B(e,n){var r,i,a,o,l;return x(this,void 0,void 0,b().mark((function s(){var d,v;return b().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!(null===(r=e.value)||void 0===r?void 0:r.id)){s.next=8;break}if((t.valueBehavior!==I.NEEDKEY||!e.value)&&t.validateValues){s.next=8;break}return(d=new O(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n,C.value)).addValue(e.value),K(d),t.valueBehavior===I.NEEDKEY&&p.value&&q(!0),p.value="",s.abrupt("return");case 8:if(f.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){s.next=16;break}return f.value=new O(e,n,C.value),c.value="",(v="condition"===n)&&K(),h.value=v||!!f.value.children.length,q(t.valueBehavior===I.NEEDKEY&&!!p.value),s.abrupt("return");case 16:if("condition"!==(null===(o=f.value)||void 0===o?void 0:o.type)){s.next=20;break}return f.value=new O(e,n,C.value),K(),s.abrupt("return");case 20:return f.value.addValue(e),s.next=23,D(e);case 23:if(s.sent){s.next=26;break}return s.abrupt("return");case 26:f.value.multiple||K(),t.valueBehavior===I.NEEDKEY&&(null===(l=f.value)||void 0===l?void 0:l.multiple)&&q();case 28:case"end":return s.stop()}}),s)})))}function D(e){return x(this,void 0,void 0,b().mark((function n(){var r,i,a,o;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(f.value){n.next=4;break}return n.next=3,A(null,[e]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=f.value,i=r.searchItem,a=r.validate,o=r.values,!a||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,A(i,e?[e]:o);case 9:return L(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function A(e,n){var r;return x(this,void 0,void 0,b().mark((function i(){var a;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=t.validateValues)||void 0===r?void 0:r.call(t,null!=e?e:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(a=i.sent)&&!1!==a){i.next=6;break}return L(a||"校验错误"),i.abrupt("return",!1);case 6:return L(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function q(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&(0,n.nextTick)().then((function(){M()})),v.value=!0,h.value=!0,d.value=!1;var t=setTimeout((function(){if(u.value){u.value.focus();var e=window.getSelection();0===e.focusOffset&&(e.selectAllChildren(u.value),e.collapseToEnd())}window.clearTimeout(t)}),0);i("focus",v.value)}function M(){var n,r,i,a,o;return x(this,void 0,void 0,b().mark((function l(){var u,s;return b().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=f.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==f.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=f.value)||void 0===i?void 0:i.searchItem,c.value).catch((function(){return[]}));case 5:u=l.sent,m.value=!1,l.next=10;break;case 9:(null==f?void 0:f.value)?"condition"===f.value.type?u=t.conditions:(null===(o=f.value.values)||void 0===o?void 0:o.length)&&!f.value.multiple&&t.mode!==N.EDIT||(u=f.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(a=c.value)||void 0===a?void 0:a.length)?t.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;t.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())?(u.push(t),null===(n=t.children)||void 0===n||n.forEach((function(n){u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:c.value,name:c.value}}))):(null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())&&u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{value:{id:c.value,name:c.value}})))})):u=t.data.filter((function(e){return!e.isSelected})).slice();case 10:k.value=u,t.valueBehavior===I.NEEDKEY&&(s=u.find((function(e){return!e.disabled})))&&(!p.value||p.value&&!u.some((function(e){return e.id===p.value})))&&(p.value=s.id);case 12:case"end":return l.stop()}}),l)})))}function K(e){i("add",null!=e?e:f.value),f.value=null,c.value="",q(t.valueBehavior===I.NEEDKEY)}function H(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(R(e.slice(0,-1)),H()):"\n"!==e[0]&&"\r"!==e[0]||(R(e.slice(1)),H())}function R(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=f.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,n.watch)(S,(function(){t.mode===N.DEFAULT&&S.value&&(h.value=!1)})),(0,n.watchEffect)((function(){c.value||R()}),{flush:"pre"}),(0,n.watch)([k,h],(function(){var e;(null===(e=k.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&h.value?y||(t.valueBehavior===I.NEEDKEY?p.value=k.value.find((function(e){return!e.disabled})).id:p.value="",y=!0,document.addEventListener("keydown",V)):(document.removeEventListener("keydown",V),y=!1,t.valueBehavior!==I.NEEDKEY&&(p.value=""))})),a({handleInputFocus:F,isFocus:v}),{popoverRef:s,inputRef:u,keyword:c,loading:m,remoteMenuList:w,menuList:k,menuHoverId:p,isFocus:v,usingItem:f,showPopover:h,showNoSelectValueError:d,debounceSetMenuList:_,documentArrowEvent:T,handleClickOutside:function(e){var n,r;!(null===(n=s.value)||void 0===n?void 0:n.contains(e.target))&&(null===(r=t.clickOutside)||void 0===r?void 0:r.call(t,e.target,s.value))&&(h.value=!1,v.value=!1,i("focus",v.value))},handleInputFocus:F,handleInputChange:function(e){var t,n,r,i,a,o,l,s,d;H();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm,C.value).replace(/\s{2}/gm,""),u.value.innerText=v,q(),c.value=v.replace((null===(t=f.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),_();else if(!c.value&&v.length<((null===(r=null===(n=f.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var h=v.replace(" "," ").replace((null===(i=f.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(a=f.value)||void 0===a?void 0:a.keyInnerText)&&v.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&h&&(null===(o=f.value.values)||void 0===o?void 0:o.length))return c.value=h,console.info("outerText",h),void _();!h&&(null==v?void 0:v.length)||(f.value=null),c.value=h?v:"",_()}else(null===(s=null===(l=f.value)||void 0===l?void 0:l.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=f.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),q(),_())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===I.NEEDKEY&&k.value.some((function(e){return e.id===p.value})))return;j(e);break;case"Backspace":!function(){var e,r;if(!f.value&&!c.value)return i("delete"),void(0,n.nextTick)(M);if(null===(e=f.value)||void 0===e?void 0:e.values.length){if((null===(r=f.value)||void 0===r?void 0:r.multiple)||f.value.isInValueList(f.value.values[0])||t.mode===N.EDIT&&!c.value)return f.value.values.splice(-1,1),c.value="",void q()}else c.value||(f.value=null,c.value="",M());L("")}();default:d.value=!1}},handleSelectItem:B,handleSelectCondtionItem:function(e){B(e,"condition")},handleMenuFooterClick:function(e){switch(e.id){case"confirm":j();break;case"cancel":f.value.values=[],h.value=!1}},resolveClassName:l,t:o}},render:function(){var e,t,r=this,i=this.usingItem||{},a=i.multiple,o=i.values,l=i.placeholder,u=i.inputInnerHtml,s=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==o?void 0:o.length)&&l,c=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),d=!this.usingItem&&this.showCondition,v=Object.assign({},this.$slots.menu?{default:function(e){var t,n;return null===(n=(t=r.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,n.createVNode)(E(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,n.withDirectives)((0,n.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":r.showInputBefore&&!(null===(e=r.keyword)||void 0===e?void 0:e.length),"input-after":s},contenteditable:!0,"data-placeholder":u||r.keyword?"":r.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:r.handleInputFocus,onInput:r.handleInputChange,onKeydown:r.handleInputKeyup},null),[[(0,n.resolveDirective)("clickoutside"),r.handleClickOutside]])},content:function(){var e;return r.loading?(0,n.createVNode)("div",null,[r.t.loading]):r.showNoSelectValueError?(0,n.createVNode)("div",null,[r.t.filterQueryMustHasValue]):(null===(e=r.menuList)||void 0===e?void 0:e.length)?(0,n.createVNode)("div",{ref:"popoverRef",class:r.resolveClassName("search-select-popover")},[(0,n.createVNode)(S,{list:r.menuList,keyword:r.keyword,multiple:!!a,hoverId:r.menuHoverId,selected:(null==o?void 0:o.map((function(e){return e.id})))||[],conditions:d?r.conditions:[],onSelectItem:r.handleSelectItem,onSelectCondition:r.handleSelectCondtionItem,onFooterClick:r.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),F=(0,n.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var r=t.emit,i=(0,n.ref)(null),a=z(),o=a.onEditClick,l=a.onEditEnter,u=a.onEditBlur,s=a.editKey,c=a.valueSplitCode;return{inputRef:i,editKey:s,copySeletedItem:function(e){var t=new O(e.searchItem,e.type,c.value);return t.values=e.values.slice(),t},handleDeleteSelected:function(e){r("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),o(t,n),setTimeout((function(){return i.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){l(e,t)},handleInputFocus:function(e){e||u()}}},render:function(){var e=this,t=function(t,r){return e.editKey==="".concat(t.id,"_").concat(r)?(0,n.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,n.createVNode)(T,{ref:"inputRef",key:e.editKey.toString(),mode:N.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,r)},onFocus:e.handleInputFocus},null)]):(0,n.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?r<e.overflowIndex:r>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(r)},[(0,n.createVNode)("span",{class:"selected-name",onClick:function(n){return e.handleEditSeleted(n,t,r)}},[t.inputInnerText]),(0,n.createVNode)(y.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(r)}},null)])};return(0,n.createVNode)(n.Fragment,null,[this.selectedList.map((function(r,i){return[e.overflowIndex>=0&&i===e.overflowIndex&&(0,n.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,n.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(r,i)]}))])}});var j={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,valueSplitCode:{type:String,default:"|"},uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:I.ALL,validator:function(e){return[I.ALL,I.NEEDKEY].includes(e)}}};const B=(0,n.defineComponent)({name:"SearchSelect",directives:{clickoutside:_.clickoutside},props:j,emits:["update:modelValue","search"],setup:function(t,r){var i,a=r.emit,o=(0,g.useLocale)("searchSelect"),l=(0,g.usePrefix)().resolveClassName,u=(0,n.computed)((function(){return void 0===t.conditions?[{id:"or",name:o.value.or},{id:"and",name:o.value.and}]:t.conditions})),s=(0,n.ref)(null),h=(0,n.ref)(null),p=(0,n.ref)(!1),m=(0,n.ref)([]),_=(0,n.ref)(-1),y=(0,e.debounce)(32,C),w=(0,n.ref)(""),b=(0,n.ref)(""),x=(0,n.computed)((function(){return t.valueSplitCode})),k=(0,n.shallowRef)([]);function E(e,t){w.value="".concat(e.id,"_").concat(t)}function S(e,t){var n=m.value.slice();n.splice(t,1,e),a("update:modelValue",n.map((function(e){return e.toValue()}))),w.value=""}function L(e){b.value=e||""}function C(){if(p.value||m.value.length<1)_.value=-1;else{for(var e=h.value.querySelector(".".concat(l("search-select-container"))),n=h.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,a=0,o=0;0===a&&i<=n-40&&o<=r.length-1;){var u=r[o];if(u.clientHeight>t.minHeight)return void(_.value=o);(i+=u?u.clientWidth+6:0)>=n-40&&(a=o),o+=1}a===r.length-1&&i<=n?_.value=-1:_.value=i>=n-40?a:a-1}}return(0,n.watch)((function(){return t.data}),(function(){var e;k.value=JSON.parse(JSON.stringify(t.data)),null===(e=k.value)||void 0===e||e.forEach((function(e){e.isSelected=t.uniqueSelect&&!!t.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,n.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return m.value=[],void(null===(n=k.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];e.forEach((function(e){var n,r=m.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(e))r.values=e.values||[],i.push(r);else{var a=t.data.find((function(t){return t.id===e.id})),o="default";a||(a=t.conditions.find((function(t){return t.id===e.id})))&&(o="condition"),a||(null===(n=e.values)||void 0===n?void 0:n.length)||(o="text");var l=new O(a||e,o,x.value);l.values=e.values||[],i.push(l)}})),m.value=i,null===(r=k.value)||void 0===r||r.forEach((function(e){e.isSelected=t.uniqueSelect&&!!i.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,n.onMounted)((function(){v(h.value.querySelector(".".concat(l("search-select-container"))),y)})),(0,n.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",f),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--c&&d&&d.parentNode.removeChild(d)}}(h.value.querySelector(".".concat(l("search-select-container"))),y)})),i={onEditClick:E,onEditEnter:S,onEditBlur:function(){w.value="",L("")},onValidate:L,editKey:w,valueSplitCode:x},(0,n.provide)(V,i),{inputRef:s,wrapRef:h,isFocus:p,copyData:k,selectedList:m,overflowIndex:_,validateStr:b,splitCode:x,onEditClick:E,onEditEnter:S,handleWrapClick:function(){w.value||s.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(_.value=-1),!1===e&&(null===(t=h.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),p.value=e},handleResize:C,handleClearAll:function(){m.value=[],_.value=-1,a("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=h.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=m.value.slice();t.push(e),L(""),a("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=m.value.slice();t.splice("number"==typeof e?e:m.value.length-1,1),L(""),a("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){a("search",e)},localConditions:u,resolveClassName:l,t:o}},render:function(){var e,r,i,a=this,o="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),l=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,u=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=a.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,n.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,n.createVNode)("div",{class:(e={},t(e,this.resolveClassName("search-select-container"),!0),t(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,n.createVNode)("div",{class:"search-prefix"},[null===(i=(r=this.$slots).prepend)||void 0===i?void 0:i.call(r)]),(0,n.createVNode)("div",{class:"search-container",style:{maxHeight:o}},[(0,n.createVNode)(F,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},u)),(0,n.createVNode)("div",{class:"search-container-input"},[(0,n.createVNode)(T,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:l,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},u))])]),(0,n.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,n.createVNode)(y.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,n.createVNode)(y.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,n.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,n.createVNode)(n.Fragment,null,[(0,n.createVNode)(y.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var D=(0,e.withInstall)(B);const A=D})(),s})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"],e["../popover"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,i,a)=>(()=>{var o={7162:(e,t,n)=>{e.exports=n(5047)},5047:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new I(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===f){if("throw"===i)throw a;return V()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=S(o,n);if(l){if(l===p)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?f:v,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=f,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",v="suspendedYield",h="executing",f="completed",p={};function m(){}function g(){}function _(){}var y={};u(y,a,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(N([])));b&&b!==n&&r.call(b,a)&&(y=b);var x=_.prototype=m.prototype=Object.create(y);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,o,l){var u=c(e[i],e,a);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,l)}),(function(e){n("throw",e,o,l)})):t.resolve(d).then((function(e){s.value=e,o(s)}),(function(e){return n("throw",e,o,l)}))}l(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:V}}function V(){return{value:t,done:!0}}return g.prototype=_,u(x,"constructor",_),u(_,"constructor",g),g.displayName=u(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},k(E.prototype),u(E.prototype,o,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new E(s(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(x),u(x,l,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return l.type="throw",l.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],l=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=a},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return o[e](n,n.exports,u),n.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 n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 s={};return(()=>{"use strict";u.r(s),u.d(s,{BkSearchSelect:()=>D,default:()=>A});var e=u(4212);function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=u(748),r=null,i=null;function a(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function o(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function l(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===o(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var c=0,d=null;function v(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=h.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&p(e)})),u=l(e),s=u.detached,v=u.rendered;e.__resize_observer_triggered__=!1===s&&!1===v,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){p(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(c||(d=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=o(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=a("div",{className:"resize-triggers"}),r=a("div",{className:"resize-expand-trigger"}),i=a("div"),l=a("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(l),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:l},m(e),e.addEventListener("scroll",f,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=l(e).rendered,window.MutationObserver){var g=new MutationObserver(e.__resize_mutation_handler__);g.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=g}e.__resize_listeners__.push(t),c++}function h(){var e=l(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(m(this),this.addEventListener("scroll",f,!0)),this.__resize_rendered__=t,p(this))}function f(){var e,t,n=this;m(this),this.__resize_raf__&&(e=this.__resize_raf__,i||(i=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),i(e)),this.__resize_raf__=(t=function(){var e,t,r,i,a,o,l=(r=(t=(e=n).__resize_last__).width,i=t.height,a=e.offsetWidth,o=e.offsetHeight,a!==r||o!==i?{width:a,height:o}:null);l&&(n.__resize_last__=l,p(n))},r||(r=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),r(t))}function p(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function m(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,a=i.scrollWidth,o=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,s=n.scrollWidth,c=n.scrollHeight;i.scrollLeft=a,i.scrollTop=o,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=s,n.scrollTop=c}var g=u(2717),_=u(4061),y=u(6870),w=u(7162),b=u.n(w);function x(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create;var k=u(5537),E=u.n(k);const S=(0,n.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}}},emits:["selectItem","selectCondition","footerClick"],setup:function(e,t){var r=t.emit,i=(0,g.useLocale)("searchSelect"),a=(0,g.usePrefix)().resolveClassName,o=(0,n.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:i.value.ok},{id:"cancel",name:i.value.cancel,disabled:!1}]:e.footerBtns}));return{handleClick:function(e){r("selectItem",e)},handleClickCondition:function(e){r("selectCondition",e)},handleClickFooterBtn:function(e){r("footerClick",e)},filterList:(0,n.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var r;return(null===(r=t.value)||void 0===r?void 0:r.name)?[(0,n.createVNode)("span",{class:"menu-name"},[t.name,(0,n.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var r=e.keyword,i=r.length;if(!(null==r?void 0:r.trim().length)||!t.toLocaleLowerCase().includes(r.toLocaleLowerCase()))return t;var a=[],o=-1;return r=r.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(r),"igm"),(function(e,r){return 0===a.length&&0!==r?a.push(t.slice(0,r)):o>=0&&a.push(t.slice(o+e.length,r)),a.push((0,n.createVNode)("span",{class:"is-keyword"},[e])),o=r,e})),o>=0&&a.push(t.slice(o+i)),a.length?a:t}(t.name)},localFooterBtns:o,resolveClassName:a}},render:function(){var e,t,r,i=this;return(0,n.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,n.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,n.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&i.handleClickCondition(e)}},[e.name])}))]),(0,n.createVNode)("ul",{class:"menu-content"},[null===(t=this.list)||void 0===t?void 0:t.map((function(e){return(0,n.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(i.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&i.handleClick(e)}},[i.$slots.default?i.$slots.default({item:e,list:i.list,multiple:!!i.multiple,hoverId:i.hoverId,getSearchNode:i.getSearchNode}):(0,n.createVNode)(n.Fragment,null,[i.getSearchNode(e),i.multiple&&i.selected.includes(e.id)&&(0,n.createVNode)(y.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(r=this.localFooterBtns)||void 0===r?void 0:r.length)&&(0,n.createVNode)("div",{class:"menu-footer"},[this.localFooterBtns.map((function(e){return(0,n.createVNode)("span",{class:"menu-footer-btn ".concat(e.disabled?"is-disabled":""),key:e.id,onClick:function(){return!e.disabled&&i.handleClickFooterBtn(e)}},[e.name])}))])])}});function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var I;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(I||(I={}));var N,V=Symbol("SEARCH_SLECT_PROVIDER_KEY"),z=function(){return(0,n.inject)(V)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(N||(N={}));var O=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"|";L(this,e),this.searchItem=t,this.type=n,this.splitCode=r,this.values=[],this.id=t.id,this.name=t.name}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}}))),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&C(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const T=(0,n.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:_.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:N.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,r){var i=r.emit,a=r.expose,o=(0,g.useLocale)("searchSelect"),l=(0,g.usePrefix)().resolveClassName,u=(0,n.ref)(null),s=(0,n.ref)(null),c=(0,n.ref)(""),d=(0,n.ref)(!1),v=(0,n.ref)(!1),h=(0,n.ref)(!1),f=(0,n.ref)(t.defautUsingItem),p=(0,n.ref)(""),m=(0,n.ref)(!1),_=(0,e.debounce)(300,M),y=!1,w=(0,n.ref)([]),k=(0,n.ref)([]),E=z(),S=E.editKey,L=E.onValidate,C=E.valueSplitCode;function V(e){switch(e.code){case"ArrowDown":case"ArrowUp":T(e);break;case"Enter":case"NumpadEnter":!function(e){if(y){e.preventDefault();var t=k.value.find((function(e){return e.id===p.value}));t&&B(t)}}(e)}}function T(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=k.value.length,r=n,i=k.value.findIndex((function(e){return e.id===p.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var a=k.value[i];if(a&&!a.disabled){r=-1;var o=document.getElementById(a.id);return null==o||o.focus(),void(p.value=a.id)}r-=1}}function F(e){q(),e&&M()}function j(e){var n;return x(this,void 0,void 0,b().mark((function r(){var a,o,l,u,s;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e||e.preventDefault(),r.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(f.value){r.next=16;break}if(c.value&&t.valueBehavior!==I.NEEDKEY){r.next=6;break}return r.abrupt("return");case 6:return a={id:c.value,name:c.value},r.next=9,D(a);case 9:if(r.sent){r.next=12;break}return r.abrupt("return");case 12:return i("add",new O(a,"text",C.value)),c.value="",M(),r.abrupt("return");case 16:if(null==(o=f.value.values)?void 0:o.length){r.next=43;break}if(!(null===(n=c.value)||void 0===n?void 0:n.length)){r.next=41;break}if(!c.value.includes(C.value)){r.next=29;break}return l=c.value.split(C.value),r.next=23,D({id:c.value,name:c.value});case 23:if(r.sent){r.next=26;break}return r.abrupt("return");case 26:l.forEach((function(e){return f.value.addValue({id:e,name:e})})),r.next=36;break;case 29:return u={id:c.value,name:c.value},r.next=32,D(u);case 32:if(r.sent){r.next=35;break}return r.abrupt("return");case 35:f.value.addValue(u);case 36:return i("add",f.value),c.value="",f.value=null,q(!0),r.abrupt("return");case 41:return d.value=!0,r.abrupt("return");case 43:if(!c.value){r.next=56;break}return s={id:c.value,name:c.value},r.next=47,D(s);case 47:if(r.sent){r.next=50;break}return r.abrupt("return");case 50:return f.value.addValue(s),i("add",f.value),c.value="",f.value=null,q(!0),r.abrupt("return");case 56:return r.next=58,D();case 58:if(r.sent){r.next=61;break}return r.abrupt("return");case 61:K();case 62:case"end":return r.stop()}}),r)})))}function B(e,n){var r,i,a,o,l;return x(this,void 0,void 0,b().mark((function s(){var d,v;return b().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(console.info(e,"=========="),!(null===(r=e.value)||void 0===r?void 0:r.id)){s.next=9;break}if((t.valueBehavior!==I.NEEDKEY||!e.value)&&t.validateValues){s.next=9;break}return(d=new O(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n,C.value)).addValue(e.value),K(d),t.valueBehavior===I.NEEDKEY&&p.value&&q(!0),p.value="",s.abrupt("return");case 9:if(f.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){s.next=17;break}return f.value=new O(e,n,C.value),c.value="",(v="condition"===n)&&K(),h.value=v||!!f.value.children.length,q(t.valueBehavior===I.NEEDKEY&&!!p.value),s.abrupt("return");case 17:if("condition"!==(null===(o=f.value)||void 0===o?void 0:o.type)){s.next=21;break}return f.value=new O(e,n,C.value),K(),s.abrupt("return");case 21:return f.value.addValue(e),s.next=24,D(e);case 24:if(s.sent){s.next=27;break}return s.abrupt("return");case 27:f.value.multiple||K(),t.valueBehavior===I.NEEDKEY&&(null===(l=f.value)||void 0===l?void 0:l.multiple)&&q();case 29:case"end":return s.stop()}}),s)})))}function D(e){return x(this,void 0,void 0,b().mark((function n(){var r,i,a,o;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(f.value){n.next=4;break}return n.next=3,A(null,[e]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=f.value,i=r.searchItem,a=r.validate,o=r.values,!a||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,A(i,e?[e]:o);case 9:return L(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function A(e,n){var r;return x(this,void 0,void 0,b().mark((function i(){var a;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=t.validateValues)||void 0===r?void 0:r.call(t,null!=e?e:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(a=i.sent)&&!1!==a){i.next=6;break}return L(a||"校验错误"),i.abrupt("return",!1);case 6:return L(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function q(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&(0,n.nextTick)().then((function(){M()})),v.value=!0,h.value=!0,d.value=!1;var t=setTimeout((function(){if(u.value){u.value.focus();var e=window.getSelection();0===e.focusOffset&&(e.selectAllChildren(u.value),e.collapseToEnd())}window.clearTimeout(t)}),0);i("focus",v.value)}function M(){var n,r,i,a,o;return x(this,void 0,void 0,b().mark((function l(){var u,s;return b().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=f.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==f.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=f.value)||void 0===i?void 0:i.searchItem,c.value).catch((function(){return[]}));case 5:u=l.sent,m.value=!1,l.next=10;break;case 9:(null==f?void 0:f.value)?"condition"===f.value.type?u=t.conditions:(null===(o=f.value.values)||void 0===o?void 0:o.length)&&!f.value.multiple&&t.mode!==N.EDIT||(u=f.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(a=c.value)||void 0===a?void 0:a.length)?t.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;t.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())?(u.push(t),null===(n=t.children)||void 0===n||n.forEach((function(n){u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:c.value,name:c.value}}))):(null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())&&u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{value:{id:c.value,name:c.value}})))})):u=t.data.filter((function(e){return!e.isSelected})).slice();case 10:k.value=u,t.valueBehavior===I.NEEDKEY&&(s=u.find((function(e){return!e.disabled})))&&(!p.value||p.value&&!u.some((function(e){return e.id===p.value})))&&(p.value=s.id);case 12:case"end":return l.stop()}}),l)})))}function K(e){i("add",null!=e?e:f.value),f.value=null,c.value="",q(t.valueBehavior===I.NEEDKEY)}function H(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(R(e.slice(0,-1)),H()):"\n"!==e[0]&&"\r"!==e[0]||(R(e.slice(1)),H())}function R(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=f.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,n.watch)(S,(function(){t.mode===N.DEFAULT&&S.value&&(h.value=!1)})),(0,n.watchEffect)((function(){c.value||R()}),{flush:"pre"}),(0,n.watch)([k,h],(function(){var e;(null===(e=k.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&h.value?y||(t.valueBehavior===I.NEEDKEY?p.value=k.value.find((function(e){return!e.disabled})).id:p.value="",y=!0,document.addEventListener("keydown",V)):(document.removeEventListener("keydown",V),y=!1,t.valueBehavior!==I.NEEDKEY&&(p.value=""))})),a({handleInputFocus:F,isFocus:v}),{popoverRef:s,inputRef:u,keyword:c,loading:m,remoteMenuList:w,menuList:k,menuHoverId:p,isFocus:v,usingItem:f,showPopover:h,showNoSelectValueError:d,debounceSetMenuList:_,documentArrowEvent:T,handleClickOutside:function(e){var n,r;!(null===(n=s.value)||void 0===n?void 0:n.contains(e.target))&&(null===(r=t.clickOutside)||void 0===r?void 0:r.call(t,e.target,s.value))&&(h.value=!1,v.value=!1,i("focus",v.value))},handleInputFocus:F,handleInputChange:function(e){var t,n,r,i,a,o,l,s,d;H();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm,C.value).replace(/\s{2}/gm,""),u.value.innerText=v,q(),c.value=v.replace((null===(t=f.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),_();else if(!c.value&&v.length<((null===(r=null===(n=f.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var h=v.replace(" "," ").replace((null===(i=f.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(a=f.value)||void 0===a?void 0:a.keyInnerText)&&v.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&h&&(null===(o=f.value.values)||void 0===o?void 0:o.length))return c.value=h,console.info("outerText",h),void _();!h&&(null==v?void 0:v.length)||(f.value=null),c.value=h?v:"",_()}else(null===(s=null===(l=f.value)||void 0===l?void 0:l.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=f.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),q(),_())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===I.NEEDKEY&&k.value.some((function(e){return e.id===p.value})))return;j(e);break;case"Backspace":!function(){var e,r;if(!f.value&&!c.value)return i("delete"),void(0,n.nextTick)(M);if(null===(e=f.value)||void 0===e?void 0:e.values.length){if((null===(r=f.value)||void 0===r?void 0:r.multiple)||f.value.isInValueList(f.value.values[0])||t.mode===N.EDIT&&!c.value)return f.value.values.splice(-1,1),c.value="",void q()}else c.value||(f.value=null,c.value="",M());L("")}();default:d.value=!1}},handleSelectItem:B,handleSelectCondtionItem:function(e){B(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=f.value)||void 0===t?void 0:t.values.length))return;c.value="",j();break;case"cancel":f.value.values=[],h.value=!1}},resolveClassName:l,t:o}},render:function(){var e,t,r=this,i=this.usingItem||{},a=i.multiple,o=i.values,l=i.placeholder,u=i.inputInnerHtml,s=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==o?void 0:o.length)&&l,c=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),d=!this.usingItem&&this.showCondition,v=Object.assign({},this.$slots.menu?{default:function(e){var t,n;return null===(n=(t=r.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,n.createVNode)(E(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,n.withDirectives)((0,n.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":r.showInputBefore&&!(null===(e=r.keyword)||void 0===e?void 0:e.length),"input-after":s},contenteditable:!0,"data-placeholder":u||r.keyword?"":r.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:r.handleInputFocus,onInput:r.handleInputChange,onKeydown:r.handleInputKeyup},null),[[(0,n.resolveDirective)("clickoutside"),r.handleClickOutside]])},content:function(){var e;return r.loading?(0,n.createVNode)("div",null,[r.t.loading]):r.showNoSelectValueError?(0,n.createVNode)("div",null,[r.t.filterQueryMustHasValue]):(null===(e=r.menuList)||void 0===e?void 0:e.length)?(0,n.createVNode)("div",{ref:"popoverRef",class:r.resolveClassName("search-select-popover")},[(0,n.createVNode)(S,{list:r.menuList,keyword:r.keyword,multiple:!!a,hoverId:r.menuHoverId,selected:(null==o?void 0:o.map((function(e){return e.id})))||[],conditions:d?r.conditions:[],onSelectItem:r.handleSelectItem,onSelectCondition:r.handleSelectCondtionItem,onFooterClick:r.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),F=(0,n.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var r=t.emit,i=(0,n.ref)(null),a=z(),o=a.onEditClick,l=a.onEditEnter,u=a.onEditBlur,s=a.editKey,c=a.valueSplitCode;return{inputRef:i,editKey:s,copySeletedItem:function(e){var t=new O(e.searchItem,e.type,c.value);return t.values=e.values.slice(),t},handleDeleteSelected:function(e){r("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),o(t,n),setTimeout((function(){return i.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){l(e,t)},handleInputFocus:function(e){e||u()}}},render:function(){var e=this,t=function(t,r){return e.editKey==="".concat(t.id,"_").concat(r)?(0,n.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,n.createVNode)(T,{ref:"inputRef",key:e.editKey.toString(),mode:N.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,r)},onFocus:e.handleInputFocus},null)]):(0,n.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?r<e.overflowIndex:r>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(r)},[(0,n.createVNode)("span",{class:"selected-name",onClick:function(n){return e.handleEditSeleted(n,t,r)}},[t.inputInnerText]),(0,n.createVNode)(y.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(r)}},null)])};return(0,n.createVNode)(n.Fragment,null,[this.selectedList.map((function(r,i){return[e.overflowIndex>=0&&i===e.overflowIndex&&(0,n.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,n.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(r,i)]}))])}});var j={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,valueSplitCode:{type:String,default:"|"},uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:I.ALL,validator:function(e){return[I.ALL,I.NEEDKEY].includes(e)}}};const B=(0,n.defineComponent)({name:"SearchSelect",directives:{clickoutside:_.clickoutside},props:j,emits:["update:modelValue","search"],setup:function(t,r){var i,a=r.emit,o=(0,g.useLocale)("searchSelect"),l=(0,g.usePrefix)().resolveClassName,u=(0,n.computed)((function(){return void 0===t.conditions?[{id:"or",name:o.value.or},{id:"and",name:o.value.and}]:t.conditions})),s=(0,n.ref)(null),h=(0,n.ref)(null),p=(0,n.ref)(!1),m=(0,n.ref)([]),_=(0,n.ref)(-1),y=(0,e.debounce)(32,C),w=(0,n.ref)(""),b=(0,n.ref)(""),x=(0,n.computed)((function(){return t.valueSplitCode})),k=(0,n.shallowRef)([]);function E(e,t){w.value="".concat(e.id,"_").concat(t)}function S(e,t){var n=m.value.slice();n.splice(t,1,e),a("update:modelValue",n.map((function(e){return e.toValue()}))),w.value=""}function L(e){b.value=e||""}function C(){if(p.value||m.value.length<1)_.value=-1;else{for(var e=h.value.querySelector(".".concat(l("search-select-container"))),n=h.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,a=0,o=0;0===a&&i<=n-40&&o<=r.length-1;){var u=r[o];if(u.clientHeight>t.minHeight)return void(_.value=o);(i+=u?u.clientWidth+6:0)>=n-40&&(a=o),o+=1}a===r.length-1&&i<=n?_.value=-1:_.value=i>=n-40?a:a-1}}return(0,n.watch)((function(){return t.data}),(function(){var e;k.value=JSON.parse(JSON.stringify(t.data)),null===(e=k.value)||void 0===e||e.forEach((function(e){e.isSelected=t.uniqueSelect&&!!t.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,n.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return m.value=[],void(null===(n=k.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];e.forEach((function(e){var n,r=m.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(e))r.values=e.values||[],i.push(r);else{var a=t.data.find((function(t){return t.id===e.id})),o="default";a||(a=t.conditions.find((function(t){return t.id===e.id})))&&(o="condition"),a||(null===(n=e.values)||void 0===n?void 0:n.length)||(o="text");var l=new O(a||e,o,x.value);l.values=e.values||[],i.push(l)}})),m.value=i,null===(r=k.value)||void 0===r||r.forEach((function(e){e.isSelected=t.uniqueSelect&&!!i.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,n.onMounted)((function(){v(h.value.querySelector(".".concat(l("search-select-container"))),y)})),(0,n.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",f),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--c&&d&&d.parentNode.removeChild(d)}}(h.value.querySelector(".".concat(l("search-select-container"))),y)})),i={onEditClick:E,onEditEnter:S,onEditBlur:function(){w.value="",L("")},onValidate:L,editKey:w,valueSplitCode:x},(0,n.provide)(V,i),{inputRef:s,wrapRef:h,isFocus:p,copyData:k,selectedList:m,overflowIndex:_,validateStr:b,splitCode:x,onEditClick:E,onEditEnter:S,handleWrapClick:function(){w.value||s.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(_.value=-1),!1===e&&(null===(t=h.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),p.value=e},handleResize:C,handleClearAll:function(){m.value=[],_.value=-1,a("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=h.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=m.value.slice();t.push(e),L(""),a("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=m.value.slice();t.splice("number"==typeof e?e:m.value.length-1,1),L(""),a("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){a("search",e)},localConditions:u,resolveClassName:l,t:o}},render:function(){var e,r,i,a=this,o="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),l=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,u=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=a.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,n.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,n.createVNode)("div",{class:(e={},t(e,this.resolveClassName("search-select-container"),!0),t(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,n.createVNode)("div",{class:"search-prefix"},[null===(i=(r=this.$slots).prepend)||void 0===i?void 0:i.call(r)]),(0,n.createVNode)("div",{class:"search-container",style:{maxHeight:o}},[(0,n.createVNode)(F,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},u)),(0,n.createVNode)("div",{class:"search-container-input"},[(0,n.createVNode)(T,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:l,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},u))])]),(0,n.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,n.createVNode)(y.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,n.createVNode)(y.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,n.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,n.createVNode)(n.Fragment,null,[(0,n.createVNode)(y.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var D=(0,e.withInstall)(B);const A=D})(),s})()));
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../icon"),require("lodash"),require("../config-provider"),require("../directives"),require("../input"),require("../loading"),require("../popover"),require("../virtual-render"),require("../tag"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon","lodash","../config-provider","../directives","../input","../loading","../popover","../virtual-render","../tag"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("../icon"),require("lodash"),require("../config-provider"),require("../directives"),require("../input"),require("../loading"),require("../popover"),require("../virtual-render"),require("../tag")):t(e["../shared"],e.vue,e["../icon"],e.lodash,e["../config-provider"],e["../directives"],e["../input"],e["../loading"],e["../popover"],e["../virtual-render"],e["../tag"]);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(self,((e,t,r,o,n,l,a,i,u,s,c)=>(()=>{var d={7162:(e,t,r)=>{e.exports=r(5047)},5047:e=>{var t=function(e){"use strict";var t,r=Object.prototype,o=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},l=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function s(e,t,r,o){var n=t&&t.prototype instanceof g?t:g,l=Object.create(n.prototype),a=new O(o||[]);return l._invoke=function(e,t,r){var o=d;return function(n,l){if(o===p)throw new Error("Generator is already running");if(o===f){if("throw"===n)throw l;return j()}for(r.method=n,r.arg=l;;){var a=r.delegate;if(a){var i=N(a,r);if(i){if(i===h)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var u=c(e,t,r);if("normal"===u.type){if(o=r.done?f:v,u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=f,r.method="throw",r.arg=u.arg)}}}(e,r,a),l}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",v="suspendedYield",p="executing",f="completed",h={};function g(){}function y(){}function m(){}var b={};u(b,l,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(I([])));T&&T!==r&&o.call(T,l)&&(b=T);var x=m.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(n,l,a,i){var u=c(e[n],e,l);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"==typeof d&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,i)}),(function(e){r("throw",e,a,i)})):t.resolve(d).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,i)}))}i(u.arg)}var n;this._invoke=function(e,o){function l(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(l,l):l()}}function N(e,r){var o=e.iterator[r.method];if(o===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,N(e,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=c(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,h;var l=n.arg;return l?l.done?(r[e.resultName]=l.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(e){if(e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:j}}function j(){return{value:t,done:!0}}return y.prototype=m,u(x,"constructor",m),u(m,"constructor",y),y.displayName=u(m,i,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,i,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},S(P.prototype),u(P.prototype,a,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,o,n,l){void 0===l&&(l=Promise);var a=new P(s(t,r,o,n),l);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(x),u(x,i,"Generator"),u(x,l,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var o=t.pop();if(o in e)return r.value=o,r.done=!1,r}return r.done=!0,r}},e.values=I,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(V),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(o,n){return i.type="throw",i.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var l=this.tryEntries.length-1;l>=0;--l){var a=this.tryEntries[l],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var l=n;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var a=l?l.completion:{};return a.type=e,a.arg=t,l?(this.method="next",this.next=l.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),V(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;V(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:I(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=l},6870:e=>{"use strict";e.exports=r},8133:e=>{"use strict";e.exports=a},4870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=u},4212:t=>{"use strict";t.exports=e},7739:e=>{"use strict";e.exports=c},3511:e=>{"use strict";e.exports=s},467:e=>{"use strict";e.exports=o},748:e=>{"use strict";e.exports=t}},v={};function p(e){var t=v[e];if(void 0!==t)return t.exports;var r=v[e]={exports:{}};return d[e](r,r.exports,p),r.exports}p.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return p.d(t,{a:t}),t},p.d=(e,t)=>{for(var r in t)p.o(t,r)&&!p.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},p.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};return(()=>{"use strict";p.r(f),p.d(f,{BkOption:()=>d,BkOptionGroup:()=>g,BkSelect:()=>A,default:()=>R});var e=p(4212);function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var r=p(748),o=p(6870),n=p(7162),l=p.n(n);Object.create,Object.create;var a=Symbol("BkSelect"),i=Symbol("BkOptionGroup");function u(e){return{register:function(t,r){if(r){if(!e.value.has(t))return e.value.set(t,r);console.warn("repeat ".concat(t),r)}},unregister:function(t){e.value.delete(t)}}}function s(e,t){var o=this,n=function(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=e;return(0,r.customRef)((function(e,r){return{get:function(){return e(),n},set:function(e){clearTimeout(t),void 0===e||""===e?(n=e,r()):t=setTimeout((function(){n=e,r()}),o)}}}))}(""),a=(0,r.ref)(!1);return(0,r.watch)(n,(function(){return r=o,i=void 0,u=void 0,s=l().mark((function r(){return l().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,a.value=!0,r.next=4,e(n.value);case 4:a.value=!1,r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.error(r.t0);case 10:return r.prev=10,null==t||t(),r.finish(10);case 13:case"end":return r.stop()}}),r,null,[[0,7,10,13]])})),new(u||(u=Promise))((function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(o,n)}l((s=s.apply(r,i||[])).next())}));var r,i,u,s})),{searchKey:n,searchLoading:a}}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?String(e).trim().toLowerCase():e}const d=(0,r.defineComponent)({name:"Option",props:{value:{type:[String,Number,Object],require:!0},label:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(""),disabled:e.PropTypes.bool.def(!1)},setup:function(e){var t=(0,r.getCurrentInstance)().proxy,o=(0,r.reactive)({visible:!0}),n=(0,r.toRefs)(e),l=n.disabled,u=n.value,s=(0,r.inject)(a,null),c=(0,r.inject)(i,null),d=(0,r.computed)((function(){var e;return null===(e=null==s?void 0:s.selected)||void 0===e?void 0:e.some((function(e){return e.value===u.value}))})),v=(0,r.computed)((function(){return null==s?void 0:s.multiple})),p=(0,r.computed)((function(){return(null==s?void 0:s.activeOptionValue)===u.value})),f=(0,r.computed)((function(){return null==s?void 0:s.showSelectedIcon}));return(0,r.onBeforeMount)((function(){null==s||s.register(u.value,t),null==c||c.register(u.value,t)})),(0,r.onBeforeUnmount)((function(){null==s||s.unregister(u.value),null==c||c.unregister(u.value)})),Object.assign(Object.assign({},(0,r.toRefs)(o)),{selected:d,multiple:v,isHover:p,showSelectedIcon:f,handleOptionClick:function(){l.value||null==s||s.handleOptionSelected(t)},handleMouseEnter:function(){s.activeOptionValue=u.value}})},render:function(){var n,l,a,i=(0,e.classes)(t({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover},(0,e.resolveClassName)("select-option"),!0));return(0,r.withDirectives)((0,r.createVNode)("li",{class:i,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[null!==(a=null===(l=(n=this.$slots).default)||void 0===l?void 0:l.call(n))&&void 0!==a?a:(0,r.createVNode)("span",{class:(0,e.resolveClassName)("select-option-item"),title:String(this.label)},[this.label]),this.multiple&&this.selected&&this.showSelectedIcon&&(0,r.createVNode)(o.Done,{class:(0,e.resolveClassName)("select-selected-icon"),width:22,height:22},null)]),[[r.vShow,this.visible]])}});function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function h(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}(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.")}()}const g=(0,r.defineComponent)({name:"OptionGroup",props:{label:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1),collapsible:e.PropTypes.bool.def(!1),collapse:e.PropTypes.bool.def(!1)},setup:function(e,t){var o=t.emit,n=(0,r.getCurrentInstance)(),l=n.proxy,s=(0,r.inject)(a,null),c=(0,r.reactive)({groupCollapse:e.collapse,visible:!0}),d=(0,r.ref)(new Map),v=u(d),p=v.register,f=v.unregister,g=(0,r.computed)((function(){return"".concat(e.label," (").concat(h(d.value.values()).filter((function(e){return e.visible})).length,")")}));return(0,r.provide)(i,(0,r.reactive)(Object.assign(Object.assign({},(0,r.toRefs)(e)),{register:p,unregister:f,groupCollapse:(0,r.toRef)(c,"groupCollapse")}))),(0,r.onBeforeMount)((function(){null==s||s.registerGroup(n.uid,l)})),(0,r.onBeforeUnmount)((function(){null==s||s.unregisterGroup(n.uid)})),Object.assign(Object.assign({},(0,r.toRefs)(c)),{groupLabel:g,handleToggleCollapse:function(){e.collapsible&&!e.disabled&&(c.groupCollapse=!c.groupCollapse,o("update:collapse",c.groupCollapse))}})},render:function(){var n,l,a,i,u=(0,e.classes)((t(n={},(0,e.resolveClassName)("option-group"),!0),t(n,"collapsible",this.collapsible),t(n,"disabled",this.disabled),n)),s=(0,e.classes)((t(l={},(0,e.resolveClassName)("option-group-label"),!0),t(l,"collapsible",this.collapsible),l)),c=(0,e.classes)({"default-group-label-icon":!0,collapse:this.groupCollapse});return(0,r.withDirectives)((0,r.createVNode)("ul",{class:u},[(0,r.createVNode)("li",{class:s,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():(0,r.createVNode)("span",{class:"default-group-label"},[this.collapsible&&(0,r.createVNode)(o.AngleUpFill,{class:c},null),(0,r.createVNode)("span",{class:"default-group-label-title"},[this.groupLabel])])]),(0,r.withDirectives)((0,r.createVNode)("ul",{class:(0,e.resolveClassName)("option-group-content")},[null===(i=(a=this.$slots).default)||void 0===i?void 0:i.call(a)]),[[r.vShow,!this.groupCollapse]])]),[[r.vShow,this.visible]])}});function y(e){return y="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},y(e)}var m=p(467),b=p(2717),w=p(4061),T=p(8133),x=p.n(T),S=p(4870),P=p.n(S),N=p(5537),C=p.n(N),V=p(3511),O=p.n(V),I=p(7739),j=p.n(I);const L=(0,r.defineComponent)({name:"SelectTagInput",props:{selected:{type:Array,default:function(){return[]}},tagTheme:(0,e.TagThemeType)(),placeholder:e.PropTypes.string.def(""),filterable:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),modelValue:e.PropTypes.any,collapseTags:e.PropTypes.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup:function(e,t){var o=t.emit,n=(0,r.getCurrentInstance)().proxy,l=(0,r.inject)(a,null),i=(0,r.toRefs)(e),u=i.modelValue,s=i.collapseTags,c=i.selected,d=(0,r.ref)(u.value),v=(0,r.ref)(),p=(0,r.ref)(null);(0,r.watch)(u,(function(){d.value=u.value})),(0,r.watch)([c,s],(function(){f()}),{flush:"post"});var f=function(){s.value&&(p.value=null,setTimeout((function(){var e=function(e){var t=h(n.$el.querySelectorAll(".bk-tag"));return t}(),t=e.findIndex((function(t,r){return!!r&&e[r-1].offsetTop!==t.offsetTop}));p.value=t>0?t:null})))};return{select:l,overflowTagIndex:p,value:d,inputRef:v,handleRemoveTag:function(e){o("remove",e)},focus:function(){var e;null===(e=v.value)||void 0===e||e.focus()},handleInput:function(e){o("update:modelValue",e.target.value)},handleKeydown:function(e){"Enter"===e.code&&o("enter",e.target.value,e),o("keydown",e.target.value,e)}}},render:function(){var o,n,l,a,i,u,s,c,d,v,p=this,f=null===(l=null===(n=this.$slots)||void 0===n?void 0:n.prefix)||void 0===l?void 0:l.call(n),h=(0,e.classes)((t(o={},(0,e.resolveClassName)("select-tag"),!0),t(o,(0,e.resolveClassName)("select-tag--default"),!0),t(o,"is-disabled",this.disabled),t(o,"collapse-tag",this.collapseTags),t(o,"has-prefix",!!f&&(null==f?void 0:f.every((function(e){var t;return!!(null===(t=e.children)||void 0===t?void 0:t.length)})))),o)),g=(0,e.classes)(t({},(0,e.resolveClassName)("select-tag-wrapper"),!0)),y={display:this.selected.length&&!this.filterable?"none":""};return(0,r.createVNode)("div",{class:h},[null===(i=null===(a=this.$slots)||void 0===a?void 0:a.prefix)||void 0===i?void 0:i.call(a),(0,r.createVNode)("span",{class:g},[null!==(c=null===(s=(u=this.$slots).default)||void 0===s?void 0:s.call(u))&&void 0!==c?c:this.selected.map((function(e,t){var o;return(0,r.createVNode)(j(),{closable:!0,theme:p.tagTheme,style:{display:p.collapseTags&&p.overflowTagIndex&&t>=p.overflowTagIndex?"none":""},onClose:function(){return p.handleRemoveTag(e.value)}},{default:function(){return[null===(o=p.select)||void 0===o?void 0:o.handleGetLabelByValue(e.value)]}})})),!!this.overflowTagIndex&&this.collapseTags&&(0,r.createVNode)(j(),{class:(0,e.resolveClassName)("select-overflow-tag")},{default:function(){return[(0,r.createTextVNode)("+"),p.selected.length-p.overflowTagIndex]}}),(0,r.createVNode)("input",{class:(0,e.resolveClassName)("select-tag-input"),ref:"inputRef",type:"text",style:y,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),null===(v=null===(d=this.$slots)||void 0===d?void 0:d.suffix)||void 0===v?void 0:v.call(d)])}});function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}const k=(0,r.defineComponent)({name:"Select",directives:{clickoutside:w.clickoutside},props:{modelValue:e.PropTypes.any,multiple:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),size:e.PropTypes.size().def(e.SizeEnum.DEFAULT),clearable:e.PropTypes.bool.def(!0),loading:e.PropTypes.bool.def(!1),filterable:e.PropTypes.bool.def(!1),remoteMethod:e.PropTypes.func,scrollHeight:e.PropTypes.number.def(200),showSelectAll:e.PropTypes.bool.def(!1),popoverMinWidth:e.PropTypes.number.def(0),showOnInit:e.PropTypes.bool.def(!1),multipleMode:e.PropTypes.oneOf(["default","tag"]).def("default"),tagTheme:(0,e.TagThemeType)(),behavior:(0,e.InputBehaviorType)(),collapseTags:e.PropTypes.bool.def(!1),autoHeight:e.PropTypes.bool.def(!0),noDataText:e.PropTypes.string,noMatchText:e.PropTypes.string,loadingText:e.PropTypes.string,placeholder:e.PropTypes.string,searchPlaceholder:e.PropTypes.string,selectAllText:e.PropTypes.string,scrollLoading:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),popoverOptions:Object,customContent:e.PropTypes.bool.def(!1),list:e.PropTypes.array.def([]),idKey:e.PropTypes.string.def("value"),displayKey:e.PropTypes.string.def("label"),withValidate:e.PropTypes.bool.def(!0),showSelectedIcon:e.PropTypes.bool.def(!0),inputSearch:e.PropTypes.bool.def(!0),enableVirtualRender:e.PropTypes.bool.def(!1),allowEmptyValues:e.PropTypes.array.def([]),autoFocus:e.PropTypes.bool.def(!1),keepSearchValue:e.PropTypes.bool.def(!1),prefix:e.PropTypes.string},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup:function(t,o){var n=o.emit,l=(0,b.useLocale)("select"),i=(0,r.toRefs)(t),d=i.modelValue,v=i.disabled,p=i.filterable,f=i.multiple,g=i.remoteMethod,w=i.loading,T=i.popoverMinWidth,x=i.showOnInit,S=i.multipleMode,P=i.allowCreate,N=i.customContent,C=i.showSelectedIcon,V=i.inputSearch,O=i.enableVirtualRender,I=i.showSelectAll,j=i.scrollHeight,L=i.list,k=i.displayKey,A=i.idKey,R=i.collapseTags,M=i.autoHeight,H=i.popoverOptions,K=i.allowEmptyValues,q=i.autoFocus,D=i.keepSearchValue,$=(0,r.computed)((function(){return void 0===t.noDataText?l.value.noData:t.noDataText})),G=(0,r.computed)((function(){return void 0===t.noMatchText?l.value.noMatchedData:t.noMatchText})),_=(0,r.computed)((function(){return void 0===t.loadingText?l.value.loading:t.loadingText})),B=(0,r.computed)((function(){return void 0===t.placeholder?l.value.pleaseSelect:t.placeholder})),F=(0,r.computed)((function(){return void 0===t.searchPlaceholder?l.value.enterKeywords:t.searchPlaceholder})),U=(0,r.computed)((function(){return void 0===t.selectAllText?l.value.all:t.selectAllText})),z=(0,e.useFormItem)(),W=(0,r.ref)(),Y=(0,r.ref)(),J=(0,r.ref)(),Q=(0,r.ref)(),X=(0,r.ref)(),Z=(0,r.ref)(),ee=(0,r.ref)(),te=(0,r.ref)(new Map),re=(0,r.computed)((function(){return h(te.value.values())})),oe=(0,r.ref)(new Map),ne=(0,r.ref)([]),le=(0,r.computed)((function(){return ne.value.reduce((function(e,t){return e[t.value]=t.label,e}),{})})),ae=(0,r.ref)(),ie=(0,r.computed)((function(){return L.value.reduce((function(e,t){return e[t[A.value]]=t[k.value],e}),{})}));(0,r.watch)(d,(function(){var e;Je(),t.withValidate&&(null===(e=null==z?void 0:z.validate)||void 0===e||e.call(z,"change"))}),{deep:!0}),(0,r.watch)(ne,(function(){var e;null===(e=ee.value)||void 0===e||e.updatePopover(null,Te.value)}));var ue=(0,r.computed)((function(){return he.value?L.value:L.value.filter((function(e){var t;return null===(t=c(String(e[k.value])))||void 0===t?void 0:t.includes(c(Be.value))}))})),se=(0,r.computed)((function(){return v.value||w.value})),ce=(0,r.computed)((function(){return ne.value.map((function(e){var t,r;return(null===(r=null===(t=te.value)||void 0===t?void 0:t.get(e.value))||void 0===r?void 0:r.label)||e.label||ie.value[e.value]}))})),de=(0,r.computed)((function(){var e=re.value.reduce((function(e,t){return t.disabled||e.push(t.value),e}),[]);return e.length<=ne.value.length&&e.every((function(e){return ne.value.some((function(t){return t.value===e}))}))})),ve=(0,r.computed)((function(){return!!oe.value.size})),pe=(0,r.computed)((function(){return!re.value.length})),fe=(0,r.computed)((function(){return re.value.length&&re.value.every((function(e){return!e.visible}))})),he=(0,r.computed)((function(){return p.value&&"function"==typeof g.value})),ge=(0,r.computed)((function(){return!(Fe.value||pe.value||fe.value)||N.value})),ye=(0,r.computed)((function(){return f.value&&I.value&&(!Be.value||!p.value)})),me=(0,r.computed)((function(){return j.value-12-(ye.value?32:0)})),be=(0,r.computed)((function(){return Fe.value?_.value:pe.value?$.value:fe.value?G.value:""})),we=(0,r.computed)((function(){return M.value?R.value&&!He.value:R.value})),Te=(0,r.computed)((function(){return(0,m.merge)({theme:"light bk-select-popover",trigger:"manual",width:Me.value,arrow:!1,placement:"bottom-start",isShow:He.value,reference:X.value,offset:6,popoverDelay:0,renderType:e.RenderType.AUTO},H.value)})),xe=u(te),Se=xe.register,Pe=xe.unregister,Ne=u(oe),Ce=Ne.register,Ve=Ne.unregister,Oe=function(){var e=(0,r.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),Ie=Oe.isHover,je=Oe.setHover,Le=Oe.cancelHover,Ee=(0,r.ref)(!1),ke=function(){Ee.value||(Ee.value=!0,n("focus"))},Ae=function(){Ee.value&&(Ee.value=!1,n("blur"))},Re=function(t,o){var n=t.popoverMinWidth,l=null,a=(0,r.ref)("auto"),i=(0,r.ref)(!1),u=function(){var e;a.value=Math.max(null===(e=o.value)||void 0===e?void 0:e.offsetWidth,n)};return(0,r.onMounted)((function(){o.value&&(l=(0,e.observerResize)(o.value,u,60,!0)).start()})),(0,r.onBeforeUnmount)((function(){null==l||l.stop(),l=null})),{isPopoverShow:i,popperWidth:a,togglePopover:function(){i.value=!i.value},hidePopover:function(){i.value=!1},showPopover:function(){i.value=!0}}}({popoverMinWidth:T.value},Y),Me=Re.popperWidth,He=Re.isPopoverShow,Ke=Re.hidePopover,qe=Re.showPopover,De=Re.togglePopover;(0,r.watch)(He,(function(){n("toggle",He.value)}));var $e=(0,r.computed)((function(){return(p.value&&V.value||P.value)&&He.value}));(0,r.watch)(He,(function(e){e?setTimeout((function(){We(),Ge()}),10):D.value||(Be.value="")}));var Ge=function(){var e,t=ne.value[0],r=te.value.get(null==t?void 0:t.value);r&&!r.disabled&&r.visible?ae.value=null==t?void 0:t.value:ae.value=null===(e=re.value.find((function(e){return!e.disabled&&e.visible})))||void 0===e?void 0:e.value},_e=s(he.value?g.value:function(e){p.value&&re.value.forEach((function(t){var r;t.visible=null===(r=c(String(t.label)))||void 0===r?void 0:r.includes(c(e))}))},Ge),Be=_e.searchKey,Fe=_e.searchLoading,Ue=function(e){e!==d.value&&(n("update:modelValue",e,d.value),n("change",e,d.value))},ze=function(e){if(!se.value&&e){if(f.value){var t=ne.value.findIndex((function(t){return t.value===e.value}));t>-1?ne.value.splice(t,1):ne.value.push({value:e.value,label:e.label||e.value}),Ue(ne.value.map((function(e){return e.value})))}else ne.value=[{label:e.label||e.value,value:e.value}],Ue(e.value),Ke();We()}},We=function(){setTimeout((function(){var e,t,r;V.value||P.value?"tag"===S.value?null===(t=X.value)||void 0===t||t.focus():null===(r=W.value)||void 0===r||r.focus():null===(e=Q.value)||void 0===e||e.focus()}),0)},Ye=function(e){var t,r,o=e;if("object"===y(o)){var n,l=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,l=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw l}}}}(te.value.keys());try{for(l.s();!(n=l.n()).done;){var a=n.value;if((0,m.isEqual)(a,o)){o=a;break}}}catch(e){l.e(e)}finally{l.f()}}return(null===(r=null===(t=te.value)||void 0===t?void 0:t.get(o))||void 0===r?void 0:r.label)||le.value[o]||ie.value[o]||o},Je=function(){Array.isArray(d.value)?ne.value=h(d.value.map((function(e){return{value:e,label:Ye(e)}}))):void 0!==d.value||K.value.includes(d.value)?ne.value=[{value:d.value,label:Ye(d.value)}]:ne.value=[]};return(0,r.provide)(a,(0,r.reactive)({multiple:f,selected:ne,activeOptionValue:ae,showSelectedIcon:C,register:Se,unregister:Pe,registerGroup:Ce,unregisterGroup:Ve,handleOptionSelected:ze,handleGetLabelByValue:Ye})),(0,r.onMounted)((function(){Je(),setTimeout((function(){x.value&&qe(),q.value&&We()}))})),{selected:ne,isInput:$e,options:re,isDisabled:se,selectedLabel:ce,isPopoverShow:He,isHover:Ie,popperWidth:Me,inputRef:W,triggerRef:Y,contentRef:J,searchRef:Q,selectTagInputRef:X,virtualRenderRef:Z,popoverRef:ee,searchLoading:Fe,isOptionsEmpty:pe,isSearchEmpty:fe,isFocus:Ee,isShowSelectContent:ge,curContentText:be,isGroup:ve,searchKey:Be,isShowSelectAll:ye,virtualHeight:me,virtualList:ue,isCollapseTags:we,popoverConfig:Te,focusInput:We,setHover:je,cancelHover:Le,handleFocus:ke,handleBlur:Ae,handleTogglePopover:function(){se.value||(ke(),De())},handleClear:function(e){e.stopPropagation(),ne.value=[],Ue(f.value?[]:""),n("clear",f.value?[]:""),Ke()},hidePopover:Ke,showPopover:qe,handleToggleAll:function(){de.value?ne.value=[]:re.value.forEach((function(e){e.disabled||ne.value.find((function(t){return t.value===e.value}))||ne.value.push({value:e.value,label:e.label||e.value})})),Ue(ne.value.map((function(e){return e.value}))),We()},handleOptionSelected:ze,handleClickOutside:function(e){var t,r=e.event.target;(null===(t=Y.value)||void 0===t?void 0:t.contains(r))||Y.value===r||(Ke(),Ae())},handleScroll:function(e){var t=e.target;t.scrollTop+t.clientHeight===t.scrollHeight&&n("scroll-end")},handleDeleteTag:function(e){if(!se.value){var t=ne.value.findIndex((function(t){return t.value===e}));t>-1&&(ne.value.splice(t,1),Ue(ne.value.map((function(e){return e.value}))))}},handleInputChange:function(e){p.value&&(Be.value=e)},handleInputEnter:function(e,t){var r=String(e);!P.value||!r||p.value&&re.value.find((function(e){return c(String(e.label))===c(r)}))||te.value.get(r)||(t.stopPropagation(),f.value?(ne.value.push({value:r,label:r}),Ue(ne.value.map((function(e){return e.value})))):(ne.value=[{value:r,label:r}],Ue(r),Ke()),Be.value="")},handleKeydown:function(e){var t,r;if(He.value){var o=re.value.filter((function(e){return!e.disabled&&e.visible})),n=o.findIndex((function(e){return e.value===ae.value}));if(o.length&&-1!==n)switch(e.code){case"ArrowDown":e.preventDefault();var l=n>=o.length-1?0:n+1;ae.value=null===(t=o[l])||void 0===t?void 0:t.value;break;case"ArrowUp":e.preventDefault();var a=0===n?o.length-1:n-1;ae.value=null===(r=o[a])||void 0===r?void 0:r.value;break;case"Backspace":if(!f.value||!ne.value.length||Be.value.length||e.target===Q.value)return;ne.value.pop(),Ue(ne.value.map((function(e){return e.value})));break;case"Enter":var i=te.value.get(ae.value);ze(i)}}},handleSelectedAllOptionMouseEnter:function(){ae.value=""},handlePopoverShow:function(){setTimeout((function(){var e,t;O.value&&(null===(t=null===(e=Z.value)||void 0===e?void 0:e.reset)||void 0===t||t.call(e))}))},localLoadingText:_,localPlaceholder:B,localSearchPlaceholder:F,localSelectAllText:U}},render:function(){var n,l=this,a=(0,e.classes)((t(n={},(0,e.resolveClassName)("select"),!0),t(n,"popover-show",this.isPopoverShow),t(n,"is-disabled",this.isDisabled),t(n,"is-focus",this.isFocus),t(n,"is-filterable",this.filterable),t(n,this.size,!0),t(n,this.behavior,!0),n)),i=function(){return l.loading?(0,r.createVNode)(P(),{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):l.clearable&&l.isHover&&l.selected.length&&!l.isDisabled?(0,r.createVNode)(o.Close,{class:"clear-icon",onClick:l.handleClear},null):(0,r.createVNode)(o.AngleUp,{class:"angle-up"},null)};return(0,r.createVNode)("div",{class:a},[(0,r.createVNode)(C(),(0,r.mergeProps)(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:function(){return(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-trigger"),style:{height:l.autoHeight&&l.collapseTags?"32px":""},ref:"triggerRef",onClick:l.handleTogglePopover,onMouseenter:l.setHover,onMouseleave:l.cancelHover},[(null===(a=(n=l.$slots).trigger)||void 0===a?void 0:a.call(n,{selected:l.selected}))||("tag"===l.multipleMode?(0,r.createVNode)(L,{ref:"selectTagInputRef",modelValue:l.searchKey,"onUpdate:modelValue":function(e){return l.searchKey=e},selected:l.selected,tagTheme:l.tagTheme,placeholder:l.localPlaceholder,filterable:l.isInput,disabled:l.isDisabled,onRemove:l.handleDeleteTag,collapseTags:l.isCollapseTags,onEnter:l.handleInputEnter,onKeydown:function(e,t){return l.handleKeydown(t)}},{prefix:function(){var e,t;return"function"==typeof l.$slots.prefix?null===(t=(e=l.$slots).prefix)||void 0===t?void 0:t.call(e):l.prefix?(0,r.createVNode)("div",{class:"bk-select--prefix-area"},[(0,r.createVNode)("span",null,[l.prefix])]):""},default:l.$slots.tag&&function(){return l.$slots.tag({selected:l.selected})},suffix:function(){return i()}}):(0,r.createVNode)(x(),(0,r.mergeProps)({ref:"inputRef",type:"text",modelValue:l.isInput?l.searchKey:l.selectedLabel.join(","),placeholder:l.isInput&&l.selectedLabel.join(",")||l.localPlaceholder,readonly:!l.isInput,selectReadonly:!0,disabled:l.isDisabled,behavior:l.behavior,size:l.size,withValidate:!1,onInput:l.handleInputChange,onEnter:l.handleInputEnter,onKeydown:function(e,t){return l.handleKeydown(t)}},l.prefix?{prefix:l.prefix}:null),"function"==typeof(o=t=Object.assign(Object.assign({},"function"==typeof l.$slots.prefix?{prefix:function(){var e,t;return null===(t=(e=l.$slots).prefix)||void 0===t?void 0:t.call(e)}}:null),{suffix:function(){return i()}}))||"[object Object]"===Object.prototype.toString.call(o)&&!(0,r.isVNode)(o)?t:{default:function(){return[t]}}))]);var t,o,n,a},content:function(){return(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-content-wrapper"),ref:"contentRef"},[l.filterable&&!l.inputSearch&&(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-search-wrapper")},[(0,r.createVNode)(o.Search,{class:"icon-search",width:16,height:16},null),(0,r.withDirectives)((0,r.createVNode)("input",{ref:"searchRef",class:(0,e.resolveClassName)("select-search-input"),placeholder:l.localSearchPlaceholder,"onUpdate:modelValue":function(e){return l.searchKey=e}},null),[[r.vModelText,l.searchKey]])]),!l.isShowSelectContent&&(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-empty")},[l.searchLoading&&(0,r.createVNode)(P(),{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,r.createVNode)("span",null,[l.curContentText])]),(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-content")},[(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-dropdown"),style:{maxHeight:"".concat(l.scrollHeight,"px")},onScroll:l.handleScroll},[(0,r.withDirectives)((0,r.createVNode)("ul",{class:(0,e.resolveClassName)("select-options")},[l.isShowSelectAll&&(0,r.createVNode)("li",{class:(0,e.resolveClassName)("select-option"),onMouseenter:l.handleSelectedAllOptionMouseEnter,onClick:l.handleToggleAll},[l.localSelectAllText]),l.enableVirtualRender?(0,r.createVNode)(O(),{list:l.virtualList,height:l.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:function(e){return e.data.map((function(e){return(0,r.createVNode)(d,{key:e[l.idKey],value:e[l.idKey],label:e[l.displayKey]},null)}))}}):l.list.map((function(e){return(0,r.createVNode)(d,{value:e[l.idKey],label:e[l.displayKey]},null)})),null===(n=(t=l.$slots).default)||void 0===n?void 0:n.call(t),l.scrollLoading&&(0,r.createVNode)("li",{class:(0,e.resolveClassName)("select-options-loading")},[(0,r.createVNode)(P(),{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,r.createVNode)("span",null,[l.localLoadingText])])]),[[r.vShow,l.isShowSelectContent]])]),l.$slots.extension&&(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-extension")},[l.$slots.extension()])])]);var t,n}})])}});var A=(0,e.withInstallProps)(k,{Option:d,Group:g});const R=A})(),f})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../icon"),require("lodash"),require("../config-provider"),require("../directives"),require("../input"),require("../loading"),require("../popover"),require("../virtual-render"),require("../tag"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon","lodash","../config-provider","../directives","../input","../loading","../popover","../virtual-render","../tag"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("../icon"),require("lodash"),require("../config-provider"),require("../directives"),require("../input"),require("../loading"),require("../popover"),require("../virtual-render"),require("../tag")):t(e["../shared"],e.vue,e["../icon"],e.lodash,e["../config-provider"],e["../directives"],e["../input"],e["../loading"],e["../popover"],e["../virtual-render"],e["../tag"]);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(self,((e,t,r,o,n,l,a,i,u,s,c)=>(()=>{var d={7162:(e,t,r)=>{e.exports=r(5047)},5047:e=>{var t=function(e){"use strict";var t,r=Object.prototype,o=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},l=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function s(e,t,r,o){var n=t&&t.prototype instanceof g?t:g,l=Object.create(n.prototype),a=new O(o||[]);return l._invoke=function(e,t,r){var o=d;return function(n,l){if(o===p)throw new Error("Generator is already running");if(o===f){if("throw"===n)throw l;return j()}for(r.method=n,r.arg=l;;){var a=r.delegate;if(a){var i=N(a,r);if(i){if(i===h)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var u=c(e,t,r);if("normal"===u.type){if(o=r.done?f:v,u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=f,r.method="throw",r.arg=u.arg)}}}(e,r,a),l}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",v="suspendedYield",p="executing",f="completed",h={};function g(){}function y(){}function m(){}var b={};u(b,l,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(I([])));T&&T!==r&&o.call(T,l)&&(b=T);var x=m.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(n,l,a,i){var u=c(e[n],e,l);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"==typeof d&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,i)}),(function(e){r("throw",e,a,i)})):t.resolve(d).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,i)}))}i(u.arg)}var n;this._invoke=function(e,o){function l(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(l,l):l()}}function N(e,r){var o=e.iterator[r.method];if(o===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,N(e,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=c(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,h;var l=n.arg;return l?l.done?(r[e.resultName]=l.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(e){if(e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:j}}function j(){return{value:t,done:!0}}return y.prototype=m,u(x,"constructor",m),u(m,"constructor",y),y.displayName=u(m,i,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,i,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},S(P.prototype),u(P.prototype,a,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,o,n,l){void 0===l&&(l=Promise);var a=new P(s(t,r,o,n),l);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(x),u(x,i,"Generator"),u(x,l,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var o=t.pop();if(o in e)return r.value=o,r.done=!1,r}return r.done=!0,r}},e.values=I,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(V),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(o,n){return i.type="throw",i.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var l=this.tryEntries.length-1;l>=0;--l){var a=this.tryEntries[l],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var l=n;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var a=l?l.completion:{};return a.type=e,a.arg=t,l?(this.method="next",this.next=l.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),V(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;V(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:I(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=l},6870:e=>{"use strict";e.exports=r},8133:e=>{"use strict";e.exports=a},4870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=u},4212:t=>{"use strict";t.exports=e},7739:e=>{"use strict";e.exports=c},3511:e=>{"use strict";e.exports=s},467:e=>{"use strict";e.exports=o},748:e=>{"use strict";e.exports=t}},v={};function p(e){var t=v[e];if(void 0!==t)return t.exports;var r=v[e]={exports:{}};return d[e](r,r.exports,p),r.exports}p.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return p.d(t,{a:t}),t},p.d=(e,t)=>{for(var r in t)p.o(t,r)&&!p.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},p.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};return(()=>{"use strict";p.r(f),p.d(f,{BkOption:()=>d,BkOptionGroup:()=>g,BkSelect:()=>A,default:()=>R});var e=p(4212);function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var r=p(748),o=p(6870),n=p(7162),l=p.n(n);Object.create,Object.create;var a=Symbol("BkSelect"),i=Symbol("BkOptionGroup");function u(e){return{register:function(t,r){if(r){if(!e.value.has(t))return e.value.set(t,r);console.warn("repeat ".concat(t),r)}},unregister:function(t){e.value.delete(t)}}}function s(e,t){var o=this,n=function(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=e;return(0,r.customRef)((function(e,r){return{get:function(){return e(),n},set:function(e){clearTimeout(t),void 0===e||""===e?(n=e,r()):t=setTimeout((function(){n=e,r()}),o)}}}))}(""),a=(0,r.ref)(!1);return(0,r.watch)(n,(function(){return r=o,i=void 0,u=void 0,s=l().mark((function r(){return l().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,a.value=!0,r.next=4,e(n.value);case 4:a.value=!1,r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.error(r.t0);case 10:return r.prev=10,null==t||t(),r.finish(10);case 13:case"end":return r.stop()}}),r,null,[[0,7,10,13]])})),new(u||(u=Promise))((function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(o,n)}l((s=s.apply(r,i||[])).next())}));var r,i,u,s})),{searchKey:n,searchLoading:a}}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?String(e).trim().toLowerCase():e}const d=(0,r.defineComponent)({name:"Option",props:{value:{type:[String,Number,Object],require:!0},label:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(""),disabled:e.PropTypes.bool.def(!1)},setup:function(e){var t=(0,r.getCurrentInstance)().proxy,o=(0,r.reactive)({visible:!0}),n=(0,r.toRefs)(e),l=n.disabled,u=n.value,s=(0,r.inject)(a,null),c=(0,r.inject)(i,null),d=(0,r.computed)((function(){var e;return null===(e=null==s?void 0:s.selected)||void 0===e?void 0:e.some((function(e){return e.value===u.value}))})),v=(0,r.computed)((function(){return null==s?void 0:s.multiple})),p=(0,r.computed)((function(){return(null==s?void 0:s.activeOptionValue)===u.value})),f=(0,r.computed)((function(){return null==s?void 0:s.showSelectedIcon}));return(0,r.onBeforeMount)((function(){null==s||s.register(u.value,t),null==c||c.register(u.value,t)})),(0,r.onBeforeUnmount)((function(){null==s||s.unregister(u.value),null==c||c.unregister(u.value)})),Object.assign(Object.assign({},(0,r.toRefs)(o)),{selected:d,multiple:v,isHover:p,showSelectedIcon:f,handleOptionClick:function(){l.value||null==s||s.handleOptionSelected(t)},handleMouseEnter:function(){s.activeOptionValue=u.value}})},render:function(){var n,l,a,i=(0,e.classes)(t({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover},(0,e.resolveClassName)("select-option"),!0));return(0,r.withDirectives)((0,r.createVNode)("li",{class:i,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[null!==(a=null===(l=(n=this.$slots).default)||void 0===l?void 0:l.call(n))&&void 0!==a?a:(0,r.createVNode)("span",{class:(0,e.resolveClassName)("select-option-item"),title:String(this.label)},[this.label]),this.multiple&&this.selected&&this.showSelectedIcon&&(0,r.createVNode)(o.Done,{class:(0,e.resolveClassName)("select-selected-icon"),width:22,height:22},null)]),[[r.vShow,this.visible]])}});function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function h(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(e,t):void 0}}(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.")}()}const g=(0,r.defineComponent)({name:"OptionGroup",props:{label:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1),collapsible:e.PropTypes.bool.def(!1),collapse:e.PropTypes.bool.def(!1)},setup:function(e,t){var o=t.emit,n=(0,r.getCurrentInstance)(),l=n.proxy,s=(0,r.inject)(a,null),c=(0,r.reactive)({groupCollapse:e.collapse,visible:!0}),d=(0,r.ref)(new Map),v=u(d),p=v.register,f=v.unregister,g=(0,r.computed)((function(){return"".concat(e.label," (").concat(h(d.value.values()).filter((function(e){return e.visible})).length,")")}));return(0,r.provide)(i,(0,r.reactive)(Object.assign(Object.assign({},(0,r.toRefs)(e)),{register:p,unregister:f,groupCollapse:(0,r.toRef)(c,"groupCollapse")}))),(0,r.onBeforeMount)((function(){null==s||s.registerGroup(n.uid,l)})),(0,r.onBeforeUnmount)((function(){null==s||s.unregisterGroup(n.uid)})),Object.assign(Object.assign({},(0,r.toRefs)(c)),{groupLabel:g,handleToggleCollapse:function(){e.collapsible&&!e.disabled&&(c.groupCollapse=!c.groupCollapse,o("update:collapse",c.groupCollapse))}})},render:function(){var n,l,a,i,u=(0,e.classes)((t(n={},(0,e.resolveClassName)("option-group"),!0),t(n,"collapsible",this.collapsible),t(n,"disabled",this.disabled),n)),s=(0,e.classes)((t(l={},(0,e.resolveClassName)("option-group-label"),!0),t(l,"collapsible",this.collapsible),l)),c=(0,e.classes)({"default-group-label-icon":!0,collapse:this.groupCollapse});return(0,r.withDirectives)((0,r.createVNode)("ul",{class:u},[(0,r.createVNode)("li",{class:s,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():(0,r.createVNode)("span",{class:"default-group-label"},[this.collapsible&&(0,r.createVNode)(o.AngleUpFill,{class:c},null),(0,r.createVNode)("span",{class:"default-group-label-title"},[this.groupLabel])])]),(0,r.withDirectives)((0,r.createVNode)("ul",{class:(0,e.resolveClassName)("option-group-content")},[null===(i=(a=this.$slots).default)||void 0===i?void 0:i.call(a)]),[[r.vShow,!this.groupCollapse]])]),[[r.vShow,this.visible]])}});function y(e){return y="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},y(e)}var m=p(467),b=p(2717),w=p(4061),T=p(8133),x=p.n(T),S=p(4870),P=p.n(S),N=p(5537),C=p.n(N),V=p(3511),O=p.n(V),I=p(7739),j=p.n(I);const L=(0,r.defineComponent)({name:"SelectTagInput",props:{selected:{type:Array,default:function(){return[]}},tagTheme:(0,e.TagThemeType)(),placeholder:e.PropTypes.string.def(""),filterable:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),modelValue:e.PropTypes.any,collapseTags:e.PropTypes.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup:function(e,t){var o=t.emit,n=(0,r.getCurrentInstance)().proxy,l=(0,r.inject)(a,null),i=(0,r.toRefs)(e),u=i.modelValue,s=i.collapseTags,c=i.selected,d=(0,r.ref)(u.value),v=(0,r.ref)(),p=(0,r.ref)(null);(0,r.watch)(u,(function(){d.value=u.value})),(0,r.watch)([c,s],(function(){f()}),{flush:"post"});var f=function(){s.value&&(p.value=null,setTimeout((function(){var e=function(e){var t=h(n.$el.querySelectorAll(".bk-tag"));return t}(),t=e.findIndex((function(t,r){return!!r&&e[r-1].offsetTop!==t.offsetTop}));p.value=t>0?t:null})))};return{select:l,overflowTagIndex:p,value:d,inputRef:v,handleRemoveTag:function(e){o("remove",e)},focus:function(){var e;null===(e=v.value)||void 0===e||e.focus()},handleInput:function(e){o("update:modelValue",e.target.value)},handleKeydown:function(e){"Enter"===e.code&&o("enter",e.target.value,e),o("keydown",e.target.value,e)}}},render:function(){var o,n,l,a,i,u,s,c,d,v,p=this,f=null===(l=null===(n=this.$slots)||void 0===n?void 0:n.prefix)||void 0===l?void 0:l.call(n),h=(0,e.classes)((t(o={},(0,e.resolveClassName)("select-tag"),!0),t(o,(0,e.resolveClassName)("select-tag--default"),!0),t(o,"is-disabled",this.disabled),t(o,"collapse-tag",this.collapseTags),t(o,"has-prefix",!!f),o)),g=(0,e.classes)(t({},(0,e.resolveClassName)("select-tag-wrapper"),!0)),y={display:this.selected.length&&!this.filterable?"none":""};return(0,r.createVNode)("div",{class:h},[null===(i=null===(a=this.$slots)||void 0===a?void 0:a.prefix)||void 0===i?void 0:i.call(a),(0,r.createVNode)("span",{class:g},[null!==(c=null===(s=(u=this.$slots).default)||void 0===s?void 0:s.call(u))&&void 0!==c?c:this.selected.map((function(e,t){var o;return(0,r.createVNode)(j(),{closable:!0,theme:p.tagTheme,style:{display:p.collapseTags&&p.overflowTagIndex&&t>=p.overflowTagIndex?"none":""},onClose:function(){return p.handleRemoveTag(e.value)}},{default:function(){return[null===(o=p.select)||void 0===o?void 0:o.handleGetLabelByValue(e.value)]}})})),!!this.overflowTagIndex&&this.collapseTags&&(0,r.createVNode)(j(),{class:(0,e.resolveClassName)("select-overflow-tag")},{default:function(){return[(0,r.createTextVNode)("+"),p.selected.length-p.overflowTagIndex]}}),(0,r.createVNode)("input",{class:(0,e.resolveClassName)("select-tag-input"),ref:"inputRef",type:"text",style:y,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),null===(v=null===(d=this.$slots)||void 0===d?void 0:d.suffix)||void 0===v?void 0:v.call(d)])}});function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}const k=(0,r.defineComponent)({name:"Select",directives:{clickoutside:w.clickoutside},props:{modelValue:e.PropTypes.any,multiple:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),size:e.PropTypes.size().def(e.SizeEnum.DEFAULT),clearable:e.PropTypes.bool.def(!0),loading:e.PropTypes.bool.def(!1),filterable:e.PropTypes.bool.def(!1),remoteMethod:e.PropTypes.func,scrollHeight:e.PropTypes.number.def(200),showSelectAll:e.PropTypes.bool.def(!1),popoverMinWidth:e.PropTypes.number.def(0),showOnInit:e.PropTypes.bool.def(!1),multipleMode:e.PropTypes.oneOf(["default","tag"]).def("default"),tagTheme:(0,e.TagThemeType)(),behavior:(0,e.InputBehaviorType)(),collapseTags:e.PropTypes.bool.def(!1),autoHeight:e.PropTypes.bool.def(!0),noDataText:e.PropTypes.string,noMatchText:e.PropTypes.string,loadingText:e.PropTypes.string,placeholder:e.PropTypes.string,searchPlaceholder:e.PropTypes.string,selectAllText:e.PropTypes.string,scrollLoading:e.PropTypes.bool.def(!1),allowCreate:e.PropTypes.bool.def(!1),popoverOptions:Object,customContent:e.PropTypes.bool.def(!1),list:e.PropTypes.array.def([]),idKey:e.PropTypes.string.def("value"),displayKey:e.PropTypes.string.def("label"),withValidate:e.PropTypes.bool.def(!0),showSelectedIcon:e.PropTypes.bool.def(!0),inputSearch:e.PropTypes.bool.def(!0),enableVirtualRender:e.PropTypes.bool.def(!1),allowEmptyValues:e.PropTypes.array.def([]),autoFocus:e.PropTypes.bool.def(!1),keepSearchValue:e.PropTypes.bool.def(!1),prefix:e.PropTypes.string},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup:function(t,o){var n=o.emit,l=(0,b.useLocale)("select"),i=(0,r.toRefs)(t),d=i.modelValue,v=i.disabled,p=i.filterable,f=i.multiple,g=i.remoteMethod,w=i.loading,T=i.popoverMinWidth,x=i.showOnInit,S=i.multipleMode,P=i.allowCreate,N=i.customContent,C=i.showSelectedIcon,V=i.inputSearch,O=i.enableVirtualRender,I=i.showSelectAll,j=i.scrollHeight,L=i.list,k=i.displayKey,A=i.idKey,R=i.collapseTags,M=i.autoHeight,H=i.popoverOptions,K=i.allowEmptyValues,q=i.autoFocus,D=i.keepSearchValue,$=(0,r.computed)((function(){return void 0===t.noDataText?l.value.noData:t.noDataText})),G=(0,r.computed)((function(){return void 0===t.noMatchText?l.value.noMatchedData:t.noMatchText})),_=(0,r.computed)((function(){return void 0===t.loadingText?l.value.loading:t.loadingText})),B=(0,r.computed)((function(){return void 0===t.placeholder?l.value.pleaseSelect:t.placeholder})),F=(0,r.computed)((function(){return void 0===t.searchPlaceholder?l.value.enterKeywords:t.searchPlaceholder})),U=(0,r.computed)((function(){return void 0===t.selectAllText?l.value.all:t.selectAllText})),z=(0,e.useFormItem)(),W=(0,r.ref)(),Y=(0,r.ref)(),J=(0,r.ref)(),Q=(0,r.ref)(),X=(0,r.ref)(),Z=(0,r.ref)(),ee=(0,r.ref)(),te=(0,r.ref)(new Map),re=(0,r.computed)((function(){return h(te.value.values())})),oe=(0,r.ref)(new Map),ne=(0,r.ref)([]),le=(0,r.computed)((function(){return ne.value.reduce((function(e,t){return e[t.value]=t.label,e}),{})})),ae=(0,r.ref)(),ie=(0,r.computed)((function(){return L.value.reduce((function(e,t){return e[t[A.value]]=t[k.value],e}),{})}));(0,r.watch)(d,(function(){var e;Je(),t.withValidate&&(null===(e=null==z?void 0:z.validate)||void 0===e||e.call(z,"change"))}),{deep:!0}),(0,r.watch)(ne,(function(){var e;null===(e=ee.value)||void 0===e||e.updatePopover(null,Te.value)}));var ue=(0,r.computed)((function(){return he.value?L.value:L.value.filter((function(e){var t;return null===(t=c(String(e[k.value])))||void 0===t?void 0:t.includes(c(Be.value))}))})),se=(0,r.computed)((function(){return v.value||w.value})),ce=(0,r.computed)((function(){return ne.value.map((function(e){var t,r;return(null===(r=null===(t=te.value)||void 0===t?void 0:t.get(e.value))||void 0===r?void 0:r.label)||ie.value[e.value]||e.label}))})),de=(0,r.computed)((function(){var e=re.value.reduce((function(e,t){return t.disabled||e.push(t.value),e}),[]);return e.length<=ne.value.length&&e.every((function(e){return ne.value.some((function(t){return t.value===e}))}))})),ve=(0,r.computed)((function(){return!!oe.value.size})),pe=(0,r.computed)((function(){return!re.value.length})),fe=(0,r.computed)((function(){return re.value.length&&re.value.every((function(e){return!e.visible}))})),he=(0,r.computed)((function(){return p.value&&"function"==typeof g.value})),ge=(0,r.computed)((function(){return!(Fe.value||pe.value||fe.value)||N.value})),ye=(0,r.computed)((function(){return f.value&&I.value&&(!Be.value||!p.value)})),me=(0,r.computed)((function(){return j.value-12-(ye.value?32:0)})),be=(0,r.computed)((function(){return Fe.value?_.value:pe.value?$.value:fe.value?G.value:""})),we=(0,r.computed)((function(){return M.value?R.value&&!He.value:R.value})),Te=(0,r.computed)((function(){return(0,m.merge)({theme:"light bk-select-popover",trigger:"manual",width:Me.value,arrow:!1,placement:"bottom-start",isShow:He.value,reference:X.value,offset:6,popoverDelay:0,renderType:e.RenderType.AUTO},H.value)})),xe=u(te),Se=xe.register,Pe=xe.unregister,Ne=u(oe),Ce=Ne.register,Ve=Ne.unregister,Oe=function(){var e=(0,r.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),Ie=Oe.isHover,je=Oe.setHover,Le=Oe.cancelHover,Ee=(0,r.ref)(!1),ke=function(){Ee.value||(Ee.value=!0,n("focus"))},Ae=function(){Ee.value&&(Ee.value=!1,n("blur"))},Re=function(t,o){var n=t.popoverMinWidth,l=null,a=(0,r.ref)("auto"),i=(0,r.ref)(!1),u=function(){var e;a.value=Math.max(null===(e=o.value)||void 0===e?void 0:e.offsetWidth,n)};return(0,r.onMounted)((function(){o.value&&(l=(0,e.observerResize)(o.value,u,60,!0)).start()})),(0,r.onBeforeUnmount)((function(){null==l||l.stop(),l=null})),{isPopoverShow:i,popperWidth:a,togglePopover:function(){i.value=!i.value},hidePopover:function(){i.value=!1},showPopover:function(){i.value=!0}}}({popoverMinWidth:T.value},Y),Me=Re.popperWidth,He=Re.isPopoverShow,Ke=Re.hidePopover,qe=Re.showPopover,De=Re.togglePopover;(0,r.watch)(He,(function(){n("toggle",He.value)}));var $e=(0,r.computed)((function(){return(p.value&&V.value||P.value)&&He.value}));(0,r.watch)(He,(function(e){e?setTimeout((function(){We(),Ge()}),10):D.value||(Be.value="")}));var Ge=function(){var e,t=ne.value[0],r=te.value.get(null==t?void 0:t.value);r&&!r.disabled&&r.visible?ae.value=null==t?void 0:t.value:ae.value=null===(e=re.value.find((function(e){return!e.disabled&&e.visible})))||void 0===e?void 0:e.value},_e=s(he.value?g.value:function(e){p.value&&re.value.forEach((function(t){var r;t.visible=null===(r=c(String(t.label)))||void 0===r?void 0:r.includes(c(e))}))},Ge),Be=_e.searchKey,Fe=_e.searchLoading,Ue=function(e){e!==d.value&&(n("update:modelValue",e,d.value),n("change",e,d.value))},ze=function(e){if(!se.value&&e){if(f.value){var t=ne.value.findIndex((function(t){return t.value===e.value}));t>-1?ne.value.splice(t,1):ne.value.push({value:e.value,label:e.label||e.value}),Ue(ne.value.map((function(e){return e.value})))}else ne.value=[{label:e.label||e.value,value:e.value}],Ue(e.value),Ke();We()}},We=function(){setTimeout((function(){var e,t,r;V.value||P.value?"tag"===S.value?null===(t=X.value)||void 0===t||t.focus():null===(r=W.value)||void 0===r||r.focus():null===(e=Q.value)||void 0===e||e.focus()}),0)},Ye=function(e){var t,r,o=e;if("object"===y(o)){var n,l=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,l=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw l}}}}(te.value.keys());try{for(l.s();!(n=l.n()).done;){var a=n.value;if((0,m.isEqual)(a,o)){o=a;break}}}catch(e){l.e(e)}finally{l.f()}}return(null===(r=null===(t=te.value)||void 0===t?void 0:t.get(o))||void 0===r?void 0:r.label)||ie.value[o]||le.value[o]||o},Je=function(){Array.isArray(d.value)?ne.value=h(d.value.map((function(e){return{value:e,label:Ye(e)}}))):void 0!==d.value||K.value.includes(d.value)?ne.value=[{value:d.value,label:Ye(d.value)}]:ne.value=[]};return(0,r.provide)(a,(0,r.reactive)({multiple:f,selected:ne,activeOptionValue:ae,showSelectedIcon:C,register:Se,unregister:Pe,registerGroup:Ce,unregisterGroup:Ve,handleOptionSelected:ze,handleGetLabelByValue:Ye})),(0,r.onMounted)((function(){Je(),setTimeout((function(){x.value&&qe(),q.value&&We()}))})),{selected:ne,isInput:$e,options:re,isDisabled:se,selectedLabel:ce,isPopoverShow:He,isHover:Ie,popperWidth:Me,inputRef:W,triggerRef:Y,contentRef:J,searchRef:Q,selectTagInputRef:X,virtualRenderRef:Z,popoverRef:ee,searchLoading:Fe,isOptionsEmpty:pe,isSearchEmpty:fe,isFocus:Ee,isShowSelectContent:ge,curContentText:be,isGroup:ve,searchKey:Be,isShowSelectAll:ye,virtualHeight:me,virtualList:ue,isCollapseTags:we,popoverConfig:Te,focusInput:We,setHover:je,cancelHover:Le,handleFocus:ke,handleBlur:Ae,handleTogglePopover:function(){se.value||(ke(),De())},handleClear:function(e){e.stopPropagation(),ne.value=[],Ue(f.value?[]:""),n("clear",f.value?[]:""),Ke()},hidePopover:Ke,showPopover:qe,handleToggleAll:function(){de.value?ne.value=[]:re.value.forEach((function(e){e.disabled||ne.value.find((function(t){return t.value===e.value}))||ne.value.push({value:e.value,label:e.label||e.value})})),Ue(ne.value.map((function(e){return e.value}))),We()},handleOptionSelected:ze,handleClickOutside:function(e){var t,r=e.event.target;(null===(t=Y.value)||void 0===t?void 0:t.contains(r))||Y.value===r||(Ke(),Ae())},handleScroll:function(e){var t=e.target;t.scrollTop+t.clientHeight===t.scrollHeight&&n("scroll-end")},handleDeleteTag:function(e){if(!se.value){var t=ne.value.findIndex((function(t){return t.value===e}));t>-1&&(ne.value.splice(t,1),Ue(ne.value.map((function(e){return e.value}))))}},handleInputChange:function(e){p.value&&(Be.value=e)},handleInputEnter:function(e,t){var r=String(e);!P.value||!r||p.value&&re.value.find((function(e){return c(String(e.label))===c(r)}))||te.value.get(r)||(t.stopPropagation(),f.value?(ne.value.push({value:r,label:r}),Ue(ne.value.map((function(e){return e.value})))):(ne.value=[{value:r,label:r}],Ue(r),Ke()),Be.value="")},handleKeydown:function(e){var t,r;if(He.value){var o=re.value.filter((function(e){return!e.disabled&&e.visible})),n=o.findIndex((function(e){return e.value===ae.value}));if(o.length&&-1!==n)switch(e.code){case"ArrowDown":e.preventDefault();var l=n>=o.length-1?0:n+1;ae.value=null===(t=o[l])||void 0===t?void 0:t.value;break;case"ArrowUp":e.preventDefault();var a=0===n?o.length-1:n-1;ae.value=null===(r=o[a])||void 0===r?void 0:r.value;break;case"Backspace":if(!f.value||!ne.value.length||Be.value.length||e.target===Q.value)return;ne.value.pop(),Ue(ne.value.map((function(e){return e.value})));break;case"Enter":var i=te.value.get(ae.value);ze(i)}}},handleSelectedAllOptionMouseEnter:function(){ae.value=""},handlePopoverShow:function(){setTimeout((function(){var e,t;O.value&&(null===(t=null===(e=Z.value)||void 0===e?void 0:e.reset)||void 0===t||t.call(e))}))},localLoadingText:_,localPlaceholder:B,localSearchPlaceholder:F,localSelectAllText:U}},render:function(){var n,l=this,a=(0,e.classes)((t(n={},(0,e.resolveClassName)("select"),!0),t(n,"popover-show",this.isPopoverShow),t(n,"is-disabled",this.isDisabled),t(n,"is-focus",this.isFocus),t(n,"is-filterable",this.filterable),t(n,this.size,!0),t(n,this.behavior,!0),n)),i=function(){return l.loading?(0,r.createVNode)(P(),{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):l.clearable&&l.isHover&&l.selected.length&&!l.isDisabled?(0,r.createVNode)(o.Close,{class:"clear-icon",onClick:l.handleClear},null):(0,r.createVNode)(o.AngleUp,{class:"angle-up"},null)},u=function(){var e,t,o,n;return"tag"===l.multipleMode?(0,r.createVNode)(L,{ref:"selectTagInputRef",modelValue:l.searchKey,"onUpdate:modelValue":function(e){return l.searchKey=e},selected:l.selected,tagTheme:l.tagTheme,placeholder:l.localPlaceholder,filterable:l.isInput,disabled:l.isDisabled,onRemove:l.handleDeleteTag,collapseTags:l.isCollapseTags,onEnter:l.handleInputEnter,onKeydown:function(e,t){return l.handleKeydown(t)}},{prefix:l.prefix?(0,r.createVNode)("div",{class:"bk-select--prefix-area"},[(0,r.createVNode)("span",null,[l.prefix])]):null===(o=(t=l.$slots).prefix)||void 0===o?void 0:o.call(t),default:l.$slots.tag&&function(){return l.$slots.tag({selected:l.selected})},suffix:function(){return i()}}):(0,r.createVNode)(x(),(0,r.mergeProps)({ref:"inputRef",type:"text",modelValue:l.isInput?l.searchKey:l.selectedLabel.join(","),placeholder:l.isInput&&l.selectedLabel.join(",")||l.localPlaceholder,readonly:!l.isInput,selectReadonly:!0,disabled:l.isDisabled,behavior:l.behavior,size:l.size,withValidate:!1,onInput:l.handleInputChange,onEnter:l.handleInputEnter,onKeydown:function(e,t){return l.handleKeydown(t)}},l.prefix?{prefix:l.prefix}:null),(n=e=Object.assign(Object.assign({},"function"==typeof l.$slots.prefix?{prefix:function(){var e,t;return null===(t=(e=l.$slots).prefix)||void 0===t?void 0:t.call(e)}}:null),{suffix:function(){return i()}}),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!(0,r.isVNode)(n)?e:{default:function(){return[e]}}))};return(0,r.createVNode)("div",{class:a},[(0,r.createVNode)(C(),(0,r.mergeProps)(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:function(){return(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-trigger"),style:{height:l.autoHeight&&l.collapseTags?"32px":""},ref:"triggerRef",onClick:l.handleTogglePopover,onMouseenter:l.setHover,onMouseleave:l.cancelHover},[(null===(o=(t=l.$slots).trigger)||void 0===o?void 0:o.call(t,{selected:l.selected}))||u()]);var t,o},content:function(){return(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-content-wrapper"),ref:"contentRef"},[l.filterable&&!l.inputSearch&&(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-search-wrapper")},[(0,r.createVNode)(o.Search,{class:"icon-search",width:16,height:16},null),(0,r.withDirectives)((0,r.createVNode)("input",{ref:"searchRef",class:(0,e.resolveClassName)("select-search-input"),placeholder:l.localSearchPlaceholder,"onUpdate:modelValue":function(e){return l.searchKey=e}},null),[[r.vModelText,l.searchKey]])]),!l.isShowSelectContent&&(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-empty")},[l.searchLoading&&(0,r.createVNode)(P(),{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,r.createVNode)("span",null,[l.curContentText])]),(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-content")},[(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-dropdown"),style:{maxHeight:"".concat(l.scrollHeight,"px")},onScroll:l.handleScroll},[(0,r.withDirectives)((0,r.createVNode)("ul",{class:(0,e.resolveClassName)("select-options")},[l.isShowSelectAll&&(0,r.createVNode)("li",{class:(0,e.resolveClassName)("select-option"),onMouseenter:l.handleSelectedAllOptionMouseEnter,onClick:l.handleToggleAll},[l.localSelectAllText]),l.enableVirtualRender?(0,r.createVNode)(O(),{list:l.virtualList,height:l.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:function(e){return e.data.map((function(e){var t,o;return(0,r.createVNode)(d,{key:e[l.idKey],value:e[l.idKey],label:e[l.displayKey]},{default:null===(o=(t=l.$slots).virtualScrollRender)||void 0===o?void 0:o.call(t,{item:e})})}))}}):l.list.map((function(e){return(0,r.createVNode)(d,{value:e[l.idKey],label:e[l.displayKey]},null)})),null===(n=(t=l.$slots).default)||void 0===n?void 0:n.call(t),l.scrollLoading&&(0,r.createVNode)("li",{class:(0,e.resolveClassName)("select-options-loading")},[(0,r.createVNode)(P(),{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,r.createVNode)("span",null,[l.localLoadingText])])]),[[r.vShow,l.isShowSelectContent]])]),l.$slots.extension&&(0,r.createVNode)("div",{class:(0,e.resolveClassName)("select-extension")},[l.$slots.extension()])])]);var t,n}})])}});var A=(0,e.withInstallProps)(k,{Option:d,Group:g});const R=A})(),f})()));
@@ -296,6 +296,7 @@
296
296
  .bk-popover.bk-pop2-content.bk-select-popover .bk-select-content-wrapper .bk-select-option .bk-select-selected-icon {
297
297
  position: absolute;
298
298
  right: 10px;
299
+ top: 5px;
299
300
  }
300
301
  .bk-popover.bk-pop2-content.bk-select-popover .bk-select-content-wrapper .bk-select-option-item {
301
302
  overflow: hidden;
@@ -336,6 +336,7 @@
336
336
  .@{bk-prefix}-select-selected-icon {
337
337
  position: absolute;
338
338
  right: 10px;
339
+ top: 5px
339
340
  }
340
341
 
341
342
  &-item {
@@ -418,6 +418,7 @@
418
418
  .bk-popover.bk-pop2-content.bk-select-popover .bk-select-content-wrapper .bk-select-option .bk-select-selected-icon {
419
419
  position: absolute;
420
420
  right: 10px;
421
+ top: 5px;
421
422
  }
422
423
  .bk-popover.bk-pop2-content.bk-select-popover .bk-select-content-wrapper .bk-select-option-item {
423
424
  overflow: hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.1-beta.452",
3
+ "version": "0.0.1-beta.454",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",