vlite3 1.4.40 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AppShell/AppShellLayoutClassic.vue.js +27 -28
- package/components/AppShell/AppShellLayoutDashboard.vue.js +48 -48
- package/components/AppShell/AppShellLayoutDock.vue.js +51 -51
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +69 -69
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.d.ts +2 -2
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +78 -78
- package/components/AppShell/AppShellLayoutStorefront.vue.js +14 -15
- package/components/AppShell/useAppShell.d.ts +4 -0
- package/components/AppShell/useAppShell.js +45 -40
- package/components/AsyncSelect/createAsyncSelect.js +10 -10
- package/components/AttachmentsList/AttachmentsList.vue.d.ts +50 -2
- package/components/AttachmentsList/AttachmentsList.vue.js +289 -272
- package/components/AttachmentsList/types.d.ts +37 -0
- package/components/BackButton.vue.js +2 -2
- package/components/Button.vue.d.ts +1 -0
- package/components/Button.vue.js +5 -241
- package/components/Button.vue2.js +245 -2
- package/components/ButtonGroup.vue.js +2 -2
- package/components/ButtonGroup.vue2.js +4 -1
- package/components/Calendar/Calendar.vue2.js +16 -16
- package/components/Cart/CartCouponInput.vue.js +24 -24
- package/components/Cart/CartEmptyState.vue.js +4 -4
- package/components/Cart/CartLineItem.vue.js +33 -33
- package/components/Cart/CartVariant1.vue.js +3 -3
- package/components/Cart/CartVariant2.vue.js +5 -5
- package/components/Cart/CartVariant3.vue.js +25 -25
- package/components/Cart/CartVariant4.vue.js +9 -9
- package/components/CategoryManager/CategoryManager.vue.d.ts +2 -2
- package/components/CategoryManager/CategoryManager.vue2.js +18 -18
- package/components/CategoryManager/CategoryNode.vue.js +4 -4
- package/components/CategoryMenu/CategoryMenu.vue.js +3 -2
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +3 -2
- package/components/Chat/ChatInterface.vue.js +23 -23
- package/components/Clipboard.vue.d.ts +7 -1
- package/components/Clipboard.vue.js +19 -17
- package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +22 -22
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +8 -8
- package/components/Comment/CommentEditor.vue.js +14 -14
- package/components/Comment/CommentItem.vue2.js +6 -6
- package/components/Comment/CommentThread.vue.js +4 -4
- package/components/DataList/DataList.vue.js +7 -7
- package/components/DataTable/DataTable.vue.d.ts +9 -1
- package/components/DataTable/DataTable.vue.js +374 -263
- package/components/DataTable/DataTableRow.vue.d.ts +23 -2
- package/components/DataTable/DataTableRow.vue.js +5 -198
- package/components/DataTable/DataTableRow.vue2.js +360 -2
- package/components/DataTable/dataTableHeaders.d.ts +18 -0
- package/components/DataTable/dataTableHeaders.js +9 -0
- package/components/DataTable/types.d.ts +6 -0
- package/components/DatePicker.vue.js +8 -9
- package/components/DateRangePicker.vue2.js +34 -34
- package/components/Dropdown/Dropdown.vue.d.ts +7 -2
- package/components/Dropdown/Dropdown.vue.js +146 -139
- package/components/Dropdown/DropdownTrigger.vue.js +6 -6
- package/components/ExportData/ExportData.vue.js +15 -15
- package/components/FilePicker/FilePickerDropzone.vue.js +16 -16
- package/components/FilePicker/FilePickerInput.vue.js +3 -2
- package/components/FilePicker/FilePreview.vue.js +3 -3
- package/components/FileTree/FileTree.vue.js +4 -4
- package/components/FileTree/FileTree.vue2.js +9 -9
- package/components/FileTree/FileTreeNode.vue.js +76 -72
- package/components/Footer/Variant1.vue.js +48 -48
- package/components/Footer/Variant2.vue.js +42 -42
- package/components/Form/AccordionView.vue.d.ts +1 -1
- package/components/Form/AccordionView.vue.js +2 -2
- package/components/Form/AccordionView.vue3.js +61 -57
- package/components/Form/Form.vue2.js +41 -41
- package/components/Form/TableRow.vue.d.ts +7 -0
- package/components/Form/TableRow.vue.js +187 -41
- package/components/Form/TableView.vue.d.ts +11 -1
- package/components/Form/TableView.vue.js +71 -49
- package/components/Form/composables/useForm.js +146 -142
- package/components/Form/index.vue.d.ts +5 -1
- package/components/Form/index.vue.js +2 -2
- package/components/Form/index.vue2.js +44 -37
- package/components/Form/rowHelpers.d.ts +20 -0
- package/components/Form/rowHelpers.js +76 -28
- package/components/Form/types.d.ts +11 -0
- package/components/GoogleLogin.vue.js +4 -4
- package/components/IconPicker.vue.js +9 -9
- package/components/ImportData/ImportData.vue.js +11 -11
- package/components/ImportData/ImportStep1.vue.js +10 -10
- package/components/ImportData/ImportStep2.vue.js +15 -14
- package/components/Input.vue.js +133 -129
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +9 -9
- package/components/MultiSelect/MultiSelect.vue.js +3 -2
- package/components/Navbar/Navbar.vue.js +17 -17
- package/components/Navbar/NavbarGroup.vue.js +8 -7
- package/components/Navbar/NavbarItem.vue.js +40 -39
- package/components/Navbar/NavbarTabs.vue.js +6 -184
- package/components/Navbar/NavbarTabs.vue2.js +204 -0
- package/components/Navbar/useNavbar.js +3 -3
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +81 -77
- package/components/OTPInput/OTPInput.vue.js +24 -23
- package/components/Pagination/Pagination.vue.d.ts +1 -1
- package/components/Pagination/Pagination.vue.js +5 -274
- package/components/Pagination/Pagination.vue2.js +283 -2
- package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
- package/components/PricingPlan/PricingPlanItem.vue.js +7 -7
- package/components/Screen/Screen.vue.d.ts +1 -1
- package/components/Screen/Screen.vue.js +21 -21
- package/components/Screen/ScreenFilter.vue.js +5 -5
- package/components/Screen/components/ScreenAddAction.vue.js +3 -3
- package/components/Screen/components/ScreenEmptyState.vue.js +10 -10
- package/components/Screen/components/ScreenExportModal.vue.js +12 -12
- package/components/Screen/components/ScreenOptionsDropdown.vue.js +5 -5
- package/components/Screen/components/ScreenToolbar.vue.js +15 -15
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +6 -6
- package/components/SidebarMenu/SidebarMenu.vue.js +77 -72
- package/components/SidebarMenu/SidebarMenuItem.vue.js +172 -168
- package/components/Slider.vue.js +123 -108
- package/components/Tabes/Tabes.vue.d.ts +25 -4
- package/components/Tabes/Tabes.vue.js +3 -3
- package/components/Tabes/Tabes.vue2.js +274 -211
- package/components/Tabes/tabes.utils.d.ts +30 -0
- package/components/Tabes/tabes.utils.js +49 -18
- package/components/Tabes/types.d.ts +7 -0
- package/components/Textarea.vue.d.ts +2 -0
- package/components/Textarea.vue.js +19 -16
- package/components/ThemeToggle.vue.js +8 -8
- package/components/ToastNotification.vue2.js +10 -10
- package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
- package/components/TreeConnectors/TreeConnectors.vue.js +13 -8
- package/components/TreeConnectors/geometry.js +77 -69
- package/components/Workbook/WorkbookAddButton.vue.js +2 -2
- package/composables/useRtl.d.ts +14 -0
- package/composables/useRtl.js +33 -0
- package/index.js +470 -471
- package/package.json +5 -4
- package/style.css +86 -1
- package/types/button.d.ts +8 -0
- package/components/Navbar/NavbarTabs.vue3.js +0 -5
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { defineComponent as q, ref as v, onMounted as J, nextTick as g, onUnmounted as K, watch as R, computed as p, openBlock as a, createElementBlock as m, normalizeClass as s, createVNode as h, Transition as A, withCtx as T, createElementVNode as l, createCommentVNode as x, Fragment as Q, renderList as X, isMemoSame as Y, createBlock as I, resolveDynamicComponent as Z, mergeProps as ee, toDisplayString as te, unref as re } from "vue";
|
|
2
|
+
import { useRoute as ne } from "vue-router";
|
|
3
|
+
import y from "../Icon.vue.js";
|
|
4
|
+
import { $t as oe } from "../../utils/i18n.js";
|
|
5
|
+
import { useRtl as ae } from "../../composables/useRtl.js";
|
|
6
|
+
import { getTabesScrollOverflow as se, scrollTabesStrip as le } from "../Tabes/tabes.utils.js";
|
|
7
|
+
const ie = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "navbar-tabs-edge navbar-tabs-edge--start absolute top-0 bottom-0 z-10 flex items-center pointer-events-none"
|
|
10
|
+
}, ce = { class: "truncate" }, ue = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "navbar-tabs-edge navbar-tabs-edge--end absolute top-0 bottom-0 z-10 flex items-center justify-end pointer-events-none"
|
|
13
|
+
}, de = "[data-navbar-tab]", he = /* @__PURE__ */ q({
|
|
14
|
+
__name: "NavbarTabs",
|
|
15
|
+
props: {
|
|
16
|
+
items: {},
|
|
17
|
+
variant: { default: "solid" },
|
|
18
|
+
size: { default: "md" },
|
|
19
|
+
activeClass: { default: "" },
|
|
20
|
+
inactiveClass: { default: "" },
|
|
21
|
+
class: { default: "" }
|
|
22
|
+
},
|
|
23
|
+
setup(i) {
|
|
24
|
+
const o = i, c = ae(), u = v(null), k = v(!1), C = v(!1), d = () => {
|
|
25
|
+
const t = u.value;
|
|
26
|
+
if (!t) {
|
|
27
|
+
k.value = !1, C.value = !1;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const r = se(t, de);
|
|
31
|
+
k.value = r.canScrollStart, C.value = r.canScrollEnd;
|
|
32
|
+
}, E = (t) => {
|
|
33
|
+
const r = u.value;
|
|
34
|
+
r && le(r, t, r.clientWidth * 0.6);
|
|
35
|
+
};
|
|
36
|
+
J(() => {
|
|
37
|
+
g(() => {
|
|
38
|
+
d(), u.value?.addEventListener("scroll", d, { passive: !0 });
|
|
39
|
+
});
|
|
40
|
+
}), K(() => {
|
|
41
|
+
u.value?.removeEventListener("scroll", d);
|
|
42
|
+
});
|
|
43
|
+
const w = ne();
|
|
44
|
+
R(
|
|
45
|
+
() => w.path,
|
|
46
|
+
() => g(d)
|
|
47
|
+
), R(c, () => g(d));
|
|
48
|
+
const S = v(/* @__PURE__ */ new Map()), L = (t, r) => {
|
|
49
|
+
const e = t?.$el ?? t;
|
|
50
|
+
e instanceof HTMLElement ? S.value.set(r, e) : S.value.delete(r);
|
|
51
|
+
};
|
|
52
|
+
R(
|
|
53
|
+
() => w.path,
|
|
54
|
+
(t) => {
|
|
55
|
+
g(() => {
|
|
56
|
+
const r = o.items.findIndex((n) => f(n));
|
|
57
|
+
if (r === -1) return;
|
|
58
|
+
S.value.get(r)?.scrollIntoView({ block: "nearest", inline: "center", behavior: "smooth" });
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
{ immediate: !0 }
|
|
62
|
+
);
|
|
63
|
+
const N = {
|
|
64
|
+
line: "flex border-b border-border gap-0",
|
|
65
|
+
pill: "flex gap-1 p-1 bg-secondary/80 rounded-lg",
|
|
66
|
+
solid: "flex gap-0",
|
|
67
|
+
ghost: "flex gap-1"
|
|
68
|
+
}, $ = {
|
|
69
|
+
sm: "px-2.5 py-1.5 text-xs",
|
|
70
|
+
md: "px-3.5 py-2 text-sm",
|
|
71
|
+
lg: "px-5 py-2.5 text-base"
|
|
72
|
+
}, M = {
|
|
73
|
+
line: "text-primary border-b-2 border-primary -mb-px",
|
|
74
|
+
pill: "bg-background text-foreground shadow-sm",
|
|
75
|
+
solid: "bg-primary-light text-primary-dark",
|
|
76
|
+
ghost: "bg-accent text-accent-foreground"
|
|
77
|
+
}, j = {
|
|
78
|
+
line: "text-muted-foreground border-b-2 border-transparent hover:text-foreground hover:border-border",
|
|
79
|
+
pill: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
|
|
80
|
+
solid: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
|
|
81
|
+
ghost: "text-muted-foreground hover:text-foreground hover:bg-accent/50"
|
|
82
|
+
}, f = (t) => {
|
|
83
|
+
const r = w.path;
|
|
84
|
+
if (!t.to) return !1;
|
|
85
|
+
const e = typeof t.to == "string" ? t.to : t.to.path;
|
|
86
|
+
if (!e) return !1;
|
|
87
|
+
if (t.exact || e === "/")
|
|
88
|
+
return r === e;
|
|
89
|
+
if (r === e) return !0;
|
|
90
|
+
if (r.startsWith(e)) {
|
|
91
|
+
const n = r[e.length];
|
|
92
|
+
return n === "/" || n === "?" || n === "#" || n === void 0;
|
|
93
|
+
}
|
|
94
|
+
return !1;
|
|
95
|
+
}, D = (t) => {
|
|
96
|
+
const r = "group relative inline-flex items-center justify-center gap-2 font-medium whitespace-nowrap shrink-0 select-none cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-1", e = t.disabled ? "opacity-50 pointer-events-none cursor-not-allowed" : "", z = f(t) ? o.activeClass || M[o.variant] : o.inactiveClass || j[o.variant];
|
|
97
|
+
return [r, $[o.size], z, e].filter(Boolean).join(" ");
|
|
98
|
+
}, P = (t) => t.to ? "router-link" : t.href ? "a" : "button", G = (t) => t.to ? { to: t.to } : t.href ? { href: t.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" }, O = (t, r) => {
|
|
99
|
+
r.disabled && t.preventDefault();
|
|
100
|
+
}, W = p(
|
|
101
|
+
() => c.value ? "lucide:chevron-right" : "lucide:chevron-left"
|
|
102
|
+
), F = p(
|
|
103
|
+
() => c.value ? "lucide:chevron-left" : "lucide:chevron-right"
|
|
104
|
+
), H = p(
|
|
105
|
+
() => c.value ? "bg-gradient-to-l from-background to-transparent" : "bg-gradient-to-r from-background to-transparent"
|
|
106
|
+
), U = p(
|
|
107
|
+
() => c.value ? "bg-gradient-to-r from-background to-transparent" : "bg-gradient-to-l from-background to-transparent"
|
|
108
|
+
);
|
|
109
|
+
return (t, r) => (a(), m("div", {
|
|
110
|
+
class: s(["relative flex items-center w-full min-w-0 border-b", o.class])
|
|
111
|
+
}, [
|
|
112
|
+
h(A, { name: "fade-x" }, {
|
|
113
|
+
default: T(() => [
|
|
114
|
+
k.value ? (a(), m("div", ie, [
|
|
115
|
+
l("div", {
|
|
116
|
+
class: s(["w-8 h-full", H.value])
|
|
117
|
+
}, null, 2),
|
|
118
|
+
l("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
class: "pointer-events-auto absolute start-0 bg-body h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors",
|
|
121
|
+
"aria-label": "Scroll tabs to start",
|
|
122
|
+
tabindex: "-1",
|
|
123
|
+
onClick: r[0] || (r[0] = (e) => E("start"))
|
|
124
|
+
}, [
|
|
125
|
+
h(y, {
|
|
126
|
+
icon: W.value,
|
|
127
|
+
class: "w-4 h-4"
|
|
128
|
+
}, null, 8, ["icon"])
|
|
129
|
+
])
|
|
130
|
+
])) : x("", !0)
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
}),
|
|
134
|
+
l("nav", {
|
|
135
|
+
ref_key: "scrollRef",
|
|
136
|
+
ref: u,
|
|
137
|
+
role: "tablist",
|
|
138
|
+
class: s([
|
|
139
|
+
"flex-1 overflow-x-auto scroll-smooth navbar-tabs-no-scrollbar",
|
|
140
|
+
N[i.variant]
|
|
141
|
+
]),
|
|
142
|
+
style: { "will-change": "transform", contain: "layout style" },
|
|
143
|
+
"aria-label": "Page tabs"
|
|
144
|
+
}, [
|
|
145
|
+
(a(!0), m(Q, null, X(i.items, (e, n, z, b) => {
|
|
146
|
+
const B = [e, f(e), e.disabled];
|
|
147
|
+
if (b && b.key === n && Y(b, B)) return b;
|
|
148
|
+
const V = (a(), I(Z(P(e)), ee({ key: n }, { ref_for: !0 }, G(e), {
|
|
149
|
+
ref_for: !0,
|
|
150
|
+
ref: (_) => L(_, n),
|
|
151
|
+
role: "tab",
|
|
152
|
+
"data-navbar-tab": "",
|
|
153
|
+
"aria-selected": f(e),
|
|
154
|
+
"aria-disabled": e.disabled || void 0,
|
|
155
|
+
tabindex: e.disabled ? -1 : 0,
|
|
156
|
+
class: D(e),
|
|
157
|
+
onClick: (_) => O(_, e)
|
|
158
|
+
}), {
|
|
159
|
+
default: T(() => [
|
|
160
|
+
e.icon ? (a(), I(y, {
|
|
161
|
+
key: 0,
|
|
162
|
+
icon: e.icon,
|
|
163
|
+
class: s(["shrink-0", i.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4"])
|
|
164
|
+
}, null, 8, ["icon", "class"])) : x("", !0),
|
|
165
|
+
l("span", ce, te(e.labelI18n ? re(oe)(e.labelI18n) : e.label), 1),
|
|
166
|
+
e.iconRight ? (a(), I(y, {
|
|
167
|
+
key: 1,
|
|
168
|
+
icon: e.iconRight,
|
|
169
|
+
class: s(["shrink-0 opacity-70", i.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4"])
|
|
170
|
+
}, null, 8, ["icon", "class"])) : x("", !0)
|
|
171
|
+
]),
|
|
172
|
+
_: 2
|
|
173
|
+
}, 1040, ["aria-selected", "aria-disabled", "tabindex", "class", "onClick"]));
|
|
174
|
+
return V.memo = B, V;
|
|
175
|
+
}, r, 1), 128))
|
|
176
|
+
], 2),
|
|
177
|
+
h(A, { name: "fade-x" }, {
|
|
178
|
+
default: T(() => [
|
|
179
|
+
C.value ? (a(), m("div", ue, [
|
|
180
|
+
l("div", {
|
|
181
|
+
class: s(["w-8 h-full", U.value])
|
|
182
|
+
}, null, 2),
|
|
183
|
+
l("button", {
|
|
184
|
+
type: "button",
|
|
185
|
+
class: "pointer-events-auto absolute end-0 h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors bg-body",
|
|
186
|
+
"aria-label": "Scroll tabs to end",
|
|
187
|
+
tabindex: "-1",
|
|
188
|
+
onClick: r[3] || (r[3] = (e) => E("end"))
|
|
189
|
+
}, [
|
|
190
|
+
h(y, {
|
|
191
|
+
icon: F.value,
|
|
192
|
+
class: "w-4 h-4"
|
|
193
|
+
}, null, 8, ["icon"])
|
|
194
|
+
])
|
|
195
|
+
])) : x("", !0)
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
})
|
|
199
|
+
], 2));
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
export {
|
|
203
|
+
he as default
|
|
204
|
+
};
|
|
@@ -45,13 +45,13 @@ function j(e) {
|
|
|
45
45
|
};
|
|
46
46
|
}), b = i(() => {
|
|
47
47
|
const l = e.variant === "sidebar", s = {
|
|
48
|
-
fixed: "fixed top-0
|
|
48
|
+
fixed: "fixed top-0 start-0 z-40",
|
|
49
49
|
sticky: "sticky top-0 z-40",
|
|
50
50
|
relative: "relative z-10",
|
|
51
|
-
absolute: "absolute top-0
|
|
51
|
+
absolute: "absolute top-0 start-0 w-full z-40"
|
|
52
52
|
}, d = "bg-body", o = [
|
|
53
53
|
e.glass && (t.value || l || e.floating) ? "bg-background/95" : "bg-background",
|
|
54
|
-
e.border && !e.floating ? l ? "border-
|
|
54
|
+
e.border && !e.floating ? l ? "border-e border-border" : "border-b border-border" : "",
|
|
55
55
|
e.floating ? "m-4 rounded shadow-lg border border-border/50" : "",
|
|
56
56
|
t.value && !e.floating && !l && e.position === "sticky" ? "shadow-sm" : ""
|
|
57
57
|
];
|
|
@@ -4,7 +4,7 @@ import v from "./Modal.vue.js";
|
|
|
4
4
|
import N from "./CommandPalette/CommandPaletteContent.vue.js";
|
|
5
5
|
import { $t as U } from "../utils/i18n.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const V = { class: "block truncate -text-fs-1.5" }, S = { class: "
|
|
7
|
+
const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ms-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ms-1" }, A = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|
|
10
10
|
items: { default: () => [] },
|
|
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3e1eac3e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as q, ref as k, watch as D, computed as i, onBeforeUnmount as M, openBlock as f, createElementBlock as y, normalizeClass as u, withModifiers as r, createVNode as g, createCommentVNode as P, createElementVNode as h, withKeys as z } from "vue";
|
|
2
2
|
import w from "./Icon.vue.js";
|
|
3
|
-
|
|
3
|
+
import { useRtl as U } from "../composables/useRtl.js";
|
|
4
|
+
const A = ["disabled", "data-testid"], G = ["value", "placeholder", "disabled", "readonly", "dir", "onKeydown", "data-testid"], H = ["disabled", "data-testid"], J = {
|
|
4
5
|
key: 2,
|
|
5
|
-
class: "flex flex-col justify-center h-full py-[3px]
|
|
6
|
-
},
|
|
6
|
+
class: "flex flex-col justify-center h-full py-[3px] pe-[3px]"
|
|
7
|
+
}, L = { class: "flex flex-col h-full w-6 scale-80" }, O = ["disabled", "data-testid"], Q = ["disabled", "data-testid"], _ = /* @__PURE__ */ q({
|
|
7
8
|
__name: "NumberInput",
|
|
8
9
|
props: {
|
|
9
10
|
modelValue: { default: void 0 },
|
|
@@ -23,13 +24,13 @@ const M = ["disabled", "data-testid"], U = ["value", "placeholder", "disabled",
|
|
|
23
24
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
24
25
|
setup(e, { emit: V }) {
|
|
25
26
|
const n = e, m = V, a = k(n.modelValue ?? "");
|
|
26
|
-
|
|
27
|
+
D(
|
|
27
28
|
() => n.modelValue,
|
|
28
29
|
(d) => {
|
|
29
30
|
d !== void 0 && (a.value = d);
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
|
-
const B = k(null), c =
|
|
33
|
+
const B = k(null), I = U(), S = i(() => I.value ? "rtl" : "ltr"), c = i(() => {
|
|
33
34
|
const d = {
|
|
34
35
|
xs: { h: "h-7", text: "text-xs", px: "px-2", icon: "w-3 h-3" },
|
|
35
36
|
sm: { h: "h-8", text: "text-xs", px: "px-2", icon: "w-3.5 h-3.5" },
|
|
@@ -38,7 +39,7 @@ const M = ["disabled", "data-testid"], U = ["value", "placeholder", "disabled",
|
|
|
38
39
|
xl: { h: "h-12", text: "text-lg", px: "px-5", icon: "w-6 h-6" }
|
|
39
40
|
};
|
|
40
41
|
return d[n.size] || d.md;
|
|
41
|
-
}),
|
|
42
|
+
}), j = i(() => ({
|
|
42
43
|
none: "rounded-none",
|
|
43
44
|
sm: "rounded-sm",
|
|
44
45
|
md: "rounded-md",
|
|
@@ -46,51 +47,52 @@ const M = ["disabled", "data-testid"], U = ["value", "placeholder", "disabled",
|
|
|
46
47
|
xl: "rounded-xl",
|
|
47
48
|
"2xl": "rounded-2xl",
|
|
48
49
|
full: "rounded-full"
|
|
49
|
-
})[n.rounded] || "rounded-md"),
|
|
50
|
-
none: "rounded-
|
|
51
|
-
sm: "rounded-
|
|
52
|
-
md: "rounded-
|
|
53
|
-
lg: "rounded-
|
|
54
|
-
xl: "rounded-
|
|
55
|
-
"2xl": "rounded-
|
|
56
|
-
full: "rounded-
|
|
57
|
-
})[n.rounded] || "rounded-
|
|
58
|
-
none: "rounded-
|
|
59
|
-
sm: "rounded-
|
|
60
|
-
md: "rounded-
|
|
61
|
-
lg: "rounded-
|
|
62
|
-
xl: "rounded-
|
|
63
|
-
"2xl": "rounded-
|
|
64
|
-
full: "rounded-
|
|
65
|
-
})[n.rounded] || "rounded-
|
|
66
|
-
|
|
50
|
+
})[n.rounded] || "rounded-md"), E = i(() => ({
|
|
51
|
+
none: "rounded-s-none",
|
|
52
|
+
sm: "rounded-s-sm",
|
|
53
|
+
md: "rounded-s-md",
|
|
54
|
+
lg: "rounded-s-lg",
|
|
55
|
+
xl: "rounded-s-xl",
|
|
56
|
+
"2xl": "rounded-s-2xl",
|
|
57
|
+
full: "rounded-s-full"
|
|
58
|
+
})[n.rounded] || "rounded-s-md"), R = i(() => ({
|
|
59
|
+
none: "rounded-e-none",
|
|
60
|
+
sm: "rounded-e-sm",
|
|
61
|
+
md: "rounded-e-md",
|
|
62
|
+
lg: "rounded-e-lg",
|
|
63
|
+
xl: "rounded-e-xl",
|
|
64
|
+
"2xl": "rounded-e-2xl",
|
|
65
|
+
full: "rounded-e-full"
|
|
66
|
+
})[n.rounded] || "rounded-e-md"), p = i(() => [
|
|
67
|
+
// bare flex: under dir=rtl first control sits on inline-start with logical radii
|
|
68
|
+
"input-addon-group flex items-center w-full relative transition-all duration-200",
|
|
67
69
|
n.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
68
70
|
n.mode === "solid" ? "bg-muted" : "",
|
|
69
71
|
n.mode === "outline" ? "border border-input bg-background" : "",
|
|
70
72
|
n.mode === "ghost" ? "bg-transparent" : "",
|
|
71
73
|
c.value.h,
|
|
72
|
-
|
|
73
|
-
]), F =
|
|
74
|
+
j.value
|
|
75
|
+
]), F = i(() => [
|
|
74
76
|
"flex-1 w-full bg-transparent focus:outline-none appearance-none",
|
|
75
|
-
n.variant === "split" ? "text-center" : "text-
|
|
77
|
+
n.variant === "split" ? "text-center" : "text-start ps-3 pe-2",
|
|
76
78
|
"placeholder:text-muted-foreground/50",
|
|
77
79
|
c.value.text,
|
|
78
80
|
n.disabled ? "cursor-not-allowed" : ""
|
|
79
|
-
]), C =
|
|
81
|
+
]), C = i(() => {
|
|
80
82
|
const d = "flex items-center justify-center transition-colors active:scale-95 shrink-0 select-none", t = n.disabled ? "" : "hover:text-primary hover:bg-muted/50";
|
|
81
83
|
return n.size === "xs" || n.size, n.variant === "split" ? n.mode === "solid" ? [
|
|
82
84
|
d,
|
|
83
85
|
n.disabled ? "" : "hover:text-primary hover:bg-background/80",
|
|
84
86
|
"bg-background shadow-sm rounded-full mx-1 my-0.5 aspect-square self-center h-[calc(100%-12px)] w-auto max-w-[calc(100%-12px)] flex items-center justify-center"
|
|
85
|
-
] : [d, t, "h-full", "px-2"] : [d, t, "h-1/2 w-8 border-
|
|
87
|
+
] : [d, t, "h-full", "px-2"] : [d, t, "h-1/2 w-8 border-s border-input/50"];
|
|
86
88
|
}), s = (d) => {
|
|
87
89
|
if (n.disabled || n.readonly) return;
|
|
88
90
|
let t = d;
|
|
89
91
|
n.min !== void 0 && t < n.min && (t = n.min), n.max !== void 0 && t > n.max && (t = n.max), a.value = t, m("update:modelValue", t), m("change", t);
|
|
90
92
|
};
|
|
91
|
-
let b = null,
|
|
93
|
+
let b = null, v = null;
|
|
92
94
|
const l = () => {
|
|
93
|
-
b && clearTimeout(b),
|
|
95
|
+
b && clearTimeout(b), v && clearInterval(v), b = null, v = null;
|
|
94
96
|
}, $ = () => {
|
|
95
97
|
if (n.disabled || n.readonly || n.max !== void 0 && Number(a.value) >= n.max) {
|
|
96
98
|
l();
|
|
@@ -105,9 +107,9 @@ const M = ["disabled", "data-testid"], U = ["value", "placeholder", "disabled",
|
|
|
105
107
|
}
|
|
106
108
|
const d = Number(a.value) || 0;
|
|
107
109
|
s(d - n.step);
|
|
108
|
-
},
|
|
110
|
+
}, x = (d, t) => {
|
|
109
111
|
t.button !== 0 && t.pointerType === "mouse" || (l(), d === "inc" ? $() : N(), b = setTimeout(() => {
|
|
110
|
-
|
|
112
|
+
v = setInterval(() => {
|
|
111
113
|
d === "inc" ? $() : N();
|
|
112
114
|
}, 50);
|
|
113
115
|
}, 400));
|
|
@@ -118,43 +120,44 @@ const M = ["disabled", "data-testid"], U = ["value", "placeholder", "disabled",
|
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
120
122
|
s(o);
|
|
121
|
-
},
|
|
123
|
+
}, T = (d) => {
|
|
122
124
|
m("blur", d);
|
|
123
125
|
const t = parseFloat(String(a.value));
|
|
124
126
|
isNaN(t) ? s(n.min || 0) : s(t);
|
|
125
|
-
},
|
|
127
|
+
}, W = (d) => {
|
|
126
128
|
const t = d.target;
|
|
127
129
|
document.activeElement === t && t.blur();
|
|
128
130
|
};
|
|
129
|
-
return
|
|
131
|
+
return M(() => {
|
|
130
132
|
l();
|
|
131
133
|
}), (d, t) => (f(), y("div", {
|
|
132
|
-
class:
|
|
134
|
+
class: u([p.value, "overflow-hidden"]),
|
|
135
|
+
dir: "ltr"
|
|
133
136
|
}, [
|
|
134
137
|
e.variant === "split" && !e.disabled && !e.readonly ? (f(), y("button", {
|
|
135
138
|
key: 0,
|
|
136
139
|
tabindex: "-1",
|
|
137
140
|
type: "button",
|
|
138
|
-
class:
|
|
141
|
+
class: u([
|
|
139
142
|
C.value,
|
|
140
|
-
e.mode === "outline" ? "border-
|
|
141
|
-
e.variant === "split" && e.mode !== "solid" ?
|
|
143
|
+
e.mode === "outline" ? "border-e border-input" : "",
|
|
144
|
+
e.variant === "split" && e.mode !== "solid" ? E.value : ""
|
|
142
145
|
]),
|
|
143
146
|
disabled: e.disabled || e.min !== void 0 && Number(a.value) <= e.min,
|
|
144
|
-
onPointerdown: t[0] || (t[0] = (o) =>
|
|
147
|
+
onPointerdown: t[0] || (t[0] = (o) => x("dec", o)),
|
|
145
148
|
onPointerup: l,
|
|
146
149
|
onPointerleave: l,
|
|
147
150
|
onPointercancel: l,
|
|
148
|
-
onContextmenu: t[1] || (t[1] =
|
|
151
|
+
onContextmenu: t[1] || (t[1] = r(() => {
|
|
149
152
|
}, ["prevent"])),
|
|
150
153
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-dec` : e.name ? `number-${e.name}-dec` : e.id ? `number-${e.id}-dec` : "number-input-dec"
|
|
151
154
|
}, [
|
|
152
|
-
|
|
155
|
+
g(w, {
|
|
153
156
|
icon: "lucide:minus",
|
|
154
|
-
class:
|
|
157
|
+
class: u(c.value.icon)
|
|
155
158
|
}, null, 8, ["class"])
|
|
156
|
-
], 42,
|
|
157
|
-
|
|
159
|
+
], 42, A)) : P("", !0),
|
|
160
|
+
h("input", {
|
|
158
161
|
ref_key: "inputRef",
|
|
159
162
|
ref: B,
|
|
160
163
|
type: "number",
|
|
@@ -162,85 +165,86 @@ const M = ["disabled", "data-testid"], U = ["value", "placeholder", "disabled",
|
|
|
162
165
|
placeholder: e.placeholder,
|
|
163
166
|
disabled: e.disabled,
|
|
164
167
|
readonly: e.readonly,
|
|
165
|
-
class:
|
|
168
|
+
class: u(F.value),
|
|
169
|
+
dir: S.value,
|
|
166
170
|
onInput: K,
|
|
167
171
|
onFocus: t[2] || (t[2] = (o) => m("focus", o)),
|
|
168
|
-
onBlur:
|
|
172
|
+
onBlur: T,
|
|
169
173
|
onKeydown: [
|
|
170
|
-
z(
|
|
171
|
-
z(
|
|
174
|
+
z(r($, ["prevent"]), ["up"]),
|
|
175
|
+
z(r(N, ["prevent"]), ["down"])
|
|
172
176
|
],
|
|
173
|
-
onWheel:
|
|
174
|
-
onInvalid: t[3] || (t[3] =
|
|
177
|
+
onWheel: W,
|
|
178
|
+
onInvalid: t[3] || (t[3] = r(() => {
|
|
175
179
|
}, ["prevent"])),
|
|
176
180
|
"data-testid": d.$attrs["data-testid"] || (e.name ? `number-${e.name}` : e.id ? `number-${e.id}` : "number-input")
|
|
177
|
-
}, null, 42,
|
|
181
|
+
}, null, 42, G),
|
|
178
182
|
e.variant === "split" && !e.disabled && !e.readonly ? (f(), y("button", {
|
|
179
183
|
key: 1,
|
|
180
184
|
tabindex: "-1",
|
|
181
185
|
type: "button",
|
|
182
|
-
class:
|
|
186
|
+
class: u([
|
|
183
187
|
C.value,
|
|
184
|
-
e.mode === "outline" ? "border-
|
|
185
|
-
e.variant === "split" && e.mode !== "solid" ?
|
|
188
|
+
e.mode === "outline" ? "border-s border-input" : "",
|
|
189
|
+
e.variant === "split" && e.mode !== "solid" ? R.value : ""
|
|
186
190
|
]),
|
|
187
191
|
disabled: e.disabled || e.max !== void 0 && Number(a.value) >= e.max,
|
|
188
|
-
onPointerdown: t[4] || (t[4] = (o) =>
|
|
192
|
+
onPointerdown: t[4] || (t[4] = (o) => x("inc", o)),
|
|
189
193
|
onPointerup: l,
|
|
190
194
|
onPointerleave: l,
|
|
191
195
|
onPointercancel: l,
|
|
192
|
-
onContextmenu: t[5] || (t[5] =
|
|
196
|
+
onContextmenu: t[5] || (t[5] = r(() => {
|
|
193
197
|
}, ["prevent"])),
|
|
194
198
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-inc` : e.name ? `number-${e.name}-inc` : e.id ? `number-${e.id}-inc` : "number-input-inc"
|
|
195
199
|
}, [
|
|
196
|
-
|
|
200
|
+
g(w, {
|
|
197
201
|
icon: "lucide:plus",
|
|
198
|
-
class:
|
|
202
|
+
class: u(c.value.icon)
|
|
199
203
|
}, null, 8, ["class"])
|
|
200
|
-
], 42,
|
|
201
|
-
e.variant === "stacked" && !e.disabled && !e.readonly ? (f(), y("div",
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
], 42, H)) : P("", !0),
|
|
205
|
+
e.variant === "stacked" && !e.disabled && !e.readonly ? (f(), y("div", J, [
|
|
206
|
+
h("div", L, [
|
|
207
|
+
h("button", {
|
|
204
208
|
tabindex: "-1",
|
|
205
209
|
type: "button",
|
|
206
210
|
class: "flex-1 flex items-center justify-center bg-gray-100 hover:bg-gray-200 text-muted-foreground hover:text-foreground rounded-t-[3px] border-b border-gray-300 transition-colors disabled:cursor-not-allowed",
|
|
207
211
|
disabled: e.disabled || e.max !== void 0 && Number(a.value) >= e.max,
|
|
208
|
-
onPointerdown: t[6] || (t[6] = (o) =>
|
|
212
|
+
onPointerdown: t[6] || (t[6] = (o) => x("inc", o)),
|
|
209
213
|
onPointerup: l,
|
|
210
214
|
onPointerleave: l,
|
|
211
215
|
onPointercancel: l,
|
|
212
|
-
onContextmenu: t[7] || (t[7] =
|
|
216
|
+
onContextmenu: t[7] || (t[7] = r(() => {
|
|
213
217
|
}, ["prevent"])),
|
|
214
218
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-inc` : e.name ? `number-${e.name}-inc` : e.id ? `number-${e.id}-inc` : "number-input-inc"
|
|
215
219
|
}, [
|
|
216
|
-
|
|
217
|
-
class:
|
|
220
|
+
g(w, {
|
|
221
|
+
class: u(["text-gray-700/85!", e.size === "xs" || e.size === "sm" ? "w-3 h-3" : "w-3.5 h-3.5"]),
|
|
218
222
|
icon: "mynaui:chevron-up-solid"
|
|
219
223
|
}, null, 8, ["class"])
|
|
220
|
-
], 40,
|
|
221
|
-
|
|
224
|
+
], 40, O),
|
|
225
|
+
h("button", {
|
|
222
226
|
tabindex: "-1",
|
|
223
227
|
type: "button",
|
|
224
228
|
class: "flex-1 flex items-center justify-center bg-gray-100 hover:bg-gray-200 text-muted-foreground hover:text-foreground rounded-b-[3px] transition-colors disabled:cursor-not-allowed",
|
|
225
229
|
disabled: e.disabled || e.min !== void 0 && Number(a.value) <= e.min,
|
|
226
|
-
onPointerdown: t[8] || (t[8] = (o) =>
|
|
230
|
+
onPointerdown: t[8] || (t[8] = (o) => x("dec", o)),
|
|
227
231
|
onPointerup: l,
|
|
228
232
|
onPointerleave: l,
|
|
229
233
|
onPointercancel: l,
|
|
230
|
-
onContextmenu: t[9] || (t[9] =
|
|
234
|
+
onContextmenu: t[9] || (t[9] = r(() => {
|
|
231
235
|
}, ["prevent"])),
|
|
232
236
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-dec` : e.name ? `number-${e.name}-dec` : e.id ? `number-${e.id}-dec` : "number-input-dec"
|
|
233
237
|
}, [
|
|
234
|
-
|
|
235
|
-
class:
|
|
238
|
+
g(w, {
|
|
239
|
+
class: u(["text-gray-700/85!", e.size === "xs" || e.size === "sm" ? "w-3 h-3" : "w-3.5 h-3.5"]),
|
|
236
240
|
icon: "mynaui:chevron-down-solid"
|
|
237
241
|
}, null, 8, ["class"])
|
|
238
|
-
], 40,
|
|
242
|
+
], 40, Q)
|
|
239
243
|
])
|
|
240
244
|
])) : P("", !0)
|
|
241
245
|
], 2));
|
|
242
246
|
}
|
|
243
247
|
});
|
|
244
248
|
export {
|
|
245
|
-
|
|
249
|
+
_ as default
|
|
246
250
|
};
|