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