vlite3 1.4.1 → 1.4.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/AppShell/AppShell.vue.d.ts +1 -0
- package/components/AppShell/AppShell.vue.js +33 -26
- package/components/AppShell/AppShellLayoutStorefront.vue.d.ts +54 -0
- package/components/AppShell/AppShellLayoutStorefront.vue.js +222 -0
- package/components/AppShell/AppShellLayoutStorefront.vue2.js +4 -0
- package/components/AsyncSelect/createAsyncSelect.js +3 -2
- package/components/CategoryManager/CategoryManager.vue2.js +3 -2
- package/components/CategoryMenu/CategoryMenu.vue.d.ts +22 -0
- package/components/CategoryMenu/CategoryMenu.vue.js +106 -0
- package/components/CategoryMenu/CategoryMenu.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +17 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.js +146 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +18 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.js +162 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +4 -0
- package/components/CategoryMenu/index.d.ts +2 -0
- package/components/CategoryMenu/types.d.ts +32 -0
- package/components/CategoryMenu/utils.d.ts +16 -0
- package/components/CategoryMenu/utils.js +45 -0
- package/components/ColorPicker/ColorPicker.vue.d.ts +7 -3
- package/components/ColorPicker/ColorPicker.vue.js +59 -45
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/DatePicker.vue.js +5 -4
- package/components/DateRangePicker.vue.js +3 -2
- package/components/Dropdown/Dropdown.vue.d.ts +4 -1
- package/components/Dropdown/Dropdown.vue.js +10 -8
- package/components/Dropdown/DropdownGroupedLayout.vue2.js +5 -2
- package/components/Dropdown/DropdownGroupedLayout.vue3.js +111 -0
- package/components/Dropdown/DropdownItem.vue.d.ts +2 -2
- package/components/Dropdown/DropdownItem.vue.js +66 -49
- package/components/Dropdown/DropdownMenu.vue.d.ts +2 -0
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/DropdownMenu.vue2.js +44 -42
- package/components/Dropdown/composables/useDropdownHydration.d.ts +4 -0
- package/components/Dropdown/composables/useDropdownNavigation.js +30 -18
- package/components/Form/FormField.vue.js +14 -11
- package/components/IconPicker.vue.js +3 -2
- package/components/ImportData/ImportStep2.vue.js +3 -2
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +4 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PermissionMatrix/PermissionTopBar.vue.js +3 -2
- package/components/Screen/ScreenFilter.vue.js +19 -18
- package/components/SidebarMenu/SidebarMenuItem.vue.js +3 -2
- package/components/Switch.vue.js +8 -8
- package/components/Tooltip.vue.js +1 -0
- package/components/Workbook/Sheet.vue.js +14 -13
- package/components/index.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +153 -151
- package/package.json +2 -2
- package/style.css +1 -1
- package/types/appshell.type.d.ts +2 -1
- package/types/styles.d.ts +2 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.js +0 -75
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, computed as m, openBlock as w, createBlock as $, unref as D, withCtx as h, createElementVNode as z, createVNode as g, renderSlot as L, mergeProps as x } from "vue";
|
|
2
2
|
import P from "./Button.vue.js";
|
|
3
3
|
import B from "./Dropdown/Dropdown.vue.js";
|
|
4
4
|
import "@iconify/vue";
|
|
5
5
|
import { $t as V } from "../utils/i18n.js";
|
|
6
6
|
/* empty css */
|
|
7
|
+
/* empty css */
|
|
7
8
|
/* empty css */
|
|
8
9
|
import U, { TimePicker as j } from "v-datepicker-lite";
|
|
9
10
|
import "v-datepicker-lite/style.css";
|
|
10
|
-
const C = { class: "overflow-hidden min-w-[300px]" },
|
|
11
|
+
const C = { class: "overflow-hidden min-w-[300px]" }, J = /* @__PURE__ */ p({
|
|
11
12
|
__name: "DatePicker",
|
|
12
13
|
props: {
|
|
13
14
|
placeholder: {},
|
|
@@ -160,7 +161,7 @@ const C = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
|
|
|
160
161
|
])
|
|
161
162
|
]),
|
|
162
163
|
default: h(() => [
|
|
163
|
-
|
|
164
|
+
z("div", C, [
|
|
164
165
|
g(D(U), {
|
|
165
166
|
value: T.value,
|
|
166
167
|
mode: t.mode,
|
|
@@ -211,5 +212,5 @@ const C = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
|
|
|
211
212
|
}
|
|
212
213
|
});
|
|
213
214
|
export {
|
|
214
|
-
|
|
215
|
+
J as default
|
|
215
216
|
};
|
|
@@ -3,6 +3,7 @@ import E from "./Dropdown/Dropdown.vue.js";
|
|
|
3
3
|
import R from "./Icon.vue.js";
|
|
4
4
|
import { $t as l } from "../utils/i18n.js";
|
|
5
5
|
/* empty css */
|
|
6
|
+
/* empty css */
|
|
6
7
|
/* empty css */
|
|
7
8
|
import P from "./Button.vue.js";
|
|
8
9
|
import p from "v-datepicker-lite";
|
|
@@ -10,7 +11,7 @@ import "v-datepicker-lite/style.css";
|
|
|
10
11
|
const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, Q = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "flex flex-col gap-1 sm:pr-3 py-2 sm:border-r border-border max-h-[280px]"
|
|
13
|
-
}, O = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, I = { class: "border border-border rounded-md overflow-hidden bg-background" }, U = { class: "flex items-center justify-center shrink-0" }, q = { class: "border border-border rounded-md overflow-hidden bg-background" },
|
|
14
|
+
}, O = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, I = { class: "border border-border rounded-md overflow-hidden bg-background" }, U = { class: "flex items-center justify-center shrink-0" }, q = { class: "border border-border rounded-md overflow-hidden bg-background" }, le = /* @__PURE__ */ $({
|
|
14
15
|
__name: "DateRangePicker",
|
|
15
16
|
props: {
|
|
16
17
|
modelValue: {},
|
|
@@ -236,5 +237,5 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
236
237
|
}
|
|
237
238
|
});
|
|
238
239
|
export {
|
|
239
|
-
|
|
240
|
+
le as default
|
|
240
241
|
};
|
|
@@ -41,6 +41,7 @@ type __VLS_Props = {
|
|
|
41
41
|
disabled?: boolean;
|
|
42
42
|
readonly?: boolean;
|
|
43
43
|
variant?: 'default' | 'transparent' | 'secondary';
|
|
44
|
+
trigger?: import('v-tooltip-lite/types').TooltTipTrigger;
|
|
44
45
|
};
|
|
45
46
|
declare function __VLS_template(): {
|
|
46
47
|
attrs: Partial<{}>;
|
|
@@ -48,7 +49,7 @@ declare function __VLS_template(): {
|
|
|
48
49
|
trigger?(_: {
|
|
49
50
|
selectedLabel: string;
|
|
50
51
|
selectedIcon: string;
|
|
51
|
-
isOpen:
|
|
52
|
+
isOpen: any;
|
|
52
53
|
}): any;
|
|
53
54
|
menu?(_: {}): any;
|
|
54
55
|
default?(_: {}): any;
|
|
@@ -92,12 +93,14 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
92
93
|
onOnOpen?: () => any;
|
|
93
94
|
"onUpdate:isOpen"?: (value: boolean) => any;
|
|
94
95
|
}>, {
|
|
96
|
+
width: string;
|
|
95
97
|
variant: "default" | "transparent" | "secondary";
|
|
96
98
|
columns: number | string;
|
|
97
99
|
loading: boolean;
|
|
98
100
|
readonly: boolean;
|
|
99
101
|
disabled: boolean;
|
|
100
102
|
layout: "default" | "grouped";
|
|
103
|
+
trigger: import('v-tooltip-lite/types').TooltTipTrigger;
|
|
101
104
|
direction: "ltr" | "rtl";
|
|
102
105
|
selectable: boolean;
|
|
103
106
|
options: (IDropdownOption | string | number)[];
|
|
@@ -26,8 +26,8 @@ const He = /* @__PURE__ */ ae({
|
|
|
26
26
|
teleport: { type: Boolean, default: !0 },
|
|
27
27
|
selectedIndex: { default: null },
|
|
28
28
|
maxHeight: { default: "300px" },
|
|
29
|
-
width: {},
|
|
30
|
-
minWidth: { default: "
|
|
29
|
+
width: { default: "min-content" },
|
|
30
|
+
minWidth: { default: "140px" },
|
|
31
31
|
ignoreClickOutside: {},
|
|
32
32
|
menuId: {},
|
|
33
33
|
nestedPosition: {},
|
|
@@ -49,7 +49,8 @@ const He = /* @__PURE__ */ ae({
|
|
|
49
49
|
isNested: { type: Boolean, default: !1 },
|
|
50
50
|
disabled: { type: Boolean, default: !1 },
|
|
51
51
|
readonly: { type: Boolean, default: !1 },
|
|
52
|
-
variant: { default: "default" }
|
|
52
|
+
variant: { default: "default" },
|
|
53
|
+
trigger: { default: "click" }
|
|
53
54
|
},
|
|
54
55
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
55
56
|
setup(t, { emit: U }) {
|
|
@@ -189,7 +190,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
189
190
|
}, [
|
|
190
191
|
N(u(be), {
|
|
191
192
|
content: "",
|
|
192
|
-
trigger:
|
|
193
|
+
trigger: t.trigger,
|
|
193
194
|
arrow: !1,
|
|
194
195
|
disabled: t.disabled || t.readonly,
|
|
195
196
|
teleport: t.teleport,
|
|
@@ -199,12 +200,12 @@ const He = /* @__PURE__ */ ae({
|
|
|
199
200
|
keepAlive: C.value > 0,
|
|
200
201
|
menuId: I.value,
|
|
201
202
|
ignoreClickOutside: te.value,
|
|
202
|
-
class: "w-full",
|
|
203
|
+
class: "w-full flex!",
|
|
203
204
|
className: "dropdown " + (t.className || "") + (t.variant === "transparent" ? " unstyled-dropdown" : "") + (t.variant === "secondary" ? " dropdown-secondary" : ""),
|
|
204
205
|
onOnShow: o[2] || (o[2] = (n) => e.$emit("onOpen")),
|
|
205
206
|
onOnHide: o[3] || (o[3] = (n) => e.$emit("onClose")),
|
|
206
207
|
"onUpdate:isOpen": A,
|
|
207
|
-
triggerClass: "w-full",
|
|
208
|
+
triggerClass: "w-full flex items-center",
|
|
208
209
|
styles: {
|
|
209
210
|
padding: "0",
|
|
210
211
|
...t.width ? { width: t.width, maxWidth: t.width } : {},
|
|
@@ -253,6 +254,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
253
254
|
searchable: t.searchable,
|
|
254
255
|
remote: t.remote,
|
|
255
256
|
debounceTime: t.debounceTime,
|
|
257
|
+
trigger: t.trigger,
|
|
256
258
|
onSelect: le,
|
|
257
259
|
onClose: w,
|
|
258
260
|
onLoadMore: o[0] || (o[0] = (n) => e.$emit("load-more")),
|
|
@@ -287,10 +289,10 @@ const He = /* @__PURE__ */ ae({
|
|
|
287
289
|
]),
|
|
288
290
|
key: "3"
|
|
289
291
|
} : void 0
|
|
290
|
-
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : ye("", !0)
|
|
292
|
+
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime", "trigger"])) : ye("", !0)
|
|
291
293
|
]),
|
|
292
294
|
_: 3
|
|
293
|
-
}, 8, ["disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
295
|
+
}, 8, ["trigger", "disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
294
296
|
N(we, {
|
|
295
297
|
show: b.value,
|
|
296
298
|
title: r.value.title,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./DropdownGroupedLayout.vue3.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-512aa158"]]);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
m as default
|
|
4
7
|
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineComponent as B, computed as S, openBlock as l, createElementBlock as n, normalizeStyle as D, Fragment as i, renderList as u, createBlock as m, resolveDynamicComponent as E, mergeProps as L, withCtx as N, createElementVNode as y, normalizeClass as x, createCommentVNode as d, toDisplayString as k, createVNode as V } from "vue";
|
|
2
|
+
import h from "../Icon.vue.js";
|
|
3
|
+
import v from "./DropdownItem.vue.js";
|
|
4
|
+
import { $t as z } from "../../utils/i18n.js";
|
|
5
|
+
const A = { class: "flex items-center gap-2" }, G = { class: "font-semibold text-sm text-foreground" }, I = {
|
|
6
|
+
key: 2,
|
|
7
|
+
class: "flex flex-col space-y-0.5"
|
|
8
|
+
}, P = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "flex flex-col space-y-0.5 ml-3 pl-3 border-l border-border mt-0.5 mb-1.5"
|
|
11
|
+
}, J = /* @__PURE__ */ B({
|
|
12
|
+
__name: "DropdownGroupedLayout",
|
|
13
|
+
props: {
|
|
14
|
+
options: { default: () => [] },
|
|
15
|
+
selected: {},
|
|
16
|
+
selectable: { type: Boolean, default: !0 },
|
|
17
|
+
columns: { default: 3 },
|
|
18
|
+
itemsClass: {},
|
|
19
|
+
headerClass: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["select", "mouseenter"],
|
|
22
|
+
setup(o, { emit: T }) {
|
|
23
|
+
const s = o, C = S(() => {
|
|
24
|
+
const e = s.columns;
|
|
25
|
+
return typeof e == "number" ? { "--mega-cols": e } : { gridTemplateColumns: e };
|
|
26
|
+
}), a = (e) => s.selected ? Array.isArray(s.selected) ? s.selected.includes(e.value) : typeof s.selected == "object" && s.selected !== null && e.key && e.key in s.selected ? s.selected[e.key] === e.value : s.selected === e.value : !1, b = (e) => e.labelI18n ? z(e.labelI18n) : e.label, p = (e) => e.to ? "router-link" : e.href ? "a" : "button", j = (e) => {
|
|
27
|
+
if (e.to) return { to: e.to };
|
|
28
|
+
if (e.href) {
|
|
29
|
+
const f = e.href.startsWith("http") || e.href.startsWith("//");
|
|
30
|
+
return {
|
|
31
|
+
href: e.href,
|
|
32
|
+
target: f ? "_blank" : void 0,
|
|
33
|
+
rel: f ? "noopener noreferrer" : void 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return { type: "button" };
|
|
37
|
+
};
|
|
38
|
+
return (e, f) => (l(), n("div", {
|
|
39
|
+
class: "mega-menu-grid p-2 gap-6",
|
|
40
|
+
style: D(C.value)
|
|
41
|
+
}, [
|
|
42
|
+
(l(!0), n(i, null, u(o.options, (t, $) => (l(), n("div", {
|
|
43
|
+
key: t.key || t.value || $,
|
|
44
|
+
class: "flex flex-col space-y-1"
|
|
45
|
+
}, [
|
|
46
|
+
o.selectable !== !1 && t.disabled !== !0 ? (l(), m(E(p(t)), L({
|
|
47
|
+
key: 0,
|
|
48
|
+
ref_for: !0
|
|
49
|
+
}, j(t), {
|
|
50
|
+
class: ["flex items-center px-2 py-1.5 mb-1 w-full text-left transition-colors group/header", [
|
|
51
|
+
o.headerClass,
|
|
52
|
+
a(t) ? "text-primary" : ""
|
|
53
|
+
]],
|
|
54
|
+
onClick: (r) => e.$emit("select", t)
|
|
55
|
+
}), {
|
|
56
|
+
default: N(() => [
|
|
57
|
+
y("div", A, [
|
|
58
|
+
t.icon || t.emoji ? (l(), m(h, {
|
|
59
|
+
key: 0,
|
|
60
|
+
icon: t.icon,
|
|
61
|
+
emoji: t.emoji,
|
|
62
|
+
class: x(["w-4 h-4 opacity-80", a(t) ? "text-primary" : "text-muted-foreground group-hover/header:text-primary"])
|
|
63
|
+
}, null, 8, ["icon", "emoji", "class"])) : d("", !0),
|
|
64
|
+
y("span", {
|
|
65
|
+
class: x(["font-semibold text-sm transition-colors", a(t) ? "text-primary" : "text-foreground group-hover/header:text-primary"])
|
|
66
|
+
}, k(b(t)), 3)
|
|
67
|
+
])
|
|
68
|
+
]),
|
|
69
|
+
_: 2
|
|
70
|
+
}, 1040, ["class", "onClick"])) : (l(), n("div", {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: x(["flex items-center gap-2 px-2 py-1.5 mb-1", o.headerClass])
|
|
73
|
+
}, [
|
|
74
|
+
t.icon || t.emoji ? (l(), m(h, {
|
|
75
|
+
key: 0,
|
|
76
|
+
icon: t.icon,
|
|
77
|
+
emoji: t.emoji,
|
|
78
|
+
class: "w-4 h-4 text-muted-foreground"
|
|
79
|
+
}, null, 8, ["icon", "emoji"])) : d("", !0),
|
|
80
|
+
y("span", G, k(b(t)), 1)
|
|
81
|
+
], 2)),
|
|
82
|
+
t.children && t.children.length ? (l(), n("div", I, [
|
|
83
|
+
(l(!0), n(i, null, u(t.children, (r, _) => (l(), n(i, {
|
|
84
|
+
key: r.key || r.value || _
|
|
85
|
+
}, [
|
|
86
|
+
V(v, {
|
|
87
|
+
option: r,
|
|
88
|
+
selected: a(r),
|
|
89
|
+
selectable: o.selectable,
|
|
90
|
+
class: "w-full text-sm text-muted-foreground hover:text-foreground font-medium",
|
|
91
|
+
onClick: (c) => e.$emit("select", r)
|
|
92
|
+
}, null, 8, ["option", "selected", "selectable", "onClick"]),
|
|
93
|
+
r.children && r.children.length ? (l(), n("div", P, [
|
|
94
|
+
(l(!0), n(i, null, u(r.children, (c, w) => (l(), m(v, {
|
|
95
|
+
key: c.key || c.value || w,
|
|
96
|
+
option: c,
|
|
97
|
+
selected: a(c),
|
|
98
|
+
selectable: o.selectable,
|
|
99
|
+
class: "w-full text-xs text-muted-foreground hover:text-foreground",
|
|
100
|
+
onClick: (W) => e.$emit("select", c)
|
|
101
|
+
}, null, 8, ["option", "selected", "selectable", "onClick"]))), 128))
|
|
102
|
+
])) : d("", !0)
|
|
103
|
+
], 64))), 128))
|
|
104
|
+
])) : d("", !0)
|
|
105
|
+
]))), 128))
|
|
106
|
+
], 4));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
J as default
|
|
111
|
+
};
|
|
@@ -16,7 +16,7 @@ declare function __VLS_template(): {
|
|
|
16
16
|
}): any;
|
|
17
17
|
};
|
|
18
18
|
refs: {};
|
|
19
|
-
rootEl:
|
|
19
|
+
rootEl: any;
|
|
20
20
|
};
|
|
21
21
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
22
|
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
@@ -25,7 +25,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
25
25
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
26
26
|
onClick?: (option: IDropdownOption) => any;
|
|
27
27
|
onMouseenter?: (index: number) => any;
|
|
28
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
28
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
30
|
export default _default;
|
|
31
31
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { $t as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as $, computed as n, openBlock as i, createBlock as l, resolveDynamicComponent as C, mergeProps as I, withKeys as B, withCtx as D, renderSlot as j, normalizeProps as E, guardReactiveProps as P, createCommentVNode as a, createElementVNode as r, toDisplayString as s, createElementBlock as b } from "vue";
|
|
2
|
+
import h from "../Icon.vue.js";
|
|
3
|
+
import { $t as c } from "../../utils/i18n.js";
|
|
4
|
+
const S = { class: "flex flex-col flex-1 min-w-0" }, z = { class: "flex items-center justify-between gap-2" }, K = { class: "truncate font-medium" }, L = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-xs text-muted-foreground whitespace-nowrap opacity-90"
|
|
7
|
-
},
|
|
7
|
+
}, N = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-[10px] text-muted-foreground truncate opacity-70"
|
|
10
|
-
},
|
|
10
|
+
}, T = /* @__PURE__ */ $({
|
|
11
11
|
__name: "DropdownItem",
|
|
12
12
|
props: {
|
|
13
13
|
option: {},
|
|
@@ -17,52 +17,69 @@ const j = ["tabindex", "data-disabled", "data-testid"], C = { class: "flex flex-
|
|
|
17
17
|
index: {}
|
|
18
18
|
},
|
|
19
19
|
emits: ["click", "mouseenter"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
() =>
|
|
23
|
-
),
|
|
24
|
-
() =>
|
|
25
|
-
),
|
|
26
|
-
() =>
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
setup(t, { emit: v }) {
|
|
21
|
+
const e = t, d = v, x = n(
|
|
22
|
+
() => e.option.labelI18n ? c(e.option.labelI18n) : e.option.label
|
|
23
|
+
), u = n(
|
|
24
|
+
() => e.option.subtitleI18n ? c(e.option.subtitleI18n) : e.option.subtitle
|
|
25
|
+
), p = n(
|
|
26
|
+
() => e.option.descriptionI18n ? c(e.option.descriptionI18n) : e.option.description
|
|
27
|
+
), m = n(
|
|
28
|
+
() => e.option.href && (e.option.href.startsWith("http") || e.option.href.startsWith("//"))
|
|
29
|
+
), y = n(() => e.option.to ? "router-link" : e.option.href ? "a" : "div"), k = n(() => e.option.to ? { to: e.option.to } : e.option.href ? {
|
|
30
|
+
href: e.option.href,
|
|
31
|
+
target: m.value ? "_blank" : void 0,
|
|
32
|
+
rel: m.value ? "noopener noreferrer" : void 0
|
|
33
|
+
} : {}), g = (o) => {
|
|
34
|
+
if (e.option.disabled) {
|
|
35
|
+
o.preventDefault();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
d("click", e.option);
|
|
39
|
+
}, w = (o) => {
|
|
40
|
+
e.option.to || e.option.href || (o.preventDefault(), d("click", e.option));
|
|
41
|
+
};
|
|
42
|
+
return (o, f) => (i(), l(C(y.value), I(k.value, {
|
|
43
|
+
tabindex: t.option.disabled ? -1 : 0,
|
|
30
44
|
"data-dropdown-item": "",
|
|
31
|
-
class:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
]]
|
|
37
|
-
"data-disabled":
|
|
38
|
-
"data-testid":
|
|
39
|
-
onClick:
|
|
40
|
-
onKeydown:
|
|
41
|
-
onMouseenter:
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
class: ["relative w-full flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus-visible:bg-accent focus-visible:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", [
|
|
46
|
+
t.selectable && t.selected && !t.option.children ? "bg-accent" : "",
|
|
47
|
+
t.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
48
|
+
t.option.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
49
|
+
t.option.class || ""
|
|
50
|
+
]],
|
|
51
|
+
"data-disabled": t.option.disabled ? !0 : void 0,
|
|
52
|
+
"data-testid": o.$attrs["data-testid"] || (t.option.value ? `dropdown-item-${t.option.value}` : `dropdown-item-${t.option.label}`).toString().toLowerCase().replace(/[^a-z0-9]+/g, "-"),
|
|
53
|
+
onClick: g,
|
|
54
|
+
onKeydown: B(w, ["enter"]),
|
|
55
|
+
onMouseenter: f[0] || (f[0] = (V) => o.$emit("mouseenter", t.index ?? -1))
|
|
56
|
+
}), {
|
|
57
|
+
default: D(() => [
|
|
58
|
+
j(o.$slots, "default", E(P({ option: t.option, index: t.index, selected: t.selected })), () => [
|
|
59
|
+
t.option.icon || t.option.emoji ? (i(), l(h, {
|
|
60
|
+
key: 0,
|
|
61
|
+
icon: t.option.icon,
|
|
62
|
+
emoji: t.option.emoji,
|
|
63
|
+
class: "mr-2.5 h-4 w-4 shrink-0 mt-0.5"
|
|
64
|
+
}, null, 8, ["icon", "emoji"])) : a("", !0),
|
|
65
|
+
r("div", S, [
|
|
66
|
+
r("div", z, [
|
|
67
|
+
r("span", K, s(x.value), 1),
|
|
68
|
+
u.value ? (i(), b("span", L, s(u.value), 1)) : a("", !0)
|
|
69
|
+
]),
|
|
70
|
+
p.value ? (i(), b("span", N, s(p.value), 1)) : a("", !0)
|
|
54
71
|
]),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
t.selectable && t.selected ? (i(), l(h, {
|
|
73
|
+
key: 1,
|
|
74
|
+
icon: "lucide:check",
|
|
75
|
+
class: "ml-2 h-4 w-4 shrink-0 text-primary"
|
|
76
|
+
})) : a("", !0)
|
|
77
|
+
])
|
|
78
|
+
]),
|
|
79
|
+
_: 3
|
|
80
|
+
}, 16, ["tabindex", "class", "data-disabled", "data-testid"]));
|
|
64
81
|
}
|
|
65
82
|
});
|
|
66
83
|
export {
|
|
67
|
-
|
|
84
|
+
T as default
|
|
68
85
|
};
|
|
@@ -20,6 +20,7 @@ interface Props {
|
|
|
20
20
|
direction?: 'ltr' | 'rtl';
|
|
21
21
|
emptyMessage?: string;
|
|
22
22
|
searchEmptyMessage?: string;
|
|
23
|
+
trigger?: import('v-tooltip-lite/types').TooltTipTrigger;
|
|
23
24
|
}
|
|
24
25
|
declare function __VLS_template(): {
|
|
25
26
|
attrs: Partial<{}>;
|
|
@@ -54,6 +55,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
54
55
|
columns: number | string;
|
|
55
56
|
loading: boolean;
|
|
56
57
|
layout: "default" | "grouped";
|
|
58
|
+
trigger: import('v-tooltip-lite/types').TooltTipTrigger;
|
|
57
59
|
direction: "ltr" | "rtl";
|
|
58
60
|
selectable: boolean;
|
|
59
61
|
options: (IDropdownOption | string | number)[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DropdownMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-754d002e"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|