bkui-vue 0.0.2-table-refactor.8 → 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
@@ -1,2 +1,2729 @@
|
|
1
|
-
|
2
|
-
import*as e from"../shared";import*as t from"vue";import*as n from"../config-provider";import*as r from"../directives";import*as i from"../icon";import*as a from"../popover";import*as o from"../checkbox";import*as l from"../radio";var u={7609:(e,t,n)=>{var r=n(7425).default;function i(){e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),l=new N(r||[]);return o(a,"_invoke",{value:E(e,n,l)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var h={};function p(){}function m(){}function g(){}var y={};d(y,u,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(I([])));w&&w!==n&&a.call(w,u)&&(y=w);var b=g.prototype=p.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,o,l,u){var c=f(e[i],e,o);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):t.resolve(d).then((function(e){s.value=e,l(s)}),(function(e){return n("throw",e,l,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}})}function E(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=S(o,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function I(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 n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:V}}function V(){return{value:void 0,done:!0}}return m.prototype=g,o(b,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=d(g,s,"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,s,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},x(k.prototype),d(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new k(v(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},x(b),d(b,s,"Generator"),d(b,u,(function(){return this})),d(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,N.prototype={constructor:N,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(C),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){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(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var r=n(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return u[e](n,n.exports,s),n.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var d={};(()=>{s.d(d,{r:()=>J,Z:()=>Z});const u=(c={debounce:()=>e.debounce,random:()=>e.random,withInstall:()=>e.withInstall},v={},s.d(v,c),v);var c,v;function f(e){return f="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},f(e)}function h(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}function p(e,t,n){return(t=h(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const m=(e=>{var t={};return s.d(t,e),t})({Fragment:()=>t.Fragment,computed:()=>t.computed,createTextVNode:()=>t.createTextVNode,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,inject:()=>t.inject,nextTick:()=>t.nextTick,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,provide:()=>t.provide,ref:()=>t.ref,resolveDirective:()=>t.resolveDirective,shallowRef:()=>t.shallowRef,watch:()=>t.watch,watchEffect:()=>t.watchEffect,withDirectives:()=>t.withDirectives});var g=null,y=null;function _(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function w(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function b(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===w(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var x=0,k=null;function E(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=S.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&C(e)})),a=b(e),o=a.detached,l=a.rendered;e.__resize_observer_triggered__=!1===o&&!1===l,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){C(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(x||(k=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=w(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=_("div",{className:"resize-triggers"}),r=_("div",{className:"resize-expand-trigger"}),i=_("div"),a=_("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(a),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:a},N(e),e.addEventListener("scroll",L,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=b(e).rendered,window.MutationObserver){var u=new MutationObserver(e.__resize_mutation_handler__);u.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=u}e.__resize_listeners__.push(t),x++}function S(){var e=b(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(N(this),this.addEventListener("scroll",L,!0)),this.__resize_rendered__=t,C(this))}function L(){var e,t,n=this;N(this),this.__resize_raf__&&(e=this.__resize_raf__,y||(y=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),y(e)),this.__resize_raf__=(t=function(){var e,t,r,i,a,o,l=(r=(t=(e=n).__resize_last__).width,i=t.height,a=e.offsetWidth,o=e.offsetHeight,a!==r||o!==i?{width:a,height:o}:null);l&&(n.__resize_last__=l,C(n))},g||(g=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),g(t))}function C(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function N(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,a=i.scrollWidth,o=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,c=n.scrollWidth,s=n.scrollHeight;i.scrollLeft=a,i.scrollTop=o,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=c,n.scrollTop=s}const I=(e=>{var t={};return s.d(t,e),t})({useLocale:()=>n.useLocale,usePrefix:()=>n.usePrefix}),V=(e=>{var t={};return s.d(t,e),t})({clickoutside:()=>r.clickoutside}),O=(e=>{var t={};return s.d(t,e),t})({Close:()=>i.Close,Error:()=>i.Error,ExclamationCircleShape:()=>i.ExclamationCircleShape,Search:()=>i.Search});var z=s(2841),T=s.n(z);function F(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const D=(e=>{var t={};return s.d(t,e),t})({default:()=>a.default}),j=(e=>{var t={};return s.d(t,e),t})({default:()=>o.default}),B=(e=>{var t={};return s.d(t,e),t})({default:()=>l.default});function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}var R;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(R||(R={}));var M,P,K=Symbol("SEARCH_SLECT_PROVIDER_KEY"),H=function(){return(0,m.inject)(K)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(M||(M={})),function(e){e.AND="&",e.OR="|"}(P||(P={}));var q=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchItem=t,this.type=n,this.values=[],this.id=t.id,this.name=t.name,this.logical=t.logical||P.OR}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"showLogical",get:function(){return!!this.searchItem.showLogicalPanel}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}})),this.multiple&&this.logical!==P.OR&&(t.logical=this.logical)),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&A(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const Y=(0,m.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}},showLogical:{type:Boolean,default:!0},logical:{type:String,default:P.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup:function(e,t){var n=t.emit,r=(0,I.useLocale)("searchSelect"),i=(0,I.usePrefix)().resolveClassName,a=(0,m.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:r.value.ok},{id:"cancel",name:r.value.cancel,disabled:!1}]:e.footerBtns}));function o(e){n("selectItem",e)}return{handleClick:o,handleClickCondition:function(e){n("selectCondition",e)},handleClickFooterBtn:function(e){n("footerClick",e)},handleSelectedChange:function(e,t){e.stopPropagation(),e.preventDefault(),o(t)},handleLogicalChange:function(e){n("update:logical",e)},filterList:(0,m.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var n;return(null===(n=t.value)||void 0===n?void 0:n.name)?[(0,m.createVNode)("span",{class:"menu-name"},[t.name,(0,m.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var n=e.keyword,r=n.length;if(!(null==n?void 0:n.trim().length)||!t.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return t;var i=[],a=-1;return n=n.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(n),"igm"),(function(e,n){return 0===i.length&&0!==n?i.push(t.slice(0,n)):a>=0&&i.push(t.slice(a+e.length,n)),i.push((0,m.createVNode)("span",{class:"is-keyword"},[e])),a=n,e})),a>=0&&i.push(t.slice(a+r)),i.length?i:t}(t.name)},localFooterBtns:a,resolveClassName:i,t:r}},render:function(){var e,t,n=this,r=(0,m.createVNode)("ul",{class:"menu-content"},[null===(e=this.list)||void 0===e?void 0:e.map((function(e){return(0,m.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(n.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&n.handleClick(e)}},[n.$slots.default?n.$slots.default({item:e,list:n.list,multiple:!!n.multiple,hoverId:n.hoverId,getSearchNode:n.getSearchNode}):(0,m.createVNode)(m.Fragment,null,[n.multiple&&(0,m.createVNode)("span",{onClick:function(t){return n.handleSelectedChange(t,e)}},[(0,m.createVNode)(j.default,{modelValue:n.selected.includes(e.id),class:"is-selected"},null)]),n.getSearchNode(e)])])}))]);return(0,m.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(t=this.conditions)||void 0===t?void 0:t.length)&&(0,m.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,m.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&n.handleClickCondition(e)}},[e.name])}))]),n.showLogical&&n.multiple?(0,m.createVNode)("div",{class:"menu-content-wrapper"},[r,(0,m.createVNode)("div",{class:"menu-condition"},[(0,m.createVNode)("div",{class:"menu-condition-title"},[n.t.logical]),(0,m.createVNode)(B.default,{modelValue:n.logical,onChange:n.handleLogicalChange,label:"|"},{default:function(){return[n.t.or,(0,m.createTextVNode)(" |")]}}),(0,m.createVNode)(B.default,{modelValue:n.logical,onChange:n.handleLogicalChange,label:"&"},{default:function(){return[n.t.and,(0,m.createTextVNode)(" &")]}})])]):r])}}),$=(0,m.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:V.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:M.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(e,t){var n=t.emit,r=t.expose,i=(0,I.useLocale)("searchSelect"),a=(0,I.usePrefix)().resolveClassName,o=(0,m.ref)(null),l=(0,m.ref)(null),c=(0,m.ref)(""),s=(0,m.ref)(!1),d=(0,m.ref)(!1),v=(0,m.ref)(!1),f=(0,m.ref)(e.defautUsingItem),h=(0,m.ref)(""),p=(0,m.ref)(!1),g=(0,u.debounce)(300,j),y=!1,_=(0,m.ref)([]),w=(0,m.ref)([]),b=H(),x=b.editKey,k=b.onValidate,E=(0,m.computed)((function(){var e;return(null===(e=f.value)||void 0===e?void 0:e.logical)||P.OR}));function S(e){switch(e.code){case"ArrowDown":case"ArrowUp":L(e);break;case"Enter":case"NumpadEnter":!function(e){if(y){e.preventDefault();var t=w.value.find((function(e){return e.id===h.value}));t&&V(t)}}(e)}}function L(e){var t;e.preventDefault(),null===(t=o.value)||void 0===t||t.blur();for(var n=w.value.length,r=n,i=w.value.findIndex((function(e){return e.id===h.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var a=w.value[i];if(a&&!a.disabled){r=-1;var l=document.getElementById(a.id);return null==l||l.focus(),void(h.value=a.id)}r-=1}}function C(e){D(),e&&j()}function N(t){var r;return F(this,void 0,void 0,T().mark((function i(){var a,o,l,u,d;return T().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return null==t||t.preventDefault(),i.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(f.value){i.next=16;break}if(c.value&&e.valueBehavior!==R.NEEDKEY){i.next=6;break}return i.abrupt("return");case 6:return a={id:c.value,name:c.value},i.next=9,O(a);case 9:if(i.sent){i.next=12;break}return i.abrupt("return");case 12:return n("add",new q(a,"text")),c.value="",j(),i.abrupt("return");case 16:if(null==(o=f.value.values)?void 0:o.length){i.next=43;break}if(!(null===(r=c.value)||void 0===r?void 0:r.length)){i.next=41;break}if(!c.value.includes(E.value)){i.next=29;break}return l=c.value.split(E.value),i.next=23,O({id:c.value,name:c.value});case 23:if(i.sent){i.next=26;break}return i.abrupt("return");case 26:l.forEach((function(e){return f.value.addValue({id:e,name:e})})),i.next=36;break;case 29:return u={id:c.value,name:c.value},i.next=32,O(u);case 32:if(i.sent){i.next=35;break}return i.abrupt("return");case 35:f.value.addValue(u);case 36:return n("add",f.value),c.value="",f.value=null,D(!0),i.abrupt("return");case 41:return s.value=!0,i.abrupt("return");case 43:if(!c.value){i.next=56;break}return d={id:c.value,name:c.value},i.next=47,O(d);case 47:if(i.sent){i.next=50;break}return i.abrupt("return");case 50:return f.value.addValue(d),n("add",f.value),c.value="",f.value=null,D(!0),i.abrupt("return");case 56:return i.next=58,O();case 58:if(i.sent){i.next=61;break}return i.abrupt("return");case 61:B();case 62:case"end":return i.stop()}}),i)})))}function V(t,n){var r,i,a,l,u,s;return F(this,void 0,void 0,T().mark((function d(){var p,m;return T().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(!(null===(r=t.value)||void 0===r?void 0:r.id)){d.next=20;break}if((e.valueBehavior!==R.NEEDKEY||!t.value)&&e.validateValues){d.next=8;break}return(p=new q(Object.assign(Object.assign({},t),{id:null!==(i=t.realId)&&void 0!==i?i:t.id}),n)).addValue(t.value),B(p),e.valueBehavior===R.NEEDKEY&&h.value&&D(!0),h.value="",d.abrupt("return");case 8:return f.value=new q(Object.assign(Object.assign({},t),{id:null!==(a=t.realId)&&void 0!==a?a:t.id}),n),f.value.addValue(t.value),d.next=12,O(t.value);case 12:if(d.sent){d.next=16;break}return f.value=null,d.abrupt("return");case 16:return B(f.value),h.value="",D(!0),d.abrupt("return");case 20:if(f.value&&(null===(l=null==o?void 0:o.value)||void 0===l?void 0:l.innerText)){d.next=28;break}return f.value=new q(t,n),c.value="",(m="condition"===n)&&B(),v.value=m||!!f.value.children.length,D(e.valueBehavior===R.NEEDKEY&&!!h.value),d.abrupt("return");case 28:if("condition"!==(null===(u=f.value)||void 0===u?void 0:u.type)){d.next=32;break}return f.value=new q(t,n),B(),d.abrupt("return");case 32:return f.value.addValue(t),d.next=35,O(t);case 35:if(d.sent){d.next=38;break}return d.abrupt("return");case 38:f.value.multiple||B(),e.valueBehavior===R.NEEDKEY&&(null===(s=f.value)||void 0===s?void 0:s.multiple)&&D();case 40:case"end":return d.stop()}}),d)})))}function O(t){return F(this,void 0,void 0,T().mark((function n(){var r,i,a,o;return T().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(f.value){n.next=4;break}return n.next=3,z(null,[t]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=f.value,i=r.searchItem,a=r.validate,o=r.values,!a||"function"!=typeof e.validateValues){n.next=9;break}return n.next=8,z(i,t?[t]:o);case 9:return k(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function z(t,n){var r;return F(this,void 0,void 0,T().mark((function i(){var a;return T().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=e.validateValues)||void 0===r?void 0:r.call(e,null!=t?t:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(a=i.sent)&&!1!==a){i.next=6;break}return k(a||"校验错误"),i.abrupt("return",!1);case 6:return k(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function D(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(0,m.nextTick)().then((function(){j()})),d.value=!0,v.value=!0,s.value=!1;var e=setTimeout((function(){if(o.value){o.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(o.value),t.collapseToEnd())}window.clearTimeout(e)}),0);n("focus",d.value)}function j(){var t,n,r,i,a;return F(this,void 0,void 0,T().mark((function o(){var l,s;return T().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(l=[],"function"!=typeof e.getMenuList||void 0!==(null===(n=null===(t=f.value)||void 0===t?void 0:t.searchItem)||void 0===n?void 0:n.async)&&!0!==f.value.searchItem.async){o.next=9;break}return p.value=!0,o.next=5,e.getMenuList(null===(r=f.value)||void 0===r?void 0:r.searchItem,c.value).catch((function(){return[]}));case 5:l=o.sent,p.value=!1,o.next=10;break;case 9:(null==f?void 0:f.value)?"condition"===f.value.type?l=e.conditions:(null===(a=f.value.values)||void 0===a?void 0:a.length)&&!f.value.multiple&&e.mode!==M.EDIT||(l=f.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(i=c.value)||void 0===i?void 0:i.length)?e.data.filter((function(e){return!e.isSelected})).forEach((function(e){var t,n;if(e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())){var r;l.push(e);var i=[];null===(t=e.children)||void 0===t||t.forEach((function(t){i.push(Object.assign(Object.assign({},e),{realId:e.id,id:(0,u.random)(10),value:t}))})),!i.length&&!e.onlyRecommendChildren&&i.push(Object.assign(Object.assign({},e),{realId:e.id,id:(0,u.random)(10),value:{id:c.value,name:c.value}})),(r=l).push.apply(r,i)}else{var a,o=[];null===(n=e.children)||void 0===n||n.forEach((function(t){t.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())&&o.push(Object.assign(Object.assign({},e),{realId:e.id,id:(0,u.random)(10),value:t}))})),!o.length&&!e.onlyRecommendChildren&&o.push(Object.assign(Object.assign({},e),{value:{id:c.value,name:c.value}})),(a=l).push.apply(a,o)}})):l=e.data.filter((function(e){return!e.isSelected})).slice();case 10:w.value=l,e.valueBehavior===R.NEEDKEY&&(s=l.find((function(e){return!e.disabled})))&&(!h.value||h.value&&!l.some((function(e){return e.id===h.value})))&&(h.value=s.id);case 12:case"end":return o.stop()}}),o)})))}function B(t){n("add",null!=t?t:f.value),f.value=null,c.value="",D(e.valueBehavior===R.NEEDKEY)}function A(){var e=o.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(K(e.slice(0,-1)),A()):"\n"!==e[0]&&"\r"!==e[0]||(K(e.slice(1)),A())}function K(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o.value&&(o.value.innerHTML=t||(null===(e=f.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,m.watch)(x,(function(){e.mode===M.DEFAULT&&x.value&&(v.value=!1)})),(0,m.watchEffect)((function(){c.value||K()}),{flush:"pre"}),(0,m.watch)([w,v],(function(){var t;(null===(t=w.value)||void 0===t?void 0:t.some((function(e){return!e.disabled})))&&v.value?y||(e.valueBehavior===R.NEEDKEY?h.value=w.value.find((function(e){return!e.disabled})).id:h.value="",y=!0,document.addEventListener("keydown",S)):(document.removeEventListener("keydown",S),y=!1,e.valueBehavior!==R.NEEDKEY&&(h.value=""))})),r({handleInputFocus:C,isFocus:d}),{popoverRef:l,inputRef:o,keyword:c,loading:p,remoteMenuList:_,menuList:w,menuHoverId:h,isFocus:d,usingItem:f,showPopover:v,showNoSelectValueError:s,debounceSetMenuList:g,documentArrowEvent:L,handleClickOutside:function(t){var r,i,a,o,u;if(!(null===(r=l.value)||void 0===r?void 0:r.contains(t.target))&&(null===(i=e.clickOutside)||void 0===i?void 0:i.call(e,t.target,l.value))){if((null===(o=null===(a=f.value)||void 0===a?void 0:a.values)||void 0===o?void 0:o.length)&&(null===(u=f.value)||void 0===u?void 0:u.multiple))return c.value="",void N();v.value=!1,d.value=!1,n("focus",d.value)}},handleInputFocus:C,handleInputChange:function(e){var t,n,r,i,a,l,u,s,d;A();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm," ".concat(E.value," ")).replace(/\s{2}/gm,""),o.value.innerText=v,D(),c.value=v.replace((null===(t=f.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),g();else if(!c.value&&v.length<((null===(r=null===(n=f.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var h=v.replace(" "," ").replace((null===(i=f.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(a=f.value)||void 0===a?void 0:a.keyInnerText)&&v.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&h&&(null===(l=f.value.values)||void 0===l?void 0:l.length))return c.value=h,console.info("outerText",h),void g();!h&&(null==v?void 0:v.length)||(f.value=null),c.value=h?v:"",g()}else(null===(s=null===(u=f.value)||void 0===u?void 0:u.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=f.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),D(),g())},handleLogicalChange:function(e){f.value&&(f.value.logical=e)},handleInputKeyup:function(t){switch(t.code){case"Enter":case"NumpadEnter":if(e.valueBehavior===R.NEEDKEY&&w.value.some((function(e){return e.id===h.value})))return;N(t);break;case"Backspace":!function(){var t,r;if(!f.value&&!c.value)return n("delete"),void(0,m.nextTick)(j);if(null===(t=f.value)||void 0===t?void 0:t.values.length){if((null===(r=f.value)||void 0===r?void 0:r.multiple)||f.value.isInValueList(f.value.values[0])||e.mode===M.EDIT&&!c.value)return f.value.values.splice(-1,1),c.value="",void D()}else c.value||(f.value=null,c.value="",j());k("")}();default:s.value=!1}},handleSelectItem:V,handleSelectCondtionItem:function(e){V(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=f.value)||void 0===t?void 0:t.values.length))return;c.value="",N();break;case"cancel":f.value.values=[],v.value=!1}},resolveClassName:a,t:i}},render:function(){var e,t,n=this,r=this.usingItem||{},i=r.multiple,a=r.values,o=r.placeholder,l=r.inputInnerHtml,u=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==a?void 0:a.length)&&o,c=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),s=!this.usingItem&&this.showCondition,d=Object.assign({},this.$slots.menu?{default:function(e){var t,r;return null===(r=(t=n.$slots).menu)||void 0===r?void 0:r.call(t,e)}}:{});return(0,m.createVNode)(D.default,{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,m.withDirectives)((0,m.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":n.showInputBefore&&!(null===(e=n.keyword)||void 0===e?void 0:e.length),"input-after":u},contenteditable:!0,"data-placeholder":l||n.keyword?"":n.placeholder,"data-tips":o||"",spellcheck:"false",onFocus:n.handleInputFocus,onInput:n.handleInputChange,onKeydown:n.handleInputKeyup},null),[[(0,m.resolveDirective)("clickoutside"),n.handleClickOutside]])},content:function(){var e,t,r;return n.loading?(0,m.createVNode)("div",null,[n.t.loading]):n.showNoSelectValueError?(0,m.createVNode)("div",null,[n.t.filterQueryMustHasValue]):(null===(e=n.menuList)||void 0===e?void 0:e.length)?(0,m.createVNode)("div",{ref:"popoverRef",class:n.resolveClassName("search-select-popover")},[(0,m.createVNode)(Y,{list:n.menuList,keyword:n.keyword,multiple:!!i,hoverId:n.menuHoverId,selected:(null==a?void 0:a.map((function(e){return e.id})))||[],conditions:s?n.conditions:[],logical:null===(t=n.usingItem)||void 0===t?void 0:t.logical,showLogical:null===(r=n.usingItem)||void 0===r?void 0:r.showLogical,"onUpdate:logical":n.handleLogicalChange,onSelectItem:n.handleSelectItem,onSelectCondition:n.handleSelectCondtionItem,onFooterClick:n.handleMenuFooterClick},Object.assign({},d))]):void 0}})}}),U=(0,m.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var n=t.emit,r=(0,m.ref)(null),i=H(),a=i.onEditClick,o=i.onEditEnter,l=i.onEditBlur,u=i.editKey;return{inputRef:r,editKey:u,copySeletedItem:function(e){var t=new q(e.searchItem,e.type);return t.values=e.values.slice(),t.logical=e.logical||P.OR,t},handleDeleteSelected:function(e){n("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),a(t,n),setTimeout((function(){return r.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){o(e,t)},handleInputFocus:function(e){e||l()}}},render:function(){var e=this,t=function(t,n){return e.editKey==="".concat(t.id,"_").concat(n)?(0,m.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,m.createVNode)($,{ref:"inputRef",key:e.editKey.toString(),mode:M.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,n)},onFocus:e.handleInputFocus},null)]):(0,m.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?n<e.overflowIndex:n>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(n)},[(0,m.createVNode)("span",{class:"selected-name",onClick:function(r){return e.handleEditSeleted(r,t,n)}},[t.inputInnerText]),(0,m.createVNode)(O.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(n)}},null)])};return(0,m.createVNode)(m.Fragment,null,[this.selectedList.map((function(n,r){return[e.overflowIndex>=0&&r===e.overflowIndex&&(0,m.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,m.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(n,r)]}))])}});var W={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:R.ALL,validator:function(e){return[R.ALL,R.NEEDKEY].includes(e)}}};const G=(0,m.defineComponent)({name:"SearchSelect",directives:{clickoutside:V.clickoutside},props:W,emits:["update:modelValue","search"],setup:function(e,t){var n,r=t.emit,i=(0,I.useLocale)("searchSelect"),a=(0,I.usePrefix)().resolveClassName,o=(0,m.computed)((function(){return void 0===e.conditions?[{id:"or",name:i.value.or},{id:"and",name:i.value.and}]:e.conditions})),l=(0,m.ref)(null),c=(0,m.ref)(null),s=(0,m.ref)(!1),d=(0,m.ref)([]),v=(0,m.ref)(-1),f=(0,u.debounce)(32,b),h=(0,m.ref)(""),p=(0,m.ref)(""),g=(0,m.shallowRef)([]);function y(e,t){h.value="".concat(e.id,"_").concat(t)}function _(e,t){var n=d.value.slice();n.splice(t,1,e),r("update:modelValue",n.map((function(e){return e.toValue()}))),h.value=""}function w(e){p.value=e||""}function b(){if(s.value||d.value.length<1)v.value=-1;else{for(var t=c.value.querySelector(".".concat(a("search-select-container"))),n=c.value.querySelector(".search-container").clientWidth-6-2,r=t.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,o=0,l=0;0===o&&i<=n-40&&l<=r.length-1;){var u=r[l];if(u.clientHeight>e.minHeight)return void(v.value=l);(i+=u?u.clientWidth+6:0)>=n-40&&(o=l),l+=1}o===r.length-1&&i<=n?v.value=-1:v.value=i>=n-40?o:o-1}}return(0,m.watch)((function(){return e.data}),(function(){var t;g.value=JSON.parse(JSON.stringify(e.data)),null===(t=g.value)||void 0===t||t.forEach((function(t){t.isSelected=e.uniqueSelect&&!!e.modelValue.some((function(e){return e.id===t.id}))}))}),{immediate:!0}),(0,m.watch)((function(){return e.modelValue}),(function(t){var n,r;if(!(null==t?void 0:t.length))return d.value=[],void(null===(n=g.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];t.forEach((function(t){var n,r=d.value.find((function(e){return e.id===t.id&&e.name===t.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(t))r.values=t.values||[],r.logical=t.logical||P.OR,i.push(r);else{var a=e.data.find((function(e){return e.id===t.id})),o="default";a||(a=e.conditions.find((function(e){return e.id===t.id})))&&(o="condition"),a||(null===(n=t.values)||void 0===n?void 0:n.length)||(o="text");var l=new q(a||t,o);l.values=t.values||[],l.logical=t.logical||P.OR,i.push(l)}})),d.value=i,null===(r=g.value)||void 0===r||r.forEach((function(t){t.isSelected=e.uniqueSelect&&!!i.some((function(e){return e.id===t.id}))}))}),{immediate:!0,deep:!0}),(0,m.onMounted)((function(){E(c.value.querySelector(".".concat(a("search-select-container"))),f)})),(0,m.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",L),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --x&&k&&k.parentNode.removeChild(k)}}(c.value.querySelector(".".concat(a("search-select-container"))),f)})),n={onEditClick:y,onEditEnter:_,onEditBlur:function(){h.value="",w("")},onValidate:w,editKey:h},(0,m.provide)(K,n),{inputRef:l,wrapRef:c,isFocus:s,copyData:g,selectedList:d,overflowIndex:v,validateStr:p,onEditClick:y,onEditEnter:_,handleWrapClick:function(){h.value||l.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(v.value=-1),!1===e&&(null===(t=c.value.querySelector(".".concat(a("search-select-container"))))||void 0===t||t.scrollTo(0,0)),s.value=e},handleResize:b,handleClearAll:function(){d.value=[],v.value=-1,r("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=c.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=d.value.slice();t.push(e),w(""),r("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=d.value.slice();t.splice("number"==typeof e?e:d.value.length-1,1),w(""),r("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){r("search",e)},localConditions:o,resolveClassName:a,t:i}},render:function(){var e,t,n,r=this,i="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),a=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,o=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=r.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,m.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,m.createVNode)("div",{class:(e={},p(e,this.resolveClassName("search-select-container"),!0),p(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,m.createVNode)("div",{class:"search-prefix"},[null===(n=(t=this.$slots).prepend)||void 0===n?void 0:n.call(t)]),(0,m.createVNode)("div",{class:"search-container",style:{maxHeight:i}},[(0,m.createVNode)(U,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},o)),(0,m.createVNode)("div",{class:"search-container-input"},[(0,m.createVNode)($,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:a,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},o))])]),(0,m.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,m.createVNode)(O.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,m.createVNode)(O.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,m.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,m.createVNode)(m.Fragment,null,[(0,m.createVNode)(O.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var J=(0,u.withInstall)(G);const Z=J})();var v=d.r,f=d.Z;export{v as BkSearchSelect,f 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__config_provider_9d0186d9__ from "../config-provider";
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__ from "../directives";
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__ from "../popover";
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__ from "../checkbox";
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__radio_904c495d__ from "../radio";
|
9
|
+
/******/ var __webpack_modules__ = ({
|
10
|
+
|
11
|
+
/***/ 7609:
|
12
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
13
|
+
|
14
|
+
var _typeof = (__webpack_require__(7425)["default"]);
|
15
|
+
function _regeneratorRuntime() {
|
16
|
+
"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
17
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
18
|
+
return exports;
|
19
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
20
|
+
var exports = {},
|
21
|
+
Op = Object.prototype,
|
22
|
+
hasOwn = Op.hasOwnProperty,
|
23
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
24
|
+
obj[key] = desc.value;
|
25
|
+
},
|
26
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
27
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
28
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
29
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
30
|
+
function define(obj, key, value) {
|
31
|
+
return Object.defineProperty(obj, key, {
|
32
|
+
value: value,
|
33
|
+
enumerable: !0,
|
34
|
+
configurable: !0,
|
35
|
+
writable: !0
|
36
|
+
}), obj[key];
|
37
|
+
}
|
38
|
+
try {
|
39
|
+
define({}, "");
|
40
|
+
} catch (err) {
|
41
|
+
define = function define(obj, key, value) {
|
42
|
+
return obj[key] = value;
|
43
|
+
};
|
44
|
+
}
|
45
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
46
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
47
|
+
generator = Object.create(protoGenerator.prototype),
|
48
|
+
context = new Context(tryLocsList || []);
|
49
|
+
return defineProperty(generator, "_invoke", {
|
50
|
+
value: makeInvokeMethod(innerFn, self, context)
|
51
|
+
}), generator;
|
52
|
+
}
|
53
|
+
function tryCatch(fn, obj, arg) {
|
54
|
+
try {
|
55
|
+
return {
|
56
|
+
type: "normal",
|
57
|
+
arg: fn.call(obj, arg)
|
58
|
+
};
|
59
|
+
} catch (err) {
|
60
|
+
return {
|
61
|
+
type: "throw",
|
62
|
+
arg: err
|
63
|
+
};
|
64
|
+
}
|
65
|
+
}
|
66
|
+
exports.wrap = wrap;
|
67
|
+
var ContinueSentinel = {};
|
68
|
+
function Generator() {}
|
69
|
+
function GeneratorFunction() {}
|
70
|
+
function GeneratorFunctionPrototype() {}
|
71
|
+
var IteratorPrototype = {};
|
72
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
73
|
+
return this;
|
74
|
+
});
|
75
|
+
var getProto = Object.getPrototypeOf,
|
76
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
77
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
78
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
79
|
+
function defineIteratorMethods(prototype) {
|
80
|
+
["next", "throw", "return"].forEach(function (method) {
|
81
|
+
define(prototype, method, function (arg) {
|
82
|
+
return this._invoke(method, arg);
|
83
|
+
});
|
84
|
+
});
|
85
|
+
}
|
86
|
+
function AsyncIterator(generator, PromiseImpl) {
|
87
|
+
function invoke(method, arg, resolve, reject) {
|
88
|
+
var record = tryCatch(generator[method], generator, arg);
|
89
|
+
if ("throw" !== record.type) {
|
90
|
+
var result = record.arg,
|
91
|
+
value = result.value;
|
92
|
+
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
93
|
+
invoke("next", value, resolve, reject);
|
94
|
+
}, function (err) {
|
95
|
+
invoke("throw", err, resolve, reject);
|
96
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
97
|
+
result.value = unwrapped, resolve(result);
|
98
|
+
}, function (error) {
|
99
|
+
return invoke("throw", error, resolve, reject);
|
100
|
+
});
|
101
|
+
}
|
102
|
+
reject(record.arg);
|
103
|
+
}
|
104
|
+
var previousPromise;
|
105
|
+
defineProperty(this, "_invoke", {
|
106
|
+
value: function value(method, arg) {
|
107
|
+
function callInvokeWithMethodAndArg() {
|
108
|
+
return new PromiseImpl(function (resolve, reject) {
|
109
|
+
invoke(method, arg, resolve, reject);
|
110
|
+
});
|
111
|
+
}
|
112
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
113
|
+
}
|
114
|
+
});
|
115
|
+
}
|
116
|
+
function makeInvokeMethod(innerFn, self, context) {
|
117
|
+
var state = "suspendedStart";
|
118
|
+
return function (method, arg) {
|
119
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
120
|
+
if ("completed" === state) {
|
121
|
+
if ("throw" === method) throw arg;
|
122
|
+
return doneResult();
|
123
|
+
}
|
124
|
+
for (context.method = method, context.arg = arg;;) {
|
125
|
+
var delegate = context.delegate;
|
126
|
+
if (delegate) {
|
127
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
128
|
+
if (delegateResult) {
|
129
|
+
if (delegateResult === ContinueSentinel) continue;
|
130
|
+
return delegateResult;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
134
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
135
|
+
context.dispatchException(context.arg);
|
136
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
137
|
+
state = "executing";
|
138
|
+
var record = tryCatch(innerFn, self, context);
|
139
|
+
if ("normal" === record.type) {
|
140
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
141
|
+
return {
|
142
|
+
value: record.arg,
|
143
|
+
done: context.done
|
144
|
+
};
|
145
|
+
}
|
146
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
147
|
+
}
|
148
|
+
};
|
149
|
+
}
|
150
|
+
function maybeInvokeDelegate(delegate, context) {
|
151
|
+
var methodName = context.method,
|
152
|
+
method = delegate.iterator[methodName];
|
153
|
+
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;
|
154
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
155
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
156
|
+
var info = record.arg;
|
157
|
+
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);
|
158
|
+
}
|
159
|
+
function pushTryEntry(locs) {
|
160
|
+
var entry = {
|
161
|
+
tryLoc: locs[0]
|
162
|
+
};
|
163
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
164
|
+
}
|
165
|
+
function resetTryEntry(entry) {
|
166
|
+
var record = entry.completion || {};
|
167
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
168
|
+
}
|
169
|
+
function Context(tryLocsList) {
|
170
|
+
this.tryEntries = [{
|
171
|
+
tryLoc: "root"
|
172
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
173
|
+
}
|
174
|
+
function values(iterable) {
|
175
|
+
if (iterable) {
|
176
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
177
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
178
|
+
if ("function" == typeof iterable.next) return iterable;
|
179
|
+
if (!isNaN(iterable.length)) {
|
180
|
+
var i = -1,
|
181
|
+
next = function next() {
|
182
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
183
|
+
return next.value = undefined, next.done = !0, next;
|
184
|
+
};
|
185
|
+
return next.next = next;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
return {
|
189
|
+
next: doneResult
|
190
|
+
};
|
191
|
+
}
|
192
|
+
function doneResult() {
|
193
|
+
return {
|
194
|
+
value: undefined,
|
195
|
+
done: !0
|
196
|
+
};
|
197
|
+
}
|
198
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
199
|
+
value: GeneratorFunctionPrototype,
|
200
|
+
configurable: !0
|
201
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
202
|
+
value: GeneratorFunction,
|
203
|
+
configurable: !0
|
204
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
205
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
206
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
207
|
+
}, exports.mark = function (genFun) {
|
208
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
209
|
+
}, exports.awrap = function (arg) {
|
210
|
+
return {
|
211
|
+
__await: arg
|
212
|
+
};
|
213
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
214
|
+
return this;
|
215
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
216
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
217
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
218
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
219
|
+
return result.done ? result.value : iter.next();
|
220
|
+
});
|
221
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
222
|
+
return this;
|
223
|
+
}), define(Gp, "toString", function () {
|
224
|
+
return "[object Generator]";
|
225
|
+
}), exports.keys = function (val) {
|
226
|
+
var object = Object(val),
|
227
|
+
keys = [];
|
228
|
+
for (var key in object) keys.push(key);
|
229
|
+
return keys.reverse(), function next() {
|
230
|
+
for (; keys.length;) {
|
231
|
+
var key = keys.pop();
|
232
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
233
|
+
}
|
234
|
+
return next.done = !0, next;
|
235
|
+
};
|
236
|
+
}, exports.values = values, Context.prototype = {
|
237
|
+
constructor: Context,
|
238
|
+
reset: function reset(skipTempReset) {
|
239
|
+
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);
|
240
|
+
},
|
241
|
+
stop: function stop() {
|
242
|
+
this.done = !0;
|
243
|
+
var rootRecord = this.tryEntries[0].completion;
|
244
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
245
|
+
return this.rval;
|
246
|
+
},
|
247
|
+
dispatchException: function dispatchException(exception) {
|
248
|
+
if (this.done) throw exception;
|
249
|
+
var context = this;
|
250
|
+
function handle(loc, caught) {
|
251
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
252
|
+
}
|
253
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
254
|
+
var entry = this.tryEntries[i],
|
255
|
+
record = entry.completion;
|
256
|
+
if ("root" === entry.tryLoc) return handle("end");
|
257
|
+
if (entry.tryLoc <= this.prev) {
|
258
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
259
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
260
|
+
if (hasCatch && hasFinally) {
|
261
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
262
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
263
|
+
} else if (hasCatch) {
|
264
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
265
|
+
} else {
|
266
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
267
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
268
|
+
}
|
269
|
+
}
|
270
|
+
}
|
271
|
+
},
|
272
|
+
abrupt: function abrupt(type, arg) {
|
273
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
274
|
+
var entry = this.tryEntries[i];
|
275
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
276
|
+
var finallyEntry = entry;
|
277
|
+
break;
|
278
|
+
}
|
279
|
+
}
|
280
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
281
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
282
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
283
|
+
},
|
284
|
+
complete: function complete(record, afterLoc) {
|
285
|
+
if ("throw" === record.type) throw record.arg;
|
286
|
+
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;
|
287
|
+
},
|
288
|
+
finish: function finish(finallyLoc) {
|
289
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
290
|
+
var entry = this.tryEntries[i];
|
291
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
292
|
+
}
|
293
|
+
},
|
294
|
+
"catch": function _catch(tryLoc) {
|
295
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
296
|
+
var entry = this.tryEntries[i];
|
297
|
+
if (entry.tryLoc === tryLoc) {
|
298
|
+
var record = entry.completion;
|
299
|
+
if ("throw" === record.type) {
|
300
|
+
var thrown = record.arg;
|
301
|
+
resetTryEntry(entry);
|
302
|
+
}
|
303
|
+
return thrown;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
throw new Error("illegal catch attempt");
|
307
|
+
},
|
308
|
+
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
309
|
+
return this.delegate = {
|
310
|
+
iterator: values(iterable),
|
311
|
+
resultName: resultName,
|
312
|
+
nextLoc: nextLoc
|
313
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
314
|
+
}
|
315
|
+
}, exports;
|
316
|
+
}
|
317
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
318
|
+
|
319
|
+
/***/ }),
|
320
|
+
|
321
|
+
/***/ 7425:
|
322
|
+
/***/ ((module) => {
|
323
|
+
|
324
|
+
function _typeof(obj) {
|
325
|
+
"@babel/helpers - typeof";
|
326
|
+
|
327
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
328
|
+
return typeof obj;
|
329
|
+
} : function (obj) {
|
330
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
331
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
|
332
|
+
}
|
333
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
334
|
+
|
335
|
+
/***/ }),
|
336
|
+
|
337
|
+
/***/ 2841:
|
338
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
339
|
+
|
340
|
+
// TODO(Babel 8): Remove this file.
|
341
|
+
|
342
|
+
var runtime = __webpack_require__(7609)();
|
343
|
+
module.exports = runtime;
|
344
|
+
|
345
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
346
|
+
try {
|
347
|
+
regeneratorRuntime = runtime;
|
348
|
+
} catch (accidentalStrictMode) {
|
349
|
+
if (typeof globalThis === "object") {
|
350
|
+
globalThis.regeneratorRuntime = runtime;
|
351
|
+
} else {
|
352
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
353
|
+
}
|
354
|
+
}
|
355
|
+
|
356
|
+
|
357
|
+
/***/ })
|
358
|
+
|
359
|
+
/******/ });
|
360
|
+
/************************************************************************/
|
361
|
+
/******/ // The module cache
|
362
|
+
/******/ var __webpack_module_cache__ = {};
|
363
|
+
/******/
|
364
|
+
/******/ // The require function
|
365
|
+
/******/ function __webpack_require__(moduleId) {
|
366
|
+
/******/ // Check if module is in cache
|
367
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
368
|
+
/******/ if (cachedModule !== undefined) {
|
369
|
+
/******/ return cachedModule.exports;
|
370
|
+
/******/ }
|
371
|
+
/******/ // Create a new module (and put it into the cache)
|
372
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
373
|
+
/******/ // no module.id needed
|
374
|
+
/******/ // no module.loaded needed
|
375
|
+
/******/ exports: {}
|
376
|
+
/******/ };
|
377
|
+
/******/
|
378
|
+
/******/ // Execute the module function
|
379
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
380
|
+
/******/
|
381
|
+
/******/ // Return the exports of the module
|
382
|
+
/******/ return module.exports;
|
383
|
+
/******/ }
|
384
|
+
/******/
|
385
|
+
/************************************************************************/
|
386
|
+
/******/ /* webpack/runtime/compat get default export */
|
387
|
+
/******/ (() => {
|
388
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
389
|
+
/******/ __webpack_require__.n = (module) => {
|
390
|
+
/******/ var getter = module && module.__esModule ?
|
391
|
+
/******/ () => (module['default']) :
|
392
|
+
/******/ () => (module);
|
393
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
394
|
+
/******/ return getter;
|
395
|
+
/******/ };
|
396
|
+
/******/ })();
|
397
|
+
/******/
|
398
|
+
/******/ /* webpack/runtime/define property getters */
|
399
|
+
/******/ (() => {
|
400
|
+
/******/ // define getter functions for harmony exports
|
401
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
402
|
+
/******/ for(var key in definition) {
|
403
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
404
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
405
|
+
/******/ }
|
406
|
+
/******/ }
|
407
|
+
/******/ };
|
408
|
+
/******/ })();
|
409
|
+
/******/
|
410
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
411
|
+
/******/ (() => {
|
412
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
413
|
+
/******/ })();
|
414
|
+
/******/
|
415
|
+
/************************************************************************/
|
416
|
+
var __webpack_exports__ = {};
|
417
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
418
|
+
(() => {
|
419
|
+
|
420
|
+
// EXPORTS
|
421
|
+
__webpack_require__.d(__webpack_exports__, {
|
422
|
+
r: () => (/* binding */ BkSearchSelect),
|
423
|
+
Z: () => (/* binding */ src)
|
424
|
+
});
|
425
|
+
|
426
|
+
;// CONCATENATED MODULE: external "../shared"
|
427
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
428
|
+
var y = x => () => x
|
429
|
+
const external_shared_namespaceObject = x({ ["debounce"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.debounce, ["random"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.random, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
|
430
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
431
|
+
function _typeof(obj) {
|
432
|
+
"@babel/helpers - typeof";
|
433
|
+
|
434
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
435
|
+
return typeof obj;
|
436
|
+
} : function (obj) {
|
437
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
438
|
+
}, _typeof(obj);
|
439
|
+
}
|
440
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
441
|
+
|
442
|
+
function _toPrimitive(input, hint) {
|
443
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
444
|
+
var prim = input[Symbol.toPrimitive];
|
445
|
+
if (prim !== undefined) {
|
446
|
+
var res = prim.call(input, hint || "default");
|
447
|
+
if (_typeof(res) !== "object") return res;
|
448
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
449
|
+
}
|
450
|
+
return (hint === "string" ? String : Number)(input);
|
451
|
+
}
|
452
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
453
|
+
|
454
|
+
|
455
|
+
function _toPropertyKey(arg) {
|
456
|
+
var key = _toPrimitive(arg, "string");
|
457
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
458
|
+
}
|
459
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
460
|
+
|
461
|
+
function _defineProperty(obj, key, value) {
|
462
|
+
key = _toPropertyKey(key);
|
463
|
+
if (key in obj) {
|
464
|
+
Object.defineProperty(obj, key, {
|
465
|
+
value: value,
|
466
|
+
enumerable: true,
|
467
|
+
configurable: true,
|
468
|
+
writable: true
|
469
|
+
});
|
470
|
+
} else {
|
471
|
+
obj[key] = value;
|
472
|
+
}
|
473
|
+
return obj;
|
474
|
+
}
|
475
|
+
;// CONCATENATED MODULE: external "vue"
|
476
|
+
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
477
|
+
var external_vue_y = x => () => x
|
478
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
479
|
+
;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
|
480
|
+
var raf = null;
|
481
|
+
function requestAnimationFrame (callback) {
|
482
|
+
if (!raf) {
|
483
|
+
raf = (
|
484
|
+
window.requestAnimationFrame ||
|
485
|
+
window.webkitRequestAnimationFrame ||
|
486
|
+
window.mozRequestAnimationFrame ||
|
487
|
+
function (callback) {
|
488
|
+
return setTimeout(callback, 16)
|
489
|
+
}
|
490
|
+
).bind(window);
|
491
|
+
}
|
492
|
+
return raf(callback)
|
493
|
+
}
|
494
|
+
|
495
|
+
var caf = null;
|
496
|
+
function cancelAnimationFrame (id) {
|
497
|
+
if (!caf) {
|
498
|
+
caf = (
|
499
|
+
window.cancelAnimationFrame ||
|
500
|
+
window.webkitCancelAnimationFrame ||
|
501
|
+
window.mozCancelAnimationFrame ||
|
502
|
+
function (id) {
|
503
|
+
clearTimeout(id);
|
504
|
+
}
|
505
|
+
).bind(window);
|
506
|
+
}
|
507
|
+
|
508
|
+
caf(id);
|
509
|
+
}
|
510
|
+
|
511
|
+
function createStyles (styleText) {
|
512
|
+
var style = document.createElement('style');
|
513
|
+
|
514
|
+
if (style.styleSheet) {
|
515
|
+
style.styleSheet.cssText = styleText;
|
516
|
+
} else {
|
517
|
+
style.appendChild(document.createTextNode(styleText));
|
518
|
+
}
|
519
|
+
(document.querySelector('head') || document.body).appendChild(style);
|
520
|
+
return style
|
521
|
+
}
|
522
|
+
|
523
|
+
function createElement (tagName, props) {
|
524
|
+
if ( props === void 0 ) props = {};
|
525
|
+
|
526
|
+
var elem = document.createElement(tagName);
|
527
|
+
Object.keys(props).forEach(function (key) {
|
528
|
+
elem[key] = props[key];
|
529
|
+
});
|
530
|
+
return elem
|
531
|
+
}
|
532
|
+
|
533
|
+
function getComputedStyle (elem, prop, pseudo) {
|
534
|
+
// for older versions of Firefox, `getComputedStyle` required
|
535
|
+
// the second argument and may return `null` for some elements
|
536
|
+
// when `display: none`
|
537
|
+
var computedStyle = window.getComputedStyle(elem, pseudo || null) || {
|
538
|
+
display: 'none'
|
539
|
+
};
|
540
|
+
|
541
|
+
return computedStyle[prop]
|
542
|
+
}
|
543
|
+
|
544
|
+
function getRenderInfo (elem) {
|
545
|
+
if (!document.documentElement.contains(elem)) {
|
546
|
+
return {
|
547
|
+
detached: true,
|
548
|
+
rendered: false
|
549
|
+
}
|
550
|
+
}
|
551
|
+
|
552
|
+
var current = elem;
|
553
|
+
while (current !== document) {
|
554
|
+
if (getComputedStyle(current, 'display') === 'none') {
|
555
|
+
return {
|
556
|
+
detached: false,
|
557
|
+
rendered: false
|
558
|
+
}
|
559
|
+
}
|
560
|
+
current = current.parentNode;
|
561
|
+
}
|
562
|
+
|
563
|
+
return {
|
564
|
+
detached: false,
|
565
|
+
rendered: true
|
566
|
+
}
|
567
|
+
}
|
568
|
+
|
569
|
+
var css_248z = ".resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:\"\";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}";
|
570
|
+
|
571
|
+
var total = 0;
|
572
|
+
var style = null;
|
573
|
+
|
574
|
+
function addListener (elem, callback) {
|
575
|
+
if (!elem.__resize_mutation_handler__) {
|
576
|
+
elem.__resize_mutation_handler__ = handleMutation.bind(elem);
|
577
|
+
}
|
578
|
+
|
579
|
+
var listeners = elem.__resize_listeners__;
|
580
|
+
|
581
|
+
if (!listeners) {
|
582
|
+
elem.__resize_listeners__ = [];
|
583
|
+
if (window.ResizeObserver) {
|
584
|
+
var offsetWidth = elem.offsetWidth;
|
585
|
+
var offsetHeight = elem.offsetHeight;
|
586
|
+
var ro = new ResizeObserver(function () {
|
587
|
+
if (!elem.__resize_observer_triggered__) {
|
588
|
+
elem.__resize_observer_triggered__ = true;
|
589
|
+
if (elem.offsetWidth === offsetWidth && elem.offsetHeight === offsetHeight) {
|
590
|
+
return
|
591
|
+
}
|
592
|
+
}
|
593
|
+
runCallbacks(elem);
|
594
|
+
});
|
595
|
+
|
596
|
+
// initially display none won't trigger ResizeObserver callback
|
597
|
+
var ref = getRenderInfo(elem);
|
598
|
+
var detached = ref.detached;
|
599
|
+
var rendered = ref.rendered;
|
600
|
+
elem.__resize_observer_triggered__ = detached === false && rendered === false;
|
601
|
+
elem.__resize_observer__ = ro;
|
602
|
+
ro.observe(elem);
|
603
|
+
} else if (elem.attachEvent && elem.addEventListener) {
|
604
|
+
// targeting IE9/10
|
605
|
+
elem.__resize_legacy_resize_handler__ = function handleLegacyResize () {
|
606
|
+
runCallbacks(elem);
|
607
|
+
};
|
608
|
+
elem.attachEvent('onresize', elem.__resize_legacy_resize_handler__);
|
609
|
+
document.addEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
|
610
|
+
} else {
|
611
|
+
if (!total) {
|
612
|
+
style = createStyles(css_248z);
|
613
|
+
}
|
614
|
+
initTriggers(elem);
|
615
|
+
|
616
|
+
elem.__resize_rendered__ = getRenderInfo(elem).rendered;
|
617
|
+
if (window.MutationObserver) {
|
618
|
+
var mo = new MutationObserver(elem.__resize_mutation_handler__);
|
619
|
+
mo.observe(document, {
|
620
|
+
attributes: true,
|
621
|
+
childList: true,
|
622
|
+
characterData: true,
|
623
|
+
subtree: true
|
624
|
+
});
|
625
|
+
elem.__resize_mutation_observer__ = mo;
|
626
|
+
}
|
627
|
+
}
|
628
|
+
}
|
629
|
+
|
630
|
+
elem.__resize_listeners__.push(callback);
|
631
|
+
total++;
|
632
|
+
}
|
633
|
+
|
634
|
+
function removeListener (elem, callback) {
|
635
|
+
var listeners = elem.__resize_listeners__;
|
636
|
+
if (!listeners) {
|
637
|
+
return
|
638
|
+
}
|
639
|
+
|
640
|
+
if (callback) {
|
641
|
+
listeners.splice(listeners.indexOf(callback), 1);
|
642
|
+
}
|
643
|
+
|
644
|
+
// no listeners exist, or removing all listeners
|
645
|
+
if (!listeners.length || !callback) {
|
646
|
+
// targeting IE9/10
|
647
|
+
if (elem.detachEvent && elem.removeEventListener) {
|
648
|
+
elem.detachEvent('onresize', elem.__resize_legacy_resize_handler__);
|
649
|
+
document.removeEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
|
650
|
+
return
|
651
|
+
}
|
652
|
+
|
653
|
+
if (elem.__resize_observer__) {
|
654
|
+
elem.__resize_observer__.unobserve(elem);
|
655
|
+
elem.__resize_observer__.disconnect();
|
656
|
+
elem.__resize_observer__ = null;
|
657
|
+
} else {
|
658
|
+
if (elem.__resize_mutation_observer__) {
|
659
|
+
elem.__resize_mutation_observer__.disconnect();
|
660
|
+
elem.__resize_mutation_observer__ = null;
|
661
|
+
}
|
662
|
+
elem.removeEventListener('scroll', handleScroll);
|
663
|
+
elem.removeChild(elem.__resize_triggers__.triggers);
|
664
|
+
elem.__resize_triggers__ = null;
|
665
|
+
}
|
666
|
+
elem.__resize_listeners__ = null;
|
667
|
+
}
|
668
|
+
|
669
|
+
if (!--total && style) {
|
670
|
+
style.parentNode.removeChild(style);
|
671
|
+
}
|
672
|
+
}
|
673
|
+
|
674
|
+
function getUpdatedSize (elem) {
|
675
|
+
var ref = elem.__resize_last__;
|
676
|
+
var width = ref.width;
|
677
|
+
var height = ref.height;
|
678
|
+
var offsetWidth = elem.offsetWidth;
|
679
|
+
var offsetHeight = elem.offsetHeight;
|
680
|
+
if (offsetWidth !== width || offsetHeight !== height) {
|
681
|
+
return {
|
682
|
+
width: offsetWidth,
|
683
|
+
height: offsetHeight
|
684
|
+
}
|
685
|
+
}
|
686
|
+
return null
|
687
|
+
}
|
688
|
+
|
689
|
+
function handleMutation () {
|
690
|
+
// `this` denotes the scrolling element
|
691
|
+
var ref = getRenderInfo(this);
|
692
|
+
var rendered = ref.rendered;
|
693
|
+
var detached = ref.detached;
|
694
|
+
if (rendered !== this.__resize_rendered__) {
|
695
|
+
if (!detached && this.__resize_triggers__) {
|
696
|
+
resetTriggers(this);
|
697
|
+
this.addEventListener('scroll', handleScroll, true);
|
698
|
+
}
|
699
|
+
this.__resize_rendered__ = rendered;
|
700
|
+
runCallbacks(this);
|
701
|
+
}
|
702
|
+
}
|
703
|
+
|
704
|
+
function handleScroll () {
|
705
|
+
var this$1 = this;
|
706
|
+
|
707
|
+
// `this` denotes the scrolling element
|
708
|
+
resetTriggers(this);
|
709
|
+
if (this.__resize_raf__) {
|
710
|
+
cancelAnimationFrame(this.__resize_raf__);
|
711
|
+
}
|
712
|
+
this.__resize_raf__ = requestAnimationFrame(function () {
|
713
|
+
var updated = getUpdatedSize(this$1);
|
714
|
+
if (updated) {
|
715
|
+
this$1.__resize_last__ = updated;
|
716
|
+
runCallbacks(this$1);
|
717
|
+
}
|
718
|
+
});
|
719
|
+
}
|
720
|
+
|
721
|
+
function runCallbacks (elem) {
|
722
|
+
if (!elem || !elem.__resize_listeners__) {
|
723
|
+
return
|
724
|
+
}
|
725
|
+
elem.__resize_listeners__.forEach(function (callback) {
|
726
|
+
callback.call(elem, elem);
|
727
|
+
});
|
728
|
+
}
|
729
|
+
|
730
|
+
function initTriggers (elem) {
|
731
|
+
var position = getComputedStyle(elem, 'position');
|
732
|
+
if (!position || position === 'static') {
|
733
|
+
elem.style.position = 'relative';
|
734
|
+
}
|
735
|
+
|
736
|
+
elem.__resize_old_position__ = position;
|
737
|
+
elem.__resize_last__ = {};
|
738
|
+
|
739
|
+
var triggers = createElement('div', {
|
740
|
+
className: 'resize-triggers'
|
741
|
+
});
|
742
|
+
var expand = createElement('div', {
|
743
|
+
className: 'resize-expand-trigger'
|
744
|
+
});
|
745
|
+
var expandChild = createElement('div');
|
746
|
+
var contract = createElement('div', {
|
747
|
+
className: 'resize-contract-trigger'
|
748
|
+
});
|
749
|
+
expand.appendChild(expandChild);
|
750
|
+
triggers.appendChild(expand);
|
751
|
+
triggers.appendChild(contract);
|
752
|
+
elem.appendChild(triggers);
|
753
|
+
|
754
|
+
elem.__resize_triggers__ = {
|
755
|
+
triggers: triggers,
|
756
|
+
expand: expand,
|
757
|
+
expandChild: expandChild,
|
758
|
+
contract: contract
|
759
|
+
};
|
760
|
+
|
761
|
+
resetTriggers(elem);
|
762
|
+
elem.addEventListener('scroll', handleScroll, true);
|
763
|
+
|
764
|
+
elem.__resize_last__ = {
|
765
|
+
width: elem.offsetWidth,
|
766
|
+
height: elem.offsetHeight
|
767
|
+
};
|
768
|
+
}
|
769
|
+
|
770
|
+
function resetTriggers (elem) {
|
771
|
+
var ref = elem.__resize_triggers__;
|
772
|
+
var expand = ref.expand;
|
773
|
+
var expandChild = ref.expandChild;
|
774
|
+
var contract = ref.contract;
|
775
|
+
|
776
|
+
// batch read
|
777
|
+
var csw = contract.scrollWidth;
|
778
|
+
var csh = contract.scrollHeight;
|
779
|
+
var eow = expand.offsetWidth;
|
780
|
+
var eoh = expand.offsetHeight;
|
781
|
+
var esw = expand.scrollWidth;
|
782
|
+
var esh = expand.scrollHeight;
|
783
|
+
|
784
|
+
// batch write
|
785
|
+
contract.scrollLeft = csw;
|
786
|
+
contract.scrollTop = csh;
|
787
|
+
expandChild.style.width = eow + 1 + 'px';
|
788
|
+
expandChild.style.height = eoh + 1 + 'px';
|
789
|
+
expand.scrollLeft = esw;
|
790
|
+
expand.scrollTop = esh;
|
791
|
+
}
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
;// CONCATENATED MODULE: external "../config-provider"
|
796
|
+
var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
797
|
+
var external_config_provider_y = x => () => x
|
798
|
+
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 });
|
799
|
+
;// CONCATENATED MODULE: external "../directives"
|
800
|
+
var external_directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
801
|
+
var external_directives_y = x => () => x
|
802
|
+
const external_directives_namespaceObject = external_directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__.clickoutside });
|
803
|
+
;// CONCATENATED MODULE: external "../icon"
|
804
|
+
var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
805
|
+
var external_icon_y = x => () => x
|
806
|
+
const external_icon_namespaceObject = external_icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Error, ["ExclamationCircleShape"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.ExclamationCircleShape, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Search });
|
807
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
808
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
809
|
+
try {
|
810
|
+
var info = gen[key](arg);
|
811
|
+
var value = info.value;
|
812
|
+
} catch (error) {
|
813
|
+
reject(error);
|
814
|
+
return;
|
815
|
+
}
|
816
|
+
if (info.done) {
|
817
|
+
resolve(value);
|
818
|
+
} else {
|
819
|
+
Promise.resolve(value).then(_next, _throw);
|
820
|
+
}
|
821
|
+
}
|
822
|
+
function _asyncToGenerator(fn) {
|
823
|
+
return function () {
|
824
|
+
var self = this,
|
825
|
+
args = arguments;
|
826
|
+
return new Promise(function (resolve, reject) {
|
827
|
+
var gen = fn.apply(self, args);
|
828
|
+
function _next(value) {
|
829
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
830
|
+
}
|
831
|
+
function _throw(err) {
|
832
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
833
|
+
}
|
834
|
+
_next(undefined);
|
835
|
+
});
|
836
|
+
};
|
837
|
+
}
|
838
|
+
// EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
|
839
|
+
var regenerator = __webpack_require__(2841);
|
840
|
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
841
|
+
;// CONCATENATED MODULE: external "../popover"
|
842
|
+
var external_popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
843
|
+
var external_popover_y = x => () => x
|
844
|
+
const external_popover_namespaceObject = external_popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__["default"] });
|
845
|
+
;// CONCATENATED MODULE: external "../checkbox"
|
846
|
+
var external_checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
847
|
+
var external_checkbox_y = x => () => x
|
848
|
+
const external_checkbox_namespaceObject = external_checkbox_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__["default"] });
|
849
|
+
;// CONCATENATED MODULE: external "../radio"
|
850
|
+
var external_radio_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
851
|
+
var external_radio_y = x => () => x
|
852
|
+
const external_radio_namespaceObject = external_radio_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__radio_904c495d__["default"] });
|
853
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
854
|
+
function _classCallCheck(instance, Constructor) {
|
855
|
+
if (!(instance instanceof Constructor)) {
|
856
|
+
throw new TypeError("Cannot call a class as a function");
|
857
|
+
}
|
858
|
+
}
|
859
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
|
860
|
+
|
861
|
+
function _defineProperties(target, props) {
|
862
|
+
for (var i = 0; i < props.length; i++) {
|
863
|
+
var descriptor = props[i];
|
864
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
865
|
+
descriptor.configurable = true;
|
866
|
+
if ("value" in descriptor) descriptor.writable = true;
|
867
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
868
|
+
}
|
869
|
+
}
|
870
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
871
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
872
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
873
|
+
Object.defineProperty(Constructor, "prototype", {
|
874
|
+
writable: false
|
875
|
+
});
|
876
|
+
return Constructor;
|
877
|
+
}
|
878
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/utils.ts
|
879
|
+
|
880
|
+
|
881
|
+
|
882
|
+
/*
|
883
|
+
* Tencent is pleased to support the open source community by making
|
884
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
885
|
+
*
|
886
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
887
|
+
*
|
888
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
889
|
+
*
|
890
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
891
|
+
*
|
892
|
+
* ---------------------------------------------------
|
893
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
894
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
895
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
896
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
897
|
+
*
|
898
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
899
|
+
* the Software.
|
900
|
+
*
|
901
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
902
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
903
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
904
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
905
|
+
* IN THE SOFTWARE.
|
906
|
+
*/
|
907
|
+
|
908
|
+
/**
|
909
|
+
* @description: 获取menu list方法
|
910
|
+
* @param {ISearchItem} item 已选择的key字段 为空则代表当前并未选择key字段
|
911
|
+
* @param {string} keyword 已输入的文本
|
912
|
+
* @return {*} menu list用于渲染选择弹层列表
|
913
|
+
*/
|
914
|
+
var ValueBehavior;
|
915
|
+
(function (ValueBehavior) {
|
916
|
+
ValueBehavior["ALL"] = "all";
|
917
|
+
ValueBehavior["NEEDKEY"] = "need-key";
|
918
|
+
})(ValueBehavior || (ValueBehavior = {}));
|
919
|
+
var SEARCH_SLECT_PROVIDER_KEY = Symbol('SEARCH_SLECT_PROVIDER_KEY');
|
920
|
+
var useSearchSelectProvider = function useSearchSelectProvider(data) {
|
921
|
+
(0,external_vue_namespaceObject.provide)(SEARCH_SLECT_PROVIDER_KEY, data);
|
922
|
+
};
|
923
|
+
var useSearchSelectInject = function useSearchSelectInject() {
|
924
|
+
return (0,external_vue_namespaceObject.inject)(SEARCH_SLECT_PROVIDER_KEY);
|
925
|
+
};
|
926
|
+
var SearchInputMode;
|
927
|
+
(function (SearchInputMode) {
|
928
|
+
SearchInputMode["DEFAULT"] = "default";
|
929
|
+
SearchInputMode["EDIT"] = "edit";
|
930
|
+
})(SearchInputMode || (SearchInputMode = {}));
|
931
|
+
var SearchLogical;
|
932
|
+
(function (SearchLogical) {
|
933
|
+
SearchLogical["AND"] = "&";
|
934
|
+
SearchLogical["OR"] = "|";
|
935
|
+
})(SearchLogical || (SearchLogical = {}));
|
936
|
+
var SelectedItem = /*#__PURE__*/function () {
|
937
|
+
function SelectedItem(searchItem) {
|
938
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
939
|
+
_classCallCheck(this, SelectedItem);
|
940
|
+
_defineProperty(this, "values", []);
|
941
|
+
this.searchItem = searchItem;
|
942
|
+
this.type = type;
|
943
|
+
this.id = searchItem.id;
|
944
|
+
this.name = searchItem.name;
|
945
|
+
this.logical = searchItem.logical || SearchLogical.OR;
|
946
|
+
}
|
947
|
+
_createClass(SelectedItem, [{
|
948
|
+
key: "multiple",
|
949
|
+
get: function get() {
|
950
|
+
return !!this.searchItem.multiple;
|
951
|
+
}
|
952
|
+
}, {
|
953
|
+
key: "placeholder",
|
954
|
+
get: function get() {
|
955
|
+
return this.searchItem.placeholder || '';
|
956
|
+
}
|
957
|
+
}, {
|
958
|
+
key: "children",
|
959
|
+
get: function get() {
|
960
|
+
return this.searchItem.children || [];
|
961
|
+
}
|
962
|
+
}, {
|
963
|
+
key: "validate",
|
964
|
+
get: function get() {
|
965
|
+
return !this.searchItem.noValidate;
|
966
|
+
}
|
967
|
+
}, {
|
968
|
+
key: "inputInnerHtml",
|
969
|
+
get: function get() {
|
970
|
+
var _this$values;
|
971
|
+
if (this.isSpecialType()) return this.name;
|
972
|
+
return "".concat(this.keyInnerHtml).concat(((_this$values = this.values) === null || _this$values === void 0 ? void 0 : _this$values.map(function (item) {
|
973
|
+
return item.name;
|
974
|
+
}).join(" ".concat(this.logical, " "))) || '');
|
975
|
+
}
|
976
|
+
}, {
|
977
|
+
key: "inputInnerText",
|
978
|
+
get: function get() {
|
979
|
+
var _this$values2;
|
980
|
+
if (this.isSpecialType()) return this.name;
|
981
|
+
return "".concat(this.keyInnerText).concat(((_this$values2 = this.values) === null || _this$values2 === void 0 ? void 0 : _this$values2.map(function (item) {
|
982
|
+
return item.name;
|
983
|
+
}).join(" ".concat(this.logical, " "))) || '');
|
984
|
+
}
|
985
|
+
}, {
|
986
|
+
key: "keyInnerHtml",
|
987
|
+
get: function get() {
|
988
|
+
if (this.isSpecialType()) return this.name;
|
989
|
+
return this.name ? "".concat(this.name, ":\xA0") : '';
|
990
|
+
}
|
991
|
+
}, {
|
992
|
+
key: "keyInnerText",
|
993
|
+
get: function get() {
|
994
|
+
if (this.isSpecialType()) return this.name;
|
995
|
+
return this.name ? "".concat(this.name, ": ") : '';
|
996
|
+
}
|
997
|
+
}, {
|
998
|
+
key: "showLogical",
|
999
|
+
get: function get() {
|
1000
|
+
return !!this.searchItem.showLogicalPanel;
|
1001
|
+
}
|
1002
|
+
}, {
|
1003
|
+
key: "isSpecialType",
|
1004
|
+
value: function isSpecialType() {
|
1005
|
+
return ['text', 'condition'].includes(this.type);
|
1006
|
+
}
|
1007
|
+
}, {
|
1008
|
+
key: "addValue",
|
1009
|
+
value: function addValue(item) {
|
1010
|
+
if (this.multiple) {
|
1011
|
+
var index = this.values.findIndex(function (val) {
|
1012
|
+
return val.id === item.id;
|
1013
|
+
});
|
1014
|
+
if (index > -1) {
|
1015
|
+
this.values.splice(index, 1);
|
1016
|
+
return;
|
1017
|
+
}
|
1018
|
+
this.values.push(item);
|
1019
|
+
return;
|
1020
|
+
}
|
1021
|
+
this.values = [item];
|
1022
|
+
}
|
1023
|
+
}, {
|
1024
|
+
key: "toValue",
|
1025
|
+
value: function toValue() {
|
1026
|
+
var _this$values3;
|
1027
|
+
var value = {
|
1028
|
+
id: this.id,
|
1029
|
+
name: this.name
|
1030
|
+
};
|
1031
|
+
if ((_this$values3 = this.values) !== null && _this$values3 !== void 0 && _this$values3.length) {
|
1032
|
+
value.values = this.values.map(function (item) {
|
1033
|
+
return {
|
1034
|
+
id: item.id,
|
1035
|
+
name: item.name
|
1036
|
+
};
|
1037
|
+
});
|
1038
|
+
if (this.multiple && this.logical !== SearchLogical.OR) {
|
1039
|
+
value.logical = this.logical;
|
1040
|
+
}
|
1041
|
+
}
|
1042
|
+
if (this.type && this.type !== 'default') {
|
1043
|
+
value.type = this.type;
|
1044
|
+
}
|
1045
|
+
return value;
|
1046
|
+
}
|
1047
|
+
}, {
|
1048
|
+
key: "toValueKey",
|
1049
|
+
value: function toValueKey() {
|
1050
|
+
return JSON.stringify(this.toValue());
|
1051
|
+
}
|
1052
|
+
}, {
|
1053
|
+
key: "isInValueList",
|
1054
|
+
value: function isInValueList(item) {
|
1055
|
+
return this.children.some(function (v) {
|
1056
|
+
return v.id === (item === null || item === void 0 ? void 0 : item.id);
|
1057
|
+
});
|
1058
|
+
}
|
1059
|
+
}]);
|
1060
|
+
return SelectedItem;
|
1061
|
+
}();
|
1062
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/menu.tsx
|
1063
|
+
|
1064
|
+
/*
|
1065
|
+
* Tencent is pleased to support the open source community by making
|
1066
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1067
|
+
*
|
1068
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1069
|
+
*
|
1070
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1071
|
+
*
|
1072
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1073
|
+
*
|
1074
|
+
* ---------------------------------------------------
|
1075
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1076
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1077
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1078
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1079
|
+
*
|
1080
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1081
|
+
* the Software.
|
1082
|
+
*
|
1083
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1084
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1085
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1086
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1087
|
+
* IN THE SOFTWARE.
|
1088
|
+
*/
|
1089
|
+
|
1090
|
+
|
1091
|
+
|
1092
|
+
|
1093
|
+
// import { Done } from '@bkui-vue/icon';
|
1094
|
+
|
1095
|
+
/* harmony default export */ const menu = ((0,external_vue_namespaceObject.defineComponent)({
|
1096
|
+
name: 'SearchSelectMenu',
|
1097
|
+
props: {
|
1098
|
+
list: {
|
1099
|
+
type: Array
|
1100
|
+
},
|
1101
|
+
hoverId: String,
|
1102
|
+
keyword: {
|
1103
|
+
type: String,
|
1104
|
+
"default": ''
|
1105
|
+
},
|
1106
|
+
multiple: {
|
1107
|
+
type: Boolean,
|
1108
|
+
"default": false
|
1109
|
+
},
|
1110
|
+
selected: {
|
1111
|
+
type: Array,
|
1112
|
+
"default": function _default() {
|
1113
|
+
return [];
|
1114
|
+
}
|
1115
|
+
},
|
1116
|
+
conditions: {
|
1117
|
+
type: Array
|
1118
|
+
},
|
1119
|
+
footerBtns: {
|
1120
|
+
type: Array,
|
1121
|
+
"default": function _default() {
|
1122
|
+
return [];
|
1123
|
+
}
|
1124
|
+
},
|
1125
|
+
showLogical: {
|
1126
|
+
type: Boolean,
|
1127
|
+
"default": true
|
1128
|
+
},
|
1129
|
+
logical: {
|
1130
|
+
type: String,
|
1131
|
+
"default": SearchLogical.OR
|
1132
|
+
}
|
1133
|
+
},
|
1134
|
+
emits: ['selectItem', 'selectCondition', 'footerClick', 'update:logical'],
|
1135
|
+
setup: function setup(props, _ref) {
|
1136
|
+
var emit = _ref.emit;
|
1137
|
+
var t = (0,external_config_provider_namespaceObject.useLocale)('searchSelect');
|
1138
|
+
var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
|
1139
|
+
resolveClassName = _usePrefix.resolveClassName;
|
1140
|
+
var localFooterBtns = (0,external_vue_namespaceObject.computed)(function () {
|
1141
|
+
if (props.footerBtns === undefined || props.footerBtns.length === 0) {
|
1142
|
+
return [{
|
1143
|
+
id: 'confirm',
|
1144
|
+
name: t.value.ok
|
1145
|
+
}, {
|
1146
|
+
id: 'cancel',
|
1147
|
+
name: t.value.cancel,
|
1148
|
+
disabled: false
|
1149
|
+
}];
|
1150
|
+
}
|
1151
|
+
return props.footerBtns;
|
1152
|
+
});
|
1153
|
+
// events
|
1154
|
+
function handleClick(item) {
|
1155
|
+
emit('selectItem', item);
|
1156
|
+
}
|
1157
|
+
function handleClickCondition(item) {
|
1158
|
+
emit('selectCondition', item);
|
1159
|
+
}
|
1160
|
+
function handleClickFooterBtn(item) {
|
1161
|
+
emit('footerClick', item);
|
1162
|
+
}
|
1163
|
+
var filterList = (0,external_vue_namespaceObject.computed)(function () {
|
1164
|
+
var _props$list, _props$keyword;
|
1165
|
+
if (!((_props$list = props.list) !== null && _props$list !== void 0 && _props$list.length)) return [];
|
1166
|
+
if (!((_props$keyword = props.keyword) !== null && _props$keyword !== void 0 && _props$keyword.length)) return props.list;
|
1167
|
+
return props.list.filter(function (item) {
|
1168
|
+
return item.name.toLocaleLowerCase().includes(props.keyword.toLocaleLowerCase());
|
1169
|
+
});
|
1170
|
+
});
|
1171
|
+
function transformNode(str) {
|
1172
|
+
var _keyword;
|
1173
|
+
if (!str) return str;
|
1174
|
+
var keyword = props.keyword;
|
1175
|
+
var len = keyword.length;
|
1176
|
+
if (!((_keyword = keyword) !== null && _keyword !== void 0 && _keyword.trim().length) || !str.toLocaleLowerCase().includes(keyword.toLocaleLowerCase())) return str;
|
1177
|
+
var list = [];
|
1178
|
+
var lastIndex = -1;
|
1179
|
+
keyword = keyword.replace(/([.*/]{1})/gim, '\\$1');
|
1180
|
+
str.replace(new RegExp("".concat(keyword), 'igm'), function (key, index) {
|
1181
|
+
if (list.length === 0 && index !== 0) {
|
1182
|
+
list.push(str.slice(0, index));
|
1183
|
+
} else if (lastIndex >= 0) {
|
1184
|
+
list.push(str.slice(lastIndex + key.length, index));
|
1185
|
+
}
|
1186
|
+
list.push((0,external_vue_namespaceObject.createVNode)("span", {
|
1187
|
+
"class": "is-keyword"
|
1188
|
+
}, [key]));
|
1189
|
+
lastIndex = index;
|
1190
|
+
return key;
|
1191
|
+
});
|
1192
|
+
if (lastIndex >= 0) {
|
1193
|
+
list.push(str.slice(lastIndex + len));
|
1194
|
+
}
|
1195
|
+
return list.length ? list : str;
|
1196
|
+
}
|
1197
|
+
function getSearchNode(item) {
|
1198
|
+
var _item$value;
|
1199
|
+
if (!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.name)) return transformNode(item.name);
|
1200
|
+
return [(0,external_vue_namespaceObject.createVNode)("span", {
|
1201
|
+
"class": "menu-name"
|
1202
|
+
}, [item.name, (0,external_vue_namespaceObject.createTextVNode)(":")]), item.value.name];
|
1203
|
+
}
|
1204
|
+
function handleSelectedChange(e, item) {
|
1205
|
+
e.stopPropagation();
|
1206
|
+
e.preventDefault();
|
1207
|
+
handleClick(item);
|
1208
|
+
}
|
1209
|
+
function handleLogicalChange(value) {
|
1210
|
+
emit('update:logical', value);
|
1211
|
+
}
|
1212
|
+
return {
|
1213
|
+
handleClick: handleClick,
|
1214
|
+
handleClickCondition: handleClickCondition,
|
1215
|
+
handleClickFooterBtn: handleClickFooterBtn,
|
1216
|
+
handleSelectedChange: handleSelectedChange,
|
1217
|
+
handleLogicalChange: handleLogicalChange,
|
1218
|
+
filterList: filterList,
|
1219
|
+
getSearchNode: getSearchNode,
|
1220
|
+
localFooterBtns: localFooterBtns,
|
1221
|
+
resolveClassName: resolveClassName,
|
1222
|
+
t: t
|
1223
|
+
};
|
1224
|
+
},
|
1225
|
+
render: function render() {
|
1226
|
+
var _this$list,
|
1227
|
+
_this = this,
|
1228
|
+
_this$conditions;
|
1229
|
+
var listMenu = (0,external_vue_namespaceObject.createVNode)("ul", {
|
1230
|
+
"class": "menu-content"
|
1231
|
+
}, [(_this$list = this.list) === null || _this$list === void 0 ? void 0 : _this$list.map(function (item) {
|
1232
|
+
return (0,external_vue_namespaceObject.createVNode)("li", {
|
1233
|
+
"class": "menu-item ".concat(item.disabled ? 'is-disabled' : '', " ").concat(_this.hoverId === item.id && !item.disabled ? 'is-hover' : ''),
|
1234
|
+
"key": item.id,
|
1235
|
+
"id": item.id,
|
1236
|
+
"tabindex": "-1",
|
1237
|
+
"onClick": function onClick() {
|
1238
|
+
return !item.disabled && _this.handleClick(item);
|
1239
|
+
}
|
1240
|
+
}, [_this.$slots["default"] ? _this.$slots["default"]({
|
1241
|
+
item: item,
|
1242
|
+
list: _this.list,
|
1243
|
+
multiple: !!_this.multiple,
|
1244
|
+
hoverId: _this.hoverId,
|
1245
|
+
getSearchNode: _this.getSearchNode
|
1246
|
+
}) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.multiple && (0,external_vue_namespaceObject.createVNode)("span", {
|
1247
|
+
"onClick": function onClick(e) {
|
1248
|
+
return _this.handleSelectedChange(e, item);
|
1249
|
+
}
|
1250
|
+
}, [(0,external_vue_namespaceObject.createVNode)(external_checkbox_namespaceObject["default"], {
|
1251
|
+
"modelValue": _this.selected.includes(item.id),
|
1252
|
+
"class": "is-selected"
|
1253
|
+
}, null)]), _this.getSearchNode(item)])]);
|
1254
|
+
})]);
|
1255
|
+
var getListMenu = function getListMenu() {
|
1256
|
+
if (!_this.showLogical || !_this.multiple) return listMenu;
|
1257
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1258
|
+
"class": "menu-content-wrapper"
|
1259
|
+
}, [listMenu, (0,external_vue_namespaceObject.createVNode)("div", {
|
1260
|
+
"class": "menu-condition"
|
1261
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1262
|
+
"class": "menu-condition-title"
|
1263
|
+
}, [_this.t.logical]), (0,external_vue_namespaceObject.createVNode)(external_radio_namespaceObject["default"], {
|
1264
|
+
"modelValue": _this.logical,
|
1265
|
+
"onChange": _this.handleLogicalChange,
|
1266
|
+
"label": "|"
|
1267
|
+
}, {
|
1268
|
+
"default": function _default() {
|
1269
|
+
return [_this.t.or, (0,external_vue_namespaceObject.createTextVNode)(" |")];
|
1270
|
+
}
|
1271
|
+
}), (0,external_vue_namespaceObject.createVNode)(external_radio_namespaceObject["default"], {
|
1272
|
+
"modelValue": _this.logical,
|
1273
|
+
"onChange": _this.handleLogicalChange,
|
1274
|
+
"label": "&"
|
1275
|
+
}, {
|
1276
|
+
"default": function _default() {
|
1277
|
+
return [_this.t.and, (0,external_vue_namespaceObject.createTextVNode)(" &")];
|
1278
|
+
}
|
1279
|
+
})])]);
|
1280
|
+
};
|
1281
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1282
|
+
"class": this.resolveClassName('search-select-menu')
|
1283
|
+
}, [!!((_this$conditions = this.conditions) !== null && _this$conditions !== void 0 && _this$conditions.length) && (0,external_vue_namespaceObject.createVNode)("ul", {
|
1284
|
+
"class": "menu-header"
|
1285
|
+
}, [this.conditions.map(function (item) {
|
1286
|
+
return (0,external_vue_namespaceObject.createVNode)("li", {
|
1287
|
+
"key": item.id,
|
1288
|
+
"class": "menu-header-item ".concat(item.disabled ? 'is-disabled' : ''),
|
1289
|
+
"onClick": function onClick() {
|
1290
|
+
return !item.disabled && _this.handleClickCondition(item);
|
1291
|
+
}
|
1292
|
+
}, [item.name]);
|
1293
|
+
})]), getListMenu()]);
|
1294
|
+
}
|
1295
|
+
}));
|
1296
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/input.tsx
|
1297
|
+
|
1298
|
+
|
1299
|
+
|
1300
|
+
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; }
|
1301
|
+
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; }
|
1302
|
+
|
1303
|
+
/*
|
1304
|
+
* Tencent is pleased to support the open source community by making
|
1305
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1306
|
+
*
|
1307
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1308
|
+
*
|
1309
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1310
|
+
*
|
1311
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1312
|
+
*
|
1313
|
+
* ---------------------------------------------------
|
1314
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1315
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1316
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1317
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1318
|
+
*
|
1319
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1320
|
+
* the Software.
|
1321
|
+
*
|
1322
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1323
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1324
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1325
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1326
|
+
* IN THE SOFTWARE.
|
1327
|
+
*/
|
1328
|
+
|
1329
|
+
|
1330
|
+
|
1331
|
+
|
1332
|
+
|
1333
|
+
|
1334
|
+
|
1335
|
+
/* harmony default export */ const input = ((0,external_vue_namespaceObject.defineComponent)({
|
1336
|
+
name: 'SearchSelectInput',
|
1337
|
+
directives: {
|
1338
|
+
clickoutside: external_directives_namespaceObject.clickoutside
|
1339
|
+
},
|
1340
|
+
props: {
|
1341
|
+
data: {
|
1342
|
+
type: Array,
|
1343
|
+
required: true
|
1344
|
+
},
|
1345
|
+
showInputBefore: Boolean,
|
1346
|
+
showCondition: Boolean,
|
1347
|
+
clickOutside: Function,
|
1348
|
+
placeholder: String,
|
1349
|
+
conditions: {
|
1350
|
+
type: Array,
|
1351
|
+
"default": function _default() {
|
1352
|
+
return [];
|
1353
|
+
}
|
1354
|
+
},
|
1355
|
+
defautUsingItem: Object,
|
1356
|
+
mode: {
|
1357
|
+
type: String,
|
1358
|
+
"default": SearchInputMode.DEFAULT
|
1359
|
+
},
|
1360
|
+
getMenuList: Function,
|
1361
|
+
validateValues: Function,
|
1362
|
+
valueBehavior: String
|
1363
|
+
},
|
1364
|
+
emits: ['focus', 'add', 'delete'],
|
1365
|
+
setup: function setup(props, _ref) {
|
1366
|
+
var emit = _ref.emit,
|
1367
|
+
expose = _ref.expose;
|
1368
|
+
var t = (0,external_config_provider_namespaceObject.useLocale)('searchSelect');
|
1369
|
+
var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
|
1370
|
+
resolveClassName = _usePrefix.resolveClassName;
|
1371
|
+
var inputRef = (0,external_vue_namespaceObject.ref)(null);
|
1372
|
+
var popoverRef = (0,external_vue_namespaceObject.ref)(null);
|
1373
|
+
var keyword = (0,external_vue_namespaceObject.ref)('');
|
1374
|
+
var showNoSelectValueError = (0,external_vue_namespaceObject.ref)(false);
|
1375
|
+
var isFocus = (0,external_vue_namespaceObject.ref)(false);
|
1376
|
+
var showPopover = (0,external_vue_namespaceObject.ref)(false);
|
1377
|
+
var usingItem = (0,external_vue_namespaceObject.ref)(props.defautUsingItem);
|
1378
|
+
var menuHoverId = (0,external_vue_namespaceObject.ref)('');
|
1379
|
+
var loading = (0,external_vue_namespaceObject.ref)(false);
|
1380
|
+
var debounceSetMenuList = (0,external_shared_namespaceObject.debounce)(300, setMenuList);
|
1381
|
+
// const selectMenuList = ref<ICommonItem[]>([]);
|
1382
|
+
var isBindEvent = false;
|
1383
|
+
var remoteMenuList = (0,external_vue_namespaceObject.ref)([]);
|
1384
|
+
var menuList = (0,external_vue_namespaceObject.ref)([]);
|
1385
|
+
var _useSearchSelectInjec = useSearchSelectInject(),
|
1386
|
+
editKey = _useSearchSelectInjec.editKey,
|
1387
|
+
onValidate = _useSearchSelectInjec.onValidate;
|
1388
|
+
var valueLoagic = (0,external_vue_namespaceObject.computed)(function () {
|
1389
|
+
var _usingItem$value;
|
1390
|
+
return ((_usingItem$value = usingItem.value) === null || _usingItem$value === void 0 ? void 0 : _usingItem$value.logical) || SearchLogical.OR;
|
1391
|
+
});
|
1392
|
+
(0,external_vue_namespaceObject.watch)(editKey, function () {
|
1393
|
+
if (props.mode === SearchInputMode.DEFAULT && editKey.value) {
|
1394
|
+
showPopover.value = false;
|
1395
|
+
}
|
1396
|
+
});
|
1397
|
+
// effects
|
1398
|
+
(0,external_vue_namespaceObject.watchEffect)(function () {
|
1399
|
+
if (!keyword.value) {
|
1400
|
+
setInputText();
|
1401
|
+
}
|
1402
|
+
}, {
|
1403
|
+
flush: 'pre'
|
1404
|
+
});
|
1405
|
+
(0,external_vue_namespaceObject.watch)([menuList, showPopover], function () {
|
1406
|
+
var _menuList$value;
|
1407
|
+
if ((_menuList$value = menuList.value) !== null && _menuList$value !== void 0 && _menuList$value.some(function (item) {
|
1408
|
+
return !item.disabled;
|
1409
|
+
}) && showPopover.value) {
|
1410
|
+
if (!isBindEvent) {
|
1411
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY) {
|
1412
|
+
menuHoverId.value = menuList.value.find(function (item) {
|
1413
|
+
return !item.disabled;
|
1414
|
+
}).id;
|
1415
|
+
} else {
|
1416
|
+
menuHoverId.value = '';
|
1417
|
+
}
|
1418
|
+
isBindEvent = true;
|
1419
|
+
document.addEventListener('keydown', handleDocumentKeydown);
|
1420
|
+
}
|
1421
|
+
} else {
|
1422
|
+
document.removeEventListener('keydown', handleDocumentKeydown);
|
1423
|
+
isBindEvent = false;
|
1424
|
+
if (props.valueBehavior !== ValueBehavior.NEEDKEY) {
|
1425
|
+
menuHoverId.value = '';
|
1426
|
+
}
|
1427
|
+
}
|
1428
|
+
});
|
1429
|
+
// events
|
1430
|
+
function handleDocumentKeydown(e) {
|
1431
|
+
switch (e.code) {
|
1432
|
+
case 'ArrowDown':
|
1433
|
+
case 'ArrowUp':
|
1434
|
+
documentArrowEvent(e);
|
1435
|
+
break;
|
1436
|
+
case 'Enter':
|
1437
|
+
case 'NumpadEnter':
|
1438
|
+
documentEnterEvent(e);
|
1439
|
+
break;
|
1440
|
+
}
|
1441
|
+
}
|
1442
|
+
function documentArrowEvent(e) {
|
1443
|
+
var _inputRef$value;
|
1444
|
+
e.preventDefault();
|
1445
|
+
(_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value.blur();
|
1446
|
+
var len = menuList.value.length;
|
1447
|
+
var i = len;
|
1448
|
+
var index = menuList.value.findIndex(function (set) {
|
1449
|
+
return set.id === menuHoverId.value;
|
1450
|
+
});
|
1451
|
+
while (i >= 0) {
|
1452
|
+
index = e.code === 'ArrowDown' ? index + 1 : index - 1;
|
1453
|
+
// eslint-disable-next-line no-nested-ternary
|
1454
|
+
index = index > len - 1 ? 0 : index < 0 ? len - 1 : index;
|
1455
|
+
var item = menuList.value[index];
|
1456
|
+
if (item && !item.disabled) {
|
1457
|
+
i = -1;
|
1458
|
+
var dom = document.getElementById(item.id);
|
1459
|
+
dom === null || dom === void 0 ? void 0 : dom.focus();
|
1460
|
+
menuHoverId.value = item.id;
|
1461
|
+
return;
|
1462
|
+
}
|
1463
|
+
i -= 1;
|
1464
|
+
}
|
1465
|
+
}
|
1466
|
+
function documentEnterEvent(e) {
|
1467
|
+
if (isBindEvent) {
|
1468
|
+
e.preventDefault();
|
1469
|
+
var item = menuList.value.find(function (item) {
|
1470
|
+
return item.id === menuHoverId.value;
|
1471
|
+
});
|
1472
|
+
item && handleSelectItem(item);
|
1473
|
+
}
|
1474
|
+
}
|
1475
|
+
function handleClickOutside(e) {
|
1476
|
+
var _popoverRef$value, _props$clickOutside;
|
1477
|
+
if (!((_popoverRef$value = popoverRef.value) !== null && _popoverRef$value !== void 0 && _popoverRef$value.contains(e.target)) && (_props$clickOutside = props.clickOutside) !== null && _props$clickOutside !== void 0 && _props$clickOutside.call(props, e.target, popoverRef.value)) {
|
1478
|
+
var _usingItem$value2, _usingItem$value3;
|
1479
|
+
if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && (_usingItem$value2 = _usingItem$value2.values) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.length && (_usingItem$value3 = usingItem.value) !== null && _usingItem$value3 !== void 0 && _usingItem$value3.multiple) {
|
1480
|
+
keyword.value = '';
|
1481
|
+
handleKeyEnter();
|
1482
|
+
return;
|
1483
|
+
}
|
1484
|
+
showPopover.value = false;
|
1485
|
+
isFocus.value = false;
|
1486
|
+
emit('focus', isFocus.value);
|
1487
|
+
}
|
1488
|
+
}
|
1489
|
+
function handleInputFocus(e) {
|
1490
|
+
setInputFocus();
|
1491
|
+
e && setMenuList();
|
1492
|
+
}
|
1493
|
+
function handleInputChange(event) {
|
1494
|
+
var _usingItem$value5, _usingItem$value8;
|
1495
|
+
clearInput();
|
1496
|
+
var text = event.target.innerText;
|
1497
|
+
if (/(\r|\n)/gm.test(text) || /\s{2}/gm.test(text)) {
|
1498
|
+
var _usingItem$value4;
|
1499
|
+
event.preventDefault();
|
1500
|
+
text = text.replace(/(\r|\n)/gm, " ".concat(valueLoagic.value, " ")).replace(/\s{2}/gm, '');
|
1501
|
+
inputRef.value.innerText = text;
|
1502
|
+
setInputFocus();
|
1503
|
+
keyword.value = text.replace(((_usingItem$value4 = usingItem.value) === null || _usingItem$value4 === void 0 ? void 0 : _usingItem$value4.keyInnerText) || '', '').trim();
|
1504
|
+
debounceSetMenuList();
|
1505
|
+
} else if (!keyword.value && text.length < (((_usingItem$value5 = usingItem.value) === null || _usingItem$value5 === void 0 || (_usingItem$value5 = _usingItem$value5.inputInnerText) === null || _usingItem$value5 === void 0 ? void 0 : _usingItem$value5.length) || 1)) {
|
1506
|
+
var _usingItem$value6, _usingItem$value7, _usingItem$value$valu, _text;
|
1507
|
+
var outerText = text.replace("\xA0", " ").replace(((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.keyInnerText.replace("\xA0", " ").trim()) || '', '').trim();
|
1508
|
+
var hasKeyword = text && ((_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 ? void 0 : _usingItem$value7.keyInnerText) && text.replace("\xA0", " ").includes(usingItem.value.keyInnerText.replace("\xA0", " ").trim());
|
1509
|
+
if (hasKeyword && outerText && (_usingItem$value$valu = usingItem.value.values) !== null && _usingItem$value$valu !== void 0 && _usingItem$value$valu.length) {
|
1510
|
+
keyword.value = outerText;
|
1511
|
+
console.info('outerText', outerText);
|
1512
|
+
debounceSetMenuList();
|
1513
|
+
return;
|
1514
|
+
}
|
1515
|
+
if (outerText || !((_text = text) !== null && _text !== void 0 && _text.length)) {
|
1516
|
+
usingItem.value = null;
|
1517
|
+
}
|
1518
|
+
keyword.value = outerText ? text : '';
|
1519
|
+
debounceSetMenuList();
|
1520
|
+
} else if (!((_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && (_usingItem$value8 = _usingItem$value8.values) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.length)) {
|
1521
|
+
var _usingItem$value9;
|
1522
|
+
keyword.value = text.replace("\xA0", " ").replace(((_usingItem$value9 = usingItem.value) === null || _usingItem$value9 === void 0 ? void 0 : _usingItem$value9.keyInnerText.replace("\xA0", " ")) || '', '').trim();
|
1523
|
+
setInputFocus();
|
1524
|
+
debounceSetMenuList();
|
1525
|
+
}
|
1526
|
+
}
|
1527
|
+
function handleInputKeyup(event) {
|
1528
|
+
switch (event.code) {
|
1529
|
+
case 'Enter':
|
1530
|
+
case 'NumpadEnter':
|
1531
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY && menuList.value.some(function (item) {
|
1532
|
+
return item.id === menuHoverId.value;
|
1533
|
+
})) return;
|
1534
|
+
handleKeyEnter(event);
|
1535
|
+
break;
|
1536
|
+
case 'Backspace':
|
1537
|
+
handleKeyBackspace();
|
1538
|
+
default:
|
1539
|
+
showNoSelectValueError.value = false;
|
1540
|
+
break;
|
1541
|
+
}
|
1542
|
+
}
|
1543
|
+
function handleKeyEnter(_x) {
|
1544
|
+
return _handleKeyEnter.apply(this, arguments);
|
1545
|
+
}
|
1546
|
+
function _handleKeyEnter() {
|
1547
|
+
_handleKeyEnter = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(event) {
|
1548
|
+
var value, _res, values, _keyword$value, valueList, _res2, _value, _res3, _value2, _res4, res;
|
1549
|
+
return regenerator_default().wrap(function _callee$(_context) {
|
1550
|
+
while (1) switch (_context.prev = _context.next) {
|
1551
|
+
case 0:
|
1552
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
1553
|
+
// resolve 中文输入时直接按下enter的错误表现
|
1554
|
+
_context.next = 3;
|
1555
|
+
return new Promise(function (r) {
|
1556
|
+
return setTimeout(r, 0);
|
1557
|
+
});
|
1558
|
+
case 3:
|
1559
|
+
if (usingItem.value) {
|
1560
|
+
_context.next = 16;
|
1561
|
+
break;
|
1562
|
+
}
|
1563
|
+
if (!(!keyword.value || props.valueBehavior === ValueBehavior.NEEDKEY)) {
|
1564
|
+
_context.next = 6;
|
1565
|
+
break;
|
1566
|
+
}
|
1567
|
+
return _context.abrupt("return");
|
1568
|
+
case 6:
|
1569
|
+
value = {
|
1570
|
+
id: keyword.value,
|
1571
|
+
name: keyword.value
|
1572
|
+
};
|
1573
|
+
_context.next = 9;
|
1574
|
+
return validateUsingItemValues(value);
|
1575
|
+
case 9:
|
1576
|
+
_res = _context.sent;
|
1577
|
+
if (_res) {
|
1578
|
+
_context.next = 12;
|
1579
|
+
break;
|
1580
|
+
}
|
1581
|
+
return _context.abrupt("return");
|
1582
|
+
case 12:
|
1583
|
+
emit('add', new SelectedItem(value, 'text'));
|
1584
|
+
keyword.value = '';
|
1585
|
+
setMenuList();
|
1586
|
+
return _context.abrupt("return");
|
1587
|
+
case 16:
|
1588
|
+
values = usingItem.value.values;
|
1589
|
+
if (values !== null && values !== void 0 && values.length) {
|
1590
|
+
_context.next = 43;
|
1591
|
+
break;
|
1592
|
+
}
|
1593
|
+
if (!((_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length)) {
|
1594
|
+
_context.next = 41;
|
1595
|
+
break;
|
1596
|
+
}
|
1597
|
+
if (!keyword.value.includes(valueLoagic.value)) {
|
1598
|
+
_context.next = 29;
|
1599
|
+
break;
|
1600
|
+
}
|
1601
|
+
valueList = keyword.value.split(valueLoagic.value);
|
1602
|
+
_context.next = 23;
|
1603
|
+
return validateUsingItemValues({
|
1604
|
+
id: keyword.value,
|
1605
|
+
name: keyword.value
|
1606
|
+
});
|
1607
|
+
case 23:
|
1608
|
+
_res2 = _context.sent;
|
1609
|
+
if (_res2) {
|
1610
|
+
_context.next = 26;
|
1611
|
+
break;
|
1612
|
+
}
|
1613
|
+
return _context.abrupt("return");
|
1614
|
+
case 26:
|
1615
|
+
valueList.forEach(function (v) {
|
1616
|
+
return usingItem.value.addValue({
|
1617
|
+
id: v,
|
1618
|
+
name: v
|
1619
|
+
});
|
1620
|
+
});
|
1621
|
+
_context.next = 36;
|
1622
|
+
break;
|
1623
|
+
case 29:
|
1624
|
+
_value = {
|
1625
|
+
id: keyword.value,
|
1626
|
+
name: keyword.value
|
1627
|
+
};
|
1628
|
+
_context.next = 32;
|
1629
|
+
return validateUsingItemValues(_value);
|
1630
|
+
case 32:
|
1631
|
+
_res3 = _context.sent;
|
1632
|
+
if (_res3) {
|
1633
|
+
_context.next = 35;
|
1634
|
+
break;
|
1635
|
+
}
|
1636
|
+
return _context.abrupt("return");
|
1637
|
+
case 35:
|
1638
|
+
usingItem.value.addValue(_value);
|
1639
|
+
case 36:
|
1640
|
+
emit('add', usingItem.value);
|
1641
|
+
keyword.value = '';
|
1642
|
+
usingItem.value = null;
|
1643
|
+
setInputFocus(true);
|
1644
|
+
return _context.abrupt("return");
|
1645
|
+
case 41:
|
1646
|
+
showNoSelectValueError.value = true;
|
1647
|
+
return _context.abrupt("return");
|
1648
|
+
case 43:
|
1649
|
+
if (!keyword.value) {
|
1650
|
+
_context.next = 56;
|
1651
|
+
break;
|
1652
|
+
}
|
1653
|
+
_value2 = {
|
1654
|
+
id: keyword.value,
|
1655
|
+
name: keyword.value
|
1656
|
+
};
|
1657
|
+
_context.next = 47;
|
1658
|
+
return validateUsingItemValues(_value2);
|
1659
|
+
case 47:
|
1660
|
+
_res4 = _context.sent;
|
1661
|
+
if (_res4) {
|
1662
|
+
_context.next = 50;
|
1663
|
+
break;
|
1664
|
+
}
|
1665
|
+
return _context.abrupt("return");
|
1666
|
+
case 50:
|
1667
|
+
usingItem.value.addValue(_value2);
|
1668
|
+
emit('add', usingItem.value);
|
1669
|
+
keyword.value = '';
|
1670
|
+
usingItem.value = null;
|
1671
|
+
setInputFocus(true);
|
1672
|
+
return _context.abrupt("return");
|
1673
|
+
case 56:
|
1674
|
+
_context.next = 58;
|
1675
|
+
return validateUsingItemValues();
|
1676
|
+
case 58:
|
1677
|
+
res = _context.sent;
|
1678
|
+
if (res) {
|
1679
|
+
_context.next = 61;
|
1680
|
+
break;
|
1681
|
+
}
|
1682
|
+
return _context.abrupt("return");
|
1683
|
+
case 61:
|
1684
|
+
setSelectedItem();
|
1685
|
+
case 62:
|
1686
|
+
case "end":
|
1687
|
+
return _context.stop();
|
1688
|
+
}
|
1689
|
+
}, _callee);
|
1690
|
+
}));
|
1691
|
+
return _handleKeyEnter.apply(this, arguments);
|
1692
|
+
}
|
1693
|
+
function handleKeyBackspace() {
|
1694
|
+
var _usingItem$value10;
|
1695
|
+
// 删除已选择项
|
1696
|
+
if (!usingItem.value && !keyword.value) {
|
1697
|
+
emit('delete');
|
1698
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
1699
|
+
setTimeout(setMenuList, 16);
|
1700
|
+
return;
|
1701
|
+
}
|
1702
|
+
if ((_usingItem$value10 = usingItem.value) !== null && _usingItem$value10 !== void 0 && _usingItem$value10.values.length) {
|
1703
|
+
var _usingItem$value11;
|
1704
|
+
// 删除选项
|
1705
|
+
if ((_usingItem$value11 = usingItem.value) !== null && _usingItem$value11 !== void 0 && _usingItem$value11.multiple || usingItem.value.isInValueList(usingItem.value.values[0]) || props.mode === SearchInputMode.EDIT && !keyword.value) {
|
1706
|
+
usingItem.value.values.splice(-1, 1);
|
1707
|
+
keyword.value = '';
|
1708
|
+
setInputFocus();
|
1709
|
+
return;
|
1710
|
+
}
|
1711
|
+
} else if (!keyword.value) {
|
1712
|
+
usingItem.value = null;
|
1713
|
+
keyword.value = '';
|
1714
|
+
setMenuList();
|
1715
|
+
}
|
1716
|
+
onValidate('');
|
1717
|
+
}
|
1718
|
+
function handleSelectItem(_x2, _x3) {
|
1719
|
+
return _handleSelectItem.apply(this, arguments);
|
1720
|
+
}
|
1721
|
+
function _handleSelectItem() {
|
1722
|
+
_handleSelectItem = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2(item, type) {
|
1723
|
+
var _item$value, _inputRef$value2, _usingItem$value14, _usingItem$value15;
|
1724
|
+
var _item$realId2, _item$realId, seleted, _res5, isCondition, res;
|
1725
|
+
return regenerator_default().wrap(function _callee2$(_context2) {
|
1726
|
+
while (1) switch (_context2.prev = _context2.next) {
|
1727
|
+
case 0:
|
1728
|
+
if (!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.id)) {
|
1729
|
+
_context2.next = 20;
|
1730
|
+
break;
|
1731
|
+
}
|
1732
|
+
if (!(props.valueBehavior === ValueBehavior.NEEDKEY && item.value || !props.validateValues)) {
|
1733
|
+
_context2.next = 8;
|
1734
|
+
break;
|
1735
|
+
}
|
1736
|
+
seleted = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
|
1737
|
+
id: (_item$realId = item.realId) !== null && _item$realId !== void 0 ? _item$realId : item.id
|
1738
|
+
}), type);
|
1739
|
+
seleted.addValue(item.value);
|
1740
|
+
setSelectedItem(seleted);
|
1741
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value) {
|
1742
|
+
setInputFocus(true);
|
1743
|
+
}
|
1744
|
+
menuHoverId.value = '';
|
1745
|
+
return _context2.abrupt("return");
|
1746
|
+
case 8:
|
1747
|
+
usingItem.value = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
|
1748
|
+
id: (_item$realId2 = item.realId) !== null && _item$realId2 !== void 0 ? _item$realId2 : item.id
|
1749
|
+
}), type);
|
1750
|
+
usingItem.value.addValue(item.value);
|
1751
|
+
_context2.next = 12;
|
1752
|
+
return validateUsingItemValues(item.value);
|
1753
|
+
case 12:
|
1754
|
+
_res5 = _context2.sent;
|
1755
|
+
if (_res5) {
|
1756
|
+
_context2.next = 16;
|
1757
|
+
break;
|
1758
|
+
}
|
1759
|
+
usingItem.value = null;
|
1760
|
+
return _context2.abrupt("return");
|
1761
|
+
case 16:
|
1762
|
+
setSelectedItem(usingItem.value);
|
1763
|
+
menuHoverId.value = '';
|
1764
|
+
setInputFocus(true);
|
1765
|
+
return _context2.abrupt("return");
|
1766
|
+
case 20:
|
1767
|
+
if (!(!usingItem.value || !(inputRef !== null && inputRef !== void 0 && (_inputRef$value2 = inputRef.value) !== null && _inputRef$value2 !== void 0 && _inputRef$value2.innerText))) {
|
1768
|
+
_context2.next = 28;
|
1769
|
+
break;
|
1770
|
+
}
|
1771
|
+
usingItem.value = new SelectedItem(item, type);
|
1772
|
+
keyword.value = '';
|
1773
|
+
isCondition = type === 'condition';
|
1774
|
+
isCondition && setSelectedItem();
|
1775
|
+
showPopover.value = isCondition || !!usingItem.value.children.length;
|
1776
|
+
setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
|
1777
|
+
return _context2.abrupt("return");
|
1778
|
+
case 28:
|
1779
|
+
if (!(((_usingItem$value14 = usingItem.value) === null || _usingItem$value14 === void 0 ? void 0 : _usingItem$value14.type) === 'condition')) {
|
1780
|
+
_context2.next = 32;
|
1781
|
+
break;
|
1782
|
+
}
|
1783
|
+
usingItem.value = new SelectedItem(item, type);
|
1784
|
+
setSelectedItem();
|
1785
|
+
return _context2.abrupt("return");
|
1786
|
+
case 32:
|
1787
|
+
usingItem.value.addValue(item);
|
1788
|
+
_context2.next = 35;
|
1789
|
+
return validateUsingItemValues(item);
|
1790
|
+
case 35:
|
1791
|
+
res = _context2.sent;
|
1792
|
+
if (res) {
|
1793
|
+
_context2.next = 38;
|
1794
|
+
break;
|
1795
|
+
}
|
1796
|
+
return _context2.abrupt("return");
|
1797
|
+
case 38:
|
1798
|
+
if (!usingItem.value.multiple) setSelectedItem();
|
1799
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value15 = usingItem.value) !== null && _usingItem$value15 !== void 0 && _usingItem$value15.multiple) {
|
1800
|
+
setInputFocus();
|
1801
|
+
}
|
1802
|
+
case 40:
|
1803
|
+
case "end":
|
1804
|
+
return _context2.stop();
|
1805
|
+
}
|
1806
|
+
}, _callee2);
|
1807
|
+
}));
|
1808
|
+
return _handleSelectItem.apply(this, arguments);
|
1809
|
+
}
|
1810
|
+
function handleSelectCondtionItem(item) {
|
1811
|
+
handleSelectItem(item, 'condition');
|
1812
|
+
}
|
1813
|
+
function handleMenuFooterClick(item) {
|
1814
|
+
var _usingItem$value12;
|
1815
|
+
switch (item.id) {
|
1816
|
+
case 'confirm':
|
1817
|
+
if (!((_usingItem$value12 = usingItem.value) !== null && _usingItem$value12 !== void 0 && _usingItem$value12.values.length)) return;
|
1818
|
+
keyword.value = '';
|
1819
|
+
handleKeyEnter();
|
1820
|
+
break;
|
1821
|
+
case 'cancel':
|
1822
|
+
usingItem.value.values = [];
|
1823
|
+
showPopover.value = false;
|
1824
|
+
break;
|
1825
|
+
}
|
1826
|
+
}
|
1827
|
+
// functions
|
1828
|
+
function validateUsingItemValues(_x4) {
|
1829
|
+
return _validateUsingItemValues.apply(this, arguments);
|
1830
|
+
}
|
1831
|
+
function _validateUsingItemValues() {
|
1832
|
+
_validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(value) {
|
1833
|
+
var _usingItem$value16, searchItem, validate, values;
|
1834
|
+
return regenerator_default().wrap(function _callee3$(_context3) {
|
1835
|
+
while (1) switch (_context3.prev = _context3.next) {
|
1836
|
+
case 0:
|
1837
|
+
if (usingItem.value) {
|
1838
|
+
_context3.next = 4;
|
1839
|
+
break;
|
1840
|
+
}
|
1841
|
+
_context3.next = 3;
|
1842
|
+
return validateValues(null, [value]);
|
1843
|
+
case 3:
|
1844
|
+
return _context3.abrupt("return", _context3.sent);
|
1845
|
+
case 4:
|
1846
|
+
_usingItem$value16 = usingItem.value, searchItem = _usingItem$value16.searchItem, validate = _usingItem$value16.validate, values = _usingItem$value16.values;
|
1847
|
+
if (!(validate && typeof props.validateValues === 'function')) {
|
1848
|
+
_context3.next = 9;
|
1849
|
+
break;
|
1850
|
+
}
|
1851
|
+
_context3.next = 8;
|
1852
|
+
return validateValues(searchItem, value ? [value] : values);
|
1853
|
+
case 8:
|
1854
|
+
return _context3.abrupt("return", _context3.sent);
|
1855
|
+
case 9:
|
1856
|
+
onValidate('');
|
1857
|
+
return _context3.abrupt("return", true);
|
1858
|
+
case 11:
|
1859
|
+
case "end":
|
1860
|
+
return _context3.stop();
|
1861
|
+
}
|
1862
|
+
}, _callee3);
|
1863
|
+
}));
|
1864
|
+
return _validateUsingItemValues.apply(this, arguments);
|
1865
|
+
}
|
1866
|
+
function validateValues(_x5, _x6) {
|
1867
|
+
return _validateValues.apply(this, arguments);
|
1868
|
+
}
|
1869
|
+
function _validateValues() {
|
1870
|
+
_validateValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(searchItem, value) {
|
1871
|
+
var _props$validateValues;
|
1872
|
+
var validateStr;
|
1873
|
+
return regenerator_default().wrap(function _callee4$(_context4) {
|
1874
|
+
while (1) switch (_context4.prev = _context4.next) {
|
1875
|
+
case 0:
|
1876
|
+
_context4.next = 2;
|
1877
|
+
return (_props$validateValues = props.validateValues) === null || _props$validateValues === void 0 ? void 0 : _props$validateValues.call(props, searchItem !== null && searchItem !== void 0 ? searchItem : null, value)["catch"](function () {
|
1878
|
+
return false;
|
1879
|
+
});
|
1880
|
+
case 2:
|
1881
|
+
validateStr = _context4.sent;
|
1882
|
+
if (!(typeof validateStr === 'string' || validateStr === false)) {
|
1883
|
+
_context4.next = 6;
|
1884
|
+
break;
|
1885
|
+
}
|
1886
|
+
onValidate(validateStr || '校验错误');
|
1887
|
+
return _context4.abrupt("return", false);
|
1888
|
+
case 6:
|
1889
|
+
onValidate('');
|
1890
|
+
return _context4.abrupt("return", true);
|
1891
|
+
case 8:
|
1892
|
+
case "end":
|
1893
|
+
return _context4.stop();
|
1894
|
+
}
|
1895
|
+
}, _callee4);
|
1896
|
+
}));
|
1897
|
+
return _validateValues.apply(this, arguments);
|
1898
|
+
}
|
1899
|
+
function setInputFocus() {
|
1900
|
+
var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
1901
|
+
if (refleshMenuList) {
|
1902
|
+
setTimeout(function () {
|
1903
|
+
setMenuList();
|
1904
|
+
}, 16);
|
1905
|
+
}
|
1906
|
+
isFocus.value = true;
|
1907
|
+
showPopover.value = true;
|
1908
|
+
showNoSelectValueError.value = false;
|
1909
|
+
var timer = setTimeout(function () {
|
1910
|
+
if (inputRef.value) {
|
1911
|
+
inputRef.value.focus(); // 光标移至最后
|
1912
|
+
var selection = window.getSelection();
|
1913
|
+
if (selection.focusOffset === 0) {
|
1914
|
+
selection.selectAllChildren(inputRef.value);
|
1915
|
+
selection.collapseToEnd();
|
1916
|
+
}
|
1917
|
+
}
|
1918
|
+
window.clearTimeout(timer);
|
1919
|
+
}, 0);
|
1920
|
+
emit('focus', isFocus.value);
|
1921
|
+
}
|
1922
|
+
function setMenuList() {
|
1923
|
+
return _setMenuList.apply(this, arguments);
|
1924
|
+
}
|
1925
|
+
function _setMenuList() {
|
1926
|
+
_setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
|
1927
|
+
var _usingItem$value17, _usingItem$value$valu2;
|
1928
|
+
var list, _usingItem$value18, _keyword$value2, hoverItem;
|
1929
|
+
return regenerator_default().wrap(function _callee5$(_context5) {
|
1930
|
+
while (1) switch (_context5.prev = _context5.next) {
|
1931
|
+
case 0:
|
1932
|
+
list = [];
|
1933
|
+
if (!(typeof props.getMenuList === 'function' && (typeof ((_usingItem$value17 = usingItem.value) === null || _usingItem$value17 === void 0 || (_usingItem$value17 = _usingItem$value17.searchItem) === null || _usingItem$value17 === void 0 ? void 0 : _usingItem$value17.async) === 'undefined' || usingItem.value.searchItem.async === true))) {
|
1934
|
+
_context5.next = 9;
|
1935
|
+
break;
|
1936
|
+
}
|
1937
|
+
loading.value = true;
|
1938
|
+
_context5.next = 5;
|
1939
|
+
return props.getMenuList((_usingItem$value18 = usingItem.value) === null || _usingItem$value18 === void 0 ? void 0 : _usingItem$value18.searchItem, keyword.value)["catch"](function () {
|
1940
|
+
return [];
|
1941
|
+
});
|
1942
|
+
case 5:
|
1943
|
+
list = _context5.sent;
|
1944
|
+
loading.value = false;
|
1945
|
+
_context5.next = 10;
|
1946
|
+
break;
|
1947
|
+
case 9:
|
1948
|
+
if (!(usingItem !== null && usingItem !== void 0 && usingItem.value)) {
|
1949
|
+
if (!((_keyword$value2 = keyword.value) !== null && _keyword$value2 !== void 0 && _keyword$value2.length)) {
|
1950
|
+
list = props.data.filter(function (item) {
|
1951
|
+
return !item.isSelected;
|
1952
|
+
}).slice();
|
1953
|
+
} else props.data.filter(function (item) {
|
1954
|
+
return !item.isSelected;
|
1955
|
+
}).forEach(function (item) {
|
1956
|
+
var isMatched = item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
|
1957
|
+
if (isMatched) {
|
1958
|
+
var _item$children, _list;
|
1959
|
+
list.push(item);
|
1960
|
+
var filterList = [];
|
1961
|
+
(_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.forEach(function (child) {
|
1962
|
+
filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
1963
|
+
realId: item.id,
|
1964
|
+
id: (0,external_shared_namespaceObject.random)(10),
|
1965
|
+
value: child
|
1966
|
+
}));
|
1967
|
+
});
|
1968
|
+
!filterList.length && !item.onlyRecommendChildren && filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
1969
|
+
realId: item.id,
|
1970
|
+
id: (0,external_shared_namespaceObject.random)(10),
|
1971
|
+
value: {
|
1972
|
+
id: keyword.value,
|
1973
|
+
name: keyword.value
|
1974
|
+
}
|
1975
|
+
}));
|
1976
|
+
(_list = list).push.apply(_list, filterList);
|
1977
|
+
} else {
|
1978
|
+
var _item$children2, _list2;
|
1979
|
+
var _filterList = [];
|
1980
|
+
(_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.forEach(function (child) {
|
1981
|
+
if (child.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase())) {
|
1982
|
+
_filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
1983
|
+
realId: item.id,
|
1984
|
+
id: (0,external_shared_namespaceObject.random)(10),
|
1985
|
+
value: child
|
1986
|
+
}));
|
1987
|
+
}
|
1988
|
+
});
|
1989
|
+
!_filterList.length && !item.onlyRecommendChildren && _filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
1990
|
+
value: {
|
1991
|
+
id: keyword.value,
|
1992
|
+
name: keyword.value
|
1993
|
+
}
|
1994
|
+
}));
|
1995
|
+
(_list2 = list).push.apply(_list2, _filterList);
|
1996
|
+
}
|
1997
|
+
});
|
1998
|
+
} else if (usingItem.value.type === 'condition') {
|
1999
|
+
list = props.conditions;
|
2000
|
+
} else if (!((_usingItem$value$valu2 = usingItem.value.values) !== null && _usingItem$value$valu2 !== void 0 && _usingItem$value$valu2.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
|
2001
|
+
list = usingItem.value.children.filter(function (item) {
|
2002
|
+
return item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
|
2003
|
+
});
|
2004
|
+
}
|
2005
|
+
case 10:
|
2006
|
+
menuList.value = list;
|
2007
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY) {
|
2008
|
+
hoverItem = list.find(function (item) {
|
2009
|
+
return !item.disabled;
|
2010
|
+
});
|
2011
|
+
if (hoverItem && (!menuHoverId.value || menuHoverId.value && !list.some(function (item) {
|
2012
|
+
return item.id === menuHoverId.value;
|
2013
|
+
}))) {
|
2014
|
+
menuHoverId.value = hoverItem.id;
|
2015
|
+
}
|
2016
|
+
}
|
2017
|
+
case 12:
|
2018
|
+
case "end":
|
2019
|
+
return _context5.stop();
|
2020
|
+
}
|
2021
|
+
}, _callee5);
|
2022
|
+
}));
|
2023
|
+
return _setMenuList.apply(this, arguments);
|
2024
|
+
}
|
2025
|
+
function setSelectedItem(item) {
|
2026
|
+
emit('add', item !== null && item !== void 0 ? item : usingItem.value);
|
2027
|
+
usingItem.value = null;
|
2028
|
+
keyword.value = '';
|
2029
|
+
setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY);
|
2030
|
+
}
|
2031
|
+
function clearInput() {
|
2032
|
+
var text = inputRef.value.innerText;
|
2033
|
+
if (text[text.length - 1] === '\n' || text[0] === '\r') {
|
2034
|
+
setInputText(text.slice(0, -1));
|
2035
|
+
clearInput();
|
2036
|
+
} else if (text[0] === '\n' || text[0] === '\r') {
|
2037
|
+
setInputText(text.slice(1));
|
2038
|
+
clearInput();
|
2039
|
+
}
|
2040
|
+
}
|
2041
|
+
function setInputText() {
|
2042
|
+
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
2043
|
+
if (inputRef.value) {
|
2044
|
+
var _usingItem$value13;
|
2045
|
+
inputRef.value.innerHTML = text || ((_usingItem$value13 = usingItem.value) === null || _usingItem$value13 === void 0 ? void 0 : _usingItem$value13.inputInnerHtml) || '';
|
2046
|
+
}
|
2047
|
+
}
|
2048
|
+
function handleLogicalChange(logical) {
|
2049
|
+
if (!usingItem.value) return;
|
2050
|
+
usingItem.value.logical = logical;
|
2051
|
+
}
|
2052
|
+
// expose
|
2053
|
+
expose({
|
2054
|
+
handleInputFocus: handleInputFocus,
|
2055
|
+
isFocus: isFocus
|
2056
|
+
});
|
2057
|
+
return {
|
2058
|
+
popoverRef: popoverRef,
|
2059
|
+
inputRef: inputRef,
|
2060
|
+
keyword: keyword,
|
2061
|
+
loading: loading,
|
2062
|
+
remoteMenuList: remoteMenuList,
|
2063
|
+
menuList: menuList,
|
2064
|
+
menuHoverId: menuHoverId,
|
2065
|
+
isFocus: isFocus,
|
2066
|
+
usingItem: usingItem,
|
2067
|
+
showPopover: showPopover,
|
2068
|
+
showNoSelectValueError: showNoSelectValueError,
|
2069
|
+
debounceSetMenuList: debounceSetMenuList,
|
2070
|
+
documentArrowEvent: documentArrowEvent,
|
2071
|
+
handleClickOutside: handleClickOutside,
|
2072
|
+
handleInputFocus: handleInputFocus,
|
2073
|
+
handleInputChange: handleInputChange,
|
2074
|
+
handleLogicalChange: handleLogicalChange,
|
2075
|
+
handleInputKeyup: handleInputKeyup,
|
2076
|
+
handleSelectItem: handleSelectItem,
|
2077
|
+
handleSelectCondtionItem: handleSelectCondtionItem,
|
2078
|
+
handleMenuFooterClick: handleMenuFooterClick,
|
2079
|
+
resolveClassName: resolveClassName,
|
2080
|
+
t: t
|
2081
|
+
};
|
2082
|
+
},
|
2083
|
+
render: function render() {
|
2084
|
+
var _this$keyword,
|
2085
|
+
_this$menuList,
|
2086
|
+
_this = this;
|
2087
|
+
var _ref2 = this.usingItem || {},
|
2088
|
+
multiple = _ref2.multiple,
|
2089
|
+
values = _ref2.values,
|
2090
|
+
placeholder = _ref2.placeholder,
|
2091
|
+
inputInnerHtml = _ref2.inputInnerHtml;
|
2092
|
+
var showInputAfter = !((_this$keyword = this.keyword) !== null && _this$keyword !== void 0 && _this$keyword.length) && !(values !== null && values !== void 0 && values.length) && placeholder;
|
2093
|
+
var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && !!((_this$menuList = this.menuList) !== null && _this$menuList !== void 0 && _this$menuList.length);
|
2094
|
+
var showCondition = !this.usingItem && this.showCondition;
|
2095
|
+
var menuSlots = Object.assign({}, this.$slots.menu ? {
|
2096
|
+
"default": function _default(data) {
|
2097
|
+
var _this$$slots$menu, _this$$slots;
|
2098
|
+
return (_this$$slots$menu = (_this$$slots = _this.$slots).menu) === null || _this$$slots$menu === void 0 ? void 0 : _this$$slots$menu.call(_this$$slots, data);
|
2099
|
+
}
|
2100
|
+
} : {});
|
2101
|
+
var inputContent = function inputContent() {
|
2102
|
+
var _this$keyword2;
|
2103
|
+
return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
2104
|
+
"ref": "inputRef",
|
2105
|
+
"class": {
|
2106
|
+
'div-input': true,
|
2107
|
+
'input-before': _this.showInputBefore && !((_this$keyword2 = _this.keyword) !== null && _this$keyword2 !== void 0 && _this$keyword2.length),
|
2108
|
+
'input-after': showInputAfter
|
2109
|
+
},
|
2110
|
+
"contenteditable": true,
|
2111
|
+
"data-placeholder": !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
|
2112
|
+
"data-tips": placeholder || '',
|
2113
|
+
"spellcheck": "false",
|
2114
|
+
"onFocus": _this.handleInputFocus,
|
2115
|
+
"onInput": _this.handleInputChange,
|
2116
|
+
"onKeydown": _this.handleInputKeyup
|
2117
|
+
}, null), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
|
2118
|
+
};
|
2119
|
+
var popoverContent = function popoverContent() {
|
2120
|
+
var _this$menuList2, _this$usingItem, _this$usingItem2;
|
2121
|
+
if (_this.loading) {
|
2122
|
+
return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.loading]);
|
2123
|
+
}
|
2124
|
+
if (_this.showNoSelectValueError) {
|
2125
|
+
return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.filterQueryMustHasValue]);
|
2126
|
+
}
|
2127
|
+
return (_this$menuList2 = _this.menuList) !== null && _this$menuList2 !== void 0 && _this$menuList2.length ? (0,external_vue_namespaceObject.createVNode)("div", {
|
2128
|
+
"ref": "popoverRef",
|
2129
|
+
"class": _this.resolveClassName('search-select-popover')
|
2130
|
+
}, [(0,external_vue_namespaceObject.createVNode)(menu, {
|
2131
|
+
"list": _this.menuList,
|
2132
|
+
"keyword": _this.keyword,
|
2133
|
+
"multiple": !!multiple,
|
2134
|
+
"hoverId": _this.menuHoverId,
|
2135
|
+
"selected": (values === null || values === void 0 ? void 0 : values.map(function (item) {
|
2136
|
+
return item.id;
|
2137
|
+
})) || [],
|
2138
|
+
"conditions": showCondition ? _this.conditions : [],
|
2139
|
+
"logical": (_this$usingItem = _this.usingItem) === null || _this$usingItem === void 0 ? void 0 : _this$usingItem.logical,
|
2140
|
+
"showLogical": (_this$usingItem2 = _this.usingItem) === null || _this$usingItem2 === void 0 ? void 0 : _this$usingItem2.showLogical,
|
2141
|
+
"onUpdate:logical": _this.handleLogicalChange,
|
2142
|
+
"onSelectItem": _this.handleSelectItem,
|
2143
|
+
"onSelectCondition": _this.handleSelectCondtionItem,
|
2144
|
+
"onFooterClick": _this.handleMenuFooterClick
|
2145
|
+
}, _objectSpread({}, menuSlots))]) : undefined;
|
2146
|
+
};
|
2147
|
+
return (0,external_vue_namespaceObject.createVNode)(external_popover_namespaceObject["default"], {
|
2148
|
+
"trigger": "manual",
|
2149
|
+
"theme": "light",
|
2150
|
+
"placement": "bottom-start",
|
2151
|
+
"arrow": false,
|
2152
|
+
"disableOutsideClick": true,
|
2153
|
+
"isShow": showPopover
|
2154
|
+
}, {
|
2155
|
+
"default": inputContent,
|
2156
|
+
content: popoverContent
|
2157
|
+
});
|
2158
|
+
}
|
2159
|
+
}));
|
2160
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/selected.tsx
|
2161
|
+
|
2162
|
+
/*
|
2163
|
+
* Tencent is pleased to support the open source community by making
|
2164
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
2165
|
+
*
|
2166
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
2167
|
+
*
|
2168
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2169
|
+
*
|
2170
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
2171
|
+
*
|
2172
|
+
* ---------------------------------------------------
|
2173
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
2174
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
2175
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
2176
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2177
|
+
*
|
2178
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
2179
|
+
* the Software.
|
2180
|
+
*
|
2181
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
2182
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
2183
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
2184
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2185
|
+
* IN THE SOFTWARE.
|
2186
|
+
*/
|
2187
|
+
|
2188
|
+
|
2189
|
+
|
2190
|
+
|
2191
|
+
/* harmony default export */ const selected = ((0,external_vue_namespaceObject.defineComponent)({
|
2192
|
+
name: 'SearchSelected',
|
2193
|
+
props: {
|
2194
|
+
data: {
|
2195
|
+
type: Array,
|
2196
|
+
required: true
|
2197
|
+
},
|
2198
|
+
selectedList: {
|
2199
|
+
type: Array,
|
2200
|
+
required: true
|
2201
|
+
},
|
2202
|
+
overflowIndex: {
|
2203
|
+
type: Number,
|
2204
|
+
"default": -1
|
2205
|
+
},
|
2206
|
+
conditions: {
|
2207
|
+
type: Array,
|
2208
|
+
"default": function _default() {
|
2209
|
+
return [];
|
2210
|
+
}
|
2211
|
+
},
|
2212
|
+
getMenuList: Function,
|
2213
|
+
validateValues: Function,
|
2214
|
+
valueBehavior: String
|
2215
|
+
},
|
2216
|
+
emits: ['delete'],
|
2217
|
+
setup: function setup(_props, _ref) {
|
2218
|
+
var emit = _ref.emit;
|
2219
|
+
var inputRef = (0,external_vue_namespaceObject.ref)(null);
|
2220
|
+
var _useSearchSelectInjec = useSearchSelectInject(),
|
2221
|
+
onEditClick = _useSearchSelectInjec.onEditClick,
|
2222
|
+
onEditEnter = _useSearchSelectInjec.onEditEnter,
|
2223
|
+
onEditBlur = _useSearchSelectInjec.onEditBlur,
|
2224
|
+
editKey = _useSearchSelectInjec.editKey;
|
2225
|
+
function handleDeleteSelected(index) {
|
2226
|
+
emit('delete', index);
|
2227
|
+
}
|
2228
|
+
function handleEditSeleted(e, item, index) {
|
2229
|
+
e.preventDefault();
|
2230
|
+
e.stopPropagation();
|
2231
|
+
onEditClick(item, index);
|
2232
|
+
// magic code
|
2233
|
+
setTimeout(function () {
|
2234
|
+
return inputRef.value.handleInputFocus();
|
2235
|
+
}, 200);
|
2236
|
+
}
|
2237
|
+
function handleAddSelected(item, index) {
|
2238
|
+
onEditEnter(item, index);
|
2239
|
+
}
|
2240
|
+
function handleInputFocus(isFocus) {
|
2241
|
+
if (isFocus) return;
|
2242
|
+
onEditBlur();
|
2243
|
+
}
|
2244
|
+
function handleInputOutside() {
|
2245
|
+
return true;
|
2246
|
+
}
|
2247
|
+
function copySeletedItem(item) {
|
2248
|
+
var newItem = new SelectedItem(item.searchItem, item.type);
|
2249
|
+
newItem.values = item.values.slice();
|
2250
|
+
newItem.logical = item.logical || SearchLogical.OR;
|
2251
|
+
return newItem;
|
2252
|
+
}
|
2253
|
+
return {
|
2254
|
+
inputRef: inputRef,
|
2255
|
+
editKey: editKey,
|
2256
|
+
copySeletedItem: copySeletedItem,
|
2257
|
+
handleDeleteSelected: handleDeleteSelected,
|
2258
|
+
handleEditSeleted: handleEditSeleted,
|
2259
|
+
handleInputOutside: handleInputOutside,
|
2260
|
+
handleAddSelected: handleAddSelected,
|
2261
|
+
handleInputFocus: handleInputFocus
|
2262
|
+
};
|
2263
|
+
},
|
2264
|
+
render: function render() {
|
2265
|
+
var _this = this;
|
2266
|
+
var contentComponent = function contentComponent(item, index) {
|
2267
|
+
return _this.editKey === "".concat(item.id, "_").concat(index) ? (0,external_vue_namespaceObject.createVNode)("div", {
|
2268
|
+
"class": "selected-input",
|
2269
|
+
"key": _this.editKey.toString()
|
2270
|
+
}, [(0,external_vue_namespaceObject.createVNode)(input, {
|
2271
|
+
"ref": "inputRef",
|
2272
|
+
"key": _this.editKey.toString(),
|
2273
|
+
"mode": SearchInputMode.EDIT,
|
2274
|
+
"data": _this.data,
|
2275
|
+
"showCondition": false,
|
2276
|
+
"conditions": _this.conditions,
|
2277
|
+
"defautUsingItem": _this.copySeletedItem(item),
|
2278
|
+
"clickOutside": _this.handleInputOutside,
|
2279
|
+
"getMenuList": _this.getMenuList,
|
2280
|
+
"validateValues": _this.validateValues,
|
2281
|
+
"valueBehavior": _this.valueBehavior,
|
2282
|
+
"onAdd": function onAdd(v) {
|
2283
|
+
return _this.handleAddSelected(v, index);
|
2284
|
+
},
|
2285
|
+
"onFocus": _this.handleInputFocus
|
2286
|
+
}, null)]) : (0,external_vue_namespaceObject.createVNode)("li", {
|
2287
|
+
"class": "search-container-selected ".concat(!(_this.overflowIndex >= 0 ? index < _this.overflowIndex : index >= 0) ? 'hidden-selected' : ''),
|
2288
|
+
"key": "".concat(item.id, "_").concat(index)
|
2289
|
+
}, [(0,external_vue_namespaceObject.createVNode)("span", {
|
2290
|
+
"class": "selected-name",
|
2291
|
+
"onClick": function onClick(e) {
|
2292
|
+
return _this.handleEditSeleted(e, item, index);
|
2293
|
+
}
|
2294
|
+
}, [item.inputInnerText]), (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
|
2295
|
+
"class": "selected-clear",
|
2296
|
+
"onClick": function onClick() {
|
2297
|
+
return _this.handleDeleteSelected(index);
|
2298
|
+
}
|
2299
|
+
}, null)]);
|
2300
|
+
};
|
2301
|
+
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [this.selectedList.map(function (item, index) {
|
2302
|
+
return [_this.overflowIndex >= 0 && index === _this.overflowIndex && (0,external_vue_namespaceObject.createVNode)("div", {
|
2303
|
+
"class": "search-container-selected overflow-selected"
|
2304
|
+
}, [(0,external_vue_namespaceObject.createTextVNode)("+"), _this.selectedList.length - _this.overflowIndex]), contentComponent(item, index)];
|
2305
|
+
})]);
|
2306
|
+
}
|
2307
|
+
}));
|
2308
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/search-select.tsx
|
2309
|
+
|
2310
|
+
|
2311
|
+
function search_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; }
|
2312
|
+
function search_select_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? search_select_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : search_select_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
2313
|
+
/*
|
2314
|
+
* Tencent is pleased to support the open source community by making
|
2315
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
2316
|
+
*
|
2317
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
2318
|
+
*
|
2319
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2320
|
+
*
|
2321
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
2322
|
+
*
|
2323
|
+
* ---------------------------------------------------
|
2324
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
2325
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
2326
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
2327
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2328
|
+
*
|
2329
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
2330
|
+
* the Software.
|
2331
|
+
*
|
2332
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
2333
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
2334
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
2335
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2336
|
+
* IN THE SOFTWARE.
|
2337
|
+
*/
|
2338
|
+
|
2339
|
+
|
2340
|
+
|
2341
|
+
|
2342
|
+
|
2343
|
+
|
2344
|
+
|
2345
|
+
|
2346
|
+
|
2347
|
+
var INPUT_PADDING_WIDTH = 40;
|
2348
|
+
var SELETED_MARGING_RIGHT = 6;
|
2349
|
+
var SearchSelectProps = {
|
2350
|
+
data: {
|
2351
|
+
type: Array,
|
2352
|
+
"default": function _default() {
|
2353
|
+
return [];
|
2354
|
+
}
|
2355
|
+
},
|
2356
|
+
modelValue: {
|
2357
|
+
type: Array,
|
2358
|
+
"default": function _default() {
|
2359
|
+
return [];
|
2360
|
+
}
|
2361
|
+
},
|
2362
|
+
shrink: {
|
2363
|
+
type: Boolean,
|
2364
|
+
"default": true
|
2365
|
+
},
|
2366
|
+
maxHeight: {
|
2367
|
+
type: Number,
|
2368
|
+
"default": 120
|
2369
|
+
},
|
2370
|
+
minHeight: {
|
2371
|
+
type: Number,
|
2372
|
+
"default": 26
|
2373
|
+
},
|
2374
|
+
conditions: {
|
2375
|
+
type: Array,
|
2376
|
+
"default": function _default() {
|
2377
|
+
return [];
|
2378
|
+
}
|
2379
|
+
},
|
2380
|
+
clearable: {
|
2381
|
+
type: Boolean,
|
2382
|
+
"default": true
|
2383
|
+
},
|
2384
|
+
placeholder: String,
|
2385
|
+
getMenuList: Function,
|
2386
|
+
validateValues: Function,
|
2387
|
+
uniqueSelect: {
|
2388
|
+
type: Boolean,
|
2389
|
+
"default": false
|
2390
|
+
},
|
2391
|
+
valueBehavior: {
|
2392
|
+
type: String,
|
2393
|
+
"default": ValueBehavior.ALL,
|
2394
|
+
validator: function validator(v) {
|
2395
|
+
return [ValueBehavior.ALL, ValueBehavior.NEEDKEY].includes(v);
|
2396
|
+
}
|
2397
|
+
}
|
2398
|
+
};
|
2399
|
+
/* harmony default export */ const search_select = ((0,external_vue_namespaceObject.defineComponent)({
|
2400
|
+
name: 'SearchSelect',
|
2401
|
+
directives: {
|
2402
|
+
clickoutside: external_directives_namespaceObject.clickoutside
|
2403
|
+
},
|
2404
|
+
props: SearchSelectProps,
|
2405
|
+
emits: ['update:modelValue', 'search'],
|
2406
|
+
setup: function setup(props, _ref) {
|
2407
|
+
var emit = _ref.emit;
|
2408
|
+
var t = (0,external_config_provider_namespaceObject.useLocale)('searchSelect');
|
2409
|
+
var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
|
2410
|
+
resolveClassName = _usePrefix.resolveClassName;
|
2411
|
+
var localConditions = (0,external_vue_namespaceObject.computed)(function () {
|
2412
|
+
if (props.conditions === undefined) {
|
2413
|
+
return [{
|
2414
|
+
id: 'or',
|
2415
|
+
name: t.value.or
|
2416
|
+
}, {
|
2417
|
+
id: 'and',
|
2418
|
+
name: t.value.and
|
2419
|
+
}];
|
2420
|
+
}
|
2421
|
+
return props.conditions;
|
2422
|
+
});
|
2423
|
+
// refs
|
2424
|
+
var inputRef = (0,external_vue_namespaceObject.ref)(null);
|
2425
|
+
var wrapRef = (0,external_vue_namespaceObject.ref)(null);
|
2426
|
+
// vars
|
2427
|
+
var isFocus = (0,external_vue_namespaceObject.ref)(false);
|
2428
|
+
var selectedList = (0,external_vue_namespaceObject.ref)([]);
|
2429
|
+
var overflowIndex = (0,external_vue_namespaceObject.ref)(-1);
|
2430
|
+
var debounceResize = (0,external_shared_namespaceObject.debounce)(32, handleResize);
|
2431
|
+
var editKey = (0,external_vue_namespaceObject.ref)('');
|
2432
|
+
var validateStr = (0,external_vue_namespaceObject.ref)('');
|
2433
|
+
var copyData = (0,external_vue_namespaceObject.shallowRef)([]);
|
2434
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
2435
|
+
return props.data;
|
2436
|
+
}, function () {
|
2437
|
+
var _copyData$value;
|
2438
|
+
copyData.value = JSON.parse(JSON.stringify(props.data));
|
2439
|
+
(_copyData$value = copyData.value) === null || _copyData$value === void 0 ? void 0 : _copyData$value.forEach(function (item) {
|
2440
|
+
item.isSelected = props.uniqueSelect && !!props.modelValue.some(function (set) {
|
2441
|
+
return set.id === item.id;
|
2442
|
+
});
|
2443
|
+
});
|
2444
|
+
}, {
|
2445
|
+
immediate: true
|
2446
|
+
});
|
2447
|
+
// effects
|
2448
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
2449
|
+
return props.modelValue;
|
2450
|
+
}, function (v) {
|
2451
|
+
if (!(v !== null && v !== void 0 && v.length)) {
|
2452
|
+
var _copyData$value2;
|
2453
|
+
selectedList.value = [];
|
2454
|
+
(_copyData$value2 = copyData.value) === null || _copyData$value2 === void 0 ? void 0 : _copyData$value2.forEach(function (item) {
|
2455
|
+
item.isSelected = false;
|
2456
|
+
});
|
2457
|
+
return;
|
2458
|
+
}
|
2459
|
+
var list = [];
|
2460
|
+
v.forEach(function (item) {
|
2461
|
+
var seleted = selectedList.value.find(function (set) {
|
2462
|
+
return set.id === item.id && set.name === item.name;
|
2463
|
+
});
|
2464
|
+
if ((seleted === null || seleted === void 0 ? void 0 : seleted.toValueKey()) === JSON.stringify(item)) {
|
2465
|
+
seleted.values = item.values || [];
|
2466
|
+
seleted.logical = item.logical || SearchLogical.OR;
|
2467
|
+
list.push(seleted);
|
2468
|
+
} else {
|
2469
|
+
var _item$values;
|
2470
|
+
var searchItem = props.data.find(function (set) {
|
2471
|
+
return set.id === item.id;
|
2472
|
+
});
|
2473
|
+
var searchType = 'default';
|
2474
|
+
if (!searchItem) {
|
2475
|
+
searchItem = props.conditions.find(function (set) {
|
2476
|
+
return set.id === item.id;
|
2477
|
+
});
|
2478
|
+
searchItem && (searchType = 'condition');
|
2479
|
+
}
|
2480
|
+
if (!searchItem && !((_item$values = item.values) !== null && _item$values !== void 0 && _item$values.length)) {
|
2481
|
+
searchType = 'text';
|
2482
|
+
}
|
2483
|
+
var newSelected = new SelectedItem(searchItem || item, searchType);
|
2484
|
+
newSelected.values = item.values || [];
|
2485
|
+
newSelected.logical = item.logical || SearchLogical.OR;
|
2486
|
+
list.push(newSelected);
|
2487
|
+
}
|
2488
|
+
});
|
2489
|
+
selectedList.value = list;
|
2490
|
+
copyData.value = JSON.parse(JSON.stringify(props.data || []));
|
2491
|
+
copyData.value.forEach(function (item) {
|
2492
|
+
item.isSelected = props.uniqueSelect && !!list.some(function (set) {
|
2493
|
+
return set.id === item.id;
|
2494
|
+
});
|
2495
|
+
});
|
2496
|
+
}, {
|
2497
|
+
immediate: true,
|
2498
|
+
deep: true
|
2499
|
+
});
|
2500
|
+
// life hooks
|
2501
|
+
(0,external_vue_namespaceObject.onMounted)(function () {
|
2502
|
+
addListener(wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container'))), debounceResize);
|
2503
|
+
});
|
2504
|
+
(0,external_vue_namespaceObject.onBeforeUnmount)(function () {
|
2505
|
+
removeListener(wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container'))), debounceResize);
|
2506
|
+
});
|
2507
|
+
// edit item
|
2508
|
+
useSearchSelectProvider({
|
2509
|
+
onEditClick: onEditClick,
|
2510
|
+
onEditEnter: onEditEnter,
|
2511
|
+
onEditBlur: onEditBlur,
|
2512
|
+
onValidate: onValidate,
|
2513
|
+
editKey: editKey
|
2514
|
+
});
|
2515
|
+
function onEditClick(item, index) {
|
2516
|
+
editKey.value = "".concat(item.id, "_").concat(index);
|
2517
|
+
}
|
2518
|
+
function onEditEnter(item, index) {
|
2519
|
+
var list = selectedList.value.slice();
|
2520
|
+
list.splice(index, 1, item);
|
2521
|
+
emit('update:modelValue', list.map(function (item) {
|
2522
|
+
return item.toValue();
|
2523
|
+
}));
|
2524
|
+
editKey.value = '';
|
2525
|
+
}
|
2526
|
+
function onEditBlur() {
|
2527
|
+
editKey.value = '';
|
2528
|
+
onValidate('');
|
2529
|
+
}
|
2530
|
+
function onValidate(str) {
|
2531
|
+
validateStr.value = str || '';
|
2532
|
+
}
|
2533
|
+
// events
|
2534
|
+
function handleResize() {
|
2535
|
+
if (isFocus.value || selectedList.value.length < 1) {
|
2536
|
+
overflowIndex.value = -1;
|
2537
|
+
return;
|
2538
|
+
}
|
2539
|
+
var inputEl = wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container')));
|
2540
|
+
var maxWidth = wrapRef.value.querySelector('.search-container').clientWidth - SELETED_MARGING_RIGHT - 2;
|
2541
|
+
var tagList = inputEl.querySelectorAll('.search-container-selected:not(.overflow-selected)');
|
2542
|
+
var width = 0;
|
2543
|
+
var index = 0;
|
2544
|
+
var i = 0;
|
2545
|
+
while (index === 0 && width <= maxWidth - INPUT_PADDING_WIDTH && i <= tagList.length - 1) {
|
2546
|
+
var el = tagList[i];
|
2547
|
+
if (el.clientHeight > props.minHeight) {
|
2548
|
+
overflowIndex.value = i;
|
2549
|
+
return;
|
2550
|
+
}
|
2551
|
+
width += el ? el.clientWidth + SELETED_MARGING_RIGHT : 0;
|
2552
|
+
if (width >= maxWidth - INPUT_PADDING_WIDTH) {
|
2553
|
+
index = i;
|
2554
|
+
}
|
2555
|
+
i += 1;
|
2556
|
+
}
|
2557
|
+
if (index === tagList.length - 1 && width <= maxWidth) {
|
2558
|
+
overflowIndex.value = -1;
|
2559
|
+
return;
|
2560
|
+
}
|
2561
|
+
overflowIndex.value = width >= maxWidth - INPUT_PADDING_WIDTH ? index : index - 1;
|
2562
|
+
}
|
2563
|
+
function handleWrapClick() {
|
2564
|
+
if (!editKey.value) {
|
2565
|
+
inputRef.value.handleInputFocus();
|
2566
|
+
}
|
2567
|
+
}
|
2568
|
+
function handleClearAll() {
|
2569
|
+
selectedList.value = [];
|
2570
|
+
overflowIndex.value = -1;
|
2571
|
+
emit('update:modelValue', []);
|
2572
|
+
}
|
2573
|
+
function handleInputOutside(target) {
|
2574
|
+
var _wrapRef$value;
|
2575
|
+
return !((_wrapRef$value = wrapRef.value) !== null && _wrapRef$value !== void 0 && _wrapRef$value.contains(target));
|
2576
|
+
}
|
2577
|
+
function handleAddSelected(item) {
|
2578
|
+
var list = selectedList.value.slice();
|
2579
|
+
list.push(item);
|
2580
|
+
onValidate('');
|
2581
|
+
emit('update:modelValue', list.map(function (item) {
|
2582
|
+
return item.toValue();
|
2583
|
+
}));
|
2584
|
+
}
|
2585
|
+
function handleDeleteSelected(index) {
|
2586
|
+
var list = selectedList.value.slice();
|
2587
|
+
list.splice(typeof index === 'number' ? index : selectedList.value.length - 1, 1);
|
2588
|
+
onValidate('');
|
2589
|
+
emit('update:modelValue', list.map(function (item) {
|
2590
|
+
return item.toValue();
|
2591
|
+
}));
|
2592
|
+
}
|
2593
|
+
function handleInputFocus(v) {
|
2594
|
+
v && (overflowIndex.value = -1);
|
2595
|
+
if (v === false) {
|
2596
|
+
var _wrapRef$value$queryS;
|
2597
|
+
(_wrapRef$value$queryS = wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container')))) === null || _wrapRef$value$queryS === void 0 ? void 0 : _wrapRef$value$queryS.scrollTo(0, 0);
|
2598
|
+
}
|
2599
|
+
isFocus.value = v;
|
2600
|
+
}
|
2601
|
+
function handleClickSearch(e) {
|
2602
|
+
emit('search', e);
|
2603
|
+
}
|
2604
|
+
return {
|
2605
|
+
inputRef: inputRef,
|
2606
|
+
wrapRef: wrapRef,
|
2607
|
+
isFocus: isFocus,
|
2608
|
+
copyData: copyData,
|
2609
|
+
selectedList: selectedList,
|
2610
|
+
overflowIndex: overflowIndex,
|
2611
|
+
validateStr: validateStr,
|
2612
|
+
onEditClick: onEditClick,
|
2613
|
+
onEditEnter: onEditEnter,
|
2614
|
+
handleWrapClick: handleWrapClick,
|
2615
|
+
handleInputFocus: handleInputFocus,
|
2616
|
+
handleResize: handleResize,
|
2617
|
+
handleClearAll: handleClearAll,
|
2618
|
+
handleInputOutside: handleInputOutside,
|
2619
|
+
handleAddSelected: handleAddSelected,
|
2620
|
+
handleDeleteSelected: handleDeleteSelected,
|
2621
|
+
handleClickSearch: handleClickSearch,
|
2622
|
+
localConditions: localConditions,
|
2623
|
+
resolveClassName: resolveClassName,
|
2624
|
+
t: t
|
2625
|
+
};
|
2626
|
+
},
|
2627
|
+
render: function render() {
|
2628
|
+
var _this = this,
|
2629
|
+
_ref2,
|
2630
|
+
_this$$slots$prepend,
|
2631
|
+
_this$$slots2;
|
2632
|
+
var maxHeight = "".concat(!this.shrink || this.isFocus ? this.maxHeight : this.minHeight, "px");
|
2633
|
+
var showCondition = !!this.selectedList.length && this.selectedList.slice(-1)[0].type !== 'condition';
|
2634
|
+
var menuSlots = Object.assign({}, this.$slots.menu ? {
|
2635
|
+
menu: function menu(data) {
|
2636
|
+
var _this$$slots$menu, _this$$slots;
|
2637
|
+
return (_this$$slots$menu = (_this$$slots = _this.$slots).menu) === null || _this$$slots$menu === void 0 ? void 0 : _this$$slots$menu.call(_this$$slots, data);
|
2638
|
+
}
|
2639
|
+
} : {});
|
2640
|
+
// render
|
2641
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
2642
|
+
"class": this.resolveClassName('search-select'),
|
2643
|
+
"ref": "wrapRef"
|
2644
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
2645
|
+
"class": (_ref2 = {}, _defineProperty(_ref2, this.resolveClassName('search-select-container'), true), _defineProperty(_ref2, 'is-focus', this.isFocus), _ref2),
|
2646
|
+
"onClick": this.handleWrapClick
|
2647
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
2648
|
+
"class": "search-prefix"
|
2649
|
+
}, [(_this$$slots$prepend = (_this$$slots2 = this.$slots).prepend) === null || _this$$slots$prepend === void 0 ? void 0 : _this$$slots$prepend.call(_this$$slots2)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
2650
|
+
"class": "search-container",
|
2651
|
+
"style": {
|
2652
|
+
maxHeight: maxHeight
|
2653
|
+
}
|
2654
|
+
}, [(0,external_vue_namespaceObject.createVNode)(selected, {
|
2655
|
+
"data": this.copyData,
|
2656
|
+
"conditions": this.localConditions,
|
2657
|
+
"selectedList": this.selectedList,
|
2658
|
+
"overflowIndex": this.overflowIndex,
|
2659
|
+
"getMenuList": this.getMenuList,
|
2660
|
+
"validateValues": this.validateValues,
|
2661
|
+
"valueBehavior": this.valueBehavior,
|
2662
|
+
"onDelete": this.handleDeleteSelected
|
2663
|
+
}, search_select_objectSpread({}, menuSlots)), (0,external_vue_namespaceObject.createVNode)("div", {
|
2664
|
+
"class": "search-container-input"
|
2665
|
+
}, [(0,external_vue_namespaceObject.createVNode)(input, {
|
2666
|
+
"ref": "inputRef",
|
2667
|
+
"data": this.copyData,
|
2668
|
+
"showInputBefore": !this.selectedList.length,
|
2669
|
+
"showCondition": showCondition,
|
2670
|
+
"conditions": this.localConditions,
|
2671
|
+
"placeholder": this.placeholder || this.t.pleaseSelect,
|
2672
|
+
"clickOutside": this.handleInputOutside,
|
2673
|
+
"getMenuList": this.getMenuList,
|
2674
|
+
"validateValues": this.validateValues,
|
2675
|
+
"valueBehavior": this.valueBehavior,
|
2676
|
+
"onAdd": this.handleAddSelected,
|
2677
|
+
"onDelete": this.handleDeleteSelected,
|
2678
|
+
"onFocus": this.handleInputFocus
|
2679
|
+
}, search_select_objectSpread({}, menuSlots))])]), (0,external_vue_namespaceObject.createVNode)("div", {
|
2680
|
+
"class": "search-nextfix"
|
2681
|
+
}, [this.clearable && !!this.selectedList.length && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, {
|
2682
|
+
"class": "search-clear",
|
2683
|
+
"onClick": this.handleClearAll
|
2684
|
+
}, null), this.$slots.append ? this.$slots.append() : (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Search, {
|
2685
|
+
"onClick": this.handleClickSearch,
|
2686
|
+
"class": "search-nextfix-icon ".concat(this.isFocus ? 'is-focus' : '')
|
2687
|
+
}, null)])]), !!this.validateStr.length && (0,external_vue_namespaceObject.createVNode)("div", {
|
2688
|
+
"class": this.resolveClassName('search-select-tips')
|
2689
|
+
}, [this.$slots.validate ? this.$slots.validate() : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.ExclamationCircleShape, {
|
2690
|
+
"class": "select-tips"
|
2691
|
+
}, null), this.validateStr || ''])])]);
|
2692
|
+
}
|
2693
|
+
}));
|
2694
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/index.ts
|
2695
|
+
/*
|
2696
|
+
* Tencent is pleased to support the open source community by making
|
2697
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
2698
|
+
*
|
2699
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
2700
|
+
*
|
2701
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2702
|
+
*
|
2703
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
2704
|
+
*
|
2705
|
+
* ---------------------------------------------------
|
2706
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
2707
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
2708
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
2709
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2710
|
+
*
|
2711
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
2712
|
+
* the Software.
|
2713
|
+
*
|
2714
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
2715
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
2716
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
2717
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2718
|
+
* IN THE SOFTWARE.
|
2719
|
+
*/
|
2720
|
+
|
2721
|
+
|
2722
|
+
var BkSearchSelect = (0,external_shared_namespaceObject.withInstall)(search_select);
|
2723
|
+
/* harmony default export */ const src = (BkSearchSelect);
|
2724
|
+
|
2725
|
+
})();
|
2726
|
+
|
2727
|
+
var __webpack_exports__BkSearchSelect = __webpack_exports__.r;
|
2728
|
+
var __webpack_exports__default = __webpack_exports__.Z;
|
2729
|
+
export { __webpack_exports__BkSearchSelect as BkSearchSelect, __webpack_exports__default as default };
|