vlite3 1.5.5 → 1.5.7
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 +34 -0
- package/VLiteIconsVite.d.ts +36 -0
- package/components/AppShell/AppShell.vue.d.ts +1 -1
- package/components/AppShell/AppShellLayoutDashboard.vue.js +3 -2
- package/components/AppShell/AppShellLayoutDock.vue.js +3 -2
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +28 -27
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +3 -2
- package/components/AsyncSelect/createAsyncSelect.d.ts +4 -4
- package/components/AsyncSelect/createAsyncSelect.js +3 -2
- package/components/BackButton.vue.d.ts +1 -1
- package/components/ButtonGroup.vue.js +2 -2
- package/components/CategoryManager/CategoryManager.vue2.js +15 -15
- package/components/CategoryManager/CategoryNode.vue.js +16 -16
- package/components/CategoryMenu/CategoryMenu.vue.js +9 -8
- package/components/Chart/BarChart.vue.d.ts +1 -1
- package/components/Chart/GanttChart.vue.d.ts +1 -1
- package/components/Chart/LineChart.vue.d.ts +1 -1
- package/components/Chart/TimelineChart.vue.d.ts +1 -1
- package/components/Chip/Chip.vue.d.ts +1 -0
- package/components/Chip/Chip.vue.js +67 -36
- package/components/Chip/types.d.ts +5 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/ConfirmationModal.vue.d.ts +4 -0
- package/components/ConfirmationModal.vue.js +47 -39
- package/components/DataTable/DataTable.vue.d.ts +12 -3
- package/components/DataTable/DataTable.vue.js +5 -561
- package/components/DataTable/DataTable.vue2.js +711 -2
- package/components/DataTable/DataTableHeader.vue.d.ts +22 -0
- package/components/DataTable/DataTableHeader.vue.js +5 -58
- package/components/DataTable/DataTableHeader.vue2.js +106 -2
- package/components/DataTable/DataTableRow.vue.d.ts +15 -0
- package/components/DataTable/DataTableRow.vue.js +3 -3
- package/components/DataTable/DataTableRow.vue2.js +131 -118
- package/components/DataTable/dataTableColumnWidths.d.ts +91 -0
- package/components/DataTable/dataTableColumnWidths.js +82 -0
- package/components/DataTable/types.d.ts +50 -0
- package/components/DataTable/useDataTableColumnResize.d.ts +52 -0
- package/components/DataTable/useDataTableColumnResize.js +328 -0
- package/components/DatePicker.vue.js +5 -4
- package/components/Empty/Empty.vue.js +3 -2
- package/components/ExportData/ExportData.vue.d.ts +1 -1
- package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
- package/components/Form/Form.vue2.js +44 -43
- package/components/Form/FormField.vue.js +24 -24
- package/components/Form/index.vue2.js +1 -1
- package/components/Heatmap/Heatmap.vue2.js +3 -2
- package/components/Icon.vue.d.ts +3 -2
- package/components/Icon.vue.js +22 -12
- package/components/IconPicker.vue.js +5 -133
- package/components/IconPicker.vue2.js +218 -2
- package/components/ImportData/ImportData.vue.js +3 -2
- package/components/ImportData/ImportStep2.vue.js +3 -2
- package/components/Kanban/KanbanBoard.vue2.js +4 -2
- package/components/List/utils.js +5 -4
- package/components/Masonry/Masonry.vue2.js +14 -13
- package/components/Navbar/Navbar.vue.d.ts +1 -1
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +1 -1
- package/components/Price/Price.vue.js +13 -12
- package/components/Rating/Rating.vue.js +2 -2
- package/components/Rating/Rating.vue2.js +41 -41
- package/components/Rating/ReviewSummary.vue.js +20 -20
- package/components/Screen/ScreenFilter.vue.js +6 -4
- package/components/Screen/components/ScreenExportModal.vue.d.ts +2 -2
- package/components/Stats/StatItem.vue.js +3 -2
- package/components/StatusChip/StatusChip.vue.d.ts +6 -0
- package/components/StatusChip/StatusChip.vue.js +14 -11
- package/components/Tabes/Tabes.vue.js +3 -3
- package/components/Tabes/Tabes.vue2.js +241 -220
- package/components/Tabes/types.d.ts +3 -1
- package/components/Workbook/Sheet.vue.js +11 -11
- package/core/config.d.ts +28 -0
- package/core/config.js +23 -21
- package/core/index.js +18 -17
- package/icons/IconRegistry.d.ts +38 -0
- package/icons/IconRegistry.js +166 -0
- package/icons/IconTypes.d.ts +37 -0
- package/index.d.ts +2 -0
- package/index.js +473 -457
- package/package.json +15 -3
- package/style.css +17 -3
- package/types/config.type.d.ts +8 -1
- package/utils/functions.js +44 -43
- package/utils/index.d.ts +1 -0
- package/utils/usePersistentState.d.ts +4 -1
- package/utils/usePersistentState.js +4 -3
- package/vite.d.ts +6 -0
- package/vite.js +223 -0
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useResizeObserver as
|
|
3
|
-
import { useDraggable as
|
|
4
|
-
import { hashTabesValues as
|
|
5
|
-
import { measureTabesMarkerGeometry as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { $t as
|
|
10
|
-
import { useRtl as
|
|
11
|
-
import { usePersistentState as
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as We, ref as d, computed as o, watch as g, onMounted as Ge, onBeforeUnmount as Qe, openBlock as y, createElementBlock as F, normalizeClass as c, withDirectives as E, createVNode as V, vShow as I, createElementVNode as p, normalizeStyle as Ue, createCommentVNode as W, Fragment as le, renderList as _e, unref as ie, createBlock as T, withCtx as ce, toDisplayString as ue, withMemo as Je, resolveDynamicComponent as Xe, mergeProps as Ye, nextTick as Ze } from "vue";
|
|
2
|
+
import { useResizeObserver as de } from "@vueuse/core";
|
|
3
|
+
import { useDraggable as et } from "vue-draggable-plus";
|
|
4
|
+
import { hashTabesValues as tt, getActiveMarkerKey as rt, isMenuTab as fe, isTabActive as ve, scrollTabesStrip as be, getTabesScrollOverflow as at } from "./tabes.utils.js";
|
|
5
|
+
import { measureTabesMarkerGeometry as nt, toTabesLocalScrollDelta as me } from "./TabesMarkerGeometry.js";
|
|
6
|
+
import z from "../Icon.vue.js";
|
|
7
|
+
import ge from "../FadeOverlay/FadeOverlay.vue.js";
|
|
8
|
+
import st from "../Dropdown/Dropdown.vue.js";
|
|
9
|
+
import { $t as ot } from "../../utils/i18n.js";
|
|
10
|
+
import { useRtl as lt, resolveDirFromAncestors as it } from "../../composables/useRtl.js";
|
|
11
|
+
import { usePersistentState as ct } from "../../utils/usePersistentState.js";
|
|
12
|
+
const ut = ["dir"], dt = ["data-variant"], ft = ["aria-selected", "aria-expanded", "disabled"], pe = 200, St = /* @__PURE__ */ We({
|
|
13
13
|
__name: "Tabes",
|
|
14
14
|
props: {
|
|
15
15
|
options: {},
|
|
@@ -25,140 +25,134 @@ const ot = ["dir"], lt = ["data-variant"], it = ["aria-selected", "aria-expanded
|
|
|
25
25
|
storageKey: {}
|
|
26
26
|
},
|
|
27
27
|
emits: ["update:modelValue", "change", "menu-select", "menu-open", "menu-close", "reorder", "update:options"],
|
|
28
|
-
setup(
|
|
29
|
-
const r =
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
`tabes-order-${r.storageKey ?? `auto-${
|
|
28
|
+
setup(i, { emit: he }) {
|
|
29
|
+
const r = i, f = he, G = d(null), S = d(null), h = d(null), k = /* @__PURE__ */ new Map(), Q = lt(), L = d(null), $ = o(() => r.direction === "rtl" ? "rtl" : r.direction === "ltr" ? "ltr" : L.value ? L.value : Q.value ? "rtl" : "ltr"), B = o(() => $.value === "rtl"), U = () => {
|
|
30
|
+
L.value = it(G.value);
|
|
31
|
+
}, _ = r.sortable ? ct(
|
|
32
|
+
`tabes-order-${r.storageKey ?? `auto-${tt(r.options)}`}`,
|
|
33
33
|
[],
|
|
34
34
|
{ writeDefaults: !1 }
|
|
35
|
-
) : d([]),
|
|
35
|
+
) : d([]), j = (e) => {
|
|
36
36
|
if (!r.sortable) return [...e];
|
|
37
|
-
const a =
|
|
37
|
+
const a = _.value;
|
|
38
38
|
if (!a?.length) return [...e];
|
|
39
|
-
const t = new Map(e.map((
|
|
40
|
-
for (const
|
|
41
|
-
const
|
|
42
|
-
|
|
39
|
+
const t = new Map(e.map((n) => [n.value, n])), s = [];
|
|
40
|
+
for (const n of a) {
|
|
41
|
+
const l = t.get(n);
|
|
42
|
+
l && (s.push(l), t.delete(n));
|
|
43
43
|
}
|
|
44
|
-
for (const
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
const e =
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
const { item: a, from: t, oldIndex:
|
|
44
|
+
for (const n of e) t.has(n.value) && s.push(n);
|
|
45
|
+
return s;
|
|
46
|
+
}, v = d(j(r.options)), xe = () => {
|
|
47
|
+
const e = v.value.map((a) => a.value);
|
|
48
|
+
_.value = e, f("reorder", { options: [...v.value], order: e }), f("update:options", [...v.value]), u({ ensureVisible: !0 });
|
|
49
|
+
}, ye = (e) => {
|
|
50
|
+
const { item: a, from: t, oldIndex: s, oldDraggableIndex: n, newDraggableIndex: l } = e;
|
|
51
51
|
a.parentNode?.removeChild(a);
|
|
52
|
-
const
|
|
53
|
-
if (t.insertBefore(a,
|
|
52
|
+
const A = typeof s == "number" ? t.children[s] ?? null : null;
|
|
53
|
+
if (t.insertBefore(a, A), n == null || l == null || n === l)
|
|
54
54
|
return;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
61
|
-
const { canScrollStart: e, canScrollEnd: a } =
|
|
62
|
-
|
|
55
|
+
const m = [...v.value], [w] = m.splice(n, 1);
|
|
56
|
+
w && (m.splice(l, 0, w), v.value = m, xe());
|
|
57
|
+
}, R = d(!1), M = d(!1);
|
|
58
|
+
let P = 0, J = 0, O = !1, D = !1, q = 0;
|
|
59
|
+
const X = () => {
|
|
60
|
+
if (!h.value) return;
|
|
61
|
+
const { canScrollStart: e, canScrollEnd: a } = at(
|
|
62
|
+
h.value
|
|
63
63
|
);
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
R.value !== e && (R.value = e), M.value !== a && (M.value = a);
|
|
65
|
+
}, we = () => {
|
|
66
|
+
D || (D = !0, J = requestAnimationFrame(() => {
|
|
67
|
+
D = !1, X();
|
|
68
68
|
}));
|
|
69
|
-
},
|
|
70
|
-
if (!
|
|
71
|
-
const e =
|
|
69
|
+
}, ke = () => be(h.value, "start", pe), Ce = () => be(h.value, "end", pe), Y = o(() => rt(r.options, r.modelValue)), Se = () => {
|
|
70
|
+
if (!h.value || !S.value) return;
|
|
71
|
+
const e = Y.value;
|
|
72
72
|
if (e === void 0) return;
|
|
73
|
-
const a =
|
|
73
|
+
const a = k.get(e);
|
|
74
74
|
if (!a) return;
|
|
75
|
-
const t =
|
|
76
|
-
|
|
77
|
-
left:
|
|
78
|
-
t,
|
|
79
|
-
n.left - s.left - u
|
|
80
|
-
),
|
|
75
|
+
const t = h.value, s = a.getBoundingClientRect(), n = t.getBoundingClientRect(), l = 40;
|
|
76
|
+
s.left < n.left + l ? t.scrollBy({
|
|
77
|
+
left: me(t, s.left - n.left - l),
|
|
81
78
|
behavior: "smooth"
|
|
82
|
-
}) :
|
|
83
|
-
left:
|
|
84
|
-
t,
|
|
85
|
-
n.right - s.right + u
|
|
86
|
-
),
|
|
79
|
+
}) : s.right > n.right - l && t.scrollBy({
|
|
80
|
+
left: me(t, s.right - n.right + l),
|
|
87
81
|
behavior: "smooth"
|
|
88
82
|
});
|
|
89
|
-
},
|
|
90
|
-
e instanceof HTMLElement ?
|
|
91
|
-
},
|
|
83
|
+
}, Z = (e, a) => {
|
|
84
|
+
e instanceof HTMLElement ? k.set(a, e) : e && typeof e == "object" && "$el" in e && e.$el instanceof HTMLElement ? k.set(a, e.$el) : k.delete(a);
|
|
85
|
+
}, C = d({
|
|
92
86
|
width: "0px",
|
|
93
87
|
height: "0px",
|
|
94
88
|
left: "0px",
|
|
95
89
|
top: "0px",
|
|
96
90
|
transform: "translate(0px, 0px)",
|
|
97
91
|
opacity: 0
|
|
98
|
-
}),
|
|
99
|
-
|
|
100
|
-
...
|
|
92
|
+
}), K = d(!1), N = () => {
|
|
93
|
+
C.value.opacity !== 0 && (C.value = {
|
|
94
|
+
...C.value,
|
|
101
95
|
opacity: 0
|
|
102
96
|
});
|
|
103
|
-
},
|
|
104
|
-
await
|
|
105
|
-
const e =
|
|
97
|
+
}, Ve = async () => {
|
|
98
|
+
await Ze();
|
|
99
|
+
const e = S.value, a = Y.value, t = a !== void 0 ? k.get(a) : void 0;
|
|
106
100
|
if (!e || !t) {
|
|
107
|
-
|
|
101
|
+
N();
|
|
108
102
|
return;
|
|
109
103
|
}
|
|
110
104
|
if (e.offsetWidth <= 0 || t.offsetWidth <= 0) {
|
|
111
|
-
|
|
105
|
+
N();
|
|
112
106
|
return;
|
|
113
107
|
}
|
|
114
|
-
const { width:
|
|
115
|
-
width: `${
|
|
116
|
-
height: `${
|
|
108
|
+
const { width: s, height: n, left: l, top: A } = nt(e, t), m = {
|
|
109
|
+
width: `${s}px`,
|
|
110
|
+
height: `${n}px`,
|
|
117
111
|
left: "0px",
|
|
118
112
|
top: "0px",
|
|
119
|
-
transform: `translate(${
|
|
113
|
+
transform: `translate(${l}px, ${A}px)`,
|
|
120
114
|
opacity: 1
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
}, w = C.value;
|
|
116
|
+
w.width === m.width && w.height === m.height && w.transform === m.transform && w.opacity === m.opacity || (C.value = m, K.value || (cancelAnimationFrame(q), q = requestAnimationFrame(() => {
|
|
117
|
+
K.value = !0;
|
|
124
118
|
})));
|
|
125
119
|
};
|
|
126
|
-
let
|
|
127
|
-
const
|
|
128
|
-
await
|
|
129
|
-
},
|
|
130
|
-
e?.ensureVisible && (
|
|
131
|
-
|
|
132
|
-
const a =
|
|
133
|
-
|
|
120
|
+
let H = !1;
|
|
121
|
+
const ee = async (e) => {
|
|
122
|
+
await Ve(), X(), e?.ensureVisible && Se();
|
|
123
|
+
}, u = (e) => {
|
|
124
|
+
e?.ensureVisible && (H = !0), !O && (O = !0, cancelAnimationFrame(P), P = requestAnimationFrame(() => {
|
|
125
|
+
O = !1;
|
|
126
|
+
const a = H;
|
|
127
|
+
H = !1, ee({ ensureVisible: a });
|
|
134
128
|
}));
|
|
135
129
|
};
|
|
136
|
-
|
|
130
|
+
de(h, () => u()), de(S, () => u()), g(
|
|
137
131
|
() => r.modelValue,
|
|
138
|
-
() =>
|
|
139
|
-
),
|
|
132
|
+
() => u({ ensureVisible: !0 })
|
|
133
|
+
), g(
|
|
140
134
|
() => r.options,
|
|
141
135
|
(e) => {
|
|
142
|
-
|
|
136
|
+
v.value = j(e), u();
|
|
143
137
|
}
|
|
144
|
-
),
|
|
138
|
+
), g(
|
|
145
139
|
() => r.sortable,
|
|
146
140
|
() => {
|
|
147
|
-
|
|
141
|
+
v.value = j(r.options), u();
|
|
148
142
|
}
|
|
149
|
-
),
|
|
143
|
+
), g(
|
|
150
144
|
() => r.size,
|
|
151
|
-
() =>
|
|
152
|
-
),
|
|
145
|
+
() => u()
|
|
146
|
+
), g(
|
|
153
147
|
() => r.block,
|
|
154
|
-
() =>
|
|
155
|
-
),
|
|
148
|
+
() => u()
|
|
149
|
+
), g(
|
|
156
150
|
() => r.wrap,
|
|
157
|
-
() =>
|
|
158
|
-
),
|
|
151
|
+
() => u()
|
|
152
|
+
), g(
|
|
159
153
|
() => r.variant,
|
|
160
|
-
() =>
|
|
161
|
-
),
|
|
154
|
+
() => u()
|
|
155
|
+
), g(Q, () => U()), g($, () => u({ ensureVisible: !0 })), r.sortable && et(S, v, {
|
|
162
156
|
animation: 150,
|
|
163
157
|
draggable: "[data-tabes-sortable]",
|
|
164
158
|
filter: "[data-tabes-disabled]",
|
|
@@ -167,56 +161,69 @@ const ot = ["dir"], lt = ["data-variant"], it = ["aria-selected", "aria-expanded
|
|
|
167
161
|
dragClass: "tabes-drag-active",
|
|
168
162
|
// Hide the marker while dragging (it can't track a moving target), then
|
|
169
163
|
// re-measure on drop so it lands on the active tab's new position.
|
|
170
|
-
onStart: () =>
|
|
171
|
-
onEnd: () =>
|
|
164
|
+
onStart: () => N(),
|
|
165
|
+
onEnd: () => u(),
|
|
172
166
|
// Own the reorder so the marker child can't skew the list indices.
|
|
173
|
-
customUpdate: (e) =>
|
|
174
|
-
}),
|
|
175
|
-
|
|
176
|
-
}),
|
|
177
|
-
cancelAnimationFrame(
|
|
167
|
+
customUpdate: (e) => ye(e)
|
|
168
|
+
}), Ge(() => {
|
|
169
|
+
U(), ee({ ensureVisible: !0 });
|
|
170
|
+
}), Qe(() => {
|
|
171
|
+
cancelAnimationFrame(P), cancelAnimationFrame(J), cancelAnimationFrame(q), O = !1, D = !1, k.clear();
|
|
178
172
|
});
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
e.disabled || ce(e) || (f("update:modelValue", e.value), f("change", e.value));
|
|
187
|
-
}, Ve = (e, a) => {
|
|
173
|
+
const b = o(() => r.variant === "line"), x = o(() => r.variant === "checkbox"), ze = o(
|
|
174
|
+
() => r.modelValue !== void 0 && !r.wrap && !x.value
|
|
175
|
+
), $e = o(() => r.block || b.value ? "flex w-full relative" : "inline-flex max-w-full relative"), te = o(() => [
|
|
176
|
+
"absolute top-0 bottom-0 z-20 flex items-center pointer-events-none transition-opacity duration-200"
|
|
177
|
+
]), Be = (e) => {
|
|
178
|
+
e.disabled || fe(e) || (f("update:modelValue", e.value), f("change", e.value));
|
|
179
|
+
}, Re = (e, a) => {
|
|
188
180
|
if (e.disabled) return;
|
|
189
181
|
const t = a.value;
|
|
190
182
|
t != null && (f("update:modelValue", t), f("change", t), f("menu-select", { value: t, option: a.option, tab: e }));
|
|
191
|
-
},
|
|
183
|
+
}, Me = (e) => {
|
|
192
184
|
f("menu-open", e);
|
|
193
|
-
},
|
|
194
|
-
f("menu-close", e),
|
|
195
|
-
},
|
|
196
|
-
const e =
|
|
197
|
-
return (r.block || r.wrap) && !e ? "flex-1 min-w-max" : "shrink-0";
|
|
198
|
-
}), Re = (e) => e.dropdown?.direction ?? V.value, Oe = l(() => z.value ? "right" : "left"), Me = l(() => z.value ? "left" : "right"), De = l(() => z.value ? "lucide:chevron-right" : "lucide:chevron-left"), Ae = l(() => z.value ? "lucide:chevron-left" : "lucide:chevron-right"), Fe = l(() => {
|
|
199
|
-
const e = r.variant === "line", a = {
|
|
185
|
+
}, Oe = (e) => {
|
|
186
|
+
f("menu-close", e), u();
|
|
187
|
+
}, De = o(() => b.value ? "shrink-0" : x.value ? r.block ? "flex-1 min-w-max" : "shrink-0" : r.block || r.wrap ? "flex-1 min-w-max" : "shrink-0"), Ae = (e) => e.dropdown?.direction ?? $.value, Fe = o(() => B.value ? "right" : "left"), Ee = o(() => B.value ? "left" : "right"), Ie = o(() => B.value ? "lucide:chevron-right" : "lucide:chevron-left"), Te = o(() => B.value ? "lucide:chevron-left" : "lucide:chevron-right"), Le = o(() => {
|
|
188
|
+
const e = b.value, a = x.value, t = {
|
|
200
189
|
surface: "bg-secondary/80 p-1",
|
|
201
190
|
primary: "bg-secondary p-1",
|
|
202
191
|
secondary: "bg-secondary p-1",
|
|
203
192
|
danger: "bg-danger/10 p-1",
|
|
204
193
|
success: "bg-success/10 p-1",
|
|
205
194
|
outline: "bg-transparent border border-border p-1",
|
|
206
|
-
line: "bg-transparent gap-6 rounded-none p-0 border-b border-border"
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
195
|
+
line: "bg-transparent gap-6 rounded-none p-0 border-b border-border",
|
|
196
|
+
// Loose chip row: no shared surface, border, or underline — items carry their own chrome
|
|
197
|
+
checkbox: "bg-transparent gap-2 p-0 rounded-none border-0"
|
|
198
|
+
}, s = r.wrap && !e ? "flex-wrap" : "";
|
|
199
|
+
return [`${r.block || e ? "flex min-w-full w-max" : "inline-flex"} ${a || e ? "" : "rounded-lg"} relative isolate ${s}`.replace(/\s+/g, " ").trim(), t[r.variant], r.sortable ? "is-sortable" : ""];
|
|
200
|
+
}), re = 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)"), ae = o(() => b.value ? {
|
|
201
|
+
sm: "text-xs px-2.5",
|
|
202
|
+
md: "-text-fs-2 px-3",
|
|
203
|
+
lg: "-text-fs-1 px-4"
|
|
204
|
+
} : x.value ? {
|
|
205
|
+
sm: "text-xs px-2.5 py-1 gap-1",
|
|
206
|
+
md: "-text-fs-2 px-3 py-1.5 gap-1.5",
|
|
207
|
+
lg: "-text-fs-1 px-3.5 py-2 gap-2"
|
|
208
|
+
} : {
|
|
210
209
|
sm: "text-xs px-2.5 py-1",
|
|
211
210
|
md: "-text-fs-2 px-3 py-1",
|
|
212
211
|
lg: "-text-fs-1 px-4 py-1"
|
|
213
|
-
},
|
|
214
|
-
|
|
212
|
+
}), je = o(() => {
|
|
213
|
+
if (x.value)
|
|
214
|
+
return [
|
|
215
|
+
"relative z-10 flex items-center justify-center font-medium transition-colors duration-150 ease-out cursor-pointer select-none rounded-full outline-none shrink-0 border-0 box-border",
|
|
216
|
+
"focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
|
|
217
|
+
r.block ? "flex-1" : ""
|
|
218
|
+
];
|
|
219
|
+
const e = b.value, a = 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 pt-3 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" : "";
|
|
215
220
|
return [a, t];
|
|
216
|
-
}),
|
|
217
|
-
const a =
|
|
221
|
+
}), ne = (e) => {
|
|
222
|
+
const a = ve(e, r.modelValue), t = b.value, s = x.value;
|
|
218
223
|
let n = "";
|
|
219
|
-
if (
|
|
224
|
+
if (s)
|
|
225
|
+
n = a ? "bg-primary text-primary-fg" : "bg-transparent text-muted-foreground hover:text-foreground";
|
|
226
|
+
else if (a)
|
|
220
227
|
if (t)
|
|
221
228
|
n = r.wrap ? "text-primary !border-primary" : "text-primary";
|
|
222
229
|
else
|
|
@@ -244,87 +251,91 @@ const ot = ["dir"], lt = ["data-variant"], it = ["aria-selected", "aria-expanded
|
|
|
244
251
|
}
|
|
245
252
|
else
|
|
246
253
|
n = t ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
|
|
247
|
-
const
|
|
248
|
-
return [
|
|
249
|
-
},
|
|
250
|
-
const a = `absolute z-0 pointer-events-none ${
|
|
251
|
-
return
|
|
252
|
-
}),
|
|
254
|
+
const l = e.disabled ? "opacity-50 cursor-not-allowed" : "";
|
|
255
|
+
return [je.value, n, r?.tabClass, l].join(" ");
|
|
256
|
+
}, Pe = o(() => {
|
|
257
|
+
const a = `absolute z-0 pointer-events-none ${K.value ? "transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)]" : ""}`;
|
|
258
|
+
return b.value ? `${a} !h-[2px] !top-auto bottom-0` : `${a} rounded-md shadow-sm`;
|
|
259
|
+
}), qe = () => ({
|
|
253
260
|
surface: "bg-[#ffff] dark:bg-[#0B0B0B]",
|
|
254
261
|
primary: "bg-primary",
|
|
255
262
|
secondary: "bg-secondary-foreground",
|
|
256
263
|
danger: "bg-danger",
|
|
257
264
|
success: "bg-success",
|
|
258
265
|
outline: "bg-accent/50 ring-1 ring-border",
|
|
259
|
-
line: "bg-primary"
|
|
260
|
-
|
|
266
|
+
line: "bg-primary",
|
|
267
|
+
// Marker is hidden for checkbox; value kept for exhaustive Record typing
|
|
268
|
+
checkbox: "bg-transparent"
|
|
269
|
+
})[r.variant], se = o(
|
|
270
|
+
() => r.size === "sm" ? "w-3.5 h-3.5 shrink-0" : "w-4 h-4 shrink-0"
|
|
271
|
+
), oe = (e) => e.labelI18n ? ot(e.labelI18n) : e.label, Ke = (e) => e.to ? "router-link" : e.href ? "a" : "button", Ne = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" }, He = (e) => [
|
|
261
272
|
r.size === "sm" ? "w-3 h-3" : "w-3.5 h-3.5",
|
|
262
273
|
"opacity-70 shrink-0 transition-transform duration-200",
|
|
263
274
|
e ? "rotate-180" : ""
|
|
264
275
|
].join(" ");
|
|
265
|
-
return (e, a) => (
|
|
276
|
+
return (e, a) => (y(), F("div", {
|
|
266
277
|
ref_key: "rootRef",
|
|
267
|
-
ref:
|
|
268
|
-
class:
|
|
269
|
-
dir:
|
|
278
|
+
ref: G,
|
|
279
|
+
class: c([$e.value, "group"]),
|
|
280
|
+
dir: $.value
|
|
270
281
|
}, [
|
|
271
|
-
|
|
272
|
-
direction:
|
|
273
|
-
color:
|
|
282
|
+
E(V(ge, {
|
|
283
|
+
direction: Fe.value,
|
|
284
|
+
color: re.value,
|
|
274
285
|
coverage: "100px",
|
|
275
286
|
blur: "40px",
|
|
276
287
|
easing: "smooth",
|
|
277
288
|
tintOpacity: 1,
|
|
278
|
-
class:
|
|
289
|
+
class: c(["z-10 pointer-events-none", b.value || x.value ? "" : "rounded-s-lg"])
|
|
279
290
|
}, null, 8, ["direction", "color", "class"]), [
|
|
280
|
-
[
|
|
291
|
+
[I, R.value]
|
|
281
292
|
]),
|
|
282
|
-
|
|
283
|
-
class:
|
|
293
|
+
E(p("div", {
|
|
294
|
+
class: c(["start-0 ps-1", te.value])
|
|
284
295
|
}, [
|
|
285
|
-
|
|
286
|
-
onClick:
|
|
296
|
+
p("button", {
|
|
297
|
+
onClick: ke,
|
|
287
298
|
class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
|
|
288
299
|
"aria-label": "Scroll backward"
|
|
289
300
|
}, [
|
|
290
|
-
|
|
291
|
-
icon:
|
|
292
|
-
class: "w-5 h-5"
|
|
301
|
+
V(z, {
|
|
302
|
+
icon: Ie.value,
|
|
303
|
+
class: "w-4.5 h-4.5"
|
|
293
304
|
}, null, 8, ["icon"])
|
|
294
305
|
])
|
|
295
306
|
], 2), [
|
|
296
|
-
[
|
|
307
|
+
[I, R.value]
|
|
297
308
|
]),
|
|
298
|
-
|
|
309
|
+
p("div", {
|
|
299
310
|
ref_key: "scrollRef",
|
|
300
|
-
ref:
|
|
311
|
+
ref: h,
|
|
301
312
|
class: "tabes-scroll flex-1 min-w-0 max-w-full overflow-x-auto scrollbar-hide scroll-smooth",
|
|
302
|
-
onScroll:
|
|
313
|
+
onScroll: we
|
|
303
314
|
}, [
|
|
304
|
-
|
|
315
|
+
p("div", {
|
|
305
316
|
ref_key: "containerRef",
|
|
306
|
-
ref:
|
|
307
|
-
class:
|
|
317
|
+
ref: S,
|
|
318
|
+
class: c([Le.value, "tabes-container"]),
|
|
308
319
|
role: "tablist",
|
|
309
320
|
"data-variant": r.variant,
|
|
310
321
|
"data-tabes": ""
|
|
311
322
|
}, [
|
|
312
|
-
|
|
323
|
+
ze.value ? (y(), F("div", {
|
|
313
324
|
key: 0,
|
|
314
|
-
class:
|
|
315
|
-
style:
|
|
316
|
-
}, null, 6)) :
|
|
317
|
-
(
|
|
325
|
+
class: c(["tabes-marker", [Pe.value, qe()]]),
|
|
326
|
+
style: Ue(C.value)
|
|
327
|
+
}, null, 6)) : W("", !0),
|
|
328
|
+
(y(!0), F(le, null, _e(v.value, (t) => (y(), F(le, {
|
|
318
329
|
key: t.value
|
|
319
330
|
}, [
|
|
320
|
-
|
|
331
|
+
ie(fe)(t) ? (y(), T(st, {
|
|
321
332
|
key: 0,
|
|
322
333
|
options: t.menu,
|
|
323
|
-
selected:
|
|
334
|
+
selected: i.modelValue,
|
|
324
335
|
disabled: t.disabled,
|
|
325
336
|
"data-tabes-sortable": "",
|
|
326
337
|
"data-tabes-disabled": t.disabled || void 0,
|
|
327
|
-
direction:
|
|
338
|
+
direction: Ae(t),
|
|
328
339
|
position: t.dropdown?.position,
|
|
329
340
|
offset: t.dropdown?.offset ?? [0, 8],
|
|
330
341
|
searchable: t.dropdown?.searchable ?? !1,
|
|
@@ -338,100 +349,110 @@ const ot = ["dir"], lt = ["data-variant"], it = ["aria-selected", "aria-expanded
|
|
|
338
349
|
"show-selected-icon": !1,
|
|
339
350
|
"toggle-selection": !1,
|
|
340
351
|
selectable: !0,
|
|
341
|
-
class:
|
|
342
|
-
onOnSelect: (
|
|
343
|
-
onOnOpen: () =>
|
|
344
|
-
onOnClose: () =>
|
|
352
|
+
class: c(["tabes-menu", "inline-flex!", De.value]),
|
|
353
|
+
onOnSelect: (s) => Re(t, s),
|
|
354
|
+
onOnOpen: () => Me(t),
|
|
355
|
+
onOnClose: () => Oe(t)
|
|
345
356
|
}, {
|
|
346
|
-
trigger:
|
|
347
|
-
|
|
357
|
+
trigger: ce(({ isOpen: s }) => [
|
|
358
|
+
p("button", {
|
|
348
359
|
ref_for: !0,
|
|
349
|
-
ref: (
|
|
360
|
+
ref: (n) => Z(n, t.value),
|
|
350
361
|
type: "button",
|
|
351
362
|
role: "tab",
|
|
352
363
|
"data-tabes-item": "",
|
|
353
364
|
"data-tabes-menu-trigger": "",
|
|
354
|
-
"aria-selected":
|
|
365
|
+
"aria-selected": ie(ve)(t, i.modelValue),
|
|
355
366
|
"aria-haspopup": !0,
|
|
356
|
-
"aria-expanded":
|
|
367
|
+
"aria-expanded": s,
|
|
357
368
|
disabled: t.disabled,
|
|
358
|
-
class:
|
|
369
|
+
class: c([ne(t), ae.value[r.size], "w-full"])
|
|
359
370
|
}, [
|
|
360
|
-
t.icon ? (
|
|
371
|
+
t.icon ? (y(), T(z, {
|
|
361
372
|
key: 0,
|
|
362
373
|
icon: t.icon,
|
|
363
|
-
class:
|
|
364
|
-
}, null, 8, ["icon", "class"])) :
|
|
365
|
-
|
|
366
|
-
class:
|
|
367
|
-
},
|
|
368
|
-
|
|
374
|
+
class: c(se.value)
|
|
375
|
+
}, null, 8, ["icon", "class"])) : W("", !0),
|
|
376
|
+
p("span", {
|
|
377
|
+
class: c(["whitespace-nowrap z-20 relative", i.textClass])
|
|
378
|
+
}, ue(oe(t)), 3),
|
|
379
|
+
V(z, {
|
|
369
380
|
icon: "lucide:chevron-down",
|
|
370
|
-
class:
|
|
381
|
+
class: c(He(s)),
|
|
371
382
|
"aria-hidden": "true"
|
|
372
383
|
}, null, 8, ["class"])
|
|
373
|
-
], 10,
|
|
384
|
+
], 10, ft)
|
|
374
385
|
]),
|
|
375
386
|
_: 2
|
|
376
|
-
}, 1032, ["options", "selected", "disabled", "data-tabes-disabled", "direction", "position", "offset", "searchable", "close-on-select", "max-height", "min-width", "width", "menu-id", "teleport", "class", "onOnSelect", "onOnOpen", "onOnClose"])) :
|
|
387
|
+
}, 1032, ["options", "selected", "disabled", "data-tabes-disabled", "direction", "position", "offset", "searchable", "close-on-select", "max-height", "min-width", "width", "menu-id", "teleport", "class", "onOnSelect", "onOnOpen", "onOnClose"])) : Je([
|
|
388
|
+
t,
|
|
389
|
+
i.modelValue === t.value,
|
|
390
|
+
i.size,
|
|
391
|
+
i.variant,
|
|
392
|
+
i.block,
|
|
393
|
+
i.wrap,
|
|
394
|
+
i.tabClass,
|
|
395
|
+
i.textClass,
|
|
396
|
+
i.sortable
|
|
397
|
+
], () => (y(), T(Xe(Ke(t)), Ye({
|
|
377
398
|
key: 1,
|
|
378
399
|
ref_for: !0,
|
|
379
|
-
ref: (
|
|
400
|
+
ref: (s) => Z(s, t.value),
|
|
380
401
|
role: "tab",
|
|
381
402
|
"data-tabes-item": "",
|
|
382
403
|
"data-tabes-sortable": "",
|
|
383
404
|
"data-tabes-disabled": t.disabled || void 0,
|
|
384
|
-
"aria-selected":
|
|
405
|
+
"aria-selected": i.modelValue === t.value,
|
|
385
406
|
disabled: t.disabled,
|
|
386
|
-
class: [
|
|
387
|
-
}, { ref_for: !0 },
|
|
388
|
-
onClick: (
|
|
407
|
+
class: [ne(t), ae.value[r.size]]
|
|
408
|
+
}, { ref_for: !0 }, Ne(t), {
|
|
409
|
+
onClick: (s) => Be(t)
|
|
389
410
|
}), {
|
|
390
|
-
default:
|
|
391
|
-
t.icon ? (
|
|
411
|
+
default: ce(() => [
|
|
412
|
+
t.icon ? (y(), T(z, {
|
|
392
413
|
key: 0,
|
|
393
414
|
icon: t.icon,
|
|
394
|
-
class:
|
|
395
|
-
}, null, 8, ["icon", "class"])) :
|
|
396
|
-
|
|
397
|
-
class:
|
|
398
|
-
},
|
|
415
|
+
class: c(se.value)
|
|
416
|
+
}, null, 8, ["icon", "class"])) : W("", !0),
|
|
417
|
+
p("span", {
|
|
418
|
+
class: c(["whitespace-nowrap z-20 relative", i.textClass])
|
|
419
|
+
}, ue(oe(t)), 3)
|
|
399
420
|
]),
|
|
400
421
|
_: 2
|
|
401
422
|
}, 1040, ["data-tabes-disabled", "aria-selected", "disabled", "class", "onClick"])), a, 0)
|
|
402
423
|
], 64))), 128))
|
|
403
|
-
], 10,
|
|
424
|
+
], 10, dt)
|
|
404
425
|
], 544),
|
|
405
|
-
|
|
406
|
-
direction:
|
|
407
|
-
color:
|
|
426
|
+
E(V(ge, {
|
|
427
|
+
direction: Ee.value,
|
|
428
|
+
color: re.value,
|
|
408
429
|
coverage: "100px",
|
|
409
430
|
blur: "40",
|
|
410
431
|
easing: "smooth",
|
|
411
432
|
tintOpacity: 1,
|
|
412
|
-
class:
|
|
433
|
+
class: c(["z-10 pointer-events-none", b.value || x.value ? "" : "rounded-e-lg"])
|
|
413
434
|
}, null, 8, ["direction", "color", "class"]), [
|
|
414
|
-
[
|
|
435
|
+
[I, M.value]
|
|
415
436
|
]),
|
|
416
|
-
|
|
417
|
-
class:
|
|
437
|
+
E(p("div", {
|
|
438
|
+
class: c(["end-0 pe-1", te.value])
|
|
418
439
|
}, [
|
|
419
|
-
|
|
420
|
-
onClick:
|
|
440
|
+
p("button", {
|
|
441
|
+
onClick: Ce,
|
|
421
442
|
class: "pointer-events-auto h-full px-1 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors focus:outline-none",
|
|
422
443
|
"aria-label": "Scroll forward"
|
|
423
444
|
}, [
|
|
424
|
-
|
|
425
|
-
icon:
|
|
426
|
-
class: "w-5 h-5"
|
|
445
|
+
V(z, {
|
|
446
|
+
icon: Te.value,
|
|
447
|
+
class: "w-4.5 h-4.5"
|
|
427
448
|
}, null, 8, ["icon"])
|
|
428
449
|
])
|
|
429
450
|
], 2), [
|
|
430
|
-
[
|
|
451
|
+
[I, M.value]
|
|
431
452
|
])
|
|
432
|
-
], 10,
|
|
453
|
+
], 10, ut));
|
|
433
454
|
}
|
|
434
455
|
});
|
|
435
456
|
export {
|
|
436
|
-
|
|
457
|
+
St as default
|
|
437
458
|
};
|