@dv.net/ui-kit 7.7.21 → 7.7.23

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 (30) 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.C8yIOFl6.js → UiChat.Bzq1rIIj.js} +1 -1
  4. package/dist/assets/{UiChatHeader.CXBBEiuH.js → UiChatHeader.DPDnVuml.js} +1 -1
  5. package/dist/assets/UiDropdown.dordvCUy.js +142 -0
  6. package/dist/assets/{UiPagination.2XvUpFoX.js → UiPagination.7HNbPhvg.js} +1 -1
  7. package/dist/assets/{UiProfileMenu.DabRebk0.js → UiProfileMenu.Daxkis6-.js} +1 -1
  8. package/dist/assets/UiSelect.CF7NEAzH.js +350 -0
  9. package/dist/assets/{UiTable.B0Yoq7JZ.js → UiTable.pKt1Al8E.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/UiDropdown/UiDropdown.js +1 -1
  13. package/dist/components/UiDropdown/UiDropdown.vue.d.ts +1 -0
  14. package/dist/components/UiDropdown/composables/useKeyboard.d.ts +12 -0
  15. package/dist/components/UiDropdown/composables/useKeyboard.js +73 -0
  16. package/dist/components/UiDropdown/types.d.ts +1 -0
  17. package/dist/components/UiPagination/UiPagination.js +1 -1
  18. package/dist/components/UiProfileMenu/UiProfileMenu.js +1 -1
  19. package/dist/components/UiSelect/UiSelect.js +1 -1
  20. package/dist/components/UiSelect/components/SelectListItem.js +1 -1
  21. package/dist/components/UiSelect/components/SelectVirtualList.js +1 -1
  22. package/dist/components/UiSelect/components/SelectVirtualList.vue.d.ts +3 -1
  23. package/dist/components/UiSelect/composables/useKeyboard.d.ts +8 -5
  24. package/dist/components/UiSelect/composables/useKeyboard.js +43 -12
  25. package/dist/components/UiTable/UiTable.js +1 -1
  26. package/dist/index.js +6 -6
  27. package/dist/style.css +1 -1
  28. package/package.json +1 -1
  29. package/dist/assets/UiDropdown.Dg0XSpN8.js +0 -122
  30. 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.21",
4
+ "version": "7.7.23",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "dist/index.js",
@@ -1,122 +0,0 @@
1
- import { t as e } from "./UiIcon.iHypdpWu.js";
2
- import { a as t, t as n } from "./dist.Djg8q2_N.js";
3
- import { a as r, i, n as a, o, s } from "./floating-ui.dom.CaQOX_Ez.js";
4
- import { n as c } from "./floating-ui.vue.DvnT8fZC.js";
5
- import { isMobileDevice as l } from "../helpers/is-mobile-device.js";
6
- import { Teleport as u, Transition as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createVNode as _, defineComponent as v, mergeModels as y, normalizeClass as b, normalizeStyle as x, openBlock as S, ref as C, renderSlot as w, useCssVars as T, useModel as E, watch as D, withCtx as O } from "vue";
7
- //#endregion
8
- //#region src/lib/components/UiDropdown/UiDropdown.vue
9
- var k = /* @__PURE__ */ v({
10
- __name: "UiDropdown",
11
- props: /*@__PURE__*/ y({
12
- popperClass: {},
13
- offset: {},
14
- disabled: { type: Boolean },
15
- trigger: { default: "click" },
16
- fitContentWidth: {
17
- type: Boolean,
18
- default: !0
19
- },
20
- placement: { default: "bottom-start" },
21
- teleport: {
22
- type: [String, Boolean],
23
- default: "body"
24
- },
25
- mode: {}
26
- }, {
27
- modelValue: {
28
- type: Boolean,
29
- default: !1
30
- },
31
- modelModifiers: {}
32
- }),
33
- emits: /*@__PURE__*/ y(["close", "open"], ["update:modelValue"]),
34
- setup(v, { expose: y, emit: k }) {
35
- T((e) => ({ v7a5b2832: F.value }));
36
- let A = k, j = v, M = E(v, "modelValue"), N = C(null), P = C(null), F = C(""), { width: I } = t(), { x: L, y: R } = c(N, P, {
37
- whileElementsMounted: a,
38
- placement: j.placement,
39
- middleware: [
40
- r(j.offset),
41
- s({ apply({ availableHeight: e, elements: t }) {
42
- Object.assign(t.floating.style, { maxHeight: `${Math.max(300, e)}px` });
43
- } }),
44
- i({ fallbackStrategy: "initialPlacement" }),
45
- o()
46
- ]
47
- });
48
- n(N, () => {
49
- M.value && W();
50
- }, { ignore: [P] }), y({
51
- open: U,
52
- close: W
53
- });
54
- let z = f(() => ({
55
- top: R.value == null ? "" : `${R.value}px`,
56
- left: L.value == null ? "" : `${L.value}px`
57
- }));
58
- function B() {
59
- F.value = (N.value?.clientWidth ?? 0) + "px";
60
- }
61
- function V(e) {
62
- if (l() && j.trigger == "hover" && e === "mouseenter") {
63
- H();
64
- return;
65
- }
66
- if (j.trigger === "click") {
67
- if (e !== "click") return;
68
- H();
69
- return;
70
- }
71
- if (e === "mouseenter") {
72
- H();
73
- return;
74
- }
75
- e === "mouseleave" && H();
76
- }
77
- function H() {
78
- M.value ? W() : U();
79
- }
80
- function U() {
81
- M.value = !0, A("open");
82
- }
83
- function W() {
84
- M.value = !1, A("close");
85
- }
86
- return D([M, I], B), (t, n) => (S(), h("div", {
87
- ref_key: "dropdownRef",
88
- ref: N,
89
- class: "ui-dropdown"
90
- }, [g("div", {
91
- class: b(["ui-dropdown__trigger", [{
92
- "click-event": v.trigger === "click",
93
- "is-disabled": v.disabled
94
- }, `mode-${v.mode}`]]),
95
- onMouseenter: n[0] ||= (e) => V("mouseenter"),
96
- onMouseleave: n[1] ||= (e) => V("mouseleave"),
97
- onClick: n[2] ||= (e) => V("click")
98
- }, [w(t.$slots, "reference"), v.mode === "custom" ? (S(), p(e, {
99
- key: 0,
100
- class: b(["ui-dropdown__trigger-arrow", { rotate: M.value }]),
101
- type: "400",
102
- name: "keyboard-arrow-down"
103
- }, null, 8, ["class"])) : m("", !0)], 34), (S(), p(u, {
104
- disabled: !v.teleport,
105
- to: typeof v.teleport == "string" ? v.teleport : "body"
106
- }, [g("div", {
107
- class: b([[v.popperClass, { "is-show": M.value }], "ui-dropdown__content-wrapper"]),
108
- style: x(z.value),
109
- ref_key: "contentRefer",
110
- ref: P,
111
- role: "tooltip"
112
- }, [_(d, { name: "dropdown" }, {
113
- default: O(() => [M.value ? (S(), h("div", {
114
- key: 0,
115
- class: b(["ui-dropdown__content", { "is-fit": v.fitContentWidth }])
116
- }, [w(t.$slots, "default")], 2)) : m("", !0)]),
117
- _: 3
118
- })], 6)], 8, ["disabled", "to"]))], 512));
119
- }
120
- });
121
- //#endregion
122
- export { k 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 };