vlite3 0.6.1 → 0.6.4
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/CheckBox.vue.js +13 -12
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPaletteContent.vue2.js +2 -2
- package/components/Dropdown/Dropdown.vue.js +123 -106
- package/components/Form/Form.vue.d.ts +0 -23
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +146 -141
- package/components/Form/FormField.vue.js +6 -5
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +8 -8
- package/components/Input.vue.js +13 -13
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +66 -63
- package/components/Navbar/NavbarTabs.vue.js +3 -3
- package/components/Pagination/Pagination.vue.d.ts +2 -0
- package/components/Pagination/Pagination.vue.js +163 -118
- package/components/Pagination/index.d.ts +6 -0
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidePanel.vue.js +61 -59
- package/components/SidebarMenu/SidebarMenu.vue.js +89 -87
- package/components/SidebarMenu/SidebarMenuItem.vue.js +161 -139
- package/components/Switch.vue.js +2 -2
- package/components/Textarea.vue.js +4 -2
- package/components/Tooltip.vue.js +5 -4
- package/package.json +2 -2
- package/style.css +8 -8
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as N, ref as P, watch as
|
|
2
|
-
import
|
|
3
|
-
import { useKeyStroke as
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as N, ref as P, inject as D, watch as C, onMounted as V, onUnmounted as j, computed as c, openBlock as l, createElementBlock as i, Fragment as K, createElementVNode as m, mergeProps as g, withModifiers as M, renderSlot as d, createCommentVNode as n, createBlock as p, Teleport as F, createVNode as h, Transition as k, withCtx as w, normalizeClass as u, toDisplayString as x, resolveDynamicComponent as L } from "vue";
|
|
2
|
+
import U from "./Button.vue.js";
|
|
3
|
+
import { useKeyStroke as q } from "../composables/useKeyStroke.js";
|
|
4
|
+
import { $t as $ } from "../utils/i18n.js";
|
|
5
|
+
const G = { class: "text-lg font-bold text-foreground" }, H = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "mt-1 text-sm text-muted-foreground"
|
|
8
|
-
},
|
|
8
|
+
}, X = /* @__PURE__ */ N({
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "SidePanel",
|
|
11
11
|
props: {
|
|
@@ -29,45 +29,47 @@ const M = { class: "text-lg font-bold text-foreground" }, U = {
|
|
|
29
29
|
bodyProps: {}
|
|
30
30
|
},
|
|
31
31
|
emits: ["close", "update:show", "onOpen", "onAfterOpen", "onAfterClose"],
|
|
32
|
-
setup(t, { emit:
|
|
33
|
-
const o = t,
|
|
34
|
-
|
|
32
|
+
setup(t, { emit: B }) {
|
|
33
|
+
const o = t, y = B, s = P(o.show), r = D("dropdown-context", null);
|
|
34
|
+
C(
|
|
35
35
|
() => o.show,
|
|
36
36
|
(e) => {
|
|
37
|
-
|
|
37
|
+
s.value = e, e && (y("onOpen"), r?.close());
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
o.closeOutside &&
|
|
46
|
-
}, { onKeyStroke:
|
|
47
|
-
|
|
48
|
-
e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
49
|
-
}),
|
|
50
|
-
|
|
40
|
+
const z = () => {
|
|
41
|
+
s.value = !0, r?.close();
|
|
42
|
+
}, a = () => {
|
|
43
|
+
s.value = !1, y("update:show", !1), y("close");
|
|
44
|
+
}, A = () => {
|
|
45
|
+
o.closeOutside && a();
|
|
46
|
+
}, { onKeyStroke: O } = q();
|
|
47
|
+
O("Escape", a), C(s, (e) => {
|
|
48
|
+
r?.onChildToggle?.(e), e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
49
|
+
}), V(() => {
|
|
50
|
+
s.value && r?.onChildToggle?.(!0);
|
|
51
|
+
}), j(() => {
|
|
52
|
+
s.value && r?.onChildToggle?.(!1), document.body.style.overflow = "";
|
|
51
53
|
});
|
|
52
|
-
const
|
|
54
|
+
const I = {
|
|
53
55
|
sm: "max-w-sm",
|
|
54
56
|
md: "max-w-md",
|
|
55
57
|
lg: "max-w-lg",
|
|
56
58
|
xl: "max-w-xl",
|
|
57
59
|
full: "max-w-full"
|
|
58
|
-
},
|
|
59
|
-
() => o.descriptionI18n ?
|
|
60
|
+
}, T = c(() => o.position === "left" ? "left-0" : "right-0"), S = c(() => o.position === "left" ? "slide-left" : "slide-right"), v = c(() => o.titleI18n ? $(o.titleI18n) : o.title), b = c(
|
|
61
|
+
() => o.descriptionI18n ? $(o.descriptionI18n) : o.description
|
|
60
62
|
);
|
|
61
|
-
return (e,
|
|
62
|
-
|
|
63
|
-
onClick:
|
|
63
|
+
return (e, f) => (l(), i(K, null, [
|
|
64
|
+
m("span", g({
|
|
65
|
+
onClick: M(z, ["stop"]),
|
|
64
66
|
class: `${t.triggerClass}`
|
|
65
67
|
}, e.$attrs), [
|
|
66
|
-
|
|
67
|
-
t.body ?
|
|
68
|
+
d(e.$slots, "trigger", {}, () => [
|
|
69
|
+
t.body ? d(e.$slots, "default", { key: 0 }) : n("", !0)
|
|
68
70
|
])
|
|
69
71
|
], 16),
|
|
70
|
-
(
|
|
72
|
+
(l(), p(F, { to: "body" }, [
|
|
71
73
|
h(k, {
|
|
72
74
|
"enter-active-class": "transition-opacity duration-300 ease-out",
|
|
73
75
|
"enter-from-class": "opacity-0",
|
|
@@ -76,60 +78,60 @@ const M = { class: "text-lg font-bold text-foreground" }, U = {
|
|
|
76
78
|
"leave-from-class": "opacity-100",
|
|
77
79
|
"leave-to-class": "opacity-0"
|
|
78
80
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
|
|
81
|
+
default: w(() => [
|
|
82
|
+
s.value ? (l(), i("div", {
|
|
81
83
|
key: 0,
|
|
82
|
-
class:
|
|
83
|
-
onClick:
|
|
84
|
-
}, null, 2)) :
|
|
84
|
+
class: u(["fixed inset-0 z-50 bg-[#00000033] v-sidepanel-overlay", [t.overlayClass, { "backdrop-blur-[2px]": t.backdrop }]]),
|
|
85
|
+
onClick: A
|
|
86
|
+
}, null, 2)) : n("", !0)
|
|
85
87
|
]),
|
|
86
88
|
_: 1
|
|
87
89
|
}),
|
|
88
90
|
h(k, {
|
|
89
91
|
name: S.value,
|
|
90
|
-
onAfterEnter:
|
|
91
|
-
onAfterLeave:
|
|
92
|
+
onAfterEnter: f[0] || (f[0] = (E) => e.$emit("onAfterOpen")),
|
|
93
|
+
onAfterLeave: f[1] || (f[1] = (E) => e.$emit("onAfterClose"))
|
|
92
94
|
}, {
|
|
93
|
-
default:
|
|
94
|
-
|
|
95
|
+
default: w(() => [
|
|
96
|
+
s.value ? (l(), i("div", {
|
|
95
97
|
key: 0,
|
|
96
|
-
class:
|
|
98
|
+
class: u(["sidepanel-body fixed inset-y-0 z-50 flex flex-col bg-body shadow-sm border transition-transform duration-300 ease-in-out w-full", [I[t.size], T.value, o.class]])
|
|
97
99
|
}, [
|
|
98
|
-
|
|
100
|
+
v.value || e.$slots.header ? (l(), i("div", {
|
|
99
101
|
key: 0,
|
|
100
|
-
class:
|
|
102
|
+
class: u([t.headerClass, "flex-none flex items-center justify-between px-6 py-2 border-b border-border"])
|
|
101
103
|
}, [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
d(e.$slots, "header", {}, () => [
|
|
105
|
+
m("div", null, [
|
|
106
|
+
m("h3", G, x(v.value), 1),
|
|
107
|
+
b.value ? (l(), i("p", H, x(b.value), 1)) : n("", !0)
|
|
106
108
|
])
|
|
107
109
|
]),
|
|
108
|
-
t.hideCloseButton ?
|
|
110
|
+
t.hideCloseButton ? n("", !0) : (l(), p(U, {
|
|
109
111
|
key: 0,
|
|
110
112
|
rounded: "full",
|
|
111
113
|
size: "sm",
|
|
112
114
|
variant: "ghost",
|
|
113
115
|
icon: "lucide:x",
|
|
114
|
-
onClick:
|
|
116
|
+
onClick: a,
|
|
115
117
|
class: "-mr-2"
|
|
116
118
|
}))
|
|
117
|
-
], 2)) :
|
|
118
|
-
|
|
119
|
-
class:
|
|
119
|
+
], 2)) : n("", !0),
|
|
120
|
+
m("div", {
|
|
121
|
+
class: u(["flex-1 overflow-y-auto px-6 py-4", t.bodyClass])
|
|
120
122
|
}, [
|
|
121
|
-
t.body ? (
|
|
123
|
+
t.body ? (l(), p(L(t.body), g({ key: 0 }, { ...t.bodyProps, ...e.$attrs }, { close: a }), null, 16)) : d(e.$slots, "default", {
|
|
122
124
|
key: 1,
|
|
123
|
-
close:
|
|
125
|
+
close: a
|
|
124
126
|
})
|
|
125
127
|
], 2),
|
|
126
|
-
e.$slots.footer ? (
|
|
128
|
+
e.$slots.footer ? (l(), i("div", {
|
|
127
129
|
key: 1,
|
|
128
|
-
class:
|
|
130
|
+
class: u(["flex-none px-6 py-3 border-t border-border", t.footerClass])
|
|
129
131
|
}, [
|
|
130
|
-
|
|
131
|
-
], 2)) :
|
|
132
|
-
], 2)) :
|
|
132
|
+
d(e.$slots, "footer", { close: a })
|
|
133
|
+
], 2)) : n("", !0)
|
|
134
|
+
], 2)) : n("", !0)
|
|
133
135
|
]),
|
|
134
136
|
_: 3
|
|
135
137
|
}, 8, ["name"])
|
|
@@ -138,5 +140,5 @@ const M = { class: "text-lg font-bold text-foreground" }, U = {
|
|
|
138
140
|
}
|
|
139
141
|
});
|
|
140
142
|
export {
|
|
141
|
-
|
|
143
|
+
X as default
|
|
142
144
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as S, inject as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { useBreakpoints as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as S, inject as E, ref as T, computed as l, watch as g, reactive as N, provide as L, openBlock as C, createElementBlock as k, normalizeClass as P, Fragment as A, renderList as O, createBlock as F } from "vue";
|
|
2
|
+
import { useRoute as W } from "vue-router";
|
|
3
|
+
import { useBreakpoints as H, breakpointsTailwind as D } from "@vueuse/core";
|
|
4
|
+
import R from "./SidebarMenuItem.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
const
|
|
6
|
+
const K = /* @__PURE__ */ S({
|
|
7
7
|
__name: "SidebarMenu",
|
|
8
8
|
props: {
|
|
9
9
|
items: { default: () => [] },
|
|
@@ -15,7 +15,7 @@ const J = /* @__PURE__ */ S({
|
|
|
15
15
|
showCompactLabels: { type: Boolean, default: !1 },
|
|
16
16
|
renderMode: { default: "tree" },
|
|
17
17
|
iconSize: { default: "16px" },
|
|
18
|
-
compactIconSize: { default: "
|
|
18
|
+
compactIconSize: { default: "21px" },
|
|
19
19
|
labelClass: { default: "text-sm" },
|
|
20
20
|
compactLabelClass: { default: "text-[11.5px] mt-1" },
|
|
21
21
|
itemPadding: { default: "py-2 px-2" },
|
|
@@ -29,112 +29,114 @@ const J = /* @__PURE__ */ S({
|
|
|
29
29
|
showTooltip: { type: Boolean, default: !0 }
|
|
30
30
|
},
|
|
31
31
|
setup(m) {
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
if (
|
|
35
|
-
const a = typeof
|
|
36
|
-
if (a
|
|
37
|
-
return !0;
|
|
32
|
+
const c = E("navbar-context", null), e = m, f = W(), y = H(D), d = T([...e.defaultExpanded]), s = T(null), B = l(() => !e.mobileBreakpoint || e.mobileBreakpoint === "none" ? !0 : y.greaterOrEqual(e.mobileBreakpoint).value), v = l(() => B.value && e.orientation || "vertical"), r = (t) => t.id || (typeof t.to == "string" ? t.to : null) || t.label, M = (t, o) => {
|
|
33
|
+
if (s.value === r(t)) return !0;
|
|
34
|
+
if (t.to) {
|
|
35
|
+
const a = typeof t.to == "string" ? t.to : t.to.path;
|
|
36
|
+
if (a) {
|
|
37
|
+
if (o === a) return !0;
|
|
38
|
+
if (o.startsWith(a) && a !== "/" && a.length > 1) {
|
|
39
|
+
const i = o[a.length];
|
|
40
|
+
if (!i || i === "/" || i === "?")
|
|
41
|
+
return !0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
}
|
|
39
45
|
return !1;
|
|
40
|
-
}, b = (
|
|
41
|
-
let
|
|
42
|
-
for (const
|
|
43
|
-
const
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
(
|
|
48
|
-
|
|
49
|
-
}),
|
|
46
|
+
}, b = (t, o, a = []) => {
|
|
47
|
+
let i = !1;
|
|
48
|
+
for (const n of t) {
|
|
49
|
+
const u = r(n);
|
|
50
|
+
let p = !1;
|
|
51
|
+
n.children && (p = b(n.children, o, [...a, u]), p && (i = !0));
|
|
52
|
+
const x = M(n, o), z = p && c?.renderNestedTabs?.value && a.length === 0;
|
|
53
|
+
(x || z) && (s.value = u, a.forEach((w) => {
|
|
54
|
+
d.value.includes(w) || d.value.push(w);
|
|
55
|
+
}), i = !0);
|
|
50
56
|
}
|
|
51
|
-
return
|
|
52
|
-
},
|
|
53
|
-
if (!
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
to: e.to,
|
|
65
|
-
href: e.href
|
|
57
|
+
return i;
|
|
58
|
+
}, h = (t) => {
|
|
59
|
+
if (!c?.renderNestedTabs?.value) return;
|
|
60
|
+
const o = e.items.find((a) => s.value === r(a) ? !0 : a.children?.some((n) => s.value === r(n) || n.children && n.children.some((u) => s.value === r(u))) || M(a, t));
|
|
61
|
+
if (o && o.children) {
|
|
62
|
+
const a = o.children.map((n) => ({
|
|
63
|
+
label: n.label,
|
|
64
|
+
labelI18n: n.labelI18n,
|
|
65
|
+
value: r(n),
|
|
66
|
+
icon: n.icon,
|
|
67
|
+
disabled: n.disabled,
|
|
68
|
+
to: n.to,
|
|
69
|
+
href: n.href
|
|
66
70
|
}));
|
|
67
|
-
let
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
|
|
71
|
+
let i = a[0].value;
|
|
72
|
+
if (s.value) {
|
|
73
|
+
const n = a.find((u) => u.value === s.value);
|
|
74
|
+
if (n)
|
|
75
|
+
i = n.value;
|
|
72
76
|
else {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
));
|
|
76
|
-
o && (r = o.id || (typeof o.to == "string" ? o.to : null) || o.label);
|
|
77
|
+
const u = o.children.find((p) => p.children?.some((x) => r(x) === s.value));
|
|
78
|
+
u && (i = r(u));
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
|
-
|
|
81
|
+
c.setNestedTabs(a, i);
|
|
80
82
|
} else
|
|
81
|
-
|
|
82
|
-
(
|
|
83
|
-
) ||
|
|
83
|
+
e.items.some(
|
|
84
|
+
(i) => i.children?.some((n) => r(n) === s.value)
|
|
85
|
+
) || c.setNestedTabs([], "");
|
|
84
86
|
};
|
|
85
|
-
|
|
86
|
-
() =>
|
|
87
|
-
(
|
|
88
|
-
|
|
87
|
+
g(
|
|
88
|
+
() => f?.path,
|
|
89
|
+
(t) => {
|
|
90
|
+
t && (b(e.items, t), h(t));
|
|
89
91
|
},
|
|
90
92
|
{ immediate: !0 }
|
|
91
|
-
),
|
|
92
|
-
() =>
|
|
93
|
+
), g(
|
|
94
|
+
() => e.items,
|
|
93
95
|
() => {
|
|
94
|
-
|
|
96
|
+
f?.path && (b(e.items, f.path), h(f.path));
|
|
95
97
|
},
|
|
96
98
|
{ deep: !0 }
|
|
97
|
-
),
|
|
98
|
-
() =>
|
|
99
|
+
), g(
|
|
100
|
+
() => s.value,
|
|
99
101
|
() => {
|
|
100
|
-
|
|
102
|
+
c?.renderNestedTabs?.value && h(f?.path || "");
|
|
101
103
|
}
|
|
102
104
|
);
|
|
103
|
-
const
|
|
104
|
-
activeItem:
|
|
105
|
-
expandedItems:
|
|
106
|
-
toggleExpand: (
|
|
107
|
-
|
|
105
|
+
const I = N({
|
|
106
|
+
activeItem: s,
|
|
107
|
+
expandedItems: d,
|
|
108
|
+
toggleExpand: (t) => {
|
|
109
|
+
d.value.includes(t) ? d.value = d.value.filter((a) => a !== t) : e.allowMultiple ? d.value.push(t) : d.value = [t];
|
|
108
110
|
},
|
|
109
|
-
setActive: (
|
|
110
|
-
|
|
111
|
+
setActive: (t) => {
|
|
112
|
+
s.value = t;
|
|
111
113
|
},
|
|
112
|
-
indentSize:
|
|
113
|
-
variant:
|
|
114
|
-
renderMode:
|
|
115
|
-
renderNestedTabs:
|
|
116
|
-
compact:
|
|
117
|
-
showCompactLabels:
|
|
118
|
-
iconSize:
|
|
119
|
-
compactIconSize:
|
|
120
|
-
labelClass:
|
|
121
|
-
compactLabelClass:
|
|
122
|
-
itemPadding:
|
|
123
|
-
compactItemPadding:
|
|
124
|
-
nestedMenuWidth:
|
|
125
|
-
nestedMenuMaxHeight:
|
|
114
|
+
indentSize: l(() => e.indentSize),
|
|
115
|
+
variant: l(() => e.variant),
|
|
116
|
+
renderMode: l(() => e.renderMode || "tree"),
|
|
117
|
+
renderNestedTabs: l(() => !!c?.renderNestedTabs?.value),
|
|
118
|
+
compact: l(() => e.compact),
|
|
119
|
+
showCompactLabels: l(() => e.showCompactLabels),
|
|
120
|
+
iconSize: l(() => e.iconSize),
|
|
121
|
+
compactIconSize: l(() => e.compactIconSize),
|
|
122
|
+
labelClass: l(() => e.labelClass),
|
|
123
|
+
compactLabelClass: l(() => e.compactLabelClass),
|
|
124
|
+
itemPadding: l(() => e.itemPadding),
|
|
125
|
+
compactItemPadding: l(() => e.compactItemPadding),
|
|
126
|
+
nestedMenuWidth: l(() => e.nestedMenuWidth),
|
|
127
|
+
nestedMenuMaxHeight: l(() => e.nestedMenuMaxHeight),
|
|
126
128
|
currentOrientation: v,
|
|
127
|
-
showTooltip:
|
|
129
|
+
showTooltip: l(() => e.showTooltip)
|
|
128
130
|
});
|
|
129
|
-
return
|
|
130
|
-
class:
|
|
131
|
+
return L("sidebar-menu-ctx", I), (t, o) => (C(), k("nav", {
|
|
132
|
+
class: P(["flex w-full transition-all duration-300", [
|
|
131
133
|
v.value === "horizontal" ? "flex-row flex-wrap gap-2 items-center" : "flex-col",
|
|
132
|
-
v.value === "vertical" && !
|
|
134
|
+
v.value === "vertical" && !e.compact ? "space-y-1" : ""
|
|
133
135
|
]]),
|
|
134
136
|
role: "tree",
|
|
135
137
|
"aria-label": "Sidebar Menu"
|
|
136
138
|
}, [
|
|
137
|
-
(
|
|
139
|
+
(C(!0), k(A, null, O(m.items, (a) => (C(), F(R, {
|
|
138
140
|
key: a.id || a.label,
|
|
139
141
|
item: a,
|
|
140
142
|
itemClass: m.itemClass,
|
|
@@ -144,5 +146,5 @@ const J = /* @__PURE__ */ S({
|
|
|
144
146
|
}
|
|
145
147
|
});
|
|
146
148
|
export {
|
|
147
|
-
|
|
149
|
+
K as default
|
|
148
150
|
};
|