bkui-vue 0.0.2-table-refactor.9 → 0.0.3-beta.2
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 +17178 -19445
- 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 +21 -0
- package/lib/config-provider/config-provider.variable.css +6 -2
- package/lib/config-provider/index.d.ts +28 -0
- package/lib/config-provider/index.js +365 -1
- package/lib/config-provider/token.d.ts +7 -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/grag-fill.d.ts +4 -0
- package/lib/icon/grag-fill.js +191 -0
- 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 +2 -0
- package/lib/icon/index.js +2452 -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 +479 -1
- package/lib/locale/lang/en.d.ts +7 -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 +14 -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/events.d.ts +10 -1
- package/lib/table/index.d.ts +96 -7
- package/lib/table/index.js +6655 -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-draggable.d.ts +17 -0
- 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 +15 -1
- package/lib/table/table.css +75 -59
- package/lib/table/table.d.ts +16 -1
- package/lib/table/table.less +52 -22
- package/lib/table/table.variable.css +81 -61
- package/lib/table/use-attributes.d.ts +6 -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 +779 -1
- package/lib/tag/index.d.ts +4 -21
- package/lib/tag/index.js +229 -1
- package/lib/tag/tag.css +14 -10
- package/lib/tag/tag.d.ts +2 -12
- package/lib/tag/tag.less +31 -27
- package/lib/tag/tag.variable.css +20 -12
- package/lib/tag-input/index.d.ts +3 -0
- package/lib/tag-input/index.js +1674 -1
- package/lib/tag-input/list-tag-render.d.ts +11 -0
- package/lib/tag-input/tag-input.d.ts +1 -0
- package/lib/tag-input/tag-input.variable.css +6 -2
- package/lib/time-picker/index.d.ts +9 -3
- package/lib/time-picker/index.js +71 -1
- package/lib/time-picker/time-picker.css +4 -3
- package/lib/time-picker/time-picker.less +5 -9
- package/lib/time-picker/time-picker.variable.css +10 -5
- package/lib/timeline/index.js +241 -1
- package/lib/timeline/timeline.variable.css +6 -2
- package/lib/transfer/index.js +673 -1
- package/lib/transfer/transfer.css +2 -2
- package/lib/transfer/transfer.less +2 -2
- package/lib/transfer/transfer.variable.css +8 -4
- package/lib/tree/index.d.ts +21 -33
- package/lib/tree/index.js +2584 -1
- package/lib/tree/props.d.ts +4 -8
- package/lib/tree/tree.css +13 -1
- package/lib/tree/tree.d.ts +15 -19
- package/lib/tree/tree.variable.css +19 -3
- package/lib/tree/use-empty.d.ts +1 -3
- package/lib/tree/util.d.ts +1 -0
- package/lib/upload/index.js +2874 -2
- package/lib/upload/upload.type.d.ts +1 -1
- package/lib/upload/upload.variable.css +6 -2
- package/lib/upload/use-file-handler.d.ts +2 -2
- package/lib/virtual-render/index.js +901 -1
- package/lib/virtual-render/use-fix-top.d.ts +18 -0
- package/lib/virtual-render/v-virtual-render.d.ts +6 -1
- package/lib/virtual-render/virtual-render.variable.css +6 -2
- package/package.json +17 -4
- package/lib/cascader/index.js.LICENSE.txt +0 -1
- package/lib/dialog/index.js.LICENSE.txt +0 -1
- package/lib/directives/index.js.LICENSE.txt +0 -14
- package/lib/info-box/index.js.LICENSE.txt +0 -1
- package/lib/input/index.js.LICENSE.txt +0 -1
- package/lib/message/index.js.LICENSE.txt +0 -6
- package/lib/process/index.js.LICENSE.txt +0 -1
- package/lib/search-select/index.js.LICENSE.txt +0 -1
- package/lib/select/index.js.LICENSE.txt +0 -1
- package/lib/sideslider/index.js.LICENSE.txt +0 -1
- package/lib/slider/index.js.LICENSE.txt +0 -1
- package/lib/steps/index.js.LICENSE.txt +0 -1
- package/lib/table/render.d.ts +0 -130
- package/lib/upload/index.js.LICENSE.txt +0 -1
- /package/lib/overflow-title/{overflow.css → overflow-title.css} +0 -0
- /package/lib/overflow-title/{overflow.less → overflow-title.less} +0 -0
- /package/lib/overflow-title/{overflow.variable.css → overflow-title.variable.css} +0 -0
package/lib/transfer/index.js
CHANGED
@@ -1 +1,673 @@
|
|
1
|
-
import*as e from"../shared";import*as t from"vue";import*as r from"../checkbox";import*as l from"../config-provider";import*as n from"../icon/";import*as a from"../input";var o={d:(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},u={};o.d(u,{Z:()=>b});const s=(c={PropTypes:()=>e.PropTypes,withInstall:()=>e.withInstall},i={},o.d(i,c),i);var c,i;function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,l=new Array(t);r<t;r++)l[r]=e[r];return l}function f(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const p=(e=>{var t={};return o.d(t,e),t})({Fragment:()=>t.Fragment,computed:()=>t.computed,createTextVNode:()=>t.createTextVNode,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,isVNode:()=>t.isVNode,ref:()=>t.ref,toRaw:()=>t.toRaw,toRefs:()=>t.toRefs,watch:()=>t.watch}),v=(e=>{var t={};return o.d(t,e),t})({BkCheckboxGroup:()=>r.BkCheckboxGroup,default:()=>r.default}),h=(e=>{var t={};return o.d(t,e),t})({useLocale:()=>l.useLocale,usePrefix:()=>l.usePrefix}),m=(e=>{var t={};return o.d(t,e),t})({AngleLeft:()=>n.AngleLeft,AngleRight:()=>n.AngleRight,ArrowsRight:()=>n.ArrowsRight,Error:()=>n.Error,Search:()=>n.Search,Transfer:()=>n.Transfer}),g=(e=>{var t={};return o.d(t,e),t})({default:()=>a.default});var y;!function(e){e.OBJECT_ARRAY="objectArray",e.BASE_ARRAY="baseArray",e.NOT_ARRAY="notArray"}(y||(y={}));var A={title:s.PropTypes.arrayOf(s.PropTypes.string).def([]),extCls:s.PropTypes.string.def(""),searchPlaceholder:s.PropTypes.string.def(""),settingKey:s.PropTypes.string.def("id"),displayKey:s.PropTypes.string.def("value"),sortKey:s.PropTypes.string.def("value"),showOverflowTips:s.PropTypes.bool.def(!1),searchable:s.PropTypes.bool.def(!1),sortable:s.PropTypes.bool.def(!1),sourceList:s.PropTypes.arrayOf(s.PropTypes.any).def([]),targetList:s.PropTypes.arrayOf(s.PropTypes.any).def([]),emptyContent:s.PropTypes.arrayOf(s.PropTypes.string).def([]),multiple:s.PropTypes.bool.def(!1)};const V=(0,p.defineComponent)({name:"Transfer",props:A,emits:["change","update:targetList"],setup:function(e,t){var r=t.emit,l=(0,h.useLocale)("transfer"),n=(0,p.ref)({source:!1,target:!1}),a=(0,p.ref)({source:[],target:[]}),o=(0,p.computed)((function(){return Array.isArray(e.sourceList)?e.sourceList.every((function(e){return e.toString().includes("[object Object]")}))?y.OBJECT_ARRAY:y.BASE_ARRAY:y.NOT_ARRAY})),u=(0,p.computed)((function(){return o.value===y.BASE_ARRAY?"value":e.settingKey})),s=(0,p.computed)((function(){return o.value===y.BASE_ARRAY?"value":e.displayKey})),c=(0,p.computed)((function(){return e.sortKey||s.value})),i=(0,p.computed)((function(){switch(o.value){case y.BASE_ARRAY:return f(new Set(e.sourceList)).map((function(e){return{value:e}}));case y.OBJECT_ARRAY:return f(e.sourceList);default:return[]}})),d=(0,p.toRefs)(e).targetList,v=function(e,t,r){var l=(0,p.ref)([]),n=(0,p.ref)([]),a=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(l.value=[],n.value=[]),e.value.forEach((function(e){var a=e[r.value];t.value.includes(a)?n.value.push(e):l.value.push(e)}))};return a(),(0,p.watch)((function(){return[e,t,r]}),(function(){a(!0)}),{deep:!0}),{selectList:l,selectedList:n}}(i,d,u),m=v.selectList,g=v.selectedList,A=function(e,t){var r=(0,p.ref)(""),l=(0,p.computed)((function(){return e.value.filter((function(e){var l=e[t.value];return!(l instanceof Object)&&l.toString().includes(r.value)}))}));return{selectSearchQuery:r,selectListSearch:l}}(m,s),V=A.selectSearchQuery,b=A.selectListSearch,N=(0,p.computed)((function(){return f(b.value).sort((function(e,t){return e[c.value]>t[c.value]?1:-1}))})),S=(0,p.computed)((function(){return f(g.value).sort((function(e,t){return e[c.value]>t[c.value]?1:-1}))}));(0,p.watch)((function(){return[m,g]}),(function(){e.multiple||L()}),{deep:!0});var C=function(e,t){var r=u.value;return e.some((function(e){return e[r]===t[r]}))&&t.disabled},L=function(){var e=m.value.map((function(e){return e[u.value]})),t=g.value.map((function(e){return e[u.value]}));r("update:targetList",t),r("change",o.value===y.BASE_ARRAY?e:m.value.map((function(e){return(0,p.toRaw)(e)})),o.value===y.BASE_ARRAY?t:g.value.map((function(e){return(0,p.toRaw)(e)})),t)},R=(0,h.usePrefix)().resolveClassName;return{selectSearchQuery:V,selectListSearch:b,selectedList:g,selectListSort:N,selectedListSort:S,settingCode:u,displayCode:s,allToRight:function(){m.value=f(i.value.filter((function(e){return C(m.value,e)}))),g.value=f(i.value.filter((function(e){return!C(m.value,e)}))),L()},allToLeft:function(){m.value=f(i.value.filter((function(e){return!C(g.value,e)}))),g.value=f(i.value.filter((function(e){return C(g.value,e)}))),L()},handleItemClick:function(e,t){var r;if(!e.disabled){var l=e[u.value],n=t?m:g,a=t?g:m,o=n.value.findIndex((function(e){return e[u.value]===l}));(r=a.value).push.apply(r,f(n.value.splice(o,1))),L()}},t:l,handleAllChecked:function(e,t){var r="source"===t?m:g;a.value[t]=e?r.value.map((function(e){return e[u.value]})):[]},multipleSelectAllValue:n,multipleSelectList:a,handleMultipleChange:function(e){var t,r="left"===e,l=r?m:g,n=r?g:m,o=a.value[r?"source":"target"],s=l.value.filter((function(e){return o.includes(e[u.value])}));l.value=l.value.filter((function(e){return!o.includes(e[u.value])})),(t=n.value).push.apply(t,f(s)),a.value[r?"source":"target"]=[],L()},handleItemChecked:function(e){var t="source"===e?m:g;n.value[e]=a.value[e].length===t.value.length},resolveClassName:R}},render:function(){var e=this,t=this.$props.multiple,r=this.sortable?this.selectListSort:this.selectListSearch,l=this.sortable?this.selectedListSort:this.selectedList,n=function(t){var n,a,o="left-header"===t,u=o?"source":"target",s="".concat(o?null!==(n=e.title[0])&&void 0!==n?n:e.t.sourceList:null!==(a=e.title[1])&&void 0!==a?a:e.t.targetList),c=o?!r.length:!l.length,i=!!e.multipleSelectList[u].length&&!e.multipleSelectAllValue[u],d=e.multipleSelectList[u].length;return e.$slots[t]?(0,p.createVNode)("div",{class:"slot-header"},[e.$slots[t]()]):(0,p.createVNode)("div",{class:"header"},[e.multiple?(0,p.createVNode)(v.default,{class:"header-checkbox",label:s,modelValue:e.multipleSelectAllValue[u],"onUpdate:modelValue":function(t){return e.multipleSelectAllValue[u]=t},indeterminate:i,onChange:function(t){return e.handleAllChecked(t,u)}},null):(0,p.createVNode)(p.Fragment,null,["".concat(s,"(").concat(o?r.length:l.length,")")]),e.multiple?(0,p.createVNode)("div",{class:"select-total-count"},[(0,p.createVNode)("span",{class:"select-count"},[d]),(0,p.createVNode)("span",{class:"count-delimiter"},[(0,p.createTextVNode)("/")]),(0,p.createVNode)("span",{class:"total-count"},[o?r.length:l.length])]):(0,p.createVNode)("span",{class:{"select-all":!0,disabled:c},onClick:function(){c||(o?e.allToRight():e.allToLeft())}},[o?e.t.selectAll:e.t.removeAll])])},a=function(r){var l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,p.createVNode)("div",{class:["item-content",{"is-disabled":r.disabled}]},[(0,p.createVNode)("span",{class:"content-text",title:r[e.displayCode]},[r[e.displayCode]]),!t&&(0,p.createVNode)("span",{class:"icon-wrapper"},[l?(0,p.createVNode)(m.ArrowsRight,{class:"".concat(e.resolveClassName("icon")," icon-move")},null):(0,p.createVNode)(m.Error,{class:"".concat(e.resolveClassName("icon")," icon-delete")},null)])])},o=function(n){var o,u,s="left"===n,c="left"===n?"source":"target",i=s?r:l,d=s?"source-option":"target-option",f=s?"left-empty-content":"right-empty-content",h=t?(0,p.createVNode)(v.BkCheckboxGroup,{class:"content is-flex",modelValue:e.multipleSelectList[c],"onUpdate:modelValue":function(t){return e.multipleSelectList[c]=t},onChange:function(){return e.handleItemChecked(c)}},"function"==typeof(u=o=i.map((function(t){var r,l,n;return(0,p.createVNode)("div",null,[(0,p.createVNode)(v.default,{class:"checkbox-item",label:t[e.settingCode]},{default:function(){return[null!==(n=null===(l=(r=e.$slots)[d])||void 0===l?void 0:l.call(r,t))&&void 0!==n?n:a(t,s)]}})])})))||"[object Object]"===Object.prototype.toString.call(u)&&!(0,p.isVNode)(u)?o:{default:function(){return[o]}}):(0,p.createVNode)("ul",{class:["content",e.searchable&&s?"is-search":""]},[i.map((function(t){var r,l,n;return(0,p.createVNode)("li",{key:t[e.settingCode],class:[e.$slots[d]?"custom-item":""],onClick:function(){return e.handleItemClick(t,s)}},[null!==(n=null===(l=(r=e.$slots)[d])||void 0===l?void 0:l.call(r,t))&&void 0!==n?n:a(t,s)])}))]);return i.length?h:function(t){var r,l="left-empty-content"===t,n=null!==(r=l?e.emptyContent[0]:e.emptyContent[1])&&void 0!==r?r:l?e.t.noData:e.t.noSelected;return e.$slots[t]?(0,p.createVNode)("div",null,[e.$slots[t]()]):(0,p.createVNode)("div",{class:"empty"},[n])}(f)};return(0,p.createVNode)("div",{class:["".concat(this.resolveClassName("transfer")),this.extCls]},[(0,p.createVNode)("div",{class:"source-list"},[n("left-header"),this.searchable&&(0,p.createVNode)(g.default,{modelValue:e.selectSearchQuery,"onUpdate:modelValue":function(t){return e.selectSearchQuery=t},class:"transfer-search-input",clearable:!0,placeholder:this.searchPlaceholder||this.t.search},{prefix:function(){return(0,p.createVNode)(m.Search,{class:"icon-search"},null)}}),o("left")]),t?(0,p.createVNode)("div",{class:"transfer-button-group"},[(0,p.createVNode)("div",{class:["transfer-button",{disabled:!this.multipleSelectList.source.length}],onClick:function(){return e.handleMultipleChange("left")}},[(0,p.createVNode)(m.AngleRight,null,null)]),(0,p.createVNode)("div",{class:["transfer-button",{disabled:!this.multipleSelectList.target.length}],onClick:function(){return e.handleMultipleChange("right")}},[(0,p.createVNode)(m.AngleLeft,null,null)])]):(0,p.createVNode)(m.Transfer,{class:"transfer"},null),(0,p.createVNode)("div",{class:"target-list"},[n("right-header"),o("right")])])}}),b=(0,s.withInstall)(V);var N=u.Z;export{N 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__checkbox_a57bcb84__ from "../checkbox";
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__icon__2ba2075d__ from "../icon/";
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__input_752b0149__ from "../input";
|
7
|
+
/******/ // The require scope
|
8
|
+
/******/ var __webpack_require__ = {};
|
9
|
+
/******/
|
10
|
+
/************************************************************************/
|
11
|
+
/******/ /* webpack/runtime/define property getters */
|
12
|
+
/******/ (() => {
|
13
|
+
/******/ // define getter functions for harmony exports
|
14
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
15
|
+
/******/ for(var key in definition) {
|
16
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
17
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
18
|
+
/******/ }
|
19
|
+
/******/ }
|
20
|
+
/******/ };
|
21
|
+
/******/ })();
|
22
|
+
/******/
|
23
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
24
|
+
/******/ (() => {
|
25
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
26
|
+
/******/ })();
|
27
|
+
/******/
|
28
|
+
/************************************************************************/
|
29
|
+
var __webpack_exports__ = {};
|
30
|
+
|
31
|
+
// EXPORTS
|
32
|
+
__webpack_require__.d(__webpack_exports__, {
|
33
|
+
Z: () => (/* binding */ src)
|
34
|
+
});
|
35
|
+
|
36
|
+
;// CONCATENATED MODULE: external "../shared"
|
37
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
38
|
+
var y = x => () => x
|
39
|
+
const external_shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
|
40
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
41
|
+
function _arrayLikeToArray(arr, len) {
|
42
|
+
if (len == null || len > arr.length) len = arr.length;
|
43
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
44
|
+
return arr2;
|
45
|
+
}
|
46
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
47
|
+
|
48
|
+
function _arrayWithoutHoles(arr) {
|
49
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
50
|
+
}
|
51
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
52
|
+
function _iterableToArray(iter) {
|
53
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
54
|
+
}
|
55
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
56
|
+
|
57
|
+
function _unsupportedIterableToArray(o, minLen) {
|
58
|
+
if (!o) return;
|
59
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
60
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
61
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
62
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
63
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
64
|
+
}
|
65
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
66
|
+
function _nonIterableSpread() {
|
67
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
68
|
+
}
|
69
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
function _toConsumableArray(arr) {
|
75
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
76
|
+
}
|
77
|
+
;// CONCATENATED MODULE: external "vue"
|
78
|
+
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
79
|
+
var external_vue_y = x => () => x
|
80
|
+
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, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
81
|
+
;// CONCATENATED MODULE: external "../checkbox"
|
82
|
+
var external_checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
83
|
+
var external_checkbox_y = x => () => x
|
84
|
+
const external_checkbox_namespaceObject = external_checkbox_x({ ["BkCheckboxGroup"]: () => __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__.BkCheckboxGroup, ["default"]: () => __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__["default"] });
|
85
|
+
;// CONCATENATED MODULE: external "../config-provider"
|
86
|
+
var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
87
|
+
var external_config_provider_y = x => () => x
|
88
|
+
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 });
|
89
|
+
;// CONCATENATED MODULE: external "../icon/"
|
90
|
+
var _x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
91
|
+
var _y = x => () => x
|
92
|
+
const _namespaceObject = _x({ ["AngleLeft"]: () => __WEBPACK_EXTERNAL_MODULE__icon__2ba2075d__.AngleLeft, ["AngleRight"]: () => __WEBPACK_EXTERNAL_MODULE__icon__2ba2075d__.AngleRight, ["ArrowsRight"]: () => __WEBPACK_EXTERNAL_MODULE__icon__2ba2075d__.ArrowsRight, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon__2ba2075d__.Error, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE__icon__2ba2075d__.Search, ["Transfer"]: () => __WEBPACK_EXTERNAL_MODULE__icon__2ba2075d__.Transfer });
|
93
|
+
;// CONCATENATED MODULE: external "../input"
|
94
|
+
var external_input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
95
|
+
var external_input_y = x => () => x
|
96
|
+
const external_input_namespaceObject = external_input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__input_752b0149__["default"] });
|
97
|
+
;// CONCATENATED MODULE: ../../packages/transfer/src/const.ts
|
98
|
+
/*
|
99
|
+
* Tencent is pleased to support the open source community by making
|
100
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
101
|
+
*
|
102
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
103
|
+
*
|
104
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
105
|
+
*
|
106
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
107
|
+
*
|
108
|
+
* ---------------------------------------------------
|
109
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
110
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
111
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
112
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
113
|
+
*
|
114
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
115
|
+
* the Software.
|
116
|
+
*
|
117
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
118
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
119
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
120
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
121
|
+
* IN THE SOFTWARE.
|
122
|
+
*/
|
123
|
+
// 非数组,基础数据数组,对象数组
|
124
|
+
var ArrayType;
|
125
|
+
(function (ArrayType) {
|
126
|
+
ArrayType["OBJECT_ARRAY"] = "objectArray";
|
127
|
+
ArrayType["BASE_ARRAY"] = "baseArray";
|
128
|
+
ArrayType["NOT_ARRAY"] = "notArray";
|
129
|
+
})(ArrayType || (ArrayType = {}));
|
130
|
+
;// CONCATENATED MODULE: ../../packages/transfer/src/props.ts
|
131
|
+
/*
|
132
|
+
* Tencent is pleased to support the open source community by making
|
133
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
134
|
+
*
|
135
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
136
|
+
*
|
137
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
138
|
+
*
|
139
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
140
|
+
*
|
141
|
+
* ---------------------------------------------------
|
142
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
143
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
144
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
145
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
146
|
+
*
|
147
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
148
|
+
* the Software.
|
149
|
+
*
|
150
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
151
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
152
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
153
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
154
|
+
* IN THE SOFTWARE.
|
155
|
+
*/
|
156
|
+
|
157
|
+
var transferProps = {
|
158
|
+
// 顶部title(title[0]: 左侧title,title[1]: 右侧title,)
|
159
|
+
title: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.string).def([]),
|
160
|
+
// 自定义class
|
161
|
+
extCls: external_shared_namespaceObject.PropTypes.string.def(''),
|
162
|
+
// 搜索框 placeholder
|
163
|
+
searchPlaceholder: external_shared_namespaceObject.PropTypes.string.def(''),
|
164
|
+
// 唯一key值
|
165
|
+
settingKey: external_shared_namespaceObject.PropTypes.string.def('id'),
|
166
|
+
// 循环list时,显示字段的key值(当list为普通数组时可不传传了也无效)
|
167
|
+
displayKey: external_shared_namespaceObject.PropTypes.string.def('value'),
|
168
|
+
// 排序所依据的key(当list为普通数组时可不传,默认按照index值排序)
|
169
|
+
sortKey: external_shared_namespaceObject.PropTypes.string.def('value'),
|
170
|
+
// 内容超出是否显示tooltip
|
171
|
+
showOverflowTips: external_shared_namespaceObject.PropTypes.bool.def(false),
|
172
|
+
// 是否开启搜索
|
173
|
+
searchable: external_shared_namespaceObject.PropTypes.bool.def(false),
|
174
|
+
// 是否开启排序功能
|
175
|
+
sortable: external_shared_namespaceObject.PropTypes.bool.def(false),
|
176
|
+
// 穿梭框数据源(支持普通数组)
|
177
|
+
sourceList: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.any).def([]),
|
178
|
+
// 默认已选择的数据源
|
179
|
+
targetList: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.any).def([]),
|
180
|
+
// 穿梭框无数据时提示文案
|
181
|
+
emptyContent: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.string).def([]),
|
182
|
+
// 支持checkbox多选模式
|
183
|
+
multiple: external_shared_namespaceObject.PropTypes.bool.def(false)
|
184
|
+
};
|
185
|
+
;// CONCATENATED MODULE: ../../packages/transfer/src/transfer.tsx
|
186
|
+
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Tencent is pleased to support the open source community by making
|
190
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
191
|
+
*
|
192
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
193
|
+
*
|
194
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
195
|
+
*
|
196
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
197
|
+
*
|
198
|
+
* ---------------------------------------------------
|
199
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
200
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
201
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
202
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
203
|
+
*
|
204
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
205
|
+
* the Software.
|
206
|
+
*
|
207
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
208
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
209
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
210
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
211
|
+
* IN THE SOFTWARE.
|
212
|
+
*/
|
213
|
+
/* eslint-disable arrow-body-style */
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
// 生成数据
|
222
|
+
function _isSlot(s) {
|
223
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
224
|
+
}
|
225
|
+
function useTransferData(sourceData, targetList, settingCode) {
|
226
|
+
var selectList = (0,external_vue_namespaceObject.ref)([]);
|
227
|
+
var selectedList = (0,external_vue_namespaceObject.ref)([]);
|
228
|
+
var transformData = function transformData() {
|
229
|
+
var isChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
230
|
+
if (isChange) {
|
231
|
+
// watch监听时需要清空重新按照targetList赋值
|
232
|
+
selectList.value = [];
|
233
|
+
selectedList.value = [];
|
234
|
+
}
|
235
|
+
sourceData.value.forEach(function (s) {
|
236
|
+
var keyId = s[settingCode.value];
|
237
|
+
if (targetList.value.includes(keyId)) {
|
238
|
+
selectedList.value.push(s);
|
239
|
+
} else {
|
240
|
+
selectList.value.push(s);
|
241
|
+
}
|
242
|
+
});
|
243
|
+
};
|
244
|
+
transformData();
|
245
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
246
|
+
return [sourceData, targetList, settingCode];
|
247
|
+
}, function () {
|
248
|
+
transformData(true);
|
249
|
+
}, {
|
250
|
+
deep: true
|
251
|
+
});
|
252
|
+
return {
|
253
|
+
selectList: selectList,
|
254
|
+
selectedList: selectedList
|
255
|
+
};
|
256
|
+
}
|
257
|
+
// 搜索
|
258
|
+
function useSelectListSearch(selectList, displayCode) {
|
259
|
+
var selectSearchQuery = (0,external_vue_namespaceObject.ref)('');
|
260
|
+
var selectListSearch = (0,external_vue_namespaceObject.computed)(function () {
|
261
|
+
return selectList.value.filter(function (select) {
|
262
|
+
var val = select[displayCode.value];
|
263
|
+
if (val instanceof Object) return false;
|
264
|
+
return val.toString().includes(selectSearchQuery.value);
|
265
|
+
});
|
266
|
+
});
|
267
|
+
return {
|
268
|
+
selectSearchQuery: selectSearchQuery,
|
269
|
+
selectListSearch: selectListSearch
|
270
|
+
};
|
271
|
+
}
|
272
|
+
/* harmony default export */ const transfer = ((0,external_vue_namespaceObject.defineComponent)({
|
273
|
+
name: 'Transfer',
|
274
|
+
props: transferProps,
|
275
|
+
emits: ['change', 'update:targetList'],
|
276
|
+
setup: function setup(props, _ref) {
|
277
|
+
var emit = _ref.emit;
|
278
|
+
var t = (0,external_config_provider_namespaceObject.useLocale)('transfer');
|
279
|
+
var multipleSelectAllValue = (0,external_vue_namespaceObject.ref)({
|
280
|
+
source: false,
|
281
|
+
target: false
|
282
|
+
});
|
283
|
+
var multipleSelectList = (0,external_vue_namespaceObject.ref)({
|
284
|
+
source: [],
|
285
|
+
target: []
|
286
|
+
});
|
287
|
+
// 区分数据是基础数据数组(false)还是对象数组(true)
|
288
|
+
var sourceListType = (0,external_vue_namespaceObject.computed)(function () {
|
289
|
+
if (Array.isArray(props.sourceList)) {
|
290
|
+
var isObjectArray = props.sourceList.every(function (s) {
|
291
|
+
return s.toString().includes('[object Object]');
|
292
|
+
});
|
293
|
+
return isObjectArray ? ArrayType.OBJECT_ARRAY : ArrayType.BASE_ARRAY;
|
294
|
+
}
|
295
|
+
return ArrayType.NOT_ARRAY;
|
296
|
+
});
|
297
|
+
var settingCode = (0,external_vue_namespaceObject.computed)(function () {
|
298
|
+
return sourceListType.value === ArrayType.BASE_ARRAY ? 'value' : props.settingKey;
|
299
|
+
});
|
300
|
+
var displayCode = (0,external_vue_namespaceObject.computed)(function () {
|
301
|
+
return sourceListType.value === ArrayType.BASE_ARRAY ? 'value' : props.displayKey;
|
302
|
+
});
|
303
|
+
var sortCode = (0,external_vue_namespaceObject.computed)(function () {
|
304
|
+
return props.sortKey || displayCode.value;
|
305
|
+
});
|
306
|
+
// 处理为统一格式
|
307
|
+
var sourceData = (0,external_vue_namespaceObject.computed)(function () {
|
308
|
+
switch (sourceListType.value) {
|
309
|
+
case ArrayType.BASE_ARRAY:
|
310
|
+
// 封装为对象
|
311
|
+
return _toConsumableArray(new Set(props.sourceList)).map(function (s) {
|
312
|
+
return {
|
313
|
+
value: s
|
314
|
+
};
|
315
|
+
});
|
316
|
+
case ArrayType.OBJECT_ARRAY:
|
317
|
+
return _toConsumableArray(props.sourceList);
|
318
|
+
default:
|
319
|
+
return [];
|
320
|
+
}
|
321
|
+
});
|
322
|
+
// 获取左右列表
|
323
|
+
var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
|
324
|
+
targetList = _toRefs.targetList;
|
325
|
+
var _useTransferData = useTransferData(sourceData, targetList, settingCode),
|
326
|
+
selectList = _useTransferData.selectList,
|
327
|
+
selectedList = _useTransferData.selectedList;
|
328
|
+
// 使用搜索
|
329
|
+
var _useSelectListSearch = useSelectListSearch(selectList, displayCode),
|
330
|
+
selectSearchQuery = _useSelectListSearch.selectSearchQuery,
|
331
|
+
selectListSearch = _useSelectListSearch.selectListSearch;
|
332
|
+
var selectListSort = (0,external_vue_namespaceObject.computed)(function () {
|
333
|
+
return _toConsumableArray(selectListSearch.value).sort(function (a, b) {
|
334
|
+
var va = a[sortCode.value];
|
335
|
+
var vb = b[sortCode.value];
|
336
|
+
return va > vb ? 1 : -1;
|
337
|
+
});
|
338
|
+
});
|
339
|
+
var selectedListSort = (0,external_vue_namespaceObject.computed)(function () {
|
340
|
+
return _toConsumableArray(selectedList.value).sort(function (a, b) {
|
341
|
+
var va = a[sortCode.value];
|
342
|
+
var vb = b[sortCode.value];
|
343
|
+
return va > vb ? 1 : -1;
|
344
|
+
});
|
345
|
+
});
|
346
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
347
|
+
return [selectList, selectedList];
|
348
|
+
}, function () {
|
349
|
+
if (!props.multiple) {
|
350
|
+
handleEmitUpdateTargetList();
|
351
|
+
}
|
352
|
+
}, {
|
353
|
+
deep: true
|
354
|
+
});
|
355
|
+
/** 全选、清空操作过滤禁用选项 */
|
356
|
+
var handleCheckAllItemSelect = function handleCheckAllItemSelect(list, source) {
|
357
|
+
var itemKey = settingCode.value;
|
358
|
+
return list.some(function (val) {
|
359
|
+
return val[itemKey] === source[itemKey];
|
360
|
+
}) && source.disabled;
|
361
|
+
};
|
362
|
+
/** 全选 */
|
363
|
+
var allToRight = function allToRight() {
|
364
|
+
// 清空源列表 除源列表禁用选项
|
365
|
+
selectList.value = _toConsumableArray(sourceData.value.filter(function (source) {
|
366
|
+
return handleCheckAllItemSelect(selectList.value, source);
|
367
|
+
}));
|
368
|
+
// 填满目标列表 除源列表禁用选项
|
369
|
+
selectedList.value = _toConsumableArray(sourceData.value.filter(function (source) {
|
370
|
+
return !handleCheckAllItemSelect(selectList.value, source);
|
371
|
+
}));
|
372
|
+
// 全选搜索结果
|
373
|
+
// selectedList.value.push(...selectListSearch.value)
|
374
|
+
handleEmitUpdateTargetList();
|
375
|
+
};
|
376
|
+
/** 移除 */
|
377
|
+
var allToLeft = function allToLeft() {
|
378
|
+
// 填满源列表 除目标列表禁用选项
|
379
|
+
selectList.value = _toConsumableArray(sourceData.value.filter(function (source) {
|
380
|
+
return !handleCheckAllItemSelect(selectedList.value, source);
|
381
|
+
}));
|
382
|
+
// 清空目标列表 除目标列表禁用选项
|
383
|
+
selectedList.value = _toConsumableArray(sourceData.value.filter(function (source) {
|
384
|
+
return handleCheckAllItemSelect(selectedList.value, source);
|
385
|
+
}));
|
386
|
+
handleEmitUpdateTargetList();
|
387
|
+
};
|
388
|
+
/**
|
389
|
+
* @desc 列表项 click 事件
|
390
|
+
* @param { string } itemKey settingCode值
|
391
|
+
* @param { boolean } isLeft 左右面板
|
392
|
+
*/
|
393
|
+
var handleItemClick = function handleItemClick(item, isLeft) {
|
394
|
+
var _to$value;
|
395
|
+
if (item.disabled) return;
|
396
|
+
var itemKey = item[settingCode.value];
|
397
|
+
var from = isLeft ? selectList : selectedList;
|
398
|
+
var to = isLeft ? selectedList : selectList;
|
399
|
+
var index = from.value.findIndex(function (item) {
|
400
|
+
return item[settingCode.value] === itemKey;
|
401
|
+
});
|
402
|
+
(_to$value = to.value).push.apply(_to$value, _toConsumableArray(from.value.splice(index, 1)));
|
403
|
+
handleEmitUpdateTargetList();
|
404
|
+
};
|
405
|
+
// emit事件,只有用户交互才会触发,如果是程序修改不会触发
|
406
|
+
var handleEmitUpdateTargetList = function handleEmitUpdateTargetList() {
|
407
|
+
var restList = selectList.value.map(function (item) {
|
408
|
+
return item[settingCode.value];
|
409
|
+
});
|
410
|
+
var targetList = selectedList.value.map(function (item) {
|
411
|
+
return item[settingCode.value];
|
412
|
+
});
|
413
|
+
emit('update:targetList', targetList);
|
414
|
+
emit('change', sourceListType.value === ArrayType.BASE_ARRAY ? restList : selectList.value.map(function (v) {
|
415
|
+
return (0,external_vue_namespaceObject.toRaw)(v);
|
416
|
+
}), sourceListType.value === ArrayType.BASE_ARRAY ? targetList : selectedList.value.map(function (v) {
|
417
|
+
return (0,external_vue_namespaceObject.toRaw)(v);
|
418
|
+
}), targetList);
|
419
|
+
};
|
420
|
+
/**
|
421
|
+
* @desc checkboxGroup 变化事件
|
422
|
+
* @param { string } dirct 左右面板
|
423
|
+
*/
|
424
|
+
var handleItemChecked = function handleItemChecked(dirct) {
|
425
|
+
var target = dirct === 'source' ? selectList : selectedList;
|
426
|
+
multipleSelectAllValue.value[dirct] = multipleSelectList.value[dirct].length === target.value.length;
|
427
|
+
};
|
428
|
+
/**
|
429
|
+
* @desc checkbox 全选
|
430
|
+
* @param { boolean } value checked
|
431
|
+
* @param { string } dirct 左右面板
|
432
|
+
*/
|
433
|
+
var handleAllChecked = function handleAllChecked(value, dirct) {
|
434
|
+
var target = dirct === 'source' ? selectList : selectedList;
|
435
|
+
multipleSelectList.value[dirct] = value ? target.value.map(function (item) {
|
436
|
+
return item[settingCode.value];
|
437
|
+
}) : [];
|
438
|
+
};
|
439
|
+
/**
|
440
|
+
* @desc 多选后点击穿梭事件
|
441
|
+
* @param { string } dirct 左右面板
|
442
|
+
*/
|
443
|
+
var handleMultipleChange = function handleMultipleChange(dirct) {
|
444
|
+
var _to$value2;
|
445
|
+
var isLeft = dirct === 'left';
|
446
|
+
var from = isLeft ? selectList : selectedList;
|
447
|
+
var to = isLeft ? selectedList : selectList;
|
448
|
+
var checkeds = multipleSelectList.value[isLeft ? 'source' : 'target'];
|
449
|
+
var items = from.value.filter(function (val) {
|
450
|
+
return checkeds.includes(val[settingCode.value]);
|
451
|
+
});
|
452
|
+
from.value = from.value.filter(function (val) {
|
453
|
+
return !checkeds.includes(val[settingCode.value]);
|
454
|
+
});
|
455
|
+
(_to$value2 = to.value).push.apply(_to$value2, _toConsumableArray(items));
|
456
|
+
multipleSelectList.value[isLeft ? 'source' : 'target'] = [];
|
457
|
+
handleEmitUpdateTargetList();
|
458
|
+
};
|
459
|
+
var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
|
460
|
+
resolveClassName = _usePrefix.resolveClassName;
|
461
|
+
return {
|
462
|
+
selectSearchQuery: selectSearchQuery,
|
463
|
+
selectListSearch: selectListSearch,
|
464
|
+
selectedList: selectedList,
|
465
|
+
selectListSort: selectListSort,
|
466
|
+
selectedListSort: selectedListSort,
|
467
|
+
settingCode: settingCode,
|
468
|
+
displayCode: displayCode,
|
469
|
+
allToRight: allToRight,
|
470
|
+
allToLeft: allToLeft,
|
471
|
+
handleItemClick: handleItemClick,
|
472
|
+
t: t,
|
473
|
+
handleAllChecked: handleAllChecked,
|
474
|
+
multipleSelectAllValue: multipleSelectAllValue,
|
475
|
+
multipleSelectList: multipleSelectList,
|
476
|
+
handleMultipleChange: handleMultipleChange,
|
477
|
+
handleItemChecked: handleItemChecked,
|
478
|
+
resolveClassName: resolveClassName
|
479
|
+
};
|
480
|
+
},
|
481
|
+
render: function render() {
|
482
|
+
var _this = this;
|
483
|
+
var multiple = this.$props.multiple;
|
484
|
+
var leftList = this.sortable ? this.selectListSort : this.selectListSearch;
|
485
|
+
var rightList = this.sortable ? this.selectedListSort : this.selectedList;
|
486
|
+
var getHeaderHtml = function getHeaderHtml(dirct) {
|
487
|
+
var _this$title$, _this$title$2;
|
488
|
+
var isLeft = dirct === 'left-header';
|
489
|
+
var selectField = isLeft ? 'source' : 'target';
|
490
|
+
var titleText = isLeft ? "".concat((_this$title$ = _this.title[0]) !== null && _this$title$ !== void 0 ? _this$title$ : _this.t.sourceList) : "".concat((_this$title$2 = _this.title[1]) !== null && _this$title$2 !== void 0 ? _this$title$2 : _this.t.targetList);
|
491
|
+
var isDisabled = isLeft ? !leftList.length : !rightList.length;
|
492
|
+
// eslint-disable-next-line max-len
|
493
|
+
var isIndeterminate = !!_this.multipleSelectList[selectField].length && !_this.multipleSelectAllValue[selectField];
|
494
|
+
var selectCount = _this.multipleSelectList[selectField].length;
|
495
|
+
var headerClick = function headerClick() {
|
496
|
+
if (isDisabled) return;
|
497
|
+
isLeft ? _this.allToRight() : _this.allToLeft();
|
498
|
+
};
|
499
|
+
return _this.$slots[dirct] ? (0,external_vue_namespaceObject.createVNode)("div", {
|
500
|
+
"class": "slot-header"
|
501
|
+
}, [_this.$slots[dirct]()]) : (0,external_vue_namespaceObject.createVNode)("div", {
|
502
|
+
"class": "header"
|
503
|
+
}, [_this.multiple ? (0,external_vue_namespaceObject.createVNode)(external_checkbox_namespaceObject["default"], {
|
504
|
+
"class": "header-checkbox",
|
505
|
+
"label": titleText,
|
506
|
+
"modelValue": _this.multipleSelectAllValue[selectField],
|
507
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
508
|
+
return _this.multipleSelectAllValue[selectField] = $event;
|
509
|
+
},
|
510
|
+
"indeterminate": isIndeterminate,
|
511
|
+
"onChange": function onChange(val) {
|
512
|
+
return _this.handleAllChecked(val, selectField);
|
513
|
+
}
|
514
|
+
}, null) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, ["".concat(titleText, "\uFF08").concat(isLeft ? leftList.length : rightList.length, "\uFF09")]), _this.multiple ? (0,external_vue_namespaceObject.createVNode)("div", {
|
515
|
+
"class": "select-total-count"
|
516
|
+
}, [(0,external_vue_namespaceObject.createVNode)("span", {
|
517
|
+
"class": "select-count"
|
518
|
+
}, [selectCount]), (0,external_vue_namespaceObject.createVNode)("span", {
|
519
|
+
"class": "count-delimiter"
|
520
|
+
}, [(0,external_vue_namespaceObject.createTextVNode)("/")]), (0,external_vue_namespaceObject.createVNode)("span", {
|
521
|
+
"class": "total-count"
|
522
|
+
}, [isLeft ? leftList.length : rightList.length])]) : (0,external_vue_namespaceObject.createVNode)("span", {
|
523
|
+
"class": {
|
524
|
+
'select-all': true,
|
525
|
+
disabled: isDisabled
|
526
|
+
},
|
527
|
+
"onClick": function onClick() {
|
528
|
+
return headerClick();
|
529
|
+
}
|
530
|
+
}, [isLeft ? _this.t.selectAll : _this.t.removeAll])]);
|
531
|
+
};
|
532
|
+
var getEmptyHtml = function getEmptyHtml(dirct) {
|
533
|
+
var _ref2;
|
534
|
+
var isLeft = dirct === 'left-empty-content';
|
535
|
+
var emptyText = (_ref2 = isLeft ? _this.emptyContent[0] : _this.emptyContent[1]) !== null && _ref2 !== void 0 ? _ref2 : isLeft ? _this.t.noData : _this.t.noSelected;
|
536
|
+
return _this.$slots[dirct] ? (0,external_vue_namespaceObject.createVNode)("div", null, [_this.$slots[dirct]()]) : (0,external_vue_namespaceObject.createVNode)("div", {
|
537
|
+
"class": "empty"
|
538
|
+
}, [emptyText]);
|
539
|
+
};
|
540
|
+
var getDefaultListHtml = function getDefaultListHtml(item) {
|
541
|
+
var isLeft = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
542
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
543
|
+
"class": ['item-content', {
|
544
|
+
'is-disabled': item.disabled
|
545
|
+
}]
|
546
|
+
}, [(0,external_vue_namespaceObject.createVNode)("span", {
|
547
|
+
"class": "content-text",
|
548
|
+
"title": item[_this.displayCode]
|
549
|
+
}, [item[_this.displayCode]]), !multiple && (0,external_vue_namespaceObject.createVNode)("span", {
|
550
|
+
"class": "icon-wrapper"
|
551
|
+
}, [isLeft ? (0,external_vue_namespaceObject.createVNode)(_namespaceObject.ArrowsRight, {
|
552
|
+
"class": "".concat(_this.resolveClassName('icon'), " icon-move")
|
553
|
+
}, null) : (0,external_vue_namespaceObject.createVNode)(_namespaceObject.Error, {
|
554
|
+
"class": "".concat(_this.resolveClassName('icon'), " icon-delete")
|
555
|
+
}, null)])]);
|
556
|
+
};
|
557
|
+
var getListContentHtml = function getListContentHtml(dirct) {
|
558
|
+
var _slot;
|
559
|
+
var isLeft = dirct === 'left';
|
560
|
+
var selectField = dirct === 'left' ? 'source' : 'target';
|
561
|
+
var list = isLeft ? leftList : rightList;
|
562
|
+
var slotName = isLeft ? 'source-option' : 'target-option';
|
563
|
+
var emptySlotName = isLeft ? 'left-empty-content' : 'right-empty-content';
|
564
|
+
var contentMode = multiple ? (0,external_vue_namespaceObject.createVNode)(external_checkbox_namespaceObject.BkCheckboxGroup, {
|
565
|
+
"class": "content is-flex",
|
566
|
+
"modelValue": _this.multipleSelectList[selectField],
|
567
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
568
|
+
return _this.multipleSelectList[selectField] = $event;
|
569
|
+
},
|
570
|
+
"onChange": function onChange() {
|
571
|
+
return _this.handleItemChecked(selectField);
|
572
|
+
}
|
573
|
+
}, _isSlot(_slot = list.map(function (item) {
|
574
|
+
var _this$$slots$slotName, _this$$slots$slotName2, _this$$slots;
|
575
|
+
return (0,external_vue_namespaceObject.createVNode)("div", null, [(0,external_vue_namespaceObject.createVNode)(external_checkbox_namespaceObject["default"], {
|
576
|
+
"class": "checkbox-item",
|
577
|
+
"label": item[_this.settingCode]
|
578
|
+
}, {
|
579
|
+
"default": function _default() {
|
580
|
+
return [(_this$$slots$slotName = (_this$$slots$slotName2 = (_this$$slots = _this.$slots)[slotName]) === null || _this$$slots$slotName2 === void 0 ? void 0 : _this$$slots$slotName2.call(_this$$slots, item)) !== null && _this$$slots$slotName !== void 0 ? _this$$slots$slotName : getDefaultListHtml(item, isLeft)];
|
581
|
+
}
|
582
|
+
})]);
|
583
|
+
})) ? _slot : {
|
584
|
+
"default": function _default() {
|
585
|
+
return [_slot];
|
586
|
+
}
|
587
|
+
}) : (0,external_vue_namespaceObject.createVNode)("ul", {
|
588
|
+
"class": ['content', _this.searchable && isLeft ? 'is-search' : '']
|
589
|
+
}, [list.map(function (item) {
|
590
|
+
var _this$$slots$slotName3, _this$$slots$slotName4, _this$$slots2;
|
591
|
+
return (0,external_vue_namespaceObject.createVNode)("li", {
|
592
|
+
"key": item[_this.settingCode],
|
593
|
+
"class": [_this.$slots[slotName] ? 'custom-item' : ''],
|
594
|
+
"onClick": function onClick() {
|
595
|
+
return _this.handleItemClick(item, isLeft);
|
596
|
+
}
|
597
|
+
}, [(_this$$slots$slotName3 = (_this$$slots$slotName4 = (_this$$slots2 = _this.$slots)[slotName]) === null || _this$$slots$slotName4 === void 0 ? void 0 : _this$$slots$slotName4.call(_this$$slots2, item)) !== null && _this$$slots$slotName3 !== void 0 ? _this$$slots$slotName3 : getDefaultListHtml(item, isLeft)]);
|
598
|
+
})]);
|
599
|
+
return list.length ? contentMode : getEmptyHtml(emptySlotName);
|
600
|
+
};
|
601
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
602
|
+
"class": ["".concat(this.resolveClassName('transfer')), this.extCls]
|
603
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
604
|
+
"class": "source-list"
|
605
|
+
}, [getHeaderHtml('left-header'), this.searchable && (0,external_vue_namespaceObject.createVNode)(external_input_namespaceObject["default"], {
|
606
|
+
"modelValue": _this.selectSearchQuery,
|
607
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
608
|
+
return _this.selectSearchQuery = $event;
|
609
|
+
},
|
610
|
+
"class": "transfer-search-input",
|
611
|
+
"clearable": true,
|
612
|
+
"placeholder": this.searchPlaceholder || this.t.search
|
613
|
+
}, {
|
614
|
+
prefix: function prefix() {
|
615
|
+
return (0,external_vue_namespaceObject.createVNode)(_namespaceObject.Search, {
|
616
|
+
"class": "icon-search"
|
617
|
+
}, null);
|
618
|
+
}
|
619
|
+
}), getListContentHtml('left')]), multiple ? (0,external_vue_namespaceObject.createVNode)("div", {
|
620
|
+
"class": "transfer-button-group"
|
621
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
622
|
+
"class": ['transfer-button', {
|
623
|
+
disabled: !this.multipleSelectList.source.length
|
624
|
+
}],
|
625
|
+
"onClick": function onClick() {
|
626
|
+
return _this.handleMultipleChange('left');
|
627
|
+
}
|
628
|
+
}, [(0,external_vue_namespaceObject.createVNode)(_namespaceObject.AngleRight, null, null)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
629
|
+
"class": ['transfer-button', {
|
630
|
+
disabled: !this.multipleSelectList.target.length
|
631
|
+
}],
|
632
|
+
"onClick": function onClick() {
|
633
|
+
return _this.handleMultipleChange('right');
|
634
|
+
}
|
635
|
+
}, [(0,external_vue_namespaceObject.createVNode)(_namespaceObject.AngleLeft, null, null)])]) : (0,external_vue_namespaceObject.createVNode)(_namespaceObject.Transfer, {
|
636
|
+
"class": "transfer"
|
637
|
+
}, null), (0,external_vue_namespaceObject.createVNode)("div", {
|
638
|
+
"class": "target-list"
|
639
|
+
}, [getHeaderHtml('right-header'), getListContentHtml('right')])]);
|
640
|
+
}
|
641
|
+
}));
|
642
|
+
;// CONCATENATED MODULE: ../../packages/transfer/src/index.ts
|
643
|
+
/**
|
644
|
+
* Tencent is pleased to support the open source community by making
|
645
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
646
|
+
*
|
647
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
648
|
+
*
|
649
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
650
|
+
*
|
651
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
652
|
+
*
|
653
|
+
* ---------------------------------------------------
|
654
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
655
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
656
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
657
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
658
|
+
*
|
659
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
660
|
+
* the Software.
|
661
|
+
*
|
662
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
663
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
664
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
665
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
666
|
+
* IN THE SOFTWARE.
|
667
|
+
*/
|
668
|
+
|
669
|
+
|
670
|
+
var Transfer = (0,external_shared_namespaceObject.withInstall)(transfer);
|
671
|
+
/* harmony default export */ const src = (Transfer);
|
672
|
+
var __webpack_exports__default = __webpack_exports__.Z;
|
673
|
+
export { __webpack_exports__default as default };
|