vlite3 0.6.1 → 0.6.3
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/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPaletteContent.vue2.js +2 -2
- 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/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/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/package.json +1 -1
- package/style.css +8 -8
|
@@ -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
|
};
|