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.
- package/components/DataTable/DataTable.vue.js +232 -209
- package/components/DataTable/types.d.ts +15 -0
- package/components/DataTable/types.js +4 -0
- package/components/Dropdown/Dropdown.vue.js +13 -21
- package/components/Modal.vue.js +2 -2
- package/components/Modal.vue2.js +58 -56
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +0 -12
- package/components/PermissionMatrix/PermissionEditor.vue.js +120 -524
- package/components/PermissionMatrix/PermissionEditorList.vue.d.ts +18 -0
- package/components/PermissionMatrix/PermissionEditorList.vue.js +156 -0
- package/components/PermissionMatrix/PermissionEditorList.vue2.js +4 -0
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.d.ts +18 -0
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +207 -0
- package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +4 -0
- package/components/PermissionMatrix/PermissionTopBar.vue.d.ts +28 -0
- package/components/PermissionMatrix/PermissionTopBar.vue.js +132 -0
- package/components/PermissionMatrix/PermissionTopBar.vue2.js +4 -0
- package/components/PermissionMatrix/utils.d.ts +11 -0
- package/components/PermissionMatrix/utils.js +20 -0
- package/components/Screen/Screen.vue.js +113 -107
- package/components/SidePanel.vue.js +57 -53
- package/index.js +179 -177
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as J, ref as s, computed as
|
|
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 =
|
|
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 =
|
|
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
|
|
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
|
-
},
|
|
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:
|
|
116
|
+
options: h
|
|
116
117
|
}), { currentValue: P, selectedLabel: I, selectOption: R } = se(
|
|
117
118
|
D,
|
|
118
119
|
p
|
|
119
|
-
), F =
|
|
120
|
-
const e = o.ignoreClickOutside || [], l = z(
|
|
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:
|
|
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 ||
|
|
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:
|
|
204
|
+
cachedOptions: h.value,
|
|
213
205
|
class: _(n.className),
|
|
214
206
|
selected: O(P),
|
|
215
207
|
selectedIndex: n.selectedIndex,
|
package/components/Modal.vue.js
CHANGED
|
@@ -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
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-906bb006"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
package/components/Modal.vue2.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useKeyStroke as
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
32
|
-
const t = o,
|
|
33
|
-
let
|
|
34
|
-
const
|
|
35
|
-
|
|
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 && (
|
|
38
|
+
l.value = e, e && (b("onOpen"), i?.close());
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
|
-
const
|
|
42
|
-
l.value = !0,
|
|
43
|
-
},
|
|
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
|
-
|
|
48
|
-
|
|
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,
|
|
52
|
+
l.value = !1, b("update:show", !1), b("close");
|
|
53
53
|
};
|
|
54
|
-
|
|
55
|
-
const
|
|
54
|
+
V("modal-context", { close: s, setSubmitting: D });
|
|
55
|
+
const E = () => {
|
|
56
56
|
t.closeOutside && s();
|
|
57
|
-
}, { onKeyStroke:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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 &&
|
|
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 =
|
|
66
|
-
() => t.descriptionI18n ?
|
|
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,
|
|
69
|
-
|
|
70
|
-
onClick:
|
|
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
|
-
|
|
74
|
-
o.body ?
|
|
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(),
|
|
78
|
-
|
|
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:
|
|
87
|
-
l.value ? (n(),
|
|
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:
|
|
92
|
+
onClick: E
|
|
91
93
|
}, [
|
|
92
|
-
|
|
94
|
+
u("div", {
|
|
93
95
|
ref_key: "modalRef",
|
|
94
|
-
ref:
|
|
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:
|
|
99
|
+
onClick: x[0] || (x[0] = $(() => {
|
|
98
100
|
}, ["stop"]))
|
|
99
101
|
}, [
|
|
100
|
-
h.value ? (n(),
|
|
101
|
-
|
|
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
|
-
|
|
105
|
-
|
|
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":
|
|
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
|
-
])) :
|
|
115
|
-
|
|
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
|
-
|
|
119
|
-
o.body ? (n(),
|
|
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(),
|
|
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
|
-
|
|
129
|
-
], 2)) :
|
|
130
|
+
y(e.$slots, "footer", { close: s }, void 0, !0)
|
|
131
|
+
], 2)) : f("", !0)
|
|
130
132
|
], 2)
|
|
131
|
-
], 2)) :
|
|
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
|
-
|
|
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, {} & {
|