vlite3 0.7.13 → 0.7.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.
Files changed (58) hide show
  1. package/components/Button.vue.js +1 -1
  2. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  3. package/components/ColorPicker/ColorPicker.vue.js +18 -17
  4. package/components/{CommandPaletteContent.vue.d.ts → CommandPalette/CommandPaletteContent.vue.d.ts} +3 -3
  5. package/components/CommandPalette/CommandPaletteContent.vue.js +7 -0
  6. package/components/CommandPalette/CommandPaletteContent.vue2.js +180 -0
  7. package/components/CommandPalette/CommandPaletteItem.vue.d.ts +15 -0
  8. package/components/CommandPalette/CommandPaletteItem.vue2.js +7 -0
  9. package/components/CommandPalette/CommandPaletteItem.vue3.js +60 -0
  10. package/components/CommandPalette/index.d.ts +5 -0
  11. package/components/CommandPalette/types.d.ts +40 -0
  12. package/components/CommandPalette/useCommandPaletteItems.d.ts +15 -0
  13. package/components/CommandPalette/useCommandPaletteItems.js +99 -0
  14. package/components/CommandPalette/useCommandPaletteNav.d.ts +13 -0
  15. package/components/CommandPalette/useCommandPaletteNav.js +49 -0
  16. package/components/DataList/DataList.vue.js +53 -50
  17. package/components/DataTable/DataTable.vue.js +185 -173
  18. package/components/DatePicker.vue.js +3 -2
  19. package/components/DateRangePicker.vue.js +26 -25
  20. package/components/Dropdown/Dropdown.vue.js +20 -20
  21. package/components/Dropdown/DropdownMenu.vue.js +5 -256
  22. package/components/Dropdown/DropdownMenu.vue2.js +256 -2
  23. package/components/Form/CustomFields.vue.js +1 -1
  24. package/components/Form/CustomFields.vue2.js +102 -97
  25. package/components/Form/Form.vue.d.ts +0 -1
  26. package/components/Form/Form.vue.js +2 -2
  27. package/components/Form/Form.vue2.js +20 -20
  28. package/components/Form/FormFields.vue.js +2 -2
  29. package/components/Form/FormFields.vue2.js +90 -78
  30. package/components/IconPicker.vue.js +3 -2
  31. package/components/ImportData/ImportStep2.vue.js +10 -9
  32. package/components/List/List.vue.js +205 -180
  33. package/components/Modal.vue.js +2 -2
  34. package/components/Modal.vue2.js +82 -96
  35. package/components/MultiSelect/MultiSelect.vue.js +7 -7
  36. package/components/Navbar/Navbar.vue.js +12 -12
  37. package/components/NavbarCommandPalette.vue.d.ts +7 -30
  38. package/components/NavbarCommandPalette.vue.js +40 -40
  39. package/components/PermissionMatrix/PermissionEditorList.vue.js +1 -1
  40. package/components/PermissionMatrix/PermissionEditorList.vue2.js +84 -75
  41. package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +2 -2
  42. package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +122 -107
  43. package/components/PermissionMatrix/PermissionMatrix.vue.js +2 -2
  44. package/components/PermissionMatrix/PermissionMatrix.vue2.js +161 -138
  45. package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
  46. package/components/Screen/Screen.vue.js +169 -166
  47. package/components/Screen/ScreenFilter.vue.js +4 -3
  48. package/components/SidePanel.vue.js +5 -146
  49. package/components/SidePanel.vue2.js +146 -2
  50. package/components/SidebarMenu/SidebarMenuItem.vue.js +26 -25
  51. package/components/Workbook/Sheet.vue.js +3 -2
  52. package/index.d.ts +1 -1
  53. package/index.js +1 -1
  54. package/package.json +1 -1
  55. package/style.css +1 -1
  56. package/components/CommandPaletteContent.vue.js +0 -7
  57. package/components/CommandPaletteContent.vue2.js +0 -311
  58. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,20 +1,20 @@
1
- import { defineComponent as Q, ref as L, computed as _, openBlock as n, createElementBlock as c, normalizeClass as r, createVNode as $, createCommentVNode as p, createElementVNode as i, Fragment as h, renderList as w, toDisplayString as v, createBlock as x, isMemoSame as R, withCtx as T } from "vue";
2
- import N from "../CheckBox.vue.js";
3
- import j from "../Switch.vue.js";
4
- import P from "../Icon.vue.js";
5
- import U from "../Input.vue.js";
1
+ import { defineComponent as R, ref as N, computed as S, openBlock as o, createElementBlock as r, normalizeClass as c, createVNode as B, createCommentVNode as C, createElementVNode as i, Fragment as h, renderList as V, toDisplayString as v, withMemo as T, createBlock as b, isMemoSame as U, withCtx as I } from "vue";
2
+ import j from "../CheckBox.vue.js";
3
+ import E from "../Switch.vue.js";
4
+ import M from "../Icon.vue.js";
5
+ import J from "../Input.vue.js";
6
6
  /* empty css */
7
- import I from "../Tooltip.vue.js";
8
- const J = {
7
+ import O from "../Tooltip.vue.js";
8
+ const W = {
9
9
  key: 0,
10
10
  class: "mb-4"
11
- }, O = {
11
+ }, X = {
12
12
  key: 1,
13
13
  class: "text-center py-12 text-muted-foreground"
14
- }, W = {
14
+ }, Y = {
15
15
  key: 2,
16
16
  class: "permission-matrix-wrapper border rounded-lg overflow-auto"
17
- }, X = { class: "w-full border-collapse" }, Y = { class: "bg-muted" }, Z = { class: "flex flex-col items-center gap-0.5" }, K = { class: "bg-secondary/60" }, ee = ["onClick"], te = { class: "flex items-center gap-2" }, se = ["onClick"], le = { class: "flex items-center justify-center pointer-events-none" }, ne = { class: "flex items-center gap-2 pl-6" }, oe = ["onClick"], ae = { class: "flex items-center justify-center pointer-events-none" }, ye = /* @__PURE__ */ Q({
17
+ }, Z = { class: "w-full border-collapse" }, _ = { class: "bg-muted" }, K = { class: "flex flex-col items-center gap-0.5" }, ee = ["onClick"], te = { class: "flex items-center gap-2" }, le = ["onClick"], se = { class: "flex items-center justify-center pointer-events-none" }, ne = { class: "flex items-center gap-2 pl-6" }, oe = ["onClick"], ae = { class: "flex items-center justify-center pointer-events-none" }, ye = /* @__PURE__ */ R({
18
18
  __name: "PermissionMatrix",
19
19
  props: {
20
20
  roles: {},
@@ -29,215 +29,238 @@ const J = {
29
29
  class: { default: "" }
30
30
  },
31
31
  emits: ["update:modelValue"],
32
- setup(a, { emit: E }) {
33
- const o = a, M = E, z = L(""), C = L(/* @__PURE__ */ new Set());
34
- function H(e) {
35
- if (!o.collapsible) return;
36
- const t = new Set(C.value);
37
- t.has(e) ? t.delete(e) : t.add(e), C.value = t;
32
+ setup(n, { emit: H }) {
33
+ const a = n, G = H, $ = N(""), g = N(/* @__PURE__ */ new Set());
34
+ function q(s) {
35
+ if (!a.collapsible) return;
36
+ const l = new Set(g.value);
37
+ l.has(s) ? l.delete(s) : l.add(s), g.value = l;
38
38
  }
39
- const G = _(() => {
40
- if (!z.value.trim()) return o.groups;
41
- const e = z.value.toLowerCase();
42
- return o.groups.map((t) => {
43
- const l = t.permissions.filter(
44
- (s) => s.label.toLowerCase().includes(e) || s.key.toLowerCase().includes(e) || t.label.toLowerCase().includes(e)
39
+ const L = S(() => {
40
+ if (!$.value.trim()) return a.groups;
41
+ const s = $.value.toLowerCase();
42
+ return a.groups.map((l) => {
43
+ const t = l.permissions.filter(
44
+ (e) => e.label.toLowerCase().includes(s) || e.key.toLowerCase().includes(s) || l.label.toLowerCase().includes(s)
45
45
  );
46
- return l.length === 0 ? null : { ...t, permissions: l };
46
+ return t.length === 0 ? null : { ...l, permissions: t };
47
47
  }).filter(Boolean);
48
- }), V = _(() => {
49
- const e = /* @__PURE__ */ new Map();
50
- for (const t of o.roles)
51
- e.set(t.key, new Set(o.modelValue[t.key] || []));
52
- return e;
48
+ }), p = S(() => {
49
+ const s = /* @__PURE__ */ new Map();
50
+ for (const l of a.roles)
51
+ s.set(l.key, new Set(a.modelValue[l.key] || []));
52
+ return s;
53
53
  });
54
- function B(e, t) {
55
- return V.value.get(e)?.has(t) ?? !1;
54
+ function P(s, l) {
55
+ return p.value.get(s)?.has(l) ?? !1;
56
56
  }
57
- function q(e, t) {
58
- if (o.readonly || o.roles.find((y) => y.key === e)?.locked) return;
59
- const s = o.modelValue[e] || [], k = V.value.get(e)?.has(t) ? s.filter((y) => y !== t) : [...s, t];
60
- M("update:modelValue", { ...o.modelValue, [e]: k });
57
+ function A(s, l) {
58
+ if (a.readonly || a.roles.find((y) => y.key === s)?.locked) return;
59
+ const e = a.modelValue[s] || [], k = p.value.get(s)?.has(l) ? e.filter((y) => y !== l) : [...e, l];
60
+ G("update:modelValue", { ...a.modelValue, [s]: k });
61
61
  }
62
- function S(e, t) {
63
- const l = V.value.get(e);
64
- if (!l) return "none";
65
- let s = 0;
66
- for (const k of t.permissions)
67
- l.has(k.key) && s++;
68
- return s === 0 ? "none" : s === t.permissions.length ? "all" : "indeterminate";
62
+ function w(s, l) {
63
+ const t = p.value.get(s);
64
+ if (!t) return "none";
65
+ let e = 0;
66
+ for (const k of l.permissions)
67
+ t.has(k.key) && e++;
68
+ return e === 0 ? "none" : e === l.permissions.length ? "all" : "indeterminate";
69
69
  }
70
- function A(e, t) {
71
- if (o.readonly || o.roles.find((f) => f.key === e)?.locked) return;
72
- const s = S(e, t), k = V.value.get(e) ?? /* @__PURE__ */ new Set(), y = o.modelValue[e] || [];
70
+ function D(s, l) {
71
+ if (a.readonly || a.roles.find((f) => f.key === s)?.locked) return;
72
+ const e = w(s, l), k = p.value.get(s) ?? /* @__PURE__ */ new Set(), y = a.modelValue[s] || [];
73
73
  let m;
74
- if (s === "all") {
75
- const f = new Set(t.permissions.map((d) => d.key));
76
- m = y.filter((d) => !f.has(d));
74
+ if (e === "all") {
75
+ const f = new Set(l.permissions.map((u) => u.key));
76
+ m = y.filter((u) => !f.has(u));
77
77
  } else {
78
- const f = t.permissions.filter((d) => !k.has(d.key)).map((d) => d.key);
78
+ const f = l.permissions.filter((u) => !k.has(u.key)).map((u) => u.key);
79
79
  m = [...y, ...f];
80
80
  }
81
- M("update:modelValue", { ...o.modelValue, [e]: m });
81
+ G("update:modelValue", { ...a.modelValue, [s]: m });
82
82
  }
83
- const b = _(() => o.size === "sm" ? "px-2 py-1" : "px-3 py-2"), g = _(() => o.size === "sm" ? "text-xs" : "text-sm");
84
- function D(e) {
85
- return o.modelValue[e]?.length || 0;
83
+ const x = S(() => a.size === "sm" ? "px-2 py-1" : "px-3 py-2"), z = S(() => a.size === "sm" ? "text-xs" : "text-sm");
84
+ function F(s) {
85
+ return a.modelValue[s]?.length || 0;
86
86
  }
87
- function F() {
88
- return o.groups.reduce((e, t) => e + t.permissions.length, 0);
87
+ function Q() {
88
+ return a.groups.reduce((s, l) => s + l.permissions.length, 0);
89
89
  }
90
- return (e, t) => (n(), c("div", {
91
- class: r(["permission-matrix", o.class])
90
+ return (s, l) => (o(), r("div", {
91
+ class: c(["permission-matrix", a.class])
92
92
  }, [
93
- a.searchable ? (n(), c("div", J, [
94
- $(U, {
95
- modelValue: z.value,
96
- "onUpdate:modelValue": t[0] || (t[0] = (l) => z.value = l),
93
+ n.searchable ? (o(), r("div", W, [
94
+ B(J, {
95
+ modelValue: $.value,
96
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => $.value = t),
97
97
  placeholder: "Search permissions...",
98
98
  icon: "lucide:search",
99
- size: a.size,
99
+ size: n.size,
100
100
  "show-clear-button": ""
101
101
  }, null, 8, ["modelValue", "size"])
102
- ])) : p("", !0),
103
- G.value.length === 0 ? (n(), c("div", O, [
104
- $(P, {
102
+ ])) : C("", !0),
103
+ L.value.length === 0 ? (o(), r("div", X, [
104
+ B(M, {
105
105
  icon: "lucide:search-x",
106
106
  class: "w-8 h-8 mx-auto mb-3 opacity-50"
107
107
  }),
108
108
  i("p", {
109
- class: r(g.value)
109
+ class: c(z.value)
110
110
  }, "No permissions match your search.", 2)
111
- ])) : (n(), c("div", W, [
112
- i("table", X, [
111
+ ])) : (o(), r("div", Y, [
112
+ i("table", Z, [
113
113
  i("thead", {
114
- class: r(a.stickyHeader ? "sticky top-0 z-10" : "")
114
+ class: c(n.stickyHeader ? "sticky top-0 z-10" : "")
115
115
  }, [
116
- i("tr", Y, [
116
+ i("tr", _, [
117
117
  i("th", {
118
- class: r([
119
- b.value,
120
- g.value,
118
+ class: c([
119
+ x.value,
120
+ z.value,
121
121
  "text-left font-semibold text-foreground min-w-[220px] sm:min-w-[260px] bg-muted border-b"
122
122
  ])
123
123
  }, " Permission ", 2),
124
- (n(!0), c(h, null, w(a.roles, (l) => (n(), c("th", {
125
- key: l.key,
126
- class: r([b.value, "text-center border-b border-l bg-muted min-w-[100px]"])
124
+ (o(!0), r(h, null, V(n.roles, (t) => (o(), r("th", {
125
+ key: t.key,
126
+ class: c([x.value, "text-center border-b border-l bg-muted min-w-[100px]"])
127
127
  }, [
128
- i("div", Z, [
128
+ i("div", K, [
129
129
  i("span", {
130
- class: r([g.value, "font-semibold text-foreground whitespace-nowrap"])
131
- }, v(l.label), 3),
130
+ class: c([z.value, "font-semibold text-foreground whitespace-nowrap"])
131
+ }, v(t.label), 3),
132
132
  i("span", {
133
- class: r([o.size === "sm" ? "text-[10px]" : "text-xs", "text-muted-foreground"])
134
- }, v(D(l.key)) + "/" + v(F()), 3)
133
+ class: c([
134
+ a.size === "sm" ? "text-[10px]" : "text-xs",
135
+ "text-muted-foreground"
136
+ ])
137
+ }, v(F(t.key)) + "/" + v(Q()), 3)
135
138
  ])
136
139
  ], 2))), 128))
137
140
  ])
138
141
  ], 2),
139
142
  i("tbody", null, [
140
- (n(!0), c(h, null, w(G.value, (l) => (n(), c(h, {
141
- key: l.key
143
+ (o(!0), r(h, null, V(L.value, (t) => (o(), r(h, {
144
+ key: t.key
142
145
  }, [
143
- i("tr", K, [
146
+ T([
147
+ g.value.has(t.key),
148
+ n.collapsible,
149
+ n.size,
150
+ n.toggleMode,
151
+ n.readonly,
152
+ t.label,
153
+ t.icon,
154
+ t.permissions.length,
155
+ ...n.roles.map((e) => `${e.key}-${w(e.key, t)}-${e.locked}`)
156
+ ], () => (o(), r("tr", { class: "bg-secondary/60" }, [
144
157
  i("td", {
145
- class: r([b.value, "border-b cursor-pointer select-none"]),
146
- onClick: (s) => H(l.key)
158
+ class: c([x.value, "border-b cursor-pointer select-none"]),
159
+ onClick: (e) => q(t.key)
147
160
  }, [
148
161
  i("div", te, [
149
- a.collapsible ? (n(), x(P, {
162
+ n.collapsible ? (o(), b(M, {
150
163
  key: 0,
151
164
  icon: "lucide:chevron-right",
152
- class: r(["w-3.5 h-3.5 transition-transform duration-200 text-muted-foreground", { "rotate-90": !C.value.has(l.key) }])
153
- }, null, 8, ["class"])) : p("", !0),
154
- l.icon ? (n(), x(P, {
165
+ class: c(["w-3.5 h-3.5 transition-transform duration-200 text-muted-foreground", { "rotate-90": !g.value.has(t.key) }])
166
+ }, null, 8, ["class"])) : C("", !0),
167
+ t.icon ? (o(), b(M, {
155
168
  key: 1,
156
- icon: l.icon,
169
+ icon: t.icon,
157
170
  class: "w-3.5 h-3.5 text-muted-foreground"
158
- }, null, 8, ["icon"])) : p("", !0),
171
+ }, null, 8, ["icon"])) : C("", !0),
159
172
  i("span", {
160
- class: r([g.value, "font-semibold text-foreground"])
161
- }, v(l.label), 3),
173
+ class: c([z.value, "font-semibold text-foreground"])
174
+ }, v(t.label), 3),
162
175
  i("span", {
163
- class: r([o.size === "sm" ? "text-[10px]" : "text-xs", "text-muted-foreground ml-1"])
164
- }, " (" + v(l.permissions.length) + ") ", 3)
176
+ class: c([
177
+ a.size === "sm" ? "text-[10px]" : "text-xs",
178
+ "text-muted-foreground ml-1"
179
+ ])
180
+ }, " (" + v(t.permissions.length) + ") ", 3)
165
181
  ])
166
182
  ], 10, ee),
167
- (n(!0), c(h, null, w(a.roles, (s) => (n(), c("td", {
168
- key: s.key,
169
- class: r([b.value, "text-center border-b border-l cursor-pointer"]),
170
- onClick: (k) => A(s.key, l)
183
+ (o(!0), r(h, null, V(n.roles, (e) => (o(), r("td", {
184
+ key: e.key,
185
+ class: c([x.value, "text-center border-b border-l cursor-pointer"]),
186
+ onClick: (k) => D(e.key, t)
171
187
  }, [
172
- i("div", le, [
173
- a.toggleMode === "checkbox" ? (n(), x(N, {
188
+ i("div", se, [
189
+ n.toggleMode === "checkbox" ? (o(), b(j, {
174
190
  key: 0,
175
- "model-value": S(s.key, l) === "all",
176
- indeterminate: S(s.key, l) === "indeterminate",
177
- disabled: a.readonly || s.locked,
178
- size: a.size === "sm" ? "xs" : "sm"
179
- }, null, 8, ["model-value", "indeterminate", "disabled", "size"])) : (n(), x(j, {
191
+ "model-value": w(e.key, t) === "all",
192
+ indeterminate: w(e.key, t) === "indeterminate",
193
+ disabled: n.readonly || e.locked,
194
+ size: n.size === "sm" ? "xs" : "sm"
195
+ }, null, 8, ["model-value", "indeterminate", "disabled", "size"])) : (o(), b(E, {
180
196
  key: 1,
181
- "model-value": S(s.key, l) === "all",
182
- disabled: a.readonly || s.locked
197
+ "model-value": w(e.key, t) === "all",
198
+ disabled: n.readonly || e.locked
183
199
  }, null, 8, ["model-value", "disabled"]))
184
200
  ])
185
- ], 10, se))), 128))
186
- ]),
187
- C.value.has(l.key) ? p("", !0) : (n(!0), c(h, { key: 0 }, w(l.permissions, (s, k, y, m) => {
188
- const f = [...a.roles.map((u) => B(u.key, s.key)), a.readonly];
189
- if (m && m.key === s.key && R(m, f)) return m;
190
- const d = (n(), c("tr", {
191
- key: s.key,
201
+ ], 10, le))), 128))
202
+ ])), l, 1),
203
+ g.value.has(t.key) ? C("", !0) : (o(!0), r(h, { key: 0 }, V(t.permissions, (e, k, y, m) => {
204
+ const f = [
205
+ n.readonly,
206
+ n.size,
207
+ n.toggleMode,
208
+ e.label,
209
+ e.description,
210
+ ...n.roles.map((d) => `${d.key}-${P(d.key, e.key)}-${d.locked}`)
211
+ ];
212
+ if (m && m.key === e.key && U(m, f)) return m;
213
+ const u = (o(), r("tr", {
214
+ key: e.key,
192
215
  class: "hover:bg-accent/40 transition-colors duration-100"
193
216
  }, [
194
217
  i("td", {
195
- class: r([b.value, "border-b"])
218
+ class: c([x.value, "border-b"])
196
219
  }, [
197
220
  i("div", ne, [
198
221
  i("span", {
199
- class: r([g.value, "text-foreground"])
200
- }, v(s.label), 3),
201
- s.description ? (n(), x(I, {
222
+ class: c([z.value, "text-foreground"])
223
+ }, v(e.label), 3),
224
+ e.description ? (o(), b(O, {
202
225
  key: 0,
203
- content: s.description,
226
+ content: e.description,
204
227
  placement: "top"
205
228
  }, {
206
- default: T(() => [
207
- $(P, {
229
+ default: I(() => [
230
+ B(M, {
208
231
  icon: "lucide:info",
209
232
  class: "w-3 h-3 text-muted-foreground cursor-auto shrink-0"
210
233
  })
211
234
  ]),
212
235
  _: 1
213
- }, 8, ["content"])) : p("", !0)
236
+ }, 8, ["content"])) : C("", !0)
214
237
  ])
215
238
  ], 2),
216
- (n(!0), c(h, null, w(a.roles, (u) => (n(), c("td", {
217
- key: u.key,
218
- class: r([
219
- b.value,
239
+ (o(!0), r(h, null, V(n.roles, (d) => (o(), r("td", {
240
+ key: d.key,
241
+ class: c([
242
+ x.value,
220
243
  "text-center border-b border-l",
221
- !a.readonly && !u.locked ? "cursor-pointer" : ""
244
+ !n.readonly && !d.locked ? "cursor-pointer" : ""
222
245
  ]),
223
- onClick: (ie) => q(u.key, s.key)
246
+ onClick: (ie) => A(d.key, e.key)
224
247
  }, [
225
248
  i("div", ae, [
226
- a.toggleMode === "checkbox" ? (n(), x(N, {
249
+ n.toggleMode === "checkbox" ? (o(), b(j, {
227
250
  key: 0,
228
- "model-value": B(u.key, s.key),
229
- disabled: a.readonly || u.locked,
230
- size: a.size === "sm" ? "xs" : "sm"
231
- }, null, 8, ["model-value", "disabled", "size"])) : (n(), x(j, {
251
+ "model-value": P(d.key, e.key),
252
+ disabled: n.readonly || d.locked,
253
+ size: n.size === "sm" ? "xs" : "sm"
254
+ }, null, 8, ["model-value", "disabled", "size"])) : (o(), b(E, {
232
255
  key: 1,
233
- "model-value": B(u.key, s.key),
234
- disabled: a.readonly || u.locked
256
+ "model-value": P(d.key, e.key),
257
+ disabled: n.readonly || d.locked
235
258
  }, null, 8, ["model-value", "disabled"]))
236
259
  ])
237
260
  ], 10, oe))), 128))
238
261
  ]));
239
- return d.memo = f, d;
240
- }, t, 1), 128))
262
+ return u.memo = f, u;
263
+ }, l, 2), 128))
241
264
  ], 64))), 128))
242
265
  ])
243
266
  ])
@@ -1,10 +1,11 @@
1
- import { defineComponent as w, computed as k, openBlock as l, createElementBlock as n, createElementVNode as r, createVNode as c, createCommentVNode as i, unref as C, withCtx as f, withModifiers as G, createBlock as $, toDisplayString as a, normalizeClass as u } from "vue";
1
+ import { defineComponent as w, computed as k, openBlock as l, createElementBlock as n, createElementVNode as s, createVNode as c, createCommentVNode as i, unref as C, withCtx as f, withModifiers as G, createBlock as $, toDisplayString as a, normalizeClass as u } from "vue";
2
2
  import z from "../Input.vue.js";
3
3
  /* empty css */
4
4
  import h from "../Icon.vue.js";
5
5
  import K from "../CheckBox.vue.js";
6
6
  import B from "../Dropdown/Dropdown.vue.js";
7
7
  import "../../core/config.js";
8
+ /* empty css */
8
9
  const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3 mb-4" }, V = { class: "flex items-center gap-2 flex-1 w-full sm:max-w-lg" }, A = {
9
10
  key: 0,
10
11
  class: "flex-1"
@@ -14,7 +15,7 @@ const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3
14
15
  }, N = ["onClick"], P = { class: "text-sm" }, U = {
15
16
  key: 0,
16
17
  class: "border-t px-3 py-1.5"
17
- }, E = { class: "flex items-center gap-3 ml-auto" }, H = /* @__PURE__ */ w({
18
+ }, E = { class: "flex items-center gap-3 ml-auto" }, I = /* @__PURE__ */ w({
18
19
  __name: "PermissionTopBar",
19
20
  props: {
20
21
  searchQuery: {},
@@ -29,18 +30,18 @@ const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3
29
30
  emits: ["update:searchQuery", "update:selectedGroupKeys", "selectAll", "clearAll"],
30
31
  setup(e, { emit: g }) {
31
32
  const x = e, d = g, m = k(() => x.size === "sm" ? "text-xs" : "text-sm");
32
- function y(s) {
33
- const t = x.selectedGroupKeys, o = t.includes(s) ? t.filter((p) => p !== s) : [...t, s];
33
+ function y(r) {
34
+ const t = x.selectedGroupKeys, o = t.includes(r) ? t.filter((p) => p !== r) : [...t, r];
34
35
  d("update:selectedGroupKeys", o);
35
36
  }
36
37
  function v() {
37
38
  d("update:selectedGroupKeys", []);
38
39
  }
39
- function b(s) {
40
- d("update:searchQuery", String(s));
40
+ function b(r) {
41
+ d("update:searchQuery", String(r));
41
42
  }
42
- return (s, t) => (l(), n("div", S, [
43
- r("div", V, [
43
+ return (r, t) => (l(), n("div", S, [
44
+ s("div", V, [
44
45
  e.searchable ? (l(), n("div", A, [
45
46
  c(z, {
46
47
  "model-value": e.searchQuery,
@@ -58,7 +59,7 @@ const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3
58
59
  position: "bottom-end"
59
60
  }, {
60
61
  trigger: f(() => [
61
- r("button", {
62
+ s("button", {
62
63
  type: "button",
63
64
  class: u([
64
65
  "inline-flex items-center gap-1.5 border rounded-md cursor-pointer transition-colors",
@@ -70,12 +71,12 @@ const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3
70
71
  icon: "lucide:filter",
71
72
  class: "w-3.5 h-3.5"
72
73
  }),
73
- t[2] || (t[2] = r("span", { class: "hidden sm:inline" }, "Modules", -1)),
74
+ t[2] || (t[2] = s("span", { class: "hidden sm:inline" }, "Modules", -1)),
74
75
  e.selectedGroupKeys.length > 0 ? (l(), n("span", Q, a(e.selectedGroupKeys.length), 1)) : i("", !0)
75
76
  ], 2)
76
77
  ]),
77
78
  item: f(({ option: o }) => [
78
- r("div", {
79
+ s("div", {
79
80
  class: "flex items-center gap-2 w-full cursor-pointer hover:bg-accent rounded-md",
80
81
  onClick: G((p) => y(o.value), ["stop"])
81
82
  }, [
@@ -89,12 +90,12 @@ const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3
89
90
  icon: o.icon,
90
91
  class: "w-3.5 h-3.5 text-muted-foreground"
91
92
  }, null, 8, ["icon"])) : i("", !0),
92
- r("span", P, a(o.label), 1)
93
+ s("span", P, a(o.label), 1)
93
94
  ], 8, N)
94
95
  ]),
95
96
  footer: f(() => [
96
97
  e.selectedGroupKeys.length > 0 ? (l(), n("div", U, [
97
- r("button", {
98
+ s("button", {
98
99
  type: "button",
99
100
  class: "text-xs text-muted-foreground hover:text-foreground cursor-pointer",
100
101
  onClick: v
@@ -104,15 +105,15 @@ const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3
104
105
  _: 1
105
106
  }, 8, ["options"])
106
107
  ]),
107
- r("div", E, [
108
- r("span", {
108
+ s("div", E, [
109
+ s("span", {
109
110
  class: u([m.value, "text-muted-foreground whitespace-nowrap"])
110
111
  }, a(e.selectedCount) + " / " + a(e.totalPerms) + " selected ", 3),
111
112
  e.readonly ? i("", !0) : (l(), n("button", {
112
113
  key: 0,
113
114
  type: "button",
114
115
  class: u([m.value, "text-primary hover:underline whitespace-nowrap cursor-pointer"]),
115
- onClick: t[0] || (t[0] = (o) => s.$emit("selectAll"))
116
+ onClick: t[0] || (t[0] = (o) => r.$emit("selectAll"))
116
117
  }, " Select All ", 2)),
117
118
  !e.readonly && e.selectedCount > 0 ? (l(), n("button", {
118
119
  key: 1,
@@ -121,12 +122,12 @@ const S = { class: "flex flex-col sm:flex-row items-start sm:items-center gap-3
121
122
  m.value,
122
123
  "text-muted-foreground hover:text-foreground hover:underline whitespace-nowrap cursor-pointer"
123
124
  ]),
124
- onClick: t[1] || (t[1] = (o) => s.$emit("clearAll"))
125
+ onClick: t[1] || (t[1] = (o) => r.$emit("clearAll"))
125
126
  }, " Clear ", 2)) : i("", !0)
126
127
  ])
127
128
  ]));
128
129
  }
129
130
  });
130
131
  export {
131
- H as default
132
+ I as default
132
133
  };