vlite3 0.4.6 → 0.4.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/Accordion/AccordionItem.vue.js +33 -32
- package/components/Accordion/types.d.ts +2 -0
- package/components/Alert.vue.d.ts +2 -0
- package/components/Alert.vue.js +38 -36
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
- package/components/Button.vue.d.ts +1 -1
- package/components/Button.vue.js +37 -35
- package/components/CheckBox.vue.d.ts +1 -0
- package/components/CheckBox.vue.js +40 -40
- package/components/Chip/Chip.vue.js +55 -55
- package/components/Chip/types.d.ts +1 -0
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
- package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
- package/components/ColorPicker/ColorPicker.vue.js +3 -2
- package/components/ConfirmationModal.vue.d.ts +4 -2
- package/components/ConfirmationModal.vue.js +48 -33
- package/components/DataList/DataList.vue.d.ts +0 -2
- package/components/DataList/DataList.vue.js +39 -35
- package/components/DataList/types.d.ts +2 -0
- package/components/DataTable/DataTable.vue.d.ts +0 -5
- package/components/DataTable/DataTable.vue.js +177 -158
- package/components/DataTable/DataTableHeader.vue.js +15 -14
- package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
- package/components/DataTable/DataTableToolbar.vue.js +30 -23
- package/components/DataTable/types.d.ts +4 -0
- package/components/DatePicker.vue.d.ts +1 -0
- package/components/DatePicker.vue.js +32 -25
- package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
- package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
- package/components/Dropdown/DropdownItem.vue.js +24 -23
- package/components/Dropdown/DropdownMenu.vue.js +100 -91
- package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
- package/components/Dropdown/composables/useDropdownSelection.js +19 -17
- package/components/Empty/Empty.vue.d.ts +2 -2
- package/components/Empty/Empty.vue.js +32 -18
- package/components/FilePicker/FilePicker.vue.d.ts +3 -1
- package/components/FilePicker/FilePicker.vue.js +140 -127
- package/components/FileTree/FileTree.vue.js +68 -58
- package/components/FileTree/FileTreeNode.vue.js +35 -34
- package/components/FileTree/types.d.ts +3 -0
- package/components/Form/CustomFields.vue.d.ts +3 -1
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +92 -80
- package/components/Form/Form.vue.d.ts +1 -1
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Form/FormField.vue.js +60 -59
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +58 -57
- package/components/Form/composables/useForm.js +84 -79
- package/components/Form/types.d.ts +4 -0
- package/components/GoogleLogin.vue.d.ts +1 -1
- package/components/GoogleLogin.vue.js +39 -32
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/IconPicker.vue.d.ts +2 -0
- package/components/IconPicker.vue.js +37 -29
- package/components/Input.vue.d.ts +1 -1
- package/components/Input.vue.js +96 -98
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +55 -54
- package/components/Kanban/types.d.ts +1 -0
- package/components/Masonry/Masonry.vue2.js +3 -2
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +62 -57
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/MultiSelect/MultiSelect.vue.js +61 -54
- package/components/Navbar/Navbar.vue.js +46 -46
- package/components/Pagination/Pagination.vue.js +116 -97
- package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
- package/components/PricingPlan/types.d.ts +5 -0
- package/components/Screen/Screen.vue.d.ts +0 -4
- package/components/Screen/Screen.vue.js +231 -189
- package/components/Screen/ScreenFilter.vue.js +73 -63
- package/components/Screen/types.d.ts +5 -0
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +140 -5
- package/components/SidePanel.vue2.js +2 -135
- package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
- package/components/SidebarMenu/types.d.ts +1 -0
- package/components/Slider.vue.d.ts +1 -0
- package/components/Slider.vue.js +71 -69
- package/components/Switch.vue.d.ts +1 -0
- package/components/Switch.vue.js +23 -18
- package/components/Tabes/Tabes.vue.js +20 -19
- package/components/Tabes/types.d.ts +1 -0
- package/components/Textarea.vue.d.ts +1 -0
- package/components/Textarea.vue.js +18 -16
- package/components/ThemeToggle.vue.js +24 -14
- package/components/Timeline.vue.js +68 -82
- package/components/ToastNotification.vue.js +2 -2
- package/components/Tooltip.vue.d.ts +4 -3
- package/components/Tooltip.vue.js +17 -15
- package/components/Workbook/Sheet.vue.js +80 -71
- package/components/Workbook/WorkbookAddButton.vue.js +14 -10
- package/components/Workbook/types.d.ts +1 -0
- package/core/config.d.ts +2 -0
- package/index.d.ts +1 -0
- package/index.js +28 -26
- package/package.json +1 -1
- package/style.css +1 -2
- package/types/button.d.ts +1 -0
- package/types/config.type.d.ts +10 -0
- package/types/form.type.d.ts +2 -0
- package/types/styles.d.ts +3 -0
- package/types/timeline.type.d.ts +2 -0
- package/utils/i18n.d.ts +8 -0
- package/utils/i18n.js +5 -0
- package/utils/index.d.ts +1 -0
package/components/Modal.vue.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useKeyStroke as
|
|
4
|
-
|
|
1
|
+
import { defineComponent as O, ref as S, watch as b, provide as z, onUnmounted as D, computed as p, openBlock as l, createElementBlock as a, Fragment as E, createElementVNode as n, mergeProps as v, withModifiers as h, renderSlot as c, createCommentVNode as i, createBlock as g, Teleport as N, createVNode as x, Transition as P, withCtx as T, normalizeClass as d, toDisplayString as k, resolveDynamicComponent as V } from "vue";
|
|
2
|
+
import j from "./Button.vue.js";
|
|
3
|
+
import { useKeyStroke as K } from "../composables/useKeyStroke.js";
|
|
4
|
+
import { $t as C } from "../utils/i18n.js";
|
|
5
|
+
const M = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
|
|
7
|
-
},
|
|
8
|
+
}, W = { class: "text-lg font-semibold leading-none tracking-tight" }, A = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "text-sm text-muted-foreground mb-6.5"
|
|
10
|
-
},
|
|
11
|
+
}, H = /* @__PURE__ */ O({
|
|
11
12
|
inheritAttrs: !1,
|
|
12
13
|
__name: "Modal",
|
|
13
14
|
props: {
|
|
14
15
|
show: { type: Boolean, default: !1 },
|
|
15
16
|
title: {},
|
|
17
|
+
titleI18n: {},
|
|
16
18
|
maxWidth: { default: "sm:max-w-lg" },
|
|
17
19
|
closeOutside: { type: Boolean, default: !0 },
|
|
18
20
|
backdrop: { type: Boolean, default: !0 },
|
|
19
21
|
description: {},
|
|
22
|
+
descriptionI18n: {},
|
|
20
23
|
triggerClass: {},
|
|
21
24
|
bodyClass: {},
|
|
22
25
|
headerClass: {},
|
|
@@ -25,38 +28,40 @@ const D = {
|
|
|
25
28
|
bodyProps: {}
|
|
26
29
|
},
|
|
27
30
|
emits: ["close", "update:show", "onOpen"],
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
() =>
|
|
32
|
-
(
|
|
33
|
-
|
|
31
|
+
setup(t, { emit: w }) {
|
|
32
|
+
const o = t, u = w, r = S(o.show);
|
|
33
|
+
b(
|
|
34
|
+
() => o.show,
|
|
35
|
+
(e) => {
|
|
36
|
+
r.value = e, e && u("onOpen");
|
|
34
37
|
}
|
|
35
38
|
);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
39
|
+
const $ = () => {
|
|
40
|
+
r.value = !0;
|
|
41
|
+
}, s = () => {
|
|
42
|
+
r.value = !1, u("update:show", !1), u("close");
|
|
40
43
|
};
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
}, { onKeyStroke:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}),
|
|
44
|
+
z("modal-context", { close: s });
|
|
45
|
+
const B = () => {
|
|
46
|
+
o.closeOutside && s();
|
|
47
|
+
}, { onKeyStroke: I } = K();
|
|
48
|
+
I("Escape", s), b(r, (e) => {
|
|
49
|
+
e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
50
|
+
}), D(() => {
|
|
48
51
|
document.body.style.overflow = "";
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
});
|
|
53
|
+
const f = p(() => o.titleI18n ? C(o.titleI18n) : o.title), m = p(() => o.descriptionI18n ? C(o.descriptionI18n) : o.description);
|
|
54
|
+
return (e, y) => (l(), a(E, null, [
|
|
55
|
+
n("span", v({
|
|
56
|
+
onClick: h($, ["stop"]),
|
|
57
|
+
class: `${t.triggerClass}`
|
|
58
|
+
}, e.$attrs), [
|
|
59
|
+
c(e.$slots, "trigger", {}, () => [
|
|
60
|
+
t.body ? c(e.$slots, "default", { key: 0 }) : i("", !0)
|
|
56
61
|
])
|
|
57
62
|
], 16),
|
|
58
|
-
(
|
|
59
|
-
|
|
63
|
+
(l(), g(N, { to: "body" }, [
|
|
64
|
+
x(P, {
|
|
60
65
|
"enter-active-class": "transition duration-200 ease-out",
|
|
61
66
|
"enter-from-class": "opacity-0",
|
|
62
67
|
"enter-to-class": "opacity-100",
|
|
@@ -64,49 +69,49 @@ const D = {
|
|
|
64
69
|
"leave-from-class": "opacity-100",
|
|
65
70
|
"leave-to-class": "opacity-0"
|
|
66
71
|
}, {
|
|
67
|
-
default:
|
|
68
|
-
|
|
72
|
+
default: T(() => [
|
|
73
|
+
r.value ? (l(), a("div", {
|
|
69
74
|
key: 0,
|
|
70
|
-
class: d(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4",
|
|
71
|
-
onClick:
|
|
75
|
+
class: d(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", t.backdrop && "backdrop-blur-[2px]"]),
|
|
76
|
+
onClick: B
|
|
72
77
|
}, [
|
|
73
|
-
|
|
74
|
-
class: d(["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]", [
|
|
75
|
-
onClick:
|
|
78
|
+
n("div", {
|
|
79
|
+
class: d(["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]", [t.maxWidth]]),
|
|
80
|
+
onClick: y[0] || (y[0] = h(() => {
|
|
76
81
|
}, ["stop"]))
|
|
77
82
|
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class: d(["flex items-center justify-between py-2 px-4 rounded-t-md",
|
|
83
|
+
f.value ? (l(), a("div", M, [
|
|
84
|
+
n("div", {
|
|
85
|
+
class: d(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
|
|
81
86
|
}, [
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
n("h3", W, k(f.value), 1),
|
|
88
|
+
x(j, {
|
|
84
89
|
rounded: "full",
|
|
85
90
|
size: "sm",
|
|
86
91
|
icon: "lucide:x",
|
|
87
92
|
variant: "ghost",
|
|
88
93
|
class: "hover:bg-gray-250/25!",
|
|
89
|
-
onClick:
|
|
94
|
+
onClick: s
|
|
90
95
|
})
|
|
91
96
|
], 2)
|
|
92
|
-
])) :
|
|
93
|
-
|
|
94
|
-
class: d(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0",
|
|
97
|
+
])) : i("", !0),
|
|
98
|
+
n("div", {
|
|
99
|
+
class: d(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", t.bodyClass])
|
|
95
100
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
m.value ? (l(), a("p", A, k(m.value), 1)) : i("", !0),
|
|
102
|
+
t.body ? (l(), g(V(t.body), v({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : c(e.$slots, "default", {
|
|
98
103
|
key: 2,
|
|
99
|
-
close:
|
|
104
|
+
close: s
|
|
100
105
|
})
|
|
101
106
|
], 2),
|
|
102
|
-
|
|
107
|
+
e.$slots.footer ? (l(), a("div", {
|
|
103
108
|
key: 1,
|
|
104
|
-
class: d([
|
|
109
|
+
class: d([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
|
|
105
110
|
}, [
|
|
106
|
-
|
|
107
|
-
], 2)) :
|
|
111
|
+
c(e.$slots, "footer", { close: s })
|
|
112
|
+
], 2)) : i("", !0)
|
|
108
113
|
], 2)
|
|
109
|
-
], 2)) :
|
|
114
|
+
], 2)) : i("", !0)
|
|
110
115
|
]),
|
|
111
116
|
_: 3
|
|
112
117
|
})
|
|
@@ -115,5 +120,5 @@ const D = {
|
|
|
115
120
|
}
|
|
116
121
|
});
|
|
117
122
|
export {
|
|
118
|
-
|
|
123
|
+
H as default
|
|
119
124
|
};
|
|
@@ -3,6 +3,7 @@ interface Props {
|
|
|
3
3
|
modelValue?: any[];
|
|
4
4
|
options?: IDropdownOptions;
|
|
5
5
|
placeholder?: string;
|
|
6
|
+
placeholderI18n?: string;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
searchable?: boolean;
|
|
8
9
|
variant?: 'default' | 'outline' | 'solid';
|
|
@@ -26,7 +27,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
26
27
|
}>, {
|
|
27
28
|
disabled: boolean;
|
|
28
29
|
size: "sm" | "md" | "lg";
|
|
29
|
-
placeholder: string;
|
|
30
30
|
variant: "default" | "outline" | "solid";
|
|
31
31
|
modelValue: any[];
|
|
32
32
|
loading: boolean;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as j, ref as E, computed as i, openBlock as s, createBlock as m, unref as v, withCtx as f, createVNode as h, createElementVNode as d, normalizeClass as w, createElementBlock as p, toDisplayString as b, Fragment as k, renderList as L, withModifiers as C, createCommentVNode as g, createTextVNode as A } from "vue";
|
|
2
|
+
import x from "../Icon.vue.js";
|
|
3
|
+
import D from "../Dropdown/Dropdown.vue.js";
|
|
4
|
+
import F from "../Dropdown/DropdownMenu.vue.js";
|
|
5
|
+
import { $t as y } from "../../utils/i18n.js";
|
|
6
|
+
import $ from "../Badge.vue.js";
|
|
7
|
+
const P = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }, T = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "text-muted-foreground pl-1"
|
|
9
|
-
}, U = { class: "truncate" }, q = ["onClick"], G = { class: "flex items-center gap-2 pl-2 shrink-0 text-muted-foreground" },
|
|
10
|
+
}, U = { class: "truncate" }, q = ["onClick"], G = { class: "flex items-center gap-2 pl-2 shrink-0 text-muted-foreground" }, Y = /* @__PURE__ */ j({
|
|
10
11
|
__name: "MultiSelect",
|
|
11
12
|
props: {
|
|
12
13
|
modelValue: { default: () => [] },
|
|
13
14
|
options: { default: () => [] },
|
|
14
|
-
placeholder: {
|
|
15
|
+
placeholder: {},
|
|
16
|
+
placeholderI18n: {},
|
|
15
17
|
disabled: { type: Boolean, default: !1 },
|
|
16
18
|
searchable: { type: Boolean, default: !0 },
|
|
17
19
|
variant: { default: "outline" },
|
|
@@ -23,51 +25,56 @@ const F = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }
|
|
|
23
25
|
layout: { default: "default" }
|
|
24
26
|
},
|
|
25
27
|
emits: ["update:modelValue", "change", "load-more", "search"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
28
|
+
setup(o, { emit: S }) {
|
|
29
|
+
const t = o, r = S, u = E(!1), B = i(() => {
|
|
30
|
+
if (t.placeholderI18n) return y(t.placeholderI18n);
|
|
31
|
+
if (t.placeholder) return t.placeholder;
|
|
32
|
+
const a = y("vlite.multiSelect.placeholder");
|
|
33
|
+
return a !== "vlite.multiSelect.placeholder" ? a : "Select items...";
|
|
34
|
+
}), c = i(() => t.options.filter((a) => {
|
|
28
35
|
const e = a.value ?? a.label;
|
|
29
|
-
return
|
|
30
|
-
})),
|
|
31
|
-
const e = a.value ?? a.label,
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
const e =
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
},
|
|
36
|
+
return t.modelValue.includes(e);
|
|
37
|
+
})), O = i(() => c.value.slice(0, t.maxVisible)), V = i(() => c.value.length - t.maxVisible), M = (a) => {
|
|
38
|
+
const e = a.value ?? a.label, l = [...t.modelValue], n = l.indexOf(e);
|
|
39
|
+
n === -1 ? l.push(e) : l.splice(n, 1), r("update:modelValue", l), r("change", l);
|
|
40
|
+
}, I = (a) => {
|
|
41
|
+
const e = t.modelValue.filter((l) => l !== a);
|
|
42
|
+
r("update:modelValue", e), r("change", e);
|
|
43
|
+
}, N = () => {
|
|
44
|
+
r("update:modelValue", []), r("change", []);
|
|
45
|
+
}, z = i(() => [
|
|
39
46
|
"flex items-center justify-between w-full px-3 py-1.5 rounded-md border text-sm transition-colors cursor-pointer",
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
t.disabled ? "opacity-50 cursor-not-allowed bg-muted" : "bg-background hover:bg-gray-50/70",
|
|
48
|
+
t.variant === "outline" ? "border-input" : "border-transparent bg-muted",
|
|
42
49
|
u.value ? "border-primary/20" : ""
|
|
43
50
|
].join(" "));
|
|
44
|
-
return i(() =>
|
|
51
|
+
return i(() => t.size === "sm" ? "xs" : "sm"), (a, e) => (s(), m(v(D), {
|
|
45
52
|
isOpen: u.value,
|
|
46
|
-
"onUpdate:isOpen": e[3] || (e[3] = (
|
|
53
|
+
"onUpdate:isOpen": e[3] || (e[3] = (l) => u.value = l),
|
|
47
54
|
"close-on-select": !1,
|
|
48
55
|
selectable: !0,
|
|
49
|
-
disabled:
|
|
56
|
+
disabled: o.disabled
|
|
50
57
|
}, {
|
|
51
|
-
trigger: f(({ isOpen:
|
|
58
|
+
trigger: f(({ isOpen: l }) => [
|
|
52
59
|
d("div", {
|
|
53
|
-
class:
|
|
60
|
+
class: w(z.value)
|
|
54
61
|
}, [
|
|
55
|
-
d("div",
|
|
56
|
-
c.value.length === 0 ? (
|
|
57
|
-
(
|
|
58
|
-
key:
|
|
62
|
+
d("div", P, [
|
|
63
|
+
c.value.length === 0 ? (s(), p("span", T, b(B.value), 1)) : (s(), p(k, { key: 1 }, [
|
|
64
|
+
(s(!0), p(k, null, L(O.value, (n) => (s(), m($, {
|
|
65
|
+
key: n.value,
|
|
59
66
|
variant: "secondary",
|
|
60
67
|
class: "gap-1 pr-1 truncate max-w-[150px]"
|
|
61
68
|
}, {
|
|
62
69
|
default: f(() => [
|
|
63
|
-
d("span", U, b(
|
|
64
|
-
|
|
70
|
+
d("span", U, b(n.labelI18n ? v(y)(n.labelI18n) : n.label), 1),
|
|
71
|
+
o.disabled ? g("", !0) : (s(), p("button", {
|
|
65
72
|
key: 0,
|
|
66
73
|
type: "button",
|
|
67
|
-
onClick:
|
|
74
|
+
onClick: C((H) => I(n.value), ["stop"]),
|
|
68
75
|
class: "hover:bg-destructive/10 hover:text-destructive rounded-full p-0.5 transition-colors"
|
|
69
76
|
}, [
|
|
70
|
-
|
|
77
|
+
h(x, {
|
|
71
78
|
icon: "lucide:x",
|
|
72
79
|
class: "w-3 h-3"
|
|
73
80
|
})
|
|
@@ -75,47 +82,47 @@ const F = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }
|
|
|
75
82
|
]),
|
|
76
83
|
_: 2
|
|
77
84
|
}, 1024))), 128)),
|
|
78
|
-
|
|
85
|
+
V.value > 0 ? (s(), m($, {
|
|
79
86
|
key: 0,
|
|
80
87
|
variant: "secondary",
|
|
81
88
|
class: "font-normal text-muted-foreground"
|
|
82
89
|
}, {
|
|
83
90
|
default: f(() => [
|
|
84
|
-
|
|
91
|
+
A(" +" + b(V.value), 1)
|
|
85
92
|
]),
|
|
86
93
|
_: 1
|
|
87
94
|
})) : g("", !0)
|
|
88
95
|
], 64))
|
|
89
96
|
]),
|
|
90
97
|
d("div", G, [
|
|
91
|
-
c.value.length > 0 && !
|
|
98
|
+
c.value.length > 0 && !o.disabled ? (s(), m(x, {
|
|
92
99
|
key: 0,
|
|
93
100
|
icon: "lucide:x",
|
|
94
101
|
class: "w-4 h-4 hover:text-foreground transition-colors",
|
|
95
|
-
onClick:
|
|
102
|
+
onClick: C(N, ["stop"])
|
|
96
103
|
})) : g("", !0),
|
|
97
104
|
e[4] || (e[4] = d("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
|
|
98
|
-
|
|
105
|
+
h(x, {
|
|
99
106
|
icon: "lucide:chevron-down",
|
|
100
|
-
class:
|
|
107
|
+
class: w(["w-4 h-4 transition-transform duration-200", { "rotate-180": l }])
|
|
101
108
|
}, null, 8, ["class"])
|
|
102
109
|
])
|
|
103
110
|
], 2)
|
|
104
111
|
]),
|
|
105
112
|
default: f(() => [
|
|
106
|
-
v(
|
|
107
|
-
options:
|
|
108
|
-
selected:
|
|
113
|
+
h(v(F), {
|
|
114
|
+
options: o.options,
|
|
115
|
+
selected: o.modelValue,
|
|
109
116
|
class: "min-w-[300px]",
|
|
110
|
-
loading:
|
|
111
|
-
hasMore:
|
|
112
|
-
searchable:
|
|
113
|
-
remote:
|
|
114
|
-
layout:
|
|
115
|
-
onSelect:
|
|
116
|
-
onClose: e[0] || (e[0] = (
|
|
117
|
-
onLoadMore: e[1] || (e[1] = (
|
|
118
|
-
onSearch: e[2] || (e[2] = (
|
|
117
|
+
loading: o.loading,
|
|
118
|
+
hasMore: o.hasMore,
|
|
119
|
+
searchable: o.searchable,
|
|
120
|
+
remote: o.remote,
|
|
121
|
+
layout: o.layout,
|
|
122
|
+
onSelect: M,
|
|
123
|
+
onClose: e[0] || (e[0] = (l) => u.value = !1),
|
|
124
|
+
onLoadMore: e[1] || (e[1] = (l) => a.$emit("load-more")),
|
|
125
|
+
onSearch: e[2] || (e[2] = (l) => a.$emit("search", l))
|
|
119
126
|
}, null, 8, ["options", "selected", "loading", "hasMore", "searchable", "remote", "layout"])
|
|
120
127
|
]),
|
|
121
128
|
_: 1
|
|
@@ -123,5 +130,5 @@ const F = { class: "flex flex-wrap gap-1.5 items-center flex-1 min-w-0 py-0.5" }
|
|
|
123
130
|
}
|
|
124
131
|
});
|
|
125
132
|
export {
|
|
126
|
-
|
|
133
|
+
Y as default
|
|
127
134
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as R, ref as g, useSlots as V, onMounted as L, onUnmounted as N, computed as p, provide as
|
|
1
|
+
import { defineComponent as R, ref as g, useSlots as V, onMounted as L, onUnmounted as N, computed as p, provide as E, watch as C, openBlock as t, createElementBlock as n, normalizeClass as i, Fragment as x, createElementVNode as r, renderSlot as o, createVNode as B, createBlock as y, resolveDynamicComponent as P, withCtx as k, createCommentVNode as d, toDisplayString as A, createTextVNode as D } from "vue";
|
|
2
2
|
import { useRoute as H } from "vue-router";
|
|
3
3
|
import { onClickOutside as U, useBreakpoints as F, breakpointsTailwind as Y } from "@vueuse/core";
|
|
4
4
|
import T from "../Icon.vue.js";
|
|
@@ -37,7 +37,7 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
37
37
|
mobileMenuVariant: { default: "sidepanel" }
|
|
38
38
|
},
|
|
39
39
|
emits: ["toggle-mobile"],
|
|
40
|
-
setup(m, { emit:
|
|
40
|
+
setup(m, { emit: se }) {
|
|
41
41
|
const l = m, a = g(!1), b = g(!1);
|
|
42
42
|
V();
|
|
43
43
|
const w = g(null), h = g(null);
|
|
@@ -57,7 +57,7 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
57
57
|
window.removeEventListener("scroll", $);
|
|
58
58
|
});
|
|
59
59
|
const z = p(() => {
|
|
60
|
-
const e = l.variant === "sidebar",
|
|
60
|
+
const e = l.variant === "sidebar", s = {
|
|
61
61
|
fixed: "fixed top-0 left-0 z-40",
|
|
62
62
|
sticky: "sticky top-0 z-40",
|
|
63
63
|
relative: "relative z-10",
|
|
@@ -69,9 +69,9 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
69
69
|
b.value && !l.floating && !e && l.position === "sticky" ? "shadow-sm" : ""
|
|
70
70
|
];
|
|
71
71
|
let c = "";
|
|
72
|
-
return e ? c = u.value.sidebarLayout : c = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${l.height}`, [f,
|
|
72
|
+
return e ? c = u.value.sidebarLayout : c = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${l.height}`, [f, s[l.position], ...v, c, l.class].join(" ");
|
|
73
73
|
}), u = p(() => {
|
|
74
|
-
const e = l.mobileBreakpoint || "md",
|
|
74
|
+
const e = l.mobileBreakpoint || "md", s = {
|
|
75
75
|
sm: "sm:hidden",
|
|
76
76
|
md: "md:hidden",
|
|
77
77
|
lg: "lg:hidden",
|
|
@@ -98,13 +98,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
98
98
|
xl: "hidden xl:flex flex-col h-full w-full overflow-hidden"
|
|
99
99
|
};
|
|
100
100
|
return {
|
|
101
|
-
mobileTrigger:
|
|
101
|
+
mobileTrigger: s[e],
|
|
102
102
|
desktopContent: f[e],
|
|
103
103
|
sidebarLayout: v[e],
|
|
104
104
|
mobileHeader: c[e],
|
|
105
105
|
desktopSidebar: O[e]
|
|
106
106
|
};
|
|
107
|
-
}),
|
|
107
|
+
}), M = p(() => {
|
|
108
108
|
if (l.variant === "sidebar") return "flex-1 py-4 overflow-y-auto";
|
|
109
109
|
switch (l.centerPosition) {
|
|
110
110
|
case "left":
|
|
@@ -115,12 +115,12 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
115
115
|
return `${u.value.desktopContent} items-center justify-center mx-auto`;
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
E("navbar-context", {
|
|
119
119
|
compact: p(() => l.compact)
|
|
120
120
|
});
|
|
121
|
-
const
|
|
121
|
+
const S = H();
|
|
122
122
|
C(
|
|
123
|
-
() =>
|
|
123
|
+
() => S.path,
|
|
124
124
|
() => {
|
|
125
125
|
a.value = !1;
|
|
126
126
|
}
|
|
@@ -128,13 +128,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
128
128
|
const j = F(Y).greater(l.mobileBreakpoint);
|
|
129
129
|
return C(j, (e) => {
|
|
130
130
|
e && (a.value = !1);
|
|
131
|
-
}), (e,
|
|
131
|
+
}), (e, s) => (t(), n("nav", {
|
|
132
132
|
class: i(z.value),
|
|
133
133
|
role: "navigation"
|
|
134
134
|
}, [
|
|
135
135
|
m.variant === "header" ? (t(), n(x, { key: 0 }, [
|
|
136
136
|
r("div", I, [
|
|
137
|
-
|
|
137
|
+
o(e.$slots, "mobile-trigger", {
|
|
138
138
|
isOpen: a.value,
|
|
139
139
|
toggle: () => a.value = !a.value
|
|
140
140
|
}, () => [
|
|
@@ -143,21 +143,21 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
143
143
|
ref_key: "mobileTriggerRef",
|
|
144
144
|
ref: h,
|
|
145
145
|
class: i(["p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0", [u.value.mobileTrigger, l.mobileTriggerClass]]),
|
|
146
|
-
onClick:
|
|
146
|
+
onClick: s[0] || (s[0] = (f) => a.value = !a.value)
|
|
147
147
|
}, [
|
|
148
148
|
B(T, {
|
|
149
149
|
icon: "lucide:menu",
|
|
150
150
|
class: "w-5 h-5"
|
|
151
151
|
}),
|
|
152
|
-
|
|
152
|
+
s[3] || (s[3] = r("span", { class: "sr-only" }, "Open Menu", -1))
|
|
153
153
|
], 2)
|
|
154
154
|
]),
|
|
155
155
|
e.$slots?.logo ? (t(), n("div", {
|
|
156
156
|
key: 0,
|
|
157
157
|
class: i(["shrink-0", l.logoClass])
|
|
158
158
|
}, [
|
|
159
|
-
|
|
160
|
-
(t(), y(
|
|
159
|
+
o(e.$slots, "logo", {}, () => [
|
|
160
|
+
(t(), y(P(l.logo ? "img" : "div"), {
|
|
161
161
|
src: l.logo,
|
|
162
162
|
class: "h-8 w-auto font-bold text-xl flex items-center gap-2"
|
|
163
163
|
}, {
|
|
@@ -176,19 +176,19 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
176
176
|
key: 1,
|
|
177
177
|
class: i(["items-center gap-1 overflow-x-auto no-scrollbar mask-gradient", u.value.desktopContent])
|
|
178
178
|
}, [
|
|
179
|
-
|
|
179
|
+
o(e.$slots, "left")
|
|
180
180
|
], 2)) : d("", !0)
|
|
181
181
|
]),
|
|
182
182
|
e.$slots?.center ? (t(), n("div", {
|
|
183
183
|
key: 0,
|
|
184
184
|
class: i([
|
|
185
|
-
|
|
185
|
+
M.value,
|
|
186
186
|
// Width constraint to ensure it doesn't crush others, but allows simple resizing
|
|
187
187
|
"max-w-full",
|
|
188
188
|
l.contentClass
|
|
189
189
|
])
|
|
190
190
|
}, [
|
|
191
|
-
|
|
191
|
+
o(e.$slots, "center")
|
|
192
192
|
], 2)) : d("", !0),
|
|
193
193
|
r("div", {
|
|
194
194
|
class: i(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", [
|
|
@@ -203,16 +203,16 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
203
203
|
l.rightClass
|
|
204
204
|
]])
|
|
205
205
|
}, [
|
|
206
|
-
|
|
206
|
+
o(e.$slots, "right")
|
|
207
207
|
], 2)
|
|
208
208
|
], 64)) : (t(), n(x, { key: 1 }, [
|
|
209
209
|
r("div", {
|
|
210
210
|
class: i(u.value.mobileHeader)
|
|
211
211
|
}, [
|
|
212
|
-
e.$slots?.logo ?
|
|
213
|
-
|
|
212
|
+
e.$slots?.logo ? o(e.$slots, "logo", { key: 0 }, () => [
|
|
213
|
+
s[4] || (s[4] = r("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
|
|
214
214
|
]) : d("", !0),
|
|
215
|
-
|
|
215
|
+
o(e.$slots, "mobile-trigger", {
|
|
216
216
|
isOpen: a.value,
|
|
217
217
|
toggle: () => a.value = !a.value
|
|
218
218
|
}, () => [
|
|
@@ -221,13 +221,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
221
221
|
ref_key: "mobileTriggerRef",
|
|
222
222
|
ref: h,
|
|
223
223
|
class: i(["p-2 -mr-2 text-muted-foreground hover:bg-accent rounded-md", l.mobileTriggerClass]),
|
|
224
|
-
onClick:
|
|
224
|
+
onClick: s[1] || (s[1] = (f) => a.value = !a.value)
|
|
225
225
|
}, [
|
|
226
226
|
B(T, {
|
|
227
227
|
icon: "lucide:menu",
|
|
228
228
|
class: "w-5 h-5"
|
|
229
229
|
}),
|
|
230
|
-
|
|
230
|
+
s[5] || (s[5] = r("span", { class: "sr-only" }, "Open Menu", -1))
|
|
231
231
|
], 2)
|
|
232
232
|
])
|
|
233
233
|
], 2),
|
|
@@ -238,22 +238,22 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
238
238
|
key: 0,
|
|
239
239
|
class: i(["py-4.5 flex items-center px-4.5 z-10", l.logoClass])
|
|
240
240
|
}, [
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
o(e.$slots, "logo", {}, () => [
|
|
242
|
+
s[6] || (s[6] = r("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
|
|
243
243
|
])
|
|
244
244
|
], 2)) : d("", !0),
|
|
245
245
|
r("div", {
|
|
246
246
|
class: i(["flex-1 px-2.5 pt-0 pb-4 overflow-y-auto space-y-4 scrollbar-thin", l.contentClass])
|
|
247
247
|
}, [
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
o(e.$slots, "left"),
|
|
249
|
+
o(e.$slots, "default"),
|
|
250
|
+
o(e.$slots, "center")
|
|
251
251
|
], 2),
|
|
252
252
|
e.$slots?.right ? (t(), n("div", {
|
|
253
253
|
key: 1,
|
|
254
254
|
class: i(["p-2 border-t border-border shrink-0 bg-background mt-auto", l.rightClass])
|
|
255
255
|
}, [
|
|
256
|
-
|
|
256
|
+
o(e.$slots, "right")
|
|
257
257
|
], 2)) : d("", !0)
|
|
258
258
|
], 2)
|
|
259
259
|
], 64)),
|
|
@@ -265,13 +265,13 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
265
265
|
class: i(["absolute top-[calc(100%_+_1px)] left-0 w-full bg-body border border-border/50 shadow-xl z-50 flex flex-col transition-all duration-300 origin-top overflow-hidden will-change-transform", l.menuClass])
|
|
266
266
|
}, [
|
|
267
267
|
r("div", Q, [
|
|
268
|
-
|
|
268
|
+
o(e.$slots, "mobile-menu", {}, () => [
|
|
269
269
|
r("div", W, [
|
|
270
|
-
|
|
270
|
+
o(e.$slots, "left")
|
|
271
271
|
]),
|
|
272
|
-
|
|
272
|
+
s[7] || (s[7] = r("div", { class: "h-px bg-border/50 my-1 mx-2" }, null, -1)),
|
|
273
273
|
r("div", X, [
|
|
274
|
-
|
|
274
|
+
o(e.$slots, "center")
|
|
275
275
|
])
|
|
276
276
|
])
|
|
277
277
|
])
|
|
@@ -279,7 +279,7 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
279
279
|
], 64)) : (t(), y(q, {
|
|
280
280
|
key: 3,
|
|
281
281
|
show: a.value,
|
|
282
|
-
"onUpdate:show":
|
|
282
|
+
"onUpdate:show": s[2] || (s[2] = (f) => a.value = f),
|
|
283
283
|
position: "left",
|
|
284
284
|
size: "sm",
|
|
285
285
|
triggerClass: u.value.mobileTrigger,
|
|
@@ -288,25 +288,25 @@ const I = { class: "flex items-center gap-4 shrink-0 z-10" }, J = { key: 1 }, K
|
|
|
288
288
|
bodyClass: "p-0!"
|
|
289
289
|
}, {
|
|
290
290
|
header: k(() => [
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
o(e.$slots, "logo", {}, () => [
|
|
292
|
+
s[8] || (s[8] = D("Brand", -1))
|
|
293
293
|
])
|
|
294
294
|
]),
|
|
295
295
|
default: k(() => [
|
|
296
296
|
r("div", Z, [
|
|
297
297
|
m.variant === "header" ? (t(), n("div", _, [
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
298
|
+
o(e.$slots, "mobile-menu", {}, () => [
|
|
299
|
+
o(e.$slots, "left"),
|
|
300
|
+
s[9] || (s[9] = r("div", { class: "h-px bg-border my-2" }, null, -1)),
|
|
301
|
+
o(e.$slots, "center")
|
|
302
302
|
])
|
|
303
303
|
])) : (t(), n("div", ee, [
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
304
|
+
o(e.$slots, "left"),
|
|
305
|
+
o(e.$slots, "default"),
|
|
306
|
+
o(e.$slots, "center")
|
|
307
307
|
])),
|
|
308
308
|
e.$slots?.right ? (t(), n("div", le, [
|
|
309
|
-
|
|
309
|
+
o(e.$slots, "right")
|
|
310
310
|
])) : d("", !0)
|
|
311
311
|
])
|
|
312
312
|
]),
|