@vunk/plus 1.15.0 → 1.16.0

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 (66) hide show
  1. package/components/bubble-list/index.cjs +1 -1
  2. package/components/bubble-list/index.mjs +265 -133
  3. package/components/bubble-list/src/core/index.vue.d.ts +45 -14
  4. package/components/bubble-list/src/ctx.d.ts +4 -0
  5. package/components/bubble-list/src/index.vue.d.ts +23 -10
  6. package/components/components.css +1 -1
  7. package/components/drawer/src/ctx.d.ts +1 -1
  8. package/components/drawer/src/index.vue.d.ts +7 -7
  9. package/components/pixi-frame/src/apng.vue.d.ts +2 -2
  10. package/components/pixi-frame/src/bitmap-generator.vue.d.ts +18 -18
  11. package/components/pixi-frame/src/bitmap.vue.d.ts +18 -18
  12. package/components/pixi-frame/src/buffer-image.vue.d.ts +18 -18
  13. package/components/pixi-frame/src/core.vue.d.ts +2 -2
  14. package/components/pixi-frame/src/index.vue.d.ts +44 -44
  15. package/components/pixi-frame/src/video.vue.d.ts +2 -2
  16. package/components/recorder-button/src/index.vue.d.ts +2 -2
  17. package/components/scrollbar/src/index.vue.d.ts +2 -2
  18. package/components/speech-button/src/index.vue.d.ts +1 -1
  19. package/components/table-columns/src/ctx.d.ts +2 -2
  20. package/components/table-columns/src/el-ctx.d.ts +3 -3
  21. package/components/table-columns/src/index.vue.d.ts +4 -4
  22. package/components/tables-v1/src/ctx.d.ts +11 -11
  23. package/components/tables-v1/src/el-ctx.d.ts +7 -7
  24. package/components/tables-v1/src/index.vue.d.ts +12 -12
  25. package/components/tables-v1-checkbox/src/ctx.d.ts +9 -9
  26. package/components/tables-v1-checkbox/src/index.vue.d.ts +44 -44
  27. package/components/text/src/ctx.d.ts +1 -1
  28. package/components/text/src/index.vue.d.ts +6 -6
  29. package/components/thinking/src/index.vue.d.ts +2 -2
  30. package/components/vditor/src/ctx.d.ts +1 -1
  31. package/components/vditor/src/index.vue.d.ts +1 -1
  32. package/index.css +3 -1
  33. package/package.json +6 -1
  34. package/vue-virtual-scroller/index.cjs +1 -0
  35. package/vue-virtual-scroller/index.d.ts +4 -0
  36. package/vue-virtual-scroller/index.mjs +2708 -0
  37. package/vue-virtual-scroller/src/components/DynamicScroller.vue.d.ts +52 -0
  38. package/vue-virtual-scroller/src/components/DynamicScrollerItem.vue.d.ts +36 -0
  39. package/vue-virtual-scroller/src/components/ItemView.vue.d.ts +24 -0
  40. package/vue-virtual-scroller/src/components/RecycleScroller.vue.d.ts +65 -0
  41. package/vue-virtual-scroller/src/components/ResizeObserver.vue.d.ts +7 -0
  42. package/vue-virtual-scroller/src/components/WindowScroller.vue.d.ts +54 -0
  43. package/vue-virtual-scroller/src/composables/dynamicScrollerMeasureQueue.d.ts +19 -0
  44. package/vue-virtual-scroller/src/composables/dynamicScrollerMeasurement.d.ts +41 -0
  45. package/vue-virtual-scroller/src/composables/scrollerOptions.d.ts +66 -0
  46. package/vue-virtual-scroller/src/composables/useDynamicScroller.d.ts +109 -0
  47. package/vue-virtual-scroller/src/composables/useDynamicScrollerItem.d.ts +21 -0
  48. package/vue-virtual-scroller/src/composables/useIdState.d.ts +7 -0
  49. package/vue-virtual-scroller/src/composables/useRecycleScroller.d.ts +65 -0
  50. package/vue-virtual-scroller/src/composables/useTableColumnWidths.d.ts +28 -0
  51. package/vue-virtual-scroller/src/composables/useWindowScroller.d.ts +17 -0
  52. package/vue-virtual-scroller/src/config.d.ts +7 -0
  53. package/vue-virtual-scroller/src/directives/observeVisibility.d.ts +8 -0
  54. package/vue-virtual-scroller/src/engine/cache.d.ts +8 -0
  55. package/vue-virtual-scroller/src/engine/keyField.d.ts +13 -0
  56. package/vue-virtual-scroller/src/engine/scroll.d.ts +14 -0
  57. package/vue-virtual-scroller/src/index.d.ts +25 -0
  58. package/vue-virtual-scroller/src/scrollparent.d.ts +27 -0
  59. package/vue-virtual-scroller/src/typecheck/generic-components.typecheck.vue.d.ts +3 -0
  60. package/vue-virtual-scroller/src/typecheck/generic-composables.typecheck.d.ts +1 -0
  61. package/vue-virtual-scroller/src/types.d.ts +139 -0
  62. package/vue-virtual-scroller/src/utils/eventEmitter.d.ts +21 -0
  63. package/vue-virtual-scroller/src/utils/itemSize.d.ts +13 -0
  64. package/vue-virtual-scroller/src/utils/viewStyle.d.ts +29 -0
  65. package/vue-virtual-scroller/src/utils.d.ts +1 -0
  66. package/vue-virtual-scroller/vue-virtual-scroller.css +1 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("@vunk/plus/components/bubble-templates"),B=require("element-plus"),w=require("@element-plus/icons-vue"),S=require("@vueuse/core"),C=require("@vunk/plus/components/scrollbar"),T=require("@vunk/plus/element/bubble"),$=require("../_plugin-vue_export-helper-BHFhmbuH.js"),x=require("@vunk/shared/function"),R=require("@vunk/plus/components/agent-chat-provider"),_={},V={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"704",height:"704",viewBox:"0 0 704 704"};function P(s,l){return e.openBlock(),e.createElementBlock("svg",V,[...l[0]||(l[0]=[e.createStaticVNode('<defs><filter id="master_svg0_62_10054" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.030120481927710843" y="-0.030120481927710843" width="1.0602409638554218" height="1.0602409638554218"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="5" result="effect1_foregroundBlur"></feGaussianBlur></filter><linearGradient id="master_svg1_62_10082" x1="0.5" y1="-0.13192443549633026" x2="0.42319029569625854" y2="1.368432641029358"><stop offset="9.145302325487137%" stop-color="currentColor" stop-opacity="1"></stop><stop offset="13.636428117752075%" stop-color="currentColor" stop-opacity="0.07539999485015869"></stop><stop offset="16.968481242656708%" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs><g transform="matrix(0,1,-1,0,704,-664)" filter="url(#master_svg0_62_10054)"><path d="M1016,684C1199.359,684,1348,535.359,1348,352C1348,168.641,1199.359,20,1016,20C832.641,20,684,168.641,684,352C684,535.359,832.641,684,1016,684ZM1016,32C1192.731,32,1336,175.269,1336,352C1336,528.731,1192.731,672,1016,672C839.269,672,696,528.731,696,352C696,175.269,839.269,32,1016,32Z" fill-rule="evenodd" fill="url(#master_svg1_62_10082)" fill-opacity="1"></path></g>',2)])])}const z=$._export_sfc(_,[["render",P]]),N={class:"vk-bubble-list-wrapper"},q=e.defineComponent({__name:"index",props:{list:{type:Array,default:()=>[]},autoScroll:{type:Boolean,default:!0},autoScrollThreshold:{type:Number,default:200},maxHeight:{type:String,default:""},alwaysShowScrollbar:{type:Boolean,default:!1},backButtonThreshold:{type:Number,default:80},showBackButton:{type:Boolean,default:!0},backButtonPosition:{type:Object,default:()=>({bottom:"20px",left:"calc(50% - 19px)"})},btnLoading:{type:Boolean,default:!0},btnColor:{type:String,default:"#409EFF"},btnIconSize:{type:Number,default:24},scrollbarAppendTo:{type:null,default:void 0}},emits:{complete:null},setup(s,{expose:l}){const a=s,i=e.ref();function r(){document.documentElement.style.setProperty("--el-bubble-list-max-height",a.maxHeight||"100%"),document.documentElement.style.setProperty("--el-bubble-list-btn-size",`${a.btnIconSize}px`)}e.onMounted(()=>{r()}),e.watch(()=>[a.maxHeight,a.btnIconSize],()=>{r()});const u=e.ref(),v=e.computed(()=>i.value?.wrapRef?.firstElementChild),m=e.computed(()=>a.showBackButton&&u.value!==void 0&&u.value>a.backButtonThreshold);e.onMounted(()=>{setTimeout(p)});function p(){const o=i.value?.$el,n=i.value?.wrapRef;if(!(!o||!n))return u.value=n.scrollHeight-n.scrollTop-n.clientHeight,u.value}function b(...o){i.value?.scrollToBottom(...o)}function g(...o){i.value?.scrollToTop(...o)}a.autoScroll&&S.useResizeObserver(v,()=>{const o=p();o!==void 0&&o>a.autoScrollThreshold||b()});function y(o){const n=i.value?.wrapRef;if(!n)return;const d=n.querySelectorAll(".el-bubble");if(o>=d.length)return;const t=d[o],f=n.getBoundingClientRect(),k=t.getBoundingClientRect().top-f.top+n.scrollTop;n.scrollTo({top:k,behavior:"smooth"})}return l({scrollToTop:g,scrollToBottom:b,scrollToBubble:y}),(o,n)=>{const d=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",N,[e.createVNode(e.unref(C.VkScrollbar),{ref_key:"scrollbarRef",ref:i,class:"vk-bubble-list","append-to":s.scrollbarAppendTo,always:s.alwaysShowScrollbar,"hide-after":800,onScroll:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.list,(t,f)=>(e.openBlock(),e.createBlock(e.unref(T.Bubble),{key:t.key||f,content:t.content,placement:t.placement,loading:t.loading,shape:t.shape,variant:t.variant,"is-markdown":t.isMarkdown,"is-fog":t.isFog,typing:t.typing,"max-width":t.maxWidth,avatar:t.avatar,"avatar-size":t.avatarSize,"avatar-gap":t.avatarGap,"avatar-shape":t.avatarShape,"avatar-src-set":t.avatarSrcSet,"avatar-alt":t.avatarAlt,"avatar-fit":t.avatarFit,"no-style":t.noStyle,class:e.normalizeClass({[`is-${t.role}`]:!0})},e.createSlots({_:2},[o.$slots.avatar?{name:"avatar",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"avatar",{item:t})]),key:"0"}:void 0,o.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"header",{item:t})]),key:"1"}:void 0,o.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"content",{item:t})]),key:"2"}:void 0,o.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"footer",{item:t})]),key:"3"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"loading",{item:t})]),key:"4"}:void 0]),1032,["content","placement","loading","shape","variant","is-markdown","is-fog","typing","max-width","avatar","avatar-size","avatar-gap","avatar-shape","avatar-src-set","avatar-alt","avatar-fit","no-style","class"]))),128))]),_:3},8,["append-to","always"]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["vk-bubble-list-default-back-button",{"vk-bubble-list-back-to-bottom-solt":o.$slots.backToBottom}]),style:e.normalizeStyle({bottom:s.backButtonPosition.bottom,left:s.backButtonPosition.left}),onClick:b},[e.renderSlot(o.$slots,"backToBottom",{},()=>[e.createVNode(d,{class:"vk-bubble-list-back-to-bottom-icon",style:e.normalizeStyle({color:a.btnColor})},{default:e.withCtx(()=>[e.createVNode(e.unref(w.ArrowDownBold)),a.btnLoading?(e.openBlock(),e.createBlock(z,{key:0,class:"back-to-bottom-loading-svg-bg"})):e.createCommentVNode("",!0)]),_:1},8,["style"])])],6),[[e.vShow,m.value]])])}}}),A={items:{type:Array,default:()=>[]},elRef:{type:Function,default:x.noop},scrollbarAppendTo:null,autoScrollThreshold:{type:Number,default:200}},c=e.defineComponent({name:"VkBubbleList",inheritAttrs:!1,__name:"index",props:A,setup(s){return(l,a)=>(e.openBlock(),e.createBlock(e.unref(h.VkBubbleRenderTemplates),null,{placeholder:e.withCtx(()=>[e.createVNode(e.unref(h.VkBubbleTemplates))]),default:e.withCtx(()=>[e.renderSlot(l.$slots,"renderer"),e.createVNode(e.unref(B.ElAutoResizer),null,{default:e.withCtx(({height:i})=>[e.createVNode(q,e.mergeProps({ref:l.elRef,"btn-icon-size":18,"max-height":`${i}px`,"scrollbar-append-to":l.scrollbarAppendTo,"auto-scroll-threshold":l.autoScrollThreshold,style:{"--el-bubble-list-max-height":`${i}px`},list:l.items},l.$attrs),e.createSlots({content:e.withCtx(({item:r})=>[e.createVNode(e.unref(h.VkBubbleRenderer),{source:[r]},null,8,["source"])]),_:2},[l.$slots.avatar?{name:"avatar",fn:e.withCtx(r=>[e.renderSlot(l.$slots,"avatar",e.normalizeProps(e.guardReactiveProps(r)))]),key:"0"}:void 0,l.$slots.header?{name:"header",fn:e.withCtx(r=>[e.renderSlot(l.$slots,"header",e.normalizeProps(e.guardReactiveProps(r)))]),key:"1"}:void 0,l.$slots.loading?{name:"loading",fn:e.withCtx(r=>[e.renderSlot(l.$slots,"loading",e.normalizeProps(e.guardReactiveProps(r)))]),key:"2"}:void 0,l.$slots.footer?{name:"footer",fn:e.withCtx(r=>[e.renderSlot(l.$slots,"footer",e.normalizeProps(e.guardReactiveProps(r)))]),key:"3"}:void 0]),1040,["max-height","scrollbar-append-to","auto-scroll-threshold","style","list"])]),_:3})]),_:3}))}}),E=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));c.install=s=>{s.component(c.name||"VkBubbleList",c)};Object.defineProperty(exports,"Role",{enumerable:!0,get:()=>R.Role});exports.VkBubbleList=c;exports.__VkBubbleList=E;exports.default=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("@vunk/plus/components/bubble-templates"),$=require("element-plus"),k=require("@vunk/plus/vue-virtual-scroller"),x=require("@element-plus/icons-vue"),R=require("@vueuse/core"),w=require("@vunk/plus/components/scrollbar"),B=require("@vunk/plus/element/bubble"),V=require("../_plugin-vue_export-helper-BHFhmbuH.js"),z=require("@vunk/shared/function"),P=require("@vunk/plus/components/agent-chat-provider"),N={},q={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"704",height:"704",viewBox:"0 0 704 704"};function A(r,i){return e.openBlock(),e.createElementBlock("svg",q,[...i[0]||(i[0]=[e.createStaticVNode('<defs><filter id="master_svg0_62_10054" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.030120481927710843" y="-0.030120481927710843" width="1.0602409638554218" height="1.0602409638554218"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="5" result="effect1_foregroundBlur"></feGaussianBlur></filter><linearGradient id="master_svg1_62_10082" x1="0.5" y1="-0.13192443549633026" x2="0.42319029569625854" y2="1.368432641029358"><stop offset="9.145302325487137%" stop-color="currentColor" stop-opacity="1"></stop><stop offset="13.636428117752075%" stop-color="currentColor" stop-opacity="0.07539999485015869"></stop><stop offset="16.968481242656708%" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs><g transform="matrix(0,1,-1,0,704,-664)" filter="url(#master_svg0_62_10054)"><path d="M1016,684C1199.359,684,1348,535.359,1348,352C1348,168.641,1199.359,20,1016,20C832.641,20,684,168.641,684,352C684,535.359,832.641,684,1016,684ZM1016,32C1192.731,32,1336,175.269,1336,352C1336,528.731,1192.731,672,1016,672C839.269,672,696,528.731,696,352C696,175.269,839.269,32,1016,32Z" fill-rule="evenodd" fill="url(#master_svg1_62_10082)" fill-opacity="1"></path></g>',2)])])}const F=V._export_sfc(N,[["render",A]]),E={class:"vk-bubble-list-wrapper"},L=e.defineComponent({__name:"index",props:{list:{type:Array,default:()=>[]},autoScroll:{type:Boolean,default:!0},autoScrollThreshold:{type:Number,default:200},maxHeight:{type:String,default:""},alwaysShowScrollbar:{type:Boolean,default:!1},backButtonThreshold:{type:Number,default:80},showBackButton:{type:Boolean,default:!0},backButtonPosition:{type:Object,default:()=>({bottom:"20px",left:"calc(50% - 19px)"})},btnLoading:{type:Boolean,default:!0},btnColor:{type:String,default:"#409EFF"},btnIconSize:{type:Number,default:24},scrollbarAppendTo:{type:null,default:void 0},virtual:{type:Boolean,default:!1}},emits:{complete:null},setup(r,{expose:i}){const l=r,n=e.ref(),a=e.ref(),v=e.ref();function u(){document.documentElement.style.setProperty("--el-bubble-list-max-height",l.maxHeight||"100%"),document.documentElement.style.setProperty("--el-bubble-list-btn-size",`${l.btnIconSize}px`)}e.onMounted(()=>{u(),l.virtual&&e.nextTick(()=>{const o=n.value?.wrapRef;o&&(v.value=o)}),setTimeout(p)}),e.watch(()=>[l.maxHeight,l.btnIconSize],()=>u());const s=e.ref(),S=e.computed(()=>l.showBackButton&&s.value!==void 0&&s.value>l.backButtonThreshold);function p(){const o=n.value?.wrapRef;if(o)return s.value=o.scrollHeight-o.scrollTop-o.clientHeight,s.value}function h(){if(l.virtual){a.value?.scrollToBottom();return}n.value?.scrollToBottom()}function C(){if(l.virtual){a.value?.scrollToItem(0);return}n.value?.scrollToTop()}function T(o){if(l.virtual){a.value?.scrollToItem(o);return}const c=n.value?.wrapRef;if(!c)return;const b=c.querySelectorAll(".el-bubble");if(o>=b.length)return;const t=b[o],d=c.getBoundingClientRect(),y=t.getBoundingClientRect();c.scrollTo({top:y.top-d.top+c.scrollTop,behavior:"smooth"})}const g=e.ref();return e.onMounted(()=>{e.nextTick(()=>{g.value=n.value?.wrapRef?.firstElementChild})}),l.autoScroll&&R.useResizeObserver(g,()=>{const o=p();o!==void 0&&o>l.autoScrollThreshold||h()}),i({scrollToTop:C,scrollToBottom:h,scrollToBubble:T}),(o,c)=>{const b=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",E,[r.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vk-bubble-list-virtual-host",style:e.normalizeStyle({height:r.maxHeight||"100%"})},[e.createVNode(e.unref(w.VkScrollbar),{ref_key:"scrollbarRef",ref:n,class:"vk-bubble-list-virtual-scrollbar",always:r.alwaysShowScrollbar,"hide-after":800,onScroll:p},{default:e.withCtx(()=>[v.value?(e.openBlock(),e.createBlock(e.unref(k.DynamicScroller),{key:0,ref_key:"scrollerRef",ref:a,items:r.list,"min-item-size":54,"key-field":"key","page-mode":!0,"scroll-parent":v.value,class:"vk-bubble-list-dynamic-scroller"},{default:e.withCtx(({item:t,index:d,active:y})=>[e.createVNode(e.unref(k.DynamicScrollerItem),{item:t,active:y,"data-index":d,class:"vk-bubble-list-virtual-item"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Bubble),{content:t.content,placement:t.placement,loading:t.loading,shape:t.shape,variant:t.variant,"is-markdown":t.isMarkdown,"is-fog":t.isFog,typing:t.typing,"max-width":t.maxWidth,avatar:t.avatar,"avatar-size":t.avatarSize,"avatar-gap":t.avatarGap,"avatar-shape":t.avatarShape,"avatar-src-set":t.avatarSrcSet,"avatar-alt":t.avatarAlt,"avatar-fit":t.avatarFit,"no-style":t.noStyle,class:e.normalizeClass({[`is-${t.role}`]:!0})},e.createSlots({_:2},[o.$slots.avatar?{name:"avatar",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"avatar",{item:t})]),key:"0"}:void 0,o.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"header",{item:t})]),key:"1"}:void 0,o.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"content",{item:t})]),key:"2"}:void 0,o.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"footer",{item:t})]),key:"3"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"loading",{item:t})]),key:"4"}:void 0]),1032,["content","placement","loading","shape","variant","is-markdown","is-fog","typing","max-width","avatar","avatar-size","avatar-gap","avatar-shape","avatar-src-set","avatar-alt","avatar-fit","no-style","class"])]),_:2},1032,["item","active","data-index"])]),_:3},8,["items","scroll-parent"])):e.createCommentVNode("",!0)]),_:3},8,["always"])],4)):(e.openBlock(),e.createBlock(e.unref(w.VkScrollbar),{key:1,ref_key:"scrollbarRef",ref:n,class:"vk-bubble-list","append-to":r.scrollbarAppendTo,always:r.alwaysShowScrollbar,"hide-after":800,onScroll:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.list,(t,d)=>(e.openBlock(),e.createBlock(e.unref(B.Bubble),{key:t.key||d,content:t.content,placement:t.placement,loading:t.loading,shape:t.shape,variant:t.variant,"is-markdown":t.isMarkdown,"is-fog":t.isFog,typing:t.typing,"max-width":t.maxWidth,avatar:t.avatar,"avatar-size":t.avatarSize,"avatar-gap":t.avatarGap,"avatar-shape":t.avatarShape,"avatar-src-set":t.avatarSrcSet,"avatar-alt":t.avatarAlt,"avatar-fit":t.avatarFit,"no-style":t.noStyle,class:e.normalizeClass({[`is-${t.role}`]:!0})},e.createSlots({_:2},[o.$slots.avatar?{name:"avatar",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"avatar",{item:t})]),key:"0"}:void 0,o.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"header",{item:t})]),key:"1"}:void 0,o.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"content",{item:t})]),key:"2"}:void 0,o.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"footer",{item:t})]),key:"3"}:void 0,o.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"loading",{item:t})]),key:"4"}:void 0]),1032,["content","placement","loading","shape","variant","is-markdown","is-fog","typing","max-width","avatar","avatar-size","avatar-gap","avatar-shape","avatar-src-set","avatar-alt","avatar-fit","no-style","class"]))),128))]),_:3},8,["append-to","always"])),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["vk-bubble-list-default-back-button",{"vk-bubble-list-back-to-bottom-solt":o.$slots.backToBottom}]),style:e.normalizeStyle({bottom:r.backButtonPosition.bottom,left:r.backButtonPosition.left}),onClick:h},[e.renderSlot(o.$slots,"backToBottom",{},()=>[e.createVNode(b,{class:"vk-bubble-list-back-to-bottom-icon",style:e.normalizeStyle({color:l.btnColor})},{default:e.withCtx(()=>[e.createVNode(e.unref(x.ArrowDownBold)),l.btnLoading?(e.openBlock(),e.createBlock(F,{key:0,class:"back-to-bottom-loading-svg-bg"})):e.createCommentVNode("",!0)]),_:1},8,["style"])])],6),[[e.vShow,S.value]])])}}}),M={items:{type:Array,default:()=>[]},elRef:{type:Function,default:z.noop},scrollbarAppendTo:null,virtual:{type:Boolean,default:!1},autoScrollThreshold:{type:Number,default:200}},f=e.defineComponent({name:"VkBubbleList",inheritAttrs:!1,__name:"index",props:M,setup(r,{expose:i}){const l=r,n=e.ref();return e.watch(()=>l.elRef,a=>{a&&a(n.value)},{immediate:!0}),i({scrollToTop:()=>n.value?.scrollToTop(),scrollToBottom:()=>n.value?.scrollToBottom(),scrollToBubble:a=>n.value?.scrollToBubble(a)}),(a,v)=>(e.openBlock(),e.createBlock(e.unref(m.VkBubbleRenderTemplates),null,{placeholder:e.withCtx(()=>[e.createVNode(e.unref(m.VkBubbleTemplates))]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"renderer"),e.createVNode(e.unref($.ElAutoResizer),null,{default:e.withCtx(({height:u})=>[e.createVNode(L,e.mergeProps({ref_key:"bubbleListRef",ref:n,"btn-icon-size":18,"max-height":`${u}px`,"scrollbar-append-to":a.scrollbarAppendTo,virtual:a.virtual,"auto-scroll-threshold":a.autoScrollThreshold,style:{"--el-bubble-list-max-height":`${u}px`},list:a.items},a.$attrs),e.createSlots({content:e.withCtx(({item:s})=>[e.createVNode(e.unref(m.VkBubbleRenderer),{source:[s]},null,8,["source"])]),_:2},[a.$slots.avatar?{name:"avatar",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"avatar",e.normalizeProps(e.guardReactiveProps(s)))]),key:"0"}:void 0,a.$slots.header?{name:"header",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"header",e.normalizeProps(e.guardReactiveProps(s)))]),key:"1"}:void 0,a.$slots.loading?{name:"loading",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"loading",e.normalizeProps(e.guardReactiveProps(s)))]),key:"2"}:void 0,a.$slots.footer?{name:"footer",fn:e.withCtx(s=>[e.renderSlot(a.$slots,"footer",e.normalizeProps(e.guardReactiveProps(s)))]),key:"3"}:void 0]),1040,["max-height","scrollbar-append-to","virtual","auto-scroll-threshold","style","list"])]),_:3})]),_:3}))}}),_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));f.install=r=>{r.component(f.name||"VkBubbleList",f)};Object.defineProperty(exports,"Role",{enumerable:!0,get:()=>P.Role});exports.VkBubbleList=f;exports.__VkBubbleList=_;exports.default=f;
@@ -1,14 +1,15 @@
1
- import { openBlock as p, createElementBlock as B, createStaticVNode as E, defineComponent as _, ref as S, onMounted as $, watch as N, computed as T, resolveComponent as G, createVNode as u, unref as d, withCtx as l, Fragment as L, renderList as H, createBlock as w, normalizeClass as C, createSlots as z, renderSlot as s, withDirectives as I, createElementVNode as M, normalizeStyle as R, createCommentVNode as j, vShow as D, mergeProps as O, normalizeProps as m, guardReactiveProps as v } from "vue";
2
- import { VkBubbleRenderTemplates as Z, VkBubbleRenderer as q, VkBubbleTemplates as U } from "@vunk/plus/components/bubble-templates";
3
- import { ElAutoResizer as W } from "element-plus";
4
- import { ArrowDownBold as J } from "@element-plus/icons-vue";
5
- import { useResizeObserver as K } from "@vueuse/core";
6
- import { VkScrollbar as Q } from "@vunk/plus/components/scrollbar";
7
- import { Bubble as X } from "@vunk/plus/element/bubble";
8
- import { _ as Y } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
9
- import { noop as ee } from "@vunk/shared/function";
10
- import { Role as Be } from "@vunk/plus/components/agent-chat-provider";
11
- const te = {}, oe = {
1
+ import { openBlock as c, createElementBlock as S, createStaticVNode as M, defineComponent as I, ref as p, onMounted as F, nextTick as P, watch as N, computed as _, resolveComponent as j, normalizeStyle as R, createVNode as d, unref as u, withCtx as o, createBlock as h, normalizeClass as C, createSlots as V, renderSlot as r, createCommentVNode as L, Fragment as O, renderList as W, withDirectives as Z, createElementVNode as q, vShow as U, mergeProps as J, normalizeProps as B, guardReactiveProps as w } from "vue";
2
+ import { VkBubbleRenderTemplates as K, VkBubbleRenderer as Q, VkBubbleTemplates as X } from "@vunk/plus/components/bubble-templates";
3
+ import { ElAutoResizer as Y } from "element-plus";
4
+ import { DynamicScroller as ee, DynamicScrollerItem as te } from "@vunk/plus/vue-virtual-scroller";
5
+ import { ArrowDownBold as ae } from "@element-plus/icons-vue";
6
+ import { useResizeObserver as oe } from "@vueuse/core";
7
+ import { VkScrollbar as E } from "@vunk/plus/components/scrollbar";
8
+ import { Bubble as G } from "@vunk/plus/element/bubble";
9
+ import { _ as le } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
10
+ import { noop as re } from "@vunk/shared/function";
11
+ import { Role as Re } from "@vunk/plus/components/agent-chat-provider";
12
+ const se = {}, ne = {
12
13
  xmlns: "http://www.w3.org/2000/svg",
13
14
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
14
15
  version: "1.1",
@@ -16,12 +17,12 @@ const te = {}, oe = {
16
17
  height: "704",
17
18
  viewBox: "0 0 704 704"
18
19
  };
19
- function le(i, o) {
20
- return p(), B("svg", oe, [...o[0] || (o[0] = [
21
- E('<defs><filter id="master_svg0_62_10054" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.030120481927710843" y="-0.030120481927710843" width="1.0602409638554218" height="1.0602409638554218"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="5" result="effect1_foregroundBlur"></feGaussianBlur></filter><linearGradient id="master_svg1_62_10082" x1="0.5" y1="-0.13192443549633026" x2="0.42319029569625854" y2="1.368432641029358"><stop offset="9.145302325487137%" stop-color="currentColor" stop-opacity="1"></stop><stop offset="13.636428117752075%" stop-color="currentColor" stop-opacity="0.07539999485015869"></stop><stop offset="16.968481242656708%" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs><g transform="matrix(0,1,-1,0,704,-664)" filter="url(#master_svg0_62_10054)"><path d="M1016,684C1199.359,684,1348,535.359,1348,352C1348,168.641,1199.359,20,1016,20C832.641,20,684,168.641,684,352C684,535.359,832.641,684,1016,684ZM1016,32C1192.731,32,1336,175.269,1336,352C1336,528.731,1192.731,672,1016,672C839.269,672,696,528.731,696,352C696,175.269,839.269,32,1016,32Z" fill-rule="evenodd" fill="url(#master_svg1_62_10082)" fill-opacity="1"></path></g>', 2)
20
+ function ie(s, f) {
21
+ return c(), S("svg", ne, [...f[0] || (f[0] = [
22
+ M('<defs><filter id="master_svg0_62_10054" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.030120481927710843" y="-0.030120481927710843" width="1.0602409638554218" height="1.0602409638554218"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="5" result="effect1_foregroundBlur"></feGaussianBlur></filter><linearGradient id="master_svg1_62_10082" x1="0.5" y1="-0.13192443549633026" x2="0.42319029569625854" y2="1.368432641029358"><stop offset="9.145302325487137%" stop-color="currentColor" stop-opacity="1"></stop><stop offset="13.636428117752075%" stop-color="currentColor" stop-opacity="0.07539999485015869"></stop><stop offset="16.968481242656708%" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs><g transform="matrix(0,1,-1,0,704,-664)" filter="url(#master_svg0_62_10054)"><path d="M1016,684C1199.359,684,1348,535.359,1348,352C1348,168.641,1199.359,20,1016,20C832.641,20,684,168.641,684,352C684,535.359,832.641,684,1016,684ZM1016,32C1192.731,32,1336,175.269,1336,352C1336,528.731,1192.731,672,1016,672C839.269,672,696,528.731,696,352C696,175.269,839.269,32,1016,32Z" fill-rule="evenodd" fill="url(#master_svg1_62_10082)" fill-opacity="1"></path></g>', 2)
22
23
  ])]);
23
24
  }
24
- const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-list-wrapper" }, ne = /* @__PURE__ */ _({
25
+ const ue = /* @__PURE__ */ le(se, [["render", ie]]), ce = { class: "vk-bubble-list-wrapper" }, de = /* @__PURE__ */ I({
25
26
  __name: "index",
26
27
  props: {
27
28
  list: {
@@ -71,81 +72,199 @@ const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-lis
71
72
  scrollbarAppendTo: {
72
73
  type: null,
73
74
  default: void 0
75
+ },
76
+ /** Enable virtual list rendering via vue-virtual-scroller */
77
+ virtual: {
78
+ type: Boolean,
79
+ default: !1
74
80
  }
75
81
  },
76
82
  emits: {
77
83
  complete: null
78
84
  },
79
- setup(i, { expose: o }) {
80
- const r = i, c = S();
81
- function a() {
85
+ setup(s, { expose: f }) {
86
+ const l = s, n = p(), a = p(), y = p();
87
+ function b() {
82
88
  document.documentElement.style.setProperty(
83
89
  "--el-bubble-list-max-height",
84
- r.maxHeight || "100%"
90
+ l.maxHeight || "100%"
85
91
  ), document.documentElement.style.setProperty(
86
92
  "--el-bubble-list-btn-size",
87
- `${r.btnIconSize}px`
93
+ `${l.btnIconSize}px`
88
94
  );
89
95
  }
90
- $(() => {
91
- a();
96
+ F(() => {
97
+ b(), l.virtual && P(() => {
98
+ const t = n.value?.wrapRef;
99
+ t && (y.value = t);
100
+ }), setTimeout(g);
92
101
  }), N(
93
- () => [r.maxHeight, r.btnIconSize],
94
- () => {
95
- a();
96
- }
102
+ () => [l.maxHeight, l.btnIconSize],
103
+ () => b()
97
104
  );
98
- const f = S(), V = T(() => c.value?.wrapRef?.firstElementChild), A = T(() => r.showBackButton && f.value !== void 0 && f.value > r.backButtonThreshold);
99
- $(() => {
100
- setTimeout(h);
101
- });
102
- function h() {
103
- const t = c.value?.$el, n = c.value?.wrapRef;
104
- if (!(!t || !n))
105
- return f.value = n.scrollHeight - n.scrollTop - n.clientHeight, f.value;
105
+ const i = p(), x = _(() => l.showBackButton && i.value !== void 0 && i.value > l.backButtonThreshold);
106
+ function g() {
107
+ const t = n.value?.wrapRef;
108
+ if (t)
109
+ return i.value = t.scrollHeight - t.scrollTop - t.clientHeight, i.value;
106
110
  }
107
- function g(...t) {
108
- c.value?.scrollToBottom(...t);
109
- }
110
- function x(...t) {
111
- c.value?.scrollToTop(...t);
111
+ function T() {
112
+ if (l.virtual) {
113
+ a.value?.scrollToBottom();
114
+ return;
115
+ }
116
+ n.value?.scrollToBottom();
112
117
  }
113
- r.autoScroll && K(V, () => {
114
- const t = h();
115
- t !== void 0 && t > r.autoScrollThreshold || g();
116
- });
117
- function F(t) {
118
- const n = c.value?.wrapRef;
119
- if (!n)
118
+ function D() {
119
+ if (l.virtual) {
120
+ a.value?.scrollToItem(0);
120
121
  return;
121
- const b = n.querySelectorAll(".el-bubble");
122
- if (t >= b.length)
122
+ }
123
+ n.value?.scrollToTop();
124
+ }
125
+ function H(t) {
126
+ if (l.virtual) {
127
+ a.value?.scrollToItem(t);
123
128
  return;
124
- const e = b[t], y = n.getBoundingClientRect(), P = e.getBoundingClientRect().top - y.top + n.scrollTop;
125
- n.scrollTo({
126
- top: P,
129
+ }
130
+ const v = n.value?.wrapRef;
131
+ if (!v) return;
132
+ const k = v.querySelectorAll(".el-bubble");
133
+ if (t >= k.length) return;
134
+ const e = k[t], m = v.getBoundingClientRect(), $ = e.getBoundingClientRect();
135
+ v.scrollTo({
136
+ top: $.top - m.top + v.scrollTop,
127
137
  behavior: "smooth"
128
138
  });
129
139
  }
130
- return o({
131
- scrollToTop: x,
132
- scrollToBottom: g,
133
- scrollToBubble: F
134
- }), (t, n) => {
135
- const b = G("el-icon");
136
- return p(), B("div", re, [
137
- u(d(Q), {
140
+ const A = p();
141
+ return F(() => {
142
+ P(() => {
143
+ A.value = n.value?.wrapRef?.firstElementChild;
144
+ });
145
+ }), l.autoScroll && oe(A, () => {
146
+ const t = g();
147
+ t !== void 0 && t > l.autoScrollThreshold || T();
148
+ }), f({
149
+ scrollToTop: D,
150
+ scrollToBottom: T,
151
+ scrollToBubble: H
152
+ }), (t, v) => {
153
+ const k = j("el-icon");
154
+ return c(), S("div", ce, [
155
+ s.virtual ? (c(), S("div", {
156
+ key: 0,
157
+ class: "vk-bubble-list-virtual-host",
158
+ style: R({ height: s.maxHeight || "100%" })
159
+ }, [
160
+ d(u(E), {
161
+ ref_key: "scrollbarRef",
162
+ ref: n,
163
+ class: "vk-bubble-list-virtual-scrollbar",
164
+ always: s.alwaysShowScrollbar,
165
+ "hide-after": 800,
166
+ onScroll: g
167
+ }, {
168
+ default: o(() => [
169
+ y.value ? (c(), h(u(ee), {
170
+ key: 0,
171
+ ref_key: "scrollerRef",
172
+ ref: a,
173
+ items: s.list,
174
+ "min-item-size": 54,
175
+ "key-field": "key",
176
+ "page-mode": !0,
177
+ "scroll-parent": y.value,
178
+ class: "vk-bubble-list-dynamic-scroller"
179
+ }, {
180
+ default: o(({ item: e, index: m, active: $ }) => [
181
+ d(u(te), {
182
+ item: e,
183
+ active: $,
184
+ "data-index": m,
185
+ class: "vk-bubble-list-virtual-item"
186
+ }, {
187
+ default: o(() => [
188
+ d(u(G), {
189
+ content: e.content,
190
+ placement: e.placement,
191
+ loading: e.loading,
192
+ shape: e.shape,
193
+ variant: e.variant,
194
+ "is-markdown": e.isMarkdown,
195
+ "is-fog": e.isFog,
196
+ typing: e.typing,
197
+ "max-width": e.maxWidth,
198
+ avatar: e.avatar,
199
+ "avatar-size": e.avatarSize,
200
+ "avatar-gap": e.avatarGap,
201
+ "avatar-shape": e.avatarShape,
202
+ "avatar-src-set": e.avatarSrcSet,
203
+ "avatar-alt": e.avatarAlt,
204
+ "avatar-fit": e.avatarFit,
205
+ "no-style": e.noStyle,
206
+ class: C({
207
+ [`is-${e.role}`]: !0
208
+ })
209
+ }, V({ _: 2 }, [
210
+ t.$slots.avatar ? {
211
+ name: "avatar",
212
+ fn: o(() => [
213
+ r(t.$slots, "avatar", { item: e })
214
+ ]),
215
+ key: "0"
216
+ } : void 0,
217
+ t.$slots.header ? {
218
+ name: "header",
219
+ fn: o(() => [
220
+ r(t.$slots, "header", { item: e })
221
+ ]),
222
+ key: "1"
223
+ } : void 0,
224
+ t.$slots.content ? {
225
+ name: "content",
226
+ fn: o(() => [
227
+ r(t.$slots, "content", { item: e })
228
+ ]),
229
+ key: "2"
230
+ } : void 0,
231
+ t.$slots.footer ? {
232
+ name: "footer",
233
+ fn: o(() => [
234
+ r(t.$slots, "footer", { item: e })
235
+ ]),
236
+ key: "3"
237
+ } : void 0,
238
+ t.$slots.loading ? {
239
+ name: "loading",
240
+ fn: o(() => [
241
+ r(t.$slots, "loading", { item: e })
242
+ ]),
243
+ key: "4"
244
+ } : void 0
245
+ ]), 1032, ["content", "placement", "loading", "shape", "variant", "is-markdown", "is-fog", "typing", "max-width", "avatar", "avatar-size", "avatar-gap", "avatar-shape", "avatar-src-set", "avatar-alt", "avatar-fit", "no-style", "class"])
246
+ ]),
247
+ _: 2
248
+ }, 1032, ["item", "active", "data-index"])
249
+ ]),
250
+ _: 3
251
+ }, 8, ["items", "scroll-parent"])) : L("", !0)
252
+ ]),
253
+ _: 3
254
+ }, 8, ["always"])
255
+ ], 4)) : (c(), h(u(E), {
256
+ key: 1,
138
257
  ref_key: "scrollbarRef",
139
- ref: c,
258
+ ref: n,
140
259
  class: "vk-bubble-list",
141
- "append-to": i.scrollbarAppendTo,
142
- always: i.alwaysShowScrollbar,
260
+ "append-to": s.scrollbarAppendTo,
261
+ always: s.alwaysShowScrollbar,
143
262
  "hide-after": 800,
144
- onScroll: h
263
+ onScroll: g
145
264
  }, {
146
- default: l(() => [
147
- (p(!0), B(L, null, H(i.list, (e, y) => (p(), w(d(X), {
148
- key: e.key || y,
265
+ default: o(() => [
266
+ (c(!0), S(O, null, W(s.list, (e, m) => (c(), h(u(G), {
267
+ key: e.key || m,
149
268
  content: e.content,
150
269
  placement: e.placement,
151
270
  loading: e.loading,
@@ -166,152 +285,165 @@ const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-lis
166
285
  class: C({
167
286
  [`is-${e.role}`]: !0
168
287
  })
169
- }, z({ _: 2 }, [
288
+ }, V({ _: 2 }, [
170
289
  t.$slots.avatar ? {
171
290
  name: "avatar",
172
- fn: l(() => [
173
- s(t.$slots, "avatar", { item: e })
291
+ fn: o(() => [
292
+ r(t.$slots, "avatar", { item: e })
174
293
  ]),
175
294
  key: "0"
176
295
  } : void 0,
177
296
  t.$slots.header ? {
178
297
  name: "header",
179
- fn: l(() => [
180
- s(t.$slots, "header", { item: e })
298
+ fn: o(() => [
299
+ r(t.$slots, "header", { item: e })
181
300
  ]),
182
301
  key: "1"
183
302
  } : void 0,
184
303
  t.$slots.content ? {
185
304
  name: "content",
186
- fn: l(() => [
187
- s(t.$slots, "content", { item: e })
305
+ fn: o(() => [
306
+ r(t.$slots, "content", { item: e })
188
307
  ]),
189
308
  key: "2"
190
309
  } : void 0,
191
310
  t.$slots.footer ? {
192
311
  name: "footer",
193
- fn: l(() => [
194
- s(t.$slots, "footer", { item: e })
312
+ fn: o(() => [
313
+ r(t.$slots, "footer", { item: e })
195
314
  ]),
196
315
  key: "3"
197
316
  } : void 0,
198
317
  t.$slots.loading ? {
199
318
  name: "loading",
200
- fn: l(() => [
201
- s(t.$slots, "loading", { item: e })
319
+ fn: o(() => [
320
+ r(t.$slots, "loading", { item: e })
202
321
  ]),
203
322
  key: "4"
204
323
  } : void 0
205
324
  ]), 1032, ["content", "placement", "loading", "shape", "variant", "is-markdown", "is-fog", "typing", "max-width", "avatar", "avatar-size", "avatar-gap", "avatar-shape", "avatar-src-set", "avatar-alt", "avatar-fit", "no-style", "class"]))), 128))
206
325
  ]),
207
326
  _: 3
208
- }, 8, ["append-to", "always"]),
209
- I(M("div", {
327
+ }, 8, ["append-to", "always"])),
328
+ Z(q("div", {
210
329
  class: C(["vk-bubble-list-default-back-button", {
211
330
  "vk-bubble-list-back-to-bottom-solt": t.$slots.backToBottom
212
331
  }]),
213
332
  style: R({
214
- bottom: i.backButtonPosition.bottom,
215
- left: i.backButtonPosition.left
333
+ bottom: s.backButtonPosition.bottom,
334
+ left: s.backButtonPosition.left
216
335
  }),
217
- onClick: g
336
+ onClick: T
218
337
  }, [
219
- s(t.$slots, "backToBottom", {}, () => [
220
- u(b, {
338
+ r(t.$slots, "backToBottom", {}, () => [
339
+ d(k, {
221
340
  class: "vk-bubble-list-back-to-bottom-icon",
222
- style: R({ color: r.btnColor })
341
+ style: R({ color: l.btnColor })
223
342
  }, {
224
- default: l(() => [
225
- u(d(J)),
226
- r.btnLoading ? (p(), w(ae, {
343
+ default: o(() => [
344
+ d(u(ae)),
345
+ l.btnLoading ? (c(), h(ue, {
227
346
  key: 0,
228
347
  class: "back-to-bottom-loading-svg-bg"
229
- })) : j("", !0)
348
+ })) : L("", !0)
230
349
  ]),
231
350
  _: 1
232
351
  }, 8, ["style"])
233
352
  ])
234
353
  ], 6), [
235
- [D, A.value]
354
+ [U, x.value]
236
355
  ])
237
356
  ]);
238
357
  };
239
358
  }
240
- }), se = {
359
+ }), fe = {
241
360
  items: {
242
361
  type: Array,
243
362
  default: () => []
244
363
  },
245
364
  elRef: {
246
365
  type: Function,
247
- default: ee
366
+ default: re
248
367
  },
249
368
  scrollbarAppendTo: null,
369
+ virtual: {
370
+ type: Boolean,
371
+ default: !1
372
+ },
250
373
  autoScrollThreshold: {
251
374
  type: Number,
252
375
  default: 200
253
376
  }
254
- }, k = /* @__PURE__ */ _({
377
+ }, z = /* @__PURE__ */ I({
255
378
  name: "VkBubbleList",
256
379
  inheritAttrs: !1,
257
380
  __name: "index",
258
- props: se,
259
- setup(i) {
260
- return (o, r) => (p(), w(d(Z), null, {
261
- placeholder: l(() => [
262
- u(d(U))
381
+ props: fe,
382
+ setup(s, { expose: f }) {
383
+ const l = s, n = p();
384
+ return N(() => l.elRef, (a) => {
385
+ a && a(n.value);
386
+ }, { immediate: !0 }), f({
387
+ scrollToTop: () => n.value?.scrollToTop(),
388
+ scrollToBottom: () => n.value?.scrollToBottom(),
389
+ scrollToBubble: (a) => n.value?.scrollToBubble(a)
390
+ }), (a, y) => (c(), h(u(K), null, {
391
+ placeholder: o(() => [
392
+ d(u(X))
263
393
  ]),
264
- default: l(() => [
265
- s(o.$slots, "renderer"),
266
- u(d(W), null, {
267
- default: l(({ height: c }) => [
268
- u(ne, O({
269
- ref: o.elRef,
394
+ default: o(() => [
395
+ r(a.$slots, "renderer"),
396
+ d(u(Y), null, {
397
+ default: o(({ height: b }) => [
398
+ d(de, J({
399
+ ref_key: "bubbleListRef",
400
+ ref: n,
270
401
  "btn-icon-size": 18,
271
- "max-height": `${c}px`,
272
- "scrollbar-append-to": o.scrollbarAppendTo,
273
- "auto-scroll-threshold": o.autoScrollThreshold,
402
+ "max-height": `${b}px`,
403
+ "scrollbar-append-to": a.scrollbarAppendTo,
404
+ virtual: a.virtual,
405
+ "auto-scroll-threshold": a.autoScrollThreshold,
274
406
  style: {
275
- "--el-bubble-list-max-height": `${c}px`
407
+ "--el-bubble-list-max-height": `${b}px`
276
408
  },
277
- list: o.items
278
- }, o.$attrs), z({
279
- content: l(({ item: a }) => [
280
- u(d(q), {
281
- source: [a]
409
+ list: a.items
410
+ }, a.$attrs), V({
411
+ content: o(({ item: i }) => [
412
+ d(u(Q), {
413
+ source: [i]
282
414
  }, null, 8, ["source"])
283
415
  ]),
284
416
  _: 2
285
417
  }, [
286
- o.$slots.avatar ? {
418
+ a.$slots.avatar ? {
287
419
  name: "avatar",
288
- fn: l((a) => [
289
- s(o.$slots, "avatar", m(v(a)))
420
+ fn: o((i) => [
421
+ r(a.$slots, "avatar", B(w(i)))
290
422
  ]),
291
423
  key: "0"
292
424
  } : void 0,
293
- o.$slots.header ? {
425
+ a.$slots.header ? {
294
426
  name: "header",
295
- fn: l((a) => [
296
- s(o.$slots, "header", m(v(a)))
427
+ fn: o((i) => [
428
+ r(a.$slots, "header", B(w(i)))
297
429
  ]),
298
430
  key: "1"
299
431
  } : void 0,
300
- o.$slots.loading ? {
432
+ a.$slots.loading ? {
301
433
  name: "loading",
302
- fn: l((a) => [
303
- s(o.$slots, "loading", m(v(a)))
434
+ fn: o((i) => [
435
+ r(a.$slots, "loading", B(w(i)))
304
436
  ]),
305
437
  key: "2"
306
438
  } : void 0,
307
- o.$slots.footer ? {
439
+ a.$slots.footer ? {
308
440
  name: "footer",
309
- fn: l((a) => [
310
- s(o.$slots, "footer", m(v(a)))
441
+ fn: o((i) => [
442
+ r(a.$slots, "footer", B(w(i)))
311
443
  ]),
312
444
  key: "3"
313
445
  } : void 0
314
- ]), 1040, ["max-height", "scrollbar-append-to", "auto-scroll-threshold", "style", "list"])
446
+ ]), 1040, ["max-height", "scrollbar-append-to", "virtual", "auto-scroll-threshold", "style", "list"])
315
447
  ]),
316
448
  _: 3
317
449
  })
@@ -319,15 +451,15 @@ const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-lis
319
451
  _: 3
320
452
  }));
321
453
  }
322
- }), ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
454
+ }), Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
323
455
  __proto__: null
324
456
  }, Symbol.toStringTag, { value: "Module" }));
325
- k.install = (i) => {
326
- i.component(k.name || "VkBubbleList", k);
457
+ z.install = (s) => {
458
+ s.component(z.name || "VkBubbleList", z);
327
459
  };
328
460
  export {
329
- Be as Role,
330
- k as VkBubbleList,
331
- ge as __VkBubbleList,
332
- k as default
461
+ Re as Role,
462
+ z as VkBubbleList,
463
+ Se as __VkBubbleList,
464
+ z as default
333
465
  };