vlite3 0.6.6 → 0.6.7

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,4 +1,4 @@
1
- import { defineComponent as J, ref as s, computed as h, watch as $, provide as K, reactive as Q, toRefs as W, openBlock as A, createElementBlock as X, normalizeStyle as Y, createVNode as T, unref as O, withCtx as u, renderSlot as d, createBlock as Z, normalizeClass as _, createSlots as ee, normalizeProps as M, guardReactiveProps as H, createCommentVNode as te } from "vue";
1
+ import { defineComponent as J, ref as s, computed as y, watch as $, provide as K, reactive as Q, toRefs as W, openBlock as A, createElementBlock as X, normalizeStyle as Y, createVNode as T, unref as O, withCtx as u, renderSlot as d, createBlock as Z, normalizeClass as _, createSlots as ee, normalizeProps as M, guardReactiveProps as H, createCommentVNode as te } from "vue";
2
2
  import le from "v-tooltip-lite";
3
3
  import "v-tooltip-lite/style.css";
4
4
  import ne from "./DropdownMenu.vue.js";
@@ -52,7 +52,7 @@ const pe = /* @__PURE__ */ J({
52
52
  confirmText: "Confirm",
53
53
  cancelText: "Cancel",
54
54
  variant: "primary"
55
- }), E = h(() => o.position ? o.position : o.direction === "rtl" ? "bottom-end" : "bottom-start"), L = h(() => o.nestedPosition ? o.nestedPosition : o.direction === "rtl" ? "left-start" : "right-start"), S = s(o.isOpen || !1), b = s(0);
55
+ }), E = y(() => o.position ? o.position : o.direction === "rtl" ? "bottom-end" : "bottom-start"), L = y(() => o.nestedPosition ? o.nestedPosition : o.direction === "rtl" ? "left-start" : "right-start"), S = s(o.isOpen || !1), b = s(0);
56
56
  $(
57
57
  () => o.isOpen,
58
58
  (e) => {
@@ -70,7 +70,7 @@ const pe = /* @__PURE__ */ J({
70
70
  e ? b.value++ : b.value = Math.max(0, b.value - 1);
71
71
  }
72
72
  });
73
- const w = h(() => o.options ? o.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), m = s([]);
73
+ const w = y(() => o.options ? o.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), m = s([]);
74
74
  $(
75
75
  w,
76
76
  (e) => {
@@ -83,7 +83,8 @@ const pe = /* @__PURE__ */ J({
83
83
  } else
84
84
  m.value = e;
85
85
  },
86
- { immediate: !0, deep: !0 }
86
+ { immediate: !0 }
87
+ // Performance fix: Removed deep: true to prevent heavy recursion mapping
87
88
  );
88
89
  const v = s(/* @__PURE__ */ new Map()), k = s(!1), j = async (e) => {
89
90
  if (!o.fetchSelected || e === void 0 || e === null) return;
@@ -105,29 +106,20 @@ const pe = /* @__PURE__ */ J({
105
106
  k.value = !1;
106
107
  }
107
108
  }
108
- }, y = h(() => {
109
+ }, h = y(() => {
109
110
  const e = [...m.value], l = new Set(e.map((t) => t.value ?? t.label));
110
111
  return v.value.forEach((t, i) => {
111
112
  l.has(i) || (e.unshift(t), l.add(i));
112
113
  }), e;
113
114
  }), { getAllRecursiveIds: z } = ie(), D = Q({
114
115
  ...W(o),
115
- options: y
116
+ options: h
116
117
  }), { currentValue: P, selectedLabel: I, selectOption: R } = se(
117
118
  D,
118
119
  p
119
- ), F = h(() => {
120
- const e = o.ignoreClickOutside || [], l = z(y.value);
121
- return [
122
- .../* @__PURE__ */ new Set([
123
- ...e,
124
- ...l,
125
- ".modal-body",
126
- ".v-modal-overlay",
127
- ".sidepanel-body",
128
- ".v-sidepanel-overlay"
129
- ])
130
- ];
120
+ ), F = y(() => {
121
+ const e = o.ignoreClickOutside || [], l = z(h.value);
122
+ return [.../* @__PURE__ */ new Set([...e, ...l])];
131
123
  });
132
124
  $(
133
125
  () => P.value,
@@ -160,7 +152,7 @@ const pe = /* @__PURE__ */ J({
160
152
  typeof c.onSelect == "function" && c.onSelect({
161
153
  value: a,
162
154
  option: c,
163
- data: y.value || [],
155
+ data: h.value || [],
164
156
  values: t
165
157
  });
166
158
  });
@@ -206,10 +198,10 @@ const pe = /* @__PURE__ */ J({
206
198
  ]),
207
199
  default: u(() => [
208
200
  d(e.$slots, "default"),
209
- w.value.length || y.value.length || e.$slots.menu || e.$slots.item || n.remote || n.searchable ? (A(), Z(ne, {
201
+ w.value.length || h.value.length || e.$slots.menu || e.$slots.item || n.remote || n.searchable ? (A(), Z(ne, {
210
202
  key: 0,
211
203
  options: w.value,
212
- cachedOptions: y.value,
204
+ cachedOptions: h.value,
213
205
  class: _(n.className),
214
206
  selected: O(P),
215
207
  selectedIndex: n.selectedIndex,
@@ -1,7 +1,7 @@
1
1
  import o from "./Modal.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c26acbd9"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-906bb006"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,14 +1,14 @@
1
- import { defineComponent as M, ref as f, inject as N, watch as x, provide as P, nextTick as V, onMounted as K, onUnmounted as R, computed as C, openBlock as n, createElementBlock as d, Fragment as W, createElementVNode as c, mergeProps as w, withModifiers as T, renderSlot as m, createCommentVNode as u, createBlock as $, Teleport as A, createVNode as B, Transition as F, withCtx as U, normalizeClass as a, toDisplayString as I, resolveDynamicComponent as q } from "vue";
2
- import G from "./Button.vue.js";
3
- import { useKeyStroke as H } from "../composables/useKeyStroke.js";
4
- import { $t as S } from "../utils/i18n.js";
5
- const J = {
1
+ import { defineComponent as N, ref as m, inject as P, watch as C, provide as V, nextTick as K, onMounted as R, onUnmounted as W, computed as w, openBlock as n, createElementBlock as c, Fragment as A, createElementVNode as u, mergeProps as T, withModifiers as $, renderSlot as y, createCommentVNode as f, createBlock as B, Teleport as F, createVNode as I, Transition as U, withCtx as q, normalizeClass as a, toDisplayString as S, resolveDynamicComponent as G } from "vue";
2
+ import H from "./Button.vue.js";
3
+ import { useKeyStroke as J } from "../composables/useKeyStroke.js";
4
+ import { $t as O } from "../utils/i18n.js";
5
+ const L = {
6
6
  key: 0,
7
7
  class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
8
- }, L = { class: "text-lg font-semibold leading-none tracking-tight" }, Q = {
8
+ }, Q = { class: "text-lg font-semibold leading-none tracking-tight" }, X = {
9
9
  key: 0,
10
10
  class: "text-sm text-muted-foreground mb-6.5"
11
- }, ee = /* @__PURE__ */ M({
11
+ }, oe = /* @__PURE__ */ N({
12
12
  inheritAttrs: !1,
13
13
  __name: "Modal",
14
14
  props: {
@@ -28,54 +28,56 @@ const J = {
28
28
  bodyProps: {}
29
29
  },
30
30
  emits: ["close", "update:show", "onOpen"],
31
- setup(o, { emit: O }) {
32
- const t = o, y = O, l = f(t.show), p = f(!1), b = f(!1), v = f(null);
33
- let i = null;
34
- const r = N("dropdown-context", null);
35
- x(
31
+ setup(o, { emit: j }) {
32
+ const t = o, b = j, l = m(t.show), p = m(!1), v = m(!1), g = m(null);
33
+ let r = null, d = null;
34
+ const i = P("dropdown-context", null);
35
+ C(
36
36
  () => t.show,
37
37
  (e) => {
38
- l.value = e, e && (y("onOpen"), r?.close());
38
+ l.value = e, e && (b("onOpen"), i?.close());
39
39
  }
40
40
  );
41
- const j = () => {
42
- l.value = !0, r?.close();
43
- }, z = (e) => {
41
+ const z = () => {
42
+ l.value = !0, i?.close();
43
+ }, D = (e) => {
44
44
  p.value = e;
45
45
  }, s = () => {
46
46
  if (p.value) {
47
- b.value = !0, i && clearTimeout(i), i = setTimeout(() => {
48
- b.value = !1;
47
+ v.value = !0, r && clearTimeout(r), r = setTimeout(() => {
48
+ v.value = !1;
49
49
  }, 1e3);
50
50
  return;
51
51
  }
52
- l.value = !1, y("update:show", !1), y("close");
52
+ l.value = !1, b("update:show", !1), b("close");
53
53
  };
54
- P("modal-context", { close: s, setSubmitting: z });
55
- const D = () => {
54
+ V("modal-context", { close: s, setSubmitting: D });
55
+ const E = () => {
56
56
  t.closeOutside && s();
57
- }, { onKeyStroke: E } = H();
58
- E("Escape", s), x(l, async (e) => {
59
- r?.onChildToggle?.(e), e ? (document.body.style.overflow = "hidden", await V(), v.value?.focus()) : document.body.style.overflow = "";
60
- }), K(() => {
61
- l.value && r?.onChildToggle?.(!0);
57
+ }, { onKeyStroke: M } = J();
58
+ M("Escape", s), C(l, async (e) => {
59
+ d && clearTimeout(d), e ? (i?.onChildToggle?.(!0), document.body.style.overflow = "hidden", await K(), g.value?.focus()) : (document.body.style.overflow = "", d = setTimeout(() => {
60
+ i?.onChildToggle?.(!1);
61
+ }, 200));
62
62
  }), R(() => {
63
- l.value && r?.onChildToggle?.(!1), document.body.style.overflow = "", i && clearTimeout(i);
63
+ l.value && i?.onChildToggle?.(!0);
64
+ }), W(() => {
65
+ d && clearTimeout(d), l.value && i?.onChildToggle?.(!1), document.body.style.overflow = "", r && clearTimeout(r);
64
66
  });
65
- const h = C(() => t.titleI18n ? S(t.titleI18n) : t.title), g = C(
66
- () => t.descriptionI18n ? S(t.descriptionI18n) : t.description
67
+ const h = w(() => t.titleI18n ? O(t.titleI18n) : t.title), k = w(
68
+ () => t.descriptionI18n ? O(t.descriptionI18n) : t.description
67
69
  );
68
- return (e, k) => (n(), d(W, null, [
69
- c("span", w({
70
- onClick: T(j, ["stop"]),
70
+ return (e, x) => (n(), c(A, null, [
71
+ u("span", T({
72
+ onClick: $(z, ["stop"]),
71
73
  class: `${o.triggerClass}`
72
74
  }, e.$attrs), [
73
- m(e.$slots, "trigger", {}, () => [
74
- o.body ? m(e.$slots, "default", { key: 0 }, void 0, !0) : u("", !0)
75
+ y(e.$slots, "trigger", {}, () => [
76
+ o.body ? y(e.$slots, "default", { key: 0 }, void 0, !0) : f("", !0)
75
77
  ], !0)
76
78
  ], 16),
77
- (n(), $(A, { to: "body" }, [
78
- B(F, {
79
+ (n(), B(F, { to: "body" }, [
80
+ I(U, {
79
81
  "enter-active-class": "transition duration-200 ease-out",
80
82
  "enter-from-class": "opacity-0",
81
83
  "enter-to-class": "opacity-100",
@@ -83,52 +85,52 @@ const J = {
83
85
  "leave-from-class": "opacity-100",
84
86
  "leave-to-class": "opacity-0"
85
87
  }, {
86
- default: U(() => [
87
- l.value ? (n(), d("div", {
88
+ default: q(() => [
89
+ l.value ? (n(), c("div", {
88
90
  key: 0,
89
91
  class: a(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4 v-modal-overlay", o.backdrop && "backdrop-blur-[2px]"]),
90
- onClick: D
92
+ onClick: E
91
93
  }, [
92
- c("div", {
94
+ u("div", {
93
95
  ref_key: "modalRef",
94
- ref: v,
96
+ ref: g,
95
97
  tabindex: "-1",
96
98
  class: a(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh] focus:outline-none", [o.maxWidth]]),
97
- onClick: k[0] || (k[0] = T(() => {
99
+ onClick: x[0] || (x[0] = $(() => {
98
100
  }, ["stop"]))
99
101
  }, [
100
- h.value ? (n(), d("div", J, [
101
- c("div", {
102
+ h.value ? (n(), c("div", L, [
103
+ u("div", {
102
104
  class: a(["flex items-center justify-between py-2 px-4 rounded-t-md", o.headerClass])
103
105
  }, [
104
- c("h3", L, I(h.value), 1),
105
- B(G, {
106
+ u("h3", Q, S(h.value), 1),
107
+ I(H, {
106
108
  rounded: "full",
107
109
  size: "sm",
108
110
  icon: "lucide:x",
109
111
  variant: "ghost",
110
- class: a(["hover:bg-gray-250/25! transition-all", { "blink-bg": b.value }]),
112
+ class: a(["hover:bg-gray-250/25! transition-all", { "blink-bg": v.value }]),
111
113
  onClick: s
112
114
  }, null, 8, ["class"])
113
115
  ], 2)
114
- ])) : u("", !0),
115
- c("div", {
116
+ ])) : f("", !0),
117
+ u("div", {
116
118
  class: a(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", o.bodyClass])
117
119
  }, [
118
- g.value ? (n(), d("p", Q, I(g.value), 1)) : u("", !0),
119
- o.body ? (n(), $(q(o.body), w({ key: 1 }, { ...o.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : m(e.$slots, "default", {
120
+ k.value ? (n(), c("p", X, S(k.value), 1)) : f("", !0),
121
+ o.body ? (n(), B(G(o.body), T({ key: 1 }, { ...o.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : y(e.$slots, "default", {
120
122
  key: 2,
121
123
  close: s
122
124
  }, void 0, !0)
123
125
  ], 2),
124
- e.$slots.footer ? (n(), d("div", {
126
+ e.$slots.footer ? (n(), c("div", {
125
127
  key: 1,
126
128
  class: a([o.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
127
129
  }, [
128
- m(e.$slots, "footer", { close: s }, void 0, !0)
129
- ], 2)) : u("", !0)
130
+ y(e.$slots, "footer", { close: s }, void 0, !0)
131
+ ], 2)) : f("", !0)
130
132
  ], 2)
131
- ], 2)) : u("", !0)
133
+ ], 2)) : f("", !0)
132
134
  ]),
133
135
  _: 3
134
136
  })
@@ -137,5 +139,5 @@ const J = {
137
139
  }
138
140
  });
139
141
  export {
140
- ee as default
142
+ oe as default
141
143
  };
@@ -1,27 +1,15 @@
1
1
  import { PermissionGroup, PermissionToggleMode, PermissionMatrixSize, PermissionEditorLayout, PermissionMatrixGroup } from './types';
2
2
  export interface PermissionEditorProps {
3
- /** Permission groups with nested permissions (used in list layout) */
4
3
  groups?: PermissionGroup[];
5
- /** v-model: array of selected permission keys */
6
4
  modelValue: string[];
7
- /** Toggle display mode (default: 'checkbox') */
8
5
  toggleMode?: PermissionToggleMode;
9
- /** Show search input (default: true) */
10
6
  searchable?: boolean;
11
- /** Allow collapsing groups (default: true) */
12
7
  collapsible?: boolean;
13
- /** Read-only mode (default: false) */
14
8
  readonly?: boolean;
15
- /** Size variant (default: 'md') */
16
9
  size?: PermissionMatrixSize;
17
- /** Extra CSS classes */
18
10
  class?: string;
19
- /** Group keys to show expanded by default. Others will start collapsed.
20
- * If not provided or empty, all groups start expanded. */
21
11
  defaultExpanded?: string[];
22
- /** Layout mode (default: 'list') */
23
12
  layout?: PermissionEditorLayout;
24
- /** Matrix groups — used when layout is 'matrix' */
25
13
  matrixGroups?: PermissionMatrixGroup[];
26
14
  }
27
15
  declare const _default: import('vue').DefineComponent<PermissionEditorProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {