@vunk/plus 1.16.0 → 1.16.2

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