vlite3 1.4.39 → 1.4.41
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.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 -0
- package/components/DataTable/DataTable.vue.js +380 -265
- 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 +11 -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.vue2.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 +8 -3
- package/components/Tabes/Tabes.vue.js +2 -2
- package/components/Tabes/Tabes.vue2.js +209 -200
- package/components/Tabes/tabes.utils.d.ts +23 -0
- package/components/Tabes/tabes.utils.js +39 -16
- 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 +1 -1
- package/style.css +86 -1
- package/types/button.d.ts +8 -0
- package/components/Navbar/NavbarTabs.vue3.js +0 -5
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useResizeObserver as
|
|
3
|
-
import { getActiveMarkerKey as
|
|
4
|
-
import { measureTabesMarkerGeometry as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { $t as
|
|
9
|
-
|
|
1
|
+
import { defineComponent as Te, ref as f, computed as o, watch as m, onMounted as De, onBeforeUnmount as Ie, openBlock as v, createElementBlock as M, normalizeClass as l, withDirectives as A, createVNode as w, vShow as F, createElementVNode as u, normalizeStyle as je, createCommentVNode as j, Fragment as ee, renderList as qe, unref as te, createBlock as O, withCtx as re, toDisplayString as ne, withMemo as Pe, resolveDynamicComponent as He, mergeProps as Ne, nextTick as We } from "vue";
|
|
2
|
+
import { useResizeObserver as ae } from "@vueuse/core";
|
|
3
|
+
import { getActiveMarkerKey as Ge, isMenuTab as se, isTabActive as oe, scrollTabesStrip as le, getTabesScrollOverflow as Ke } from "./tabes.utils.js";
|
|
4
|
+
import { measureTabesMarkerGeometry as Qe, toTabesLocalScrollDelta as ie } from "./TabesMarkerGeometry.js";
|
|
5
|
+
import y from "../Icon.vue.js";
|
|
6
|
+
import ce from "../FadeOverlay/FadeOverlay.vue.js";
|
|
7
|
+
import Ue from "../Dropdown/Dropdown.vue.js";
|
|
8
|
+
import { $t as Je } from "../../utils/i18n.js";
|
|
9
|
+
import { useRtl as Xe, resolveDirFromAncestors as Ye } from "../../composables/useRtl.js";
|
|
10
|
+
const Ze = ["dir"], _e = ["data-variant"], et = ["aria-selected", "aria-expanded", "disabled"], ue = 200, ut = /* @__PURE__ */ Te({
|
|
10
11
|
__name: "Tabes",
|
|
11
12
|
props: {
|
|
12
13
|
options: {},
|
|
@@ -17,129 +18,135 @@ const Ee = ["dir"], Te = ["data-variant"], je = ["aria-selected", "aria-expanded
|
|
|
17
18
|
textClass: {},
|
|
18
19
|
wrap: { type: Boolean, default: !1 },
|
|
19
20
|
tabClass: {},
|
|
20
|
-
direction: { default: "
|
|
21
|
+
direction: { default: "auto" }
|
|
21
22
|
},
|
|
22
23
|
emits: ["update:modelValue", "change", "menu-select", "menu-open", "menu-close"],
|
|
23
|
-
setup(s, { emit:
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
setup(s, { emit: de }) {
|
|
25
|
+
const r = s, b = de, q = f(null), k = f(null), d = f(null), g = /* @__PURE__ */ new Map(), P = Xe(), L = f(null), C = o(() => r.direction === "rtl" ? "rtl" : r.direction === "ltr" ? "ltr" : L.value ? L.value : P.value ? "rtl" : "ltr"), S = o(() => C.value === "rtl"), H = () => {
|
|
26
|
+
L.value = Ye(q.value);
|
|
27
|
+
}, V = f(!1), z = f(!1);
|
|
28
|
+
let E = 0, N = 0, B = !1, $ = !1, T = 0;
|
|
29
|
+
const W = () => {
|
|
30
|
+
if (!d.value) return;
|
|
31
|
+
const { canScrollStart: e, canScrollEnd: n } = Ke(
|
|
32
|
+
d.value
|
|
33
|
+
);
|
|
34
|
+
V.value !== e && (V.value = e), z.value !== n && (z.value = n);
|
|
35
|
+
}, fe = () => {
|
|
36
|
+
$ || ($ = !0, N = requestAnimationFrame(() => {
|
|
37
|
+
$ = !1, W();
|
|
33
38
|
}));
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!u.value || !k.value) return;
|
|
38
|
-
const e = D.value;
|
|
39
|
+
}, me = () => le(d.value, "start", ue), ve = () => le(d.value, "end", ue), G = o(() => Ge(r.options, r.modelValue)), be = () => {
|
|
40
|
+
if (!d.value || !k.value) return;
|
|
41
|
+
const e = G.value;
|
|
39
42
|
if (e === void 0) return;
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
const t =
|
|
43
|
-
a.left <
|
|
44
|
-
left:
|
|
43
|
+
const n = g.get(e);
|
|
44
|
+
if (!n) return;
|
|
45
|
+
const t = d.value, a = n.getBoundingClientRect(), i = t.getBoundingClientRect(), p = 40;
|
|
46
|
+
a.left < i.left + p ? t.scrollBy({
|
|
47
|
+
left: ie(
|
|
45
48
|
t,
|
|
46
|
-
a.left -
|
|
49
|
+
a.left - i.left - p
|
|
47
50
|
),
|
|
48
51
|
behavior: "smooth"
|
|
49
|
-
}) : a.right >
|
|
50
|
-
left:
|
|
52
|
+
}) : a.right > i.right - p && t.scrollBy({
|
|
53
|
+
left: ie(
|
|
51
54
|
t,
|
|
52
|
-
a.right -
|
|
55
|
+
a.right - i.right + p
|
|
53
56
|
),
|
|
54
57
|
behavior: "smooth"
|
|
55
58
|
});
|
|
56
|
-
},
|
|
57
|
-
e instanceof HTMLElement ?
|
|
58
|
-
},
|
|
59
|
+
}, K = (e, n) => {
|
|
60
|
+
e instanceof HTMLElement ? g.set(n, e) : e && typeof e == "object" && "$el" in e && e.$el instanceof HTMLElement ? g.set(n, e.$el) : g.delete(n);
|
|
61
|
+
}, h = f({
|
|
59
62
|
width: "0px",
|
|
60
63
|
height: "0px",
|
|
64
|
+
left: "0px",
|
|
65
|
+
top: "0px",
|
|
61
66
|
transform: "translate(0px, 0px)",
|
|
62
67
|
opacity: 0
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
...
|
|
68
|
+
}), D = f(!1), Q = () => {
|
|
69
|
+
h.value.opacity !== 0 && (h.value = {
|
|
70
|
+
...h.value,
|
|
66
71
|
opacity: 0
|
|
67
72
|
});
|
|
68
|
-
},
|
|
69
|
-
await
|
|
70
|
-
const e = k.value,
|
|
73
|
+
}, ge = async () => {
|
|
74
|
+
await We();
|
|
75
|
+
const e = k.value, n = G.value, t = n !== void 0 ? g.get(n) : void 0;
|
|
71
76
|
if (!e || !t) {
|
|
72
|
-
|
|
77
|
+
Q();
|
|
73
78
|
return;
|
|
74
79
|
}
|
|
75
80
|
if (e.offsetWidth <= 0 || t.offsetWidth <= 0) {
|
|
76
|
-
|
|
81
|
+
Q();
|
|
77
82
|
return;
|
|
78
83
|
}
|
|
79
|
-
const { width: a, height:
|
|
84
|
+
const { width: a, height: i, left: p, top: Ee } = Qe(e, t), x = {
|
|
80
85
|
width: `${a}px`,
|
|
81
|
-
height: `${
|
|
82
|
-
|
|
86
|
+
height: `${i}px`,
|
|
87
|
+
left: "0px",
|
|
88
|
+
top: "0px",
|
|
89
|
+
transform: `translate(${p}px, ${Ee}px)`,
|
|
83
90
|
opacity: 1
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
}, R = h.value;
|
|
92
|
+
R.width === x.width && R.height === x.height && R.transform === x.transform && R.opacity === x.opacity || (h.value = x, D.value || (cancelAnimationFrame(T), T = requestAnimationFrame(() => {
|
|
93
|
+
D.value = !0;
|
|
87
94
|
})));
|
|
88
95
|
};
|
|
89
96
|
let I = !1;
|
|
90
|
-
const
|
|
91
|
-
await
|
|
92
|
-
},
|
|
93
|
-
e?.ensureVisible && (I = !0), !
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
I = !1,
|
|
97
|
+
const U = async (e) => {
|
|
98
|
+
await ge(), W(), e?.ensureVisible && be();
|
|
99
|
+
}, c = (e) => {
|
|
100
|
+
e?.ensureVisible && (I = !0), !B && (B = !0, cancelAnimationFrame(E), E = requestAnimationFrame(() => {
|
|
101
|
+
B = !1;
|
|
102
|
+
const n = I;
|
|
103
|
+
I = !1, U({ ensureVisible: n });
|
|
97
104
|
}));
|
|
98
105
|
};
|
|
99
|
-
|
|
100
|
-
() =>
|
|
101
|
-
() =>
|
|
102
|
-
),
|
|
103
|
-
() =>
|
|
104
|
-
() =>
|
|
105
|
-
),
|
|
106
|
-
() =>
|
|
107
|
-
() =>
|
|
108
|
-
),
|
|
109
|
-
() =>
|
|
110
|
-
() =>
|
|
111
|
-
),
|
|
112
|
-
() =>
|
|
113
|
-
() =>
|
|
114
|
-
),
|
|
115
|
-
() =>
|
|
116
|
-
() =>
|
|
117
|
-
),
|
|
118
|
-
H({ ensureVisible: !0 });
|
|
119
|
-
}),
|
|
120
|
-
cancelAnimationFrame(
|
|
106
|
+
ae(d, () => c()), ae(k, () => c()), m(
|
|
107
|
+
() => r.modelValue,
|
|
108
|
+
() => c({ ensureVisible: !0 })
|
|
109
|
+
), m(
|
|
110
|
+
() => r.options,
|
|
111
|
+
() => c()
|
|
112
|
+
), m(
|
|
113
|
+
() => r.size,
|
|
114
|
+
() => c()
|
|
115
|
+
), m(
|
|
116
|
+
() => r.block,
|
|
117
|
+
() => c()
|
|
118
|
+
), m(
|
|
119
|
+
() => r.wrap,
|
|
120
|
+
() => c()
|
|
121
|
+
), m(
|
|
122
|
+
() => r.variant,
|
|
123
|
+
() => c()
|
|
124
|
+
), m(P, () => H()), m(C, () => c({ ensureVisible: !0 })), De(() => {
|
|
125
|
+
H(), U({ ensureVisible: !0 });
|
|
126
|
+
}), Ie(() => {
|
|
127
|
+
cancelAnimationFrame(E), cancelAnimationFrame(N), cancelAnimationFrame(T), B = !1, $ = !1, g.clear();
|
|
121
128
|
});
|
|
122
|
-
const
|
|
123
|
-
const e =
|
|
124
|
-
return
|
|
125
|
-
}),
|
|
129
|
+
const he = o(() => {
|
|
130
|
+
const e = r.variant === "line";
|
|
131
|
+
return r.block || e ? "flex w-full relative" : "inline-flex max-w-full relative";
|
|
132
|
+
}), J = o(() => [
|
|
126
133
|
"absolute top-0 bottom-0 z-20 flex items-center pointer-events-none transition-opacity duration-200",
|
|
127
|
-
|
|
128
|
-
]),
|
|
129
|
-
e.disabled ||
|
|
130
|
-
},
|
|
134
|
+
r.variant === "line" ? "pb-[10px]" : ""
|
|
135
|
+
]), pe = (e) => {
|
|
136
|
+
e.disabled || se(e) || (b("update:modelValue", e.value), b("change", e.value));
|
|
137
|
+
}, xe = (e, n) => {
|
|
131
138
|
if (e.disabled) return;
|
|
132
|
-
const t =
|
|
133
|
-
t != null && (
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
const e =
|
|
140
|
-
return (
|
|
141
|
-
}),
|
|
142
|
-
const e =
|
|
139
|
+
const t = n.value;
|
|
140
|
+
t != null && (b("update:modelValue", t), b("change", t), b("menu-select", { value: t, option: n.option, tab: e }));
|
|
141
|
+
}, we = (e) => {
|
|
142
|
+
b("menu-open", e);
|
|
143
|
+
}, ye = (e) => {
|
|
144
|
+
b("menu-close", e), c();
|
|
145
|
+
}, ke = o(() => {
|
|
146
|
+
const e = r.variant === "line";
|
|
147
|
+
return (r.block || r.wrap) && !e ? "flex-1 min-w-max" : "shrink-0";
|
|
148
|
+
}), Ce = (e) => e.dropdown?.direction ?? C.value, Se = o(() => S.value ? "right" : "left"), Ve = o(() => S.value ? "left" : "right"), ze = o(() => S.value ? "lucide:chevron-right" : "lucide:chevron-left"), Be = o(() => S.value ? "lucide:chevron-left" : "lucide:chevron-right"), $e = o(() => {
|
|
149
|
+
const e = r.variant === "line", n = {
|
|
143
150
|
surface: "bg-secondary/80 p-1",
|
|
144
151
|
primary: "bg-secondary p-1",
|
|
145
152
|
secondary: "bg-secondary p-1",
|
|
@@ -147,52 +154,52 @@ const Ee = ["dir"], Te = ["data-variant"], je = ["aria-selected", "aria-expanded
|
|
|
147
154
|
success: "bg-success/10 p-1",
|
|
148
155
|
outline: "bg-transparent border border-border p-1",
|
|
149
156
|
line: "bg-transparent gap-6 rounded-none p-0 border-b border-border"
|
|
150
|
-
}, t =
|
|
151
|
-
return [`${
|
|
152
|
-
}),
|
|
157
|
+
}, t = r.wrap && !e ? "flex-wrap" : "";
|
|
158
|
+
return [`${r.block || e ? "flex min-w-full w-max" : "inline-flex"} rounded-lg relative isolate ${t}`, n[r.variant]];
|
|
159
|
+
}), X = o(() => r.variant === "surface" || r.variant === "primary" || r.variant === "secondary" ? "var(--color-secondary)" : r.variant === "danger" ? "color-mix(in srgb, var(--color-danger) 10%, transparent)" : r.variant === "success" ? "color-mix(in srgb, var(--color-success) 10%, transparent)" : "var(--color-background)"), Y = {
|
|
153
160
|
sm: "text-xs px-2.5 py-1",
|
|
154
161
|
md: "-text-fs-2 px-3 py-1",
|
|
155
162
|
lg: "-text-fs-1 px-4 py-1"
|
|
156
|
-
},
|
|
157
|
-
const e =
|
|
158
|
-
return [
|
|
159
|
-
}),
|
|
160
|
-
const
|
|
163
|
+
}, Re = o(() => {
|
|
164
|
+
const e = r.variant === "line", n = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none pb-3 border-b-2 border-transparent hover:text-foreground shrink-0" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none shrink-0", t = (r.block || r.wrap) && !e ? "flex-1" : "";
|
|
165
|
+
return [n, t];
|
|
166
|
+
}), Z = (e) => {
|
|
167
|
+
const n = oe(e, r.modelValue), t = r.variant === "line";
|
|
161
168
|
let a = "";
|
|
162
|
-
if (
|
|
169
|
+
if (n)
|
|
163
170
|
if (t)
|
|
164
|
-
a =
|
|
171
|
+
a = r.wrap ? "text-primary !border-primary" : "text-primary";
|
|
165
172
|
else
|
|
166
|
-
switch (
|
|
173
|
+
switch (r.variant) {
|
|
167
174
|
case "surface":
|
|
168
|
-
a =
|
|
175
|
+
a = r.wrap ? "text-foreground bg-[#ffff] dark:bg-[#0B0B0B] shadow-sm" : "text-foreground";
|
|
169
176
|
break;
|
|
170
177
|
case "primary":
|
|
171
|
-
a =
|
|
178
|
+
a = r.wrap ? "text-primary-foreground bg-primary" : "text-primary-foreground";
|
|
172
179
|
break;
|
|
173
180
|
case "secondary":
|
|
174
|
-
a =
|
|
181
|
+
a = r.wrap ? "text-secondary bg-secondary-foreground" : "text-secondary";
|
|
175
182
|
break;
|
|
176
183
|
case "danger":
|
|
177
|
-
a =
|
|
184
|
+
a = r.wrap ? "text-danger-fg bg-danger" : "text-danger-fg";
|
|
178
185
|
break;
|
|
179
186
|
case "success":
|
|
180
|
-
a =
|
|
187
|
+
a = r.wrap ? "text-success-fg bg-success" : "text-success-fg";
|
|
181
188
|
break;
|
|
182
189
|
case "outline":
|
|
183
|
-
a =
|
|
190
|
+
a = r.wrap ? "text-accent-foreground bg-accent/50 ring-1 ring-border" : "text-accent-foreground";
|
|
184
191
|
break;
|
|
185
192
|
default:
|
|
186
193
|
a = "text-foreground";
|
|
187
194
|
}
|
|
188
195
|
else
|
|
189
196
|
a = t ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
|
|
190
|
-
const
|
|
191
|
-
return [
|
|
192
|
-
},
|
|
193
|
-
const
|
|
194
|
-
return
|
|
195
|
-
}),
|
|
197
|
+
const i = e.disabled ? "opacity-50 cursor-not-allowed" : "";
|
|
198
|
+
return [Re.value, a, r?.tabClass, i].join(" ");
|
|
199
|
+
}, Me = o(() => {
|
|
200
|
+
const n = `absolute z-0 pointer-events-none ${D.value ? "transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]" : ""}`;
|
|
201
|
+
return r.variant === "line" ? `${n} !h-[2px] !top-auto bottom-0` : `${n} rounded-md shadow-sm`;
|
|
202
|
+
}), Ae = () => ({
|
|
196
203
|
surface: "bg-[#ffff] dark:bg-[#0B0B0B]",
|
|
197
204
|
primary: "bg-primary",
|
|
198
205
|
secondary: "bg-secondary-foreground",
|
|
@@ -200,70 +207,72 @@ const Ee = ["dir"], Te = ["data-variant"], je = ["aria-selected", "aria-expanded
|
|
|
200
207
|
success: "bg-success",
|
|
201
208
|
outline: "bg-accent/50 ring-1 ring-border",
|
|
202
209
|
line: "bg-primary"
|
|
203
|
-
})[
|
|
204
|
-
|
|
210
|
+
})[r.variant], _ = (e) => e.labelI18n ? Je(e.labelI18n) : e.label, Fe = (e) => e.to ? "router-link" : e.href ? "a" : "button", Oe = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" }, Le = (e) => [
|
|
211
|
+
r.size === "sm" ? "w-3 h-3" : "w-3.5 h-3.5",
|
|
205
212
|
"opacity-70 shrink-0 transition-transform duration-200",
|
|
206
213
|
e ? "rotate-180" : ""
|
|
207
214
|
].join(" ");
|
|
208
|
-
return (e,
|
|
209
|
-
|
|
210
|
-
|
|
215
|
+
return (e, n) => (v(), M("div", {
|
|
216
|
+
ref_key: "rootRef",
|
|
217
|
+
ref: q,
|
|
218
|
+
class: l([he.value, "group"]),
|
|
219
|
+
dir: C.value
|
|
211
220
|
}, [
|
|
212
|
-
|
|
213
|
-
direction:
|
|
214
|
-
color:
|
|
221
|
+
A(w(ce, {
|
|
222
|
+
direction: Se.value,
|
|
223
|
+
color: X.value,
|
|
215
224
|
coverage: "100px",
|
|
216
225
|
blur: "40px",
|
|
217
226
|
easing: "smooth",
|
|
218
227
|
tintOpacity: 1,
|
|
219
|
-
class: l(["z-10 pointer-events-none",
|
|
220
|
-
}, null, 8, ["color", "class"]), [
|
|
221
|
-
[
|
|
228
|
+
class: l(["z-10 pointer-events-none", r.variant === "line" ? "" : "rounded-s-lg"])
|
|
229
|
+
}, null, 8, ["direction", "color", "class"]), [
|
|
230
|
+
[F, V.value]
|
|
222
231
|
]),
|
|
223
|
-
|
|
224
|
-
class: l(["
|
|
232
|
+
A(u("div", {
|
|
233
|
+
class: l(["start-0 ps-1", J.value])
|
|
225
234
|
}, [
|
|
226
|
-
|
|
227
|
-
onClick:
|
|
235
|
+
u("button", {
|
|
236
|
+
onClick: me,
|
|
228
237
|
class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
|
|
229
|
-
"aria-label": "Scroll
|
|
238
|
+
"aria-label": "Scroll backward"
|
|
230
239
|
}, [
|
|
231
|
-
y
|
|
232
|
-
icon:
|
|
240
|
+
w(y, {
|
|
241
|
+
icon: ze.value,
|
|
233
242
|
class: "w-5 h-5"
|
|
234
|
-
})
|
|
243
|
+
}, null, 8, ["icon"])
|
|
235
244
|
])
|
|
236
245
|
], 2), [
|
|
237
|
-
[
|
|
246
|
+
[F, V.value]
|
|
238
247
|
]),
|
|
239
|
-
|
|
248
|
+
u("div", {
|
|
240
249
|
ref_key: "scrollRef",
|
|
241
|
-
ref:
|
|
250
|
+
ref: d,
|
|
242
251
|
class: "tabes-scroll flex-1 min-w-0 max-w-full overflow-x-auto scrollbar-hide scroll-smooth",
|
|
243
|
-
onScroll:
|
|
252
|
+
onScroll: fe
|
|
244
253
|
}, [
|
|
245
|
-
|
|
254
|
+
u("div", {
|
|
246
255
|
ref_key: "containerRef",
|
|
247
256
|
ref: k,
|
|
248
|
-
class: l([
|
|
257
|
+
class: l([$e.value, "tabes-container"]),
|
|
249
258
|
role: "tablist",
|
|
250
|
-
"data-variant":
|
|
259
|
+
"data-variant": r.variant,
|
|
251
260
|
"data-tabes": ""
|
|
252
261
|
}, [
|
|
253
|
-
s.modelValue !== void 0 && !s.wrap ? (
|
|
262
|
+
s.modelValue !== void 0 && !s.wrap ? (v(), M("div", {
|
|
254
263
|
key: 0,
|
|
255
|
-
class: l(["tabes-marker", [
|
|
256
|
-
style:
|
|
257
|
-
}, null, 6)) :
|
|
258
|
-
(
|
|
264
|
+
class: l(["tabes-marker", [Me.value, Ae()]]),
|
|
265
|
+
style: je(h.value)
|
|
266
|
+
}, null, 6)) : j("", !0),
|
|
267
|
+
(v(!0), M(ee, null, qe(s.options, (t) => (v(), M(ee, {
|
|
259
268
|
key: t.value
|
|
260
269
|
}, [
|
|
261
|
-
|
|
270
|
+
te(se)(t) ? (v(), O(Ue, {
|
|
262
271
|
key: 0,
|
|
263
272
|
options: t.menu,
|
|
264
273
|
selected: s.modelValue,
|
|
265
274
|
disabled: t.disabled,
|
|
266
|
-
direction:
|
|
275
|
+
direction: Ce(t),
|
|
267
276
|
position: t.dropdown?.position,
|
|
268
277
|
offset: t.dropdown?.offset ?? [0, 8],
|
|
269
278
|
searchable: t.dropdown?.searchable ?? !1,
|
|
@@ -277,98 +286,98 @@ const Ee = ["dir"], Te = ["data-variant"], je = ["aria-selected", "aria-expanded
|
|
|
277
286
|
"show-selected-icon": !1,
|
|
278
287
|
"toggle-selection": !1,
|
|
279
288
|
selectable: !0,
|
|
280
|
-
class: l(["tabes-menu", "inline-flex!",
|
|
281
|
-
onOnSelect: (a) =>
|
|
282
|
-
onOnOpen: () =>
|
|
283
|
-
onOnClose: () =>
|
|
289
|
+
class: l(["tabes-menu", "inline-flex!", ke.value]),
|
|
290
|
+
onOnSelect: (a) => xe(t, a),
|
|
291
|
+
onOnOpen: () => we(t),
|
|
292
|
+
onOnClose: () => ye(t)
|
|
284
293
|
}, {
|
|
285
|
-
trigger:
|
|
286
|
-
|
|
294
|
+
trigger: re(({ isOpen: a }) => [
|
|
295
|
+
u("button", {
|
|
287
296
|
ref_for: !0,
|
|
288
|
-
ref: (
|
|
297
|
+
ref: (i) => K(i, t.value),
|
|
289
298
|
type: "button",
|
|
290
299
|
role: "tab",
|
|
291
300
|
"data-tabes-item": "",
|
|
292
301
|
"data-tabes-menu-trigger": "",
|
|
293
|
-
"aria-selected":
|
|
302
|
+
"aria-selected": te(oe)(t, s.modelValue),
|
|
294
303
|
"aria-haspopup": !0,
|
|
295
304
|
"aria-expanded": a,
|
|
296
305
|
disabled: t.disabled,
|
|
297
|
-
class: l([
|
|
306
|
+
class: l([Z(t), Y[r.size], "w-full"])
|
|
298
307
|
}, [
|
|
299
|
-
t.icon ? (
|
|
308
|
+
t.icon ? (v(), O(y, {
|
|
300
309
|
key: 0,
|
|
301
310
|
icon: t.icon,
|
|
302
311
|
class: l(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
|
|
303
|
-
}, null, 8, ["icon", "class"])) :
|
|
304
|
-
|
|
312
|
+
}, null, 8, ["icon", "class"])) : j("", !0),
|
|
313
|
+
u("span", {
|
|
305
314
|
class: l(["whitespace-nowrap z-20 relative", s.textClass])
|
|
306
|
-
},
|
|
307
|
-
y
|
|
315
|
+
}, ne(_(t)), 3),
|
|
316
|
+
w(y, {
|
|
308
317
|
icon: "lucide:chevron-down",
|
|
309
|
-
class: l(
|
|
318
|
+
class: l(Le(a)),
|
|
310
319
|
"aria-hidden": "true"
|
|
311
320
|
}, null, 8, ["class"])
|
|
312
|
-
], 10,
|
|
321
|
+
], 10, et)
|
|
313
322
|
]),
|
|
314
323
|
_: 2
|
|
315
|
-
}, 1032, ["options", "selected", "disabled", "direction", "position", "offset", "searchable", "close-on-select", "max-height", "min-width", "width", "menu-id", "teleport", "class", "onOnSelect", "onOnOpen", "onOnClose"])) :
|
|
324
|
+
}, 1032, ["options", "selected", "disabled", "direction", "position", "offset", "searchable", "close-on-select", "max-height", "min-width", "width", "menu-id", "teleport", "class", "onOnSelect", "onOnOpen", "onOnClose"])) : Pe([t, s.modelValue === t.value, s.size, s.variant, s.block, s.wrap, s.tabClass, s.textClass], () => (v(), O(He(Fe(t)), Ne({
|
|
316
325
|
key: 1,
|
|
317
326
|
ref_for: !0,
|
|
318
|
-
ref: (a) =>
|
|
327
|
+
ref: (a) => K(a, t.value),
|
|
319
328
|
role: "tab",
|
|
320
329
|
"data-tabes-item": "",
|
|
321
330
|
"aria-selected": s.modelValue === t.value,
|
|
322
331
|
disabled: t.disabled,
|
|
323
|
-
class: [
|
|
324
|
-
}, { ref_for: !0 },
|
|
325
|
-
onClick: (a) =>
|
|
332
|
+
class: [Z(t), Y[r.size]]
|
|
333
|
+
}, { ref_for: !0 }, Oe(t), {
|
|
334
|
+
onClick: (a) => pe(t)
|
|
326
335
|
}), {
|
|
327
|
-
default:
|
|
328
|
-
t.icon ? (
|
|
336
|
+
default: re(() => [
|
|
337
|
+
t.icon ? (v(), O(y, {
|
|
329
338
|
key: 0,
|
|
330
339
|
icon: t.icon,
|
|
331
340
|
class: l(s.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4")
|
|
332
|
-
}, null, 8, ["icon", "class"])) :
|
|
333
|
-
|
|
341
|
+
}, null, 8, ["icon", "class"])) : j("", !0),
|
|
342
|
+
u("span", {
|
|
334
343
|
class: l(["whitespace-nowrap z-20 relative", s.textClass])
|
|
335
|
-
},
|
|
344
|
+
}, ne(_(t)), 3)
|
|
336
345
|
]),
|
|
337
346
|
_: 2
|
|
338
|
-
}, 1040, ["aria-selected", "disabled", "class", "onClick"])),
|
|
347
|
+
}, 1040, ["aria-selected", "disabled", "class", "onClick"])), n, 0)
|
|
339
348
|
], 64))), 128))
|
|
340
|
-
], 10,
|
|
349
|
+
], 10, _e)
|
|
341
350
|
], 544),
|
|
342
|
-
|
|
343
|
-
direction:
|
|
344
|
-
color:
|
|
351
|
+
A(w(ce, {
|
|
352
|
+
direction: Ve.value,
|
|
353
|
+
color: X.value,
|
|
345
354
|
coverage: "100px",
|
|
346
355
|
blur: "40",
|
|
347
356
|
easing: "smooth",
|
|
348
357
|
tintOpacity: 1,
|
|
349
|
-
class: l(["z-10 pointer-events-none",
|
|
350
|
-
}, null, 8, ["color", "class"]), [
|
|
351
|
-
[
|
|
358
|
+
class: l(["z-10 pointer-events-none", r.variant === "line" ? "" : "rounded-e-lg"])
|
|
359
|
+
}, null, 8, ["direction", "color", "class"]), [
|
|
360
|
+
[F, z.value]
|
|
352
361
|
]),
|
|
353
|
-
|
|
354
|
-
class: l(["
|
|
362
|
+
A(u("div", {
|
|
363
|
+
class: l(["end-0 pe-1", J.value])
|
|
355
364
|
}, [
|
|
356
|
-
|
|
357
|
-
onClick:
|
|
365
|
+
u("button", {
|
|
366
|
+
onClick: ve,
|
|
358
367
|
class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
|
|
359
|
-
"aria-label": "Scroll
|
|
368
|
+
"aria-label": "Scroll forward"
|
|
360
369
|
}, [
|
|
361
|
-
y
|
|
362
|
-
icon:
|
|
370
|
+
w(y, {
|
|
371
|
+
icon: Be.value,
|
|
363
372
|
class: "w-5 h-5"
|
|
364
|
-
})
|
|
373
|
+
}, null, 8, ["icon"])
|
|
365
374
|
])
|
|
366
375
|
], 2), [
|
|
367
|
-
[
|
|
376
|
+
[F, z.value]
|
|
368
377
|
])
|
|
369
|
-
], 10,
|
|
378
|
+
], 10, Ze));
|
|
370
379
|
}
|
|
371
380
|
});
|
|
372
381
|
export {
|
|
373
|
-
|
|
382
|
+
ut as default
|
|
374
383
|
};
|
|
@@ -12,3 +12,26 @@ export declare function isTabActive(option: TabesOption, modelValue: string | nu
|
|
|
12
12
|
* For menu tabs, returns the parent tab's value when a child is selected.
|
|
13
13
|
*/
|
|
14
14
|
export declare function getActiveMarkerKey(options: TabesOption[], modelValue: string | number): string | number | undefined;
|
|
15
|
+
/** Start/end (inline-edge) scroll overflow of a horizontal tab strip. */
|
|
16
|
+
export interface TabesScrollOverflow {
|
|
17
|
+
/** More content is hidden past the inline-start edge. */
|
|
18
|
+
canScrollStart: boolean;
|
|
19
|
+
/** More content is hidden past the inline-end edge. */
|
|
20
|
+
canScrollEnd: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Compute inline-start / inline-end scroll overflow for a horizontal tab strip,
|
|
24
|
+
* shared by `Tabes` and `NavbarTabs` so both track affordances identically.
|
|
25
|
+
*
|
|
26
|
+
* Direction-agnostic: modern engines report `scrollLeft` as ≤ 0 under RTL
|
|
27
|
+
* (start = 0, end grows negative), so the magnitude is the distance scrolled
|
|
28
|
+
* from the inline-start edge in either direction. `itemSelector` is an optional
|
|
29
|
+
* guard — with no matching items there is nothing to scroll.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getTabesScrollOverflow(el: HTMLElement | null | undefined, itemSelector?: string): TabesScrollOverflow;
|
|
32
|
+
/**
|
|
33
|
+
* Smoothly step a tab strip one page toward its inline-start / inline-end edge.
|
|
34
|
+
* `scrollBy({ left })` is physical, so the sign flips under RTL where
|
|
35
|
+
* inline-start sits on the physical right.
|
|
36
|
+
*/
|
|
37
|
+
export declare function scrollTabesStrip(el: HTMLElement | null | undefined, toward: 'start' | 'end', amount: number): void;
|