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