labull-framework 0.1.29 → 0.1.31

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,52 +1,52 @@
1
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
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-Fky1ghd2.js";
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
- const Me = ["onKeydown"], Ie = {
4
+ import { u as Pe, e as q, g as xe, i as Le, d as Ee, l as Te, a as Se, s as Me } from "./chunk-index-BVIJeFeJ.js";
5
+ const Ie = ["onKeydown"], Oe = {
6
6
  key: 2,
7
7
  class: "labull-search-panel",
8
8
  role: "listbox"
9
- }, Oe = ["aria-selected", "onMouseenter", "onMousedown"], Ne = { class: "labull-search-path" }, Ae = {
9
+ }, Ae = ["aria-selected", "onMouseenter", "onMousedown"], Ne = { class: "labull-search-path" }, Be = {
10
10
  key: 0,
11
11
  class: "labull-search-empty"
12
12
  }, Ue = /* @__PURE__ */ z({
13
13
  __name: "AppSearch",
14
14
  setup(n) {
15
- const r = (b) => typeof b == "string" && b.trim() ? b.trim() : "";
15
+ const i = (b) => typeof b == "string" && b.trim() ? b.trim() : "";
16
16
  function m(b) {
17
- const u = /* @__PURE__ */ new Set(), y = [];
17
+ const r = /* @__PURE__ */ new Set(), y = [];
18
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 }));
19
+ const a = i(P?.path);
20
+ !a || r.has(a) || a.includes(":") || a.includes("*") || P.redirect || !P.components?.default || P.meta?.tab === !1 || (r.add(a), y.push({ path: a, title: i(P.meta?.title) || i(P.meta?.sub) || a }));
21
21
  }
22
22
  return y;
23
23
  }
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);
24
+ const c = ne(), { portrait: h } = se(), p = S(""), o = S(!1), g = S(0), L = S(null), k = S(null), C = x(() => m(c.getRoutes())), u = x(() => {
25
+ const b = p.value.trim().toLowerCase();
26
+ return b ? C.value.filter((r) => `${r.title} ${r.path}`.toLowerCase().includes(b)).slice(0, 8) : C.value.slice(0, 8);
27
27
  });
28
- ae(i, () => {
28
+ ae(u, () => {
29
29
  g.value = 0;
30
30
  });
31
31
  function E(b) {
32
- b && (le(b.path), h.value = "", o.value = !1, k.value?.blur());
32
+ b && (le(b.path), p.value = "", o.value = !1, k.value?.blur());
33
33
  }
34
- function B(b) {
35
- const u = i.value.length;
36
- u > 0 && (g.value = (g.value + b + u) % u), o.value = !0;
34
+ function U(b) {
35
+ const r = u.value.length;
36
+ r > 0 && (g.value = (g.value + b + r) % r), o.value = !0;
37
37
  }
38
38
  function M() {
39
39
  o.value = !0, G();
40
40
  }
41
41
  function K() {
42
- h.value = "", o.value = !1, k.value?.blur();
42
+ p.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 (h.value) {
49
- h.value = "";
48
+ if (p.value) {
49
+ p.value = "";
50
50
  return;
51
51
  }
52
52
  o.value = !1, k.value?.blur();
@@ -61,55 +61,55 @@ 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(p, () => {
64
+ }), ae(h, () => {
65
65
  K();
66
- }), (b, u) => (t(), l("div", {
66
+ }), (b, r) => (t(), l("div", {
67
67
  ref_key: "box",
68
68
  ref: L,
69
- class: $(["labull-search-box", { "is-open": d(p) && o.value }])
69
+ class: $(["labull-search-box", { "is-open": d(h) && o.value }])
70
70
  }, [
71
- d(p) && !o.value ? (t(), l("button", {
71
+ d(h) && !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
- }, [...u[6] || (u[6] = [
77
+ }, [...r[6] || (r[6] = [
78
78
  e("i", { class: "pi pi-search" }, null, -1)
79
79
  ])])) : (t(), l(T, { key: 1 }, [
80
- u[8] || (u[8] = e("i", { class: "pi pi-search" }, null, -1)),
80
+ r[8] || (r[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": u[0] || (u[0] = (y) => h.value = y),
84
+ "onUpdate:modelValue": r[0] || (r[0] = (y) => p.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: u[1] || (u[1] = (y) => o.value = !0),
91
- onInput: u[2] || (u[2] = (y) => o.value = !0),
90
+ onFocus: r[1] || (r[1] = (y) => o.value = !0),
91
+ onInput: r[2] || (r[2] = (y) => o.value = !0),
92
92
  onKeydown: [
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"])),
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"])),
96
96
  Q(H(I, ["prevent"]), ["esc"])
97
97
  ]
98
- }, null, 40, Me), [
99
- [_e, h.value]
98
+ }, null, 40, Ie), [
99
+ [_e, p.value]
100
100
  ]),
101
- d(p) ? (t(), l("button", {
101
+ d(h) ? (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
- }, [...u[7] || (u[7] = [
107
+ }, [...r[7] || (r[7] = [
108
108
  e("i", { class: "pi pi-times" }, null, -1)
109
109
  ])])) : _("", !0)
110
110
  ], 64)),
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", {
111
+ o.value && (p.value || d(h)) ? (t(), l("div", Oe, [
112
+ (t(!0), l(T, null, D(u.value, (y, P) => (t(), l("button", {
113
113
  key: y.path,
114
114
  class: "labull-search-item",
115
115
  type: "button",
@@ -118,18 +118,18 @@ const Me = ["onKeydown"], Ie = {
118
118
  onMouseenter: (a) => g.value = P,
119
119
  onMousedown: H((a) => E(y), ["prevent"])
120
120
  }, [
121
- u[9] || (u[9] = e("i", { class: "pi pi-file" }, null, -1)),
121
+ r[9] || (r[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
- ], 40, Oe))), 128)),
125
- i.value.length === 0 ? (t(), l("p", Ae, "未找到匹配项")) : _("", !0)
124
+ ], 40, Ae))), 128)),
125
+ u.value.length === 0 ? (t(), l("p", Be, "未找到匹配项")) : _("", !0)
126
126
  ])) : _("", !0)
127
127
  ], 2));
128
128
  }
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 = {
129
+ }), de = /* @__PURE__ */ J(Ue, [["__scopeId", "data-v-1af7a3a4"]]), Ke = { class: "labull-rail" }, Ve = { class: "labull-rail__group" }, De = ["title"], Ge = { class: "labull-rail__label" }, Re = {
130
130
  key: 1,
131
131
  class: "labull-rail__divider"
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({
132
+ }, je = ["title", "aria-expanded", "onClick", "onMouseenter"], He = { class: "labull-rail__label" }, We = ["title"], ze = { class: "labull-rail__brand-name" }, Fe = ["aria-hidden"], qe = { class: "labull-menu__header" }, Je = { class: "labull-menu__title" }, Qe = { class: "labull-menu__list" }, Xe = ["onClick"], Ye = ["aria-hidden"], Ze = { class: "labull-navsheet__head" }, et = { class: "labull-navsheet__title" }, tt = { class: "labull-navsheet__body" }, lt = ["onClick"], nt = ["onClick"], st = /* @__PURE__ */ z({
133
133
  __name: "ProductSide",
134
134
  props: {
135
135
  items: {},
@@ -139,24 +139,24 @@ const Me = ["onKeydown"], Ie = {
139
139
  homeIcon: {}
140
140
  },
141
141
  setup(n) {
142
- const r = n, m = re(), { portrait: c, navOpen: p, closeNav: h } = se();
142
+ const i = n, m = re(), { portrait: c, navOpen: h, closeNav: p } = se();
143
143
  function o(s) {
144
144
  return s.path || s.title;
145
145
  }
146
146
  function g() {
147
- return !!r.home && m.path === r.home;
147
+ return !!i.home && m.path === i.home;
148
148
  }
149
149
  const L = S(!1), k = S(!1), C = S(null);
150
- function i(s) {
150
+ function u(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((U) => i(U)) : i(s);
154
+ return s.children?.length ? s.children.some((B) => u(B)) : u(s);
155
155
  }
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(() => {
156
+ const U = x(() => i.items.find((s) => E(s)) ?? i.items[0]), M = x(() => (C.value ? i.items.find((B) => o(B) === C.value) : void 0) ?? U.value), K = x(() => I.value ? M.value : U.value), G = x(() => {
157
157
  const s = M.value;
158
158
  return s ? s.children?.length ? s.children : [s] : [];
159
- }), I = x(() => r.items.length > 0 && (k.value || L.value));
159
+ }), I = x(() => i.items.length > 0 && (k.value || L.value));
160
160
  function R() {
161
161
  L.value = !0;
162
162
  }
@@ -166,7 +166,7 @@ const Me = ["onKeydown"], Ie = {
166
166
  function b(s) {
167
167
  C.value = o(s);
168
168
  }
169
- function u(s) {
169
+ function r(s) {
170
170
  k.value = !0, C.value = o(s), s.onClick?.(s);
171
171
  }
172
172
  function y(s) {
@@ -177,32 +177,32 @@ const Me = ["onKeydown"], Ie = {
177
177
  s.path && le(s.path, { title: s.title, icon: s.icon });
178
178
  }
179
179
  function P() {
180
- k.value = !1, C.value = null, r.home && le(r.home);
180
+ k.value = !1, C.value = null, i.home && le(i.home);
181
181
  }
182
182
  function a(s) {
183
- y(s), h();
183
+ y(s), p();
184
184
  }
185
185
  function f(s) {
186
186
  if (s.children?.length) {
187
- s.onClick?.(s), h();
187
+ s.onClick?.(s), p();
188
188
  return;
189
189
  }
190
190
  a(s);
191
191
  }
192
- function N() {
193
- P(), h();
192
+ function A() {
193
+ P(), p();
194
194
  }
195
- function A(s) {
196
- s.key === "Escape" && p.value && h();
195
+ function N(s) {
196
+ s.key === "Escape" && h.value && p();
197
197
  }
198
- return X(() => window.addEventListener("keydown", A)), Y(() => window.removeEventListener("keydown", A)), (s, U) => (t(), l("nav", {
198
+ return X(() => window.addEventListener("keydown", N)), Y(() => window.removeEventListener("keydown", N)), (s, B) => (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", Be, [
205
- e("div", Ke, [
204
+ e("div", Ke, [
205
+ e("div", Ve, [
206
206
  n.home ? (t(), l("button", {
207
207
  key: 0,
208
208
  class: $(["labull-rail__btn", { "is-active": g() }]),
@@ -213,43 +213,43 @@ const Me = ["onKeydown"], Ie = {
213
213
  e("i", {
214
214
  class: $(n.homeIcon || "pi pi-home")
215
215
  }, null, 2),
216
- e("span", De, w(n.homeTitle || "首页"), 1)
217
- ], 10, Ve)) : _("", !0),
218
- n.home && n.items.length > 0 ? (t(), l("span", Ge)) : _("", !0),
216
+ e("span", Ge, w(n.homeTitle || "首页"), 1)
217
+ ], 10, De)) : _("", !0),
218
+ n.home && n.items.length > 0 ? (t(), l("span", Re)) : _("", !0),
219
219
  (t(!0), l(T, null, D(n.items, (v) => (t(), l("button", {
220
220
  key: o(v),
221
221
  class: $(["labull-rail__btn", { "is-active": v === K.value }]),
222
222
  type: "button",
223
223
  title: v.title,
224
224
  "aria-expanded": I.value && v === M.value,
225
- onClick: (O) => u(v),
225
+ onClick: (O) => r(v),
226
226
  onMouseenter: (O) => b(v)
227
227
  }, [
228
228
  e("i", {
229
229
  class: $(v.icon || "pi pi-folder")
230
230
  }, null, 2),
231
- e("span", je, w(v.title), 1)
232
- ], 42, Re))), 128))
231
+ e("span", He, w(v.title), 1)
232
+ ], 42, je))), 128))
233
233
  ]),
234
234
  n.brand ? (t(), l("div", {
235
235
  key: 0,
236
236
  class: "labull-rail__brand",
237
237
  title: n.brand
238
238
  }, [
239
- e("span", We, w(n.brand), 1)
240
- ], 8, He)) : _("", !0)
239
+ e("span", ze, w(n.brand), 1)
240
+ ], 8, We)) : _("", !0)
241
241
  ]),
242
242
  e("aside", {
243
243
  class: $(["labull-menu", { "is-open": I.value }]),
244
244
  "aria-hidden": !I.value
245
245
  }, [
246
- e("div", Fe, [
247
- e("div", qe, w(M.value?.title), 1)
246
+ e("div", qe, [
247
+ e("div", Je, w(M.value?.title), 1)
248
248
  ]),
249
- e("div", Je, [
249
+ e("div", Qe, [
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": i(v) }]),
252
+ class: $(["labull-menu__item", { "is-active": u(v) }]),
253
253
  type: "button",
254
254
  onClick: (O) => y(v)
255
255
  }, [
@@ -257,35 +257,35 @@ const Me = ["onKeydown"], Ie = {
257
257
  class: $(v.icon || "pi pi-file")
258
258
  }, null, 2),
259
259
  e("span", null, w(v.title), 1)
260
- ], 10, Qe))), 128))
260
+ ], 10, Xe))), 128))
261
261
  ])
262
- ], 10, ze),
262
+ ], 10, Fe),
263
263
  d(c) ? (t(), l("div", {
264
264
  key: 0,
265
- class: $(["labull-navsheet", { "is-open": d(p) }]),
266
- "aria-hidden": !d(p),
265
+ class: $(["labull-navsheet", { "is-open": d(h) }]),
266
+ "aria-hidden": !d(h),
267
267
  role: "dialog",
268
268
  "aria-modal": "true",
269
269
  "aria-label": "主导航"
270
270
  }, [
271
- e("div", Ye, [
272
- e("span", Ze, w(n.brand || "导航"), 1),
271
+ e("div", Ze, [
272
+ e("span", et, w(n.brand || "导航"), 1),
273
273
  e("button", {
274
274
  class: "labull-navsheet__close",
275
275
  type: "button",
276
276
  "aria-label": "关闭导航",
277
- onClick: U[0] || (U[0] = //@ts-ignore
278
- (...v) => d(h) && d(h)(...v))
279
- }, [...U[1] || (U[1] = [
277
+ onClick: B[0] || (B[0] = //@ts-ignore
278
+ (...v) => d(p) && d(p)(...v))
279
+ }, [...B[1] || (B[1] = [
280
280
  e("i", { class: "pi pi-times" }, null, -1)
281
281
  ])])
282
282
  ]),
283
- e("div", et, [
283
+ e("div", tt, [
284
284
  n.home ? (t(), l("button", {
285
285
  key: 0,
286
286
  class: $(["labull-navsheet__row labull-navsheet__row--home", { "is-active": g() }]),
287
287
  type: "button",
288
- onClick: N
288
+ onClick: A
289
289
  }, [
290
290
  e("i", {
291
291
  class: $(n.homeIcon || "pi pi-home")
@@ -306,7 +306,7 @@ const Me = ["onKeydown"], Ie = {
306
306
  class: $(v.icon || "pi pi-folder")
307
307
  }, null, 2),
308
308
  e("span", null, w(v.title), 1)
309
- ], 10, tt)) : (t(), l("div", {
309
+ ], 10, lt)) : (t(), l("div", {
310
310
  key: 1,
311
311
  class: $(["labull-navsheet__row labull-navsheet__row--group is-static", { "is-current": E(v) }])
312
312
  }, [
@@ -317,153 +317,153 @@ 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": i(O) }]),
320
+ class: $(["labull-navsheet__row labull-navsheet__row--page", { "is-active": u(O) }]),
321
321
  type: "button",
322
- onClick: (Gt) => a(O)
322
+ onClick: (Rt) => a(O)
323
323
  }, [
324
324
  e("i", {
325
325
  class: $(O.icon || "pi pi-file")
326
326
  }, null, 2),
327
327
  e("span", null, w(O.title), 1)
328
- ], 10, lt))), 128))
328
+ ], 10, nt))), 128))
329
329
  ]))), 128))
330
330
  ])
331
- ], 10, Xe)) : _("", !0)
331
+ ], 10, Ye)) : _("", !0)
332
332
  ], 32));
333
333
  }
334
- }), ve = /* @__PURE__ */ J(nt, [["__scopeId", "data-v-c3bdb098"]]), st = {
334
+ }), ve = /* @__PURE__ */ J(st, [["__scopeId", "data-v-c3bdb098"]]), at = {
335
335
  key: 0,
336
336
  class: "labull-tabbar",
337
337
  role: "tablist"
338
- }, at = ["aria-selected", "title", "onClick"], ot = ["onClick"], it = /* @__PURE__ */ z({
338
+ }, ot = ["aria-selected", "title", "onClick"], it = ["onClick"], ut = /* @__PURE__ */ z({
339
339
  __name: "ProductTabs",
340
340
  props: {
341
341
  home: { default: "/" }
342
342
  },
343
343
  setup(n) {
344
- const r = n, { tabs: m, active: c, activateTab: p, closeTab: h, openTab: o } = ce();
344
+ const i = n, { tabs: m, active: c, activateTab: h, closeTab: p, openTab: o } = ce();
345
345
  function g(k) {
346
- p(k);
346
+ h(k);
347
347
  }
348
348
  function L(k) {
349
- h(k) || m.value.length === 0 && o(r.home);
349
+ p(k) || m.value.length === 0 && o(i.home);
350
350
  }
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) }]),
351
+ return (k, C) => d(m).length > 0 ? (t(), l("div", at, [
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) }]),
355
355
  type: "button",
356
356
  role: "tab",
357
- "aria-selected": i.key === d(c),
358
- title: i.title,
359
- onClick: (E) => g(i.key)
357
+ "aria-selected": u.key === d(c),
358
+ title: u.title,
359
+ onClick: (E) => g(u.key)
360
360
  }, [
361
- i.icon ? (t(), l("i", {
361
+ u.icon ? (t(), l("i", {
362
362
  key: 0,
363
- class: $(i.icon)
363
+ class: $(u.icon)
364
364
  }, null, 2)) : _("", !0),
365
- e("span", null, w(i.title), 1),
365
+ e("span", null, w(u.title), 1),
366
366
  e("i", {
367
367
  class: "pi pi-times labull-tab__close",
368
368
  title: "关闭",
369
- onClick: H((E) => L(i.key), ["stop"])
370
- }, null, 8, ot)
371
- ], 10, at))), 128))
369
+ onClick: H((E) => L(u.key), ["stop"])
370
+ }, null, 8, it)
371
+ ], 10, ot))), 128))
372
372
  ])) : _("", !0);
373
373
  }
374
- }), be = /* @__PURE__ */ J(it, [["__scopeId", "data-v-02d7624f"]]), ut = /* @__PURE__ */ z({
374
+ }), be = /* @__PURE__ */ J(ut, [["__scopeId", "data-v-02d7624f"]]), rt = /* @__PURE__ */ z({
375
375
  __name: "TabPage",
376
376
  props: {
377
377
  tab: {}
378
378
  },
379
379
  setup(n) {
380
- const r = n;
381
- ge(r.tab);
380
+ const i = n;
381
+ ge(i.tab);
382
382
  const m = ne();
383
383
  function c() {
384
- return m.resolve(r.tab.key);
384
+ return m.resolve(i.tab.key);
385
385
  }
386
- const p = x(() => {
386
+ const h = x(() => {
387
387
  const o = c().matched;
388
388
  return o[o.length - 1]?.components?.default ?? null;
389
- }), h = x(() => {
389
+ }), p = 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(r.tab.key)) : o && typeof o == "object" ? o : {};
391
+ return o === !0 ? c().params : typeof o == "function" ? o(m.resolve(i.tab.key)) : o && typeof o == "object" ? o : {};
392
392
  });
393
- return (o, g) => p.value ? (t(), ue(ke(p.value), ye(we({ key: 0 }, h.value)), null, 16)) : _("", !0);
393
+ return (o, g) => h.value ? (t(), ue(ke(h.value), ye(we({ key: 0 }, p.value)), null, 16)) : _("", !0);
394
394
  }
395
- }), rt = ["aria-expanded"], ct = { class: "labull-avatar" }, dt = { class: "labull-topbar__username" }, vt = {
395
+ }), ct = ["aria-expanded"], dt = { class: "labull-avatar" }, vt = { class: "labull-topbar__username" }, bt = {
396
396
  key: 0,
397
397
  class: "labull-user__panel"
398
- }, bt = { class: "labull-user__who" }, ht = { class: "labull-user__title" }, pt = {
398
+ }, pt = { class: "labull-user__who" }, ht = { class: "labull-user__title" }, ft = {
399
399
  key: 0,
400
400
  class: "labull-user__work"
401
- }, ft = {
401
+ }, _t = {
402
402
  key: 0,
403
403
  class: "labull-user__groups"
404
- }, _t = { class: "labull-user__row" }, mt = /* @__PURE__ */ z({
404
+ }, mt = { class: "labull-user__row" }, kt = /* @__PURE__ */ z({
405
405
  __name: "UserMenu",
406
406
  setup(n) {
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));
407
+ const { user: i, logout: m } = Pe(), c = S(!1), h = S(!1), p = S(null), o = x(() => i.value?.name || "当前用户"), g = x(() => o.value.slice(0, 1));
408
408
  function L() {
409
- c.value = !1, p.value = !1;
409
+ c.value = !1, h.value = !1;
410
410
  }
411
411
  function k(C) {
412
- c.value && !h.value?.contains(C.target) && L();
412
+ c.value && !p.value?.contains(C.target) && L();
413
413
  }
414
- return X(() => document.addEventListener("mousedown", k)), Y(() => document.removeEventListener("mousedown", k)), (C, i) => (t(), l("div", {
414
+ return X(() => document.addEventListener("mousedown", k)), Y(() => document.removeEventListener("mousedown", k)), (C, u) => (t(), l("div", {
415
415
  ref_key: "box",
416
- ref: h,
416
+ ref: p,
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: i[0] || (i[0] = (E) => c.value ? L() : c.value = !0)
423
+ onClick: u[0] || (u[0] = (E) => c.value ? L() : c.value = !0)
424
424
  }, [
425
- e("span", ct, w(g.value), 1),
426
- e("span", dt, w(o.value), 1),
427
- i[4] || (i[4] = e("i", { class: "pi pi-chevron-down labull-user__caret" }, null, -1))
428
- ], 8, rt),
429
- c.value ? (t(), l("div", vt, [
430
- e("div", bt, [
425
+ e("span", dt, w(g.value), 1),
426
+ e("span", vt, w(o.value), 1),
427
+ u[4] || (u[4] = e("i", { class: "pi pi-chevron-down labull-user__caret" }, null, -1))
428
+ ], 8, ct),
429
+ c.value ? (t(), l("div", bt, [
430
+ e("div", pt, [
431
431
  e("span", ht, [
432
432
  W(w(o.value), 1),
433
- d(r)?.workId ? (t(), l("span", pt, "(工号 " + w(d(r).workId) + ")", 1)) : _("", !0)
433
+ d(i)?.workId ? (t(), l("span", ft, "(工号 " + w(d(i).workId) + ")", 1)) : _("", !0)
434
434
  ]),
435
- d(r)?.groups?.length ? (t(), l("small", ft, w(d(r).groups.join(" / ")), 1)) : _("", !0)
435
+ d(i)?.groups?.length ? (t(), l("small", _t, w(d(i).groups.join(" / ")), 1)) : _("", !0)
436
436
  ]),
437
- p.value ? (t(), l(T, { key: 1 }, [
438
- i[5] || (i[5] = e("p", { class: "labull-user__ask" }, "退出后要重新登录,未保存的输入会丢。", -1)),
439
- e("div", _t, [
437
+ h.value ? (t(), l(T, { key: 1 }, [
438
+ u[5] || (u[5] = e("p", { class: "labull-user__ask" }, "退出后要重新登录,未保存的输入会丢。", -1)),
439
+ e("div", mt, [
440
440
  e("button", {
441
441
  class: "p-button p-button-sm p-button-text",
442
442
  type: "button",
443
- onClick: i[2] || (i[2] = (E) => p.value = !1)
443
+ onClick: u[2] || (u[2] = (E) => h.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: i[3] || (i[3] = (E) => d(m)())
448
+ onClick: u[3] || (u[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: i[1] || (i[1] = (E) => p.value = !0)
455
+ onClick: u[1] || (u[1] = (E) => h.value = !0)
456
456
  }, "退出登录"))
457
457
  ])) : _("", !0)
458
458
  ], 512));
459
459
  }
460
- }), he = /* @__PURE__ */ J(mt, [["__scopeId", "data-v-27408f31"]]);
460
+ }), pe = /* @__PURE__ */ J(kt, [["__scopeId", "data-v-27408f31"]]);
461
461
  let ee = !1, j = null;
462
- const pe = {
462
+ const he = {
463
463
  pass(n) {
464
464
  return ee ? Promise.resolve(!0) : j || (j = (async () => {
465
- const r = await xe();
466
- return r !== "timeout" && r ? (ee = !0, !0) : (r !== "timeout" && Le(n), !1);
465
+ const i = await xe();
466
+ return i !== "timeout" && i ? (ee = !0, !0) : (i !== "timeout" && Le(n), !1);
467
467
  })().finally(() => {
468
468
  j = null;
469
469
  }), j);
@@ -473,36 +473,36 @@ const pe = {
473
473
  }
474
474
  };
475
475
  function fe() {
476
- return pe.pass(q());
476
+ return he.pass(q());
477
477
  }
478
- function kt() {
479
- pe.reset();
478
+ function yt() {
479
+ he.reset();
480
480
  }
481
- const yt = {
481
+ const wt = {
482
482
  key: 0,
483
483
  class: "labull-gate"
484
- }, wt = {
484
+ }, $t = {
485
485
  key: 0,
486
486
  class: "labull-gate__hint"
487
- }, $t = ["href"], gt = ["href"], Ct = {
487
+ }, gt = ["href"], Ct = ["href"], Pt = {
488
488
  key: 1,
489
489
  class: "labull-shell"
490
- }, Pt = {
490
+ }, xt = {
491
491
  key: 0,
492
492
  class: "labull-shell__bar"
493
- }, xt = {
493
+ }, Lt = {
494
494
  key: 1,
495
495
  class: "labull-topbar"
496
- }, Lt = ["aria-expanded"], Et = { class: "labull-topbar__brand" }, Tt = ["src"], St = {
496
+ }, Et = ["aria-expanded"], Tt = { class: "labull-topbar__brand" }, St = ["src"], Mt = {
497
497
  key: 1,
498
498
  class: "labull-topbar__caption"
499
- }, Mt = {
499
+ }, It = {
500
500
  key: 1,
501
501
  class: "labull-topbar__actions"
502
- }, It = { class: "labull-body" }, Ot = { class: "labull-main" }, Nt = { class: "labull-viewport" }, At = {
502
+ }, Ot = { class: "labull-body" }, At = { class: "labull-main" }, Nt = { class: "labull-viewport" }, Bt = {
503
503
  key: 0,
504
504
  class: "labull-tabpage"
505
- }, Ut = { class: "labull-tabpages" }, Bt = /* @__PURE__ */ z({
505
+ }, Ut = { class: "labull-tabpages" }, Kt = /* @__PURE__ */ z({
506
506
  __name: "ProductShell",
507
507
  props: {
508
508
  actions: { type: Boolean, default: !0 },
@@ -513,7 +513,7 @@ const yt = {
513
513
  brand: {}
514
514
  },
515
515
  setup(n) {
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);
516
+ const i = n, m = re(), c = ne(), { tabs: h, active: p } = ce(), { portrait: o, navOpen: g, toggleNav: L } = se(), { open: k, denied: C, unreachable: u, pass: E, recheck: U } = Ee(), M = x(() => m.path === "/login" || q() === "/login"), K = x(() => Te(q())), G = x(() => !!(i.side && i.side.length > 0)), I = x(() => m.meta.tab === !1);
517
517
  ie({
518
518
  resolve: (a) => {
519
519
  const f = R(c.resolve(a));
@@ -526,13 +526,13 @@ const yt = {
526
526
  });
527
527
  function R(a) {
528
528
  for (let f = 0; f < 8; f += 1) {
529
- const A = a.matched[a.matched.length - 1]?.redirect;
530
- if (typeof A == "string") {
531
- a = c.resolve(A);
529
+ const N = a.matched[a.matched.length - 1]?.redirect;
530
+ if (typeof N == "string") {
531
+ a = c.resolve(N);
532
532
  continue;
533
533
  }
534
- if (A && typeof A == "object") {
535
- a = c.resolve(A);
534
+ if (N && typeof N == "object") {
535
+ a = c.resolve(N);
536
536
  continue;
537
537
  }
538
538
  return a;
@@ -546,11 +546,11 @@ const yt = {
546
546
  if (M.value) return;
547
547
  await fe() && await E(q());
548
548
  }
549
- function u() {
549
+ function r() {
550
550
  window.location.reload();
551
551
  }
552
552
  function y(a) {
553
- a.persisted && (kt(), B(q()));
553
+ a.persisted && (yt(), U(q()));
554
554
  }
555
555
  let P;
556
556
  return X(() => {
@@ -559,35 +559,35 @@ const yt = {
559
559
  });
560
560
  }), Y(() => {
561
561
  window.removeEventListener("pageshow", y), P?.(), ie(null);
562
- }), (a, f) => !d(k) && !M.value ? (t(), l("div", yt, [
562
+ }), (a, f) => !d(k) && !M.value ? (t(), l("div", wt, [
563
563
  f[5] || (f[5] = e("p", { class: "labull-gate__title" }, "正在确认登录状态…", -1)),
564
- d(C) ? (t(), l("p", wt, [
565
- d(i) ? (t(), l(T, { key: 0 }, [
564
+ d(C) ? (t(), l("p", $t, [
565
+ d(u) ? (t(), l(T, { key: 0 }, [
566
566
  W("连不上后端(等了 " + w(Math.round(d(Se) / 1e3)) + " 秒也没有回音)。确认后端起来之后 ", 1),
567
567
  e("button", {
568
568
  class: "labull-gate__link",
569
569
  type: "button",
570
- onClick: u
570
+ onClick: r
571
571
  }, "重试"),
572
572
  f[1] || (f[1] = W(",或者", -1)),
573
573
  e("a", {
574
574
  class: "labull-gate__link",
575
575
  href: K.value
576
- }, "直接去登录", 8, $t),
576
+ }, "直接去登录", 8, gt),
577
577
  f[2] || (f[2] = W("。", -1))
578
578
  ], 64)) : (t(), l(T, { key: 1 }, [
579
579
  f[3] || (f[3] = W("没有登录(或会话已失效),正在跳登录页 —— 没跳过去就", -1)),
580
580
  e("a", {
581
581
  class: "labull-gate__link",
582
582
  href: K.value
583
- }, "点这里登录", 8, gt),
583
+ }, "点这里登录", 8, Ct),
584
584
  f[4] || (f[4] = W("。", -1))
585
585
  ], 64))
586
586
  ])) : _("", !0)
587
- ])) : (t(), l("div", Ct, [
588
- a.$slots.bar ? (t(), l("div", Pt, [
587
+ ])) : (t(), l("div", Pt, [
588
+ a.$slots.bar ? (t(), l("div", xt, [
589
589
  Z(a.$slots, "bar", {}, void 0, !0)
590
- ])) : a.$slots.appbar || n.logo || n.caption || a.$slots.actions || n.actions ? (t(), l("header", xt, [
590
+ ])) : a.$slots.appbar || n.logo || n.caption || a.$slots.actions || n.actions ? (t(), l("header", Lt, [
591
591
  d(o) && G.value ? (t(), l("button", {
592
592
  key: 0,
593
593
  class: "labull-topbar__nav",
@@ -595,49 +595,49 @@ const yt = {
595
595
  "aria-label": "打开导航",
596
596
  "aria-expanded": d(g),
597
597
  onClick: f[0] || (f[0] = //@ts-ignore
598
- (...N) => d(L) && d(L)(...N))
598
+ (...A) => d(L) && d(L)(...A))
599
599
  }, [...f[6] || (f[6] = [
600
600
  e("i", { class: "pi pi-bars" }, null, -1)
601
- ])], 8, Lt)) : _("", !0),
602
- e("div", Et, [
601
+ ])], 8, Et)) : _("", !0),
602
+ e("div", Tt, [
603
603
  n.logo ? (t(), l("img", {
604
604
  key: 0,
605
605
  class: "labull-topbar__logo",
606
606
  src: n.logo,
607
607
  alt: ""
608
- }, null, 8, Tt)) : _("", !0),
609
- n.caption ? (t(), l("span", St, w(n.caption), 1)) : _("", !0),
608
+ }, null, 8, St)) : _("", !0),
609
+ n.caption ? (t(), l("span", Mt, w(n.caption), 1)) : _("", !0),
610
610
  Z(a.$slots, "appbar", {}, void 0, !0)
611
611
  ]),
612
- n.actions || a.$slots.actions ? (t(), l("div", Mt, [
612
+ n.actions || a.$slots.actions ? (t(), l("div", It, [
613
613
  Z(a.$slots, "actions", {}, void 0, !0),
614
614
  n.actions ? (t(), l(T, { key: 0 }, [
615
615
  F(de),
616
- F(he)
616
+ F(pe)
617
617
  ], 64)) : _("", !0)
618
618
  ])) : _("", !0)
619
619
  ])) : _("", !0),
620
- e("div", It, [
620
+ e("div", Ot, [
621
621
  n.side && n.side.length > 0 ? (t(), ue(ve, {
622
622
  key: 0,
623
623
  items: n.side,
624
624
  home: n.home,
625
625
  brand: n.brand
626
626
  }, null, 8, ["items", "home", "brand"])) : _("", !0),
627
- e("div", Ot, [
627
+ e("div", At, [
628
628
  F(be, { home: n.home }, null, 8, ["home"]),
629
629
  e("main", Nt, [
630
- I.value ? (t(), l("div", At, [
630
+ I.value ? (t(), l("div", Bt, [
631
631
  F(d($e))
632
632
  ])) : _("", !0),
633
633
  te(e("div", Ut, [
634
- (t(!0), l(T, null, D(d(p), (N) => te((t(), l("div", {
635
- key: N.key,
634
+ (t(!0), l(T, null, D(d(h), (A) => te((t(), l("div", {
635
+ key: A.key,
636
636
  class: "labull-tabpage"
637
637
  }, [
638
- F(ut, { tab: N }, null, 8, ["tab"])
638
+ F(rt, { tab: A }, null, 8, ["tab"])
639
639
  ])), [
640
- [oe, N.key === d(h)]
640
+ [oe, A.key === d(p)]
641
641
  ])), 128))
642
642
  ], 512), [
643
643
  [oe, !I.value]
@@ -647,21 +647,22 @@ const yt = {
647
647
  ])
648
648
  ]));
649
649
  }
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);
650
+ }), Vt = /* @__PURE__ */ J(Kt, [["__scopeId", "data-v-06035587"]]), Dt = { ProductShell: Vt, ProductSide: ve, ProductTabs: be, AppSearch: de, UserMenu: pe };
651
+ function Gt(n, i = {}) {
652
+ Me(i.apiBase);
653
+ for (const [c, h] of Object.entries(Dt)) n.component(c, h);
653
654
  const m = n.config.globalProperties.$router;
654
655
  m ? m.beforeEach(async (c) => c.path === "/login" ? !0 : await fe()) : console.warn("[labull] 没拿到 router:把 app.use(labull) 放到 app.use(router) 之后。");
655
- for (const c of r.extra ?? []) n.use(c);
656
+ for (const c of i.extra ?? []) n.use(c);
656
657
  }
657
- const zt = { install: (n) => Dt(n) };
658
+ const Ft = { install: (n, i) => Gt(n, i ?? {}) };
658
659
  export {
659
660
  de as A,
660
- Kt as P,
661
- he as U,
662
- ut as _,
661
+ Vt as P,
662
+ pe as U,
663
+ rt as _,
663
664
  ve as a,
664
665
  be as b,
665
- Dt as i,
666
- zt as l
666
+ Gt as i,
667
+ Ft as l
667
668
  };