bkui-vue 0.0.2-beta.36 → 0.0.2-beta.37

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.
Files changed (169) hide show
  1. package/lib/affix/index.js +391 -1
  2. package/lib/alert/index.js +287 -1
  3. package/lib/animate-number/index.js +219 -1
  4. package/lib/backtop/index.js +264 -1
  5. package/lib/badge/index.js +304 -1
  6. package/lib/breadcrumb/index.js +379 -1
  7. package/lib/button/index.js +403 -1
  8. package/lib/card/index.js +369 -1
  9. package/lib/cascader/index.js +2095 -2
  10. package/lib/checkbox/index.js +602 -1
  11. package/lib/code-diff/index.js +5548 -1
  12. package/lib/collapse/index.js +605 -1
  13. package/lib/collapse-transition/index.js +237 -1
  14. package/lib/color-picker/index.js +2735 -1
  15. package/lib/components.js +770 -1
  16. package/lib/config-provider/index.js +377 -1
  17. package/lib/container/index.js +408 -1
  18. package/lib/date-picker/index.js +5576 -1
  19. package/lib/dialog/index.js +1324 -2
  20. package/lib/directives/index.js +1386 -2
  21. package/lib/dist.index.js +179 -1
  22. package/lib/divider/index.js +237 -1
  23. package/lib/dropdown/index.js +455 -1
  24. package/lib/exception/index.js +435 -1
  25. package/lib/fixed-navbar/index.js +222 -1
  26. package/lib/form/index.js +1004 -1
  27. package/lib/hooks.js +133 -1
  28. package/lib/icon/angle-double-down-line.js +541 -1
  29. package/lib/icon/angle-double-left-line.js +541 -1
  30. package/lib/icon/angle-double-left.js +541 -1
  31. package/lib/icon/angle-double-right-line.js +541 -1
  32. package/lib/icon/angle-double-right.js +541 -1
  33. package/lib/icon/angle-double-up-line.js +541 -1
  34. package/lib/icon/angle-down-fill.js +541 -1
  35. package/lib/icon/angle-down-line.js +541 -1
  36. package/lib/icon/angle-down.js +541 -1
  37. package/lib/icon/angle-left.js +541 -1
  38. package/lib/icon/angle-right.js +541 -1
  39. package/lib/icon/angle-up-fill.js +541 -1
  40. package/lib/icon/angle-up.js +541 -1
  41. package/lib/icon/archive-fill.js +541 -1
  42. package/lib/icon/arrows-left.js +541 -1
  43. package/lib/icon/arrows-right.js +541 -1
  44. package/lib/icon/assistant.js +541 -1
  45. package/lib/icon/audio-fill.js +541 -1
  46. package/lib/icon/bk.js +541 -1
  47. package/lib/icon/circle.js +541 -1
  48. package/lib/icon/close-line.js +541 -1
  49. package/lib/icon/close.js +541 -1
  50. package/lib/icon/code.js +541 -1
  51. package/lib/icon/cog-shape.js +541 -1
  52. package/lib/icon/collapse-left.js +541 -1
  53. package/lib/icon/copy-shape.js +541 -1
  54. package/lib/icon/copy.js +541 -1
  55. package/lib/icon/data-shape.js +541 -1
  56. package/lib/icon/del.js +541 -1
  57. package/lib/icon/doc-fill.js +541 -1
  58. package/lib/icon/done.js +541 -1
  59. package/lib/icon/down-shape.js +541 -1
  60. package/lib/icon/down-small.js +541 -1
  61. package/lib/icon/edit-line.js +541 -1
  62. package/lib/icon/ellipsis.js +541 -1
  63. package/lib/icon/enlarge-line.js +541 -1
  64. package/lib/icon/error.js +541 -1
  65. package/lib/icon/excel-fill.js +541 -1
  66. package/lib/icon/exclamation-circle-shape.js +541 -1
  67. package/lib/icon/eye.js +541 -1
  68. package/lib/icon/filliscreen-line.js +541 -1
  69. package/lib/icon/fix-line.js +541 -1
  70. package/lib/icon/fix-shape.js +541 -1
  71. package/lib/icon/folder-open.js +541 -1
  72. package/lib/icon/folder-shape-open.js +541 -1
  73. package/lib/icon/folder-shape.js +541 -1
  74. package/lib/icon/folder.js +541 -1
  75. package/lib/icon/funnel.js +541 -1
  76. package/lib/icon/help-document-fill.js +541 -1
  77. package/lib/icon/help-fill.js +541 -1
  78. package/lib/icon/help.js +541 -1
  79. package/lib/icon/image-fill.js +563 -1
  80. package/lib/icon/img-error.js +563 -1
  81. package/lib/icon/img-placehoulder.js +563 -1
  82. package/lib/icon/index.js +2353 -1
  83. package/lib/icon/info-line.js +563 -1
  84. package/lib/icon/info.js +563 -1
  85. package/lib/icon/left-shape.js +563 -1
  86. package/lib/icon/left-turn-line.js +563 -1
  87. package/lib/icon/narrow-line.js +563 -1
  88. package/lib/icon/original.js +563 -1
  89. package/lib/icon/pdf-fill.js +563 -1
  90. package/lib/icon/play-shape.js +563 -1
  91. package/lib/icon/plus.js +563 -1
  92. package/lib/icon/ppt-fill.js +563 -1
  93. package/lib/icon/qq.js +563 -1
  94. package/lib/icon/right-shape.js +563 -1
  95. package/lib/icon/right-turn-line.js +563 -1
  96. package/lib/icon/search.js +563 -1
  97. package/lib/icon/share.js +563 -1
  98. package/lib/icon/spinner.js +563 -1
  99. package/lib/icon/success.js +563 -1
  100. package/lib/icon/switcher-loading.js +563 -1
  101. package/lib/icon/text-file.js +563 -1
  102. package/lib/icon/text-fill.js +563 -1
  103. package/lib/icon/transfer.js +563 -1
  104. package/lib/icon/tree-application-shape.js +563 -1
  105. package/lib/icon/unfull-screen.js +563 -1
  106. package/lib/icon/unvisible.js +563 -1
  107. package/lib/icon/up-shape.js +563 -1
  108. package/lib/icon/upload.js +563 -1
  109. package/lib/icon/video-fill.js +563 -1
  110. package/lib/icon/warn.js +563 -1
  111. package/lib/icon/weixin-pro.js +563 -1
  112. package/lib/icon/weixin.js +563 -1
  113. package/lib/image/index.js +681 -1
  114. package/lib/index.js +195 -1
  115. package/lib/info-box/index.js +1514 -2
  116. package/lib/input/index.js +1038 -1
  117. package/lib/link/index.js +232 -1
  118. package/lib/loading/index.js +443 -1
  119. package/lib/locale/index.js +489 -1
  120. package/lib/menu/index.js +793 -1
  121. package/lib/message/index.js +1842 -2
  122. package/lib/modal/index.js +407 -1
  123. package/lib/navigation/index.js +439 -1
  124. package/lib/notify/index.js +470 -1
  125. package/lib/overflow-title/index.js +547 -1
  126. package/lib/pagination/index.js +974 -1
  127. package/lib/plugin-popover/index.js +4121 -1
  128. package/lib/plugins/index.js +130 -1
  129. package/lib/pop-confirm/index.js +367 -1
  130. package/lib/popover/index.js +4127 -1
  131. package/lib/popover2/index.js +171 -1
  132. package/lib/preset.js +164 -1
  133. package/lib/process/index.js +1146 -2
  134. package/lib/progress/index.js +495 -1
  135. package/lib/radio/index.js +693 -1
  136. package/lib/rate/index.js +406 -1
  137. package/lib/resize-layout/index.js +499 -1
  138. package/lib/search-select/index.js +3024 -2
  139. package/lib/select/index.js +2599 -2
  140. package/lib/shared/index.js +2832 -1
  141. package/lib/sideslider/index.js +1056 -2
  142. package/lib/slider/index.js +1683 -2
  143. package/lib/steps/index.js +1215 -2
  144. package/lib/swiper/index.js +404 -1
  145. package/lib/switcher/index.js +335 -1
  146. package/lib/tab/index.js +935 -1
  147. package/lib/table/index.js +6588 -1
  148. package/lib/table-column/index.js +768 -1
  149. package/lib/tag/index.js +309 -1
  150. package/lib/tag-input/index.js +1758 -1
  151. package/lib/time-picker/index.js +142 -1
  152. package/lib/timeline/index.js +310 -1
  153. package/lib/transfer/index.js +767 -1
  154. package/lib/tree/index.js +2664 -1
  155. package/lib/upload/index.js +3257 -2
  156. package/lib/virtual-render/index.js +806 -1
  157. package/package.json +1 -1
  158. package/lib/cascader/index.js.LICENSE.txt +0 -1
  159. package/lib/dialog/index.js.LICENSE.txt +0 -1
  160. package/lib/directives/index.js.LICENSE.txt +0 -14
  161. package/lib/info-box/index.js.LICENSE.txt +0 -1
  162. package/lib/message/index.js.LICENSE.txt +0 -6
  163. package/lib/process/index.js.LICENSE.txt +0 -1
  164. package/lib/search-select/index.js.LICENSE.txt +0 -1
  165. package/lib/select/index.js.LICENSE.txt +0 -1
  166. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  167. package/lib/slider/index.js.LICENSE.txt +0 -1
  168. package/lib/steps/index.js.LICENSE.txt +0 -1
  169. package/lib/upload/index.js.LICENSE.txt +0 -1
@@ -1 +1,806 @@
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),autoReset:e.PropTypes.bool.def(!0)},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&&e.autoReset&&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
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("../shared"), require("vue"), require("../config-provider"), require("lodash"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["../shared", "vue", "../config-provider", "lodash"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../config-provider"), require("lodash")) : factory(root["../shared"], root["vue"], root["../config-provider"], root["lodash"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__2717__, __WEBPACK_EXTERNAL_MODULE__467__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 2717:
16
+ /***/ ((module) => {
17
+
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE__2717__;
19
+
20
+ /***/ }),
21
+
22
+ /***/ 4212:
23
+ /***/ ((module) => {
24
+
25
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
26
+
27
+ /***/ }),
28
+
29
+ /***/ 467:
30
+ /***/ ((module) => {
31
+
32
+ module.exports = __WEBPACK_EXTERNAL_MODULE__467__;
33
+
34
+ /***/ }),
35
+
36
+ /***/ 748:
37
+ /***/ ((module) => {
38
+
39
+ module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
40
+
41
+ /***/ })
42
+
43
+ /******/ });
44
+ /************************************************************************/
45
+ /******/ // The module cache
46
+ /******/ var __webpack_module_cache__ = {};
47
+ /******/
48
+ /******/ // The require function
49
+ /******/ function __webpack_require__(moduleId) {
50
+ /******/ // Check if module is in cache
51
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
52
+ /******/ if (cachedModule !== undefined) {
53
+ /******/ return cachedModule.exports;
54
+ /******/ }
55
+ /******/ // Create a new module (and put it into the cache)
56
+ /******/ var module = __webpack_module_cache__[moduleId] = {
57
+ /******/ // no module.id needed
58
+ /******/ // no module.loaded needed
59
+ /******/ exports: {}
60
+ /******/ };
61
+ /******/
62
+ /******/ // Execute the module function
63
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
64
+ /******/
65
+ /******/ // Return the exports of the module
66
+ /******/ return module.exports;
67
+ /******/ }
68
+ /******/
69
+ /************************************************************************/
70
+ /******/ /* webpack/runtime/define property getters */
71
+ /******/ (() => {
72
+ /******/ // define getter functions for harmony exports
73
+ /******/ __webpack_require__.d = (exports, definition) => {
74
+ /******/ for(var key in definition) {
75
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
76
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
77
+ /******/ }
78
+ /******/ }
79
+ /******/ };
80
+ /******/ })();
81
+ /******/
82
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
83
+ /******/ (() => {
84
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
85
+ /******/ })();
86
+ /******/
87
+ /******/ /* webpack/runtime/make namespace object */
88
+ /******/ (() => {
89
+ /******/ // define __esModule on exports
90
+ /******/ __webpack_require__.r = (exports) => {
91
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
92
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
93
+ /******/ }
94
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
95
+ /******/ };
96
+ /******/ })();
97
+ /******/
98
+ /************************************************************************/
99
+ var __webpack_exports__ = {};
100
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
101
+ (() => {
102
+ // ESM COMPAT FLAG
103
+ __webpack_require__.r(__webpack_exports__);
104
+
105
+ // EXPORTS
106
+ __webpack_require__.d(__webpack_exports__, {
107
+ "default": () => (/* binding */ src)
108
+ });
109
+
110
+ // EXTERNAL MODULE: external "../shared"
111
+ var external_shared_ = __webpack_require__(4212);
112
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
113
+ function _arrayLikeToArray(arr, len) {
114
+ if (len == null || len > arr.length) len = arr.length;
115
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
116
+ return arr2;
117
+ }
118
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
119
+
120
+ function _arrayWithoutHoles(arr) {
121
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
122
+ }
123
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
124
+ function _iterableToArray(iter) {
125
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
126
+ }
127
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
128
+
129
+ function _unsupportedIterableToArray(o, minLen) {
130
+ if (!o) return;
131
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
132
+ var n = Object.prototype.toString.call(o).slice(8, -1);
133
+ if (n === "Object" && o.constructor) n = o.constructor.name;
134
+ if (n === "Map" || n === "Set") return Array.from(o);
135
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
136
+ }
137
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
138
+ function _nonIterableSpread() {
139
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
140
+ }
141
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
142
+
143
+
144
+
145
+
146
+ function _toConsumableArray(arr) {
147
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
148
+ }
149
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
150
+ function _typeof(obj) {
151
+ "@babel/helpers - typeof";
152
+
153
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
154
+ return typeof obj;
155
+ } : function (obj) {
156
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
157
+ }, _typeof(obj);
158
+ }
159
+ // EXTERNAL MODULE: external "vue"
160
+ var external_vue_ = __webpack_require__(748);
161
+ // EXTERNAL MODULE: external "../config-provider"
162
+ var external_config_provider_ = __webpack_require__(2717);
163
+ ;// CONCATENATED MODULE: ../../packages/virtual-render/src/props.ts
164
+ /*
165
+ * Tencent is pleased to support the open source community by making
166
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
167
+ *
168
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
169
+ *
170
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
171
+ *
172
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
173
+ *
174
+ * ---------------------------------------------------
175
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
176
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
177
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
178
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
179
+ *
180
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
181
+ * the Software.
182
+ *
183
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
184
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
185
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
186
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
187
+ * IN THE SOFTWARE.
188
+ */
189
+
190
+ var EventProps = {
191
+ onContentScroll: Function
192
+ };
193
+ var virtualRenderProps = Object.assign({
194
+ /** 传入原始数据源 */
195
+ list: external_shared_.PropTypes.array.def([]),
196
+ /**
197
+ * 是否启用此功能
198
+ * 如果设置为false,则此组件只会渲染两层指定的 容器,默认渲染两层 div
199
+ * 设置为true才会启用所有的虚拟渲染 & 滚动相关计算
200
+ * 此属性设置为了兼容需要按需开启\关闭虚拟渲染场景,避免外层设计两套样式架构
201
+ * Note: 目前此属性不支持动态修改
202
+ */
203
+ enabled: external_shared_.PropTypes.bool.def(true),
204
+ /**
205
+ * 是否启用内置的Scroll Listener
206
+ * 当启用虚拟滚动时(enabled = true),滚动监听为内置生效
207
+ * 只有当(enabled = false)时此配置项才生效
208
+ */
209
+ scrollEvent: external_shared_.PropTypes.bool.def(false),
210
+ /**
211
+ * 每行数据高度
212
+ * 默认为数值类型,默认高度 30px
213
+ * 如果每行高度不一致,可为回调函数:(index: number, row: any[]): number => {}
214
+ * 函数参数为当前行index & 当前行数据 row,row为数组,当不分组时,为当前行item
215
+ * 如果有分组展示, index 为当前分组 index, row为数组,当前行分组所有 item 数据
216
+ */
217
+ lineHeight: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.func]).def(30),
218
+ /** 整体最小高度 */
219
+ minHeight: external_shared_.PropTypes.number.def(30),
220
+ /**
221
+ * 整体高度
222
+ * 可设置具体值,如果设置为 100%,则组件会自动计算外层DOM元素offsetHeight,用于计算可渲染行数
223
+ */
224
+ height: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string.def('100%'), external_shared_.PropTypes.number]).def('100%'),
225
+ /**
226
+ * 渲染区域宽度
227
+ * 如果设置 100% 则自适应外层元素宽度
228
+ */
229
+ width: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string.def('100%'), external_shared_.PropTypes.number]).def('100%'),
230
+ /** 最外层元素ClassName */
231
+ className: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.string), external_shared_.PropTypes.object, external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.object), external_shared_.PropTypes.string]).def(''),
232
+ /** 内层层元素ClassName */
233
+ contentClassName: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.string), external_shared_.PropTypes.object, external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.object), external_shared_.PropTypes.string]).def(''),
234
+ /** 内层元素样式 */
235
+ contentStyle: external_shared_.PropTypes.object.def({}),
236
+ /** 用于自定义X轴滚动条样式 */
237
+ scrollXName: external_shared_.PropTypes.string.def((0,external_shared_.resolveClassName)('F-scroll-x')),
238
+ /** 用于自定义Y轴滚动条样式 */
239
+ scrollYName: external_shared_.PropTypes.string.def((0,external_shared_.resolveClassName)('F-scroll-y')),
240
+ /** 分组展示,一行数据可能有多条数据 */
241
+ groupItemCount: external_shared_.PropTypes.number.def(1),
242
+ /** 预加载行数,避免空白渲染 */
243
+ preloadItemCount: external_shared_.PropTypes.number.def(1),
244
+ /** 外层Dom元素需要渲染成的目标元素 */
245
+ renderAs: external_shared_.PropTypes.string.def('div'),
246
+ /** 内容层渲染成目标元素 */
247
+ contentAs: external_shared_.PropTypes.string.def('div'),
248
+ /** top 滚动填充 */
249
+ scrollOffsetTop: external_shared_.PropTypes.number.def(0),
250
+ /**
251
+ * 内置滚动位置
252
+ * 可选:container (最外层容器),content(内容层容器)
253
+ * Note: container 慎选,需要自己处理样式 & 位置
254
+ */
255
+ scrollPosition: external_shared_.PropTypes.string.def('content'),
256
+ /**
257
+ * 绝对高度 | 实际高估
258
+ * 可选值: auto(根据行高和行数计算, LineHeight * List.length) number(外层给定高度,若为0,则不显示)
259
+ */
260
+ abosuteHeight: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string.def('auto'), external_shared_.PropTypes.number]).def('auto'),
261
+ /**
262
+ * 滚动刷新计算间隔时间
263
+ * 默认60 ms
264
+ */
265
+ throttleDelay: external_shared_.PropTypes.number.def(60),
266
+ rowKey: external_shared_.PropTypes.string.def(undefined),
267
+ /**
268
+ * 数据改变时是否保持之前的状态
269
+ * 保持滚动条位置、当前渲染区间
270
+ */
271
+ keepAlive: external_shared_.PropTypes.bool.def(false),
272
+ /**
273
+ * 数据监听改变时,是否自动重置位置到[0, 0]
274
+ */
275
+ autoReset: external_shared_.PropTypes.bool.def(true)
276
+ }, EventProps);
277
+ ;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-tag-render.tsx
278
+ /*
279
+ * Tencent is pleased to support the open source community by making
280
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
281
+ *
282
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
283
+ *
284
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
285
+ *
286
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
287
+ *
288
+ * ---------------------------------------------------
289
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
290
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
291
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
292
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
293
+ *
294
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
295
+ * the Software.
296
+ *
297
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
298
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
299
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
300
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
301
+ * IN THE SOFTWARE.
302
+ */
303
+
304
+ /* harmony default export */ const use_tag_render = (function (props, ctx) {
305
+ var renderAs = props.renderAs,
306
+ contentAs = props.contentAs;
307
+ /** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
308
+ var handleScrollCallback = function handleScrollCallback(event, _startIndex, _endIndex, _scrollTop, translateY, scrollLeft, pos) {
309
+ ctx.emit('content-scroll', [event, {
310
+ translateY: translateY,
311
+ translateX: scrollLeft,
312
+ pos: pos
313
+ }]);
314
+ };
315
+ var vVirtualRender = (0,external_vue_.resolveDirective)('bkVirtualRender');
316
+ var dirModifier = {
317
+ lineHeight: props.lineHeight,
318
+ handleScrollCallback: handleScrollCallback,
319
+ pagination: {},
320
+ throttleDelay: props.throttleDelay,
321
+ onlyScroll: props.scrollEvent
322
+ };
323
+ var refRoot = (0,external_vue_.ref)(null);
324
+ var scrollTo = function scrollTo(_ref) {
325
+ var _ref$left = _ref.left,
326
+ left = _ref$left === void 0 ? 0 : _ref$left,
327
+ _ref$top = _ref.top,
328
+ top = _ref$top === void 0 ? 0 : _ref$top;
329
+ refRoot.value.scrollTo(left, top);
330
+ };
331
+ ctx.expose({
332
+ scrollTo: scrollTo
333
+ });
334
+ return {
335
+ rendAsTag: function rendAsTag() {
336
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
337
+ return (0,external_vue_.h)(
338
+ // @ts-ignore:next-line
339
+ renderAs, {
340
+ "class": props.className,
341
+ ref: refRoot
342
+ }, [(_c = (_b = (_a = ctx.slots).beforeContent) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '', (0,external_vue_.withDirectives)((0,external_vue_.h)(contentAs, {
343
+ "class": props.contentClassName,
344
+ style: props.contentStyle
345
+ }, [(_f = (_e = (_d = ctx.slots)["default"]) === null || _e === void 0 ? void 0 : _e.call(_d, {
346
+ data: props.list
347
+ })) !== null && _f !== void 0 ? _f : '']), [[vVirtualRender, dirModifier]]), (_j = (_h = (_g = ctx.slots).afterContent) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : '', (_m = (_l = (_k = ctx.slots).afterSection) === null || _l === void 0 ? void 0 : _l.call(_k)) !== null && _m !== void 0 ? _m : '']);
348
+ }
349
+ };
350
+ });
351
+ // EXTERNAL MODULE: external "lodash"
352
+ var external_lodash_ = __webpack_require__(467);
353
+ ;// CONCATENATED MODULE: ../../packages/virtual-render/src/v-virtual-render.ts
354
+ var _this = undefined;
355
+ /*
356
+ * Tencent is pleased to support the open source community by making
357
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
358
+ *
359
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
360
+ *
361
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
362
+ *
363
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
364
+ *
365
+ * ---------------------------------------------------
366
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
367
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
368
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
369
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
370
+ *
371
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
372
+ * the Software.
373
+ *
374
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
375
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
376
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
377
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
378
+ * IN THE SOFTWARE.
379
+ */
380
+ /**
381
+ * @file v-virtual-render
382
+ *
383
+ * Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
384
+ */
385
+
386
+ function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
387
+ var startIndex = 0;
388
+ var height = 0;
389
+ var diffHeight = 0;
390
+ var lastHeight = 0;
391
+ for (; startIndex < maxCount; startIndex++) {
392
+ lastHeight = callback(startIndex, [startIndex * groupItemCount, (startIndex + 1) * groupItemCount, 'virtual']);
393
+ if (height + lastHeight > maxHeight) {
394
+ diffHeight = maxHeight - height;
395
+ break;
396
+ }
397
+ height += lastHeight;
398
+ }
399
+ return {
400
+ startIndex: startIndex,
401
+ height: height,
402
+ diffHeight: diffHeight
403
+ };
404
+ }
405
+ function computedVirtualIndex(lineHeight, callback, pagination, el, event) {
406
+ if (!el) {
407
+ return;
408
+ }
409
+ var elScrollTop = el.scrollTop;
410
+ var elScrollLeft = el.scrollLeft;
411
+ var scrollTop = pagination.scrollTop,
412
+ count = pagination.count,
413
+ groupItemCount = pagination.groupItemCount,
414
+ startIndex = pagination.startIndex,
415
+ endIndex = pagination.endIndex,
416
+ scrollLeft = pagination.scrollLeft;
417
+ var offsetHeight = el.offsetHeight;
418
+ var targetStartIndex = 0;
419
+ var targetEndIndex = 0;
420
+ var translateY = 0;
421
+ if (typeof lineHeight === 'number') {
422
+ targetStartIndex = Math.floor(elScrollTop / lineHeight);
423
+ targetEndIndex = Math.ceil(offsetHeight / lineHeight) + targetStartIndex;
424
+ translateY = elScrollTop % lineHeight;
425
+ }
426
+ if (typeof lineHeight === 'function') {
427
+ var startValue = getMatchedIndex(count, elScrollTop, groupItemCount, lineHeight);
428
+ targetStartIndex = startValue.startIndex > 0 ? startValue.startIndex : 0;
429
+ translateY = startValue.diffHeight;
430
+ var endValue = getMatchedIndex(count, offsetHeight, groupItemCount, lineHeight);
431
+ targetEndIndex = endValue.startIndex + targetStartIndex + 1;
432
+ }
433
+ if (elScrollTop !== scrollTop || targetStartIndex !== startIndex || targetEndIndex !== endIndex || scrollLeft !== elScrollLeft) {
434
+ var bottom = el.scrollHeight - el.offsetHeight - el.scrollTop;
435
+ typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop, translateY, elScrollLeft, {
436
+ bottom: bottom >= 0 ? bottom : 0
437
+ });
438
+ }
439
+ }
440
+ function visibleRender(e, wrapper, binding) {
441
+ var _binding$value = binding.value,
442
+ _binding$value$lineHe = _binding$value.lineHeight,
443
+ lineHeight = _binding$value$lineHe === void 0 ? 30 : _binding$value$lineHe,
444
+ handleScrollCallback = _binding$value.handleScrollCallback,
445
+ _binding$value$pagina = _binding$value.pagination,
446
+ pagination = _binding$value$pagina === void 0 ? {} : _binding$value$pagina,
447
+ onlyScroll = _binding$value.onlyScroll;
448
+ if (onlyScroll) {
449
+ var elScrollTop = wrapper.scrollTop;
450
+ var elScrollLeft = wrapper.scrollLeft;
451
+ var bottom = wrapper.scrollHeight - wrapper.offsetHeight - wrapper.scrollTop;
452
+ handleScrollCallback(e, null, null, elScrollTop, elScrollTop, elScrollLeft, {
453
+ bottom: bottom >= 0 ? bottom : 0
454
+ });
455
+ return;
456
+ }
457
+ var startIndex = pagination.startIndex,
458
+ endIndex = pagination.endIndex,
459
+ groupItemCount = pagination.groupItemCount,
460
+ count = pagination.count,
461
+ scrollTop = pagination.scrollTop,
462
+ scrollLeft = pagination.scrollLeft;
463
+ computedVirtualIndex(lineHeight, handleScrollCallback, {
464
+ scrollTop: scrollTop,
465
+ startIndex: startIndex,
466
+ endIndex: endIndex,
467
+ groupItemCount: groupItemCount,
468
+ count: count,
469
+ scrollLeft: scrollLeft
470
+ }, wrapper, e);
471
+ }
472
+ var throttledRender = function throttledRender() {
473
+ var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 60;
474
+ return (0,external_lodash_.throttle)(function (e, wrapper, binding) {
475
+ return visibleRender(e, wrapper, binding);
476
+ }, delay);
477
+ };
478
+ // const debounceRender = (delay = 60) => debounce((e, wrapper, binding) => visibleRender(e, wrapper, binding), delay);
479
+ var executeThrottledRender = function executeThrottledRender(e, wrapper, binding) {
480
+ var delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 60;
481
+ Reflect.apply(throttledRender(delay), _this, [e, wrapper, binding]);
482
+ };
483
+ /* harmony default export */ const v_virtual_render = ({
484
+ mounted: function mounted(el, binding) {
485
+ var wrapper = el.parentNode;
486
+ var throttleDelay = binding.value.throttleDelay;
487
+ wrapper.addEventListener('scroll', function (e) {
488
+ // @ts-ignore:next-line
489
+ executeThrottledRender(e, wrapper, binding, throttleDelay);
490
+ });
491
+ },
492
+ unbind: function unbind(el) {
493
+ if (el) {
494
+ var wrapper = el.parentNode;
495
+ if (!wrapper) {
496
+ return;
497
+ }
498
+ wrapper.removeEventListener('scroll', throttledRender);
499
+ }
500
+ }
501
+ });
502
+ ;// CONCATENATED MODULE: ../../packages/virtual-render/src/virtual-render.tsx
503
+
504
+
505
+ /*
506
+ * Tencent is pleased to support the open source community by making
507
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
508
+ *
509
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
510
+ *
511
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
512
+ *
513
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
514
+ *
515
+ * ---------------------------------------------------
516
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
517
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
518
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
519
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
520
+ *
521
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
522
+ * the Software.
523
+ *
524
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
525
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
526
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
527
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
528
+ * IN THE SOFTWARE.
529
+ */
530
+ /**
531
+ * @file virtual-render
532
+ *
533
+ * Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
534
+ */
535
+
536
+
537
+
538
+
539
+
540
+ /* harmony default export */ const virtual_render = ((0,external_vue_.defineComponent)({
541
+ name: 'VirtualRender',
542
+ directives: {
543
+ bkVirtualRender: v_virtual_render
544
+ },
545
+ props: virtualRenderProps,
546
+ emits: ['content-scroll'],
547
+ slots: Object,
548
+ setup: function setup(props, ctx) {
549
+ var _this = this;
550
+ var renderAs = props.renderAs,
551
+ contentAs = props.contentAs;
552
+ var resolvePropClassName = function resolvePropClassName(prop) {
553
+ if (typeof prop === 'string') {
554
+ return [prop];
555
+ }
556
+ if (_typeof(prop) === 'object' && !Array.isArray(prop)) {
557
+ return [prop];
558
+ }
559
+ return prop;
560
+ };
561
+ if (!props.enabled) {
562
+ var _useTagRender = use_tag_render(props, ctx),
563
+ rendAsTag = _useTagRender.rendAsTag;
564
+ return rendAsTag;
565
+ }
566
+ var refRoot = (0,external_vue_.ref)(null);
567
+ var pagination = (0,external_vue_.reactive)({
568
+ startIndex: 0,
569
+ endIndex: 0,
570
+ scrollTop: 1,
571
+ scrollLeft: 0,
572
+ translateY: 0,
573
+ translateX: 0,
574
+ count: 0,
575
+ pos: {},
576
+ groupItemCount: props.groupItemCount
577
+ });
578
+ /** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
579
+ var handleScrollCallback = function handleScrollCallback(event, startIndex, endIndex, scrollTop, translateY, scrollLeft, pos) {
580
+ pagination.startIndex = startIndex;
581
+ pagination.endIndex = endIndex;
582
+ pagination.scrollTop = scrollTop;
583
+ // 设置偏移量,避免行高较大时出现卡顿式的滚动
584
+ pagination.translateY = translateY;
585
+ pagination.translateX = scrollLeft;
586
+ pagination.scrollLeft = scrollLeft;
587
+ pagination.pos = pos;
588
+ ctx.emit('content-scroll', [event, pagination]);
589
+ };
590
+ // const quequeScroll = [];
591
+ (0,external_vue_.onMounted)(function () {
592
+ (0,external_vue_.nextTick)(function () {
593
+ handleListChanged(props.list);
594
+ afterListDataReset();
595
+ });
596
+ });
597
+ (0,external_vue_.watch)(function () {
598
+ return props.list;
599
+ }, function () {
600
+ var scrollToOpt = {
601
+ left: 0,
602
+ top: 0
603
+ };
604
+ scrollToOpt = {
605
+ left: pagination.scrollLeft,
606
+ top: pagination.scrollTop
607
+ };
608
+ handleChangeListConfig();
609
+ afterListDataReset();
610
+ if (props.keepAlive) {
611
+ scrollTo(scrollToOpt);
612
+ }
613
+ }, {
614
+ deep: true
615
+ });
616
+ (0,external_vue_.watch)(function () {
617
+ return props.lineHeight;
618
+ }, function () {
619
+ handleChangeListConfig();
620
+ afterListDataReset();
621
+ });
622
+ var handleChangeListConfig = function handleChangeListConfig() {
623
+ /** 数据改变时激活当前表单,使其渲染DOM */
624
+ handleListChanged(props.list);
625
+ };
626
+ /** 如果有分组状态,计算总行数 */
627
+ var listLength = (0,external_vue_.ref)(0);
628
+ /** 实际高度,根据行高和总行数计算出来的实际高度 */
629
+ var innerHeight = (0,external_vue_.ref)(0);
630
+ /**
631
+ * 列表数据改变时,处理相关参数
632
+ */
633
+ var handleListChanged = function handleListChanged(list) {
634
+ listLength.value = Math.ceil((list || []).length / props.groupItemCount);
635
+ pagination.count = listLength.value;
636
+ pagination.startIndex = 0;
637
+ pagination.endIndex = 0;
638
+ pagination.translateY = 0;
639
+ pagination.scrollTop = 0;
640
+ var isAuto = typeof props.abosuteHeight === 'string' && props.abosuteHeight === 'auto';
641
+ if (isAuto) {
642
+ if (typeof props.lineHeight === 'function') {
643
+ innerHeight.value = 0;
644
+ var fnValue = 0;
645
+ for (var i = 0; i < listLength.value; i++) {
646
+ var fnVal = props.lineHeight.call(_this, i, list.slice(i * props.groupItemCount, props.groupItemCount));
647
+ fnValue += typeof fnVal === 'number' ? fnVal : 0;
648
+ }
649
+ innerHeight.value = fnValue;
650
+ } else {
651
+ innerHeight.value = props.lineHeight * listLength.value;
652
+ }
653
+ } else {
654
+ innerHeight.value = props.abosuteHeight;
655
+ }
656
+ };
657
+ /** 列表数据重置之后的处理事项 */
658
+ var afterListDataReset = function afterListDataReset() {
659
+ var scrollToOpt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
660
+ left: 0,
661
+ top: 0
662
+ };
663
+ var _a;
664
+ var el = (_a = refRoot.value) === null || _a === void 0 ? void 0 : _a.parentNode;
665
+ computedVirtualIndex(props.lineHeight, handleScrollCallback, pagination, el, null);
666
+ if (scrollToOpt && refRoot.value && props.autoReset) {
667
+ scrollTo(scrollToOpt);
668
+ }
669
+ };
670
+ /** 映射传入的数组为新的数组,增加 $index属性,用来处理唯一Index */
671
+ var localList = (0,external_vue_.computed)(function () {
672
+ if (props.rowKey !== undefined) {
673
+ return props.list;
674
+ }
675
+ return (props.list || []).map(function (item, index) {
676
+ return Object.assign(Object.assign({}, item), {
677
+ $index: index
678
+ });
679
+ });
680
+ });
681
+ /** 计算出来的当前页数据 */
682
+ var calcList = (0,external_vue_.computed)(function () {
683
+ return localList.value.slice(pagination.startIndex * props.groupItemCount, (pagination.endIndex + props.preloadItemCount) * props.groupItemCount);
684
+ });
685
+ /** 展示列表内容区域样式 */
686
+ var innerContentStyle = (0,external_vue_.computed)(function () {
687
+ return props.scrollPosition === 'content' ? {
688
+ top: "".concat(pagination.scrollTop + props.scrollOffsetTop, "px"),
689
+ transform: "translateY(-".concat(pagination.translateY, "px)")
690
+ } : {};
691
+ });
692
+ /** 虚拟渲染外层容器样式 */
693
+ var wrapperStyle = (0,external_vue_.computed)(function () {
694
+ return Object.assign({
695
+ height: typeof props.height === 'number' ? "".concat(props.height, "px") : props.height,
696
+ width: typeof props.width === 'number' ? "".concat(props.width, "px") : props.width,
697
+ display: 'inline-block'
698
+ }, props.scrollPosition === 'container' ? innerContentStyle.value : {});
699
+ });
700
+ /** 虚拟渲染区域内置占位区域样式,用来撑起总高度,出现滚动条 */
701
+ var innerStyle = (0,external_vue_.computed)(function () {
702
+ var isHidden = typeof props.abosuteHeight === 'number' && props.abosuteHeight === 0;
703
+ return {
704
+ height: "".concat(innerHeight.value < props.minHeight ? props.minHeight : innerHeight.value, "px"),
705
+ display: isHidden ? 'none' : 'block'
706
+ };
707
+ });
708
+ var _usePrefix = (0,external_config_provider_.usePrefix)(),
709
+ resolveClassName = _usePrefix.resolveClassName;
710
+ /** 外层样式列表 */
711
+ var wrapperClass = (0,external_vue_.computed)(function () {
712
+ return [resolveClassName('virtual-render'), props.scrollXName, props.scrollYName].concat(_toConsumableArray(resolvePropClassName(props.className)), [props.scrollPosition === 'container' ? resolveClassName('virtual-content') : '']);
713
+ });
714
+ /** 内容区域样式列表 */
715
+ var innerClass = (0,external_vue_.computed)(function () {
716
+ return [props.scrollPosition === 'content' ? resolveClassName('virtual-content') : ''].concat(_toConsumableArray(resolvePropClassName(props.contentClassName)));
717
+ });
718
+ var vVirtualRender = (0,external_vue_.resolveDirective)('bkVirtualRender');
719
+ var dirModifier = {
720
+ lineHeight: props.lineHeight,
721
+ handleScrollCallback: handleScrollCallback,
722
+ pagination: pagination,
723
+ throttleDelay: props.throttleDelay
724
+ };
725
+ /**
726
+ * 重置当前配置
727
+ * @param keepLastPostion
728
+ */
729
+ var reset = function reset() {
730
+ handleChangeListConfig();
731
+ afterListDataReset();
732
+ };
733
+ var scrollTo = function scrollTo() {
734
+ var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
735
+ left: 0,
736
+ top: 0
737
+ };
738
+ var left = option.left,
739
+ top = option.top;
740
+ refRoot.value.scrollTo(left, top);
741
+ };
742
+ ctx.expose({
743
+ reset: reset,
744
+ scrollTo: scrollTo
745
+ });
746
+ return function () {
747
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
748
+ return (0,external_vue_.h)(
749
+ // @ts-ignore:next-line
750
+ renderAs || 'div', {
751
+ ref: refRoot,
752
+ "class": wrapperClass.value,
753
+ style: wrapperStyle.value
754
+ }, [(_c = (_b = (_a = ctx.slots).beforeContent) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '', (0,external_vue_.withDirectives)((0,external_vue_.h)(contentAs || 'div', {
755
+ "class": innerClass.value,
756
+ style: Object.assign(Object.assign({}, innerContentStyle.value), props.contentStyle)
757
+ }, [(_f = (_e = (_d = ctx.slots)["default"]) === null || _e === void 0 ? void 0 : _e.call(_d, {
758
+ data: calcList.value
759
+ })) !== null && _f !== void 0 ? _f : '']), [[vVirtualRender, dirModifier]]), (_j = (_h = (_g = ctx.slots).afterContent) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : '', (0,external_vue_.h)('div', {
760
+ "class": [resolveClassName('virtual-section')],
761
+ style: innerStyle.value
762
+ }), (_m = (_l = (_k = ctx.slots).afterSection) === null || _l === void 0 ? void 0 : _l.call(_k)) !== null && _m !== void 0 ? _m : '']);
763
+ };
764
+ }
765
+ }));
766
+ ;// CONCATENATED MODULE: ../../packages/virtual-render/src/index.ts
767
+ /*
768
+ * Tencent is pleased to support the open source community by making
769
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
770
+ *
771
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
772
+ *
773
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
774
+ *
775
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
776
+ *
777
+ * ---------------------------------------------------
778
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
779
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
780
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
781
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
782
+ *
783
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
784
+ * the Software.
785
+ *
786
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
787
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
788
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
789
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
790
+ * IN THE SOFTWARE.
791
+ */
792
+ /**
793
+ * @file virtual-render enter
794
+ *
795
+ * Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
796
+ */
797
+
798
+
799
+ var BkVirtualRender = (0,external_shared_.withInstall)(virtual_render);
800
+ /* harmony default export */ const src = (BkVirtualRender);
801
+ })();
802
+
803
+ /******/ return __webpack_exports__;
804
+ /******/ })()
805
+ ;
806
+ });