bkui-vue 0.0.2-beta.36 → 0.0.2-beta.37

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 (169) hide show
  1. package/lib/affix/index.js +391 -1
  2. package/lib/alert/index.js +287 -1
  3. package/lib/animate-number/index.js +219 -1
  4. package/lib/backtop/index.js +264 -1
  5. package/lib/badge/index.js +304 -1
  6. package/lib/breadcrumb/index.js +379 -1
  7. package/lib/button/index.js +403 -1
  8. package/lib/card/index.js +369 -1
  9. package/lib/cascader/index.js +2095 -2
  10. package/lib/checkbox/index.js +602 -1
  11. package/lib/code-diff/index.js +5548 -1
  12. package/lib/collapse/index.js +605 -1
  13. package/lib/collapse-transition/index.js +237 -1
  14. package/lib/color-picker/index.js +2735 -1
  15. package/lib/components.js +770 -1
  16. package/lib/config-provider/index.js +377 -1
  17. package/lib/container/index.js +408 -1
  18. package/lib/date-picker/index.js +5576 -1
  19. package/lib/dialog/index.js +1324 -2
  20. package/lib/directives/index.js +1386 -2
  21. package/lib/dist.index.js +179 -1
  22. package/lib/divider/index.js +237 -1
  23. package/lib/dropdown/index.js +455 -1
  24. package/lib/exception/index.js +435 -1
  25. package/lib/fixed-navbar/index.js +222 -1
  26. package/lib/form/index.js +1004 -1
  27. package/lib/hooks.js +133 -1
  28. package/lib/icon/angle-double-down-line.js +541 -1
  29. package/lib/icon/angle-double-left-line.js +541 -1
  30. package/lib/icon/angle-double-left.js +541 -1
  31. package/lib/icon/angle-double-right-line.js +541 -1
  32. package/lib/icon/angle-double-right.js +541 -1
  33. package/lib/icon/angle-double-up-line.js +541 -1
  34. package/lib/icon/angle-down-fill.js +541 -1
  35. package/lib/icon/angle-down-line.js +541 -1
  36. package/lib/icon/angle-down.js +541 -1
  37. package/lib/icon/angle-left.js +541 -1
  38. package/lib/icon/angle-right.js +541 -1
  39. package/lib/icon/angle-up-fill.js +541 -1
  40. package/lib/icon/angle-up.js +541 -1
  41. package/lib/icon/archive-fill.js +541 -1
  42. package/lib/icon/arrows-left.js +541 -1
  43. package/lib/icon/arrows-right.js +541 -1
  44. package/lib/icon/assistant.js +541 -1
  45. package/lib/icon/audio-fill.js +541 -1
  46. package/lib/icon/bk.js +541 -1
  47. package/lib/icon/circle.js +541 -1
  48. package/lib/icon/close-line.js +541 -1
  49. package/lib/icon/close.js +541 -1
  50. package/lib/icon/code.js +541 -1
  51. package/lib/icon/cog-shape.js +541 -1
  52. package/lib/icon/collapse-left.js +541 -1
  53. package/lib/icon/copy-shape.js +541 -1
  54. package/lib/icon/copy.js +541 -1
  55. package/lib/icon/data-shape.js +541 -1
  56. package/lib/icon/del.js +541 -1
  57. package/lib/icon/doc-fill.js +541 -1
  58. package/lib/icon/done.js +541 -1
  59. package/lib/icon/down-shape.js +541 -1
  60. package/lib/icon/down-small.js +541 -1
  61. package/lib/icon/edit-line.js +541 -1
  62. package/lib/icon/ellipsis.js +541 -1
  63. package/lib/icon/enlarge-line.js +541 -1
  64. package/lib/icon/error.js +541 -1
  65. package/lib/icon/excel-fill.js +541 -1
  66. package/lib/icon/exclamation-circle-shape.js +541 -1
  67. package/lib/icon/eye.js +541 -1
  68. package/lib/icon/filliscreen-line.js +541 -1
  69. package/lib/icon/fix-line.js +541 -1
  70. package/lib/icon/fix-shape.js +541 -1
  71. package/lib/icon/folder-open.js +541 -1
  72. package/lib/icon/folder-shape-open.js +541 -1
  73. package/lib/icon/folder-shape.js +541 -1
  74. package/lib/icon/folder.js +541 -1
  75. package/lib/icon/funnel.js +541 -1
  76. package/lib/icon/help-document-fill.js +541 -1
  77. package/lib/icon/help-fill.js +541 -1
  78. package/lib/icon/help.js +541 -1
  79. package/lib/icon/image-fill.js +563 -1
  80. package/lib/icon/img-error.js +563 -1
  81. package/lib/icon/img-placehoulder.js +563 -1
  82. package/lib/icon/index.js +2353 -1
  83. package/lib/icon/info-line.js +563 -1
  84. package/lib/icon/info.js +563 -1
  85. package/lib/icon/left-shape.js +563 -1
  86. package/lib/icon/left-turn-line.js +563 -1
  87. package/lib/icon/narrow-line.js +563 -1
  88. package/lib/icon/original.js +563 -1
  89. package/lib/icon/pdf-fill.js +563 -1
  90. package/lib/icon/play-shape.js +563 -1
  91. package/lib/icon/plus.js +563 -1
  92. package/lib/icon/ppt-fill.js +563 -1
  93. package/lib/icon/qq.js +563 -1
  94. package/lib/icon/right-shape.js +563 -1
  95. package/lib/icon/right-turn-line.js +563 -1
  96. package/lib/icon/search.js +563 -1
  97. package/lib/icon/share.js +563 -1
  98. package/lib/icon/spinner.js +563 -1
  99. package/lib/icon/success.js +563 -1
  100. package/lib/icon/switcher-loading.js +563 -1
  101. package/lib/icon/text-file.js +563 -1
  102. package/lib/icon/text-fill.js +563 -1
  103. package/lib/icon/transfer.js +563 -1
  104. package/lib/icon/tree-application-shape.js +563 -1
  105. package/lib/icon/unfull-screen.js +563 -1
  106. package/lib/icon/unvisible.js +563 -1
  107. package/lib/icon/up-shape.js +563 -1
  108. package/lib/icon/upload.js +563 -1
  109. package/lib/icon/video-fill.js +563 -1
  110. package/lib/icon/warn.js +563 -1
  111. package/lib/icon/weixin-pro.js +563 -1
  112. package/lib/icon/weixin.js +563 -1
  113. package/lib/image/index.js +681 -1
  114. package/lib/index.js +195 -1
  115. package/lib/info-box/index.js +1514 -2
  116. package/lib/input/index.js +1038 -1
  117. package/lib/link/index.js +232 -1
  118. package/lib/loading/index.js +443 -1
  119. package/lib/locale/index.js +489 -1
  120. package/lib/menu/index.js +793 -1
  121. package/lib/message/index.js +1842 -2
  122. package/lib/modal/index.js +407 -1
  123. package/lib/navigation/index.js +439 -1
  124. package/lib/notify/index.js +470 -1
  125. package/lib/overflow-title/index.js +547 -1
  126. package/lib/pagination/index.js +974 -1
  127. package/lib/plugin-popover/index.js +4121 -1
  128. package/lib/plugins/index.js +130 -1
  129. package/lib/pop-confirm/index.js +367 -1
  130. package/lib/popover/index.js +4127 -1
  131. package/lib/popover2/index.js +171 -1
  132. package/lib/preset.js +164 -1
  133. package/lib/process/index.js +1146 -2
  134. package/lib/progress/index.js +495 -1
  135. package/lib/radio/index.js +693 -1
  136. package/lib/rate/index.js +406 -1
  137. package/lib/resize-layout/index.js +499 -1
  138. package/lib/search-select/index.js +3024 -2
  139. package/lib/select/index.js +2599 -2
  140. package/lib/shared/index.js +2832 -1
  141. package/lib/sideslider/index.js +1056 -2
  142. package/lib/slider/index.js +1683 -2
  143. package/lib/steps/index.js +1215 -2
  144. package/lib/swiper/index.js +404 -1
  145. package/lib/switcher/index.js +335 -1
  146. package/lib/tab/index.js +935 -1
  147. package/lib/table/index.js +6588 -1
  148. package/lib/table-column/index.js +768 -1
  149. package/lib/tag/index.js +309 -1
  150. package/lib/tag-input/index.js +1758 -1
  151. package/lib/time-picker/index.js +142 -1
  152. package/lib/timeline/index.js +310 -1
  153. package/lib/transfer/index.js +767 -1
  154. package/lib/tree/index.js +2664 -1
  155. package/lib/upload/index.js +3257 -2
  156. package/lib/virtual-render/index.js +806 -1
  157. package/package.json +1 -1
  158. package/lib/cascader/index.js.LICENSE.txt +0 -1
  159. package/lib/dialog/index.js.LICENSE.txt +0 -1
  160. package/lib/directives/index.js.LICENSE.txt +0 -14
  161. package/lib/info-box/index.js.LICENSE.txt +0 -1
  162. package/lib/message/index.js.LICENSE.txt +0 -6
  163. package/lib/process/index.js.LICENSE.txt +0 -1
  164. package/lib/search-select/index.js.LICENSE.txt +0 -1
  165. package/lib/select/index.js.LICENSE.txt +0 -1
  166. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  167. package/lib/slider/index.js.LICENSE.txt +0 -1
  168. package/lib/steps/index.js.LICENSE.txt +0 -1
  169. package/lib/upload/index.js.LICENSE.txt +0 -1
@@ -1,2 +1,2095 @@
1
- /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../tag"),require("../checkbox"));else if("function"==typeof define&&define.amd)define(["../shared","vue","vue-types","../config-provider","../directives","../icon","../popover","../tag","../checkbox"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../tag"),require("../checkbox")):t(e["../shared"],e.vue,e["vue-types"],e["../config-provider"],e["../directives"],e["../icon"],e["../popover"],e["../tag"],e["../checkbox"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,a,i,s,l)=>(()=>{var c={5800:e=>{"use strict";e.exports=l},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=o},6870:e=>{"use strict";e.exports=a},5537:e=>{"use strict";e.exports=i},4212:t=>{"use strict";t.exports=e},7739:e=>{"use strict";e.exports=s},748:e=>{"use strict";e.exports=t},210:e=>{"use strict";e.exports=r},7609:(e,t,r)=>{var n=r(7425).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new S(n||[]);return i(a,"_invoke",{value:w(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var h={};function v(){}function y(){}function g(){}var m={};d(m,l,(function(){return this}));var b=Object.getPrototypeOf,N=b&&b(b(L([])));N&&N!==r&&a.call(N,l)&&(m=N);var k=g.prototype=v.prototype=Object.create(m);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(o,i,s,l){var c=p(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==n(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,l)}),(function(e){r("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return r("throw",e,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function w(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=P(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function P(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function L(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(a.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:E}}function E(){return{value:void 0,done:!0}}return y.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:y,configurable:!0}),y.displayName=d(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,u,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},T(x.prototype),d(x.prototype,c,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new x(f(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},T(k),d(k,u,"Generator"),d(k,l,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=L,S.prototype={constructor:S,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)&&a.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 r(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),V(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;V(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(r){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(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,r)=>{var n=r(7609)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return c[e](r,r.exports,d),r.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};return(()=>{"use strict";d.r(f),d.d(f,{BkCascader:()=>P,BkCascaderPanel:()=>v,default:()=>C});var e=d(4212),t=d(748),r=d(210),n=d(2717),o=d(4061),a=d(6870),i=d(5537),s=d.n(i),l=d(7739),c=d.n(l);d(2841),Symbol("BkSelect"),Symbol("BkOptionGroup");var u=d(5800),p=d.n(u);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const v=(0,t.defineComponent)({name:"CascaderPanel",props:{width:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def("auto"),height:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(216),store:e.PropTypes.object.def({}),separator:e.PropTypes.string.def(""),suggestions:e.PropTypes.arrayOf((0,r.object)()),isFiltering:e.PropTypes.bool.def(!1),searchKey:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def(""),modelValue:e.PropTypes.arrayOf(e.PropTypes.oneOfType([(0,r.array)(),String,Number]))},emits:["update:modelValue"],setup:function(r,o){var i=o.emit,s=(0,n.useLocale)("select"),l=r.store,c=(0,t.reactive)({list:[r.store.getNodes()]}),u=(0,t.ref)([]),d=(0,t.ref)([]),f=function(e){return"number"==typeof e?"".concat(e,"px"):e},p=f(r.height),v=f(r.width),y=function(e){var t=[];if(l.config.multiple){var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;o.length>t.length&&(t=o)}}catch(e){n.e(e)}finally{n.f()}}else t=e;t.forEach((function(e){var t=l.getNodeById(e);m(t)}))},g=function(e){if(!e.isDisabled){if(e.config.multiple){var t=l.config.checkAnyLevel?l.getCheckedNodes():l.getCheckedLeafNodes();d.value=t.map((function(e){return e.path}))}else d.value=e.path;i("update:modelValue",d.value)}},m=function(e){var t;if(e&&!(null==e?void 0:e.isDisabled)){if(c.list=c.list.slice(0,e.level),u.value=u.value.slice(0,e.level-1),null===(t=e.children)||void 0===t?void 0:t.length)return c.list.push(e.children),void u.value.push(e);l.config.isRemote&&!e.isLeaf&&(e.loading=!0,l.config.remoteMethod(e,(function(t){l.appendNodes(t,e||null),c.list.push(e.children),u.value.push(e),e.loading=!1})))}},b=s.value.noData,N=function(e,t){e.setNodeCheck(t||!1),g(e)};(0,t.watch)((function(){return r.modelValue}),(function(e){!function(e){0===e.length&&(c.list=c.list.slice(0,1),u.value=[]),y(e),d.value=e}(e)}),{immediate:!0}),(0,t.watch)((function(){return r.store}),(function(e){c.list=[e.getNodes()]}));var k=(0,n.usePrefix)().resolveClassName;return{menus:c,activePath:u,nodeExpandHandler:m,isNodeInPath:function(e){return(u.value[e.level-1]||{}).id===e.id},nodeEvent:function(e){var t=e.config,r=t.trigger,n=t.checkAnyLevel,o=t.multiple;return{onClick:function(t){e.isLeaf&&!o||t.stopPropagation(),"click"===r&&m(e),n&&!o&&g(e),e.isLeaf&&!o&&g(e)},onMouseenter:function(){"hover"===r&&m(e)}}},isCheckedNode:function(t,r){return t.config.multiple?r.some((function(r){return(0,e.arrayEqual)(r,t.path)})):(0,e.arrayEqual)(r,t.path)},checkValue:d,checkNode:N,iconRender:function(e){return e.loading?(0,t.createVNode)(a.Spinner,{class:"icon-spinner"},null):(0,t.createVNode)(a.AngleRight,{class:"icon-angle-right"},null)},panelWidth:v,panelHeight:p,searchPanelEvents:function(e){var t=e.config.multiple;return{onClick:function(r){if(t)return r.stopPropagation(),void N(e,!e.checked);m(e),e.isLeaf&&!t&&g(e)}}},expandByNodeList:y,noDataText:b,resolveClassName:k}},render:function(){var e=this,r=parseInt(this.panelWidth,10)>200?this.panelWidth:"".concat(200,"px");return(0,t.createVNode)("div",{class:this.resolveClassName("cascader-panel-wrapper")},[this.isFiltering?e.suggestions.length?(0,t.createVNode)("ul",{class:[e.resolveClassName("cascader-panel"),e.resolveClassName("scroll-y")],style:{height:e.panelHeight,width:e.panelWidth}},[e.suggestions.map((function(r){return(0,t.createVNode)("li",(0,t.mergeProps)({class:[e.resolveClassName("cascader-node"),{"is-selected":e.isNodeInPath(r)},{"is-disabled":r.isDisabled},{"is-checked":e.isCheckedNode(r,e.checkValue)}]},e.searchPanelEvents(r)),[r.pathNames.join(e.separator)])}))]):(0,t.createVNode)("div",{class:e.resolveClassName("cascader-search-empty"),style:{width:r}},[(0,t.createVNode)("span",null,[(0,t.createTextVNode)("暂无搜索结果")])]):this.menus.list.map((function(r){return(0,t.createVNode)("ul",{class:[e.resolveClassName("cascader-panel"),e.resolveClassName("scroll-y")],style:{height:e.panelHeight,width:e.panelWidth}},[r.length?r.map((function(r){var n,o;return(0,t.createVNode)("li",(0,t.mergeProps)({class:[e.resolveClassName("cascader-node"),{"is-selected":e.isNodeInPath(r)},{"is-disabled":r.isDisabled},{"is-checked":!r.config.multiple&&e.isCheckedNode(r,e.checkValue)}]},Object.assign(e.nodeEvent(r),(r.config.multiple,{}))),[r.config.multiple&&(0,t.createVNode)(p(),{disabled:r.isDisabled,modelValue:r.checked,"onUpdate:modelValue":function(e){return r.checked=e},indeterminate:r.isIndeterminate,style:"margin-right: 5px",onChange:function(t){return e.checkNode(r,!!t)}},null),null===(o=(n=e.$slots).default)||void 0===o?void 0:o.call(n,{node:r,data:r.data}),r.isLeaf?"":e.iconRender(r)])})):(0,t.createVNode)("div",{class:e.resolveClassName("cascader-panel-empty-wrapper")},[e.noDataText])])}))])}});function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(o=n.key,a=void 0,a=function(e,t){if("object"!==g(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===g(a)?a:String(a)),n)}var o,a}function b(e,t,r){return t&&m(e.prototype,t),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e){return!!e.data.disabled||(1!==e.level?N(e.parent):e.data.disabled)}const k=function(){function t(e,r,n){y(this,t),this.data=e,this.config=r,this.parent=n||null,this.leaf=e.leaf,this.level=this.parent?this.parent.level+1:1,this.initState()}return b(t,[{key:"initState",value:function(){var e=this,r=this.config,n=r.idKey,o=r.nameKey,a=r.childrenKey;this.id=this.data[n],this.name=this.data[o],this.loading=!1,this.loaded=!1,this.checked=!1;var i=this.data[a];this.children=(i||[]).map((function(r){return new t(r,e.config,e)})),this.pathNodes=this.calculateNodesPath(),this.path=this.pathNodes.map((function(e){return e.id})),this.pathNames=this.pathNodes.map((function(e){return e.name}))}},{key:"isLeaf",get:function(){var e;return this.config.isRemote?this.leaf||!!this.loaded&&!this.children.length:!(Array.isArray(this.children)&&0!==(null===(e=this.children)||void 0===e?void 0:e.length))}},{key:"isDisabled",get:function(){return N(this)}},{key:"broadcast",value:function(t,r){var n="onParent".concat((0,e.capitalize)(t));this.children.forEach((function(e){var o;e&&(e.broadcast(t,r),null===(o=e[n])||void 0===o||o.call(e,r))}))}},{key:"emit",value:function(t){var r,n=this.parent,o="onChild".concat((0,e.capitalize)(t));n&&(null===(r=n[o])||void 0===r||r.call(n),n.emit(t))}},{key:"onParentCheck",value:function(e){this.isDisabled||this.setCheckState(e)}},{key:"onChildCheck",value:function(){var e=this.children.filter((function(e){return!e.isDisabled})),t=!!e.length&&e.every((function(e){return e.checked}));this.setCheckState(t)}},{key:"setCheckState",value:function(e){var t=this.children.length,r=this.children.reduce((function(e,t){var r=t.isIndeterminate?.5:0;return e+(t.checked?1:r)}),0);this.checked=e,this.isIndeterminate=r!==t&&r>0}},{key:"setNodeCheck",value:function(e){this.config.checkAnyLevel?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check"))}},{key:"calculateNodesPath",value:function(){for(var e=[this],t=this.parent;t;)e.unshift(t),t=t.parent;return e}}]),t}();var T=function e(t,r){return t.reduce((function(t,n){return n.isLeaf?t.push(n):(!r&&t.push(n),t=t.concat(e(n.children,r))),t}),[])};const x=function(){function t(e){var r=this;y(this,t);var n=e.list;this.data=n,this.config=e,this.nodes=this.data.map((function(e){return new k(e,r.config)}))}return b(t,[{key:"getNodes",value:function(){return this.nodes}},{key:"clearChecked",value:function(){this.getFlattedNodes().forEach((function(e){e.setNodeCheck(!1),e.isIndeterminate=!1}))}},{key:"removeTag",value:function(t){this.getFlattedNodes().find((function(r){return!!(0,e.arrayEqual)(t,r.path)&&(r.setNodeCheck(!1),!0)}))}},{key:"getFlattedNodes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return T(this.nodes,e)}},{key:"setNodesCheck",value:function(t){var r=this;this.getFlattedNodes().forEach((function(n){n.setNodeCheck(!1);var o=t.find((function(t){return(0,e.arrayEqual)(n.path,t)}));o&&r.getNodeByValue(o).setNodeCheck(!0)}))}},{key:"getCheckedNodes",value:function(){return this.getFlattedNodes().filter((function(e){return e.checked}))}},{key:"getCheckedLeafNodes",value:function(){return this.getFlattedNodes().filter((function(e){return e.isLeaf&&e.checked}))}},{key:"getNodeByValue",value:function(t){var r;return null!==(r=this.getFlattedNodes().filter((function(r){return(0,e.arrayEqual)(r.path,t)}))[0])&&void 0!==r?r:null}},{key:"getNodeById",value:function(e){return this.getFlattedNodes().find((function(t){return t.id===e}))}},{key:"appendNode",value:function(e,t){var r=new k(e,this.config,t);(t?t.children:this.nodes).push(r)}},{key:"appendNodes",value:function(e,t){var r=this;e.forEach((function(e){return r.appendNode(e,t)}))}}]),t}(),w=(0,t.defineComponent)({name:"Cascader",directives:{bkTooltips:o.bkTooltips},components:{CascaderPanel:v,BkPopover:s(),Tag:c()},props:{modelValue:e.PropTypes.arrayOf(e.PropTypes.oneOfType([(0,r.array)(),String,Number])),list:e.PropTypes.array.def([]),placeholder:e.PropTypes.string.def(""),behavior:e.PropTypes.string.def("normal"),filterable:e.PropTypes.bool.def(!1),multiple:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),clearable:e.PropTypes.bool.def(!0),trigger:e.PropTypes.string.def("click"),checkAnyLevel:e.PropTypes.bool.def(!1),isRemote:e.PropTypes.bool.def(!1),remoteMethod:e.PropTypes.func,showCompleteName:e.PropTypes.bool.def(!0),idKey:e.PropTypes.string.def("id"),nameKey:e.PropTypes.string.def("name"),childrenKey:e.PropTypes.string.def("children"),separator:e.PropTypes.string.def("/"),limitOneLine:e.PropTypes.bool.def(!1),extCls:e.PropTypes.string.def(""),filterMethod:e.PropTypes.func,scrollHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(216),scrollWidth:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def("auto"),customTextFillback:e.PropTypes.func,customTagsFillback:e.PropTypes.func,collapseTags:{type:Boolean,default:!0},floatMode:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear","toggle","focus"],setup:function(r,o){var a=o.emit,i=o.slots,s=(0,n.useLocale)("select"),l=r.separator,c=r.multiple,u=function(){var e=(0,t.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),d=u.isHover,f=u.setHover,p=u.cancelHover,h=(0,t.ref)(new x(r)),v=(0,t.ref)(""),y=(0,t.ref)([]),g=(0,t.toRefs)(r).modelValue,m=(0,t.ref)(),b=(0,t.ref)(""),N=(0,t.ref)([]),k=(0,t.ref)(!1),T=(0,t.ref)(!1),w=(0,t.ref)(!1),P=(0,t.ref)(!1),C=(0,t.computed)({get:function(){return g.value},set:function(e){a("update:modelValue",e)}}),V=(0,t.ref)(null),S=(0,t.ref)(null),L=(0,t.ref)(null),E=(0,t.computed)((function(){return r.placeholder?r.placeholder:s.value.pleaseSelect})),O=(0,t.computed)((function(){return r.customTextFillback?r.customTextFillback(r.modelValue,h.value.getFlattedNodes()):v.value})),j=function(e){return r.showCompleteName?e.pathNames.join(l):e.pathNames[e.pathNames.length-1]},I=function(e){var t;if(c)return h.value.setNodesCheck(e),y.value=h.value.getCheckedNodes().filter((function(e){return h.value.config.checkAnyLevel||e.isLeaf})).map((function(e){return{text:j(e),key:e.id}})),void(v.value=y.value.map((function(e){return e.text})).join(", "));r.checkAnyLevel||null===(t=null==V?void 0:V.value)||void 0===t||t.hide();var n=h.value.getNodeByValue(e);v.value=n?j(n):"",b.value=v.value},F=(0,e.debounce)(200,(function(e){var t=e.target;if(b.value=t.value,""!==b.value){k.value=!0,k.value=!0;var n=r.filterMethod?r.filterMethod:function(e){return(r.checkAnyLevel||e.isLeaf)&&e.pathNames.join(r.separator).includes(b.value)},o=h.value.getFlattedNodes().filter((function(e){return n(e,b.value)}));N.value=o,!(null==V?void 0:V.value.isShow)&&(null==V||V.value.show())}else k.value=!1})),_=function(){a("focus")};(0,t.watch)((function(){return r.modelValue}),(function(e,t){var r;I(e),a("update:modelValue",e),void 0!==t&&a("change",e),null===(r=null==L?void 0:L.value)||void 0===r||r.focus()}),{immediate:!0}),(0,t.watch)((function(){return r.list}),(function(){h.value=new x(r),I(r.modelValue)}),{deep:!0,immediate:!0});var q=(0,t.computed)((function(){return r.customTagsFillback?r.customTagsFillback(r.modelValue,h.value.getFlattedNodes()):y.value.map((function(e){return e.text}))})),A=(0,t.computed)((function(){return r.collapseTags?r.collapseTags&&w.value:r.collapseTags})),H=(0,t.computed)((function(){return r.collapseTags?r.collapseTags&&T.value:r.collapseTags})),M=i.trigger?{overflowTagIndex:null}:function(e,r,n){(0,t.watch)([n,r],(function(){a()}),{flush:"post"});var o=(0,t.ref)(null),a=function(){r.value&&(o.value=null,setTimeout((function(){var t=Array.from(e.value.querySelectorAll(".tag-item")),r=t.findIndex((function(e,r){return!!r&&t[r-1].offsetTop!==e.offsetTop}));o.value=r>0?r-1:null})))};return{overflowTagIndex:o}}(S,H,q),R=M.overflowTagIndex,B=(0,n.usePrefix)().resolveClassName;return{calcuPlaceholder:E,bkCascaderRef:S,inputRef:L,overflowTagIndex:R,isCollapse:A,isFocus:w,store:h,updateValue:I,selectedText:v,checkedValue:C,handleClear:function(e){e.stopPropagation(),h.value.clearChecked(),b.value="",I([]),a("update:modelValue",[]),a("clear",JSON.parse(JSON.stringify(r.modelValue)))},isHover:d,setHover:f,popover:V,cancelHover:p,selectedTags:y,removeTag:function(e,t,r){r.stopPropagation();var n=JSON.parse(JSON.stringify(e)),o=n.splice(t,1)[0];T.value=!0,h.value.removeTag(o),I(n),a("update:modelValue",h.value.getCheckedNodes().map((function(e){return e.path}))),setTimeout((function(){T.value=w.value}))},cascaderPanel:m,popoverChangeEmitter:function(e){P.value=e.isShow,a("toggle",e.isShow),T.value=e.isShow,w.value=e.isShow,(0,t.nextTick)((function(){var t;e&&(null===(t=L.value)||void 0===t||t.focus())})),e.isShow&&_(),e.isShow||(k.value=!1)},searchKey:b,suggestions:N,isFiltering:k,searchInputHandler:F,focusEmitter:_,tagList:q,isEdit:T,displayText:O,resolveClassName:B,isShowPanel:P}},render:function(){var e=this;this.overflowTagIndex=0===this.overflowTagIndex?1:this.overflowTagIndex;var r=this.tagList.reduce((function(t,r,n){return null!==e.overflowTagIndex&&n>=e.overflowTagIndex&&t.push(r),t}),[]),n=function(){return(0,t.createVNode)(s(),{placement:"bottom-start",theme:"light ".concat(e.resolveClassName("cascader-popover")),trigger:"click",arrow:!1,disabled:e.disabled,class:e.resolveClassName("cascader-popover-wrapper"),ref:"popover",onAfterHidden:e.popoverChangeEmitter,onAfterShow:e.popoverChangeEmitter,boundary:"body"},{default:function(){return e.$slots.trigger?e.$slots.trigger({selected:e.modelValue,isShow:e.isShowPanel}):(0,t.createVNode)("div",{class:[e.resolveClassName("cascader-name"),e.resolveClassName("scroll-y")]},[e.multiple&&e.selectedTags.length>0&&(e.limitOneLine?(0,t.createVNode)("span",{class:"cascader-selected-text"},[e.displayText]):(0,t.createVNode)("div",{class:"cascader-tag-list"},[e.tagList.map((function(r,n){var o=!e.isCollapse&&null!==e.overflowTagIndex&&n>=e.overflowTagIndex;return(0,t.createVNode)("span",{class:"tag-item",style:{display:o?"none":""},key:r},[(0,t.createVNode)("span",{class:"tag-item-name"},[r]),(0,t.createVNode)(a.Error,{class:e.resolveClassName("icon-clear-icon"),onClick:function(t){t.stopPropagation(),e.removeTag(e.modelValue,n,t)}},null)])})),null!==e.overflowTagIndex&&!e.isCollapse&&(0,t.withDirectives)((0,t.createVNode)(c(),{style:"margin-top: 0"},{default:function(){return[(0,t.createTextVNode)("+"),e.selectedTags.length-e.overflowTagIndex]}}),[[(0,t.resolveDirective)("bk-tooltips"),r.join(", ")]])])),e.filterable?(e.isCollapse||0===e.selectedTags.length)&&(0,t.createVNode)("input",{class:[e.resolveClassName("cascader-search-input"),{"is-disabled":e.disabled}],type:"text",onInput:e.searchInputHandler,placeholder:e.calcuPlaceholder,value:e.searchKey,disabled:e.disabled,ref:"inputRef"},null):e.multiple?null:(0,t.createVNode)("span",null,[e.displayText])])},content:function(){return(0,t.createVNode)("div",{class:e.resolveClassName("cascader-popover")},[(0,t.createVNode)(v,{store:e.store,ref:"cascaderPanel",width:e.scrollWidth,height:e.scrollHeight,"search-key":e.searchKey,separator:e.separator,"is-filtering":e.isFiltering,suggestions:e.suggestions,modelValue:e.checkedValue,"onUpdate:modelValue":function(t){return e.checkedValue=t}},{default:function(r){return e.$slots.default?e.$slots.default(r):(0,t.createVNode)("span",{class:e.resolveClassName("cascader-node-name")},[r.node.name])}})])}})};return(0,t.createVNode)("div",{class:[this.resolveClassName("cascader-wrapper"),this.floatMode?"float-mode":""]},[this.$slots.trigger?n():(0,t.createVNode)("div",{class:[this.resolveClassName("cascader"),this.extCls,{"is-unselected":0===this.modelValue.length,"is-hover":this.isHover,"is-filterable":this.filterable,"is-focus":this.isFocus,"is-disabled":this.disabled,"is-simplicity":"simplicity"===this.behavior}],tabindex:"0","data-placeholder":this.calcuPlaceholder,onMouseenter:this.setHover,onMouseleave:this.cancelHover,ref:"bkCascaderRef"},[e.clearable&&e.isHover&&!e.disabled?(0,t.createVNode)(a.Close,{class:e.resolveClassName("icon-clear-icon"),onClick:e.handleClear},null):(0,t.createVNode)(a.AngleUp,{class:e.resolveClassName("icon-angle-up")},null),n()])])}});var P=(0,e.withInstallProps)(w,{CascaderPanel:v});const C=P})(),f})()));
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("../shared"), require("vue"), require("vue-types"), require("../config-provider"), require("../directives"), require("../icon"), require("../popover"), require("../tag"), require("../checkbox"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["../shared", "vue", "vue-types", "../config-provider", "../directives", "../icon", "../popover", "../tag", "../checkbox"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("vue-types"), require("../config-provider"), require("../directives"), require("../icon"), require("../popover"), require("../tag"), require("../checkbox")) : factory(root["../shared"], root["vue"], root["vue-types"], root["../config-provider"], root["../directives"], root["../icon"], root["../popover"], root["../tag"], root["../checkbox"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__210__, __WEBPACK_EXTERNAL_MODULE__2717__, __WEBPACK_EXTERNAL_MODULE__4061__, __WEBPACK_EXTERNAL_MODULE__6870__, __WEBPACK_EXTERNAL_MODULE__5537__, __WEBPACK_EXTERNAL_MODULE__7739__, __WEBPACK_EXTERNAL_MODULE__5800__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 5800:
15
+ /***/ ((module) => {
16
+
17
+ "use strict";
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5800__;
19
+
20
+ /***/ }),
21
+
22
+ /***/ 2717:
23
+ /***/ ((module) => {
24
+
25
+ "use strict";
26
+ module.exports = __WEBPACK_EXTERNAL_MODULE__2717__;
27
+
28
+ /***/ }),
29
+
30
+ /***/ 4061:
31
+ /***/ ((module) => {
32
+
33
+ "use strict";
34
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4061__;
35
+
36
+ /***/ }),
37
+
38
+ /***/ 6870:
39
+ /***/ ((module) => {
40
+
41
+ "use strict";
42
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
43
+
44
+ /***/ }),
45
+
46
+ /***/ 5537:
47
+ /***/ ((module) => {
48
+
49
+ "use strict";
50
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5537__;
51
+
52
+ /***/ }),
53
+
54
+ /***/ 4212:
55
+ /***/ ((module) => {
56
+
57
+ "use strict";
58
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
59
+
60
+ /***/ }),
61
+
62
+ /***/ 7739:
63
+ /***/ ((module) => {
64
+
65
+ "use strict";
66
+ module.exports = __WEBPACK_EXTERNAL_MODULE__7739__;
67
+
68
+ /***/ }),
69
+
70
+ /***/ 748:
71
+ /***/ ((module) => {
72
+
73
+ "use strict";
74
+ module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
75
+
76
+ /***/ }),
77
+
78
+ /***/ 210:
79
+ /***/ ((module) => {
80
+
81
+ "use strict";
82
+ module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
83
+
84
+ /***/ }),
85
+
86
+ /***/ 7609:
87
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
88
+
89
+ var _typeof = (__webpack_require__(7425)["default"]);
90
+ function _regeneratorRuntime() {
91
+ "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
92
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
93
+ return exports;
94
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
95
+ var exports = {},
96
+ Op = Object.prototype,
97
+ hasOwn = Op.hasOwnProperty,
98
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
99
+ obj[key] = desc.value;
100
+ },
101
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
102
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
103
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
104
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
105
+ function define(obj, key, value) {
106
+ return Object.defineProperty(obj, key, {
107
+ value: value,
108
+ enumerable: !0,
109
+ configurable: !0,
110
+ writable: !0
111
+ }), obj[key];
112
+ }
113
+ try {
114
+ define({}, "");
115
+ } catch (err) {
116
+ define = function define(obj, key, value) {
117
+ return obj[key] = value;
118
+ };
119
+ }
120
+ function wrap(innerFn, outerFn, self, tryLocsList) {
121
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
122
+ generator = Object.create(protoGenerator.prototype),
123
+ context = new Context(tryLocsList || []);
124
+ return defineProperty(generator, "_invoke", {
125
+ value: makeInvokeMethod(innerFn, self, context)
126
+ }), generator;
127
+ }
128
+ function tryCatch(fn, obj, arg) {
129
+ try {
130
+ return {
131
+ type: "normal",
132
+ arg: fn.call(obj, arg)
133
+ };
134
+ } catch (err) {
135
+ return {
136
+ type: "throw",
137
+ arg: err
138
+ };
139
+ }
140
+ }
141
+ exports.wrap = wrap;
142
+ var ContinueSentinel = {};
143
+ function Generator() {}
144
+ function GeneratorFunction() {}
145
+ function GeneratorFunctionPrototype() {}
146
+ var IteratorPrototype = {};
147
+ define(IteratorPrototype, iteratorSymbol, function () {
148
+ return this;
149
+ });
150
+ var getProto = Object.getPrototypeOf,
151
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
152
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
153
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
154
+ function defineIteratorMethods(prototype) {
155
+ ["next", "throw", "return"].forEach(function (method) {
156
+ define(prototype, method, function (arg) {
157
+ return this._invoke(method, arg);
158
+ });
159
+ });
160
+ }
161
+ function AsyncIterator(generator, PromiseImpl) {
162
+ function invoke(method, arg, resolve, reject) {
163
+ var record = tryCatch(generator[method], generator, arg);
164
+ if ("throw" !== record.type) {
165
+ var result = record.arg,
166
+ value = result.value;
167
+ return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
168
+ invoke("next", value, resolve, reject);
169
+ }, function (err) {
170
+ invoke("throw", err, resolve, reject);
171
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
172
+ result.value = unwrapped, resolve(result);
173
+ }, function (error) {
174
+ return invoke("throw", error, resolve, reject);
175
+ });
176
+ }
177
+ reject(record.arg);
178
+ }
179
+ var previousPromise;
180
+ defineProperty(this, "_invoke", {
181
+ value: function value(method, arg) {
182
+ function callInvokeWithMethodAndArg() {
183
+ return new PromiseImpl(function (resolve, reject) {
184
+ invoke(method, arg, resolve, reject);
185
+ });
186
+ }
187
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
188
+ }
189
+ });
190
+ }
191
+ function makeInvokeMethod(innerFn, self, context) {
192
+ var state = "suspendedStart";
193
+ return function (method, arg) {
194
+ if ("executing" === state) throw new Error("Generator is already running");
195
+ if ("completed" === state) {
196
+ if ("throw" === method) throw arg;
197
+ return doneResult();
198
+ }
199
+ for (context.method = method, context.arg = arg;;) {
200
+ var delegate = context.delegate;
201
+ if (delegate) {
202
+ var delegateResult = maybeInvokeDelegate(delegate, context);
203
+ if (delegateResult) {
204
+ if (delegateResult === ContinueSentinel) continue;
205
+ return delegateResult;
206
+ }
207
+ }
208
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
209
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
210
+ context.dispatchException(context.arg);
211
+ } else "return" === context.method && context.abrupt("return", context.arg);
212
+ state = "executing";
213
+ var record = tryCatch(innerFn, self, context);
214
+ if ("normal" === record.type) {
215
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
216
+ return {
217
+ value: record.arg,
218
+ done: context.done
219
+ };
220
+ }
221
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
222
+ }
223
+ };
224
+ }
225
+ function maybeInvokeDelegate(delegate, context) {
226
+ var methodName = context.method,
227
+ method = delegate.iterator[methodName];
228
+ 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;
229
+ var record = tryCatch(method, delegate.iterator, context.arg);
230
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
231
+ var info = record.arg;
232
+ 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);
233
+ }
234
+ function pushTryEntry(locs) {
235
+ var entry = {
236
+ tryLoc: locs[0]
237
+ };
238
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
239
+ }
240
+ function resetTryEntry(entry) {
241
+ var record = entry.completion || {};
242
+ record.type = "normal", delete record.arg, entry.completion = record;
243
+ }
244
+ function Context(tryLocsList) {
245
+ this.tryEntries = [{
246
+ tryLoc: "root"
247
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
248
+ }
249
+ function values(iterable) {
250
+ if (iterable) {
251
+ var iteratorMethod = iterable[iteratorSymbol];
252
+ if (iteratorMethod) return iteratorMethod.call(iterable);
253
+ if ("function" == typeof iterable.next) return iterable;
254
+ if (!isNaN(iterable.length)) {
255
+ var i = -1,
256
+ next = function next() {
257
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
258
+ return next.value = undefined, next.done = !0, next;
259
+ };
260
+ return next.next = next;
261
+ }
262
+ }
263
+ return {
264
+ next: doneResult
265
+ };
266
+ }
267
+ function doneResult() {
268
+ return {
269
+ value: undefined,
270
+ done: !0
271
+ };
272
+ }
273
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
274
+ value: GeneratorFunctionPrototype,
275
+ configurable: !0
276
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
277
+ value: GeneratorFunction,
278
+ configurable: !0
279
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
280
+ var ctor = "function" == typeof genFun && genFun.constructor;
281
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
282
+ }, exports.mark = function (genFun) {
283
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
284
+ }, exports.awrap = function (arg) {
285
+ return {
286
+ __await: arg
287
+ };
288
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
289
+ return this;
290
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
291
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
292
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
293
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
294
+ return result.done ? result.value : iter.next();
295
+ });
296
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
297
+ return this;
298
+ }), define(Gp, "toString", function () {
299
+ return "[object Generator]";
300
+ }), exports.keys = function (val) {
301
+ var object = Object(val),
302
+ keys = [];
303
+ for (var key in object) keys.push(key);
304
+ return keys.reverse(), function next() {
305
+ for (; keys.length;) {
306
+ var key = keys.pop();
307
+ if (key in object) return next.value = key, next.done = !1, next;
308
+ }
309
+ return next.done = !0, next;
310
+ };
311
+ }, exports.values = values, Context.prototype = {
312
+ constructor: Context,
313
+ reset: function reset(skipTempReset) {
314
+ 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);
315
+ },
316
+ stop: function stop() {
317
+ this.done = !0;
318
+ var rootRecord = this.tryEntries[0].completion;
319
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
320
+ return this.rval;
321
+ },
322
+ dispatchException: function dispatchException(exception) {
323
+ if (this.done) throw exception;
324
+ var context = this;
325
+ function handle(loc, caught) {
326
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
327
+ }
328
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
329
+ var entry = this.tryEntries[i],
330
+ record = entry.completion;
331
+ if ("root" === entry.tryLoc) return handle("end");
332
+ if (entry.tryLoc <= this.prev) {
333
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
334
+ hasFinally = hasOwn.call(entry, "finallyLoc");
335
+ if (hasCatch && hasFinally) {
336
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
337
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
338
+ } else if (hasCatch) {
339
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
340
+ } else {
341
+ if (!hasFinally) throw new Error("try statement without catch or finally");
342
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
343
+ }
344
+ }
345
+ }
346
+ },
347
+ abrupt: function abrupt(type, arg) {
348
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
349
+ var entry = this.tryEntries[i];
350
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
351
+ var finallyEntry = entry;
352
+ break;
353
+ }
354
+ }
355
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
356
+ var record = finallyEntry ? finallyEntry.completion : {};
357
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
358
+ },
359
+ complete: function complete(record, afterLoc) {
360
+ if ("throw" === record.type) throw record.arg;
361
+ 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;
362
+ },
363
+ finish: function finish(finallyLoc) {
364
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
365
+ var entry = this.tryEntries[i];
366
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
367
+ }
368
+ },
369
+ "catch": function _catch(tryLoc) {
370
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
371
+ var entry = this.tryEntries[i];
372
+ if (entry.tryLoc === tryLoc) {
373
+ var record = entry.completion;
374
+ if ("throw" === record.type) {
375
+ var thrown = record.arg;
376
+ resetTryEntry(entry);
377
+ }
378
+ return thrown;
379
+ }
380
+ }
381
+ throw new Error("illegal catch attempt");
382
+ },
383
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
384
+ return this.delegate = {
385
+ iterator: values(iterable),
386
+ resultName: resultName,
387
+ nextLoc: nextLoc
388
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
389
+ }
390
+ }, exports;
391
+ }
392
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
393
+
394
+ /***/ }),
395
+
396
+ /***/ 7425:
397
+ /***/ ((module) => {
398
+
399
+ function _typeof(obj) {
400
+ "@babel/helpers - typeof";
401
+
402
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
403
+ return typeof obj;
404
+ } : function (obj) {
405
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
406
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
407
+ }
408
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
409
+
410
+ /***/ }),
411
+
412
+ /***/ 2841:
413
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
414
+
415
+ // TODO(Babel 8): Remove this file.
416
+
417
+ var runtime = __webpack_require__(7609)();
418
+ module.exports = runtime;
419
+
420
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
421
+ try {
422
+ regeneratorRuntime = runtime;
423
+ } catch (accidentalStrictMode) {
424
+ if (typeof globalThis === "object") {
425
+ globalThis.regeneratorRuntime = runtime;
426
+ } else {
427
+ Function("r", "regeneratorRuntime = r")(runtime);
428
+ }
429
+ }
430
+
431
+
432
+ /***/ })
433
+
434
+ /******/ });
435
+ /************************************************************************/
436
+ /******/ // The module cache
437
+ /******/ var __webpack_module_cache__ = {};
438
+ /******/
439
+ /******/ // The require function
440
+ /******/ function __webpack_require__(moduleId) {
441
+ /******/ // Check if module is in cache
442
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
443
+ /******/ if (cachedModule !== undefined) {
444
+ /******/ return cachedModule.exports;
445
+ /******/ }
446
+ /******/ // Create a new module (and put it into the cache)
447
+ /******/ var module = __webpack_module_cache__[moduleId] = {
448
+ /******/ // no module.id needed
449
+ /******/ // no module.loaded needed
450
+ /******/ exports: {}
451
+ /******/ };
452
+ /******/
453
+ /******/ // Execute the module function
454
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
455
+ /******/
456
+ /******/ // Return the exports of the module
457
+ /******/ return module.exports;
458
+ /******/ }
459
+ /******/
460
+ /************************************************************************/
461
+ /******/ /* webpack/runtime/compat get default export */
462
+ /******/ (() => {
463
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
464
+ /******/ __webpack_require__.n = (module) => {
465
+ /******/ var getter = module && module.__esModule ?
466
+ /******/ () => (module['default']) :
467
+ /******/ () => (module);
468
+ /******/ __webpack_require__.d(getter, { a: getter });
469
+ /******/ return getter;
470
+ /******/ };
471
+ /******/ })();
472
+ /******/
473
+ /******/ /* webpack/runtime/define property getters */
474
+ /******/ (() => {
475
+ /******/ // define getter functions for harmony exports
476
+ /******/ __webpack_require__.d = (exports, definition) => {
477
+ /******/ for(var key in definition) {
478
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
479
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
480
+ /******/ }
481
+ /******/ }
482
+ /******/ };
483
+ /******/ })();
484
+ /******/
485
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
486
+ /******/ (() => {
487
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
488
+ /******/ })();
489
+ /******/
490
+ /******/ /* webpack/runtime/make namespace object */
491
+ /******/ (() => {
492
+ /******/ // define __esModule on exports
493
+ /******/ __webpack_require__.r = (exports) => {
494
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
495
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
496
+ /******/ }
497
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
498
+ /******/ };
499
+ /******/ })();
500
+ /******/
501
+ /************************************************************************/
502
+ var __webpack_exports__ = {};
503
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
504
+ (() => {
505
+ "use strict";
506
+ // ESM COMPAT FLAG
507
+ __webpack_require__.r(__webpack_exports__);
508
+
509
+ // EXPORTS
510
+ __webpack_require__.d(__webpack_exports__, {
511
+ BkCascader: () => (/* binding */ BkCascader),
512
+ BkCascaderPanel: () => (/* reexport */ cascader_panel),
513
+ "default": () => (/* binding */ src)
514
+ });
515
+
516
+ // EXTERNAL MODULE: external "../shared"
517
+ var external_shared_ = __webpack_require__(4212);
518
+ // EXTERNAL MODULE: external "vue"
519
+ var external_vue_ = __webpack_require__(748);
520
+ // EXTERNAL MODULE: external "vue-types"
521
+ var external_vue_types_ = __webpack_require__(210);
522
+ // EXTERNAL MODULE: external "../config-provider"
523
+ var external_config_provider_ = __webpack_require__(2717);
524
+ // EXTERNAL MODULE: external "../directives"
525
+ var external_directives_ = __webpack_require__(4061);
526
+ // EXTERNAL MODULE: external "../icon"
527
+ var external_icon_ = __webpack_require__(6870);
528
+ // EXTERNAL MODULE: external "../popover"
529
+ var external_popover_ = __webpack_require__(5537);
530
+ var external_popover_default = /*#__PURE__*/__webpack_require__.n(external_popover_);
531
+ // EXTERNAL MODULE: external "../tag"
532
+ var external_tag_ = __webpack_require__(7739);
533
+ var external_tag_default = /*#__PURE__*/__webpack_require__.n(external_tag_);
534
+ // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
535
+ var regenerator = __webpack_require__(2841);
536
+ ;// CONCATENATED MODULE: ../../packages/select/src/common.ts
537
+
538
+
539
+ /*
540
+ * Tencent is pleased to support the open source community by making
541
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
542
+ *
543
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
544
+ *
545
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
546
+ *
547
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
548
+ *
549
+ * ---------------------------------------------------
550
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
551
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
552
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
553
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
554
+ *
555
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
556
+ * the Software.
557
+ *
558
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
559
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
560
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
561
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
562
+ * IN THE SOFTWARE.
563
+ */
564
+
565
+
566
+ var selectKey = Symbol('BkSelect');
567
+ var optionGroupKey = Symbol('BkOptionGroup');
568
+ function useHover() {
569
+ var isHover = (0,external_vue_.ref)(false);
570
+ var setHover = function setHover() {
571
+ isHover.value = true;
572
+ };
573
+ var cancelHover = function cancelHover() {
574
+ isHover.value = false;
575
+ };
576
+ return {
577
+ isHover: isHover,
578
+ setHover: setHover,
579
+ cancelHover: cancelHover
580
+ };
581
+ }
582
+ function useRegistry(data) {
583
+ // 注册item
584
+ var register = function register(key, item) {
585
+ if (!item) return;
586
+ if (data.value.has(key)) {
587
+ console.warn("repeat ".concat(key), item);
588
+ return;
589
+ }
590
+ return data.value.set(key, item);
591
+ };
592
+ // 删除item
593
+ var unregister = function unregister(key) {
594
+ data.value["delete"](key);
595
+ };
596
+ return {
597
+ register: register,
598
+ unregister: unregister
599
+ };
600
+ }
601
+ function useDebouncedRef(value) {
602
+ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
603
+ var timeout;
604
+ var innerValue = value;
605
+ return customRef(function (track, trigger) {
606
+ return {
607
+ get: function get() {
608
+ track();
609
+ return innerValue;
610
+ },
611
+ set: function set(newValue) {
612
+ clearTimeout(timeout);
613
+ if (newValue === undefined || newValue === '') {
614
+ innerValue = newValue;
615
+ trigger();
616
+ } else {
617
+ timeout = setTimeout(function () {
618
+ innerValue = newValue;
619
+ trigger();
620
+ }, delay);
621
+ }
622
+ }
623
+ };
624
+ });
625
+ }
626
+ function usePopover(config, triggerRef) {
627
+ var popoverMinWidth = config.popoverMinWidth;
628
+ var observerIns = null;
629
+ var popperWidth = ref('auto');
630
+ var isPopoverShow = ref(false);
631
+ var togglePopover = function togglePopover() {
632
+ isPopoverShow.value = !isPopoverShow.value;
633
+ };
634
+ var hidePopover = function hidePopover() {
635
+ isPopoverShow.value = false;
636
+ };
637
+ var showPopover = function showPopover() {
638
+ isPopoverShow.value = true;
639
+ };
640
+ var triggerRefResize = function triggerRefResize() {
641
+ var _a;
642
+ popperWidth.value = Math.max((_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.offsetWidth, popoverMinWidth);
643
+ };
644
+ onMounted(function () {
645
+ if (!triggerRef.value) return;
646
+ observerIns = observerResize(triggerRef.value, triggerRefResize, 60, true);
647
+ observerIns.start();
648
+ });
649
+ onBeforeUnmount(function () {
650
+ observerIns === null || observerIns === void 0 ? void 0 : observerIns.stop();
651
+ observerIns = null;
652
+ });
653
+ return {
654
+ isPopoverShow: isPopoverShow,
655
+ popperWidth: popperWidth,
656
+ togglePopover: togglePopover,
657
+ hidePopover: hidePopover,
658
+ showPopover: showPopover
659
+ };
660
+ }
661
+ function useRemoteSearch(method, callBack) {
662
+ var _this = this;
663
+ var searchKey = useDebouncedRef('');
664
+ var searchLoading = ref(false);
665
+ watch(searchKey, function () {
666
+ return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
667
+ return _regeneratorRuntime.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
+ });
693
+ return {
694
+ searchKey: searchKey,
695
+ searchLoading: searchLoading
696
+ };
697
+ }
698
+ function toLowerCase() {
699
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
700
+ if (!value) return value;
701
+ return String(value).trim().toLowerCase();
702
+ }
703
+ ;
704
+ ;// CONCATENATED MODULE: ../../packages/tag-input/src/common.ts
705
+
706
+ /*
707
+ * Tencent is pleased to support the open source community by making
708
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
709
+ *
710
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
711
+ *
712
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
713
+ *
714
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
715
+ *
716
+ * ---------------------------------------------------
717
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
718
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
719
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
720
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
721
+ *
722
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
723
+ * the Software.
724
+ *
725
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
726
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
727
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
728
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
729
+ * IN THE SOFTWARE.
730
+ */
731
+
732
+ var INPUT_MIN_WIDTH = 12;
733
+ function common_useDebouncedRef(value) {
734
+ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
735
+ var timeout;
736
+ var innerValue = value;
737
+ return customRef(function (track, trigger) {
738
+ return {
739
+ get: function get() {
740
+ track();
741
+ return innerValue;
742
+ },
743
+ set: function set(newValue) {
744
+ clearTimeout(timeout);
745
+ timeout = setTimeout(function () {
746
+ innerValue = newValue;
747
+ trigger();
748
+ }, delay);
749
+ }
750
+ };
751
+ });
752
+ }
753
+ function usePage(pageSize) {
754
+ var state = reactive({
755
+ curPage: 1,
756
+ totalSize: 0,
757
+ totalPage: 0,
758
+ pageSize: pageSize,
759
+ isPageLoading: false,
760
+ curPageList: [],
761
+ renderListPaged: []
762
+ });
763
+ // 初始化分页信息
764
+ var initPage = function initPage() {
765
+ var _state$renderListPage, _state$curPageList;
766
+ var allList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
767
+ state.curPage = 1;
768
+ state.totalSize = allList.length;
769
+ state.totalPage = Math.ceil(state.totalSize / state.pageSize) || 1;
770
+ var list = [];
771
+ // 小于等于0会无限循环
772
+ if (state.pageSize > 0) {
773
+ for (var i = 0; i < state.totalSize; i += state.pageSize) {
774
+ list.push(allList.slice(i, i + state.pageSize));
775
+ }
776
+ }
777
+ (_state$renderListPage = state.renderListPaged).splice.apply(_state$renderListPage, [0, state.renderListPaged.length].concat(list));
778
+ (_state$curPageList = state.curPageList).splice.apply(_state$curPageList, [0, state.curPageList.length].concat(_toConsumableArray(state.renderListPaged[state.curPage - 1] || [])));
779
+ };
780
+ var pageChange = function pageChange(page) {
781
+ var _state$curPageList2;
782
+ state.curPage = page;
783
+ (_state$curPageList2 = state.curPageList).splice.apply(_state$curPageList2, [state.curPageList.length, 0].concat(_toConsumableArray(state.renderListPaged[state.curPage - 1] || [])));
784
+ state.isPageLoading = false;
785
+ };
786
+ return {
787
+ pageState: state,
788
+ initPage: initPage,
789
+ pageChange: pageChange
790
+ };
791
+ }
792
+ function useFlatList(props) {
793
+ var _toRefs = toRefs(props),
794
+ useGroup = _toRefs.useGroup,
795
+ saveKey = _toRefs.saveKey,
796
+ displayKey = _toRefs.displayKey,
797
+ list = _toRefs.list;
798
+ var flatList = ref([]);
799
+ var saveKeyMap = ref({});
800
+ watch([useGroup, saveKey, displayKey, list], function () {
801
+ flatList.value = [];
802
+ var formatList = markRaw(list.value);
803
+ if (useGroup.value) {
804
+ formatList = formatList.reduce(function (formatList, item) {
805
+ var children = [];
806
+ if (item.children) {
807
+ children = item.children.map(function (child) {
808
+ return Object.assign({
809
+ group: {
810
+ groupId: item[saveKey.value],
811
+ groupName: item[displayKey.value]
812
+ }
813
+ }, child);
814
+ });
815
+ }
816
+ return formatList.concat(children);
817
+ }, []);
818
+ }
819
+ flatList.value = formatList;
820
+ saveKeyMap.value = formatList.reduce(function (acc, item) {
821
+ acc[item[saveKey.value]] = item;
822
+ return acc;
823
+ }, {});
824
+ }, {
825
+ immediate: true,
826
+ deep: true
827
+ });
828
+ return {
829
+ flatList: flatList,
830
+ saveKeyMap: saveKeyMap
831
+ };
832
+ }
833
+ /**
834
+ * 获取字符长度,汉字两个字节
835
+ * @param str 需要计算长度的字符
836
+ * @returns 字符长度
837
+ */
838
+ var getCharLength = function getCharLength(str) {
839
+ var len = str.length;
840
+ var bitLen = 0;
841
+ for (var i = 0; i < len; i++) {
842
+ if ((str.charCodeAt(i) & 0xff00) !== 0) {
843
+ bitLen += 1;
844
+ }
845
+ bitLen += 1;
846
+ }
847
+ return bitLen;
848
+ };
849
+ /**
850
+ * 获取隐藏 tag index
851
+ * @param tagInputRef 组件容器 ref
852
+ * @param collapseTags 是否折叠 tags
853
+ * @param selectedTagList 已选择 tags
854
+ */
855
+ var useTagsOverflow = function useTagsOverflow(tagInputRef, collapseTags, selectedTagList) {
856
+ (0,external_vue_.watch)([selectedTagList, collapseTags], function () {
857
+ calcOverflow();
858
+ }, {
859
+ flush: 'post'
860
+ });
861
+ var overflowTagIndex = (0,external_vue_.ref)(null);
862
+ // 计算出现换行的索引
863
+ var calcOverflow = function calcOverflow() {
864
+ if (!collapseTags.value) return;
865
+ overflowTagIndex.value = null;
866
+ setTimeout(function () {
867
+ var tags = Array.from(tagInputRef.value.querySelectorAll('.tag-item'));
868
+ var tagIndexInSecondRow = tags.findIndex(function (currentTag, index) {
869
+ if (!index) {
870
+ return false;
871
+ }
872
+ var previousTag = tags[index - 1];
873
+ return previousTag.offsetTop !== currentTag.offsetTop;
874
+ });
875
+ overflowTagIndex.value = tagIndexInSecondRow > 0 ? tagIndexInSecondRow - 1 : null;
876
+ });
877
+ };
878
+ return {
879
+ overflowTagIndex: overflowTagIndex
880
+ };
881
+ };
882
+ // EXTERNAL MODULE: external "../checkbox"
883
+ var external_checkbox_ = __webpack_require__(5800);
884
+ var external_checkbox_default = /*#__PURE__*/__webpack_require__.n(external_checkbox_);
885
+ ;// CONCATENATED MODULE: ../../packages/cascader/src/cascader-panel.tsx
886
+
887
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _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; } } }; }
888
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _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 _arrayLikeToArray(o, minLen); }
889
+ function _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; }
890
+ /*
891
+ * Tencent is pleased to support the open source community by making
892
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
893
+ *
894
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
895
+ *
896
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
897
+ *
898
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
899
+ *
900
+ * ---------------------------------------------------
901
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
902
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
903
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
904
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
905
+ *
906
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
907
+ * the Software.
908
+ *
909
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
910
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
911
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
912
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
913
+ * IN THE SOFTWARE.
914
+ */
915
+
916
+
917
+
918
+
919
+
920
+
921
+ /* harmony default export */ const cascader_panel = ((0,external_vue_.defineComponent)({
922
+ name: 'CascaderPanel',
923
+ props: {
924
+ width: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def('auto'),
925
+ height: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(216),
926
+ store: external_shared_.PropTypes.object.def({}),
927
+ separator: external_shared_.PropTypes.string.def(''),
928
+ suggestions: external_shared_.PropTypes.arrayOf((0,external_vue_types_.object)()),
929
+ isFiltering: external_shared_.PropTypes.bool.def(false),
930
+ searchKey: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string, external_shared_.PropTypes.number]).def(''),
931
+ modelValue: external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.oneOfType([(0,external_vue_types_.array)(), String, Number]))
932
+ },
933
+ emits: ['update:modelValue'],
934
+ setup: function setup(props, _ref) {
935
+ var emit = _ref.emit;
936
+ var t = (0,external_config_provider_.useLocale)('select');
937
+ var store = props.store;
938
+ var menus = (0,external_vue_.reactive)({
939
+ list: [props.store.getNodes()]
940
+ });
941
+ var activePath = (0,external_vue_.ref)([]);
942
+ var checkValue = (0,external_vue_.ref)([]);
943
+ var getSizeComputed = function getSizeComputed(value) {
944
+ if (typeof value === 'number') {
945
+ return "".concat(value, "px");
946
+ }
947
+ return value;
948
+ };
949
+ var panelHeight = getSizeComputed(props.height);
950
+ var panelWidth = getSizeComputed(props.width);
951
+ var updateCheckValue = function updateCheckValue(value) {
952
+ if (value.length === 0) {
953
+ menus.list = menus.list.slice(0, 1);
954
+ activePath.value = [];
955
+ }
956
+ expandByNodeList(value);
957
+ checkValue.value = value;
958
+ };
959
+ var expandByNodeList = function expandByNodeList(value) {
960
+ var targetList = [];
961
+ // 如果配置了多选,找出最长的序列,即其最远的路径,以展开所有面板
962
+ if (store.config.multiple) {
963
+ var _iterator = _createForOfIteratorHelper(value),
964
+ _step;
965
+ try {
966
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
967
+ var subArray = _step.value;
968
+ if (subArray.length > targetList.length) {
969
+ targetList = subArray;
970
+ }
971
+ }
972
+ } catch (err) {
973
+ _iterator.e(err);
974
+ } finally {
975
+ _iterator.f();
976
+ }
977
+ } else {
978
+ targetList = value;
979
+ }
980
+ // 遍历最长路径的节点,如果节点有children,展开子面板
981
+ targetList.forEach(function (id) {
982
+ var node = store.getNodeById(id);
983
+ nodeExpandHandler(node);
984
+ });
985
+ };
986
+ /** 节点选中回调
987
+ * 根据单选、多选配置checkValue
988
+ * 派发事件,更新选中值
989
+ */
990
+ var nodeCheckHandler = function nodeCheckHandler(node) {
991
+ if (node.isDisabled) {
992
+ return;
993
+ }
994
+ if (node.config.multiple) {
995
+ // 如果checkAnyLevel,返回所有check的节点; 否则只check 叶子节点
996
+ var targets = store.config.checkAnyLevel ? store.getCheckedNodes() : store.getCheckedLeafNodes();
997
+ checkValue.value = targets.map(function (node) {
998
+ return node.path;
999
+ }); // 如果任意级别可选,当前节点即为所选内容
1000
+ } else {
1001
+ checkValue.value = node.path;
1002
+ }
1003
+ emit('update:modelValue', checkValue.value);
1004
+ };
1005
+ /** node点击展开回调 */
1006
+ var nodeExpandHandler = function nodeExpandHandler(node) {
1007
+ var _a;
1008
+ if (!node || (node === null || node === void 0 ? void 0 : node.isDisabled)) return;
1009
+ menus.list = menus.list.slice(0, node.level);
1010
+ activePath.value = activePath.value.slice(0, node.level - 1);
1011
+ /** 如果所点击的node具有children元素,则直接展开
1012
+ * 否则判断是否开启了远程加载,进行远程加载列表
1013
+ */
1014
+ if ((_a = node.children) === null || _a === void 0 ? void 0 : _a.length) {
1015
+ menus.list.push(node.children);
1016
+ activePath.value.push(node);
1017
+ return;
1018
+ }
1019
+ if (store.config.isRemote && !node.isLeaf) {
1020
+ node.loading = true;
1021
+ var updateNodes = function updateNodes(nodeData) {
1022
+ store.appendNodes(nodeData, node || null);
1023
+ menus.list.push(node.children);
1024
+ activePath.value.push(node);
1025
+ node.loading = false;
1026
+ };
1027
+ store.config.remoteMethod(node, updateNodes);
1028
+ }
1029
+ };
1030
+ var nodeEvent = function nodeEvent(node) {
1031
+ var _node$config = node.config,
1032
+ trigger = _node$config.trigger,
1033
+ checkAnyLevel = _node$config.checkAnyLevel,
1034
+ multiple = _node$config.multiple;
1035
+ var events = {
1036
+ onClick: function onClick(e) {
1037
+ if (!node.isLeaf || multiple) e.stopPropagation();
1038
+ trigger === 'click' && nodeExpandHandler(node);
1039
+ checkAnyLevel && !multiple && nodeCheckHandler(node);
1040
+ node.isLeaf && !multiple && nodeCheckHandler(node);
1041
+ },
1042
+ onMouseenter: function onMouseenter() {
1043
+ trigger === 'hover' && nodeExpandHandler(node);
1044
+ }
1045
+ };
1046
+ return events;
1047
+ };
1048
+ var searchPanelEvents = function searchPanelEvents(node) {
1049
+ var multiple = node.config.multiple;
1050
+ var events = {
1051
+ onClick: function onClick(e) {
1052
+ if (multiple) {
1053
+ e.stopPropagation();
1054
+ checkNode(node, !node.checked);
1055
+ return;
1056
+ }
1057
+ nodeExpandHandler(node);
1058
+ node.isLeaf && !multiple && nodeCheckHandler(node);
1059
+ }
1060
+ };
1061
+ return events;
1062
+ };
1063
+ var noDataText = t.value.noData;
1064
+ var isNodeInPath = function isNodeInPath(node) {
1065
+ var currentLevel = activePath.value[node.level - 1] || {};
1066
+ return currentLevel.id === node.id;
1067
+ };
1068
+ var isCheckedNode = function isCheckedNode(node, checkValue) {
1069
+ var multiple = node.config.multiple;
1070
+ if (multiple) {
1071
+ return checkValue.some(function (val) {
1072
+ return (0,external_shared_.arrayEqual)(val, node.path);
1073
+ });
1074
+ }
1075
+ return (0,external_shared_.arrayEqual)(checkValue, node.path);
1076
+ };
1077
+ /** 多选节点checkbox点击的回调 */
1078
+ var checkNode = function checkNode(node, value) {
1079
+ node.setNodeCheck(value ? value : false);
1080
+ nodeCheckHandler(node);
1081
+ };
1082
+ var iconRender = function iconRender(node) {
1083
+ return node.loading ? (0,external_vue_.createVNode)(external_icon_.Spinner, {
1084
+ "class": "icon-spinner"
1085
+ }, null) : (0,external_vue_.createVNode)(external_icon_.AngleRight, {
1086
+ "class": "icon-angle-right"
1087
+ }, null);
1088
+ };
1089
+ (0,external_vue_.watch)(function () {
1090
+ return props.modelValue;
1091
+ }, function (value) {
1092
+ updateCheckValue(value);
1093
+ }, {
1094
+ immediate: true
1095
+ });
1096
+ (0,external_vue_.watch)(function () {
1097
+ return props.store;
1098
+ }, function (value) {
1099
+ menus.list = [value.getNodes()];
1100
+ });
1101
+ var _usePrefix = (0,external_config_provider_.usePrefix)(),
1102
+ resolveClassName = _usePrefix.resolveClassName;
1103
+ return {
1104
+ menus: menus,
1105
+ activePath: activePath,
1106
+ nodeExpandHandler: nodeExpandHandler,
1107
+ isNodeInPath: isNodeInPath,
1108
+ nodeEvent: nodeEvent,
1109
+ isCheckedNode: isCheckedNode,
1110
+ checkValue: checkValue,
1111
+ checkNode: checkNode,
1112
+ iconRender: iconRender,
1113
+ panelWidth: panelWidth,
1114
+ panelHeight: panelHeight,
1115
+ searchPanelEvents: searchPanelEvents,
1116
+ expandByNodeList: expandByNodeList,
1117
+ noDataText: noDataText,
1118
+ resolveClassName: resolveClassName
1119
+ };
1120
+ },
1121
+ render: function render() {
1122
+ var _this = this;
1123
+ var emptyWidth = parseInt(this.panelWidth, 10) > 200 ? this.panelWidth : "".concat(200, "px");
1124
+ var searchPanelRender = function searchPanelRender() {
1125
+ return _this.suggestions.length ? (0,external_vue_.createVNode)("ul", {
1126
+ "class": [_this.resolveClassName('cascader-panel'), _this.resolveClassName('scroll-y')],
1127
+ "style": {
1128
+ height: _this.panelHeight,
1129
+ width: _this.panelWidth
1130
+ }
1131
+ }, [_this.suggestions.map(function (node) {
1132
+ return (0,external_vue_.createVNode)("li", (0,external_vue_.mergeProps)({
1133
+ "class": [_this.resolveClassName('cascader-node'), {
1134
+ 'is-selected': _this.isNodeInPath(node)
1135
+ }, {
1136
+ 'is-disabled': node.isDisabled
1137
+ }, {
1138
+ 'is-checked': _this.isCheckedNode(node, _this.checkValue)
1139
+ }]
1140
+ }, _this.searchPanelEvents(node)), [node.pathNames.join(_this.separator)]);
1141
+ })]) : (0,external_vue_.createVNode)("div", {
1142
+ "class": _this.resolveClassName('cascader-search-empty'),
1143
+ "style": {
1144
+ width: emptyWidth
1145
+ }
1146
+ }, [(0,external_vue_.createVNode)("span", null, [(0,external_vue_.createTextVNode)("\u6682\u65E0\u641C\u7D22\u7ED3\u679C")])]);
1147
+ };
1148
+ return (0,external_vue_.createVNode)("div", {
1149
+ "class": this.resolveClassName('cascader-panel-wrapper')
1150
+ }, [this.isFiltering ? searchPanelRender() : this.menus.list.map(function (menu) {
1151
+ return (0,external_vue_.createVNode)("ul", {
1152
+ "class": [_this.resolveClassName('cascader-panel'), _this.resolveClassName('scroll-y')],
1153
+ "style": {
1154
+ height: _this.panelHeight,
1155
+ width: _this.panelWidth
1156
+ }
1157
+ }, [menu.length ? menu.map(function (node) {
1158
+ var _a, _b;
1159
+ return (0,external_vue_.createVNode)("li", (0,external_vue_.mergeProps)({
1160
+ "class": [_this.resolveClassName('cascader-node'), {
1161
+ 'is-selected': _this.isNodeInPath(node)
1162
+ }, {
1163
+ 'is-disabled': node.isDisabled
1164
+ }, {
1165
+ 'is-checked': !node.config.multiple && _this.isCheckedNode(node, _this.checkValue)
1166
+ }]
1167
+ }, Object.assign(_this.nodeEvent(node), node.config.multiple ? {} : {})), [node.config.multiple && (0,external_vue_.createVNode)((external_checkbox_default()), {
1168
+ "disabled": node.isDisabled,
1169
+ "modelValue": node.checked,
1170
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
1171
+ return node.checked = $event;
1172
+ },
1173
+ "indeterminate": node.isIndeterminate,
1174
+ "style": "margin-right: 5px",
1175
+ "onChange": function onChange(val) {
1176
+ return _this.checkNode(node, !!val);
1177
+ }
1178
+ }, null), (_b = (_a = _this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a, {
1179
+ node: node,
1180
+ data: node.data
1181
+ }), !node.isLeaf ? _this.iconRender(node) : '']);
1182
+ }) : (0,external_vue_.createVNode)("div", {
1183
+ "class": _this.resolveClassName('cascader-panel-empty-wrapper')
1184
+ }, [_this.noDataText])]);
1185
+ })]);
1186
+ }
1187
+ }));
1188
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
1189
+ function _classCallCheck(instance, Constructor) {
1190
+ if (!(instance instanceof Constructor)) {
1191
+ throw new TypeError("Cannot call a class as a function");
1192
+ }
1193
+ }
1194
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
1195
+ function _typeof(obj) {
1196
+ "@babel/helpers - typeof";
1197
+
1198
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1199
+ return typeof obj;
1200
+ } : function (obj) {
1201
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1202
+ }, _typeof(obj);
1203
+ }
1204
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
1205
+
1206
+ function _toPrimitive(input, hint) {
1207
+ if (_typeof(input) !== "object" || input === null) return input;
1208
+ var prim = input[Symbol.toPrimitive];
1209
+ if (prim !== undefined) {
1210
+ var res = prim.call(input, hint || "default");
1211
+ if (_typeof(res) !== "object") return res;
1212
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1213
+ }
1214
+ return (hint === "string" ? String : Number)(input);
1215
+ }
1216
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
1217
+
1218
+
1219
+ function _toPropertyKey(arg) {
1220
+ var key = _toPrimitive(arg, "string");
1221
+ return _typeof(key) === "symbol" ? key : String(key);
1222
+ }
1223
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
1224
+
1225
+ function _defineProperties(target, props) {
1226
+ for (var i = 0; i < props.length; i++) {
1227
+ var descriptor = props[i];
1228
+ descriptor.enumerable = descriptor.enumerable || false;
1229
+ descriptor.configurable = true;
1230
+ if ("value" in descriptor) descriptor.writable = true;
1231
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
1232
+ }
1233
+ }
1234
+ function _createClass(Constructor, protoProps, staticProps) {
1235
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1236
+ if (staticProps) _defineProperties(Constructor, staticProps);
1237
+ Object.defineProperty(Constructor, "prototype", {
1238
+ writable: false
1239
+ });
1240
+ return Constructor;
1241
+ }
1242
+ ;// CONCATENATED MODULE: ../../packages/cascader/src/node.ts
1243
+
1244
+
1245
+ /*
1246
+ * Tencent is pleased to support the open source community by making
1247
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1248
+ *
1249
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1250
+ *
1251
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1252
+ *
1253
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1254
+ *
1255
+ * ---------------------------------------------------
1256
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1257
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1258
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1259
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1260
+ *
1261
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1262
+ * the Software.
1263
+ *
1264
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1265
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1266
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1267
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1268
+ * IN THE SOFTWARE.
1269
+ */
1270
+
1271
+ ;
1272
+ /** 除了节点本身的disabled,如果父级是disabled,直接点也必须是disabled */
1273
+ function isNodeDisabled(node) {
1274
+ if (node.data.disabled) {
1275
+ return true;
1276
+ }
1277
+ if (node.level !== 1) {
1278
+ return isNodeDisabled(node.parent);
1279
+ }
1280
+ return node.data.disabled;
1281
+ }
1282
+ // 定义节点类实现INode接口
1283
+ var Node = /*#__PURE__*/function () {
1284
+ function Node(node, config, parent) {
1285
+ _classCallCheck(this, Node);
1286
+ this.data = node;
1287
+ this.config = config;
1288
+ this.parent = parent || null;
1289
+ this.leaf = node.leaf;
1290
+ this.level = !this.parent ? 1 : this.parent.level + 1;
1291
+ this.initState();
1292
+ }
1293
+ // 初始化节点状态
1294
+ _createClass(Node, [{
1295
+ key: "initState",
1296
+ value: function initState() {
1297
+ var _this = this;
1298
+ var _this$config = this.config,
1299
+ idKey = _this$config.idKey,
1300
+ nameKey = _this$config.nameKey,
1301
+ childrenKey = _this$config.childrenKey;
1302
+ this.id = this.data[idKey];
1303
+ this.name = this.data[nameKey];
1304
+ this.loading = false;
1305
+ this.loaded = false;
1306
+ this.checked = false;
1307
+ var childrenData = this.data[childrenKey];
1308
+ this.children = (childrenData || []).map(function (child) {
1309
+ return new Node(child, _this.config, _this);
1310
+ });
1311
+ this.pathNodes = this.calculateNodesPath();
1312
+ this.path = this.pathNodes.map(function (node) {
1313
+ return node.id;
1314
+ });
1315
+ this.pathNames = this.pathNodes.map(function (node) {
1316
+ return node.name;
1317
+ });
1318
+ }
1319
+ // 判断是否是叶子节点
1320
+ }, {
1321
+ key: "isLeaf",
1322
+ get: function get() {
1323
+ var _a;
1324
+ if (this.config.isRemote) {
1325
+ var isLeaf = this.leaf || (this.loaded ? !this.children.length : false);
1326
+ return isLeaf;
1327
+ }
1328
+ return !(Array.isArray(this.children) && ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) !== 0);
1329
+ }
1330
+ // 判断节点是否被禁用
1331
+ }, {
1332
+ key: "isDisabled",
1333
+ get: function get() {
1334
+ return isNodeDisabled(this);
1335
+ }
1336
+ // 向子节点广播事件
1337
+ }, {
1338
+ key: "broadcast",
1339
+ value: function broadcast(event, checkStatus) {
1340
+ var handlerName = "onParent".concat((0,external_shared_.capitalize)(event));
1341
+ this.children.forEach(function (child) {
1342
+ var _a;
1343
+ if (child) {
1344
+ // 自底向上广播事件
1345
+ child.broadcast(event, checkStatus);
1346
+ (_a = child[handlerName]) === null || _a === void 0 ? void 0 : _a.call(child, checkStatus);
1347
+ }
1348
+ });
1349
+ }
1350
+ // 向父节点发送事件
1351
+ }, {
1352
+ key: "emit",
1353
+ value: function emit(event) {
1354
+ var _a;
1355
+ var parent = this.parent;
1356
+ var handlerName = "onChild".concat((0,external_shared_.capitalize)(event));
1357
+ if (parent) {
1358
+ (_a = parent[handlerName]) === null || _a === void 0 ? void 0 : _a.call(parent);
1359
+ parent.emit(event);
1360
+ }
1361
+ }
1362
+ // 处理父节点的选中状态变化
1363
+ }, {
1364
+ key: "onParentCheck",
1365
+ value: function onParentCheck(checked) {
1366
+ if (!this.isDisabled) {
1367
+ this.setCheckState(checked);
1368
+ }
1369
+ }
1370
+ // 处理子节点的选中状态变化
1371
+ }, {
1372
+ key: "onChildCheck",
1373
+ value: function onChildCheck() {
1374
+ var children = this.children;
1375
+ var validChildren = children.filter(function (child) {
1376
+ return !child.isDisabled;
1377
+ });
1378
+ var checked = validChildren.length ? validChildren.every(function (child) {
1379
+ return child.checked;
1380
+ }) : false;
1381
+ this.setCheckState(checked);
1382
+ }
1383
+ // 设置节点的选中状态
1384
+ }, {
1385
+ key: "setCheckState",
1386
+ value: function setCheckState(checked) {
1387
+ var totalNum = this.children.length;
1388
+ var checkedNum = this.children.reduce(function (c, p) {
1389
+ var tempNum = p.isIndeterminate ? 0.5 : 0;
1390
+ var num = p.checked ? 1 : tempNum;
1391
+ return c + num;
1392
+ }, 0);
1393
+ this.checked = checked;
1394
+ this.isIndeterminate = checkedNum !== totalNum && checkedNum > 0;
1395
+ }
1396
+ // 设置节点及其子节点的选中状态
1397
+ }, {
1398
+ key: "setNodeCheck",
1399
+ value: function setNodeCheck(status) {
1400
+ if (this.config.checkAnyLevel) {
1401
+ this.checked = status;
1402
+ return;
1403
+ }
1404
+ this.broadcast('check', status);
1405
+ this.setCheckState(status);
1406
+ this.emit('check');
1407
+ }
1408
+ // 计算节点路径上的所有节点
1409
+ }, {
1410
+ key: "calculateNodesPath",
1411
+ value: function calculateNodesPath() {
1412
+ var nodes = [this];
1413
+ var parent = this.parent;
1414
+ while (parent) {
1415
+ nodes.unshift(parent);
1416
+ parent = parent.parent;
1417
+ }
1418
+ return nodes;
1419
+ }
1420
+ }]);
1421
+ return Node;
1422
+ }();
1423
+ /* harmony default export */ const src_node = (Node);
1424
+ ;// CONCATENATED MODULE: ../../packages/cascader/src/store.ts
1425
+
1426
+
1427
+ /*
1428
+ * Tencent is pleased to support the open source community by making
1429
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1430
+ *
1431
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1432
+ *
1433
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1434
+ *
1435
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1436
+ *
1437
+ * ---------------------------------------------------
1438
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1439
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1440
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1441
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1442
+ *
1443
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1444
+ * the Software.
1445
+ *
1446
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1447
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1448
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1449
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1450
+ * IN THE SOFTWARE.
1451
+ */
1452
+
1453
+
1454
+ var flatNodes = function flatNodes(data, leafOnly) {
1455
+ return data.reduce(function (acc, node) {
1456
+ if (node.isLeaf) {
1457
+ acc.push(node);
1458
+ } else {
1459
+ !leafOnly && acc.push(node);
1460
+ // eslint-disable-next-line no-param-reassign
1461
+ acc = acc.concat(flatNodes(node.children, leafOnly));
1462
+ }
1463
+ return acc;
1464
+ }, []);
1465
+ };
1466
+ var Store = /*#__PURE__*/function () {
1467
+ function Store(props) {
1468
+ var _this = this;
1469
+ _classCallCheck(this, Store);
1470
+ var list = props.list;
1471
+ this.data = list;
1472
+ this.config = props;
1473
+ this.nodes = this.data.map(function (node) {
1474
+ return new src_node(node, _this.config);
1475
+ });
1476
+ }
1477
+ _createClass(Store, [{
1478
+ key: "getNodes",
1479
+ value: function getNodes() {
1480
+ return this.nodes;
1481
+ }
1482
+ /** 清空所有checked */
1483
+ }, {
1484
+ key: "clearChecked",
1485
+ value: function clearChecked() {
1486
+ this.getFlattedNodes().forEach(function (node) {
1487
+ node.setNodeCheck(false);
1488
+ node.isIndeterminate = false;
1489
+ });
1490
+ }
1491
+ /** 移除某一个Tag的check状态 */
1492
+ }, {
1493
+ key: "removeTag",
1494
+ value: function removeTag(tag) {
1495
+ this.getFlattedNodes().find(function (node) {
1496
+ if ((0,external_shared_.arrayEqual)(tag, node.path)) {
1497
+ node.setNodeCheck(false);
1498
+ return true;
1499
+ }
1500
+ return false;
1501
+ });
1502
+ }
1503
+ /** 拍平节点,方便筛选 */
1504
+ }, {
1505
+ key: "getFlattedNodes",
1506
+ value: function getFlattedNodes() {
1507
+ var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1508
+ return flatNodes(this.nodes, leafOnly);
1509
+ }
1510
+ /** 根据传入节点设置节点check状态 */
1511
+ }, {
1512
+ key: "setNodesCheck",
1513
+ value: function setNodesCheck(nodes) {
1514
+ var _this2 = this;
1515
+ this.getFlattedNodes().forEach(function (node) {
1516
+ node.setNodeCheck(false);
1517
+ var checkedNode = nodes.find(function (nodeValue) {
1518
+ return (0,external_shared_.arrayEqual)(node.path, nodeValue);
1519
+ });
1520
+ if (checkedNode) {
1521
+ var currentNode = _this2.getNodeByValue(checkedNode);
1522
+ currentNode.setNodeCheck(true);
1523
+ }
1524
+ });
1525
+ }
1526
+ /** 获取多选下,被选中(checked)的节点 */
1527
+ }, {
1528
+ key: "getCheckedNodes",
1529
+ value: function getCheckedNodes() {
1530
+ return this.getFlattedNodes().filter(function (node) {
1531
+ return node.checked;
1532
+ });
1533
+ }
1534
+ /** 获取多选下,被选中(checked),且为叶子节点的节点 */
1535
+ }, {
1536
+ key: "getCheckedLeafNodes",
1537
+ value: function getCheckedLeafNodes() {
1538
+ return this.getFlattedNodes().filter(function (node) {
1539
+ return node.isLeaf && node.checked;
1540
+ });
1541
+ }
1542
+ /** 根据值获得node实例 */
1543
+ }, {
1544
+ key: "getNodeByValue",
1545
+ value: function getNodeByValue(value) {
1546
+ var _a;
1547
+ var nodes = this.getFlattedNodes().filter(function (node) {
1548
+ return (0,external_shared_.arrayEqual)(node.path, value);
1549
+ });
1550
+ return (_a = nodes[0]) !== null && _a !== void 0 ? _a : null;
1551
+ }
1552
+ }, {
1553
+ key: "getNodeById",
1554
+ value: function getNodeById(id) {
1555
+ return this.getFlattedNodes().find(function (node) {
1556
+ return node.id === id;
1557
+ });
1558
+ }
1559
+ /** 插入单个节点 */
1560
+ }, {
1561
+ key: "appendNode",
1562
+ value: function appendNode(nodeData, parentNode) {
1563
+ var node = new src_node(nodeData, this.config, parentNode);
1564
+ var children = parentNode ? parentNode.children : this.nodes;
1565
+ children.push(node);
1566
+ }
1567
+ }, {
1568
+ key: "appendNodes",
1569
+ value: function appendNodes(nodeDataList, parentNode) {
1570
+ var _this3 = this;
1571
+ nodeDataList.forEach(function (node) {
1572
+ return _this3.appendNode(node, parentNode);
1573
+ });
1574
+ }
1575
+ }]);
1576
+ return Store;
1577
+ }();
1578
+ /* harmony default export */ const src_store = (Store);
1579
+ ;// CONCATENATED MODULE: ../../packages/cascader/src/cascader.tsx
1580
+
1581
+ /*
1582
+ * Tencent is pleased to support the open source community by making
1583
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1584
+ *
1585
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1586
+ *
1587
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1588
+ *
1589
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1590
+ *
1591
+ * ---------------------------------------------------
1592
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1593
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1594
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1595
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1596
+ *
1597
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1598
+ * the Software.
1599
+ *
1600
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1601
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1602
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1603
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1604
+ * IN THE SOFTWARE.
1605
+ */
1606
+
1607
+
1608
+
1609
+
1610
+
1611
+
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+
1618
+ /* harmony default export */ const cascader = ((0,external_vue_.defineComponent)({
1619
+ name: 'Cascader',
1620
+ directives: {
1621
+ bkTooltips: external_directives_.bkTooltips
1622
+ },
1623
+ components: {
1624
+ CascaderPanel: cascader_panel,
1625
+ BkPopover: (external_popover_default()),
1626
+ Tag: (external_tag_default())
1627
+ },
1628
+ props: {
1629
+ modelValue: external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.oneOfType([(0,external_vue_types_.array)(), String, Number])),
1630
+ list: external_shared_.PropTypes.array.def([]),
1631
+ placeholder: external_shared_.PropTypes.string.def(''),
1632
+ behavior: external_shared_.PropTypes.string.def('normal'),
1633
+ filterable: external_shared_.PropTypes.bool.def(false),
1634
+ multiple: external_shared_.PropTypes.bool.def(false),
1635
+ disabled: external_shared_.PropTypes.bool.def(false),
1636
+ clearable: external_shared_.PropTypes.bool.def(true),
1637
+ trigger: external_shared_.PropTypes.string.def('click'),
1638
+ checkAnyLevel: external_shared_.PropTypes.bool.def(false),
1639
+ isRemote: external_shared_.PropTypes.bool.def(false),
1640
+ remoteMethod: external_shared_.PropTypes.func,
1641
+ showCompleteName: external_shared_.PropTypes.bool.def(true),
1642
+ idKey: external_shared_.PropTypes.string.def('id'),
1643
+ nameKey: external_shared_.PropTypes.string.def('name'),
1644
+ childrenKey: external_shared_.PropTypes.string.def('children'),
1645
+ separator: external_shared_.PropTypes.string.def('/'),
1646
+ limitOneLine: external_shared_.PropTypes.bool.def(false),
1647
+ extCls: external_shared_.PropTypes.string.def(''),
1648
+ filterMethod: external_shared_.PropTypes.func,
1649
+ scrollHeight: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(216),
1650
+ scrollWidth: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def('auto'),
1651
+ customTextFillback: external_shared_.PropTypes.func,
1652
+ customTagsFillback: external_shared_.PropTypes.func,
1653
+ collapseTags: {
1654
+ type: Boolean,
1655
+ "default": true
1656
+ },
1657
+ floatMode: {
1658
+ type: Boolean,
1659
+ "default": false
1660
+ }
1661
+ },
1662
+ emits: ['update:modelValue', 'change', 'clear', 'toggle', 'focus'],
1663
+ setup: function setup(props, _ref) {
1664
+ var emit = _ref.emit,
1665
+ slots = _ref.slots;
1666
+ var t = (0,external_config_provider_.useLocale)('select');
1667
+ var separator = props.separator,
1668
+ multiple = props.multiple;
1669
+ // 用useHover自定义hook来处理鼠标hover状态
1670
+ var _useHover = useHover(),
1671
+ isHover = _useHover.isHover,
1672
+ setHover = _useHover.setHover,
1673
+ cancelHover = _useHover.cancelHover;
1674
+ var store = (0,external_vue_.ref)(new src_store(props));
1675
+ // 定义selectedText变量用于记录当前选择的值的文本
1676
+ var selectedText = (0,external_vue_.ref)('');
1677
+ // 定义selectedTags变量用于记录多选模式下已选的tag
1678
+ var selectedTags = (0,external_vue_.ref)([]);
1679
+ var _toRefs = (0,external_vue_.toRefs)(props),
1680
+ modelValue = _toRefs.modelValue;
1681
+ // 定义cascaderPanel 引用
1682
+ var cascaderPanel = (0,external_vue_.ref)();
1683
+ // 定义searchKey变量,支持搜索时,搜索框绑定变量
1684
+ var searchKey = (0,external_vue_.ref)('');
1685
+ // 定义suggestions变量,搜索功能打开时,面板给出的列表
1686
+ var suggestions = (0,external_vue_.ref)([]);
1687
+ // 定义isFiltering变量,记录是否正在搜索,过滤
1688
+ var isFiltering = (0,external_vue_.ref)(false);
1689
+ // 定义isEdit变量,记录是否处于编辑状态
1690
+ var isEdit = (0,external_vue_.ref)(false);
1691
+ // 定义isFocus变量,记录是否处于焦点状态
1692
+ var isFocus = (0,external_vue_.ref)(false);
1693
+ // 定义isShowPanel变量,用于标致面板显示
1694
+ var isShowPanel = (0,external_vue_.ref)(false);
1695
+ // 用computed定义checkedValue变量,用于监听modelValue的变化
1696
+ var checkedValue = (0,external_vue_.computed)({
1697
+ get: function get() {
1698
+ return modelValue.value;
1699
+ },
1700
+ set: function set(value) {
1701
+ emit('update:modelValue', value);
1702
+ }
1703
+ });
1704
+ // 定义popover变量
1705
+ var popover = (0,external_vue_.ref)(null);
1706
+ // 定义bkCascaderRef和inputRef变量
1707
+ var bkCascaderRef = (0,external_vue_.ref)(null);
1708
+ var inputRef = (0,external_vue_.ref)(null);
1709
+ // 用computed定义placeholder变量,用于处理props中的placeholder属性
1710
+ var placeholder = (0,external_vue_.computed)(function () {
1711
+ return props.placeholder ? props.placeholder : t.value.pleaseSelect;
1712
+ });
1713
+ var displayText = (0,external_vue_.computed)(function () {
1714
+ if (props.customTextFillback) {
1715
+ return props.customTextFillback(props.modelValue, store.value.getFlattedNodes());
1716
+ }
1717
+ return selectedText.value;
1718
+ });
1719
+ // 根据配置,获取输入框显示的text
1720
+ var getShowText = function getShowText(node) {
1721
+ return props.showCompleteName ? node.pathNames.join(separator) : node.pathNames[node.pathNames.length - 1];
1722
+ };
1723
+ // 更新搜索框的值
1724
+ var updateSearchKey = function updateSearchKey() {
1725
+ searchKey.value = selectedText.value;
1726
+ };
1727
+ // 更新选中
1728
+ var updateValue = function updateValue(val) {
1729
+ var _a;
1730
+ // 更新多选情况下的选中标签
1731
+ if (multiple) {
1732
+ store.value.setNodesCheck(val); // 同步节点选中的状态
1733
+ selectedTags.value = store.value.getCheckedNodes().filter(function (node) {
1734
+ return store.value.config.checkAnyLevel || node.isLeaf;
1735
+ }) // 根据 checkAnyLevel 配置过滤选中的节点
1736
+ .map(function (node) {
1737
+ return {
1738
+ text: getShowText(node),
1739
+ key: node.id // 获取节点的唯一键
1740
+ };
1741
+ });
1742
+
1743
+ selectedText.value = selectedTags.value.map(function (item) {
1744
+ return item.text;
1745
+ }).join(', '); // 生成选中文本
1746
+ return;
1747
+ }
1748
+ // 如果 checkAnyLevel 配置为 false,则隐藏弹出框
1749
+ if (!props.checkAnyLevel) {
1750
+ (_a = popover === null || popover === void 0 ? void 0 : popover.value) === null || _a === void 0 ? void 0 : _a.hide();
1751
+ }
1752
+ // 获取与选中值对应的节点
1753
+ var node = store.value.getNodeByValue(val);
1754
+ selectedText.value = node ? getShowText(node) : ''; // 获取节点的显示文本,如果节点不存在则赋值为空字符串
1755
+ updateSearchKey(); // 更新搜索关键字
1756
+ };
1757
+ // 清空所选内容,要stopPropagation防止触发下拉
1758
+ var handleClear = function handleClear(e) {
1759
+ e.stopPropagation();
1760
+ store.value.clearChecked();
1761
+ searchKey.value = '';
1762
+ updateValue([]);
1763
+ emit('update:modelValue', []);
1764
+ emit('clear', JSON.parse(JSON.stringify(props.modelValue)));
1765
+ };
1766
+ // 移除tag
1767
+ var removeTag = function removeTag(value, index, e) {
1768
+ e.stopPropagation();
1769
+ var current = JSON.parse(JSON.stringify(value));
1770
+ var tag = current.splice(index, 1)[0];
1771
+ isEdit.value = true; // 删除时也在编辑态,触发overflowTagIndex的计算
1772
+ store.value.removeTag(tag);
1773
+ updateValue(current);
1774
+ emit('update:modelValue', store.value.getCheckedNodes().map(function (node) {
1775
+ return node.path;
1776
+ }));
1777
+ // 计算过后,关闭编辑状态
1778
+ setTimeout(function () {
1779
+ isEdit.value = isFocus.value;
1780
+ });
1781
+ };
1782
+ // modelValue的监听函数
1783
+ var modelValueChangeHandler = function modelValueChangeHandler(value, oldValue) {
1784
+ var _a;
1785
+ updateValue(value);
1786
+ // 派发相关事件
1787
+ emit('update:modelValue', value);
1788
+ oldValue !== undefined && emit('change', value); // oldValue = undefined代表初始化,init不派发change事件
1789
+ // 如果有过滤搜索,选择后,自动focus到input
1790
+ (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.value) === null || _a === void 0 ? void 0 : _a.focus();
1791
+ };
1792
+ // list的监听函数
1793
+ var listChangeHandler = function listChangeHandler() {
1794
+ store.value = new src_store(props);
1795
+ updateValue(props.modelValue);
1796
+ };
1797
+ // popover的监听函数
1798
+ var popoverChangeEmitter = function popoverChangeEmitter(val) {
1799
+ isShowPanel.value = val.isShow;
1800
+ emit('toggle', val.isShow);
1801
+ isEdit.value = val.isShow;
1802
+ // popover激活后,focus相应事件
1803
+ isFocus.value = val.isShow;
1804
+ (0,external_vue_.nextTick)(function () {
1805
+ var _a;
1806
+ val && ((_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.focus());
1807
+ });
1808
+ val.isShow && focusEmitter(); // 面板打开,触发focus事件
1809
+ // 面板收起,搜索状态关闭
1810
+ if (!val.isShow) {
1811
+ isFiltering.value = false;
1812
+ }
1813
+ };
1814
+ // 搜索框输入的处理函数
1815
+ var searchInputHandler = (0,external_shared_.debounce)(200, function (e) {
1816
+ var target = e.target;
1817
+ searchKey.value = target.value;
1818
+ if (searchKey.value === '') {
1819
+ // 如果搜索关键字为空,则取消过滤
1820
+ isFiltering.value = false;
1821
+ return;
1822
+ }
1823
+ // 开始过滤
1824
+ isFiltering.value = true;
1825
+ isFiltering.value = true;
1826
+ // 筛选方法,如果props中存在filterMethod,则使用props中的方法,否则使用默认方法
1827
+ var filterMethod = props.filterMethod ? props.filterMethod : function (node) {
1828
+ if (props.checkAnyLevel) {
1829
+ // 检查是否需要搜索所有层级的节点
1830
+ return node.pathNames.join(props.separator).includes(searchKey.value);
1831
+ }
1832
+ // 只搜索叶子节点,并且路径中包含搜索关键字
1833
+ return node.isLeaf && node.pathNames.join(props.separator).includes(searchKey.value);
1834
+ };
1835
+ // 获取所有节点并进行过滤
1836
+ var targetNodes = store.value.getFlattedNodes().filter(function (node) {
1837
+ return filterMethod(node, searchKey.value);
1838
+ });
1839
+ suggestions.value = targetNodes;
1840
+ // 如果popover存在且未显示,则显示popover
1841
+ !(popover === null || popover === void 0 ? void 0 : popover.value.isShow) && (popover === null || popover === void 0 ? void 0 : popover.value.show());
1842
+ });
1843
+ // focus事件的处理函数
1844
+ var focusEmitter = function focusEmitter() {
1845
+ emit('focus');
1846
+ };
1847
+ // 监听modelValue的变化
1848
+ (0,external_vue_.watch)(function () {
1849
+ return props.modelValue;
1850
+ }, modelValueChangeHandler, {
1851
+ immediate: true
1852
+ });
1853
+ // 监听list的变化
1854
+ (0,external_vue_.watch)(function () {
1855
+ return props.list;
1856
+ }, listChangeHandler, {
1857
+ deep: true,
1858
+ immediate: true
1859
+ });
1860
+ // 定义overflowTagIndex变量,用于处理tag的折叠
1861
+ var tagList = (0,external_vue_.computed)(function () {
1862
+ return props.customTagsFillback ? props.customTagsFillback(props.modelValue, store.value.getFlattedNodes()) : selectedTags.value.map(function (item) {
1863
+ return item.text;
1864
+ });
1865
+ });
1866
+ var isCollapse = (0,external_vue_.computed)(function () {
1867
+ return props.collapseTags ? props.collapseTags && isFocus.value : props.collapseTags;
1868
+ });
1869
+ var isEditMode = (0,external_vue_.computed)(function () {
1870
+ return props.collapseTags ? props.collapseTags && isEdit.value : props.collapseTags;
1871
+ });
1872
+ // 如果使用了trigger插槽,则不存在bkCascaderRef,做兼容处理
1873
+ var _ref2 = slots.trigger ? {
1874
+ overflowTagIndex: null
1875
+ } : useTagsOverflow(bkCascaderRef, isEditMode, tagList),
1876
+ overflowTagIndex = _ref2.overflowTagIndex;
1877
+ var _usePrefix = (0,external_config_provider_.usePrefix)(),
1878
+ resolveClassName = _usePrefix.resolveClassName;
1879
+ // 返回组件所需的变量和函数
1880
+ return {
1881
+ calcuPlaceholder: placeholder,
1882
+ bkCascaderRef: bkCascaderRef,
1883
+ inputRef: inputRef,
1884
+ overflowTagIndex: overflowTagIndex,
1885
+ isCollapse: isCollapse,
1886
+ isFocus: isFocus,
1887
+ store: store,
1888
+ updateValue: updateValue,
1889
+ selectedText: selectedText,
1890
+ checkedValue: checkedValue,
1891
+ handleClear: handleClear,
1892
+ isHover: isHover,
1893
+ setHover: setHover,
1894
+ popover: popover,
1895
+ cancelHover: cancelHover,
1896
+ selectedTags: selectedTags,
1897
+ removeTag: removeTag,
1898
+ cascaderPanel: cascaderPanel,
1899
+ popoverChangeEmitter: popoverChangeEmitter,
1900
+ searchKey: searchKey,
1901
+ suggestions: suggestions,
1902
+ isFiltering: isFiltering,
1903
+ searchInputHandler: searchInputHandler,
1904
+ focusEmitter: focusEmitter,
1905
+ tagList: tagList,
1906
+ isEdit: isEdit,
1907
+ displayText: displayText,
1908
+ resolveClassName: resolveClassName,
1909
+ isShowPanel: isShowPanel
1910
+ };
1911
+ },
1912
+ render: function render() {
1913
+ var _this = this;
1914
+ // 定义suffixIcon函数,用于根据不同情况渲染后缀图标
1915
+ var suffixIcon = function suffixIcon() {
1916
+ if (_this.clearable && _this.isHover && !_this.disabled) {
1917
+ // 当可清空、鼠标悬浮且未禁用时,渲染清空图标
1918
+ return (0,external_vue_.createVNode)(external_icon_.Close, {
1919
+ "class": _this.resolveClassName('icon-clear-icon'),
1920
+ "onClick": _this.handleClear
1921
+ }, null);
1922
+ }
1923
+ // 否则渲染展开/收起图标
1924
+ return (0,external_vue_.createVNode)(external_icon_.AngleUp, {
1925
+ "class": _this.resolveClassName('icon-angle-up')
1926
+ }, null);
1927
+ };
1928
+ // 因为cascader的tag长短不一,在计算时如果overflowIndex为0,会出现直接+n渲染的情况,因此需要对其进行修正
1929
+ this.overflowTagIndex = this.overflowTagIndex === 0 ? 1 : this.overflowTagIndex;
1930
+ // 根据overflowTagIndex获取需要收起的tag,并生成tooltip
1931
+ var collapseTooltip = this.tagList.reduce(function (acc, cur, curIndex) {
1932
+ if (_this.overflowTagIndex !== null && curIndex >= _this.overflowTagIndex) {
1933
+ acc.push(cur);
1934
+ }
1935
+ return acc;
1936
+ }, []);
1937
+ // 定义renderTags函数,用于渲染选中的tag
1938
+ var renderTags = function renderTags() {
1939
+ if (_this.limitOneLine) {
1940
+ // 如果limitOneLine为true,则只显示一行
1941
+ return (0,external_vue_.createVNode)("span", {
1942
+ "class": "cascader-selected-text"
1943
+ }, [_this.displayText]);
1944
+ }
1945
+ return (0,external_vue_.createVNode)("div", {
1946
+ "class": "cascader-tag-list"
1947
+ }, [_this.tagList.map(function (tag, index) {
1948
+ var isOverflow = !_this.isCollapse && _this.overflowTagIndex !== null && index >= _this.overflowTagIndex;
1949
+ // 根据tag是否超出显示范围,来决定是否渲染
1950
+ return (0,external_vue_.createVNode)("span", {
1951
+ "class": "tag-item",
1952
+ "style": {
1953
+ display: isOverflow ? 'none' : ''
1954
+ },
1955
+ "key": tag
1956
+ }, [(0,external_vue_.createVNode)("span", {
1957
+ "class": "tag-item-name"
1958
+ }, [tag]), (0,external_vue_.createVNode)(external_icon_.Error, {
1959
+ "class": _this.resolveClassName('icon-clear-icon'),
1960
+ "onClick": function onClick(e) {
1961
+ e.stopPropagation();
1962
+ _this.removeTag(_this.modelValue, index, e);
1963
+ }
1964
+ }, null)]);
1965
+ }), _this.overflowTagIndex !== null && !_this.isCollapse && (0,external_vue_.withDirectives)((0,external_vue_.createVNode)((external_tag_default()), {
1966
+ "style": "margin-top: 0"
1967
+ }, {
1968
+ "default": function _default() {
1969
+ return [(0,external_vue_.createTextVNode)("+"), _this.selectedTags.length - _this.overflowTagIndex];
1970
+ }
1971
+ }), [[(0,external_vue_.resolveDirective)("bk-tooltips"), collapseTooltip.join(', ')]])]);
1972
+ };
1973
+ var textRender = function textRender() {
1974
+ return (
1975
+ // 多选时, text被tagRender填充,不需要进行text渲染
1976
+ _this.multiple ? null : (0,external_vue_.createVNode)("span", null, [_this.displayText])
1977
+ );
1978
+ };
1979
+ // 定义popoverRender函数,用于渲染弹出框
1980
+ var popoverRender = function popoverRender() {
1981
+ return (0,external_vue_.createVNode)((external_popover_default()), {
1982
+ "placement": "bottom-start",
1983
+ "theme": "light ".concat(_this.resolveClassName('cascader-popover')),
1984
+ "trigger": "click",
1985
+ "arrow": false,
1986
+ "disabled": _this.disabled,
1987
+ "class": _this.resolveClassName('cascader-popover-wrapper'),
1988
+ "ref": "popover",
1989
+ "onAfterHidden": _this.popoverChangeEmitter,
1990
+ "onAfterShow": _this.popoverChangeEmitter,
1991
+ "boundary": "body"
1992
+ }, {
1993
+ "default": function _default() {
1994
+ return _this.$slots.trigger ? _this.$slots.trigger({
1995
+ selected: _this.modelValue,
1996
+ isShow: _this.isShowPanel
1997
+ }) : (0,external_vue_.createVNode)("div", {
1998
+ "class": [_this.resolveClassName('cascader-name'), _this.resolveClassName('scroll-y')]
1999
+ }, [_this.multiple && _this.selectedTags.length > 0 && renderTags(), _this.filterable ? (_this.isCollapse || _this.selectedTags.length === 0) && (0,external_vue_.createVNode)("input", {
2000
+ "class": [_this.resolveClassName('cascader-search-input'), {
2001
+ 'is-disabled': _this.disabled
2002
+ }],
2003
+ "type": "text",
2004
+ "onInput": _this.searchInputHandler,
2005
+ "placeholder": _this.calcuPlaceholder,
2006
+ "value": _this.searchKey,
2007
+ "disabled": _this.disabled,
2008
+ "ref": "inputRef"
2009
+ }, null) : textRender()]);
2010
+ },
2011
+ content: function content() {
2012
+ return (0,external_vue_.createVNode)("div", {
2013
+ "class": _this.resolveClassName('cascader-popover')
2014
+ }, [(0,external_vue_.createVNode)(cascader_panel, {
2015
+ "store": _this.store,
2016
+ "ref": "cascaderPanel",
2017
+ "width": _this.scrollWidth,
2018
+ "height": _this.scrollHeight,
2019
+ "search-key": _this.searchKey,
2020
+ "separator": _this.separator,
2021
+ "is-filtering": _this.isFiltering,
2022
+ "suggestions": _this.suggestions,
2023
+ "modelValue": _this.checkedValue,
2024
+ "onUpdate:modelValue": function onUpdateModelValue($event) {
2025
+ return _this.checkedValue = $event;
2026
+ }
2027
+ }, {
2028
+ "default": function _default(scope) {
2029
+ return _this.$slots["default"] ? _this.$slots["default"](scope) : (0,external_vue_.createVNode)("span", {
2030
+ "class": _this.resolveClassName('cascader-node-name')
2031
+ }, [scope.node.name]);
2032
+ }
2033
+ })]);
2034
+ }
2035
+ });
2036
+ };
2037
+ return (0,external_vue_.createVNode)("div", {
2038
+ "class": [this.resolveClassName('cascader-wrapper'), this.floatMode ? 'float-mode' : '']
2039
+ }, [this.$slots.trigger ? popoverRender() : (0,external_vue_.createVNode)("div", {
2040
+ "class": [this.resolveClassName('cascader'), this.extCls, {
2041
+ 'is-unselected': this.modelValue.length === 0,
2042
+ 'is-hover': this.isHover,
2043
+ 'is-filterable': this.filterable,
2044
+ 'is-focus': this.isFocus,
2045
+ 'is-disabled': this.disabled,
2046
+ 'is-simplicity': this.behavior === 'simplicity'
2047
+ }],
2048
+ "tabindex": "0",
2049
+ "data-placeholder": this.calcuPlaceholder,
2050
+ "onMouseenter": this.setHover,
2051
+ "onMouseleave": this.cancelHover,
2052
+ "ref": "bkCascaderRef"
2053
+ }, [suffixIcon(), popoverRender()])]);
2054
+ }
2055
+ }));
2056
+ ;// CONCATENATED MODULE: ../../packages/cascader/src/index.ts
2057
+ /*
2058
+ * Tencent is pleased to support the open source community by making
2059
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2060
+ *
2061
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2062
+ *
2063
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2064
+ *
2065
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2066
+ *
2067
+ * ---------------------------------------------------
2068
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2069
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2070
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2071
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2072
+ *
2073
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2074
+ * the Software.
2075
+ *
2076
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2077
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2078
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2079
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2080
+ * IN THE SOFTWARE.
2081
+ */
2082
+
2083
+
2084
+
2085
+ var BkCascader = (0,external_shared_.withInstallProps)(cascader, {
2086
+ CascaderPanel: cascader_panel
2087
+ });
2088
+ /* harmony default export */ const src = (BkCascader);
2089
+
2090
+ })();
2091
+
2092
+ /******/ return __webpack_exports__;
2093
+ /******/ })()
2094
+ ;
2095
+ });