@dv.net/ui-kit 7.5.7 → 7.5.9
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/dist/assets/UiChat.vue_vue_type_script_setup_true_lang.5Ww-IJjp.js +175 -0
- package/dist/assets/UiChatAttachments.vue_vue_type_script_setup_true_lang.BldJhrnR.js +101 -0
- package/dist/assets/UiChatFooter.vue_vue_type_script_setup_true_lang.BgESk-GX.js +111 -0
- package/dist/assets/{UiTextarea.vue_vue_type_script_setup_true_lang.D7yuONgD.js → UiTextarea.vue_vue_type_script_setup_true_lang.BAO4Rh6-.js} +26 -22
- package/dist/components/UiChat/UiChat.js +1 -1
- package/dist/components/UiChat/UiChat.vue.d.ts +11 -1
- package/dist/components/UiChat/UiChatAttachments.js +1 -1
- package/dist/components/UiChat/UiChatAttachments.vue.d.ts +1 -0
- package/dist/components/UiChat/UiChatFooter.js +1 -1
- package/dist/components/UiChat/UiChatFooter.vue.d.ts +4 -0
- package/dist/components/UiTextarea/UiTextarea.js +1 -1
- package/dist/components/UiTextarea/UiTextarea.vue.d.ts +2 -0
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/assets/UiChat.vue_vue_type_script_setup_true_lang.DCBYICkI.js +0 -134
- package/dist/assets/UiChatAttachments.vue_vue_type_script_setup_true_lang.DDZ-aWa5.js +0 -97
- package/dist/assets/UiChatFooter.vue_vue_type_script_setup_true_lang.DDY3HZXd.js +0 -106
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { defineComponent as P, ref as w, computed as o, watch as z, onUnmounted as Q, createElementBlock as u, openBlock as i, createCommentVNode as l, createElementVNode as f, unref as y, toDisplayString as T, createVNode as E, createBlock as B, normalizeClass as X, Transition as Y, withCtx as Z, Fragment as I, renderList as N, nextTick as x } from "vue";
|
|
2
|
+
import { _ as ee } from "./UiChatHeader.vue_vue_type_script_setup_true_lang.CkV0GeAh.js";
|
|
3
|
+
import "./style.C3xG1ALc.js";
|
|
4
|
+
import { _ as te } from "./UiChatFooter.vue_vue_type_script_setup_true_lang.BgESk-GX.js";
|
|
5
|
+
import { _ as ae } from "./UiChatMessage.vue_vue_type_script_setup_true_lang.BkD09EG5.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { _ as se } from "./UiChatManagerAlert.vue_vue_type_script_setup_true_lang.DzU8TXYU.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { d as g, u as ie, t as ne } from "./useDatePicker.BwRlPS-o.js";
|
|
10
|
+
import { config as d } from "../config/index.js";
|
|
11
|
+
import { UiChatTicketStatusValue as F } from "../components/UiChat/types.js";
|
|
12
|
+
import { d as oe } from "./UiChatAttachments.vue_vue_type_script_setup_true_lang.BldJhrnR.js";
|
|
13
|
+
import { useBreakpoints as re } from "../composables/useBreakpoints.js";
|
|
14
|
+
const ue = { class: "ui-chat" }, ce = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "ui-chat__top"
|
|
17
|
+
}, le = { class: "ui-chat__top-title" }, de = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "ui-chat__top-id"
|
|
20
|
+
}, me = { class: "ui-chat__wrapper" }, fe = { class: "ui-chat__group-date" }, ge = ["data-chat-message-id"], Ue = /* @__PURE__ */ P({
|
|
21
|
+
__name: "UiChat",
|
|
22
|
+
props: {
|
|
23
|
+
ticket: {},
|
|
24
|
+
messages: { default: () => [] },
|
|
25
|
+
currentUserUuid: {},
|
|
26
|
+
showManagerAlert: { type: Boolean, default: !1 },
|
|
27
|
+
managerAlertSeconds: {},
|
|
28
|
+
ticketLoading: { type: Boolean, default: !1 },
|
|
29
|
+
isCreateTicket: { type: Boolean, default: !1 },
|
|
30
|
+
sendingLoading: { type: Boolean, default: !1 },
|
|
31
|
+
enableReopenTicket: { type: Boolean, default: !1 }
|
|
32
|
+
},
|
|
33
|
+
emits: ["action-ticket", "submit", "attach", "read"],
|
|
34
|
+
setup(s, { expose: V, emit: $ }) {
|
|
35
|
+
g.extend(ie), g.extend(ne);
|
|
36
|
+
const k = $, { isDesktop: S } = re(), U = w(), v = w(), h = w(!s.isCreateTicket);
|
|
37
|
+
let r = null, c = null, C = /* @__PURE__ */ new WeakMap(), m = null;
|
|
38
|
+
const A = o(() => d.uiChat.timezone || g.tz.guess()), b = (e) => {
|
|
39
|
+
const t = g(e);
|
|
40
|
+
return t.isValid() ? t.tz(A.value) : null;
|
|
41
|
+
}, j = (e) => {
|
|
42
|
+
const t = b(e);
|
|
43
|
+
return t?.isValid() ? t.format(d.uiChat.dateFormat) : e.split(/[T\s]/)[0] || e;
|
|
44
|
+
}, L = (e) => e.user.uuid === s.currentUserUuid, M = o(() => !s.messages.length || !s.ticket || !s.currentUserUuid), _ = o(() => typeof s.ticket?.status?.value < "u"), R = o(() => _.value ? s.ticket?.status?.value === F.MANAGER_CLOSED || s.ticket?.status?.value === F.USER_CLOSED : !1), W = o(() => !(!s.isCreateTicket && !_.value || _.value && R.value)), q = o(() => s.isCreateTicket && M.value && !s.ticketLoading), D = o(() => {
|
|
45
|
+
if (!M.value) return s.messages;
|
|
46
|
+
if (!h.value) return [];
|
|
47
|
+
const e = g().tz(A.value).format(d.uiChat.dateTimeFormat);
|
|
48
|
+
return [oe(d.uiChat.translations.defaultMessage, e)];
|
|
49
|
+
}), O = o(() => {
|
|
50
|
+
const e = {};
|
|
51
|
+
for (const t of D.value) {
|
|
52
|
+
const a = j(t.created_at);
|
|
53
|
+
e[a] || (e[a] = []), e[a].push(t);
|
|
54
|
+
}
|
|
55
|
+
for (const t in e)
|
|
56
|
+
e[t].sort((a, n) => (b(a.created_at)?.valueOf() ?? 0) - (b(n.created_at)?.valueOf() ?? 0));
|
|
57
|
+
return e;
|
|
58
|
+
}), G = o(() => {
|
|
59
|
+
const e = /* @__PURE__ */ new Map();
|
|
60
|
+
for (const t of D.value)
|
|
61
|
+
e.set(t.id, t);
|
|
62
|
+
return e;
|
|
63
|
+
}), H = (e) => {
|
|
64
|
+
for (const t of e) {
|
|
65
|
+
if (!t.isIntersecting) continue;
|
|
66
|
+
const a = C.get(t.target);
|
|
67
|
+
if (!a) continue;
|
|
68
|
+
const n = !!s.currentUserUuid && !L(a);
|
|
69
|
+
if (!(!a.ticket_id || a.id <= 0 || !n || a.updated_at !== a.created_at)) {
|
|
70
|
+
c && clearTimeout(c), c = setTimeout(() => {
|
|
71
|
+
k("read", { ticketId: a.ticket_id });
|
|
72
|
+
}, 3e3);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, J = async () => {
|
|
77
|
+
if (await x(), m?.disconnect(), C = /* @__PURE__ */ new WeakMap(), !v.value || s.ticketLoading) return;
|
|
78
|
+
m = new IntersectionObserver(H, {
|
|
79
|
+
root: v.value,
|
|
80
|
+
rootMargin: "0px",
|
|
81
|
+
threshold: 0.6
|
|
82
|
+
}), v.value.querySelectorAll("[data-chat-message-id]").forEach((t) => {
|
|
83
|
+
const a = Number(t.dataset.chatMessageId), n = G.value.get(a);
|
|
84
|
+
n && (C.set(t, n), m?.observe(t));
|
|
85
|
+
});
|
|
86
|
+
}, K = () => {
|
|
87
|
+
U.value?.clearInputAndFiles();
|
|
88
|
+
};
|
|
89
|
+
return z(
|
|
90
|
+
q,
|
|
91
|
+
(e) => {
|
|
92
|
+
if (r && (clearTimeout(r), r = null), !e) {
|
|
93
|
+
h.value = !0;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
h.value = !1, r = setTimeout(() => {
|
|
97
|
+
h.value = !0;
|
|
98
|
+
}, 1e3);
|
|
99
|
+
},
|
|
100
|
+
{ immediate: !0 }
|
|
101
|
+
), z(
|
|
102
|
+
O,
|
|
103
|
+
() => {
|
|
104
|
+
J();
|
|
105
|
+
},
|
|
106
|
+
{ immediate: !0 }
|
|
107
|
+
), Q(() => {
|
|
108
|
+
r && (clearTimeout(r), r = null), c && (clearTimeout(c), c = null), m?.disconnect(), m = null;
|
|
109
|
+
}), V({ clearInputAndFiles: K }), (e, t) => (i(), u("div", ue, [
|
|
110
|
+
y(S) ? (i(), u("div", ce, [
|
|
111
|
+
f("span", le, T(e.ticket?.subject || y(d).uiChat.translations.newTicket), 1),
|
|
112
|
+
e.ticket?.id ? (i(), u("span", de, T(y(d).uiChat.translations.ticket) + " #" + T(e.ticket.id), 1)) : l("", !0)
|
|
113
|
+
])) : l("", !0),
|
|
114
|
+
f("div", me, [
|
|
115
|
+
E(ee, {
|
|
116
|
+
ticket: e.ticket,
|
|
117
|
+
"is-empty": M.value,
|
|
118
|
+
"is-closed-ticket": R.value,
|
|
119
|
+
"ticket-loading": e.ticketLoading,
|
|
120
|
+
"enable-reopen-ticket": e.enableReopenTicket,
|
|
121
|
+
onActionTicket: t[0] || (t[0] = (a) => k("action-ticket", a))
|
|
122
|
+
}, null, 8, ["ticket", "is-empty", "is-closed-ticket", "ticket-loading", "enable-reopen-ticket"]),
|
|
123
|
+
f("div", {
|
|
124
|
+
ref_key: "chatBodyRef",
|
|
125
|
+
ref: v,
|
|
126
|
+
class: X(["ui-chat__body", { "mobile-layout": y(S) }])
|
|
127
|
+
}, [
|
|
128
|
+
e.ticketLoading ? l("", !0) : (i(), B(Y, {
|
|
129
|
+
key: 0,
|
|
130
|
+
name: "alert",
|
|
131
|
+
mode: "out-in",
|
|
132
|
+
appear: ""
|
|
133
|
+
}, {
|
|
134
|
+
default: Z(() => [
|
|
135
|
+
e.showManagerAlert ? (i(), B(se, {
|
|
136
|
+
key: 0,
|
|
137
|
+
seconds: e.managerAlertSeconds
|
|
138
|
+
}, null, 8, ["seconds"])) : l("", !0)
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
})),
|
|
142
|
+
e.ticketLoading ? l("", !0) : (i(!0), u(I, { key: 1 }, N(O.value, (a, n) => (i(), u("div", {
|
|
143
|
+
key: n,
|
|
144
|
+
class: "ui-chat__group"
|
|
145
|
+
}, [
|
|
146
|
+
f("div", fe, [
|
|
147
|
+
f("span", null, T(n), 1)
|
|
148
|
+
]),
|
|
149
|
+
(i(!0), u(I, null, N(a, (p) => (i(), u("div", {
|
|
150
|
+
key: p.id,
|
|
151
|
+
class: "ui-chat__message-observer",
|
|
152
|
+
"data-chat-message-id": p.id
|
|
153
|
+
}, [
|
|
154
|
+
E(ae, {
|
|
155
|
+
message: p,
|
|
156
|
+
"is-own": L(p)
|
|
157
|
+
}, null, 8, ["message", "is-own"])
|
|
158
|
+
], 8, ge))), 128))
|
|
159
|
+
]))), 128))
|
|
160
|
+
], 2),
|
|
161
|
+
W.value ? (i(), B(te, {
|
|
162
|
+
key: 0,
|
|
163
|
+
ref_key: "footerRef",
|
|
164
|
+
ref: U,
|
|
165
|
+
"sending-loading": e.sendingLoading,
|
|
166
|
+
onSubmit: t[1] || (t[1] = (a) => k("submit", a)),
|
|
167
|
+
onAttach: t[2] || (t[2] = (a) => k("attach", a))
|
|
168
|
+
}, null, 8, ["sending-loading"])) : l("", !0)
|
|
169
|
+
])
|
|
170
|
+
]));
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
export {
|
|
174
|
+
Ue as _
|
|
175
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { defineComponent as R, ref as c, computed as j, createElementBlock as d, openBlock as h, createElementVNode as i, createVNode as _, Fragment as E, renderList as I, toDisplayString as O } from "vue";
|
|
2
|
+
import { _ as f } from "./UiIcon.vue_vue_type_script_setup_true_lang.DFsApq5s.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { _ as V } from "./UiGallery.vue_vue_type_script_setup_true_lang.BT952T6m.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const Q = (n, o) => ({
|
|
7
|
+
id: 0,
|
|
8
|
+
ticket_id: 0,
|
|
9
|
+
message: n,
|
|
10
|
+
created_at: o,
|
|
11
|
+
updated_at: o,
|
|
12
|
+
files: [],
|
|
13
|
+
attachments: [],
|
|
14
|
+
user: { uuid: "", avatar: null, telegram: null, email: "", name: null }
|
|
15
|
+
}), M = 10, A = ["jpg", "jpeg", "png", "heic", "heif"], Y = A.join(", "), S = A.map((n) => `.${n}`).join(","), $ = { class: "ui-chat-attachments" }, H = ["accept", "multiple"], x = { class: "ui-chat-attachments__file" }, B = ["src", "alt"], D = { class: "ui-chat-attachments__overlay" }, P = ["onClick"], W = ["disabled", "onClick"], G = { class: "ui-chat-attachments__description" }, Z = /* @__PURE__ */ R({
|
|
16
|
+
__name: "UiChatAttachments",
|
|
17
|
+
props: {
|
|
18
|
+
maxFiles: { default: () => M },
|
|
19
|
+
accept: { default: () => S },
|
|
20
|
+
sendingLoading: { type: Boolean, default: !1 }
|
|
21
|
+
},
|
|
22
|
+
emits: ["change"],
|
|
23
|
+
setup(n, { expose: o, emit: y }) {
|
|
24
|
+
const u = y, v = c(), a = c([]), l = c(/* @__PURE__ */ new Map()), F = () => {
|
|
25
|
+
a.value.length >= n.maxFiles || n.sendingLoading || v.value?.click();
|
|
26
|
+
}, g = (e) => {
|
|
27
|
+
if (!e.length || n.sendingLoading) return;
|
|
28
|
+
const t = n.maxFiles - a.value.length;
|
|
29
|
+
t <= 0 || (a.value.push(...e.slice(0, t)), u("change", a.value));
|
|
30
|
+
}, L = (e) => {
|
|
31
|
+
const t = e.target;
|
|
32
|
+
t.files?.length && (g(Array.from(t.files)), t.value = "");
|
|
33
|
+
}, C = (e) => {
|
|
34
|
+
g(e.filter((t) => t.type.startsWith("image/")));
|
|
35
|
+
}, b = (e) => {
|
|
36
|
+
if (n.sendingLoading) return;
|
|
37
|
+
const t = l.value.get(a.value[e]);
|
|
38
|
+
t && (window.URL.revokeObjectURL(t), l.value.delete(a.value[e])), a.value.splice(e, 1), u("change", a.value);
|
|
39
|
+
}, k = (e) => (l.value.has(e) || l.value.set(e, window.URL.createObjectURL(e)), l.value.get(e)), r = c(!1), p = c(0), T = j(() => a.value.map((e) => ({ file: e }))), U = (e) => {
|
|
40
|
+
p.value = e, r.value = !0;
|
|
41
|
+
};
|
|
42
|
+
return o({ openFileDialog: F, clearFiles: () => {
|
|
43
|
+
l.value.forEach((e) => window.URL.revokeObjectURL(e)), l.value.clear(), a.value = [], u("change", []);
|
|
44
|
+
}, addFiles: C }), (e, t) => (h(), d("div", $, [
|
|
45
|
+
i("input", {
|
|
46
|
+
ref_key: "fileInput",
|
|
47
|
+
ref: v,
|
|
48
|
+
type: "file",
|
|
49
|
+
accept: e.accept,
|
|
50
|
+
multiple: e.maxFiles > 1,
|
|
51
|
+
hidden: "",
|
|
52
|
+
onChange: L
|
|
53
|
+
}, null, 40, H),
|
|
54
|
+
(h(!0), d(E, null, I(a.value, (s, m) => (h(), d("div", {
|
|
55
|
+
key: m,
|
|
56
|
+
class: "ui-chat-attachments__item"
|
|
57
|
+
}, [
|
|
58
|
+
i("div", x, [
|
|
59
|
+
i("img", {
|
|
60
|
+
src: k(s),
|
|
61
|
+
alt: s.name
|
|
62
|
+
}, null, 8, B),
|
|
63
|
+
i("div", D, [
|
|
64
|
+
i("button", {
|
|
65
|
+
class: "ui-chat-attachments__btn ui-chat-attachments__btn--show",
|
|
66
|
+
onClick: (w) => U(m)
|
|
67
|
+
}, [
|
|
68
|
+
_(f, {
|
|
69
|
+
name: "visibility",
|
|
70
|
+
type: "400"
|
|
71
|
+
})
|
|
72
|
+
], 8, P),
|
|
73
|
+
i("button", {
|
|
74
|
+
class: "ui-chat-attachments__btn ui-chat-attachments__btn--remove",
|
|
75
|
+
disabled: e.sendingLoading,
|
|
76
|
+
onClick: (w) => b(m)
|
|
77
|
+
}, [
|
|
78
|
+
_(f, {
|
|
79
|
+
name: "close",
|
|
80
|
+
type: "400"
|
|
81
|
+
})
|
|
82
|
+
], 8, W)
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
i("span", G, O(s.name), 1)
|
|
86
|
+
]))), 128)),
|
|
87
|
+
_(V, {
|
|
88
|
+
modelValue: r.value,
|
|
89
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => r.value = s),
|
|
90
|
+
images: T.value,
|
|
91
|
+
"initial-index": p.value
|
|
92
|
+
}, null, 8, ["modelValue", "images", "initial-index"])
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
M as A,
|
|
98
|
+
Z as _,
|
|
99
|
+
Y as a,
|
|
100
|
+
Q as d
|
|
101
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineComponent as x, ref as m, computed as T, createElementBlock as V, openBlock as h, createElementVNode as o, createVNode as c, normalizeClass as v, unref as s, createBlock as B, createCommentVNode as D, withCtx as b, renderSlot as y, toDisplayString as u } from "vue";
|
|
2
|
+
import { A as f, a as S, _ as z } from "./UiChatAttachments.vue_vue_type_script_setup_true_lang.BldJhrnR.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { _ as C } from "./UiIconButton.vue_vue_type_script_setup_true_lang.DMTMLuQZ.js";
|
|
5
|
+
import "./style.C3xG1ALc.js";
|
|
6
|
+
import { _ as E } from "./UiTextarea.vue_vue_type_script_setup_true_lang.BAO4Rh6-.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { _ as I } from "./UiTooltip.vue_vue_type_script_setup_true_lang.CHftlCxm.js";
|
|
9
|
+
import { config as p } from "../config/index.js";
|
|
10
|
+
import { useBreakpoints as M } from "../composables/useBreakpoints.js";
|
|
11
|
+
const N = { class: "ui-chat__footer-wrapper" }, P = { class: "ui-chat__footer-tooltip" }, R = { class: "ui-chat__footer-input" }, Q = /* @__PURE__ */ x({
|
|
12
|
+
__name: "UiChatFooter",
|
|
13
|
+
props: {
|
|
14
|
+
sendingLoading: { type: Boolean, default: !1 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["submit", "attach"],
|
|
17
|
+
setup(_, { expose: F, emit: A }) {
|
|
18
|
+
const d = A, { isDesktop: k } = M(), n = m(null), l = m([]), r = m(), L = T(() => l.value.length >= f), g = () => {
|
|
19
|
+
!n.value || _.sendingLoading || d("submit", { message: n.value, files: l.value });
|
|
20
|
+
}, $ = (e) => {
|
|
21
|
+
if (_.sendingLoading) return;
|
|
22
|
+
const t = Array.from(e.clipboardData?.items || []).filter((i) => i.kind === "file" && i.type.startsWith("image/")).map((i) => i.getAsFile()).filter((i) => !!i);
|
|
23
|
+
t.length && (e.preventDefault(), r.value?.addFiles?.(t));
|
|
24
|
+
};
|
|
25
|
+
return F({ clearInputAndFiles: () => {
|
|
26
|
+
if (n.value = null, r.value?.clearFiles) {
|
|
27
|
+
r.value.clearFiles();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
l.value = [], d("attach", []);
|
|
31
|
+
} }), (e, a) => (h(), V("div", N, [
|
|
32
|
+
o("div", {
|
|
33
|
+
class: v(["ui-chat__footer", { "mobile-layout": s(k) }])
|
|
34
|
+
}, [
|
|
35
|
+
L.value ? D("", !0) : (h(), B(I, { key: 0 }, {
|
|
36
|
+
text: b(() => [
|
|
37
|
+
o("p", P, [
|
|
38
|
+
o("span", null, u(s(p).uiChat.translations.maxFiles) + ": " + u(s(f)), 1),
|
|
39
|
+
o("span", null, u(s(p).uiChat.translations.supportsFormats) + ": " + u(s(S)), 1)
|
|
40
|
+
])
|
|
41
|
+
]),
|
|
42
|
+
default: b(() => [
|
|
43
|
+
o("div", {
|
|
44
|
+
class: "ui-chat__footer-control",
|
|
45
|
+
onClick: a[0] || (a[0] = (t) => r.value?.openFileDialog())
|
|
46
|
+
}, [
|
|
47
|
+
y(e.$slots, "footer-left", {}, () => [
|
|
48
|
+
c(C, {
|
|
49
|
+
class: "ui-chat__footer-icon-button",
|
|
50
|
+
"icon-name": "attach-file_add",
|
|
51
|
+
type: "clear",
|
|
52
|
+
"icon-type": "100",
|
|
53
|
+
"icon-color": "#1968e5",
|
|
54
|
+
size: "xl",
|
|
55
|
+
"container-small": "",
|
|
56
|
+
disabled: e.sendingLoading
|
|
57
|
+
}, null, 8, ["disabled"])
|
|
58
|
+
])
|
|
59
|
+
])
|
|
60
|
+
]),
|
|
61
|
+
_: 3
|
|
62
|
+
})),
|
|
63
|
+
o("div", R, [
|
|
64
|
+
c(E, {
|
|
65
|
+
class: "ui-chat__footer-input-el",
|
|
66
|
+
modelValue: n.value,
|
|
67
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => n.value = t),
|
|
68
|
+
size: "auto",
|
|
69
|
+
placeholder: s(p).uiChat.translations.messagePlaceholder,
|
|
70
|
+
submitOnEnter: "",
|
|
71
|
+
disabled: e.sendingLoading,
|
|
72
|
+
onPaste: $,
|
|
73
|
+
onSubmit: g,
|
|
74
|
+
"is-empty-value-null": ""
|
|
75
|
+
}, null, 8, ["modelValue", "placeholder", "disabled"])
|
|
76
|
+
]),
|
|
77
|
+
o("div", {
|
|
78
|
+
class: "ui-chat__footer-control",
|
|
79
|
+
onClick: g
|
|
80
|
+
}, [
|
|
81
|
+
y(e.$slots, "footer-right", {}, () => [
|
|
82
|
+
c(C, {
|
|
83
|
+
class: "ui-chat__footer-icon-button",
|
|
84
|
+
"icon-name": "send",
|
|
85
|
+
type: "clear",
|
|
86
|
+
"icon-type": "400",
|
|
87
|
+
"icon-color": "#1968e5",
|
|
88
|
+
size: "xl",
|
|
89
|
+
"container-small": "",
|
|
90
|
+
loading: e.sendingLoading,
|
|
91
|
+
disabled: !n.value
|
|
92
|
+
}, null, 8, ["loading", "disabled"])
|
|
93
|
+
])
|
|
94
|
+
])
|
|
95
|
+
], 2),
|
|
96
|
+
c(z, {
|
|
97
|
+
ref_key: "attachmentsRef",
|
|
98
|
+
ref: r,
|
|
99
|
+
"max-files": s(f),
|
|
100
|
+
"sending-loading": e.sendingLoading,
|
|
101
|
+
class: v(["ui-chat__footer-attachments", { "ui-chat__footer-attachments--empty": !l.value.length }]),
|
|
102
|
+
onChange: a[2] || (a[2] = (t) => {
|
|
103
|
+
l.value = t, d("attach", t);
|
|
104
|
+
})
|
|
105
|
+
}, null, 8, ["max-files", "sending-loading", "class"])
|
|
106
|
+
]));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
Q as _
|
|
111
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { defineComponent as $, mergeModels as c, useModel as L, ref as m, onMounted as M, nextTick as N, createElementBlock as n, openBlock as u, normalizeClass as h, renderSlot as r, withDirectives as T, createCommentVNode as d, createElementVNode as C, vModelText as D, createVNode as I, toDisplayString as y } from "vue";
|
|
2
|
+
import { _ as K } from "./UiCopyText.vue_vue_type_script_setup_true_lang.DZTcTa4v.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
const
|
|
4
|
+
const F = ["maxlength", "id", "placeholder", "disabled", "readonly", "rows"], O = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "ui-textarea__maxlength"
|
|
7
|
-
},
|
|
7
|
+
}, R = {
|
|
8
8
|
key: 2,
|
|
9
9
|
class: "ui-textarea__placeholder-block"
|
|
10
|
-
},
|
|
10
|
+
}, H = /* @__PURE__ */ $({
|
|
11
11
|
__name: "UiTextarea",
|
|
12
|
-
props: /* @__PURE__ */
|
|
12
|
+
props: /* @__PURE__ */ c({
|
|
13
13
|
maxLength: {},
|
|
14
14
|
isDisabled: { type: Boolean },
|
|
15
15
|
placeholder: { default: "" },
|
|
@@ -28,9 +28,9 @@ const K = ["maxlength", "id", "placeholder", "disabled", "readonly", "rows"], F
|
|
|
28
28
|
modelValue: { default: null },
|
|
29
29
|
modelModifiers: {}
|
|
30
30
|
}),
|
|
31
|
-
emits: /* @__PURE__ */
|
|
32
|
-
setup(
|
|
33
|
-
const i =
|
|
31
|
+
emits: /* @__PURE__ */ c(["input", "blur", "focus", "change", "submit", "paste"], ["update:modelValue"]),
|
|
32
|
+
setup(p, { expose: v, emit: g }) {
|
|
33
|
+
const i = p, o = g, l = L(p, "modelValue"), s = m(!1), a = m();
|
|
34
34
|
function t() {
|
|
35
35
|
a.value && i.size == "auto" && (a.value.style.height = "1em", a.value.style.height = a.value.scrollHeight + "px");
|
|
36
36
|
}
|
|
@@ -53,14 +53,17 @@ const K = ["maxlength", "id", "placeholder", "disabled", "readonly", "rows"], F
|
|
|
53
53
|
function x() {
|
|
54
54
|
t();
|
|
55
55
|
}
|
|
56
|
-
function E() {
|
|
56
|
+
function E(e) {
|
|
57
|
+
o("paste", e);
|
|
58
|
+
}
|
|
59
|
+
function w() {
|
|
57
60
|
o("change");
|
|
58
61
|
}
|
|
59
62
|
return v({
|
|
60
63
|
focus: () => a.value?.focus()
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
}), (e,
|
|
64
|
+
}), M(() => {
|
|
65
|
+
N(t);
|
|
66
|
+
}), (e, f) => (u(), n("label", {
|
|
64
67
|
class: h(["ui-textarea", [
|
|
65
68
|
e.size,
|
|
66
69
|
{ "is-focus": s.value },
|
|
@@ -70,12 +73,12 @@ const K = ["maxlength", "id", "placeholder", "disabled", "readonly", "rows"], F
|
|
|
70
73
|
]])
|
|
71
74
|
}, [
|
|
72
75
|
r(e.$slots, "prepend"),
|
|
73
|
-
|
|
76
|
+
T(C("textarea", {
|
|
74
77
|
maxlength: e.maxLength,
|
|
75
78
|
id: e.id,
|
|
76
79
|
ref_key: "textareaRef",
|
|
77
80
|
ref: a,
|
|
78
|
-
"onUpdate:modelValue":
|
|
81
|
+
"onUpdate:modelValue": f[0] || (f[0] = (z) => l.value = z),
|
|
79
82
|
class: "ui-textarea__textarea",
|
|
80
83
|
placeholder: e.$slots.placeholder ? "" : e.placeholder,
|
|
81
84
|
disabled: e.disabled,
|
|
@@ -83,31 +86,32 @@ const K = ["maxlength", "id", "placeholder", "disabled", "readonly", "rows"], F
|
|
|
83
86
|
onBlur: b,
|
|
84
87
|
onFocus: k,
|
|
85
88
|
onInput: B,
|
|
86
|
-
onChange:
|
|
89
|
+
onChange: w,
|
|
90
|
+
onPaste: E,
|
|
87
91
|
onKeyup: x,
|
|
88
92
|
onKeydown: V,
|
|
89
93
|
rows: e.rows
|
|
90
|
-
}, null, 40,
|
|
91
|
-
[
|
|
94
|
+
}, null, 40, F), [
|
|
95
|
+
[D, l.value]
|
|
92
96
|
]),
|
|
93
97
|
r(e.$slots, "append"),
|
|
94
98
|
e.copy && l.value ? (u(), n("div", {
|
|
95
99
|
key: 0,
|
|
96
100
|
class: h(["ui-textarea__copy", { "is-disabled": e.disabled }])
|
|
97
101
|
}, [
|
|
98
|
-
|
|
102
|
+
I(K, {
|
|
99
103
|
colorIcon: "var(--color-icon-tertiary)",
|
|
100
104
|
sizeIcon: "sm",
|
|
101
105
|
copiedText: l.value
|
|
102
106
|
}, null, 8, ["copiedText"])
|
|
103
107
|
], 2)) : d("", !0),
|
|
104
|
-
e.maxLength ? (u(), n("div",
|
|
105
|
-
e.$slots.placeholder && !l.value && !s.value ? (u(), n("div",
|
|
108
|
+
e.maxLength ? (u(), n("div", O, y(l.value?.length) + " / " + y(e.maxLength), 1)) : d("", !0),
|
|
109
|
+
e.$slots.placeholder && !l.value && !s.value ? (u(), n("div", R, [
|
|
106
110
|
r(e.$slots, "placeholder")
|
|
107
111
|
])) : d("", !0)
|
|
108
112
|
], 2));
|
|
109
113
|
}
|
|
110
114
|
});
|
|
111
115
|
export {
|
|
112
|
-
_
|
|
116
|
+
H as _
|
|
113
117
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
1
2
|
import { UiChatProps, ChatAction, UiChatSubmitPayload } from './types';
|
|
2
3
|
declare const _default: import('vue').DefineComponent<UiChatProps, {
|
|
3
4
|
clearInputAndFiles: () => void;
|
|
@@ -5,11 +6,18 @@ declare const _default: import('vue').DefineComponent<UiChatProps, {
|
|
|
5
6
|
submit: (payload: UiChatSubmitPayload) => any;
|
|
6
7
|
"action-ticket": (value: ChatAction) => any;
|
|
7
8
|
attach: (files: File[]) => any;
|
|
9
|
+
read: (payload: {
|
|
10
|
+
ticketId: number;
|
|
11
|
+
}) => any;
|
|
8
12
|
}, string, import('vue').PublicProps, Readonly<UiChatProps> & Readonly<{
|
|
9
13
|
onSubmit?: ((payload: UiChatSubmitPayload) => any) | undefined;
|
|
10
14
|
"onAction-ticket"?: ((value: ChatAction) => any) | undefined;
|
|
11
15
|
onAttach?: ((files: File[]) => any) | undefined;
|
|
16
|
+
onRead?: ((payload: {
|
|
17
|
+
ticketId: number;
|
|
18
|
+
}) => any) | undefined;
|
|
12
19
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
20
|
+
chatBodyRef: HTMLDivElement;
|
|
13
21
|
footerRef: ({
|
|
14
22
|
$: import('vue').ComponentInternalInstance;
|
|
15
23
|
$data: {};
|
|
@@ -33,6 +41,7 @@ declare const _default: import('vue').DefineComponent<UiChatProps, {
|
|
|
33
41
|
}>, {
|
|
34
42
|
openFileDialog: () => void;
|
|
35
43
|
clearFiles: () => void;
|
|
44
|
+
addFiles: (newFiles: File[]) => void;
|
|
36
45
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
37
46
|
change: (files: File[]) => any;
|
|
38
47
|
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
@@ -53,6 +62,7 @@ declare const _default: import('vue').DefineComponent<UiChatProps, {
|
|
|
53
62
|
}>, {
|
|
54
63
|
openFileDialog: () => void;
|
|
55
64
|
clearFiles: () => void;
|
|
65
|
+
addFiles: (newFiles: File[]) => void;
|
|
56
66
|
}, {}, {}, {}, {}> | null;
|
|
57
67
|
};
|
|
58
68
|
$slots: Readonly<{
|
|
@@ -91,7 +101,7 @@ declare const _default: import('vue').DefineComponent<UiChatProps, {
|
|
|
91
101
|
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
92
102
|
};
|
|
93
103
|
$forceUpdate: () => void;
|
|
94
|
-
$nextTick: typeof
|
|
104
|
+
$nextTick: typeof nextTick;
|
|
95
105
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
96
106
|
} & Readonly<{}> & Omit<Readonly<{
|
|
97
107
|
sendingLoading?: boolean;
|
|
@@ -6,6 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
7
7
|
openFileDialog: () => void;
|
|
8
8
|
clearFiles: () => void;
|
|
9
|
+
addFiles: (newFiles: File[]) => void;
|
|
9
10
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
11
|
change: (files: File[]) => any;
|
|
11
12
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -18,6 +18,7 @@ declare function __VLS_template(): {
|
|
|
18
18
|
}>, {
|
|
19
19
|
openFileDialog: () => void;
|
|
20
20
|
clearFiles: () => void;
|
|
21
|
+
addFiles: (newFiles: File[]) => void;
|
|
21
22
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
23
|
change: (files: File[]) => any;
|
|
23
24
|
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
@@ -38,6 +39,7 @@ declare function __VLS_template(): {
|
|
|
38
39
|
}>, {
|
|
39
40
|
openFileDialog: () => void;
|
|
40
41
|
clearFiles: () => void;
|
|
42
|
+
addFiles: (newFiles: File[]) => void;
|
|
41
43
|
}, {}, {}, {}, {}> | null;
|
|
42
44
|
};
|
|
43
45
|
rootEl: HTMLDivElement;
|
|
@@ -61,6 +63,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
61
63
|
}>, {
|
|
62
64
|
openFileDialog: () => void;
|
|
63
65
|
clearFiles: () => void;
|
|
66
|
+
addFiles: (newFiles: File[]) => void;
|
|
64
67
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
65
68
|
change: (files: File[]) => any;
|
|
66
69
|
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
@@ -81,6 +84,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
81
84
|
}>, {
|
|
82
85
|
openFileDialog: () => void;
|
|
83
86
|
clearFiles: () => void;
|
|
87
|
+
addFiles: (newFiles: File[]) => void;
|
|
84
88
|
}, {}, {}, {}, {}> | null;
|
|
85
89
|
}, HTMLDivElement>;
|
|
86
90
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -24,6 +24,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
24
24
|
submit: (...args: any[]) => void;
|
|
25
25
|
blur: (...args: any[]) => void;
|
|
26
26
|
focus: (...args: any[]) => void;
|
|
27
|
+
paste: (...args: any[]) => void;
|
|
27
28
|
"update:modelValue": (value: string | null) => void;
|
|
28
29
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
30
|
onInput?: ((...args: any[]) => any) | undefined;
|
|
@@ -32,6 +33,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
32
33
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
33
34
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
34
35
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
onPaste?: ((...args: any[]) => any) | undefined;
|
|
35
37
|
}>, {
|
|
36
38
|
size: import('./type.ts').UiTextareaSize;
|
|
37
39
|
placeholder: string;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { _ as C } from "./assets/UiAvatar.vue_vue_type_script_setup_true_lang.DA
|
|
|
3
3
|
import "./assets/style.C3xG1ALc.js";
|
|
4
4
|
import { _ as b } from "./assets/UiBlockTitle.vue_vue_type_script_setup_true_lang.CfFJC_O7.js";
|
|
5
5
|
import { _ as M } from "./assets/UiButton.vue_vue_type_script_setup_true_lang.C102Xym_.js";
|
|
6
|
-
import { _ as D } from "./assets/UiChat.vue_vue_type_script_setup_true_lang.
|
|
6
|
+
import { _ as D } from "./assets/UiChat.vue_vue_type_script_setup_true_lang.5Ww-IJjp.js";
|
|
7
7
|
import { _ as w } from "./assets/UiCheckbox.vue_vue_type_script_setup_true_lang.Cc-pU9ur.js";
|
|
8
8
|
import { _ as F } from "./assets/UiCheckboxGroup.vue_vue_type_script_setup_true_lang.RuHoIxXC.js";
|
|
9
9
|
/* empty css */
|
|
@@ -58,7 +58,7 @@ import { _ as Qo } from "./assets/UiTabs.vue_vue_type_script_setup_true_lang.Cl2
|
|
|
58
58
|
import { _ as Wo } from "./assets/UiTabsItem.vue_vue_type_script_setup_true_lang.XvsBaqkr.js";
|
|
59
59
|
/* empty css */
|
|
60
60
|
import { default as Yo } from "./components/UiTag/UiTag.js";
|
|
61
|
-
import { _ as $o } from "./assets/UiTextarea.vue_vue_type_script_setup_true_lang.
|
|
61
|
+
import { _ as $o } from "./assets/UiTextarea.vue_vue_type_script_setup_true_lang.BAO4Rh6-.js";
|
|
62
62
|
/* empty css */
|
|
63
63
|
import { _ as rr } from "./assets/UiTooltip.vue_vue_type_script_setup_true_lang.CHftlCxm.js";
|
|
64
64
|
import { default as ar } from "./composables/useNotification/useNotification.js";
|