x-essential-lib 0.9.27 → 0.9.28

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.
package/dist/index.js CHANGED
@@ -334,37 +334,42 @@ function isHasAccessToken() {
334
334
  function isHasActiveOrg() {
335
335
  return !!api.get("activeOrg");
336
336
  }
337
- function onBeforeEach(e, T, E, D) {
338
- let O = isHasAccessToken(), k = isHasActiveOrg(), A = matchRouteMeta(e.path);
339
- if (!A) {
340
- console.assert(!1), E();
337
+ function onBeforeEach(e, T, E) {
338
+ let D = isHasAccessToken(), O = isHasActiveOrg(), k = matchRouteMeta(e.path);
339
+ if (!k) throw Error("to route meta invalid");
340
+ if (k.requiredState === "auth") if (D) if (O) {
341
+ let e = "/main";
342
+ return onBeforeChange(e, T.path, E), { path: e };
343
+ } else {
344
+ onBeforeChange(e.path, T.path, E);
341
345
  return;
342
346
  }
343
- if (A.requiredState === "auth") if (O) if (k) {
344
- let e = "/main";
345
- onBeforeChange(e, T.path, D), E({ path: e });
346
- } else onBeforeChange(e.path, T.path, D), E();
347
347
  else {
348
348
  let e = "/passport/login";
349
- onBeforeChange(e, T.path, D), E({ path: e });
349
+ return onBeforeChange(e, T.path, E), { path: e };
350
350
  }
351
- else if (A.requiredState === "org") if (O) if (k) onBeforeChange(e.path, T.path, D), E();
352
- else {
351
+ else if (k.requiredState === "org") if (D) if (O) {
352
+ onBeforeChange(e.path, T.path, E);
353
+ return;
354
+ } else {
353
355
  let e = "/org/joinOrCreate";
354
- onBeforeChange(e, T.path, D), E({ path: e });
356
+ return onBeforeChange(e, T.path, E), { path: e };
355
357
  }
356
358
  else {
357
359
  let e = "/passport/login";
358
- onBeforeChange(e, T.path, D), E({ path: e });
360
+ return onBeforeChange(e, T.path, E), { path: e };
359
361
  }
360
- else if (O) if (k) {
362
+ else if (D) if (O) {
361
363
  let e = "/main";
362
- onBeforeChange(e, T.path, D), E({ path: e });
364
+ return onBeforeChange(e, T.path, E), { path: e };
363
365
  } else {
364
366
  let e = "/org/joinOrCreate";
365
- onBeforeChange(e, T.path, D), E({ path: e });
367
+ return onBeforeChange(e, T.path, E), { path: e };
368
+ }
369
+ else {
370
+ onBeforeChange(e.path, T.path, E);
371
+ return;
366
372
  }
367
- else onBeforeChange(e.path, T.path, D), E();
368
373
  }
369
374
  const types = [
370
375
  "string",
@@ -479,7 +484,7 @@ function useSystem() {
479
484
  return {
480
485
  sysBarAvail: E,
481
486
  compactWidth: computed(() => O.width.value <= 1280 ? O.width.value + "px" : O.width.value <= 1920 ? "768px" : "1024px"),
482
- isCurvedScreen: computed(() => O.xs.value),
487
+ isCurvedScreen: computed(() => !1),
483
488
  isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
484
489
  nameList: (E, D) => {
485
490
  let O, k = E.map((e) => T(e));
@@ -1,4 +1,4 @@
1
- import { RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
1
+ import { RouteLocationNormalized } from 'vue-router';
2
2
  interface RouteMeta {
3
3
  app: 'x-app-mf' | 'x-compute-mf' | 'x-data-mf' | 'x-main-mf' | 'x-mine-mf' | 'x-org-mf' | 'x-passport-mf' | 'x-resource-mf';
4
4
  path: string;
@@ -8,5 +8,7 @@ interface RouteMeta {
8
8
  }
9
9
  export declare function matchRouteMeta(path: string): RouteMeta | undefined;
10
10
  export declare const routeTransName: import("vue").Ref<string, string>;
11
- export declare function onBeforeEach(to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext, lastAppPath: string): void;
11
+ export declare function onBeforeEach(to: RouteLocationNormalized, from: RouteLocationNormalized, lastAppPath: string): {
12
+ path: string;
13
+ } | undefined;
12
14
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
3
  "private": false,
4
- "version": "0.9.27",
4
+ "version": "0.9.28",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",