vlite3 0.8.7 → 0.8.9
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/Badge.vue.js +4 -4
- package/components/Button.vue.js +21 -21
- package/components/ColorPicker/ColorPicker.vue.d.ts +1 -1
- package/components/DataTable/DataTable.vue.js +34 -11
- package/components/Dropdown/Dropdown.vue.d.ts +7 -7
- package/components/Dropdown/Dropdown.vue.js +132 -121
- package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
- package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
- package/components/Dropdown/useDropdownIds.d.ts +7 -0
- package/components/FilePicker/FilePicker.vue.js +12 -12
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +2 -2
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +6 -6
- package/components/IconPicker.vue.d.ts +1 -1
- package/components/Modal.vue.js +2 -2
- package/components/Navbar/Navbar.vue.d.ts +1 -1
- package/components/NavbarCommandPalette.vue.d.ts +1 -1
- package/components/Screen/Screen.vue.js +197 -218
- package/components/SidePanel.vue.d.ts +1 -1
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
- package/components/Stats/Stats.vue.js +151 -113
- package/components/Stats/types.d.ts +1 -1
- package/components/Tooltip.vue.d.ts +4 -4
- package/components/Tooltip.vue.js +2 -2
- package/lib/v-tooltip-lite/components/ToolTip.vue.d.ts +48 -0
- package/lib/v-tooltip-lite/components/ToolTip.vue.js +102 -0
- package/lib/v-tooltip-lite/components/ToolTip.vue2.js +4 -0
- package/lib/v-tooltip-lite/composables/usePopover.d.ts +20 -0
- package/lib/v-tooltip-lite/composables/usePopover.js +144 -0
- package/lib/v-tooltip-lite/index.d.ts +2 -0
- package/lib/v-tooltip-lite/index.js +4 -0
- package/package.json +2 -2
- package/style.css +1 -1
package/components/Badge.vue.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as b, computed as
|
|
1
|
+
import { defineComponent as b, computed as a, openBlock as d, createElementBlock as u, normalizeClass as i, renderSlot as c } from "vue";
|
|
2
2
|
const p = /* @__PURE__ */ b({
|
|
3
3
|
__name: "Badge",
|
|
4
4
|
props: {
|
|
5
5
|
variant: { default: "default" },
|
|
6
|
-
size: { default: "
|
|
6
|
+
size: { default: "sm" },
|
|
7
7
|
rounded: { default: "full" },
|
|
8
8
|
class: { default: "" }
|
|
9
9
|
},
|
|
10
10
|
setup(o) {
|
|
11
|
-
const e = o, s =
|
|
11
|
+
const e = o, s = a(() => {
|
|
12
12
|
const r = {
|
|
13
13
|
xs: "px-1.5 h-5 text-[10.5px] leading-none",
|
|
14
14
|
sm: "px-2 h-6 text-xs font-medium",
|
|
@@ -33,7 +33,7 @@ const p = /* @__PURE__ */ b({
|
|
|
33
33
|
};
|
|
34
34
|
return [l, t[e.variant] || t.default, e.class].join(" ");
|
|
35
35
|
});
|
|
36
|
-
return (r, n) => (
|
|
36
|
+
return (r, n) => (d(), u("div", {
|
|
37
37
|
class: i(s.value)
|
|
38
38
|
}, [
|
|
39
39
|
c(r.$slots, "default")
|
package/components/Button.vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, computed as o, useSlots as R, inject as S, withDirectives as G, openBlock as s, createElementBlock as h, normalizeClass as
|
|
1
|
+
import { defineComponent as B, computed as o, useSlots as R, inject as S, withDirectives as G, openBlock as s, createElementBlock as h, normalizeClass as r, createBlock as u, createCommentVNode as m, renderSlot as b, createTextVNode as f, toDisplayString as x, unref as $ } from "vue";
|
|
2
2
|
import g from "./Icon.vue.js";
|
|
3
3
|
import { vRipple as j } from "../directives/vRipple.js";
|
|
4
4
|
import { $t as V } from "../utils/i18n.js";
|
|
@@ -25,7 +25,7 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
25
25
|
const t = e, a = o(() => t.textI18n ? V(t.textI18n) : t.text), v = R(), l = o(
|
|
26
26
|
() => t?.asIcon || t.icon && !a.value && !v.default
|
|
27
27
|
), p = S("buttonGroup", null), w = o(() => !!p?.isInGroup), y = o(() => {
|
|
28
|
-
const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none
|
|
28
|
+
const n = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus:border focus:border-primary disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", i = {
|
|
29
29
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
30
30
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
|
|
31
31
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -77,12 +77,12 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
77
77
|
"2xl": "rounded-2xl",
|
|
78
78
|
full: "rounded-full"
|
|
79
79
|
};
|
|
80
|
-
let
|
|
81
|
-
return l.value ?
|
|
80
|
+
let d;
|
|
81
|
+
return l.value ? d = w.value ? k[t.size] : C[t.size] : d = z[t.size], [
|
|
82
82
|
n,
|
|
83
|
-
|
|
83
|
+
i[t.variant],
|
|
84
84
|
I[t.rounded],
|
|
85
|
-
|
|
85
|
+
d,
|
|
86
86
|
t.class
|
|
87
87
|
].join(" ");
|
|
88
88
|
}), c = o(() => {
|
|
@@ -93,7 +93,7 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
93
93
|
md: "w-4 h-4",
|
|
94
94
|
lg: "w-4 h-4",
|
|
95
95
|
xl: "w-4 h-4"
|
|
96
|
-
},
|
|
96
|
+
}, i = {
|
|
97
97
|
xs: "w-3 h-3",
|
|
98
98
|
sm: "w-4 h-4",
|
|
99
99
|
sm2: "w-4 h-4",
|
|
@@ -101,36 +101,36 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
101
101
|
lg: "w-4 h-4",
|
|
102
102
|
xl: "w-4 h-4"
|
|
103
103
|
};
|
|
104
|
-
return l.value ?
|
|
104
|
+
return l.value ? i[t.size] : n[t.size];
|
|
105
105
|
});
|
|
106
|
-
return (n,
|
|
106
|
+
return (n, i) => G((s(), h("button", {
|
|
107
107
|
type: e.type,
|
|
108
|
-
class:
|
|
108
|
+
class: r([y.value, "cursor-pointer"]),
|
|
109
109
|
disabled: e.disabled || e.loading
|
|
110
110
|
}, [
|
|
111
|
-
e.loading ? (s(),
|
|
111
|
+
e.loading ? (s(), u(g, {
|
|
112
112
|
key: 0,
|
|
113
113
|
icon: "lucide:loader-2",
|
|
114
|
-
class:
|
|
115
|
-
}, null, 8, ["class"])) : e.icon ? (s(),
|
|
114
|
+
class: r(["animate-spin pointer-events-none", c.value])
|
|
115
|
+
}, null, 8, ["class"])) : e.icon ? (s(), u(g, {
|
|
116
116
|
key: 1,
|
|
117
117
|
icon: e.icon,
|
|
118
|
-
class:
|
|
118
|
+
class: r(["pointer-events-none", [e.iconClass, c.value, l.value ? "mx-auto" : ""]])
|
|
119
119
|
}, null, 8, ["icon", "class"])) : m("", !0),
|
|
120
120
|
e.textClass ? (s(), h("span", {
|
|
121
121
|
key: 2,
|
|
122
|
-
class:
|
|
122
|
+
class: r(e.textClass)
|
|
123
123
|
}, [
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
b(n.$slots, "default", {}, () => [
|
|
125
|
+
f(x(a.value), 1)
|
|
126
126
|
])
|
|
127
|
-
], 2)) :
|
|
128
|
-
|
|
127
|
+
], 2)) : b(n.$slots, "default", { key: 3 }, () => [
|
|
128
|
+
f(x(a.value), 1)
|
|
129
129
|
]),
|
|
130
|
-
e.iconRight && !e.loading ? (s(),
|
|
130
|
+
e.iconRight && !e.loading ? (s(), u(g, {
|
|
131
131
|
key: 4,
|
|
132
132
|
icon: e.iconRight,
|
|
133
|
-
class:
|
|
133
|
+
class: r([[e.iconRightClass, c.value], "h-4 w-4 pointer-events-none"])
|
|
134
134
|
}, null, 8, ["icon", "class"])) : m("", !0)
|
|
135
135
|
], 10, D)), [
|
|
136
136
|
[$(j)]
|
|
@@ -24,7 +24,7 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
24
24
|
rows: { default: () => [] },
|
|
25
25
|
selectedRows: { default: () => [] },
|
|
26
26
|
search: { default: "" },
|
|
27
|
-
showSearch: { type: Boolean, default: !
|
|
27
|
+
showSearch: { type: Boolean, default: !1 },
|
|
28
28
|
searchPlaceholder: {},
|
|
29
29
|
searchPlaceholderI18n: {},
|
|
30
30
|
toolbarClass: {},
|
|
@@ -83,13 +83,22 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
83
83
|
V && clearTimeout(V), V = setTimeout(() => {
|
|
84
84
|
h.value = 1, R();
|
|
85
85
|
}, 300);
|
|
86
|
-
}), g(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
}), g(
|
|
87
|
+
() => a.pageInfo?.itemsPerPage,
|
|
88
|
+
(e) => {
|
|
89
|
+
e !== void 0 && (P.value = e);
|
|
90
|
+
}
|
|
91
|
+
), g(
|
|
92
|
+
() => a.paginationProps?.itemsPerPage,
|
|
93
|
+
(e) => {
|
|
94
|
+
e !== void 0 && (P.value = e);
|
|
95
|
+
}
|
|
96
|
+
), g(
|
|
97
|
+
() => a.pageInfo?.currentPage,
|
|
98
|
+
(e) => {
|
|
99
|
+
e && (h.value = e);
|
|
100
|
+
}
|
|
101
|
+
);
|
|
93
102
|
const s = y(/* @__PURE__ */ new Set());
|
|
94
103
|
g(
|
|
95
104
|
() => a.selectedRows,
|
|
@@ -118,7 +127,11 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
118
127
|
}), (a.selectedRows || []).forEach((l) => {
|
|
119
128
|
const n = c(l, d.value);
|
|
120
129
|
!e.has(n) && s.value.has(n) && (t.push(l), e.add(n));
|
|
121
|
-
}), b("select", {
|
|
130
|
+
}), b("select", {
|
|
131
|
+
selected: t,
|
|
132
|
+
all: M.value,
|
|
133
|
+
indeterminate: O.value
|
|
134
|
+
}), b("update:selectedRows", t);
|
|
122
135
|
}, le = (e) => {
|
|
123
136
|
const t = a.headers.find((n) => n.field === e), l = t ? Q(t) : e;
|
|
124
137
|
u.value.field === l ? u.value.order === "asc" ? u.value.order = "desc" : u.value.order === "desc" ? (u.value.order = "", u.value.field = "") : u.value.order = "asc" : (u.value.field = l, u.value.order = "asc"), h.value = 1, R();
|
|
@@ -154,7 +167,11 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
154
167
|
"overflow-hidden",
|
|
155
168
|
a.bordered ? "border border-border" : "",
|
|
156
169
|
a.class
|
|
157
|
-
].join(" ")), ie = r(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), de = (e) => e.width || "auto", ce = r(
|
|
170
|
+
].join(" ")), ie = r(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), de = (e) => e.width || "auto", ce = r(
|
|
171
|
+
() => a.emptyTitleI18n ? w(a.emptyTitleI18n) : a.emptyTitle
|
|
172
|
+
), ue = r(
|
|
173
|
+
() => a.emptyDescriptionI18n ? w(a.emptyDescriptionI18n) : a.emptyDescription
|
|
174
|
+
), me = r(() => {
|
|
158
175
|
const e = w("vlite.dataTable.confirmDeleteTitle");
|
|
159
176
|
return e !== "vlite.dataTable.confirmDeleteTitle" ? e : "Confirm Deletion";
|
|
160
177
|
}), fe = r(() => {
|
|
@@ -267,7 +284,13 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
267
284
|
]));
|
|
268
285
|
return S.memo = C, S;
|
|
269
286
|
}, t, 2), 128)) : o.rows.length > 0 ? (i(!0), m(A, { key: 1 }, B(o.rows, (l, n, ge, v) => {
|
|
270
|
-
const C = [
|
|
287
|
+
const C = [
|
|
288
|
+
l,
|
|
289
|
+
s.value.has(c(l, d.value)),
|
|
290
|
+
o.compact,
|
|
291
|
+
o.striped,
|
|
292
|
+
o.hoverable
|
|
293
|
+
];
|
|
271
294
|
if (v && v.key === c(l, d.value) && W(v, C)) return v;
|
|
272
295
|
const S = (i(), F(Te, {
|
|
273
296
|
key: c(l, d.value),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IDropdownOption, ButtonProps } from '../../types';
|
|
2
|
-
import { TooltTipPlacement } from 'v-tooltip-lite/types';
|
|
2
|
+
import { TooltTipPlacement } from '../../lib/v-tooltip-lite/types';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
selected?: any;
|
|
5
5
|
modelValue?: any;
|
|
@@ -65,10 +65,10 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
65
65
|
option?: IDropdownOption;
|
|
66
66
|
}) => any;
|
|
67
67
|
"update:modelValue": (value: any) => any;
|
|
68
|
+
"update:isOpen": (value: boolean) => any;
|
|
68
69
|
"load-more": () => any;
|
|
69
70
|
onClose: () => any;
|
|
70
71
|
onOpen: () => any;
|
|
71
|
-
"update:isOpen": (value: boolean) => any;
|
|
72
72
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
73
73
|
onSearch?: (query: string) => any;
|
|
74
74
|
onOnSelect?: (payload: {
|
|
@@ -77,14 +77,17 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
77
77
|
option?: IDropdownOption;
|
|
78
78
|
}) => any;
|
|
79
79
|
"onUpdate:modelValue"?: (value: any) => any;
|
|
80
|
+
"onUpdate:isOpen"?: (value: boolean) => any;
|
|
80
81
|
"onLoad-more"?: () => any;
|
|
81
82
|
onOnClose?: () => any;
|
|
82
83
|
onOnOpen?: () => any;
|
|
83
|
-
"onUpdate:isOpen"?: (value: boolean) => any;
|
|
84
84
|
}>, {
|
|
85
85
|
loading: boolean;
|
|
86
|
-
|
|
86
|
+
offset: [number, number];
|
|
87
87
|
options: (IDropdownOption | string | number)[];
|
|
88
|
+
teleport: boolean;
|
|
89
|
+
isOpen: boolean;
|
|
90
|
+
selectable: boolean;
|
|
88
91
|
columns: number | string;
|
|
89
92
|
selectedIndex: number | null;
|
|
90
93
|
maxHeight: string;
|
|
@@ -98,9 +101,6 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
98
101
|
closeOnSelect: boolean;
|
|
99
102
|
toggleSelection: boolean;
|
|
100
103
|
emptyMessage: string;
|
|
101
|
-
offset: [number, number];
|
|
102
|
-
isOpen: boolean;
|
|
103
|
-
teleport: boolean;
|
|
104
104
|
showSelectedLabel: boolean;
|
|
105
105
|
doubleConfirmation: boolean;
|
|
106
106
|
isNested: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useDropdownIds as
|
|
8
|
-
import { useDropdownSelection as
|
|
9
|
-
import { useDropdownHydration as
|
|
10
|
-
const
|
|
1
|
+
import { defineComponent as ee, ref as i, computed as c, inject as te, onMounted as ne, onUnmounted as le, watch as P, provide as oe, reactive as ae, toRefs as ie, openBlock as L, createElementBlock as se, normalizeStyle as re, createVNode as x, unref as p, withCtx as f, renderSlot as m, createBlock as ue, normalizeClass as de, createSlots as ce, normalizeProps as V, guardReactiveProps as R, createCommentVNode as fe } from "vue";
|
|
2
|
+
import me from "../../lib/v-tooltip-lite/components/ToolTip.vue.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import ve from "./DropdownMenu.vue.js";
|
|
5
|
+
import he from "./DropdownTrigger.vue.js";
|
|
6
|
+
import pe from "../ConfirmationModal.vue.js";
|
|
7
|
+
import { useDropdownIds as ge } from "./composables/useDropdownIds.js";
|
|
8
|
+
import { useDropdownSelection as ye } from "./composables/useDropdownSelection.js";
|
|
9
|
+
import { useDropdownHydration as Ce } from "./composables/useDropdownHydration.js";
|
|
10
|
+
const xe = /* @__PURE__ */ ee({
|
|
11
11
|
__name: "Dropdown",
|
|
12
12
|
props: {
|
|
13
13
|
selected: {},
|
|
@@ -46,138 +46,149 @@ const be = /* @__PURE__ */ K({
|
|
|
46
46
|
isNested: { type: Boolean, default: !1 }
|
|
47
47
|
},
|
|
48
48
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
49
|
-
setup(l, { emit:
|
|
50
|
-
const
|
|
49
|
+
setup(l, { emit: z }) {
|
|
50
|
+
const o = l, g = z, y = i(!1), v = i(null), r = i({
|
|
51
51
|
title: "Confirm Selection",
|
|
52
52
|
description: "Are you sure you want to select this option?",
|
|
53
53
|
confirmText: "Confirm",
|
|
54
54
|
cancelText: "Cancel",
|
|
55
55
|
variant: "primary"
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
}), E = c(() => o.position ? o.position : o.direction === "rtl" ? "bottom-end" : "bottom-start"), j = c(() => o.nestedPosition ? o.nestedPosition : o.direction === "rtl" ? "left-start" : "right-start"), S = i(o.isOpen || !1), C = i(0), U = `dropdown-${Math.random().toString(36).substring(2, 9)}`, $ = c(() => o.menuId || U), h = i([]), s = te("dropdown-context", null), q = (e) => {
|
|
57
|
+
h.value.includes(e) || h.value.push(e), s?.registerChildId?.(e);
|
|
58
|
+
}, F = (e) => {
|
|
59
|
+
h.value = h.value.filter((n) => n !== e), s?.unregisterChildId?.(e);
|
|
60
|
+
};
|
|
61
|
+
ne(() => {
|
|
62
|
+
s?.registerChildId && s.registerChildId(`#${$.value}`);
|
|
63
|
+
}), le(() => {
|
|
64
|
+
s?.unregisterChildId && s.unregisterChildId(`#${$.value}`);
|
|
65
|
+
}), P(
|
|
66
|
+
() => o.isOpen,
|
|
59
67
|
(e) => {
|
|
60
|
-
e !== void 0 && (
|
|
68
|
+
e !== void 0 && (S.value = e);
|
|
61
69
|
}
|
|
62
70
|
);
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
71
|
+
const M = (e) => {
|
|
72
|
+
S.value = e, g("update:isOpen", e), g(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
|
|
73
|
+
}, b = () => {
|
|
74
|
+
M(!1);
|
|
75
|
+
}, G = (e) => {
|
|
76
|
+
e ? C.value++ : C.value = Math.max(0, C.value - 1);
|
|
67
77
|
};
|
|
68
|
-
|
|
69
|
-
close:
|
|
78
|
+
oe("dropdown-context", {
|
|
79
|
+
close: b,
|
|
70
80
|
onChildToggle: (e) => {
|
|
71
|
-
e
|
|
72
|
-
}
|
|
81
|
+
G(e), s?.onChildToggle?.(e);
|
|
82
|
+
},
|
|
83
|
+
registerChildId: q,
|
|
84
|
+
unregisterChildId: F
|
|
73
85
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
const w = c(() => o.options ? o.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), O = i([]), N = i(!1), k = i(!1);
|
|
87
|
+
P(
|
|
88
|
+
w,
|
|
77
89
|
(e) => {
|
|
78
90
|
if (e) {
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
91
|
+
if (o.remote) {
|
|
92
|
+
const n = [...O.value];
|
|
81
93
|
e.forEach((t) => {
|
|
82
|
-
|
|
83
|
-
}),
|
|
94
|
+
n.some((a) => a.value !== void 0 && t.value !== void 0 ? typeof a.value == "object" && a.key && t.key ? a.key === t.key && a.value[a.key] === t.value[t.key] : a.value === t.value : a.label === t.label) || n.push(t);
|
|
95
|
+
}), O.value = n;
|
|
84
96
|
} else
|
|
85
|
-
|
|
86
|
-
!
|
|
87
|
-
|
|
97
|
+
O.value = e;
|
|
98
|
+
!N.value && e.length > 0 && (N.value = !0, setTimeout(() => {
|
|
99
|
+
k.value = !0, A(T.value);
|
|
88
100
|
}, 10));
|
|
89
101
|
}
|
|
90
102
|
},
|
|
91
103
|
{ immediate: !0 }
|
|
92
|
-
// Performance fix: Removed deep: true to prevent heavy recursion mapping
|
|
93
104
|
);
|
|
94
|
-
const
|
|
95
|
-
const e = [...
|
|
96
|
-
return
|
|
97
|
-
|
|
105
|
+
const d = c(() => {
|
|
106
|
+
const e = [...O.value], n = new Set(e.map((t) => t.value ?? t.label));
|
|
107
|
+
return I.value.forEach((t, u) => {
|
|
108
|
+
n.has(u) || (e.unshift(t), n.add(u));
|
|
98
109
|
}), e;
|
|
99
|
-
}), { selectedBuffer:
|
|
100
|
-
fetchSelected:
|
|
101
|
-
getAvailableOptions: () =>
|
|
102
|
-
isReady: () =>
|
|
103
|
-
}), { getAllRecursiveIds:
|
|
104
|
-
...
|
|
105
|
-
options:
|
|
106
|
-
}), { currentValue:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
),
|
|
110
|
-
const e =
|
|
111
|
-
return [.../* @__PURE__ */ new Set([...e, ...
|
|
110
|
+
}), { selectedBuffer: I, isHydrating: J, hydrateSelected: A } = Ce({
|
|
111
|
+
fetchSelected: o.fetchSelected,
|
|
112
|
+
getAvailableOptions: () => d.value,
|
|
113
|
+
isReady: () => k.value
|
|
114
|
+
}), { getAllRecursiveIds: K } = ge(), Q = ae({
|
|
115
|
+
...ie(o),
|
|
116
|
+
options: d
|
|
117
|
+
}), { currentValue: T, selectedLabel: H, selectOption: W } = ye(
|
|
118
|
+
Q,
|
|
119
|
+
g
|
|
120
|
+
), X = c(() => {
|
|
121
|
+
const e = o.ignoreClickOutside || [], n = K(d.value);
|
|
122
|
+
return [.../* @__PURE__ */ new Set([...e, ...n, ...h.value])];
|
|
112
123
|
});
|
|
113
|
-
|
|
114
|
-
() =>
|
|
124
|
+
P(
|
|
125
|
+
() => T.value,
|
|
115
126
|
(e) => {
|
|
116
|
-
|
|
127
|
+
k.value && A(e);
|
|
117
128
|
},
|
|
118
129
|
{ deep: !0 }
|
|
119
130
|
);
|
|
120
|
-
const
|
|
121
|
-
|
|
131
|
+
const Y = (e) => {
|
|
132
|
+
o.doubleConfirmation || !!e.confirmation ? (v.value = e, typeof e.confirmation == "object" ? r.value = {
|
|
122
133
|
title: e.confirmation.title || "Confirm Selection",
|
|
123
134
|
description: e.confirmation.description || "Are you sure you want to select this option?",
|
|
124
135
|
confirmText: e.confirmation.confirmText || "Confirm",
|
|
125
136
|
cancelText: e.confirmation.cancelText || "Cancel",
|
|
126
137
|
variant: e.confirmation.variant || "primary"
|
|
127
|
-
} :
|
|
138
|
+
} : r.value = {
|
|
128
139
|
title: "Confirm Selection",
|
|
129
140
|
description: `Are you sure you want to select "${e.label}"?`,
|
|
130
141
|
confirmText: "Confirm",
|
|
131
142
|
cancelText: "Cancel",
|
|
132
143
|
variant: "primary"
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
const t =
|
|
138
|
-
if (!
|
|
139
|
-
const
|
|
140
|
-
(e._path || [
|
|
141
|
-
typeof
|
|
144
|
+
}, y.value = !0, b()) : (D(e), o.closeOnSelect && b());
|
|
145
|
+
}, D = (e) => {
|
|
146
|
+
const n = e.value ?? e.label;
|
|
147
|
+
I.value.has(n) || I.value.set(n, e);
|
|
148
|
+
const t = W(e);
|
|
149
|
+
if (!o.isNested) {
|
|
150
|
+
const u = e._originalOption || e, a = u.value ?? u.label;
|
|
151
|
+
(e._path || [u]).forEach((B) => {
|
|
152
|
+
typeof B.onSelect == "function" && B.onSelect({
|
|
142
153
|
value: a,
|
|
143
|
-
option:
|
|
144
|
-
data:
|
|
154
|
+
option: B,
|
|
155
|
+
data: d.value || [],
|
|
145
156
|
values: t
|
|
146
157
|
});
|
|
147
158
|
});
|
|
148
159
|
}
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
|
|
160
|
+
}, Z = () => {
|
|
161
|
+
v.value && (D(v.value), v.value = null, y.value = !1);
|
|
162
|
+
}, _ = () => {
|
|
163
|
+
v.value = null, y.value = !1;
|
|
153
164
|
};
|
|
154
|
-
return (e,
|
|
165
|
+
return (e, n) => (L(), se("div", {
|
|
155
166
|
class: "relative inline-block text-left",
|
|
156
|
-
style:
|
|
167
|
+
style: re({ direction: l.direction })
|
|
157
168
|
}, [
|
|
158
|
-
|
|
169
|
+
x(p(me), {
|
|
159
170
|
content: "",
|
|
160
171
|
trigger: "click",
|
|
161
172
|
arrow: !1,
|
|
162
173
|
teleport: l.teleport,
|
|
163
174
|
offset: l.offset,
|
|
164
|
-
placement:
|
|
165
|
-
isOpen:
|
|
166
|
-
keepAlive:
|
|
167
|
-
menuId:
|
|
168
|
-
ignoreClickOutside:
|
|
175
|
+
placement: E.value,
|
|
176
|
+
isOpen: S.value,
|
|
177
|
+
keepAlive: C.value > 0,
|
|
178
|
+
menuId: $.value,
|
|
179
|
+
ignoreClickOutside: X.value,
|
|
169
180
|
class: "w-full",
|
|
170
181
|
className: "dropdown " + (l.className || ""),
|
|
171
|
-
onOnShow:
|
|
172
|
-
onOnHide:
|
|
173
|
-
"onUpdate:isOpen":
|
|
182
|
+
onOnShow: n[2] || (n[2] = (t) => e.$emit("onOpen")),
|
|
183
|
+
onOnHide: n[3] || (n[3] = (t) => e.$emit("onClose")),
|
|
184
|
+
"onUpdate:isOpen": M,
|
|
174
185
|
triggerClass: "w-full",
|
|
175
186
|
styles: { padding: "0" }
|
|
176
187
|
}, {
|
|
177
|
-
trigger:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
"selected-label":
|
|
188
|
+
trigger: f(({ isOpen: t }) => [
|
|
189
|
+
m(e.$slots, "trigger", V(R({ selectedLabel: p(H), isOpen: t })), () => [
|
|
190
|
+
x(he, {
|
|
191
|
+
"selected-label": p(H),
|
|
181
192
|
"is-open": t,
|
|
182
193
|
direction: l.direction,
|
|
183
194
|
triggerProps: l.triggerProps,
|
|
@@ -185,77 +196,77 @@ const be = /* @__PURE__ */ K({
|
|
|
185
196
|
}, null, 8, ["selected-label", "is-open", "direction", "triggerProps"])
|
|
186
197
|
])
|
|
187
198
|
]),
|
|
188
|
-
default:
|
|
189
|
-
|
|
190
|
-
|
|
199
|
+
default: f(() => [
|
|
200
|
+
m(e.$slots, "default"),
|
|
201
|
+
w.value.length || d.value.length || e.$slots.menu || e.$slots.item || l.remote || l.searchable ? (L(), ue(ve, {
|
|
191
202
|
key: 0,
|
|
192
|
-
options:
|
|
193
|
-
cachedOptions:
|
|
194
|
-
class:
|
|
195
|
-
selected:
|
|
203
|
+
options: w.value,
|
|
204
|
+
cachedOptions: d.value,
|
|
205
|
+
class: de(l.className),
|
|
206
|
+
selected: p(T),
|
|
196
207
|
selectedIndex: l.selectedIndex,
|
|
197
208
|
maxHeight: l.maxHeight,
|
|
198
|
-
nestedPosition:
|
|
209
|
+
nestedPosition: j.value,
|
|
199
210
|
nestedOffset: l.nestedOffset,
|
|
200
211
|
selectable: l.selectable,
|
|
201
212
|
direction: l.direction,
|
|
202
213
|
layout: l.layout,
|
|
203
214
|
columns: l.columns,
|
|
204
|
-
loading: l.loading ||
|
|
215
|
+
loading: l.loading || p(J),
|
|
205
216
|
hasMore: l.hasMore,
|
|
206
217
|
searchable: l.searchable,
|
|
207
218
|
remote: l.remote,
|
|
208
219
|
debounceTime: l.debounceTime,
|
|
209
|
-
onSelect:
|
|
210
|
-
onClose:
|
|
211
|
-
onLoadMore:
|
|
212
|
-
onSearch:
|
|
213
|
-
},
|
|
220
|
+
onSelect: Y,
|
|
221
|
+
onClose: b,
|
|
222
|
+
onLoadMore: n[0] || (n[0] = (t) => e.$emit("load-more")),
|
|
223
|
+
onSearch: n[1] || (n[1] = (t) => e.$emit("search", t))
|
|
224
|
+
}, ce({ _: 2 }, [
|
|
214
225
|
e.$slots.menu ? {
|
|
215
226
|
name: "menu",
|
|
216
|
-
fn:
|
|
217
|
-
|
|
227
|
+
fn: f(() => [
|
|
228
|
+
m(e.$slots, "menu")
|
|
218
229
|
]),
|
|
219
230
|
key: "0"
|
|
220
231
|
} : void 0,
|
|
221
232
|
e.$slots.item ? {
|
|
222
233
|
name: "item",
|
|
223
|
-
fn:
|
|
224
|
-
|
|
234
|
+
fn: f((t) => [
|
|
235
|
+
m(e.$slots, "item", V(R(t)))
|
|
225
236
|
]),
|
|
226
237
|
key: "1"
|
|
227
238
|
} : void 0,
|
|
228
239
|
e.$slots.header ? {
|
|
229
240
|
name: "header",
|
|
230
|
-
fn:
|
|
231
|
-
|
|
241
|
+
fn: f(() => [
|
|
242
|
+
m(e.$slots, "header")
|
|
232
243
|
]),
|
|
233
244
|
key: "2"
|
|
234
245
|
} : void 0,
|
|
235
246
|
e.$slots.footer ? {
|
|
236
247
|
name: "footer",
|
|
237
|
-
fn:
|
|
238
|
-
|
|
248
|
+
fn: f(() => [
|
|
249
|
+
m(e.$slots, "footer")
|
|
239
250
|
]),
|
|
240
251
|
key: "3"
|
|
241
252
|
} : void 0
|
|
242
|
-
]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) :
|
|
253
|
+
]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : fe("", !0)
|
|
243
254
|
]),
|
|
244
255
|
_: 3
|
|
245
256
|
}, 8, ["teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className"]),
|
|
246
|
-
|
|
247
|
-
show:
|
|
248
|
-
title:
|
|
249
|
-
description:
|
|
250
|
-
"confirm-text":
|
|
251
|
-
"cancel-text":
|
|
252
|
-
variant:
|
|
253
|
-
onConfirm:
|
|
254
|
-
onCancel:
|
|
257
|
+
x(pe, {
|
|
258
|
+
show: y.value,
|
|
259
|
+
title: r.value.title,
|
|
260
|
+
description: r.value.description,
|
|
261
|
+
"confirm-text": r.value.confirmText,
|
|
262
|
+
"cancel-text": r.value.cancelText,
|
|
263
|
+
variant: r.value.variant,
|
|
264
|
+
onConfirm: Z,
|
|
265
|
+
onCancel: _
|
|
255
266
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
|
|
256
267
|
], 4));
|
|
257
268
|
}
|
|
258
269
|
});
|
|
259
270
|
export {
|
|
260
|
-
|
|
271
|
+
xe as default
|
|
261
272
|
};
|
|
@@ -14,8 +14,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
14
14
|
onSelect?: (option: IDropdownOption) => any;
|
|
15
15
|
onMouseenter?: (payload: any) => any;
|
|
16
16
|
}>, {
|
|
17
|
-
selectable: boolean;
|
|
18
17
|
options: IDropdownOptions;
|
|
18
|
+
selectable: boolean;
|
|
19
19
|
columns: number | string;
|
|
20
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
21
21
|
export default _default;
|
|
@@ -49,8 +49,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
49
49
|
}>, {
|
|
50
50
|
class: string;
|
|
51
51
|
loading: boolean;
|
|
52
|
-
selectable: boolean;
|
|
53
52
|
options: (IDropdownOption | string | number)[];
|
|
53
|
+
selectable: boolean;
|
|
54
54
|
columns: number | string;
|
|
55
55
|
cachedOptions: IDropdownOptions;
|
|
56
56
|
selectedIndex: number | null;
|