vlite3 0.8.7 → 0.8.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.
Files changed (34) hide show
  1. package/components/Badge.vue.js +4 -4
  2. package/components/Button.vue.js +21 -21
  3. package/components/ColorPicker/ColorPicker.vue.d.ts +1 -1
  4. package/components/DataTable/DataTable.vue.js +34 -11
  5. package/components/Dropdown/Dropdown.vue.d.ts +7 -7
  6. package/components/Dropdown/Dropdown.vue.js +132 -121
  7. package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
  8. package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
  9. package/components/Dropdown/useDropdownIds.d.ts +7 -0
  10. package/components/FilePicker/FilePicker.vue.js +12 -12
  11. package/components/Form/Form.vue.js +2 -2
  12. package/components/Form/Form.vue2.js +2 -2
  13. package/components/Form/FormFields.vue.js +2 -2
  14. package/components/Form/FormFields.vue2.js +6 -6
  15. package/components/IconPicker.vue.d.ts +1 -1
  16. package/components/Modal.vue.js +2 -2
  17. package/components/Navbar/Navbar.vue.d.ts +1 -1
  18. package/components/NavbarCommandPalette.vue.d.ts +1 -1
  19. package/components/Screen/Screen.vue.js +197 -218
  20. package/components/SidePanel.vue.d.ts +1 -1
  21. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  22. package/components/Stats/Stats.vue.js +151 -113
  23. package/components/Stats/types.d.ts +1 -1
  24. package/components/Tooltip.vue.d.ts +4 -4
  25. package/components/Tooltip.vue.js +2 -2
  26. package/lib/v-tooltip-lite/components/ToolTip.vue.d.ts +48 -0
  27. package/lib/v-tooltip-lite/components/ToolTip.vue.js +102 -0
  28. package/lib/v-tooltip-lite/components/ToolTip.vue2.js +4 -0
  29. package/lib/v-tooltip-lite/composables/usePopover.d.ts +20 -0
  30. package/lib/v-tooltip-lite/composables/usePopover.js +144 -0
  31. package/lib/v-tooltip-lite/index.d.ts +2 -0
  32. package/lib/v-tooltip-lite/index.js +4 -0
  33. package/package.json +2 -2
  34. package/style.css +1 -1
@@ -1,14 +1,14 @@
1
- import { defineComponent as b, computed as d, openBlock as a, createElementBlock as u, normalizeClass as i, renderSlot as c } from "vue";
1
+ import { defineComponent as b, computed as a, openBlock as d, createElementBlock as u, normalizeClass as i, renderSlot as c } from "vue";
2
2
  const p = /* @__PURE__ */ b({
3
3
  __name: "Badge",
4
4
  props: {
5
5
  variant: { default: "default" },
6
- size: { default: "md" },
6
+ size: { default: "sm" },
7
7
  rounded: { default: "full" },
8
8
  class: { default: "" }
9
9
  },
10
10
  setup(o) {
11
- const e = o, s = d(() => {
11
+ const e = o, s = a(() => {
12
12
  const r = {
13
13
  xs: "px-1.5 h-5 text-[10.5px] leading-none",
14
14
  sm: "px-2 h-6 text-xs font-medium",
@@ -33,7 +33,7 @@ const p = /* @__PURE__ */ b({
33
33
  };
34
34
  return [l, t[e.variant] || t.default, e.class].join(" ");
35
35
  });
36
- return (r, n) => (a(), u("div", {
36
+ return (r, n) => (d(), u("div", {
37
37
  class: i(s.value)
38
38
  }, [
39
39
  c(r.$slots, "default")
@@ -1,4 +1,4 @@
1
- import { defineComponent as B, computed as o, useSlots as R, inject as S, withDirectives as G, openBlock as s, createElementBlock as h, normalizeClass as i, createBlock as d, createCommentVNode as m, renderSlot as f, createTextVNode as b, toDisplayString as x, unref as $ } from "vue";
1
+ import { defineComponent as B, computed as o, useSlots as R, inject as S, withDirectives as G, openBlock as s, createElementBlock as h, normalizeClass as r, createBlock as u, createCommentVNode as m, renderSlot as b, createTextVNode as f, toDisplayString as x, unref as $ } from "vue";
2
2
  import g from "./Icon.vue.js";
3
3
  import { vRipple as j } from "../directives/vRipple.js";
4
4
  import { $t as V } from "../utils/i18n.js";
@@ -25,7 +25,7 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
25
25
  const t = e, a = o(() => t.textI18n ? V(t.textI18n) : t.text), v = R(), l = o(
26
26
  () => t?.asIcon || t.icon && !a.value && !v.default
27
27
  ), p = S("buttonGroup", null), w = o(() => !!p?.isInGroup), y = o(() => {
28
- const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", r = {
28
+ const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus:border focus:border-primary disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", i = {
29
29
  primary: "bg-primary text-primary-foreground hover:bg-primary/90",
30
30
  "primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
31
31
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
@@ -77,12 +77,12 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
77
77
  "2xl": "rounded-2xl",
78
78
  full: "rounded-full"
79
79
  };
80
- let u;
81
- return l.value ? u = w.value ? k[t.size] : C[t.size] : u = z[t.size], [
80
+ let d;
81
+ return l.value ? d = w.value ? k[t.size] : C[t.size] : d = z[t.size], [
82
82
  n,
83
- r[t.variant],
83
+ i[t.variant],
84
84
  I[t.rounded],
85
- u,
85
+ d,
86
86
  t.class
87
87
  ].join(" ");
88
88
  }), c = o(() => {
@@ -93,7 +93,7 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
93
93
  md: "w-4 h-4",
94
94
  lg: "w-4 h-4",
95
95
  xl: "w-4 h-4"
96
- }, r = {
96
+ }, i = {
97
97
  xs: "w-3 h-3",
98
98
  sm: "w-4 h-4",
99
99
  sm2: "w-4 h-4",
@@ -101,36 +101,36 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
101
101
  lg: "w-4 h-4",
102
102
  xl: "w-4 h-4"
103
103
  };
104
- return l.value ? r[t.size] : n[t.size];
104
+ return l.value ? i[t.size] : n[t.size];
105
105
  });
106
- return (n, r) => G((s(), h("button", {
106
+ return (n, i) => G((s(), h("button", {
107
107
  type: e.type,
108
- class: i([y.value, "cursor-pointer"]),
108
+ class: r([y.value, "cursor-pointer"]),
109
109
  disabled: e.disabled || e.loading
110
110
  }, [
111
- e.loading ? (s(), d(g, {
111
+ e.loading ? (s(), u(g, {
112
112
  key: 0,
113
113
  icon: "lucide:loader-2",
114
- class: i(["animate-spin pointer-events-none", c.value])
115
- }, null, 8, ["class"])) : e.icon ? (s(), d(g, {
114
+ class: r(["animate-spin pointer-events-none", c.value])
115
+ }, null, 8, ["class"])) : e.icon ? (s(), u(g, {
116
116
  key: 1,
117
117
  icon: e.icon,
118
- class: i(["pointer-events-none", [e.iconClass, c.value, l.value ? "mx-auto" : ""]])
118
+ class: r(["pointer-events-none", [e.iconClass, c.value, l.value ? "mx-auto" : ""]])
119
119
  }, null, 8, ["icon", "class"])) : m("", !0),
120
120
  e.textClass ? (s(), h("span", {
121
121
  key: 2,
122
- class: i(e.textClass)
122
+ class: r(e.textClass)
123
123
  }, [
124
- f(n.$slots, "default", {}, () => [
125
- b(x(a.value), 1)
124
+ b(n.$slots, "default", {}, () => [
125
+ f(x(a.value), 1)
126
126
  ])
127
- ], 2)) : f(n.$slots, "default", { key: 3 }, () => [
128
- b(x(a.value), 1)
127
+ ], 2)) : b(n.$slots, "default", { key: 3 }, () => [
128
+ f(x(a.value), 1)
129
129
  ]),
130
- e.iconRight && !e.loading ? (s(), d(g, {
130
+ e.iconRight && !e.loading ? (s(), u(g, {
131
131
  key: 4,
132
132
  icon: e.iconRight,
133
- class: i([[e.iconRightClass, c.value], "h-4 w-4 pointer-events-none"])
133
+ class: r([[e.iconRightClass, c.value], "h-4 w-4 pointer-events-none"])
134
134
  }, null, 8, ["icon", "class"])) : m("", !0)
135
135
  ], 10, D)), [
136
136
  [$(j)]
@@ -1,4 +1,4 @@
1
- import { TooltTipPlacement } from 'v-tooltip-lite/types';
1
+ import { TooltTipPlacement } from '../../lib/v-tooltip-lite/types';
2
2
  import { ButtonProps } from '../../types';
3
3
  interface Props {
4
4
  modelValue?: string;
@@ -24,7 +24,7 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
24
24
  rows: { default: () => [] },
25
25
  selectedRows: { default: () => [] },
26
26
  search: { default: "" },
27
- showSearch: { type: Boolean, default: !0 },
27
+ showSearch: { type: Boolean, default: !1 },
28
28
  searchPlaceholder: {},
29
29
  searchPlaceholderI18n: {},
30
30
  toolbarClass: {},
@@ -83,13 +83,22 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
83
83
  V && clearTimeout(V), V = setTimeout(() => {
84
84
  h.value = 1, R();
85
85
  }, 300);
86
- }), g(() => a.pageInfo?.itemsPerPage, (e) => {
87
- e !== void 0 && (P.value = e);
88
- }), g(() => a.paginationProps?.itemsPerPage, (e) => {
89
- e !== void 0 && (P.value = e);
90
- }), g(() => a.pageInfo?.currentPage, (e) => {
91
- e && (h.value = e);
92
- });
86
+ }), g(
87
+ () => a.pageInfo?.itemsPerPage,
88
+ (e) => {
89
+ e !== void 0 && (P.value = e);
90
+ }
91
+ ), g(
92
+ () => a.paginationProps?.itemsPerPage,
93
+ (e) => {
94
+ e !== void 0 && (P.value = e);
95
+ }
96
+ ), g(
97
+ () => a.pageInfo?.currentPage,
98
+ (e) => {
99
+ e && (h.value = e);
100
+ }
101
+ );
93
102
  const s = y(/* @__PURE__ */ new Set());
94
103
  g(
95
104
  () => a.selectedRows,
@@ -118,7 +127,11 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
118
127
  }), (a.selectedRows || []).forEach((l) => {
119
128
  const n = c(l, d.value);
120
129
  !e.has(n) && s.value.has(n) && (t.push(l), e.add(n));
121
- }), b("select", { selected: t, all: M.value, indeterminate: O.value }), b("update:selectedRows", t);
130
+ }), b("select", {
131
+ selected: t,
132
+ all: M.value,
133
+ indeterminate: O.value
134
+ }), b("update:selectedRows", t);
122
135
  }, le = (e) => {
123
136
  const t = a.headers.find((n) => n.field === e), l = t ? Q(t) : e;
124
137
  u.value.field === l ? u.value.order === "asc" ? u.value.order = "desc" : u.value.order === "desc" ? (u.value.order = "", u.value.field = "") : u.value.order = "asc" : (u.value.field = l, u.value.order = "asc"), h.value = 1, R();
@@ -154,7 +167,11 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
154
167
  "overflow-hidden",
155
168
  a.bordered ? "border border-border" : "",
156
169
  a.class
157
- ].join(" ")), ie = r(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), de = (e) => e.width || "auto", ce = r(() => a.emptyTitleI18n ? w(a.emptyTitleI18n) : a.emptyTitle), ue = r(() => a.emptyDescriptionI18n ? w(a.emptyDescriptionI18n) : a.emptyDescription), me = r(() => {
170
+ ].join(" ")), ie = r(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), de = (e) => e.width || "auto", ce = r(
171
+ () => a.emptyTitleI18n ? w(a.emptyTitleI18n) : a.emptyTitle
172
+ ), ue = r(
173
+ () => a.emptyDescriptionI18n ? w(a.emptyDescriptionI18n) : a.emptyDescription
174
+ ), me = r(() => {
158
175
  const e = w("vlite.dataTable.confirmDeleteTitle");
159
176
  return e !== "vlite.dataTable.confirmDeleteTitle" ? e : "Confirm Deletion";
160
177
  }), fe = r(() => {
@@ -267,7 +284,13 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
267
284
  ]));
268
285
  return S.memo = C, S;
269
286
  }, t, 2), 128)) : o.rows.length > 0 ? (i(!0), m(A, { key: 1 }, B(o.rows, (l, n, ge, v) => {
270
- const C = [l, s.value.has(c(l, d.value)), o.compact, o.striped, o.hoverable];
287
+ const C = [
288
+ l,
289
+ s.value.has(c(l, d.value)),
290
+ o.compact,
291
+ o.striped,
292
+ o.hoverable
293
+ ];
271
294
  if (v && v.key === c(l, d.value) && W(v, C)) return v;
272
295
  const S = (i(), F(Te, {
273
296
  key: c(l, d.value),
@@ -1,5 +1,5 @@
1
1
  import { IDropdownOption, ButtonProps } from '../../types';
2
- import { TooltTipPlacement } from 'v-tooltip-lite/types';
2
+ import { TooltTipPlacement } from '../../lib/v-tooltip-lite/types';
3
3
  type __VLS_Props = {
4
4
  selected?: any;
5
5
  modelValue?: any;
@@ -65,10 +65,10 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
65
65
  option?: IDropdownOption;
66
66
  }) => any;
67
67
  "update:modelValue": (value: any) => any;
68
+ "update:isOpen": (value: boolean) => any;
68
69
  "load-more": () => any;
69
70
  onClose: () => any;
70
71
  onOpen: () => any;
71
- "update:isOpen": (value: boolean) => any;
72
72
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
73
73
  onSearch?: (query: string) => any;
74
74
  onOnSelect?: (payload: {
@@ -77,14 +77,17 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
77
77
  option?: IDropdownOption;
78
78
  }) => any;
79
79
  "onUpdate:modelValue"?: (value: any) => any;
80
+ "onUpdate:isOpen"?: (value: boolean) => any;
80
81
  "onLoad-more"?: () => any;
81
82
  onOnClose?: () => any;
82
83
  onOnOpen?: () => any;
83
- "onUpdate:isOpen"?: (value: boolean) => any;
84
84
  }>, {
85
85
  loading: boolean;
86
- selectable: boolean;
86
+ offset: [number, number];
87
87
  options: (IDropdownOption | string | number)[];
88
+ teleport: boolean;
89
+ isOpen: boolean;
90
+ selectable: boolean;
88
91
  columns: number | string;
89
92
  selectedIndex: number | null;
90
93
  maxHeight: string;
@@ -98,9 +101,6 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
98
101
  closeOnSelect: boolean;
99
102
  toggleSelection: boolean;
100
103
  emptyMessage: string;
101
- offset: [number, number];
102
- isOpen: boolean;
103
- teleport: boolean;
104
104
  showSelectedLabel: boolean;
105
105
  doubleConfirmation: boolean;
106
106
  isNested: boolean;
@@ -1,13 +1,13 @@
1
- import { defineComponent as K, ref as i, computed as m, watch as T, provide as Q, reactive as W, toRefs as X, openBlock as A, createElementBlock as Y, normalizeStyle as Z, createVNode as B, unref as v, withCtx as c, renderSlot as d, createBlock as _, normalizeClass as ee, createSlots as te, normalizeProps as H, guardReactiveProps as L, createCommentVNode as le } from "vue";
2
- import oe from "v-tooltip-lite";
3
- import "v-tooltip-lite/style.css";
4
- import ne from "./DropdownMenu.vue.js";
5
- import ae from "./DropdownTrigger.vue.js";
6
- import ie from "../ConfirmationModal.vue.js";
7
- import { useDropdownIds as se } from "./composables/useDropdownIds.js";
8
- import { useDropdownSelection as re } from "./composables/useDropdownSelection.js";
9
- import { useDropdownHydration as ue } from "./composables/useDropdownHydration.js";
10
- const be = /* @__PURE__ */ K({
1
+ import { defineComponent as ee, ref as i, computed as c, inject as te, onMounted as ne, onUnmounted as le, watch as P, provide as oe, reactive as ae, toRefs as ie, openBlock as L, createElementBlock as se, normalizeStyle as re, createVNode as x, unref as p, withCtx as f, renderSlot as m, createBlock as ue, normalizeClass as de, createSlots as ce, normalizeProps as V, guardReactiveProps as R, createCommentVNode as fe } from "vue";
2
+ import me from "../../lib/v-tooltip-lite/components/ToolTip.vue.js";
3
+ /* empty css */
4
+ import ve from "./DropdownMenu.vue.js";
5
+ import he from "./DropdownTrigger.vue.js";
6
+ import pe from "../ConfirmationModal.vue.js";
7
+ import { useDropdownIds as ge } from "./composables/useDropdownIds.js";
8
+ import { useDropdownSelection as ye } from "./composables/useDropdownSelection.js";
9
+ import { useDropdownHydration as Ce } from "./composables/useDropdownHydration.js";
10
+ const xe = /* @__PURE__ */ ee({
11
11
  __name: "Dropdown",
12
12
  props: {
13
13
  selected: {},
@@ -46,138 +46,149 @@ const be = /* @__PURE__ */ K({
46
46
  isNested: { type: Boolean, default: !1 }
47
47
  },
48
48
  emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
49
- setup(l, { emit: V }) {
50
- const n = l, p = V, h = i(!1), f = i(null), s = i({
49
+ setup(l, { emit: z }) {
50
+ const o = l, g = z, y = i(!1), v = i(null), r = i({
51
51
  title: "Confirm Selection",
52
52
  description: "Are you sure you want to select this option?",
53
53
  confirmText: "Confirm",
54
54
  cancelText: "Cancel",
55
55
  variant: "primary"
56
- }), D = m(() => n.position ? n.position : n.direction === "rtl" ? "bottom-end" : "bottom-start"), R = m(() => n.nestedPosition ? n.nestedPosition : n.direction === "rtl" ? "left-start" : "right-start"), O = i(n.isOpen || !1), y = i(0);
57
- T(
58
- () => n.isOpen,
56
+ }), E = c(() => o.position ? o.position : o.direction === "rtl" ? "bottom-end" : "bottom-start"), j = c(() => o.nestedPosition ? o.nestedPosition : o.direction === "rtl" ? "left-start" : "right-start"), S = i(o.isOpen || !1), C = i(0), U = `dropdown-${Math.random().toString(36).substring(2, 9)}`, $ = c(() => o.menuId || U), h = i([]), s = te("dropdown-context", null), q = (e) => {
57
+ h.value.includes(e) || h.value.push(e), s?.registerChildId?.(e);
58
+ }, F = (e) => {
59
+ h.value = h.value.filter((n) => n !== e), s?.unregisterChildId?.(e);
60
+ };
61
+ ne(() => {
62
+ s?.registerChildId && s.registerChildId(`#${$.value}`);
63
+ }), le(() => {
64
+ s?.unregisterChildId && s.unregisterChildId(`#${$.value}`);
65
+ }), P(
66
+ () => o.isOpen,
59
67
  (e) => {
60
- e !== void 0 && (O.value = e);
68
+ e !== void 0 && (S.value = e);
61
69
  }
62
70
  );
63
- const P = (e) => {
64
- O.value = e, p("update:isOpen", e), p(e ? "onOpen" : "onClose");
65
- }, g = () => {
66
- P(!1);
71
+ const M = (e) => {
72
+ S.value = e, g("update:isOpen", e), g(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
73
+ }, b = () => {
74
+ M(!1);
75
+ }, G = (e) => {
76
+ e ? C.value++ : C.value = Math.max(0, C.value - 1);
67
77
  };
68
- Q("dropdown-context", {
69
- close: g,
78
+ oe("dropdown-context", {
79
+ close: b,
70
80
  onChildToggle: (e) => {
71
- e ? y.value++ : y.value = Math.max(0, y.value - 1);
72
- }
81
+ G(e), s?.onChildToggle?.(e);
82
+ },
83
+ registerChildId: q,
84
+ unregisterChildId: F
73
85
  });
74
- const b = m(() => n.options ? n.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), C = i([]), I = i(!1), S = i(!1);
75
- T(
76
- b,
86
+ const w = c(() => o.options ? o.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), O = i([]), N = i(!1), k = i(!1);
87
+ P(
88
+ w,
77
89
  (e) => {
78
90
  if (e) {
79
- if (n.remote) {
80
- const o = [...C.value];
91
+ if (o.remote) {
92
+ const n = [...O.value];
81
93
  e.forEach((t) => {
82
- o.some((a) => a.value !== void 0 && t.value !== void 0 ? typeof a.value == "object" && a.key && t.key ? a.key === t.key && a.value[a.key] === t.value[t.key] : a.value === t.value : a.label === t.label) || o.push(t);
83
- }), C.value = o;
94
+ n.some((a) => a.value !== void 0 && t.value !== void 0 ? typeof a.value == "object" && a.key && t.key ? a.key === t.key && a.value[a.key] === t.value[t.key] : a.value === t.value : a.label === t.label) || n.push(t);
95
+ }), O.value = n;
84
96
  } else
85
- C.value = e;
86
- !I.value && e.length > 0 && (I.value = !0, setTimeout(() => {
87
- S.value = !0, N(w.value);
97
+ O.value = e;
98
+ !N.value && e.length > 0 && (N.value = !0, setTimeout(() => {
99
+ k.value = !0, A(T.value);
88
100
  }, 10));
89
101
  }
90
102
  },
91
103
  { immediate: !0 }
92
- // Performance fix: Removed deep: true to prevent heavy recursion mapping
93
104
  );
94
- const u = m(() => {
95
- const e = [...C.value], o = new Set(e.map((t) => t.value ?? t.label));
96
- return k.value.forEach((t, r) => {
97
- o.has(r) || (e.unshift(t), o.add(r));
105
+ const d = c(() => {
106
+ const e = [...O.value], n = new Set(e.map((t) => t.value ?? t.label));
107
+ return I.value.forEach((t, u) => {
108
+ n.has(u) || (e.unshift(t), n.add(u));
98
109
  }), e;
99
- }), { selectedBuffer: k, isHydrating: z, hydrateSelected: N } = ue({
100
- fetchSelected: n.fetchSelected,
101
- getAvailableOptions: () => u.value,
102
- isReady: () => S.value
103
- }), { getAllRecursiveIds: E } = se(), j = W({
104
- ...X(n),
105
- options: u
106
- }), { currentValue: w, selectedLabel: x, selectOption: U } = re(
107
- j,
108
- p
109
- ), q = m(() => {
110
- const e = n.ignoreClickOutside || [], o = E(u.value);
111
- return [.../* @__PURE__ */ new Set([...e, ...o, ".tooltip-container"])];
110
+ }), { selectedBuffer: I, isHydrating: J, hydrateSelected: A } = Ce({
111
+ fetchSelected: o.fetchSelected,
112
+ getAvailableOptions: () => d.value,
113
+ isReady: () => k.value
114
+ }), { getAllRecursiveIds: K } = ge(), Q = ae({
115
+ ...ie(o),
116
+ options: d
117
+ }), { currentValue: T, selectedLabel: H, selectOption: W } = ye(
118
+ Q,
119
+ g
120
+ ), X = c(() => {
121
+ const e = o.ignoreClickOutside || [], n = K(d.value);
122
+ return [.../* @__PURE__ */ new Set([...e, ...n, ...h.value])];
112
123
  });
113
- T(
114
- () => w.value,
124
+ P(
125
+ () => T.value,
115
126
  (e) => {
116
- S.value && N(e);
127
+ k.value && A(e);
117
128
  },
118
129
  { deep: !0 }
119
130
  );
120
- const F = (e) => {
121
- n.doubleConfirmation || !!e.confirmation ? (f.value = e, typeof e.confirmation == "object" ? s.value = {
131
+ const Y = (e) => {
132
+ o.doubleConfirmation || !!e.confirmation ? (v.value = e, typeof e.confirmation == "object" ? r.value = {
122
133
  title: e.confirmation.title || "Confirm Selection",
123
134
  description: e.confirmation.description || "Are you sure you want to select this option?",
124
135
  confirmText: e.confirmation.confirmText || "Confirm",
125
136
  cancelText: e.confirmation.cancelText || "Cancel",
126
137
  variant: e.confirmation.variant || "primary"
127
- } : s.value = {
138
+ } : r.value = {
128
139
  title: "Confirm Selection",
129
140
  description: `Are you sure you want to select "${e.label}"?`,
130
141
  confirmText: "Confirm",
131
142
  cancelText: "Cancel",
132
143
  variant: "primary"
133
- }, h.value = !0, g()) : (M(e), n.closeOnSelect && g());
134
- }, M = (e) => {
135
- const o = e.value ?? e.label;
136
- k.value.has(o) || k.value.set(o, e);
137
- const t = U(e);
138
- if (!n.isNested) {
139
- const r = e._originalOption || e, a = r.value ?? r.label;
140
- (e._path || [r]).forEach(($) => {
141
- typeof $.onSelect == "function" && $.onSelect({
144
+ }, y.value = !0, b()) : (D(e), o.closeOnSelect && b());
145
+ }, D = (e) => {
146
+ const n = e.value ?? e.label;
147
+ I.value.has(n) || I.value.set(n, e);
148
+ const t = W(e);
149
+ if (!o.isNested) {
150
+ const u = e._originalOption || e, a = u.value ?? u.label;
151
+ (e._path || [u]).forEach((B) => {
152
+ typeof B.onSelect == "function" && B.onSelect({
142
153
  value: a,
143
- option: $,
144
- data: u.value || [],
154
+ option: B,
155
+ data: d.value || [],
145
156
  values: t
146
157
  });
147
158
  });
148
159
  }
149
- }, G = () => {
150
- f.value && (M(f.value), f.value = null, h.value = !1);
151
- }, J = () => {
152
- f.value = null, h.value = !1;
160
+ }, Z = () => {
161
+ v.value && (D(v.value), v.value = null, y.value = !1);
162
+ }, _ = () => {
163
+ v.value = null, y.value = !1;
153
164
  };
154
- return (e, o) => (A(), Y("div", {
165
+ return (e, n) => (L(), se("div", {
155
166
  class: "relative inline-block text-left",
156
- style: Z({ direction: l.direction })
167
+ style: re({ direction: l.direction })
157
168
  }, [
158
- B(v(oe), {
169
+ x(p(me), {
159
170
  content: "",
160
171
  trigger: "click",
161
172
  arrow: !1,
162
173
  teleport: l.teleport,
163
174
  offset: l.offset,
164
- placement: D.value,
165
- isOpen: O.value,
166
- keepAlive: y.value > 0,
167
- menuId: l.menuId,
168
- ignoreClickOutside: q.value,
175
+ placement: E.value,
176
+ isOpen: S.value,
177
+ keepAlive: C.value > 0,
178
+ menuId: $.value,
179
+ ignoreClickOutside: X.value,
169
180
  class: "w-full",
170
181
  className: "dropdown " + (l.className || ""),
171
- onOnShow: o[2] || (o[2] = (t) => e.$emit("onOpen")),
172
- onOnHide: o[3] || (o[3] = (t) => e.$emit("onClose")),
173
- "onUpdate:isOpen": P,
182
+ onOnShow: n[2] || (n[2] = (t) => e.$emit("onOpen")),
183
+ onOnHide: n[3] || (n[3] = (t) => e.$emit("onClose")),
184
+ "onUpdate:isOpen": M,
174
185
  triggerClass: "w-full",
175
186
  styles: { padding: "0" }
176
187
  }, {
177
- trigger: c(({ isOpen: t }) => [
178
- d(e.$slots, "trigger", H(L({ selectedLabel: v(x), isOpen: t })), () => [
179
- B(ae, {
180
- "selected-label": v(x),
188
+ trigger: f(({ isOpen: t }) => [
189
+ m(e.$slots, "trigger", V(R({ selectedLabel: p(H), isOpen: t })), () => [
190
+ x(he, {
191
+ "selected-label": p(H),
181
192
  "is-open": t,
182
193
  direction: l.direction,
183
194
  triggerProps: l.triggerProps,
@@ -185,77 +196,77 @@ const be = /* @__PURE__ */ K({
185
196
  }, null, 8, ["selected-label", "is-open", "direction", "triggerProps"])
186
197
  ])
187
198
  ]),
188
- default: c(() => [
189
- d(e.$slots, "default"),
190
- b.value.length || u.value.length || e.$slots.menu || e.$slots.item || l.remote || l.searchable ? (A(), _(ne, {
199
+ default: f(() => [
200
+ m(e.$slots, "default"),
201
+ w.value.length || d.value.length || e.$slots.menu || e.$slots.item || l.remote || l.searchable ? (L(), ue(ve, {
191
202
  key: 0,
192
- options: b.value,
193
- cachedOptions: u.value,
194
- class: ee(l.className),
195
- selected: v(w),
203
+ options: w.value,
204
+ cachedOptions: d.value,
205
+ class: de(l.className),
206
+ selected: p(T),
196
207
  selectedIndex: l.selectedIndex,
197
208
  maxHeight: l.maxHeight,
198
- nestedPosition: R.value,
209
+ nestedPosition: j.value,
199
210
  nestedOffset: l.nestedOffset,
200
211
  selectable: l.selectable,
201
212
  direction: l.direction,
202
213
  layout: l.layout,
203
214
  columns: l.columns,
204
- loading: l.loading || v(z),
215
+ loading: l.loading || p(J),
205
216
  hasMore: l.hasMore,
206
217
  searchable: l.searchable,
207
218
  remote: l.remote,
208
219
  debounceTime: l.debounceTime,
209
- onSelect: F,
210
- onClose: g,
211
- onLoadMore: o[0] || (o[0] = (t) => e.$emit("load-more")),
212
- onSearch: o[1] || (o[1] = (t) => e.$emit("search", t))
213
- }, te({ _: 2 }, [
220
+ onSelect: Y,
221
+ onClose: b,
222
+ onLoadMore: n[0] || (n[0] = (t) => e.$emit("load-more")),
223
+ onSearch: n[1] || (n[1] = (t) => e.$emit("search", t))
224
+ }, ce({ _: 2 }, [
214
225
  e.$slots.menu ? {
215
226
  name: "menu",
216
- fn: c(() => [
217
- d(e.$slots, "menu")
227
+ fn: f(() => [
228
+ m(e.$slots, "menu")
218
229
  ]),
219
230
  key: "0"
220
231
  } : void 0,
221
232
  e.$slots.item ? {
222
233
  name: "item",
223
- fn: c((t) => [
224
- d(e.$slots, "item", H(L(t)))
234
+ fn: f((t) => [
235
+ m(e.$slots, "item", V(R(t)))
225
236
  ]),
226
237
  key: "1"
227
238
  } : void 0,
228
239
  e.$slots.header ? {
229
240
  name: "header",
230
- fn: c(() => [
231
- d(e.$slots, "header")
241
+ fn: f(() => [
242
+ m(e.$slots, "header")
232
243
  ]),
233
244
  key: "2"
234
245
  } : void 0,
235
246
  e.$slots.footer ? {
236
247
  name: "footer",
237
- fn: c(() => [
238
- d(e.$slots, "footer")
248
+ fn: f(() => [
249
+ m(e.$slots, "footer")
239
250
  ]),
240
251
  key: "3"
241
252
  } : void 0
242
- ]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : le("", !0)
253
+ ]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : fe("", !0)
243
254
  ]),
244
255
  _: 3
245
256
  }, 8, ["teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className"]),
246
- B(ie, {
247
- show: h.value,
248
- title: s.value.title,
249
- description: s.value.description,
250
- "confirm-text": s.value.confirmText,
251
- "cancel-text": s.value.cancelText,
252
- variant: s.value.variant,
253
- onConfirm: G,
254
- onCancel: J
257
+ x(pe, {
258
+ show: y.value,
259
+ title: r.value.title,
260
+ description: r.value.description,
261
+ "confirm-text": r.value.confirmText,
262
+ "cancel-text": r.value.cancelText,
263
+ variant: r.value.variant,
264
+ onConfirm: Z,
265
+ onCancel: _
255
266
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
256
267
  ], 4));
257
268
  }
258
269
  });
259
270
  export {
260
- be as default
271
+ xe as default
261
272
  };
@@ -14,8 +14,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
14
14
  onSelect?: (option: IDropdownOption) => any;
15
15
  onMouseenter?: (payload: any) => any;
16
16
  }>, {
17
- selectable: boolean;
18
17
  options: IDropdownOptions;
18
+ selectable: boolean;
19
19
  columns: number | string;
20
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
21
21
  export default _default;
@@ -49,8 +49,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
49
49
  }>, {
50
50
  class: string;
51
51
  loading: boolean;
52
- selectable: boolean;
53
52
  options: (IDropdownOption | string | number)[];
53
+ selectable: boolean;
54
54
  columns: number | string;
55
55
  cachedOptions: IDropdownOptions;
56
56
  selectedIndex: number | null;