vue3-router-tab 1.1.0 → 1.1.1

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,115 +1,7 @@
1
1
  import './vue3-router-tab.css';
2
- import { defineComponent as te, inject as z, computed as P, unref as $e, provide as U, ref as B, watch as E, h as Ke, getCurrentInstance as ne, reactive as _e, shallowRef as Ie, nextTick as ae, onMounted as Q, onBeforeUnmount as Ve, resolveComponent as Oe, createElementBlock as A, openBlock as w, createElementVNode as $, createCommentVNode as K, renderSlot as ie, createVNode as D, TransitionGroup as Ne, mergeProps as q, withCtx as L, Fragment as se, renderList as le, withModifiers as j, normalizeClass as re, createTextVNode as De, toDisplayString as ce, Transition as ue, createBlock as W, KeepAlive as Le, resolveDynamicComponent as fe, normalizeStyle as je } from "vue";
3
- /*!
4
- * vue-router v4.5.1
5
- * (c) 2025 Eduardo San Martin Morote
6
- * @license MIT
7
- */
8
- const Me = typeof document < "u", Ue = Object.assign, ze = Array.isArray;
9
- function Be(e) {
10
- const t = Array.from(arguments).slice(1);
11
- console.warn.apply(console, ["[Vue Router warn]: " + e].concat(t));
12
- }
13
- function Ge(e, t) {
14
- return (e.aliasOf || e) === (t.aliasOf || t);
15
- }
16
- var de;
17
- (function(e) {
18
- e.pop = "pop", e.push = "push";
19
- })(de || (de = {}));
20
- var pe;
21
- (function(e) {
22
- e.back = "back", e.forward = "forward", e.unknown = "";
23
- })(pe || (pe = {}));
24
- Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
25
- var be;
26
- (function(e) {
27
- e[e.aborted = 4] = "aborted", e[e.cancelled = 8] = "cancelled", e[e.duplicated = 16] = "duplicated";
28
- })(be || (be = {}));
29
- const Je = Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : ""), ve = Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
30
- Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
31
- Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
32
- const me = Symbol(process.env.NODE_ENV !== "production" ? "router view location" : ""), He = /* @__PURE__ */ te({
33
- name: "RouterView",
34
- // #674 we manually inherit them
35
- inheritAttrs: !1,
36
- props: {
37
- name: {
38
- type: String,
39
- default: "default"
40
- },
41
- route: Object
42
- },
43
- // Better compat for @vue/compat users
44
- // https://github.com/vuejs/router/issues/1315
45
- compatConfig: { MODE: 3 },
46
- setup(e, { attrs: t, slots: o }) {
47
- process.env.NODE_ENV !== "production" && qe();
48
- const n = z(me), s = P(() => e.route || n.value), p = z(ve, 0), d = P(() => {
49
- let b = $e(p);
50
- const { matched: v } = s.value;
51
- let m;
52
- for (; (m = v[b]) && !m.components; )
53
- b++;
54
- return b;
55
- }), l = P(() => s.value.matched[d.value]);
56
- U(ve, P(() => d.value + 1)), U(Je, l), U(me, s);
57
- const r = B();
58
- return E(() => [r.value, l.value, e.name], ([b, v, m], [k, h, T]) => {
59
- v && (v.instances[m] = b, h && h !== v && b && b === k && (v.leaveGuards.size || (v.leaveGuards = h.leaveGuards), v.updateGuards.size || (v.updateGuards = h.updateGuards))), b && v && // if there is no instance but to and from are the same this might be
60
- // the first visit
61
- (!h || !Ge(v, h) || !k) && (v.enterCallbacks[m] || []).forEach((_) => _(b));
62
- }, { flush: "post" }), () => {
63
- const b = s.value, v = e.name, m = l.value, k = m && m.components[v];
64
- if (!k)
65
- return he(o.default, { Component: k, route: b });
66
- const h = m.props[v], T = h ? h === !0 ? b.params : typeof h == "function" ? h(b) : h : null, R = Ke(k, Ue({}, T, t, {
67
- onVnodeUnmounted: (x) => {
68
- x.component.isUnmounted && (m.instances[v] = null);
69
- },
70
- ref: r
71
- }));
72
- if (process.env.NODE_ENV !== "production" && Me && R.ref) {
73
- const x = {
74
- depth: d.value,
75
- name: m.name,
76
- path: m.path,
77
- meta: m.meta
78
- };
79
- (ze(R.ref) ? R.ref.map((S) => S.i) : [R.ref.i]).forEach((S) => {
80
- S.__vrv_devtools = x;
81
- });
82
- }
83
- return (
84
- // pass the vnode to the slot as a prop.
85
- // h and <component :is="..."> both accept vnodes
86
- he(o.default, { Component: R, route: b }) || R
87
- );
88
- };
89
- }
90
- });
91
- function he(e, t) {
92
- if (!e)
93
- return null;
94
- const o = e(t);
95
- return o.length === 1 ? o[0] : o;
96
- }
97
- const Ye = He;
98
- function qe() {
99
- const e = ne(), t = e.parent && e.parent.type.name, o = e.parent && e.parent.subTree && e.parent.subTree.type;
100
- if (t && (t === "KeepAlive" || t.includes("Transition")) && typeof o == "object" && o.name === "RouterView") {
101
- const n = t === "KeepAlive" ? "keep-alive" : "transition";
102
- Be(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
103
- Use slot props instead:
104
-
105
- <router-view v-slot="{ Component }">
106
- <${n}>
107
- <component :is="Component" />
108
- </${n}>
109
- </router-view>`);
110
- }
111
- }
112
- function We(e = {}) {
2
+ import { reactive as me, ref as Q, shallowRef as Ae, computed as K, watch as P, nextTick as ie, inject as oe, getCurrentInstance as ye, onMounted as Z, defineComponent as ge, provide as _e, onBeforeUnmount as Pe, resolveComponent as xe, createElementBlock as g, openBlock as m, createElementVNode as R, createCommentVNode as w, renderSlot as H, createVNode as E, TransitionGroup as $e, mergeProps as j, withCtx as z, Fragment as Y, renderList as ae, withModifiers as O, normalizeClass as le, createTextVNode as Ie, toDisplayString as se, normalizeProps as Ke, Transition as re, createBlock as q, KeepAlive as Se, resolveDynamicComponent as ce, normalizeStyle as Le } from "vue";
3
+ import { RouterView as Me } from "vue-router";
4
+ function Ee(e = {}) {
113
5
  return {
114
6
  initialTabs: e.initialTabs ?? [],
115
7
  keepAlive: e.keepAlive ?? !0,
@@ -119,79 +11,79 @@ function We(e = {}) {
119
11
  defaultRoute: e.defaultRoute ?? "/"
120
12
  };
121
13
  }
122
- function I(e, t) {
123
- const o = e.resolve(t);
14
+ function A(e, n) {
15
+ const o = e.resolve(n);
124
16
  if (!o || !o.matched.length)
125
- throw new Error(`[RouterTabs] Unable to resolve route: ${String(t)}`);
17
+ throw new Error(`[RouterTabs] Unable to resolve route: ${String(n)}`);
126
18
  return o;
127
19
  }
128
- const Xe = {
20
+ const je = {
129
21
  path: (e) => e.path,
130
22
  fullpath: (e) => e.fullPath,
131
23
  fullname: (e) => e.fullPath,
132
24
  full: (e) => e.fullPath,
133
25
  name: (e) => e.name ? String(e.name) : e.fullPath
134
26
  };
135
- function V(e) {
136
- const t = e.meta?.key;
137
- if (typeof t == "function") {
138
- const o = t(e);
27
+ function _(e) {
28
+ const n = e.meta?.key;
29
+ if (typeof n == "function") {
30
+ const o = n(e);
139
31
  if (typeof o == "string" && o.length) return o;
140
- } else if (typeof t == "string" && t.length) {
141
- const o = Xe[t.toLowerCase()];
142
- return o ? o(e) : t;
32
+ } else if (typeof n == "string" && n.length) {
33
+ const o = je[n.toLowerCase()];
34
+ return o ? o(e) : n;
143
35
  }
144
36
  return e.fullPath;
145
37
  }
146
- function Z(e, t) {
38
+ function ee(e, n) {
147
39
  const o = e.meta?.keepAlive;
148
- return typeof o == "boolean" ? o : t;
40
+ return typeof o == "boolean" ? o : n;
149
41
  }
150
- function ee(e, t) {
42
+ function te(e, n) {
151
43
  const o = e.meta?.reuse;
152
- return typeof o == "boolean" ? o : t;
44
+ return typeof o == "boolean" ? o : n;
153
45
  }
154
- function Ae(e) {
155
- const t = e.meta ?? {}, o = {};
156
- return "title" in t && (o.title = t.title), "tips" in t && (o.tips = t.tips), "icon" in t && (o.icon = t.icon), "closable" in t && (o.closable = t.closable), "tabClass" in t && (o.tabClass = t.tabClass), "target" in t && (o.target = t.target), "href" in t && (o.href = t.href), o;
46
+ function Te(e) {
47
+ const n = e.meta ?? {}, o = {};
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;
157
49
  }
158
- function M(e, t, o) {
159
- const n = Ae(e);
50
+ function V(e, n, o) {
51
+ const t = Te(e);
160
52
  return {
161
- id: V(e),
53
+ id: _(e),
162
54
  to: e.fullPath,
163
55
  fullPath: e.fullPath,
164
56
  matched: e,
165
- alive: Z(e, o),
166
- reusable: ee(e, !1),
167
- closable: n.closable ?? !0,
168
- ...n,
169
- ...t
57
+ alive: ee(e, o),
58
+ reusable: te(e, !1),
59
+ closable: t.closable ?? !0,
60
+ ...t,
61
+ ...n
170
62
  };
171
63
  }
172
- function X(e, t, o, n) {
173
- if (!e.find((p) => p.id === t.id)) {
174
- if (o === "next" && n) {
175
- const p = e.findIndex((d) => d.id === n);
176
- if (p > -1) {
177
- e.splice(p + 1, 0, t);
64
+ function W(e, n, o, t) {
65
+ if (!e.find((d) => d.id === n.id)) {
66
+ if (o === "next" && t) {
67
+ const d = e.findIndex((b) => b.id === t);
68
+ if (d > -1) {
69
+ e.splice(d + 1, 0, n);
178
70
  return;
179
71
  }
180
72
  }
181
- e.push(t);
73
+ e.push(n);
182
74
  }
183
75
  }
184
- function ye(e, t, o) {
185
- if (!t || t <= 0) return;
186
- const n = e.filter((s) => s.alive);
187
- for (; n.length > t; ) {
188
- const s = n.shift();
189
- if (!s || s.id === o) continue;
190
- const p = e.findIndex((d) => d.id === s.id);
191
- p > -1 && (e[p].alive = !1);
76
+ function ue(e, n, o) {
77
+ if (!n || n <= 0) return;
78
+ const t = e.filter((r) => r.alive);
79
+ for (; t.length > n; ) {
80
+ const r = t.shift();
81
+ if (!r || r.id === o) continue;
82
+ const d = e.findIndex((b) => b.id === r.id);
83
+ d > -1 && (e[d].alive = !1);
192
84
  }
193
85
  }
194
- function Fe(e) {
86
+ function ze(e) {
195
87
  return {
196
88
  to: e.to,
197
89
  title: e.title,
@@ -201,173 +93,173 @@ function Fe(e) {
201
93
  closable: e.closable
202
94
  };
203
95
  }
204
- function Qe(e) {
205
- const t = {};
206
- return "title" in e && (t.title = e.title), "tips" in e && (t.tips = e.tips), "icon" in e && (t.icon = e.icon), "tabClass" in e && (t.tabClass = e.tabClass), "closable" in e && (t.closable = e.closable), t;
96
+ function Oe(e) {
97
+ const n = {};
98
+ 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), n;
207
99
  }
208
- function Ze(e, t = {}) {
209
- const o = We(t), n = _e([]), s = B(null), p = Ie(), d = B(null), l = P(() => n.filter((i) => i.alive).map((i) => i.id));
210
- let r = !1;
211
- function b(i) {
212
- const c = typeof i.matched == "object" ? i : I(e, i);
100
+ function Ve(e, n = {}) {
101
+ const o = Ee(n), t = me([]), r = Q(null), d = Ae(), b = Q(null), l = K(() => t.filter((a) => a.alive).map((a) => a.id));
102
+ let u = !1;
103
+ function T(a) {
104
+ const s = typeof a.matched == "object" ? a : A(e, a);
213
105
  return {
214
- key: V(c),
215
- fullPath: c.fullPath,
216
- alive: Z(c, o.keepAlive),
217
- reusable: ee(c, !1),
218
- matched: c
106
+ key: _(s),
107
+ fullPath: s.fullPath,
108
+ alive: ee(s, o.keepAlive),
109
+ reusable: te(s, !1),
110
+ matched: s
219
111
  };
220
112
  }
221
- function v(i) {
222
- const c = V(i);
223
- let u = n.find((y) => y.id === c);
224
- return u ? (u.fullPath = i.fullPath, u.to = i.fullPath, u.matched = i, u.alive = Z(i, o.keepAlive), u.reusable = ee(i, u.reusable), Object.assign(u, Ae(i)), u) : (u = M(i, {}, o.keepAlive), X(n, u, o.appendPosition, s.value), ye(n, o.maxAlive, s.value), u);
113
+ function C(a) {
114
+ const s = _(a);
115
+ let c = t.find((p) => p.id === s);
116
+ return c ? (c.fullPath = a.fullPath, c.to = a.fullPath, c.matched = a, c.alive = ee(a, o.keepAlive), c.reusable = te(a, c.reusable), Object.assign(c, Te(a)), c) : (c = V(a, {}, o.keepAlive), W(t, c, o.appendPosition, r.value), ue(t, o.maxAlive, r.value), c);
225
117
  }
226
- async function m(i, c = !1, u = !0) {
227
- const y = I(e, i), a = V(y), f = s.value === a;
228
- u === "sameTab" && (u = f), u && await _(a, !0), await e[c ? "replace" : "push"](y), f && await O();
118
+ async function S(a, s = !1, c = !0) {
119
+ const p = A(e, a), k = _(p), i = r.value === k;
120
+ c === "sameTab" && (c = i), c && await v(k, !0), await e[s ? "replace" : "push"](p), i && await $();
229
121
  }
230
- function k(i) {
231
- const c = n.findIndex((y) => y.id === i), u = n[c] || n[c - 1] || n[0];
232
- return u ? u.to : o.defaultRoute;
122
+ function L(a) {
123
+ const s = t.findIndex((p) => p.id === a), c = t[s] || t[s - 1] || t[0];
124
+ return c ? c.to : o.defaultRoute;
233
125
  }
234
- async function h(i = s.value, c = {}) {
235
- if (i) {
236
- if (!c.force && o.keepLastTab && n.length === 1)
126
+ async function x(a = r.value, s = {}) {
127
+ if (a) {
128
+ if (!s.force && o.keepLastTab && t.length === 1)
237
129
  throw new Error("[RouterTabs] Unable to close the final tab when keepLastTab is true.");
238
- if (await T(i, { force: c.force }), c.redirect !== null)
239
- if (s.value === i) {
240
- const u = c.redirect ?? k(i);
241
- u && await e.replace(u);
242
- } else c.redirect && await e.replace(c.redirect);
130
+ if (await M(a, { force: s.force }), s.redirect !== null)
131
+ if (r.value === a) {
132
+ const c = s.redirect ?? L(a);
133
+ c && await e.replace(c);
134
+ } else s.redirect && await e.replace(s.redirect);
243
135
  }
244
136
  }
245
- async function T(i, c = {}) {
246
- const u = n.findIndex((y) => y.id === i);
247
- u !== -1 && (n.splice(u, 1), d.value === i && (d.value = null), s.value === i && (s.value = null, p.value = void 0));
137
+ async function M(a, s = {}) {
138
+ const c = t.findIndex((p) => p.id === a);
139
+ c !== -1 && (t.splice(c, 1), b.value === a && (b.value = null), r.value === a && (r.value = null, d.value = void 0));
248
140
  }
249
- async function _(i = s.value ?? void 0, c = !1) {
250
- i && (d.value = i, await ae(), c || await ae(), d.value = null);
141
+ async function v(a = r.value ?? void 0, s = !1) {
142
+ a && (b.value = a, await ie(), s || await ie(), b.value = null);
251
143
  }
252
- async function R(i = !1) {
253
- for (const c of n)
254
- await _(c.id, i);
144
+ async function N(a = !1) {
145
+ for (const s of t)
146
+ await v(s.id, a);
255
147
  }
256
- async function x(i = o.defaultRoute) {
257
- n.splice(0, n.length), s.value = null, p.value = void 0;
258
- for (const c of o.initialTabs) {
259
- const u = I(e, c.to), y = M(u, c, o.keepAlive);
260
- n.push(y);
148
+ async function U(a = o.defaultRoute) {
149
+ t.splice(0, t.length), r.value = null, d.value = void 0;
150
+ for (const s of o.initialTabs) {
151
+ const c = A(e, s.to), p = V(c, s, o.keepAlive);
152
+ t.push(p);
261
153
  }
262
- await e.replace(i);
154
+ await e.replace(a);
263
155
  }
264
- async function O() {
265
- const i = s.value;
266
- i && await _(i, !0);
156
+ async function $() {
157
+ const a = r.value;
158
+ a && await v(a, !0);
267
159
  }
268
- function S(i) {
269
- return typeof i.matched == "object" ? V(i) : V(I(e, i));
160
+ function B(a) {
161
+ return typeof a.matched == "object" ? _(a) : _(A(e, a));
270
162
  }
271
- function N() {
272
- const i = n.find((c) => c.id === s.value);
163
+ function F() {
164
+ const a = t.find((s) => s.id === r.value);
273
165
  return {
274
- tabs: n.map(Fe),
275
- active: i ? i.to : null
166
+ tabs: t.map(ze),
167
+ active: a ? a.to : null
276
168
  };
277
169
  }
278
- async function J(i) {
279
- r = !0, n.splice(0, n.length), s.value = null, p.value = void 0;
280
- const c = i?.tabs ?? [];
281
- for (const y of c)
170
+ async function I(a) {
171
+ u = !0, t.splice(0, t.length), r.value = null, d.value = void 0;
172
+ const s = a?.tabs ?? [];
173
+ for (const p of s)
282
174
  try {
283
- const a = I(e, y.to), f = Qe(y), g = M(a, f, o.keepAlive);
284
- X(n, g, "last", null);
175
+ const k = A(e, p.to), i = Oe(p), f = V(k, i, o.keepAlive);
176
+ W(t, f, "last", null);
285
177
  } catch {
286
178
  }
287
- r = !1;
288
- const u = i?.active ?? c[c.length - 1]?.to ?? o.defaultRoute;
289
- if (u)
179
+ u = !1;
180
+ const c = a?.active ?? s[s.length - 1]?.to ?? o.defaultRoute;
181
+ if (c)
290
182
  try {
291
- await e.replace(u);
183
+ await e.replace(c);
292
184
  } catch {
293
185
  }
294
186
  }
295
- return E(
187
+ return P(
296
188
  () => e.currentRoute.value,
297
- (i) => {
298
- if (r) return;
299
- const c = v(i);
300
- s.value = c.id, p.value = c, ye(n, o.maxAlive, s.value);
189
+ (a) => {
190
+ if (u) return;
191
+ const s = C(a);
192
+ r.value = s.id, d.value = s, ue(t, o.maxAlive, r.value);
301
193
  },
302
194
  { immediate: !0 }
303
- ), o.initialTabs.length && o.initialTabs.forEach((i) => {
304
- const c = I(e, i.to), u = M(c, i, o.keepAlive);
305
- X(n, u, "last", null);
195
+ ), o.initialTabs.length && o.initialTabs.forEach((a) => {
196
+ const s = A(e, a.to), c = V(s, a, o.keepAlive);
197
+ W(t, c, "last", null);
306
198
  }), {
307
199
  options: o,
308
- tabs: n,
309
- activeId: s,
310
- current: p,
200
+ tabs: t,
201
+ activeId: r,
202
+ current: d,
311
203
  includeKeys: l,
312
- refreshingKey: d,
313
- openTab: m,
314
- closeTab: h,
315
- removeTab: T,
316
- refreshTab: _,
317
- refreshAll: R,
318
- reset: x,
319
- reload: O,
320
- getRouteKey: S,
321
- matchRoute: b,
322
- snapshot: N,
323
- hydrate: J
204
+ refreshingKey: b,
205
+ openTab: S,
206
+ closeTab: x,
207
+ removeTab: M,
208
+ refreshTab: v,
209
+ refreshAll: N,
210
+ reset: U,
211
+ reload: $,
212
+ getRouteKey: B,
213
+ matchRoute: T,
214
+ snapshot: F,
215
+ hydrate: I
324
216
  };
325
217
  }
326
- function ge(e) {
218
+ function fe(e) {
327
219
  return e ? typeof e == "string" ? { name: e } : e : {};
328
220
  }
329
- const G = Symbol("RouterTabsContext"), et = "router-tabs:snapshot";
330
- function Te(e = {}) {
331
- const { optional: t = !1 } = e, o = z(G, null);
221
+ const D = Symbol("RouterTabsContext"), De = "router-tabs:snapshot";
222
+ function de(e = {}) {
223
+ const { optional: n = !1 } = e, o = oe(D, null);
332
224
  if (o) return o;
333
- const n = z("$tabs", null);
334
- if (n) return n;
335
- const p = ne()?.appContext.config.globalProperties.$tabs;
336
- if (p) return p;
337
- if (!t)
225
+ const t = oe("$tabs", null);
226
+ if (t) return t;
227
+ const d = ye()?.appContext.config.globalProperties.$tabs;
228
+ if (d) return d;
229
+ if (!n)
338
230
  throw new Error("[RouterTabs] useRouterTabs must be used within <router-tab>.");
339
231
  return null;
340
232
  }
341
- const tt = 864e5;
342
- function nt(e) {
233
+ const Ne = 864e5;
234
+ function Ue(e) {
343
235
  if (typeof document > "u") return null;
344
- const t = `${encodeURIComponent(e)}=`, o = document.cookie ? document.cookie.split("; ") : [];
345
- for (const n of o)
346
- if (n.startsWith(t))
347
- return decodeURIComponent(n.slice(t.length));
236
+ const n = `${encodeURIComponent(e)}=`, o = document.cookie ? document.cookie.split("; ") : [];
237
+ for (const t of o)
238
+ if (t.startsWith(n))
239
+ return decodeURIComponent(t.slice(n.length));
348
240
  return null;
349
241
  }
350
- function ke(e, t, o) {
242
+ function be(e, n, o) {
351
243
  if (typeof document > "u") return;
352
244
  const {
353
- expiresInDays: n = 7,
354
- path: s = "/",
355
- domain: p,
356
- secure: d,
245
+ expiresInDays: t = 7,
246
+ path: r = "/",
247
+ domain: d,
248
+ secure: b,
357
249
  sameSite: l = "lax"
358
- } = o, r = [`${encodeURIComponent(e)}=${encodeURIComponent(t)}`];
359
- if (n !== 1 / 0) {
360
- const b = new Date(Date.now() + n * tt).toUTCString();
361
- r.push(`Expires=${b}`);
250
+ } = o, u = [`${encodeURIComponent(e)}=${encodeURIComponent(n)}`];
251
+ if (t !== 1 / 0) {
252
+ const T = new Date(Date.now() + t * Ne).toUTCString();
253
+ u.push(`Expires=${T}`);
362
254
  }
363
- s && r.push(`Path=${s}`), p && r.push(`Domain=${p}`), d && r.push("Secure"), l && r.push(`SameSite=${l.charAt(0).toUpperCase()}${l.slice(1)}`), document.cookie = r.join("; ");
255
+ r && u.push(`Path=${r}`), d && u.push(`Domain=${d}`), b && u.push("Secure"), l && u.push(`SameSite=${l.charAt(0).toUpperCase()}${l.slice(1)}`), document.cookie = u.join("; ");
364
256
  }
365
- function we(e, t) {
257
+ function pe(e, n) {
366
258
  if (typeof document > "u") return;
367
- const { path: o = "/", domain: n } = t, s = [`${encodeURIComponent(e)}=`];
368
- s.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && s.push(`Path=${o}`), n && s.push(`Domain=${n}`), document.cookie = s.join("; ");
259
+ const { path: o = "/", domain: t } = n, r = [`${encodeURIComponent(e)}=`];
260
+ r.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && r.push(`Path=${o}`), t && r.push(`Domain=${t}`), document.cookie = r.join("; ");
369
261
  }
370
- const ot = (e) => JSON.stringify(e ?? null), at = (e) => {
262
+ const Be = (e) => JSON.stringify(e ?? null), Fe = (e) => {
371
263
  if (!e) return null;
372
264
  try {
373
265
  return JSON.parse(e);
@@ -375,58 +267,58 @@ const ot = (e) => JSON.stringify(e ?? null), at = (e) => {
375
267
  return null;
376
268
  }
377
269
  };
378
- function xe(e = {}) {
270
+ function ke(e = {}) {
379
271
  const {
380
- cookieKey: t = et,
381
- serialize: o = ot,
382
- deserialize: n = at
383
- } = e, s = Te({ optional: !0 }), p = B(!1), d = (l) => {
384
- Q(async () => {
385
- const r = n(nt(t));
386
- if (r && r.tabs?.length)
272
+ cookieKey: n = De,
273
+ serialize: o = Be,
274
+ deserialize: t = Fe
275
+ } = e, r = de({ optional: !0 }), d = Q(!1), b = (l) => {
276
+ Z(async () => {
277
+ const u = t(Ue(n));
278
+ if (u && u.tabs?.length)
387
279
  try {
388
- p.value = !0, await l.hydrate(r);
280
+ d.value = !0, await l.hydrate(u);
389
281
  } finally {
390
- p.value = !1;
282
+ d.value = !1;
391
283
  }
392
284
  else
393
285
  try {
394
- p.value = !0;
395
- const v = e.fallbackRoute ?? l.options.defaultRoute;
396
- await l.reset(v);
286
+ d.value = !0;
287
+ const C = e.fallbackRoute ?? l.options.defaultRoute;
288
+ await l.reset(C);
397
289
  } finally {
398
- p.value = !1;
290
+ d.value = !1;
399
291
  }
400
- const b = l.snapshot();
401
- b.tabs.length ? ke(t, o(b), e) : we(t, e);
402
- }), E(
292
+ const T = l.snapshot();
293
+ T.tabs.length ? be(n, o(T), e) : pe(n, e);
294
+ }), P(
403
295
  () => ({
404
- tabs: l.tabs.map((r) => ({
405
- to: r.to,
406
- title: r.title,
407
- tips: r.tips,
408
- icon: r.icon,
409
- tabClass: r.tabClass,
410
- closable: r.closable
296
+ tabs: l.tabs.map((u) => ({
297
+ to: u.to,
298
+ title: u.title,
299
+ tips: u.tips,
300
+ icon: u.icon,
301
+ tabClass: u.tabClass,
302
+ closable: u.closable
411
303
  })),
412
304
  active: l.activeId.value
413
305
  }),
414
306
  () => {
415
- if (p.value) return;
416
- const r = l.snapshot();
417
- r.tabs.length ? ke(t, o(r), e) : we(t, e);
307
+ if (d.value) return;
308
+ const u = l.snapshot();
309
+ u.tabs.length ? be(n, o(u), e) : pe(n, e);
418
310
  },
419
311
  { deep: !0 }
420
312
  );
421
313
  };
422
- s ? d(s) : Q(() => {
423
- const l = Te({ optional: !0 });
424
- l && d(l);
314
+ r ? b(r) : Z(() => {
315
+ const l = de({ optional: !0 });
316
+ l && b(l);
425
317
  });
426
318
  }
427
- const it = te({
319
+ const Ge = ge({
428
320
  name: "RouterTab",
429
- components: { RouterView: Ye },
321
+ components: { RouterView: Me },
430
322
  props: {
431
323
  tabs: {
432
324
  type: Array,
@@ -474,13 +366,13 @@ const it = te({
474
366
  }
475
367
  },
476
368
  setup(e) {
477
- const t = ne();
478
- if (!t)
369
+ const n = ye();
370
+ if (!n)
479
371
  throw new Error("[RouterTab] component must be used within a Vue application context.");
480
- const o = t.appContext.app.config.globalProperties.$router;
372
+ const o = n.appContext.app.config.globalProperties.$router;
481
373
  if (!o)
482
374
  throw new Error("[RouterTab] Vue Router is required. Make sure to call app.use(router) before RouterTab.");
483
- const n = Ze(o, {
375
+ const t = Ve(o, {
484
376
  initialTabs: e.tabs,
485
377
  keepAlive: e.keepAlive,
486
378
  maxAlive: e.maxAlive,
@@ -488,17 +380,19 @@ const it = te({
488
380
  appendPosition: e.append,
489
381
  defaultRoute: e.defaultPage
490
382
  });
491
- if (U(G, n), t.appContext.config.globalProperties.$tabs = n, e.cookieKey || e.persistence) {
492
- const a = {
383
+ _e(D, t), n.appContext.config.globalProperties.$tabs = t;
384
+ const r = K(() => !!n?.slots?.default);
385
+ if (e.cookieKey || e.persistence) {
386
+ const i = {
493
387
  ...e.persistence ?? {}
494
388
  };
495
- e.cookieKey && (a.cookieKey = e.cookieKey), xe(a);
389
+ e.cookieKey && (i.cookieKey = e.cookieKey), ke(i);
496
390
  }
497
- const s = P(() => ge(e.tabTransition)), p = P(() => ge(e.pageTransition)), d = _e({
391
+ const d = K(() => fe(e.tabTransition)), b = K(() => fe(e.pageTransition)), l = me({
498
392
  visible: !1,
499
393
  target: null,
500
394
  position: { x: 0, y: 0 }
501
- }), l = [
395
+ }), u = [
502
396
  "refresh",
503
397
  "refreshAll",
504
398
  "close",
@@ -506,267 +400,270 @@ const it = te({
506
400
  "closeRights",
507
401
  "closeOthers"
508
402
  ];
509
- function r(a) {
510
- return n.tabs.findIndex((f) => f.id === a);
403
+ function T(i) {
404
+ return t.tabs.findIndex((f) => f.id === i);
511
405
  }
512
- function b(a) {
513
- const f = r(a.id);
514
- return f > 0 ? n.tabs.slice(0, f) : [];
406
+ function C(i) {
407
+ const f = T(i.id);
408
+ return f > 0 ? t.tabs.slice(0, f) : [];
515
409
  }
516
- function v(a) {
517
- const f = r(a.id);
518
- return f > -1 ? n.tabs.slice(f + 1) : [];
410
+ function S(i) {
411
+ const f = T(i.id);
412
+ return f > -1 ? t.tabs.slice(f + 1) : [];
519
413
  }
520
- function m(a) {
521
- return n.tabs.filter((f) => f.id !== a.id);
414
+ function L(i) {
415
+ return t.tabs.filter((f) => f.id !== i.id);
522
416
  }
523
- async function k(a, f) {
524
- const g = a.filter((C) => C.closable !== !1);
525
- if (g.length) {
526
- for (const C of g)
527
- n.activeId.value === C.id ? await n.closeTab(C.id, { redirect: f.to, force: !0 }) : await n.removeTab(C.id, { force: !0 });
528
- n.activeId.value !== f.id && await n.openTab(f.to, !0, !1);
417
+ async function x(i, f) {
418
+ const h = i.filter((y) => y.closable !== !1);
419
+ if (h.length) {
420
+ for (const y of h)
421
+ t.activeId.value === y.id ? await t.closeTab(y.id, { redirect: f.to, force: !0 }) : await t.removeTab(y.id, { force: !0 });
422
+ t.activeId.value !== f.id && await t.openTab(f.to, !0, !1);
529
423
  }
530
424
  }
531
- const h = {
425
+ const M = {
532
426
  refresh: {
533
427
  label: "Refresh",
534
- handler: async ({ target: a }) => {
535
- await n.refreshTab(a.id, !0);
428
+ handler: async ({ target: i }) => {
429
+ await t.refreshTab(i.id, !0);
536
430
  }
537
431
  },
538
432
  refreshAll: {
539
433
  label: "Refresh All",
540
434
  handler: async () => {
541
- await n.refreshAll(!0);
435
+ await t.refreshAll(!0);
542
436
  }
543
437
  },
544
438
  close: {
545
439
  label: "Close",
546
- handler: async ({ target: a }) => {
547
- await n.closeTab(a.id);
440
+ handler: async ({ target: i }) => {
441
+ await t.closeTab(i.id);
548
442
  },
549
- enable: ({ target: a }) => N(a)
443
+ enable: ({ target: i }) => I(i)
550
444
  },
551
445
  closeLefts: {
552
446
  label: "Close to the Left",
553
- handler: async ({ target: a }) => {
554
- await k(b(a), a);
447
+ handler: async ({ target: i }) => {
448
+ await x(C(i), i);
555
449
  },
556
- enable: ({ target: a }) => b(a).some((f) => f.closable !== !1)
450
+ enable: ({ target: i }) => C(i).some((f) => f.closable !== !1)
557
451
  },
558
452
  closeRights: {
559
453
  label: "Close to the Right",
560
- handler: async ({ target: a }) => {
561
- await k(v(a), a);
454
+ handler: async ({ target: i }) => {
455
+ await x(S(i), i);
562
456
  },
563
- enable: ({ target: a }) => v(a).some((f) => f.closable !== !1)
457
+ enable: ({ target: i }) => S(i).some((f) => f.closable !== !1)
564
458
  },
565
459
  closeOthers: {
566
460
  label: "Close Others",
567
- handler: async ({ target: a }) => {
568
- await k(m(a), a);
461
+ handler: async ({ target: i }) => {
462
+ await x(L(i), i);
569
463
  },
570
- enable: ({ target: a }) => m(a).some((f) => f.closable !== !1)
464
+ enable: ({ target: i }) => L(i).some((f) => f.closable !== !1)
571
465
  }
572
466
  };
573
- function T() {
574
- d.visible = !1, d.target = null;
467
+ function v() {
468
+ l.visible = !1, l.target = null;
575
469
  }
576
- function _(a, f) {
577
- e.contextmenu && (d.visible = !0, d.target = a, d.position.x = f.clientX, d.position.y = f.clientY, document.addEventListener("click", T, { once: !0 }));
470
+ function N(i, f) {
471
+ e.contextmenu && (l.visible = !0, l.target = i, l.position.x = f.clientX, l.position.y = f.clientY, document.addEventListener("click", v, { once: !0 }));
578
472
  }
579
- function R(a, f) {
580
- const g = typeof a == "string" ? { id: a } : a, C = h[g.id], Pe = g.label ?? C?.label ?? String(g.id), H = g.visible ?? C?.visible ?? !0;
581
- if (!(typeof H == "function" ? H(f) : H !== !1)) return null;
582
- const Y = g.enable ?? C?.enable ?? !0, Se = typeof Y == "function" ? Y(f) : Y !== !1, oe = g.handler ?? C?.handler;
583
- if (!oe) return null;
584
- const Ee = async () => {
585
- await Promise.resolve(oe(f));
473
+ function U(i, f) {
474
+ const h = typeof i == "string" ? { id: i } : i, y = M[h.id], Ce = h.label ?? y?.label ?? String(h.id), G = h.visible ?? y?.visible ?? !0;
475
+ if (!(typeof G == "function" ? G(f) : G !== !1)) return null;
476
+ const J = h.enable ?? y?.enable ?? !0, Re = typeof J == "function" ? J(f) : J !== !1, ne = h.handler ?? y?.handler;
477
+ if (!ne) return null;
478
+ const we = async () => {
479
+ await Promise.resolve(ne(f));
586
480
  };
587
481
  return {
588
- id: String(g.id),
589
- label: Pe,
590
- disabled: !Se,
591
- action: Ee
482
+ id: String(h.id),
483
+ label: Ce,
484
+ disabled: !Re,
485
+ action: we
592
486
  };
593
487
  }
594
- const x = P(() => {
595
- if (!d.visible || !d.target || e.contextmenu === !1) return [];
596
- const a = Array.isArray(e.contextmenu) ? e.contextmenu : l, f = { target: d.target, controller: n };
597
- return a.map((g) => R(g, f)).filter((g) => !!g);
488
+ const $ = K(() => {
489
+ if (!l.visible || !l.target || e.contextmenu === !1) return [];
490
+ const i = Array.isArray(e.contextmenu) ? e.contextmenu : u, f = { target: l.target, controller: t };
491
+ return i.map((h) => U(h, f)).filter((h) => !!h);
598
492
  });
599
- async function O(a) {
600
- a.disabled || (T(), await a.action());
493
+ async function B(i) {
494
+ i.disabled || (v(), await i.action());
601
495
  }
602
- function S(a) {
603
- return typeof a.title == "string" ? a.title : Array.isArray(a.title) && a.title.length ? String(a.title[0]) : a.fullPath;
496
+ function F(i) {
497
+ return typeof i.title == "string" ? i.title : Array.isArray(i.title) && i.title.length ? String(i.title[0]) : i.fullPath;
604
498
  }
605
- function N(a) {
606
- return !(a.closable === !1 || n.options.keepLastTab && n.tabs.length <= 1);
499
+ function I(i) {
500
+ return !(i.closable === !1 || t.options.keepLastTab && t.tabs.length <= 1);
607
501
  }
608
- async function J(a) {
609
- await n.closeTab(a.id);
502
+ async function a(i) {
503
+ await t.closeTab(i.id);
610
504
  }
611
- function i(a) {
612
- n.activeId.value !== a.id && n.openTab(a.to, !1);
505
+ function s(i) {
506
+ t.activeId.value !== i.id && t.openTab(i.to, !1);
613
507
  }
614
- function c(a) {
508
+ function c(i) {
615
509
  return [
616
510
  "router-tab__item",
617
511
  {
618
- "is-active": n.activeId.value === a.id,
619
- "is-closable": N(a)
512
+ "is-active": t.activeId.value === i.id,
513
+ "is-closable": I(i)
620
514
  },
621
- a.tabClass
515
+ i.tabClass
622
516
  ];
623
517
  }
624
- function u(a) {
625
- return n.refreshingKey.value === n.getRouteKey(a);
518
+ function p(i) {
519
+ return t.refreshingKey.value === t.getRouteKey(i);
626
520
  }
627
- Q(() => {
628
- document.addEventListener("keydown", T);
629
- }), Ve(() => {
630
- document.removeEventListener("keydown", T), t.appContext.config.globalProperties.$tabs = null;
631
- }), E(
521
+ Z(() => {
522
+ document.addEventListener("keydown", v);
523
+ }), Pe(() => {
524
+ document.removeEventListener("keydown", v), n.appContext.config.globalProperties.$tabs = null;
525
+ }), P(
632
526
  () => e.keepAlive,
633
- (a) => {
634
- n.options.keepAlive = a;
527
+ (i) => {
528
+ t.options.keepAlive = i;
635
529
  }
636
- ), E(
637
- () => n.activeId.value,
638
- () => T()
639
- ), E(
530
+ ), P(
531
+ () => t.activeId.value,
532
+ () => v()
533
+ ), P(
640
534
  () => e.contextmenu,
641
- (a) => {
642
- a || T();
535
+ (i) => {
536
+ i || v();
643
537
  }
644
- ), E(
645
- () => x.value.length,
646
- (a) => {
647
- d.visible && a === 0 && T();
538
+ ), P(
539
+ () => $.value.length,
540
+ (i) => {
541
+ l.visible && i === 0 && v();
648
542
  }
649
543
  );
650
- const y = n.includeKeys;
544
+ const k = t.includeKeys;
651
545
  return {
652
- controller: n,
653
- tabs: n.tabs,
654
- includeKeys: y,
655
- tabTransitionProps: s,
656
- pageTransitionProps: p,
546
+ controller: t,
547
+ tabs: t.tabs,
548
+ includeKeys: k,
549
+ tabTransitionProps: d,
550
+ pageTransitionProps: b,
657
551
  buildTabClass: c,
658
- activate: i,
659
- close: J,
660
- context: d,
661
- menuItems: x,
662
- handleMenuAction: O,
663
- showContextMenu: _,
664
- hideContextMenu: T,
665
- tabTitle: S,
666
- isClosable: N,
667
- isRefreshing: u
552
+ activate: s,
553
+ close: a,
554
+ context: l,
555
+ menuItems: $,
556
+ handleMenuAction: B,
557
+ showContextMenu: N,
558
+ hideContextMenu: v,
559
+ tabTitle: F,
560
+ isClosable: I,
561
+ isRefreshing: p,
562
+ hasCustomSlot: r
668
563
  };
669
564
  }
670
- }), st = (e, t) => {
565
+ }), Je = (e, n) => {
671
566
  const o = e.__vccOpts || e;
672
- for (const [n, s] of t)
673
- o[n] = s;
567
+ for (const [t, r] of n)
568
+ o[t] = r;
674
569
  return o;
675
- }, lt = { class: "router-tab" }, rt = { class: "router-tab__header" }, ct = { class: "router-tab__slot-start" }, ut = { class: "router-tab__scroll" }, ft = ["onClick", "onAuxclick", "onContextmenu"], dt = ["title"], pt = ["onClick"], bt = { class: "router-tab__slot-end" }, vt = { class: "router-tab__container" }, mt = ["aria-disabled", "onClick"];
676
- function ht(e, t, o, n, s, p) {
677
- const d = Oe("RouterView");
678
- return w(), A("div", lt, [
679
- $("header", rt, [
680
- $("div", ct, [
681
- ie(e.$slots, "start")
570
+ }, He = { class: "router-tab" }, Ye = { class: "router-tab__header" }, qe = { class: "router-tab__slot-start" }, We = { class: "router-tab__scroll" }, Xe = ["onClick", "onAuxclick", "onContextmenu"], Qe = ["title"], Ze = ["onClick"], et = { class: "router-tab__slot-end" }, tt = { class: "router-tab__container" }, nt = ["aria-disabled", "onClick"];
571
+ function it(e, n, o, t, r, d) {
572
+ const b = xe("RouterView");
573
+ return m(), g("div", He, [
574
+ R("header", Ye, [
575
+ R("div", qe, [
576
+ H(e.$slots, "start")
682
577
  ]),
683
- $("div", ut, [
684
- D(Ne, q({
578
+ R("div", We, [
579
+ E($e, j({
685
580
  tag: "ul",
686
581
  class: "router-tab__nav"
687
582
  }, e.tabTransitionProps), {
688
- default: L(() => [
689
- (w(!0), A(se, null, le(e.tabs, (l) => (w(), A("li", {
583
+ default: z(() => [
584
+ (m(!0), g(Y, null, ae(e.tabs, (l) => (m(), g("li", {
690
585
  key: l.id,
691
- class: re(e.buildTabClass(l)),
692
- onClick: (r) => e.activate(l),
693
- onAuxclick: j((r) => e.close(l), ["middle", "prevent"]),
694
- onContextmenu: j((r) => e.showContextMenu(l, r), ["prevent"])
586
+ class: le(e.buildTabClass(l)),
587
+ onClick: (u) => e.activate(l),
588
+ onAuxclick: O((u) => e.close(l), ["middle", "prevent"]),
589
+ onContextmenu: O((u) => e.showContextMenu(l, u), ["prevent"])
695
590
  }, [
696
- $("span", {
591
+ R("span", {
697
592
  class: "router-tab__item-title",
698
593
  title: e.tabTitle(l)
699
594
  }, [
700
- l.icon ? (w(), A("i", {
595
+ l.icon ? (m(), g("i", {
701
596
  key: 0,
702
- class: re(["router-tab__item-icon", l.icon])
703
- }, null, 2)) : K("", !0),
704
- De(" " + ce(e.tabTitle(l)), 1)
705
- ], 8, dt),
706
- e.isClosable(l) ? (w(), A("a", {
597
+ class: le(["router-tab__item-icon", l.icon])
598
+ }, null, 2)) : w("", !0),
599
+ Ie(" " + se(e.tabTitle(l)), 1)
600
+ ], 8, Qe),
601
+ e.isClosable(l) ? (m(), g("a", {
707
602
  key: 0,
708
603
  class: "router-tab__item-close",
709
604
  type: "button",
710
- onClick: j((r) => e.close(l), ["stop"])
711
- }, null, 8, pt)) : K("", !0)
712
- ], 42, ft))), 128))
605
+ onClick: O((u) => e.close(l), ["stop"])
606
+ }, null, 8, Ze)) : w("", !0)
607
+ ], 42, Xe))), 128))
713
608
  ]),
714
609
  _: 1
715
610
  }, 16)
716
611
  ]),
717
- $("div", bt, [
718
- ie(e.$slots, "end")
612
+ R("div", et, [
613
+ H(e.$slots, "end")
719
614
  ])
720
615
  ]),
721
- $("div", vt, [
722
- D(d, null, {
723
- default: L(({ Component: l, route: r }) => [
724
- D(ue, q(e.pageTransitionProps, { appear: "" }), {
725
- default: L(() => [
726
- e.controller.options.keepAlive ? (w(), W(Le, {
727
- key: 0,
728
- include: e.includeKeys,
729
- max: e.controller.options.maxAlive || void 0
730
- }, [
731
- e.isRefreshing(r) ? K("", !0) : (w(), W(fe(l), {
732
- key: e.controller.getRouteKey(r),
616
+ R("div", tt, [
617
+ E(b, null, {
618
+ default: z((l) => [
619
+ e.hasCustomSlot ? H(e.$slots, "default", Ke(j({ key: 0 }, { ...l, controller: e.controller }))) : (m(), g(Y, { key: 1 }, [
620
+ E(re, j(e.pageTransitionProps, { appear: "" }), {
621
+ default: z(() => [
622
+ e.controller.options.keepAlive ? (m(), q(Se, {
623
+ key: 0,
624
+ include: e.includeKeys,
625
+ max: e.controller.options.maxAlive || void 0
626
+ }, [
627
+ e.isRefreshing(l.route) ? w("", !0) : (m(), q(ce(l.Component), {
628
+ key: e.controller.getRouteKey(l.route),
629
+ class: "router-tab-page"
630
+ }))
631
+ ], 1032, ["include", "max"])) : w("", !0)
632
+ ]),
633
+ _: 2
634
+ }, 1040),
635
+ E(re, j(e.pageTransitionProps, { appear: "" }), {
636
+ default: z(() => [
637
+ !e.controller.options.keepAlive || e.isRefreshing(l.route) ? (m(), q(ce(l.Component), {
638
+ key: e.controller.getRouteKey(l.route) + (e.isRefreshing(l.route) ? "-refresh" : ""),
733
639
  class: "router-tab-page"
734
- }))
735
- ], 1032, ["include", "max"])) : K("", !0)
736
- ]),
737
- _: 2
738
- }, 1040),
739
- D(ue, q(e.pageTransitionProps, { appear: "" }), {
740
- default: L(() => [
741
- !e.controller.options.keepAlive || e.isRefreshing(r) ? (w(), W(fe(l), {
742
- key: e.controller.getRouteKey(r) + (e.isRefreshing(r) ? "-refresh" : ""),
743
- class: "router-tab-page"
744
- })) : K("", !0)
745
- ]),
746
- _: 2
747
- }, 1040)
640
+ })) : w("", !0)
641
+ ]),
642
+ _: 2
643
+ }, 1040)
644
+ ], 64))
748
645
  ]),
749
- _: 1
646
+ _: 3
750
647
  })
751
648
  ]),
752
- e.context.visible && e.context.target ? (w(), A("div", {
649
+ e.context.visible && e.context.target ? (m(), g("div", {
753
650
  key: 0,
754
651
  class: "router-tab__contextmenu",
755
- style: je({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
652
+ style: Le({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
756
653
  }, [
757
- (w(!0), A(se, null, le(e.menuItems, (l) => (w(), A("a", {
654
+ (m(!0), g(Y, null, ae(e.menuItems, (l) => (m(), g("a", {
758
655
  key: l.id,
759
656
  class: "router-tab__contextmenu-item",
760
657
  "aria-disabled": l.disabled,
761
- onClick: j((r) => e.handleMenuAction(l), ["prevent"])
762
- }, ce(l.label), 9, mt))), 128))
763
- ], 4)) : K("", !0)
658
+ onClick: O((u) => e.handleMenuAction(l), ["prevent"])
659
+ }, se(l.label), 9, nt))), 128))
660
+ ], 4)) : w("", !0)
764
661
  ]);
765
662
  }
766
- const Re = /* @__PURE__ */ st(it, [["render", ht]]), yt = {
663
+ const he = /* @__PURE__ */ Je(Ge, [["render", it]]), ot = {
767
664
  class: "router-tabs",
768
665
  "aria-hidden": "true"
769
- }, F = /* @__PURE__ */ te({
666
+ }, X = /* @__PURE__ */ ge({
770
667
  name: "RouterTabs",
771
668
  __name: "RouterTabs",
772
669
  props: {
@@ -781,30 +678,30 @@ const Re = /* @__PURE__ */ st(it, [["render", ht]]), yt = {
781
678
  fallbackRoute: {}
782
679
  },
783
680
  setup(e) {
784
- return xe(e), (o, n) => (w(), A("span", yt));
681
+ return ke(e), (o, t) => (m(), g("span", ot));
785
682
  }
786
- }), Ce = {
683
+ }), ve = {
787
684
  install(e) {
788
- if (Ce._installed) return;
789
- Ce._installed = !0;
790
- const t = Re.name || "RouterTab", o = F.name || "RouterTabs";
791
- e.component(t, Re), e.component(o, F), o !== "router-tabs" && e.component("router-tabs", F), Object.defineProperty(e.config.globalProperties, "$tabs", {
685
+ if (ve._installed) return;
686
+ ve._installed = !0;
687
+ const n = he.name || "RouterTab", o = X.name || "RouterTabs";
688
+ e.component(n, he), e.component(o, X), o !== "router-tabs" && e.component("router-tabs", X), Object.defineProperty(e.config.globalProperties, "$tabs", {
792
689
  configurable: !0,
793
690
  enumerable: !1,
794
691
  get() {
795
- return e._context.provides[G];
692
+ return e._context.provides[D];
796
693
  },
797
- set(n) {
798
- n && e.provide(G, n);
694
+ set(t) {
695
+ t && e.provide(D, t);
799
696
  }
800
697
  });
801
698
  }
802
699
  };
803
700
  export {
804
- Re as RouterTab,
805
- F as RouterTabs,
806
- Ce as default,
807
- G as routerTabsKey,
808
- Te as useRouterTabs,
809
- xe as useRouterTabsPersistence
701
+ he as RouterTab,
702
+ X as RouterTabs,
703
+ ve as default,
704
+ D as routerTabsKey,
705
+ de as useRouterTabs,
706
+ ke as useRouterTabsPersistence
810
707
  };