labull-framework 0.1.11 → 0.1.12

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,6 +1,6 @@
1
- import { defineComponent as z, ref as S, computed as C, watch as ae, onMounted as X, onBeforeUnmount as Y, openBlock as t, createElementBlock as l, normalizeClass as $, unref as d, createElementVNode as e, Fragment as T, withDirectives as te, withKeys as Q, withModifiers as H, vModelText as _e, createCommentVNode as _, renderList as D, toDisplayString as w, nextTick as me, createBlock as ue, resolveDynamicComponent as ke, normalizeProps as ye, mergeProps as we, createTextVNode as W, renderSlot as Z, createVNode as F, vShow as oe } from "vue";
1
+ import { defineComponent as z, ref as S, computed as x, watch as ae, onMounted as X, onBeforeUnmount as Y, openBlock as t, createElementBlock as l, normalizeClass as $, unref as d, createElementVNode as e, Fragment as T, withDirectives as te, withKeys as Q, withModifiers as H, vModelText as _e, createCommentVNode as _, renderList as D, toDisplayString as w, nextTick as me, createBlock as ue, resolveDynamicComponent as ke, normalizeProps as ye, mergeProps as we, createTextVNode as W, renderSlot as Z, createVNode as F, vShow as oe } from "vue";
2
2
  import { useRouter as ne, useRoute as re, RouterView as $e } from "vue-router";
3
- import { e as se, o as le, _ as J, d as ce, p as ge, f as Ce, i as ie } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_0fb37099_lang-BpRKKThg.js";
3
+ import { e as se, o as le, _ as J, d as ce, p as ge, f as Ce, i as ie } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-BpRKKThg.js";
4
4
  import { u as Pe, e as q, g as xe, i as Le, d as Ee, l as Te, a as Se } from "./chunk-index-BWpDbB19.js";
5
5
  const Me = ["onKeydown"], Ie = {
6
6
  key: 2,
@@ -9,44 +9,44 @@ const Me = ["onKeydown"], Ie = {
9
9
  }, Oe = ["aria-selected", "onMouseenter", "onMousedown"], Ne = { class: "labull-search-path" }, Ae = {
10
10
  key: 0,
11
11
  class: "labull-search-empty"
12
- }, Be = /* @__PURE__ */ z({
12
+ }, Ue = /* @__PURE__ */ z({
13
13
  __name: "AppSearch",
14
14
  setup(n) {
15
- const i = (b) => typeof b == "string" && b.trim() ? b.trim() : "";
15
+ const r = (b) => typeof b == "string" && b.trim() ? b.trim() : "";
16
16
  function m(b) {
17
- const r = /* @__PURE__ */ new Set(), y = [];
18
- for (const x of b) {
19
- const a = i(x?.path);
20
- !a || r.has(a) || a.includes(":") || a.includes("*") || x.redirect || !x.components?.default || x.meta?.tab === !1 || (r.add(a), y.push({ path: a, title: i(x.meta?.title) || i(x.meta?.sub) || a }));
17
+ const u = /* @__PURE__ */ new Set(), y = [];
18
+ for (const P of b) {
19
+ const a = r(P?.path);
20
+ !a || u.has(a) || a.includes(":") || a.includes("*") || P.redirect || !P.components?.default || P.meta?.tab === !1 || (u.add(a), y.push({ path: a, title: r(P.meta?.title) || r(P.meta?.sub) || a }));
21
21
  }
22
22
  return y;
23
23
  }
24
- const c = ne(), { portrait: h } = se(), p = S(""), o = S(!1), g = S(0), L = S(null), k = S(null), P = C(() => m(c.getRoutes())), u = C(() => {
25
- const b = p.value.trim().toLowerCase();
26
- return b ? P.value.filter((r) => `${r.title} ${r.path}`.toLowerCase().includes(b)).slice(0, 8) : P.value.slice(0, 8);
24
+ const c = ne(), { portrait: p } = se(), h = S(""), o = S(!1), g = S(0), L = S(null), k = S(null), C = x(() => m(c.getRoutes())), i = x(() => {
25
+ const b = h.value.trim().toLowerCase();
26
+ return b ? C.value.filter((u) => `${u.title} ${u.path}`.toLowerCase().includes(b)).slice(0, 8) : C.value.slice(0, 8);
27
27
  });
28
- ae(u, () => {
28
+ ae(i, () => {
29
29
  g.value = 0;
30
30
  });
31
31
  function E(b) {
32
- b && (le(b.path), p.value = "", o.value = !1, k.value?.blur());
32
+ b && (le(b.path), h.value = "", o.value = !1, k.value?.blur());
33
33
  }
34
- function U(b) {
35
- const r = u.value.length;
36
- r > 0 && (g.value = (g.value + b + r) % r), o.value = !0;
34
+ function B(b) {
35
+ const u = i.value.length;
36
+ u > 0 && (g.value = (g.value + b + u) % u), o.value = !0;
37
37
  }
38
38
  function M() {
39
39
  o.value = !0, G();
40
40
  }
41
41
  function K() {
42
- p.value = "", o.value = !1, k.value?.blur();
42
+ h.value = "", o.value = !1, k.value?.blur();
43
43
  }
44
44
  function G() {
45
45
  me(() => k.value?.focus());
46
46
  }
47
47
  function I() {
48
- if (p.value) {
49
- p.value = "";
48
+ if (h.value) {
49
+ h.value = "";
50
50
  return;
51
51
  }
52
52
  o.value = !1, k.value?.blur();
@@ -61,72 +61,72 @@ const Me = ["onKeydown"], Ie = {
61
61
  document.addEventListener("mousedown", V), window.addEventListener("keydown", R);
62
62
  }), Y(() => {
63
63
  document.removeEventListener("mousedown", V), window.removeEventListener("keydown", R);
64
- }), ae(h, () => {
64
+ }), ae(p, () => {
65
65
  K();
66
- }), (b, r) => (t(), l("div", {
66
+ }), (b, u) => (t(), l("div", {
67
67
  ref_key: "box",
68
68
  ref: L,
69
- class: $(["labull-search-box", { "is-open": d(h) && o.value }])
69
+ class: $(["labull-search-box", { "is-open": d(p) && o.value }])
70
70
  }, [
71
- d(h) && !o.value ? (t(), l("button", {
71
+ d(p) && !o.value ? (t(), l("button", {
72
72
  key: 0,
73
73
  class: "labull-search-toggle",
74
74
  type: "button",
75
75
  "aria-label": "搜索页面",
76
76
  onClick: M
77
- }, [...r[6] || (r[6] = [
77
+ }, [...u[6] || (u[6] = [
78
78
  e("i", { class: "pi pi-search" }, null, -1)
79
79
  ])])) : (t(), l(T, { key: 1 }, [
80
- r[8] || (r[8] = e("i", { class: "pi pi-search" }, null, -1)),
80
+ u[8] || (u[8] = e("i", { class: "pi pi-search" }, null, -1)),
81
81
  te(e("input", {
82
82
  ref_key: "input",
83
83
  ref: k,
84
- "onUpdate:modelValue": r[0] || (r[0] = (y) => p.value = y),
84
+ "onUpdate:modelValue": u[0] || (u[0] = (y) => h.value = y),
85
85
  class: "p-inputtext p-component labull-search-input",
86
86
  type: "search",
87
87
  placeholder: "搜索… [Ctrl+K]",
88
88
  "aria-label": "搜索页面",
89
89
  autocomplete: "off",
90
- onFocus: r[1] || (r[1] = (y) => o.value = !0),
91
- onInput: r[2] || (r[2] = (y) => o.value = !0),
90
+ onFocus: u[1] || (u[1] = (y) => o.value = !0),
91
+ onInput: u[2] || (u[2] = (y) => o.value = !0),
92
92
  onKeydown: [
93
- r[3] || (r[3] = Q(H((y) => U(1), ["prevent"]), ["down"])),
94
- r[4] || (r[4] = Q(H((y) => U(-1), ["prevent"]), ["up"])),
95
- r[5] || (r[5] = Q(H((y) => E(u.value[g.value]), ["prevent"]), ["enter"])),
93
+ u[3] || (u[3] = Q(H((y) => B(1), ["prevent"]), ["down"])),
94
+ u[4] || (u[4] = Q(H((y) => B(-1), ["prevent"]), ["up"])),
95
+ u[5] || (u[5] = Q(H((y) => E(i.value[g.value]), ["prevent"]), ["enter"])),
96
96
  Q(H(I, ["prevent"]), ["esc"])
97
97
  ]
98
98
  }, null, 40, Me), [
99
- [_e, p.value]
99
+ [_e, h.value]
100
100
  ]),
101
- d(h) ? (t(), l("button", {
101
+ d(p) ? (t(), l("button", {
102
102
  key: 0,
103
103
  class: "labull-search-cancel",
104
104
  type: "button",
105
105
  "aria-label": "取消搜索",
106
106
  onClick: K
107
- }, [...r[7] || (r[7] = [
107
+ }, [...u[7] || (u[7] = [
108
108
  e("i", { class: "pi pi-times" }, null, -1)
109
109
  ])])) : _("", !0)
110
110
  ], 64)),
111
- o.value && (p.value || d(h)) ? (t(), l("div", Ie, [
112
- (t(!0), l(T, null, D(u.value, (y, x) => (t(), l("button", {
111
+ o.value && (h.value || d(p)) ? (t(), l("div", Ie, [
112
+ (t(!0), l(T, null, D(i.value, (y, P) => (t(), l("button", {
113
113
  key: y.path,
114
114
  class: "labull-search-item",
115
115
  type: "button",
116
116
  role: "option",
117
- "aria-selected": x === g.value,
118
- onMouseenter: (a) => g.value = x,
117
+ "aria-selected": P === g.value,
118
+ onMouseenter: (a) => g.value = P,
119
119
  onMousedown: H((a) => E(y), ["prevent"])
120
120
  }, [
121
- r[9] || (r[9] = e("i", { class: "pi pi-file" }, null, -1)),
121
+ u[9] || (u[9] = e("i", { class: "pi pi-file" }, null, -1)),
122
122
  e("span", null, w(y.title), 1),
123
123
  e("small", Ne, w(y.path), 1)
124
124
  ], 40, Oe))), 128)),
125
- u.value.length === 0 ? (t(), l("p", Ae, "未找到匹配项")) : _("", !0)
125
+ i.value.length === 0 ? (t(), l("p", Ae, "未找到匹配项")) : _("", !0)
126
126
  ])) : _("", !0)
127
127
  ], 2));
128
128
  }
129
- }), de = /* @__PURE__ */ J(Be, [["__scopeId", "data-v-1af7a3a4"]]), Ue = { class: "labull-rail" }, Ke = { class: "labull-rail__group" }, Ve = ["title"], De = { class: "labull-rail__label" }, Ge = {
129
+ }), de = /* @__PURE__ */ J(Ue, [["__scopeId", "data-v-1af7a3a4"]]), Be = { class: "labull-rail" }, Ke = { class: "labull-rail__group" }, Ve = ["title"], De = { class: "labull-rail__label" }, Ge = {
130
130
  key: 1,
131
131
  class: "labull-rail__divider"
132
132
  }, Re = ["title", "aria-expanded", "onClick", "onMouseenter"], je = { class: "labull-rail__label" }, He = ["title"], We = { class: "labull-rail__brand-name" }, ze = ["aria-hidden"], Fe = { class: "labull-menu__header" }, qe = { class: "labull-menu__title" }, Je = { class: "labull-menu__list" }, Qe = ["onClick"], Xe = ["aria-hidden"], Ye = { class: "labull-navsheet__head" }, Ze = { class: "labull-navsheet__title" }, et = { class: "labull-navsheet__body" }, tt = ["onClick"], lt = ["onClick"], nt = /* @__PURE__ */ z({
@@ -139,35 +139,35 @@ const Me = ["onKeydown"], Ie = {
139
139
  homeIcon: {}
140
140
  },
141
141
  setup(n) {
142
- const i = n, m = re(), { portrait: c, navOpen: h, closeNav: p } = se();
142
+ const r = n, m = re(), { portrait: c, navOpen: p, closeNav: h } = se();
143
143
  function o(s) {
144
144
  return s.path || s.title;
145
145
  }
146
146
  function g() {
147
- return !!i.home && m.path === i.home;
147
+ return !!r.home && m.path === r.home;
148
148
  }
149
- const L = S(!1), k = S(!1), P = S(null);
150
- function u(s) {
149
+ const L = S(!1), k = S(!1), C = S(null);
150
+ function i(s) {
151
151
  return s.path ? m.path === s.path ? !0 : m.path.startsWith(`${s.path}/`) && s.path !== "/" : !1;
152
152
  }
153
153
  function E(s) {
154
- return s.children?.length ? s.children.some((B) => u(B)) : u(s);
154
+ return s.children?.length ? s.children.some((U) => i(U)) : i(s);
155
155
  }
156
- const U = C(() => i.items.find((s) => E(s)) ?? i.items[0]), M = C(() => (P.value ? i.items.find((B) => o(B) === P.value) : void 0) ?? U.value), K = C(() => I.value ? M.value : U.value), G = C(() => {
156
+ const B = x(() => r.items.find((s) => E(s)) ?? r.items[0]), M = x(() => (C.value ? r.items.find((U) => o(U) === C.value) : void 0) ?? B.value), K = x(() => I.value ? M.value : B.value), G = x(() => {
157
157
  const s = M.value;
158
158
  return s ? s.children?.length ? s.children : [s] : [];
159
- }), I = C(() => i.items.length > 0 && (k.value || L.value));
159
+ }), I = x(() => r.items.length > 0 && (k.value || L.value));
160
160
  function R() {
161
161
  L.value = !0;
162
162
  }
163
163
  function V() {
164
- L.value = !1, P.value = null, k.value = !1;
164
+ L.value = !1, C.value = null, k.value = !1;
165
165
  }
166
166
  function b(s) {
167
- P.value = o(s);
167
+ C.value = o(s);
168
168
  }
169
- function r(s) {
170
- k.value = !0, P.value = o(s), s.onClick?.(s);
169
+ function u(s) {
170
+ k.value = !0, C.value = o(s), s.onClick?.(s);
171
171
  }
172
172
  function y(s) {
173
173
  if (k.value = !1, s.onClick) {
@@ -176,39 +176,39 @@ const Me = ["onKeydown"], Ie = {
176
176
  }
177
177
  s.path && le(s.path, { title: s.title, icon: s.icon });
178
178
  }
179
- function x() {
180
- k.value = !1, P.value = null, i.home && le(i.home);
179
+ function P() {
180
+ k.value = !1, C.value = null, r.home && le(r.home);
181
181
  }
182
182
  function a(s) {
183
- y(s), p();
183
+ y(s), h();
184
184
  }
185
185
  function f(s) {
186
186
  if (s.children?.length) {
187
- s.onClick?.(s), p();
187
+ s.onClick?.(s), h();
188
188
  return;
189
189
  }
190
190
  a(s);
191
191
  }
192
192
  function N() {
193
- x(), p();
193
+ P(), h();
194
194
  }
195
195
  function A(s) {
196
- s.key === "Escape" && h.value && p();
196
+ s.key === "Escape" && p.value && h();
197
197
  }
198
- return X(() => window.addEventListener("keydown", A)), Y(() => window.removeEventListener("keydown", A)), (s, B) => (t(), l("nav", {
198
+ return X(() => window.addEventListener("keydown", A)), Y(() => window.removeEventListener("keydown", A)), (s, U) => (t(), l("nav", {
199
199
  class: "labull-nav",
200
200
  "aria-label": "主导航",
201
201
  onMouseenter: R,
202
202
  onMouseleave: V
203
203
  }, [
204
- e("div", Ue, [
204
+ e("div", Be, [
205
205
  e("div", Ke, [
206
206
  n.home ? (t(), l("button", {
207
207
  key: 0,
208
208
  class: $(["labull-rail__btn", { "is-active": g() }]),
209
209
  type: "button",
210
210
  title: n.homeTitle || "首页",
211
- onClick: x
211
+ onClick: P
212
212
  }, [
213
213
  e("i", {
214
214
  class: $(n.homeIcon || "pi pi-home")
@@ -222,7 +222,7 @@ const Me = ["onKeydown"], Ie = {
222
222
  type: "button",
223
223
  title: v.title,
224
224
  "aria-expanded": I.value && v === M.value,
225
- onClick: (O) => r(v),
225
+ onClick: (O) => u(v),
226
226
  onMouseenter: (O) => b(v)
227
227
  }, [
228
228
  e("i", {
@@ -249,7 +249,7 @@ const Me = ["onKeydown"], Ie = {
249
249
  e("div", Je, [
250
250
  (t(!0), l(T, null, D(G.value, (v) => (t(), l("button", {
251
251
  key: o(v),
252
- class: $(["labull-menu__item", { "is-active": u(v) }]),
252
+ class: $(["labull-menu__item", { "is-active": i(v) }]),
253
253
  type: "button",
254
254
  onClick: (O) => y(v)
255
255
  }, [
@@ -262,8 +262,8 @@ const Me = ["onKeydown"], Ie = {
262
262
  ], 10, ze),
263
263
  d(c) ? (t(), l("div", {
264
264
  key: 0,
265
- class: $(["labull-navsheet", { "is-open": d(h) }]),
266
- "aria-hidden": !d(h),
265
+ class: $(["labull-navsheet", { "is-open": d(p) }]),
266
+ "aria-hidden": !d(p),
267
267
  role: "dialog",
268
268
  "aria-modal": "true",
269
269
  "aria-label": "主导航"
@@ -274,9 +274,9 @@ const Me = ["onKeydown"], Ie = {
274
274
  class: "labull-navsheet__close",
275
275
  type: "button",
276
276
  "aria-label": "关闭导航",
277
- onClick: B[0] || (B[0] = //@ts-ignore
278
- (...v) => d(p) && d(p)(...v))
279
- }, [...B[1] || (B[1] = [
277
+ onClick: U[0] || (U[0] = //@ts-ignore
278
+ (...v) => d(h) && d(h)(...v))
279
+ }, [...U[1] || (U[1] = [
280
280
  e("i", { class: "pi pi-times" }, null, -1)
281
281
  ])])
282
282
  ]),
@@ -317,7 +317,7 @@ const Me = ["onKeydown"], Ie = {
317
317
  ], 2)),
318
318
  (t(!0), l(T, null, D(v.children || [], (O) => (t(), l("button", {
319
319
  key: o(O),
320
- class: $(["labull-navsheet__row labull-navsheet__row--page", { "is-active": u(O) }]),
320
+ class: $(["labull-navsheet__row labull-navsheet__row--page", { "is-active": i(O) }]),
321
321
  type: "button",
322
322
  onClick: (Gt) => a(O)
323
323
  }, [
@@ -341,32 +341,32 @@ const Me = ["onKeydown"], Ie = {
341
341
  home: { default: "/" }
342
342
  },
343
343
  setup(n) {
344
- const i = n, { tabs: m, active: c, activateTab: h, closeTab: p, openTab: o } = ce();
344
+ const r = n, { tabs: m, active: c, activateTab: p, closeTab: h, openTab: o } = ce();
345
345
  function g(k) {
346
- h(k);
346
+ p(k);
347
347
  }
348
348
  function L(k) {
349
- p(k) || m.value.length === 0 && o(i.home);
349
+ h(k) || m.value.length === 0 && o(r.home);
350
350
  }
351
- return (k, P) => d(m).length > 0 ? (t(), l("div", st, [
352
- (t(!0), l(T, null, D(d(m), (u) => (t(), l("button", {
353
- key: u.key,
354
- class: $(["labull-tab", { "is-active": u.key === d(c) }]),
351
+ return (k, C) => d(m).length > 0 ? (t(), l("div", st, [
352
+ (t(!0), l(T, null, D(d(m), (i) => (t(), l("button", {
353
+ key: i.key,
354
+ class: $(["labull-tab", { "is-active": i.key === d(c) }]),
355
355
  type: "button",
356
356
  role: "tab",
357
- "aria-selected": u.key === d(c),
358
- title: u.title,
359
- onClick: (E) => g(u.key)
357
+ "aria-selected": i.key === d(c),
358
+ title: i.title,
359
+ onClick: (E) => g(i.key)
360
360
  }, [
361
- u.icon ? (t(), l("i", {
361
+ i.icon ? (t(), l("i", {
362
362
  key: 0,
363
- class: $(u.icon)
363
+ class: $(i.icon)
364
364
  }, null, 2)) : _("", !0),
365
- e("span", null, w(u.title), 1),
365
+ e("span", null, w(i.title), 1),
366
366
  e("i", {
367
367
  class: "pi pi-times labull-tab__close",
368
368
  title: "关闭",
369
- onClick: H((E) => L(u.key), ["stop"])
369
+ onClick: H((E) => L(i.key), ["stop"])
370
370
  }, null, 8, ot)
371
371
  ], 10, at))), 128))
372
372
  ])) : _("", !0);
@@ -377,25 +377,25 @@ const Me = ["onKeydown"], Ie = {
377
377
  tab: {}
378
378
  },
379
379
  setup(n) {
380
- const i = n;
381
- ge(i.tab);
380
+ const r = n;
381
+ ge(r.tab);
382
382
  const m = ne();
383
383
  function c() {
384
- return m.resolve(i.tab.key);
384
+ return m.resolve(r.tab.key);
385
385
  }
386
- const h = C(() => {
386
+ const p = x(() => {
387
387
  const o = c().matched;
388
388
  return o[o.length - 1]?.components?.default ?? null;
389
- }), p = C(() => {
389
+ }), h = x(() => {
390
390
  const o = c().matched[c().matched.length - 1]?.props?.default;
391
- return o === !0 ? c().params : typeof o == "function" ? o(m.resolve(i.tab.key)) : o && typeof o == "object" ? o : {};
391
+ return o === !0 ? c().params : typeof o == "function" ? o(m.resolve(r.tab.key)) : o && typeof o == "object" ? o : {};
392
392
  });
393
- return (o, g) => h.value ? (t(), ue(ke(h.value), ye(we({ key: 0 }, p.value)), null, 16)) : _("", !0);
393
+ return (o, g) => p.value ? (t(), ue(ke(p.value), ye(we({ key: 0 }, h.value)), null, 16)) : _("", !0);
394
394
  }
395
395
  }), rt = ["aria-expanded"], ct = { class: "labull-avatar" }, dt = { class: "labull-topbar__username" }, vt = {
396
396
  key: 0,
397
397
  class: "labull-user__panel"
398
- }, bt = { class: "labull-user__who" }, pt = { class: "labull-user__title" }, ht = {
398
+ }, bt = { class: "labull-user__who" }, ht = { class: "labull-user__title" }, pt = {
399
399
  key: 0,
400
400
  class: "labull-user__work"
401
401
  }, ft = {
@@ -404,66 +404,66 @@ const Me = ["onKeydown"], Ie = {
404
404
  }, _t = { class: "labull-user__row" }, mt = /* @__PURE__ */ z({
405
405
  __name: "UserMenu",
406
406
  setup(n) {
407
- const { user: i, logout: m } = Pe(), c = S(!1), h = S(!1), p = S(null), o = C(() => i.value?.name || "当前用户"), g = C(() => o.value.slice(0, 1));
407
+ const { user: r, logout: m } = Pe(), c = S(!1), p = S(!1), h = S(null), o = x(() => r.value?.name || "当前用户"), g = x(() => o.value.slice(0, 1));
408
408
  function L() {
409
- c.value = !1, h.value = !1;
409
+ c.value = !1, p.value = !1;
410
410
  }
411
- function k(P) {
412
- c.value && !p.value?.contains(P.target) && L();
411
+ function k(C) {
412
+ c.value && !h.value?.contains(C.target) && L();
413
413
  }
414
- return X(() => document.addEventListener("mousedown", k)), Y(() => document.removeEventListener("mousedown", k)), (P, u) => (t(), l("div", {
414
+ return X(() => document.addEventListener("mousedown", k)), Y(() => document.removeEventListener("mousedown", k)), (C, i) => (t(), l("div", {
415
415
  ref_key: "box",
416
- ref: p,
416
+ ref: h,
417
417
  class: "labull-user"
418
418
  }, [
419
419
  e("button", {
420
420
  class: "p-button p-button-text p-button-sm labull-topbar__user",
421
421
  type: "button",
422
422
  "aria-expanded": c.value,
423
- onClick: u[0] || (u[0] = (E) => c.value ? L() : c.value = !0)
423
+ onClick: i[0] || (i[0] = (E) => c.value ? L() : c.value = !0)
424
424
  }, [
425
425
  e("span", ct, w(g.value), 1),
426
426
  e("span", dt, w(o.value), 1),
427
- u[4] || (u[4] = e("i", { class: "pi pi-chevron-down labull-user__caret" }, null, -1))
427
+ i[4] || (i[4] = e("i", { class: "pi pi-chevron-down labull-user__caret" }, null, -1))
428
428
  ], 8, rt),
429
429
  c.value ? (t(), l("div", vt, [
430
430
  e("div", bt, [
431
- e("span", pt, [
431
+ e("span", ht, [
432
432
  W(w(o.value), 1),
433
- d(i)?.workId ? (t(), l("span", ht, "(工号 " + w(d(i).workId) + ")", 1)) : _("", !0)
433
+ d(r)?.workId ? (t(), l("span", pt, "(工号 " + w(d(r).workId) + ")", 1)) : _("", !0)
434
434
  ]),
435
- d(i)?.groups?.length ? (t(), l("small", ft, w(d(i).groups.join(" / ")), 1)) : _("", !0)
435
+ d(r)?.groups?.length ? (t(), l("small", ft, w(d(r).groups.join(" / ")), 1)) : _("", !0)
436
436
  ]),
437
- h.value ? (t(), l(T, { key: 1 }, [
438
- u[5] || (u[5] = e("p", { class: "labull-user__ask" }, "退出后要重新登录,未保存的输入会丢。", -1)),
437
+ p.value ? (t(), l(T, { key: 1 }, [
438
+ i[5] || (i[5] = e("p", { class: "labull-user__ask" }, "退出后要重新登录,未保存的输入会丢。", -1)),
439
439
  e("div", _t, [
440
440
  e("button", {
441
441
  class: "p-button p-button-sm p-button-text",
442
442
  type: "button",
443
- onClick: u[2] || (u[2] = (E) => h.value = !1)
443
+ onClick: i[2] || (i[2] = (E) => p.value = !1)
444
444
  }, "取消"),
445
445
  e("button", {
446
446
  class: "p-button p-button-sm p-button-danger",
447
447
  type: "button",
448
- onClick: u[3] || (u[3] = (E) => d(m)())
448
+ onClick: i[3] || (i[3] = (E) => d(m)())
449
449
  }, "确定退出")
450
450
  ])
451
451
  ], 64)) : (t(), l("button", {
452
452
  key: 0,
453
453
  class: "labull-user__item",
454
454
  type: "button",
455
- onClick: u[1] || (u[1] = (E) => h.value = !0)
455
+ onClick: i[1] || (i[1] = (E) => p.value = !0)
456
456
  }, "退出登录"))
457
457
  ])) : _("", !0)
458
458
  ], 512));
459
459
  }
460
- }), pe = /* @__PURE__ */ J(mt, [["__scopeId", "data-v-27408f31"]]);
460
+ }), he = /* @__PURE__ */ J(mt, [["__scopeId", "data-v-27408f31"]]);
461
461
  let ee = !1, j = null;
462
- const he = {
462
+ const pe = {
463
463
  pass(n) {
464
464
  return ee ? Promise.resolve(!0) : j || (j = (async () => {
465
- const i = await xe();
466
- return i !== "timeout" && i ? (ee = !0, !0) : (i !== "timeout" && Le(n), !1);
465
+ const r = await xe();
466
+ return r !== "timeout" && r ? (ee = !0, !0) : (r !== "timeout" && Le(n), !1);
467
467
  })().finally(() => {
468
468
  j = null;
469
469
  }), j);
@@ -473,10 +473,10 @@ const he = {
473
473
  }
474
474
  };
475
475
  function fe() {
476
- return he.pass(q());
476
+ return pe.pass(q());
477
477
  }
478
478
  function kt() {
479
- he.reset();
479
+ pe.reset();
480
480
  }
481
481
  const yt = {
482
482
  key: 0,
@@ -502,7 +502,7 @@ const yt = {
502
502
  }, It = { class: "labull-body" }, Ot = { class: "labull-main" }, Nt = { class: "labull-viewport" }, At = {
503
503
  key: 0,
504
504
  class: "labull-tabpage"
505
- }, Bt = { class: "labull-tabpages" }, Ut = /* @__PURE__ */ z({
505
+ }, Ut = { class: "labull-tabpages" }, Bt = /* @__PURE__ */ z({
506
506
  __name: "ProductShell",
507
507
  props: {
508
508
  actions: { type: Boolean, default: !0 },
@@ -513,9 +513,7 @@ const yt = {
513
513
  brand: {}
514
514
  },
515
515
  setup(n) {
516
- const i = n, m = re(), c = ne(), { tabs: h, active: p } = ce(), { portrait: o, navOpen: g, toggleNav: L } = se(), { open: k, denied: P, unreachable: u, pass: E, recheck: U } = Ee(), M = C(() => m.path === "/login" || q() === "/login"), K = C(() => Te(q()));
517
- C(() => !!i.logo || !!i.caption);
518
- const G = C(() => !!(i.side && i.side.length > 0)), I = C(() => m.meta.tab === !1);
516
+ const r = n, m = re(), c = ne(), { tabs: p, active: h } = ce(), { portrait: o, navOpen: g, toggleNav: L } = se(), { open: k, denied: C, unreachable: i, pass: E, recheck: B } = Ee(), M = x(() => m.path === "/login" || q() === "/login"), K = x(() => Te(q())), G = x(() => !!(r.side && r.side.length > 0)), I = x(() => m.meta.tab === !1);
519
517
  ie({
520
518
  resolve: (a) => {
521
519
  const f = R(c.resolve(a));
@@ -548,28 +546,28 @@ const yt = {
548
546
  if (M.value) return;
549
547
  await fe() && await E(q());
550
548
  }
551
- function r() {
549
+ function u() {
552
550
  window.location.reload();
553
551
  }
554
552
  function y(a) {
555
- a.persisted && (kt(), U(q()));
553
+ a.persisted && (kt(), B(q()));
556
554
  }
557
- let x;
555
+ let P;
558
556
  return X(() => {
559
557
  window.addEventListener("pageshow", y), b().then(() => {
560
- k.value && (V(m), x = c.afterEach((a) => V(a)));
558
+ k.value && (V(m), P = c.afterEach((a) => V(a)));
561
559
  });
562
560
  }), Y(() => {
563
- window.removeEventListener("pageshow", y), x?.(), ie(null);
561
+ window.removeEventListener("pageshow", y), P?.(), ie(null);
564
562
  }), (a, f) => !d(k) && !M.value ? (t(), l("div", yt, [
565
563
  f[5] || (f[5] = e("p", { class: "labull-gate__title" }, "正在确认登录状态…", -1)),
566
- d(P) ? (t(), l("p", wt, [
567
- d(u) ? (t(), l(T, { key: 0 }, [
564
+ d(C) ? (t(), l("p", wt, [
565
+ d(i) ? (t(), l(T, { key: 0 }, [
568
566
  W("连不上后端(等了 " + w(Math.round(d(Se) / 1e3)) + " 秒也没有回音)。确认后端起来之后 ", 1),
569
567
  e("button", {
570
568
  class: "labull-gate__link",
571
569
  type: "button",
572
- onClick: r
570
+ onClick: u
573
571
  }, "重试"),
574
572
  f[1] || (f[1] = W(",或者", -1)),
575
573
  e("a", {
@@ -615,7 +613,7 @@ const yt = {
615
613
  Z(a.$slots, "actions", {}, void 0, !0),
616
614
  n.actions ? (t(), l(T, { key: 0 }, [
617
615
  F(de),
618
- F(pe)
616
+ F(he)
619
617
  ], 64)) : _("", !0)
620
618
  ])) : _("", !0)
621
619
  ])) : _("", !0),
@@ -632,14 +630,14 @@ const yt = {
632
630
  I.value ? (t(), l("div", At, [
633
631
  F(d($e))
634
632
  ])) : _("", !0),
635
- te(e("div", Bt, [
636
- (t(!0), l(T, null, D(d(h), (N) => te((t(), l("div", {
633
+ te(e("div", Ut, [
634
+ (t(!0), l(T, null, D(d(p), (N) => te((t(), l("div", {
637
635
  key: N.key,
638
636
  class: "labull-tabpage"
639
637
  }, [
640
638
  F(ut, { tab: N }, null, 8, ["tab"])
641
639
  ])), [
642
- [oe, N.key === d(p)]
640
+ [oe, N.key === d(h)]
643
641
  ])), 128))
644
642
  ], 512), [
645
643
  [oe, !I.value]
@@ -649,18 +647,18 @@ const yt = {
649
647
  ])
650
648
  ]));
651
649
  }
652
- }), Kt = /* @__PURE__ */ J(Ut, [["__scopeId", "data-v-0fb37099"]]), Vt = { ProductShell: Kt, ProductSide: ve, ProductTabs: be, AppSearch: de, UserMenu: pe };
653
- function Dt(n, i = {}) {
654
- for (const [c, h] of Object.entries(Vt)) n.component(c, h);
650
+ }), Kt = /* @__PURE__ */ J(Bt, [["__scopeId", "data-v-06035587"]]), Vt = { ProductShell: Kt, ProductSide: ve, ProductTabs: be, AppSearch: de, UserMenu: he };
651
+ function Dt(n, r = {}) {
652
+ for (const [c, p] of Object.entries(Vt)) n.component(c, p);
655
653
  const m = n.config.globalProperties.$router;
656
654
  m ? m.beforeEach(async (c) => c.path === "/login" ? !0 : await fe()) : console.warn("[labull] 没拿到 router:把 app.use(labull) 放到 app.use(router) 之后。");
657
- for (const c of i.extra ?? []) n.use(c);
655
+ for (const c of r.extra ?? []) n.use(c);
658
656
  }
659
657
  const zt = { install: (n) => Dt(n) };
660
658
  export {
661
659
  de as A,
662
660
  Kt as P,
663
- pe as U,
661
+ he as U,
664
662
  ut as _,
665
663
  ve as a,
666
664
  be as b,
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { A as e, a as t, C as r, b as o, c as l, d as i, e as u, f as c, g as n, h as T, l as b, i as A, j as p, u as d } from "./chunk-index-BWpDbB19.js";
2
- import { A as S, P as E, a as _, b as P, _ as U, U as f, i as g, l as I } from "./chunk-index-B5pTPy31.js";
3
- import { T as C, a as N, c as m, f as D, i as L, b as v, o as M, p as B, s as H, u as O, d as R } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_0fb37099_lang-BpRKKThg.js";
2
+ import { A as S, P as E, a as _, b as P, _ as U, U as f, i as g, l as I } from "./chunk-index-BN-lnG-w.js";
3
+ import { T as C, a as N, c as m, f as D, i as L, b as v, o as M, p as B, s as H, u as O, d as R } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-BpRKKThg.js";
4
4
  export {
5
5
  e as API_BASE,
6
6
  t as AUTH_DEADLINE_MS,