vue3-router-tab 1.3.3 → 1.3.4

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,5 +1,5 @@
1
1
  import './vue3-router-tab.css';
2
- import { reactive as me, ref as S, shallowRef as bt, computed as k, watch as P, nextTick as j, inject as Pe, getCurrentInstance as je, onMounted as ge, defineComponent as Oe, provide as pt, onBeforeUnmount as mt, resolveComponent as gt, createElementBlock as x, openBlock as C, createElementVNode as L, withDirectives as vt, normalizeClass as H, renderSlot as re, createVNode as Ae, TransitionGroup as yt, mergeProps as le, withCtx as se, Fragment as ue, renderList as Ee, withModifiers as ce, createCommentVNode as fe, toDisplayString as Ie, createBlock as J, normalizeProps as ht, Transition as Tt, resolveDynamicComponent as de, KeepAlive as kt, normalizeStyle as wt, vShow as Ct, isRef as Rt, isReadonly as Kt } from "vue";
2
+ import { reactive as pe, ref as S, shallowRef as bt, computed as k, watch as P, nextTick as j, inject as Ke, getCurrentInstance as je, onMounted as ge, defineComponent as Oe, provide as pt, onBeforeUnmount as gt, resolveComponent as mt, createElementBlock as $, openBlock as K, createElementVNode as L, withDirectives as vt, normalizeClass as H, renderSlot as le, createVNode as Pe, TransitionGroup as yt, mergeProps as se, withCtx as ue, Fragment as Ae, renderList as Ee, withModifiers as ce, createCommentVNode as q, toDisplayString as Ie, createBlock as J, normalizeProps as ht, Transition as Tt, resolveDynamicComponent as fe, KeepAlive as kt, normalizeStyle as wt, vShow as Ct, isRef as Rt, isReadonly as Kt } from "vue";
3
3
  import { RouterView as Pt } from "vue-router";
4
4
  function At(e = {}) {
5
5
  return {
@@ -35,11 +35,11 @@ function N(e) {
35
35
  }
36
36
  return e.fullPath;
37
37
  }
38
- function ve(e, n) {
38
+ function me(e, n) {
39
39
  const o = e.meta?.keepAlive;
40
40
  return typeof o == "boolean" ? o : n;
41
41
  }
42
- function ye(e, n) {
42
+ function ve(e, n) {
43
43
  const o = e.meta?.reuse;
44
44
  return typeof o == "boolean" ? o : n;
45
45
  }
@@ -47,22 +47,22 @@ function Ue(e) {
47
47
  const n = e.meta ?? {}, o = {};
48
48
  return "title" in n && (o.title = n.title), "tips" in n && (o.tips = n.tips), "icon" in n && (o.icon = n.icon), "closable" in n && (o.closable = n.closable), "tabClass" in n && (o.tabClass = n.tabClass), "target" in n && (o.target = n.target), "href" in n && (o.href = n.href), o;
49
49
  }
50
- function q(e, n, o) {
50
+ function Q(e, n, o) {
51
51
  const l = Ue(e);
52
52
  return {
53
53
  id: N(e),
54
54
  to: e.fullPath,
55
55
  fullPath: e.fullPath,
56
56
  matched: e,
57
- alive: ve(e, o),
58
- reusable: ye(e, !1),
57
+ alive: me(e, o),
58
+ reusable: ve(e, !1),
59
59
  closable: l.closable ?? !0,
60
60
  renderKey: typeof n.renderKey == "number" ? n.renderKey : 0,
61
61
  ...l,
62
62
  ...n
63
63
  };
64
64
  }
65
- function be(e, n, o, l) {
65
+ function de(e, n, o, l) {
66
66
  if (!e.find((p) => p.id === n.id)) {
67
67
  if (o === "next" && l) {
68
68
  const p = e.findIndex((T) => T.id === l);
@@ -76,11 +76,11 @@ function be(e, n, o, l) {
76
76
  }
77
77
  function xe(e, n, o) {
78
78
  if (!n || n <= 0) return;
79
- const l = e.filter((i) => i.alive);
79
+ const l = e.filter((r) => r.alive);
80
80
  for (; l.length > n; ) {
81
- const i = l.shift();
82
- if (!i || i.id === o) continue;
83
- const p = e.findIndex((T) => T.id === i.id);
81
+ const r = l.shift();
82
+ if (!r || r.id === o) continue;
83
+ const p = e.findIndex((T) => T.id === r.id);
84
84
  p > -1 && (e[p].alive = !1);
85
85
  }
86
86
  }
@@ -99,91 +99,91 @@ function xt(e) {
99
99
  const n = {};
100
100
  return "title" in e && (n.title = e.title), "tips" in e && (n.tips = e.tips), "icon" in e && (n.icon = e.icon), "tabClass" in e && (n.tabClass = e.tabClass), "closable" in e && (n.closable = e.closable), "renderKey" in e && typeof e.renderKey == "number" && (n.renderKey = e.renderKey), n;
101
101
  }
102
- function $t(e, n = {}) {
103
- const o = At(n), l = me([]), i = S(null), p = bt(), T = S(null), s = k(
104
- () => l.filter((r) => r.alive).map((r) => `${r.id}::${r.renderKey ?? 0}`)
102
+ function Dt(e, n = {}) {
103
+ const o = At(n), l = pe([]), r = S(null), p = bt(), T = S(null), s = k(
104
+ () => l.filter((i) => i.alive).map((i) => `${i.id}::${i.renderKey ?? 0}`)
105
105
  );
106
106
  let c = !1;
107
- function m(r) {
108
- const b = typeof r.matched == "object" ? r : V(e, r);
107
+ function g(i) {
108
+ const b = typeof i.matched == "object" ? i : V(e, i);
109
109
  return {
110
110
  key: N(b),
111
111
  fullPath: b.fullPath,
112
- alive: ve(b, o.keepAlive),
113
- reusable: ye(b, !1),
112
+ alive: me(b, o.keepAlive),
113
+ reusable: ve(b, !1),
114
114
  matched: b
115
115
  };
116
116
  }
117
- function K(r) {
118
- const b = N(r);
117
+ function R(i) {
118
+ const b = N(i);
119
119
  let d = l.find((h) => h.id === b);
120
- return d ? (d.fullPath = r.fullPath, d.to = r.fullPath, d.matched = r, d.alive = ve(r, o.keepAlive), d.reusable = ye(r, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ue(r)), d) : (d = q(r, {}, o.keepAlive), be(l, d, o.appendPosition, i.value), xe(l, o.maxAlive, i.value), d);
120
+ return d ? (d.fullPath = i.fullPath, d.to = i.fullPath, d.matched = i, d.alive = me(i, o.keepAlive), d.reusable = ve(i, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ue(i)), d) : (d = Q(i, {}, o.keepAlive), de(l, d, o.appendPosition, r.value), xe(l, o.maxAlive, r.value), d);
121
121
  }
122
- async function $(r, b = !1, d = !0) {
123
- const h = V(e, r), w = N(h), A = i.value === w;
122
+ async function x(i, b = !1, d = !0) {
123
+ const h = V(e, i), w = N(h), A = r.value === w;
124
124
  d === "sameTab" && (d = A), d && await O(w, !0), await e[b ? "replace" : "push"](h), A && await y();
125
125
  }
126
- function B(r) {
127
- const b = l.findIndex((I) => I.id === r);
126
+ function B(i) {
127
+ const b = l.findIndex((I) => I.id === i);
128
128
  if (b === -1) return o.defaultRoute;
129
- const d = l[b + 1], h = l[b - 1], w = l.find((I) => I.id !== r), A = d || h || w;
129
+ const d = l[b + 1], h = l[b - 1], w = l.find((I) => I.id !== i), A = d || h || w;
130
130
  return A ? A.to : o.defaultRoute;
131
131
  }
132
- async function z(r = i.value, b = {}) {
133
- if (!r) return;
132
+ async function z(i = r.value, b = {}) {
133
+ if (!i) return;
134
134
  if (!b.force && o.keepLastTab && l.length === 1)
135
135
  throw new Error("[RouterTabs] Unable to close the final tab when keepLastTab is true.");
136
- const h = i.value === r && b.redirect !== null, w = h ? b.redirect ?? B(r) : null;
137
- await _(r, { force: b.force }), b.redirect !== null && h && w && await e.replace(w);
136
+ const h = r.value === i && b.redirect !== null, w = h ? b.redirect ?? B(i) : null;
137
+ await Y(i, { force: b.force }), b.redirect !== null && h && w && await e.replace(w);
138
138
  }
139
- async function _(r, b = {}) {
140
- const d = l.findIndex((h) => h.id === r);
141
- d !== -1 && (l.splice(d, 1), T.value === r && (T.value = null), i.value === r && (i.value = null, p.value = void 0));
139
+ async function Y(i, b = {}) {
140
+ const d = l.findIndex((h) => h.id === i);
141
+ d !== -1 && (l.splice(d, 1), T.value === i && (T.value = null), r.value === i && (r.value = null, p.value = void 0));
142
142
  }
143
- async function O(r = i.value ?? void 0, b = !1) {
144
- if (!r) return;
145
- const d = l.find((w) => w.id === r);
143
+ async function O(i = r.value ?? void 0, b = !1) {
144
+ if (!i) return;
145
+ const d = l.find((w) => w.id === i);
146
146
  if (!d) return;
147
147
  const h = o.keepAlive && d.alive;
148
- h && (d.alive = !1, await j()), d.renderKey = (d.renderKey ?? 0) + 1, h && (d.alive = !0), T.value = r, await j(), b || await j(), T.value = null;
148
+ h && (d.alive = !1, await j()), d.renderKey = (d.renderKey ?? 0) + 1, h && (d.alive = !0), T.value = i, await j(), b || await j(), T.value = null;
149
149
  }
150
- async function te(r = !1) {
150
+ async function ne(i = !1) {
151
151
  for (const b of l)
152
- await O(b.id, r);
152
+ await O(b.id, i);
153
153
  }
154
- async function ne(r = o.defaultRoute) {
155
- l.splice(0, l.length), i.value = null, p.value = void 0;
154
+ async function oe(i = o.defaultRoute) {
155
+ l.splice(0, l.length), r.value = null, p.value = void 0;
156
156
  for (const b of o.initialTabs) {
157
- const d = V(e, b.to), h = q(d, b, o.keepAlive);
157
+ const d = V(e, b.to), h = Q(d, b, o.keepAlive);
158
158
  l.push(h);
159
159
  }
160
- await e.replace(r);
160
+ await e.replace(i);
161
161
  }
162
162
  async function y() {
163
- const r = i.value;
164
- r && await O(r, !0);
163
+ const i = r.value;
164
+ i && await O(i, !0);
165
165
  }
166
- function G(r) {
167
- return typeof r.matched == "object" ? N(r) : N(V(e, r));
166
+ function G(i) {
167
+ return typeof i.matched == "object" ? N(i) : N(V(e, i));
168
168
  }
169
169
  function M() {
170
- const r = l.find((b) => b.id === i.value);
170
+ const i = l.find((b) => b.id === r.value);
171
171
  return {
172
172
  tabs: l.map(It),
173
- active: r ? r.to : null
173
+ active: i ? i.to : null
174
174
  };
175
175
  }
176
- async function D(r) {
177
- c = !0, l.splice(0, l.length), i.value = null, p.value = void 0;
178
- const b = r?.tabs ?? [];
176
+ async function D(i) {
177
+ c = !0, l.splice(0, l.length), r.value = null, p.value = void 0;
178
+ const b = i?.tabs ?? [];
179
179
  for (const h of b)
180
180
  try {
181
- const w = V(e, h.to), A = xt(h), I = q(w, A, o.keepAlive);
182
- be(l, I, "last", null);
181
+ const w = V(e, h.to), A = xt(h), I = Q(w, A, o.keepAlive);
182
+ de(l, I, "last", null);
183
183
  } catch {
184
184
  }
185
185
  c = !1;
186
- const d = r?.active ?? b[b.length - 1]?.to ?? o.defaultRoute;
186
+ const d = i?.active ?? b[b.length - 1]?.to ?? o.defaultRoute;
187
187
  if (d)
188
188
  try {
189
189
  await e.replace(d);
@@ -192,43 +192,43 @@ function $t(e, n = {}) {
192
192
  }
193
193
  return P(
194
194
  () => e.currentRoute.value,
195
- (r) => {
195
+ (i) => {
196
196
  if (c) return;
197
- const b = K(r);
198
- i.value = b.id, p.value = b, xe(l, o.maxAlive, i.value);
197
+ const b = R(i);
198
+ r.value = b.id, p.value = b, xe(l, o.maxAlive, r.value);
199
199
  },
200
200
  { immediate: !0 }
201
- ), o.initialTabs.length && o.initialTabs.forEach((r) => {
202
- const b = V(e, r.to), d = q(b, r, o.keepAlive);
203
- be(l, d, "last", null);
201
+ ), o.initialTabs.length && o.initialTabs.forEach((i) => {
202
+ const b = V(e, i.to), d = Q(b, i, o.keepAlive);
203
+ de(l, d, "last", null);
204
204
  }), {
205
205
  options: o,
206
206
  tabs: l,
207
- activeId: i,
207
+ activeId: r,
208
208
  current: p,
209
209
  includeKeys: s,
210
210
  refreshingKey: T,
211
- openTab: $,
211
+ openTab: x,
212
212
  closeTab: z,
213
- removeTab: _,
213
+ removeTab: Y,
214
214
  refreshTab: O,
215
- refreshAll: te,
216
- reset: ne,
215
+ refreshAll: ne,
216
+ reset: oe,
217
217
  reload: y,
218
218
  getRouteKey: G,
219
- matchRoute: m,
219
+ matchRoute: g,
220
220
  snapshot: M,
221
221
  hydrate: D
222
222
  };
223
223
  }
224
- function $e(e) {
224
+ function De(e) {
225
225
  return e ? typeof e == "string" ? { name: e } : e : {};
226
226
  }
227
- const ee = Symbol("RouterTabsContext"), Z = "router-tabs:snapshot";
228
- function De(e = {}) {
229
- const { optional: n = !1 } = e, o = Pe(ee, null);
227
+ const te = Symbol("RouterTabsContext"), ee = "router-tabs:snapshot";
228
+ function $e(e = {}) {
229
+ const { optional: n = !1 } = e, o = Ke(te, null);
230
230
  if (o) return o;
231
- const l = Pe("$tabs", null);
231
+ const l = Ke("$tabs", null);
232
232
  if (l) return l;
233
233
  const p = je()?.appContext.config.globalProperties.$tabs;
234
234
  if (p) return p;
@@ -236,7 +236,7 @@ function De(e = {}) {
236
236
  throw new Error("[RouterTabs] useRouterTabs must be used within <router-tab>.");
237
237
  return null;
238
238
  }
239
- const Dt = 864e5;
239
+ const $t = 864e5;
240
240
  function St(e) {
241
241
  if (typeof document > "u") return null;
242
242
  const n = `${encodeURIComponent(e)}=`, o = document.cookie ? document.cookie.split("; ") : [];
@@ -249,21 +249,21 @@ function Se(e, n, o) {
249
249
  if (typeof document > "u") return;
250
250
  const {
251
251
  expiresInDays: l = 7,
252
- path: i = "/",
252
+ path: r = "/",
253
253
  domain: p,
254
254
  secure: T,
255
255
  sameSite: s = "lax"
256
256
  } = o, c = [`${encodeURIComponent(e)}=${encodeURIComponent(n)}`];
257
257
  if (l !== 1 / 0) {
258
- const m = new Date(Date.now() + l * Dt).toUTCString();
259
- c.push(`Expires=${m}`);
258
+ const g = new Date(Date.now() + l * $t).toUTCString();
259
+ c.push(`Expires=${g}`);
260
260
  }
261
- i && c.push(`Path=${i}`), p && c.push(`Domain=${p}`), T && c.push("Secure"), s && c.push(`SameSite=${s.charAt(0).toUpperCase()}${s.slice(1)}`), document.cookie = c.join("; ");
261
+ r && c.push(`Path=${r}`), p && c.push(`Domain=${p}`), T && c.push("Secure"), s && c.push(`SameSite=${s.charAt(0).toUpperCase()}${s.slice(1)}`), document.cookie = c.join("; ");
262
262
  }
263
263
  function Be(e, n) {
264
264
  if (typeof document > "u") return;
265
- const { path: o = "/", domain: l } = n, i = [`${encodeURIComponent(e)}=`];
266
- i.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && i.push(`Path=${o}`), l && i.push(`Domain=${l}`), document.cookie = i.join("; ");
265
+ const { path: o = "/", domain: l } = n, r = [`${encodeURIComponent(e)}=`];
266
+ r.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && r.push(`Path=${o}`), l && r.push(`Domain=${l}`), document.cookie = r.join("; ");
267
267
  }
268
268
  const Bt = (e) => JSON.stringify(e ?? null), Mt = (e) => {
269
269
  if (!e) return null;
@@ -275,18 +275,18 @@ const Bt = (e) => JSON.stringify(e ?? null), Mt = (e) => {
275
275
  };
276
276
  function Ve(e = {}) {
277
277
  const {
278
- cookieKey: n = Z,
278
+ cookieKey: n = ee,
279
279
  serialize: o = Bt,
280
280
  deserialize: l = Mt
281
- } = e, i = De({ optional: !0 }), p = S(!0), T = (s) => {
281
+ } = e, r = $e({ optional: !0 }), p = S(!0), T = (s) => {
282
282
  ge(async () => {
283
283
  const c = l(St(n));
284
284
  if (c && c.tabs?.length)
285
285
  try {
286
286
  if (p.value = !0, await s.hydrate(c), c.active) {
287
287
  await j();
288
- const K = s.tabs.find(($) => $.to === c.active);
289
- K && (s.activeId.value = K.id, s.current.value = K);
288
+ const R = s.tabs.find((x) => x.to === c.active);
289
+ R && (s.activeId.value = R.id, s.current.value = R);
290
290
  }
291
291
  } finally {
292
292
  p.value = !1;
@@ -294,15 +294,15 @@ function Ve(e = {}) {
294
294
  else if (Object.prototype.hasOwnProperty.call(e, "fallbackRoute"))
295
295
  try {
296
296
  p.value = !0;
297
- const K = e.fallbackRoute ?? s.options.defaultRoute;
298
- await s.reset(K);
297
+ const R = e.fallbackRoute ?? s.options.defaultRoute;
298
+ await s.reset(R);
299
299
  } finally {
300
300
  p.value = !1;
301
301
  }
302
302
  else
303
303
  p.value = !1;
304
- const m = s.snapshot();
305
- m.tabs.length ? Se(n, o(m), e) : Be(n, e), p.value = !1;
304
+ const g = s.snapshot();
305
+ g.tabs.length ? Se(n, o(g), e) : Be(n, e), p.value = !1;
306
306
  }), P(
307
307
  () => ({
308
308
  tabs: s.tabs.map((c) => ({
@@ -324,8 +324,8 @@ function Ve(e = {}) {
324
324
  { deep: !0 }
325
325
  );
326
326
  };
327
- i ? T(i) : ge(() => {
328
- const s = De({ optional: !0 });
327
+ r ? T(r) : ge(() => {
328
+ const s = $e({ optional: !0 });
329
329
  s && T(s);
330
330
  });
331
331
  }
@@ -371,7 +371,7 @@ const Lt = Oe({
371
371
  },
372
372
  cookieKey: {
373
373
  type: String,
374
- default: Z
374
+ default: ee
375
375
  },
376
376
  persistence: {
377
377
  type: Object,
@@ -390,7 +390,7 @@ const Lt = Oe({
390
390
  const l = o.appContext.app.config.globalProperties.$router;
391
391
  if (!l)
392
392
  throw new Error("[RouterTab] Vue Router is required. Make sure to call app.use(router) before RouterTab.");
393
- const i = $t(l, {
393
+ const r = Dt(l, {
394
394
  initialTabs: e.tabs,
395
395
  keepAlive: e.keepAlive,
396
396
  maxAlive: e.maxAlive,
@@ -398,25 +398,25 @@ const Lt = Oe({
398
398
  appendPosition: e.append,
399
399
  defaultRoute: e.defaultPage
400
400
  });
401
- pt(ee, i), o.appContext.config.globalProperties.$tabs = i;
402
- const p = k(() => !!o?.slots?.default), T = k(() => !!o?.slots?.start), s = k(() => !!o?.slots?.end), c = S(0), m = k(() => {
401
+ pt(te, r), o.appContext.config.globalProperties.$tabs = r;
402
+ const p = k(() => !!o?.slots?.default), T = k(() => !!o?.slots?.start), s = k(() => !!o?.slots?.end), c = S(0), g = k(() => {
403
403
  c.value;
404
404
  const t = {};
405
- return i.tabs.forEach((a) => {
406
- const f = typeof a.title == "string" ? a.title : String(a.title || oe(a));
405
+ return r.tabs.forEach((a) => {
406
+ const f = typeof a.title == "string" ? a.title : String(a.title || ae(a));
407
407
  t[a.id] = f;
408
408
  }), t;
409
409
  });
410
- function K() {
410
+ function R() {
411
411
  c.value++;
412
412
  }
413
- const $ = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
413
+ const x = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
414
414
  function z(t, a) {
415
- if (!a || $.has(t)) return;
416
- $.set(t, a);
417
- const f = i.tabs.find((v) => i.getRouteKey(v.to) === t);
415
+ if (!a || x.has(t)) return;
416
+ x.set(t, a);
417
+ const f = r.tabs.find((v) => r.getRouteKey(v.to) === t);
418
418
  if (!f) return;
419
- const g = [];
419
+ const m = [];
420
420
  if (a.routeTabTitle !== void 0) {
421
421
  const v = P(
422
422
  () => {
@@ -426,12 +426,12 @@ const Lt = Oe({
426
426
  (u) => {
427
427
  if (u != null) {
428
428
  const U = String(u);
429
- f.title = U, K();
429
+ f.title = U, R();
430
430
  }
431
431
  },
432
432
  { immediate: !0 }
433
433
  );
434
- g.push(v);
434
+ m.push(v);
435
435
  }
436
436
  if (a.routeTabIcon !== void 0) {
437
437
  const v = P(
@@ -440,11 +440,11 @@ const Lt = Oe({
440
440
  return u && typeof u == "object" && "value" in u ? u.value : u;
441
441
  },
442
442
  (u) => {
443
- u != null && (f.icon = String(u), K());
443
+ u != null && (f.icon = String(u), R());
444
444
  },
445
445
  { immediate: !0 }
446
446
  );
447
- g.push(v);
447
+ m.push(v);
448
448
  }
449
449
  if (a.routeTabClosable !== void 0) {
450
450
  const v = P(
@@ -453,11 +453,11 @@ const Lt = Oe({
453
453
  return u && typeof u == "object" && "value" in u ? u.value : u;
454
454
  },
455
455
  (u) => {
456
- u != null && (f.closable = !!u, K());
456
+ u != null && (f.closable = !!u, R());
457
457
  },
458
458
  { immediate: !0 }
459
459
  );
460
- g.push(v);
460
+ m.push(v);
461
461
  }
462
462
  if (a.routeTabMeta !== void 0) {
463
463
  const v = P(
@@ -466,32 +466,32 @@ const Lt = Oe({
466
466
  return u && typeof u == "object" && "value" in u ? u.value : u;
467
467
  },
468
468
  (u) => {
469
- u && typeof u == "object" && (Object.assign(f, u), K());
469
+ u && typeof u == "object" && (Object.assign(f, u), R());
470
470
  },
471
471
  { immediate: !0, deep: !0 }
472
472
  );
473
- g.push(v);
473
+ m.push(v);
474
474
  }
475
- B.set(t, g);
475
+ B.set(t, m);
476
476
  }
477
- function _(t) {
477
+ function Y(t) {
478
478
  const a = B.get(t);
479
- a && (a.forEach((f) => f()), B.delete(t)), $.delete(t);
479
+ a && (a.forEach((f) => f()), B.delete(t)), x.delete(t);
480
480
  }
481
481
  function O(t, a) {
482
- t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? z(a, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && z(a, t.$) : t === null && _(a);
482
+ t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? z(a, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && z(a, t.$) : t === null && Y(a);
483
483
  }
484
484
  if (e.cookieKey !== null || e.persistence) {
485
485
  const t = {
486
486
  ...e.persistence ?? {}
487
487
  };
488
- e.cookieKey !== null ? t.cookieKey = e.cookieKey || Z : t.cookieKey || (t.cookieKey = Z), Ve(t);
488
+ e.cookieKey !== null ? t.cookieKey = e.cookieKey || ee : t.cookieKey || (t.cookieKey = ee), Ve(t);
489
489
  }
490
- const te = k(() => $e(e.tabTransition)), ne = k(() => $e(e.pageTransition)), y = me({
490
+ const ne = k(() => De(e.tabTransition)), oe = k(() => De(e.pageTransition)), y = pe({
491
491
  visible: !1,
492
492
  target: null,
493
493
  position: { x: 0, y: 0 }
494
- }), G = S(null), M = S([]), D = S(-1), r = me({
494
+ }), G = S(null), M = S([]), D = S(-1), i = pe({
495
495
  dragging: !1,
496
496
  dragIndex: -1,
497
497
  dropIndex: -1,
@@ -505,46 +505,46 @@ const Lt = Oe({
505
505
  "closeOthers"
506
506
  ];
507
507
  function d(t) {
508
- return i.tabs.findIndex((a) => a.id === t);
508
+ return r.tabs.findIndex((a) => a.id === t);
509
509
  }
510
510
  function h(t) {
511
511
  const a = d(t.id);
512
- return a > 0 ? i.tabs.slice(0, a) : [];
512
+ return a > 0 ? r.tabs.slice(0, a) : [];
513
513
  }
514
514
  function w(t) {
515
515
  const a = d(t.id);
516
- return a > -1 ? i.tabs.slice(a + 1) : [];
516
+ return a > -1 ? r.tabs.slice(a + 1) : [];
517
517
  }
518
518
  function A(t) {
519
- return i.tabs.filter((a) => a.id !== t.id);
519
+ return r.tabs.filter((a) => a.id !== t.id);
520
520
  }
521
521
  async function I(t, a) {
522
- const f = t.filter((g) => g.closable !== !1);
522
+ const f = t.filter((m) => m.closable !== !1);
523
523
  if (f.length) {
524
- for (const g of f)
525
- i.activeId.value === g.id ? await i.closeTab(g.id, { redirect: a.to, force: !0 }) : await i.removeTab(g.id, { force: !0 });
526
- i.activeId.value !== a.id && await i.openTab(a.to, !0, !1);
524
+ for (const m of f)
525
+ r.activeId.value === m.id ? await r.closeTab(m.id, { redirect: a.to, force: !0 }) : await r.removeTab(m.id, { force: !0 });
526
+ r.activeId.value !== a.id && await r.openTab(a.to, !0, !1);
527
527
  }
528
528
  }
529
529
  const Fe = {
530
530
  refresh: {
531
531
  label: "Refresh",
532
532
  handler: async ({ target: t }) => {
533
- await i.refreshTab(t.id, !0);
533
+ await r.refreshTab(t.id, !0);
534
534
  }
535
535
  },
536
536
  refreshAll: {
537
537
  label: "Refresh All",
538
538
  handler: async () => {
539
- await i.refreshAll(!0);
539
+ await r.refreshAll(!0);
540
540
  }
541
541
  },
542
542
  close: {
543
543
  label: "Close",
544
544
  handler: async ({ target: t }) => {
545
- await i.closeTab(t.id);
545
+ await r.closeTab(t.id);
546
546
  },
547
- enable: ({ target: t }) => ae(t)
547
+ enable: ({ target: t }) => re(t)
548
548
  },
549
549
  closeLefts: {
550
550
  label: "Close to the Left",
@@ -579,12 +579,12 @@ const Lt = Oe({
579
579
  }));
580
580
  }
581
581
  function Je(t, a) {
582
- const f = typeof t == "string" ? { id: t } : t, g = Fe[f.id], v = f.label ?? g?.label ?? String(f.id), u = f.visible ?? g?.visible ?? !0;
582
+ const f = typeof t == "string" ? { id: t } : t, m = Fe[f.id], v = f.label ?? m?.label ?? String(f.id), u = f.visible ?? m?.visible ?? !0;
583
583
  if (!(typeof u == "function" ? u(a) : u !== !1)) return null;
584
- const ie = f.enable ?? g?.enable ?? !0, ft = typeof ie == "function" ? ie(a) : ie !== !1, Ke = f.handler ?? g?.handler;
585
- if (!Ke) return null;
584
+ const ie = f.enable ?? m?.enable ?? !0, ft = typeof ie == "function" ? ie(a) : ie !== !1, Re = f.handler ?? m?.handler;
585
+ if (!Re) return null;
586
586
  const dt = async () => {
587
- await Promise.resolve(Ke(a));
587
+ await Promise.resolve(Re(a));
588
588
  };
589
589
  return {
590
590
  id: String(f.id),
@@ -593,44 +593,43 @@ const Lt = Oe({
593
593
  action: dt
594
594
  };
595
595
  }
596
- const Y = k(() => {
596
+ const _ = k(() => {
597
597
  if (!y.visible || !y.target || e.contextmenu === !1) return [];
598
- const t = Array.isArray(e.contextmenu) ? e.contextmenu : b, a = { target: y.target, controller: i };
598
+ const t = Array.isArray(e.contextmenu) ? e.contextmenu : b, a = { target: y.target, controller: r };
599
599
  return t.map((f) => Je(f, a)).filter((f) => !!f);
600
600
  });
601
601
  function We() {
602
602
  const t = G.value;
603
603
  if (!t) return;
604
- const a = 8, { innerWidth: f, innerHeight: g } = window, v = t.getBoundingClientRect();
604
+ const a = 8, { innerWidth: f, innerHeight: m } = window, v = t.getBoundingClientRect();
605
605
  let u = y.position.x, U = y.position.y;
606
- v.right > f - a && (u = Math.max(a, f - v.width - a)), v.bottom > g - a && (U = Math.max(a, g - v.height - a)), (u !== y.position.x || U !== y.position.y) && (y.position.x = u, y.position.y = U);
606
+ v.right > f - a && (u = Math.max(a, f - v.width - a)), v.bottom > m - a && (U = Math.max(a, m - v.height - a)), (u !== y.position.x || U !== y.position.y) && (y.position.x = u, y.position.y = U);
607
607
  }
608
608
  function Ge(t, a) {
609
- const f = t?.$el || t;
610
- M.value[a] = f ?? null;
609
+ M.value[a] = t ?? null;
611
610
  }
612
611
  function Xe(t) {
613
612
  if (t < 0) return;
614
613
  M.value[t]?.focus({ preventScroll: !0 });
615
614
  }
616
- function X(t, a, f = Y.value) {
615
+ function X(t, a, f = _.value) {
617
616
  if (!f.length) return -1;
618
- const g = f.length;
617
+ const m = f.length;
619
618
  let v = t;
620
- for (let u = 0; u < g; u++)
621
- if (v = (v + a + g) % g, !f[v].disabled) return v;
619
+ for (let u = 0; u < m; u++)
620
+ if (v = (v + a + m) % m, !f[v].disabled) return v;
622
621
  return -1;
623
622
  }
624
623
  function F(t) {
625
624
  D.value = t, !(t < 0) && j(() => Xe(t));
626
625
  }
627
- function ke(t) {
626
+ function Te(t) {
628
627
  const a = X(D.value, t);
629
628
  a !== -1 && F(a);
630
629
  }
631
630
  function qe(t) {
632
631
  if (!y.visible) return;
633
- const a = t.key, f = Y.value;
632
+ const a = t.key, f = _.value;
634
633
  if (!f.length) return;
635
634
  if (a === "Tab") {
636
635
  E();
@@ -651,11 +650,11 @@ const Lt = Oe({
651
650
  switch (t.preventDefault(), a) {
652
651
  case "ArrowDown":
653
652
  case "ArrowRight":
654
- ke(1);
653
+ Te(1);
655
654
  break;
656
655
  case "ArrowUp":
657
656
  case "ArrowLeft":
658
- ke(-1);
657
+ Te(-1);
659
658
  break;
660
659
  case "Home":
661
660
  F(X(-1, 1));
@@ -669,7 +668,7 @@ const Lt = Oe({
669
668
  const v = D.value;
670
669
  if (v > -1) {
671
670
  const u = f[v];
672
- u.disabled || we(u);
671
+ u.disabled || ke(u);
673
672
  }
674
673
  break;
675
674
  }
@@ -678,98 +677,98 @@ const Lt = Oe({
678
677
  break;
679
678
  }
680
679
  }
681
- async function we(t) {
680
+ async function ke(t) {
682
681
  t.disabled || (E(), await t.action());
683
682
  }
684
- function oe(t) {
683
+ function ae(t) {
685
684
  return typeof t.title == "string" && t.title.trim() ? t.title : Array.isArray(t.title) && t.title.length && String(t.title[0]).trim() ? String(t.title[0]) : "Untitled";
686
685
  }
687
686
  function Qe(t) {
688
- return m.value[t.id] || oe(t);
687
+ return g.value[t.id] || ae(t);
689
688
  }
690
- function Ce(t) {
691
- const a = i.getRouteKey(t), f = i.tabs.find((v) => v.id === a);
689
+ function we(t) {
690
+ const a = r.getRouteKey(t), f = r.tabs.find((v) => v.id === a);
692
691
  if (!f)
693
- return console.warn(`[RouterTab] Tab not found for key: ${a}. This may cause rendering issues.`), `${a}::0`;
694
- const g = f.renderKey ?? 0;
695
- return `${a}::${g}`;
692
+ return console.warn("[RouterTab] Tab not found for route:", a), `${a}::0`;
693
+ const m = f.renderKey ?? 0;
694
+ return `${a}::${m}`;
696
695
  }
697
696
  function Ze(t) {
698
- return `${Ce(t)}::refresh`;
697
+ return `${we(t)}::refresh`;
699
698
  }
700
- function ae(t) {
701
- return !(t.closable === !1 || i.options.keepLastTab && i.tabs.length <= 1);
699
+ function re(t) {
700
+ return !(t.closable === !1 || r.options.keepLastTab && r.tabs.length <= 1);
702
701
  }
703
702
  async function et(t) {
704
- await i.closeTab(t.id);
703
+ await r.closeTab(t.id);
705
704
  }
706
705
  function tt(t) {
707
706
  if (t.href && typeof window < "u") {
708
707
  t.target && t.target !== "_self" ? window.open(t.href, t.target) : window.location.assign(t.href);
709
708
  return;
710
709
  }
711
- i.activeId.value !== t.id && i.openTab(t.to, !1);
710
+ r.activeId.value !== t.id && r.openTab(t.to, !1);
712
711
  }
713
712
  function nt(t) {
714
713
  return [
715
714
  "router-tab__item",
716
715
  {
717
- "is-active": i.activeId.value === t.id,
718
- "is-closable": ae(t),
719
- "is-dragging": r.dragging && r.dragTab?.id === t.id,
720
- "is-drag-over": r.dropIndex === d(t.id)
716
+ "is-active": r.activeId.value === t.id,
717
+ "is-closable": re(t),
718
+ "is-dragging": i.dragging && i.dragTab?.id === t.id,
719
+ "is-drag-over": i.dropIndex === d(t.id)
721
720
  },
722
721
  t.tabClass
723
722
  ];
724
723
  }
725
724
  function ot(t) {
726
- return i.refreshingKey.value === i.getRouteKey(t);
725
+ return r.refreshingKey.value === r.getRouteKey(t);
727
726
  }
728
727
  function at(t) {
729
- const a = i.getRouteKey(t);
730
- return i.tabs.some((f) => f.id === a);
728
+ const a = r.getRouteKey(t);
729
+ return r.tabs.some((f) => f.id === a);
731
730
  }
732
- function it(t, a, f) {
733
- e.sortable && (r.dragging = !0, r.dragIndex = a, r.dragTab = t, f.dataTransfer && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id)), n("tab-sort", { tab: t, index: a }));
731
+ function rt(t, a, f) {
732
+ e.sortable && (i.dragging = !0, i.dragIndex = a, i.dragTab = t, f.dataTransfer && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id)), n("tab-sort", { tab: t, index: a }));
734
733
  }
735
- function rt(t, a) {
736
- !e.sortable || !r.dragging || (a.preventDefault(), a.dataTransfer && (a.dataTransfer.dropEffect = "move"));
734
+ function it(t, a) {
735
+ !e.sortable || !i.dragging || (a.preventDefault(), a.dataTransfer && (a.dataTransfer.dropEffect = "move"));
737
736
  }
738
737
  function lt(t) {
739
- !e.sortable || !r.dragging || (r.dropIndex = t);
738
+ !e.sortable || !i.dragging || (i.dropIndex = t);
740
739
  }
741
740
  function st() {
742
- !e.sortable || r.dragging;
741
+ !e.sortable || i.dragging;
743
742
  }
744
743
  function ut(t, a) {
745
- if (!(!e.sortable || !r.dragging)) {
746
- if (a.preventDefault(), r.dragIndex !== -1 && r.dragIndex !== t) {
747
- const f = i.tabs.splice(r.dragIndex, 1)[0];
748
- i.tabs.splice(t, 0, f), n("tab-sorted", {
744
+ if (!(!e.sortable || !i.dragging)) {
745
+ if (a.preventDefault(), i.dragIndex !== -1 && i.dragIndex !== t) {
746
+ const f = r.tabs.splice(i.dragIndex, 1)[0];
747
+ r.tabs.splice(t, 0, f), n("tab-sorted", {
749
748
  tab: f,
750
- fromIndex: r.dragIndex,
749
+ fromIndex: i.dragIndex,
751
750
  toIndex: t
752
751
  });
753
752
  }
754
- Re();
753
+ Ce();
755
754
  }
756
755
  }
757
- function Re() {
758
- r.dragging = !1, r.dragIndex = -1, r.dropIndex = -1, r.dragTab = null;
756
+ function Ce() {
757
+ i.dragging = !1, i.dragIndex = -1, i.dropIndex = -1, i.dragTab = null;
759
758
  }
760
759
  ge(() => {
761
760
  document.addEventListener("keydown", E);
762
- }), mt(() => {
761
+ }), gt(() => {
763
762
  document.removeEventListener("keydown", E), o.appContext.config.globalProperties.$tabs = null, B.forEach((t) => {
764
763
  t.forEach((a) => a());
765
- }), B.clear(), $.clear();
764
+ }), B.clear(), x.clear();
766
765
  }), P(
767
766
  () => e.keepAlive,
768
767
  (t) => {
769
- i.options.keepAlive = t;
768
+ r.options.keepAlive = t;
770
769
  }
771
770
  ), P(
772
- () => i.activeId.value,
771
+ () => r.activeId.value,
773
772
  () => E()
774
773
  ), P(
775
774
  () => e.contextmenu,
@@ -777,13 +776,13 @@ const Lt = Oe({
777
776
  t || E();
778
777
  }
779
778
  ), P(
780
- () => Y.value.length,
779
+ () => _.value.length,
781
780
  (t) => {
782
781
  y.visible && t === 0 && E();
783
782
  },
784
783
  { flush: "post" }
785
784
  // Run after component updates to prevent blocking render
786
- ), P(Y, (t) => {
785
+ ), P(_, (t) => {
787
786
  if (!y.visible) return;
788
787
  M.value = new Array(t.length).fill(null);
789
788
  const a = X(-1, 1, t);
@@ -794,41 +793,41 @@ const Lt = Oe({
794
793
  t || (D.value = -1, M.value = []);
795
794
  }
796
795
  );
797
- const ct = i.includeKeys;
796
+ const ct = r.includeKeys;
798
797
  return {
799
- controller: i,
800
- tabs: i.tabs,
798
+ controller: r,
799
+ tabs: r.tabs,
801
800
  includeKeys: ct,
802
- tabTransitionProps: te,
803
- pageTransitionProps: ne,
801
+ tabTransitionProps: ne,
802
+ pageTransitionProps: oe,
804
803
  buildTabClass: nt,
805
804
  activate: tt,
806
805
  close: et,
807
806
  context: y,
808
- menuItems: Y,
809
- handleMenuAction: we,
807
+ menuItems: _,
808
+ handleMenuAction: ke,
810
809
  showContextMenu: He,
811
810
  hideContextMenu: E,
812
- getTabTitle: oe,
813
- isClosable: ae,
811
+ getTabTitle: ae,
812
+ isClosable: re,
814
813
  isRefreshing: ot,
815
814
  isTabReady: at,
816
815
  hasCustomSlot: p,
817
816
  hasStartSlot: T,
818
817
  hasEndSlot: s,
819
- onDragStart: it,
820
- onDragOver: rt,
818
+ onDragStart: rt,
819
+ onDragOver: it,
821
820
  onDragEnter: lt,
822
821
  onDragLeave: st,
823
822
  onDrop: ut,
824
- onDragEnd: Re,
823
+ onDragEnd: Ce,
825
824
  setupComponentWatching: z,
826
- cleanupComponentWatching: _,
825
+ cleanupComponentWatching: Y,
827
826
  handleComponentRef: O,
828
827
  getReactiveTabTitle: Qe,
829
- getComponentCacheKey: Ce,
828
+ getComponentCacheKey: we,
830
829
  getRefreshComponentKey: Ze,
831
- triggerTabUpdate: K,
830
+ triggerTabUpdate: R,
832
831
  menuRef: G,
833
832
  highlightedIndex: D,
834
833
  setMenuItemRef: Ge,
@@ -838,53 +837,53 @@ const Lt = Oe({
838
837
  }
839
838
  }), jt = (e, n) => {
840
839
  const o = e.__vccOpts || e;
841
- for (const [l, i] of n)
842
- o[l] = i;
840
+ for (const [l, r] of n)
841
+ o[l] = r;
843
842
  return o;
844
- }, Ot = { class: "router-tab" }, Ut = { class: "router-tab__header" }, Vt = { class: "router-tab__scroll" }, Nt = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], zt = ["title"], _t = ["onClick"], Yt = { class: "router-tab__container" }, Ft = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
845
- function Ht(e, n, o, l, i, p) {
846
- const T = gt("RouterView");
847
- return C(), x("div", Ot, [
843
+ }, Ot = { class: "router-tab" }, Ut = { class: "router-tab__header" }, Vt = { class: "router-tab__scroll" }, Nt = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], zt = ["title"], Yt = ["onClick"], _t = { class: "router-tab__container" }, Ft = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
844
+ function Ht(e, n, o, l, r, p) {
845
+ const T = mt("RouterView");
846
+ return K(), $("div", Ot, [
848
847
  L("header", Ut, [
849
848
  L("div", {
850
849
  class: H(["router-tab__slot-start", { "has-content": e.hasStartSlot }])
851
850
  }, [
852
- re(e.$slots, "start")
851
+ le(e.$slots, "start")
853
852
  ], 2),
854
853
  L("div", Vt, [
855
- Ae(yt, le({
854
+ Pe(yt, se({
856
855
  tag: "ul",
857
856
  class: "router-tab__nav"
858
857
  }, e.tabTransitionProps), {
859
- default: se(() => [
860
- (C(!0), x(ue, null, Ee(e.tabs, (s, c) => (C(), x("li", {
858
+ default: ue(() => [
859
+ (K(!0), $(Ae, null, Ee(e.tabs, (s, c) => (K(), $("li", {
861
860
  key: s.id,
862
861
  class: H(e.buildTabClass(s)),
863
862
  "data-title": e.getTabTitle(s),
864
863
  draggable: e.sortable,
865
- onClick: (m) => e.activate(s),
866
- onAuxclick: ce((m) => e.close(s), ["middle", "prevent"]),
867
- onContextmenu: ce((m) => e.showContextMenu(s, m), ["prevent"]),
868
- onDragstart: (m) => e.onDragStart(s, c, m),
869
- onDragover: (m) => e.onDragOver(c, m),
870
- onDragenter: (m) => e.onDragEnter(c),
871
- onDragleave: n[0] || (n[0] = (...m) => e.onDragLeave && e.onDragLeave(...m)),
872
- onDrop: (m) => e.onDrop(c, m),
873
- onDragend: n[1] || (n[1] = (...m) => e.onDragEnd && e.onDragEnd(...m))
864
+ onClick: (g) => e.activate(s),
865
+ onAuxclick: ce((g) => e.close(s), ["middle", "prevent"]),
866
+ onContextmenu: ce((g) => e.showContextMenu(s, g), ["prevent"]),
867
+ onDragstart: (g) => e.onDragStart(s, c, g),
868
+ onDragover: (g) => e.onDragOver(c, g),
869
+ onDragenter: (g) => e.onDragEnter(c),
870
+ onDragleave: n[0] || (n[0] = (...g) => e.onDragLeave && e.onDragLeave(...g)),
871
+ onDrop: (g) => e.onDrop(c, g),
872
+ onDragend: n[1] || (n[1] = (...g) => e.onDragEnd && e.onDragEnd(...g))
874
873
  }, [
875
- s.icon ? (C(), x("i", {
874
+ s.icon ? (K(), $("i", {
876
875
  key: 0,
877
876
  class: H(["router-tab__item-icon", s.icon])
878
- }, null, 2)) : fe("", !0),
877
+ }, null, 2)) : q("", !0),
879
878
  L("span", {
880
879
  class: "router-tab__item-title",
881
880
  title: e.getReactiveTabTitle(s)
882
881
  }, Ie(e.getReactiveTabTitle(s)), 9, zt),
883
- e.isClosable(s) ? (C(), x("a", {
882
+ e.isClosable(s) ? (K(), $("a", {
884
883
  key: 1,
885
884
  class: "router-tab__item-close",
886
- onClick: ce((m) => e.close(s), ["stop"])
887
- }, null, 8, _t)) : fe("", !0)
885
+ onClick: ce((g) => e.close(s), ["stop"])
886
+ }, null, 8, Yt)) : q("", !0)
888
887
  ], 42, Nt))), 128))
889
888
  ]),
890
889
  _: 1
@@ -893,40 +892,38 @@ function Ht(e, n, o, l, i, p) {
893
892
  L("div", {
894
893
  class: H(["router-tab__slot-end", { "has-content": e.hasEndSlot }])
895
894
  }, [
896
- re(e.$slots, "end")
895
+ le(e.$slots, "end")
897
896
  ], 2)
898
897
  ]),
899
- L("div", Yt, [
900
- Ae(T, null, {
901
- default: se((s) => [
902
- e.hasCustomSlot ? re(e.$slots, "default", ht(le({ key: 0 }, {
898
+ L("div", _t, [
899
+ Pe(T, null, {
900
+ default: ue((s) => [
901
+ e.hasCustomSlot ? le(e.$slots, "default", ht(se({ key: 0 }, {
903
902
  ...s,
904
903
  controller: e.controller,
905
904
  // Expose a ref binder so custom slots can keep reactivity
906
905
  pageRef: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route))
907
- }))) : (C(), J(Tt, le({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
908
- default: se(() => [
909
- s.Component && e.isTabReady(s.route) ? (C(), x(ue, { key: 0 }, [
910
- e.isRefreshing(s.route) ? (C(), J(de(s.Component), {
911
- key: e.getRefreshComponentKey(s.route),
912
- ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
913
- class: "router-tab-page"
914
- })) : e.controller.options.keepAlive ? (C(), J(kt, {
915
- key: 1,
916
- include: e.includeKeys,
917
- max: e.controller.options.maxAlive || void 0
918
- }, [
919
- (C(), J(de(s.Component), {
920
- key: e.getComponentCacheKey(s.route),
921
- ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
922
- class: "router-tab-page"
923
- }))
924
- ], 1032, ["include", "max"])) : (C(), J(de(s.Component), {
906
+ }))) : (K(), J(Tt, se({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
907
+ default: ue(() => [
908
+ e.isRefreshing(s.route) ? (K(), J(fe(s.Component), {
909
+ key: e.getRefreshComponentKey(s.route),
910
+ ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
911
+ class: "router-tab-page"
912
+ })) : e.controller.options.keepAlive ? (K(), J(kt, {
913
+ key: 1,
914
+ include: e.includeKeys,
915
+ max: e.controller.options.maxAlive || void 0
916
+ }, [
917
+ e.isTabReady(s.route) ? (K(), J(fe(s.Component), {
925
918
  key: e.getComponentCacheKey(s.route),
926
919
  ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
927
920
  class: "router-tab-page"
928
- }))
929
- ], 64)) : fe("", !0)
921
+ })) : q("", !0)
922
+ ], 1032, ["include", "max"])) : e.isTabReady(s.route) ? (K(), J(fe(s.Component), {
923
+ key: e.getComponentCacheKey(s.route),
924
+ ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
925
+ class: "router-tab-page"
926
+ })) : q("", !0)
930
927
  ]),
931
928
  _: 2
932
929
  }, 1040))
@@ -941,7 +938,7 @@ function Ht(e, n, o, l, i, p) {
941
938
  onKeydown: n[2] || (n[2] = (...s) => e.onMenuKeydown && e.onMenuKeydown(...s)),
942
939
  style: wt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
943
940
  }, [
944
- (C(!0), x(ue, null, Ee(e.menuItems, (s, c) => (C(), x("a", {
941
+ (K(!0), $(Ae, null, Ee(e.menuItems, (s, c) => (K(), $("a", {
945
942
  key: s.id,
946
943
  role: "menuitem",
947
944
  class: H(["router-tab__contextmenu-item", { "is-focused": c === e.highlightedIndex }]),
@@ -949,9 +946,9 @@ function Ht(e, n, o, l, i, p) {
949
946
  disabled: s.disabled,
950
947
  tabindex: s.disabled ? -1 : c === e.highlightedIndex ? 0 : -1,
951
948
  ref_for: !0,
952
- ref: (m) => e.setMenuItemRef(m, c),
953
- onMouseenter: (m) => !s.disabled && e.highlightMenuIndex(c),
954
- onClick: (m) => e.handleMenuAction(s)
949
+ ref: (g) => e.setMenuItemRef(g, c),
950
+ onMouseenter: (g) => !s.disabled && e.highlightMenuIndex(c),
951
+ onClick: (g) => e.handleMenuAction(s)
955
952
  }, Ie(s.label), 43, Ft))), 128))
956
953
  ], 36), [
957
954
  [Ct, e.context.visible && e.context.target]
@@ -961,7 +958,7 @@ function Ht(e, n, o, l, i, p) {
961
958
  const Me = /* @__PURE__ */ jt(Lt, [["render", Ht]]), Jt = {
962
959
  class: "router-tabs",
963
960
  "aria-hidden": "true"
964
- }, pe = /* @__PURE__ */ Oe({
961
+ }, be = /* @__PURE__ */ Oe({
965
962
  name: "RouterTabs",
966
963
  __name: "RouterTabs",
967
964
  props: {
@@ -976,11 +973,11 @@ const Me = /* @__PURE__ */ jt(Lt, [["render", Ht]]), Jt = {
976
973
  fallbackRoute: {}
977
974
  },
978
975
  setup(e) {
979
- return Ve(e), (o, l) => (C(), x("span", Jt));
976
+ return Ve(e), (o, l) => (K(), $("span", Jt));
980
977
  }
981
- }), Ne = "tab-theme-style", ze = "tab-theme-primary-color", Wt = "system", _e = "(prefers-color-scheme: dark)";
978
+ }), Ne = "tab-theme-style", ze = "tab-theme-primary-color", Wt = "system", Ye = "(prefers-color-scheme: dark)";
982
979
  let W = null;
983
- const R = {
980
+ const C = {
984
981
  primary: "#034960",
985
982
  background: "#ffffff",
986
983
  text: "#1e293b",
@@ -1021,12 +1018,12 @@ function Xt(e) {
1021
1018
  return null;
1022
1019
  }
1023
1020
  }
1024
- function he(e) {
1025
- typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? R.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? R.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? R.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? R.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? R.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? R.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? R.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? R.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? R.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? R.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? R.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? R.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? R.iconColor));
1021
+ function ye(e) {
1022
+ typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? C.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? C.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? C.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? C.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? C.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? C.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? C.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? C.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? C.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? C.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? C.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? C.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? C.iconColor));
1026
1023
  }
1027
- function Ye(e) {
1024
+ function _e(e) {
1028
1025
  if (typeof document > "u") return;
1029
- const n = document.documentElement, o = window.matchMedia(_e), l = () => {
1026
+ const n = document.documentElement, o = window.matchMedia(Ye), l = () => {
1030
1027
  n.dataset.theme = o.matches ? "dark" : "light";
1031
1028
  };
1032
1029
  W && (o.removeEventListener("change", W), W = null), e === "system" ? (l(), W = () => l(), o.addEventListener("change", W)) : n.dataset.theme = e;
@@ -1037,13 +1034,13 @@ function qt(e = {}) {
1037
1034
  styleKey: n = Ne,
1038
1035
  primaryKey: o = ze,
1039
1036
  defaultStyle: l = Wt,
1040
- defaultPrimary: i
1037
+ defaultPrimary: r
1041
1038
  } = e, p = window.localStorage.getItem(n) ?? l;
1042
- Ye(p);
1043
- const s = p === "dark" || p === "system" && window.matchMedia(_e).matches ? { ...Gt } : { ...R };
1044
- i && (s.primary = i);
1039
+ _e(p);
1040
+ const s = p === "dark" || p === "system" && window.matchMedia(Ye).matches ? { ...Gt } : { ...C };
1041
+ r && (s.primary = r);
1045
1042
  const c = Xt(o);
1046
- he(c ? {
1043
+ ye(c ? {
1047
1044
  ...s,
1048
1045
  ...c
1049
1046
  } : s);
@@ -1051,20 +1048,20 @@ function qt(e = {}) {
1051
1048
  function en(e, n) {
1052
1049
  if (typeof window > "u") return;
1053
1050
  const o = n?.styleKey ?? Ne;
1054
- window.localStorage.setItem(o, e), Ye(e);
1051
+ window.localStorage.setItem(o, e), _e(e);
1055
1052
  }
1056
1053
  function tn(e, n) {
1057
1054
  if (typeof window > "u") return;
1058
1055
  const o = n?.primaryKey ?? ze;
1059
- window.localStorage.setItem(o, JSON.stringify(e)), he(e);
1056
+ window.localStorage.setItem(o, JSON.stringify(e)), ye(e);
1060
1057
  }
1061
- function Q(e, n) {
1058
+ function Z(e, n) {
1062
1059
  if (Rt(e)) {
1063
1060
  const l = !Kt(e);
1064
1061
  return {
1065
1062
  value: e,
1066
- update: l ? (i) => {
1067
- e.value = i;
1063
+ update: l ? (r) => {
1064
+ e.value = r;
1068
1065
  } : () => {
1069
1066
  }
1070
1067
  };
@@ -1085,28 +1082,28 @@ function Q(e, n) {
1085
1082
  }
1086
1083
  };
1087
1084
  }
1088
- function Te(e = {}) {
1089
- const n = Q(e.title, "Untitled"), o = Q(e.icon, ""), l = Q(e.closable, !0), i = Q(e.meta, {});
1085
+ function he(e = {}) {
1086
+ const n = Z(e.title, "Untitled"), o = Z(e.icon, ""), l = Z(e.closable, !0), r = Z(e.meta, {});
1090
1087
  return {
1091
1088
  routeTabTitle: n.value,
1092
1089
  routeTabIcon: o.value,
1093
1090
  routeTabClosable: l.value,
1094
- routeTabMeta: i.value,
1091
+ routeTabMeta: r.value,
1095
1092
  updateTitle: n.update,
1096
1093
  updateIcon: o.update,
1097
1094
  updateClosable: l.update,
1098
- updateMeta: i.update
1095
+ updateMeta: r.update
1099
1096
  };
1100
1097
  }
1101
1098
  function nn(e, n = "Page") {
1102
- return Te({
1099
+ return he({
1103
1100
  title: k(() => e.value ? "Loading..." : n),
1104
1101
  icon: k(() => e.value ? "mdi-loading mdi-spin" : "mdi-page"),
1105
1102
  closable: k(() => !e.value)
1106
1103
  });
1107
1104
  }
1108
1105
  function on(e, n = "Page", o = "mdi-page") {
1109
- return Te({
1106
+ return he({
1110
1107
  title: k(() => e.value > 0 ? `${n} (${e.value})` : n),
1111
1108
  icon: k(() => e.value > 0 ? "mdi-bell-badge" : o)
1112
1109
  });
@@ -1118,7 +1115,7 @@ function an(e, n = "Page") {
1118
1115
  error: { suffix: " - Error", icon: "mdi-alert" },
1119
1116
  success: { suffix: " - Success", icon: "mdi-check-circle" }
1120
1117
  };
1121
- return Te({
1118
+ return he({
1122
1119
  title: k(() => n + o[e.value].suffix),
1123
1120
  icon: k(() => o[e.value].icon),
1124
1121
  closable: k(() => e.value !== "loading")
@@ -1132,33 +1129,33 @@ const rn = {
1132
1129
  const {
1133
1130
  initTheme: o = !0,
1134
1131
  themeOptions: l,
1135
- componentName: i = Me.name || "RouterTab",
1136
- tabsComponentName: p = pe.name || "RouterTabs"
1132
+ componentName: r = Me.name || "RouterTab",
1133
+ tabsComponentName: p = be.name || "RouterTabs"
1137
1134
  } = n ?? {};
1138
- o && qt(l ?? {}), e.component(i, Me), e.component(p, pe), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", pe), Object.defineProperty(e.config.globalProperties, "$tabs", {
1135
+ o && qt(l ?? {}), e.component(r, Me), e.component(p, be), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", be), Object.defineProperty(e.config.globalProperties, "$tabs", {
1139
1136
  configurable: !0,
1140
1137
  enumerable: !1,
1141
1138
  get() {
1142
- return e._context.provides[ee];
1139
+ return e._context.provides[te];
1143
1140
  },
1144
1141
  set(T) {
1145
- T && e.provide(ee, T);
1142
+ T && e.provide(te, T);
1146
1143
  }
1147
1144
  });
1148
1145
  }
1149
1146
  };
1150
1147
  export {
1151
1148
  Me as RouterTab,
1152
- pe as RouterTabs,
1149
+ be as RouterTabs,
1153
1150
  rn as default,
1154
1151
  qt as initRouterTabsTheme,
1155
- ee as routerTabsKey,
1152
+ te as routerTabsKey,
1156
1153
  tn as setRouterTabsPrimary,
1157
1154
  en as setRouterTabsTheme,
1158
1155
  nn as useLoadingTab,
1159
1156
  on as useNotificationTab,
1160
- Te as useReactiveTab,
1161
- De as useRouterTabs,
1157
+ he as useReactiveTab,
1158
+ $e as useRouterTabs,
1162
1159
  Ve as useRouterTabsPersistence,
1163
1160
  an as useStatusTab
1164
1161
  };