bkui-vue 0.0.1-beta.15 → 0.0.1-beta.18

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 (250) hide show
  1. package/dist/bkui-vue.cjs.js +1171 -186
  2. package/dist/bkui-vue.esm.js +1214 -233
  3. package/dist/bkui-vue.umd.js +1171 -186
  4. package/dist/style.css +469 -14
  5. package/lib/alert/alert.d.ts +24 -15
  6. package/lib/alert/alert.variable.css +7 -0
  7. package/lib/alert/index.d.ts +96 -60
  8. package/lib/alert/index.js +1 -1
  9. package/lib/animate-number/animate-number.d.ts +12 -7
  10. package/lib/animate-number/index.d.ts +48 -28
  11. package/lib/backtop/backtop.d.ts +27 -13
  12. package/lib/backtop/backtop.variable.css +7 -0
  13. package/lib/backtop/index.d.ts +108 -52
  14. package/lib/backtop/index.js +1 -1
  15. package/lib/badge/badge.d.ts +40 -19
  16. package/lib/badge/badge.variable.css +7 -0
  17. package/lib/badge/index.d.ts +144 -76
  18. package/lib/breadcrumb/breadcrumb-item.d.ts +13 -9
  19. package/lib/breadcrumb/breadcrumb.d.ts +21 -13
  20. package/lib/breadcrumb/breadcrumb.variable.css +7 -0
  21. package/lib/breadcrumb/index.d.ts +97 -61
  22. package/lib/breadcrumb/index.js +1 -1
  23. package/lib/button/button-group.d.ts +3 -5
  24. package/lib/button/button.d.ts +27 -22
  25. package/lib/button/button.variable.css +7 -0
  26. package/lib/button/index.d.ts +111 -93
  27. package/lib/card/card.d.ts +30 -15
  28. package/lib/card/card.variable.css +7 -0
  29. package/lib/card/index.d.ts +120 -60
  30. package/lib/checkbox/checkbox-group.d.ts +13 -9
  31. package/lib/checkbox/checkbox.d.ts +31 -22
  32. package/lib/checkbox/checkbox.variable.css +7 -0
  33. package/lib/checkbox/index.d.ts +137 -97
  34. package/lib/collapse/collapse.d.ts +50 -18
  35. package/lib/collapse/index.d.ts +108 -72
  36. package/lib/collapse/index.js +1 -1
  37. package/lib/components.d.ts +3 -0
  38. package/lib/date-picker/date-picker.d.ts +110 -63
  39. package/lib/date-picker/date-picker.variable.css +7 -0
  40. package/lib/date-picker/index.d.ts +437 -249
  41. package/lib/date-picker/index.js +1 -1
  42. package/lib/dialog/dialog.d.ts +46 -25
  43. package/lib/dialog/index.d.ts +179 -95
  44. package/lib/divider/divider.d.ts +21 -13
  45. package/lib/divider/divider.variable.css +7 -0
  46. package/lib/divider/index.d.ts +84 -52
  47. package/lib/dropdown/dropdown-item.d.ts +6 -5
  48. package/lib/dropdown/dropdown-menu.d.ts +6 -5
  49. package/lib/dropdown/dropdown.d.ts +25 -13
  50. package/lib/dropdown/dropdown.variable.css +7 -0
  51. package/lib/dropdown/index.d.ts +94 -62
  52. package/lib/exception/exception.d.ts +11 -9
  53. package/lib/exception/exception.variable.css +7 -0
  54. package/lib/exception/index.d.ts +44 -36
  55. package/lib/fixed-navbar/fixed-navbar.d.ts +15 -9
  56. package/lib/fixed-navbar/fixed-navbar.variable.css +7 -0
  57. package/lib/fixed-navbar/index.d.ts +60 -36
  58. package/lib/form/form-item.d.ts +46 -27
  59. package/lib/form/form.d.ts +22 -14
  60. package/lib/form/index.d.ts +285 -3
  61. package/lib/form/index.js +1 -1
  62. package/lib/icon/angle-double-down-line.d.ts +4 -0
  63. package/lib/icon/angle-double-down-line.js +15 -0
  64. package/lib/icon/angle-double-left-line.d.ts +4 -0
  65. package/lib/icon/angle-double-left-line.js +15 -0
  66. package/lib/icon/angle-double-left.js +15 -0
  67. package/lib/icon/angle-double-right-line.d.ts +4 -0
  68. package/lib/icon/angle-double-right-line.js +15 -0
  69. package/lib/icon/angle-double-right.js +15 -0
  70. package/lib/icon/angle-double-up-line.d.ts +4 -0
  71. package/lib/icon/angle-double-up-line.js +15 -0
  72. package/lib/icon/angle-down-fill.js +15 -0
  73. package/lib/icon/angle-down-line.js +15 -0
  74. package/lib/icon/angle-down.js +15 -0
  75. package/lib/icon/angle-left.js +15 -0
  76. package/lib/icon/angle-right.js +15 -0
  77. package/lib/icon/angle-up-fill.js +15 -0
  78. package/lib/icon/angle-up.js +15 -0
  79. package/lib/icon/arrows-left.js +15 -0
  80. package/lib/icon/circle.js +15 -0
  81. package/lib/icon/close.js +15 -0
  82. package/lib/icon/code.js +15 -0
  83. package/lib/icon/cog-shape.js +15 -0
  84. package/lib/icon/collapse-left.js +15 -0
  85. package/lib/icon/copy.js +15 -0
  86. package/lib/icon/done.js +15 -0
  87. package/lib/icon/down-shape.js +15 -0
  88. package/lib/icon/down-small.js +15 -0
  89. package/lib/icon/ellipsis.d.ts +4 -0
  90. package/lib/icon/ellipsis.js +15 -0
  91. package/lib/icon/error.js +15 -0
  92. package/lib/icon/eye.js +15 -0
  93. package/lib/icon/folder-open.js +15 -0
  94. package/lib/icon/folder-shape-open.js +15 -0
  95. package/lib/icon/folder-shape.js +15 -0
  96. package/lib/icon/folder.js +15 -0
  97. package/lib/icon/help-document-fill.js +15 -0
  98. package/lib/icon/help-fill.js +15 -0
  99. package/lib/icon/help.js +15 -0
  100. package/lib/icon/icon.js +15 -0
  101. package/lib/icon/index.d.ts +7 -0
  102. package/lib/icon/index.js +1 -1
  103. package/lib/icon/info-line.js +15 -0
  104. package/lib/icon/info.js +15 -0
  105. package/lib/icon/left-shape.d.ts +4 -0
  106. package/lib/icon/left-shape.js +15 -0
  107. package/lib/icon/play-shape.js +15 -0
  108. package/lib/icon/plus.js +15 -0
  109. package/lib/icon/right-shape.js +15 -0
  110. package/lib/icon/search.js +15 -0
  111. package/lib/icon/share.js +15 -0
  112. package/lib/icon/spinner.js +15 -0
  113. package/lib/icon/success.js +15 -0
  114. package/lib/icon/switcher-loading.js +15 -0
  115. package/lib/icon/text-file.js +15 -0
  116. package/lib/icon/tree-application-shape.js +15 -0
  117. package/lib/icon/unvisible.js +15 -0
  118. package/lib/icon/up-shape.d.ts +4 -0
  119. package/lib/icon/up-shape.js +15 -0
  120. package/lib/icon/warn.js +15 -0
  121. package/lib/input/index.d.ts +240 -160
  122. package/lib/input/index.js +2 -2
  123. package/lib/input/input.d.ts +60 -40
  124. package/lib/input/input.variable.css +7 -0
  125. package/lib/link/index.d.ts +100 -52
  126. package/lib/link/link.d.ts +25 -13
  127. package/lib/link/link.variable.css +7 -0
  128. package/lib/loading/index.d.ts +64 -64
  129. package/lib/loading/loading.d.ts +16 -16
  130. package/lib/loading/loading.variable.css +7 -0
  131. package/lib/menu/index.d.ts +90 -71
  132. package/lib/menu/index.js +1 -1
  133. package/lib/menu/menu-group.d.ts +6 -5
  134. package/lib/menu/menu-item.d.ts +6 -5
  135. package/lib/menu/menu.d.ts +18 -14
  136. package/lib/menu/menu.variable.css +7 -0
  137. package/lib/menu/submenu.css +3 -0
  138. package/lib/menu/submenu.d.ts +6 -5
  139. package/lib/menu/submenu.less +1 -1
  140. package/lib/menu/submenu.variable.css +10 -0
  141. package/lib/message/index.js +1 -1
  142. package/lib/message/message.variable.css +7 -0
  143. package/lib/message/messageConstructor.d.ts +28 -16
  144. package/lib/modal/index.d.ts +92 -56
  145. package/lib/modal/index.js +1 -1
  146. package/lib/modal/modal.d.ts +24 -15
  147. package/lib/modal/props.mixin.d.ts +1 -1
  148. package/lib/navigation/index.js +1 -1
  149. package/lib/navigation/navigation-title.d.ts +10 -7
  150. package/lib/navigation/navigation.d.ts +40 -23
  151. package/lib/navigation/navigation.variable.css +7 -0
  152. package/lib/notify/index.js +1 -1
  153. package/lib/notify/notify.variable.css +7 -0
  154. package/lib/notify/notifyConstructor.d.ts +36 -20
  155. package/lib/pagination/index.d.ts +395 -0
  156. package/lib/pagination/index.js +1 -0
  157. package/lib/pagination/pagination.css +179 -0
  158. package/lib/pagination/pagination.d.ts +220 -0
  159. package/lib/pagination/pagination.less +201 -0
  160. package/lib/pagination/pagination.variable.css +272 -0
  161. package/lib/pagination/type.d.ts +6 -0
  162. package/lib/pagination/use-limit.d.ts +8 -0
  163. package/lib/pagination/use-list.d.ts +8 -0
  164. package/lib/pagination/use-small-list.d.ts +5 -0
  165. package/lib/pagination/use-total.d.ts +5 -0
  166. package/lib/popover/index.d.ts +207 -177
  167. package/lib/popover/popover.css +1 -0
  168. package/lib/popover/popover.d.ts +52 -30
  169. package/lib/popover/popover.less +2 -0
  170. package/lib/popover/popover.variable.css +8 -0
  171. package/lib/process/index.d.ts +120 -60
  172. package/lib/process/index.js +1 -1
  173. package/lib/process/process.css +2 -3
  174. package/lib/process/process.d.ts +30 -15
  175. package/lib/process/process.less +2 -3
  176. package/lib/process/process.variable.css +9 -3
  177. package/lib/progress/index.d.ts +284 -136
  178. package/lib/progress/progress.d.ts +71 -34
  179. package/lib/progress/progress.variable.css +7 -0
  180. package/lib/radio/index.d.ts +127 -78
  181. package/lib/radio/radio-button.d.ts +24 -16
  182. package/lib/radio/radio-group.d.ts +11 -10
  183. package/lib/radio/radio.d.ts +23 -13
  184. package/lib/radio/radio.variable.css +7 -0
  185. package/lib/rate/index.d.ts +52 -40
  186. package/lib/rate/rate.d.ts +13 -10
  187. package/lib/rate/star.d.ts +32 -15
  188. package/lib/select/index.d.ts +396 -327
  189. package/lib/select/index.js +2 -2
  190. package/lib/select/option.d.ts +9 -10
  191. package/lib/select/optionGroup.d.ts +49 -41
  192. package/lib/select/select.css +2 -1
  193. package/lib/select/select.d.ts +98 -84
  194. package/lib/select/select.less +2 -1
  195. package/lib/select/select.variable.css +9 -1
  196. package/lib/shared/index.js +1 -1
  197. package/lib/sideslider/index.d.ts +111 -63
  198. package/lib/sideslider/sideslider.d.ts +29 -17
  199. package/lib/sideslider/sideslider.variable.css +7 -0
  200. package/lib/slider/slider-button.d.ts +10 -7
  201. package/lib/slider/slider.d.ts +70 -40
  202. package/lib/slider/slider.variable.css +7 -0
  203. package/lib/steps/index.d.ts +156 -104
  204. package/lib/steps/index.js +1 -1
  205. package/lib/steps/steps.css +3 -0
  206. package/lib/steps/steps.d.ts +39 -26
  207. package/lib/steps/steps.less +4 -0
  208. package/lib/steps/steps.variable.css +10 -0
  209. package/lib/styles/index.d.ts +2 -0
  210. package/lib/styles/index.js +1 -1
  211. package/lib/styles/themes/themes.less +11 -0
  212. package/lib/switcher/index.d.ts +192 -128
  213. package/lib/switcher/index.js +1 -1
  214. package/lib/switcher/switcher.d.ts +48 -32
  215. package/lib/switcher/switcher.variable.css +7 -0
  216. package/lib/tab/index.d.ts +344 -208
  217. package/lib/tab/index.js +1 -1
  218. package/lib/tab/tab-nav.d.ts +74 -38
  219. package/lib/tab/tab-panel.d.ts +22 -20
  220. package/lib/tab/tab.d.ts +64 -32
  221. package/lib/tab/tab.variable.css +7 -0
  222. package/lib/table/const.d.ts +4 -0
  223. package/lib/table/index.d.ts +154 -130
  224. package/lib/table/index.js +1 -1
  225. package/lib/table/props.d.ts +18 -0
  226. package/lib/table/render.d.ts +18 -2
  227. package/lib/table/table.css +47 -10
  228. package/lib/table/table.d.ts +47 -22
  229. package/lib/table/table.less +61 -17
  230. package/lib/table/table.variable.css +56 -12
  231. package/lib/table/utils.d.ts +28 -2
  232. package/lib/tag/index.d.ts +10 -286
  233. package/lib/tag/tag.d.ts +2 -48
  234. package/lib/tag/tag.variable.css +7 -0
  235. package/lib/timeline/index.d.ts +129 -0
  236. package/lib/timeline/index.js +1 -0
  237. package/lib/timeline/timeline.css +235 -0
  238. package/lib/timeline/timeline.d.ts +81 -0
  239. package/lib/timeline/timeline.less +239 -0
  240. package/lib/timeline/timeline.variable.css +328 -0
  241. package/lib/tree/index.d.ts +140 -75
  242. package/lib/tree/index.js +1 -1
  243. package/lib/tree/props.d.ts +19 -1
  244. package/lib/tree/tree.d.ts +42 -20
  245. package/lib/use-form.d.ts +3 -0
  246. package/lib/virtual-render/index.d.ts +410 -249
  247. package/lib/virtual-render/index.js +1 -1
  248. package/lib/virtual-render/props.d.ts +10 -0
  249. package/lib/virtual-render/virtual-render.d.ts +110 -41
  250. package/package.json +2 -2
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("../shared")):"function"==typeof define&&define.amd?define(["exports","vue","../shared"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.Shared)}(this,(function(e,t,o){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}},s={exports:{}},l={exports:{}};!function(e){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports}(l),function(e){var t=l.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var i={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(i);var u={exports:{}};!function(e){var t=l.exports;e.exports=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.exports.__esModule=!0,e.exports.default=e.exports}(u);var a={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(a),function(e){var t=s.exports,o=i.exports,n=u.exports,r=a.exports;e.exports=function(e){return t(e)||o(e)||n(e)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var p=n(r.exports),c={exports:{}};!function(e){function t(o){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(c);var f=n(c.exports),d={list:o.PropTypes.array.def([]),enabled:o.PropTypes.bool.def(!0),lineHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.func]).def(30),minHeight:o.PropTypes.number.def(30),height:o.PropTypes.oneOfType([o.PropTypes.string.def("100%"),o.PropTypes.number]).def("100%"),width:o.PropTypes.oneOfType([o.PropTypes.string.def("100%"),o.PropTypes.number]).def("100%"),className:o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.string),o.PropTypes.object,o.PropTypes.arrayOf(o.PropTypes.object),o.PropTypes.string]).def(""),contentClassName:o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.string),o.PropTypes.object,o.PropTypes.arrayOf(o.PropTypes.object),o.PropTypes.string]).def(""),contentStyle:o.PropTypes.object.def({}),scrollXName:o.PropTypes.string.def("bk-scroll-x"),scrollYName:o.PropTypes.string.def("bk-scroll-y"),groupItemCount:o.PropTypes.number.def(1),preloadItemCount:o.PropTypes.number.def(1),renderAs:o.PropTypes.string.def("div"),contentAs:o.PropTypes.string.def("div"),scrollOffsetTop:o.PropTypes.number.def(0),scrollPosition:o.PropTypes.string.def("content"),abosuteHeight:o.PropTypes.oneOfType([o.PropTypes.string.def("auto"),o.PropTypes.number]).def("auto")};function y(e,t,o,n){for(var r=0,s=0,l=0,i=0;r<e;r++){if(s+(i=n(r,[r*o,(r+1)*o]))>t){l=t-s;break}s+=i}return{startIndex:r,height:s,diffHeight:l}}function v(e,t,o,n,r){if(n){var s=n.scrollTop,l=o.scrollTop,i=o.count,u=o.groupItemCount,a=o.startIndex,p=o.endIndex,c=n.offsetHeight,f=0,d=0,v=0;if("number"==typeof e&&(f=Math.floor(s/e),d=Math.ceil(c/e)+f,v=s%e),"function"==typeof e){var x=y(i,s,u,e);f=x.startIndex>0?x.startIndex:0,v=x.diffHeight,d=y(i,c,u,e).startIndex+f+1}s===l&&f===a&&d===p||"function"==typeof t&&t(r,f,d,s,v)}}var x=o.throttle((function(e,t,o){return function(e,t,o){var n=o.value,r=n.lineHeight,s=void 0===r?30:r,l=n.handleScrollCallback,i=n.pagination,u=void 0===i?{}:i,a=u.startIndex,p=u.endIndex,c=u.groupItemCount,f=u.count;v(s,l,{scrollTop:u.scrollTop,startIndex:a,endIndex:p,groupItemCount:c,count:f},t,e)}(e,t,o)}),60),m={mounted:function(e,t){var o=e.parentNode;o.addEventListener("scroll",(function(e){x(e,o,t)}))},updated:function(e,t){var o=e.parentNode;x(null,o,t)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",x)}}},b=t.defineComponent({name:"bk-virtual-render",directives:{bkVirtualRender:m},props:d,setup:function(e,o){var n=this,r=e.renderAs,s=e.contentAs,l=function(e){return"string"==typeof e?[e]:"object"!==f(e)||Array.isArray(e)?e:[e]};if(!e.enabled)return function(){var n,i,u,a,p,c,f,d,y;return t.h(r,{class:l(e.className)},[null!==(u=null===(i=(n=o.slots).beforeContent)||void 0===i?void 0:i.call(n))&&void 0!==u?u:"",t.h(s,{class:l(e.contentClassName),style:e.contentStyle},[null!==(c=null===(p=(a=o.slots).default)||void 0===p?void 0:p.call(a,{data:e.list}))&&void 0!==c?c:""]),null!==(y=null===(d=(f=o.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:""])};var i=t.ref(null),u=t.reactive({startIndex:0,endIndex:0,scrollTop:1,translateY:0,count:0,groupItemCount:e.groupItemCount}),a=function(e,t,n,r,s){u.startIndex=t,u.endIndex=n,u.scrollTop=r,u.translateY=s,o.emit("content-scroll",[e,u])};t.onMounted((function(){t.nextTick((function(){x(e.list),m()}))})),t.watch((function(){return e.list}),(function(){c(),m()}),{deep:!0}),t.watch((function(){return e.lineHeight}),(function(){c(),m()}));var c=function(){x(e.list)},d=t.reactive(t.ref(0)),y=t.reactive(t.ref(0)),x=function(t){if(d.value=Math.ceil((t||[]).length/e.groupItemCount),u.count=d.value,u.startIndex=0,u.endIndex=0,u.translateY=0,u.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){y.value=0;for(var o=0,r=0;r<d.value;r++){var s=e.lineHeight.call(n,r,t.slice(r*e.groupItemCount,e.groupItemCount));o+="number"==typeof s?s:0}y.value=o}else y.value=e.lineHeight*d.value;else y.value=e.abosuteHeight},m=function(){var t=(i.value||{}).parentNode;v(e.lineHeight,a,u,t,null)},b=t.computed((function(){return(e.list||[]).map((function(e,t){return Object.assign(e,{$index:t})}))})),h=t.computed((function(){return b.value.slice(u.startIndex*e.groupItemCount,(u.endIndex+e.preloadItemCount)*e.groupItemCount)})),g=t.computed((function(){return"content"===e.scrollPosition?{top:"".concat(u.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(u.translateY,"px)")}:{}})),T=t.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?g.value:{})})),P=t.computed((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(y.value<e.minHeight?e.minHeight:y.value,"px"),display:t?"none":"block"}})),I=t.computed((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(p(l(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=t.computed((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(p(l(e.contentClassName)))})),H=t.resolveDirective("bkVirtualRender"),O={lineHeight:e.lineHeight,handleScrollCallback:a,pagination:u};return function(){var n,l,u,a,p,c,f,d,y;return t.h(r||"div",{ref:i,class:I.value,style:T.value},[null!==(u=null===(l=(n=o.slots).beforeContent)||void 0===l?void 0:l.call(n))&&void 0!==u?u:"",t.withDirectives(t.h(s||"div",{class:C.value,style:Object.assign(Object.assign({},g.value),e.contentStyle)},[null!==(c=null===(p=(a=o.slots).default)||void 0===p?void 0:p.call(a,{data:h.value}))&&void 0!==c?c:""]),[[H,O]]),null!==(y=null===(d=(f=o.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:"",t.h("div",{class:["bk-virtual-section"],style:P.value})])}}}),h=o.withInstall(b);e.default=h,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("../shared")):"function"==typeof define&&define.amd?define(["exports","vue","../shared"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.Shared)}(this,(function(e,t,o){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}},l={exports:{}},s={exports:{}};!function(e){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports}(s),function(e){var t=s.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(l);var i={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(i);var u={exports:{}};!function(e){var t=s.exports;e.exports=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.exports.__esModule=!0,e.exports.default=e.exports}(u);var a={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(a),function(e){var t=l.exports,o=i.exports,n=u.exports,r=a.exports;e.exports=function(e){return t(e)||o(e)||n(e)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var p=n(r.exports),c={exports:{}};!function(e){function t(o){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(c);var f=n(c.exports),d={onContentScroll:Function},y=Object.assign({list:o.PropTypes.array.def([]),enabled:o.PropTypes.bool.def(!0),lineHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.func]).def(30),minHeight:o.PropTypes.number.def(30),height:o.PropTypes.oneOfType([o.PropTypes.string.def("100%"),o.PropTypes.number]).def("100%"),width:o.PropTypes.oneOfType([o.PropTypes.string.def("100%"),o.PropTypes.number]).def("100%"),className:o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.string),o.PropTypes.object,o.PropTypes.arrayOf(o.PropTypes.object),o.PropTypes.string]).def(""),contentClassName:o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.string),o.PropTypes.object,o.PropTypes.arrayOf(o.PropTypes.object),o.PropTypes.string]).def(""),contentStyle:o.PropTypes.object.def({}),scrollXName:o.PropTypes.string.def("bk-scroll-x"),scrollYName:o.PropTypes.string.def("bk-scroll-y"),groupItemCount:o.PropTypes.number.def(1),preloadItemCount:o.PropTypes.number.def(1),renderAs:o.PropTypes.string.def("div"),contentAs:o.PropTypes.string.def("div"),scrollOffsetTop:o.PropTypes.number.def(0),scrollPosition:o.PropTypes.string.def("content"),abosuteHeight:o.PropTypes.oneOfType([o.PropTypes.string.def("auto"),o.PropTypes.number]).def("auto"),throttleDelay:o.PropTypes.number.def(60)},d),v=void 0;function h(e,t,o,n){for(var r=0,l=0,s=0,i=0;r<e;r++){if(l+(i=n(r,[r*o,(r+1)*o]))>t){s=t-l;break}l+=i}return{startIndex:r,height:l,diffHeight:s}}function x(e,t,o,n,r){if(n){var l=n.scrollTop,s=o.scrollTop,i=o.count,u=o.groupItemCount,a=o.startIndex,p=o.endIndex,c=n.offsetHeight,f=0,d=0,y=0;if("number"==typeof e&&(f=Math.floor(l/e),d=Math.ceil(c/e)+f,y=l%e),"function"==typeof e){var v=h(i,l,u,e);f=v.startIndex>0?v.startIndex:0,y=v.diffHeight,d=h(i,c,u,e).startIndex+f+1}l===s&&f===a&&d===p||"function"==typeof t&&t(r,f,d,l,y)}}function m(e,t,o){var n=o.value,r=n.lineHeight,l=void 0===r?30:r,s=n.handleScrollCallback,i=n.pagination,u=void 0===i?{}:i,a=u.startIndex,p=u.endIndex,c=u.groupItemCount,f=u.count;x(l,s,{scrollTop:u.scrollTop,startIndex:a,endIndex:p,groupItemCount:c,count:f},t,e)}var b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return o.throttle((function(e,t,o){return m(e,t,o)}),e)},g=null,T=function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;g||(g=b(n)),"function"==typeof g&&g.call(v,e,t,o)},P={mounted:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;o.addEventListener("scroll",(function(e){T(e,o,t,n)}))},updated:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;T(null,o,t,n)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",b)}}},I=t.defineComponent({name:"BkVirtualRender",directives:{bkVirtualRender:P},props:y,emits:["content-scroll"],setup:function(e,o){var n=this,r=e.renderAs,l=e.contentAs,s=function(e){return"string"==typeof e?[e]:"object"!==f(e)||Array.isArray(e)?e:[e]};if(!e.enabled)return function(){var n,i,u,a,p,c,f,d,y;return t.h(r,{class:s(e.className)},[null!==(u=null===(i=(n=o.slots).beforeContent)||void 0===i?void 0:i.call(n))&&void 0!==u?u:"",t.h(l,{class:s(e.contentClassName),style:e.contentStyle},[null!==(c=null===(p=(a=o.slots).default)||void 0===p?void 0:p.call(a,{data:e.list}))&&void 0!==c?c:""]),null!==(y=null===(d=(f=o.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:""])};var i=t.ref(null),u=t.reactive({startIndex:0,endIndex:0,scrollTop:1,translateY:0,count:0,groupItemCount:e.groupItemCount}),a=function(e,t,n,r,l){u.startIndex=t,u.endIndex=n,u.scrollTop=r,u.translateY=l,o.emit("content-scroll",[e,u])};t.onMounted((function(){t.nextTick((function(){v(e.list),h()}))})),t.watch((function(){return e.list}),(function(){c(),h()}),{deep:!0}),t.watch((function(){return e.lineHeight}),(function(){c(),h()}));var c=function(){v(e.list)},d=t.reactive(t.ref(0)),y=t.reactive(t.ref(0)),v=function(t){if(d.value=Math.ceil((t||[]).length/e.groupItemCount),u.count=d.value,u.startIndex=0,u.endIndex=0,u.translateY=0,u.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){y.value=0;for(var o=0,r=0;r<d.value;r++){var l=e.lineHeight.call(n,r,t.slice(r*e.groupItemCount,e.groupItemCount));o+="number"==typeof l?l:0}y.value=o}else y.value=e.lineHeight*d.value;else y.value=e.abosuteHeight},h=function(){var t=(i.value||{}).parentNode;x(e.lineHeight,a,u,t,null)},m=t.computed((function(){return(e.list||[]).map((function(e,t){return Object.assign(e,{$index:t})}))})),b=t.computed((function(){return m.value.slice(u.startIndex*e.groupItemCount,(u.endIndex+e.preloadItemCount)*e.groupItemCount)})),g=t.computed((function(){return"content"===e.scrollPosition?{top:"".concat(u.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(u.translateY,"px)")}:{}})),T=t.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?g.value:{})})),P=t.computed((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(y.value<e.minHeight?e.minHeight:y.value,"px"),display:t?"none":"block"}})),I=t.computed((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(p(s(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=t.computed((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(p(s(e.contentClassName)))})),O=t.resolveDirective("bkVirtualRender"),H={lineHeight:e.lineHeight,handleScrollCallback:a,pagination:u,throttleDelay:e.throttleDelay};return function(){var n,s,u,a,p,c,f,d,y;return t.h(r||"div",{ref:i,class:I.value,style:T.value},[null!==(u=null===(s=(n=o.slots).beforeContent)||void 0===s?void 0:s.call(n))&&void 0!==u?u:"",t.withDirectives(t.h(l||"div",{class:C.value,style:Object.assign(Object.assign({},g.value),e.contentStyle)},[null!==(c=null===(p=(a=o.slots).default)||void 0===p?void 0:p.call(a,{data:b.value}))&&void 0!==c?c:""]),[[O,H]]),null!==(y=null===(d=(f=o.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:"",t.h("div",{class:["bk-virtual-section"],style:P.value})])}}}),C=o.withInstall(I);e.default=C,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,5 +1,6 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
2
  export declare const virtualRenderProps: {
3
+ onContentScroll: FunctionConstructor;
3
4
  /** 传入原始数据源 */
4
5
  list: import("vue-types").VueTypeValidableDef<unknown[]> & {
5
6
  default: () => unknown[];
@@ -143,5 +144,14 @@ export declare const virtualRenderProps: {
143
144
  abosuteHeight: import("vue-types").VueTypeDef<string | number> & {
144
145
  default: string | number;
145
146
  };
147
+ /**
148
+ * 滚动刷新计算间隔时间
149
+ * 默认60 ms
150
+ */
151
+ throttleDelay: import("vue-types").VueTypeValidableDef<number> & {
152
+ default: number;
153
+ } & {
154
+ default: number;
155
+ };
146
156
  };
147
157
  export declare type VirtualRenderProps = Readonly<ExtractPropTypes<typeof virtualRenderProps>>;
@@ -1,4 +1,5 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
+ onContentScroll: FunctionConstructor;
2
3
  list: import("vue-types").VueTypeValidableDef<unknown[]> & {
3
4
  default: () => unknown[];
4
5
  } & {
@@ -70,7 +71,7 @@ declare const _default: import("vue").DefineComponent<{
70
71
  default: number;
71
72
  } & {
72
73
  default: number;
73
- };
74
+ }; /** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
74
75
  preloadItemCount: import("vue-types").VueTypeValidableDef<number> & {
75
76
  default: number;
76
77
  } & {
@@ -99,54 +100,121 @@ declare const _default: import("vue").DefineComponent<{
99
100
  abosuteHeight: import("vue-types").VueTypeDef<string | number> & {
100
101
  default: string | number;
101
102
  };
103
+ throttleDelay: import("vue-types").VueTypeValidableDef<number> & {
104
+ default: number;
105
+ } & {
106
+ default: number;
107
+ };
102
108
  }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
103
109
  [key: string]: any;
104
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
105
- list?: unknown;
106
- enabled?: unknown;
107
- lineHeight?: unknown;
108
- minHeight?: unknown;
109
- height?: unknown;
110
- width?: unknown;
111
- className?: unknown;
112
- contentClassName?: unknown;
113
- contentStyle?: unknown;
114
- scrollXName?: unknown;
115
- scrollYName?: unknown;
116
- groupItemCount?: unknown;
117
- preloadItemCount?: unknown;
118
- renderAs?: unknown;
119
- contentAs?: unknown;
120
- scrollOffsetTop?: unknown;
121
- scrollPosition?: unknown;
122
- abosuteHeight?: unknown;
123
- } & {
124
- enabled: boolean;
125
- width: string | number;
126
- height: string | number;
127
- list: unknown[];
128
- className: string | {
110
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "content-scroll", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
111
+ onContentScroll: FunctionConstructor;
112
+ list: import("vue-types").VueTypeValidableDef<unknown[]> & {
113
+ default: () => unknown[];
114
+ } & {
115
+ default: () => unknown[];
116
+ };
117
+ enabled: import("vue-types").VueTypeValidableDef<boolean> & {
118
+ default: boolean;
119
+ } & {
120
+ default: boolean;
121
+ };
122
+ lineHeight: import("vue-types").VueTypeDef<any> & {
123
+ default: any;
124
+ };
125
+ minHeight: import("vue-types").VueTypeValidableDef<number> & {
126
+ default: number;
127
+ } & {
128
+ default: number;
129
+ };
130
+ height: import("vue-types").VueTypeDef<string | number> & {
131
+ default: string | number;
132
+ };
133
+ width: import("vue-types").VueTypeDef<string | number> & {
134
+ default: string | number;
135
+ };
136
+ className: import("vue-types").VueTypeDef<string | string[] | {
137
+ [key: string]: any;
138
+ } | {
129
139
  [key: string]: any;
140
+ }[]> & {
141
+ default: string | (() => {
142
+ [key: string]: any;
143
+ }) | (() => string[]) | (() => {
144
+ [key: string]: any;
145
+ }[]);
130
146
  };
131
- minHeight: number;
132
- contentClassName: string | {
147
+ contentClassName: import("vue-types").VueTypeDef<string | string[] | {
148
+ [key: string]: any;
149
+ } | {
133
150
  [key: string]: any;
151
+ }[]> & {
152
+ default: string | (() => {
153
+ [key: string]: any;
154
+ }) | (() => string[]) | (() => {
155
+ [key: string]: any;
156
+ }[]);
134
157
  };
135
- contentStyle: {
158
+ contentStyle: import("vue-types").VueTypeValidableDef<{
136
159
  [key: string]: any;
160
+ }> & {
161
+ default: () => {
162
+ [key: string]: any;
163
+ };
164
+ } & {
165
+ default: () => {
166
+ [key: string]: any;
167
+ };
137
168
  };
138
- scrollXName: string;
139
- scrollYName: string;
140
- groupItemCount: number;
141
- preloadItemCount: number;
142
- renderAs: string;
143
- contentAs: string;
144
- scrollOffsetTop: number;
145
- scrollPosition: string;
146
- abosuteHeight: string | number;
147
- } & {
148
- lineHeight?: any;
149
- }> & ({} | {}), {
169
+ scrollXName: import("vue-types").VueTypeValidableDef<string> & {
170
+ default: string;
171
+ } & {
172
+ default: string;
173
+ };
174
+ scrollYName: import("vue-types").VueTypeValidableDef<string> & {
175
+ default: string;
176
+ } & {
177
+ default: string;
178
+ };
179
+ groupItemCount: import("vue-types").VueTypeValidableDef<number> & {
180
+ default: number;
181
+ } & {
182
+ default: number;
183
+ }; /** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
184
+ preloadItemCount: import("vue-types").VueTypeValidableDef<number> & {
185
+ default: number;
186
+ } & {
187
+ default: number;
188
+ };
189
+ renderAs: import("vue-types").VueTypeValidableDef<string> & {
190
+ default: string;
191
+ } & {
192
+ default: string;
193
+ };
194
+ contentAs: import("vue-types").VueTypeValidableDef<string> & {
195
+ default: string;
196
+ } & {
197
+ default: string;
198
+ };
199
+ scrollOffsetTop: import("vue-types").VueTypeValidableDef<number> & {
200
+ default: number;
201
+ } & {
202
+ default: number;
203
+ };
204
+ scrollPosition: import("vue-types").VueTypeValidableDef<string> & {
205
+ default: string;
206
+ } & {
207
+ default: string;
208
+ };
209
+ abosuteHeight: import("vue-types").VueTypeDef<string | number> & {
210
+ default: string | number;
211
+ };
212
+ throttleDelay: import("vue-types").VueTypeValidableDef<number> & {
213
+ default: number;
214
+ } & {
215
+ default: number;
216
+ };
217
+ }>>, {
150
218
  enabled: boolean;
151
219
  width: string | number;
152
220
  height: string | number;
@@ -171,5 +239,6 @@ declare const _default: import("vue").DefineComponent<{
171
239
  scrollOffsetTop: number;
172
240
  scrollPosition: string;
173
241
  abosuteHeight: string | number;
242
+ throttleDelay: number;
174
243
  }>;
175
244
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.1-beta.15",
3
+ "version": "0.0.1-beta.18",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*"
@@ -93,7 +93,7 @@
93
93
  "typescript": "~4.3.5",
94
94
  "vite": "~2.4.4",
95
95
  "vite-plugin-md": "~0.12.4",
96
- "vue": "3.2.2",
96
+ "vue": "^3",
97
97
  "vue-jest": "~5.0.0-alpha.8",
98
98
  "vue-router": "~4.0.10",
99
99
  "vue-types": "~4.0.1"