vlite3 1.1.2 → 1.1.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/README.md +5 -0
- 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 +138 -119
- package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
- package/components/CategoryManager/CategoryNode.vue.js +93 -88
- package/components/Chart/BarChart.vue.d.ts +48 -0
- package/components/Chart/CircleChart.vue.d.ts +47 -0
- package/components/Chart/LineChart.vue.d.ts +55 -0
- package/components/Chart/PieChart.vue.d.ts +49 -0
- package/components/Chart/index.d.ts +5 -0
- package/components/Chart/types.d.ts +135 -0
- package/components/Chart/utils.d.ts +40 -0
- package/components/Chat/ChatBubble.vue.js +22 -22
- package/components/CheckBox.vue.js +29 -28
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/Comment/CommentEditor.vue.d.ts +41 -0
- package/components/Comment/CommentEditor.vue.js +221 -0
- package/components/Comment/CommentEditor.vue2.js +4 -0
- package/components/Comment/CommentItem.vue.d.ts +70 -0
- package/components/Comment/CommentItem.vue.js +7 -0
- package/components/Comment/CommentItem.vue2.js +322 -0
- package/components/Comment/CommentThread.vue.d.ts +64 -0
- package/components/Comment/CommentThread.vue.js +185 -0
- package/components/Comment/CommentThread.vue2.js +4 -0
- package/components/Comment/index.d.ts +4 -0
- package/components/Comment/types.d.ts +34 -0
- 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.d.ts +2 -4
- package/components/DataTable/DataTable.vue.js +184 -235
- package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
- package/components/DataTable/DataTableHeader.vue.js +24 -23
- package/components/DataTable/DataTableRow.vue.d.ts +2 -0
- package/components/DataTable/DataTableRow.vue.js +32 -31
- package/components/DataTable/types.d.ts +2 -9
- package/components/DatePicker.vue.js +41 -35
- package/components/DateRangePicker.vue.js +18 -17
- package/components/Dropdown/Dropdown.vue.d.ts +5 -0
- package/components/Dropdown/Dropdown.vue.js +141 -137
- 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 +4 -0
- package/components/Dropdown/DropdownTrigger.vue.js +12 -7
- 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/Empty/Empty.vue.js +7 -5
- package/components/Empty/index.d.ts +1 -1
- package/components/Empty/variants/Variant12.vue.d.ts +22 -0
- package/components/Empty/variants/Variant12.vue.js +35 -0
- package/components/Empty/variants/Variant12.vue2.js +4 -0
- package/components/FilePicker/FilePicker.vue.js +93 -90
- package/components/Footer/Footer.vue.d.ts +3 -0
- package/components/Footer/Variant1.vue.d.ts +20 -0
- package/components/Footer/Variant2.vue.d.ts +20 -0
- package/components/Footer/Variant3.vue.d.ts +12 -0
- package/components/Footer/index.d.ts +2 -0
- package/components/Footer/types.d.ts +73 -0
- package/components/Form/CustomFields.vue.d.ts +2 -0
- package/components/Form/CustomFields.vue.js +1 -1
- package/components/Form/CustomFields.vue2.js +125 -122
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +68 -64
- package/components/Form/FormField.vue.js +205 -149
- 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.d.ts +2 -0
- package/components/MultiSelect/MultiSelect.vue.js +92 -90
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +127 -121
- package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
- package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +26 -0
- package/components/RichTextEditor/RichTextReader.vue.d.ts +7 -0
- package/components/RichTextEditor/RichTextToolbar.vue.d.ts +24 -0
- package/components/RichTextEditor/composables/useRichTextImageUpload.d.ts +14 -0
- package/components/RichTextEditor/composables/useRichTextLinks.d.ts +32 -0
- package/components/RichTextEditor/index.d.ts +2 -0
- package/components/Screen/Screen.vue.js +45 -46
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +58 -52
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
- package/components/SidebarMenu/SidebarMenu.vue.js +192 -91
- package/components/SidebarMenu/SidebarMenu.vue3.js +5 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.js +170 -157
- package/components/SidebarMenu/types.d.ts +12 -3
- package/components/{DataTable/DataTableToolbar.vue.d.ts → Splitter/Splitter.vue.d.ts} +18 -15
- package/components/Splitter/Splitter.vue.js +64 -0
- package/components/Splitter/Splitter.vue2.js +4 -0
- package/components/Splitter/index.d.ts +1 -0
- package/components/Stats/StatItem.vue.js +96 -91
- package/components/Stats/types.d.ts +1 -0
- package/components/StatusChip/status-map.js +34 -2
- 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/components/index.d.ts +4 -0
- package/core/config.d.ts +54 -0
- package/index.d.ts +4 -0
- package/index.js +300 -285
- package/package.json +1 -1
- package/style.css +657 -6
- package/types/button.d.ts +1 -1
- package/types/config.type.d.ts +2 -0
- package/types/styles.d.ts +1 -0
- package/utils/functions.js +9 -9
- package/components/DataTable/DataTableToolbar.vue.js +0 -60
- package/components/DataTable/DataTableToolbar.vue2.js +0 -4
- package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
package/components/Modal.vue2.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as P, ref as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as P, ref as f, inject as R, computed as h, markRaw as V, watch as T, provide as W, nextTick as K, onMounted as L, onUnmounted as A, openBlock as s, createElementBlock as d, Fragment as U, mergeProps as B, withModifiers as S, renderSlot as v, createCommentVNode as n, createBlock as I, Teleport as q, normalizeClass as i, createElementVNode as b, toDisplayString as z, createVNode as G, resolveDynamicComponent as H } from "vue";
|
|
2
|
+
import J from "./Button.vue.js";
|
|
3
3
|
import { useKeyStroke as Q } from "../composables/useKeyStroke.js";
|
|
4
|
-
import { $t as
|
|
5
|
-
const X = {
|
|
4
|
+
import { $t as F } from "../utils/i18n.js";
|
|
5
|
+
const X = ["data-testid"], Y = ["data-testid"], Z = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
|
|
8
|
-
},
|
|
8
|
+
}, _ = { class: "text-lg font-semibold leading-none tracking-tight" }, ee = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "text-sm text-muted-foreground mb-3.5"
|
|
11
|
-
},
|
|
11
|
+
}, ae = /* @__PURE__ */ P({
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "Modal",
|
|
14
14
|
props: {
|
|
@@ -28,107 +28,113 @@ const X = {
|
|
|
28
28
|
bodyProps: {}
|
|
29
29
|
},
|
|
30
30
|
emits: ["close", "update:show", "onOpen"],
|
|
31
|
-
setup(t, { emit:
|
|
32
|
-
const o = t,
|
|
33
|
-
let
|
|
34
|
-
const y =
|
|
31
|
+
setup(t, { emit: O }) {
|
|
32
|
+
const o = t, u = O, l = f(o.show), k = f(!1), g = f(!1), C = f(null);
|
|
33
|
+
let c = null;
|
|
34
|
+
const y = f(!1), a = R("dropdown-context", null), w = h(() => o.body ? V(o.body) : void 0);
|
|
35
35
|
T(
|
|
36
36
|
() => o.show,
|
|
37
37
|
(e) => {
|
|
38
|
-
l.value = e, e && (
|
|
38
|
+
l.value = e, e && (u("onOpen"), a?.close());
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
|
-
const
|
|
42
|
-
l.value = !0,
|
|
41
|
+
const j = () => {
|
|
42
|
+
l.value = !0, a?.close();
|
|
43
43
|
}, D = (e) => {
|
|
44
|
-
|
|
44
|
+
k.value = e;
|
|
45
45
|
}, E = (e) => {
|
|
46
46
|
y.value = e;
|
|
47
|
-
},
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
}, m = () => {
|
|
48
|
+
if (k.value) {
|
|
49
|
+
g.value = !0, c && clearTimeout(c), c = setTimeout(() => {
|
|
50
|
+
g.value = !1;
|
|
51
51
|
}, 1e3);
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
l.value = !1,
|
|
54
|
+
l.value = !1, u("update:show", !1), u("close");
|
|
55
55
|
}, p = () => {
|
|
56
|
-
l.value = !1,
|
|
56
|
+
l.value = !1, u("update:show", !1), u("close");
|
|
57
57
|
};
|
|
58
|
-
W("modal-context", { close:
|
|
58
|
+
W("modal-context", { close: m, setSubmitting: D, registerFormFooter: E });
|
|
59
59
|
const M = () => {
|
|
60
|
-
o.closeOutside &&
|
|
60
|
+
o.closeOutside && m();
|
|
61
61
|
}, { onKeyStroke: N } = Q();
|
|
62
|
-
N("Escape",
|
|
63
|
-
e ? (
|
|
62
|
+
N("Escape", m), T(l, async (e) => {
|
|
63
|
+
e ? (a?.onChildToggle?.(!0), document.body.style.overflow = "hidden", await K(), C.value?.focus()) : (document.body.style.overflow = "", a?.onChildToggle?.(!1), y.value = !1);
|
|
64
|
+
}), L(() => {
|
|
65
|
+
l.value && a?.onChildToggle?.(!0);
|
|
64
66
|
}), A(() => {
|
|
65
|
-
l.value &&
|
|
66
|
-
}), U(() => {
|
|
67
|
-
l.value && n?.onChildToggle?.(!1), document.body.style.overflow = "", u && clearTimeout(u);
|
|
67
|
+
l.value && a?.onChildToggle?.(!1), document.body.style.overflow = "", c && clearTimeout(c);
|
|
68
68
|
});
|
|
69
|
-
const
|
|
70
|
-
() => o.descriptionI18n ?
|
|
69
|
+
const r = h(() => o.titleI18n ? F(o.titleI18n) : o.title), x = h(
|
|
70
|
+
() => o.descriptionI18n ? F(o.descriptionI18n) : o.description
|
|
71
71
|
);
|
|
72
|
-
return (e, $) => (s(),
|
|
73
|
-
e.$slots?.trigger || e.$slots?.default ? (s(),
|
|
72
|
+
return (e, $) => (s(), d(U, null, [
|
|
73
|
+
e.$slots?.trigger || e.$slots?.default ? (s(), d("span", B({
|
|
74
74
|
key: 0,
|
|
75
|
-
onClick:
|
|
75
|
+
onClick: S(j, ["stop"]),
|
|
76
76
|
class: `${t.triggerClass}`
|
|
77
|
-
}, e.$attrs
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
}, e.$attrs, {
|
|
78
|
+
"data-testid": e.$attrs["data-testid"] ? `${e.$attrs["data-testid"]}-trigger` : r.value ? `modal-trigger-${r.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "modal-trigger"
|
|
79
|
+
}), [
|
|
80
|
+
v(e.$slots, "trigger", {}, () => [
|
|
81
|
+
t.body ? v(e.$slots, "default", { key: 0 }, void 0, !0) : n("", !0)
|
|
80
82
|
], !0)
|
|
81
|
-
], 16)) :
|
|
82
|
-
(s(),
|
|
83
|
-
l.value ? (s(),
|
|
83
|
+
], 16, X)) : n("", !0),
|
|
84
|
+
(s(), I(q, { to: "body" }, [
|
|
85
|
+
l.value ? (s(), d("div", {
|
|
84
86
|
key: 0,
|
|
85
87
|
class: i(["fixed inset-0 z-50 flex items-center justify-center p-4 v-modal-overlay", t.backdrop ? "v-modal-backdrop" : ""]),
|
|
86
88
|
onClick: M
|
|
87
89
|
}, [
|
|
88
90
|
b("div", {
|
|
89
91
|
ref_key: "modalRef",
|
|
90
|
-
ref:
|
|
92
|
+
ref: C,
|
|
91
93
|
tabindex: "-1",
|
|
94
|
+
role: "dialog",
|
|
95
|
+
"aria-modal": "true",
|
|
92
96
|
class: i(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh] focus:outline-none", [t.maxWidth]]),
|
|
93
|
-
|
|
97
|
+
"data-testid": e.$attrs["data-testid"] || (r.value ? `modal-${r.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "modal"),
|
|
98
|
+
onClick: $[0] || ($[0] = S(() => {
|
|
94
99
|
}, ["stop"]))
|
|
95
100
|
}, [
|
|
96
|
-
|
|
101
|
+
r.value ? (s(), d("div", Z, [
|
|
97
102
|
b("div", {
|
|
98
103
|
class: i(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
|
|
99
104
|
}, [
|
|
100
|
-
b("h3",
|
|
101
|
-
|
|
105
|
+
b("h3", _, z(r.value), 1),
|
|
106
|
+
G(J, {
|
|
102
107
|
rounded: "full",
|
|
103
108
|
size: "sm",
|
|
104
109
|
icon: "lucide:x",
|
|
105
110
|
variant: "ghost",
|
|
106
|
-
class: i(["hover:bg-gray-250/25!", { "blink-bg":
|
|
107
|
-
|
|
111
|
+
class: i(["hover:bg-gray-250/25!", { "blink-bg": g.value }]),
|
|
112
|
+
"data-testid": "modal-close-btn",
|
|
113
|
+
onClick: m
|
|
108
114
|
}, null, 8, ["class"])
|
|
109
115
|
], 2)
|
|
110
|
-
])) :
|
|
116
|
+
])) : n("", !0),
|
|
111
117
|
b("div", {
|
|
112
118
|
class: i(["flex-1 overflow-y-auto px-4 pt-4 min-h-0 scrollbar-thin scrollbar-stable", [y.value ? "pb-0" : "pb-3.5", t.bodyClass]])
|
|
113
119
|
}, [
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
x.value ? (s(), d("p", ee, z(x.value), 1)) : n("", !0),
|
|
121
|
+
w.value ? (s(), I(H(w.value), B({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: p }), null, 16)) : v(e.$slots, "default", {
|
|
116
122
|
key: 2,
|
|
117
123
|
close: p
|
|
118
124
|
}, void 0, !0)
|
|
119
125
|
], 2),
|
|
120
|
-
e.$slots.footer ? (s(),
|
|
126
|
+
e.$slots.footer ? (s(), d("div", {
|
|
121
127
|
key: 1,
|
|
122
128
|
class: i([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
|
|
123
129
|
}, [
|
|
124
|
-
|
|
125
|
-
], 2)) :
|
|
126
|
-
],
|
|
127
|
-
], 2)) :
|
|
130
|
+
v(e.$slots, "footer", { close: p }, void 0, !0)
|
|
131
|
+
], 2)) : n("", !0)
|
|
132
|
+
], 10, Y)
|
|
133
|
+
], 2)) : n("", !0)
|
|
128
134
|
]))
|
|
129
135
|
], 64));
|
|
130
136
|
}
|
|
131
137
|
});
|
|
132
138
|
export {
|
|
133
|
-
|
|
139
|
+
ae as default
|
|
134
140
|
};
|
|
@@ -5,6 +5,7 @@ interface Props {
|
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
placeholderI18n?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
readonly?: boolean;
|
|
8
9
|
searchable?: boolean;
|
|
9
10
|
variant?: 'default' | 'outline' | 'solid' | 'floating' | string;
|
|
10
11
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -34,6 +35,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
34
35
|
size: "sm" | "md" | "lg";
|
|
35
36
|
rounded: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | string;
|
|
36
37
|
loading: boolean;
|
|
38
|
+
readonly: boolean;
|
|
37
39
|
disabled: boolean;
|
|
38
40
|
modelValue: any[];
|
|
39
41
|
options: (IDropdownOption | string | number)[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as P, ref as k, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as P, ref as k, computed as d, watch as M, openBlock as r, createBlock as f, unref as h, withCtx as g, createCommentVNode as m, createElementVNode as y, withKeys as I, withModifiers as p, normalizeClass as c, createElementBlock as v, toDisplayString as $, Fragment as T, renderList as R, createVNode as L, createTextVNode as U } from "vue";
|
|
2
|
+
import S from "../Icon.vue.js";
|
|
3
3
|
import q from "../Dropdown/Dropdown.vue.js";
|
|
4
4
|
import G from "../Dropdown/DropdownMenu.vue.js";
|
|
5
|
-
import { $t as
|
|
5
|
+
import { $t as C } from "../../utils/i18n.js";
|
|
6
6
|
import N from "../Badge.vue.js";
|
|
7
7
|
import { useMultiSelectHydration as J } from "./composables/useMultiSelectHydration.js";
|
|
8
|
-
const Q = ["tabindex"], W = {
|
|
8
|
+
const Q = ["tabindex", "data-testid"], W = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "text-muted-foreground pl-0.5 truncate"
|
|
11
11
|
}, X = { class: "truncate min-w-0" }, Y = ["onClick"], Z = {
|
|
@@ -19,6 +19,7 @@ const Q = ["tabindex"], W = {
|
|
|
19
19
|
placeholder: {},
|
|
20
20
|
placeholderI18n: {},
|
|
21
21
|
disabled: { type: Boolean, default: !1 },
|
|
22
|
+
readonly: { type: Boolean, default: !1 },
|
|
22
23
|
searchable: { type: Boolean, default: !0 },
|
|
23
24
|
variant: { default: "outline" },
|
|
24
25
|
size: { default: "md" },
|
|
@@ -34,28 +35,28 @@ const Q = ["tabindex"], W = {
|
|
|
34
35
|
rounded: { default: "md" }
|
|
35
36
|
},
|
|
36
37
|
emits: ["update:modelValue", "change", "load-more", "search"],
|
|
37
|
-
setup(
|
|
38
|
-
const e =
|
|
39
|
-
if (e.placeholderI18n) return
|
|
38
|
+
setup(t, { emit: j }) {
|
|
39
|
+
const e = t, i = j, o = k(!1), D = d(() => {
|
|
40
|
+
if (e.placeholderI18n) return C(e.placeholderI18n);
|
|
40
41
|
if (e.placeholder) return e.placeholder;
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
}), x =
|
|
42
|
+
const a = C("vlite.multiSelect.placeholder");
|
|
43
|
+
return a !== "vlite.multiSelect.placeholder" ? a : "Select items...";
|
|
44
|
+
}), x = d(() => e.options ? e.options.map((a) => typeof a == "string" || typeof a == "number" ? { label: String(a), value: String(a) } : a) : []), B = k(!1), w = k(!1);
|
|
44
45
|
M(
|
|
45
46
|
x,
|
|
46
|
-
(
|
|
47
|
-
!B.value &&
|
|
48
|
-
w.value = !0,
|
|
47
|
+
(a) => {
|
|
48
|
+
!B.value && a.length > 0 && (B.value = !0, setTimeout(() => {
|
|
49
|
+
w.value = !0, s.hydrateSelected(e.modelValue || []);
|
|
49
50
|
}, 10));
|
|
50
51
|
},
|
|
51
52
|
{ immediate: !0 }
|
|
52
53
|
);
|
|
53
|
-
const V =
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
}),
|
|
58
|
-
}),
|
|
54
|
+
const V = d(() => {
|
|
55
|
+
const a = [...x.value], n = new Set(a.map((l) => l.value ?? l.label));
|
|
56
|
+
return s.selectedBuffer.value.forEach((l, u) => {
|
|
57
|
+
n.has(u) || (a.unshift(l), n.add(u));
|
|
58
|
+
}), a;
|
|
59
|
+
}), s = J({
|
|
59
60
|
fetchSelected: e.fetchSelected,
|
|
60
61
|
getValues: () => e.modelValue || [],
|
|
61
62
|
getOptions: () => V.value,
|
|
@@ -63,77 +64,78 @@ const Q = ["tabindex"], W = {
|
|
|
63
64
|
});
|
|
64
65
|
M(
|
|
65
66
|
() => e.modelValue,
|
|
66
|
-
(
|
|
67
|
-
w.value &&
|
|
67
|
+
(a) => {
|
|
68
|
+
w.value && s.hydrateSelected(a || []);
|
|
68
69
|
},
|
|
69
70
|
{ deep: !0 }
|
|
70
71
|
);
|
|
71
|
-
const b =
|
|
72
|
-
const
|
|
73
|
-
return e.modelValue.includes(
|
|
74
|
-
})), E =
|
|
75
|
-
if (e.disabled) return;
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
u === -1 ?
|
|
80
|
-
}, K = (
|
|
81
|
-
if (e.disabled) return;
|
|
82
|
-
const
|
|
83
|
-
i("update:modelValue",
|
|
72
|
+
const b = d(() => V.value.filter((a) => {
|
|
73
|
+
const n = a.value ?? a.label;
|
|
74
|
+
return e.modelValue.includes(n);
|
|
75
|
+
})), E = d(() => b.value.slice(0, e.maxVisible)), O = d(() => b.value.length - e.maxVisible), H = (a) => {
|
|
76
|
+
if (e.disabled || e.readonly) return;
|
|
77
|
+
const n = a.value ?? a.label;
|
|
78
|
+
s.selectedBuffer.value.has(n) || s.selectedBuffer.value.set(n, a);
|
|
79
|
+
const l = [...e.modelValue], u = l.indexOf(n);
|
|
80
|
+
u === -1 ? l.push(n) : l.splice(u, 1), i("update:modelValue", l), i("change", l);
|
|
81
|
+
}, K = (a) => {
|
|
82
|
+
if (e.disabled || e.readonly) return;
|
|
83
|
+
const n = e.modelValue.filter((l) => l !== a);
|
|
84
|
+
i("update:modelValue", n), i("change", n);
|
|
84
85
|
}, A = () => {
|
|
85
|
-
e.disabled || (i("update:modelValue", []), i("change", []));
|
|
86
|
-
}, F =
|
|
87
|
-
const
|
|
86
|
+
e.disabled || e.readonly || (i("update:modelValue", []), i("change", []));
|
|
87
|
+
}, F = d(() => {
|
|
88
|
+
const a = e.rounded === "none" ? "rounded-none" : `rounded-${e.rounded}`, n = e.variant === "transparent" ? "px-2 py-0" : "px-3 py-1.5", l = e.variant === "transparent" ? "h-full min-h-[40px]" : "min-h-[40px]";
|
|
88
89
|
return [
|
|
89
|
-
`flex items-center justify-between w-full ${
|
|
90
|
-
e.disabled ? "opacity-50 cursor-not-allowed bg-muted" : e.variant === "floating" || e.variant === "transparent" ? "bg-transparent text-foreground" : "bg-background hover:bg-gray-50/70"
|
|
90
|
+
`flex items-center justify-between w-full ${n} ${l} ${a} border text-sm transition-colors outline-none`,
|
|
91
|
+
e.disabled ? "opacity-50 cursor-not-allowed bg-muted" : e.readonly ? `cursor-default ${e.variant === "transparent" || e.variant === "floating" ? "bg-transparent text-foreground" : "bg-background"}` : `cursor-pointer ${e.variant === "floating" || e.variant === "transparent" ? "bg-transparent text-foreground" : "bg-background hover:bg-gray-50/70"}`,
|
|
91
92
|
e.variant === "outline" || e.variant === "floating" ? "border-input focus-visible:ring-1 focus-visible:ring-primary" : e.variant === "transparent" ? "border-transparent" : "border-transparent bg-muted",
|
|
92
93
|
o.value && e.variant !== "transparent" ? "border-primary/20 ring-1 ring-primary/20" : ""
|
|
93
94
|
].join(" ");
|
|
94
|
-
}), z =
|
|
95
|
-
return (
|
|
95
|
+
}), z = d(() => e.size === "sm" ? "xs" : "sm");
|
|
96
|
+
return (a, n) => (r(), f(h(q), {
|
|
96
97
|
isOpen: o.value,
|
|
97
|
-
"onUpdate:isOpen":
|
|
98
|
+
"onUpdate:isOpen": n[5] || (n[5] = (l) => o.value = l),
|
|
98
99
|
"close-on-select": !1,
|
|
99
100
|
selectable: !0,
|
|
100
|
-
disabled:
|
|
101
|
+
disabled: t.disabled || t.readonly
|
|
101
102
|
}, {
|
|
102
|
-
trigger:
|
|
103
|
-
|
|
103
|
+
trigger: g(() => [
|
|
104
|
+
y("div", {
|
|
104
105
|
class: c(F.value),
|
|
105
|
-
tabindex:
|
|
106
|
+
tabindex: t.disabled || t.readonly ? -1 : 0,
|
|
106
107
|
onKeydown: [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
]
|
|
108
|
+
n[0] || (n[0] = I(p((l) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["enter"])),
|
|
109
|
+
n[1] || (n[1] = I(p((l) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["space"]))
|
|
110
|
+
],
|
|
111
|
+
"data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `multiselect-${a.$attrs.name}` : "multiselect")
|
|
110
112
|
}, [
|
|
111
|
-
|
|
112
|
-
class: c(["flex gap-1.5 items-center flex-1 min-w-0", [
|
|
113
|
+
y("div", {
|
|
114
|
+
class: c(["flex gap-1.5 items-center flex-1 min-w-0", [t.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
|
|
113
115
|
}, [
|
|
114
|
-
b.value.length === 0 ? (r(), v("span", W,
|
|
115
|
-
(r(!0), v(T, null, R(E.value, (
|
|
116
|
-
key:
|
|
117
|
-
variant:
|
|
116
|
+
b.value.length === 0 ? (r(), v("span", W, $(D.value), 1)) : (r(), v(T, { key: 1 }, [
|
|
117
|
+
(r(!0), v(T, null, R(E.value, (l) => (r(), f(N, {
|
|
118
|
+
key: l.value,
|
|
119
|
+
variant: t.variant === "transparent" ? "outline" : "secondary",
|
|
118
120
|
size: z.value,
|
|
119
|
-
rounded:
|
|
121
|
+
rounded: t.rounded === "none" ? "sm" : "full",
|
|
120
122
|
class: c(["gap-1 pr-1 truncate min-w-0 shrink", [
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
t.wrap ? "max-w-[150px]" : "",
|
|
124
|
+
t.variant === "transparent" ? "border-transparent bg-muted/50 text-foreground font-medium shadow-none" : ""
|
|
123
125
|
]])
|
|
124
126
|
}, {
|
|
125
|
-
default:
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
default: g(() => [
|
|
128
|
+
y("span", X, $(l.labelI18n ? h(C)(l.labelI18n) : l.label), 1),
|
|
129
|
+
t.disabled || t.readonly ? m("", !0) : (r(), v("button", {
|
|
128
130
|
key: 0,
|
|
129
131
|
type: "button",
|
|
130
|
-
onClick:
|
|
132
|
+
onClick: p((u) => K(l.value), ["stop"]),
|
|
131
133
|
class: c([
|
|
132
134
|
"rounded transition-colors shrink-0 flex items-center justify-center p-px",
|
|
133
|
-
|
|
135
|
+
t.variant === "transparent" ? "text-muted-foreground hover:bg-black/10 hover:text-foreground" : "hover:bg-destructive/10 hover:text-destructive p-0.5 rounded-full"
|
|
134
136
|
])
|
|
135
137
|
}, [
|
|
136
|
-
L(
|
|
138
|
+
L(S, {
|
|
137
139
|
icon: "lucide:x",
|
|
138
140
|
class: "w-3 h-3"
|
|
139
141
|
})
|
|
@@ -141,55 +143,55 @@ const Q = ["tabindex"], W = {
|
|
|
141
143
|
]),
|
|
142
144
|
_: 2
|
|
143
145
|
}, 1032, ["variant", "size", "rounded", "class"]))), 128)),
|
|
144
|
-
O.value > 0 ? (r(),
|
|
146
|
+
O.value > 0 ? (r(), f(N, {
|
|
145
147
|
key: 0,
|
|
146
|
-
variant:
|
|
148
|
+
variant: t.variant === "transparent" ? "outline" : "secondary",
|
|
147
149
|
size: z.value,
|
|
148
|
-
rounded:
|
|
150
|
+
rounded: t.rounded === "none" ? "sm" : "full",
|
|
149
151
|
class: c([
|
|
150
152
|
"shrink-0",
|
|
151
|
-
|
|
153
|
+
t.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
|
|
152
154
|
])
|
|
153
155
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
U(" +" +
|
|
156
|
+
default: g(() => [
|
|
157
|
+
U(" +" + $(O.value), 1)
|
|
156
158
|
]),
|
|
157
159
|
_: 1
|
|
158
|
-
}, 8, ["variant", "size", "rounded", "class"])) :
|
|
160
|
+
}, 8, ["variant", "size", "rounded", "class"])) : m("", !0)
|
|
159
161
|
], 64))
|
|
160
162
|
], 2),
|
|
161
|
-
|
|
162
|
-
b.value.length > 0 && !
|
|
163
|
+
t.showControls && !(t.disabled || t.readonly) ? (r(), v("div", Z, [
|
|
164
|
+
b.value.length > 0 && !(t.disabled || t.readonly) ? (r(), f(S, {
|
|
163
165
|
key: 0,
|
|
164
166
|
icon: "lucide:x",
|
|
165
167
|
class: "w-4 h-4 hover:text-foreground transition-colors",
|
|
166
|
-
onClick:
|
|
167
|
-
})) :
|
|
168
|
-
|
|
169
|
-
L(
|
|
168
|
+
onClick: p(A, ["stop"])
|
|
169
|
+
})) : m("", !0),
|
|
170
|
+
n[6] || (n[6] = y("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
|
|
171
|
+
L(S, {
|
|
170
172
|
icon: "lucide:chevron-down",
|
|
171
173
|
class: c(["w-4 h-4 transition-transform duration-200", { "rotate-180": o.value }])
|
|
172
174
|
}, null, 8, ["class"])
|
|
173
|
-
])) :
|
|
175
|
+
])) : m("", !0)
|
|
174
176
|
], 42, Q)
|
|
175
177
|
]),
|
|
176
|
-
default:
|
|
177
|
-
|
|
178
|
+
default: g(() => [
|
|
179
|
+
t.disabled || t.readonly ? m("", !0) : (r(), f(h(G), {
|
|
178
180
|
key: 0,
|
|
179
181
|
options: x.value,
|
|
180
182
|
cachedOptions: V.value,
|
|
181
|
-
selected:
|
|
183
|
+
selected: t.modelValue,
|
|
182
184
|
class: "min-w-[300px]",
|
|
183
|
-
loading:
|
|
184
|
-
hasMore:
|
|
185
|
-
searchable:
|
|
186
|
-
remote:
|
|
187
|
-
debounceTime:
|
|
188
|
-
layout:
|
|
185
|
+
loading: t.loading || h(s).isHydrating.value,
|
|
186
|
+
hasMore: t.hasMore,
|
|
187
|
+
searchable: t.searchable,
|
|
188
|
+
remote: t.remote,
|
|
189
|
+
debounceTime: t.debounceTime,
|
|
190
|
+
layout: t.layout,
|
|
189
191
|
onSelect: H,
|
|
190
|
-
onClose:
|
|
191
|
-
onLoadMore:
|
|
192
|
-
onSearch:
|
|
192
|
+
onClose: n[2] || (n[2] = (l) => o.value = !1),
|
|
193
|
+
onLoadMore: n[3] || (n[3] = (l) => a.$emit("load-more")),
|
|
194
|
+
onSearch: n[4] || (n[4] = (l) => a.$emit("search", l))
|
|
193
195
|
}, null, 8, ["options", "cachedOptions", "selected", "loading", "hasMore", "searchable", "remote", "debounceTime", "layout"]))
|
|
194
196
|
]),
|
|
195
197
|
_: 1
|
|
@@ -19,6 +19,7 @@ export declare function useMultiSelectHydration(opts: UseMultiSelectHydrationOpt
|
|
|
19
19
|
description?: string;
|
|
20
20
|
descriptionI18n?: string;
|
|
21
21
|
icon?: string;
|
|
22
|
+
badge?: string;
|
|
22
23
|
emoji?: string;
|
|
23
24
|
disabled?: {
|
|
24
25
|
valueOf: () => boolean;
|
|
@@ -59,6 +60,7 @@ export declare function useMultiSelectHydration(opts: UseMultiSelectHydrationOpt
|
|
|
59
60
|
description?: string;
|
|
60
61
|
descriptionI18n?: string;
|
|
61
62
|
icon?: string;
|
|
63
|
+
badge?: string;
|
|
62
64
|
emoji?: string;
|
|
63
65
|
disabled?: {
|
|
64
66
|
valueOf: () => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./NumberInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cce64dd9"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|