vlite3 1.1.2 → 1.1.4
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/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
- package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
- package/components/Avatar.vue.js +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
- package/components/Button.vue.js +30 -28
- package/components/Carousel/Carousel.vue.d.ts +2 -2
- package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
- package/components/CategoryManager/CategoryManager.vue.js +137 -118
- package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
- package/components/CategoryManager/CategoryNode.vue.js +93 -88
- package/components/Chat/ChatBubble.vue.js +22 -22
- package/components/CheckBox.vue.js +29 -28
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/ConfirmationModal.vue.js +30 -28
- package/components/CopyButton.vue.d.ts +50 -0
- package/components/CopyButton.vue.js +69 -0
- package/components/CopyButton.vue2.js +4 -0
- package/components/DataTable/DataTable.vue.js +44 -44
- package/components/DatePicker.vue.js +41 -35
- package/components/DateRangePicker.vue.js +18 -17
- package/components/Dropdown/Dropdown.vue.d.ts +3 -0
- package/components/Dropdown/Dropdown.vue.js +117 -115
- package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
- package/components/Dropdown/DropdownItem.vue.js +21 -20
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/DropdownMenu.vue2.js +13 -12
- package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
- package/components/Dropdown/DropdownTrigger.vue.js +10 -6
- package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
- package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
- package/components/Dropdown/composables/useDropdownSelection.js +46 -31
- package/components/FilePicker/FilePicker.vue.js +93 -90
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +68 -64
- package/components/Form/FormField.vue.js +204 -148
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +28 -27
- package/components/Form/types.d.ts +2 -2
- package/components/Form/utils/form.utils.d.ts +3 -3
- package/components/Form/utils/form.utils.js +37 -37
- package/components/Input.vue.js +64 -62
- package/components/Invoice/Invoice.vue.js +9 -7
- package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
- package/components/Invoice/InvoiceTotals.vue.js +86 -0
- package/components/Invoice/InvoiceTotals.vue2.js +4 -0
- package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant1.vue.js +194 -207
- package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant2.vue.js +109 -118
- package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant3.vue.js +157 -167
- package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant4.vue.js +192 -202
- package/components/Invoice/index.d.ts +1 -0
- package/components/Invoice/types.d.ts +22 -0
- package/components/Masonry/Masonry.vue.d.ts +1 -1
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +60 -54
- package/components/MultiSelect/MultiSelect.vue.js +47 -46
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +121 -116
- package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +58 -52
- package/components/Stats/StatItem.vue.js +96 -91
- package/components/Stats/types.d.ts +1 -0
- package/components/Switch.vue.d.ts +6 -1
- package/components/Switch.vue.js +61 -24
- package/components/TagInput/TagInput.vue.d.ts +187 -0
- package/components/TagInput/TagInput.vue.js +113 -0
- package/components/TagInput/TagInput.vue2.js +4 -0
- package/components/TagInput/index.d.ts +1 -0
- package/components/Textarea.vue.js +19 -18
- package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
- package/core/config.d.ts +36 -0
- package/index.d.ts +2 -0
- package/index.js +130 -124
- package/package.json +1 -1
- package/style.css +616 -1
- package/types/button.d.ts +1 -1
- package/types/styles.d.ts +1 -0
- package/utils/functions.js +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as $, ref as b, watch as F, computed as u, openBlock as d, createBlock as m, unref as v, withCtx as D, createElementVNode as i, createElementBlock as w, Fragment as L, renderList as T, createCommentVNode as z, createVNode as h, normalizeClass as y, toDisplayString as x, createTextVNode as B } from "vue";
|
|
2
|
+
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 */
|
|
@@ -10,7 +10,7 @@ import "v-datepicker-lite/style.css";
|
|
|
10
10
|
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
11
|
key: 0,
|
|
12
12
|
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" }, te = /* @__PURE__ */
|
|
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" }, te = /* @__PURE__ */ $({
|
|
14
14
|
__name: "DateRangePicker",
|
|
15
15
|
props: {
|
|
16
16
|
modelValue: {},
|
|
@@ -28,7 +28,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
28
28
|
emits: ["update:modelValue", "change"],
|
|
29
29
|
setup(s, { emit: M }) {
|
|
30
30
|
const g = s, k = M, o = b(!1), c = b(0);
|
|
31
|
-
|
|
31
|
+
F(o, (a) => {
|
|
32
32
|
a && c.value++;
|
|
33
33
|
});
|
|
34
34
|
const n = u({
|
|
@@ -46,13 +46,13 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
46
46
|
n.value = { ...n.value, startDate: a };
|
|
47
47
|
}, S = (a) => {
|
|
48
48
|
n.value = { ...n.value, endDate: a };
|
|
49
|
-
},
|
|
49
|
+
}, C = u(() => {
|
|
50
50
|
if (n.value.endDate) {
|
|
51
51
|
const a = new Date(n.value.endDate);
|
|
52
52
|
if (!isNaN(a.getTime())) return a.toISOString();
|
|
53
53
|
}
|
|
54
54
|
return g.maxDate;
|
|
55
|
-
}),
|
|
55
|
+
}), N = u(() => {
|
|
56
56
|
if (n.value.startDate) {
|
|
57
57
|
const a = new Date(n.value.startDate);
|
|
58
58
|
if (!isNaN(a.getTime())) return a.toISOString();
|
|
@@ -66,7 +66,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
66
66
|
} catch {
|
|
67
67
|
return "";
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, V = u(() => [
|
|
70
70
|
{
|
|
71
71
|
label: l("vlite.dateRangePicker.today") !== "vlite.dateRangePicker.today" ? l("vlite.dateRangePicker.today") : "Today",
|
|
72
72
|
value: "today",
|
|
@@ -112,7 +112,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
112
112
|
value: "last_year",
|
|
113
113
|
icon: "lucide:history"
|
|
114
114
|
}
|
|
115
|
-
]),
|
|
115
|
+
]), _ = (a) => {
|
|
116
116
|
const e = /* @__PURE__ */ new Date();
|
|
117
117
|
let t = /* @__PURE__ */ new Date(), r = /* @__PURE__ */ new Date();
|
|
118
118
|
switch (e.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0), a.value) {
|
|
@@ -146,7 +146,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
146
146
|
}
|
|
147
147
|
n.value = { startDate: t, endDate: r }, c.value++, o.value = !1;
|
|
148
148
|
};
|
|
149
|
-
return (a, e) => (d(), m(v(
|
|
149
|
+
return (a, e) => (d(), m(v(E), {
|
|
150
150
|
isOpen: o.value,
|
|
151
151
|
"onUpdate:isOpen": e[0] || (e[0] = (t) => o.value = t),
|
|
152
152
|
position: "bottom-start",
|
|
@@ -160,36 +160,37 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
160
160
|
variant: s.variant || "outline",
|
|
161
161
|
size: s.size || "md",
|
|
162
162
|
disabled: s.disabled,
|
|
163
|
-
class: y(["w-full justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": t }]])
|
|
163
|
+
class: y(["w-full justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": t }]]),
|
|
164
|
+
"data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `daterange-${a.$attrs.name}` : "daterange")
|
|
164
165
|
}, {
|
|
165
166
|
default: D(() => [
|
|
166
167
|
i("div", j, [
|
|
167
168
|
i("span", {
|
|
168
169
|
class: y({ "text-muted-foreground": !n.value.startDate })
|
|
169
170
|
}, x(n.value.startDate ? f(n.value.startDate) : s.placeholderStart), 3),
|
|
170
|
-
e[1] || (e[1] =
|
|
171
|
+
e[1] || (e[1] = B(" — ", -1)),
|
|
171
172
|
i("span", {
|
|
172
173
|
class: y({ "text-muted-foreground": !n.value.endDate })
|
|
173
174
|
}, x(n.value.endDate ? f(n.value.endDate) : s.placeholderEnd), 3)
|
|
174
175
|
])
|
|
175
176
|
]),
|
|
176
177
|
_: 1
|
|
177
|
-
}, 8, ["variant", "size", "disabled", "class"])
|
|
178
|
+
}, 8, ["variant", "size", "disabled", "class", "data-testid"])
|
|
178
179
|
]),
|
|
179
180
|
menu: D(() => [
|
|
180
181
|
i("div", H, [
|
|
181
182
|
s.showQuickRanges ? (d(), w("div", Q, [
|
|
182
183
|
e[2] || (e[2] = i("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
|
|
183
|
-
(d(!0), w(
|
|
184
|
+
(d(!0), w(L, null, T(V.value, (t) => (d(), m(P, {
|
|
184
185
|
key: t.value,
|
|
185
186
|
text: t.label,
|
|
186
187
|
icon: t.icon,
|
|
187
188
|
variant: "ghost",
|
|
188
189
|
size: "sm",
|
|
189
190
|
class: "justify-start w-full font-normal",
|
|
190
|
-
onClick: (r) =>
|
|
191
|
+
onClick: (r) => _(t)
|
|
191
192
|
}, null, 8, ["text", "icon", "onClick"]))), 128))
|
|
192
|
-
])) :
|
|
193
|
+
])) : z("", !0),
|
|
193
194
|
i("div", O, [
|
|
194
195
|
i("div", I, [
|
|
195
196
|
(d(), m(v(p), {
|
|
@@ -197,7 +198,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
197
198
|
value: n.value.startDate,
|
|
198
199
|
onChange: Y,
|
|
199
200
|
mode: "date",
|
|
200
|
-
"max-date":
|
|
201
|
+
"max-date": C.value,
|
|
201
202
|
"min-date": s.minDate,
|
|
202
203
|
disabled: s.disabled,
|
|
203
204
|
class: "min-w-[270px]",
|
|
@@ -220,7 +221,7 @@ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class
|
|
|
220
221
|
value: n.value.endDate,
|
|
221
222
|
onChange: S,
|
|
222
223
|
mode: "date",
|
|
223
|
-
"min-date":
|
|
224
|
+
"min-date": N.value,
|
|
224
225
|
"max-date": s.maxDate,
|
|
225
226
|
class: "min-w-[270px]",
|
|
226
227
|
disabled: s.disabled,
|
|
@@ -22,6 +22,7 @@ type __VLS_Props = {
|
|
|
22
22
|
nestedPosition?: TooltTipPlacement;
|
|
23
23
|
nestedOffset?: [number, number];
|
|
24
24
|
showSelectedLabel?: boolean;
|
|
25
|
+
showSelectedIcon?: boolean;
|
|
25
26
|
selectable?: boolean;
|
|
26
27
|
doubleConfirmation?: boolean;
|
|
27
28
|
layout?: 'default' | 'grouped';
|
|
@@ -42,6 +43,7 @@ declare function __VLS_template(): {
|
|
|
42
43
|
slots: {
|
|
43
44
|
trigger?(_: {
|
|
44
45
|
selectedLabel: string;
|
|
46
|
+
selectedIcon: string;
|
|
45
47
|
isOpen: boolean;
|
|
46
48
|
}): any;
|
|
47
49
|
default?(_: {}): any;
|
|
@@ -104,6 +106,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
104
106
|
isOpen: boolean;
|
|
105
107
|
teleport: boolean;
|
|
106
108
|
showSelectedLabel: boolean;
|
|
109
|
+
showSelectedIcon: boolean;
|
|
107
110
|
doubleConfirmation: boolean;
|
|
108
111
|
isNested: boolean;
|
|
109
112
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as oe, ref as i, computed as f, inject as ae, onMounted as ie, onUnmounted as se, watch as P, provide as R, reactive as re, toRefs as de, openBlock as x, createElementBlock as z, normalizeStyle as ue, createVNode as M, unref as u, withCtx as m, renderSlot as v, createCommentVNode as E, createBlock as ce, normalizeClass as fe, createSlots as me, normalizeProps as j, guardReactiveProps as U } from "vue";
|
|
2
|
+
import ve from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import he from "./DropdownMenu.vue.js";
|
|
5
|
+
import ge from "./DropdownTrigger.vue.js";
|
|
6
6
|
import pe from "../ConfirmationModal.vue.js";
|
|
7
|
-
import { useDropdownIds as
|
|
8
|
-
import { useDropdownSelection as
|
|
9
|
-
import { useDropdownHydration as
|
|
10
|
-
const
|
|
7
|
+
import { useDropdownIds as ye } from "./composables/useDropdownIds.js";
|
|
8
|
+
import { useDropdownSelection as be } from "./composables/useDropdownSelection.js";
|
|
9
|
+
import { useDropdownHydration as Ce } from "./composables/useDropdownHydration.js";
|
|
10
|
+
const Oe = {
|
|
11
11
|
key: 0,
|
|
12
12
|
tabindex: "0"
|
|
13
|
-
},
|
|
13
|
+
}, Ne = /* @__PURE__ */ oe({
|
|
14
14
|
__name: "Dropdown",
|
|
15
15
|
props: {
|
|
16
16
|
selected: {},
|
|
@@ -34,6 +34,7 @@ const Ce = {
|
|
|
34
34
|
nestedPosition: {},
|
|
35
35
|
nestedOffset: {},
|
|
36
36
|
showSelectedLabel: { type: Boolean, default: !0 },
|
|
37
|
+
showSelectedIcon: { type: Boolean, default: !1 },
|
|
37
38
|
selectable: { type: Boolean, default: !0 },
|
|
38
39
|
doubleConfirmation: { type: Boolean, default: !1 },
|
|
39
40
|
layout: { default: "default" },
|
|
@@ -50,22 +51,22 @@ const Ce = {
|
|
|
50
51
|
disabled: { type: Boolean, default: !1 }
|
|
51
52
|
},
|
|
52
53
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
53
|
-
setup(
|
|
54
|
-
const o =
|
|
54
|
+
setup(t, { emit: q }) {
|
|
55
|
+
const o = t, h = q, y = i(!1), g = i(null), r = i({
|
|
55
56
|
title: "Confirm Selection",
|
|
56
57
|
description: "Are you sure you want to select this option?",
|
|
57
58
|
confirmText: "Confirm",
|
|
58
59
|
cancelText: "Cancel",
|
|
59
60
|
variant: "primary"
|
|
60
|
-
}),
|
|
61
|
+
}), F = f(() => o.position ? o.position : o.direction === "rtl" ? "bottom-end" : "bottom-start"), G = f(() => o.nestedPosition ? o.nestedPosition : o.direction === "rtl" ? "left-start" : "right-start"), b = i(o.isOpen || !1), C = i(0), J = `dropdown-${Math.random().toString(36).substring(2, 9)}`, w = f(() => o.menuId || J), p = i([]), s = ae("dropdown-context", null), K = (e) => {
|
|
61
62
|
p.value.includes(e) || p.value.push(e), s?.registerChildId?.(e);
|
|
62
|
-
},
|
|
63
|
+
}, Q = (e) => {
|
|
63
64
|
p.value = p.value.filter((n) => n !== e), s?.unregisterChildId?.(e);
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
-
s?.registerChildId && s.registerChildId(`#${
|
|
67
|
-
}),
|
|
68
|
-
s?.unregisterChildId && s.unregisterChildId(`#${
|
|
66
|
+
ie(() => {
|
|
67
|
+
s?.registerChildId && s.registerChildId(`#${w.value}`);
|
|
68
|
+
}), se(() => {
|
|
69
|
+
s?.unregisterChildId && s.unregisterChildId(`#${w.value}`);
|
|
69
70
|
}), P(
|
|
70
71
|
() => o.isOpen,
|
|
71
72
|
(e) => {
|
|
@@ -77,71 +78,71 @@ const Ce = {
|
|
|
77
78
|
);
|
|
78
79
|
const N = (e) => {
|
|
79
80
|
if (o.disabled) {
|
|
80
|
-
b.value = !1,
|
|
81
|
+
b.value = !1, h("update:isOpen", !1);
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
|
-
b.value = e,
|
|
84
|
+
b.value = e, h("update:isOpen", e), h(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
|
|
84
85
|
}, O = () => {
|
|
85
86
|
N(!1);
|
|
86
|
-
},
|
|
87
|
+
}, W = (e) => {
|
|
87
88
|
e ? C.value++ : C.value = Math.max(0, C.value - 1);
|
|
88
89
|
};
|
|
89
|
-
|
|
90
|
+
R("dropdown-context", {
|
|
90
91
|
close: O,
|
|
91
92
|
onChildToggle: (e) => {
|
|
92
|
-
|
|
93
|
+
W(e), s?.onChildToggle?.(e);
|
|
93
94
|
},
|
|
94
|
-
registerChildId:
|
|
95
|
-
unregisterChildId:
|
|
96
|
-
}),
|
|
97
|
-
const
|
|
95
|
+
registerChildId: K,
|
|
96
|
+
unregisterChildId: Q
|
|
97
|
+
}), R("modal-context", null);
|
|
98
|
+
const I = f(() => o.options ? o.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), S = i([]), A = i(!1), $ = i(!1);
|
|
98
99
|
P(
|
|
99
|
-
|
|
100
|
+
I,
|
|
100
101
|
(e) => {
|
|
101
102
|
if (e) {
|
|
102
103
|
if (o.remote) {
|
|
103
104
|
const n = [...S.value];
|
|
104
|
-
e.forEach((
|
|
105
|
-
n.some((a) => a.value !== void 0 &&
|
|
105
|
+
e.forEach((l) => {
|
|
106
|
+
n.some((a) => a.value !== void 0 && l.value !== void 0 ? typeof a.value == "object" && a.key && l.key ? a.key === l.key && a.value[a.key] === l.value[l.key] : a.value === l.value : a.label === l.label) || n.push(l);
|
|
106
107
|
}), S.value = n;
|
|
107
108
|
} else
|
|
108
109
|
S.value = e;
|
|
109
110
|
!A.value && e.length > 0 && (A.value = !0, setTimeout(() => {
|
|
110
|
-
|
|
111
|
+
$.value = !0, H(T.value);
|
|
111
112
|
}, 10));
|
|
112
113
|
}
|
|
113
114
|
},
|
|
114
115
|
{ immediate: !0 }
|
|
115
116
|
);
|
|
116
|
-
const
|
|
117
|
-
const e = [...S.value], n = new Set(e.map((
|
|
118
|
-
return
|
|
119
|
-
n.has(d) || (e.unshift(
|
|
117
|
+
const c = f(() => {
|
|
118
|
+
const e = [...S.value], n = new Set(e.map((l) => l.value ?? l.label));
|
|
119
|
+
return k.value.forEach((l, d) => {
|
|
120
|
+
n.has(d) || (e.unshift(l), n.add(d));
|
|
120
121
|
}), e;
|
|
121
|
-
}), { selectedBuffer:
|
|
122
|
+
}), { selectedBuffer: k, isHydrating: X, hydrateSelected: H } = Ce({
|
|
122
123
|
fetchSelected: o.fetchSelected,
|
|
123
|
-
getAvailableOptions: () =>
|
|
124
|
-
isReady: () =>
|
|
125
|
-
}), { getAllRecursiveIds:
|
|
126
|
-
...
|
|
127
|
-
options:
|
|
128
|
-
}), { currentValue: T, selectedLabel: D, selectOption:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
),
|
|
132
|
-
const e = o.ignoreClickOutside || [], n =
|
|
124
|
+
getAvailableOptions: () => c.value,
|
|
125
|
+
isReady: () => $.value
|
|
126
|
+
}), { getAllRecursiveIds: Y } = ye(), Z = re({
|
|
127
|
+
...de(o),
|
|
128
|
+
options: c
|
|
129
|
+
}), { currentValue: T, selectedLabel: D, selectedIcon: L, selectOption: _ } = be(
|
|
130
|
+
Z,
|
|
131
|
+
h
|
|
132
|
+
), ee = f(() => {
|
|
133
|
+
const e = o.ignoreClickOutside || [], n = Y(c.value);
|
|
133
134
|
return [.../* @__PURE__ */ new Set([...e, ...n, ...p.value])];
|
|
134
135
|
});
|
|
135
136
|
P(
|
|
136
137
|
() => T.value,
|
|
137
138
|
(e) => {
|
|
138
|
-
|
|
139
|
+
$.value && H(e);
|
|
139
140
|
},
|
|
140
141
|
{ deep: !0 }
|
|
141
142
|
);
|
|
142
|
-
const
|
|
143
|
+
const te = (e) => {
|
|
143
144
|
if (o.disabled || e.disabled) return;
|
|
144
|
-
o.doubleConfirmation || !!e.confirmation ? (
|
|
145
|
+
o.doubleConfirmation || !!e.confirmation ? (g.value = e, typeof e.confirmation == "object" ? r.value = {
|
|
145
146
|
title: e.confirmation.title || "Confirm Selection",
|
|
146
147
|
description: e.confirmation.description || "Are you sure you want to select this option?",
|
|
147
148
|
confirmText: e.confirmation.confirmText || "Confirm",
|
|
@@ -153,120 +154,121 @@ const Ce = {
|
|
|
153
154
|
confirmText: "Confirm",
|
|
154
155
|
cancelText: "Cancel",
|
|
155
156
|
variant: "primary"
|
|
156
|
-
}, y.value = !0, O()) : (
|
|
157
|
-
},
|
|
157
|
+
}, y.value = !0, O()) : (V(e), o.closeOnSelect && O());
|
|
158
|
+
}, V = (e) => {
|
|
158
159
|
if (o.disabled || e.disabled) return;
|
|
159
160
|
const n = e.value ?? e.label;
|
|
160
|
-
|
|
161
|
-
const
|
|
161
|
+
k.value.has(n) || k.value.set(n, e);
|
|
162
|
+
const l = _(e);
|
|
162
163
|
if (!o.isNested) {
|
|
163
164
|
const d = e._originalOption || e, a = d.value ?? d.label;
|
|
164
165
|
(e._path || [d]).forEach((B) => {
|
|
165
166
|
typeof B.onSelect == "function" && B.onSelect({
|
|
166
167
|
value: a,
|
|
167
168
|
option: B,
|
|
168
|
-
data:
|
|
169
|
-
values:
|
|
169
|
+
data: c.value || [],
|
|
170
|
+
values: l
|
|
170
171
|
});
|
|
171
172
|
});
|
|
172
173
|
}
|
|
173
|
-
}, te = () => {
|
|
174
|
-
h.value && (L(h.value), h.value = null, y.value = !1);
|
|
175
174
|
}, le = () => {
|
|
176
|
-
|
|
175
|
+
g.value && (V(g.value), g.value = null, y.value = !1);
|
|
176
|
+
}, ne = () => {
|
|
177
|
+
g.value = null, y.value = !1;
|
|
177
178
|
};
|
|
178
|
-
return (e, n) => (x(),
|
|
179
|
+
return (e, n) => (x(), z("div", {
|
|
179
180
|
class: "relative inline-block text-left",
|
|
180
|
-
style:
|
|
181
|
+
style: ue({ direction: t.direction })
|
|
181
182
|
}, [
|
|
182
|
-
M(
|
|
183
|
+
M(u(ve), {
|
|
183
184
|
content: "",
|
|
184
185
|
trigger: "click",
|
|
185
186
|
arrow: !1,
|
|
186
|
-
teleport:
|
|
187
|
-
offset:
|
|
188
|
-
placement:
|
|
187
|
+
teleport: t.teleport,
|
|
188
|
+
offset: t.offset,
|
|
189
|
+
placement: F.value,
|
|
189
190
|
isOpen: b.value,
|
|
190
191
|
keepAlive: C.value > 0,
|
|
191
|
-
menuId:
|
|
192
|
-
ignoreClickOutside:
|
|
192
|
+
menuId: w.value,
|
|
193
|
+
ignoreClickOutside: ee.value,
|
|
193
194
|
class: "w-full",
|
|
194
|
-
className: "dropdown " + (
|
|
195
|
-
onOnShow: n[2] || (n[2] = (
|
|
196
|
-
onOnHide: n[3] || (n[3] = (
|
|
195
|
+
className: "dropdown " + (t.className || ""),
|
|
196
|
+
onOnShow: n[2] || (n[2] = (l) => e.$emit("onOpen")),
|
|
197
|
+
onOnHide: n[3] || (n[3] = (l) => e.$emit("onClose")),
|
|
197
198
|
"onUpdate:isOpen": N,
|
|
198
199
|
triggerClass: "w-full",
|
|
199
200
|
styles: { padding: "0" }
|
|
200
201
|
}, {
|
|
201
|
-
trigger:
|
|
202
|
-
|
|
203
|
-
M(
|
|
204
|
-
"selected-label":
|
|
205
|
-
"
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
trigger: m(({ isOpen: l }) => [
|
|
203
|
+
v(e.$slots, "trigger", j(U({ selectedLabel: u(D), selectedIcon: t.showSelectedIcon ? u(L) : void 0, isOpen: l })), () => [
|
|
204
|
+
M(ge, {
|
|
205
|
+
"selected-label": u(D),
|
|
206
|
+
"selected-icon": t.showSelectedIcon ? u(L) : void 0,
|
|
207
|
+
"is-open": l,
|
|
208
|
+
direction: t.direction,
|
|
209
|
+
disabled: t.disabled,
|
|
210
|
+
triggerProps: t.triggerProps,
|
|
209
211
|
class: "w-full"
|
|
210
|
-
}, null, 8, ["selected-label", "is-open", "direction", "disabled", "triggerProps"])
|
|
212
|
+
}, null, 8, ["selected-label", "selected-icon", "is-open", "direction", "disabled", "triggerProps"])
|
|
211
213
|
])
|
|
212
214
|
]),
|
|
213
|
-
default:
|
|
214
|
-
e.$slots?.default ? (x(),
|
|
215
|
-
|
|
216
|
-
])) :
|
|
217
|
-
!
|
|
215
|
+
default: m(() => [
|
|
216
|
+
e.$slots?.default ? (x(), z("span", Oe, [
|
|
217
|
+
v(e.$slots, "default")
|
|
218
|
+
])) : E("", !0),
|
|
219
|
+
!t.disabled && (I.value.length || c.value.length || e.$slots.menu || e.$slots.item || t.remote || t.searchable) ? (x(), ce(he, {
|
|
218
220
|
key: 1,
|
|
219
|
-
options:
|
|
220
|
-
cachedOptions:
|
|
221
|
-
class:
|
|
222
|
-
selected:
|
|
223
|
-
selectedIndex:
|
|
224
|
-
maxHeight:
|
|
225
|
-
nestedPosition:
|
|
226
|
-
nestedOffset:
|
|
227
|
-
selectable:
|
|
228
|
-
direction:
|
|
229
|
-
layout:
|
|
230
|
-
columns:
|
|
231
|
-
loading:
|
|
232
|
-
hasMore:
|
|
233
|
-
searchable:
|
|
234
|
-
remote:
|
|
235
|
-
debounceTime:
|
|
236
|
-
onSelect:
|
|
221
|
+
options: I.value,
|
|
222
|
+
cachedOptions: c.value,
|
|
223
|
+
class: fe(t.className),
|
|
224
|
+
selected: u(T),
|
|
225
|
+
selectedIndex: t.selectedIndex,
|
|
226
|
+
maxHeight: t.maxHeight,
|
|
227
|
+
nestedPosition: G.value,
|
|
228
|
+
nestedOffset: t.nestedOffset,
|
|
229
|
+
selectable: t.selectable,
|
|
230
|
+
direction: t.direction,
|
|
231
|
+
layout: t.layout,
|
|
232
|
+
columns: t.columns,
|
|
233
|
+
loading: t.loading || u(X),
|
|
234
|
+
hasMore: t.hasMore,
|
|
235
|
+
searchable: t.searchable,
|
|
236
|
+
remote: t.remote,
|
|
237
|
+
debounceTime: t.debounceTime,
|
|
238
|
+
onSelect: te,
|
|
237
239
|
onClose: O,
|
|
238
|
-
onLoadMore: n[0] || (n[0] = (
|
|
239
|
-
onSearch: n[1] || (n[1] = (
|
|
240
|
-
},
|
|
240
|
+
onLoadMore: n[0] || (n[0] = (l) => e.$emit("load-more")),
|
|
241
|
+
onSearch: n[1] || (n[1] = (l) => e.$emit("search", l))
|
|
242
|
+
}, me({ _: 2 }, [
|
|
241
243
|
e.$slots.menu ? {
|
|
242
244
|
name: "menu",
|
|
243
|
-
fn:
|
|
244
|
-
|
|
245
|
+
fn: m(() => [
|
|
246
|
+
v(e.$slots, "menu")
|
|
245
247
|
]),
|
|
246
248
|
key: "0"
|
|
247
249
|
} : void 0,
|
|
248
250
|
e.$slots.item ? {
|
|
249
251
|
name: "item",
|
|
250
|
-
fn:
|
|
251
|
-
|
|
252
|
+
fn: m((l) => [
|
|
253
|
+
v(e.$slots, "item", j(U(l)))
|
|
252
254
|
]),
|
|
253
255
|
key: "1"
|
|
254
256
|
} : void 0,
|
|
255
257
|
e.$slots.header ? {
|
|
256
258
|
name: "header",
|
|
257
|
-
fn:
|
|
258
|
-
|
|
259
|
+
fn: m(() => [
|
|
260
|
+
v(e.$slots, "header")
|
|
259
261
|
]),
|
|
260
262
|
key: "2"
|
|
261
263
|
} : void 0,
|
|
262
264
|
e.$slots.footer ? {
|
|
263
265
|
name: "footer",
|
|
264
|
-
fn:
|
|
265
|
-
|
|
266
|
+
fn: m(() => [
|
|
267
|
+
v(e.$slots, "footer")
|
|
266
268
|
]),
|
|
267
269
|
key: "3"
|
|
268
270
|
} : void 0
|
|
269
|
-
]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) :
|
|
271
|
+
]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : E("", !0)
|
|
270
272
|
]),
|
|
271
273
|
_: 3
|
|
272
274
|
}, 8, ["teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className"]),
|
|
@@ -277,12 +279,12 @@ const Ce = {
|
|
|
277
279
|
"confirm-text": r.value.confirmText,
|
|
278
280
|
"cancel-text": r.value.cancelText,
|
|
279
281
|
variant: r.value.variant,
|
|
280
|
-
onConfirm:
|
|
281
|
-
onCancel:
|
|
282
|
+
onConfirm: le,
|
|
283
|
+
onCancel: ne
|
|
282
284
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
|
|
283
285
|
], 4));
|
|
284
286
|
}
|
|
285
287
|
});
|
|
286
288
|
export {
|
|
287
|
-
|
|
289
|
+
Ne as default
|
|
288
290
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as m, computed as d, openBlock as a, createElementBlock as u, withModifiers as p, normalizeClass as f, createElementVNode as l, createBlock as g, createCommentVNode as h, toDisplayString as v, createVNode as b } from "vue";
|
|
2
|
+
import x from "../Switch.vue.js";
|
|
3
3
|
import y from "../Icon.vue.js";
|
|
4
4
|
import { $t as k } from "../../utils/i18n.js";
|
|
5
|
-
const w = { class: "flex items-center gap-2 flex-1 min-w-0" },
|
|
5
|
+
const w = ["data-testid"], B = { class: "flex items-center gap-2 flex-1 min-w-0" }, $ = { class: "truncate font-medium" }, z = /* @__PURE__ */ m({
|
|
6
6
|
__name: "DropdownBooleanItem",
|
|
7
7
|
props: {
|
|
8
8
|
option: {},
|
|
@@ -11,36 +11,37 @@ const w = { class: "flex items-center gap-2 flex-1 min-w-0" }, B = { class: "tru
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["change"],
|
|
13
13
|
setup(e, { emit: c }) {
|
|
14
|
-
const o = e, s = c,
|
|
14
|
+
const o = e, s = c, r = d(
|
|
15
15
|
() => o.option.labelI18n ? k(o.option.labelI18n) : o.option.label
|
|
16
|
-
),
|
|
17
|
-
s("change",
|
|
16
|
+
), n = (t) => {
|
|
17
|
+
s("change", t, o.option);
|
|
18
18
|
};
|
|
19
|
-
return (
|
|
19
|
+
return (t, i) => (a(), u("div", {
|
|
20
20
|
tabindex: "0",
|
|
21
21
|
"data-dropdown-item": "",
|
|
22
22
|
class: f(["relative flex cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", [
|
|
23
23
|
e.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
|
|
24
24
|
]]),
|
|
25
|
-
|
|
25
|
+
"data-testid": t.$attrs["data-testid"] || `dropdown-item-bool-${e.option.key || e.option.label}`.toLowerCase().replace(/[^a-z0-9]+/g, "-"),
|
|
26
|
+
onClick: i[0] || (i[0] = p((j) => n(!e.value), ["stop"]))
|
|
26
27
|
}, [
|
|
27
|
-
l("div",
|
|
28
|
+
l("div", B, [
|
|
28
29
|
e.option.icon || e.option.emoji ? (a(), g(y, {
|
|
29
30
|
key: 0,
|
|
30
31
|
icon: e.option.icon,
|
|
31
32
|
emoji: e.option.emoji,
|
|
32
33
|
class: "h-4 w-4 shrink-0 opacity-70"
|
|
33
|
-
}, null, 8, ["icon", "emoji"])) :
|
|
34
|
-
l("span",
|
|
34
|
+
}, null, 8, ["icon", "emoji"])) : h("", !0),
|
|
35
|
+
l("span", $, v(r.value), 1)
|
|
35
36
|
]),
|
|
36
|
-
x
|
|
37
|
+
b(x, {
|
|
37
38
|
"model-value": e.value,
|
|
38
39
|
class: "ml-3 shrink-0 scale-75 origin-right",
|
|
39
|
-
"onUpdate:modelValue":
|
|
40
|
+
"onUpdate:modelValue": n
|
|
40
41
|
}, null, 8, ["model-value"])
|
|
41
|
-
],
|
|
42
|
+
], 10, w));
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
z as default
|
|
46
47
|
};
|