bkui-vue 0.0.1-beta.346 → 0.0.1-beta.347

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.
@@ -11,6 +11,7 @@ declare const BkSearchSelect: {
11
11
  conditions: import("./utils").ICommonItem[];
12
12
  valueSplitCode: string;
13
13
  shrink: boolean;
14
+ uniqueSelect: boolean;
14
15
  }> & Omit<Readonly<import("vue").ExtractPropTypes<{
15
16
  data: {
16
17
  type: import("vue").PropType<import("./utils").ISearchItem[]>;
@@ -49,9 +50,13 @@ declare const BkSearchSelect: {
49
50
  type: StringConstructor;
50
51
  default: string;
51
52
  };
53
+ uniqueSelect: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
52
57
  }>> & {
53
58
  "onUpdate:modelValue"?: (...args: any[]) => any;
54
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "maxHeight" | "minHeight" | "clearable" | "modelValue" | "conditions" | "valueSplitCode" | "shrink">;
59
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "maxHeight" | "minHeight" | "clearable" | "modelValue" | "conditions" | "valueSplitCode" | "shrink" | "uniqueSelect">;
55
60
  $attrs: {
56
61
  [x: string]: unknown;
57
62
  };
@@ -103,6 +108,10 @@ declare const BkSearchSelect: {
103
108
  type: StringConstructor;
104
109
  default: string;
105
110
  };
111
+ uniqueSelect: {
112
+ type: BooleanConstructor;
113
+ default: boolean;
114
+ };
106
115
  }>> & {
107
116
  "onUpdate:modelValue"?: (...args: any[]) => any;
108
117
  }, {
@@ -139,7 +148,9 @@ declare const BkSearchSelect: {
139
148
  name: string;
140
149
  id: string;
141
150
  realId?: string;
151
+ isSelected?: boolean;
142
152
  };
153
+ isSelected?: boolean;
143
154
  }[]>;
144
155
  menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
145
156
  menuHoverId: import("vue").Ref<string>;
@@ -190,6 +201,7 @@ declare const BkSearchSelect: {
190
201
  }>>;
191
202
  wrapRef: import("vue").Ref<HTMLDivElement>;
192
203
  isFocus: import("vue").Ref<boolean>;
204
+ copyData: import("vue").Ref<import("./utils").ISearchItem[]>;
193
205
  selectedList: import("vue").Ref<{
194
206
  id: string;
195
207
  name: string;
@@ -202,7 +214,9 @@ declare const BkSearchSelect: {
202
214
  name: string;
203
215
  id: string;
204
216
  realId?: string;
217
+ isSelected?: boolean;
205
218
  };
219
+ isSelected?: boolean;
206
220
  }[];
207
221
  condition: string;
208
222
  searchItem: {
@@ -217,7 +231,9 @@ declare const BkSearchSelect: {
217
231
  name: string;
218
232
  id: string;
219
233
  realId?: string;
234
+ isSelected?: boolean;
220
235
  };
236
+ isSelected?: boolean;
221
237
  }[];
222
238
  multiple?: boolean;
223
239
  async?: boolean;
@@ -233,8 +249,11 @@ declare const BkSearchSelect: {
233
249
  name: string;
234
250
  id: string;
235
251
  realId?: string;
252
+ isSelected?: boolean;
236
253
  };
254
+ isSelected?: boolean;
237
255
  };
256
+ isSelected?: boolean;
238
257
  };
239
258
  type: import("./utils").SearchItemType;
240
259
  splitCode: string;
@@ -249,7 +268,9 @@ declare const BkSearchSelect: {
249
268
  name: string;
250
269
  id: string;
251
270
  realId?: string;
271
+ isSelected?: boolean;
252
272
  };
273
+ isSelected?: boolean;
253
274
  }[];
254
275
  readonly validate: boolean;
255
276
  readonly inputInnerHtml: string;
@@ -283,6 +304,7 @@ declare const BkSearchSelect: {
283
304
  conditions: import("./utils").ICommonItem[];
284
305
  valueSplitCode: string;
285
306
  shrink: boolean;
307
+ uniqueSelect: boolean;
286
308
  }> & {
287
309
  beforeCreate?: (() => void) | (() => void)[];
288
310
  created?: (() => void) | (() => void)[];
@@ -341,6 +363,10 @@ declare const BkSearchSelect: {
341
363
  type: StringConstructor;
342
364
  default: string;
343
365
  };
366
+ uniqueSelect: {
367
+ type: BooleanConstructor;
368
+ default: boolean;
369
+ };
344
370
  }>> & {
345
371
  "onUpdate:modelValue"?: (...args: any[]) => any;
346
372
  } & import("vue").ShallowUnwrapRef<{
@@ -377,7 +403,9 @@ declare const BkSearchSelect: {
377
403
  name: string;
378
404
  id: string;
379
405
  realId?: string;
406
+ isSelected?: boolean;
380
407
  };
408
+ isSelected?: boolean;
381
409
  }[]>;
382
410
  menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
383
411
  menuHoverId: import("vue").Ref<string>;
@@ -428,6 +456,7 @@ declare const BkSearchSelect: {
428
456
  }>>;
429
457
  wrapRef: import("vue").Ref<HTMLDivElement>;
430
458
  isFocus: import("vue").Ref<boolean>;
459
+ copyData: import("vue").Ref<import("./utils").ISearchItem[]>;
431
460
  selectedList: import("vue").Ref<{
432
461
  id: string;
433
462
  name: string;
@@ -440,7 +469,9 @@ declare const BkSearchSelect: {
440
469
  name: string;
441
470
  id: string;
442
471
  realId?: string;
472
+ isSelected?: boolean;
443
473
  };
474
+ isSelected?: boolean;
444
475
  }[];
445
476
  condition: string;
446
477
  searchItem: {
@@ -455,7 +486,9 @@ declare const BkSearchSelect: {
455
486
  name: string;
456
487
  id: string;
457
488
  realId?: string;
489
+ isSelected?: boolean;
458
490
  };
491
+ isSelected?: boolean;
459
492
  }[];
460
493
  multiple?: boolean;
461
494
  async?: boolean;
@@ -471,8 +504,11 @@ declare const BkSearchSelect: {
471
504
  name: string;
472
505
  id: string;
473
506
  realId?: string;
507
+ isSelected?: boolean;
474
508
  };
509
+ isSelected?: boolean;
475
510
  };
511
+ isSelected?: boolean;
476
512
  };
477
513
  type: import("./utils").SearchItemType;
478
514
  splitCode: string;
@@ -487,7 +523,9 @@ declare const BkSearchSelect: {
487
523
  name: string;
488
524
  id: string;
489
525
  realId?: string;
526
+ isSelected?: boolean;
490
527
  };
528
+ isSelected?: boolean;
491
529
  }[];
492
530
  readonly validate: boolean;
493
531
  readonly inputInnerHtml: string;
@@ -554,6 +592,10 @@ declare const BkSearchSelect: {
554
592
  type: StringConstructor;
555
593
  default: string;
556
594
  };
595
+ uniqueSelect: {
596
+ type: BooleanConstructor;
597
+ default: boolean;
598
+ };
557
599
  }>> & {
558
600
  "onUpdate:modelValue"?: (...args: any[]) => any;
559
601
  }, {
@@ -590,7 +632,9 @@ declare const BkSearchSelect: {
590
632
  name: string;
591
633
  id: string;
592
634
  realId?: string;
635
+ isSelected?: boolean;
593
636
  };
637
+ isSelected?: boolean;
594
638
  }[]>;
595
639
  menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
596
640
  menuHoverId: import("vue").Ref<string>;
@@ -641,6 +685,7 @@ declare const BkSearchSelect: {
641
685
  }>>;
642
686
  wrapRef: import("vue").Ref<HTMLDivElement>;
643
687
  isFocus: import("vue").Ref<boolean>;
688
+ copyData: import("vue").Ref<import("./utils").ISearchItem[]>;
644
689
  selectedList: import("vue").Ref<{
645
690
  id: string;
646
691
  name: string;
@@ -653,7 +698,9 @@ declare const BkSearchSelect: {
653
698
  name: string;
654
699
  id: string;
655
700
  realId?: string;
701
+ isSelected?: boolean;
656
702
  };
703
+ isSelected?: boolean;
657
704
  }[];
658
705
  condition: string;
659
706
  searchItem: {
@@ -668,7 +715,9 @@ declare const BkSearchSelect: {
668
715
  name: string;
669
716
  id: string;
670
717
  realId?: string;
718
+ isSelected?: boolean;
671
719
  };
720
+ isSelected?: boolean;
672
721
  }[];
673
722
  multiple?: boolean;
674
723
  async?: boolean;
@@ -684,8 +733,11 @@ declare const BkSearchSelect: {
684
733
  name: string;
685
734
  id: string;
686
735
  realId?: string;
736
+ isSelected?: boolean;
687
737
  };
738
+ isSelected?: boolean;
688
739
  };
740
+ isSelected?: boolean;
689
741
  };
690
742
  type: import("./utils").SearchItemType;
691
743
  splitCode: string;
@@ -700,7 +752,9 @@ declare const BkSearchSelect: {
700
752
  name: string;
701
753
  id: string;
702
754
  realId?: string;
755
+ isSelected?: boolean;
703
756
  };
757
+ isSelected?: boolean;
704
758
  }[];
705
759
  readonly validate: boolean;
706
760
  readonly inputInnerHtml: string;
@@ -734,6 +788,7 @@ declare const BkSearchSelect: {
734
788
  conditions: import("./utils").ICommonItem[];
735
789
  valueSplitCode: string;
736
790
  shrink: boolean;
791
+ uniqueSelect: boolean;
737
792
  }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
738
793
  export default BkSearchSelect;
739
794
  export { BkSearchSelect, };
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../directives","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,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)=>(()=>{var a={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 E(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 N()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=I(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 _(){}function g(){}var y={};u(y,a,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(V([])));b&&b!==n&&r.call(b,a)&&(y=b);var x=g.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 L(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 I(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,I(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 S(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 E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function V(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:N}}function N(){return{value:t,done:!0}}return _.prototype=g,u(x,"constructor",g),u(g,"constructor",_),_.displayName=u(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},k(L.prototype),u(L.prototype,o,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new L(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=V,E.prototype={constructor:E,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:V(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)}},4061:e=>{"use strict";e.exports=n},6870:e=>{"use strict";e.exports=r},5537:e=>{"use strict";e.exports=i},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return a[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{"use strict";l.r(u),l.d(u,{BkSearchSelect:()=>F,default:()=>j});var e=l(4212),t=l(748),n=null,r=null;function i(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function a(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function o(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===a(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var s=0,c=null;function d(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=v.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,l=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&f(e)})),u=o(e),d=u.detached,m=u.rendered;e.__resize_observer_triggered__=!1===d&&!1===m,e.__resize_observer__=l,l.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){f(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(s||(c=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=a(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=i("div",{className:"resize-triggers"}),r=i("div",{className:"resize-expand-trigger"}),o=i("div"),l=i("div",{className:"resize-contract-trigger"});r.appendChild(o),n.appendChild(r),n.appendChild(l),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:o,contract:l},p(e),e.addEventListener("scroll",h,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=o(e).rendered,window.MutationObserver){var _=new MutationObserver(e.__resize_mutation_handler__);_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=_}e.__resize_listeners__.push(t),s++}function v(){var e=o(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(p(this),this.addEventListener("scroll",h,!0)),this.__resize_rendered__=t,f(this))}function h(){var e,t,i=this;p(this),this.__resize_raf__&&(e=this.__resize_raf__,r||(r=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),r(e)),this.__resize_raf__=(t=function(){var e,t,n,r,a,o,l=(n=(t=(e=i).__resize_last__).width,r=t.height,a=e.offsetWidth,o=e.offsetHeight,a!==n||o!==r?{width:a,height:o}:null);l&&(i.__resize_last__=l,f(i))},n||(n=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),n(t))}function f(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function p(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 m=l(4061),_=l(6870),g=l(7162),y=l.n(g);function w(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 b=l(5537),x=l.n(b);const k=(0,t.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[{id:"confirm",name:"确认"},{id:"cancel",name:"取消",disabled:!1}]}}},emits:["selectItem","selectCondition","footerClick"],setup:function(e,n){var r=n.emit;return{handleClick:function(e){r("selectItem",e)},handleClickCondition:function(e){r("selectCondition",e)},handleClickFooterBtn:function(e){r("footerClick",e)},filterList:(0,t.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(n){var r;return(null===(r=n.value)||void 0===r?void 0:r.name)?[(0,t.createVNode)("span",{class:"menu-name"},[n.name,(0,t.createTextVNode)(":")]),n.value.name]:function(n){if(!n)return n;var r=e.keyword,i=r.length;if(!(null==r?void 0:r.trim().length)||!n.toLocaleLowerCase().includes(r.toLocaleLowerCase()))return n;var a=[],o=-1;return r=r.replace(/([.*/]{1})/gim,"\\$1"),n.replace(new RegExp("".concat(r),"igm"),(function(e,r){return 0===a.length&&0!==r?a.push(n.slice(0,r)):o>=0&&a.push(n.slice(o+e.length,r)),a.push((0,t.createVNode)("span",{class:"is-keyword"},[e])),o=r,e})),o>=0&&a.push(n.slice(o+i)),a.length?a:n}(n.name)}}},render:function(){var e,n,r,i=this;return(0,t.createVNode)("div",{class:"bk-search-select-menu"},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,t.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,t.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,t.createVNode)("ul",{class:"menu-content"},[null===(n=this.list)||void 0===n?void 0:n.map((function(e){return(0,t.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,t.createVNode)(t.Fragment,null,[i.getSearchNode(e),i.multiple&&i.selected.includes(e.id)&&(0,t.createVNode)(_.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(r=this.footerBtns)||void 0===r?void 0:r.length)&&(0,t.createVNode)("div",{class:"menu-footer"},[this.footerBtns.map((function(e){return(0,t.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 I(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 S,C=Symbol("SEARCH_SLECT_PROVIDER_KEY"),E=function(){return(0,t.inject)(C)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(S||(S={}));var V=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)}))}}])&&I(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const N=(0,t.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:m.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:S.DEFAULT},getMenuList:Function,validateValues:Function},emits:["focus","add","delete"],setup:function(n,r){var i=r.emit,a=r.expose,o=(0,t.ref)(null),l=(0,t.ref)(null),u=(0,t.ref)(""),s=(0,t.ref)(!1),c=(0,t.ref)(!1),d=(0,t.ref)(!1),v=(0,t.ref)(n.defautUsingItem),h=(0,t.ref)(""),f=(0,t.ref)(!1),p=(0,e.debounce)(300,A),m=!1,_=(0,t.ref)([]),g=(0,t.ref)([]),b=E(),x=b.editKey,k=b.onValidate,L=b.valueSplitCode;function I(e){switch(e.code){case"ArrowDown":case"ArrowUp":C(e);break;case"Enter":case"NumpadEnter":!function(e){if(m){e.preventDefault();var t=g.value.find((function(e){return e.id===h.value}));t&&O(t)}}(e)}}function C(e){var t;e.preventDefault(),null===(t=o.value)||void 0===t||t.blur();for(var n=g.value.length,r=n,i=g.value.findIndex((function(e){return e.id===h.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var a=g.value[i];if(!a.disabled){r=-1;var l=document.getElementById(a.id);return null==l||l.focus(),void(h.value=a.id)}r-=1}}function N(e){j(),e&&A()}function z(e){var t;return w(this,void 0,void 0,y().mark((function n(){var r,a,o,l;return y().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null==e||e.preventDefault(),v.value){n.next=14;break}if(u.value){n.next=4;break}return n.abrupt("return");case 4:return r={id:u.value,name:u.value},n.next=7,T(r);case 7:if(n.sent){n.next=10;break}return n.abrupt("return");case 10:return i("add",new V(r,"text",L.value)),u.value="",A(),n.abrupt("return");case 14:if(null==(a=v.value.values)?void 0:a.length){n.next=41;break}if(!(null===(t=u.value)||void 0===t?void 0:t.length)){n.next=39;break}if(!u.value.includes(L.value)){n.next=28;break}return o=u.value.split(L.value),n.next=22,T({id:u.value,name:u.value});case 22:if(n.sent){n.next=25;break}return n.abrupt("return");case 25:o.forEach((function(e){return v.value.addValue({id:e,name:e})})),n.next=35;break;case 28:return l={id:u.value,name:u.value},n.next=31,T(l);case 31:if(n.sent){n.next=34;break}return n.abrupt("return");case 34:v.value.addValue(l);case 35:return i("add",v.value),u.value="",v.value=null,n.abrupt("return");case 39:return s.value=!0,n.abrupt("return");case 41:return n.next=43,T();case 43:if(n.sent){n.next=46;break}return n.abrupt("return");case 46:D();case 47:case"end":return n.stop()}}),n)})))}function O(e,t){var n,r,i,a;return w(this,void 0,void 0,y().mark((function l(){var s,c;return y().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(!(null===(n=e.value)||void 0===n?void 0:n.id)){l.next=5;break}return(s=new V(Object.assign(Object.assign({},e),{id:null!==(r=e.realId)&&void 0!==r?r:e.id}),t,L.value)).addValue(e.value),D(s),l.abrupt("return");case 5:if(v.value&&(null===(i=null==o?void 0:o.value)||void 0===i?void 0:i.innerText)){l.next=13;break}return v.value=new V(e,t,L.value),u.value="",(c="condition"===t)&&D(),d.value=c||!!v.value.children.length,j(),l.abrupt("return");case 13:if("condition"!==(null===(a=v.value)||void 0===a?void 0:a.type)){l.next=17;break}return v.value=new V(e,t,L.value),D(),l.abrupt("return");case 17:return v.value.addValue(e),l.next=20,T(e);case 20:if(l.sent){l.next=23;break}return l.abrupt("return");case 23:!v.value.multiple&&D();case 24:case"end":return l.stop()}}),l)})))}function T(e){return w(this,void 0,void 0,y().mark((function t(){var r,i,a,o;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v.value){t.next=4;break}return t.next=3,F(null,[e]);case 3:case 8:return t.abrupt("return",t.sent);case 4:if(r=v.value,i=r.searchItem,a=r.validate,o=r.values,!a||"function"!=typeof n.validateValues){t.next=9;break}return t.next=8,F(i,e?[e]:o);case 9:return k(""),t.abrupt("return",!0);case 11:case"end":return t.stop()}}),t)})))}function F(e,t){var r;return w(this,void 0,void 0,y().mark((function i(){var a;return y().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=n.validateValues)||void 0===r?void 0:r.call(n,null!=e?e:null,t).catch((function(){return!1}));case 2:if("string"!=typeof(a=i.sent)&&!1!==a){i.next=6;break}return k(a||"校验错误"),i.abrupt("return",!1);case 6:return k(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function j(){c.value=!0,d.value=!0,s.value=!1;var e=setTimeout((function(){if(o.value){o.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(o.value),t.collapseToEnd())}window.clearTimeout(e)}),0);i("focus",c.value)}function A(){var t,r,i,a,o;return w(this,void 0,void 0,y().mark((function l(){var s;return y().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(s=[],"function"!=typeof n.getMenuList||(null===(r=null===(t=v.value)||void 0===t?void 0:t.searchItem)||void 0===r?void 0:r.async)){l.next=9;break}return f.value=!0,l.next=5,n.getMenuList(null===(i=v.value)||void 0===i?void 0:i.searchItem,u.value).catch((function(){return[]}));case 5:s=l.sent,f.value=!1,l.next=10;break;case 9:(null==v?void 0:v.value)?"condition"===v.value.type?s=n.conditions:(null===(o=v.value.values)||void 0===o?void 0:o.length)&&!v.value.multiple&&n.mode!==S.EDIT||(s=v.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(u.value.toLocaleLowerCase())}))):(null===(a=u.value)||void 0===a?void 0:a.length)?n.data.forEach((function(t){var n,r;t.name.toLocaleLowerCase().includes(u.value.toLocaleLowerCase())?(s.push(t),null===(n=t.children)||void 0===n||n.forEach((function(n){s.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),s.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:u.value,name:u.value}}))):(null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(u.value.toLocaleLowerCase())&&s.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),s.push(Object.assign(Object.assign({},t),{value:{id:u.value,name:u.value}})))})):s=n.data.slice();case 10:g.value=s;case 11:case"end":return l.stop()}}),l)})))}function D(e){i("add",null!=e?e:v.value),v.value=null,u.value="",j()}function M(){var e=o.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(H(e.slice(0,-1)),M()):"\n"!==e[0]&&"\r"!==e[0]||(H(e.slice(1)),M())}function H(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o.value&&(o.value.innerHTML=t||(null===(e=v.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,t.watch)(x,(function(){n.mode===S.DEFAULT&&x.value&&(d.value=!1)})),(0,t.watchEffect)((function(){u.value||H()}),{flush:"pre"}),(0,t.watch)([g,d],(function(){var e;(null===(e=g.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&d.value?m||(h.value="",m=!0,document.addEventListener("keydown",I)):(document.removeEventListener("keydown",I),m=!1,h.value="")})),a({handleInputFocus:N,isFocus:c}),{popoverRef:l,inputRef:o,keyword:u,loading:f,remoteMenuList:_,menuList:g,menuHoverId:h,isFocus:c,usingItem:v,showPopover:d,showNoSelectValueError:s,debounceSetMenuList:p,documentArrowEvent:C,handleClickOutside:function(e){var t,r;!(null===(t=l.value)||void 0===t?void 0:t.contains(e.target))&&(null===(r=n.clickOutside)||void 0===r?void 0:r.call(n,e.target,l.value))&&(d.value=!1,c.value=!1,i("focus",c.value))},handleInputFocus:N,handleInputChange:function(e){var t,n,r,i,a,l,s;M();var c=e.target.innerText;if(/(\r|\n)/gm.test(c)||/\s{2}/gm.test(c))e.preventDefault(),c=c.replace(/(\r|\n)/gm,L.value).replace(/\s{2}/gm,""),o.value.innerText=c,j(),u.value=c.replace((null===(t=v.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),p();else if(!u.value&&c.length<((null===(r=null===(n=v.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var d=c.replace(" "," ").replace((null===(i=v.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();!d&&(null==c?void 0:c.length)||(v.value=null),u.value=d?c:"",p()}else(null===(l=null===(a=v.value)||void 0===a?void 0:a.values)||void 0===l?void 0:l.length)||(u.value=c.replace(" "," ").replace((null===(s=v.value)||void 0===s?void 0:s.keyInnerText.replace(" "," "))||"","").trim(),j(),p())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":z(e);break;case"Backspace":!function(){var e,t;if(v.value||u.value)return(null===(e=v.value)||void 0===e?void 0:e.values.length)&&((null===(t=v.value)||void 0===t?void 0:t.multiple)||v.value.isInValueList(v.value.values[0]))?(v.value.values.splice(-1,1),u.value="",void j()):void k("");i("delete")}();default:s.value=!1}},handleSelectItem:O,handleSelectCondtionItem:function(e){O(e,"condition")},handleMenuFooterClick:function(e){switch(e.id){case"confirm":z();break;case"cancel":v.value.values=[],j()}}}},render:function(){var e,n,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===(n=this.menuList)||void 0===n?void 0:n.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,t.createVNode)(x(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,t.withDirectives)((0,t.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?"":"请选择","data-tips":l||"",spellcheck:"false",onFocus:r.handleInputFocus,onInput:r.handleInputChange,onKeydown:r.handleInputKeyup},null),[[(0,t.resolveDirective)("clickoutside"),r.handleClickOutside]])},content:function(){var e;return r.loading?(0,t.createVNode)("div",null,[(0,t.createTextVNode)("加载中...")]):r.showNoSelectValueError?(0,t.createVNode)("div",null,[(0,t.createTextVNode)("包含键值的过滤查询必须有一个值")]):(null===(e=r.menuList)||void 0===e?void 0:e.length)?(0,t.createVNode)("div",{ref:"popoverRef",class:"bk-search-select-popover"},[(0,t.createVNode)(k,{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}})}}),z=(0,t.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},emits:["delete"],setup:function(e,n){var r=n.emit,i=(0,t.ref)(null),a=E(),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 V(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,n=function(n,r){return e.editKey==="".concat(n.id,"_").concat(r)?(0,t.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,t.createVNode)(N,{ref:"inputRef",key:e.editKey.toString(),mode:S.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(n),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,onAdd:function(t){return e.handleAddSelected(t,r)},onFocus:e.handleInputFocus},null)]):(0,t.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?r<e.overflowIndex:r>=0)?"":"hidden-selected"),key:"".concat(n.id,"_").concat(r)},[(0,t.createVNode)("span",{class:"selected-name",onClick:function(t){return e.handleEditSeleted(t,n,r)}},[n.inputInnerText]),(0,t.createVNode)(_.Close,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(r)}},null)])};return(0,t.createVNode)(t.Fragment,null,[this.selectedList.map((function(r,i){return[e.overflowIndex>=0&&i===e.overflowIndex&&(0,t.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,t.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),n(r,i)]}))])}});var O={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[{id:"or",name:"或"},{id:"and",name:"且"}]}},clearable:{type:Boolean,default:!0},getMenuList:Function,validateValues:Function,valueSplitCode:{type:String,default:"|"}};const T=(0,t.defineComponent)({name:"SearchSelect",directives:{clickoutside:m.clickoutside},props:O,emits:["update:modelValue"],setup:function(n,r){var i,a=r.emit,o=(0,t.ref)(null),l=(0,t.ref)(null),u=(0,t.ref)(!1),v=(0,t.ref)([]),f=(0,t.ref)(-1),p=(0,e.debounce)(32,x),m=(0,t.ref)(""),_=(0,t.ref)(""),g=(0,t.computed)((function(){return n.valueSplitCode}));function y(e,t){m.value="".concat(e.id,"_").concat(t)}function w(e,t){var n=v.value.slice();n.splice(t,1,e),a("update:modelValue",n.map((function(e){return e.toValue()}))),m.value=""}function b(e){_.value=e||""}function x(){if(u.value||v.value.length<1)f.value=-1;else{for(var e=l.value.querySelector(".bk-search-select-container"),t=l.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<=t-40&&o<=r.length-1;){var s=r[o];if(s.clientHeight>n.minHeight)return void(f.value=o);(i+=s?s.clientWidth+6:0)>=t-40&&(a=o),o+=1}a===r.length-1&&i<=t?f.value=-1:f.value=i>=t-40?a:a-1}}return(0,t.watch)((function(){return n.modelValue}),(function(e){if(null==e?void 0:e.length){var t=[];e.forEach((function(e){var r,i=v.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==i?void 0:i.toValueKey())===JSON.stringify(e))i.values=e.values||[],t.push(i);else{var a=n.data.find((function(t){return t.id===e.id})),o="default";a||(a=n.conditions.find((function(t){return t.id===e.id})))&&(o="condition"),a||(null===(r=e.values)||void 0===r?void 0:r.length)||(o="text");var l=new V(a||e,o,g.value);l.values=e.values||[],t.push(l)}})),v.value=t}else v.value=[]}),{immediate:!0,deep:!0}),(0,t.onMounted)((function(){d(l.value.querySelector(".bk-search-select-container"),p)})),(0,t.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",h),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--s&&c&&c.parentNode.removeChild(c)}}(l.value.querySelector(".bk-search-select-container"),p)})),i={onEditClick:y,onEditEnter:w,onEditBlur:function(){m.value="",b("")},onValidate:b,editKey:m,valueSplitCode:g},(0,t.provide)(C,i),{inputRef:o,wrapRef:l,isFocus:u,selectedList:v,overflowIndex:f,validateStr:_,splitCode:g,onEditClick:y,onEditEnter:w,handleWrapClick:function(){m.value||o.value.handleInputFocus()},handleInputFocus:function(e){e&&(f.value=-1),u.value=e},handleResize:x,handleClearAll:function(){v.value=[],f.value=-1,a("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=l.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=v.value.slice();t.push(e),b(""),a("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=v.value.slice();t.splice("number"==typeof e?e:v.value.length-1,1),b(""),a("update:modelValue",t.map((function(e){return e.toValue()})))}}},render:function(){var e,n,r=this,i="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),a=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,o=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=r.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,t.createVNode)("div",{class:"bk-search-select",ref:"wrapRef"},[(0,t.createVNode)("div",{class:{"bk-search-select-container":!0,"is-focus":this.isFocus},onClick:this.handleWrapClick},[(0,t.createVNode)("div",{class:"search-prefix"},[null===(n=(e=this.$slots).prepend)||void 0===n?void 0:n.call(e)]),(0,t.createVNode)("div",{class:"search-container",style:{maxHeight:i}},[(0,t.createVNode)(z,{data:this.data,conditions:this.conditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,onDelete:this.handleDeleteSelected},Object.assign({},o)),(0,t.createVNode)("div",{class:"search-container-input"},[(0,t.createVNode)(N,{ref:"inputRef",data:this.data,showInputBefore:!this.selectedList.length,showCondition:a,conditions:this.conditions,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},o))])]),(0,t.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,t.createVNode)(_.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,t.createVNode)(_.Search,{class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,t.createVNode)("div",{class:"bk-search-select-tips"},[this.$slots.validate?this.$slots.validate():(0,t.createVNode)(t.Fragment,null,[(0,t.createVNode)(_.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var F=(0,e.withInstall)(T);const j=F})(),u})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../directives","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../directives"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,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)=>(()=>{var a={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 C(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw a;return N()}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=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?h:v,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,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",f="executing",h="completed",p={};function m(){}function _(){}function g(){}var y={};u(y,a,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(V([])));b&&b!==n&&r.call(b,a)&&(y=b);var x=g.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 L(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 I(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 E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function V(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:N}}function N(){return{value:t,done:!0}}return _.prototype=g,u(x,"constructor",g),u(g,"constructor",_),_.displayName=u(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},k(L.prototype),u(L.prototype,o,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new L(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=V,C.prototype={constructor:C,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(E),!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),E(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;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:V(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)}},4061:e=>{"use strict";e.exports=n},6870:e=>{"use strict";e.exports=r},5537:e=>{"use strict";e.exports=i},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return a[e](n,n.exports,l),n.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{"use strict";l.r(u),l.d(u,{BkSearchSelect:()=>F,default:()=>j});var e=l(4212),t=l(748),n=null,r=null;function i(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function a(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function o(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===a(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var s=0,c=null;function d(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=v.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,l=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&h(e)})),u=o(e),d=u.detached,m=u.rendered;e.__resize_observer_triggered__=!1===d&&!1===m,e.__resize_observer__=l,l.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){h(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(s||(c=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=a(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=i("div",{className:"resize-triggers"}),r=i("div",{className:"resize-expand-trigger"}),o=i("div"),l=i("div",{className:"resize-contract-trigger"});r.appendChild(o),n.appendChild(r),n.appendChild(l),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:o,contract:l},p(e),e.addEventListener("scroll",f,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=o(e).rendered,window.MutationObserver){var _=new MutationObserver(e.__resize_mutation_handler__);_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=_}e.__resize_listeners__.push(t),s++}function v(){var e=o(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(p(this),this.addEventListener("scroll",f,!0)),this.__resize_rendered__=t,h(this))}function f(){var e,t,i=this;p(this),this.__resize_raf__&&(e=this.__resize_raf__,r||(r=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),r(e)),this.__resize_raf__=(t=function(){var e,t,n,r,a,o,l=(n=(t=(e=i).__resize_last__).width,r=t.height,a=e.offsetWidth,o=e.offsetHeight,a!==n||o!==r?{width:a,height:o}:null);l&&(i.__resize_last__=l,h(i))},n||(n=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),n(t))}function h(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function p(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 m=l(4061),_=l(6870),g=l(7162),y=l.n(g);function w(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 b=l(5537),x=l.n(b);const k=(0,t.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[{id:"confirm",name:"确认"},{id:"cancel",name:"取消",disabled:!1}]}}},emits:["selectItem","selectCondition","footerClick"],setup:function(e,n){var r=n.emit;return{handleClick:function(e){r("selectItem",e)},handleClickCondition:function(e){r("selectCondition",e)},handleClickFooterBtn:function(e){r("footerClick",e)},filterList:(0,t.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(n){var r;return(null===(r=n.value)||void 0===r?void 0:r.name)?[(0,t.createVNode)("span",{class:"menu-name"},[n.name,(0,t.createTextVNode)(":")]),n.value.name]:function(n){if(!n)return n;var r=e.keyword,i=r.length;if(!(null==r?void 0:r.trim().length)||!n.toLocaleLowerCase().includes(r.toLocaleLowerCase()))return n;var a=[],o=-1;return r=r.replace(/([.*/]{1})/gim,"\\$1"),n.replace(new RegExp("".concat(r),"igm"),(function(e,r){return 0===a.length&&0!==r?a.push(n.slice(0,r)):o>=0&&a.push(n.slice(o+e.length,r)),a.push((0,t.createVNode)("span",{class:"is-keyword"},[e])),o=r,e})),o>=0&&a.push(n.slice(o+i)),a.length?a:n}(n.name)}}},render:function(){var e,n,r,i=this;return(0,t.createVNode)("div",{class:"bk-search-select-menu"},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,t.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,t.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,t.createVNode)("ul",{class:"menu-content"},[null===(n=this.list)||void 0===n?void 0:n.map((function(e){return(0,t.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,t.createVNode)(t.Fragment,null,[i.getSearchNode(e),i.multiple&&i.selected.includes(e.id)&&(0,t.createVNode)(_.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(r=this.footerBtns)||void 0===r?void 0:r.length)&&(0,t.createVNode)("div",{class:"menu-footer"},[this.footerBtns.map((function(e){return(0,t.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 S(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,E=Symbol("SEARCH_SLECT_PROVIDER_KEY"),C=function(){return(0,t.inject)(E)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(I||(I={}));var V=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)}))}}])&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const N=(0,t.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:m.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:I.DEFAULT},getMenuList:Function,validateValues:Function},emits:["focus","add","delete"],setup:function(n,r){var i=r.emit,a=r.expose,o=(0,t.ref)(null),l=(0,t.ref)(null),u=(0,t.ref)(""),s=(0,t.ref)(!1),c=(0,t.ref)(!1),d=(0,t.ref)(!1),v=(0,t.ref)(n.defautUsingItem),f=(0,t.ref)(""),h=(0,t.ref)(!1),p=(0,e.debounce)(300,A),m=!1,_=(0,t.ref)([]),g=(0,t.ref)([]),b=C(),x=b.editKey,k=b.onValidate,L=b.valueSplitCode;function S(e){switch(e.code){case"ArrowDown":case"ArrowUp":E(e);break;case"Enter":case"NumpadEnter":!function(e){if(m){e.preventDefault();var t=g.value.find((function(e){return e.id===f.value}));t&&O(t)}}(e)}}function E(e){var t;e.preventDefault(),null===(t=o.value)||void 0===t||t.blur();for(var n=g.value.length,r=n,i=g.value.findIndex((function(e){return e.id===f.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var a=g.value[i];if(!a.disabled){r=-1;var l=document.getElementById(a.id);return null==l||l.focus(),void(f.value=a.id)}r-=1}}function N(e){j(),e&&A()}function z(e){var t;return w(this,void 0,void 0,y().mark((function n(){var r,a,o,l;return y().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null==e||e.preventDefault(),v.value){n.next=14;break}if(u.value){n.next=4;break}return n.abrupt("return");case 4:return r={id:u.value,name:u.value},n.next=7,T(r);case 7:if(n.sent){n.next=10;break}return n.abrupt("return");case 10:return i("add",new V(r,"text",L.value)),u.value="",A(),n.abrupt("return");case 14:if(null==(a=v.value.values)?void 0:a.length){n.next=40;break}if(!(null===(t=u.value)||void 0===t?void 0:t.length)){n.next=38;break}if(!u.value.includes(L.value)){n.next=27;break}return o=u.value.split(L.value),n.next=21,T({id:u.value,name:u.value});case 21:if(n.sent){n.next=24;break}return n.abrupt("return");case 24:o.forEach((function(e){return v.value.addValue({id:e,name:e})})),n.next=34;break;case 27:return l={id:u.value,name:u.value},n.next=30,T(l);case 30:if(n.sent){n.next=33;break}return n.abrupt("return");case 33:v.value.addValue(l);case 34:return i("add",v.value),u.value="",v.value=null,n.abrupt("return");case 38:return s.value=!0,n.abrupt("return");case 40:return n.next=42,T();case 42:if(n.sent){n.next=45;break}return n.abrupt("return");case 45:D();case 46:case"end":return n.stop()}}),n)})))}function O(e,t){var n,r,i,a;return w(this,void 0,void 0,y().mark((function l(){var s,c;return y().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(!(null===(n=e.value)||void 0===n?void 0:n.id)){l.next=5;break}return(s=new V(Object.assign(Object.assign({},e),{id:null!==(r=e.realId)&&void 0!==r?r:e.id}),t,L.value)).addValue(e.value),D(s),l.abrupt("return");case 5:if(v.value&&(null===(i=null==o?void 0:o.value)||void 0===i?void 0:i.innerText)){l.next=13;break}return v.value=new V(e,t,L.value),u.value="",(c="condition"===t)&&D(),d.value=c||!!v.value.children.length,j(),l.abrupt("return");case 13:if("condition"!==(null===(a=v.value)||void 0===a?void 0:a.type)){l.next=17;break}return v.value=new V(e,t,L.value),D(),l.abrupt("return");case 17:return v.value.addValue(e),l.next=20,T(e);case 20:if(l.sent){l.next=23;break}return l.abrupt("return");case 23:!v.value.multiple&&D();case 24:case"end":return l.stop()}}),l)})))}function T(e){return w(this,void 0,void 0,y().mark((function t(){var r,i,a,o;return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v.value){t.next=4;break}return t.next=3,F(null,[e]);case 3:case 8:return t.abrupt("return",t.sent);case 4:if(r=v.value,i=r.searchItem,a=r.validate,o=r.values,!a||"function"!=typeof n.validateValues){t.next=9;break}return t.next=8,F(i,e?[e]:o);case 9:return k(""),t.abrupt("return",!0);case 11:case"end":return t.stop()}}),t)})))}function F(e,t){var r;return w(this,void 0,void 0,y().mark((function i(){var a;return y().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=n.validateValues)||void 0===r?void 0:r.call(n,null!=e?e:null,t).catch((function(){return!1}));case 2:if("string"!=typeof(a=i.sent)&&!1!==a){i.next=6;break}return k(a||"校验错误"),i.abrupt("return",!1);case 6:return k(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function j(){c.value=!0,d.value=!0,s.value=!1;var e=setTimeout((function(){if(o.value){o.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(o.value),t.collapseToEnd())}window.clearTimeout(e)}),0);i("focus",c.value)}function A(){var t,r,i,a,o;return w(this,void 0,void 0,y().mark((function l(){var s;return y().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(s=[],"function"!=typeof n.getMenuList||void 0!==(null===(r=null===(t=v.value)||void 0===t?void 0:t.searchItem)||void 0===r?void 0:r.async)&&!0!==v.value.searchItem.async){l.next=9;break}return h.value=!0,l.next=5,n.getMenuList(null===(i=v.value)||void 0===i?void 0:i.searchItem,u.value).catch((function(){return[]}));case 5:s=l.sent,h.value=!1,l.next=10;break;case 9:(null==v?void 0:v.value)?"condition"===v.value.type?s=n.conditions:(null===(o=v.value.values)||void 0===o?void 0:o.length)&&!v.value.multiple&&n.mode!==I.EDIT||(s=v.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(u.value.toLocaleLowerCase())}))):(null===(a=u.value)||void 0===a?void 0:a.length)?n.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;t.name.toLocaleLowerCase().includes(u.value.toLocaleLowerCase())?(s.push(t),null===(n=t.children)||void 0===n||n.forEach((function(n){s.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),s.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:u.value,name:u.value}}))):(null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(u.value.toLocaleLowerCase())&&s.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),s.push(Object.assign(Object.assign({},t),{value:{id:u.value,name:u.value}})))})):s=n.data.filter((function(e){return!e.isSelected})).slice();case 10:g.value=s;case 11:case"end":return l.stop()}}),l)})))}function D(e){i("add",null!=e?e:v.value),v.value=null,u.value="",j()}function M(){var e=o.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(q(e.slice(0,-1)),M()):"\n"!==e[0]&&"\r"!==e[0]||(q(e.slice(1)),M())}function q(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o.value&&(o.value.innerHTML=t||(null===(e=v.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,t.watch)(x,(function(){n.mode===I.DEFAULT&&x.value&&(d.value=!1)})),(0,t.watchEffect)((function(){u.value||q()}),{flush:"pre"}),(0,t.watch)([g,d],(function(){var e;(null===(e=g.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&d.value?m||(f.value="",m=!0,document.addEventListener("keydown",S)):(document.removeEventListener("keydown",S),m=!1,f.value="")})),a({handleInputFocus:N,isFocus:c}),{popoverRef:l,inputRef:o,keyword:u,loading:h,remoteMenuList:_,menuList:g,menuHoverId:f,isFocus:c,usingItem:v,showPopover:d,showNoSelectValueError:s,debounceSetMenuList:p,documentArrowEvent:E,handleClickOutside:function(e){var t,r;!(null===(t=l.value)||void 0===t?void 0:t.contains(e.target))&&(null===(r=n.clickOutside)||void 0===r?void 0:r.call(n,e.target,l.value))&&(d.value=!1,c.value=!1,i("focus",c.value))},handleInputFocus:N,handleInputChange:function(e){var t,n,r,i,a,l,s;M();var c=e.target.innerText;if(/(\r|\n)/gm.test(c)||/\s{2}/gm.test(c))e.preventDefault(),c=c.replace(/(\r|\n)/gm,L.value).replace(/\s{2}/gm,""),o.value.innerText=c,j(),u.value=c.replace((null===(t=v.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),p();else if(!u.value&&c.length<((null===(r=null===(n=v.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var d=c.replace(" "," ").replace((null===(i=v.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();!d&&(null==c?void 0:c.length)||(v.value=null),u.value=d?c:"",p()}else(null===(l=null===(a=v.value)||void 0===a?void 0:a.values)||void 0===l?void 0:l.length)||(u.value=c.replace(" "," ").replace((null===(s=v.value)||void 0===s?void 0:s.keyInnerText.replace(" "," "))||"","").trim(),j(),p())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":z(e);break;case"Backspace":v.value||u.value?(null===(n=v.value)||void 0===n?void 0:n.values.length)&&((null===(r=v.value)||void 0===r?void 0:r.multiple)||v.value.isInValueList(v.value.values[0]))?(v.value.values.splice(-1,1),u.value="",j()):k(""):(i("delete"),(0,t.nextTick)(A));default:s.value=!1}var n,r},handleSelectItem:O,handleSelectCondtionItem:function(e){O(e,"condition")},handleMenuFooterClick:function(e){switch(e.id){case"confirm":z();break;case"cancel":v.value.values=[],j()}}}},render:function(){var e,n,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===(n=this.menuList)||void 0===n?void 0:n.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,t.createVNode)(x(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,t.withDirectives)((0,t.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?"":"请选择","data-tips":l||"",spellcheck:"false",onFocus:r.handleInputFocus,onInput:r.handleInputChange,onKeydown:r.handleInputKeyup},null),[[(0,t.resolveDirective)("clickoutside"),r.handleClickOutside]])},content:function(){var e;return r.loading?(0,t.createVNode)("div",null,[(0,t.createTextVNode)("加载中...")]):r.showNoSelectValueError?(0,t.createVNode)("div",null,[(0,t.createTextVNode)("包含键值的过滤查询必须有一个值")]):(null===(e=r.menuList)||void 0===e?void 0:e.length)?(0,t.createVNode)("div",{ref:"popoverRef",class:"bk-search-select-popover"},[(0,t.createVNode)(k,{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}})}}),z=(0,t.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},emits:["delete"],setup:function(e,n){var r=n.emit,i=(0,t.ref)(null),a=C(),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 V(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,n=function(n,r){return e.editKey==="".concat(n.id,"_").concat(r)?(0,t.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,t.createVNode)(N,{ref:"inputRef",key:e.editKey.toString(),mode:I.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(n),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,onAdd:function(t){return e.handleAddSelected(t,r)},onFocus:e.handleInputFocus},null)]):(0,t.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?r<e.overflowIndex:r>=0)?"":"hidden-selected"),key:"".concat(n.id,"_").concat(r)},[(0,t.createVNode)("span",{class:"selected-name",onClick:function(t){return e.handleEditSeleted(t,n,r)}},[n.inputInnerText]),(0,t.createVNode)(_.Close,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(r)}},null)])};return(0,t.createVNode)(t.Fragment,null,[this.selectedList.map((function(r,i){return[e.overflowIndex>=0&&i===e.overflowIndex&&(0,t.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,t.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),n(r,i)]}))])}});var O={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[{id:"or",name:"或"},{id:"and",name:"且"}]}},clearable:{type:Boolean,default:!0},getMenuList:Function,validateValues:Function,valueSplitCode:{type:String,default:"|"},uniqueSelect:{type:Boolean,default:!1}};const T=(0,t.defineComponent)({name:"SearchSelect",directives:{clickoutside:m.clickoutside},props:O,emits:["update:modelValue"],setup:function(n,r){var i,a,o=r.emit,l=(0,t.ref)(null),u=(0,t.ref)(null),v=(0,t.ref)(!1),h=(0,t.ref)([]),p=(0,t.ref)(-1),m=(0,e.debounce)(32,k),_=(0,t.ref)(""),g=(0,t.ref)(""),y=(0,t.computed)((function(){return n.valueSplitCode}));function w(e,t){_.value="".concat(e.id,"_").concat(t)}function b(e,t){var n=h.value.slice();n.splice(t,1,e),o("update:modelValue",n.map((function(e){return e.toValue()}))),_.value=""}function x(e){g.value=e||""}function k(){if(v.value||h.value.length<1)p.value=-1;else{for(var e=u.value.querySelector(".bk-search-select-container"),t=u.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<=t-40&&o<=r.length-1;){var l=r[o];if(l.clientHeight>n.minHeight)return void(p.value=o);(i+=l?l.clientWidth+6:0)>=t-40&&(a=o),o+=1}a===r.length-1&&i<=t?p.value=-1:p.value=i>=t-40?a:a-1}}return(0,t.watch)((function(){return n.data}),(function(){var e;null===(e=(i=(0,t.ref)(JSON.parse(JSON.stringify(n.data)))).value)||void 0===e||e.forEach((function(e){e.isSelected=!!n.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,t.watch)((function(){return n.modelValue}),(function(e){var t,r;if(!(null==e?void 0:e.length))return h.value=[],void(null===(t=i.value)||void 0===t||t.forEach((function(e){e.isSelected=!1})));var a=[];e.forEach((function(e){var t,r=h.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||[],a.push(r);else{var i=n.data.find((function(t){return t.id===e.id})),o="default";i||(i=n.conditions.find((function(t){return t.id===e.id})))&&(o="condition"),i||(null===(t=e.values)||void 0===t?void 0:t.length)||(o="text");var l=new V(i||e,o,y.value);l.values=e.values||[],a.push(l)}})),h.value=a,null===(r=i.value)||void 0===r||r.forEach((function(e){e.isSelected=!!a.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,t.onMounted)((function(){d(u.value.querySelector(".bk-search-select-container"),m)})),(0,t.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}!--s&&c&&c.parentNode.removeChild(c)}}(u.value.querySelector(".bk-search-select-container"),m)})),a={onEditClick:w,onEditEnter:b,onEditBlur:function(){_.value="",x("")},onValidate:x,editKey:_,valueSplitCode:y},(0,t.provide)(E,a),{inputRef:l,wrapRef:u,isFocus:v,copyData:i,selectedList:h,overflowIndex:p,validateStr:g,splitCode:y,onEditClick:w,onEditEnter:b,handleWrapClick:function(){_.value||l.value.handleInputFocus()},handleInputFocus:function(e){e&&(p.value=-1),v.value=e},handleResize:k,handleClearAll:function(){h.value=[],p.value=-1,o("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=u.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=h.value.slice();t.push(e),x(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=h.value.slice();t.splice("number"==typeof e?e:h.value.length-1,1),x(""),o("update:modelValue",t.map((function(e){return e.toValue()})))}}},render:function(){var e,n,r=this,i="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),a=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,o=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=r.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,t.createVNode)("div",{class:"bk-search-select",ref:"wrapRef"},[(0,t.createVNode)("div",{class:{"bk-search-select-container":!0,"is-focus":this.isFocus},onClick:this.handleWrapClick},[(0,t.createVNode)("div",{class:"search-prefix"},[null===(n=(e=this.$slots).prepend)||void 0===n?void 0:n.call(e)]),(0,t.createVNode)("div",{class:"search-container",style:{maxHeight:i}},[(0,t.createVNode)(z,{data:this.copyData,conditions:this.conditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,onDelete:this.handleDeleteSelected},Object.assign({},o)),(0,t.createVNode)("div",{class:"search-container-input"},[(0,t.createVNode)(N,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:a,conditions:this.conditions,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},o))])]),(0,t.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,t.createVNode)(_.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,t.createVNode)(_.Search,{class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,t.createVNode)("div",{class:"bk-search-select-tips"},[this.$slots.validate?this.$slots.validate():(0,t.createVNode)(t.Fragment,null,[(0,t.createVNode)(_.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var F=(0,e.withInstall)(T);const j=F})(),u})()));
@@ -33,7 +33,9 @@ declare const _default: import("vue").DefineComponent<{
33
33
  name: string;
34
34
  id: string;
35
35
  realId?: string;
36
+ isSelected?: boolean;
36
37
  };
38
+ isSelected?: boolean;
37
39
  }[]>;
38
40
  menuList: Ref<ISearchItem[]>;
39
41
  menuHoverId: Ref<string>;
@@ -1,4 +1,4 @@
1
- import { PropType } from 'vue';
1
+ import { PropType, Ref } from 'vue';
2
2
  import { GetMenuListFunc, ICommonItem, ISearchItem, ISearchValue, SearchItemType, SelectedItem, ValidateValuesFunc } from './utils';
3
3
  export declare const SearchSelectProps: {
4
4
  data: {
@@ -38,6 +38,10 @@ export declare const SearchSelectProps: {
38
38
  type: StringConstructor;
39
39
  default: string;
40
40
  };
41
+ uniqueSelect: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
41
45
  };
42
46
  declare const _default: import("vue").DefineComponent<{
43
47
  data: {
@@ -77,8 +81,12 @@ declare const _default: import("vue").DefineComponent<{
77
81
  type: StringConstructor;
78
82
  default: string;
79
83
  };
84
+ uniqueSelect: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
80
88
  }, {
81
- inputRef: import("vue").Ref<import("vue").DefineComponent<{
89
+ inputRef: Ref<import("vue").DefineComponent<{
82
90
  data: {
83
91
  type: PropType<ISearchItem[]>;
84
92
  required: true;
@@ -98,11 +106,11 @@ declare const _default: import("vue").DefineComponent<{
98
106
  getMenuList: PropType<GetMenuListFunc>;
99
107
  validateValues: PropType<ValidateValuesFunc>;
100
108
  }, {
101
- popoverRef: import("vue").Ref<HTMLDivElement>;
102
- inputRef: import("vue").Ref<HTMLDivElement>;
103
- keyword: import("vue").Ref<string>;
104
- loading: import("vue").Ref<boolean>;
105
- remoteMenuList: import("vue").Ref<{
109
+ popoverRef: Ref<HTMLDivElement>;
110
+ inputRef: Ref<HTMLDivElement>;
111
+ keyword: Ref<string>;
112
+ loading: Ref<boolean>;
113
+ remoteMenuList: Ref<{
106
114
  id: string;
107
115
  name: string;
108
116
  disabled?: boolean;
@@ -111,14 +119,16 @@ declare const _default: import("vue").DefineComponent<{
111
119
  name: string;
112
120
  id: string;
113
121
  realId?: string;
122
+ isSelected?: boolean;
114
123
  };
124
+ isSelected?: boolean;
115
125
  }[]>;
116
- menuList: import("vue").Ref<ISearchItem[]>;
117
- menuHoverId: import("vue").Ref<string>;
118
- isFocus: import("vue").Ref<boolean>;
119
- usingItem: import("vue").Ref<SelectedItem>;
120
- showPopover: import("vue").Ref<boolean>;
121
- showNoSelectValueError: import("vue").Ref<boolean>;
126
+ menuList: Ref<ISearchItem[]>;
127
+ menuHoverId: Ref<string>;
128
+ isFocus: Ref<boolean>;
129
+ usingItem: Ref<SelectedItem>;
130
+ showPopover: Ref<boolean>;
131
+ showNoSelectValueError: Ref<boolean>;
122
132
  debounceSetMenuList: {
123
133
  (this: any): any;
124
134
  cancel(): void;
@@ -160,9 +170,10 @@ declare const _default: import("vue").DefineComponent<{
160
170
  showInputBefore: boolean;
161
171
  showCondition: boolean;
162
172
  }>>;
163
- wrapRef: import("vue").Ref<HTMLDivElement>;
164
- isFocus: import("vue").Ref<boolean>;
165
- selectedList: import("vue").Ref<{
173
+ wrapRef: Ref<HTMLDivElement>;
174
+ isFocus: Ref<boolean>;
175
+ copyData: Ref<ISearchItem[]>;
176
+ selectedList: Ref<{
166
177
  id: string;
167
178
  name: string;
168
179
  values: {
@@ -174,7 +185,9 @@ declare const _default: import("vue").DefineComponent<{
174
185
  name: string;
175
186
  id: string;
176
187
  realId?: string;
188
+ isSelected?: boolean;
177
189
  };
190
+ isSelected?: boolean;
178
191
  }[];
179
192
  condition: string;
180
193
  searchItem: {
@@ -189,7 +202,9 @@ declare const _default: import("vue").DefineComponent<{
189
202
  name: string;
190
203
  id: string;
191
204
  realId?: string;
205
+ isSelected?: boolean;
192
206
  };
207
+ isSelected?: boolean;
193
208
  }[];
194
209
  multiple?: boolean;
195
210
  async?: boolean;
@@ -205,8 +220,11 @@ declare const _default: import("vue").DefineComponent<{
205
220
  name: string;
206
221
  id: string;
207
222
  realId?: string;
223
+ isSelected?: boolean;
208
224
  };
225
+ isSelected?: boolean;
209
226
  };
227
+ isSelected?: boolean;
210
228
  };
211
229
  type: SearchItemType;
212
230
  splitCode: string;
@@ -221,7 +239,9 @@ declare const _default: import("vue").DefineComponent<{
221
239
  name: string;
222
240
  id: string;
223
241
  realId?: string;
242
+ isSelected?: boolean;
224
243
  };
244
+ isSelected?: boolean;
225
245
  }[];
226
246
  readonly validate: boolean;
227
247
  readonly inputInnerHtml: string;
@@ -234,8 +254,8 @@ declare const _default: import("vue").DefineComponent<{
234
254
  toValueKey: () => string;
235
255
  isInValueList: (item: ICommonItem) => boolean;
236
256
  }[]>;
237
- overflowIndex: import("vue").Ref<number>;
238
- validateStr: import("vue").Ref<string>;
257
+ overflowIndex: Ref<number>;
258
+ validateStr: Ref<string>;
239
259
  splitCode: import("vue").ComputedRef<string>;
240
260
  onEditClick: (item: SelectedItem, index: number) => void;
241
261
  onEditEnter: (item: SelectedItem, index: number) => void;
@@ -284,6 +304,10 @@ declare const _default: import("vue").DefineComponent<{
284
304
  type: StringConstructor;
285
305
  default: string;
286
306
  };
307
+ uniqueSelect: {
308
+ type: BooleanConstructor;
309
+ default: boolean;
310
+ };
287
311
  }>> & {
288
312
  "onUpdate:modelValue"?: (...args: any[]) => any;
289
313
  }, {
@@ -295,5 +319,6 @@ declare const _default: import("vue").DefineComponent<{
295
319
  conditions: ICommonItem[];
296
320
  valueSplitCode: string;
297
321
  shrink: boolean;
322
+ uniqueSelect: boolean;
298
323
  }>;
299
324
  export default _default;
@@ -53,7 +53,9 @@ declare const _default: import("vue").DefineComponent<{
53
53
  name: string;
54
54
  id: string;
55
55
  realId?: string;
56
+ isSelected?: boolean;
56
57
  };
58
+ isSelected?: boolean;
57
59
  }[]>;
58
60
  menuList: import("vue").Ref<ISearchItem[]>;
59
61
  menuHoverId: import("vue").Ref<string>;
@@ -35,6 +35,7 @@ export interface ICommonItem {
35
35
  disabled?: boolean;
36
36
  realId?: string;
37
37
  value?: Omit<ICommonItem, 'disabled' | 'value'>;
38
+ isSelected?: boolean;
38
39
  }
39
40
  export interface ISearchValue extends Omit<ICommonItem, 'disabled' | 'value'> {
40
41
  type?: SearchItemType;
@@ -50,6 +51,7 @@ export interface ISearchItem {
50
51
  placeholder?: string;
51
52
  disabled?: boolean;
52
53
  value?: ICommonItem;
54
+ isSelected?: boolean;
53
55
  }
54
56
  export interface IMenuFooterItem {
55
57
  id: 'confirm' | 'cancel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.1-beta.346",
3
+ "version": "0.0.1-beta.347",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",