bkui-vue 0.0.1-beta.61 → 0.0.1-beta.62

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 (215) hide show
  1. package/dist/index.cjs.js +30 -30
  2. package/dist/index.esm.js +1434 -298
  3. package/dist/index.umd.js +28 -28
  4. package/dist/style.css +1 -1
  5. package/lib/affix/affix.css +3 -0
  6. package/lib/affix/affix.d.ts +47 -0
  7. package/lib/affix/affix.less +5 -0
  8. package/lib/affix/affix.variable.css +102 -0
  9. package/lib/affix/index.d.ts +143 -0
  10. package/lib/affix/index.js +1 -0
  11. package/lib/alert/alert.variable.css +5 -0
  12. package/lib/backtop/backtop.d.ts +1 -1
  13. package/lib/backtop/backtop.variable.css +5 -0
  14. package/lib/backtop/index.d.ts +4 -4
  15. package/lib/badge/badge.d.ts +1 -1
  16. package/lib/badge/badge.variable.css +5 -0
  17. package/lib/badge/index.d.ts +4 -4
  18. package/lib/breadcrumb/breadcrumb.variable.css +5 -0
  19. package/lib/button/button.css +2 -1
  20. package/lib/button/button.less +9 -8
  21. package/lib/button/button.variable.css +7 -1
  22. package/lib/button/index.js +1 -1
  23. package/lib/card/card.variable.css +5 -0
  24. package/lib/cascader/cascader-panel.d.ts +48 -0
  25. package/lib/cascader/cascader.css +130 -0
  26. package/lib/cascader/cascader.d.ts +271 -0
  27. package/lib/cascader/cascader.less +146 -0
  28. package/lib/cascader/cascader.variable.css +229 -0
  29. package/lib/cascader/index.d.ts +721 -0
  30. package/lib/cascader/index.js +1 -0
  31. package/lib/cascader/interface.d.ts +44 -0
  32. package/lib/cascader/node.d.ts +24 -0
  33. package/lib/cascader/store.d.ts +15 -0
  34. package/lib/checkbox/checkbox.variable.css +5 -0
  35. package/lib/code-diff/code-diff.variable.css +5 -0
  36. package/lib/code-diff/index.js +1 -1
  37. package/lib/components.d.ts +12 -9
  38. package/lib/components.js +1 -1
  39. package/lib/container/container.variable.css +5 -0
  40. package/lib/container/index.js +1 -1
  41. package/lib/date-picker/date-picker.css +1 -0
  42. package/lib/date-picker/date-picker.d.ts +9 -2
  43. package/lib/date-picker/date-picker.less +1 -0
  44. package/lib/date-picker/date-picker.variable.css +6 -0
  45. package/lib/date-picker/index.d.ts +22 -7
  46. package/lib/date-picker/index.js +1 -1
  47. package/lib/date-picker/props.d.ts +3 -0
  48. package/lib/dialog/dialog.css +10 -1
  49. package/lib/dialog/dialog.d.ts +75 -8
  50. package/lib/dialog/dialog.variable.css +10 -1
  51. package/lib/dialog/index.d.ts +166 -25
  52. package/lib/dialog/index.js +1 -1
  53. package/lib/divider/divider.d.ts +1 -1
  54. package/lib/divider/divider.variable.css +5 -0
  55. package/lib/divider/index.d.ts +4 -4
  56. package/lib/dropdown/dropdown.css +4 -0
  57. package/lib/dropdown/dropdown.less +5 -0
  58. package/lib/dropdown/dropdown.variable.css +9 -0
  59. package/lib/dropdown/index.js +1 -1
  60. package/lib/exception/exception.variable.css +5 -0
  61. package/lib/fixed-navbar/fixed-navbar.d.ts +17 -3
  62. package/lib/fixed-navbar/fixed-navbar.variable.css +5 -0
  63. package/lib/fixed-navbar/index.d.ts +43 -8
  64. package/lib/fixed-navbar/index.js +1 -1
  65. package/lib/form/form-item.d.ts +1 -1
  66. package/lib/form/form.css +4 -0
  67. package/lib/form/form.d.ts +5 -2
  68. package/lib/form/form.less +4 -0
  69. package/lib/form/form.variable.css +9 -0
  70. package/lib/form/index.d.ts +19 -8
  71. package/lib/form/index.js +1 -1
  72. package/lib/icon/archive-fill.d.ts +4 -0
  73. package/lib/icon/archive-fill.js +1 -0
  74. package/lib/icon/audio-fill.d.ts +4 -0
  75. package/lib/icon/audio-fill.js +1 -0
  76. package/lib/icon/del.d.ts +4 -0
  77. package/lib/icon/del.js +1 -0
  78. package/lib/icon/doc-fill.d.ts +4 -0
  79. package/lib/icon/doc-fill.js +1 -0
  80. package/lib/icon/excel-fill.d.ts +4 -0
  81. package/lib/icon/excel-fill.js +1 -0
  82. package/lib/icon/image-fill.d.ts +4 -0
  83. package/lib/icon/image-fill.js +1 -0
  84. package/lib/icon/index.d.ts +12 -1
  85. package/lib/icon/index.js +1 -1
  86. package/lib/icon/pdf-fill.d.ts +4 -0
  87. package/lib/icon/pdf-fill.js +1 -0
  88. package/lib/icon/ppt-fill.d.ts +4 -0
  89. package/lib/icon/ppt-fill.js +1 -0
  90. package/lib/icon/text-fill.d.ts +4 -0
  91. package/lib/icon/text-fill.js +1 -0
  92. package/lib/icon/upload.d.ts +4 -0
  93. package/lib/icon/upload.js +1 -0
  94. package/lib/icon/video-fill.d.ts +4 -0
  95. package/lib/icon/video-fill.js +1 -0
  96. package/lib/input/index.d.ts +8 -8
  97. package/lib/input/input.css +3 -0
  98. package/lib/input/input.d.ts +2 -2
  99. package/lib/input/input.less +3 -0
  100. package/lib/input/input.variable.css +8 -0
  101. package/lib/link/index.d.ts +4 -4
  102. package/lib/link/link.d.ts +1 -1
  103. package/lib/link/link.variable.css +5 -0
  104. package/lib/loading/loading.variable.css +5 -0
  105. package/lib/menu/menu.variable.css +5 -0
  106. package/lib/menu/submenu.variable.css +5 -0
  107. package/lib/message/index.js +1 -1
  108. package/lib/message/message.css +4 -4
  109. package/lib/message/message.less +4 -4
  110. package/lib/message/message.variable.css +9 -4
  111. package/lib/modal/index.d.ts +277 -24
  112. package/lib/modal/index.js +1 -1
  113. package/lib/modal/modal.css +10 -1
  114. package/lib/modal/modal.d.ts +108 -9
  115. package/lib/modal/modal.less +15 -4
  116. package/lib/modal/modal.variable.css +10 -1
  117. package/lib/modal/props.mixin.d.ts +47 -3
  118. package/lib/navigation/index.d.ts +291 -1
  119. package/lib/navigation/index.js +1 -1
  120. package/lib/navigation/navigation.variable.css +5 -0
  121. package/lib/notify/index.js +1 -1
  122. package/lib/notify/notify.css +17 -1
  123. package/lib/notify/notify.less +19 -1
  124. package/lib/notify/notify.variable.css +22 -1
  125. package/lib/notify/notifyConstructor.d.ts +49 -5
  126. package/lib/pagination/index.d.ts +4 -4
  127. package/lib/pagination/pagination.d.ts +1 -1
  128. package/lib/pagination/pagination.variable.css +5 -0
  129. package/lib/popover/index.d.ts +57 -11
  130. package/lib/popover/index.js +1 -1
  131. package/lib/popover/popover.css +3 -0
  132. package/lib/popover/popover.d.ts +26 -4
  133. package/lib/popover/popover.less +2 -0
  134. package/lib/popover/popover.variable.css +8 -0
  135. package/lib/popover/props.d.ts +11 -1
  136. package/lib/process/process.variable.css +5 -0
  137. package/lib/progress/index.d.ts +7 -7
  138. package/lib/progress/progress.d.ts +2 -2
  139. package/lib/progress/progress.variable.css +5 -0
  140. package/lib/radio/radio.variable.css +5 -0
  141. package/lib/resize-layout/resize-layout.variable.css +5 -0
  142. package/lib/select/select.variable.css +5 -0
  143. package/lib/shared/index.d.ts +18 -0
  144. package/lib/shared/index.js +1 -1
  145. package/lib/shared/mask-manager.d.ts +3 -2
  146. package/lib/shared/pop-manager.d.ts +3 -2
  147. package/lib/shared/popover.d.ts +3 -0
  148. package/lib/sideslider/index.d.ts +227 -33
  149. package/lib/sideslider/index.js +1 -1
  150. package/lib/sideslider/sideslider.css +48 -3
  151. package/lib/sideslider/sideslider.d.ts +103 -12
  152. package/lib/sideslider/sideslider.less +65 -6
  153. package/lib/sideslider/sideslider.variable.css +53 -3
  154. package/lib/slider/index.d.ts +414 -1
  155. package/lib/slider/index.js +1 -1
  156. package/lib/slider/slider.variable.css +5 -0
  157. package/lib/steps/steps.variable.css +5 -0
  158. package/lib/styles/index.d.ts +3 -0
  159. package/lib/styles/themes/themes.less +7 -0
  160. package/lib/switcher/switcher.variable.css +5 -0
  161. package/lib/tab/index.d.ts +6 -6
  162. package/lib/tab/tab-panel.d.ts +2 -2
  163. package/lib/tab/tab.d.ts +1 -1
  164. package/lib/tab/tab.variable.css +5 -0
  165. package/lib/table/index.d.ts +4 -4
  166. package/lib/table/index.js +1 -1
  167. package/lib/table/plugins/head-filter.variable.css +5 -0
  168. package/lib/table/plugins/head-sort.variable.css +5 -0
  169. package/lib/table/plugins/settings.variable.css +5 -0
  170. package/lib/table/props.d.ts +4 -0
  171. package/lib/table/render.d.ts +1 -0
  172. package/lib/table/table.css +54 -2
  173. package/lib/table/table.d.ts +1 -1
  174. package/lib/table/table.less +52 -2
  175. package/lib/table/table.variable.css +59 -2
  176. package/lib/table/use-common.d.ts +5 -3
  177. package/lib/table/utils.d.ts +10 -0
  178. package/lib/tag/index.d.ts +3 -3
  179. package/lib/tag/tag.d.ts +1 -1
  180. package/lib/tag/tag.variable.css +5 -0
  181. package/lib/tag-input/index.d.ts +893 -1
  182. package/lib/tag-input/index.js +1 -1
  183. package/lib/tag-input/tag-input.d.ts +1 -1
  184. package/lib/tag-input/tag-input.variable.css +5 -0
  185. package/lib/timeline/timeline.variable.css +5 -0
  186. package/lib/transfer/transfer.variable.css +5 -0
  187. package/lib/tree/index.d.ts +39 -1
  188. package/lib/tree/index.js +1 -1
  189. package/lib/tree/props.d.ts +19 -0
  190. package/lib/tree/tree.css +3 -1
  191. package/lib/tree/tree.d.ts +18 -0
  192. package/lib/tree/tree.less +3 -1
  193. package/lib/tree/tree.variable.css +8 -1
  194. package/lib/tree/use-empty.d.ts +6 -0
  195. package/lib/tree/use-node-attribute.d.ts +1 -0
  196. package/lib/tree/use-search.d.ts +11 -0
  197. package/lib/tree/util.d.ts +2 -1
  198. package/lib/upload/index.d.ts +2 -0
  199. package/lib/upload/index.js +1 -0
  200. package/lib/upload/props.d.ts +113 -0
  201. package/lib/upload/upload-list.d.ts +46 -0
  202. package/lib/upload/upload-trigger.d.ts +54 -0
  203. package/lib/upload/upload.css +374 -0
  204. package/lib/upload/upload.d.ts +252 -0
  205. package/lib/upload/upload.less +455 -0
  206. package/lib/upload/upload.type.d.ts +78 -0
  207. package/lib/upload/upload.variable.css +473 -0
  208. package/lib/upload/use-ajax-upload.d.ts +3 -0
  209. package/lib/upload/use-file-handler.d.ts +44 -0
  210. package/lib/virtual-render/index.d.ts +27 -4
  211. package/lib/virtual-render/index.js +1 -1
  212. package/lib/virtual-render/props.d.ts +10 -0
  213. package/lib/virtual-render/use-tag-render.d.ts +7 -0
  214. package/lib/virtual-render/virtual-render.d.ts +14 -3
  215. package/package.json +2 -2
@@ -1 +1 @@
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 n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,((e,t,o)=>(()=>{"use strict";var n={4212:t=>{t.exports=e},467:e=>{e.exports=o},748:e=>{e.exports=t}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[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 i={};return(()=>{l.r(i),l.d(i,{default:()=>g});var e=l(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}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 n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?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 n(e){return n="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},n(e)}var r=l(748),a={onContentScroll:Function},s=Object.assign({list:e.PropTypes.array.def([]),enabled:e.PropTypes.bool.def(!0),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("bk-scroll-x"),scrollYName:e.PropTypes.string.def("bk-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)},a),u=l(467),c=void 0;function p(e,t,o,n){for(var r=0,l=0,i=0,a=0;r<e;r++){if(l+(a=n(r,[r*o,(r+1)*o,"virtual"]))>t){i=t-l;break}l+=a}return{startIndex:r,height:l,diffHeight:i}}function f(e,t,o,n,r){if(n){var l=n.scrollTop,i=o.scrollTop,a=o.count,s=o.groupItemCount,u=o.startIndex,c=o.endIndex,f=n.offsetHeight,d=0,y=0,v=0;if("number"==typeof e&&(d=Math.floor(l/e),y=Math.ceil(f/e)+d,v=l%e),"function"==typeof e){var m=p(a,l,s,e);d=m.startIndex>0?m.startIndex:0,v=m.diffHeight,y=p(a,f,s,e).startIndex+d+1}l===i&&d===u&&y===c||"function"==typeof t&&t(r,d,y,l,v)}}function d(e,t,o){var n=o.value,r=n.lineHeight,l=void 0===r?30:r,i=n.handleScrollCallback,a=n.pagination,s=void 0===a?{}:a,u=s.startIndex,c=s.endIndex,p=s.groupItemCount,d=s.count;f(l,i,{scrollTop:s.scrollTop,startIndex:u,endIndex:c,groupItemCount:p,count:d},t,e)}var y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return(0,u.throttle)((function(e,t,o){return d(e,t,o)}),e)},v=null,m=function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;v||(v=y(n)),"function"==typeof v&&v.call(c,e,t,o)};const b={mounted:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;o.addEventListener("scroll",(function(e){m(e,o,t,n)}))},updated:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;m(null,o,t,n)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",y)}}},h=(0,r.defineComponent)({name:"VirtualRender",directives:{bkVirtualRender:b},props:s,emits:["content-scroll"],setup:function(e,t){var l=this,i=e.renderAs,a=e.contentAs,s=function(e){return"string"==typeof e?[e]:"object"!==n(e)||Array.isArray(e)?e:[e]};if(!e.enabled)return function(){var o,n,l,u,c,p,f,d,y;return(0,r.h)(i,{class:s(e.className)},[null!==(l=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==l?l:"",(0,r.h)(a,{class:s(e.contentClassName),style:e.contentStyle},[null!==(p=null===(c=(u=t.slots).default)||void 0===c?void 0:c.call(u,{data:e.list}))&&void 0!==p?p:""]),null!==(y=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:""])};var u=(0,r.ref)(null),c=(0,r.reactive)({startIndex:0,endIndex:0,scrollTop:1,translateY:0,count:0,groupItemCount:e.groupItemCount}),p=function(e,o,n,r,l){c.startIndex=o,c.endIndex=n,c.scrollTop=r,c.translateY=l,t.emit("content-scroll",[e,c])};(0,r.onMounted)((function(){(0,r.nextTick)((function(){m(e.list),b()}))})),(0,r.watch)((function(){return e.list}),(function(){d(),b()}),{deep:!0}),(0,r.watch)((function(){return e.lineHeight}),(function(){d(),b()}));var d=function(){m(e.list)},y=(0,r.ref)(0),v=(0,r.ref)(0),m=function(t){if(y.value=Math.ceil((t||[]).length/e.groupItemCount),c.count=y.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){v.value=0;for(var o=0,n=0;n<y.value;n++){var r=e.lineHeight.call(l,n,t.slice(n*e.groupItemCount,e.groupItemCount));o+="number"==typeof r?r:0}v.value=o}else v.value=e.lineHeight*y.value;else v.value=e.abosuteHeight},b=function(){var t,o=null===(t=u.value)||void 0===t?void 0:t.parentNode;f(e.lineHeight,p,c,o,null)},h=(0,r.computed)((function(){return(e.list||[]).map((function(e,t){return Object.assign(Object.assign({},e),{$index:t})}))})),g=(0,r.computed)((function(){return h.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)})),T=(0,r.computed)((function(){return"content"===e.scrollPosition?{top:"".concat(c.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(c.translateY,"px)")}:{}})),P=(0,r.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?T.value:{})})),x=(0,r.computed)((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(v.value<e.minHeight?e.minHeight:v.value,"px"),display:t?"none":"block"}})),I=(0,r.computed)((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(o(s(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=(0,r.computed)((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(o(s(e.contentClassName)))})),O=(0,r.resolveDirective)("bkVirtualRender"),j={lineHeight:e.lineHeight,handleScrollCallback:p,pagination:c,throttleDelay:e.throttleDelay};return t.expose({reset:function(){d(),b()}}),function(){var o,n,l,s,c,p,f,d,y;return(0,r.h)(i||"div",{ref:u,class:I.value,style:P.value},[null!==(l=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==l?l:"",(0,r.withDirectives)((0,r.h)(a||"div",{class:C.value,style:Object.assign(Object.assign({},T.value),e.contentStyle)},[null!==(p=null===(c=(s=t.slots).default)||void 0===c?void 0:c.call(s,{data:g.value}))&&void 0!==p?p:""]),[[O,j]]),null!==(y=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:"",(0,r.h)("div",{class:["bk-virtual-section"],style:x.value})])}}}),g=(0,e.withInstall)(h)})(),i})()));
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 n="object"==typeof exports?t(require("../shared"),require("vue"),require("lodash")):t(e["../shared"],e.vue,e.lodash);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,((e,t,n)=>(()=>{"use strict";var o={4212:t=>{t.exports=e},467:e=>{e.exports=n},748:e=>{e.exports=t}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return o[e](n,n.exports,l),n.exports}l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 i={};return(()=>{l.r(i),l.d(i,{default:()=>g});var e=l(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function n(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,n){if(e){if("string"==typeof e)return t(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):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 o(e){return o="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},o(e)}var r=l(748),a={onContentScroll:Function},s=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("bk-scroll-x"),scrollYName:e.PropTypes.string.def("bk-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)},a),u=l(467),c=void 0;function p(e,t,n,o){for(var r=0,l=0,i=0,a=0;r<e;r++){if(l+(a=o(r,[r*n,(r+1)*n,"virtual"]))>t){i=t-l;break}l+=a}return{startIndex:r,height:l,diffHeight:i}}function f(e,t,n,o,r){if(o){var l=o.scrollTop,i=o.scrollLeft,a=n.scrollTop,s=n.count,u=n.groupItemCount,c=n.startIndex,f=n.endIndex,d=o.offsetHeight,y=0,v=0,h=0;if("number"==typeof e&&(y=Math.floor(l/e),v=Math.ceil(d/e)+y,h=l%e),"function"==typeof e){var b=p(s,l,u,e);y=b.startIndex>0?b.startIndex:0,h=b.diffHeight,v=p(s,d,u,e).startIndex+y+1}l===a&&y===c&&v===f||"function"==typeof t&&t(r,y,v,l,h,i)}}function d(e,t,n){var o=n.value,r=o.lineHeight,l=void 0===r?30:r,i=o.handleScrollCallback,a=o.pagination,s=void 0===a?{}:a;if(o.onlyScroll){var u=t.scrollTop;i(e,null,null,u,u,t.scrollLeft)}else{var c=s.startIndex,p=s.endIndex,d=s.groupItemCount,y=s.count;f(l,i,{scrollTop:s.scrollTop,startIndex:c,endIndex:p,groupItemCount:d,count:y},t,e)}}var y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return(0,u.throttle)((function(e,t,n){return d(e,t,n)}),e)},v=null,h=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;v||(v=y(o)),"function"==typeof v&&v.call(c,e,t,n)};const b={mounted:function(e,t){var n=e.parentNode,o=t.value.throttleDelay;n.addEventListener("scroll",(function(e){h(e,n,t,o)}))},updated:function(e,t){var n=e.parentNode,o=t.value.throttleDelay;h(null,n,t,o)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",y)}}},m=(0,r.defineComponent)({name:"VirtualRender",directives:{bkVirtualRender:b},props:s,emits:["content-scroll"],setup:function(e,t){var l=this,i=e.renderAs,a=e.contentAs,s=function(e){return"string"==typeof e?[e]:"object"!==o(e)||Array.isArray(e)?e:[e]};if(!e.enabled){var u=function(e,t){var n=e.renderAs,o=e.contentAs,l=(0,r.resolveDirective)("bkVirtualRender"),i={lineHeight:e.lineHeight,handleScrollCallback:function(e,n,o,r,l,i){t.emit("content-scroll",[e,{translateY:l,translateX:i}])},pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent};return{rendAsTag:function(){var a,s,u,c,p,f,d,y,v;return(0,r.h)(n,{class:e.className},[null!==(u=null===(s=(a=t.slots).beforeContent)||void 0===s?void 0:s.call(a))&&void 0!==u?u:"",(0,r.withDirectives)((0,r.h)(o,{class:e.contentClassName,style:e.contentStyle},[null!==(f=null===(p=(c=t.slots).default)||void 0===p?void 0:p.call(c,{data:e.list}))&&void 0!==f?f:""]),[[l,i]]),null!==(v=null===(y=(d=t.slots).afterContent)||void 0===y?void 0:y.call(d))&&void 0!==v?v:""])}}}(e,t);return u.rendAsTag}var c=(0,r.ref)(null),p=(0,r.reactive)({startIndex:0,endIndex:0,scrollTop:1,translateY:0,translateX:0,count:0,groupItemCount:e.groupItemCount}),d=function(e,n,o,r,l,i){p.startIndex=n,p.endIndex=o,p.scrollTop=r,p.translateY=l,p.translateX=i,t.emit("content-scroll",[e,p])};(0,r.onMounted)((function(){(0,r.nextTick)((function(){b(e.list),m()}))})),(0,r.watch)((function(){return e.list}),(function(){y(),m()}),{deep:!0}),(0,r.watch)((function(){return e.lineHeight}),(function(){y(),m()}));var y=function(){b(e.list)},v=(0,r.ref)(0),h=(0,r.ref)(0),b=function(t){if(v.value=Math.ceil((t||[]).length/e.groupItemCount),p.count=v.value,p.startIndex=0,p.endIndex=0,p.translateY=0,p.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){h.value=0;for(var n=0,o=0;o<v.value;o++){var r=e.lineHeight.call(l,o,t.slice(o*e.groupItemCount,e.groupItemCount));n+="number"==typeof r?r:0}h.value=n}else h.value=e.lineHeight*v.value;else h.value=e.abosuteHeight},m=function(){var t,n=null===(t=c.value)||void 0===t?void 0:t.parentNode;f(e.lineHeight,d,p,n,null)},g=(0,r.computed)((function(){return(e.list||[]).map((function(e,t){return Object.assign(Object.assign({},e),{$index:t})}))})),T=(0,r.computed)((function(){return g.value.slice(p.startIndex*e.groupItemCount,(p.endIndex+e.preloadItemCount)*e.groupItemCount)})),P=(0,r.computed)((function(){return"content"===e.scrollPosition?{top:"".concat(p.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(p.translateY,"px)")}:{}})),x=(0,r.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?P.value:{})})),I=(0,r.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"}})),C=(0,r.computed)((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(n(s(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),O=(0,r.computed)((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(n(s(e.contentClassName)))})),S=(0,r.resolveDirective)("bkVirtualRender"),j={lineHeight:e.lineHeight,handleScrollCallback:d,pagination:p,throttleDelay:e.throttleDelay};return t.expose({reset:function(){y(),m()}}),function(){var n,o,l,s,u,p,f,d,y;return(0,r.h)(i||"div",{ref:c,class:C.value,style:x.value},[null!==(l=null===(o=(n=t.slots).beforeContent)||void 0===o?void 0:o.call(n))&&void 0!==l?l:"",(0,r.withDirectives)((0,r.h)(a||"div",{class:O.value,style:Object.assign(Object.assign({},P.value),e.contentStyle)},[null!==(p=null===(u=(s=t.slots).default)||void 0===u?void 0:u.call(s,{data:T.value}))&&void 0!==p?p:""]),[[S,j]]),null!==(y=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:"",(0,r.h)("div",{class:["bk-virtual-section"],style:I.value})])}}}),g=(0,e.withInstall)(m)})(),i})()));
@@ -19,6 +19,16 @@ export declare const virtualRenderProps: {
19
19
  } & {
20
20
  default: boolean;
21
21
  };
22
+ /**
23
+ * 是否启用内置的Scroll Listener
24
+ * 当启用虚拟滚动时(enabled = true),滚动监听为内置生效
25
+ * 只有当(enabled = false)时此配置项才生效
26
+ */
27
+ scrollEvent: import("vue-types").VueTypeValidableDef<boolean> & {
28
+ default: boolean;
29
+ } & {
30
+ default: boolean;
31
+ };
22
32
  /**
23
33
  * 每行数据高度
24
34
  * 默认为数值类型,默认高度 30px
@@ -0,0 +1,7 @@
1
+ import { VirtualRenderProps } from './props';
2
+ declare const _default: (props: VirtualRenderProps, ctx: any) => {
3
+ rendAsTag: () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
4
+ [key: string]: any;
5
+ }>;
6
+ };
7
+ export default _default;
@@ -10,6 +10,11 @@ declare const _default: import("vue").DefineComponent<{
10
10
  } & {
11
11
  default: boolean;
12
12
  };
13
+ scrollEvent: import("vue-types").VueTypeValidableDef<boolean> & {
14
+ default: boolean;
15
+ } & {
16
+ default: boolean;
17
+ };
13
18
  lineHeight: import("vue-types").VueTypeDef<any> & {
14
19
  default: any;
15
20
  };
@@ -96,7 +101,7 @@ declare const _default: import("vue").DefineComponent<{
96
101
  default: string;
97
102
  } & {
98
103
  default: string;
99
- };
104
+ }; /** 如果有分组状态,计算总行数 */
100
105
  abosuteHeight: import("vue-types").VueTypeDef<string | number> & {
101
106
  default: string | number;
102
107
  };
@@ -119,6 +124,11 @@ declare const _default: import("vue").DefineComponent<{
119
124
  } & {
120
125
  default: boolean;
121
126
  };
127
+ scrollEvent: import("vue-types").VueTypeValidableDef<boolean> & {
128
+ default: boolean;
129
+ } & {
130
+ default: boolean;
131
+ };
122
132
  lineHeight: import("vue-types").VueTypeDef<any> & {
123
133
  default: any;
124
134
  };
@@ -205,7 +215,7 @@ declare const _default: import("vue").DefineComponent<{
205
215
  default: string;
206
216
  } & {
207
217
  default: string;
208
- };
218
+ }; /** 如果有分组状态,计算总行数 */
209
219
  abosuteHeight: import("vue-types").VueTypeDef<string | number> & {
210
220
  default: string | number;
211
221
  };
@@ -215,15 +225,16 @@ declare const _default: import("vue").DefineComponent<{
215
225
  default: number;
216
226
  };
217
227
  }>>, {
228
+ enabled: boolean;
218
229
  width: string | number;
219
230
  height: string | number;
220
231
  list: unknown[];
221
- enabled: boolean;
222
232
  lineHeight: any;
223
233
  minHeight: number;
224
234
  className: string | {
225
235
  [key: string]: any;
226
236
  };
237
+ scrollEvent: boolean;
227
238
  contentClassName: string | {
228
239
  [key: string]: any;
229
240
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.1-beta.61",
3
+ "version": "0.0.1-beta.62",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",
@@ -116,7 +116,7 @@
116
116
  "git add"
117
117
  ],
118
118
  "site/**/*.(vue|ts|tsx|js)": [
119
- "eslint ./site --ext .js,.tsx,.ts,.vue --cache --fix",
119
+ "eslint ./site --ext .js,.tsx,.ts,.vue --cache --fix --ignore-pattern site/dist/",
120
120
  "git add"
121
121
  ],
122
122
  "packages/**/*.(vue|ts|tsx|js)": [