@dv.net/ui-kit 7.7.20 → 7.7.22

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 (29) hide show
  1. package/dist/assets/{SelectListItem.CjXmHYbp.js → SelectListItem.C3KlnrwK.js} +14 -12
  2. package/dist/assets/{SelectVirtualList.C8ZTNnx8.js → SelectVirtualList.BKZFHrk3.js} +10 -6
  3. package/dist/assets/{UiChat.DgUnWoCI.js → UiChat.BTOPlRp-.js} +2 -2
  4. package/dist/assets/{UiChatHeader.CXBBEiuH.js → UiChatHeader.tNXu72JW.js} +1 -1
  5. package/dist/assets/UiChatMessage.BgjgEgkc.js +59 -0
  6. package/dist/assets/{UiNotification.BQl5o1e4.js → UiNotification.Bpq5dNbz.js} +18 -29
  7. package/dist/assets/{UiPagination.2XvUpFoX.js → UiPagination.DpV3wFEW.js} +1 -1
  8. package/dist/assets/UiSelect.DBnwUWeq.js +349 -0
  9. package/dist/assets/{UiTable.B0Yoq7JZ.js → UiTable.BVVe4xAf.js} +1 -1
  10. package/dist/components/UiChat/UiChat.js +1 -1
  11. package/dist/components/UiChat/UiChatHeader.js +1 -1
  12. package/dist/components/UiChat/UiChatMessage.js +1 -1
  13. package/dist/components/UiPagination/UiPagination.js +1 -1
  14. package/dist/components/UiSelect/UiSelect.js +1 -1
  15. package/dist/components/UiSelect/components/SelectListItem.js +1 -1
  16. package/dist/components/UiSelect/components/SelectVirtualList.js +1 -1
  17. package/dist/components/UiSelect/components/SelectVirtualList.vue.d.ts +3 -1
  18. package/dist/components/UiSelect/composables/useKeyboard.d.ts +8 -5
  19. package/dist/components/UiSelect/composables/useKeyboard.js +43 -12
  20. package/dist/components/UiTable/UiTable.js +1 -1
  21. package/dist/composables/useNotification/UiNotification.js +1 -1
  22. package/dist/composables/useNotification/UiNotification.vue.d.ts +0 -2
  23. package/dist/composables/useNotification/useNotification.d.ts +1 -1
  24. package/dist/composables/useNotification/useNotification.js +11 -12
  25. package/dist/index.js +4 -4
  26. package/dist/style.css +1 -1
  27. package/package.json +1 -1
  28. package/dist/assets/UiChatMessage.7AQRFKRA.js +0 -40
  29. package/dist/assets/UiSelect.CBOQXkNp.js +0 -326
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dv.net/ui-kit",
3
3
  "private": false,
4
- "version": "7.7.20",
4
+ "version": "7.7.22",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "dist/index.js",
@@ -1,40 +0,0 @@
1
- import { t as e } from "./UiChatMessageAttachments.Z2dmirIN.js";
2
- import { formatUiChatTime as t } from "../components/UiChat/uiChatDate.js";
3
- import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, toDisplayString as u, unref as d } from "vue";
4
- //#region src/utils/constants/general.ts
5
- var f = /(https?:\/\/[^\s<]+)/g, p = { class: "ui-chat__message-bubble" }, m = { class: "ui-chat__message-info" }, h = ["innerHTML"], g = { class: "ui-chat__message-time" }, _ = /* @__PURE__ */ s({
6
- __name: "UiChatMessage",
7
- props: {
8
- message: {},
9
- isOwn: {
10
- type: Boolean,
11
- default: !1
12
- }
13
- },
14
- setup(s) {
15
- let _ = (e) => e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&#39;"), v = n(() => {
16
- let e = s.message.message?.trim();
17
- return e ? _(e).replace(f, "<a href=\"$1\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>") : "";
18
- });
19
- return (n, f) => (l(), a("div", { class: c(["ui-chat__message", { "ui-chat__message--own": s.isOwn }]) }, [o("div", p, [s.message.attachments?.length ? (l(), r(e, {
20
- key: 0,
21
- attachments: s.message.attachments
22
- }, null, 8, ["attachments"])) : i("", !0), o("div", m, [v.value ? (l(), a("p", {
23
- key: 0,
24
- class: "ui-chat__message-text",
25
- innerHTML: v.value
26
- }, null, 8, h)) : i("", !0), o("span", g, u(d(t)(s.message.created_at)), 1)])]), f[0] ||= o("svg", {
27
- class: "ui-chat__message-tail",
28
- xmlns: "http://www.w3.org/2000/svg",
29
- width: "7",
30
- height: "12",
31
- viewBox: "0 0 7 12",
32
- fill: "none"
33
- }, [o("path", {
34
- d: "M0.403418 3.2C-0.585437 1.88153 0.355327 0 2.00342 0H7.00342V12L0.403418 3.2Z",
35
- fill: "currentColor"
36
- })], -1)], 2));
37
- }
38
- });
39
- //#endregion
40
- export { _ as t };
@@ -1,326 +0,0 @@
1
- import { t as e } from "./UiIcon.iHypdpWu.js";
2
- import { t } from "./UiLoading.C1fW2N3T.js";
3
- import { config as n } from "../config/index.js";
4
- import { t as ee } from "./SelectList.DfsXkDPU.js";
5
- import { t as r } from "./SelectListItem.CjXmHYbp.js";
6
- import { t as te } from "./SelectSearch.D39QhMF3.js";
7
- import { t as ne } from "./SelectTrigger.CoKjmQFU.js";
8
- import { t as re } from "./SelectVirtualList.C8ZTNnx8.js";
9
- import { t as ie } from "./UiDropdown.Dg0XSpN8.js";
10
- import { useKeyboard as i } from "../components/UiSelect/composables/useKeyboard.js";
11
- import { useMultiple as a } from "../components/UiSelect/composables/useMultiple.js";
12
- import { Fragment as ae, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeModels as m, normalizeClass as h, openBlock as g, ref as _, renderList as oe, renderSlot as v, toDisplayString as y, unref as b, useModel as x, withCtx as S, withKeys as C, withModifiers as w } from "vue";
13
- //#region src/lib/components/UiSelect/UiSelect.vue?vue&type=script&setup=true&lang.ts
14
- var se = ["disabled", "id"], ce = ["title"], le = { class: "ui-select__content" }, ue = {
15
- key: 0,
16
- class: "ui-select__header"
17
- }, de = {
18
- key: 3,
19
- class: "ui-select__no-data-block"
20
- }, T = {
21
- key: 6,
22
- class: "ui-select__footer"
23
- }, E = /* @__PURE__ */ p({
24
- __name: "UiSelect",
25
- props: /*@__PURE__*/ m({
26
- options: { default: () => [] },
27
- valueKey: { default: "value" },
28
- labelKey: { default: "label" },
29
- asObject: { type: Boolean },
30
- type: { default: "outside" },
31
- size: { default: "md" },
32
- error: { type: Boolean },
33
- filled: { type: Boolean },
34
- disabled: { type: Boolean },
35
- placeholder: {},
36
- withSearch: { type: Boolean },
37
- clearable: { type: Boolean },
38
- loading: {
39
- type: Boolean,
40
- default: !1
41
- },
42
- id: {},
43
- multiple: { type: Boolean },
44
- itemSize: { default: "sm" },
45
- popperClass: {},
46
- fitContentWidth: {
47
- type: Boolean,
48
- default: !0
49
- },
50
- offset: {
51
- type: [
52
- Number,
53
- Object,
54
- Function
55
- ],
56
- default: 1
57
- },
58
- placement: { default: "bottom" },
59
- readonly: { type: Boolean },
60
- teleport: {
61
- type: [String, Boolean],
62
- default: "body"
63
- },
64
- isVirtualList: {
65
- type: Boolean,
66
- default: !1
67
- },
68
- customSearch: {
69
- type: Boolean,
70
- default: !1
71
- },
72
- chevronName: { default: "keyboard-arrow-down" },
73
- chevronColor: { default: "intherit" },
74
- chevronSize: { default: "md" },
75
- optionClass: {},
76
- searchFn: {}
77
- }, {
78
- modelValue: { default: null },
79
- modelModifiers: {},
80
- isOpen: {
81
- type: Boolean,
82
- default: !1
83
- },
84
- isOpenModifiers: {}
85
- }),
86
- emits: /*@__PURE__*/ m([
87
- "change",
88
- "clear",
89
- "changeInfinityScroll",
90
- "search",
91
- "onClose"
92
- ], ["update:modelValue", "update:isOpen"]),
93
- setup(p, { emit: m }) {
94
- let E = m, D = p, O = x(p, "modelValue"), k = x(p, "isOpen"), A = _(!1), j = _(""), M = _(), N = _(), P = o(() => D.disabled || D.readonly), F = o(() => D.options.length && typeof D.options[0] != "object"), fe = o(() => n.uiSelect.translations.notFound && !R.value.length), I = o(() => Array.isArray(O.value) ? !!O.value.length : !!O.value), L = o(() => {
95
- if (D.multiple && Array.isArray(O.value) && O.value.length) return `${n.uiSelect.translations.multipleSelectedText} ${O.value.length}`;
96
- let e = q(O.value);
97
- return F.value ? e : e?.[D.labelKey];
98
- }), R = o(() => D.customSearch || !j.value ? D.options : D.searchFn ? D.searchFn(j.value) : D.options.filter((e) => {
99
- let t = F.value ? e : e?.[D.labelKey];
100
- return String(t).toLowerCase().includes(j.value.toLowerCase());
101
- })), { onKeydownDown: z, onKeydownEnter: B, onKeydownUp: V, navigatedIndex: H } = i({
102
- isFocus: A,
103
- checkOption: U,
104
- filteredOptions: R
105
- }), { setModelValueItem: pe } = a(O);
106
- function U(e) {
107
- e.disabled || (D.multiple && Array.isArray(O.value) ? pe(K(e)) : (O.value = K(e), Z()), E("change"));
108
- }
109
- function W(e) {
110
- return D.multiple && Array.isArray(O.value) ? O.value.includes(K(e)) : O.value === K(e);
111
- }
112
- function G(e) {
113
- return e.disabled;
114
- }
115
- function K(e) {
116
- return F.value || D.asObject ? e : e?.[D.valueKey];
117
- }
118
- function q(e) {
119
- return e ? D.options.find((t) => F.value ? t === e : D.asObject ? t?.[D.valueKey] === e?.[D.valueKey] : t?.[D.valueKey] === e) : null;
120
- }
121
- function J(e) {
122
- H.value = e;
123
- }
124
- function Y() {
125
- H.value = null;
126
- }
127
- function X() {
128
- O.value = D.multiple ? [] : null, E("clear");
129
- }
130
- function me() {
131
- P.value || ($(), M.value.open());
132
- }
133
- function Z() {
134
- Q(), M.value.close();
135
- }
136
- function Q() {
137
- j.value = "", E("search", j.value), E("onClose"), H.value = null, A.value = !1, N.value.blur();
138
- }
139
- function $() {
140
- let e = R.value.findIndex((e) => W(e));
141
- e !== -1 && (H.value = e), N.value.focus(), A.value = !0;
142
- }
143
- return (i, a) => (g(), l("div", {
144
- class: h(["ui-select__wrapper", [{ "is-disabled": D.disabled }]]),
145
- onKeydown: [
146
- a[5] ||= C((...e) => b(B) && b(B)(...e), ["enter"]),
147
- a[6] ||= C((...e) => b(z) && b(z)(...e), ["down"]),
148
- a[7] ||= C((...e) => b(V) && b(V)(...e), ["up"]),
149
- C(Z, ["tab"])
150
- ]
151
- }, [u("input", {
152
- inputmode: "none",
153
- ref_key: "inputRef",
154
- ref: N,
155
- disabled: p.disabled,
156
- id: p.id,
157
- class: "ui-select__input",
158
- onFocus: me
159
- }, null, 40, se), f(ie, {
160
- modelValue: k.value,
161
- "onUpdate:modelValue": a[4] ||= (e) => k.value = e,
162
- offset: p.offset,
163
- ref_key: "dropdownRef",
164
- ref: M,
165
- onClose: Q,
166
- onOpen: $,
167
- "popper-class": [p.popperClass ?? "", "ui-select__popper"],
168
- "fit-content-width": p.fitContentWidth,
169
- disabled: P.value,
170
- placement: p.placement,
171
- teleport: p.teleport
172
- }, {
173
- reference: S(() => [u("div", { class: h(["ui-select", [
174
- p.size,
175
- { "is-focus": A.value },
176
- { "is-error": D.error },
177
- { "is-filled": D.filled },
178
- { "is-has-value": I.value },
179
- `type-${p.type}`
180
- ]]) }, [f(ne, {
181
- clearable: !!p.clearable,
182
- isFocus: A.value,
183
- "is-has-value": I.value,
184
- "is-active": I.value,
185
- type: p.type,
186
- placeholder: p.placeholder,
187
- "chevron-color": p.chevronColor,
188
- "chevron-name": p.chevronName,
189
- "chevron-size": p.chevronSize,
190
- onClear: X
191
- }, {
192
- default: S(() => [v(i.$slots, "selected", { option: p.multiple ? O.value : q(O.value) }, () => [L.value ? (g(), l("span", {
193
- key: 0,
194
- title: L.value
195
- }, y(L.value), 9, ce)) : c("", !0)])]),
196
- _: 3
197
- }, 8, [
198
- "clearable",
199
- "isFocus",
200
- "is-has-value",
201
- "is-active",
202
- "type",
203
- "placeholder",
204
- "chevron-color",
205
- "chevron-name",
206
- "chevron-size"
207
- ])], 2)]),
208
- default: S(() => [u("div", le, [
209
- i.$slots.header ? (g(), l("div", ue, [v(i.$slots, "header")])) : c("", !0),
210
- p.loading && !p.options.length && !j.value ? (g(), s(t, {
211
- key: 1,
212
- "icon-size": "xl",
213
- class: "ui-select__loading-inner",
214
- "is-show": ""
215
- })) : c("", !0),
216
- D.withSearch ? (g(), s(te, {
217
- key: 2,
218
- "onUpdate:modelValue": [a[0] ||= (e) => i.$emit("search", e ?? ""), a[1] ||= (e) => j.value = e],
219
- modelValue: j.value
220
- }, null, 8, ["modelValue"])) : c("", !0),
221
- fe.value ? (g(), l("div", de, [u("p", null, y(b(n).uiSelect.translations.notFound), 1)])) : c("", !0),
222
- p.isVirtualList ? (g(), s(re, {
223
- key: 4,
224
- onChangeInfinityScroll: a[2] ||= (e) => i.$emit("changeInfinityScroll"),
225
- size: p.itemSize,
226
- options: R.value,
227
- "is-loading": p.loading
228
- }, {
229
- default: S(({ item: t }) => [(g(), s(r, {
230
- class: h(p.optionClass && p.optionClass(t.option, t.index)),
231
- key: t.index,
232
- size: p.itemSize,
233
- "is-navigated": b(H) === t.index,
234
- "is-checked": W(t.option),
235
- "is-disabled": G(t.option),
236
- onClick: w((e) => U(t.option), ["prevent"]),
237
- onMouseenter: (e) => J(t.index),
238
- onMouseleave: Y,
239
- title: F.value ? t.option : t.option[p.labelKey]
240
- }, {
241
- default: S(() => [u("span", null, [v(i.$slots, "default", {
242
- option: t.option,
243
- checked: W(t.option)
244
- }, () => [d(y(F.value ? t.option : t.option[p.labelKey]), 1)])]), W(t.option) ? (g(), s(e, {
245
- key: 0,
246
- color: "var(--color-icon-accent)",
247
- type: "400",
248
- name: "done"
249
- })) : c("", !0)]),
250
- _: 2
251
- }, 1032, [
252
- "class",
253
- "size",
254
- "is-navigated",
255
- "is-checked",
256
- "is-disabled",
257
- "onClick",
258
- "onMouseenter",
259
- "title"
260
- ]))]),
261
- _: 3
262
- }, 8, [
263
- "size",
264
- "options",
265
- "is-loading"
266
- ])) : (g(), s(ee, {
267
- key: 5,
268
- onChangeInfinityScroll: a[3] ||= (e) => i.$emit("changeInfinityScroll"),
269
- search: j.value,
270
- size: p.itemSize,
271
- options: R.value
272
- }, {
273
- default: S(({ options: t }) => [(g(!0), l(ae, null, oe(t, ({ index: t, data: n }) => (g(), s(r, {
274
- class: h(p.optionClass && p.optionClass(n, t)),
275
- key: t,
276
- size: p.itemSize,
277
- "is-navigated": b(H) === t,
278
- "is-checked": W(n),
279
- "is-disabled": G(n),
280
- onClick: w((e) => U(n), ["prevent"]),
281
- onMouseenter: (e) => J(t),
282
- onMouseleave: Y,
283
- title: F.value ? n : n[p.labelKey]
284
- }, {
285
- default: S(() => [u("span", null, [v(i.$slots, "default", {
286
- option: n,
287
- checked: W(n)
288
- }, () => [d(y(F.value ? n : n[p.labelKey]), 1)])]), W(n) ? (g(), s(e, {
289
- key: 0,
290
- color: "var(--color-icon-accent)",
291
- type: "400",
292
- name: "done"
293
- })) : c("", !0)]),
294
- _: 2
295
- }, 1032, [
296
- "class",
297
- "size",
298
- "is-navigated",
299
- "is-checked",
300
- "is-disabled",
301
- "onClick",
302
- "onMouseenter",
303
- "title"
304
- ]))), 128))]),
305
- _: 3
306
- }, 8, [
307
- "search",
308
- "size",
309
- "options"
310
- ])),
311
- i.$slots.footer ? (g(), l("div", T, [v(i.$slots, "footer")])) : c("", !0)
312
- ])]),
313
- _: 3
314
- }, 8, [
315
- "modelValue",
316
- "offset",
317
- "popper-class",
318
- "fit-content-width",
319
- "disabled",
320
- "placement",
321
- "teleport"
322
- ])], 34));
323
- }
324
- });
325
- //#endregion
326
- export { E as t };