vlite3 1.2.13 → 1.2.15

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.
@@ -1,72 +1,72 @@
1
- import { defineComponent as K, inject as R, computed as g, resolveComponent as T, openBlock as r, createBlock as f, unref as l, withCtx as A, createElementBlock as d, Fragment as L, renderList as O, isMemoSame as P, createElementVNode as y, normalizeClass as u, createVNode as i, createCommentVNode as c, withDirectives as k, withModifiers as Q, withKeys as w, vModelText as z, toDisplayString as q, vShow as G } from "vue";
1
+ import { defineComponent as A, inject as B, computed as p, resolveComponent as F, openBlock as r, createBlock as f, unref as l, withCtx as K, createElementBlock as s, Fragment as R, renderList as L, isMemoSame as O, createElementVNode as y, normalizeClass as u, createVNode as d, createCommentVNode as c, withDirectives as k, withModifiers as q, withKeys as w, vModelText as _, toDisplayString as Q, vShow as G } from "vue";
2
2
  import { VueDraggable as H } from "vue-draggable-plus";
3
3
  import C from "../Icon.vue.js";
4
4
  import m from "../Button.vue.js";
5
- import E from "../IconPicker.vue.js";
5
+ import z from "../IconPicker.vue.js";
6
6
  const J = { class: "flex items-center gap-px overflow-hidden flex-1" }, W = ["onClick"], X = { class: "flex items-center gap-1.5 overflow-hidden flex-1 w-full" }, Y = {
7
7
  key: 0,
8
8
  class: "drag-handle cursor-grab active:cursor-grabbing text-muted hover:text-foreground transition-colors p-0.5 shrink-0"
9
- }, Z = ["onUpdate:modelValue", "onChange"], ee = {
9
+ }, Z = ["onUpdate:modelValue", "placeholder", "onChange"], ee = {
10
10
  key: 0,
11
11
  class: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0 bg-background/80 px-1 rounded ml-2"
12
12
  }, te = {
13
13
  key: 0,
14
14
  class: "ml-6 pl-3 border-l border-border mt-1.5 flex flex-col relative"
15
- }, ne = {
15
+ }, le = {
16
16
  key: 1,
17
17
  class: "flex items-center gap-1.5 py-1.5 px-2 bg-background border border-border shadow-sm rounded-lg w-full mb-1.5"
18
- }, ue = /* @__PURE__ */ K({
18
+ }, oe = ["placeholder"], ce = /* @__PURE__ */ A({
19
19
  __name: "CategoryNode",
20
20
  props: {
21
21
  modelValue: {},
22
22
  level: { default: 0 }
23
23
  },
24
24
  emits: ["update:modelValue", "change", "dragEnd"],
25
- setup(V, { emit: U }) {
26
- const S = V, p = U, n = R("categoryManager"), b = g({
25
+ setup(V, { emit: E }) {
26
+ const S = V, g = E, t = B("categoryManager"), b = p({
27
27
  get: () => S.modelValue,
28
- set: (s) => p("update:modelValue", s)
29
- }), D = (s, t) => {
30
- t.children = s, p("change");
31
- }, N = () => p("change"), M = (s) => {
32
- const t = s.item?.dataset?.id;
33
- t && p("dragEnd", t);
34
- }, v = g(() => n?.readonly.value || !1), a = g(() => n?.size.value || "md"), j = g(() => a.value === "sm" ? "p-1 md:p-1.5" : a.value === "lg" ? "p-2 md:p-2.5" : "py-1.5 px-2"), I = g(() => {
35
- const t = S.level === 0 ? "font-semibold" : "font-medium";
36
- return a.value === "sm" ? `text-xs ${t} text-foreground` : a.value === "lg" ? `-text-fs-1 ${t} text-foreground` : `text-sm ${t} text-foreground`;
37
- }), h = g(() => a.value === "sm" ? "w-3.5 h-3.5" : a.value === "lg" ? "w-4.5 h-4.5" : "w-4 h-4"), B = {
38
- mounted: (s) => {
39
- setTimeout(() => s.focus(), 10);
28
+ set: (i) => g("update:modelValue", i)
29
+ }), D = (i, o) => {
30
+ o.children = i, g("change");
31
+ }, U = () => g("change"), N = (i) => {
32
+ const o = i.item?.dataset?.id;
33
+ o && g("dragEnd", o);
34
+ }, v = p(() => t?.readonly.value || !1), a = p(() => t?.size.value || "md"), M = p(() => a.value === "sm" ? "p-1 md:p-1.5" : a.value === "lg" ? "p-2 md:p-2.5" : "py-1.5 px-2"), I = p(() => {
35
+ const o = S.level === 0 ? "font-semibold" : "font-medium";
36
+ return a.value === "sm" ? `text-xs ${o} text-foreground` : a.value === "lg" ? `-text-fs-1 ${o} text-foreground` : `text-sm ${o} text-foreground`;
37
+ }), h = p(() => a.value === "sm" ? "w-3.5 h-3.5" : a.value === "lg" ? "w-4.5 h-4.5" : "w-4 h-4"), j = {
38
+ mounted: (i) => {
39
+ setTimeout(() => i.focus(), 10);
40
40
  }
41
41
  };
42
- return (s, t) => {
43
- const F = T("CategoryNode", !0);
42
+ return (i, o) => {
43
+ const P = F("CategoryNode", !0);
44
44
  return r(), f(l(H), {
45
45
  modelValue: b.value,
46
- "onUpdate:modelValue": t[11] || (t[11] = (e) => b.value = e),
46
+ "onUpdate:modelValue": o[11] || (o[11] = (e) => b.value = e),
47
47
  group: "category-manager",
48
48
  animation: 150,
49
49
  handle: ".drag-handle",
50
50
  "ghost-class": "opacity-50",
51
51
  disabled: v.value,
52
52
  class: "min-h-[2px]",
53
- onEnd: M
53
+ onEnd: N
54
54
  }, {
55
- default: A(() => [
56
- (r(!0), d(L, null, O(b.value, (e, oe, le, x) => {
57
- const $ = [
55
+ default: K(() => [
56
+ (r(!0), s(R, null, L(b.value, (e, ne, re, x) => {
57
+ const T = [
58
58
  e.id,
59
59
  e.title,
60
60
  e.icon,
61
- e.children?.map((o) => o.id).join(","),
62
- l(n)?.expandedIds.value.has(e.id),
63
- l(n)?.inlineState.value.targetId === e.id,
64
- l(n)?.inlineState.value.mode,
61
+ e.children?.map((n) => n.id).join(","),
62
+ l(t)?.expandedIds.value.has(e.id),
63
+ l(t)?.inlineState.value.targetId === e.id,
64
+ l(t)?.inlineState.value.mode,
65
65
  v.value,
66
66
  a.value
67
67
  ];
68
- if (x && x.key === e.id && P(x, $)) return x;
69
- const _ = (r(), d("div", {
68
+ if (x && x.key === e.id && O(x, T)) return x;
69
+ const $ = (r(), s("div", {
70
70
  key: e.id,
71
71
  "data-id": e.id,
72
72
  class: "mb-1.5 flex flex-col"
@@ -74,26 +74,26 @@ const J = { class: "flex items-center gap-px overflow-hidden flex-1" }, W = ["on
74
74
  y("div", {
75
75
  class: u([
76
76
  "group flex items-center justify-between rounded-lg transition-colors bg-body! border border-border ",
77
- j.value
77
+ M.value
78
78
  ])
79
79
  }, [
80
80
  y("div", J, [
81
- e.children && e.children.length > 0 ? (r(), d("button", {
81
+ e.children && e.children.length > 0 ? (r(), s("button", {
82
82
  key: 0,
83
- onClick: (o) => l(n)?.toggleExpand(e.id),
83
+ onClick: (n) => l(t)?.toggleExpand(e.id),
84
84
  class: u([
85
85
  "flex items-center justify-center shrink-0 text-muted-foreground hover:bg-muted rounded transition-colors",
86
86
  a.value === "sm" ? "w-4 h-4" : a.value === "lg" ? "w-6 h-6" : "w-6.5 h-6.5"
87
87
  ])
88
88
  }, [
89
- i(C, {
90
- icon: l(n)?.expandedIds.value.has(e.id) ? "lucide:chevron-down" : "lucide:chevron-right",
89
+ d(C, {
90
+ icon: l(t)?.expandedIds.value.has(e.id) ? "lucide:chevron-down" : "lucide:chevron-right",
91
91
  class: u(h.value)
92
92
  }, null, 8, ["icon", "class"])
93
93
  ], 10, W)) : c("", !0),
94
94
  y("div", X, [
95
- v.value ? c("", !0) : (r(), d("div", Y, [
96
- i(C, {
95
+ v.value ? c("", !0) : (r(), s("div", Y, [
96
+ d(C, {
97
97
  icon: "lucide:grip-vertical",
98
98
  class: u(h.value)
99
99
  }, null, 8, ["class"])
@@ -102,7 +102,7 @@ const J = { class: "flex items-center gap-px overflow-hidden flex-1" }, W = ["on
102
102
  key: 2,
103
103
  icon: e.icon,
104
104
  class: u([h.value, "shrink-0 text-muted-foreground"])
105
- }, null, 8, ["icon", "class"])) : c("", !0) : (r(), f(E, {
105
+ }, null, 8, ["icon", "class"])) : c("", !0) : (r(), f(z, {
106
106
  key: 1,
107
107
  value: e.icon,
108
108
  "btn-props": {
@@ -112,70 +112,70 @@ const J = { class: "flex items-center gap-px overflow-hidden flex-1" }, W = ["on
112
112
  class: (a.value === "sm" ? "h-5 w-5" : a.value === "lg" ? "h-7 w-7" : "h-6 w-6") + " -ml-0.5! p-0 text-muted-foreground hover:text-foreground shrink-0 rounded-md"
113
113
  },
114
114
  position: "bottom-start",
115
- onOnSelect: (o) => {
116
- console.log("IconPicker value :>> ", o), e.icon = o, l(n)?.saveItem(e);
115
+ onOnSelect: (n) => {
116
+ console.log("IconPicker value :>> ", n), e.icon = n, l(t)?.saveItem(e);
117
117
  }
118
118
  }, null, 8, ["value", "btn-props", "onOnSelect"])),
119
- v.value ? (r(), d("span", {
119
+ v.value ? (r(), s("span", {
120
120
  key: 4,
121
121
  class: u(["truncate", I.value])
122
- }, q(e.title), 3)) : k((r(), d("input", {
122
+ }, Q(e.title), 3)) : k((r(), s("input", {
123
123
  key: 3,
124
- "onUpdate:modelValue": (o) => e.title = o,
124
+ "onUpdate:modelValue": (n) => e.title = n,
125
125
  class: u([
126
126
  "bg-transparent border-0 outline-none focus:ring-0 px-1 py-0.5 -ml-1 transition-colors w-full truncate cursor-text min-w-0 shadow-none caret-primary",
127
127
  I.value
128
128
  ]),
129
- placeholder: "Category title...",
130
- onChange: (o) => l(n)?.saveItem(e),
131
- onKeyup: t[0] || (t[0] = w((o) => o.target.blur(), ["enter"])),
132
- onClick: t[1] || (t[1] = Q(() => {
129
+ placeholder: l(t)?.categoryTitlePlaceholderText.value || "Category title...",
130
+ onChange: (n) => l(t)?.saveItem(e),
131
+ onKeyup: o[0] || (o[0] = w((n) => n.target.blur(), ["enter"])),
132
+ onClick: o[1] || (o[1] = q(() => {
133
133
  }, ["stop"]))
134
134
  }, null, 42, Z)), [
135
- [z, e.title]
135
+ [_, e.title]
136
136
  ])
137
137
  ])
138
138
  ]),
139
- v.value ? c("", !0) : (r(), d("div", ee, [
140
- i(m, {
139
+ v.value ? c("", !0) : (r(), s("div", ee, [
140
+ d(m, {
141
141
  variant: "ghost",
142
142
  size: "xs",
143
143
  icon: "lucide:plus",
144
- title: "Quick Add Subcategory",
144
+ title: l(t)?.quickAddTooltipText.value || "Quick Add Subcategory",
145
145
  class: "h-7 w-7 px-0 text-muted-foreground hover:text-primary",
146
- onClick: (o) => l(n)?.startInline("add-child", e.id)
147
- }, null, 8, ["onClick"]),
148
- i(m, {
146
+ onClick: (n) => l(t)?.startInline("add-child", e.id)
147
+ }, null, 8, ["title", "onClick"]),
148
+ d(m, {
149
149
  variant: "ghost",
150
150
  size: "xs",
151
151
  icon: "lucide:settings",
152
- title: "Advanced Details",
152
+ title: l(t)?.advancedDetailsTooltipText.value || "Advanced Details",
153
153
  class: "h-7 w-7 px-0 text-muted-foreground hover:text-primary",
154
- onClick: (o) => l(n)?.openModalForm("edit", e)
155
- }, null, 8, ["onClick"]),
156
- i(m, {
154
+ onClick: (n) => l(t)?.openModalForm("edit", e)
155
+ }, null, 8, ["title", "onClick"]),
156
+ d(m, {
157
157
  variant: "ghost",
158
158
  size: "xs",
159
159
  icon: "lucide:trash-2",
160
- title: "Delete",
160
+ title: l(t)?.deleteTooltipText.value || "Delete",
161
161
  class: "h-7 w-7 px-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10",
162
- onClick: (o) => l(n)?.deleteItem(e)
163
- }, null, 8, ["onClick"])
162
+ onClick: (n) => l(t)?.deleteItem(e)
163
+ }, null, 8, ["title", "onClick"])
164
164
  ]))
165
165
  ], 2),
166
- e.children && e.children.length > 0 || l(n)?.inlineState.value.mode === "add-child" && l(n).inlineState.value.targetId === e.id ? k((r(), d("div", te, [
167
- e.children && e.children.length > 0 ? (r(), f(F, {
166
+ e.children && e.children.length > 0 || l(t)?.inlineState.value.mode === "add-child" && l(t).inlineState.value.targetId === e.id ? k((r(), s("div", te, [
167
+ e.children && e.children.length > 0 ? (r(), f(P, {
168
168
  key: 0,
169
169
  modelValue: e.children,
170
- "onUpdate:modelValue": (o) => D(o, e),
170
+ "onUpdate:modelValue": (n) => D(n, e),
171
171
  level: V.level + 1,
172
- onChange: N,
173
- onDragEnd: t[2] || (t[2] = (o) => p("dragEnd", o))
172
+ onChange: U,
173
+ onDragEnd: o[2] || (o[2] = (n) => g("dragEnd", n))
174
174
  }, null, 8, ["modelValue", "onUpdate:modelValue", "level"])) : c("", !0),
175
- l(n)?.inlineState.value.mode === "add-child" && l(n).inlineState.value.targetId === e.id ? (r(), d("div", ne, [
176
- i(E, {
177
- modelValue: l(n).inlineState.value.icon,
178
- "onUpdate:modelValue": t[3] || (t[3] = (o) => l(n).inlineState.value.icon = o),
175
+ l(t)?.inlineState.value.mode === "add-child" && l(t).inlineState.value.targetId === e.id ? (r(), s("div", le, [
176
+ d(z, {
177
+ modelValue: l(t).inlineState.value.icon,
178
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => l(t).inlineState.value.icon = n),
179
179
  "btn-props": {
180
180
  variant: "ghost",
181
181
  size: "xs",
@@ -184,40 +184,40 @@ const J = { class: "flex items-center gap-px overflow-hidden flex-1" }, W = ["on
184
184
  position: "bottom-start"
185
185
  }, null, 8, ["modelValue"]),
186
186
  k(y("input", {
187
- "onUpdate:modelValue": t[4] || (t[4] = (o) => l(n).inlineState.value.title = o),
187
+ "onUpdate:modelValue": o[4] || (o[4] = (n) => l(t).inlineState.value.title = n),
188
188
  class: "flex-1 bg-transparent border-0 outline-none focus:ring-0 px-1 py-0.5 text-sm transition-colors w-full shadow-none caret-primary text-foreground placeholder:text-muted-foreground",
189
- placeholder: "New subcategory title...",
189
+ placeholder: l(t)?.newSubcategoryPlaceholderText.value || "New subcategory title...",
190
190
  onKeyup: [
191
- t[5] || (t[5] = w((o) => l(n).saveInline(), ["enter"])),
192
- t[6] || (t[6] = w((o) => l(n).cancelInline(), ["esc"]))
191
+ o[5] || (o[5] = w((n) => l(t).saveInline(), ["enter"])),
192
+ o[6] || (o[6] = w((n) => l(t).cancelInline(), ["esc"]))
193
193
  ]
194
- }, null, 544), [
195
- [B],
196
- [z, l(n).inlineState.value.title]
194
+ }, null, 40, oe), [
195
+ [j],
196
+ [_, l(t).inlineState.value.title]
197
197
  ]),
198
- i(m, {
198
+ d(m, {
199
199
  variant: "primary",
200
200
  size: "xs",
201
201
  icon: "lucide:check",
202
202
  class: "shrink-0 h-6 w-6 px-0",
203
- title: "Save",
204
- onClick: t[7] || (t[7] = (o) => l(n).saveInline())
205
- }),
206
- i(m, {
203
+ title: l(t)?.saveTooltipText.value || "Save",
204
+ onClick: o[7] || (o[7] = (n) => l(t).saveInline())
205
+ }, null, 8, ["title"]),
206
+ d(m, {
207
207
  variant: "ghost",
208
208
  size: "xs",
209
209
  icon: "lucide:x",
210
210
  class: "shrink-0 h-6 w-6 px-0",
211
- title: "Cancel",
212
- onClick: t[8] || (t[8] = (o) => l(n).cancelInline())
213
- })
211
+ title: l(t)?.cancelTooltipText.value || "Cancel",
212
+ onClick: o[8] || (o[8] = (n) => l(t).cancelInline())
213
+ }, null, 8, ["title"])
214
214
  ])) : c("", !0)
215
215
  ], 512)), [
216
- [G, l(n)?.expandedIds.value.has(e.id)]
216
+ [G, l(t)?.expandedIds.value.has(e.id)]
217
217
  ]) : c("", !0)
218
218
  ], 8, ["data-id"]));
219
- return _.memo = $, _;
220
- }, t, 9), 128))
219
+ return $.memo = T, $;
220
+ }, o, 9), 128))
221
221
  ]),
222
222
  _: 1
223
223
  }, 8, ["modelValue", "disabled"]);
@@ -225,5 +225,5 @@ const J = { class: "flex items-center gap-px overflow-hidden flex-1" }, W = ["on
225
225
  }
226
226
  });
227
227
  export {
228
- ue as default
228
+ ce as default
229
229
  };
@@ -35,6 +35,40 @@ export interface CategoryManagerProps {
35
35
  emptyDescription?: string;
36
36
  /** Size modifier for the category nodes */
37
37
  size?: 'sm' | 'md' | 'lg';
38
+ emptyTitleI18n?: string;
39
+ emptyDescriptionI18n?: string;
40
+ headerTitle?: string;
41
+ headerTitleI18n?: string;
42
+ headerDescription?: string;
43
+ headerDescriptionI18n?: string;
44
+ addCategoryText?: string;
45
+ addCategoryTextI18n?: string;
46
+ createCategoryText?: string;
47
+ createCategoryTextI18n?: string;
48
+ newRootPlaceholder?: string;
49
+ newRootPlaceholderI18n?: string;
50
+ newSubcategoryPlaceholder?: string;
51
+ newSubcategoryPlaceholderI18n?: string;
52
+ categoryTitlePlaceholder?: string;
53
+ categoryTitlePlaceholderI18n?: string;
54
+ modalTitleAdd?: string;
55
+ modalTitleAddI18n?: string;
56
+ modalTitleAddChild?: string;
57
+ modalTitleAddChildI18n?: string;
58
+ modalTitleEdit?: string;
59
+ modalTitleEditI18n?: string;
60
+ modalSaveText?: string;
61
+ modalSaveTextI18n?: string;
62
+ quickAddTooltip?: string;
63
+ quickAddTooltipI18n?: string;
64
+ advancedDetailsTooltip?: string;
65
+ advancedDetailsTooltipI18n?: string;
66
+ deleteTooltip?: string;
67
+ deleteTooltipI18n?: string;
68
+ saveTooltip?: string;
69
+ saveTooltipI18n?: string;
70
+ cancelTooltip?: string;
71
+ cancelTooltipI18n?: string;
38
72
  }
39
73
  export interface InlineState {
40
74
  mode: 'add-root' | 'add-child' | null;
@@ -54,4 +88,11 @@ export interface CategoryManagerContext {
54
88
  deleteItem: (item: CategoryItem) => void;
55
89
  readonly: ComputedRef<boolean>;
56
90
  size: ComputedRef<'sm' | 'md' | 'lg'>;
91
+ newSubcategoryPlaceholderText: ComputedRef<string>;
92
+ categoryTitlePlaceholderText: ComputedRef<string>;
93
+ quickAddTooltipText: ComputedRef<string>;
94
+ advancedDetailsTooltipText: ComputedRef<string>;
95
+ deleteTooltipText: ComputedRef<string>;
96
+ saveTooltipText: ComputedRef<string>;
97
+ cancelTooltipText: ComputedRef<string>;
57
98
  }
@@ -71,7 +71,7 @@ const z = {
71
71
  }, [
72
72
  d("div", {
73
73
  class: l(["px-3.5 py-2.5 rounded-2xl break-words relative min-w-[60px] max-w-full min-w-0 overflow-hidden", [
74
- e.isSender ? "bg-primary text-primary-foreground rounded-br-sm" : "bg-muted text-foreground rounded-bl-sm"
74
+ e.isSender ? "bg-primary text-primary-foreground rounded-br-sm" : "bg-muted! text-foreground rounded-bl-sm"
75
75
  ]])
76
76
  }, [
77
77
  e.showUserInfo && e.message.senderName && !e.isSender ? (t(), i("div", A, u(e.message.senderName), 1)) : a("", !0),
@@ -184,7 +184,7 @@ const xe = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, I
184
184
  m("thead", {
185
185
  class: b([
186
186
  "[&_tr]:border-b [&_tr]:border-border",
187
- a.headerVariant === "minimal" ? "bg-transparent" : "bg-muted",
187
+ a.headerVariant === "minimal" ? "bg-transparent" : "bg-accent",
188
188
  a.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
189
189
  ])
190
190
  }, [
@@ -208,10 +208,7 @@ const xe = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, I
208
208
  "table-sortable": a.sortable,
209
209
  "cell-bordered": a.cellBordered,
210
210
  onSort: _,
211
- class: b([
212
- a.cellBordered ? "" : "last:pr-5!",
213
- re(l)
214
- ]),
211
+ class: b([a.cellBordered ? "" : "last:pr-5!", re(l)]),
215
212
  style: j(se(l))
216
213
  }, null, 8, ["header", "sort-config", "compact", "size", "table-sortable", "cell-bordered", "class", "style"]))), 128))
217
214
  ])
@@ -45,7 +45,7 @@ const j = ["tabindex", "data-disabled", "data-testid"], C = { class: "flex flex-
45
45
  key: 0,
46
46
  icon: e.option.icon,
47
47
  emoji: e.option.emoji,
48
- class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
48
+ class: "mr-2.5 h-4 w-4 shrink-0 mt-0.5"
49
49
  }, null, 8, ["icon", "emoji"])) : i("", !0),
50
50
  c("div", C, [
51
51
  c("div", S, [
@@ -9,10 +9,10 @@ const f = ["for"], m = /* @__PURE__ */ l({
9
9
  setup(t) {
10
10
  const e = t, o = a(() => [
11
11
  {
12
- xs: "-text-fs-3.5",
13
- sm: "-text-fs-3",
14
- md: "-text-fs-2",
15
- lg: "text-base"
12
+ xs: "-text-fs-3.5!",
13
+ sm: "-text-fs-3!",
14
+ md: "-text-fs-2!",
15
+ lg: "text-base!"
16
16
  }[e.size],
17
17
  "leading-none text-gray-800 block peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
18
18
  e.class
@@ -1,4 +1,4 @@
1
- import { defineComponent as F, ref as V, computed as s, watch as E, openBlock as r, createBlock as f, unref as y, withCtx as d, createSlots as U, renderSlot as b, normalizeProps as q, guardReactiveProps as G, createCommentVNode as v, createElementVNode as p, withKeys as I, withModifiers as w, normalizeClass as m, createElementBlock as g, toDisplayString as S, Fragment as T, renderList as J, createVNode as N, createTextVNode as Q } from "vue";
1
+ import { defineComponent as F, ref as V, computed as s, watch as E, openBlock as r, createBlock as f, unref as y, withCtx as d, createSlots as U, renderSlot as b, normalizeProps as q, guardReactiveProps as G, createCommentVNode as v, createElementVNode as p, withKeys as I, withModifiers as x, normalizeClass as c, createElementBlock as h, toDisplayString as S, Fragment as T, renderList as J, createVNode as N, createTextVNode as Q } from "vue";
2
2
  import M from "../Icon.vue.js";
3
3
  import W from "../Dropdown/Dropdown.vue.js";
4
4
  import X from "../Dropdown/DropdownMenu.vue.js";
@@ -43,9 +43,9 @@ const Z = ["tabindex", "data-testid"], _ = {
43
43
  if (a.placeholder) return a.placeholder;
44
44
  const e = C("vlite.multiSelect.placeholder");
45
45
  return e !== "vlite.multiSelect.placeholder" ? e : "Select items...";
46
- }), x = s(() => a.options ? a.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = V(!1), $ = V(!1);
46
+ }), w = s(() => a.options ? a.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = V(!1), $ = V(!1);
47
47
  E(
48
- x,
48
+ w,
49
49
  (e) => {
50
50
  !B.value && e.length > 0 && (B.value = !0, setTimeout(() => {
51
51
  $.value = !0, u.hydrateSelected(a.modelValue || []);
@@ -54,9 +54,9 @@ const Z = ["tabindex", "data-testid"], _ = {
54
54
  { immediate: !0 }
55
55
  );
56
56
  const k = s(() => {
57
- const e = [...x.value], l = new Set(e.map((n) => n.value ?? n.label));
58
- return u.selectedBuffer.value.forEach((n, c) => {
59
- l.has(c) || (e.unshift(n), l.add(c));
57
+ const e = [...w.value], l = new Set(e.map((n) => n.value ?? n.label));
58
+ return u.selectedBuffer.value.forEach((n, m) => {
59
+ l.has(m) || (e.unshift(n), l.add(m));
60
60
  }), e;
61
61
  }), u = Y({
62
62
  fetchSelected: a.fetchSelected,
@@ -71,15 +71,15 @@ const Z = ["tabindex", "data-testid"], _ = {
71
71
  },
72
72
  { deep: !0 }
73
73
  );
74
- const h = s(() => k.value.filter((e) => {
74
+ const g = s(() => k.value.filter((e) => {
75
75
  const l = e.value ?? e.label;
76
76
  return a.modelValue.includes(l);
77
- })), P = s(() => h.value.slice(0, a.maxVisible)), O = s(() => h.value.length - a.maxVisible), H = (e) => {
77
+ })), P = s(() => g.value.slice(0, a.maxVisible)), O = s(() => g.value.length - a.maxVisible), H = (e) => {
78
78
  if (a.disabled || a.readonly) return;
79
79
  const l = e.value ?? e.label;
80
80
  u.selectedBuffer.value.has(l) || u.selectedBuffer.value.set(l, e);
81
- const n = [...a.modelValue], c = n.indexOf(l);
82
- c === -1 ? n.push(l) : n.splice(c, 1), i("update:modelValue", n), i("change", n);
81
+ const n = [...a.modelValue], m = n.indexOf(l);
82
+ m === -1 ? n.push(l) : n.splice(m, 1), i("update:modelValue", n), i("change", n);
83
83
  }, K = (e) => {
84
84
  if (a.disabled || a.readonly) return;
85
85
  const l = a.modelValue.filter((n) => n !== e);
@@ -102,39 +102,41 @@ const Z = ["tabindex", "data-testid"], _ = {
102
102
  selectable: !0,
103
103
  searchable: !1,
104
104
  remote: !1,
105
+ "class-name": "max-h-full! px-0! py-0!",
106
+ "max-height": "100%",
105
107
  disabled: t.disabled || t.readonly
106
108
  }, {
107
109
  trigger: d(() => [
108
110
  p("div", {
109
- class: m(A.value),
111
+ class: c(A.value),
110
112
  tabindex: t.disabled || t.readonly ? -1 : 0,
111
113
  onKeydown: [
112
- l[0] || (l[0] = I(w((n) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["enter"])),
113
- l[1] || (l[1] = I(w((n) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["space"]))
114
+ l[0] || (l[0] = I(x((n) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["enter"])),
115
+ l[1] || (l[1] = I(x((n) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["space"]))
114
116
  ],
115
117
  "data-testid": e.$attrs["data-testid"] || (e.$attrs.name ? `multiselect-${e.$attrs.name}` : "multiselect")
116
118
  }, [
117
119
  p("div", {
118
- class: m(["flex gap-1.5 items-center flex-1 min-w-0", [t.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
120
+ class: c(["flex gap-1.5 items-center flex-1 min-w-0", [t.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
119
121
  }, [
120
- h.value.length === 0 ? (r(), g("span", _, S(D.value), 1)) : (r(), g(T, { key: 1 }, [
121
- (r(!0), g(T, null, J(P.value, (n) => (r(), f(L, {
122
+ g.value.length === 0 ? (r(), h("span", _, S(D.value), 1)) : (r(), h(T, { key: 1 }, [
123
+ (r(!0), h(T, null, J(P.value, (n) => (r(), f(L, {
122
124
  key: n.value,
123
125
  variant: t.variant === "transparent" ? "outline" : "secondary",
124
126
  size: z.value,
125
127
  rounded: t.rounded === "none" ? "sm" : "full",
126
- class: m(["gap-1 pr-1 truncate min-w-0 shrink", [
128
+ class: c(["gap-1 pr-1 truncate min-w-0 shrink", [
127
129
  t.wrap ? "max-w-[150px]" : "",
128
130
  t.variant === "transparent" ? "border-transparent bg-muted/50 text-foreground font-medium shadow-none" : ""
129
131
  ]])
130
132
  }, {
131
133
  default: d(() => [
132
134
  p("span", ee, S(n.labelI18n ? y(C)(n.labelI18n) : n.label), 1),
133
- t.disabled || t.readonly ? v("", !0) : (r(), g("button", {
135
+ t.disabled || t.readonly ? v("", !0) : (r(), h("button", {
134
136
  key: 0,
135
137
  type: "button",
136
- onClick: w((c) => K(n.value), ["stop"]),
137
- class: m([
138
+ onClick: x((m) => K(n.value), ["stop"]),
139
+ class: c([
138
140
  "rounded transition-colors shrink-0 flex items-center justify-center p-px",
139
141
  t.variant === "transparent" ? "text-muted-foreground hover:bg-black/10 hover:text-foreground" : "hover:bg-destructive/10 hover:text-destructive p-0.5 rounded-full"
140
142
  ])
@@ -152,7 +154,7 @@ const Z = ["tabindex", "data-testid"], _ = {
152
154
  variant: t.variant === "transparent" ? "outline" : "secondary",
153
155
  size: z.value,
154
156
  rounded: t.rounded === "none" ? "sm" : "full",
155
- class: m([
157
+ class: c([
156
158
  "shrink-0",
157
159
  t.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
158
160
  ])
@@ -164,17 +166,17 @@ const Z = ["tabindex", "data-testid"], _ = {
164
166
  }, 8, ["variant", "size", "rounded", "class"])) : v("", !0)
165
167
  ], 64))
166
168
  ], 2),
167
- t.showControls && !(t.disabled || t.readonly) ? (r(), g("div", ae, [
168
- h.value.length > 0 && !(t.disabled || t.readonly) ? (r(), f(M, {
169
+ t.showControls && !(t.disabled || t.readonly) ? (r(), h("div", ae, [
170
+ g.value.length > 0 && !(t.disabled || t.readonly) ? (r(), f(M, {
169
171
  key: 0,
170
172
  icon: "lucide:x",
171
173
  class: "w-4 h-4 hover:text-foreground transition-colors",
172
- onClick: w(R, ["stop"])
174
+ onClick: x(R, ["stop"])
173
175
  })) : v("", !0),
174
176
  l[6] || (l[6] = p("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
175
177
  N(M, {
176
178
  icon: "lucide:chevron-down",
177
- class: m(["w-4 h-4 transition-transform duration-200", { "rotate-180": o.value }])
179
+ class: c(["w-4 h-4 transition-transform duration-200", { "rotate-180": o.value }])
178
180
  }, null, 8, ["class"])
179
181
  ])) : v("", !0)
180
182
  ], 42, Z)
@@ -182,12 +184,12 @@ const Z = ["tabindex", "data-testid"], _ = {
182
184
  default: d(() => [
183
185
  t.disabled || t.readonly ? v("", !0) : (r(), f(y(X), {
184
186
  key: 0,
185
- options: x.value,
187
+ options: w.value,
186
188
  cachedOptions: k.value,
187
189
  selected: t.modelValue,
188
190
  emptyMessage: t.emptyMessage,
189
191
  searchEmptyMessage: t.searchEmptyMessage,
190
- class: "min-w-[300px]",
192
+ class: "min-w-[250px] -mx-0.5 px-2 mt-0.5",
191
193
  loading: t.loading || y(u).isHydrating.value,
192
194
  hasMore: t.hasMore,
193
195
  searchable: t.searchable,
@@ -1,7 +1,7 @@
1
1
  import o from "./PermissionEditorMatrix.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e227acf6"]]);
4
+ const s = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e8bfdc18"]]);
5
5
  export {
6
- m as default
6
+ s as default
7
7
  };