bkui-vue 0.0.2-beta.9 → 0.0.2-beta.90
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 +143 -161
- package/dist/index.esm.js +20658 -22774
- package/dist/index.umd.js +143 -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.d.ts +1 -1
- package/lib/affix/index.d.ts +4 -4
- package/lib/affix/index.js +321 -1
- package/lib/alert/alert.css +7 -0
- package/lib/alert/alert.d.ts +5 -5
- package/lib/alert/alert.less +16 -6
- package/lib/alert/alert.variable.css +7 -0
- package/lib/alert/index.d.ts +10 -10
- package/lib/alert/index.js +214 -1
- package/lib/animate-number/index.d.ts +1 -1
- package/lib/animate-number/index.js +155 -1
- package/lib/backtop/backtop.css +8 -8
- package/lib/backtop/backtop.less +3 -1
- package/lib/backtop/backtop.variable.css +11 -11
- package/lib/backtop/index.d.ts +1 -1
- package/lib/backtop/index.js +188 -1
- package/lib/badge/badge.d.ts +2 -2
- package/lib/badge/index.d.ts +7 -7
- package/lib/badge/index.js +235 -1
- package/lib/breadcrumb/breadcrumb.css +4 -4
- package/lib/breadcrumb/breadcrumb.variable.css +4 -4
- package/lib/breadcrumb/index.d.ts +2 -2
- package/lib/breadcrumb/index.js +309 -1
- package/lib/button/button.css +20 -0
- package/lib/button/button.less +105 -94
- package/lib/button/button.variable.css +20 -0
- package/lib/button/index.d.ts +2 -2
- package/lib/button/index.js +321 -1
- package/lib/card/card.css +4 -4
- package/lib/card/card.d.ts +1 -1
- package/lib/card/card.variable.css +4 -4
- package/lib/card/index.d.ts +4 -4
- package/lib/card/index.js +285 -1
- package/lib/cascader/cascader.css +4 -4
- package/lib/cascader/cascader.d.ts +1 -0
- package/lib/cascader/cascader.variable.css +4 -4
- package/lib/cascader/index.d.ts +5 -2
- package/lib/cascader/index.js +2036 -2
- package/lib/cascader/interface.d.ts +1 -1
- package/lib/checkbox/checkbox-group.d.ts +6 -3
- package/lib/checkbox/checkbox.d.ts +4 -4
- package/lib/checkbox/index.d.ts +22 -19
- package/lib/checkbox/index.js +542 -1
- package/lib/code-diff/index.d.ts +1 -1
- package/lib/code-diff/index.js +5501 -1
- package/lib/collapse/index.d.ts +2 -2
- package/lib/collapse/index.js +570 -1
- package/lib/collapse-transition/index.d.ts +128 -2
- package/lib/collapse-transition/index.js +177 -1
- package/lib/color-picker/color-picker.d.ts +16 -0
- package/lib/color-picker/components/recommend-colors.d.ts +16 -0
- package/lib/color-picker/index.d.ts +19 -1
- package/lib/color-picker/index.js +2665 -1
- package/lib/components.js +530 -1
- package/lib/config-provider/config-provider.d.ts +3 -0
- package/lib/config-provider/index.d.ts +5 -1
- package/lib/config-provider/index.js +365 -1
- package/lib/config-provider/token.d.ts +1 -0
- package/lib/config-provider/use-global-config.d.ts +2 -0
- package/lib/config-provider/use-prefix.d.ts +2 -0
- package/lib/container/container.css +4 -4
- package/lib/container/container.variable.css +4 -4
- package/lib/container/index.d.ts +2 -2
- package/lib/container/index.js +391 -1
- package/lib/date-picker/date-picker.d.ts +4 -2
- package/lib/date-picker/index.d.ts +15 -8
- package/lib/date-picker/index.js +5555 -1
- package/lib/date-picker/panel/date-range.d.ts +2 -1
- package/lib/date-picker/time-picker.d.ts +1 -1
- package/lib/dialog/dialog.css +2 -0
- package/lib/dialog/dialog.variable.css +2 -0
- package/lib/dialog/index.d.ts +1 -1
- package/lib/dialog/index.js +975 -2
- package/lib/directives/index.js +1376 -2
- package/lib/directives/tooltips.d.ts +3 -2
- package/lib/dist.index.js +87 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/divider/index.js +169 -1
- package/lib/dropdown/dropdown.css +1 -0
- package/lib/dropdown/dropdown.variable.css +1 -0
- package/lib/dropdown/index.d.ts +2 -2
- package/lib/dropdown/index.js +369 -1
- package/lib/exception/index.d.ts +2 -2
- package/lib/exception/index.js +385 -1
- package/lib/fixed-navbar/index.d.ts +1 -1
- package/lib/fixed-navbar/index.js +154 -1
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +952 -1
- package/lib/hooks.d.ts +1 -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.d.ts +4 -0
- package/lib/icon/assistant.js +191 -0
- 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 +2399 -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/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/index.d.ts +1 -1
- package/lib/image/index.js +641 -1
- package/lib/index.js +97 -1
- package/lib/info-box/index.js +1165 -2
- package/lib/info-box/info-box.css +2 -0
- package/lib/info-box/info-box.less +2 -1
- package/lib/info-box/info-box.variable.css +2 -0
- package/lib/input/index.d.ts +146 -50
- package/lib/input/index.js +1218 -1
- package/lib/input/input.css +38 -10
- package/lib/input/input.d.ts +100 -11
- package/lib/input/input.less +53 -14
- package/lib/input/input.variable.css +38 -10
- package/lib/input/util.d.ts +6 -0
- package/lib/link/index.d.ts +4 -4
- package/lib/link/index.js +160 -1
- package/lib/link/link.d.ts +1 -1
- package/lib/loading/index.d.ts +2 -2
- package/lib/loading/index.js +381 -1
- package/lib/loading/loading.css +4 -4
- package/lib/loading/loading.variable.css +4 -4
- package/lib/locale/index.js +465 -1
- package/lib/locale/lang/en.d.ts +1 -0
- package/lib/menu/index.d.ts +2 -2
- package/lib/menu/index.js +724 -1
- package/lib/menu/menu.css +4 -4
- package/lib/menu/menu.variable.css +4 -4
- package/lib/message/index.js +1795 -2
- package/lib/message/message.css +33 -9
- package/lib/message/message.less +78 -54
- package/lib/message/message.variable.css +33 -9
- package/lib/message/messageConstructor.d.ts +25 -4
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +396 -1
- package/lib/modal/modal.css +2 -0
- package/lib/modal/modal.variable.css +2 -0
- package/lib/navigation/index.d.ts +4 -1
- package/lib/navigation/index.js +367 -1
- package/lib/navigation/navigation.d.ts +1 -0
- package/lib/notify/index.js +397 -1
- package/lib/notify/notifyConstructor.d.ts +1 -1
- package/lib/overflow-title/components/overflow-title.d.ts +257 -1
- package/lib/overflow-title/index.d.ts +387 -2
- package/lib/overflow-title/index.js +461 -1
- package/lib/overflow-title/props.d.ts +129 -0
- package/lib/pagination/index.d.ts +2 -2
- package/lib/pagination/index.js +880 -1
- package/lib/plugin-popover/index.js +3905 -1
- package/lib/plugins/index.js +63 -1
- package/lib/pop-confirm/index.d.ts +1 -1
- package/lib/pop-confirm/index.js +273 -1
- package/lib/popover/content.d.ts +33 -0
- package/lib/popover/index.d.ts +74 -16
- package/lib/popover/index.js +3913 -1
- package/lib/popover/popover.css +1 -0
- package/lib/popover/popover.d.ts +40 -7
- package/lib/popover/popover.less +3 -2
- package/lib/popover/popover.variable.css +1 -0
- package/lib/popover/props.d.ts +25 -2
- package/lib/popover/use-floating.d.ts +1 -1
- package/lib/popover/use-popover-init.d.ts +2 -1
- package/lib/popover2/index.d.ts +1 -1
- package/lib/popover2/index.js +107 -1
- package/lib/preset.d.ts +2 -0
- package/lib/preset.js +93 -1
- package/lib/process/index.d.ts +1 -1
- package/lib/process/index.js +759 -2
- package/lib/progress/index.d.ts +1 -1
- package/lib/progress/index.js +431 -1
- package/lib/progress/progress.css +4 -4
- package/lib/progress/progress.variable.css +4 -4
- package/lib/radio/index.d.ts +23 -23
- package/lib/radio/index.js +627 -1
- package/lib/radio/radio-button.d.ts +4 -4
- package/lib/radio/radio-group.d.ts +4 -4
- package/lib/radio/radio.d.ts +4 -4
- package/lib/rate/index.d.ts +8 -4
- package/lib/rate/index.js +338 -1
- package/lib/rate/rate.d.ts +2 -1
- package/lib/resize-layout/index.d.ts +4 -4
- package/lib/resize-layout/index.js +429 -1
- package/lib/resize-layout/resize-layout.css +12 -0
- package/lib/resize-layout/resize-layout.d.ts +1 -1
- package/lib/resize-layout/resize-layout.less +12 -0
- package/lib/resize-layout/resize-layout.variable.css +12 -0
- package/lib/search-select/index.d.ts +62 -29
- package/lib/search-select/index.js +2729 -2
- package/lib/search-select/input.d.ts +5 -1
- package/lib/search-select/menu.d.ts +33 -2
- package/lib/search-select/search-select.css +38 -20
- package/lib/search-select/search-select.d.ts +23 -20
- package/lib/search-select/search-select.less +35 -14
- package/lib/search-select/search-select.variable.css +38 -20
- package/lib/search-select/selected.d.ts +5 -1
- package/lib/search-select/utils.d.ts +13 -5
- package/lib/select/common.d.ts +1 -0
- package/lib/select/index.d.ts +198 -72
- package/lib/select/index.js +2254 -2
- package/lib/select/option.d.ts +11 -0
- package/lib/select/select.css +13 -5
- package/lib/select/select.d.ts +83 -31
- package/lib/select/select.less +11 -1
- package/lib/select/select.variable.css +37 -29
- package/lib/select/selectTagInput.d.ts +8 -5
- package/lib/shared/helper.d.ts +1 -1
- package/lib/shared/index.js +2689 -1
- package/lib/shared/mask-manager.d.ts +3 -4
- package/lib/shared/pop-manager.d.ts +6 -2
- package/lib/shared/popover.d.ts +2 -2
- package/lib/shared/vue-types.d.ts +3 -2
- package/lib/sideslider/index.d.ts +1 -1
- package/lib/sideslider/index.js +714 -2
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +1291 -2
- package/lib/steps/index.d.ts +1 -1
- package/lib/steps/index.js +825 -2
- package/lib/styles/mixins/animate.css +4 -4
- package/lib/styles/mixins/animate.less +10 -6
- package/lib/styles/mixins/animate.variable.css +126 -4
- package/lib/styles/mixins/clearfix.css +8 -0
- package/lib/styles/mixins/clearfix.less +10 -0
- package/lib/styles/mixins/clearfix.variable.css +8 -0
- package/lib/styles/mixins/mixins.css +72 -0
- package/lib/styles/mixins/mixins.less +5 -0
- package/lib/styles/mixins/mixins.variable.css +72 -0
- package/lib/styles/mixins/popper.less +6 -5
- package/lib/swiper/index.d.ts +1 -1
- package/lib/swiper/index.js +336 -1
- package/lib/swiper/swiper.css +0 -6
- package/lib/swiper/swiper.less +0 -8
- package/lib/swiper/swiper.variable.css +0 -6
- package/lib/switcher/index.d.ts +30 -16
- package/lib/switcher/index.js +277 -1
- package/lib/switcher/switcher.css +4 -4
- package/lib/switcher/switcher.d.ts +74 -5
- package/lib/switcher/switcher.variable.css +4 -4
- package/lib/tab/index.d.ts +3 -3
- package/lib/tab/index.js +914 -1
- package/lib/tab/tab-nav.d.ts +12 -2
- package/lib/tab/tab-panel.d.ts +1 -1
- package/lib/table/components/table-cell.d.ts +22 -24
- package/lib/table/components/table-column.d.ts +125 -82
- package/lib/table/const.d.ts +24 -2
- package/lib/table/events.d.ts +26 -26
- package/lib/table/index.d.ts +281 -295
- package/lib/table/index.js +6243 -1
- package/lib/table/plugins/head-filter.css +3 -0
- package/lib/table/plugins/head-filter.less +3 -0
- package/lib/table/plugins/head-filter.variable.css +3 -0
- package/lib/table/plugins/settings.d.ts +7 -17
- package/lib/table/plugins/use-column-resize.d.ts +30 -10
- package/lib/table/plugins/use-fixed-column.d.ts +9 -9
- package/lib/table/plugins/use-pagination.d.ts +7 -4
- package/lib/table/props.d.ts +118 -58
- package/lib/table/render.d.ts +7 -17
- package/lib/table/table.css +83 -11
- package/lib/table/table.d.ts +95 -72
- package/lib/table/table.less +59 -21
- package/lib/table/table.variable.css +83 -11
- package/lib/table/use-attributes.d.ts +55 -0
- package/lib/table/use-column.d.ts +264 -49
- package/lib/table/use-common.d.ts +1608 -88
- package/lib/table/use-render.d.ts +11 -0
- package/lib/table/utils.d.ts +30 -29
- package/lib/table-column/index.d.ts +241 -408
- package/lib/table-column/index.js +766 -1
- package/lib/tag/index.d.ts +10 -10
- package/lib/tag/index.js +233 -1
- package/lib/tag/tag.d.ts +5 -5
- package/lib/tag-input/index.d.ts +49 -7
- package/lib/tag-input/index.js +1660 -1
- package/lib/tag-input/tag-input.css +9 -1
- package/lib/tag-input/tag-input.d.ts +32 -4
- package/lib/tag-input/tag-input.less +13 -4
- package/lib/tag-input/tag-input.variable.css +9 -1
- package/lib/tag-input/tag-props.d.ts +16 -2
- package/lib/time-picker/index.d.ts +4 -4
- package/lib/time-picker/index.js +71 -1
- package/lib/timeline/index.d.ts +1 -1
- package/lib/timeline/index.js +241 -1
- package/lib/transfer/index.d.ts +1 -1
- package/lib/transfer/index.js +673 -1
- package/lib/tree/constant.d.ts +2 -2
- package/lib/tree/index.d.ts +58 -22
- package/lib/tree/index.js +2503 -1
- package/lib/tree/props.d.ts +18 -6
- package/lib/tree/tree.d.ts +32 -11
- package/lib/tree/use-node-action.d.ts +5 -3
- package/lib/tree/use-node-attribute.d.ts +17 -8
- package/lib/tree/use-search.d.ts +2 -2
- package/lib/tree/use-tree-init.d.ts +1 -2
- package/lib/tree/util.d.ts +8 -3
- package/lib/upload/index.d.ts +1 -1
- package/lib/upload/index.js +2874 -2
- package/lib/upload/upload.css +4 -4
- package/lib/upload/upload.type.d.ts +1 -1
- package/lib/upload/upload.variable.css +4 -4
- package/lib/upload/use-file-handler.d.ts +2 -2
- package/lib/virtual-render/index.d.ts +43 -1
- package/lib/virtual-render/index.js +865 -1
- package/lib/virtual-render/props.d.ts +15 -0
- package/lib/virtual-render/v-virtual-render.d.ts +19 -1
- package/lib/virtual-render/virtual-render.d.ts +25 -0
- package/lib/volar.components.d.ts +24 -24
- package/package.json +29 -17
- 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/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/upload/index.js.LICENSE.txt +0 -1
@@ -1 +1,865 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("lodash"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","lodash"],t);else{var o="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("lodash")):t(e["../shared"],e.vue,e["../config-provider"],e.lodash);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,((e,t,o,r)=>(()=>{"use strict";var n={2717:e=>{e.exports=o},4212:t=>{t.exports=e},467:e=>{e.exports=r},748:e=>{e.exports=t}},l={};function i(e){var t=l[e];if(void 0!==t)return t.exports;var o=l[e]={exports:{}};return n[e](o,o.exports,i),o.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{i.r(s),i.d(s,{default:()=>g});var e=i(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function o(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):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.")}()}function r(e){return r="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},r(e)}var n=i(748),l=i(2717),a={onContentScroll:Function},u=Object.assign({list:e.PropTypes.array.def([]),enabled:e.PropTypes.bool.def(!0),scrollEvent:e.PropTypes.bool.def(!1),lineHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.func]).def(30),minHeight:e.PropTypes.number.def(30),height:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),width:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),className:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentClassName:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentStyle:e.PropTypes.object.def({}),scrollXName:e.PropTypes.string.def((0,e.resolveClassName)("F-scroll-x")),scrollYName:e.PropTypes.string.def((0,e.resolveClassName)("F-scroll-y")),groupItemCount:e.PropTypes.number.def(1),preloadItemCount:e.PropTypes.number.def(1),renderAs:e.PropTypes.string.def("div"),contentAs:e.PropTypes.string.def("div"),scrollOffsetTop:e.PropTypes.number.def(0),scrollPosition:e.PropTypes.string.def("content"),abosuteHeight:e.PropTypes.oneOfType([e.PropTypes.string.def("auto"),e.PropTypes.number]).def("auto"),throttleDelay:e.PropTypes.number.def(60),rowKey:e.PropTypes.string.def(void 0),keepAlive:e.PropTypes.bool.def(!1)},a),c=i(467);function p(e,t,o,r){for(var n=0,l=0,i=0,s=0;n<e;n++){if(l+(s=r(n,[n*o,(n+1)*o,"virtual"]))>t){i=t-l;break}l+=s}return{startIndex:n,height:l,diffHeight:i}}function f(e,t,o,r,n){if(r){var l=r.scrollTop,i=r.scrollLeft,s=o.scrollTop,a=o.count,u=o.groupItemCount,c=o.startIndex,f=o.endIndex,d=o.scrollLeft,v=r.offsetHeight,y=0,g=0,h=0;if("number"==typeof e&&(y=Math.floor(l/e),g=Math.ceil(v/e)+y,h=l%e),"function"==typeof e){var m=p(a,l,u,e);y=m.startIndex>0?m.startIndex:0,h=m.diffHeight,g=p(a,v,u,e).startIndex+y+1}if(l!==s||y!==c||g!==f||d!==i){var b=r.scrollHeight-r.offsetHeight-r.scrollTop;"function"==typeof t&&t(n,y,g,l,h,i,{bottom:b>=0?b:0})}}}var d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return(0,c.throttle)((function(e,t,o){return function(e,t,o){var r=o.value,n=r.lineHeight,l=void 0===n?30:n,i=r.handleScrollCallback,s=r.pagination,a=void 0===s?{}:s;if(r.onlyScroll){var u=t.scrollTop,c=t.scrollLeft,p=t.scrollHeight-t.offsetHeight-t.scrollTop;i(e,null,null,u,u,c,{bottom:p>=0?p:0})}else{var d=a.startIndex,v=a.endIndex,y=a.groupItemCount,g=a.count;f(l,i,{scrollTop:a.scrollTop,startIndex:d,endIndex:v,groupItemCount:y,count:g,scrollLeft:a.scrollLeft},t,e)}}(e,t,o)}),e)};const v={mounted:function(e,t){var o=e.parentNode,r=t.value.throttleDelay;o.addEventListener("scroll",(function(e){!function(e,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;Reflect.apply(d(r),void 0,[e,t,o])}(e,o,t,r)}))},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",d)}}},y=(0,n.defineComponent)({name:"VirtualRender",directives:{bkVirtualRender:v},props:u,emits:["content-scroll"],slots:Object,setup:function(e,t){var i=this,s=e.renderAs,a=e.contentAs,u=function(e){return"string"==typeof e?[e]:"object"!==r(e)||Array.isArray(e)?e:[e]};if(!e.enabled){var c=function(e,t){var o=e.renderAs,r=e.contentAs,l=(0,n.resolveDirective)("bkVirtualRender"),i={lineHeight:e.lineHeight,handleScrollCallback:function(e,o,r,n,l,i,s){t.emit("content-scroll",[e,{translateY:l,translateX:i,pos:s}])},pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},s=(0,n.ref)(null);return t.expose({scrollTo:function(e){var t=e.left,o=void 0===t?0:t,r=e.top,n=void 0===r?0:r;s.value.scrollTo(o,n)}}),{rendAsTag:function(){var a,u,c,p,f,d,v,y,g,h,m,b;return(0,n.h)(o,{class:e.className,ref:s},[null!==(c=null===(u=(a=t.slots).beforeContent)||void 0===u?void 0:u.call(a))&&void 0!==c?c:"",(0,n.withDirectives)((0,n.h)(r,{class:e.contentClassName,style:e.contentStyle},[null!==(d=null===(f=(p=t.slots).default)||void 0===f?void 0:f.call(p,{data:e.list}))&&void 0!==d?d:""]),[[l,i]]),null!==(g=null===(y=(v=t.slots).afterContent)||void 0===y?void 0:y.call(v))&&void 0!==g?g:"",null!==(b=null===(m=(h=t.slots).afterSection)||void 0===m?void 0:m.call(h))&&void 0!==b?b:""])}}}(e,t);return c.rendAsTag}var p=(0,n.ref)(null),d=(0,n.reactive)({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),v=function(e,o,r,n,l,i,s){d.startIndex=o,d.endIndex=r,d.scrollTop=n,d.translateY=l,d.translateX=i,d.scrollLeft=i,d.pos=s,t.emit("content-scroll",[e,d])};(0,n.onMounted)((function(){(0,n.nextTick)((function(){m(e.list),b()}))})),(0,n.watch)((function(){return e.list}),(function(){var t;t={left:d.scrollLeft,top:d.scrollTop},y(),b(),e.keepAlive&&w(t)}),{deep:!0}),(0,n.watch)((function(){return e.lineHeight}),(function(){y(),b()}));var y=function(){m(e.list)},g=(0,n.ref)(0),h=(0,n.ref)(0),m=function(t){if(g.value=Math.ceil((t||[]).length/e.groupItemCount),d.count=g.value,d.startIndex=0,d.endIndex=0,d.translateY=0,d.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){h.value=0;for(var o=0,r=0;r<g.value;r++){var n=e.lineHeight.call(i,r,t.slice(r*e.groupItemCount,e.groupItemCount));o+="number"==typeof n?n:0}h.value=o}else h.value=e.lineHeight*g.value;else h.value=e.abosuteHeight},b=function(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{left:0,top:0},r=null===(t=p.value)||void 0===t?void 0:t.parentNode;f(e.lineHeight,v,d,r,null),o&&p.value&&w(o)},T=(0,n.computed)((function(){return void 0!==e.rowKey?e.list:(e.list||[]).map((function(e,t){return Object.assign(Object.assign({},e),{$index:t})}))})),P=(0,n.computed)((function(){return T.value.slice(d.startIndex*e.groupItemCount,(d.endIndex+e.preloadItemCount)*e.groupItemCount)})),x=(0,n.computed)((function(){return"content"===e.scrollPosition?{top:"".concat(d.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(d.translateY,"px)")}:{}})),I=(0,n.computed)((function(){return Object.assign({height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"number"==typeof e.width?"".concat(e.width,"px"):e.width,display:"inline-block"},"container"===e.scrollPosition?x.value:{})})),C=(0,n.computed)((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(h.value<e.minHeight?e.minHeight:h.value,"px"),display:t?"none":"block"}})),H=(0,l.usePrefix)().resolveClassName,O=(0,n.computed)((function(){return[H("virtual-render"),e.scrollXName,e.scrollYName].concat(o(u(e.className)),["container"===e.scrollPosition?H("virtual-content"):""])})),S=(0,n.computed)((function(){return["content"===e.scrollPosition?H("virtual-content"):""].concat(o(u(e.contentClassName)))})),j=(0,n.resolveDirective)("bkVirtualRender"),A={lineHeight:e.lineHeight,handleScrollCallback:v,pagination:d,throttleDelay:e.throttleDelay},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{left:0,top:0},t=e.left,o=e.top;p.value.scrollTo(t,o)};return t.expose({reset:function(){y(),b()},scrollTo:w}),function(){var o,r,l,i,u,c,f,d,v,y,g,h;return(0,n.h)(s||"div",{ref:p,class:O.value,style:I.value},[null!==(l=null===(r=(o=t.slots).beforeContent)||void 0===r?void 0:r.call(o))&&void 0!==l?l:"",(0,n.withDirectives)((0,n.h)(a||"div",{class:S.value,style:Object.assign(Object.assign({},x.value),e.contentStyle)},[null!==(c=null===(u=(i=t.slots).default)||void 0===u?void 0:u.call(i,{data:P.value}))&&void 0!==c?c:""]),[[j,A]]),null!==(v=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==v?v:"",(0,n.h)("div",{class:[H("virtual-section")],style:C.value}),null!==(h=null===(g=(y=t.slots).afterSection)||void 0===g?void 0:g.call(y))&&void 0!==h?h:""])}}}),g=(0,e.withInstall)(y)})(),s})()));
|
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_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
5
|
+
/******/ // The require scope
|
6
|
+
/******/ var __webpack_require__ = {};
|
7
|
+
/******/
|
8
|
+
/************************************************************************/
|
9
|
+
/******/ /* webpack/runtime/define property getters */
|
10
|
+
/******/ (() => {
|
11
|
+
/******/ // define getter functions for harmony exports
|
12
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
13
|
+
/******/ for(var key in definition) {
|
14
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
15
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
16
|
+
/******/ }
|
17
|
+
/******/ }
|
18
|
+
/******/ };
|
19
|
+
/******/ })();
|
20
|
+
/******/
|
21
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
22
|
+
/******/ (() => {
|
23
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
24
|
+
/******/ })();
|
25
|
+
/******/
|
26
|
+
/************************************************************************/
|
27
|
+
var __webpack_exports__ = {};
|
28
|
+
|
29
|
+
// EXPORTS
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
31
|
+
Z: () => (/* binding */ src)
|
32
|
+
});
|
33
|
+
|
34
|
+
;// CONCATENATED MODULE: external "../shared"
|
35
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
36
|
+
var y = x => () => x
|
37
|
+
const external_shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["resolveClassName"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.resolveClassName, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
|
38
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
39
|
+
function _arrayLikeToArray(arr, len) {
|
40
|
+
if (len == null || len > arr.length) len = arr.length;
|
41
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
42
|
+
return arr2;
|
43
|
+
}
|
44
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
45
|
+
|
46
|
+
function _arrayWithoutHoles(arr) {
|
47
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
48
|
+
}
|
49
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
50
|
+
function _iterableToArray(iter) {
|
51
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
52
|
+
}
|
53
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
54
|
+
|
55
|
+
function _unsupportedIterableToArray(o, minLen) {
|
56
|
+
if (!o) return;
|
57
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
58
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
59
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
60
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
61
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
62
|
+
}
|
63
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
64
|
+
function _nonIterableSpread() {
|
65
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
66
|
+
}
|
67
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
function _toConsumableArray(arr) {
|
73
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
74
|
+
}
|
75
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
76
|
+
function _typeof(obj) {
|
77
|
+
"@babel/helpers - typeof";
|
78
|
+
|
79
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
80
|
+
return typeof obj;
|
81
|
+
} : function (obj) {
|
82
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
83
|
+
}, _typeof(obj);
|
84
|
+
}
|
85
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
86
|
+
|
87
|
+
function _toPrimitive(input, hint) {
|
88
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
89
|
+
var prim = input[Symbol.toPrimitive];
|
90
|
+
if (prim !== undefined) {
|
91
|
+
var res = prim.call(input, hint || "default");
|
92
|
+
if (_typeof(res) !== "object") return res;
|
93
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
94
|
+
}
|
95
|
+
return (hint === "string" ? String : Number)(input);
|
96
|
+
}
|
97
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
98
|
+
|
99
|
+
|
100
|
+
function _toPropertyKey(arg) {
|
101
|
+
var key = _toPrimitive(arg, "string");
|
102
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
103
|
+
}
|
104
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
105
|
+
|
106
|
+
function _defineProperty(obj, key, value) {
|
107
|
+
key = _toPropertyKey(key);
|
108
|
+
if (key in obj) {
|
109
|
+
Object.defineProperty(obj, key, {
|
110
|
+
value: value,
|
111
|
+
enumerable: true,
|
112
|
+
configurable: true,
|
113
|
+
writable: true
|
114
|
+
});
|
115
|
+
} else {
|
116
|
+
obj[key] = value;
|
117
|
+
}
|
118
|
+
return obj;
|
119
|
+
}
|
120
|
+
;// CONCATENATED MODULE: external "vue"
|
121
|
+
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
122
|
+
var external_vue_y = x => () => x
|
123
|
+
const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
124
|
+
;// CONCATENATED MODULE: external "../config-provider"
|
125
|
+
var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
126
|
+
var external_config_provider_y = x => () => x
|
127
|
+
const external_config_provider_namespaceObject = external_config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
|
128
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/props.ts
|
129
|
+
|
130
|
+
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; }
|
131
|
+
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; }
|
132
|
+
/*
|
133
|
+
* Tencent is pleased to support the open source community by making
|
134
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
135
|
+
*
|
136
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
137
|
+
*
|
138
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
139
|
+
*
|
140
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
141
|
+
*
|
142
|
+
* ---------------------------------------------------
|
143
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
144
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
145
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
146
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
147
|
+
*
|
148
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
149
|
+
* the Software.
|
150
|
+
*
|
151
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
152
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
153
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
154
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
155
|
+
* IN THE SOFTWARE.
|
156
|
+
*/
|
157
|
+
|
158
|
+
var EventProps = {
|
159
|
+
onContentScroll: Function
|
160
|
+
};
|
161
|
+
var virtualRenderProps = _objectSpread({
|
162
|
+
/** 传入原始数据源 */
|
163
|
+
list: external_shared_namespaceObject.PropTypes.array.def([]),
|
164
|
+
/**
|
165
|
+
* 是否启用此功能
|
166
|
+
* 如果设置为false,则此组件只会渲染两层指定的 容器,默认渲染两层 div
|
167
|
+
* 设置为true才会启用所有的虚拟渲染 & 滚动相关计算
|
168
|
+
* 此属性设置为了兼容需要按需开启\关闭虚拟渲染场景,避免外层设计两套样式架构
|
169
|
+
* Note: 目前此属性不支持动态修改
|
170
|
+
*/
|
171
|
+
enabled: external_shared_namespaceObject.PropTypes.bool.def(true),
|
172
|
+
/**
|
173
|
+
* 是否启用内置的Scroll Listener
|
174
|
+
* 当启用虚拟滚动时(enabled = true),滚动监听为内置生效
|
175
|
+
* 只有当(enabled = false)时此配置项才生效
|
176
|
+
*/
|
177
|
+
scrollEvent: external_shared_namespaceObject.PropTypes.bool.def(false),
|
178
|
+
/**
|
179
|
+
* 每行数据高度
|
180
|
+
* 默认为数值类型,默认高度 30px
|
181
|
+
* 如果每行高度不一致,可为回调函数:(index: number, row: any[]): number => {}
|
182
|
+
* 函数参数为当前行index & 当前行数据 row,row为数组,当不分组时,为当前行item
|
183
|
+
* 如果有分组展示, index 为当前分组 index, row为数组,当前行分组所有 item 数据
|
184
|
+
*/
|
185
|
+
lineHeight: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.func]).def(30),
|
186
|
+
/** 整体最小高度 */
|
187
|
+
minHeight: external_shared_namespaceObject.PropTypes.number.def(30),
|
188
|
+
/** 整体最大高度 */
|
189
|
+
maxHeight: external_shared_namespaceObject.PropTypes.number,
|
190
|
+
/**
|
191
|
+
* 整体高度
|
192
|
+
* 可设置具体值,如果设置为 100%,则组件会自动计算外层DOM元素offsetHeight,用于计算可渲染行数
|
193
|
+
*/
|
194
|
+
height: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string.def('100%'), external_shared_namespaceObject.PropTypes.number]).def('100%'),
|
195
|
+
/**
|
196
|
+
* 渲染区域宽度
|
197
|
+
* 如果设置 100% 则自适应外层元素宽度
|
198
|
+
*/
|
199
|
+
width: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string.def('100%'), external_shared_namespaceObject.PropTypes.number]).def('100%'),
|
200
|
+
/** 最外层元素ClassName */
|
201
|
+
className: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.string), external_shared_namespaceObject.PropTypes.object, external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.object), external_shared_namespaceObject.PropTypes.string]).def(''),
|
202
|
+
/** 内层层元素ClassName */
|
203
|
+
contentClassName: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.string), external_shared_namespaceObject.PropTypes.object, external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.object), external_shared_namespaceObject.PropTypes.string]).def(''),
|
204
|
+
/** 内层元素样式 */
|
205
|
+
contentStyle: external_shared_namespaceObject.PropTypes.object.def({}),
|
206
|
+
/** 用于自定义X轴滚动条样式 */
|
207
|
+
scrollXName: external_shared_namespaceObject.PropTypes.string.def((0,external_shared_namespaceObject.resolveClassName)('F-scroll-x')),
|
208
|
+
/** 用于自定义Y轴滚动条样式 */
|
209
|
+
scrollYName: external_shared_namespaceObject.PropTypes.string.def((0,external_shared_namespaceObject.resolveClassName)('F-scroll-y')),
|
210
|
+
/** 分组展示,一行数据可能有多条数据 */
|
211
|
+
groupItemCount: external_shared_namespaceObject.PropTypes.number.def(1),
|
212
|
+
/** 预加载行数,避免空白渲染 */
|
213
|
+
preloadItemCount: external_shared_namespaceObject.PropTypes.number.def(1),
|
214
|
+
/** 外层Dom元素需要渲染成的目标元素 */
|
215
|
+
renderAs: external_shared_namespaceObject.PropTypes.string.def('div'),
|
216
|
+
/** 内容层渲染成目标元素 */
|
217
|
+
contentAs: external_shared_namespaceObject.PropTypes.string.def('div'),
|
218
|
+
/** top 滚动填充 */
|
219
|
+
scrollOffsetTop: external_shared_namespaceObject.PropTypes.number.def(0),
|
220
|
+
/**
|
221
|
+
* 内置滚动位置
|
222
|
+
* 可选:container (最外层容器),content(内容层容器)
|
223
|
+
* Note: container 慎选,需要自己处理样式 & 位置
|
224
|
+
*/
|
225
|
+
scrollPosition: external_shared_namespaceObject.PropTypes.string.def('content'),
|
226
|
+
/**
|
227
|
+
* 绝对高度 | 实际高估
|
228
|
+
* 可选值: auto(根据行高和行数计算, LineHeight * List.length) number(外层给定高度,若为0,则不显示)
|
229
|
+
*/
|
230
|
+
abosuteHeight: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string.def('auto'), external_shared_namespaceObject.PropTypes.number]).def('auto'),
|
231
|
+
/**
|
232
|
+
* 滚动刷新计算间隔时间
|
233
|
+
* 默认60 ms
|
234
|
+
*/
|
235
|
+
throttleDelay: external_shared_namespaceObject.PropTypes.number.def(60),
|
236
|
+
rowKey: external_shared_namespaceObject.PropTypes.string.def(undefined),
|
237
|
+
/**
|
238
|
+
* 数据改变时是否保持之前的状态
|
239
|
+
* 保持滚动条位置、当前渲染区间
|
240
|
+
*/
|
241
|
+
keepAlive: external_shared_namespaceObject.PropTypes.bool.def(false),
|
242
|
+
/**
|
243
|
+
* 数据监听改变时,是否自动重置位置到[0, 0]
|
244
|
+
*/
|
245
|
+
autoReset: external_shared_namespaceObject.PropTypes.bool.def(true),
|
246
|
+
wrapperStyle: external_shared_namespaceObject.PropTypes.any.def({})
|
247
|
+
}, EventProps);
|
248
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
249
|
+
function _classCallCheck(instance, Constructor) {
|
250
|
+
if (!(instance instanceof Constructor)) {
|
251
|
+
throw new TypeError("Cannot call a class as a function");
|
252
|
+
}
|
253
|
+
}
|
254
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
|
255
|
+
|
256
|
+
function _defineProperties(target, props) {
|
257
|
+
for (var i = 0; i < props.length; i++) {
|
258
|
+
var descriptor = props[i];
|
259
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
260
|
+
descriptor.configurable = true;
|
261
|
+
if ("value" in descriptor) descriptor.writable = true;
|
262
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
263
|
+
}
|
264
|
+
}
|
265
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
266
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
267
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
268
|
+
Object.defineProperty(Constructor, "prototype", {
|
269
|
+
writable: false
|
270
|
+
});
|
271
|
+
return Constructor;
|
272
|
+
}
|
273
|
+
;// CONCATENATED MODULE: external "lodash/throttle"
|
274
|
+
var throttle_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
275
|
+
var throttle_y = x => () => x
|
276
|
+
const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__["default"] });
|
277
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/v-virtual-render.ts
|
278
|
+
|
279
|
+
|
280
|
+
/*
|
281
|
+
* Tencent is pleased to support the open source community by making
|
282
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
283
|
+
*
|
284
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
285
|
+
*
|
286
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
287
|
+
*
|
288
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
289
|
+
*
|
290
|
+
* ---------------------------------------------------
|
291
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
292
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
293
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
294
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
295
|
+
*
|
296
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
297
|
+
* the Software.
|
298
|
+
*
|
299
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
300
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
301
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
302
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
303
|
+
* IN THE SOFTWARE.
|
304
|
+
*/
|
305
|
+
/**
|
306
|
+
* @file v-virtual-render
|
307
|
+
*
|
308
|
+
* Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
|
309
|
+
*/
|
310
|
+
|
311
|
+
function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
|
312
|
+
var startIndex = 0;
|
313
|
+
var height = 0;
|
314
|
+
var diffHeight = 0;
|
315
|
+
var lastHeight = 0;
|
316
|
+
for (; startIndex < maxCount; startIndex++) {
|
317
|
+
lastHeight = callback(startIndex, [startIndex * groupItemCount, (startIndex + 1) * groupItemCount, 'virtual']);
|
318
|
+
if (height + lastHeight > maxHeight) {
|
319
|
+
diffHeight = maxHeight - height;
|
320
|
+
break;
|
321
|
+
}
|
322
|
+
height += lastHeight;
|
323
|
+
}
|
324
|
+
return {
|
325
|
+
startIndex: startIndex,
|
326
|
+
height: height,
|
327
|
+
diffHeight: diffHeight
|
328
|
+
};
|
329
|
+
}
|
330
|
+
function computedVirtualIndex(lineHeight, callback, pagination, el, event, height) {
|
331
|
+
if (!el) {
|
332
|
+
return;
|
333
|
+
}
|
334
|
+
var elScrollTop = el.scrollTop;
|
335
|
+
var elScrollLeft = el.scrollLeft;
|
336
|
+
var scrollTop = pagination.scrollTop,
|
337
|
+
count = pagination.count,
|
338
|
+
groupItemCount = pagination.groupItemCount,
|
339
|
+
startIndex = pagination.startIndex,
|
340
|
+
endIndex = pagination.endIndex,
|
341
|
+
scrollLeft = pagination.scrollLeft;
|
342
|
+
var offsetHeight = /^\d+(\.\d*)?$/.test(height) ? height : el.offsetHeight;
|
343
|
+
var targetStartIndex = 0;
|
344
|
+
var targetEndIndex = 0;
|
345
|
+
var translateY = 0;
|
346
|
+
if (typeof lineHeight === 'number') {
|
347
|
+
targetStartIndex = Math.floor(elScrollTop / lineHeight);
|
348
|
+
targetEndIndex = Math.ceil(offsetHeight / lineHeight) + targetStartIndex;
|
349
|
+
translateY = elScrollTop % lineHeight;
|
350
|
+
}
|
351
|
+
if (typeof lineHeight === 'function') {
|
352
|
+
var startValue = getMatchedIndex(count, elScrollTop, groupItemCount, lineHeight);
|
353
|
+
targetStartIndex = startValue.startIndex > 0 ? startValue.startIndex : 0;
|
354
|
+
translateY = startValue.diffHeight;
|
355
|
+
var endValue = getMatchedIndex(count, offsetHeight, groupItemCount, lineHeight);
|
356
|
+
targetEndIndex = endValue.startIndex + targetStartIndex + 1;
|
357
|
+
}
|
358
|
+
if (elScrollTop !== scrollTop || targetStartIndex !== startIndex || targetEndIndex !== endIndex || scrollLeft !== elScrollLeft) {
|
359
|
+
var bottom = el.scrollHeight - el.offsetHeight - el.scrollTop;
|
360
|
+
typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop, translateY, elScrollLeft, {
|
361
|
+
bottom: bottom >= 0 ? bottom : 0
|
362
|
+
});
|
363
|
+
}
|
364
|
+
return {
|
365
|
+
targetStartIndex: targetStartIndex,
|
366
|
+
targetEndIndex: targetEndIndex,
|
367
|
+
elScrollTop: elScrollTop,
|
368
|
+
translateY: translateY,
|
369
|
+
elScrollLeft: elScrollLeft
|
370
|
+
};
|
371
|
+
}
|
372
|
+
var VisibleRender = /*#__PURE__*/function () {
|
373
|
+
function VisibleRender(binding, el) {
|
374
|
+
_classCallCheck(this, VisibleRender);
|
375
|
+
this.binding = binding;
|
376
|
+
this.wrapper = el;
|
377
|
+
var throttleDelay = binding.value.throttleDelay;
|
378
|
+
this.delay = throttleDelay;
|
379
|
+
}
|
380
|
+
_createClass(VisibleRender, [{
|
381
|
+
key: "render",
|
382
|
+
value: function render(e) {
|
383
|
+
var _this$binding$value = this.binding.value,
|
384
|
+
_this$binding$value$l = _this$binding$value.lineHeight,
|
385
|
+
lineHeight = _this$binding$value$l === void 0 ? 30 : _this$binding$value$l,
|
386
|
+
handleScrollCallback = _this$binding$value.handleScrollCallback,
|
387
|
+
_this$binding$value$p = _this$binding$value.pagination,
|
388
|
+
pagination = _this$binding$value$p === void 0 ? {} : _this$binding$value$p,
|
389
|
+
onlyScroll = _this$binding$value.onlyScroll;
|
390
|
+
if (onlyScroll) {
|
391
|
+
var elScrollTop = this.wrapper.scrollTop;
|
392
|
+
var elScrollLeft = this.wrapper.scrollLeft;
|
393
|
+
var bottom = this.wrapper.scrollHeight - this.wrapper.offsetHeight - this.wrapper.scrollTop;
|
394
|
+
handleScrollCallback(e, null, null, elScrollTop, elScrollTop, elScrollLeft, {
|
395
|
+
bottom: bottom >= 0 ? bottom : 0
|
396
|
+
});
|
397
|
+
return;
|
398
|
+
}
|
399
|
+
var startIndex = pagination.startIndex,
|
400
|
+
endIndex = pagination.endIndex,
|
401
|
+
groupItemCount = pagination.groupItemCount,
|
402
|
+
count = pagination.count,
|
403
|
+
scrollTop = pagination.scrollTop,
|
404
|
+
scrollLeft = pagination.scrollLeft;
|
405
|
+
var height = this.binding.height;
|
406
|
+
computedVirtualIndex(lineHeight, handleScrollCallback, {
|
407
|
+
scrollTop: scrollTop,
|
408
|
+
startIndex: startIndex,
|
409
|
+
endIndex: endIndex,
|
410
|
+
groupItemCount: groupItemCount,
|
411
|
+
count: count,
|
412
|
+
scrollLeft: scrollLeft
|
413
|
+
}, this.wrapper, e, height);
|
414
|
+
}
|
415
|
+
}, {
|
416
|
+
key: "executeThrottledRender",
|
417
|
+
value: function executeThrottledRender(e) {
|
418
|
+
(0,throttle_namespaceObject["default"])(this.render.bind(this), this.delay)(e);
|
419
|
+
}
|
420
|
+
}, {
|
421
|
+
key: "install",
|
422
|
+
value: function install() {
|
423
|
+
var _this$wrapper;
|
424
|
+
(_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.addEventListener('scroll', this.executeThrottledRender.bind(this));
|
425
|
+
}
|
426
|
+
}, {
|
427
|
+
key: "uninstall",
|
428
|
+
value: function uninstall() {
|
429
|
+
var _this$wrapper2, _this$wrapper2$remove;
|
430
|
+
(_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2$remove = _this$wrapper2.removeListener) === null || _this$wrapper2$remove === void 0 ? void 0 : _this$wrapper2$remove.call(_this$wrapper2, 'scroll', this.executeThrottledRender.bind(this));
|
431
|
+
}
|
432
|
+
}, {
|
433
|
+
key: "setBinding",
|
434
|
+
value: function setBinding(binding) {
|
435
|
+
this.binding = binding;
|
436
|
+
}
|
437
|
+
}]);
|
438
|
+
return VisibleRender;
|
439
|
+
}();
|
440
|
+
var instance = null;
|
441
|
+
/* harmony default export */ const v_virtual_render = ({
|
442
|
+
mounted: function mounted(el, binding) {
|
443
|
+
var wrapper = el.parentNode;
|
444
|
+
instance = new VisibleRender(binding, el);
|
445
|
+
wrapper.addEventListener('scroll', instance.executeThrottledRender.bind(instance));
|
446
|
+
},
|
447
|
+
updated: function updated(_el, binding) {
|
448
|
+
var _instance;
|
449
|
+
(_instance = instance) === null || _instance === void 0 ? void 0 : _instance.setBinding(binding);
|
450
|
+
},
|
451
|
+
unbind: function unbind(el) {
|
452
|
+
if (el) {
|
453
|
+
var wrapper = el.parentNode;
|
454
|
+
if (!wrapper || !instance) {
|
455
|
+
return;
|
456
|
+
}
|
457
|
+
wrapper.removeEventListener('scroll', instance.executeThrottledRender);
|
458
|
+
}
|
459
|
+
}
|
460
|
+
});
|
461
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-tag-render.tsx
|
462
|
+
|
463
|
+
function use_tag_render_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; }
|
464
|
+
function use_tag_render_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? use_tag_render_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : use_tag_render_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
465
|
+
/*
|
466
|
+
* Tencent is pleased to support the open source community by making
|
467
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
468
|
+
*
|
469
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
470
|
+
*
|
471
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
472
|
+
*
|
473
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
474
|
+
*
|
475
|
+
* ---------------------------------------------------
|
476
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
477
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
478
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
479
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
480
|
+
*
|
481
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
482
|
+
* the Software.
|
483
|
+
*
|
484
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
485
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
486
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
487
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
488
|
+
* IN THE SOFTWARE.
|
489
|
+
*/
|
490
|
+
|
491
|
+
|
492
|
+
/* harmony default export */ const use_tag_render = (function (props, ctx) {
|
493
|
+
var renderAs = props.renderAs,
|
494
|
+
contentAs = props.contentAs;
|
495
|
+
/** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
|
496
|
+
var handleScrollCallback = function handleScrollCallback(event, _startIndex, _endIndex, _scrollTop, translateY, scrollLeft, pos) {
|
497
|
+
ctx.emit('content-scroll', [event, {
|
498
|
+
translateY: translateY,
|
499
|
+
translateX: scrollLeft,
|
500
|
+
pos: pos
|
501
|
+
}]);
|
502
|
+
};
|
503
|
+
var instance = null;
|
504
|
+
var binding = (0,external_vue_namespaceObject.computed)(function () {
|
505
|
+
return {
|
506
|
+
lineHeight: props.lineHeight,
|
507
|
+
handleScrollCallback: handleScrollCallback,
|
508
|
+
pagination: {},
|
509
|
+
throttleDelay: props.throttleDelay,
|
510
|
+
onlyScroll: props.scrollEvent
|
511
|
+
};
|
512
|
+
});
|
513
|
+
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
514
|
+
var scrollTo = function scrollTo(_ref) {
|
515
|
+
var _ref$left = _ref.left,
|
516
|
+
left = _ref$left === void 0 ? 0 : _ref$left,
|
517
|
+
_ref$top = _ref.top,
|
518
|
+
top = _ref$top === void 0 ? 0 : _ref$top;
|
519
|
+
refRoot.value.scrollTo(left, top);
|
520
|
+
};
|
521
|
+
/** 虚拟渲染外层容器样式 */
|
522
|
+
var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
|
523
|
+
var _props$maxHeight;
|
524
|
+
var height = typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
|
525
|
+
return use_tag_render_objectSpread({
|
526
|
+
height: height,
|
527
|
+
width: typeof props.width === 'number' ? "".concat(props.width, "px") : props.width,
|
528
|
+
display: 'inline-block',
|
529
|
+
maxHeight: (_props$maxHeight = props.maxHeight) !== null && _props$maxHeight !== void 0 ? _props$maxHeight : height
|
530
|
+
}, props.wrapperStyle);
|
531
|
+
});
|
532
|
+
ctx.expose({
|
533
|
+
scrollTo: scrollTo
|
534
|
+
});
|
535
|
+
(0,external_vue_namespaceObject.onMounted)(function () {
|
536
|
+
instance = new VisibleRender(binding, refRoot.value);
|
537
|
+
instance.install();
|
538
|
+
});
|
539
|
+
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
540
|
+
var _instance;
|
541
|
+
(_instance = instance) === null || _instance === void 0 ? void 0 : _instance.uninstall();
|
542
|
+
});
|
543
|
+
return {
|
544
|
+
rendAsTag: function rendAsTag() {
|
545
|
+
var _ctx$slots$beforeCont, _ctx$slots$beforeCont2, _ctx$slots, _ctx$slots$default, _ctx$slots$default2, _ctx$slots2, _ctx$slots$afterConte, _ctx$slots$afterConte2, _ctx$slots3, _ctx$slots$afterSecti, _ctx$slots$afterSecti2, _ctx$slots4;
|
546
|
+
return (0,external_vue_namespaceObject.h)(
|
547
|
+
// @ts-ignore:next-line
|
548
|
+
renderAs, {
|
549
|
+
"class": props.className,
|
550
|
+
style: wrapperStyle.value,
|
551
|
+
ref: refRoot
|
552
|
+
}, [(_ctx$slots$beforeCont = (_ctx$slots$beforeCont2 = (_ctx$slots = ctx.slots).beforeContent) === null || _ctx$slots$beforeCont2 === void 0 ? void 0 : _ctx$slots$beforeCont2.call(_ctx$slots)) !== null && _ctx$slots$beforeCont !== void 0 ? _ctx$slots$beforeCont : '', (0,external_vue_namespaceObject.h)(contentAs, {
|
553
|
+
"class": props.contentClassName,
|
554
|
+
style: props.contentStyle
|
555
|
+
}, [(_ctx$slots$default = (_ctx$slots$default2 = (_ctx$slots2 = ctx.slots)["default"]) === null || _ctx$slots$default2 === void 0 ? void 0 : _ctx$slots$default2.call(_ctx$slots2, {
|
556
|
+
data: props.list
|
557
|
+
})) !== null && _ctx$slots$default !== void 0 ? _ctx$slots$default : '']), (_ctx$slots$afterConte = (_ctx$slots$afterConte2 = (_ctx$slots3 = ctx.slots).afterContent) === null || _ctx$slots$afterConte2 === void 0 ? void 0 : _ctx$slots$afterConte2.call(_ctx$slots3)) !== null && _ctx$slots$afterConte !== void 0 ? _ctx$slots$afterConte : '', (_ctx$slots$afterSecti = (_ctx$slots$afterSecti2 = (_ctx$slots4 = ctx.slots).afterSection) === null || _ctx$slots$afterSecti2 === void 0 ? void 0 : _ctx$slots$afterSecti2.call(_ctx$slots4)) !== null && _ctx$slots$afterSecti !== void 0 ? _ctx$slots$afterSecti : '']);
|
558
|
+
}
|
559
|
+
};
|
560
|
+
});
|
561
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/virtual-render.tsx
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
function virtual_render_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; }
|
566
|
+
function virtual_render_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? virtual_render_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : virtual_render_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
567
|
+
/*
|
568
|
+
* Tencent is pleased to support the open source community by making
|
569
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
570
|
+
*
|
571
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
572
|
+
*
|
573
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
574
|
+
*
|
575
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
576
|
+
*
|
577
|
+
* ---------------------------------------------------
|
578
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
579
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
580
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
581
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
582
|
+
*
|
583
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
584
|
+
* the Software.
|
585
|
+
*
|
586
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
587
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
588
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
589
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
590
|
+
* IN THE SOFTWARE.
|
591
|
+
*/
|
592
|
+
/**
|
593
|
+
* @file virtual-render
|
594
|
+
*
|
595
|
+
* Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
|
596
|
+
*/
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
/* harmony default export */ const virtual_render = ((0,external_vue_namespaceObject.defineComponent)({
|
603
|
+
name: 'VirtualRender',
|
604
|
+
directives: {
|
605
|
+
bkVirtualRender: v_virtual_render
|
606
|
+
},
|
607
|
+
props: virtualRenderProps,
|
608
|
+
emits: ['content-scroll'],
|
609
|
+
slots: Object,
|
610
|
+
setup: function setup(props, ctx) {
|
611
|
+
var _this = this;
|
612
|
+
var renderAs = props.renderAs,
|
613
|
+
contentAs = props.contentAs;
|
614
|
+
var resolvePropClassName = function resolvePropClassName(prop) {
|
615
|
+
if (typeof prop === 'string') {
|
616
|
+
return [prop];
|
617
|
+
}
|
618
|
+
if (_typeof(prop) === 'object' && !Array.isArray(prop)) {
|
619
|
+
return [prop];
|
620
|
+
}
|
621
|
+
return prop;
|
622
|
+
};
|
623
|
+
if (!props.enabled) {
|
624
|
+
var _useTagRender = use_tag_render(props, ctx),
|
625
|
+
rendAsTag = _useTagRender.rendAsTag;
|
626
|
+
return rendAsTag;
|
627
|
+
}
|
628
|
+
var binding = (0,external_vue_namespaceObject.computed)(function () {
|
629
|
+
return {
|
630
|
+
lineHeight: props.lineHeight,
|
631
|
+
handleScrollCallback: handleScrollCallback,
|
632
|
+
pagination: pagination,
|
633
|
+
throttleDelay: props.throttleDelay
|
634
|
+
};
|
635
|
+
});
|
636
|
+
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
637
|
+
var instance = null;
|
638
|
+
var pagination = (0,external_vue_namespaceObject.reactive)({
|
639
|
+
startIndex: 0,
|
640
|
+
endIndex: 0,
|
641
|
+
scrollTop: 1,
|
642
|
+
scrollLeft: 0,
|
643
|
+
translateY: 0,
|
644
|
+
translateX: 0,
|
645
|
+
count: 0,
|
646
|
+
pos: {},
|
647
|
+
groupItemCount: props.groupItemCount
|
648
|
+
});
|
649
|
+
/** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
|
650
|
+
var handleScrollCallback = function handleScrollCallback(event, startIndex, endIndex, scrollTop, translateY, scrollLeft, pos) {
|
651
|
+
pagination.startIndex = startIndex;
|
652
|
+
pagination.endIndex = endIndex;
|
653
|
+
pagination.scrollTop = scrollTop;
|
654
|
+
// 设置偏移量,避免行高较大时出现卡顿式的滚动
|
655
|
+
pagination.translateY = translateY;
|
656
|
+
pagination.translateX = scrollLeft;
|
657
|
+
pagination.scrollLeft = scrollLeft;
|
658
|
+
Object.assign(pagination.pos, pos || {});
|
659
|
+
if (event) {
|
660
|
+
ctx.emit('content-scroll', [event, pagination]);
|
661
|
+
}
|
662
|
+
};
|
663
|
+
(0,external_vue_namespaceObject.onMounted)(function () {
|
664
|
+
instance = new VisibleRender(binding, refRoot.value);
|
665
|
+
instance.install();
|
666
|
+
});
|
667
|
+
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
668
|
+
var _instance;
|
669
|
+
(_instance = instance) === null || _instance === void 0 ? void 0 : _instance.uninstall();
|
670
|
+
});
|
671
|
+
var resolveHeight = (0,external_vue_namespaceObject.computed)(function () {
|
672
|
+
if (/^\d+(\.\d*)?(px)?$/.test("".concat(props.height))) {
|
673
|
+
return Number("".concat(props.height).replace(/px$/, ''));
|
674
|
+
}
|
675
|
+
return props.height;
|
676
|
+
});
|
677
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
678
|
+
return [props.lineHeight, props.height, props.list, props.maxHeight];
|
679
|
+
}, function () {
|
680
|
+
var _instance2;
|
681
|
+
(_instance2 = instance) === null || _instance2 === void 0 ? void 0 : _instance2.setBinding(binding);
|
682
|
+
handleChangeListConfig();
|
683
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
684
|
+
afterListDataReset();
|
685
|
+
});
|
686
|
+
}, {
|
687
|
+
deep: true
|
688
|
+
});
|
689
|
+
var handleChangeListConfig = function handleChangeListConfig() {
|
690
|
+
/** 数据改变时激活当前表单,使其渲染DOM */
|
691
|
+
handleListChanged(props.list);
|
692
|
+
};
|
693
|
+
/** 如果有分组状态,计算总行数 */
|
694
|
+
var listLength = (0,external_vue_namespaceObject.ref)(0);
|
695
|
+
/** 实际高度,根据行高和总行数计算出来的实际高度 */
|
696
|
+
var innerHeight = (0,external_vue_namespaceObject.ref)(0);
|
697
|
+
/**
|
698
|
+
* 列表数据改变时,处理相关参数
|
699
|
+
*/
|
700
|
+
var handleListChanged = function handleListChanged(list) {
|
701
|
+
listLength.value = Math.ceil((list || []).length / props.groupItemCount);
|
702
|
+
pagination.count = listLength.value;
|
703
|
+
var isAuto = typeof props.abosuteHeight === 'string' && props.abosuteHeight === 'auto';
|
704
|
+
if (isAuto) {
|
705
|
+
if (typeof props.lineHeight === 'function') {
|
706
|
+
innerHeight.value = 0;
|
707
|
+
var fnValue = 0;
|
708
|
+
for (var i = 0; i < listLength.value; i++) {
|
709
|
+
var fnVal = props.lineHeight.call(_this, i, list.slice(i * props.groupItemCount, props.groupItemCount));
|
710
|
+
fnValue += typeof fnVal === 'number' ? fnVal : 0;
|
711
|
+
}
|
712
|
+
innerHeight.value = fnValue;
|
713
|
+
} else {
|
714
|
+
innerHeight.value = props.lineHeight * listLength.value;
|
715
|
+
}
|
716
|
+
} else {
|
717
|
+
innerHeight.value = props.abosuteHeight;
|
718
|
+
}
|
719
|
+
};
|
720
|
+
/** 列表数据重置之后的处理事项 */
|
721
|
+
var afterListDataReset = function afterListDataReset() {
|
722
|
+
var _scrollToOpt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
723
|
+
left: 0,
|
724
|
+
top: 0
|
725
|
+
};
|
726
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
727
|
+
var el = refRoot.value;
|
728
|
+
var _computedVirtualIndex = computedVirtualIndex(props.lineHeight, handleScrollCallback, pagination, el, null, resolveHeight.value),
|
729
|
+
targetStartIndex = _computedVirtualIndex.targetStartIndex,
|
730
|
+
targetEndIndex = _computedVirtualIndex.targetEndIndex,
|
731
|
+
elScrollTop = _computedVirtualIndex.elScrollTop,
|
732
|
+
translateY = _computedVirtualIndex.translateY,
|
733
|
+
elScrollLeft = _computedVirtualIndex.elScrollLeft;
|
734
|
+
handleScrollCallback(null, targetStartIndex, targetEndIndex, elScrollTop, translateY, elScrollLeft, {});
|
735
|
+
});
|
736
|
+
};
|
737
|
+
/** 映射传入的数组为新的数组,增加 $index属性,用来处理唯一Index */
|
738
|
+
var localList = (0,external_vue_namespaceObject.computed)(function () {
|
739
|
+
if (props.rowKey !== undefined) {
|
740
|
+
return props.list;
|
741
|
+
}
|
742
|
+
return (props.list || []).map(function (item, index) {
|
743
|
+
return virtual_render_objectSpread(virtual_render_objectSpread({}, item), {}, {
|
744
|
+
$index: index
|
745
|
+
});
|
746
|
+
});
|
747
|
+
});
|
748
|
+
/** 计算出来的当前页数据 */
|
749
|
+
var calcList = (0,external_vue_namespaceObject.computed)(function () {
|
750
|
+
return localList.value.slice(pagination.startIndex * props.groupItemCount, (pagination.endIndex + props.preloadItemCount) * props.groupItemCount);
|
751
|
+
});
|
752
|
+
/** 展示列表内容区域样式 */
|
753
|
+
var innerContentStyle = (0,external_vue_namespaceObject.computed)(function () {
|
754
|
+
return props.scrollPosition === 'content' ? {
|
755
|
+
top: "".concat(pagination.scrollTop + props.scrollOffsetTop, "px"),
|
756
|
+
transform: "translateY(-".concat(pagination.translateY, "px)")
|
757
|
+
} : {};
|
758
|
+
});
|
759
|
+
/** 虚拟渲染外层容器样式 */
|
760
|
+
var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
|
761
|
+
var _props$maxHeight;
|
762
|
+
var height = typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
|
763
|
+
return virtual_render_objectSpread(virtual_render_objectSpread({
|
764
|
+
height: height,
|
765
|
+
width: typeof props.width === 'number' ? "".concat(props.width, "px") : props.width,
|
766
|
+
display: 'inline-block',
|
767
|
+
maxHeight: (_props$maxHeight = props.maxHeight) !== null && _props$maxHeight !== void 0 ? _props$maxHeight : height
|
768
|
+
}, props.scrollPosition === 'container' ? innerContentStyle.value : {}), props.wrapperStyle);
|
769
|
+
});
|
770
|
+
/** 虚拟渲染区域内置占位区域样式,用来撑起总高度,出现滚动条 */
|
771
|
+
var innerStyle = (0,external_vue_namespaceObject.computed)(function () {
|
772
|
+
var isHidden = typeof props.abosuteHeight === 'number' && props.abosuteHeight === 0;
|
773
|
+
return {
|
774
|
+
height: "".concat(innerHeight.value < props.minHeight ? props.minHeight : innerHeight.value, "px"),
|
775
|
+
display: isHidden ? 'none' : 'block'
|
776
|
+
};
|
777
|
+
});
|
778
|
+
var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
|
779
|
+
resolveClassName = _usePrefix.resolveClassName;
|
780
|
+
/** 外层样式列表 */
|
781
|
+
var wrapperClass = (0,external_vue_namespaceObject.computed)(function () {
|
782
|
+
return [resolveClassName('virtual-render'), props.scrollXName, props.scrollYName].concat(_toConsumableArray(resolvePropClassName(props.className)), [props.scrollPosition === 'container' ? resolveClassName('virtual-content') : '']);
|
783
|
+
});
|
784
|
+
/** 内容区域样式列表 */
|
785
|
+
var innerClass = (0,external_vue_namespaceObject.computed)(function () {
|
786
|
+
return [props.scrollPosition === 'content' ? resolveClassName('virtual-content') : ''].concat(_toConsumableArray(resolvePropClassName(props.contentClassName)));
|
787
|
+
});
|
788
|
+
/**
|
789
|
+
* 重置当前配置
|
790
|
+
* @param keepLastPostion
|
791
|
+
*/
|
792
|
+
var reset = function reset() {
|
793
|
+
handleChangeListConfig();
|
794
|
+
afterListDataReset();
|
795
|
+
};
|
796
|
+
var scrollTo = function scrollTo() {
|
797
|
+
var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
798
|
+
left: 0,
|
799
|
+
top: 0
|
800
|
+
};
|
801
|
+
var left = option.left,
|
802
|
+
top = option.top;
|
803
|
+
refRoot.value.scrollTo(left, top);
|
804
|
+
};
|
805
|
+
ctx.expose({
|
806
|
+
reset: reset,
|
807
|
+
scrollTo: scrollTo
|
808
|
+
});
|
809
|
+
return function () {
|
810
|
+
var _ctx$slots$beforeCont, _ctx$slots$beforeCont2, _ctx$slots, _ctx$slots$default, _ctx$slots$default2, _ctx$slots2, _ctx$slots$afterConte, _ctx$slots$afterConte2, _ctx$slots3, _ctx$slots$afterSecti, _ctx$slots$afterSecti2, _ctx$slots4;
|
811
|
+
return (0,external_vue_namespaceObject.h)(
|
812
|
+
// @ts-ignore:next-line
|
813
|
+
renderAs || 'div', {
|
814
|
+
ref: refRoot,
|
815
|
+
"class": wrapperClass.value,
|
816
|
+
style: wrapperStyle.value
|
817
|
+
}, [(_ctx$slots$beforeCont = (_ctx$slots$beforeCont2 = (_ctx$slots = ctx.slots).beforeContent) === null || _ctx$slots$beforeCont2 === void 0 ? void 0 : _ctx$slots$beforeCont2.call(_ctx$slots)) !== null && _ctx$slots$beforeCont !== void 0 ? _ctx$slots$beforeCont : '', (0,external_vue_namespaceObject.h)(contentAs || 'div', {
|
818
|
+
"class": innerClass.value,
|
819
|
+
style: virtual_render_objectSpread(virtual_render_objectSpread({}, innerContentStyle.value), props.contentStyle)
|
820
|
+
}, [(_ctx$slots$default = (_ctx$slots$default2 = (_ctx$slots2 = ctx.slots)["default"]) === null || _ctx$slots$default2 === void 0 ? void 0 : _ctx$slots$default2.call(_ctx$slots2, {
|
821
|
+
data: calcList.value
|
822
|
+
})) !== null && _ctx$slots$default !== void 0 ? _ctx$slots$default : '']), (_ctx$slots$afterConte = (_ctx$slots$afterConte2 = (_ctx$slots3 = ctx.slots).afterContent) === null || _ctx$slots$afterConte2 === void 0 ? void 0 : _ctx$slots$afterConte2.call(_ctx$slots3)) !== null && _ctx$slots$afterConte !== void 0 ? _ctx$slots$afterConte : '', (0,external_vue_namespaceObject.h)('div', {
|
823
|
+
"class": [resolveClassName('virtual-section')],
|
824
|
+
style: innerStyle.value
|
825
|
+
}), (_ctx$slots$afterSecti = (_ctx$slots$afterSecti2 = (_ctx$slots4 = ctx.slots).afterSection) === null || _ctx$slots$afterSecti2 === void 0 ? void 0 : _ctx$slots$afterSecti2.call(_ctx$slots4)) !== null && _ctx$slots$afterSecti !== void 0 ? _ctx$slots$afterSecti : '']);
|
826
|
+
};
|
827
|
+
}
|
828
|
+
}));
|
829
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/index.ts
|
830
|
+
/*
|
831
|
+
* Tencent is pleased to support the open source community by making
|
832
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
833
|
+
*
|
834
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
835
|
+
*
|
836
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
837
|
+
*
|
838
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
839
|
+
*
|
840
|
+
* ---------------------------------------------------
|
841
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
842
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
843
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
844
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
845
|
+
*
|
846
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
847
|
+
* the Software.
|
848
|
+
*
|
849
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
850
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
851
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
852
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
853
|
+
* IN THE SOFTWARE.
|
854
|
+
*/
|
855
|
+
/**
|
856
|
+
* @file virtual-render enter
|
857
|
+
*
|
858
|
+
* Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
|
859
|
+
*/
|
860
|
+
|
861
|
+
|
862
|
+
var BkVirtualRender = (0,external_shared_namespaceObject.withInstall)(virtual_render);
|
863
|
+
/* harmony default export */ const src = (BkVirtualRender);
|
864
|
+
var __webpack_exports__default = __webpack_exports__.Z;
|
865
|
+
export { __webpack_exports__default as default };
|