bkui-vue 0.0.1-beta.466 → 0.0.1-beta.468

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