@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
@@ -1,11 +1,14 @@
1
1
  import { ComputedRef, Ref } from 'vue';
2
- export declare function useKeyboard<Options>({ isFocus, checkOption, filteredOptions }: {
3
- isFocus: Ref<boolean>;
2
+ export declare function useKeyboard<Options>({ isOpen, isDisabled, checkOption, filteredOptions, isOptionDisabled, open }: {
3
+ isOpen: Ref<boolean>;
4
+ isDisabled: ComputedRef<boolean>;
4
5
  checkOption: (value: unknown) => void;
5
6
  filteredOptions: ComputedRef<Options[]>;
7
+ isOptionDisabled: (option: unknown) => boolean;
8
+ open: (preferEnd?: boolean) => void;
6
9
  }): {
7
- onKeydownEnter: () => void;
8
- onKeydownDown: () => void;
9
- onKeydownUp: () => void;
10
+ onKeydown: (event: KeyboardEvent) => void;
10
11
  navigatedIndex: Ref<number | null, number | null>;
12
+ firstSelectableIndex: () => number | null;
13
+ lastSelectableIndex: () => number | null;
11
14
  };
@@ -1,21 +1,52 @@
1
1
  import { ref as e } from "vue";
2
2
  //#region src/lib/components/UiSelect/composables/useKeyboard.ts
3
- function t({ isFocus: t, checkOption: n, filteredOptions: r }) {
4
- let i = e(null);
5
- function a() {
6
- i.value !== null && n(r.value?.[i.value]);
3
+ function t({ isOpen: t, isDisabled: n, checkOption: r, filteredOptions: i, isOptionDisabled: a, open: o }) {
4
+ let s = e(null);
5
+ function c(e) {
6
+ let t = i.value[e];
7
+ return t !== void 0 && !a(t);
7
8
  }
8
- function o() {
9
- t.value && (i.value === null || i.value === r.value.length - 1 ? i.value = 0 : i.value++);
9
+ function l() {
10
+ let e = i.value.findIndex((e, t) => c(t));
11
+ return e === -1 ? null : e;
10
12
  }
11
- function s() {
12
- t.value && (i.value === null || i.value === 0 ? i.value = r.value.length - 1 : i.value--);
13
+ function u() {
14
+ let e = i.value;
15
+ for (let t = e.length - 1; t >= 0; t--) if (c(t)) return t;
16
+ return null;
17
+ }
18
+ function d(e) {
19
+ let t = [];
20
+ if (i.value.forEach((e, n) => {
21
+ c(n) && t.push(n);
22
+ }), !t.length) return;
23
+ let n = t.indexOf(s.value ?? -1);
24
+ if (n === -1) {
25
+ s.value = e > 0 ? t[0] : t[t.length - 1];
26
+ return;
27
+ }
28
+ let r = n + e;
29
+ r < 0 || r >= t.length || (s.value = t[r]);
30
+ }
31
+ function f() {
32
+ if (s.value === null) return;
33
+ let e = i.value[s.value];
34
+ e === void 0 || a(e) || r(e);
35
+ }
36
+ function p(e) {
37
+ if (!(e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) && !n.value && (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter")) {
38
+ if (!t.value) {
39
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), o(e.key === "ArrowUp"));
40
+ return;
41
+ }
42
+ e.preventDefault(), e.stopPropagation(), e.key === "ArrowDown" ? d(1) : e.key === "ArrowUp" ? d(-1) : f();
43
+ }
13
44
  }
14
45
  return {
15
- onKeydownEnter: a,
16
- onKeydownDown: o,
17
- onKeydownUp: s,
18
- navigatedIndex: i
46
+ onKeydown: p,
47
+ navigatedIndex: s,
48
+ firstSelectableIndex: l,
49
+ lastSelectableIndex: u
19
50
  };
20
51
  }
21
52
  //#endregion
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../assets/UiTable.B0Yoq7JZ.js";
1
+ import { t as e } from "../../assets/UiTable.BVVe4xAf.js";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../assets/UiNotification.BQl5o1e4.js";
1
+ import { t as e } from "../../assets/UiNotification.Bpq5dNbz.js";
2
2
  export { e as default };
@@ -5,7 +5,6 @@ type __VLS_Props = {
5
5
  title?: string;
6
6
  message: string;
7
7
  type?: UiNotificationType;
8
- isHTMLMessage?: boolean;
9
8
  pauseOnHover?: boolean;
10
9
  duration?: number;
11
10
  };
@@ -19,7 +18,6 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
19
18
  pauseOnHover: boolean;
20
19
  type: UiNotificationType;
21
20
  duration: number;
22
- isHTMLMessage: boolean;
23
21
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
22
  declare const _default: typeof __VLS_export;
25
23
  export default _default;
@@ -1,2 +1,2 @@
1
1
  import { UiNotificationType } from './types.ts';
2
- export default function (message: string, type?: UiNotificationType, isHTMLMessage?: boolean, title?: string): void;
2
+ export default function (message: string, type?: UiNotificationType, titleOrLegacyFlag?: string | boolean, legacyTitle?: string): void;
@@ -1,24 +1,23 @@
1
1
  import { t as e } from "../../assets/dist.l1zr5gfb.js";
2
- import { t } from "../../assets/UiNotification.BQl5o1e4.js";
2
+ import { t } from "../../assets/UiNotification.Bpq5dNbz.js";
3
3
  import { h as n, render as r } from "vue";
4
4
  //#region src/lib/composables/useNotification/useNotification.ts
5
5
  var i = 16, a = [];
6
6
  function o(o, c, l, u) {
7
- let d = i;
8
- for (let e of a) d += e.el.offsetHeight + i;
9
- let f = document.createElement("div"), p = () => {
10
- r(null, f);
11
- }, m = e(), h = n(t, {
12
- id: m,
13
- top: d,
7
+ let d = typeof l == "string" ? l : u, f = i;
8
+ for (let e of a) f += e.el.offsetHeight + i;
9
+ let p = document.createElement("div"), m = () => {
10
+ r(null, p);
11
+ }, h = e(), g = n(t, {
12
+ id: h,
13
+ top: f,
14
14
  onDeleteFromList: s,
15
- onRemove: p,
15
+ onRemove: m,
16
16
  message: o,
17
17
  type: c,
18
- isHTMLMessage: l,
19
- title: u
18
+ title: d
20
19
  });
21
- r(h, f), a.push(h), document.body.appendChild(f.firstElementChild);
20
+ r(g, p), a.push(g), document.body.appendChild(p.firstElementChild);
22
21
  }
23
22
  function s(e) {
24
23
  let t = i;
package/dist/index.js CHANGED
@@ -15,10 +15,10 @@ import { t as p } from "./assets/UiTooltip.1p87Beod.js";
15
15
  import { config as m } from "./config/index.js";
16
16
  import { t as h } from "./assets/UiInput.BEFJx5jn.js";
17
17
  import { t as g } from "./assets/UiDropdown.Dg0XSpN8.js";
18
- import { t as _ } from "./assets/UiSelect.CBOQXkNp.js";
18
+ import { t as _ } from "./assets/UiSelect.DBnwUWeq.js";
19
19
  import { t as v } from "./assets/UiSkeleton.Gw5aX0E-.js";
20
20
  import { t as y } from "./assets/dayjs.min.DNJva77w.js";
21
- import { t as b } from "./assets/UiChat.DgUnWoCI.js";
21
+ import { t as b } from "./assets/UiChat.BTOPlRp-.js";
22
22
  import { t as x } from "./assets/UiCheckbox.DcHqX1WC.js";
23
23
  import { t as S } from "./assets/UiCheckboxGroup.BAyBw4d4.js";
24
24
  import { t as C } from "./assets/UiCollapse.wtAndcyP.js";
@@ -39,12 +39,12 @@ import L from "./components/UiLayoutAuth/UiLayoutAuth.js";
39
39
  import { t as R } from "./assets/UiLayoutMenuItem.BtzmDM7n.js";
40
40
  import { t as z } from "./assets/UiLayoutMenu.DQFLq1ZP.js";
41
41
  import { t as B } from "./assets/UiMobileMenu.BWQo-ly6.js";
42
- import { t as V } from "./assets/UiPagination.2XvUpFoX.js";
42
+ import { t as V } from "./assets/UiPagination.DpV3wFEW.js";
43
43
  import { t as H } from "./assets/UiProfileMenu.DabRebk0.js";
44
44
  import { t as U } from "./assets/UiRadio.B9S8onxL.js";
45
45
  import { t as W } from "./assets/UiRadioGroup.BYchviiF.js";
46
46
  import { t as G } from "./assets/UiSwitch.CiUXziwX.js";
47
- import { t as K } from "./assets/UiTable.B0Yoq7JZ.js";
47
+ import { t as K } from "./assets/UiTable.BVVe4xAf.js";
48
48
  import { t as q } from "./assets/UiTag.BXBfn77t.js";
49
49
  import J from "./composables/useNotification/useNotification.js";
50
50
  //#endregion