vlite3 1.3.3 → 1.3.5
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/Button.vue.js +36 -36
- package/components/DataTable/DataTable.vue.d.ts +1 -1
- package/components/Dropdown/Dropdown.vue.js +17 -16
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/DropdownMenu.vue2.js +64 -64
- package/components/FileTree/FileTree.vue.d.ts +17 -1
- package/components/FileTree/FileTree.vue.js +1 -1
- package/components/FileTree/FileTree.vue2.js +54 -44
- package/components/FileTree/FileTreeNode.vue.d.ts +22 -2
- package/components/FileTree/FileTreeNode.vue.js +119 -94
- package/components/FileTree/types.d.ts +2 -0
- package/components/Form/Form.vue.d.ts +2 -0
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +258 -229
- package/components/Form/FormField.vue.js +5 -4
- package/components/Form/FormFields.vue.d.ts +18 -1
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +117 -105
- package/components/Form/types.d.ts +2 -0
- package/components/ImportData/ImportData.vue.js +3 -2
- package/components/NavbarCommandPalette.vue.d.ts +1 -1
- package/components/Pagination/Pagination.vue.d.ts +1 -0
- package/components/Pagination/Pagination.vue.js +121 -119
- package/components/Pagination/index.d.ts +1 -0
- package/components/Persona.vue.js +134 -0
- package/components/Persona.vue2.js +4 -0
- package/components/Screen/Screen.vue.d.ts +2 -0
- package/components/Screen/Screen.vue.js +160 -157
- package/components/Stats/Stats.vue.d.ts +1 -1
- package/components/Stats/Stats.vue.js +50 -22
- package/components/Stats/Stats.vue3.js +5 -0
- package/components/StatusChip/status-map.js +1 -0
- package/components/Switch.vue.d.ts +3 -0
- package/components/Switch.vue.js +13 -9
- package/components/Tabes/Tabes.vue.js +2 -2
- package/components/Timeline/TimelineItem.vue.js +74 -91
- package/index.d.ts +1 -0
- package/index.js +382 -379
- package/package.json +2 -2
- package/style.css +18 -4
- package/components/Stats/Stats.vue2.js +0 -4
package/components/Button.vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as L, useAttrs as N, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as L, useAttrs as N, computed as r, useSlots as G, Comment as F, Fragment as b, Text as H, withDirectives as M, openBlock as i, createElementBlock as c, normalizeClass as a, createElementVNode as I, createBlock as x, createCommentVNode as u, renderSlot as w, createTextVNode as k, toDisplayString as h, unref as O } from "vue";
|
|
2
|
+
import v from "./Icon.vue.js";
|
|
3
3
|
import { vRipple as Z } from "../directives/vRipple.js";
|
|
4
4
|
import { $t as q } from "../utils/i18n.js";
|
|
5
5
|
const J = ["type", "disabled", "data-testid"], K = {
|
|
@@ -52,23 +52,23 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
52
52
|
"outline-warning": "bg-warning/10 text-warning",
|
|
53
53
|
"outline-info": "bg-info/10 text-info",
|
|
54
54
|
"outline-success": "bg-success/10 text-success",
|
|
55
|
-
ghost: "bg-
|
|
55
|
+
ghost: "bg-secondary text-foreground",
|
|
56
56
|
link: "bg-primary/10 text-primary",
|
|
57
57
|
transparent: "bg-muted text-foreground"
|
|
58
|
-
}, e = t, B = N(), o =
|
|
58
|
+
}, e = t, B = N(), o = r(() => {
|
|
59
59
|
const n = e.layout || B.layout;
|
|
60
60
|
return n === "tile" ? "tile" : n === "vertical" ? "vertical" : "horizontal";
|
|
61
|
-
}),
|
|
61
|
+
}), f = r(() => o.value === "tile"), R = r(() => $[e.variant] ?? $.primary), C = r(() => ({
|
|
62
62
|
xs: "w-9 h-9",
|
|
63
63
|
sm: "w-10 h-10",
|
|
64
64
|
sm2: "w-11 h-11",
|
|
65
65
|
md: "w-12 h-12",
|
|
66
66
|
lg: "w-14 h-14",
|
|
67
67
|
xl: "w-16 h-16"
|
|
68
|
-
})[e.size]), l =
|
|
69
|
-
() => e?.asIcon || e.icon && !l.value && !
|
|
70
|
-
), g =
|
|
71
|
-
const s = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer ${o.value === "tile" ? "flex-col gap-1.5 items-center" : o.value === "vertical" ? "flex-col gap-2" : e.description ? "gap-3" : "gap-2"} ${y.value ? "icon-only shrink-0" : ""}`, z = {
|
|
68
|
+
})[e.size]), l = r(() => e.textI18n ? q(e.textI18n) : e.text), j = G(), p = r(() => j.default ? j.default().some((s) => !(s.type === F || s.type === b && Array.isArray(s.children) && s.children.length === 0 || s.type === H && typeof s.children == "string" && s.children.trim() === "")) : !1), y = r(
|
|
69
|
+
() => e?.asIcon || e.icon && !l.value && !p.value
|
|
70
|
+
), g = r(() => e.icon ? e.icon.startsWith("http://") || e.icon.startsWith("https://") || e.icon.startsWith("data:image/") ? !0 : [".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".ico", ".avif"].some((s) => e.icon.toLowerCase().endsWith(s)) : !1), A = r(() => {
|
|
71
|
+
const s = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer focus:outline-none focus-visible:outline-none ${o.value === "tile" ? "flex-col gap-1.5 items-center" : o.value === "vertical" ? "flex-col gap-2" : e.description ? "gap-3" : "gap-2"} ${y.value ? "icon-only shrink-0" : ""}`, z = {
|
|
72
72
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
73
73
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/15",
|
|
74
74
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -87,7 +87,7 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
87
87
|
"outline-warning": "border border-warning text-warning hover:bg-warning/10",
|
|
88
88
|
"outline-info": "border border-info text-info hover:bg-info/10",
|
|
89
89
|
"outline-success": "border border-success text-success hover:bg-success/10",
|
|
90
|
-
ghost: "hover:bg-
|
|
90
|
+
ghost: "hover:bg-secondary hover:text-foreground text-foreground",
|
|
91
91
|
link: "text-primary underline-offset-4 hover:underline",
|
|
92
92
|
transparent: ""
|
|
93
93
|
}, d = {
|
|
@@ -130,12 +130,12 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
130
130
|
lg: "h-auto py-3 px-4 min-w-28",
|
|
131
131
|
xl: "h-auto py-4 px-10 min-w-32"
|
|
132
132
|
}[e.size]);
|
|
133
|
-
const W =
|
|
133
|
+
const W = f.value ? "group text-foreground focus:outline-none focus-visible:outline-none active:scale-100!" : z[e.variant];
|
|
134
134
|
return [s, W, V[e.rounded], S, e.class].join(
|
|
135
135
|
" "
|
|
136
136
|
);
|
|
137
|
-
}),
|
|
138
|
-
if (
|
|
137
|
+
}), m = r(() => {
|
|
138
|
+
if (f.value && g.value)
|
|
139
139
|
return `${C.value} object-cover`;
|
|
140
140
|
const n = e.description && o.value === "horizontal", s = {
|
|
141
141
|
xs: n ? "w-3.5 h-3.5" : "w-3 h-3",
|
|
@@ -153,37 +153,37 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
153
153
|
xl: "w-4 h-4"
|
|
154
154
|
};
|
|
155
155
|
let d = y.value ? z[e.size] : s[e.size];
|
|
156
|
-
return g.value && (d += " object-cover"),
|
|
157
|
-
}), E =
|
|
156
|
+
return g.value && (d += " object-cover"), f.value ? d += " scale-[1.45]!" : o.value === "vertical" && (d += " scale-[1.35]! mt-1"), d;
|
|
157
|
+
}), E = r(() => o.value === "vertical" ? "scale-[0.9]" : "");
|
|
158
158
|
return (n, s) => M((i(), c("button", {
|
|
159
159
|
type: t.type,
|
|
160
|
-
class:
|
|
160
|
+
class: a([A.value, "cursor-pointer"]),
|
|
161
161
|
disabled: t.disabled || t.loading,
|
|
162
162
|
"data-testid": n.$attrs["data-testid"] || (l.value ? `btn-${l.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : t.icon ? `btn-${t.icon.replace(/[^a-zA-Z0-9]+/g, "-")}` : "button")
|
|
163
163
|
}, [
|
|
164
|
-
|
|
164
|
+
f.value ? (i(), c(b, { key: 0 }, [
|
|
165
165
|
I("span", {
|
|
166
|
-
class:
|
|
166
|
+
class: a(["inline-flex items-center justify-center shrink-0 transition-transform duration-150 ease-out group-active:scale-[0.92]", [
|
|
167
167
|
g.value ? "" : "rounded-full",
|
|
168
168
|
g.value ? "" : R.value,
|
|
169
169
|
g.value ? "" : C.value
|
|
170
170
|
]])
|
|
171
171
|
}, [
|
|
172
|
-
t.loading ? (i(), x(
|
|
172
|
+
t.loading ? (i(), x(v, {
|
|
173
173
|
key: 0,
|
|
174
174
|
icon: "lucide:loader-2",
|
|
175
|
-
class:
|
|
176
|
-
}, null, 8, ["class"])) : t.icon ? (i(), x(
|
|
175
|
+
class: a(["animate-spin pointer-events-none", [m.value, g.value ? C.value : ""]])
|
|
176
|
+
}, null, 8, ["class"])) : t.icon ? (i(), x(v, {
|
|
177
177
|
key: 1,
|
|
178
178
|
icon: t.icon,
|
|
179
|
-
class:
|
|
179
|
+
class: a(["pointer-events-none", [t.iconClass, m.value]])
|
|
180
180
|
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
181
181
|
], 2),
|
|
182
|
-
l.value ||
|
|
182
|
+
l.value || p.value || e.description ? (i(), c("span", {
|
|
183
183
|
key: 0,
|
|
184
|
-
class:
|
|
184
|
+
class: a(["flex flex-col items-center max-w-full", t.textClass])
|
|
185
185
|
}, [
|
|
186
|
-
l.value ||
|
|
186
|
+
l.value || p.value ? (i(), c("span", K, [
|
|
187
187
|
w(n.$slots, "default", {}, () => [
|
|
188
188
|
k(h(l.value), 1)
|
|
189
189
|
])
|
|
@@ -191,19 +191,19 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
191
191
|
e.description ? (i(), c("span", P, h(e.description), 1)) : u("", !0)
|
|
192
192
|
], 2)) : u("", !0)
|
|
193
193
|
], 64)) : (i(), c(b, { key: 1 }, [
|
|
194
|
-
t.loading ? (i(), x(
|
|
194
|
+
t.loading ? (i(), x(v, {
|
|
195
195
|
key: 0,
|
|
196
196
|
icon: "lucide:loader-2",
|
|
197
|
-
class:
|
|
198
|
-
}, null, 8, ["class"])) : t.icon ? (i(), x(
|
|
197
|
+
class: a(["animate-spin pointer-events-none shrink-0", m.value])
|
|
198
|
+
}, null, 8, ["class"])) : t.icon ? (i(), x(v, {
|
|
199
199
|
key: 1,
|
|
200
200
|
icon: t.icon,
|
|
201
|
-
class:
|
|
201
|
+
class: a(["pointer-events-none shrink-0", [t.iconClass, m.value, y.value ? "mx-auto" : ""]])
|
|
202
202
|
}, null, 8, ["icon", "class"])) : u("", !0),
|
|
203
203
|
!e.description && o.value === "horizontal" ? (i(), c(b, { key: 2 }, [
|
|
204
204
|
t.textClass ? (i(), c("div", {
|
|
205
205
|
key: 0,
|
|
206
|
-
class:
|
|
206
|
+
class: a([t.textClass, "leading-tight truncate inline-flex items-center justify-center gap-1.5"])
|
|
207
207
|
}, [
|
|
208
208
|
w(n.$slots, "default", {}, () => [
|
|
209
209
|
k(h(l.value), 1)
|
|
@@ -211,15 +211,15 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
211
211
|
], 2)) : w(n.$slots, "default", { key: 1 }, () => [
|
|
212
212
|
k(h(l.value), 1)
|
|
213
213
|
])
|
|
214
|
-
], 64)) : l.value ||
|
|
214
|
+
], 64)) : l.value || p.value || e.description ? (i(), c("div", {
|
|
215
215
|
key: 3,
|
|
216
|
-
class:
|
|
216
|
+
class: a(["flex flex-col justify-center", [
|
|
217
217
|
o.value === "vertical" ? "items-center text-center" : e.description ? "items-start text-left" : "items-center text-center",
|
|
218
218
|
!t.icon && !t.iconRight && !t.loading ? "flex-1 w-full" : ""
|
|
219
219
|
]])
|
|
220
220
|
}, [
|
|
221
221
|
I("div", {
|
|
222
|
-
class:
|
|
222
|
+
class: a([[t.textClass, E.value], "inline-flex items-center gap-1.5 w-full leading-tight [&>:where(svg)]:mx-auto [&>:where(img)]:mx-auto"])
|
|
223
223
|
}, [
|
|
224
224
|
w(n.$slots, "default", {}, () => [
|
|
225
225
|
k(h(l.value), 1)
|
|
@@ -227,14 +227,14 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
227
227
|
], 2),
|
|
228
228
|
e.description ? (i(), c("span", Q, h(e.description), 1)) : u("", !0)
|
|
229
229
|
], 2)) : u("", !0),
|
|
230
|
-
t.iconRight && !t.loading ? (i(), x(
|
|
230
|
+
t.iconRight && !t.loading ? (i(), x(v, {
|
|
231
231
|
key: 4,
|
|
232
232
|
icon: t.iconRight,
|
|
233
|
-
class:
|
|
233
|
+
class: a([[t.iconRightClass, m.value], "h-4 w-4 pointer-events-none shrink-0"])
|
|
234
234
|
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
235
235
|
], 64))
|
|
236
236
|
], 10, J)), [
|
|
237
|
-
[O(Z), !
|
|
237
|
+
[O(Z), !f.value]
|
|
238
238
|
]);
|
|
239
239
|
}
|
|
240
240
|
});
|
|
@@ -40,11 +40,11 @@ declare const __VLS_component: import('vue').DefineComponent<DataTableProps, {},
|
|
|
40
40
|
selectedRows: any[];
|
|
41
41
|
hideSelectable: boolean;
|
|
42
42
|
paginationProps: import('./types').DataTablePaginationProps;
|
|
43
|
+
bordered: boolean;
|
|
43
44
|
showPagination: boolean;
|
|
44
45
|
cellBordered: boolean;
|
|
45
46
|
keyField: string;
|
|
46
47
|
hoverable: boolean;
|
|
47
|
-
bordered: boolean;
|
|
48
48
|
sortable: boolean;
|
|
49
49
|
headerVariant: "default" | "minimal";
|
|
50
50
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as le, ref as i, computed as f, inject as ne, onMounted as oe, onUnmounted as ae, watch as M, provide as L, reactive as ie, toRefs as se, openBlock as V, createElementBlock as
|
|
1
|
+
import { defineComponent as le, ref as i, computed as f, inject as ne, onMounted as oe, onUnmounted as ae, watch as M, provide as L, reactive as ie, toRefs as se, openBlock as V, createElementBlock as de, normalizeStyle as re, createVNode as P, unref as u, withCtx as m, createBlock as ue, normalizeClass as ce, createSlots as fe, renderSlot as v, normalizeProps as R, guardReactiveProps as W, createCommentVNode as me } from "vue";
|
|
2
2
|
import ve from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
4
|
import he from "./DropdownMenu.vue.js";
|
|
@@ -53,7 +53,7 @@ const xe = /* @__PURE__ */ le({
|
|
|
53
53
|
},
|
|
54
54
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
55
55
|
setup(t, { emit: z }) {
|
|
56
|
-
const l = t, h = z, b = i(!1), y = i(null),
|
|
56
|
+
const l = t, h = z, b = i(!1), y = i(null), d = i({
|
|
57
57
|
title: "Confirm Selection",
|
|
58
58
|
description: "Are you sure you want to select this option?",
|
|
59
59
|
confirmText: "Confirm",
|
|
@@ -117,8 +117,8 @@ const xe = /* @__PURE__ */ le({
|
|
|
117
117
|
);
|
|
118
118
|
const c = f(() => {
|
|
119
119
|
const e = [...S.value], o = new Set(e.map((n) => n.value ?? n.label));
|
|
120
|
-
return k.value.forEach((n,
|
|
121
|
-
o.has(
|
|
120
|
+
return k.value.forEach((n, r) => {
|
|
121
|
+
o.has(r) || (e.unshift(n), o.add(r));
|
|
122
122
|
}), e;
|
|
123
123
|
}), { selectedBuffer: k, isHydrating: K, hydrateSelected: E } = pe({
|
|
124
124
|
fetchSelected: l.fetchSelected,
|
|
@@ -143,13 +143,13 @@ const xe = /* @__PURE__ */ le({
|
|
|
143
143
|
);
|
|
144
144
|
const _ = (e) => {
|
|
145
145
|
if (l.disabled || l.readonly || e.disabled) return;
|
|
146
|
-
l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ?
|
|
146
|
+
l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ? d.value = {
|
|
147
147
|
title: e.confirmation.title || "Confirm Selection",
|
|
148
148
|
description: e.confirmation.description || "Are you sure you want to select this option?",
|
|
149
149
|
confirmText: e.confirmation.confirmText || "Confirm",
|
|
150
150
|
cancelText: e.confirmation.cancelText || "Cancel",
|
|
151
151
|
variant: e.confirmation.variant || "primary"
|
|
152
|
-
} :
|
|
152
|
+
} : d.value = {
|
|
153
153
|
title: "Confirm Selection",
|
|
154
154
|
description: `Are you sure you want to select "${e.label}"?`,
|
|
155
155
|
confirmText: "Confirm",
|
|
@@ -162,8 +162,8 @@ const xe = /* @__PURE__ */ le({
|
|
|
162
162
|
k.value.has(o) || k.value.set(o, e);
|
|
163
163
|
const n = Y(e);
|
|
164
164
|
if (!l.isNested) {
|
|
165
|
-
const
|
|
166
|
-
(e._path || [
|
|
165
|
+
const r = e._originalOption || e, a = r.value ?? r.label;
|
|
166
|
+
(e._path || [r]).forEach((T) => {
|
|
167
167
|
typeof T.onSelect == "function" && T.onSelect({
|
|
168
168
|
value: a,
|
|
169
169
|
option: T,
|
|
@@ -177,14 +177,15 @@ const xe = /* @__PURE__ */ le({
|
|
|
177
177
|
}, te = () => {
|
|
178
178
|
y.value = null, b.value = !1;
|
|
179
179
|
};
|
|
180
|
-
return (e, o) => (V(),
|
|
180
|
+
return (e, o) => (V(), de("div", {
|
|
181
181
|
class: "relative inline-block text-left",
|
|
182
|
-
style:
|
|
182
|
+
style: re({ direction: t.direction })
|
|
183
183
|
}, [
|
|
184
184
|
P(u(ve), {
|
|
185
185
|
content: "",
|
|
186
186
|
trigger: "click",
|
|
187
187
|
arrow: !1,
|
|
188
|
+
disabled: t.disabled || t.readonly,
|
|
188
189
|
teleport: t.teleport,
|
|
189
190
|
offset: t.offset,
|
|
190
191
|
placement: j.value,
|
|
@@ -283,14 +284,14 @@ const xe = /* @__PURE__ */ le({
|
|
|
283
284
|
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : me("", !0)
|
|
284
285
|
]),
|
|
285
286
|
_: 3
|
|
286
|
-
}, 8, ["teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
287
|
+
}, 8, ["disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
287
288
|
P(ge, {
|
|
288
289
|
show: b.value,
|
|
289
|
-
title:
|
|
290
|
-
description:
|
|
291
|
-
"confirm-text":
|
|
292
|
-
"cancel-text":
|
|
293
|
-
variant:
|
|
290
|
+
title: d.value.title,
|
|
291
|
+
description: d.value.description,
|
|
292
|
+
"confirm-text": d.value.confirmText,
|
|
293
|
+
"cancel-text": d.value.cancelText,
|
|
294
|
+
variant: d.value.variant,
|
|
294
295
|
onConfirm: ee,
|
|
295
296
|
onCancel: te
|
|
296
297
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
|
|
@@ -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-1742cff5"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as j, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as ee, ref as j, computed as g, watch as T, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as c, createVNode as O, createCommentVNode as f, renderSlot as k, unref as r, normalizeStyle as se, normalizeClass as E, createElementVNode as w, toDisplayString as N, createBlock as h, Fragment as P, renderList as oe, withCtx as V, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
|
|
2
|
+
import p from "../Icon.vue.js";
|
|
3
3
|
import ie from "../Input.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import ce from "./DropdownItem.vue.js";
|
|
@@ -53,19 +53,19 @@ const ve = ["dir"], ye = {
|
|
|
53
53
|
},
|
|
54
54
|
emits: ["select", "close", "load-more", "search"],
|
|
55
55
|
setup(a, { emit: D }) {
|
|
56
|
-
const t = a, m = D, _ = j(null),
|
|
57
|
-
if (
|
|
56
|
+
const t = a, m = D, _ = j(null), i = j(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = g(() => {
|
|
57
|
+
if (i.value && i.value.trim() !== "")
|
|
58
58
|
return t.searchEmptyMessage ? t.searchEmptyMessage : `No results found for
|
|
59
|
-
"${
|
|
59
|
+
"${i.value}"`;
|
|
60
60
|
const e = $("vlite.dropdown.empty");
|
|
61
61
|
return e !== "vlite.dropdown.empty" ? e : t.emptyMessage;
|
|
62
|
-
}), R =
|
|
62
|
+
}), R = g(() => {
|
|
63
63
|
const e = $("vlite.dropdown.search");
|
|
64
64
|
return e !== "vlite.dropdown.search" ? e : "Search...";
|
|
65
|
-
}),
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
t.remote && (
|
|
65
|
+
}), u = g(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = g(() => t.searchable ? i.value && i.value.trim() !== "" ? !0 : t.remote ? t.loading ? !0 : t.hasMore || (u.value.length || 0) > 5 : (u.value.length || 0) > 5 : !1);
|
|
66
|
+
let v = null;
|
|
67
|
+
T(i, (e) => {
|
|
68
|
+
t.remote && (v && clearTimeout(v), v = setTimeout(() => {
|
|
69
69
|
e !== void 0 && m("search", e);
|
|
70
70
|
}, t.debounceTime));
|
|
71
71
|
});
|
|
@@ -75,7 +75,7 @@ const ve = ["dir"], ye = {
|
|
|
75
75
|
}, x = (e, s) => {
|
|
76
76
|
e.disabled || m("select", e);
|
|
77
77
|
}, {
|
|
78
|
-
focusedIndex:
|
|
78
|
+
focusedIndex: b,
|
|
79
79
|
isKeyboardMode: M,
|
|
80
80
|
filteredOptions: F,
|
|
81
81
|
handleKeyDown: C,
|
|
@@ -83,12 +83,12 @@ const ve = ["dir"], ye = {
|
|
|
83
83
|
onMouseEnterItem: S,
|
|
84
84
|
scrollToIndex: K
|
|
85
85
|
} = fe({
|
|
86
|
-
options:
|
|
87
|
-
searchQuery:
|
|
86
|
+
options: u,
|
|
87
|
+
searchQuery: i,
|
|
88
88
|
containerRef: _,
|
|
89
89
|
emit: (e, ...s) => m(e, ...s),
|
|
90
90
|
handleSelect: (e, s) => x(e)
|
|
91
|
-
}),
|
|
91
|
+
}), y = g(() => t.remote ? i.value ? u.value : t.cachedOptions.length ? t.cachedOptions : u.value : F.value), U = (e) => {
|
|
92
92
|
if (!(!t.selected || typeof t.selected != "object") && e.key && e.key in t.selected)
|
|
93
93
|
return t.selected[e.key];
|
|
94
94
|
}, q = (e) => e.disabled ? !1 : Array.isArray(t.selected) ? t.selected.includes(e.value) : t.selected && typeof t.selected == "object" && e.key ? t.selected[e.key] === e.value : t.selected === e.value, G = (e) => !e.key || !t.selected || typeof t.selected != "object" ? !1 : !!t.selected[e.key], J = (e, s) => {
|
|
@@ -105,39 +105,39 @@ const ve = ["dir"], ye = {
|
|
|
105
105
|
}, Q = (e, s) => {
|
|
106
106
|
let l = s.value;
|
|
107
107
|
e.key && (l = { [e.key]: l });
|
|
108
|
-
const n = s.option,
|
|
108
|
+
const n = s.option, d = n?._path || [n?._originalOption || n].filter(Boolean), Z = {
|
|
109
109
|
label: e.label,
|
|
110
110
|
value: l,
|
|
111
111
|
data: s.data,
|
|
112
112
|
key: e.key,
|
|
113
113
|
_originalOption: n?._originalOption || n,
|
|
114
|
-
_path: [e, ...
|
|
114
|
+
_path: [e, ...d]
|
|
115
115
|
};
|
|
116
116
|
m("select", Z);
|
|
117
117
|
}, W = async () => {
|
|
118
118
|
await ae();
|
|
119
119
|
let e = -1;
|
|
120
|
-
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e =
|
|
120
|
+
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = u.value.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
|
|
121
121
|
};
|
|
122
|
-
|
|
123
|
-
() =>
|
|
122
|
+
T(
|
|
123
|
+
() => y.value,
|
|
124
124
|
() => {
|
|
125
|
-
|
|
125
|
+
b.value = -1;
|
|
126
126
|
}
|
|
127
127
|
), te(() => {
|
|
128
128
|
W(), window.addEventListener("keydown", C);
|
|
129
129
|
}), le(() => {
|
|
130
|
-
window.removeEventListener("keydown", C);
|
|
130
|
+
window.removeEventListener("keydown", C), v && clearTimeout(v), i.value && t.remote && m("search", "");
|
|
131
131
|
});
|
|
132
132
|
const X = (e) => e.labelI18n ? $(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
|
|
133
|
-
return (e, s) => (o(),
|
|
133
|
+
return (e, s) => (o(), c("div", {
|
|
134
134
|
class: "dropdown-menu w-full flex flex-col",
|
|
135
135
|
dir: a.direction
|
|
136
136
|
}, [
|
|
137
|
-
B.value ? (o(),
|
|
137
|
+
B.value ? (o(), c("div", ye, [
|
|
138
138
|
O(ie, {
|
|
139
|
-
modelValue:
|
|
140
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
139
|
+
modelValue: i.value,
|
|
140
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => i.value = l),
|
|
141
141
|
placeholder: R.value,
|
|
142
142
|
icon: "lucide:search",
|
|
143
143
|
size: "sm",
|
|
@@ -149,17 +149,17 @@ const ve = ["dir"], ye = {
|
|
|
149
149
|
"show-clear-button": !1,
|
|
150
150
|
"data-testid": "dropdown-search-input"
|
|
151
151
|
}, null, 8, ["modelValue", "placeholder"])
|
|
152
|
-
])) :
|
|
153
|
-
e.$slots.header ? (o(),
|
|
154
|
-
|
|
155
|
-
])) :
|
|
156
|
-
|
|
152
|
+
])) : f("", !0),
|
|
153
|
+
e.$slots.header ? (o(), c("div", ge, [
|
|
154
|
+
k(e.$slots, "header", {}, void 0, !0)
|
|
155
|
+
])) : f("", !0),
|
|
156
|
+
u.value.length > 0 || y.value.length === 0 ? (o(), c("div", {
|
|
157
157
|
key: 2,
|
|
158
158
|
ref_key: "containerRef",
|
|
159
159
|
ref: _,
|
|
160
160
|
tabindex: B.value ? -1 : 0,
|
|
161
161
|
role: "menu",
|
|
162
|
-
class:
|
|
162
|
+
class: E([
|
|
163
163
|
"w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1 scrollbar-thin",
|
|
164
164
|
t.class
|
|
165
165
|
]),
|
|
@@ -168,28 +168,28 @@ const ve = ["dir"], ye = {
|
|
|
168
168
|
(...l) => r(I) && r(I)(...l)),
|
|
169
169
|
onScroll: A
|
|
170
170
|
}, [
|
|
171
|
-
!a.isCustomSlotMenu &&
|
|
172
|
-
O(
|
|
171
|
+
!a.isCustomSlotMenu && y.value.length === 0 && !a.loading && !(u.value.length === 0 && e.$slots.menu) ? (o(), c("div", ke, [
|
|
172
|
+
O(p, {
|
|
173
173
|
icon: "lucide:inbox",
|
|
174
174
|
class: "w-8 h-8 mb-2 opacity-70"
|
|
175
175
|
}),
|
|
176
|
-
|
|
177
|
-
])) :
|
|
176
|
+
w("span", null, N(L.value), 1)
|
|
177
|
+
])) : f("", !0),
|
|
178
178
|
a.layout === "grouped" ? (o(), h(ue, {
|
|
179
179
|
key: 1,
|
|
180
|
-
options:
|
|
180
|
+
options: y.value,
|
|
181
181
|
selected: a.selected,
|
|
182
182
|
selectable: a.selectable,
|
|
183
183
|
columns: a.columns,
|
|
184
184
|
onSelect: x
|
|
185
|
-
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0),
|
|
186
|
-
l.label === "---" ? (o(),
|
|
185
|
+
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(P, { key: 2 }, oe(y.value, (l, n) => (o(), c(P, { key: n }, [
|
|
186
|
+
l.label === "---" ? (o(), c("div", we)) : l.data?.isBoolean ? (o(), h(de, {
|
|
187
187
|
key: 1,
|
|
188
188
|
option: l,
|
|
189
189
|
value: G(l),
|
|
190
|
-
focused: r(M) && r(
|
|
190
|
+
focused: r(M) && r(b) === n,
|
|
191
191
|
onChange: J,
|
|
192
|
-
onMouseenter: (
|
|
192
|
+
onMouseenter: (d) => r(S)(n)
|
|
193
193
|
}, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), h(he, {
|
|
194
194
|
key: 2,
|
|
195
195
|
"is-nested": !0,
|
|
@@ -204,33 +204,33 @@ const ve = ["dir"], ye = {
|
|
|
204
204
|
selectable: t.selectable,
|
|
205
205
|
ignoreClickOutside: r(H)(l.children),
|
|
206
206
|
direction: a.direction,
|
|
207
|
-
onOnSelect: (
|
|
207
|
+
onOnSelect: (d) => Q(l, d)
|
|
208
208
|
}, {
|
|
209
209
|
trigger: V(() => [
|
|
210
|
-
|
|
210
|
+
w("div", {
|
|
211
211
|
tabindex: 0,
|
|
212
212
|
"data-dropdown-item": "",
|
|
213
|
-
class:
|
|
214
|
-
r(M) && r(
|
|
213
|
+
class: E(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1", [
|
|
214
|
+
r(M) && r(b) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
215
215
|
l.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
216
216
|
l.triggerClass || l.class || ""
|
|
217
217
|
]]),
|
|
218
|
-
onMouseenter: (
|
|
218
|
+
onMouseenter: (d) => r(S)(n)
|
|
219
219
|
}, [
|
|
220
|
-
|
|
221
|
-
l.icon || l.emoji ? (o(), h(
|
|
220
|
+
w("div", xe, [
|
|
221
|
+
l.icon || l.emoji ? (o(), h(p, {
|
|
222
222
|
key: 0,
|
|
223
223
|
icon: l.icon,
|
|
224
224
|
emoji: l.emoji,
|
|
225
225
|
class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
|
|
226
|
-
}, null, 8, ["icon", "emoji"])) :
|
|
227
|
-
|
|
226
|
+
}, null, 8, ["icon", "emoji"])) : f("", !0),
|
|
227
|
+
w("span", Me, N(X(l)), 1)
|
|
228
228
|
]),
|
|
229
|
-
Y(l) ? (o(), h(
|
|
229
|
+
Y(l) ? (o(), h(p, {
|
|
230
230
|
key: 0,
|
|
231
231
|
icon: a.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
|
|
232
232
|
class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
|
|
233
|
-
}, null, 8, ["icon"])) :
|
|
233
|
+
}, null, 8, ["icon"])) : f("", !0)
|
|
234
234
|
], 42, pe)
|
|
235
235
|
]),
|
|
236
236
|
_: 2
|
|
@@ -239,31 +239,31 @@ const ve = ["dir"], ye = {
|
|
|
239
239
|
option: l,
|
|
240
240
|
index: n,
|
|
241
241
|
selected: q(l),
|
|
242
|
-
focused: r(M) && r(
|
|
242
|
+
focused: r(M) && r(b) === n,
|
|
243
243
|
selectable: a.selectable,
|
|
244
|
-
onClick: (
|
|
245
|
-
onMouseenter: (
|
|
244
|
+
onClick: (d) => x(l),
|
|
245
|
+
onMouseenter: (d) => r(S)(n)
|
|
246
246
|
}, ne({ _: 2 }, [
|
|
247
247
|
e.$slots.item ? {
|
|
248
248
|
name: "default",
|
|
249
|
-
fn: V((
|
|
250
|
-
|
|
249
|
+
fn: V((d) => [
|
|
250
|
+
k(e.$slots, "item", re({ ref_for: !0 }, d), void 0, !0)
|
|
251
251
|
]),
|
|
252
252
|
key: "0"
|
|
253
253
|
} : void 0
|
|
254
254
|
]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
|
|
255
255
|
], 64))), 128)),
|
|
256
|
-
a.loading ? (o(),
|
|
257
|
-
O(
|
|
256
|
+
a.loading ? (o(), c("div", Se, [
|
|
257
|
+
O(p, {
|
|
258
258
|
icon: "lucide:loader-2",
|
|
259
259
|
class: "w-4 h-4 animate-spin text-muted-foreground"
|
|
260
260
|
})
|
|
261
|
-
])) :
|
|
262
|
-
|
|
263
|
-
], 46, be)) :
|
|
264
|
-
e.$slots.footer ? (o(),
|
|
265
|
-
|
|
266
|
-
])) :
|
|
261
|
+
])) : f("", !0),
|
|
262
|
+
k(e.$slots, "menu", {}, void 0, !0)
|
|
263
|
+
], 46, be)) : f("", !0),
|
|
264
|
+
e.$slots.footer ? (o(), c("div", Oe, [
|
|
265
|
+
k(e.$slots, "footer", {}, void 0, !0)
|
|
266
|
+
])) : f("", !0)
|
|
267
267
|
], 8, ve));
|
|
268
268
|
}
|
|
269
269
|
});
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { FileNode, FileTreeProps } from './types';
|
|
2
|
-
declare
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
actions?(_: any): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<FileTreeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
12
|
select: (node: FileNode, selected: boolean) => any;
|
|
4
13
|
"update:modelValue": (keys: string[]) => any;
|
|
5
14
|
expand: (node: FileNode, expanded: boolean) => any;
|
|
@@ -11,10 +20,17 @@ declare const _default: import('vue').DefineComponent<FileTreeProps, {}, {}, {},
|
|
|
11
20
|
"onNode-click"?: (node: FileNode) => any;
|
|
12
21
|
}>, {
|
|
13
22
|
data: FileNode[];
|
|
23
|
+
variant: import('./types').FileTreeVariant;
|
|
14
24
|
modelValue: string[];
|
|
15
25
|
selectionMode: import('./types').FileTreeSelectionMode;
|
|
16
26
|
showCheckboxes: boolean;
|
|
17
27
|
highlightSearch: boolean;
|
|
18
28
|
defaultExpandedKeys: string[];
|
|
19
29
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
31
|
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FileTree.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ed4297b9"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|