@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.
- package/components/bubble-list/index.cjs +1 -1
- package/components/bubble-list/index.mjs +226 -145
- package/components/bubble-list/src/core/index.vue.d.ts +30 -1
- package/components/bubble-list/src/ctx.d.ts +8 -0
- package/components/bubble-list/src/index.vue.d.ts +15 -1
- package/components/components.css +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
import { VkBubbleRenderTemplates as
|
|
3
|
-
import { ElAutoResizer as
|
|
4
|
-
import { DynamicScroller as
|
|
5
|
-
import { ArrowDownBold as
|
|
6
|
-
import { useResizeObserver as
|
|
7
|
-
import { VkScrollbar as
|
|
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
|
|
10
|
-
import { noop as
|
|
11
|
-
import { Role as
|
|
12
|
-
const
|
|
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
|
|
21
|
-
return
|
|
22
|
-
|
|
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
|
|
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:
|
|
86
|
-
const
|
|
87
|
-
function
|
|
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
|
-
|
|
98
|
+
n.maxHeight || "100%"
|
|
91
99
|
), document.documentElement.style.setProperty(
|
|
92
100
|
"--el-bubble-list-btn-size",
|
|
93
|
-
`${
|
|
101
|
+
`${n.btnIconSize}px`
|
|
94
102
|
);
|
|
95
103
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const t =
|
|
99
|
-
t && (
|
|
100
|
-
}), setTimeout(
|
|
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
|
-
() => [
|
|
103
|
-
() =>
|
|
110
|
+
() => [n.maxHeight, n.btnIconSize],
|
|
111
|
+
() => g()
|
|
104
112
|
);
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
118
|
+
return u.value = t.scrollHeight - t.scrollTop - t.clientHeight, u.value;
|
|
110
119
|
}
|
|
111
|
-
function
|
|
112
|
-
if (
|
|
120
|
+
function R() {
|
|
121
|
+
if (n.virtual) {
|
|
113
122
|
a.value?.scrollToBottom();
|
|
114
123
|
return;
|
|
115
124
|
}
|
|
116
|
-
|
|
125
|
+
r.value?.scrollToBottom();
|
|
117
126
|
}
|
|
118
|
-
function
|
|
119
|
-
if (
|
|
127
|
+
function M() {
|
|
128
|
+
if (n.virtual) {
|
|
120
129
|
a.value?.scrollToItem(0);
|
|
121
130
|
return;
|
|
122
131
|
}
|
|
123
|
-
|
|
132
|
+
r.value?.scrollToTop();
|
|
124
133
|
}
|
|
125
|
-
function
|
|
126
|
-
if (
|
|
127
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
}),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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:
|
|
227
|
+
style: F({ height: s.maxHeight || "100%" })
|
|
159
228
|
}, [
|
|
160
|
-
|
|
229
|
+
b(f(O), {
|
|
161
230
|
ref_key: "scrollbarRef",
|
|
162
|
-
ref:
|
|
231
|
+
ref: r,
|
|
163
232
|
class: "vk-bubble-list-virtual-scrollbar",
|
|
164
233
|
always: s.alwaysShowScrollbar,
|
|
165
234
|
"hide-after": 800,
|
|
166
|
-
onScroll:
|
|
235
|
+
onScroll: B
|
|
167
236
|
}, {
|
|
168
237
|
default: o(() => [
|
|
169
|
-
|
|
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":
|
|
244
|
+
"key-field": s.keyField,
|
|
176
245
|
"page-mode": !0,
|
|
177
|
-
"scroll-parent":
|
|
246
|
+
"scroll-parent": w.value,
|
|
178
247
|
class: "vk-bubble-list-dynamic-scroller"
|
|
179
248
|
}, {
|
|
180
|
-
default: o(({ item: e, index:
|
|
181
|
-
|
|
249
|
+
default: o(({ item: e, index: d, active: c }) => [
|
|
250
|
+
b(f(se), {
|
|
182
251
|
item: e,
|
|
183
|
-
active:
|
|
184
|
-
"data-index":
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)) : (
|
|
325
|
+
], 4)) : (v(), k(f(O), {
|
|
256
326
|
key: 1,
|
|
257
327
|
ref_key: "scrollbarRef",
|
|
258
|
-
ref:
|
|
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:
|
|
333
|
+
onScroll: B
|
|
264
334
|
}, {
|
|
265
335
|
default: o(() => [
|
|
266
|
-
(
|
|
267
|
-
key: e.key ||
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
329
|
-
class:
|
|
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:
|
|
402
|
+
style: F({
|
|
333
403
|
bottom: s.backButtonPosition.bottom,
|
|
334
404
|
left: s.backButtonPosition.left
|
|
335
405
|
}),
|
|
336
|
-
onClick:
|
|
406
|
+
onClick: R
|
|
337
407
|
}, [
|
|
338
|
-
|
|
339
|
-
|
|
408
|
+
i(t.$slots, "backToBottom", {}, () => [
|
|
409
|
+
b(p, {
|
|
340
410
|
class: "vk-bubble-list-back-to-bottom-icon",
|
|
341
|
-
style:
|
|
411
|
+
style: F({ color: n.btnColor })
|
|
342
412
|
}, {
|
|
343
413
|
default: o(() => [
|
|
344
|
-
|
|
345
|
-
|
|
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
|
-
[
|
|
424
|
+
[Y, q.value]
|
|
355
425
|
])
|
|
356
426
|
]);
|
|
357
427
|
};
|
|
358
428
|
}
|
|
359
|
-
}),
|
|
429
|
+
}), ye = {
|
|
360
430
|
items: {
|
|
361
431
|
type: Array,
|
|
362
432
|
default: () => []
|
|
363
433
|
},
|
|
364
434
|
elRef: {
|
|
365
435
|
type: Function,
|
|
366
|
-
default:
|
|
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
|
-
},
|
|
455
|
+
}, I = /* @__PURE__ */ H({
|
|
378
456
|
name: "VkBubbleList",
|
|
379
457
|
inheritAttrs: !1,
|
|
380
458
|
__name: "index",
|
|
381
|
-
props:
|
|
382
|
-
setup(s, { expose:
|
|
383
|
-
const
|
|
384
|
-
return N(() =>
|
|
385
|
-
a && a(
|
|
386
|
-
}, { immediate: !0 }),
|
|
387
|
-
scrollToTop: () =>
|
|
388
|
-
scrollToBottom: () =>
|
|
389
|
-
scrollToBubble: (a) =>
|
|
390
|
-
|
|
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
|
-
|
|
472
|
+
b(f(oe))
|
|
393
473
|
]),
|
|
394
474
|
default: o(() => [
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
default: o(({ height:
|
|
398
|
-
|
|
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:
|
|
480
|
+
ref: r,
|
|
401
481
|
"btn-icon-size": 18,
|
|
402
|
-
"max-height": `${
|
|
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": `${
|
|
488
|
+
"--el-bubble-list-max-height": `${g}px`
|
|
408
489
|
},
|
|
409
490
|
list: a.items
|
|
410
491
|
}, a.$attrs), V({
|
|
411
|
-
content: o(({ item:
|
|
412
|
-
|
|
413
|
-
source: [
|
|
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((
|
|
421
|
-
|
|
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((
|
|
428
|
-
|
|
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((
|
|
435
|
-
|
|
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((
|
|
442
|
-
|
|
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
|
-
}),
|
|
535
|
+
}), Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
455
536
|
__proto__: null
|
|
456
537
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
457
|
-
|
|
458
|
-
s.component(
|
|
538
|
+
I.install = (s) => {
|
|
539
|
+
s.component(I.name || "VkBubbleList", I);
|
|
459
540
|
};
|
|
460
541
|
export {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
542
|
+
Ve as Role,
|
|
543
|
+
I as VkBubbleList,
|
|
544
|
+
Fe as __VkBubbleList,
|
|
545
|
+
I as default
|
|
465
546
|
};
|