@vunk/plus 1.15.0 → 1.16.1

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 +276 -123
  3. package/components/bubble-list/src/core/index.vue.d.ts +62 -14
  4. package/components/bubble-list/src/ctx.d.ts +12 -0
  5. package/components/bubble-list/src/index.vue.d.ts +32 -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"),g=require("@vunk/plus/vue-virtual-scroller"),R=require("@element-plus/icons-vue"),x=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"),F={},N={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 q(l,i){return e.openBlock(),e.createElementBlock("svg",N,[...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 A=V._export_sfc(F,[["render",q]]),E={class:"vk-bubble-list-wrapper"},I=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},keyField:{type:String,default:"key"}},emits:{complete:null},setup(l,{expose:i}){const r=l,n=e.ref(),a=e.ref(),v=e.ref();function u(){document.documentElement.style.setProperty("--el-bubble-list-max-height",r.maxHeight||"100%"),document.documentElement.style.setProperty("--el-bubble-list-btn-size",`${r.btnIconSize}px`)}e.onMounted(()=>{u(),r.virtual&&e.nextTick(()=>{const o=n.value?.wrapRef;o&&(v.value=o)}),setTimeout(p)}),e.watch(()=>[r.maxHeight,r.btnIconSize],()=>u());const s=e.ref(),S=e.computed(()=>r.showBackButton&&s.value!==void 0&&s.value>r.backButtonThreshold);function p(){const o=n.value?.wrapRef;if(o)return s.value=o.scrollHeight-o.scrollTop-o.clientHeight,s.value}function h(){if(r.virtual){a.value?.scrollToBottom();return}n.value?.scrollToBottom()}function C(){if(r.virtual){a.value?.scrollToItem(0);return}n.value?.scrollToTop()}function T(o){if(r.virtual){a.value?.scrollToItem(o),requestAnimationFrame(()=>{requestAnimationFrame(()=>{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 k=e.ref();return e.onMounted(()=>{e.nextTick(()=>{k.value=n.value?.wrapRef?.firstElementChild})}),r.autoScroll&&x.useResizeObserver(k,()=>{const o=p();o!==void 0&&o>r.autoScrollThreshold||h()}),i({scrollToTop:C,scrollToBottom:h,scrollToBubble:T}),(o,c)=>{const b=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",E,[l.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vk-bubble-list-virtual-host",style:e.normalizeStyle({height:l.maxHeight||"100%"})},[e.createVNode(e.unref(w.VkScrollbar),{ref_key:"scrollbarRef",ref:n,class:"vk-bubble-list-virtual-scrollbar",always:l.alwaysShowScrollbar,"hide-after":800,onScroll:p},{default:e.withCtx(()=>[v.value?(e.openBlock(),e.createBlock(e.unref(g.DynamicScroller),{key:0,ref_key:"scrollerRef",ref:a,items:l.list,"min-item-size":54,"key-field":l.keyField,"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(g.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","key-field","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":l.scrollbarAppendTo,always:l.alwaysShowScrollbar,"hide-after":800,onScroll:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.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:l.backButtonPosition.bottom,left:l.backButtonPosition.left}),onClick:h},[e.renderSlot(o.$slots,"backToBottom",{},()=>[e.createVNode(b,{class:"vk-bubble-list-back-to-bottom-icon",style:e.normalizeStyle({color:r.btnColor})},{default:e.withCtx(()=>[e.createVNode(e.unref(R.ArrowDownBold)),r.btnLoading?(e.openBlock(),e.createBlock(A,{key:0,class:"back-to-bottom-loading-svg-bg"})):e.createCommentVNode("",!0)]),_:1},8,["style"])])],6),[[e.vShow,S.value]])])}}}),L={items:{type:Array,default:()=>[]},elRef:{type:Function,default:z.noop},scrollbarAppendTo:null,virtual:{type:Boolean,default:!1},keyField:{type:String,default:"key"},autoScrollThreshold:{type:Number,default:200}},f=e.defineComponent({name:"VkBubbleList",inheritAttrs:!1,__name:"index",props:L,setup(l,{expose:i}){const r=l,n=e.ref();return e.watch(()=>r.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(I,e.mergeProps({ref_key:"bubbleListRef",ref:n,"btn-icon-size":18,"max-height":`${u}px`,"scrollbar-append-to":a.scrollbarAppendTo,virtual:a.virtual,"key-field":a.keyField,"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","key-field","auto-scroll-threshold","style","list"])]),_:3})]),_:3}))}}),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));f.install=l=>{l.component(f.name||"VkBubbleList",f)};Object.defineProperty(exports,"Role",{enumerable:!0,get:()=>P.Role});exports.VkBubbleList=f;exports.__VkBubbleList=M;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 x, defineComponent as G, ref as p, onMounted as V, nextTick as P, watch as N, computed as j, resolveComponent as O, normalizeStyle as R, createVNode as d, unref as u, withCtx as o, createBlock as y, normalizeClass as C, createSlots as F, renderSlot as s, createCommentVNode as I, Fragment as q, renderList as W, withDirectives as Z, createElementVNode as _, 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 L } from "@vunk/plus/components/scrollbar";
8
+ import { Bubble as E } 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(l, f) {
21
+ return c(), S("svg", ne, [...f[0] || (f[0] = [
22
+ x('<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__ */ G({
25
26
  __name: "index",
26
27
  props: {
27
28
  list: {
@@ -71,14 +72,27 @@ 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
80
+ },
81
+ /**
82
+ * Key field name for virtual list items.
83
+ * DynamicScroller uses this to uniquely identify each item.
84
+ */
85
+ keyField: {
86
+ type: String,
87
+ default: "key"
74
88
  }
75
89
  },
76
90
  emits: {
77
91
  complete: null
78
92
  },
79
- setup(i, { expose: o }) {
80
- const r = i, c = S();
81
- function a() {
93
+ setup(l, { expose: f }) {
94
+ const r = l, n = p(), a = p(), h = p();
95
+ function b() {
82
96
  document.documentElement.style.setProperty(
83
97
  "--el-bubble-list-max-height",
84
98
  r.maxHeight || "100%"
@@ -87,65 +101,182 @@ const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-lis
87
101
  `${r.btnIconSize}px`
88
102
  );
89
103
  }
90
- $(() => {
91
- a();
104
+ V(() => {
105
+ b(), r.virtual && P(() => {
106
+ const t = n.value?.wrapRef;
107
+ t && (h.value = t);
108
+ }), setTimeout(g);
92
109
  }), N(
93
110
  () => [r.maxHeight, r.btnIconSize],
94
- () => {
95
- a();
96
- }
111
+ () => b()
97
112
  );
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;
106
- }
107
- function g(...t) {
108
- c.value?.scrollToBottom(...t);
113
+ const i = p(), D = j(() => r.showBackButton && i.value !== void 0 && i.value > r.backButtonThreshold);
114
+ function g() {
115
+ const t = n.value?.wrapRef;
116
+ if (t)
117
+ return i.value = t.scrollHeight - t.scrollTop - t.clientHeight, i.value;
109
118
  }
110
- function x(...t) {
111
- c.value?.scrollToTop(...t);
119
+ function T() {
120
+ if (r.virtual) {
121
+ a.value?.scrollToBottom();
122
+ return;
123
+ }
124
+ n.value?.scrollToBottom();
112
125
  }
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)
126
+ function H() {
127
+ if (r.virtual) {
128
+ a.value?.scrollToItem(0);
120
129
  return;
121
- const b = n.querySelectorAll(".el-bubble");
122
- if (t >= b.length)
130
+ }
131
+ n.value?.scrollToTop();
132
+ }
133
+ function M(t) {
134
+ if (r.virtual) {
135
+ a.value?.scrollToItem(t), requestAnimationFrame(() => {
136
+ requestAnimationFrame(() => {
137
+ a.value?.scrollToItem(t);
138
+ });
139
+ });
123
140
  return;
124
- const e = b[t], y = n.getBoundingClientRect(), P = e.getBoundingClientRect().top - y.top + n.scrollTop;
125
- n.scrollTo({
126
- top: P,
141
+ }
142
+ const v = n.value?.wrapRef;
143
+ if (!v) return;
144
+ const k = v.querySelectorAll(".el-bubble");
145
+ if (t >= k.length) return;
146
+ const e = k[t], m = v.getBoundingClientRect(), $ = e.getBoundingClientRect();
147
+ v.scrollTo({
148
+ top: $.top - m.top + v.scrollTop,
127
149
  behavior: "smooth"
128
150
  });
129
151
  }
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), {
152
+ const A = p();
153
+ return V(() => {
154
+ P(() => {
155
+ A.value = n.value?.wrapRef?.firstElementChild;
156
+ });
157
+ }), r.autoScroll && oe(A, () => {
158
+ const t = g();
159
+ t !== void 0 && t > r.autoScrollThreshold || T();
160
+ }), f({
161
+ scrollToTop: H,
162
+ scrollToBottom: T,
163
+ scrollToBubble: M
164
+ }), (t, v) => {
165
+ const k = O("el-icon");
166
+ return c(), S("div", ce, [
167
+ l.virtual ? (c(), S("div", {
168
+ key: 0,
169
+ class: "vk-bubble-list-virtual-host",
170
+ style: R({ height: l.maxHeight || "100%" })
171
+ }, [
172
+ d(u(L), {
173
+ ref_key: "scrollbarRef",
174
+ ref: n,
175
+ class: "vk-bubble-list-virtual-scrollbar",
176
+ always: l.alwaysShowScrollbar,
177
+ "hide-after": 800,
178
+ onScroll: g
179
+ }, {
180
+ default: o(() => [
181
+ h.value ? (c(), y(u(ee), {
182
+ key: 0,
183
+ ref_key: "scrollerRef",
184
+ ref: a,
185
+ items: l.list,
186
+ "min-item-size": 54,
187
+ "key-field": l.keyField,
188
+ "page-mode": !0,
189
+ "scroll-parent": h.value,
190
+ class: "vk-bubble-list-dynamic-scroller"
191
+ }, {
192
+ default: o(({ item: e, index: m, active: $ }) => [
193
+ d(u(te), {
194
+ item: e,
195
+ active: $,
196
+ "data-index": m,
197
+ class: "vk-bubble-list-virtual-item"
198
+ }, {
199
+ default: o(() => [
200
+ d(u(E), {
201
+ content: e.content,
202
+ placement: e.placement,
203
+ loading: e.loading,
204
+ shape: e.shape,
205
+ variant: e.variant,
206
+ "is-markdown": e.isMarkdown,
207
+ "is-fog": e.isFog,
208
+ typing: e.typing,
209
+ "max-width": e.maxWidth,
210
+ avatar: e.avatar,
211
+ "avatar-size": e.avatarSize,
212
+ "avatar-gap": e.avatarGap,
213
+ "avatar-shape": e.avatarShape,
214
+ "avatar-src-set": e.avatarSrcSet,
215
+ "avatar-alt": e.avatarAlt,
216
+ "avatar-fit": e.avatarFit,
217
+ "no-style": e.noStyle,
218
+ class: C({
219
+ [`is-${e.role}`]: !0
220
+ })
221
+ }, F({ _: 2 }, [
222
+ t.$slots.avatar ? {
223
+ name: "avatar",
224
+ fn: o(() => [
225
+ s(t.$slots, "avatar", { item: e })
226
+ ]),
227
+ key: "0"
228
+ } : void 0,
229
+ t.$slots.header ? {
230
+ name: "header",
231
+ fn: o(() => [
232
+ s(t.$slots, "header", { item: e })
233
+ ]),
234
+ key: "1"
235
+ } : void 0,
236
+ t.$slots.content ? {
237
+ name: "content",
238
+ fn: o(() => [
239
+ s(t.$slots, "content", { item: e })
240
+ ]),
241
+ key: "2"
242
+ } : void 0,
243
+ t.$slots.footer ? {
244
+ name: "footer",
245
+ fn: o(() => [
246
+ s(t.$slots, "footer", { item: e })
247
+ ]),
248
+ key: "3"
249
+ } : void 0,
250
+ t.$slots.loading ? {
251
+ name: "loading",
252
+ fn: o(() => [
253
+ s(t.$slots, "loading", { item: e })
254
+ ]),
255
+ key: "4"
256
+ } : void 0
257
+ ]), 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"])
258
+ ]),
259
+ _: 2
260
+ }, 1032, ["item", "active", "data-index"])
261
+ ]),
262
+ _: 3
263
+ }, 8, ["items", "key-field", "scroll-parent"])) : I("", !0)
264
+ ]),
265
+ _: 3
266
+ }, 8, ["always"])
267
+ ], 4)) : (c(), y(u(L), {
268
+ key: 1,
138
269
  ref_key: "scrollbarRef",
139
- ref: c,
270
+ ref: n,
140
271
  class: "vk-bubble-list",
141
- "append-to": i.scrollbarAppendTo,
142
- always: i.alwaysShowScrollbar,
272
+ "append-to": l.scrollbarAppendTo,
273
+ always: l.alwaysShowScrollbar,
143
274
  "hide-after": 800,
144
- onScroll: h
275
+ onScroll: g
145
276
  }, {
146
- default: l(() => [
147
- (p(!0), B(L, null, H(i.list, (e, y) => (p(), w(d(X), {
148
- key: e.key || y,
277
+ default: o(() => [
278
+ (c(!0), S(q, null, W(l.list, (e, m) => (c(), y(u(E), {
279
+ key: e.key || m,
149
280
  content: e.content,
150
281
  placement: e.placement,
151
282
  loading: e.loading,
@@ -166,38 +297,38 @@ const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-lis
166
297
  class: C({
167
298
  [`is-${e.role}`]: !0
168
299
  })
169
- }, z({ _: 2 }, [
300
+ }, F({ _: 2 }, [
170
301
  t.$slots.avatar ? {
171
302
  name: "avatar",
172
- fn: l(() => [
303
+ fn: o(() => [
173
304
  s(t.$slots, "avatar", { item: e })
174
305
  ]),
175
306
  key: "0"
176
307
  } : void 0,
177
308
  t.$slots.header ? {
178
309
  name: "header",
179
- fn: l(() => [
310
+ fn: o(() => [
180
311
  s(t.$slots, "header", { item: e })
181
312
  ]),
182
313
  key: "1"
183
314
  } : void 0,
184
315
  t.$slots.content ? {
185
316
  name: "content",
186
- fn: l(() => [
317
+ fn: o(() => [
187
318
  s(t.$slots, "content", { item: e })
188
319
  ]),
189
320
  key: "2"
190
321
  } : void 0,
191
322
  t.$slots.footer ? {
192
323
  name: "footer",
193
- fn: l(() => [
324
+ fn: o(() => [
194
325
  s(t.$slots, "footer", { item: e })
195
326
  ]),
196
327
  key: "3"
197
328
  } : void 0,
198
329
  t.$slots.loading ? {
199
330
  name: "loading",
200
- fn: l(() => [
331
+ fn: o(() => [
201
332
  s(t.$slots, "loading", { item: e })
202
333
  ]),
203
334
  key: "4"
@@ -205,113 +336,135 @@ const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-lis
205
336
  ]), 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
337
  ]),
207
338
  _: 3
208
- }, 8, ["append-to", "always"]),
209
- I(M("div", {
339
+ }, 8, ["append-to", "always"])),
340
+ Z(_("div", {
210
341
  class: C(["vk-bubble-list-default-back-button", {
211
342
  "vk-bubble-list-back-to-bottom-solt": t.$slots.backToBottom
212
343
  }]),
213
344
  style: R({
214
- bottom: i.backButtonPosition.bottom,
215
- left: i.backButtonPosition.left
345
+ bottom: l.backButtonPosition.bottom,
346
+ left: l.backButtonPosition.left
216
347
  }),
217
- onClick: g
348
+ onClick: T
218
349
  }, [
219
350
  s(t.$slots, "backToBottom", {}, () => [
220
- u(b, {
351
+ d(k, {
221
352
  class: "vk-bubble-list-back-to-bottom-icon",
222
353
  style: R({ color: r.btnColor })
223
354
  }, {
224
- default: l(() => [
225
- u(d(J)),
226
- r.btnLoading ? (p(), w(ae, {
355
+ default: o(() => [
356
+ d(u(ae)),
357
+ r.btnLoading ? (c(), y(ue, {
227
358
  key: 0,
228
359
  class: "back-to-bottom-loading-svg-bg"
229
- })) : j("", !0)
360
+ })) : I("", !0)
230
361
  ]),
231
362
  _: 1
232
363
  }, 8, ["style"])
233
364
  ])
234
365
  ], 6), [
235
- [D, A.value]
366
+ [U, D.value]
236
367
  ])
237
368
  ]);
238
369
  };
239
370
  }
240
- }), se = {
371
+ }), fe = {
241
372
  items: {
242
373
  type: Array,
243
374
  default: () => []
244
375
  },
245
376
  elRef: {
246
377
  type: Function,
247
- default: ee
378
+ default: re
248
379
  },
249
380
  scrollbarAppendTo: null,
381
+ virtual: {
382
+ type: Boolean,
383
+ default: !1
384
+ },
385
+ /**
386
+ * Key field name for virtual list items.
387
+ * Defaults to 'key'. Set to 'id' or any other field your items use.
388
+ */
389
+ keyField: {
390
+ type: String,
391
+ default: "key"
392
+ },
250
393
  autoScrollThreshold: {
251
394
  type: Number,
252
395
  default: 200
253
396
  }
254
- }, k = /* @__PURE__ */ _({
397
+ }, z = /* @__PURE__ */ G({
255
398
  name: "VkBubbleList",
256
399
  inheritAttrs: !1,
257
400
  __name: "index",
258
- props: se,
259
- setup(i) {
260
- return (o, r) => (p(), w(d(Z), null, {
261
- placeholder: l(() => [
262
- u(d(U))
401
+ props: fe,
402
+ setup(l, { expose: f }) {
403
+ const r = l, n = p();
404
+ return N(() => r.elRef, (a) => {
405
+ a && a(n.value);
406
+ }, { immediate: !0 }), f({
407
+ scrollToTop: () => n.value?.scrollToTop(),
408
+ scrollToBottom: () => n.value?.scrollToBottom(),
409
+ scrollToBubble: (a) => n.value?.scrollToBubble(a)
410
+ }), (a, h) => (c(), y(u(K), null, {
411
+ placeholder: o(() => [
412
+ d(u(X))
263
413
  ]),
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,
414
+ default: o(() => [
415
+ s(a.$slots, "renderer"),
416
+ d(u(Y), null, {
417
+ default: o(({ height: b }) => [
418
+ d(de, J({
419
+ ref_key: "bubbleListRef",
420
+ ref: n,
270
421
  "btn-icon-size": 18,
271
- "max-height": `${c}px`,
272
- "scrollbar-append-to": o.scrollbarAppendTo,
273
- "auto-scroll-threshold": o.autoScrollThreshold,
422
+ "max-height": `${b}px`,
423
+ "scrollbar-append-to": a.scrollbarAppendTo,
424
+ virtual: a.virtual,
425
+ "key-field": a.keyField,
426
+ "auto-scroll-threshold": a.autoScrollThreshold,
274
427
  style: {
275
- "--el-bubble-list-max-height": `${c}px`
428
+ "--el-bubble-list-max-height": `${b}px`
276
429
  },
277
- list: o.items
278
- }, o.$attrs), z({
279
- content: l(({ item: a }) => [
280
- u(d(q), {
281
- source: [a]
430
+ list: a.items
431
+ }, a.$attrs), F({
432
+ content: o(({ item: i }) => [
433
+ d(u(Q), {
434
+ source: [i]
282
435
  }, null, 8, ["source"])
283
436
  ]),
284
437
  _: 2
285
438
  }, [
286
- o.$slots.avatar ? {
439
+ a.$slots.avatar ? {
287
440
  name: "avatar",
288
- fn: l((a) => [
289
- s(o.$slots, "avatar", m(v(a)))
441
+ fn: o((i) => [
442
+ s(a.$slots, "avatar", B(w(i)))
290
443
  ]),
291
444
  key: "0"
292
445
  } : void 0,
293
- o.$slots.header ? {
446
+ a.$slots.header ? {
294
447
  name: "header",
295
- fn: l((a) => [
296
- s(o.$slots, "header", m(v(a)))
448
+ fn: o((i) => [
449
+ s(a.$slots, "header", B(w(i)))
297
450
  ]),
298
451
  key: "1"
299
452
  } : void 0,
300
- o.$slots.loading ? {
453
+ a.$slots.loading ? {
301
454
  name: "loading",
302
- fn: l((a) => [
303
- s(o.$slots, "loading", m(v(a)))
455
+ fn: o((i) => [
456
+ s(a.$slots, "loading", B(w(i)))
304
457
  ]),
305
458
  key: "2"
306
459
  } : void 0,
307
- o.$slots.footer ? {
460
+ a.$slots.footer ? {
308
461
  name: "footer",
309
- fn: l((a) => [
310
- s(o.$slots, "footer", m(v(a)))
462
+ fn: o((i) => [
463
+ s(a.$slots, "footer", B(w(i)))
311
464
  ]),
312
465
  key: "3"
313
466
  } : void 0
314
- ]), 1040, ["max-height", "scrollbar-append-to", "auto-scroll-threshold", "style", "list"])
467
+ ]), 1040, ["max-height", "scrollbar-append-to", "virtual", "key-field", "auto-scroll-threshold", "style", "list"])
315
468
  ]),
316
469
  _: 3
317
470
  })
@@ -319,15 +472,15 @@ const ae = /* @__PURE__ */ Y(te, [["render", le]]), re = { class: "vk-bubble-lis
319
472
  _: 3
320
473
  }));
321
474
  }
322
- }), ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
475
+ }), Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
323
476
  __proto__: null
324
477
  }, Symbol.toStringTag, { value: "Module" }));
325
- k.install = (i) => {
326
- i.component(k.name || "VkBubbleList", k);
478
+ z.install = (l) => {
479
+ l.component(z.name || "VkBubbleList", z);
327
480
  };
328
481
  export {
329
- Be as Role,
330
- k as VkBubbleList,
331
- ge as __VkBubbleList,
332
- k as default
482
+ Re as Role,
483
+ z as VkBubbleList,
484
+ Se as __VkBubbleList,
485
+ z as default
333
486
  };