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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/index.cjs.js +135 -161
  2. package/dist/index.esm.js +16449 -19088
  3. package/dist/index.umd.js +135 -161
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +321 -1
  7. package/lib/alert/index.js +214 -1
  8. package/lib/animate-number/index.js +155 -1
  9. package/lib/backtop/index.js +188 -1
  10. package/lib/badge/index.js +235 -1
  11. package/lib/breadcrumb/index.js +309 -1
  12. package/lib/button/index.js +321 -1
  13. package/lib/card/index.js +285 -1
  14. package/lib/cascader/index.js +2036 -2
  15. package/lib/checkbox/index.js +542 -1
  16. package/lib/code-diff/index.js +5501 -1
  17. package/lib/collapse/index.js +570 -1
  18. package/lib/collapse-transition/index.js +177 -1
  19. package/lib/color-picker/index.js +2665 -1
  20. package/lib/components.js +530 -1
  21. package/lib/config-provider/index.js +365 -1
  22. package/lib/container/index.js +391 -1
  23. package/lib/date-picker/index.js +5555 -1
  24. package/lib/dialog/index.js +975 -2
  25. package/lib/directives/index.js +1375 -2
  26. package/lib/dist.index.js +87 -1
  27. package/lib/divider/index.js +169 -1
  28. package/lib/dropdown/index.js +369 -1
  29. package/lib/exception/index.js +385 -1
  30. package/lib/fixed-navbar/index.js +154 -1
  31. package/lib/form/index.js +952 -1
  32. package/lib/hooks.js +73 -1
  33. package/lib/icon/angle-double-down-line.js +191 -1
  34. package/lib/icon/angle-double-left-line.js +191 -1
  35. package/lib/icon/angle-double-left.js +191 -1
  36. package/lib/icon/angle-double-right-line.js +191 -1
  37. package/lib/icon/angle-double-right.js +191 -1
  38. package/lib/icon/angle-double-up-line.js +191 -1
  39. package/lib/icon/angle-down-fill.js +191 -1
  40. package/lib/icon/angle-down-line.js +191 -1
  41. package/lib/icon/angle-down.js +191 -1
  42. package/lib/icon/angle-left.js +191 -1
  43. package/lib/icon/angle-right.js +191 -1
  44. package/lib/icon/angle-up-fill.js +191 -1
  45. package/lib/icon/angle-up.js +191 -1
  46. package/lib/icon/archive-fill.js +191 -1
  47. package/lib/icon/arrows-left.js +191 -1
  48. package/lib/icon/arrows-right.js +191 -1
  49. package/lib/icon/assistant.js +191 -1
  50. package/lib/icon/audio-fill.js +191 -1
  51. package/lib/icon/bk.js +191 -1
  52. package/lib/icon/circle.js +191 -1
  53. package/lib/icon/close-line.js +191 -1
  54. package/lib/icon/close.js +191 -1
  55. package/lib/icon/code.js +191 -1
  56. package/lib/icon/cog-shape.js +191 -1
  57. package/lib/icon/collapse-left.js +191 -1
  58. package/lib/icon/copy-shape.js +191 -1
  59. package/lib/icon/copy.js +191 -1
  60. package/lib/icon/data-shape.js +191 -1
  61. package/lib/icon/del.js +191 -1
  62. package/lib/icon/doc-fill.js +191 -1
  63. package/lib/icon/done.js +191 -1
  64. package/lib/icon/down-shape.js +191 -1
  65. package/lib/icon/down-small.js +191 -1
  66. package/lib/icon/edit-line.js +191 -1
  67. package/lib/icon/ellipsis.js +191 -1
  68. package/lib/icon/enlarge-line.js +191 -1
  69. package/lib/icon/error.js +191 -1
  70. package/lib/icon/excel-fill.js +191 -1
  71. package/lib/icon/exclamation-circle-shape.js +191 -1
  72. package/lib/icon/eye.js +191 -1
  73. package/lib/icon/filliscreen-line.js +191 -1
  74. package/lib/icon/fix-line.js +191 -1
  75. package/lib/icon/fix-shape.js +191 -1
  76. package/lib/icon/folder-open.js +191 -1
  77. package/lib/icon/folder-shape-open.js +191 -1
  78. package/lib/icon/folder-shape.js +191 -1
  79. package/lib/icon/folder.js +191 -1
  80. package/lib/icon/funnel.js +191 -1
  81. package/lib/icon/help-document-fill.js +191 -1
  82. package/lib/icon/help-fill.js +191 -1
  83. package/lib/icon/help.js +191 -1
  84. package/lib/icon/image-fill.js +276 -1
  85. package/lib/icon/img-error.js +276 -1
  86. package/lib/icon/img-placehoulder.js +276 -1
  87. package/lib/icon/index.js +2399 -1
  88. package/lib/icon/info-line.js +276 -1
  89. package/lib/icon/info.js +276 -1
  90. package/lib/icon/left-shape.js +276 -1
  91. package/lib/icon/left-turn-line.js +276 -1
  92. package/lib/icon/narrow-line.js +276 -1
  93. package/lib/icon/original.js +276 -1
  94. package/lib/icon/pdf-fill.js +276 -1
  95. package/lib/icon/play-shape.js +276 -1
  96. package/lib/icon/plus.js +276 -1
  97. package/lib/icon/ppt-fill.js +276 -1
  98. package/lib/icon/qq.js +276 -1
  99. package/lib/icon/right-shape.js +276 -1
  100. package/lib/icon/right-turn-line.js +276 -1
  101. package/lib/icon/search.js +276 -1
  102. package/lib/icon/share.js +276 -1
  103. package/lib/icon/spinner.js +276 -1
  104. package/lib/icon/success.js +276 -1
  105. package/lib/icon/switcher-loading.js +276 -1
  106. package/lib/icon/text-file.js +276 -1
  107. package/lib/icon/text-fill.js +276 -1
  108. package/lib/icon/transfer.js +276 -1
  109. package/lib/icon/tree-application-shape.js +276 -1
  110. package/lib/icon/unfull-screen.js +276 -1
  111. package/lib/icon/unvisible.js +276 -1
  112. package/lib/icon/up-shape.js +276 -1
  113. package/lib/icon/upload.js +276 -1
  114. package/lib/icon/video-fill.js +276 -1
  115. package/lib/icon/warn.js +276 -1
  116. package/lib/icon/weixin-pro.js +276 -1
  117. package/lib/icon/weixin.js +276 -1
  118. package/lib/image/index.js +641 -1
  119. package/lib/index.js +97 -1
  120. package/lib/info-box/index.js +1165 -2
  121. package/lib/input/index.js +1218 -2
  122. package/lib/link/index.js +160 -1
  123. package/lib/loading/index.js +381 -1
  124. package/lib/locale/index.js +465 -1
  125. package/lib/menu/index.js +724 -1
  126. package/lib/message/index.js +1795 -2
  127. package/lib/modal/index.js +396 -1
  128. package/lib/navigation/index.js +367 -1
  129. package/lib/notify/index.js +397 -1
  130. package/lib/overflow-title/index.js +461 -1
  131. package/lib/pagination/index.js +880 -1
  132. package/lib/plugin-popover/index.js +4089 -1
  133. package/lib/plugins/index.js +63 -1
  134. package/lib/pop-confirm/index.js +273 -1
  135. package/lib/popover/index.js +4097 -1
  136. package/lib/popover2/index.js +107 -1
  137. package/lib/preset.js +93 -1
  138. package/lib/process/index.js +759 -2
  139. package/lib/progress/index.js +431 -1
  140. package/lib/radio/index.js +627 -1
  141. package/lib/rate/index.js +338 -1
  142. package/lib/resize-layout/index.js +429 -1
  143. package/lib/search-select/index.js +2729 -2
  144. package/lib/search-select/search-select.css +1 -3
  145. package/lib/search-select/search-select.less +1 -3
  146. package/lib/search-select/search-select.variable.css +1 -3
  147. package/lib/select/index.js +2251 -2
  148. package/lib/shared/index.js +2873 -1
  149. package/lib/sideslider/index.js +714 -2
  150. package/lib/slider/index.js +1291 -2
  151. package/lib/steps/index.js +825 -2
  152. package/lib/swiper/index.js +336 -1
  153. package/lib/switcher/index.js +277 -1
  154. package/lib/tab/index.js +914 -1
  155. package/lib/table/index.js +6421 -1
  156. package/lib/table/plugins/use-column-resize.d.ts +1 -1
  157. package/lib/table-column/index.js +763 -1
  158. package/lib/tag/index.js +233 -1
  159. package/lib/tag-input/index.js +1660 -1
  160. package/lib/tag-input/tag-input.d.ts +2 -14
  161. package/lib/time-picker/index.js +71 -1
  162. package/lib/timeline/index.js +241 -1
  163. package/lib/transfer/index.js +673 -1
  164. package/lib/tree/index.js +2686 -1
  165. package/lib/upload/index.js +2874 -2
  166. package/lib/virtual-render/index.js +865 -1
  167. package/package.json +13 -2
  168. package/lib/cascader/index.js.LICENSE.txt +0 -1
  169. package/lib/dialog/index.js.LICENSE.txt +0 -1
  170. package/lib/directives/index.js.LICENSE.txt +0 -14
  171. package/lib/info-box/index.js.LICENSE.txt +0 -1
  172. package/lib/input/index.js.LICENSE.txt +0 -1
  173. package/lib/message/index.js.LICENSE.txt +0 -6
  174. package/lib/process/index.js.LICENSE.txt +0 -1
  175. package/lib/search-select/index.js.LICENSE.txt +0 -1
  176. package/lib/select/index.js.LICENSE.txt +0 -1
  177. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  178. package/lib/slider/index.js.LICENSE.txt +0 -1
  179. package/lib/steps/index.js.LICENSE.txt +0 -1
  180. package/lib/upload/index.js.LICENSE.txt +0 -1
@@ -1,2 +1,2251 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- import*as e from"../shared";import*as t from"vue";import*as o from"lodash";import*as r from"../checkbox";import*as n from"../config-provider";import*as l from"../icon";import*as a from"../directives";import*as i from"../input";import*as u from"../loading";import*as s from"../popover";import*as c from"../virtual-render";import*as d from"../tag";var v={7609:(e,t,o)=>{var r=o(7425).default;function n(){e.exports=n=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},o=Object.prototype,l=o.hasOwnProperty,a=Object.defineProperty||function(e,t,o){e[t]=o.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function d(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,o){return e[t]=o}}function v(e,t,o,r){var n=t&&t.prototype instanceof h?t:h,l=Object.create(n.prototype),i=new I(r||[]);return a(l,"_invoke",{value:P(e,o,i)}),l}function p(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var f={};function h(){}function m(){}function g(){}var y={};d(y,u,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(O([])));T&&T!==o&&l.call(T,u)&&(y=T);var w=g.prototype=h.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function o(n,a,i,u){var s=p(e[n],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==r(d)&&l.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,i,u)}),(function(e){o("throw",e,i,u)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return o("throw",e,i,u)}))}u(s.arg)}var n;a(this,"_invoke",{value:function(e,r){function l(){return new t((function(t,n){o(e,r,t,n)}))}return n=n?n.then(l,l):l()}})}function P(e,t,o){var r="suspendedStart";return function(n,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw l;return{value:void 0,done:!0}}for(o.method=n,o.arg=l;;){var a=o.delegate;if(a){var i=N(a,o);if(i){if(i===f)continue;return i}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var u=p(e,t,o);if("normal"===u.type){if(r=o.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(r="completed",o.method="throw",o.arg=u.arg)}}}function N(e,t){var o=t.method,r=e.iterator[o];if(void 0===r)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=void 0,N(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),f;var n=p(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var l=n.arg;return l?l.done?(t[e.resultName]=l.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}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 I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function O(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o<e.length;)if(l.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return m.prototype=g,a(w,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:m,configurable:!0}),m.displayName=d(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),d(S.prototype,s,(function(){return this})),t.AsyncIterator=S,t.async=function(e,o,r,n,l){void 0===l&&(l=Promise);var a=new S(v(e,o,r,n),l);return t.isGeneratorFunction(o)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),d(w,c,"Generator"),d(w,u,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),o=[];for(var r in t)o.push(r);return o.reverse(),function e(){for(;o.length;){var r=o.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=O,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function o(o,r){return a.type="throw",a.arg=e,t.next=o,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r],a=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var i=l.call(n,"catchLoc"),u=l.call(n,"finallyLoc");if(i&&u){if(this.prev<n.catchLoc)return o(n.catchLoc,!0);if(this.prev<n.finallyLoc)return o(n.finallyLoc)}else if(i){if(this.prev<n.catchLoc)return o(n.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return o(n.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var n=r;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,f):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),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),V(o),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;V(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:O(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),f}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(o){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,o)=>{var r=o(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var o=p[e]={exports:{}};return v[e](o,o.exports,f),o.exports}f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},f.d=(e,t)=>{for(var o in t)f.o(t,o)&&!f.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var h={};(()=>{f.d(h,{T0:()=>R,GE:()=>k,i2:()=>F,ZP:()=>U});const v=(p={InputBehaviorType:()=>e.InputBehaviorType,PropTypes:()=>e.PropTypes,RenderType:()=>e.RenderType,SelectedType:()=>e.SelectedType,SelectedTypeEnum:()=>e.SelectedTypeEnum,SizeEnum:()=>e.SizeEnum,TagThemeType:()=>e.TagThemeType,classes:()=>e.classes,observerResize:()=>e.observerResize,useFormItem:()=>e.useFormItem,withInstallProps:()=>e.withInstallProps},m={},f.d(m,p),m);var p,m;function g(e){return g="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},g(e)}function y(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===g(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const b=(e=>{var t={};return f.d(t,e),t})({computed:()=>t.computed,createTextVNode:()=>t.createTextVNode,createVNode:()=>t.createVNode,customRef:()=>t.customRef,defineComponent:()=>t.defineComponent,getCurrentInstance:()=>t.getCurrentInstance,inject:()=>t.inject,isVNode:()=>t.isVNode,mergeProps:()=>t.mergeProps,onBeforeMount:()=>t.onBeforeMount,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,provide:()=>t.provide,reactive:()=>t.reactive,ref:()=>t.ref,toRef:()=>t.toRef,toRefs:()=>t.toRefs,vModelText:()=>t.vModelText,vShow:()=>t.vShow,watch:()=>t.watch,withDirectives:()=>t.withDirectives}),T=(e=>{var t={};return f.d(t,e),t})({debounce:()=>o.debounce,isEqual:()=>o.isEqual,merge:()=>o.merge}),w=(e=>{var t={};return f.d(t,e),t})({default:()=>r.default}),x=(e=>{var t={};return f.d(t,e),t})({useLocale:()=>n.useLocale,usePrefix:()=>n.usePrefix}),S=(e=>{var t={};return f.d(t,e),t})({AngleUp:()=>l.AngleUp,AngleUpFill:()=>l.AngleUpFill,Close:()=>l.Close,Done:()=>l.Done,Search:()=>l.Search});var P=f(2841),N=f.n(P);Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var C=Symbol("BkSelect"),V=Symbol("BkOptionGroup");function I(e){return{register:function(t,o){if(o&&!e.value.has(t))return e.value.set(t,o)},unregister:function(t){e.value.delete(t)}}}function O(e,t){var o=this,r=function(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=e;return(0,b.customRef)((function(e,n){return{get:function(){return e(),r},set:function(e){clearTimeout(t),void 0===e||""===e?(r=e,n()):t=setTimeout((function(){r=e,n()}),o)}}}))}(""),n=(0,b.ref)(!1);return(0,b.watch)(r,(function(){return l=o,a=void 0,i=void 0,u=N().mark((function o(){return N().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,n.value=!0,o.next=4,e(r.value);case 4:n.value=!1,o.next=10;break;case 7:o.prev=7,o.t0=o.catch(0),console.error(o.t0);case 10:return o.prev=10,null==t||t(),o.finish(10);case 13:case"end":return o.stop()}}),o,null,[[0,7,10,13]])})),new(i||(i=Promise))((function(e,t){function o(e){try{n(u.next(e))}catch(e){t(e)}}function r(e){try{n(u.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,r)}n((u=u.apply(l,a||[])).next())}));var l,a,i,u})),{searchKey:r,searchLoading:n}}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?String(e).trim().toLowerCase():e}const R=(0,b.defineComponent)({name:"Option",props:{id:{type:[String,Number,Object],require:!0},name:v.PropTypes.oneOfType([v.PropTypes.number,v.PropTypes.string]),disabled:v.PropTypes.bool.def(!1),order:v.PropTypes.number.def(0)},setup:function(e,t){var o=t.attrs,r=(0,b.getCurrentInstance)().proxy,n=(0,b.reactive)({visible:!0}),l=(0,b.toRefs)(e),a=l.disabled,i=l.id,u=l.name,s=(0,b.computed)((function(){return void 0!==u.value?u.value:o.label})),c=(0,b.computed)((function(){return void 0!==i.value?i.value:o.value})),d=(0,b.inject)(C,null),v=(0,b.inject)(V,null),p=(0,b.computed)((function(){var e;return null===(e=null==d?void 0:d.selected)||void 0===e?void 0:e.some((function(e){return(0,T.isEqual)(e.value,c.value)}))})),f=(0,b.computed)((function(){return null==d?void 0:d.multiple})),h=(0,b.computed)((function(){return(null==d?void 0:d.activeOptionValue)===c.value})),m=(0,b.computed)((function(){return(null==d?void 0:d.showSelectedIcon)&&f.value})),g=(0,b.computed)((function(){return null==d?void 0:d.selectedStyle}));(0,b.onBeforeMount)((function(){null==d||d.register(c.value,r),null==v||v.register(c.value,r)})),(0,b.onBeforeUnmount)((function(){null==d||d.unregister(c.value),null==v||v.unregister(c.value)}));var y=(0,x.usePrefix)().resolveClassName;return Object.assign(Object.assign({},(0,b.toRefs)(n)),{selected:p,multiple:f,isHover:h,showSelectedIcon:m,selectedStyle:g,optionName:s,optionID:c,handleOptionClick:function(){a.value||null==d||d.handleOptionSelected(r)},handleMouseEnter:function(){d.activeOptionValue=c.value},resolveClassName:y})},render:function(){var e,t,o,r=(0,v.classes)(y({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"is-checkbox":this.selectedStyle===v.SelectedTypeEnum.CHECKBOX},this.resolveClassName("select-option"),!0));return(0,b.withDirectives)((0,b.createVNode)("li",{class:r,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[this.showSelectedIcon&&this.selectedStyle===v.SelectedTypeEnum.CHECKBOX&&(0,b.createVNode)(w.default,{disabled:this.disabled,class:this.resolveClassName("select-checkbox"),modelValue:this.selected},null),null!==(o=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==o?o:(0,b.createVNode)("span",{class:this.resolveClassName("select-option-item"),title:String(this.optionName)},[this.optionName]),this.showSelectedIcon&&this.selected&&this.selectedStyle===v.SelectedTypeEnum.CHECK&&(0,b.createVNode)(S.Done,{class:this.resolveClassName("select-selected-icon"),width:22,height:22},null)]),[[b.vShow,this.visible]])}});function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function j(e){return function(e){if(Array.isArray(e))return L(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 L(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?L(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 k=(0,b.defineComponent)({name:"OptionGroup",props:{label:v.PropTypes.string.def(""),disabled:v.PropTypes.bool.def(!1),collapsible:v.PropTypes.bool.def(!1),collapse:v.PropTypes.bool.def(!1)},setup:function(e,t){var o=t.emit,r=(0,b.getCurrentInstance)(),n=r.proxy,l=(0,b.inject)(C,null),a=(0,b.reactive)({groupCollapse:e.collapse,visible:!0}),i=(0,b.ref)(new Map),u=I(i),s=u.register,c=u.unregister,d=(0,b.computed)((function(){return"".concat(e.label," (").concat(j(i.value.values()).filter((function(e){return e.visible})).length,")")}));(0,b.provide)(V,(0,b.reactive)(Object.assign(Object.assign({},(0,b.toRefs)(e)),{register:s,unregister:c,groupCollapse:(0,b.toRef)(a,"groupCollapse")}))),(0,b.onBeforeMount)((function(){null==l||l.registerGroup(r.uid,n)})),(0,b.onBeforeUnmount)((function(){null==l||l.unregisterGroup(r.uid)}));var v=(0,x.usePrefix)().resolveClassName;return Object.assign(Object.assign({},(0,b.toRefs)(a)),{groupLabel:d,handleToggleCollapse:function(){e.collapsible&&!e.disabled&&(a.groupCollapse=!a.groupCollapse,o("update:collapse",a.groupCollapse))},resolveClassName:v})},render:function(){var e,t,o,r,n=(0,v.classes)((y(e={},this.resolveClassName("option-group"),!0),y(e,"collapsible",this.collapsible),y(e,"disabled",this.disabled),e)),l=(0,v.classes)((y(t={},this.resolveClassName("option-group-label"),!0),y(t,"collapsible",this.collapsible),t)),a=(0,v.classes)({"default-group-label-icon":!0,collapse:this.groupCollapse});return(0,b.withDirectives)((0,b.createVNode)("ul",{class:n},[(0,b.createVNode)("li",{class:l,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():(0,b.createVNode)("span",{class:"default-group-label"},[this.collapsible&&(0,b.createVNode)(S.AngleUpFill,{class:a},null),(0,b.createVNode)("span",{class:"default-group-label-title"},[this.groupLabel])])]),(0,b.withDirectives)((0,b.createVNode)("ul",{class:this.resolveClassName("option-group-content")},[null===(r=(o=this.$slots).default)||void 0===r?void 0:r.call(o)]),[[b.vShow,!this.groupCollapse]])]),[[b.vShow,this.visible]])}}),D=(e=>{var t={};return f.d(t,e),t})({clickoutside:()=>a.clickoutside}),M=(e=>{var t={};return f.d(t,e),t})({default:()=>i.default}),A=(e=>{var t={};return f.d(t,e),t})({default:()=>u.default}),H=(e=>{var t={};return f.d(t,e),t})({default:()=>s.default}),$=(e=>{var t={};return f.d(t,e),t})({default:()=>c.default}),B=(e=>{var t={};return f.d(t,e),t})({default:()=>d.default}),_=(0,b.defineComponent)({name:"SelectTagInput",props:{selected:{type:Array,default:function(){return[]}},tagTheme:(0,v.TagThemeType)(),placeholder:v.PropTypes.string.def(""),filterable:v.PropTypes.bool.def(!1),allowCreate:v.PropTypes.bool.def(!1),disabled:v.PropTypes.bool.def(!1),modelValue:v.PropTypes.any,collapseTags:v.PropTypes.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup:function(e,t){var o=t.emit,r=(0,x.usePrefix)().resolveClassName,n=(0,b.inject)(C,null),l=(0,b.toRefs)(e),a=l.modelValue,i=l.collapseTags,u=l.selected,s=(0,b.ref)(a.value),c=(0,b.ref)(),d=(0,b.ref)(null);(0,b.watch)(a,(function(){s.value=a.value})),(0,b.watch)([u,i],(function(){f()}),{flush:"post"});var v=(0,b.ref)([]),p=(0,b.ref)(),f=function(){i.value&&(d.value=null,setTimeout((function(){var e,t,o=v.value.map((function(e){return null==e?void 0:e.$el})).filter((function(e){return!!e})),r=o.findIndex((function(e,t){return!!t&&o[t-1].offsetTop!==e.offsetTop}));d.value=r>0?r:null,(null===(e=o[d.value])||void 0===e?void 0:e.offsetTop)!==(null===(t=p.value)||void 0===t?void 0:t.offsetTop)&&d.value>1&&(d.value-=1)})))},h=(0,T.debounce)(f,150),m=(0,b.ref)(),g=new ResizeObserver((function(){h()}));return(0,b.onMounted)((function(){m.value&&g.observe(m.value)})),(0,b.onBeforeUnmount)((function(){m.value&&g.unobserve(m.value)})),{collapseTagRef:p,tagWrapperRef:m,tagsRefs:v,select:n,overflowTagIndex:d,value:s,inputRef:c,handleRemoveTag:function(e){o("remove",e)},focus:function(){var e;null===(e=c.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)},resolveClassName:r}},render:function(){var e,t,o,r,n,l,a,i,u,s,c=this,d=null===(o=null===(t=this.$slots)||void 0===t?void 0:t.prefix)||void 0===o?void 0:o.call(t),p=(0,v.classes)((y(e={},this.resolveClassName("select-tag"),!0),y(e,this.resolveClassName("select-tag--default"),!0),y(e,"is-disabled",this.disabled),y(e,"collapse-tag",this.collapseTags),y(e,"has-prefix",!!d),e)),f=(0,v.classes)(y({},this.resolveClassName("select-tag-wrapper"),!0)),h={display:this.selected.length&&!this.filterable?"none":""};return(0,b.createVNode)("div",{class:p,ref:"tagWrapperRef"},[null===(n=null===(r=this.$slots)||void 0===r?void 0:r.prefix)||void 0===n?void 0:n.call(r),(0,b.createVNode)("div",{class:f},[null!==(i=null===(a=(l=this.$slots).default)||void 0===a?void 0:a.call(l))&&void 0!==i?i:this.selected.map((function(e,t){var o;return(0,b.createVNode)(B.default,{closable:!0,theme:c.tagTheme,style:{display:c.collapseTags&&c.overflowTagIndex&&t>=c.overflowTagIndex?"none":""},ref:function(e){return c.tagsRefs[t]=e},onClose:function(){return c.handleRemoveTag(e.value)}},{default:function(){return[null===(o=c.select)||void 0===o?void 0:o.handleGetLabelByValue(e.value)]}})})),(0,b.createVNode)(B.default,{class:this.resolveClassName("select-overflow-tag"),style:{display:this.overflowTagIndex&&this.collapseTags?"":"none"},ref:"collapseTagRef"},{default:function(){return[(0,b.createTextVNode)("+"),c.selected.length-c.overflowTagIndex]}}),(0,b.createVNode)("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:h,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===(s=null===(u=this.$slots)||void 0===u?void 0:u.suffix)||void 0===s?void 0:s.call(u)])}});function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}const G=(0,b.defineComponent)({name:"Select",directives:{clickoutside:D.clickoutside},props:{modelValue:v.PropTypes.any,multiple:v.PropTypes.bool.def(!1),disabled:v.PropTypes.bool.def(!1),size:v.PropTypes.size().def(v.SizeEnum.DEFAULT),clearable:v.PropTypes.bool.def(!0),loading:v.PropTypes.bool.def(!1),filterable:v.PropTypes.bool.def(!1),remoteMethod:v.PropTypes.func,scrollHeight:v.PropTypes.number.def(200),showSelectAll:v.PropTypes.bool.def(!1),popoverMinWidth:v.PropTypes.number.def(0),showOnInit:v.PropTypes.bool.def(!1),multipleMode:v.PropTypes.oneOf(["default","tag"]).def("default"),tagTheme:(0,v.TagThemeType)(),behavior:(0,v.InputBehaviorType)(),collapseTags:v.PropTypes.bool.def(!1),autoHeight:v.PropTypes.bool.def(!0),noDataText:v.PropTypes.string,noMatchText:v.PropTypes.string,loadingText:v.PropTypes.string,placeholder:v.PropTypes.string,searchPlaceholder:v.PropTypes.string,selectAllText:v.PropTypes.string,scrollLoading:v.PropTypes.bool.def(!1),allowCreate:v.PropTypes.bool.def(!1),popoverOptions:Object,customContent:v.PropTypes.bool.def(!1),list:v.PropTypes.arrayOf(v.PropTypes.any).def([]),idKey:v.PropTypes.string.def("value"),displayKey:v.PropTypes.string.def("label"),withValidate:v.PropTypes.bool.def(!0),showSelectedIcon:v.PropTypes.bool.def(!0),inputSearch:v.PropTypes.bool.def(!0),enableVirtualRender:v.PropTypes.bool.def(!1),allowEmptyValues:v.PropTypes.array.def([]),autoFocus:v.PropTypes.bool.def(!1),keepSearchValue:v.PropTypes.bool.def(!1),prefix:v.PropTypes.string,selectedStyle:(0,v.SelectedType)(),filterOption:{type:[Boolean,Function],default:!0}},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur","tag-remove","select","deselect"],setup:function(e,t){var o=t.emit,r=(0,x.useLocale)("select"),n=(0,x.usePrefix)().resolveClassName,l=(0,b.toRefs)(e),a=l.modelValue,i=l.disabled,u=l.filterable,s=l.multiple,c=l.remoteMethod,d=l.loading,p=l.popoverMinWidth,f=l.showOnInit,h=l.multipleMode,m=l.allowCreate,y=l.customContent,w=l.showSelectedIcon,S=l.inputSearch,P=l.enableVirtualRender,N=l.showSelectAll,V=l.scrollHeight,R=l.list,L=l.displayKey,k=l.idKey,D=l.collapseTags,M=l.autoHeight,A=l.popoverOptions,H=l.allowEmptyValues,$=l.autoFocus,B=l.keepSearchValue,_=l.selectedStyle,G=l.filterOption,F=(0,b.computed)((function(){return void 0===e.noDataText?r.value.noData:e.noDataText})),U=(0,b.computed)((function(){return void 0===e.noMatchText?r.value.noMatchedData:e.noMatchText})),z=(0,b.computed)((function(){return void 0===e.loadingText?r.value.loading:e.loadingText})),W=(0,b.computed)((function(){return void 0===e.placeholder?r.value.pleaseSelect:e.placeholder})),q=(0,b.computed)((function(){return void 0===e.searchPlaceholder?r.value.enterKeywords:e.searchPlaceholder})),X=(0,b.computed)((function(){return void 0===e.selectAllText?r.value.all:e.selectAllText})),Y=(0,v.useFormItem)(),Z=(0,b.ref)(),J=(0,b.ref)(),Q=(0,b.ref)(),ee=(0,b.ref)(),te=(0,b.ref)(),oe=(0,b.ref)(),re=(0,b.ref)(),ne=(0,b.ref)(new Map),le=(0,b.computed)((function(){return j(ne.value.values()).sort((function(e,t){return e.order-t.order}))})),ae=(0,b.ref)(new Map),ie=(0,b.ref)([]),ue=(0,b.computed)((function(){return ie.value.reduce((function(e,t){return e[t.value]=t.label,e}),{})})),se=(0,b.ref)(),ce=(0,b.computed)((function(){return R.value.reduce((function(e,t){return e[t[k.value]]=t[L.value],e}),{})}));(0,b.watch)(a,(function(){var t;et(),e.withValidate&&(null===(t=null==Y?void 0:Y.validate)||void 0===t||t.call(Y,"change"))}),{deep:!0}),(0,b.watch)(ie,(function(){var e;null===(e=re.value)||void 0===e||e.updatePopover(null,Ne.value)}));var de=(0,b.computed)((function(){return ye.value?R.value:R.value.filter((function(e){var t;return be.value(qe.value,e)&&(null===(t=E(String(e[L.value])))||void 0===t?void 0:t.includes(E(qe.value)))}))})),ve=(0,b.computed)((function(){return i.value||d.value})),pe=(0,b.computed)((function(){return ie.value.map((function(e){var t,o;return(null===(o=null===(t=ne.value)||void 0===t?void 0:t.get(e.value))||void 0===o?void 0:o.optionName)||ce.value[e.value]||e.label}))})),fe=(0,b.computed)((function(){var e=le.value.reduce((function(e,t){return t.disabled||e.push(t.optionID),e}),[]);return e.length<=ie.value.length&&e.every((function(e){return ie.value.some((function(t){return t.value===e}))}))})),he=(0,b.computed)((function(){return!!ae.value.size})),me=(0,b.computed)((function(){return!le.value.length})),ge=(0,b.computed)((function(){return le.value.length&&le.value.every((function(e){return!e.visible}))})),ye=(0,b.computed)((function(){return u.value&&"function"==typeof c.value})),be=(0,b.computed)((function(){return"function"==typeof G.value?G.value:function(){return G.value}})),Te=(0,b.computed)((function(){return!(Xe.value||me.value||ge.value)||y.value})),we=(0,b.computed)((function(){return s.value&&N.value&&(!qe.value||!u.value)})),xe=(0,b.computed)((function(){return V.value-12-(we.value?32:0)})),Se=(0,b.computed)((function(){return Xe.value?z.value:ge.value||R.value.length&&!de.value.length?U.value:me.value?F.value:""})),Pe=(0,b.computed)((function(){return M.value?D.value&&!_e.value:D.value})),Ne=(0,b.computed)((function(){return(0,T.merge)({theme:"light ".concat(n("select-popover")),trigger:"manual",width:Be.value,arrow:!1,placement:"bottom-start",isShow:_e.value,reference:te.value,offset:6,popoverDelay:0,renderType:v.RenderType.AUTO},A.value)})),Ce=I(ne),Ve=Ce.register,Ie=Ce.unregister,Oe=I(ae),Ee=Oe.register,Re=Oe.unregister,Le=function(){var e=(0,b.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),je=Le.isHover,ke=Le.setHover,De=Le.cancelHover,Me=(0,b.ref)(!1),Ae=function(){Me.value||(Me.value=!0,o("focus"))},He=function(){Me.value&&(Me.value=!1,o("blur"))},$e=function(e,t){var o=e.popoverMinWidth,r=null,n=(0,b.ref)("auto"),l=(0,b.ref)(!1),a=function(){var e;n.value=Math.max(null===(e=t.value)||void 0===e?void 0:e.offsetWidth,o)};return(0,b.onMounted)((function(){t.value&&(r=(0,v.observerResize)(t.value,a,60,!0)).start()})),(0,b.onBeforeUnmount)((function(){null==r||r.stop(),r=null})),{isPopoverShow:l,popperWidth:n,togglePopover:function(){l.value=!l.value},hidePopover:function(){l.value=!1},showPopover:function(){l.value=!0}}}({popoverMinWidth:p.value},J),Be=$e.popperWidth,_e=$e.isPopoverShow,Ke=$e.hidePopover,Ge=$e.showPopover,Fe=$e.togglePopover,Ue=(0,b.computed)((function(){return(u.value&&S.value||m.value)&&_e.value}));(0,b.watch)(_e,(function(e){o("toggle",_e.value),e?(document.addEventListener("keydown",tt),setTimeout((function(){Je(),ze()}),10)):(B.value||(qe.value=""),document.removeEventListener("keydown",tt))}));var ze=function(){var e,t=ie.value[0],o=ne.value.get(null==t?void 0:t.value);o&&!o.disabled&&o.visible?se.value=null==t?void 0:t.value:se.value=null===(e=le.value.find((function(e){return!e.disabled&&e.visible})))||void 0===e?void 0:e.optionID},We=O(ye.value?c.value:function(e){u.value&&(e?le.value.forEach((function(t){var o;t.visible=be.value(e,Object.assign({},t.$props))&&(null===(o=E(String(t.optionName)))||void 0===o?void 0:o.includes(E(e)))})):le.value.forEach((function(e){e.visible=!0})))},ze),qe=We.searchKey,Xe=We.searchLoading,Ye=function(e){e!==a.value&&(o("update:modelValue",e,a.value),o("change",e,a.value))},Ze=function(e){if(!ve.value&&e){if(s.value){var t=ie.value.findIndex((function(t){return t.value===e.optionID}));t>-1?(ie.value.splice(t,1),Ye(ie.value.map((function(e){return e.value}))),o("deselect",e.optionID)):(ie.value.push({value:e.optionID,label:e.optionName||e.optionID}),Ye(ie.value.map((function(e){return e.value}))),o("select",e.optionID))}else ie.value=[{label:e.optionName||e.optionID,value:e.optionID}],Ye(e.optionID),o("select",e.optionID),Ke();Je()}},Je=function(){setTimeout((function(){var e,t,o;S.value||m.value?"tag"===h.value?null===(t=te.value)||void 0===t||t.focus():null===(o=Z.value)||void 0===o||o.focus():null===(e=ee.value)||void 0===e||e.focus()}),0)},Qe=function(e){var t,o,r=e;if("object"===g(r)){var n,l=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return K(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?K(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){i=!0,l=e},f:function(){try{a||null==o.return||o.return()}finally{if(i)throw l}}}}(ne.value.keys());try{for(l.s();!(n=l.n()).done;){var a=n.value;if((0,T.isEqual)(a,r)){r=a;break}}}catch(e){l.e(e)}finally{l.f()}}return(null===(o=null===(t=ne.value)||void 0===t?void 0:t.get(r))||void 0===o?void 0:o.optionName)||ce.value[r]||ue.value[r]||r},et=function(){Array.isArray(a.value)?ie.value=j(a.value.map((function(e){return{value:e,label:Qe(e)}}))):void 0!==a.value||H.value.includes(a.value)?ie.value=[{value:a.value,label:Qe(a.value)}]:ie.value=[]},tt=function(e){var t,o,r,n;if(_e.value){var l=le.value.filter((function(e){return!e.disabled&&e.visible})),a=l.findIndex((function(e){return e.optionID===se.value}));switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault();var i;(function(e,t){if(!e||!t)return!0;var o=e.getBoundingClientRect(),r=o.top,n=o.bottom,l=t.getBoundingClientRect(),a=l.top,i=l.bottom;return r>=a&&n<=i})(null===(t=l[i="ArrowDown"===e.code?a>=l.length-1?0:a+1:0===a?l.length-1:a-1])||void 0===t?void 0:t.$el,Q.value)||null===(r=null===(o=l[i])||void 0===o?void 0:o.$el)||void 0===r||r.scrollIntoView(),se.value=null===(n=l[i])||void 0===n?void 0:n.optionID;break;case"Backspace":if(!s.value||!ie.value.length||qe.value.length||e.target===ee.value)return;ie.value.pop(),Ye(ie.value.map((function(e){return e.value})));break;case"Enter":var u=e.target.value;if(m.value&&u)return;var c=ne.value.get(se.value);Ze(c)}}};return(0,b.provide)(C,(0,b.reactive)({multiple:s,selected:ie,activeOptionValue:se,showSelectedIcon:w,selectedStyle:_,register:Ve,unregister:Ie,registerGroup:Ee,unregisterGroup:Re,handleOptionSelected:Ze,handleGetLabelByValue:Qe})),(0,b.onMounted)((function(){et(),setTimeout((function(){f.value&&Ge(),$.value&&Je()}))})),{selected:ie,isInput:Ue,options:le,isDisabled:ve,selectedLabel:pe,isPopoverShow:_e,isHover:je,popperWidth:Be,inputRef:Z,triggerRef:J,contentRef:Q,searchRef:ee,selectTagInputRef:te,virtualRenderRef:oe,popoverRef:re,searchLoading:Xe,isOptionsEmpty:me,isSearchEmpty:ge,isFocus:Me,isShowSelectContent:Te,curContentText:Se,isGroup:he,searchKey:qe,isShowSelectAll:we,virtualHeight:xe,virtualList:de,isCollapseTags:Pe,popoverConfig:Ne,focusInput:Je,setHover:ke,cancelHover:De,handleFocus:Ae,handleBlur:He,handleTogglePopover:function(){ve.value||(Ae(),Fe())},handleClear:function(e){e.stopPropagation(),ie.value=[],Ye(s.value?[]:""),o("clear",s.value?[]:""),Ke()},hidePopover:Ke,showPopover:Ge,handleToggleAll:function(){var e;fe.value?ie.value=[]:(le.value.forEach((function(e){e.disabled||e.optionID in ue.value||ie.value.push({value:e.optionID,label:e.optionName||e.optionID})})),null===(e=R.value)||void 0===e||e.forEach((function(e){e.disabled||e[k.value]in ue.value||ie.value.push({value:e[k.value],label:e[L.value]})}))),Ye(ie.value.map((function(e){return e.value}))),Je()},handleOptionSelected:Ze,handleClickOutside:function(e){var t,o=e.event.target;(null===(t=J.value)||void 0===t?void 0:t.contains(o))||J.value===o||(Ke(),He())},handleScroll:function(e){var t=e.target;t.scrollTop+t.clientHeight===t.scrollHeight&&o("scroll-end")},handleDeleteTag:function(e){if(!ve.value){var t=ie.value.findIndex((function(t){return t.value===e}));t>-1&&(ie.value.splice(t,1),Ye(ie.value.map((function(e){return e.value}))),o("tag-remove",e))}},handleInputChange:function(e){u.value&&(qe.value=e)},handleSelectedAllOptionMouseEnter:function(){se.value=""},handlePopoverShow:function(){setTimeout((function(){var e,t;P.value&&(null===(t=null===(e=oe.value)||void 0===e?void 0:e.reset)||void 0===t||t.call(e))}))},localLoadingText:z,localPlaceholder:W,localSearchPlaceholder:q,localSelectAllText:X,resolveClassName:n,handleCreateCustomOption:function(e){var t=String(e);if(m.value&&t){var o=le.value.find((function(e){return E(String(e.optionName))===E(t)}));if(u.value&&o)return Ze(o),void(qe.value="");ne.value.get(t)||(s.value?(ie.value.push({value:t,label:t}),Ye(ie.value.map((function(e){return e.value})))):(ie.value=[{value:t,label:t}],Ye(t),Ke()),qe.value="")}}}},render:function(){var e,t=this,o=(0,v.classes)((y(e={},"".concat(this.resolveClassName("select")),!0),y(e,"popover-show",this.isPopoverShow),y(e,"is-disabled",this.isDisabled),y(e,"is-focus",this.isFocus),y(e,"is-filterable",this.filterable),y(e,this.size,!0),y(e,this.behavior,!0),e)),r=function(){return t.loading?(0,b.createVNode)(A.default,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):t.clearable&&t.isHover&&t.selected.length&&!t.isDisabled?(0,b.createVNode)(S.Close,{class:"clear-icon",onClick:t.handleClear},null):(0,b.createVNode)(S.AngleUp,{class:"angle-up"},null)};return(0,b.createVNode)("div",{class:o},[(0,b.createVNode)(H.default,(0,b.mergeProps)(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:function(){return(0,b.createVNode)("div",{class:t.resolveClassName("select-trigger"),style:{height:t.autoHeight&&t.collapseTags?"32px":""},ref:"triggerRef",onClick:t.handleTogglePopover,onMouseenter:t.setHover,onMouseleave:t.cancelHover},[(null===(l=(n=t.$slots).trigger)||void 0===l?void 0:l.call(n,{selected:t.selected}))||("tag"===t.multipleMode?(0,b.createVNode)(_,{ref:"selectTagInputRef",modelValue:t.searchKey,"onUpdate:modelValue":function(e){return t.searchKey=e},selected:t.selected,tagTheme:t.tagTheme,placeholder:t.localPlaceholder,filterable:t.isInput,disabled:t.isDisabled,onRemove:t.handleDeleteTag,collapseTags:t.isCollapseTags,onEnter:t.handleCreateCustomOption},{prefix:t.prefix?function(){return(0,b.createVNode)("div",{class:"".concat(t.resolveClassName("select--prefix-area"))},[(0,b.createVNode)("span",null,[t.prefix])])}:t.$slots.prefix?function(){var e,o;return null===(o=(e=t.$slots).prefix)||void 0===o?void 0:o.call(e)}:void 0,default:t.$slots.tag&&function(){return t.$slots.tag({selected:t.selected})},suffix:function(){return r()}}):(0,b.createVNode)(M.default,(0,b.mergeProps)({ref:"inputRef",type:"text",modelValue:t.isInput?t.searchKey:t.selectedLabel.join(","),placeholder:t.isInput&&t.selectedLabel.join(",")||t.localPlaceholder,readonly:!t.isInput,selectReadonly:!0,disabled:t.isDisabled,behavior:t.behavior,size:t.size,withValidate:!1,stopPropagation:!1,onInput:t.handleInputChange,onEnter:t.handleCreateCustomOption},t.prefix?{prefix:t.prefix}:null),"function"==typeof(o=e=Object.assign(Object.assign({},"function"==typeof t.$slots.prefix?{prefix:function(){var e,o;return null===(o=(e=t.$slots).prefix)||void 0===o?void 0:o.call(e)}}:null),{suffix:function(){return r()}}))||"[object Object]"===Object.prototype.toString.call(o)&&!(0,b.isVNode)(o)?e:{default:function(){return[e]}}))]);var e,o,n,l},content:function(){return(0,b.createVNode)("div",{class:t.resolveClassName("select-content-wrapper"),ref:"contentRef"},[t.filterable&&!t.inputSearch&&(0,b.createVNode)("div",{class:t.resolveClassName("select-search-wrapper")},[(0,b.createVNode)(S.Search,{class:"icon-search",width:16,height:16},null),(0,b.withDirectives)((0,b.createVNode)("input",{ref:"searchRef",class:t.resolveClassName("select-search-input"),placeholder:t.localSearchPlaceholder,"onUpdate:modelValue":function(e){return t.searchKey=e}},null),[[b.vModelText,t.searchKey]])]),!t.isShowSelectContent&&(0,b.createVNode)("div",{class:t.resolveClassName("select-empty")},[t.searchLoading&&(0,b.createVNode)(A.default,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,b.createVNode)("span",null,[t.curContentText])]),(0,b.createVNode)("div",{class:t.resolveClassName("select-content")},[(0,b.createVNode)("div",{class:t.enableVirtualRender?"":t.resolveClassName("select-dropdown"),style:{maxHeight:"".concat(t.scrollHeight,"px")},onScroll:t.handleScroll},[(0,b.withDirectives)((0,b.createVNode)("ul",{class:t.resolveClassName("select-options")},[t.isShowSelectAll&&(0,b.createVNode)("li",{class:t.resolveClassName("select-option"),onMouseenter:t.handleSelectedAllOptionMouseEnter,onClick:t.handleToggleAll},[t.localSelectAllText]),t.enableVirtualRender?(0,b.createVNode)($.default,{list:t.virtualList,height:t.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:function(e){var o,r,n=e.data,l=(null===(o=t.$slots)||void 0===o?void 0:o.optionRender)||(null===(r=t.$slots)||void 0===r?void 0:r.virtualScrollRender);return n.map((function(e){return(0,b.createVNode)(R,{key:e[t.idKey],id:e[t.idKey],name:e[t.displayKey]},"function"==typeof l?{default:function(){return l({item:e})}}:null)}))}}):t.list.map((function(e){var o;return(0,b.createVNode)(R,{id:e[t.idKey],name:e[t.displayKey]},(null===(o=t.$slots)||void 0===o?void 0:o.optionRender)?{default:function(){var o,r;return null===(r=null===(o=t.$slots)||void 0===o?void 0:o.optionRender)||void 0===r?void 0:r.call(o,{item:e})}}:null)})),null===(o=(e=t.$slots).default)||void 0===o?void 0:o.call(e),t.scrollLoading&&(0,b.createVNode)("li",{class:t.resolveClassName("select-options-loading")},[(0,b.createVNode)(A.default,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,b.createVNode)("span",null,[t.localLoadingText])])]),[[b.vShow,t.isShowSelectContent]])]),t.$slots.extension&&(0,b.createVNode)("div",{class:t.resolveClassName("select-extension")},[t.$slots.extension()])])]);var e,o}})])}});var F=(0,v.withInstallProps)(G,{Option:R,Group:k});const U=F})();var m=h.T0,g=h.GE,y=h.i2,b=h.ZP;export{m as BkOption,g as BkOptionGroup,y as BkSelect,b as default};
1
+ import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash_isEqual_ce045a54__ from "lodash/isEqual";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__ from "../checkbox";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash_merge_cf99375a__ from "lodash/merge";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__ from "../directives";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__input_752b0149__ from "../input";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__ from "../loading";
11
+ import * as __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__ from "../popover";
12
+ import * as __WEBPACK_EXTERNAL_MODULE__virtual_render_2d1a77c9__ from "../virtual-render";
13
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce";
14
+ import * as __WEBPACK_EXTERNAL_MODULE__tag_7d126a1d__ from "../tag";
15
+ /******/ var __webpack_modules__ = ({
16
+
17
+ /***/ 7609:
18
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19
+
20
+ var _typeof = (__webpack_require__(7425)["default"]);
21
+ function _regeneratorRuntime() {
22
+ "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
23
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
24
+ return exports;
25
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
26
+ var exports = {},
27
+ Op = Object.prototype,
28
+ hasOwn = Op.hasOwnProperty,
29
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
30
+ obj[key] = desc.value;
31
+ },
32
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
33
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
34
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
35
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
36
+ function define(obj, key, value) {
37
+ return Object.defineProperty(obj, key, {
38
+ value: value,
39
+ enumerable: !0,
40
+ configurable: !0,
41
+ writable: !0
42
+ }), obj[key];
43
+ }
44
+ try {
45
+ define({}, "");
46
+ } catch (err) {
47
+ define = function define(obj, key, value) {
48
+ return obj[key] = value;
49
+ };
50
+ }
51
+ function wrap(innerFn, outerFn, self, tryLocsList) {
52
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
53
+ generator = Object.create(protoGenerator.prototype),
54
+ context = new Context(tryLocsList || []);
55
+ return defineProperty(generator, "_invoke", {
56
+ value: makeInvokeMethod(innerFn, self, context)
57
+ }), generator;
58
+ }
59
+ function tryCatch(fn, obj, arg) {
60
+ try {
61
+ return {
62
+ type: "normal",
63
+ arg: fn.call(obj, arg)
64
+ };
65
+ } catch (err) {
66
+ return {
67
+ type: "throw",
68
+ arg: err
69
+ };
70
+ }
71
+ }
72
+ exports.wrap = wrap;
73
+ var ContinueSentinel = {};
74
+ function Generator() {}
75
+ function GeneratorFunction() {}
76
+ function GeneratorFunctionPrototype() {}
77
+ var IteratorPrototype = {};
78
+ define(IteratorPrototype, iteratorSymbol, function () {
79
+ return this;
80
+ });
81
+ var getProto = Object.getPrototypeOf,
82
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
83
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
84
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
85
+ function defineIteratorMethods(prototype) {
86
+ ["next", "throw", "return"].forEach(function (method) {
87
+ define(prototype, method, function (arg) {
88
+ return this._invoke(method, arg);
89
+ });
90
+ });
91
+ }
92
+ function AsyncIterator(generator, PromiseImpl) {
93
+ function invoke(method, arg, resolve, reject) {
94
+ var record = tryCatch(generator[method], generator, arg);
95
+ if ("throw" !== record.type) {
96
+ var result = record.arg,
97
+ value = result.value;
98
+ return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
99
+ invoke("next", value, resolve, reject);
100
+ }, function (err) {
101
+ invoke("throw", err, resolve, reject);
102
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
103
+ result.value = unwrapped, resolve(result);
104
+ }, function (error) {
105
+ return invoke("throw", error, resolve, reject);
106
+ });
107
+ }
108
+ reject(record.arg);
109
+ }
110
+ var previousPromise;
111
+ defineProperty(this, "_invoke", {
112
+ value: function value(method, arg) {
113
+ function callInvokeWithMethodAndArg() {
114
+ return new PromiseImpl(function (resolve, reject) {
115
+ invoke(method, arg, resolve, reject);
116
+ });
117
+ }
118
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
119
+ }
120
+ });
121
+ }
122
+ function makeInvokeMethod(innerFn, self, context) {
123
+ var state = "suspendedStart";
124
+ return function (method, arg) {
125
+ if ("executing" === state) throw new Error("Generator is already running");
126
+ if ("completed" === state) {
127
+ if ("throw" === method) throw arg;
128
+ return doneResult();
129
+ }
130
+ for (context.method = method, context.arg = arg;;) {
131
+ var delegate = context.delegate;
132
+ if (delegate) {
133
+ var delegateResult = maybeInvokeDelegate(delegate, context);
134
+ if (delegateResult) {
135
+ if (delegateResult === ContinueSentinel) continue;
136
+ return delegateResult;
137
+ }
138
+ }
139
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
140
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
141
+ context.dispatchException(context.arg);
142
+ } else "return" === context.method && context.abrupt("return", context.arg);
143
+ state = "executing";
144
+ var record = tryCatch(innerFn, self, context);
145
+ if ("normal" === record.type) {
146
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
147
+ return {
148
+ value: record.arg,
149
+ done: context.done
150
+ };
151
+ }
152
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
153
+ }
154
+ };
155
+ }
156
+ function maybeInvokeDelegate(delegate, context) {
157
+ var methodName = context.method,
158
+ method = delegate.iterator[methodName];
159
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
160
+ var record = tryCatch(method, delegate.iterator, context.arg);
161
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
162
+ var info = record.arg;
163
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
164
+ }
165
+ function pushTryEntry(locs) {
166
+ var entry = {
167
+ tryLoc: locs[0]
168
+ };
169
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
170
+ }
171
+ function resetTryEntry(entry) {
172
+ var record = entry.completion || {};
173
+ record.type = "normal", delete record.arg, entry.completion = record;
174
+ }
175
+ function Context(tryLocsList) {
176
+ this.tryEntries = [{
177
+ tryLoc: "root"
178
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
179
+ }
180
+ function values(iterable) {
181
+ if (iterable) {
182
+ var iteratorMethod = iterable[iteratorSymbol];
183
+ if (iteratorMethod) return iteratorMethod.call(iterable);
184
+ if ("function" == typeof iterable.next) return iterable;
185
+ if (!isNaN(iterable.length)) {
186
+ var i = -1,
187
+ next = function next() {
188
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
189
+ return next.value = undefined, next.done = !0, next;
190
+ };
191
+ return next.next = next;
192
+ }
193
+ }
194
+ return {
195
+ next: doneResult
196
+ };
197
+ }
198
+ function doneResult() {
199
+ return {
200
+ value: undefined,
201
+ done: !0
202
+ };
203
+ }
204
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
205
+ value: GeneratorFunctionPrototype,
206
+ configurable: !0
207
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
208
+ value: GeneratorFunction,
209
+ configurable: !0
210
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
211
+ var ctor = "function" == typeof genFun && genFun.constructor;
212
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
213
+ }, exports.mark = function (genFun) {
214
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
215
+ }, exports.awrap = function (arg) {
216
+ return {
217
+ __await: arg
218
+ };
219
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
220
+ return this;
221
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
222
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
223
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
224
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
225
+ return result.done ? result.value : iter.next();
226
+ });
227
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
228
+ return this;
229
+ }), define(Gp, "toString", function () {
230
+ return "[object Generator]";
231
+ }), exports.keys = function (val) {
232
+ var object = Object(val),
233
+ keys = [];
234
+ for (var key in object) keys.push(key);
235
+ return keys.reverse(), function next() {
236
+ for (; keys.length;) {
237
+ var key = keys.pop();
238
+ if (key in object) return next.value = key, next.done = !1, next;
239
+ }
240
+ return next.done = !0, next;
241
+ };
242
+ }, exports.values = values, Context.prototype = {
243
+ constructor: Context,
244
+ reset: function reset(skipTempReset) {
245
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
246
+ },
247
+ stop: function stop() {
248
+ this.done = !0;
249
+ var rootRecord = this.tryEntries[0].completion;
250
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
251
+ return this.rval;
252
+ },
253
+ dispatchException: function dispatchException(exception) {
254
+ if (this.done) throw exception;
255
+ var context = this;
256
+ function handle(loc, caught) {
257
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
258
+ }
259
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
260
+ var entry = this.tryEntries[i],
261
+ record = entry.completion;
262
+ if ("root" === entry.tryLoc) return handle("end");
263
+ if (entry.tryLoc <= this.prev) {
264
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
265
+ hasFinally = hasOwn.call(entry, "finallyLoc");
266
+ if (hasCatch && hasFinally) {
267
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
268
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
269
+ } else if (hasCatch) {
270
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
271
+ } else {
272
+ if (!hasFinally) throw new Error("try statement without catch or finally");
273
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
274
+ }
275
+ }
276
+ }
277
+ },
278
+ abrupt: function abrupt(type, arg) {
279
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
280
+ var entry = this.tryEntries[i];
281
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
282
+ var finallyEntry = entry;
283
+ break;
284
+ }
285
+ }
286
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
287
+ var record = finallyEntry ? finallyEntry.completion : {};
288
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
289
+ },
290
+ complete: function complete(record, afterLoc) {
291
+ if ("throw" === record.type) throw record.arg;
292
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
293
+ },
294
+ finish: function finish(finallyLoc) {
295
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
296
+ var entry = this.tryEntries[i];
297
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
298
+ }
299
+ },
300
+ "catch": function _catch(tryLoc) {
301
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
302
+ var entry = this.tryEntries[i];
303
+ if (entry.tryLoc === tryLoc) {
304
+ var record = entry.completion;
305
+ if ("throw" === record.type) {
306
+ var thrown = record.arg;
307
+ resetTryEntry(entry);
308
+ }
309
+ return thrown;
310
+ }
311
+ }
312
+ throw new Error("illegal catch attempt");
313
+ },
314
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
315
+ return this.delegate = {
316
+ iterator: values(iterable),
317
+ resultName: resultName,
318
+ nextLoc: nextLoc
319
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
320
+ }
321
+ }, exports;
322
+ }
323
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
324
+
325
+ /***/ }),
326
+
327
+ /***/ 7425:
328
+ /***/ ((module) => {
329
+
330
+ function _typeof(obj) {
331
+ "@babel/helpers - typeof";
332
+
333
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
334
+ return typeof obj;
335
+ } : function (obj) {
336
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
337
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
338
+ }
339
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
340
+
341
+ /***/ }),
342
+
343
+ /***/ 2841:
344
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
345
+
346
+ // TODO(Babel 8): Remove this file.
347
+
348
+ var runtime = __webpack_require__(7609)();
349
+ module.exports = runtime;
350
+
351
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
352
+ try {
353
+ regeneratorRuntime = runtime;
354
+ } catch (accidentalStrictMode) {
355
+ if (typeof globalThis === "object") {
356
+ globalThis.regeneratorRuntime = runtime;
357
+ } else {
358
+ Function("r", "regeneratorRuntime = r")(runtime);
359
+ }
360
+ }
361
+
362
+
363
+ /***/ })
364
+
365
+ /******/ });
366
+ /************************************************************************/
367
+ /******/ // The module cache
368
+ /******/ var __webpack_module_cache__ = {};
369
+ /******/
370
+ /******/ // The require function
371
+ /******/ function __webpack_require__(moduleId) {
372
+ /******/ // Check if module is in cache
373
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
374
+ /******/ if (cachedModule !== undefined) {
375
+ /******/ return cachedModule.exports;
376
+ /******/ }
377
+ /******/ // Create a new module (and put it into the cache)
378
+ /******/ var module = __webpack_module_cache__[moduleId] = {
379
+ /******/ // no module.id needed
380
+ /******/ // no module.loaded needed
381
+ /******/ exports: {}
382
+ /******/ };
383
+ /******/
384
+ /******/ // Execute the module function
385
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
386
+ /******/
387
+ /******/ // Return the exports of the module
388
+ /******/ return module.exports;
389
+ /******/ }
390
+ /******/
391
+ /************************************************************************/
392
+ /******/ /* webpack/runtime/compat get default export */
393
+ /******/ (() => {
394
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
395
+ /******/ __webpack_require__.n = (module) => {
396
+ /******/ var getter = module && module.__esModule ?
397
+ /******/ () => (module['default']) :
398
+ /******/ () => (module);
399
+ /******/ __webpack_require__.d(getter, { a: getter });
400
+ /******/ return getter;
401
+ /******/ };
402
+ /******/ })();
403
+ /******/
404
+ /******/ /* webpack/runtime/define property getters */
405
+ /******/ (() => {
406
+ /******/ // define getter functions for harmony exports
407
+ /******/ __webpack_require__.d = (exports, definition) => {
408
+ /******/ for(var key in definition) {
409
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
410
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
411
+ /******/ }
412
+ /******/ }
413
+ /******/ };
414
+ /******/ })();
415
+ /******/
416
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
417
+ /******/ (() => {
418
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
419
+ /******/ })();
420
+ /******/
421
+ /************************************************************************/
422
+ var __webpack_exports__ = {};
423
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
424
+ (() => {
425
+
426
+ // EXPORTS
427
+ __webpack_require__.d(__webpack_exports__, {
428
+ T0: () => (/* reexport */ src_option),
429
+ GE: () => (/* reexport */ optionGroup),
430
+ i2: () => (/* binding */ BkSelect),
431
+ ZP: () => (/* binding */ src)
432
+ });
433
+
434
+ ;// CONCATENATED MODULE: external "../shared"
435
+ var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
436
+ var y = x => () => x
437
+ const external_shared_namespaceObject = x({ ["InputBehaviorType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.InputBehaviorType, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["RenderType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.RenderType, ["SelectedType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.SelectedType, ["SelectedTypeEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.SelectedTypeEnum, ["SizeEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.SizeEnum, ["TagThemeType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.TagThemeType, ["classes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.classes, ["observerResize"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.observerResize, ["useFormItem"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.useFormItem, ["withInstallProps"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstallProps });
438
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
439
+ function _typeof(obj) {
440
+ "@babel/helpers - typeof";
441
+
442
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
443
+ return typeof obj;
444
+ } : function (obj) {
445
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
446
+ }, _typeof(obj);
447
+ }
448
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
449
+
450
+ function _toPrimitive(input, hint) {
451
+ if (_typeof(input) !== "object" || input === null) return input;
452
+ var prim = input[Symbol.toPrimitive];
453
+ if (prim !== undefined) {
454
+ var res = prim.call(input, hint || "default");
455
+ if (_typeof(res) !== "object") return res;
456
+ throw new TypeError("@@toPrimitive must return a primitive value.");
457
+ }
458
+ return (hint === "string" ? String : Number)(input);
459
+ }
460
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
461
+
462
+
463
+ function _toPropertyKey(arg) {
464
+ var key = _toPrimitive(arg, "string");
465
+ return _typeof(key) === "symbol" ? key : String(key);
466
+ }
467
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
468
+
469
+ function _defineProperty(obj, key, value) {
470
+ key = _toPropertyKey(key);
471
+ if (key in obj) {
472
+ Object.defineProperty(obj, key, {
473
+ value: value,
474
+ enumerable: true,
475
+ configurable: true,
476
+ writable: true
477
+ });
478
+ } else {
479
+ obj[key] = value;
480
+ }
481
+ return obj;
482
+ }
483
+ ;// CONCATENATED MODULE: external "vue"
484
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
485
+ var external_vue_y = x => () => x
486
+ const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["customRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.customRef, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["onBeforeMount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vModelText"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vModelText, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
487
+ ;// CONCATENATED MODULE: external "lodash/isEqual"
488
+ var isEqual_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
489
+ var isEqual_y = x => () => x
490
+ const isEqual_namespaceObject = isEqual_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_isEqual_ce045a54__["default"] });
491
+ ;// CONCATENATED MODULE: external "../checkbox"
492
+ var external_checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
493
+ var external_checkbox_y = x => () => x
494
+ const external_checkbox_namespaceObject = external_checkbox_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__["default"] });
495
+ ;// CONCATENATED MODULE: external "../config-provider"
496
+ var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
497
+ var external_config_provider_y = x => () => x
498
+ const external_config_provider_namespaceObject = external_config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
499
+ ;// CONCATENATED MODULE: external "../icon"
500
+ var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
501
+ var external_icon_y = x => () => x
502
+ const external_icon_namespaceObject = external_icon_x({ ["AngleUp"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleUp, ["AngleUpFill"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleUpFill, ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Done"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Done, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Search });
503
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
504
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
505
+ try {
506
+ var info = gen[key](arg);
507
+ var value = info.value;
508
+ } catch (error) {
509
+ reject(error);
510
+ return;
511
+ }
512
+ if (info.done) {
513
+ resolve(value);
514
+ } else {
515
+ Promise.resolve(value).then(_next, _throw);
516
+ }
517
+ }
518
+ function _asyncToGenerator(fn) {
519
+ return function () {
520
+ var self = this,
521
+ args = arguments;
522
+ return new Promise(function (resolve, reject) {
523
+ var gen = fn.apply(self, args);
524
+ function _next(value) {
525
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
526
+ }
527
+ function _throw(err) {
528
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
529
+ }
530
+ _next(undefined);
531
+ });
532
+ };
533
+ }
534
+ // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
535
+ var regenerator = __webpack_require__(2841);
536
+ var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
537
+ ;// CONCATENATED MODULE: ../../packages/select/src/common.ts
538
+
539
+
540
+ /*
541
+ * Tencent is pleased to support the open source community by making
542
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
543
+ *
544
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
545
+ *
546
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
547
+ *
548
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
549
+ *
550
+ * ---------------------------------------------------
551
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
552
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
553
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
554
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
555
+ *
556
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
557
+ * the Software.
558
+ *
559
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
560
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
561
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
562
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
563
+ * IN THE SOFTWARE.
564
+ */
565
+
566
+
567
+ var selectKey = Symbol('BkSelect');
568
+ var optionGroupKey = Symbol('BkOptionGroup');
569
+ function useHover() {
570
+ var isHover = (0,external_vue_namespaceObject.ref)(false);
571
+ var setHover = function setHover() {
572
+ isHover.value = true;
573
+ };
574
+ var cancelHover = function cancelHover() {
575
+ isHover.value = false;
576
+ };
577
+ return {
578
+ isHover: isHover,
579
+ setHover: setHover,
580
+ cancelHover: cancelHover
581
+ };
582
+ }
583
+ function useRegistry(data) {
584
+ // 注册item
585
+ var register = function register(key, item) {
586
+ if (!item) return;
587
+ if (data.value.has(key)) {
588
+ // console.warn(`repeat ${key}`, item);
589
+ return;
590
+ }
591
+ return data.value.set(key, item);
592
+ };
593
+ // 删除item
594
+ var unregister = function unregister(key) {
595
+ data.value["delete"](key);
596
+ };
597
+ return {
598
+ register: register,
599
+ unregister: unregister
600
+ };
601
+ }
602
+ function useDebouncedRef(value) {
603
+ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
604
+ var timeout;
605
+ var innerValue = value;
606
+ return (0,external_vue_namespaceObject.customRef)(function (track, trigger) {
607
+ return {
608
+ get: function get() {
609
+ track();
610
+ return innerValue;
611
+ },
612
+ set: function set(newValue) {
613
+ clearTimeout(timeout);
614
+ if (newValue === undefined || newValue === '') {
615
+ innerValue = newValue;
616
+ trigger();
617
+ } else {
618
+ timeout = setTimeout(function () {
619
+ innerValue = newValue;
620
+ trigger();
621
+ }, delay);
622
+ }
623
+ }
624
+ };
625
+ });
626
+ }
627
+ function usePopover(config, triggerRef) {
628
+ var popoverMinWidth = config.popoverMinWidth;
629
+ var observerIns = null;
630
+ var popperWidth = (0,external_vue_namespaceObject.ref)('auto');
631
+ var isPopoverShow = (0,external_vue_namespaceObject.ref)(false);
632
+ var togglePopover = function togglePopover() {
633
+ isPopoverShow.value = !isPopoverShow.value;
634
+ };
635
+ var hidePopover = function hidePopover() {
636
+ isPopoverShow.value = false;
637
+ };
638
+ var showPopover = function showPopover() {
639
+ isPopoverShow.value = true;
640
+ };
641
+ var triggerRefResize = function triggerRefResize() {
642
+ var _triggerRef$value;
643
+ popperWidth.value = Math.max((_triggerRef$value = triggerRef.value) === null || _triggerRef$value === void 0 ? void 0 : _triggerRef$value.offsetWidth, popoverMinWidth);
644
+ };
645
+ (0,external_vue_namespaceObject.onMounted)(function () {
646
+ if (!triggerRef.value) return;
647
+ observerIns = (0,external_shared_namespaceObject.observerResize)(triggerRef.value, triggerRefResize, 60, true);
648
+ observerIns.start();
649
+ });
650
+ (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
651
+ var _observerIns;
652
+ (_observerIns = observerIns) === null || _observerIns === void 0 ? void 0 : _observerIns.stop();
653
+ observerIns = null;
654
+ });
655
+ return {
656
+ isPopoverShow: isPopoverShow,
657
+ popperWidth: popperWidth,
658
+ togglePopover: togglePopover,
659
+ hidePopover: hidePopover,
660
+ showPopover: showPopover
661
+ };
662
+ }
663
+ function useRemoteSearch(method, callBack) {
664
+ var searchKey = useDebouncedRef('');
665
+ var searchLoading = (0,external_vue_namespaceObject.ref)(false);
666
+ (0,external_vue_namespaceObject.watch)(searchKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee() {
667
+ return regenerator_default().wrap(function _callee$(_context) {
668
+ while (1) switch (_context.prev = _context.next) {
669
+ case 0:
670
+ _context.prev = 0;
671
+ searchLoading.value = true;
672
+ _context.next = 4;
673
+ return method(searchKey.value);
674
+ case 4:
675
+ searchLoading.value = false;
676
+ _context.next = 10;
677
+ break;
678
+ case 7:
679
+ _context.prev = 7;
680
+ _context.t0 = _context["catch"](0);
681
+ console.error(_context.t0);
682
+ case 10:
683
+ _context.prev = 10;
684
+ callBack === null || callBack === void 0 ? void 0 : callBack();
685
+ return _context.finish(10);
686
+ case 13:
687
+ case "end":
688
+ return _context.stop();
689
+ }
690
+ }, _callee, null, [[0, 7, 10, 13]]);
691
+ })));
692
+ return {
693
+ searchKey: searchKey,
694
+ searchLoading: searchLoading
695
+ };
696
+ }
697
+ function toLowerCase() {
698
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
699
+ if (!value) return value;
700
+ return String(value).trim().toLowerCase();
701
+ }
702
+ function isInViewPort(el, client) {
703
+ if (!el || !client) return true;
704
+ var _el$getBoundingClient = el.getBoundingClientRect(),
705
+ elTop = _el$getBoundingClient.top,
706
+ elBottom = _el$getBoundingClient.bottom;
707
+ var _client$getBoundingCl = client.getBoundingClientRect(),
708
+ clientTop = _client$getBoundingCl.top,
709
+ clientBottom = _client$getBoundingCl.bottom;
710
+ return elTop >= clientTop && elBottom <= clientBottom;
711
+ }
712
+ ;// CONCATENATED MODULE: ../../packages/select/src/option.tsx
713
+
714
+
715
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
716
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
717
+ /* eslint-disable vue/no-reserved-component-names */
718
+ /*
719
+ * Tencent is pleased to support the open source community by making
720
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
721
+ *
722
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
723
+ *
724
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
725
+ *
726
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
727
+ *
728
+ * ---------------------------------------------------
729
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
730
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
731
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
732
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
733
+ *
734
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
735
+ * the Software.
736
+ *
737
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
738
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
739
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
740
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
741
+ * IN THE SOFTWARE.
742
+ */
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+ /* harmony default export */ const src_option = ((0,external_vue_namespaceObject.defineComponent)({
751
+ name: 'Option',
752
+ props: {
753
+ id: {
754
+ type: [String, Number, Object],
755
+ require: true
756
+ },
757
+ name: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.string]),
758
+ disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
759
+ order: external_shared_namespaceObject.PropTypes.number.def(0)
760
+ },
761
+ setup: function setup(props, _ref) {
762
+ var attrs = _ref.attrs;
763
+ var _getCurrentInstance = (0,external_vue_namespaceObject.getCurrentInstance)(),
764
+ proxy = _getCurrentInstance.proxy;
765
+ var states = (0,external_vue_namespaceObject.reactive)({
766
+ visible: true
767
+ });
768
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
769
+ disabled = _toRefs.disabled,
770
+ id = _toRefs.id,
771
+ name = _toRefs.name;
772
+ // 兼容label
773
+ var optionName = (0,external_vue_namespaceObject.computed)(function () {
774
+ return name.value !== undefined ? name.value : attrs.label;
775
+ });
776
+ // 兼容value
777
+ var optionID = (0,external_vue_namespaceObject.computed)(function () {
778
+ return id.value !== undefined ? id.value : attrs.value;
779
+ });
780
+ var select = (0,external_vue_namespaceObject.inject)(selectKey, null);
781
+ var group = (0,external_vue_namespaceObject.inject)(optionGroupKey, null);
782
+ var selected = (0,external_vue_namespaceObject.computed)(function () {
783
+ var _select$selected;
784
+ return select === null || select === void 0 || (_select$selected = select.selected) === null || _select$selected === void 0 ? void 0 : _select$selected.some(function (item) {
785
+ return (0,isEqual_namespaceObject["default"])(item.value, optionID.value);
786
+ });
787
+ });
788
+ var multiple = (0,external_vue_namespaceObject.computed)(function () {
789
+ return select === null || select === void 0 ? void 0 : select.multiple;
790
+ });
791
+ var isHover = (0,external_vue_namespaceObject.computed)(function () {
792
+ return (select === null || select === void 0 ? void 0 : select.activeOptionValue) === optionID.value;
793
+ });
794
+ var showSelectedIcon = (0,external_vue_namespaceObject.computed)(function () {
795
+ return (select === null || select === void 0 ? void 0 : select.showSelectedIcon) && multiple.value;
796
+ });
797
+ var selectedStyle = (0,external_vue_namespaceObject.computed)(function () {
798
+ return select === null || select === void 0 ? void 0 : select.selectedStyle;
799
+ });
800
+ var handleOptionClick = function handleOptionClick() {
801
+ if (disabled.value) return;
802
+ select === null || select === void 0 ? void 0 : select.handleOptionSelected(proxy);
803
+ };
804
+ var handleMouseEnter = function handleMouseEnter() {
805
+ select.activeOptionValue = optionID.value;
806
+ };
807
+ (0,external_vue_namespaceObject.onBeforeMount)(function () {
808
+ select === null || select === void 0 ? void 0 : select.register(optionID.value, proxy);
809
+ group === null || group === void 0 ? void 0 : group.register(optionID.value, proxy);
810
+ });
811
+ (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
812
+ select === null || select === void 0 ? void 0 : select.unregister(optionID.value);
813
+ group === null || group === void 0 ? void 0 : group.unregister(optionID.value);
814
+ });
815
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
816
+ resolveClassName = _usePrefix.resolveClassName;
817
+ return _objectSpread(_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(states)), {}, {
818
+ selected: selected,
819
+ multiple: multiple,
820
+ isHover: isHover,
821
+ showSelectedIcon: showSelectedIcon,
822
+ selectedStyle: selectedStyle,
823
+ optionName: optionName,
824
+ optionID: optionID,
825
+ handleOptionClick: handleOptionClick,
826
+ handleMouseEnter: handleMouseEnter,
827
+ resolveClassName: resolveClassName
828
+ });
829
+ },
830
+ render: function render() {
831
+ var _this$$slots$default, _this$$slots$default2, _this$$slots;
832
+ var selectItemClass = (0,external_shared_namespaceObject.classes)(_defineProperty({
833
+ 'is-selected': this.selected,
834
+ 'is-disabled': this.disabled,
835
+ 'is-multiple': this.multiple,
836
+ 'is-hover': this.isHover,
837
+ 'is-checkbox': this.selectedStyle === external_shared_namespaceObject.SelectedTypeEnum.CHECKBOX
838
+ }, this.resolveClassName('select-option'), true));
839
+ return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("li", {
840
+ "class": selectItemClass,
841
+ "onClick": this.handleOptionClick,
842
+ "onMouseenter": this.handleMouseEnter
843
+ }, [this.showSelectedIcon && this.selectedStyle === external_shared_namespaceObject.SelectedTypeEnum.CHECKBOX && (0,external_vue_namespaceObject.createVNode)(external_checkbox_namespaceObject["default"], {
844
+ "disabled": this.disabled,
845
+ "class": this.resolveClassName('select-checkbox'),
846
+ "modelValue": this.selected
847
+ }, null), (_this$$slots$default = (_this$$slots$default2 = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : (0,external_vue_namespaceObject.createVNode)("span", {
848
+ "class": this.resolveClassName('select-option-item'),
849
+ "title": String(this.optionName)
850
+ }, [this.optionName]), this.showSelectedIcon && this.selected && this.selectedStyle === external_shared_namespaceObject.SelectedTypeEnum.CHECK && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Done, {
851
+ "class": this.resolveClassName('select-selected-icon'),
852
+ "width": 22,
853
+ "height": 22
854
+ }, null)]), [[external_vue_namespaceObject.vShow, this.visible]]);
855
+ }
856
+ }));
857
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
858
+ function _arrayLikeToArray(arr, len) {
859
+ if (len == null || len > arr.length) len = arr.length;
860
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
861
+ return arr2;
862
+ }
863
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
864
+
865
+ function _arrayWithoutHoles(arr) {
866
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
867
+ }
868
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
869
+ function _iterableToArray(iter) {
870
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
871
+ }
872
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
873
+
874
+ function _unsupportedIterableToArray(o, minLen) {
875
+ if (!o) return;
876
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
877
+ var n = Object.prototype.toString.call(o).slice(8, -1);
878
+ if (n === "Object" && o.constructor) n = o.constructor.name;
879
+ if (n === "Map" || n === "Set") return Array.from(o);
880
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
881
+ }
882
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
883
+ function _nonIterableSpread() {
884
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
885
+ }
886
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
887
+
888
+
889
+
890
+
891
+ function _toConsumableArray(arr) {
892
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
893
+ }
894
+ ;// CONCATENATED MODULE: ../../packages/select/src/optionGroup.tsx
895
+
896
+
897
+
898
+ function optionGroup_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
899
+ function optionGroup_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? optionGroup_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : optionGroup_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
900
+ /*
901
+ * Tencent is pleased to support the open source community by making
902
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
903
+ *
904
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
905
+ *
906
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
907
+ *
908
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
909
+ *
910
+ * ---------------------------------------------------
911
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
912
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
913
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
914
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
915
+ *
916
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
917
+ * the Software.
918
+ *
919
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
920
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
921
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
922
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
923
+ * IN THE SOFTWARE.
924
+ */
925
+
926
+
927
+
928
+
929
+
930
+ /* harmony default export */ const optionGroup = ((0,external_vue_namespaceObject.defineComponent)({
931
+ name: 'OptionGroup',
932
+ props: {
933
+ label: external_shared_namespaceObject.PropTypes.string.def(''),
934
+ disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
935
+ collapsible: external_shared_namespaceObject.PropTypes.bool.def(false),
936
+ collapse: external_shared_namespaceObject.PropTypes.bool.def(false) // 是否折叠初始状态
937
+ },
938
+ setup: function setup(props, _ref) {
939
+ var emit = _ref.emit;
940
+ var instance = (0,external_vue_namespaceObject.getCurrentInstance)();
941
+ var proxy = instance.proxy;
942
+ var select = (0,external_vue_namespaceObject.inject)(selectKey, null);
943
+ var states = (0,external_vue_namespaceObject.reactive)({
944
+ groupCollapse: props.collapse,
945
+ visible: true
946
+ });
947
+ var optionsMap = (0,external_vue_namespaceObject.ref)(new Map());
948
+ var _useRegistry = useRegistry(optionsMap),
949
+ register = _useRegistry.register,
950
+ unregister = _useRegistry.unregister;
951
+ var groupLabel = (0,external_vue_namespaceObject.computed)(function () {
952
+ return "".concat(props.label, " (").concat(_toConsumableArray(optionsMap.value.values()).filter(function (option) {
953
+ return option.visible;
954
+ }).length, ")");
955
+ });
956
+ var handleToggleCollapse = function handleToggleCollapse() {
957
+ if (!props.collapsible || props.disabled) return;
958
+ states.groupCollapse = !states.groupCollapse;
959
+ emit('update:collapse', states.groupCollapse);
960
+ };
961
+ (0,external_vue_namespaceObject.provide)(optionGroupKey, (0,external_vue_namespaceObject.reactive)(optionGroup_objectSpread(optionGroup_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(props)), {}, {
962
+ register: register,
963
+ unregister: unregister,
964
+ groupCollapse: (0,external_vue_namespaceObject.toRef)(states, 'groupCollapse')
965
+ })));
966
+ (0,external_vue_namespaceObject.onBeforeMount)(function () {
967
+ select === null || select === void 0 ? void 0 : select.registerGroup(instance.uid, proxy);
968
+ });
969
+ (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
970
+ select === null || select === void 0 ? void 0 : select.unregisterGroup(instance.uid);
971
+ });
972
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
973
+ resolveClassName = _usePrefix.resolveClassName;
974
+ return optionGroup_objectSpread(optionGroup_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(states)), {}, {
975
+ groupLabel: groupLabel,
976
+ handleToggleCollapse: handleToggleCollapse,
977
+ resolveClassName: resolveClassName
978
+ });
979
+ },
980
+ render: function render() {
981
+ var _classes, _classes2, _this$$slots$default, _this$$slots;
982
+ var groupClass = (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, this.resolveClassName('option-group'), true), _defineProperty(_classes, "collapsible", this.collapsible), _defineProperty(_classes, "disabled", this.disabled), _classes));
983
+ var groupLabelClass = (0,external_shared_namespaceObject.classes)((_classes2 = {}, _defineProperty(_classes2, this.resolveClassName('option-group-label'), true), _defineProperty(_classes2, "collapsible", this.collapsible), _classes2));
984
+ var groupLabelIconClass = (0,external_shared_namespaceObject.classes)({
985
+ 'default-group-label-icon': true,
986
+ collapse: this.groupCollapse
987
+ });
988
+ return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("ul", {
989
+ "class": groupClass
990
+ }, [(0,external_vue_namespaceObject.createVNode)("li", {
991
+ "class": groupLabelClass,
992
+ "onClick": this.handleToggleCollapse
993
+ }, [this.$slots.label ? this.$slots.label() : (0,external_vue_namespaceObject.createVNode)("span", {
994
+ "class": "default-group-label"
995
+ }, [this.collapsible && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleUpFill, {
996
+ "class": groupLabelIconClass
997
+ }, null), (0,external_vue_namespaceObject.createVNode)("span", {
998
+ "class": "default-group-label-title"
999
+ }, [this.groupLabel])])]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("ul", {
1000
+ "class": this.resolveClassName('option-group-content')
1001
+ }, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)]), [[external_vue_namespaceObject.vShow, !this.groupCollapse]])]), [[external_vue_namespaceObject.vShow, this.visible]]);
1002
+ }
1003
+ }));
1004
+ ;// CONCATENATED MODULE: external "lodash/merge"
1005
+ var merge_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1006
+ var merge_y = x => () => x
1007
+ const merge_namespaceObject = merge_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_merge_cf99375a__["default"] });
1008
+ ;// CONCATENATED MODULE: external "../directives"
1009
+ var external_directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1010
+ var external_directives_y = x => () => x
1011
+ const external_directives_namespaceObject = external_directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__.clickoutside });
1012
+ ;// CONCATENATED MODULE: external "../input"
1013
+ var external_input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1014
+ var external_input_y = x => () => x
1015
+ const external_input_namespaceObject = external_input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__input_752b0149__["default"] });
1016
+ ;// CONCATENATED MODULE: external "../loading"
1017
+ var external_loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1018
+ var external_loading_y = x => () => x
1019
+ const external_loading_namespaceObject = external_loading_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__["default"] });
1020
+ ;// CONCATENATED MODULE: external "../popover"
1021
+ var external_popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1022
+ var external_popover_y = x => () => x
1023
+ const external_popover_namespaceObject = external_popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__["default"] });
1024
+ ;// CONCATENATED MODULE: external "../virtual-render"
1025
+ var external_virtual_render_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1026
+ var external_virtual_render_y = x => () => x
1027
+ const external_virtual_render_namespaceObject = external_virtual_render_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__virtual_render_2d1a77c9__["default"] });
1028
+ ;// CONCATENATED MODULE: external "lodash/debounce"
1029
+ var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1030
+ var debounce_y = x => () => x
1031
+ const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
1032
+ ;// CONCATENATED MODULE: external "../tag"
1033
+ var external_tag_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1034
+ var external_tag_y = x => () => x
1035
+ const external_tag_namespaceObject = external_tag_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__tag_7d126a1d__["default"] });
1036
+ ;// CONCATENATED MODULE: ../../packages/select/src/selectTagInput.tsx
1037
+
1038
+
1039
+ /*
1040
+ * Tencent is pleased to support the open source community by making
1041
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1042
+ *
1043
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1044
+ *
1045
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1046
+ *
1047
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1048
+ *
1049
+ * ---------------------------------------------------
1050
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1051
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1052
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1053
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1054
+ *
1055
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1056
+ * the Software.
1057
+ *
1058
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1059
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1060
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1061
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1062
+ * IN THE SOFTWARE.
1063
+ */
1064
+
1065
+
1066
+
1067
+
1068
+
1069
+
1070
+ /* harmony default export */ const selectTagInput = ((0,external_vue_namespaceObject.defineComponent)({
1071
+ name: 'SelectTagInput',
1072
+ props: {
1073
+ selected: {
1074
+ type: Array,
1075
+ "default": function _default() {
1076
+ return [];
1077
+ }
1078
+ },
1079
+ tagTheme: (0,external_shared_namespaceObject.TagThemeType)(),
1080
+ placeholder: external_shared_namespaceObject.PropTypes.string.def(''),
1081
+ filterable: external_shared_namespaceObject.PropTypes.bool.def(false),
1082
+ allowCreate: external_shared_namespaceObject.PropTypes.bool.def(false),
1083
+ disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
1084
+ modelValue: external_shared_namespaceObject.PropTypes.any,
1085
+ collapseTags: external_shared_namespaceObject.PropTypes.bool.def(false)
1086
+ },
1087
+ emits: ['update:modelValue', 'remove', 'enter', 'keydown'],
1088
+ setup: function setup(props, _ref) {
1089
+ var emit = _ref.emit;
1090
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
1091
+ resolveClassName = _usePrefix.resolveClassName;
1092
+ var select = (0,external_vue_namespaceObject.inject)(selectKey, null);
1093
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
1094
+ modelValue = _toRefs.modelValue,
1095
+ collapseTags = _toRefs.collapseTags,
1096
+ selected = _toRefs.selected;
1097
+ var value = (0,external_vue_namespaceObject.ref)(modelValue.value);
1098
+ var inputRef = (0,external_vue_namespaceObject.ref)();
1099
+ var overflowTagIndex = (0,external_vue_namespaceObject.ref)(null);
1100
+ (0,external_vue_namespaceObject.watch)(modelValue, function () {
1101
+ value.value = modelValue.value;
1102
+ });
1103
+ (0,external_vue_namespaceObject.watch)([selected, collapseTags], function () {
1104
+ calcOverflow();
1105
+ }, {
1106
+ flush: 'post'
1107
+ });
1108
+ var handleRemoveTag = function handleRemoveTag(val) {
1109
+ emit('remove', val);
1110
+ };
1111
+ var focus = function focus() {
1112
+ var _inputRef$value;
1113
+ (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value.focus();
1114
+ };
1115
+ var handleInput = function handleInput(e) {
1116
+ emit('update:modelValue', e.target.value);
1117
+ };
1118
+ var handleKeydown = function handleKeydown(e) {
1119
+ switch (e.code) {
1120
+ case 'Enter':
1121
+ {
1122
+ emit('enter', e.target.value, e);
1123
+ break;
1124
+ }
1125
+ }
1126
+ emit('keydown', e.target.value, e);
1127
+ };
1128
+ var tagsRefs = (0,external_vue_namespaceObject.ref)([]);
1129
+ var collapseTagRef = (0,external_vue_namespaceObject.ref)();
1130
+ var getTagDOM = function getTagDOM(index) {
1131
+ var tagDomList = tagsRefs.value.map(function (item) {
1132
+ return item === null || item === void 0 ? void 0 : item.$el;
1133
+ }).filter(function (item) {
1134
+ return !!item;
1135
+ });
1136
+ return typeof index === 'number' ? tagDomList[index] : tagDomList;
1137
+ };
1138
+ // 计算出现换行的索引
1139
+ var calcOverflow = function calcOverflow() {
1140
+ if (!collapseTags.value) return;
1141
+ overflowTagIndex.value = null;
1142
+ setTimeout(function () {
1143
+ var _tags$overflowTagInde, _collapseTagRef$value;
1144
+ var tags = getTagDOM();
1145
+ // 出现换行的Index位置
1146
+ var tagIndexInSecondRow = tags.findIndex(function (currentTag, index) {
1147
+ if (!index) {
1148
+ return false;
1149
+ }
1150
+ var previousTag = tags[index - 1];
1151
+ return previousTag.offsetTop !== currentTag.offsetTop;
1152
+ });
1153
+ overflowTagIndex.value = tagIndexInSecondRow > 0 ? tagIndexInSecondRow : null;
1154
+ // 剩余位置能否放下数字tag
1155
+ if (((_tags$overflowTagInde = tags[overflowTagIndex.value]) === null || _tags$overflowTagInde === void 0 ? void 0 : _tags$overflowTagInde.offsetTop) !== ((_collapseTagRef$value = collapseTagRef.value) === null || _collapseTagRef$value === void 0 ? void 0 : _collapseTagRef$value.offsetTop) && overflowTagIndex.value > 1) {
1156
+ overflowTagIndex.value -= 1;
1157
+ }
1158
+ });
1159
+ };
1160
+ // 监听Dom元素变化
1161
+ var debounceFn = (0,debounce_namespaceObject["default"])(calcOverflow, 150);
1162
+ var tagWrapperRef = (0,external_vue_namespaceObject.ref)();
1163
+ var resizeObserver = new ResizeObserver(function () {
1164
+ debounceFn();
1165
+ });
1166
+ (0,external_vue_namespaceObject.onMounted)(function () {
1167
+ tagWrapperRef.value && resizeObserver.observe(tagWrapperRef.value);
1168
+ });
1169
+ (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
1170
+ tagWrapperRef.value && resizeObserver.unobserve(tagWrapperRef.value);
1171
+ });
1172
+ return {
1173
+ collapseTagRef: collapseTagRef,
1174
+ tagWrapperRef: tagWrapperRef,
1175
+ tagsRefs: tagsRefs,
1176
+ select: select,
1177
+ overflowTagIndex: overflowTagIndex,
1178
+ value: value,
1179
+ inputRef: inputRef,
1180
+ handleRemoveTag: handleRemoveTag,
1181
+ focus: focus,
1182
+ handleInput: handleInput,
1183
+ handleKeydown: handleKeydown,
1184
+ resolveClassName: resolveClassName
1185
+ };
1186
+ },
1187
+ render: function render() {
1188
+ var _this$$slots,
1189
+ _this$$slots$prefix,
1190
+ _classes,
1191
+ _this$$slots2,
1192
+ _this$$slots2$prefix,
1193
+ _this$$slots$default,
1194
+ _this$$slots$default2,
1195
+ _this$$slots3,
1196
+ _this = this,
1197
+ _this$$slots4,
1198
+ _this$$slots4$suffix;
1199
+ var prefix = (_this$$slots = this.$slots) === null || _this$$slots === void 0 || (_this$$slots$prefix = _this$$slots.prefix) === null || _this$$slots$prefix === void 0 ? void 0 : _this$$slots$prefix.call(_this$$slots);
1200
+ var selectTagClass = (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, this.resolveClassName('select-tag'), true), _defineProperty(_classes, this.resolveClassName('select-tag--default'), true), _defineProperty(_classes, 'is-disabled', this.disabled), _defineProperty(_classes, 'collapse-tag', this.collapseTags), _defineProperty(_classes, 'has-prefix', !!prefix), _classes));
1201
+ var tagWrapperClass = (0,external_shared_namespaceObject.classes)(_defineProperty({}, this.resolveClassName('select-tag-wrapper'), true));
1202
+ var inputStyle = {
1203
+ display: this.selected.length && !this.filterable ? 'none' : ''
1204
+ };
1205
+ return (0,external_vue_namespaceObject.createVNode)("div", {
1206
+ "class": selectTagClass,
1207
+ "ref": "tagWrapperRef"
1208
+ }, [(_this$$slots2 = this.$slots) === null || _this$$slots2 === void 0 || (_this$$slots2$prefix = _this$$slots2.prefix) === null || _this$$slots2$prefix === void 0 ? void 0 : _this$$slots2$prefix.call(_this$$slots2), (0,external_vue_namespaceObject.createVNode)("div", {
1209
+ "class": tagWrapperClass
1210
+ }, [(_this$$slots$default = (_this$$slots$default2 = (_this$$slots3 = this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots3)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : this.selected.map(function (item, index) {
1211
+ var _this$select;
1212
+ return (0,external_vue_namespaceObject.createVNode)(external_tag_namespaceObject["default"], {
1213
+ "closable": true,
1214
+ "theme": _this.tagTheme,
1215
+ "style": {
1216
+ display: _this.collapseTags && _this.overflowTagIndex && index >= _this.overflowTagIndex ? 'none' : ''
1217
+ },
1218
+ "ref": function ref(el) {
1219
+ return _this.tagsRefs[index] = el;
1220
+ },
1221
+ "onClose": function onClose() {
1222
+ return _this.handleRemoveTag(item.value);
1223
+ }
1224
+ }, {
1225
+ "default": function _default() {
1226
+ return [(_this$select = _this.select) === null || _this$select === void 0 ? void 0 : _this$select.handleGetLabelByValue(item.value)];
1227
+ }
1228
+ });
1229
+ }), (0,external_vue_namespaceObject.createVNode)(external_tag_namespaceObject["default"], {
1230
+ "class": this.resolveClassName('select-overflow-tag'),
1231
+ "style": {
1232
+ display: !!this.overflowTagIndex && this.collapseTags ? '' : 'none'
1233
+ },
1234
+ "ref": "collapseTagRef"
1235
+ }, {
1236
+ "default": function _default() {
1237
+ return [(0,external_vue_namespaceObject.createTextVNode)("+"), _this.selected.length - _this.overflowTagIndex];
1238
+ }
1239
+ }), (0,external_vue_namespaceObject.createVNode)("input", {
1240
+ "class": this.resolveClassName('select-tag-input'),
1241
+ "ref": "inputRef",
1242
+ "type": "text",
1243
+ "style": inputStyle,
1244
+ "placeholder": !this.selected.length ? this.placeholder : '',
1245
+ "readonly": !this.filterable,
1246
+ "disabled": this.disabled,
1247
+ "value": !this.filterable ? '' : this.value,
1248
+ "onInput": this.handleInput,
1249
+ "onKeydown": this.handleKeydown
1250
+ }, null)]), (_this$$slots4 = this.$slots) === null || _this$$slots4 === void 0 || (_this$$slots4$suffix = _this$$slots4.suffix) === null || _this$$slots4$suffix === void 0 ? void 0 : _this$$slots4$suffix.call(_this$$slots4)]);
1251
+ }
1252
+ }));
1253
+ ;// CONCATENATED MODULE: ../../packages/select/src/select.tsx
1254
+
1255
+
1256
+
1257
+
1258
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = select_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
1259
+ function select_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return select_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return select_arrayLikeToArray(o, minLen); }
1260
+ function select_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
1261
+ function select_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1262
+ function select_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? select_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : select_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1263
+ /* eslint-disable vue/no-reserved-component-names */
1264
+ /*
1265
+ * Tencent is pleased to support the open source community by making
1266
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1267
+ *
1268
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1269
+ *
1270
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1271
+ *
1272
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1273
+ *
1274
+ * ---------------------------------------------------
1275
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1276
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1277
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1278
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1279
+ *
1280
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1281
+ * the Software.
1282
+ *
1283
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1284
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1285
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1286
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1287
+ * IN THE SOFTWARE.
1288
+ */
1289
+
1290
+
1291
+
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+ /* harmony default export */ const src_select = ((0,external_vue_namespaceObject.defineComponent)({
1304
+ name: 'Select',
1305
+ directives: {
1306
+ clickoutside: external_directives_namespaceObject.clickoutside
1307
+ },
1308
+ props: {
1309
+ modelValue: external_shared_namespaceObject.PropTypes.any,
1310
+ multiple: external_shared_namespaceObject.PropTypes.bool.def(false),
1311
+ disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
1312
+ size: external_shared_namespaceObject.PropTypes.size().def(external_shared_namespaceObject.SizeEnum.DEFAULT),
1313
+ clearable: external_shared_namespaceObject.PropTypes.bool.def(true),
1314
+ loading: external_shared_namespaceObject.PropTypes.bool.def(false),
1315
+ filterable: external_shared_namespaceObject.PropTypes.bool.def(false),
1316
+ remoteMethod: external_shared_namespaceObject.PropTypes.func,
1317
+ scrollHeight: external_shared_namespaceObject.PropTypes.number.def(200),
1318
+ showSelectAll: external_shared_namespaceObject.PropTypes.bool.def(false),
1319
+ popoverMinWidth: external_shared_namespaceObject.PropTypes.number.def(0),
1320
+ showOnInit: external_shared_namespaceObject.PropTypes.bool.def(false),
1321
+ multipleMode: external_shared_namespaceObject.PropTypes.oneOf(['default', 'tag']).def('default'),
1322
+ tagTheme: (0,external_shared_namespaceObject.TagThemeType)(),
1323
+ behavior: (0,external_shared_namespaceObject.InputBehaviorType)(),
1324
+ collapseTags: external_shared_namespaceObject.PropTypes.bool.def(false),
1325
+ autoHeight: external_shared_namespaceObject.PropTypes.bool.def(true),
1326
+ noDataText: external_shared_namespaceObject.PropTypes.string,
1327
+ noMatchText: external_shared_namespaceObject.PropTypes.string,
1328
+ loadingText: external_shared_namespaceObject.PropTypes.string,
1329
+ placeholder: external_shared_namespaceObject.PropTypes.string,
1330
+ searchPlaceholder: external_shared_namespaceObject.PropTypes.string,
1331
+ selectAllText: external_shared_namespaceObject.PropTypes.string,
1332
+ scrollLoading: external_shared_namespaceObject.PropTypes.bool.def(false),
1333
+ allowCreate: external_shared_namespaceObject.PropTypes.bool.def(false),
1334
+ popoverOptions: Object,
1335
+ customContent: external_shared_namespaceObject.PropTypes.bool.def(false),
1336
+ list: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.any).def([]),
1337
+ idKey: external_shared_namespaceObject.PropTypes.string.def('value'),
1338
+ displayKey: external_shared_namespaceObject.PropTypes.string.def('label'),
1339
+ withValidate: external_shared_namespaceObject.PropTypes.bool.def(true),
1340
+ showSelectedIcon: external_shared_namespaceObject.PropTypes.bool.def(true),
1341
+ inputSearch: external_shared_namespaceObject.PropTypes.bool.def(true),
1342
+ enableVirtualRender: external_shared_namespaceObject.PropTypes.bool.def(false),
1343
+ allowEmptyValues: external_shared_namespaceObject.PropTypes.array.def([]),
1344
+ autoFocus: external_shared_namespaceObject.PropTypes.bool.def(false),
1345
+ keepSearchValue: external_shared_namespaceObject.PropTypes.bool.def(false),
1346
+ prefix: external_shared_namespaceObject.PropTypes.string,
1347
+ selectedStyle: (0,external_shared_namespaceObject.SelectedType)(),
1348
+ filterOption: {
1349
+ type: [Boolean, Function],
1350
+ "default": true
1351
+ } // 配置当前options的过滤规则
1352
+ },
1353
+
1354
+ emits: ['update:modelValue', 'change', 'toggle', 'clear', 'scroll-end', 'focus', 'blur', 'tag-remove', 'select', 'deselect'],
1355
+ setup: function setup(props, _ref) {
1356
+ var emit = _ref.emit;
1357
+ var t = (0,external_config_provider_namespaceObject.useLocale)('select');
1358
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
1359
+ resolveClassName = _usePrefix.resolveClassName;
1360
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
1361
+ modelValue = _toRefs.modelValue,
1362
+ disabled = _toRefs.disabled,
1363
+ filterable = _toRefs.filterable,
1364
+ multiple = _toRefs.multiple,
1365
+ remoteMethod = _toRefs.remoteMethod,
1366
+ loading = _toRefs.loading,
1367
+ popoverMinWidth = _toRefs.popoverMinWidth,
1368
+ showOnInit = _toRefs.showOnInit,
1369
+ multipleMode = _toRefs.multipleMode,
1370
+ allowCreate = _toRefs.allowCreate,
1371
+ customContent = _toRefs.customContent,
1372
+ showSelectedIcon = _toRefs.showSelectedIcon,
1373
+ inputSearch = _toRefs.inputSearch,
1374
+ enableVirtualRender = _toRefs.enableVirtualRender,
1375
+ showSelectAll = _toRefs.showSelectAll,
1376
+ scrollHeight = _toRefs.scrollHeight,
1377
+ list = _toRefs.list,
1378
+ displayKey = _toRefs.displayKey,
1379
+ idKey = _toRefs.idKey,
1380
+ collapseTags = _toRefs.collapseTags,
1381
+ autoHeight = _toRefs.autoHeight,
1382
+ popoverOptions = _toRefs.popoverOptions,
1383
+ allowEmptyValues = _toRefs.allowEmptyValues,
1384
+ autoFocus = _toRefs.autoFocus,
1385
+ keepSearchValue = _toRefs.keepSearchValue,
1386
+ selectedStyle = _toRefs.selectedStyle,
1387
+ filterOption = _toRefs.filterOption;
1388
+ var localNoDataText = (0,external_vue_namespaceObject.computed)(function () {
1389
+ if (props.noDataText === undefined) {
1390
+ return t.value.noData;
1391
+ }
1392
+ return props.noDataText;
1393
+ });
1394
+ var localNoMatchText = (0,external_vue_namespaceObject.computed)(function () {
1395
+ if (props.noMatchText === undefined) {
1396
+ return t.value.noMatchedData;
1397
+ }
1398
+ return props.noMatchText;
1399
+ });
1400
+ var localLoadingText = (0,external_vue_namespaceObject.computed)(function () {
1401
+ if (props.loadingText === undefined) {
1402
+ return t.value.loading;
1403
+ }
1404
+ return props.loadingText;
1405
+ });
1406
+ var localPlaceholder = (0,external_vue_namespaceObject.computed)(function () {
1407
+ if (props.placeholder === undefined) {
1408
+ return t.value.pleaseSelect;
1409
+ }
1410
+ return props.placeholder;
1411
+ });
1412
+ var localSearchPlaceholder = (0,external_vue_namespaceObject.computed)(function () {
1413
+ if (props.searchPlaceholder === undefined) {
1414
+ return t.value.enterKeywords;
1415
+ }
1416
+ return props.searchPlaceholder;
1417
+ });
1418
+ var localSelectAllText = (0,external_vue_namespaceObject.computed)(function () {
1419
+ if (props.selectAllText === undefined) {
1420
+ return t.value.all;
1421
+ }
1422
+ return props.selectAllText;
1423
+ });
1424
+ var formItem = (0,external_shared_namespaceObject.useFormItem)();
1425
+ var inputRef = (0,external_vue_namespaceObject.ref)();
1426
+ var triggerRef = (0,external_vue_namespaceObject.ref)();
1427
+ var contentRef = (0,external_vue_namespaceObject.ref)();
1428
+ var searchRef = (0,external_vue_namespaceObject.ref)();
1429
+ var selectTagInputRef = (0,external_vue_namespaceObject.ref)();
1430
+ var virtualRenderRef = (0,external_vue_namespaceObject.ref)();
1431
+ var popoverRef = (0,external_vue_namespaceObject.ref)();
1432
+ var optionsMap = (0,external_vue_namespaceObject.ref)(new Map());
1433
+ var options = (0,external_vue_namespaceObject.computed)(function () {
1434
+ return _toConsumableArray(optionsMap.value.values()).sort(function (cur, next) {
1435
+ return cur.order - next.order;
1436
+ });
1437
+ });
1438
+ var groupsMap = (0,external_vue_namespaceObject.ref)(new Map());
1439
+ var selected = (0,external_vue_namespaceObject.ref)([]);
1440
+ var cacheSelectedMap = (0,external_vue_namespaceObject.computed)(function () {
1441
+ return selected.value.reduce(function (pre, item) {
1442
+ pre[item.value] = item.label;
1443
+ return pre;
1444
+ }, {});
1445
+ });
1446
+ var activeOptionValue = (0,external_vue_namespaceObject.ref)(); // 当前悬浮的option
1447
+ var listMap = (0,external_vue_namespaceObject.computed)(function () {
1448
+ return list.value.reduce(function (pre, item) {
1449
+ pre[item[idKey.value]] = item[displayKey.value];
1450
+ return pre;
1451
+ }, {});
1452
+ });
1453
+ (0,external_vue_namespaceObject.watch)(modelValue, function () {
1454
+ handleSetSelectedData();
1455
+ if (props.withValidate) {
1456
+ var _formItem$validate;
1457
+ formItem === null || formItem === void 0 || (_formItem$validate = formItem.validate) === null || _formItem$validate === void 0 ? void 0 : _formItem$validate.call(formItem, 'change');
1458
+ }
1459
+ }, {
1460
+ deep: true
1461
+ });
1462
+ (0,external_vue_namespaceObject.watch)(selected, function () {
1463
+ var _popoverRef$value;
1464
+ (_popoverRef$value = popoverRef.value) === null || _popoverRef$value === void 0 ? void 0 : _popoverRef$value.updatePopover(null, popoverConfig.value);
1465
+ });
1466
+ // 虚拟滚动模式下搜索后的值
1467
+ var virtualList = (0,external_vue_namespaceObject.computed)(function () {
1468
+ return isRemoteSearch.value ? list.value : list.value.filter(function (item) {
1469
+ var _toLowerCase;
1470
+ return filterOptionFunc.value(searchKey.value, item) && ((_toLowerCase = toLowerCase(String(item[displayKey.value]))) === null || _toLowerCase === void 0 ? void 0 : _toLowerCase.includes(toLowerCase(searchKey.value)));
1471
+ });
1472
+ });
1473
+ // select组件是否禁用
1474
+ var isDisabled = (0,external_vue_namespaceObject.computed)(function () {
1475
+ return disabled.value || loading.value;
1476
+ });
1477
+ // modelValue对应的label
1478
+ var selectedLabel = (0,external_vue_namespaceObject.computed)(function () {
1479
+ return selected.value.map(function (item) {
1480
+ var _optionsMap$value;
1481
+ return ((_optionsMap$value = optionsMap.value) === null || _optionsMap$value === void 0 || (_optionsMap$value = _optionsMap$value.get(item.value)) === null || _optionsMap$value === void 0 ? void 0 : _optionsMap$value.optionName) || listMap.value[item.value] || item.label;
1482
+ });
1483
+ });
1484
+ // 是否全选(todo: 优化)
1485
+ var isAllSelected = (0,external_vue_namespaceObject.computed)(function () {
1486
+ var normalSelectedValues = options.value.reduce(function (pre, option) {
1487
+ if (!option.disabled) {
1488
+ pre.push(option.optionID);
1489
+ }
1490
+ return pre;
1491
+ }, []);
1492
+ return normalSelectedValues.length <= selected.value.length && normalSelectedValues.every(function (val) {
1493
+ return selected.value.some(function (item) {
1494
+ return item.value === val;
1495
+ });
1496
+ });
1497
+ });
1498
+ // 是否含有分组
1499
+ var isGroup = (0,external_vue_namespaceObject.computed)(function () {
1500
+ return !!groupsMap.value.size;
1501
+ });
1502
+ // options是否为空
1503
+ var isOptionsEmpty = (0,external_vue_namespaceObject.computed)(function () {
1504
+ return !options.value.length;
1505
+ });
1506
+ // 是否搜索为空
1507
+ var isSearchEmpty = (0,external_vue_namespaceObject.computed)(function () {
1508
+ return options.value.length && options.value.every(function (option) {
1509
+ return !option.visible;
1510
+ });
1511
+ });
1512
+ // 是否远程搜索
1513
+ var isRemoteSearch = (0,external_vue_namespaceObject.computed)(function () {
1514
+ return filterable.value && typeof remoteMethod.value === 'function';
1515
+ });
1516
+ // options过滤函数
1517
+ var filterOptionFunc = (0,external_vue_namespaceObject.computed)(function () {
1518
+ if (typeof filterOption.value === 'function') return filterOption.value;
1519
+ return function () {
1520
+ return filterOption.value;
1521
+ };
1522
+ });
1523
+ // 是否显示select下拉内容
1524
+ var isShowSelectContent = (0,external_vue_namespaceObject.computed)(function () {
1525
+ return !(searchLoading.value || isOptionsEmpty.value || isSearchEmpty.value) || customContent.value;
1526
+ });
1527
+ // 是否显示全选
1528
+ var isShowSelectAll = (0,external_vue_namespaceObject.computed)(function () {
1529
+ return multiple.value && showSelectAll.value && (!searchKey.value || !filterable.value);
1530
+ });
1531
+ // 虚拟滚动高度 12 上下边距,32 显示全选时的高度
1532
+ var virtualHeight = (0,external_vue_namespaceObject.computed)(function () {
1533
+ return scrollHeight.value - 12 - (isShowSelectAll.value ? 32 : 0);
1534
+ });
1535
+ // 当前空状态时显示文案
1536
+ var curContentText = (0,external_vue_namespaceObject.computed)(function () {
1537
+ if (searchLoading.value) {
1538
+ return localLoadingText.value;
1539
+ }
1540
+ if (isSearchEmpty.value || list.value.length && !virtualList.value.length) {
1541
+ return localNoMatchText.value;
1542
+ }
1543
+ if (isOptionsEmpty.value) {
1544
+ return localNoDataText.value;
1545
+ }
1546
+ return '';
1547
+ });
1548
+ // 是否合并tag以数字形式展示
1549
+ var isCollapseTags = (0,external_vue_namespaceObject.computed)(function () {
1550
+ return autoHeight.value ? collapseTags.value && !isPopoverShow.value : collapseTags.value;
1551
+ });
1552
+ var popoverConfig = (0,external_vue_namespaceObject.computed)(function () {
1553
+ return (0,merge_namespaceObject["default"])({
1554
+ theme: "light ".concat(resolveClassName('select-popover')),
1555
+ trigger: 'manual',
1556
+ width: popperWidth.value,
1557
+ arrow: false,
1558
+ placement: 'bottom-start',
1559
+ isShow: isPopoverShow.value,
1560
+ reference: selectTagInputRef.value,
1561
+ offset: 6,
1562
+ popoverDelay: 0,
1563
+ renderType: external_shared_namespaceObject.RenderType.AUTO
1564
+ }, popoverOptions.value);
1565
+ });
1566
+ var _useRegistry = useRegistry(optionsMap),
1567
+ register = _useRegistry.register,
1568
+ unregister = _useRegistry.unregister;
1569
+ var _useRegistry2 = useRegistry(groupsMap),
1570
+ registerGroup = _useRegistry2.register,
1571
+ unregisterGroup = _useRegistry2.unregister;
1572
+ var _useHover = useHover(),
1573
+ isHover = _useHover.isHover,
1574
+ setHover = _useHover.setHover,
1575
+ cancelHover = _useHover.cancelHover;
1576
+ var isFocus = (0,external_vue_namespaceObject.ref)(false);
1577
+ var handleFocus = function handleFocus() {
1578
+ if (isFocus.value) return;
1579
+ isFocus.value = true;
1580
+ emit('focus');
1581
+ };
1582
+ var handleBlur = function handleBlur() {
1583
+ if (!isFocus.value) return;
1584
+ isFocus.value = false;
1585
+ emit('blur');
1586
+ };
1587
+ var _usePopover = usePopover({
1588
+ popoverMinWidth: popoverMinWidth.value
1589
+ }, triggerRef),
1590
+ popperWidth = _usePopover.popperWidth,
1591
+ isPopoverShow = _usePopover.isPopoverShow,
1592
+ hidePopover = _usePopover.hidePopover,
1593
+ showPopover = _usePopover.showPopover,
1594
+ togglePopover = _usePopover.togglePopover;
1595
+ // 输入框是否可以输入内容
1596
+ var isInput = (0,external_vue_namespaceObject.computed)(function () {
1597
+ return (filterable.value && inputSearch.value || allowCreate.value) && isPopoverShow.value;
1598
+ });
1599
+ (0,external_vue_namespaceObject.watch)(isPopoverShow, function (isShow) {
1600
+ emit('toggle', isPopoverShow.value);
1601
+ if (!isShow) {
1602
+ if (!keepSearchValue.value) {
1603
+ searchKey.value = '';
1604
+ }
1605
+ document.removeEventListener('keydown', handleDocumentKeydown);
1606
+ } else {
1607
+ document.addEventListener('keydown', handleDocumentKeydown);
1608
+ setTimeout(function () {
1609
+ focusInput();
1610
+ initActiveOptionValue();
1611
+ }, 10); // 等待Popover content出来,options加载完成
1612
+ }
1613
+ });
1614
+ // 初始化当前悬浮的option项
1615
+ var initActiveOptionValue = function initActiveOptionValue() {
1616
+ var firstSelected = selected.value[0];
1617
+ var option = optionsMap.value.get(firstSelected === null || firstSelected === void 0 ? void 0 : firstSelected.value);
1618
+ if (option && !option.disabled && option.visible) {
1619
+ activeOptionValue.value = firstSelected === null || firstSelected === void 0 ? void 0 : firstSelected.value;
1620
+ } else {
1621
+ var _options$value$find;
1622
+ activeOptionValue.value = (_options$value$find = options.value.find(function (option) {
1623
+ return !option.disabled && option.visible;
1624
+ })) === null || _options$value$find === void 0 ? void 0 : _options$value$find.optionID;
1625
+ }
1626
+ };
1627
+ // 默认搜索方法
1628
+ var defaultSearchMethod = function defaultSearchMethod(value) {
1629
+ if (!filterable.value) return;
1630
+ if (!value) {
1631
+ options.value.forEach(function (option) {
1632
+ option.visible = true;
1633
+ });
1634
+ } else {
1635
+ options.value.forEach(function (option) {
1636
+ var _toLowerCase2;
1637
+ option.visible = filterOptionFunc.value(value, select_objectSpread({}, option.$props)) && ((_toLowerCase2 = toLowerCase(String(option.optionName))) === null || _toLowerCase2 === void 0 ? void 0 : _toLowerCase2.includes(toLowerCase(value)));
1638
+ });
1639
+ }
1640
+ };
1641
+ var _useRemoteSearch = useRemoteSearch(isRemoteSearch.value ? remoteMethod.value : defaultSearchMethod, initActiveOptionValue),
1642
+ searchKey = _useRemoteSearch.searchKey,
1643
+ searchLoading = _useRemoteSearch.searchLoading;
1644
+ // 派发change事件
1645
+ var emitChange = function emitChange(val) {
1646
+ if (val === modelValue.value) return;
1647
+ emit('update:modelValue', val, modelValue.value);
1648
+ emit('change', val, modelValue.value);
1649
+ };
1650
+ // 派发toggle事件
1651
+ var handleTogglePopover = function handleTogglePopover() {
1652
+ if (isDisabled.value) return;
1653
+ handleFocus();
1654
+ togglePopover();
1655
+ };
1656
+ // 搜索
1657
+ var handleInputChange = function handleInputChange(value) {
1658
+ if (!filterable.value) return;
1659
+ searchKey.value = value;
1660
+ };
1661
+ // allow create(创建自定义选项)
1662
+ var handleCreateCustomOption = function handleCreateCustomOption(val) {
1663
+ var value = String(val);
1664
+ if (!allowCreate.value || !value) return;
1665
+ var matchedOption = options.value.find(function (data) {
1666
+ return toLowerCase(String(data.optionName)) === toLowerCase(value);
1667
+ });
1668
+ if (filterable.value && matchedOption) {
1669
+ // 开启搜索后,正好匹配到自定义选项,则不进行创建操作
1670
+ handleOptionSelected(matchedOption);
1671
+ searchKey.value = '';
1672
+ return;
1673
+ }
1674
+ var data = optionsMap.value.get(value);
1675
+ if (data) return; // 已经存在相同值的option时不能创建
1676
+ if (multiple.value) {
1677
+ selected.value.push({
1678
+ value: value,
1679
+ label: value
1680
+ });
1681
+ emitChange(selected.value.map(function (item) {
1682
+ return item.value;
1683
+ }));
1684
+ } else {
1685
+ selected.value = [{
1686
+ value: value,
1687
+ label: value
1688
+ }];
1689
+ emitChange(value);
1690
+ hidePopover();
1691
+ }
1692
+ searchKey.value = '';
1693
+ };
1694
+ // Option点击事件
1695
+ var handleOptionSelected = function handleOptionSelected(option) {
1696
+ if (isDisabled.value || !option) return;
1697
+ if (multiple.value) {
1698
+ // 多选
1699
+ var index = selected.value.findIndex(function (item) {
1700
+ return item.value === option.optionID;
1701
+ });
1702
+ if (index > -1) {
1703
+ selected.value.splice(index, 1);
1704
+ emitChange(selected.value.map(function (item) {
1705
+ return item.value;
1706
+ }));
1707
+ emit('deselect', option.optionID);
1708
+ } else {
1709
+ selected.value.push({
1710
+ value: option.optionID,
1711
+ label: option.optionName || option.optionID
1712
+ });
1713
+ emitChange(selected.value.map(function (item) {
1714
+ return item.value;
1715
+ }));
1716
+ emit('select', option.optionID);
1717
+ }
1718
+ } else {
1719
+ // 单选
1720
+ selected.value = [{
1721
+ label: option.optionName || option.optionID,
1722
+ value: option.optionID
1723
+ }];
1724
+ emitChange(option.optionID);
1725
+ emit('select', option.optionID);
1726
+ hidePopover();
1727
+ }
1728
+ focusInput();
1729
+ };
1730
+ // 聚焦输入框
1731
+ var focusInput = function focusInput() {
1732
+ setTimeout(function () {
1733
+ if (!inputSearch.value && !allowCreate.value) {
1734
+ var _searchRef$value;
1735
+ (_searchRef$value = searchRef.value) === null || _searchRef$value === void 0 ? void 0 : _searchRef$value.focus();
1736
+ } else {
1737
+ if (multipleMode.value === 'tag') {
1738
+ var _selectTagInputRef$va;
1739
+ (_selectTagInputRef$va = selectTagInputRef.value) === null || _selectTagInputRef$va === void 0 ? void 0 : _selectTagInputRef$va.focus();
1740
+ } else {
1741
+ var _inputRef$value;
1742
+ (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value.focus();
1743
+ }
1744
+ }
1745
+ }, 0);
1746
+ };
1747
+ // 清空事件
1748
+ var handleClear = function handleClear(e) {
1749
+ e.stopPropagation();
1750
+ selected.value = [];
1751
+ emitChange(multiple.value ? [] : '');
1752
+ emit('clear', multiple.value ? [] : '');
1753
+ hidePopover();
1754
+ };
1755
+ // 全选/取消全选
1756
+ var handleSelectedAllOptionMouseEnter = function handleSelectedAllOptionMouseEnter() {
1757
+ activeOptionValue.value = '';
1758
+ };
1759
+ var handleToggleAll = function handleToggleAll() {
1760
+ if (isAllSelected.value) {
1761
+ selected.value = [];
1762
+ } else {
1763
+ var _list$value;
1764
+ options.value.forEach(function (option) {
1765
+ if (option.disabled || option.optionID in cacheSelectedMap.value) return;
1766
+ selected.value.push({
1767
+ value: option.optionID,
1768
+ label: option.optionName || option.optionID
1769
+ });
1770
+ });
1771
+ (_list$value = list.value) === null || _list$value === void 0 ? void 0 : _list$value.forEach(function (item) {
1772
+ if (item.disabled || item[idKey.value] in cacheSelectedMap.value) return;
1773
+ selected.value.push({
1774
+ value: item[idKey.value],
1775
+ label: item[displayKey.value]
1776
+ });
1777
+ });
1778
+ }
1779
+ emitChange(selected.value.map(function (item) {
1780
+ return item.value;
1781
+ }));
1782
+ focusInput();
1783
+ };
1784
+ // 滚动事件
1785
+ var handleScroll = function handleScroll(e) {
1786
+ var _e$target = e.target,
1787
+ scrollTop = _e$target.scrollTop,
1788
+ clientHeight = _e$target.clientHeight,
1789
+ scrollHeight = _e$target.scrollHeight;
1790
+ if (scrollTop + clientHeight === scrollHeight) {
1791
+ emit('scroll-end');
1792
+ }
1793
+ };
1794
+ // tag删除事件
1795
+ var handleDeleteTag = function handleDeleteTag(val) {
1796
+ if (isDisabled.value) return;
1797
+ var index = selected.value.findIndex(function (item) {
1798
+ return item.value === val;
1799
+ });
1800
+ if (index > -1) {
1801
+ selected.value.splice(index, 1);
1802
+ emitChange(selected.value.map(function (item) {
1803
+ return item.value;
1804
+ }));
1805
+ emit('tag-remove', val);
1806
+ }
1807
+ };
1808
+ // options存在 > 上一次选择的label > 当前值
1809
+ var handleGetLabelByValue = function handleGetLabelByValue(value) {
1810
+ var _optionsMap$value2;
1811
+ // 处理options value为对象类型,引用类型变更后,回显不对问题
1812
+ var tmpValue = value;
1813
+ if (_typeof(tmpValue) === 'object') {
1814
+ var _iterator = _createForOfIteratorHelper(optionsMap.value.keys()),
1815
+ _step;
1816
+ try {
1817
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1818
+ var key = _step.value;
1819
+ if ((0,isEqual_namespaceObject["default"])(key, tmpValue)) {
1820
+ tmpValue = key;
1821
+ break;
1822
+ }
1823
+ }
1824
+ } catch (err) {
1825
+ _iterator.e(err);
1826
+ } finally {
1827
+ _iterator.f();
1828
+ }
1829
+ }
1830
+ return ((_optionsMap$value2 = optionsMap.value) === null || _optionsMap$value2 === void 0 || (_optionsMap$value2 = _optionsMap$value2.get(tmpValue)) === null || _optionsMap$value2 === void 0 ? void 0 : _optionsMap$value2.optionName) || listMap.value[tmpValue] || cacheSelectedMap.value[tmpValue] || tmpValue;
1831
+ };
1832
+ // 设置selected选项
1833
+ var handleSetSelectedData = function handleSetSelectedData() {
1834
+ // 同步内部value值
1835
+ if (Array.isArray(modelValue.value)) {
1836
+ selected.value = _toConsumableArray(modelValue.value.map(function (value) {
1837
+ return {
1838
+ value: value,
1839
+ label: handleGetLabelByValue(value)
1840
+ };
1841
+ }));
1842
+ } else {
1843
+ if (modelValue.value !== undefined || allowEmptyValues.value.includes(modelValue.value)) {
1844
+ selected.value = [{
1845
+ value: modelValue.value,
1846
+ label: handleGetLabelByValue(modelValue.value)
1847
+ }];
1848
+ } else {
1849
+ selected.value = [];
1850
+ }
1851
+ }
1852
+ };
1853
+ // 处理键盘事件
1854
+ var handleDocumentKeydown = function handleDocumentKeydown(e) {
1855
+ if (!isPopoverShow.value) return;
1856
+ var availableOptions = options.value.filter(function (option) {
1857
+ return !option.disabled && option.visible;
1858
+ });
1859
+ var index = availableOptions.findIndex(function (option) {
1860
+ return option.optionID === activeOptionValue.value;
1861
+ });
1862
+ // todo v-for循环时组件创建属性不固定
1863
+ switch (e.code) {
1864
+ // 下一个option
1865
+ case 'ArrowUp':
1866
+ case 'ArrowDown':
1867
+ {
1868
+ var _availableOptions$act, _availableOptions$act3;
1869
+ e.preventDefault(); // 阻止滚动屏幕
1870
+ var activeIndex = 0;
1871
+ if (e.code === 'ArrowDown') {
1872
+ activeIndex = index >= availableOptions.length - 1 ? 0 : index + 1;
1873
+ } else {
1874
+ activeIndex = index === 0 ? availableOptions.length - 1 : index - 1;
1875
+ }
1876
+ if (!isInViewPort((_availableOptions$act = availableOptions[activeIndex]) === null || _availableOptions$act === void 0 ? void 0 : _availableOptions$act.$el, contentRef.value)) {
1877
+ var _availableOptions$act2;
1878
+ (_availableOptions$act2 = availableOptions[activeIndex]) === null || _availableOptions$act2 === void 0 || (_availableOptions$act2 = _availableOptions$act2.$el) === null || _availableOptions$act2 === void 0 ? void 0 : _availableOptions$act2.scrollIntoView();
1879
+ }
1880
+ activeOptionValue.value = (_availableOptions$act3 = availableOptions[activeIndex]) === null || _availableOptions$act3 === void 0 ? void 0 : _availableOptions$act3.optionID;
1881
+ break;
1882
+ }
1883
+ // 删除选项
1884
+ case 'Backspace':
1885
+ {
1886
+ if (!multiple.value || !selected.value.length || searchKey.value.length || e.target === searchRef.value) return; // 单选和下拉搜索不支持回退键删除
1887
+ selected.value.pop();
1888
+ emitChange(selected.value.map(function (item) {
1889
+ return item.value;
1890
+ }));
1891
+ break;
1892
+ }
1893
+ // 选择选项
1894
+ case 'Enter':
1895
+ {
1896
+ var value = e.target.value;
1897
+ if (allowCreate.value && value) return;
1898
+ var option = optionsMap.value.get(activeOptionValue.value);
1899
+ handleOptionSelected(option);
1900
+ break;
1901
+ }
1902
+ }
1903
+ };
1904
+ var handleClickOutside = function handleClickOutside(_ref2) {
1905
+ var _triggerRef$value;
1906
+ var event = _ref2.event;
1907
+ var target = event.target;
1908
+ if ((_triggerRef$value = triggerRef.value) !== null && _triggerRef$value !== void 0 && _triggerRef$value.contains(target) || triggerRef.value === target) return;
1909
+ hidePopover();
1910
+ handleBlur();
1911
+ };
1912
+ var handlePopoverShow = function handlePopoverShow() {
1913
+ setTimeout(function () {
1914
+ var _virtualRenderRef$val, _virtualRenderRef$val2;
1915
+ // 虚拟滚动首次未更新问题
1916
+ enableVirtualRender.value && ((_virtualRenderRef$val = virtualRenderRef.value) === null || _virtualRenderRef$val === void 0 || (_virtualRenderRef$val2 = _virtualRenderRef$val.reset) === null || _virtualRenderRef$val2 === void 0 ? void 0 : _virtualRenderRef$val2.call(_virtualRenderRef$val));
1917
+ });
1918
+ };
1919
+ (0,external_vue_namespaceObject.provide)(selectKey, (0,external_vue_namespaceObject.reactive)({
1920
+ multiple: multiple,
1921
+ selected: selected,
1922
+ activeOptionValue: activeOptionValue,
1923
+ showSelectedIcon: showSelectedIcon,
1924
+ selectedStyle: selectedStyle,
1925
+ register: register,
1926
+ unregister: unregister,
1927
+ registerGroup: registerGroup,
1928
+ unregisterGroup: unregisterGroup,
1929
+ handleOptionSelected: handleOptionSelected,
1930
+ handleGetLabelByValue: handleGetLabelByValue
1931
+ }));
1932
+ (0,external_vue_namespaceObject.onMounted)(function () {
1933
+ handleSetSelectedData();
1934
+ setTimeout(function () {
1935
+ showOnInit.value && showPopover();
1936
+ autoFocus.value && focusInput();
1937
+ });
1938
+ });
1939
+ return {
1940
+ selected: selected,
1941
+ isInput: isInput,
1942
+ options: options,
1943
+ isDisabled: isDisabled,
1944
+ selectedLabel: selectedLabel,
1945
+ isPopoverShow: isPopoverShow,
1946
+ isHover: isHover,
1947
+ popperWidth: popperWidth,
1948
+ inputRef: inputRef,
1949
+ triggerRef: triggerRef,
1950
+ contentRef: contentRef,
1951
+ searchRef: searchRef,
1952
+ selectTagInputRef: selectTagInputRef,
1953
+ virtualRenderRef: virtualRenderRef,
1954
+ popoverRef: popoverRef,
1955
+ searchLoading: searchLoading,
1956
+ isOptionsEmpty: isOptionsEmpty,
1957
+ isSearchEmpty: isSearchEmpty,
1958
+ isFocus: isFocus,
1959
+ isShowSelectContent: isShowSelectContent,
1960
+ curContentText: curContentText,
1961
+ isGroup: isGroup,
1962
+ searchKey: searchKey,
1963
+ isShowSelectAll: isShowSelectAll,
1964
+ virtualHeight: virtualHeight,
1965
+ virtualList: virtualList,
1966
+ isCollapseTags: isCollapseTags,
1967
+ popoverConfig: popoverConfig,
1968
+ focusInput: focusInput,
1969
+ setHover: setHover,
1970
+ cancelHover: cancelHover,
1971
+ handleFocus: handleFocus,
1972
+ handleBlur: handleBlur,
1973
+ handleTogglePopover: handleTogglePopover,
1974
+ handleClear: handleClear,
1975
+ hidePopover: hidePopover,
1976
+ showPopover: showPopover,
1977
+ handleToggleAll: handleToggleAll,
1978
+ handleOptionSelected: handleOptionSelected,
1979
+ handleClickOutside: handleClickOutside,
1980
+ handleScroll: handleScroll,
1981
+ handleDeleteTag: handleDeleteTag,
1982
+ handleInputChange: handleInputChange,
1983
+ handleSelectedAllOptionMouseEnter: handleSelectedAllOptionMouseEnter,
1984
+ handlePopoverShow: handlePopoverShow,
1985
+ localLoadingText: localLoadingText,
1986
+ localPlaceholder: localPlaceholder,
1987
+ localSearchPlaceholder: localSearchPlaceholder,
1988
+ localSelectAllText: localSelectAllText,
1989
+ resolveClassName: resolveClassName,
1990
+ handleCreateCustomOption: handleCreateCustomOption
1991
+ };
1992
+ },
1993
+ render: function render() {
1994
+ var _classes,
1995
+ _this = this;
1996
+ var selectClass = (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, "".concat(this.resolveClassName('select')), true), _defineProperty(_classes, 'popover-show', this.isPopoverShow), _defineProperty(_classes, 'is-disabled', this.isDisabled), _defineProperty(_classes, 'is-focus', this.isFocus), _defineProperty(_classes, 'is-filterable', this.filterable), _defineProperty(_classes, this.size, true), _defineProperty(_classes, this.behavior, true), _classes));
1997
+ var suffixIcon = function suffixIcon() {
1998
+ if (_this.loading) {
1999
+ return (0,external_vue_namespaceObject.createVNode)(external_loading_namespaceObject["default"], {
2000
+ "loading": true,
2001
+ "theme": "primary",
2002
+ "class": "spinner",
2003
+ "mode": "spin",
2004
+ "size": "mini"
2005
+ }, null);
2006
+ }
2007
+ if (_this.clearable && _this.isHover && _this.selected.length && !_this.isDisabled) {
2008
+ return (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, {
2009
+ "class": "clear-icon",
2010
+ "onClick": _this.handleClear
2011
+ }, null);
2012
+ }
2013
+ return (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleUp, {
2014
+ "class": "angle-up"
2015
+ }, null);
2016
+ };
2017
+ var renderPrefix = function renderPrefix() {
2018
+ if (_this.prefix) {
2019
+ return function () {
2020
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2021
+ "class": "".concat(_this.resolveClassName('select--prefix-area'))
2022
+ }, [(0,external_vue_namespaceObject.createVNode)("span", null, [_this.prefix])]);
2023
+ };
2024
+ }
2025
+ return _this.$slots.prefix ? function () {
2026
+ var _this$$slots$prefix, _this$$slots;
2027
+ return (_this$$slots$prefix = (_this$$slots = _this.$slots).prefix) === null || _this$$slots$prefix === void 0 ? void 0 : _this$$slots$prefix.call(_this$$slots);
2028
+ } : undefined;
2029
+ };
2030
+ var renderTriggerInput = function renderTriggerInput() {
2031
+ if (_this.multipleMode === 'tag') {
2032
+ return (0,external_vue_namespaceObject.createVNode)(selectTagInput, {
2033
+ "ref": "selectTagInputRef",
2034
+ "modelValue": _this.searchKey,
2035
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
2036
+ return _this.searchKey = $event;
2037
+ },
2038
+ "selected": _this.selected,
2039
+ "tagTheme": _this.tagTheme,
2040
+ "placeholder": _this.localPlaceholder,
2041
+ "filterable": _this.isInput,
2042
+ "disabled": _this.isDisabled,
2043
+ "onRemove": _this.handleDeleteTag,
2044
+ "collapseTags": _this.isCollapseTags,
2045
+ "onEnter": _this.handleCreateCustomOption
2046
+ }, {
2047
+ prefix: renderPrefix(),
2048
+ "default": _this.$slots.tag && function () {
2049
+ return _this.$slots.tag({
2050
+ selected: _this.selected
2051
+ });
2052
+ },
2053
+ suffix: function suffix() {
2054
+ return suffixIcon();
2055
+ }
2056
+ });
2057
+ }
2058
+ return (0,external_vue_namespaceObject.createVNode)(external_input_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
2059
+ "ref": "inputRef",
2060
+ "type": "text",
2061
+ "modelValue": _this.isInput ? _this.searchKey : _this.selectedLabel.join(','),
2062
+ "placeholder": _this.isInput ? _this.selectedLabel.join(',') || _this.localPlaceholder : _this.localPlaceholder,
2063
+ "readonly": !_this.isInput,
2064
+ "selectReadonly": true,
2065
+ "disabled": _this.isDisabled,
2066
+ "behavior": _this.behavior,
2067
+ "size": _this.size,
2068
+ "withValidate": false,
2069
+ "stopPropagation": false,
2070
+ "onInput": _this.handleInputChange,
2071
+ "onEnter": _this.handleCreateCustomOption
2072
+ }, _this.prefix ? {
2073
+ prefix: _this.prefix
2074
+ } : null), {
2075
+ "default": function _default() {
2076
+ return [select_objectSpread(select_objectSpread({}, typeof _this.$slots.prefix === 'function' ? {
2077
+ prefix: function prefix() {
2078
+ var _this$$slots$prefix2, _this$$slots2;
2079
+ return (_this$$slots$prefix2 = (_this$$slots2 = _this.$slots).prefix) === null || _this$$slots$prefix2 === void 0 ? void 0 : _this$$slots$prefix2.call(_this$$slots2);
2080
+ }
2081
+ } : null), {}, {
2082
+ suffix: function suffix() {
2083
+ return suffixIcon();
2084
+ }
2085
+ })];
2086
+ }
2087
+ });
2088
+ };
2089
+ var renderSelectTrigger = function renderSelectTrigger() {
2090
+ var _this$$slots$trigger, _this$$slots3;
2091
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2092
+ "class": _this.resolveClassName('select-trigger'),
2093
+ "style": {
2094
+ height: _this.autoHeight && _this.collapseTags ? '32px' : ''
2095
+ },
2096
+ "ref": "triggerRef",
2097
+ "onClick": _this.handleTogglePopover,
2098
+ "onMouseenter": _this.setHover,
2099
+ "onMouseleave": _this.cancelHover
2100
+ }, [((_this$$slots$trigger = (_this$$slots3 = _this.$slots).trigger) === null || _this$$slots$trigger === void 0 ? void 0 : _this$$slots$trigger.call(_this$$slots3, {
2101
+ selected: _this.selected
2102
+ })) || renderTriggerInput()]);
2103
+ };
2104
+ var renderSelectContent = function renderSelectContent() {
2105
+ var _this$$slots$default, _this$$slots8;
2106
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2107
+ "class": _this.resolveClassName('select-content-wrapper'),
2108
+ "ref": "contentRef"
2109
+ }, [_this.filterable && !_this.inputSearch && (0,external_vue_namespaceObject.createVNode)("div", {
2110
+ "class": _this.resolveClassName('select-search-wrapper')
2111
+ }, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Search, {
2112
+ "class": "icon-search",
2113
+ "width": 16,
2114
+ "height": 16
2115
+ }, null), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("input", {
2116
+ "ref": "searchRef",
2117
+ "class": _this.resolveClassName('select-search-input'),
2118
+ "placeholder": _this.localSearchPlaceholder,
2119
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
2120
+ return _this.searchKey = $event;
2121
+ }
2122
+ }, null), [[external_vue_namespaceObject.vModelText, _this.searchKey]])]), !_this.isShowSelectContent && (0,external_vue_namespaceObject.createVNode)("div", {
2123
+ "class": _this.resolveClassName('select-empty')
2124
+ }, [_this.searchLoading && (0,external_vue_namespaceObject.createVNode)(external_loading_namespaceObject["default"], {
2125
+ "class": "mr5",
2126
+ "theme": "primary",
2127
+ "loading": true,
2128
+ "mode": "spin",
2129
+ "size": "mini"
2130
+ }, null), (0,external_vue_namespaceObject.createVNode)("span", null, [_this.curContentText])]), (0,external_vue_namespaceObject.createVNode)("div", {
2131
+ "class": _this.resolveClassName('select-content')
2132
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
2133
+ "class": _this.enableVirtualRender ? '' : _this.resolveClassName('select-dropdown'),
2134
+ "style": {
2135
+ maxHeight: "".concat(_this.scrollHeight, "px")
2136
+ },
2137
+ "onScroll": _this.handleScroll
2138
+ }, [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("ul", {
2139
+ "class": _this.resolveClassName('select-options')
2140
+ }, [_this.isShowSelectAll && (0,external_vue_namespaceObject.createVNode)("li", {
2141
+ "class": _this.resolveClassName('select-option'),
2142
+ "onMouseenter": _this.handleSelectedAllOptionMouseEnter,
2143
+ "onClick": _this.handleToggleAll
2144
+ }, [_this.localSelectAllText]), _this.enableVirtualRender ? (0,external_vue_namespaceObject.createVNode)(external_virtual_render_namespaceObject["default"], {
2145
+ "list": _this.virtualList,
2146
+ "height": _this.virtualHeight,
2147
+ "lineHeight": 32,
2148
+ "ref": "virtualRenderRef"
2149
+ }, {
2150
+ "default": function _default(_ref3) {
2151
+ var _this$$slots4, _this$$slots5;
2152
+ var data = _ref3.data;
2153
+ var optionRender = ((_this$$slots4 = _this.$slots) === null || _this$$slots4 === void 0 ? void 0 : _this$$slots4.optionRender) || ((_this$$slots5 = _this.$slots) === null || _this$$slots5 === void 0 ? void 0 : _this$$slots5.virtualScrollRender);
2154
+ return data.map(function (item) {
2155
+ return (0,external_vue_namespaceObject.createVNode)(src_option, {
2156
+ "key": item[_this.idKey],
2157
+ "id": item[_this.idKey],
2158
+ "name": item[_this.displayKey]
2159
+ }, typeof optionRender === 'function' ? {
2160
+ "default": function _default() {
2161
+ return optionRender({
2162
+ item: item
2163
+ });
2164
+ }
2165
+ } : null);
2166
+ });
2167
+ }
2168
+ }) : _this.list.map(function (item) {
2169
+ var _this$$slots6;
2170
+ return (0,external_vue_namespaceObject.createVNode)(src_option, {
2171
+ "id": item[_this.idKey],
2172
+ "name": item[_this.displayKey]
2173
+ }, (_this$$slots6 = _this.$slots) !== null && _this$$slots6 !== void 0 && _this$$slots6.optionRender ? {
2174
+ "default": function _default() {
2175
+ var _this$$slots7, _this$$slots7$optionR;
2176
+ return (_this$$slots7 = _this.$slots) === null || _this$$slots7 === void 0 || (_this$$slots7$optionR = _this$$slots7.optionRender) === null || _this$$slots7$optionR === void 0 ? void 0 : _this$$slots7$optionR.call(_this$$slots7, {
2177
+ item: item
2178
+ });
2179
+ }
2180
+ } : null);
2181
+ }), (_this$$slots$default = (_this$$slots8 = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots8), _this.scrollLoading && (0,external_vue_namespaceObject.createVNode)("li", {
2182
+ "class": _this.resolveClassName('select-options-loading')
2183
+ }, [(0,external_vue_namespaceObject.createVNode)(external_loading_namespaceObject["default"], {
2184
+ "class": "spinner mr5",
2185
+ "theme": "primary",
2186
+ "loading": true,
2187
+ "mode": "spin",
2188
+ "size": "mini"
2189
+ }, null), (0,external_vue_namespaceObject.createVNode)("span", null, [_this.localLoadingText])])]), [[external_vue_namespaceObject.vShow, _this.isShowSelectContent]])]), _this.$slots.extension && (0,external_vue_namespaceObject.createVNode)("div", {
2190
+ "class": _this.resolveClassName('select-extension')
2191
+ }, [_this.$slots.extension()])])]);
2192
+ };
2193
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2194
+ "class": selectClass
2195
+ }, [(0,external_vue_namespaceObject.createVNode)(external_popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)(this.popoverConfig, {
2196
+ "onClickoutside": this.handleClickOutside,
2197
+ "onAfterShow": this.handlePopoverShow,
2198
+ "ref": "popoverRef"
2199
+ }), {
2200
+ "default": function _default() {
2201
+ return renderSelectTrigger();
2202
+ },
2203
+ content: function content() {
2204
+ return renderSelectContent();
2205
+ }
2206
+ })]);
2207
+ }
2208
+ }));
2209
+ ;// CONCATENATED MODULE: ../../packages/select/src/index.ts
2210
+ /*
2211
+ * Tencent is pleased to support the open source community by making
2212
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2213
+ *
2214
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2215
+ *
2216
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2217
+ *
2218
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2219
+ *
2220
+ * ---------------------------------------------------
2221
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2222
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2223
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2224
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2225
+ *
2226
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2227
+ * the Software.
2228
+ *
2229
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2230
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2231
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2232
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2233
+ * IN THE SOFTWARE.
2234
+ */
2235
+
2236
+
2237
+
2238
+
2239
+ var BkSelect = (0,external_shared_namespaceObject.withInstallProps)(src_select, {
2240
+ Option: src_option,
2241
+ Group: optionGroup
2242
+ });
2243
+ /* harmony default export */ const src = (BkSelect);
2244
+
2245
+ })();
2246
+
2247
+ var __webpack_exports__BkOption = __webpack_exports__.T0;
2248
+ var __webpack_exports__BkOptionGroup = __webpack_exports__.GE;
2249
+ var __webpack_exports__BkSelect = __webpack_exports__.i2;
2250
+ var __webpack_exports__default = __webpack_exports__.ZP;
2251
+ export { __webpack_exports__BkOption as BkOption, __webpack_exports__BkOptionGroup as BkOptionGroup, __webpack_exports__BkSelect as BkSelect, __webpack_exports__default as default };