vlite3 0.7.4 → 0.7.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.
@@ -1,13 +1,14 @@
1
- import { defineComponent as N, ref as f, onMounted as T, nextTick as y, onUnmounted as W, watch as I, openBlock as s, createElementBlock as b, normalizeClass as c, createVNode as v, Transition as L, withCtx as k, createElementVNode as l, createCommentVNode as g, Fragment as j, renderList as A, createBlock as w, unref as _, withModifiers as D, toDisplayString as F } from "vue";
1
+ import { defineComponent as T, ref as f, onMounted as W, nextTick as y, onUnmounted as j, watch as z, openBlock as s, createElementBlock as b, normalizeClass as c, createVNode as v, Transition as L, withCtx as k, createElementVNode as l, createCommentVNode as g, Fragment as A, renderList as _, createBlock as w, unref as S, withModifiers as D, toDisplayString as F } from "vue";
2
2
  import { useRoute as H, RouterLink as P } from "vue-router";
3
3
  import p from "../Icon.vue.js";
4
- const U = {
4
+ import { $t as U } from "../../utils/i18n.js";
5
+ const q = {
5
6
  key: 0,
6
7
  class: "absolute left-0 top-0 bottom-0 z-10 flex items-center pointer-events-none"
7
- }, q = { class: "truncate" }, G = {
8
+ }, G = { class: "truncate" }, J = {
8
9
  key: 0,
9
10
  class: "absolute right-0 top-0 bottom-0 z-10 flex items-center justify-end pointer-events-none"
10
- }, Q = /* @__PURE__ */ N({
11
+ }, Y = /* @__PURE__ */ T({
11
12
  __name: "NavbarTabs",
12
13
  props: {
13
14
  items: {},
@@ -18,32 +19,32 @@ const U = {
18
19
  class: { default: "" }
19
20
  },
20
21
  setup(a) {
21
- const n = a, i = f(null), C = f(!1), R = f(!1), u = () => {
22
+ const n = a, i = f(null), C = f(!1), I = f(!1), u = () => {
22
23
  const o = i.value;
23
- o && (C.value = o.scrollLeft > 2, R.value = o.scrollLeft + o.clientWidth < o.scrollWidth - 2);
24
- }, z = (o) => {
24
+ o && (C.value = o.scrollLeft > 2, I.value = o.scrollLeft + o.clientWidth < o.scrollWidth - 2);
25
+ }, R = (o) => {
25
26
  const t = i.value;
26
27
  if (!t) return;
27
28
  const e = t.clientWidth * 0.6;
28
29
  t.scrollBy({ left: o === "right" ? e : -e, behavior: "smooth" });
29
30
  };
30
- T(() => {
31
+ W(() => {
31
32
  y(() => {
32
33
  u(), i.value?.addEventListener("scroll", u, { passive: !0 });
33
34
  });
34
- }), W(() => {
35
+ }), j(() => {
35
36
  i.value?.removeEventListener("scroll", u);
36
37
  });
37
38
  const h = H();
38
- I(
39
+ z(
39
40
  () => h.path,
40
41
  () => y(u)
41
42
  );
42
- const m = f(/* @__PURE__ */ new Map()), S = (o, t) => {
43
+ const m = f(/* @__PURE__ */ new Map()), $ = (o, t) => {
43
44
  const e = o?.$el ?? o;
44
45
  e instanceof HTMLElement ? m.value.set(t, e) : m.value.delete(t);
45
46
  };
46
- I(
47
+ z(
47
48
  () => h.path,
48
49
  (o) => {
49
50
  y(() => {
@@ -59,16 +60,16 @@ const U = {
59
60
  pill: "flex gap-1 p-1 bg-secondary/80 rounded-lg",
60
61
  solid: "flex gap-0",
61
62
  ghost: "flex gap-1"
62
- }, $ = {
63
+ }, E = {
63
64
  sm: "px-2.5 py-1.5 text-xs",
64
65
  md: "px-3.5 py-2 text-sm",
65
66
  lg: "px-5 py-2.5 text-base"
66
- }, E = {
67
+ }, V = {
67
68
  line: "text-primary border-b-2 border-primary -mb-px",
68
69
  pill: "bg-background text-foreground shadow-sm",
69
70
  solid: "bg-primary-light text-primary-dark",
70
71
  ghost: "bg-accent text-accent-foreground"
71
- }, V = {
72
+ }, M = {
72
73
  line: "text-muted-foreground border-b-2 border-transparent hover:text-foreground hover:border-border",
73
74
  pill: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
74
75
  solid: "text-muted-foreground hover:text-foreground hover:bg-accent/50",
@@ -86,23 +87,23 @@ const U = {
86
87
  return r === "/" || r === "?" || r === "#" || r === void 0;
87
88
  }
88
89
  return !1;
89
- }, M = (o) => {
90
- const t = "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 = o.disabled ? "opacity-50 pointer-events-none cursor-not-allowed" : "", d = x(o) ? n.activeClass || E[n.variant] : n.inactiveClass || V[n.variant];
91
- return [t, $[n.size], d, e].filter(Boolean).join(" ");
90
+ }, N = (o) => {
91
+ const t = "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 = o.disabled ? "opacity-50 pointer-events-none cursor-not-allowed" : "", d = x(o) ? n.activeClass || V[n.variant] : n.inactiveClass || M[n.variant];
92
+ return [t, E[n.size], d, e].filter(Boolean).join(" ");
92
93
  };
93
94
  return (o, t) => (s(), b("div", {
94
95
  class: c(["relative flex items-center w-full min-w-0 border-b", n.class])
95
96
  }, [
96
97
  v(L, { name: "fade-x" }, {
97
98
  default: k(() => [
98
- C.value ? (s(), b("div", U, [
99
+ C.value ? (s(), b("div", q, [
99
100
  t[2] || (t[2] = l("div", { class: "w-8 h-full bg-gradient-to-r from-background to-transparent" }, null, -1)),
100
101
  l("button", {
101
102
  type: "button",
102
103
  class: "pointer-events-auto absolute left-0 h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors",
103
104
  "aria-label": "Scroll tabs left",
104
105
  tabindex: "-1",
105
- onClick: t[0] || (t[0] = (e) => z("left"))
106
+ onClick: t[0] || (t[0] = (e) => R("left"))
106
107
  }, [
107
108
  v(p, {
108
109
  icon: "lucide:chevron-left",
@@ -123,16 +124,16 @@ const U = {
123
124
  ]),
124
125
  "aria-label": "Page tabs"
125
126
  }, [
126
- (s(!0), b(j, null, A(a.items, (e, r) => (s(), w(_(P), {
127
+ (s(!0), b(A, null, _(a.items, (e, r) => (s(), w(S(P), {
127
128
  key: r,
128
129
  ref_for: !0,
129
- ref: (d) => S(d, r),
130
+ ref: (d) => $(d, r),
130
131
  to: e.to || "",
131
132
  role: "tab",
132
133
  "aria-selected": x(e),
133
134
  "aria-disabled": e.disabled || void 0,
134
135
  tabindex: e.disabled ? -1 : 0,
135
- class: c(M(e)),
136
+ class: c(N(e)),
136
137
  onClick: D((d) => !e.disabled && e.to && o.$router.push(e.to), ["prevent"])
137
138
  }, {
138
139
  default: k(() => [
@@ -141,7 +142,7 @@ const U = {
141
142
  icon: e.icon,
142
143
  class: c(["shrink-0", a.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4"])
143
144
  }, null, 8, ["icon", "class"])) : g("", !0),
144
- l("span", q, F(e.label), 1),
145
+ l("span", G, F(e.labelI18n ? S(U)(e.labelI18n) : e.label), 1),
145
146
  e.iconRight ? (s(), w(p, {
146
147
  key: 1,
147
148
  icon: e.iconRight,
@@ -153,14 +154,14 @@ const U = {
153
154
  ], 2),
154
155
  v(L, { name: "fade-x" }, {
155
156
  default: k(() => [
156
- R.value ? (s(), b("div", G, [
157
+ I.value ? (s(), b("div", J, [
157
158
  t[3] || (t[3] = l("div", { class: "w-8 h-full bg-gradient-to-l from-background to-transparent" }, null, -1)),
158
159
  l("button", {
159
160
  type: "button",
160
161
  class: "pointer-events-auto absolute right-0 h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors",
161
162
  "aria-label": "Scroll tabs right",
162
163
  tabindex: "-1",
163
- onClick: t[1] || (t[1] = (e) => z("right"))
164
+ onClick: t[1] || (t[1] = (e) => R("right"))
164
165
  }, [
165
166
  v(p, {
166
167
  icon: "lucide:chevron-right",
@@ -175,5 +176,5 @@ const U = {
175
176
  }
176
177
  });
177
178
  export {
178
- Q as default
179
+ Y as default
179
180
  };